Even More Modifiers  1.0.0.0
A mod for rolling various bonus stats on items
MissingHealthDamage.cs
Go to the documentation of this file.
1 using Loot.Api.Core;
2 using Loot.Modifiers.Base;
3 using Terraria;
4 
5 namespace Loot.Modifiers.WeaponModifiers
6 {
8  {
10  {
11  return base.GetTooltip()
12  .WithPositive($"Up to +{Properties.RoundedPower}% damage based on missing health");
13  }
14 
16  {
17  return base.GetModifierProperties(item)
18  .WithMinMagnitude(5f)
19  .WithMaxMagnitude(15f);
20  }
21 
22  public override void ModifyWeaponDamage(Item item, Player player, ref float add, ref float mult, ref float flat)
23  {
24  base.ModifyWeaponDamage(item, player, ref add, ref mult, ref flat);
25  float mag = Properties.RoundedPower * ((player.statLifeMax2 - player.statLife) / (float)player.statLifeMax2);
26  add += mag / 100;
27  }
28  }
29 }
The ModifierPropertiesBuilder implements the builder pattern for ModifierProperties It provides a str...
Defines a modifier that can roll on a weapon item You can use this class and add to CanRoll by callin...
override ModifierProperties.ModifierPropertiesBuilder GetModifierProperties(Item item)
Defines the properties of a modifier
override void ModifyWeaponDamage(Item item, Player player, ref float add, ref float mult, ref float flat)
Defines a tooltip line of a modifier A modifier can have multiple lines
override ModifierTooltipLine.ModifierTooltipBuilder GetTooltip()