#done by Antaine with great indebtedness to Baldyr, God-Emperor, and EmperorFool
from CvPythonExtensions import *
from Popup import PyPopup
from CvEventManager import *
from PyHelpers import *
gc = CyGlobalContext()
cyGame = CyGame()
cyMap = CyMap()
pyGame = PyGame()
#units for later civ spawns
eSettler = 4
eWorker = 5
eArcher = 57
eLongbowman = 60
eMusketman = 42
eRifleman = 46
#for barbarian spawns
eGalley = 90
eViking = 36
eZulu = 38
eMongol = 68
eNative = 33
eAztec = 27
eInca = 25
eMaya = 39
#civs in the game
eCeltia = 6
eEgypt = 8
eBabylon = 3
eGreece = 13
eIndia = 16
eChina = 7
eRome = 28
ePersia = 26
eJapan = 17
eKorea = 19
eArabia = 1
eEngland = 9
eFrance = 11
eSpain = 30
eGermany = 12
eRussia = 29
eAmerica = 0
cityNameDict = {
(55, 54): "London",
(55, 53): "London",
(56, 53): "London",
(56, 54): "London",
(63, 52): "Berlin",
(62, 52): "Berlin",
(62, 53): "Berlin",
(63, 53): "Berlin",
(51, 55): "Dublin",
(51, 56): "Dublin",
(55, 58): "Edinburgh",
(54, 57): "Edinburgh",
(54, 58): "Edinburgh",
(58, 51): "Paris",
(59, 51): "Paris",
(58, 52): "Paris",
(57, 51): "Paris",
(58, 50): "Paris",
(57, 50): "Paris",
(55, 45): "Madrid",
(55, 46): "Madrid",
(54, 46): "Madrid",
(54, 45): "Madrid",
(53, 45): "Lisbon",
(53, 44): "Lisbon",
(53, 46): "Lisbon",
(61, 46): "Rome",
(62, 45): "Rome",
(62, 46): "Rome",
(61, 47): "Rome",
(60, 47): "Rome",
(67, 43): "Athens",
(66, 42): "Athens",
(67, 44): "Athens",
(66, 44): "Athens",
(68, 46): "Byzantium",
(67, 46): "Byzantium",
(69, 45): "Byzantium",
(73, 40): "Jerusalem",
(73, 41): "Jerusalem",
(72, 39): "Jerusalem",
(72, 40): "Jerusalem",
(73, 42): "Antioch",
(73, 43): "Antioch",
(68, 39): "Alexandria",
(69, 39): "Alexandria",
(67, 39): "Alexandria",
(30, 47): "New York",
(31, 47): "New York",
(29, 47): "New York",
(29, 46): "New York",
(31, 48): "Boston",
(31, 49): "Boston",
(32, 49): "Boston",
(24, 43): "New Orleans",
(23, 43): "New Orleans",
(25, 43): "New Orleans",
(24, 48): "Chicago",
(24, 47): "Chicago",
(24, 49): "Chicago",
(25, 47): "Chicago",
(12, 48): "San Francisco",
(12, 47): "San Francisco",
(12, 49): "San Francisco",
(12, 50): "Seattle",
(12, 46): "Los Angeles",
(75, 35): "Mecca",
(74, 36): "Mecca",
(75, 34): "Mecca",
(74, 37): "Mecca",
(73, 37): "Mecca",
(76, 34): "Mecca",
(68, 57): "St. Petersburg",
(67, 56): "St. Petersburg",
(66, 56): "St. Petersburg",
(68, 56): "St. Petersburg",
(68, 58): "St. Petersburg",
(67, 58): "St. Petersburg",
(71, 54): "Moscow",
(71, 53): "Moscow",
(70, 53): "Moscow",
(72, 53): "Moscow",
(72, 54): "Moscow",
(70, 54): "Moscow",
(70, 56): "Moscow",
(71, 55): "Moscow",
(72, 55): "Moscow",
(69, 52): "Kiev",
(69, 51): "Kiev",
(70, 51): "Kiev",
(70, 50): "Odessa",
(71, 50): "Odessa",
(89, 35): "Bombay",
(89, 34): "Bombay",
(88, 35): "Bombay",
(88, 36): "Bombay",
(92, 34): "Pondicherry",
(91, 34): "Pondicherry",
(91, 33): "Pondicherry",
(102, 47): "Peking",
(101, 48): "Peking",
(102, 48): "Peking",
(103, 48): "Peking",
(101, 47): "Peking",
(103, 47): "Peking",
(101, 46): "Peking",
(102, 46): "Peking",
(103, 46): "Peking",
(115, 46): "Tokyo",
(115, 45): "Tokyo",
(114, 44): "Tokyo",
(106, 43): "Shanghai",
(106, 44): "Shanghai",
(106, 45): "Shanghai",
(107, 43): "Shanghai",
(107, 42): "Shanghai",
(105, 39): "Canton",
(105, 40): "Canton",
(106, 40): "Canton",
(106, 41): "Canton",
(103, 38): "Hong Kong",
(103, 39): "Hong Kong",
(104, 39): "Hong Kong",
(102, 38): "Hong Kong",
(102, 32): "Saigon",
(103, 33): "Saigon",
(102, 33): "Saigon",
(1, 38): "Honolulu",
(3, 37): "Honolulu",
(4, 35): "Hilo",
(5, 36): "Hilo",
(103, 14): "Perth",
(104, 14): "Perth",
(104, 13): "Perth",
(104, 12): "Perth",
(103, 12): "Perth",
(107, 19): "Darwin",
(107, 20): "Darwin",
(108, 20): "Darwin",
(108, 21): "Darwin",
(118, 13): "Sydney",
(117, 12): "Sydney",
(118, 15): "Sydney",
(118, 16): "Sydney",
(118, 17): "Sydney",
(114, 10): "Adelaide",
(114, 11): "Adelaide",
(113, 11): "Adelaide",
(115, 10): "Adelaide",
(77, 41): "Babylon",
(77, 40): "Babylon",
(76, 41): "Babylon",
(77, 42): "Babylon",
(76, 42): "Babylon",
(58, 47): "Marseilles",
(58, 48): "Marseilles",
(59, 48): "Marseilles",
(56, 48): "Bordeaux",
(56, 49): "Bordeaux",
(55, 51): "Brest",
(56, 51): "Brest",
(56, 44): "Gibraltar",
(54, 44): "Gibraltar",
(53, 54): "Cardiff",
(54, 54): "Cardiff",
(53, 55): "Cardiff",
(53, 53): "Cardiff",
(55, 56): "York",
(54, 56): "York",
(49, 54): "Cork",
(49, 56): "Galway",
(50, 56): "Galway",
(51, 54): "Waterford",
(50, 54): "Cashel",
(51, 57): "Belfast",
(50, 57): "Derry",
(50, 55): "Limerick",
(60, 55): "Copenhagen",
(60, 54): "Copenhagen",
(60, 53): "Copenhagen",
(62, 52): "Trondheim",
(63, 63): "Trondheim",
(64, 64): "Trondheim",
(60, 58): "Oslo",
(59, 57): "Oslo",
(58, 58): "Oslo",
(62, 58): "Uppsala",
(62, 59): "Uppsala",
(62, 60): "Uppsala",
(63, 58): "Stockholm",
(63, 57): "Stockholm",
(63, 56): "Stockholm",
(62, 56): "Stockholm",
(66, 59): "Helsinki",
(65, 59): "Helsinki",
(65, 58): "Helsinki",
(65, 58): "Vilnius",
(65, 55): "Vilnius",
(66, 54): "Vilnius",
(66, 55): "Vilnius",
(64, 53): "Vilnius",
(65, 53): "Vilnius",
(66, 53): "Vilnius",
(63, 50): "Vienna",
(64, 50): "Vienna",
(65, 50): "Vienna",
(65, 49): "Vienna",
(64, 49): "Vienna",
(63, 49): "Vienna",
(64, 52): "Warsaw",
(63, 51): "Warsaw",
(62, 48): "Venice",
(61, 48): "Venice",
(63, 48): "Venice",
(61, 43): "Palermo",
(62, 43): "Palermo",
(76, 32): "Sanaa",
(77, 32): "Sanaa",
(77, 33): "Sanaa",
(78, 33): "Sanaa",
(64, 12): "Cape Town",
(64, 13): "Cape Town",
(65, 13): "Cape Town",
(65, 12): "Cape Town",
(42, 18): "Rio De Janeiro",
(43, 19): "Rio De Janeiro",
(41, 18): "Rio De Janeiro",
(39, 15): "Montevideo",
(38, 14): "Montevideo",
(38, 13): "Montevideo",
(36, 13): "Buenos Aires",
(37, 13): "Buenos Aires",
(36, 12): "Buenos Aires",
(18, 39): "Mexico City",
(18, 38): "Mexico City",
(19, 39): "Mexico City",
(19, 40): "Mexico City",
(18, 49): "Mexico City",
(24, 45): "St. Louis",
(25, 45): "St. Louis",
(25, 46): "St. Louis",
(24, 46): "St. Louis",
(27, 38): "Havanna",
(28, 38): "Havanna",
(31, 37): "Port-au-Prince",
(31, 39): "Port-au-Prince",
(56, 50): "Nantes",
(59, 53): "Amsterdam",
(59, 52): "Amsterdam",
(28, 46): "Philadelphia",
(28, 45): "Philadelphia",
(27, 45): "Washington",
(27, 44): "Washington",
(58, 42): "Carthage",
(59, 42): "Carthage",
(59, 41): "Carthage",
(59, 40): "Carthage",
(60, 40): "Tripoli",
(61, 40): "Tripoli",
(62, 40): "Tripoli",
(47, 61): "Reykjavik",
(47, 62): "Reykjavik",
(48, 62): "Reykjavik",
(46, 63): "Reykjavik",
(69, 41): "Knossos",
(96, 39): "Calcutta"
}
#searches in the dictionary to get a name for a key tile
def nameNorm(pCity):
coord = (pCity.getX(), pCity.getY())
if coord in cityNameDict:
name = cityNameDict[coord]
pCity.setName(name, True)
return True
else:
return False
#colony spawn for Greeks and Celts 1600BC
def ancientSpawn():
if cyGame.getGameTurnYear() == -1600:
#Celts
PyHelpers.PyPlayer(0).initUnit(4, 51, 55, 1)
PyHelpers.PyPlayer(0).initUnit(5, 51, 55, 2)
PyHelpers.PyPlayer(0).initUnit(57, 51, 55, 3)
PyHelpers.PyPlayer(0).initUnit(4, 54, 55, 1)
PyHelpers.PyPlayer(0).initUnit(5, 54, 55, 2)
PyHelpers.PyPlayer(0).initUnit(57, 54, 55, 3)
PyHelpers.PyPlayer(0).initUnit(4, 55, 58, 1)
PyHelpers.PyPlayer(0).initUnit(5, 55, 58, 2)
PyHelpers.PyPlayer(0).initUnit(57, 55, 58, 3)
#Greeks
PyHelpers.PyPlayer(5).initUnit(4, 68, 46, 1)
PyHelpers.PyPlayer(5).initUnit(5, 68, 46, 2)
PyHelpers.PyPlayer(5).initUnit(57, 68, 46, 3)
PyHelpers.PyPlayer(5).initUnit(4, 69, 41, 1)
PyHelpers.PyPlayer(5).initUnit(5, 69, 41, 2)
PyHelpers.PyPlayer(5).initUnit(57, 69, 41, 3)
PyHelpers.PyPlayer(5).initUnit(4, 64, 47, 1)
PyHelpers.PyPlayer(5).initUnit(5, 64, 47, 2)
PyHelpers.PyPlayer(5).initUnit(57, 64, 47, 3)
#spawns the classical civs 800BC on the map (different date used for testing change before release)
def classicalSpawn():
if cyGame.getGameTurnYear() == -3985:
#Romans
PyHelpers.PyPlayer(7).initUnit(4, 61, 46, 1)
PyHelpers.PyPlayer(7).initUnit(5, 61, 46, 2)
PyHelpers.PyPlayer(7).initUnit(57, 61, 46, 5)
#Persians
PyHelpers.PyPlayer(8).initUnit(4, 81, 41, 1)
PyHelpers.PyPlayer(8).initUnit(5, 81, 41, 2)
PyHelpers.PyPlayer(8).initUnit(57, 81, 41, 5)
#Japanese
PyHelpers.PyPlayer(9).initUnit(4, 115, 46, 1)
PyHelpers.PyPlayer(9).initUnit(5, 115, 46, 2)
PyHelpers.PyPlayer(9).initUnit(57, 115, 46, 5)
#Koreans
PyHelpers.PyPlayer(10).initUnit(4, 109, 46, 1)
PyHelpers.PyPlayer(10).initUnit(5, 109, 46, 2)
PyHelpers.PyPlayer(10).initUnit(57, 109, 46, 5)
#Roman colony spawn 1AD
def romeSpawn():
if cyGame.getGameTurnYear() == 1:
#Lisbon
PyHelpers.PyPlayer(7).initUnit(4, 53, 45, 1)
PyHelpers.PyPlayer(7).initUnit(5, 53, 45, 2)
PyHelpers.PyPlayer(7).initUnit(57, 53, 45, 5)
#Carthage
PyHelpers.PyPlayer(7).initUnit(4, 58, 42, 1)
PyHelpers.PyPlayer(7).initUnit(5, 58, 42, 2)
PyHelpers.PyPlayer(7).initUnit(57, 58, 42, 5)
#Tripoli
PyHelpers.PyPlayer(7).initUnit(4, 60, 40, 1)
PyHelpers.PyPlayer(7).initUnit(5, 60, 40, 2)
PyHelpers.PyPlayer(7).initUnit(57, 60, 40, 5)
#spawns Arab civ 400AD
#def arabSpawn():
# if cyGame.getGameTurnYear() == 400:
#spawns medieval civs 800AD
#def medievalSpawn():
# if cyGame.getGameTurnYear() == 800:
#English
#French
#Spanish
#Germans
#Russians
#spawns German colonies in Scandinavia and Iceland 1200AD
#def scandiSpawn():
# if cyGame.getGameTurnYear() == 1200:
#American spawn and flip of eastern US 1770AD
#def ameriSpawn():
# if cyGame.getGameTurnYear() == 1770:
#American spawns and flip of western US and Hawaii 1900AD
#def ameriFlip():
# if cyGame.getGameTurnYear() == 1900:
#colony spawns tied to discovery of Astronomy
#colonySpawn
#Arabs
#English
#French
#Spanish
#Russia
#spawns medieval barbarians 1000AD
#def barbSpawn():
# if cyGame.getGameTurnYear() == 1000:
#Vikings
#Mongols
#spawns native Americans 1400AD
#def nativeSpawn():
# if cyGame.getGameTurnYear() == 1400:
#North America
#Aztec
#Inca