示例#1
0
 private static bool DirectPhase(
     Dictionary <FleetInfo, List <ShipCombatInfo> > shipCombatInfo,
     float damageMultiplier = 1f)
 {
     foreach (KeyValuePair <FleetInfo, List <ShipCombatInfo> > keyValuePair in shipCombatInfo)
     {
         ShipCombatInfo targetShip = CombatSimulator.SelectTargetShip(keyValuePair.Key, shipCombatInfo);
         if (targetShip != null)
         {
             foreach (ShipCombatInfo shipCombatInfo1 in keyValuePair.Value)
             {
                 if (!shipCombatInfo1.shipDead)
                 {
                     if ((double)targetShip.structureFactor <= 0.0)
                     {
                         targetShip = CombatSimulator.SelectTargetShip(keyValuePair.Key, shipCombatInfo);
                         if (targetShip == null)
                         {
                             break;
                         }
                     }
                     float damage = (float)((double)shipCombatInfo1.directFireFactor * (0.5 + CombatSimulator._rand.NextDouble() * 1.5) * (double)damageMultiplier * (1.0 + (double)shipCombatInfo1.battleRiders * 0.150000005960464) * (1.0 + (double)shipCombatInfo1.drones * 0.0500000007450581));
                     CombatSimulator.ApplyShipDamage(targetShip, damage);
                 }
             }
         }
     }
     CombatSimulator.ApplyDeaths(shipCombatInfo);
     return(true);
 }
示例#2
0
 private static bool TrackingPhase(
     Dictionary <FleetInfo, List <ShipCombatInfo> > shipCombatInfo,
     float damageMultiplier = 1f)
 {
     foreach (KeyValuePair <FleetInfo, List <ShipCombatInfo> > keyValuePair in shipCombatInfo)
     {
         ShipCombatInfo targetShip = CombatSimulator.SelectTargetShip(keyValuePair.Key, shipCombatInfo);
         if (targetShip != null)
         {
             foreach (ShipCombatInfo shipCombatInfo1 in keyValuePair.Value)
             {
                 if (!shipCombatInfo1.shipDead)
                 {
                     if ((double)targetShip.structureFactor <= 0.0)
                     {
                         targetShip = CombatSimulator.SelectTargetShip(keyValuePair.Key, shipCombatInfo);
                     }
                     if (targetShip != null)
                     {
                         float damage = shipCombatInfo1.trackingFireFactor * (float)(0.75 + CombatSimulator._rand.NextDouble() * 1.25) * damageMultiplier - targetShip.pdFactor;
                         CombatSimulator.ApplyShipDamage(targetShip, damage);
                     }
                     else
                     {
                         break;
                     }
                 }
             }
         }
     }
     CombatSimulator.ApplyDeaths(shipCombatInfo);
     return(true);
 }