9 namespace Loot.Modifiers.WeaponModifiers
26 Item checkItem = Main.mouseItem != null && !Main.mouseItem.IsAir ? Main.mouseItem : player.HeldItem;
28 if (checkItem == null || checkItem.IsAir || !checkItem.IsWeapon()
35 DelegatorPlayer.GetEffect<
CursedEffect>().CurseCount += c;
45 if (CurseCount <= 0 || player.buffImmune[BuffID.Cursed])
48 if (player.lifeRegen > 0)
53 player.lifeRegen -= 2 * CurseCount;
54 player.lifeRegenTime = 0;
63 return base.GetTooltip()
64 .WithPositive($
"+{Properties.RoundedPower}% damage, but you are cursed while holding this item");
69 return base.GetModifierProperties(item)
71 .WithMaxMagnitude(15f)
72 .IsUniqueModifier(
true);
80 public override void ModifyWeaponDamage(Item item, Player player, ref
float add, ref
float mult, ref
float flat)
82 base.ModifyWeaponDamage(item, player, ref add, ref mult, ref flat);
83 add += Properties.RoundedPower / 100f;
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...
This attribute may be used to skip usage of AttachDelegations and DetachDelegations Which is a cumber...
A ModifierEffect signifies the effect of a modifier on a player It should house the implementation...
override ModifierProperties.ModifierPropertiesBuilder GetModifierProperties(Item item)
ModifierContextMethod
Defines a method for a context in which a Modifier might be rolled Used in ModifierContext ...
Defines an item that may be modified by modifiers from mods
override void ModifyWeaponDamage(Item item, Player player, ref float add, ref float mult, ref float flat)
Defines a modifier that can roll on a weapon item You can use this class and add to CanRoll by callin...
static List< Modifier > GetActivePool(Item item)
Defines the properties of a modifier
static LootModItem GetInfo(Item item)
DelegationTarget
Defines a target that can be used in conjunction with AutoDelegation for identifying the target event...
ModifierContextMethod Method
override ModifierTooltipLine.ModifierTooltipBuilder GetTooltip()
bool IsActivated
Keeps track of if the particular item was activated ('delegated') Specific usecase see CursedEffect a...
override bool CanRoll(ModifierContext ctx)
If this Modifier can roll at all in the given context Properties are available here, apart from magnitude and power
override void ResetEffects()
Automatically called when the ModPlayer does its ResetEffects Also automatically called when the dele...