public bool CheckWarpAttack(Faction attacker, Func <TreatyEffectType, bool> preventingTreaty) { if (!Galaxy.IsDefault) { return(false); // no exo-galaxy strikes } if (OwnerFactionID == attacker.FactionID || attacker.GaveTreatyRight(this, preventingTreaty)) { return(false); // attacker allied cannot strike } if (PlanetStructures.Any(x => x.IsActive && x.StructureType.EffectBlocksJumpgate == true)) { return(false); // inhibitor active } return(true); }
public bool CanFirePlanetBuster(Faction attacker) { if (!Galaxy.IsDefault) { return(false); // no exo-galaxy strikes } if (OwnerFactionID == attacker.FactionID || attacker.GaveTreatyRight(this, x => x.EffectPreventBomberAttack == true)) { return(false); // attacker allied cannot strike } if (PlanetStructures.Any(x => x.StructureType.EffectIsVictoryPlanet == true || x.StructureType.OwnerChangeWinsGame)) { return(false); // artefact protects planet } return(true); }