9 namespace Loot.Modifiers.EquipModifiers.Defensive
22 private bool ManaBlock(
bool pvp,
bool quiet, ref
int damage, ref
int hitDirection, ref
bool crit, ref
bool customDamage, ref
bool playSound, ref
bool genGore, ref PlayerDeathReason damageSource)
26 int manaBlock = (int) Math.Ceiling(damage * ManaShield) * 2;
27 if (manaBlock > 0 && player.statMana > 0)
30 if (manaBlock > player.statMana)
32 manaBlock = player.statMana;
35 damage -= manaBlock / 2;
36 player.statMana -= manaBlock;
37 player.manaRegenDelay = Math.Max(player.manaRegenDelay, 120);
49 return base.GetTooltip()
50 .WithPositive($
"+{Properties.RoundedPower}% of damage taken is redirected to mana");
55 return base.GetModifierProperties(item)
57 .WithRollChance(0.75f);
ModifierEffect GetEffect(Type type)
The ModifierPropertiesBuilder implements the builder pattern for ModifierProperties It provides a str...
bool ManaBlock(bool pvp, bool quiet, ref int damage, ref int hitDirection, ref bool crit, ref bool customDamage, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
This attribute may be used to skip usage of AttachDelegations and DetachDelegations Which is a cumber...
override void UpdateEquip(Item item, Player player)
A ModifierEffect signifies the effect of a modifier on a player It should house the implementation...
Defines a modifier that can roll on an equip item (armor or accessory) These modifiers will have 60% ...
override ModifierTooltipLine.ModifierTooltipBuilder GetTooltip()
DelegationPrioritization
Specify when you want your delegation to happen in the chain
static ModifierDelegatorPlayer GetPlayer(Player player)
Defines the properties of a modifier
override void ResetEffects()
Automatically called when the ModPlayer does its ResetEffects Also automatically called when the dele...
override ModifierProperties.ModifierPropertiesBuilder GetModifierProperties(Item item)
Holds player-entity data and handles it