Ejemplo n.º 1
0
        public double GetEffectiveShipIpBonus(Faction attacker)
        {
            double planetDropshipDefs = (PlanetStructures.Where(x => x.IsActive).Sum(x => x.StructureType.EffectDropshipDefense) ?? 0);
            int    dropshipsSent      = (PlanetFactions.Where(x => x.Faction == attacker).Sum(x => (int?)x.Dropships) ?? 0);

            return(Math.Max(0, (dropshipsSent - planetDropshipDefs)) * GlobalConst.InfluencePerShip);
        }
Ejemplo n.º 2
0
 public bool CanMatchMakerPlay(Faction attacker)
 {
     if (CanDropshipsAttack(attacker) ||
         PlanetFactions.Where(x => x.FactionID == attacker.FactionID).Sum(y => y.Dropships) >
         PlanetStructures.Where(x => x.IsActive).Sum(y => y.StructureType.EffectDropshipDefense))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 3
0
 public double GetEffectiveIpDefense()
 {
     return(PlanetStructures.Where(x => x.IsActive).Sum(x => x.StructureType.EffectReduceBattleInfluenceGain) ?? 0);
 }