コード例 #1
0
ファイル: RotationCalculation.cs プロジェクト: rakot/rawr
 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);
 }
コード例 #2
0
        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);
        }
コード例 #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);
        }
コード例 #4
0
ファイル: RotationCalculation.cs プロジェクト: rakot/rawr
 private float ExecuteSkill(DamageAbility abil, double fightlength, ref double remainingNumOfGCD)
 {
     return(ExecuteSkill(abil, ref remainingNumOfGCD, fightlength / skills[abil].CooldownWithLatency));
 }
コード例 #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;
 }
コード例 #6
0
 private float ExecuteSkill(DamageAbility abil, double fightlength, ref double remainingNumOfGCD)
 {
     return ExecuteSkill(abil, ref remainingNumOfGCD, fightlength / skills[abil].CooldownWithLatency);
 }