public override void UpdateAccessory(Player player, bool hideVisual) { var modPlayer = ExampleDamagePlayer.ModPlayer(player); modPlayer.exampleResourceMax2 += 50; // add 50 to the exampleResourceMax2, which is our max for example resource. modPlayer.exampleResourceRegenRate -= 0.5f; // subtract 0.5f from the resourceRegenRate, halving the speed it takes for it to regen once. }
public override void UpdateAccessory(Player player, bool hideVisual) { ExampleDamagePlayer modPlayer = ExampleDamagePlayer.ModPlayer(player); modPlayer.exampleDamage += 0.2f; modPlayer.exampleCrit += 15; modPlayer.exampleKnockback += 10; }
public override void UpdateAccessory(Player player, bool hideVisual) { ExampleDamagePlayer modPlayer = ExampleDamagePlayer.ModPlayer(player); modPlayer.exampleDamageAdd += 0.2f; // add 20% to the additive bonus modPlayer.exampleDamageMult *= 1.2f; // add 20% to the multiplicative bonus modPlayer.exampleCrit += 15; // add 15% crit modPlayer.exampleKnockback += 5; // add 5 knockback }
public override void GetWeaponCrit(Player player, ref int crit) { // Adds crit bonuses crit += ExampleDamagePlayer.ModPlayer(player).exampleCrit; }
public override void GetWeaponKnockback(Player player, ref float knockback) { // Adds knockback bonuses knockback += ExampleDamagePlayer.ModPlayer(player).exampleKnockback; }
// As a modder, you could also opt to make these overrides also sealed. Up to the modder public override void ModifyWeaponDamage(Player player, ref float add, ref float mult) { add += ExampleDamagePlayer.ModPlayer(player).exampleDamageAdd; mult *= ExampleDamagePlayer.ModPlayer(player).exampleDamageMult; }
// As a modder, you could also opt to make the Get overrides also sealed. Up to the modder public override void GetWeaponDamage(Player player, ref int damage) { // Multiplies the damage by our custom damage multiplier damage = (int)(damage * ExampleDamagePlayer.ModPlayer(player).exampleDamage + 5E-06f); }