private float ExecuteSkill(DamageAbility abil, ref double remainingNumOfGCD, double count) { if (remainingNumOfGCD > 0d && count > 0d) { double usedGCD = Math.Min(remainingNumOfGCD, skills[abil].GCDPercentage * count); remainingNumOfGCD -= usedGCD; return((float)(usedGCD / skills[abil].GCDPercentage)); } return(0f); }
private static (Creature c1, Creature c2) CreatureCreatures() { Creature c1 = new Creature(_DEFAULT_START_HP); Creature c2 = new Creature(_DEFAULT_START_HP); DamageAbility dmgC2 = ScriptableObject.CreateInstance <DamageAbility>(); DamageAbility dmgC1 = ScriptableObject.CreateInstance <DamageAbility>(); c1.Abilities = new Ability[] { dmgC2 }; c2.Abilities = new Ability[] { dmgC1 }; return(c1, c2); }
public double?Damage(Player player) { DamageAbility damageAbility = Weapon switch { DesertEagle desertEagle => desertEagle.Shoot, Katana katana => katana.Cut, _ => default }; var damage = player.Health - damageAbility?.Invoke(player); if (player.Health <= 0) { player.Alive = false; } return(damage); }
private float ExecuteSkill(DamageAbility abil, double fightlength, ref double remainingNumOfGCD) { return(ExecuteSkill(abil, ref remainingNumOfGCD, fightlength / skills[abil].CooldownWithLatency)); }
private float ExecuteSkill(DamageAbility abil, ref double remainingNumOfGCD, double count) { if (remainingNumOfGCD > 0d && count > 0d) { double usedGCD = Math.Min(remainingNumOfGCD, skills[abil].GCDPercentage * count); remainingNumOfGCD -= usedGCD; return (float)(usedGCD / skills[abil].GCDPercentage); } return 0f; }
private float ExecuteSkill(DamageAbility abil, double fightlength, ref double remainingNumOfGCD) { return ExecuteSkill(abil, ref remainingNumOfGCD, fightlength / skills[abil].CooldownWithLatency); }