Exemple #1
0
int Hex::GetPinnage(const Team& team) const
{
    int nPinnage = 0;
    for (auto& fleet : m_fleets)
    {
        if (fleet.FindSquadron(ShipType::GCDS))
            return 1000;
        if (!(Race(team.GetRace()).IsAncientsAlly() && fleet.GetColour() == Colour::None))
            nPinnage += (fleet.GetColour() == team.GetColour() ? -1 : 1) * fleet.GetShipCount();
    }
    return nPinnage;
}
Exemple #2
0
void TeamState::Init(const Team& team, const MapPos& pos, int rotation, Map& map, const std::vector<int>& repTiles)
{
	Race race(team.GetRace());

	m_storage = race.GetStartStorage();
	m_infTrack.AddDiscs(race.GetStartInfluenceDiscs());

	for (TechType t : race.GetStartTechnologies())
		m_techTrack.Add(t);

	for (int i : repTiles)
		m_repTrack.AddReputationTile(i);

	for (auto shipType : PlayerShipTypesRange())
		m_blueprints[(int)shipType].reset(new Blueprint(team.GetRace(), shipType));

	AddShips(ShipType::Interceptor, 8);
	AddShips(ShipType::Cruiser, 4);
	AddShips(ShipType::Dreadnought, 2);
	AddShips(ShipType::Starbase, 4);

	InitHex(team, pos, rotation, map);
}
Exemple #3
0
void TeamState::InitHex(const Team& team, const MapPos& pos, int rotation, Map& map)
{
	Race race(team.GetRace());

	Hex& hex = map.AddHex(HexPtr(new Hex(race.GetStartSector(team.GetColour()), pos, rotation)));
	hex.SetColour(team.GetColour());
	m_infTrack.RemoveDiscs(1);

	for (Square* pSquare : hex.GetAvailableSquares(team))
	{
		m_popTrack.Remove(SquareTypeToResource(pSquare->GetType()), 1);
		pSquare->SetOccupied(true);
	}

	ShipType ship = race.GetStartShip();
	hex.AddShip(ship, team.GetColour());
	RemoveShips(ship, 1);
}