Even More Modifiers  1.0.0.0
A mod for rolling various bonus stats on items
VelocityPlus.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 {
7  public class VelocityPlus : WeaponModifier
8  {
10  {
11  return base.GetTooltip()
12  .WithPositive($"+{Properties.RoundedPower}% projectile velocity");
13  }
14 
16  {
17  return base.GetModifierProperties(item)
18  .WithMinMagnitude(5f)
19  .WithMaxMagnitude(10f)
20  .WithRoundPrecision(1);
21  }
22 
23  public override bool CanRoll(ModifierContext ctx)
24  => base.CanRoll(ctx) && ctx.Item.shoot > 0 && ctx.Item.shootSpeed > 0;
25 
26  public override void Apply(Item item)
27  {
28  base.Apply(item);
29  // TODO needs better way
30  item.shootSpeed *= Properties.RoundedPower / 100f + 1f;
31  }
32  }
33 }
Defines a context in which a Modifier might be rolled Which fields are available (not null) depends o...
The ModifierPropertiesBuilder implements the builder pattern for ModifierProperties It provides a str...
override ModifierTooltipLine.ModifierTooltipBuilder GetTooltip()
Definition: VelocityPlus.cs:9
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
override void Apply(Item item)
Allows modders to do something when this modifier is applied If a modder needs ModPlayer hooks...
Definition: VelocityPlus.cs:26
override ModifierProperties.ModifierPropertiesBuilder GetModifierProperties(Item item)
Definition: VelocityPlus.cs:15