9 namespace Loot.Modifiers.EquipModifiers.Defensive
14 public static readonly
float MAX_SURVIVAL_CHANCE = 0.5f;
23 private bool SurviveEvent(
double damage,
int hitDirection,
bool pvp, ref
bool playSound, ref
bool genGore, ref PlayerDeathReason damageSource)
25 if (Main.rand.NextFloat() < Math.Min(SurvivalChance, MAX_SURVIVAL_CHANCE))
41 return base.GetTooltip()
42 .WithPositive($
"+{Properties.RoundedPower}% chance to survive lethal blows" 43 + $
"{(Main.LocalPlayer.GetModPlayer<ModifierDelegatorPlayer>().GetEffect<SurvivalEffect>().SurvivalChance >= SurvivalEffect.MAX_SURVIVAL_CHANCE ? $" (cap reached: {
SurvivalEffect.
MAX_SURVIVAL_CHANCE * 100f}%)
" : "")}" 49 return base.GetModifierProperties(item)
51 .WithRollChance(0.333f);
bool SurviveEvent(double damage, int hitDirection, bool pvp, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
ModifierEffect GetEffect(Type type)
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...
Defines a modifier that can roll on an equip item (armor or accessory) These modifiers will have 60% ...
static readonly float MAX_SURVIVAL_CHANCE
DelegationPrioritization
Specify when you want your delegation to happen in the chain
static ModifierDelegatorPlayer GetPlayer(Player player)
override ModifierProperties.ModifierPropertiesBuilder GetModifierProperties(Item item)
Defines the properties of a modifier
override void UpdateEquip(Item item, Player player)
override void ResetEffects()
Automatically called when the ModPlayer does its ResetEffects Also automatically called when the dele...
override ModifierTooltipLine.ModifierTooltipBuilder GetTooltip()
Holds player-entity data and handles it