HandleEvent(BeginTurn) 'SomeEvent' post {
location_t tmpLoc;
city_t tmpCity;
if (g.year == 100) { // in turn 100
Message(1, 'TestMessage'); // display a message for player 1 (normally the human player)
}
if (g.year == 25) { // in turn 25
GetCityByIndex(1, 0, tmpCity); // store oldest city of player 1 in tmpCity variable
// give player 0 (=barbarian) a warrior on a random tile 1 squares away from the oldest city of player 1:
CreateUnit(1, UnitDB(UNIT_WARRIOR), tmpCity.location, 0);
// give player 1 a warrior in his oldest city (random tile 0 squares away from oldest city == city itself):
CreateUnit(0, UnitDB(UNIT_WARRIOR), tmpCity.location, 1);
}
if (g.year == 125) { // in turn 125
MakeLocation(tmpLoc, 25, 40); // store location (25, 40) in variable tmpLoc
// give player 3 a hoplite on location (25, 40):
CreateUnit(3, UnitDB(UNIT_HOPLITE), tmpLoc, 0);
}
}
Message 'TestMessage' {
Text(ID_TEST_MESSAGE); // displays text TEST_MESSAGE (must be defined in text files) in a message
} |