Ejemplo n.º 1
0
 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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 private float ExecuteSkill(DamageAbility abil, double fightlength, ref double remainingNumOfGCD)
 {
     return(ExecuteSkill(abil, ref remainingNumOfGCD, fightlength / skills[abil].CooldownWithLatency));
 }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
 private float ExecuteSkill(DamageAbility abil, double fightlength, ref double remainingNumOfGCD)
 {
     return ExecuteSkill(abil, ref remainingNumOfGCD, fightlength / skills[abil].CooldownWithLatency);
 }