Even More Modifiers  1.0.0.0
A mod for rolling various bonus stats on items
VelocityDamage.cs
Go to the documentation of this file.
1 using System;
2 using Loot.Api.Core;
3 using Loot.Modifiers.Base;
4 using Terraria;
5 
6 namespace Loot.Modifiers.WeaponModifiers
7 {
9  {
11  {
12  return base.GetTooltip()
13  .WithPositive($"Added damage based on player's velocity (multiplier: {Math.Round(Properties.RoundedPower / 2, 1)}x)");
14  }
15 
17  {
18  return base.GetModifierProperties(item)
19  .WithMaxMagnitude(2)
20  .WithRoundPrecision(1);
21  }
22 
23  public override void ModifyWeaponDamage(Item item, Player player, ref float add, ref float mult, ref float flat)
24  {
25  base.ModifyWeaponDamage(item, player, ref add, ref mult, ref flat);
26  float magnitude = Properties.RoundedPower * player.velocity.Length() / 4;
27  add += magnitude / 100;
28  }
29  }
30 }
override ModifierTooltipLine.ModifierTooltipBuilder GetTooltip()
override void ModifyWeaponDamage(Item item, Player player, ref float add, ref float mult, ref float flat)
The ModifierPropertiesBuilder implements the builder pattern for ModifierProperties It provides a str...
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