Even More Modifiers  1.0.0.0
A mod for rolling various bonus stats on items
KnockbackPlus.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($"+{Properties.RoundedPower}% knockback");
13  }
14 
16  {
17  return base.GetModifierProperties(item)
18  .WithMaxMagnitude(10f);
19  }
20 
21  public override bool CanRoll(ModifierContext ctx)
22  => base.CanRoll(ctx) && ctx.Item.knockBack > 0;
23 
24  public override void GetWeaponKnockback(Item item, Player player, ref float knockback)
25  {
26  base.GetWeaponKnockback(item, player, ref knockback);
27  knockback *= Properties.RoundedPower / 100f + 1;
28  }
29  }
30 }
Defines a context in which a Modifier might be rolled Which fields are available (not null) depends o...
override ModifierTooltipLine.ModifierTooltipBuilder GetTooltip()
Definition: KnockbackPlus.cs:9
The ModifierPropertiesBuilder implements the builder pattern for ModifierProperties It provides a str...
override void GetWeaponKnockback(Item item, Player player, ref float knockback)
override ModifierProperties.ModifierPropertiesBuilder GetModifierProperties(Item item)
Defines a modifier that can roll on a weapon item You can use this class and add to CanRoll by callin...
Defines the properties of a modifier
Defines a tooltip line of a modifier A modifier can have multiple lines