Even More Modifiers  1.0.0.0
A mod for rolling various bonus stats on items
SpeedPlus.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 SpeedPlus : WeaponModifier
8  {
10  {
11  return base.GetTooltip()
12  .WithPositive($"+{Properties.RoundedPower}% use speed");
13  }
14 
16  {
17  return base.GetModifierProperties(item)
18  .WithBasePower(1 / 5f)
19  .WithMaxMagnitude(25f);
20  }
21 
22  public override void Apply(Item item)
23  {
24  base.Apply(item);
25 
26  item.useTime = (int) (item.useTime * (1 - Properties.RoundedPower / 100f));
27  item.useAnimation = (int) (item.useAnimation * (1 - Properties.RoundedPower / 100f));
28 
29  // Don't go below the minimum
30  if (item.useTime < 2)
31  {
32  item.useTime = 2;
33  }
34 
35  if (item.useAnimation < 2)
36  {
37  item.useAnimation = 2;
38  }
39  }
40 
41  /*public override float UseTimeMultiplier(Item item, Player player)
42  {
43  return 1 - Properties.RoundedPower / 100;
44  }*/
45  }
46 }
The ModifierPropertiesBuilder implements the builder pattern for ModifierProperties It provides a str...
override ModifierProperties.ModifierPropertiesBuilder GetModifierProperties(Item item)
Definition: SpeedPlus.cs:15
override void Apply(Item item)
Allows modders to do something when this modifier is applied If a modder needs ModPlayer hooks...
Definition: SpeedPlus.cs:22
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 ModifierTooltipLine.ModifierTooltipBuilder GetTooltip()
Definition: SpeedPlus.cs:9