public override bool IsAllowedForSquadBuilderPostCheck(RosterBuilder.SquadBuilderUpgrade upgradeHolder) { int sameUpgradesInstalled = 0; List <RosterBuilder.SquadBuilderShip> playerShips = RosterBuilder.SquadBuilderRoster.GetShipsByPlayer(upgradeHolder.Host.Player); foreach (var ship in playerShips) { foreach (var squadBuilderUpgrade in ship.GetUpgrades()) { if (squadBuilderUpgrade.Slot.InstalledUpgrade != null) { if (squadBuilderUpgrade.Slot.InstalledUpgrade.GetType() == this.GetType()) { sameUpgradesInstalled++; } } } } ; if (sameUpgradesInstalled > 2) { Messages.ShowError("Cannot have more than 2 Attanni Mindlinks"); } return(sameUpgradesInstalled < 3); }
public override bool IsAllowedForSquadBuilderPostCheck(RosterBuilder.SquadBuilderUpgrade upgradeHolder) { bool result = false; if (RosterBuilder.SquadBuilderRoster.playerFactions[upgradeHolder.Host.Player] == Faction.Scum) { result = true; } if (RosterBuilder.SquadBuilderRoster.playerFactions[upgradeHolder.Host.Player] == Faction.Rebel) { List <RosterBuilder.SquadBuilderShip> playerShips = RosterBuilder.SquadBuilderRoster.GetShipsByPlayer(upgradeHolder.Host.Player); foreach (var shipHolder in playerShips) { if (shipHolder.Ship.PilotName == "Ezra Bridger") { return(true); } foreach (var anotherUpgradeHolder in shipHolder.GetUpgrades()) { if (anotherUpgradeHolder.Slot.InstalledUpgrade != null && anotherUpgradeHolder.Slot.InstalledUpgrade.Name == "Ezra Bridger") { return(true); } } } if (result != true) { Messages.ShowError("Maul cannot be in Rebel squad without Ezra Bridger"); } } return(result); }
public virtual bool IsAllowedForSquadBuilderPostCheck(RosterBuilder.SquadBuilderUpgrade upgradeHolder) { return(true); }