コード例 #1
0
        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.
        }
コード例 #2
0
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            ExampleDamagePlayer modPlayer = ExampleDamagePlayer.ModPlayer(player);

            modPlayer.exampleDamage    += 0.2f;
            modPlayer.exampleCrit      += 15;
            modPlayer.exampleKnockback += 10;
        }
コード例 #3
0
        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
        }
コード例 #4
0
 public override void GetWeaponCrit(Player player, ref int crit)
 {
     // Adds crit bonuses
     crit += ExampleDamagePlayer.ModPlayer(player).exampleCrit;
 }
コード例 #5
0
 public override void GetWeaponKnockback(Player player, ref float knockback)
 {
     // Adds knockback bonuses
     knockback += ExampleDamagePlayer.ModPlayer(player).exampleKnockback;
 }
コード例 #6
0
 // 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;
 }
コード例 #7
0
 // 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);
 }