Beispiel #1
0
 private void ECTorpedoAttack(sortie_battle.torpedo api)
 {
     if (api == null)
     {
         return;
     }
     AllFriends.ZipEach(api.api_fdam.Skip(1), Delegates.SetDamage);
     AllEnemies.ZipEach(api.api_edam.Skip(1), Delegates.SetDamage);
     AllFriends.ZipEach(api.api_fydam.Skip(1), Delegates.SetGiveDamage);
     AllEnemies.ZipEach(api.api_eydam.Skip(1), Delegates.SetGiveDamage);
 }
Beispiel #2
0
 private void TorpedoAttack(sortie_battle.torpedo api)
 {
     if (api == null)
     {
         return;
     }
     NightOrTorpedo.ArrayZip(api.api_fdam, 1, Delegates.SetDamage);
     EnemyFleet.ArrayZip(api.api_edam, 1, Delegates.SetDamage);
     NightOrTorpedo.ArrayZip(api.api_fydam, 1, Delegates.SetGiveDamage);
     EnemyFleet.ArrayZip(api.api_eydam, 1, Delegates.SetGiveDamage);
 }
Beispiel #3
0
 private void TorpedoAttack(sortie_battle.torpedo api)
 {
     if (api == null)
     {
         return;
     }
     NightOrTorpedo.ArrayZip(api.api_fdam, 1, Delegates.SetDamage);
     AllEnemies.ZipEach(api.api_edam.Skip(1), Delegates.SetDamage);
     NightOrTorpedo.ArrayZip(api.api_fydam, 1, Delegates.SetGiveDamage);
     AllEnemies.ZipEach(api.api_eydam.Skip(1), Delegates.SetGiveDamage);
 }
Beispiel #4
0
        public ECTorpedoCombat(Battle battle, sortie_battle.torpedo api)
        {
            var result = new List <Attack>();

            for (int i = 1; i < api.api_fydam.Length; i++)
            {
                int target = api.api_frai[i];
                if (target == 0)
                {
                    continue;
                }
                var damage = Attack.ParseDamage(api.api_fydam[i]);
                result.Add(new Attack
                {
                    Friend     = FindShip(i, battle.Fleet1, battle.Fleet2),
                    Enemy      = FindShip(target, battle.EnemyFleet, battle.EnemyFleet2),
                    Direction  = true,
                    Damage     = damage.damage,
                    Shield     = damage.shield,
                    IsCritical = api.api_fcl[i] == 2
                });
            }
            for (int i = 1; i < api.api_eydam.Length; i++)
            {
                int target = api.api_erai[i];
                if (target == 0)
                {
                    continue;
                }
                var damage = Attack.ParseDamage(api.api_eydam[i]);
                result.Add(new Attack
                {
                    Friend     = FindShip(target, battle.Fleet1, battle.Fleet2),
                    Enemy      = FindShip(i, battle.EnemyFleet, battle.EnemyFleet2),
                    Direction  = false,
                    Damage     = damage.damage,
                    Shield     = damage.shield,
                    IsCritical = api.api_ecl[i] == 2
                });
            }
            ApplyAttacks(result);
        }
Beispiel #5
0
        public TorpedoCombat(sortie_battle.torpedo api, ShipInBattle[] friends, ShipInBattle[] enemies)
        {
            var result = new List <Attack>();

            for (int i = 1; i < api.api_fydam.Length; i++)
            {
                int target = api.api_frai[i];
                if (target == 0)
                {
                    continue;
                }
                var damage = Attack.ParseDamage(api.api_fydam[i]);
                result.Add(new Attack
                {
                    Friend     = friends[i - 1],
                    Enemy      = enemies[target - 1],
                    Direction  = true,
                    Damage     = damage.damage,
                    Shield     = damage.shield,
                    IsCritical = api.api_fcl[i] == 2
                });
            }
            for (int i = 1; i < api.api_eydam.Length; i++)
            {
                int target = api.api_erai[i];
                if (target == 0)
                {
                    continue;
                }
                var damage = Attack.ParseDamage(api.api_eydam[i]);
                result.Add(new Attack
                {
                    Friend     = friends[target - 1],
                    Enemy      = enemies[i - 1],
                    Direction  = false,
                    Damage     = damage.damage,
                    Shield     = damage.shield,
                    IsCritical = api.api_ecl[i] == 2
                });
            }
            ApplyAttacks(result);
        }