Adding status effects to a projectile

adding status effects to a projectile is extremely easy and all follow the same method, with the small exception of stun. First, you get your projectile, then you set whether it applies an effect with a bool to true. Finally, you specify what chance there should be for it to apply the effect. The chance should be a value less than or equal to one. 1 = 100%, 0.45 = 45%, 0.73 = 73%, etc.

Below is a list of all the possible effects:

//bleed
projectile.AppliesBleed = true;
projectile.BleedApplyChance = 0.5f;

//Charm
projectile.AppliesCharm = true;
projectile.CharmApplyChance = 0.5f;

//cheese
projectile.AppliesCheese = true;
projectile.CheeseApplyChance = 0.5f;
      
//fire
projectile.AppliesFire = true;
projectile.FireApplyChance = 0.5f; 
     
//freeze
projectile.AppliesFreeze = true;
projectile.FreezeApplyChance = 0.5f;

//poison
projectile.AppliesPoison = true;
projectile.PoisonApplyChance = 0.5f;

//stun
projectile.AppliesStun = true;
projectile.StunApplyChance = 0.5f;
projectile.AppliedStunDuration = 2f;

as you can clearly see they all function the same way, with the only exception being stun, which needs a value for how long the enemy should

Last updated