public static void Assassinate(TroopScript Assassin, TroopScript Victim) { int AssassinChance = Mathf.RoundToInt(((float)Assassin.GetEnergy()/(float)Assassin.GetMaxEnergy())*900+((float)Assassin.GetNumber()/(float)Assassin.GetmaxNumber())*100); int VictimChance = Mathf.RoundToInt(((float)Victim.GetEnergy()/(float)Victim.GetMaxEnergy())*100+((float)Victim.GetNumber()/(float)Victim.GetmaxNumber())*900); if (AssassinChance>VictimChance && Victim.boss == false) Victim.SetNumber(0); }
public static void ConvertAction(TroopScript Caster,TroopScript Target, Skill SkillUsed) { int Value = SkillUsed.EnergyCost; if (Caster.GetEnergy()>=Value){ Caster.SetEnergy(Caster.GetEnergy()-Value); Target.SetEnergy(Target.GetEnergy()+Value); if (Target.GetEnergy() > Target.GetMaxEnergy()) Target.SetEnergy(Target.GetMaxEnergy());} }