from CvPythonExtensions import *
import sys
import Popup

import CvEventManager
from CvScreenEnums import *
import CvUtil
import CvTranslator
import CvGameUtils
import CvScreensInterface
import time	
import PyHelpers
import random


import pickle

# globals
gc = CyGlobalContext()
localText = CyTranslator()
PyPlayer = PyHelpers.PyPlayer

iDuration = 14

### Constants ###
iIslam = 2

iWhite = 0

iWorldX = 124
iWorldY = 68

iDespotism = 0
iHereditaryRule = 1
iRepresentation = 2
iPoliceState = 3
iUniversalSuffrage = 4

# initialise bonuses variables to bonuses IDs from WBS
iAluminium = 0
iCoal = 1
iCopper = 2
iHorse = 3
iIron = 4
iMarble = 5
iOil = 6 
iStone = 7
iUranium = 8
iBanana = 9
iClam = 10
iCorn = 11
iCow = 12
iCrab = 13
iDeer = 14
iFish = 15
iPig = 16
iRice = 17
iSheep = 18
iWheat = 19
iDye = 20
iFur = 21
iGems = 22
iGold = 23
iIncense = 24
iIvory = 25
iSilk = 26
iSilver = 27
iSpices = 28
iSugar = 29
iWine = 30
iWhales = 31

# initialise player variables to player IDs from WBS
iChina = 0
iJapan = 1
iFrance = 2
iArabia = 3
iSpain = 4
iEngland = 5
iAustria = 6
iRussia = 7
iMali = 8
iInca = 9
iMongolia = 10
iAztecs = 11
iByzantium = 12
iVikings = 13
iIndia = 14
iKhmer = 15
iKorea = 16
iPortugal = 17
iMorocco = 18
iPoland = 19
iSeljuk = 20
iTurkey = 21
iItaly = 22
iKievanRus = 23
iIran = 24
iPope = 25
iSweden = 26
iMughals = 27
iHolland = 28
iGermany = 29
iAmerica = 30
iChola = 31
iSwahili = 32
iBrazil = 33
iMexico = 34
iGreece = 37
iArgentina = 38
iColombia = 39
iEgypt = 40
iEthiopia = 41
iMinor = 49
iBarbarian = 50
iNumActivePlayers = 41

iNumPlayers = 49

pArabia = gc.getPlayer(iArabia)
pChina = gc.getPlayer(iChina)
pPortugal = gc.getPlayer(iPortugal)
pSeljuk = gc.getPlayer(iSeljuk)
pMongolia = gc.getPlayer(iMongolia)
pTurkey = gc.getPlayer(iTurkey)
pItaly = gc.getPlayer(iItaly)
pIndia = gc.getPlayer(iIndia)
pByzantium = gc.getPlayer(iByzantium)
pRussia = gc.getPlayer(iRussia)
pKievanRus = gc.getPlayer(iKievanRus)
pKorea = gc.getPlayer(iKorea)
pInca = gc.getPlayer(iInca)
pAztecs = gc.getPlayer(iAztecs)
pIran = gc.getPlayer(iIran)
pPope = gc.getPlayer(iPope)
pKhmer = gc.getPlayer(iKhmer)
pMali = gc.getPlayer(iMali)
pPoland = gc.getPlayer(iPoland)
pAustria = gc.getPlayer(iAustria)
pSweden = gc.getPlayer(iSweden)
pMughals = gc.getPlayer(iMughals)
pSpain = gc.getPlayer(iSpain)
pFrance = gc.getPlayer(iFrance)
pEngland = gc.getPlayer(iEngland)
pVikings = gc.getPlayer(iVikings)
pHolland = gc.getPlayer(iHolland)
pGermany = gc.getPlayer(iGermany)
pAmerica = gc.getPlayer(iAmerica)
pChola = gc.getPlayer(iChola)
pSwahili = gc.getPlayer(iSwahili)
pBrazil = gc.getPlayer(iBrazil)
pMexico = gc.getPlayer(iMexico)
pColombia = gc.getPlayer(iColombia)
pArgentina = gc.getPlayer(iArgentina)
pGreece = gc.getPlayer(iGreece)
pJapan = gc.getPlayer(iJapan)
pMorocco = gc.getPlayer(iMorocco)
pEthiopia = gc.getPlayer(iEthiopia)
pEgypt = gc.getPlayer(iEgypt)
pMinor = gc.getPlayer(iMinor)

teamChina = gc.getTeam(pChina.getTeam())
teamPortugal = gc.getTeam(pPortugal.getTeam())
teamSeljuk = gc.getTeam(pSeljuk.getTeam())
teamMongolia = gc.getTeam(pMongolia.getTeam())
teamTurkey = gc.getTeam(pTurkey.getTeam())
teamItaly = gc.getTeam(pItaly.getTeam())
teamIndia = gc.getTeam(pIndia.getTeam())
teamRussia = gc.getTeam(pRussia.getTeam())
teamKievanRus = gc.getTeam(pKievanRus.getTeam())
teamKorea = gc.getTeam(pKorea.getTeam())
teamInca = gc.getTeam(pInca.getTeam())
teamAztecs = gc.getTeam(pAztecs.getTeam())
teamIran = gc.getTeam(pIran.getTeam())
teamPope = gc.getTeam(pPope.getTeam())
teamSweden = gc.getTeam(pSweden.getTeam())
teamMughals = gc.getTeam(pMughals.getTeam())
teamSpain = gc.getTeam(pSpain.getTeam())
teamAustria = gc.getTeam(pAustria.getTeam())
teamFrance = gc.getTeam(pFrance.getTeam())
teamEngland = gc.getTeam(pEngland.getTeam())
teamVikings = gc.getTeam(pVikings.getTeam())
teamHolland = gc.getTeam(pHolland.getTeam())
teamGermany = gc.getTeam(pGermany.getTeam())
teamAmerica = gc.getTeam(pAmerica.getTeam())
teamChola = gc.getTeam(pChola.getTeam())
teamSwahili = gc.getTeam(pSwahili.getTeam())
teamBrazil = gc.getTeam(pBrazil.getTeam())
teamMexico = gc.getTeam(pMexico.getTeam())
teamColombia = gc.getTeam(pColombia.getTeam())
teamArgentina = gc.getTeam(pArgentina.getTeam())
teamGreece = gc.getTeam(pGreece.getTeam())
teamEthiopia = gc.getTeam(pEthiopia.getTeam())
teamEgypt = gc.getTeam(pEgypt.getTeam())
teamMinor = gc.getTeam(pMinor.getTeam())


tLisbon = (49, 43)
tKarakorum = (99, 51)
tXijin = (102, 47)
tXingqing = (99, 46)
tMoscow = (73, 54)
tTenochtitlan = (18, 37)
tCp = (19, 37)
tTrondheim = (61, 62)
tPontaDelgada = (44, 43)
tAmsterdam = (57, 53)
tAmsterdamSea = (56, 54)
tBerlin = (62, 52)
tTwangste = (65, 54)
tHamburg = (59, 53)
tAthens = (67, 41)
tSeoul = (109, 46)

tSeljuk = (85, 48)
tSeljuk1 = (77, 46)
tKyoto = (113, 45)

tSogut = (69, 44)
tAncyra = (71, 43)
tTrapezus = (75, 44)
tVenice = (60, 47)
tBurgos = (52, 42)
tShimla = (89, 41)
tDelhi = (91, 39)
tBenares = (93, 39)
tConstantinopolis = (68, 45)
tCuzco = (28, 22)
tCp1 = (27, 22)
tSiraz = (80, 39)
tGhazni = (85, 40)
tUppsala = (63, 59)
tLund = (62, 56)
tRio = (41, 18)
tSantaFe = (27, 30)
tWashington = (27, 46)
tBuenosAires = (34, 11)
tGniezno = (65, 52)
tSalzburg = (62, 49)
tTimbuktu = (54, 30)
tOaxaca = (19, 35)
tTanger = (51, 38)
tAksum = (70, 29)
tLondon = (53, 54)
tParis = (56, 50)
tCairo = (69, 34)
tRibe = (59, 55)
tAngkor = (102, 32)
tRome = (60, 44)
tMecca = (75, 33)
tSantiago = (49, 45)

tEngRevivalArea = [(53, 54), (50, 54), (53, 57), (50, 57), (53, 60), (50, 60)]
tFrRevivalArea = [(51, 50), (54, 50), (54, 47), (56, 50), (56, 47)]
tSpRevivalArea = [(49, 45), (52, 45), (54, 45), (44, 42), (52, 42)]
tAusRevivalArea = [(59, 52), (59, 49), (62, 52), (62, 49)]
tAus1RevivalArea = [(62, 49), (66, 49), (64, 47)]
tDenRevivalArea = [(59, 56), (62, 56), (59, 59), (56, 59), (62, 59), (62, 62), (59, 62)]
tDen1RevivalArea = [(59, 55), (57, 59), (62, 62), (64, 65)]
tSwedRevivalArea = [(62, 56), (62, 59), (59, 59), (64, 62), (67, 62), (67, 59)]
tTurRevivalArea = [(69, 48), (69, 45), (69, 42), (66, 42), (66, 45), (72, 42), (72, 45), (75, 45), (75, 42)]
tTur1RevivalArea = [(68, 45), (71, 43), (75, 44)]
tRusRevivalArea = [(70, 51), (75, 51), (70, 56), (75, 56), (80, 51), (80, 56), (75, 61), (80, 61), (70, 61), (70, 66)]
tRus1RevivalArea = [(70, 56), (70, 61), (75, 56), (75, 61), (80, 51), (80, 56), (80, 61), (85, 51), (85, 56), (85, 61), (90, 61), (90, 56), (95, 56), 
				(95, 61), (100, 56), (100, 61), (105, 56), (105, 61), (110, 56), (110, 61), (110, 52), (115, 56), (115, 61), (120, 61), (120, 56)]
tKievRevivalArea = [(70, 51), (75, 51)]
tChiRevivalArea = [(105, 39), (102, 39), (99, 40), (105, 42), (108, 42), (102, 42), (99, 42), (105, 45), (102, 45), (99, 45), (102, 48), (105, 48),
				(105, 51), (105, 54), (108, 54), (108, 51), (99, 48)]
tJapRevivalArea = [(111, 42), (114, 42),(114, 46), (117, 46), (114, 49), (114, 52), (117, 52)]
tKhmRevivalArea = [(101, 36), (102, 33), (98, 37)]
tItRevivalArea = [(60, 47), (60, 44), (63, 42), (61, 60)]
tGerRevivalArea = [(59, 50), (59, 53), (62, 52), (65, 54)]
tGer1RevivalArea = [(59, 50), (59, 53), (62, 52)]
tIranRevivalArea = [(78, 44), (80, 38), (80, 41), (83, 38), (83, 41), (86, 38), (86, 41)]
tUSRevivalArea = [(25, 41), (25, 44), (25, 47), (28, 47), (31, 49), (22, 44), (22, 41), (22, 47), (19, 44), (16, 45), (13, 45), (13, 48), (16, 48),
				(19, 47), (19, 48), (22, 48), (25, 48), (4, 58), (4, 61), (7, 58), (7, 61), (7, 64), (10, 61)]
tMexRevivalArea = [(22, 37), (22, 34), (19, 34), (19, 37), (16, 37), (19, 40), (16, 40), (16, 42)]
tCanRevivalArea = [(36, 54), (36, 51), (33, 51), (33, 54), (33, 57), (30, 57), (30, 54), (30, 51), (27, 51), (27, 54), (24, 52), (24, 55), (21, 52), 
				(18, 52), (15, 52), (12, 52), (9, 52), (21, 55), (18, 55), (15, 55), (12, 55), (12, 58), (15, 58), (18, 58), (21, 58), (24, 58),
				(13, 61)]
tPeruRevivalArea = [(24, 25), (26, 22), (29, 22), (29, 19)]
tMongRevivalArea = [(99, 51), (96, 52), (93, 52), (102, 52), (104, 52)]
tEthRevivalArea = [(70, 29), (70, 26), (73, 29)]
tArRevivalArea = [(82, 34), (79, 34), (79, 31), (76, 31), (76, 34), (76, 37), (79, 37), (73, 34)]
tEgRevivalArea = [(74, 33), (74, 36), (74, 39), (71, 36), (71, 33), (68, 33), (68, 36)]

tMongoliaArea = [(99, 51), (96, 51), (102, 51), (102, 54), (99, 54),  (66, 54),  (105, 54), (93, 54)]
tTurkeyArea = [(70, 45), (70, 42), (73, 42), (73, 45), (76, 45)]
tSwedishArea = [(66, 59), (65, 62)]
tUSArea = [(25, 44), (25, 47), (28, 47), (31, 49)]
tBrazilArea = [(41, 24), (41, 21), (41, 18), (38, 18), (38, 15), (35, 18), (38, 21), (38, 24), (38, 27), (36, 14)]
tMexicoArea = [(22, 37), (22, 34), (19, 34), (19, 37), (16, 37), (19, 40), (16, 40), (19, 43), (16, 43), (13, 43), (13, 40), (16, 46), (13, 46), (10, 46)]
tColombiaArea = [(27, 30), (24, 28), (29, 32)]
tArgentineArea = [(34, 11), (32, 11), (32, 14), (32, 9), (34, 9), (32, 6), (32, 3)]

tAustraliaAndOceania = [(105, 19), (105, 14), (110, 14), (110, 19), (115, 19), (115, 24), (115, 14), (115, 9), (120, 14), (120, 19), (122, 9), (122, 4)]
tRussiaArea = [(70, 64), (70, 59), (75, 59), (75, 54), (77, 50), (80, 59), (80, 54), (75, 64), (80, 64), (80, 49), (85, 49), (85, 54), (85, 59),
				(85, 64), (90, 64), (90, 59), (90, 54), (95, 54), (95, 59), (95, 64), (100, 59), (100, 64), (105, 59), (105, 54), (110, 59),
				(110, 64), (115, 59), (115, 64), (120, 64), (120, 59), (120, 54)]

tBanForSpain = [(45, 62), (35, 55), (35, 50), (30, 50), (30, 55), (40, 45), (25, 45), (25, 50), (15, 50), (10, 50), (25, 55), (20, 55), (15, 55), (10, 55),
				(20, 60), (15, 60), (10, 60), (5, 60), (34, 30), (39, 30), (39, 25), (44, 25), (39, 20), (44, 20), (39, 15), (64, 11), (69, 11),
				(64, 16), (69, 16), (74, 16), (74, 21), (69, 21), (64, 21), (69, 26), (64, 26), (99, 27), (105, 25)]
tSpainColonies = [(29, 11), (29, 10), (29, 8), (35, 12), (29, 32), (30, 31), (31, 31), (32, 33), (26, 38), (12, 44), (12, 45), (11, 46),
				(35, 4), (108, 30), (109, 31), (110, 32), (108, 36)]
				
tBanForFrance = [(45, 62), (29, 47), (26, 40), (18, 42), (13, 42), (18, 47), (13, 47), (13, 52), (13, 57), (19, 57), (24, 57), (13, 62), (8, 62), (8, 57),
				(3, 57), (23, 33), (27, 30), (24, 25), (28, 20), (30, 15), (30, 10), (35, 10), (35, 4), (35, 15), (35, 20), (40, 15), (40, 20),
				(40, 26), (32, 30), (64, 11), (69, 11), (64, 16), (69, 16), (69, 22), (69, 27), (99, 28), (105, 25), (113, 25), (109, 31), (108, 36),
				(26, 45), (10, 51)]
				
tFranceColonies = [(35, 51), (34, 50), (33, 51), (33, 52), (32, 51), (32, 50), (27, 51), (25, 44), (23, 43), (30, 37), (36, 29), (75, 15), (74, 15),
				(76, 19), (94, 35), (93, 35), (93, 34)]

tBanForEngland = [(45, 62), (26, 41), (22, 41), (20, 45), (20, 48), (15, 48), (15, 45), (11, 47), (5, 59), (10, 59), (10, 63), (17, 41),
				(26, 38), (28, 30), (30, 30), (24, 28), (30, 16), (31, 5), (31, 10), (36, 10), (36, 15), (36, 20), (41, 15), (41, 20),
				(41, 25), (36, 25), (37, 29), (75, 15), (48, 30), (57, 30), (62, 28), (62, 20), (99, 27), (105, 25), (109, 31), (108, 35)]
				
				
tEnglandColonies = [(35, 51), (34, 50), (33, 52), (32, 51), (32, 50), (31, 49), (31, 48), (29, 41), (28, 46), (27, 46), (27, 45), (26, 45),
				(26, 44), (25, 44), (27, 51), (11, 50), (10, 51), (11, 52), (11, 53), (33, 30), (34, 30), (64, 11), (63, 10), (64, 10), 
				(65, 10), (66, 10), (67, 10), (68, 11), (68, 12), (69, 13), (71, 21), (71, 22), (92, 34), (93, 34), (93, 35), (94, 35),
				(108, 20), (107, 20), (116, 24), (117, 12), (114, 11), (118, 16), (116, 19), (122, 7), (112, 10), (120, 5)]
				
tBanForDenmark = [(35, 55), (30, 55), (35, 50), (30, 50), (30, 45), (25, 45), (25, 50), (25, 40), (27, 38), (31, 38), (20, 40), (20, 45),
				(20, 50), (20, 55), (25, 55), (20, 60), (25, 60), (15, 60), (10, 60), (10, 63), (5, 60), (15, 55), (15, 50), (10, 50),
				(10, 55), (10, 45), (15, 45), (23, 32), (28, 32), (28, 27), (23, 27), (33, 32), (38, 27), (38, 22), (43, 22), (43, 27),
				(38, 17), (43, 17), (38, 12), (33, 17), (33, 12), (28, 17), (28, 12), (33, 7), (28, 7), (33, 4), (20, 16), (65, 12),
				(70, 12), (70, 17), (65, 17), (76, 19), (74, 15), (60, 17), (70, 22), (60, 22), (70, 27), (75, 27), (65, 27), (60, 27),
				(99, 28), (105, 25), (109, 31), (108, 36)]
				
tBanForRussia = [(35, 55), (30, 55), (35, 50), (30, 50), (25, 50), (25, 55), (25, 60), (30, 45), (25, 45), (20, 50), (20, 45), (15, 45), 
				(15, 50), (10, 50), (20, 55), (15, 55), (10, 55), (15, 60), (20, 60), (25, 40), (28, 38), (20, 40), (15, 40), (23, 32),
				(27, 31), (32, 31), (24, 27), (30, 16), (35, 16), (40, 16), (35, 11), (30, 11), (30, 7), (32, 3), (36, 4), (40, 21),
				(40, 26), (43, 24), (36, 30), (20, 16), (64, 12), (74, 15), (76, 19), (64, 17), (68, 17), (72, 17), (68, 22), (71, 22),
				(61, 21), (68, 27), (62, 27), (57, 27), (94, 35), (99, 27), (105, 25), (109, 31), (108, 36), (45, 64)]
				
tBanForSweden = [(45, 63), (30, 51), (30, 56), (30, 49), (25, 41), (25, 51), (20, 51), (20, 46), (23, 46), (22, 41), (15, 46), (10, 46),
				(15, 51), (10, 51), (20, 56), (25, 56), (15, 56), (10, 56), (20, 61), (25, 61), (15, 61), (10, 61), (5, 61), (5, 56),
				(28, 38), (23, 33), (27, 30), (24, 25), (30, 16), (32, 30), (30, 11), (35, 11), (30, 6), (35, 4), (35, 16), (40, 16),
				(35, 21), (40, 21), (43, 23), (37, 30), (39, 26), (64, 12), (69, 12), (64, 17), (69, 17), (74, 15), (76, 19), (61, 21),
				(69, 22), (72, 19), (69, 27), (74, 27), (64, 27), (59, 27), (99, 27), (105, 25), (109, 31), (108, 36)]
				
tBanForPortugal = [(45, 62), (35, 55), (30, 55), (35, 50), (30, 50), (25, 50), (25, 55), (30, 45), (25, 45), (20, 50), (20, 45), (25, 40), (28, 38),
				(20, 40), (15, 45), (15, 40), (10, 45), (15, 50), (10, 50), (20, 55), (15, 55), (10, 55), (20, 60), (25, 60), (15, 60),
				(10, 60), (5, 60), (23, 32), (33, 33), (27, 30), (31, 31), (24, 26), (30, 16), (30, 11), (35, 11), (30, 6), (35, 6),
				(20, 16), (57, 27), (64, 12),(69, 12), (75, 15), (76, 19), (70, 25), (64, 27), (61, 30), (99, 27), (105, 25), (109, 31),
				(108, 36), (46, 63)]
				
tPortugalColonies = [(44, 43), (42, 24), (41, 25), (40, 25), (39, 25), (38, 26), (37, 26), (37, 27), (37, 28), (36, 28), 
				(41, 18), (40, 17), (39, 17), (38, 17), (38, 16), (70, 16), (72, 19), (62, 20)]
				
tBanForJapanAndIran = [(35, 55), (30, 55), (35, 50), (30, 50), (25, 50), (25, 55), (30, 45), (25, 45), (20, 50), (20, 45), (25, 40), (28, 38),
				(20, 40), (15, 45), (15, 40), (10, 45), (15, 50), (10, 50), (20, 55), (15, 55), (10, 55), (20, 60), (25, 60), (15, 60),
				(10, 60), (5, 60), (23, 32), (33, 33), (27, 30), (31, 31), (24, 26), (30, 16), (30, 11), (35, 11), (30, 6), (35, 6),
				(20, 16), (57, 27), (64, 12),(69, 12), (75, 15), (76, 19), (70, 25), (64, 27), (61, 30), (99, 27), (105, 25), (109, 31),
				(108, 36), (46, 63), (44, 43), (41, 18), (37, 19), (37, 26), (42, 24), (39, 22), (72, 19), (70, 16), (62, 19), (66, 17), (93, 28),
				(94, 36), (93, 34)]
				
tBanForMongolia = [(70, 64), (70, 59), (75, 59), (80, 59), (75, 64), (80, 64), (85, 59), (85, 64), (90, 64), (90, 59), (95, 59), (95, 64),
				(100, 59), (100, 64), (105, 59), (110, 59), (110, 64), (115, 59), (115, 64), (120, 64), (120, 59), (120, 54)]
				
tMongoliaCities = [(86, 49), (92, 50), (90, 54), (97, 55), (105, 53), (103, 56), (109, 52), (80, 50), (83, 53), (85, 56)]

tBanForHolland = [(29, 51), (34, 51), (34, 56), (29, 56), (24, 51), (24, 56), (24, 46), (24, 41), (19, 41), (19, 46), (19, 51), (19, 56), (24, 61), 
				(19, 61), (14, 61), (14, 56), (9, 61), (4, 61), (14, 51), (9, 51), (14, 46), (9, 46), (28, 38), (23, 32), (27, 31), (24, 26), (27, 22), (30, 17), 
				(30, 12), (35, 17), (35, 12), (40, 17), (30, 7), (35, 7), (30, 3), (30, 3), (35, 3), (40, 22), (62, 15), (67, 15), (72, 15), (67, 20),
				(72, 20), (72, 25), (67, 25), (61, 25), (76, 19), (109, 32), (109, 37), (45, 62)]
				
tHollandCities = [(29, 47), (28, 47), (29, 48), (30, 48), (31, 48), (34, 30), (35, 29), (36, 29), (42, 24), (41, 25), (40, 25), (64, 11), (64, 10),
				(63, 10), (65, 10), (66, 10), (67, 10), (99, 27), (104, 25), (105, 25), (109, 20), (108, 20), (107, 19), (110, 21), (111, 21),
				(113, 19), (113, 25), (116, 19), (115, 21), (114, 22), (122, 7), (121, 6), (123, 9)]
				
tBanForAmerica = [(33, 55), (30, 55), (35, 50), (28, 51), (23, 52), (18, 52), (13, 52), (13, 41), (23, 57), (18, 57), (13, 57), (13, 62), (28, 37), (23, 32),
				(27, 30), (32, 30), (37, 30), (24, 25), (28, 20), (30, 15), (30, 10), (30, 6), (35, 10), (35, 15), (40, 15), (35, 20), (41, 20),
				(41, 25), (37, 26), (64, 11), (69, 11), (64, 16), (69, 16), (64, 21), (74, 16), (74, 21), (69, 21), (69, 26), (64, 26), (99, 27),
				(105, 25), (113, 25)]
				
tAmericaCities = [(31, 48), (30, 48), (29, 48), (26, 44), (25, 43), (23, 42), (22, 43), (26, 48), (25, 48), (23, 48), (23, 49), (19, 48), (21, 47), (15, 44),
				(19, 45), (11, 46), (12, 45), (11, 50), (11, 48), (14, 49), (5, 60), (9, 59), (10, 64), (109, 31), (110, 32), (108, 36)]
		
		
tBanForEthiopia = [(64, 11), (69, 11), (69, 16), (64, 16), (64, 21), (74, 16), (74, 21), (69, 21), (64, 26), (59, 26), (59, 21), (64, 31), (59, 31)]				

##techs
iMysticism = 0
iMeditation = 1
iPolytheism = 2
iPriesthood = 3
iMonotheism = 4
iMonarchy = 5
iLiterature = 6
iCodeOfLaws = 7
iDrama = 8
iFeudalism = 9
iTheology = 10
iMusic = 11
iCivilService = 12
iGuilds = 13
iDivineRight = 14
iNationalism = 15
iMilitaryTradition = 16
iConstitution = 17
iLiberalism = 18
iDemocracy = 19
iCorporation = 20
iFascism = 21
iUtopia = 22
iCommunism = 22 #
iMassMedia = 23
iEcology = 24

iFishing = 25
iTheWheel = 26
iAgriculture = 27
iPottery = 28
iAesthetics = 29
iSailing = 30
iWriting = 31
iMathematics = 32
iAlphabet = 33
iCalendar = 34
iCurrency = 35
iPhilosophy = 36
iPaper = 37
iBanking = 38
iEducation = 39
iPrintingPress = 40
iEconomics = 41
iAstronomy = 42
iChemistry = 43
iScientificMethod = 44
iPhysics = 45
iBiology = 46
iMedicine = 47
iElectricity = 48
iCombustion = 49
iFission = 50
iFlight = 51
iAdvancedFlight = 52
iPlastics = 53
iComposites = 54
iStealth = 55
iGenetics = 56
iFiberOptics = 57
iFusion = 58

iHunting = 59
iMining = 60
iArchery = 61
iMasonry = 62
iAnimalHusbandry = 63
iBronzeWorking = 64
iHorsebackRiding = 65
iIronWorking = 66
iMetalCasting = 67
iCompass = 68
iConstruction = 69
iMachinery = 70
iEngineering = 71
iOptics = 72
iGunpowder = 73
iReplaceableParts = 74
iMilitaryScience = 75
iRifling = 76
iSteamPower = 77
iSteel = 78
iAssemblyLine = 79
iRailroad = 80
iArtillery = 81
iIndustrialism = 82
iRadio = 83
iRefrigeration = 84
iSuperconductors = 85
iComputers = 86
iLaser = 87
iRocketry = 88
iSatellites = 89
iRobotics = 90

iNumTechs = 90

##units
iLion = 0
iBear = 1
iPanther = 2
iWolf = 3
iSettler = 4
iWorker = 5
iIndianFastWorker = 6
iScout = 7
iExplorer = 8
iSpy = 9
iExecutive1 = 10
iExecutive2 = 11
iExecutive3 = 12
iExecutive4 = 13
iExecutive5 = 14
iExecutive6 = 15
iExecutive7 = 16
iJewishMissionary = 17
iChristianMissionary = 18
iIslamicMissionary = 19
iHinduMissionary = 20
iBuddhistMissionary = 21
iConfucianMissionary = 22
iTaoistMissionary = 23
iWarrior = 24
iIncanQuechua = 25
iSwordsman = 26
iAztecJaguar = 27
iCelticGallicWarrior = 28
iRomePraetorian = 29
iAxeman = 30
iGreekPhalanx = 31
iSumerianVulture = 32
iNativeAmericaDogSoldier = 33
iMaceman = 34
iJapanSamurai = 35
iVikingBeserker = 36
iSpearman = 37
iZuluImpi = 38
iMayaHolkan = 39
iPikeman = 40
iHolyRomanLandsknecht = 41
iMusketman = 42
iFrenchMusketeer = 43
iOttomanJanissary = 44
iEthiopianOromoWarrior = 45
iRifleman = 46
iEnglishRedcoat = 47
iGrenadier = 48
iAtInfantry = 49
iInfantry = 50
iSamInfantry = 51
iMobileSam = 52
iMarine = 53
iAmericanNavySeal = 54
iParatrooper = 55
iMechanizedInfantry = 56
iArcher = 57
iMaliSkirmisher = 58
iBabylonBowman = 59
iLongbowman = 60
iCrossbowman = 61
iChinaChokonu = 62
iChariot = 63
iEgyptWarchariot = 64
iIranImmortal = 65
iHorseArcher = 66
iCarthageNumidianCavalry = 67
iMongolKeshik = 68
iKnight = 69
iArabiaCamelarcher = 70
iCamelArcher = 70 #
iByzantineCataphract = 71
iSpanishConquistador = 72
iConquistador = 72 #
iCuirassier = 73
iCavalry = 74
iKievanRusCossack = 75
iWarElephant = 76
iKhmerBallistaElephant = 77
iTank = 78
iGermanPanzer = 79
iModernArmor = 80
iGunship = 81
iCatapult = 82
iKoreanHwacha = 83
iTrebuchet = 84
iCannon = 85
iMachineGun = 86
iArtillery = 87
iMobileArtillery = 88
iWorkboat = 89
iWorkBoat = 89 #
iGalley = 90
iTrireme = 91
iCaravel = 92
iPortugalCarrack = 93
iGalleon = 94
iHollandOostindievaarder = 95
iPrivateer = 96
iFrigate = 97
iShipOfTheLine = 98
iIronclad = 99
iTransport = 100
iDestroyer = 101
iBattleship = 102
iMissileCruiser = 103
iStealthDestroyer = 104
iSubmarine = 105
iAttackSubmarine = 106
iCarrier = 107
iAirship = 108
iFighter = 109
iJetFighter = 110
iBomber = 111
iStealthBomber = 112
iGuidedMissile = 113
iTacticalNuke = 114
iIcbm = 115
iProphet = 116
iArtist = 117
iScientist = 118
iMerchant = 119
iEngineer = 120
iGreatGeneral = 121
iGreatSpy = 122
iGhulam = 123
iQizilbash = 128
iSiegeElephant = 129

##Buildings
iPalace = 0
iGreatPalace = 1
iSummerPalace = 1 #
iVersailles = 2
iForbiddenPalace = 2 #
iWalls = 3
iCelticDun = 4
iCastle = 5
iSpanishCitadel = 6
iBarracks = 7
iZuluIkhanda = 8
iStable = 9
iMongolGer = 10
iBunker = 11
iBombShelter = 12
iGranary = 13
iIncanTerrace = 14
iAqueduct = 15
iOttomanHammam = 16
iKhmerBaray = 17
iHospital = 18
iRecyclingCenter = 19
iLighthouse = 20
iVikingTradingPost = 21
iHarbor = 22
iCarthageCothon = 23
iCustomHouse = 24
iPortugalFeitoria = 25
iDrydock = 26
iAirport = 27
iForge = 28
iMaliMint = 29
iFactory = 30
iGermanAssemblyPlant = 31
iCoalPlant = 32
iJapaneseShalePlant = 33
iHydroPlant = 34
iNuclearPlant = 35
iIndustrialPark = 36
iObelisk = 37
iEgyptianObelisk = 38
iEthiopianStele = 39
iNativeAmericaTotem = 40
iPublicTransportation = 41
iAcademy = 42
iLibrary = 43
iArabianMadrassa = 44
iUniversity = 45
iKoreanSeowon = 46
iObservatory = 47
iFrenchSalon = 48
iLaboratory = 49
iKievanRusnResearchInstitute = 50
iTheatre = 51
iChinesePavillion = 52
iByzantineHippodrome = 53
iColosseum = 54
iGreekOdeon = 55
iMayaBallCourt = 56
iBabylonGarden = 57
iBroadcastTower = 58
iMarket = 59
iRomanForum = 60
iGrocer = 61
iIrannApothecary = 62
iBank = 63
iEnglishStockExchange = 64
iSupermarket = 65
iAmericanMall = 66
iCourthouse = 67
iAztecSacrificialAltar = 68
iHolyRomanRathaus = 69
iSumerianZiggurat = 70
iJail = 71
iIndianMausoleum = 72
iLevee = 73
iHollandDike = 74
iIntelligenceAgency = 75
iNationalSecurity = 76
iJewishTemple = 77
iJewishCathedral = 78
iJewishMonastery = 79
iJewishShrine = 80
iChristianTemple = 81
iChristianCathedral = 82
iChristianMonastery = 83
iChristianShrine = 84
iIslamicTemple = 85
iIslamicCathedral = 86
iIslamicMonastery = 87
iIslamicShrine = 88
iHinduTemple = 89
iHinduCathedral = 90
iHinduMonastery = 91
iHinduShrine = 92
iBuddhistTemple = 93
iBuddhistCathedral = 94
iBuddhistMonastery = 95
iBuddhistShrine = 96
iConfucianTemple = 97
iConfucianCathedral = 98
iConfucianMonastery = 99
iConfucianShrine = 100
iTaoistTemple = 101
iTaoistCathedral = 102
iTaoistMonastery = 103
iTaoistShrine = 104
iHeroicEpic = 105 #
iFlavianAmphitheatre = 105
iNationalEpic = 106
iTriumphalArch = 106 #
iGlobeTheatre = 107
iNationalPark = 108
iHermitage = 109
iNationalGallery = 109 #
iChannelTunnel = 110
iWallStreet = 111
iIronWorks = 112
iTradingCompany = 113
iMtRushmore = 114
iRedCross = 115
iScotlandYard = 116
iInterpol = 116 #
iPyramid = 117
iStonehenge = 118
iGreatLibrary = 119
iGreatLighthouse = 120
iHangingGarden = 121
iColossus = 122
iOracle = 123
iParthenon = 124
iAngkorWat = 125
iHagiaSophia = 126
iChichenItza = 127
iTempleOfKukulkan = 127 #
iSistineChapel = 128
iSpiralMinaret = 129
iNotreDame = 130
iTajMahal = 131
iKremlin = 132
iEiffelTower = 133
iStatueOfLiberty = 134
iBroadway = 135
iWembley = 135 #
iRocknroll = 136
iGraceland = 136 #
iHollywood = 137
iGreatDam = 138
iPentagon = 139
iUnitedNations = 140
iSpaceElevator = 141
iMilitaryAcademy = 142
iArtemis = 143
iSankore = 144
iGreatWall = 145
iStatueOfZeus = 146
iMausoleumOfMaussollos = 147
iCristoRedentor = 148
iShwedagonPaya = 149
iMoaiStatues = 150
iCorporation1 = 151
iCorporation2 = 152
iCorporation3 = 153
iCorporation4 = 154
iCorporation5 = 155
iCorporation6 = 156
iCorporation7 = 157
iApostolicPalace = 158
iArtStudio = 160
iCaravanSerai = 169


# LOQ 2005-10-12: removed Fates

class fmtfe:

	def declareWar(self, iAttacker, iDefender):
		if (gc.getTeam(iAttacker).isHasMet(iDefender) and gc.getTeam(iAttacker) and gc.getTeam(iDefender).isAlive()):
			if not gc.getTeam(iAttacker).isVassal(iDefender):
				if (gc.getTeam(iAttacker).isHuman() == 0):						
					gc.getTeam(iAttacker).declareWar(iDefender, True, WarPlanTypes.WARPLAN_TOTAL)					
						
					if((iAttacker == iTurkey) and (iDefender == iByzantium)):
						gc.getTeam(iAttacker).setPermanentWarPeace(iDefender, True)
					if((iAttacker == iSeljuk) and (iDefender == iByzantium)):
						gc.getTeam(iAttacker).setPermanentWarPeace(iDefender, True)
					if((iAttacker == iSeljuk) and (iDefender == iArabia)):
						gc.getTeam(iAttacker).setPermanentWarPeace(iDefender, True)
					if((iAttacker == iMughals) and (iDefender == iIndia)):
						gc.getTeam(iAttacker).setPermanentWarPeace(iDefender, True)
					if((iAttacker == iEngland) and (iDefender == iSwahili)):
						gc.getTeam(iAttacker).setPermanentWarPeace(iDefender, True)		
					if((iAttacker == iPortugal) and (iDefender == iSwahili)):
						gc.getTeam(iAttacker).setPermanentWarPeace(iDefender, True)	
					if((iAttacker == iEngland) and (iDefender == iMughals)):
						gc.getTeam(iAttacker).setPermanentWarPeace(iDefender, True)	
					
	def makePeace(self, iAttacker, iDefender):
		if (gc.getTeam(iAttacker).isHasMet(iDefender) and gc.getTeam(iAttacker) and gc.getTeam(iDefender).isAlive()):
			gc.getTeam(iAttacker).makePeace(iDefender)

				
	def makeUnit(self, iUnit, iExp, iPlayer, tCoords, iNum): #by LOQ			
		'Makes iNum units for player iPlayer of the type iUnit at tCoords.'
		for i in range(iNum):
			player = gc.getPlayer(iPlayer)
			unit = player.initUnit(iUnit, tCoords[0], tCoords[1], UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
			unit.setExperience(iUnit, iExp)
		
	def removeUnitsFromArea(self, iPlayer, tCoords, tDesant):
		if gc.getPlayer(iPlayer).isHuman() == 0:	
			for idx in tCoords:
				for x in range(idx[0]-2, idx[0]+4):
					for y in range(idx[1]-2, idx[1]+4):
						area = gc.getMap().plot( x, y )
						iNumUnitsInAPlot = area.getNumUnits()
						
						if iNumUnitsInAPlot:
							for i in range(iNumUnitsInAPlot):
								unit = area.getUnit(i)
								
								if not area.isWater():
									if(unit.getUnitType() == iSettler):
										if(unit.getOwner() == iPlayer):
												desant = gc.getMap().plot( tDesant[0], tDesant[1] )
												if not desant.isOwned():
													unit.setXY(tDesant[0], tDesant[1] , True, True, True)
													iNumUnitsInAPlot1 = desant.getNumUnits()
													
													if iNumUnitsInAPlot1:
														for p in range(iNumUnitsInAPlot1):
															unit1 = desant.getUnit(p)
															if(unit1.getOwner() == iPlayer):
																if(unit1.getUnitType() == iSettler):
																	unit1.found()

													for l in range(iNumUnitsInAPlot):
														accompUnit = area.getUnit(l)
														if not area.isWater():
															if(accompUnit.getOwner() == iPlayer):
																accompUnit.setXY(tDesant[0], tDesant[1] , True, True, True)
												else:
													for x in range(iWorldX):
														for y in range(iWorldY):
															area1 = gc.getMap().plot( x, y )
															iNumUnitsInAPlot2 = area1.getNumUnits()
															if iNumUnitsInAPlot2:
																for j in range(iNumUnitsInAPlot2):
																	unit2 = area.getUnit(j)
																	if(unit2.getUnitType() == iSettler):
																		if(unit2.getOwner() == iPlayer):
																			pPlayer = gc.getPlayer(iPlayer)
																			jDesant = pPlayer.getCapitalCity()
																			unit.setXY(jDesant.getX(), jDesant.getY() , False, True, True)
											
											
	def findCapitalsForTheMovementOfSettlers(self, iPlayer):
		if gc.getPlayer(iPlayer).isHuman() == 0:
			for x in range(iWorldX):
				for y in range(iWorldY):
					area = gc.getMap().plot( x, y )
					iNumUnitsInAPlot = area.getNumUnits()
					if iNumUnitsInAPlot:
						for i in range(iNumUnitsInAPlot):
							unit = area.getUnit(i)
							if(unit.getUnitType() == iSettler):
								if(unit.getOwner() == iPlayer):
									unit.kill(False, iPlayer)
								
	def removeUnitsFromSomeAreaToCapital(self, iPlayer, tCoords):
		if gc.getPlayer(iPlayer).isHuman() == 0:
			for idx in tCoords:
				for x in range(idx[0]-2, idx[0]+4):
					for y in range(idx[1]-2, idx[1]+4):
						area = gc.getMap().plot( x, y )
						iNumUnitsInAPlot = area.getNumUnits()
						
						if iNumUnitsInAPlot:
							for i in range(iNumUnitsInAPlot):
								unit = area.getUnit(i)
								if not area.isWater():
									if(unit.getUnitType() == iSettler):
										if(unit.getOwner() == iPlayer):
											pPlayer = gc.getPlayer(iPlayer)
											tDesant = pPlayer.getCapitalCity()
											unit.setXY(tDesant.getX(), tDesant.getY() , False, True, True)
											for l in range(iNumUnitsInAPlot):
												accompUnit = area.getUnit(l)
												if not area.isWater():
													if(accompUnit.getOwner() == iPlayer):
														accompUnit.setXY(tDesant.getX(), tDesant.getY(), False, True, True)
										
	def fuckinshit(self, iPlayer, tCoords):
		if gc.getPlayer(iPlayer).isHuman() == 0:
			area = gc.getMap().plot( tCoords[0], tCoords[1] )
			iNumUnitsInAPlot = area.getNumUnits()
			
			if iNumUnitsInAPlot:
				for i in range(iNumUnitsInAPlot):
					unit = area.getUnit(i)
					if not area.isWater():
						if(unit.getUnitType() == iSettler):
							if(unit.getOwner() == iPlayer):
								pPlayer = gc.getPlayer(iPlayer)
								tDesant = pPlayer.getCapitalCity()
								unit.setXY(tDesant.getX(), tDesant.getY() , False, True, True)
								for l in range(iNumUnitsInAPlot):
									accompUnit = area.getUnit(l)
									if not area.isWater():
										if(accompUnit.getOwner() == iPlayer):
											accompUnit.setXY(tDesant.getX(), tDesant.getY() , False, True, True)	

						
	def removeUnitsFromAreaSource(self, iGameTurn):
		self.removeUnitsFromSomeAreaToCapital(iJapan, tBanForJapanAndIran)
		self.removeUnitsFromSomeAreaToCapital(iJapan, tAustraliaAndOceania)
		self.removeUnitsFromSomeAreaToCapital(iJapan, tRussiaArea)
		
		self.removeUnitsFromSomeAreaToCapital(iIran, tBanForJapanAndIran)
		self.removeUnitsFromSomeAreaToCapital(iIran, tAustraliaAndOceania)
		self.removeUnitsFromSomeAreaToCapital(iIran, tRussiaArea)
		
		self.removeUnitsFromArea(iSpain, tBanForSpain, random.choice(tSpainColonies))
		self.removeUnitsFromArea(iSpain, tAustraliaAndOceania, random.choice(tSpainColonies))
		self.removeUnitsFromArea(iSpain, tRussiaArea, random.choice(tSpainColonies))
		self.fuckinshit(iSpain, tPontaDelgada)
		
		self.removeUnitsFromArea(iFrance, tBanForFrance, random.choice(tFranceColonies))
		self.removeUnitsFromArea(iFrance, tAustraliaAndOceania, random.choice(tFranceColonies))
		self.removeUnitsFromArea(iFrance, tRussiaArea, random.choice(tFranceColonies))
		self.fuckinshit(iFrance, tPontaDelgada)
		
		self.removeUnitsFromArea(iEngland, tBanForEngland, random.choice(tEnglandColonies))
		self.removeUnitsFromArea(iEngland, tRussiaArea, random.choice(tEnglandColonies))
		self.fuckinshit(iEngland, tPontaDelgada)

		
		self.removeUnitsFromSomeAreaToCapital(iVikings, tBanForDenmark)
		self.removeUnitsFromSomeAreaToCapital(iVikings, tAustraliaAndOceania)
		self.removeUnitsFromSomeAreaToCapital(iVikings, tRussiaArea)
		self.fuckinshit(iVikings, tPontaDelgada)
		
		self.removeUnitsFromSomeAreaToCapital(iInca, tAustraliaAndOceania)
		
		self.removeUnitsFromSomeAreaToCapital(iRussia, tBanForRussia)
		self.removeUnitsFromSomeAreaToCapital(iRussia, tAustraliaAndOceania)
		
		self.removeUnitsFromSomeAreaToCapital(iSweden, tBanForSweden)
		self.removeUnitsFromSomeAreaToCapital(iSweden, tAustraliaAndOceania)
		self.removeUnitsFromSomeAreaToCapital(iSweden, tRussiaArea)
		self.fuckinshit(iSweden, tPontaDelgada)

		self.removeUnitsFromSomeAreaToCapital(iEthiopia, tBanForEthiopia)
		self.removeUnitsFromSomeAreaToCapital(iEthiopia, tAustraliaAndOceania)
		
		self.removeUnitsFromArea(iPortugal, tBanForPortugal, random.choice(tPortugalColonies))
		self.removeUnitsFromArea(iPortugal, tAustraliaAndOceania, random.choice(tPortugalColonies))
		self.removeUnitsFromArea(iPortugal, tRussiaArea, random.choice(tPortugalColonies))
		
		self.removeUnitsFromArea(iMongolia, tBanForMongolia, random.choice(tMongoliaCities))
		self.removeUnitsFromArea(iMongolia, tAustraliaAndOceania, random.choice(tMongoliaCities))
		
		self.removeUnitsFromArea(iHolland, tBanForHolland, random.choice(tHollandCities))
		self.removeUnitsFromArea(iHolland, tRussiaArea, random.choice(tHollandCities))
		
		self.removeUnitsFromArea(iAmerica, tBanForAmerica, random.choice(tAmericaCities))
		self.removeUnitsFromArea(iAmerica, tRussiaArea, random.choice(tAmericaCities))
		self.removeUnitsFromArea(iAmerica, tAustraliaAndOceania, random.choice(tAmericaCities))
		
		self.findCapitalsForTheMovementOfSettlers(iAustria)
		self.findCapitalsForTheMovementOfSettlers(iChina)
		self.findCapitalsForTheMovementOfSettlers(iMughals)
		self.findCapitalsForTheMovementOfSettlers(iItaly)
		self.findCapitalsForTheMovementOfSettlers(iPoland)
		self.findCapitalsForTheMovementOfSettlers(iPope)
		self.findCapitalsForTheMovementOfSettlers(iArabia)		
		self.findCapitalsForTheMovementOfSettlers(iTurkey)		
		self.findCapitalsForTheMovementOfSettlers(iSeljuk)		
		self.findCapitalsForTheMovementOfSettlers(iKhmer)	
		self.findCapitalsForTheMovementOfSettlers(iKorea)		
		self.findCapitalsForTheMovementOfSettlers(iMali)		
		self.findCapitalsForTheMovementOfSettlers(iMorocco)		
		self.findCapitalsForTheMovementOfSettlers(iByzantium)
		self.findCapitalsForTheMovementOfSettlers(iIndia)
		self.findCapitalsForTheMovementOfSettlers(iSwahili)
		self.findCapitalsForTheMovementOfSettlers(iChola)
		self.findCapitalsForTheMovementOfSettlers(iGermany)
		self.findCapitalsForTheMovementOfSettlers(iEgypt)
		self.findCapitalsForTheMovementOfSettlers(iAztecs)
		
		
		iGameTurn += 1
		iYear = CyGame().getTurnYear(iGameTurn)
#		if(iYear >= 1500):
#			self.findCapitalsForTheMovementOfSettlers(iAztecs)
#			self.findCapitalsForTheMovementOfSettlers(iInca)
		
	def setCivName(self, iPlayer, sName, sShort, sAdjective):
		gc.getPlayer(iPlayer).setCivName(localText.getText(sName, ()), localText.getText(sShort, ()), localText.getText(sAdjective, ()))
			
		
	def culturespread(self, iPlayer, tCityPlot, iNumC):
				city = CyMap().plot(tCityPlot[0], tCityPlot[1]).getPlotCity()
				city.setCulture(iPlayer, iNumC, True)
				
							
				
	def findSeaPlots( self, tCoords, iRange):
			"""Searches a sea plot that isn't occupied by a unit and isn't a civ's territory surrounding the starting coordinates"""
			seaPlotList = []
			for x in range(tCoords[0] - iRange, tCoords[0] + iRange+1):        
					for y in range(tCoords[1] - iRange, tCoords[1] + iRange+1):	
							pCurrent = gc.getMap().plot( x, y )
							if ( pCurrent.isWater()):
									if ( not pCurrent.isUnit() ):
											if (pCurrent.countTotalCulture() == 0 ):
													seaPlotList.append(pCurrent)
													# this is a good plot, so paint it and continue search
			if (len(seaPlotList) > 0):
					rndNum = gc.getGame().getSorenRandNum(len(seaPlotList), 'sea plot')
					result = seaPlotList[rndNum]
					if (result):                                                        
								return ((result.getX(), result.getY()))
			return (None)
			
	def buildingsBuild(self, iPlayer, tCityPlot, iBuilding):
		cityPlot = gc.getMap().plot( tCityPlot[0], tCityPlot[1] ).getPlotCity()
		cityPlot.setNumRealBuilding(iBuilding, True)
		
		
	def population(self, iPlayer, tCityPlot, iNum):
		city = gc.getMap().plot( tCityPlot[0], tCityPlot[1] ).getPlotCity()
		city.setPopulation(iNum)
		
	def culture(self, iPlayer, iNewOwner, lCityPlot):
		for XCity in range(lCityPlot[0]-3, lCityPlot[0]+6):
			for YCity in range(lCityPlot[1]-3, lCityPlot[1]+6):
				city = CyMap().plot(XCity, YCity).getPlotCity()#city of new civ or plot where new civ must found city
				
				city.setCulture(iPlayer, 0, False)#iPlayer - is civ who is owner plots which new civs must own
				
		for XPlot in range(lCityPlot[0]-1, lCityPlot[0]+2):
			for YPlot in range(lCityPlot[1]-1, lCityPlot[1]+2):
				plot = CyMap().plot(XPlot, YPlot)
				plot.setCulture(iNewOwner, 100, False)
				
				
				
	def cultureturn(self):
		iGameTurn = CyGame().getGameTurn()
		iGameTurn += 1
		iYear = CyGame().getTurnYear(iGameTurn)
		for iPlayer in xrange(iNumPlayers):
			if iYear == 1580:
				city = CyMap().plot(tAmsterdam[0], tAmsterdam[1]).getPlotCity()
				self.culture(iPlayer, iHolland, tAmsterdam)
			if iYear == 1700:
				berlin = CyMap().plot(tBerlin[0], tBerlin[1]).getPlotCity()
				self.culture(iPlayer, iGermany, tBerlin)	
									

	def fc(self, tCityPlot, bFlipType, bKillUnits, iNewOwner, iUnits):
			pNewOwner = gc.getPlayer(iNewOwner)
			city = gc.getMap().plot( tCityPlot[0], tCityPlot[1] ).getPlotCity()
			if (gc.getMap().plot(tCityPlot[0], tCityPlot[1]).isCity()):
					if not city.isNone():
							if (bKillUnits):
									killPlot = gc.getMap().plot( tCityPlot[0], tCityPlot[1] )
									for i in range(killPlot.getNumUnits()):
											unit = killPlot.getUnit(0)
											unit.kill(False, iNewOwner)
							if (bFlipType): #conquest
									if (city.getPopulation() == 2):
											city.setPopulation(3)
									if (city.getPopulation() == 1):
											city.setPopulation(2)
									pNewOwner.acquireCity(city, True, False)
							else: #trade
									pNewOwner.acquireCity(city, False, True)

							if (bKillUnits):
									self.makeUnit(iUnits[0], 4, iNewOwner, tCityPlot, iUnits[1])
							return True
			return False
			
	def flipCity(self, tCityPlot, bFlipType, bKillUnits, iNewOwner, iOldOwners, iUnits):
			pNewOwner = gc.getPlayer(iNewOwner)
			city = gc.getMap().plot( tCityPlot[0], tCityPlot[1] ).getPlotCity()
			if (gc.getMap().plot(tCityPlot[0], tCityPlot[1]).isCity()):
					if not city.isNone():
							if (city.getOwner() in iOldOwners or not iOldOwners):
									iOldOwner = city.getOwner()
									if (bKillUnits):
											killPlot = gc.getMap().plot( tCityPlot[0], tCityPlot[1] )
											for i in range(killPlot.getNumUnits()):
													unit = killPlot.getUnit(0)
													unit.kill(False, iNewOwner)
									if (bFlipType): #conquest
											if (city.getPopulation() == 2):
													city.setPopulation(3)
											if (city.getPopulation() == 1):
													city.setPopulation(2)
											pNewOwner.acquireCity(city, True, False)
									else: #trade
											pNewOwner.acquireCity(city, False, True)

									if (bKillUnits):
											self.makeUnit(iUnits[0], 4, iNewOwner, tCityPlot, iUnits[1])
									return True
			return False
			
			
	def rename(self):
		washington = CyMap().plot(tWashington[0], tWashington[1]).getPlotCity()
		if (washington.getOwner() == iAmerica): 
			washington.setName('Washington', False)	
		if (washington.getOwner() == iSweden): 
			washington.setName('Fort Kristina', False)
			
			
	def renameCities(self):
			"""Renames a city depending on its owner"""
			for x in range(iWorldX):
					for y in range(iWorldY):
							city = gc.getMap().plot( x, y ).getPlotCity()
			
							sName = city.getName()

							if (city.getOwner() == iChina): 
									if sName == 'Khanbaliq':
											city.setName('Beijing', False)
									elif sName == 'Shinkyo':
											city.setName('Changchun', False)
									elif (sName == 'Chach' or sName == 'Shash' or sName == 'Tashkent' or sName == 'Binkath'):
											city.setName('Cheshih', False)
									elif (sName == 'Seoul' or sName == 'Keijo'):
											city.setName('Hancheng', False)
									elif sName == 'Port Edward':
											city.setName('Weihai', False)
									elif (sName == 'Cant&#227;o' or sName == 'Canton'):
											city.setName('Guangzhou', False)
									elif sName == 'Laoag':
											city.setName('Laowo', False)
									#Khmer
									elif sName == 'Indrapura':
											city.setName('Da Nang', False)
									elif sName == 'Vijaya':
											city.setName('Qui Nhon', False)
									elif sName == 'Panduranga':
											city.setName('Phan Rang', False)
									elif sName == 'Kauthara':
											city.setName('Nha Trang', False)

							elif (city.getOwner() == iGreece): 
									if (sName == 'Niwt-Rst' or sName == 'Thebae'):
											city.setName('Thebes', False)
									elif sName == 'Per-Wadjet':
											city.setName('Buto', False)
									elif sName == 'Ineb Hedj':
											city.setName('Memphis', False)
									elif sName == 'Abdju':
											city.setName('Abydos', False)
									elif (sName == 'Iunu' or sName == 'Per-Atum'):
											city.setName('Heliopolis', False)
									elif sName == 'Yebu':
											city.setName('Elephantine', False)
									elif (sName == 'Sin' or sName == 'Sena' or sName == 'Pelusium'):
											city.setName('Pelousion', False)
									elif sName == 'Ragha':
											city.setName('Rhagae', False)
									elif sName == 'Tisfun':
											city.setName('Ctesiphon', False)
									elif sName == 'Parsa':
											city.setName('Persepolis', False)
									elif sName == 'Pathragada':
											city.setName('Pasargadae', False)
									elif (sName == 'Shushan' or sName == 'Shush' or sName == 'Seleucia ad Eulaeum' or sName == 'Susa'):
											city.setName('Seleukeia Susiana', False)
									elif (sName == 'Sur' or sName == 'Tyrus' or sName == 'As-Sur'):
											city.setName('T&#253;ros', False)
									elif sName == 'Lpqy':
											city.setName('Lepcis', False)
									elif sName == 'Lixus':
											city.setName('Lixos', False)
									elif (sName == 'Ziz' or sName == 'Panormus' or sName == 'Balharm' or sName == 'Palermo'):
											city.setName('Panormos', False) 
									elif sName == 'Gadir':
											city.setName('Gades', False)
									elif (sName == 'Qart-Hadasht' or sName == 'Carthago'):
											city.setName('Karkhedon', False) 
									elif sName == 'Merv':
											city.setName('Margiana', False)
									elif sName == 'Ecbatana':
											city.setName('Hangmatana', False)
									elif (sName == 'Samarkand' or sName == 'Samarqand' or sName == 'Samarkant' or sName == 'Samarcande' or sName == 'Samarcanda' or sName == 'Afrosiab'):
											city.setName('Marakanda', False)
									elif (sName == 'Jerusalem' or sName == 'Yerushalayim' or sName == 'Kud&#252;s' or sName == 'Urshalim' or sName == 'Aelia Capitolina' or sName == 'Aarru-Hetep' or sName == 'Urushalim' or sName == 'Al-Quds' or sName == 'Qods' or sName == 'Hierusalem'):
											city.setName('Hierousalem', False)
									elif sName == 'Bhakri':
											city.setName('Bactra', False)
									elif (sName == 'Babili' or sName == 'Babel' or sName == 'Babil'):
											city.setName('Babylon', False)
									elif sName == 'Sauloe':
											city.setName('Hekatompilos', False)
									elif sName == 'Tureng Tepe':
											city.setName('Zadrakarta', False)
									elif sName == 'Tisfun':
											city.setName('Ctesiphon', False)
									elif (sName == 'Massilia' or sName == 'Marseille' or sName == 'Marsella'):
											city.setName('Massalia', False)
									elif sName == 'Dyrrachium':
											city.setName('Epidamnos', False)
									elif (sName == 'Athenae' or sName == 'Atina' or sName == 'Athen' or sName == 'Athens' or sName == 'Atenas' or sName == 'Ath&#232;nes'):
											city.setName('Athenai', False)
									elif (sName == 'Sparta' or sName == 'Esparta'):
											city.setName('Sparte', False)
									elif sName == 'Corinthus':
											city.setName('Korinthos', False)
									elif sName == 'Delphi':
											city.setName('Delphoi', False)
									elif sName == "Pi-Ramesses":
											city.setName('Avaris', False)
									elif sName == 'Djanet':
											city.setName('Tanis', False)
									elif sName == 'Attalea':
											city.setName('Attaleia', False)
									elif (sName == 'Anavarin' or sName == 'Navarino'):
											city.setName('Neokastron', False)
									elif sName == 'Inebahti':
											city.setName('Naupactus', False)
									elif sName == 'Gebal':
											city.setName('Byblos', False)
									elif sName == 'Paraetonium':
											city.setName('Paraitonion', False)
									elif sName == 'Cyrene':
											city.setName('Kyrene', False)
									elif sName == 'Syracusae':
											city.setName('Syrakousai', False)
									elif (sName == 'Moncastrum' or sName == 'Tiraspol' or sName == 'Akkerman' or sName == 'Wei&#223;enburg'):
											city.setName('Tyras', False)
									elif (sName == 'Miklagard' or sName == 'Bizantiya'):
											city.setName('Byzantion', False) 
									elif (sName == 'Qustantiniyah' or sName == 'Konstantinopel' or sName == 'Constantinopolis'):
											city.setName('Konstantinoupolis', False) 
									elif (sName == 'Trapezus' or sName == 'Tarabizun' or sName == 'Trabzon'):
											city.setName('Trapezon', False)
									elif (sName == 'Milid' or sName == 'Melitene' or sName == 'Malatya'):
											city.setName('Malateia', False)
									elif (sName == 'Mazaka' or sName == 'Caesarea Mazaca' or sName == 'Kayseri'):
											city.setName('Kaisareia', False)
									elif (sName == 'Karlsburg' or sName == 'Apulum' or sName == 'Balgrad'):
											city.setName('Apulon', False)
									elif (sName == 'Tomis' or sName == 'Konstanca' or sName == 'K&#246;stendsche' or sName == 'Kustendje'):
											city.setName('Konstantia', False)
									elif sName == 'Mycenae':
											city.setName('Mykenai', False)
									elif sName == 'Barbaricum':
											city.setName('Barbarikon', False)
									elif (sName == 'Chersonesus' or sName == 'Khersones'):
											city.setName('Chersonesos', False) 
									elif sName == 'Tiran':
											city.setName('Tirana', False)
									elif (sName == 'Venedig' or sName == 'Venise' or sName == 'Venecia' or sName == 'Venice' or sName == 'Veneza' or sName == 'Veneti&#235;' or sName == 'Venecija' or sName == 'Al-Bundukiyya' or sName == 'Venedik'):
											city.setName('Venetia', False)
									elif (sName == 'Iadera' or sName == 'Zadar'):
											city.setName('Zantar', False) 
									elif (sName == 'Wien' or sName == 'Vena' or sName == 'Vindobona' or sName == 'Viyana'):
											city.setName('Vienne', False)
									elif (sName == 'Laibach' or sName == 'Ljubljana' or sName == 'Aemona Iulia'):
											city.setName('Emona', False)
									elif (sName == 'Split' or sName == 'Spalatum'):
											city.setName('Aspalathos', False)
									elif (sName == 'Beograd' or sName == 'Singidunum' or sName == 'Belgrad'):
											city.setName('Singidun', False)
									elif (sName == 'Dimitrof&#231;e' or sName == 'Sirmium' or sName == 'Syrmisch Mitrowitz' or sName == 'Sremska Mitrovica'):
											city.setName('Sirmion', False)
									elif (sName == 'Felicitas Julia' or sName == 'Allis Ubbo' or sName == "Al-'Ishbunah"):
											city.setName('Olissipo', False)
									elif (sName == 'Ninua' or sName == 'Ninova' or sName == 'Ninawa'):
											city.setName('Nineve', False)
									elif sName == 'Artashat':
											city.setName('Artaxata', False)
									elif (sName == 'Khalpe' or sName == 'Halab' or sName == 'Halep'):
											city.setName('Beroea', False)
									elif (sName == 'Al-Iskandariya' or sName == 'Alexandria' or sName == 'Iskenderiye' or sName == 'Eskendereyya'):
											city.setName('Alexandreia', False)

							elif (city.getOwner() == iJapan): 
									if (sName == 'Pyongyang'):
											city.setName('Heijo', False)
									if (sName == 'Seoul' or sName == 'Hancheng'):
											city.setName('Keijo', False)
									elif sName == 'Changchun':
											city.setName('Shinkyo', False)

							elif (city.getOwner() == iEthiopia): 
									if sName == 'Maqadishu':
											city.setName('Muqdisho', False)
									elif (sName == 'Fort Gouraud'):
											city.setName('Fderik', False)
									elif (sName == 'Fort Polignac'):
											city.setName('Illizi', False)

							elif (city.getOwner() == iVikings or city.getOwner() == iSweden): 
									if (sName == 'Byzantion' or sName == 'Constantinopolis' or sName == 'Konstantinoupolis' or sName == 'Istanbul' or sName == 'Konstantinopel'):
											city.setName('Miklagard', False)
									elif sName == 'Gothenburg':
											city.setName('G&#246;teborg', False)
									elif (sName == 'Dublin' or sName == '&#193;th Cliath'):
											city.setName('Dubh Linn', False)
									elif sName == 'Staraja Lagoda':
											city.setName('Aldeigjuborg', False)
									elif sName == 'Novgorod':
											city.setName('Holmgard', False)
									elif sName == 'Staraja Lagoda':
											city.setName('Kiev', False)
									elif sName == 'Derby':
											city.setName('Deoraby', False)
									elif sName == 'York':
											city.setName('J&#243;rvik', False)
									elif sName == 'Kirkwall':
											city.setName('Kirkjuvagr', False)
									elif (sName == 'Kopenhagen' or sName == 'Copenhagen' or sName == 'Copenhague'):
											city.setName('Kj&#248;bmandehavn', False)
									elif (sName == 'Hedeby' or sName == 'Haithabu'):
											city.setName('Heithabyr', False)
									elif (sName == 'Anse-aux-M&#233;duses' or sName == 'Anse aux Meadows'):
											city.setName('Vinland', False)
									elif (sName == 'Tenochtitl&#225;n' or sName == 'Mexico City' or sName == 'Ciudad de M&#233;xico' or sName == 'Mexiko-Stadt' or sName == 'Mexicopolis' or sName == 'Cidade do M&#233;xico' or sName == 'Mexico-stad'):
											city.setName('Mexico', False)
									elif (sName == 'Havana' or sName == 'La Havane' or sName == 'La Habana'):
											city.setName('Havanna', False)
									elif sName == 'Wilmington':
											city.setName('Fort Kristina', False)
									elif (sName == 'Nueva Orleans' or sName == 'Nouvelle Orl&#233;ans' or sName == 'Nova Orle&#227;es'):
											city.setName('New Orleans', False)
									elif sName == 'Saint Thomas':
											city.setName('Sankt Thomas', False)
									elif sName == 'Wiborg':
											city.setName('Vyborg', False)
									elif sName == 'Helsinki':
											city.setName('Helsingfors', False)
									elif (sName == 'Tharangambadi' or sName == 'Tranquebar'):
											city.setName('Trankebar', False)
									elif sName == 'Serampore':
											city.setName('Frederiksnagore', False)
									elif sName == 'Osu':
											city.setName('Fort Christiansborg', False)
									elif sName == 'Keta':
											city.setName('Fort Prinsensten', False)
									elif sName == 'Takoradi':
											city.setName('Fort Witsten', False)
									elif (sName == 'Venetia' or sName == 'Venise' or sName == 'Venecia' or sName == 'Venice' or sName == 'Veneza' or sName == 'Veneti&#235;' or sName == 'Venecija' or sName == 'Al-Bundukiyya' or sName == 'Venedik'):
											city.setName('Venedig', False)

							elif (city.getOwner() == iArabia or city.getOwner() == iMorocco or city.getOwner() == iIran): 
									if (sName == 'Jerusalem' or sName == 'Yerushalayim' or sName == 'Ierusalim' or sName == 'Aelia Capitolina' or sName == 'Aarru-Hetep' or sName == 'Kud&#252;s' or sName == 'Hierusalem' or sName == 'Urushalim' or sName == 'Qods' or sName == 'Hierousalem'): 
											city.setName('Al-Quds', False)
									elif (sName == 'Tingi' or sName == 'Tanger' or sName == 'T&#225;nger'):
											city.setName('Tanja', False)
									elif sName == 'Pax Iulia':
											city.setName('Beja', False)
									elif (sName == 'Lisboa' or sName == 'Allis Ubbo' or sName == 'Olissipo' or sName == 'Felicitas Julia'):
											city.setName("Al-Lixbuna", False)
									elif (sName == 'Hippo' or sName == 'Hippo Regius'):
											city.setName('Annaba', False)
									elif (sName == 'Margiana' or sName == 'Margus'):
											city.setName('Merv', False)
									elif (sName == 'Oea' or sName == 'Regio Tripolitana' or sName == 'Tripoli' or sName == 'Tripolis' or sName == 'Trablus'):
											city.setName('Tarabulus', False)
									elif sName == 'Cirta':
											city.setName('Qusantinah', False)
									elif sName == 'Damaskos':
											city.setName('Dimashq', False)
									elif (sName == 'Berenikis' or sName == 'Berenice' or sName == 'Hesperides' or sName == 'Bingazi'):
											city.setName('Bangazi', False)
									elif sName == 'Siwa':
											city.setName('Siwah', False)
									elif (sName == 'Ziz' or sName == 'Panormos' or sName == 'Panormus' or sName == 'Palermo'):
											city.setName('Balharm', False)
									elif sName == 'Kabura':
											city.setName('Kabul', False)
									elif sName == 'Bhakri':
											city.setName('Balkh', False)
									elif sName == 'Neyshabur':
											city.setName('Nishapur', False)
									elif sName == 'Hangmatana':
											city.setName('Hamadan', False)
									elif (sName == 'Marakanda' or sName == 'Samarkand' or sName == 'Samarkant' or sName == 'Samarcande' or sName == 'Samarcanda' or sName == 'Afrosiab'):
											city.setName('Samarqand', False)
									elif sName == 'Casablanca':
											city.setName('Dar Beida', False)
									elif sName == 'S.Cruz de Mar Peque&#241;a':
											city.setName('Sidi Ifni', False)
									elif (sName == 'Sur' or sName == 'T&#253;ros' or sName == 'Tyrus'):
											city.setName('As-Sur', False)
									elif (sName == 'Cairo' or sName == 'Memphis' or sName == 'Ineb Hedj' or sName == 'Kahire' or sName == 'El-Qahirah'):
											city.setName('Al-Qahirah', False)
									elif (sName == "Pi-Ramesses" or sName == 'Avaris'):
											city.setName("Tell el-Dab'a", False)
									elif (sName == 'Djanet' or sName == 'Tanis'):
											city.setName('San el-Hagar', False)
									elif sName == 'Akabe':
											city.setName('Al-Aqabah', False)
									elif sName == 'Musul':
											city.setName('Mosul', False)
									elif (sName == 'Halep' or sName == 'Aleppo'):
											city.setName('Halab', False)
									elif (sName == 'Cezayir' or sName == 'Alger'):
											city.setName('Al-Jazair', False)
									elif sName == 'Tunus':
											city.setName('Tunis', False)
									elif (sName == 'Iskenderiye' or sName == 'Alexandreia' or sName == 'Alexandria' or sName == 'Eskendereyya'):
											city.setName('Al-Iskandariya', False)
									elif sName == 'Sam':
											city.setName('Dimashq', False)
									elif sName == 'Mekke':
											city.setName('Makkah', False)
									elif sName == 'Medine':
											city.setName('Madinah', False)
									elif sName == 'Bagdat':
											city.setName('Baghdad', False)
									elif (sName == 'Byblos' or sName == 'Gebal'):
											city.setName('Jbeil', False)
									elif sName == 'Hippo Diarrhytus':
											city.setName('Binzart', False)
									elif sName == 'Kandahar':
											city.setName('Qandahar', False)
									elif (sName == 'Ninua' or sName == 'Ninova' or sName == 'Nineve'):
											city.setName('Ninawa', False)
									elif sName == 'Kalhu':
											city.setName('Nimrud', False)
									elif (sName == 'Qart-Hadasht' or sName == 'Kartaca' or sName == 'Karkhedon' or sName == 'Carthago'):
											city.setName('Qartaj', False)
									elif (sName == 'Babili' or sName == 'Babel' or sName == 'Babylon'):
											city.setName('Babil', False)
									elif (sName == 'Sin' or sName == 'Sena' or sName == 'Pelusium' or sName == 'Pelusion'):
											city.setName('Tell el-Farama', False)
									elif (sName == 'Buto' or sName == 'Per-Wadjet'):
											city.setName('Kem Kasir', False)
									elif (sName == 'Kadesh' or sName == 'Qidshu'):
											city.setName('Tell Nebi Mend', False)
									elif sName == 'Serabit':
											city.setName('Serabit el-Khadem', False)
									elif (sName == 'Paraetonium' or sName == 'Paraitonion'):
											city.setName('Marsa Matruh', False)
									elif sName == 'Xou':
											city.setName('Sakha', False)
									elif (sName == 'Etsion-Gaber' or sName == 'Elath'):
											city.setName('Umm Rashrash', False)
									elif (sName == 'Per-Wadjet' or sName == 'Buto'):
											city.setName('Kem Kasir', False)
									elif (sName == 'Niwt-Rst' or sName == 'Thebes' or sName == 'Thebae' or sName == 'Luksor'):
											city.setName('Luxor', False)
									elif (sName == 'Per-Atum' or sName == 'Heliopolis'):
											city.setName('Tell-Hisn', False)
									elif sName == 'Mut':
											city.setName('Mut al-Khorab', False)
									elif sName == 'Kumma':
											city.setName('Semna', False)
									elif (sName == 'Malaka' or sName == 'Malaga'):
											city.setName('Malaqah', False)
									elif (sName == 'Byzantion' or sName == 'Miklagard'):
											city.setName('Bizantiya', False)
									elif (sName == 'Constantinopolis' or sName == 'Konstantinoupolis' or sName == 'Konstantinopel'):
											city.setName('Qustantiniyah', False)
									elif (sName == 'Rusadir' or sName == 'Melilla'):
											city.setName('Maliliyah', False)
									elif sName == 'Ankara':
											city.setName('Anqarah', False)	
									elif sName == 'Sevilla':
											city.setName('Ishbiliya', False)
									elif sName == 'C&#243;rdoba':
											city.setName('Qurtubah', False)	
									elif sName == 'Tehran':
											city.setName('Tahran', False)	
									elif (sName == 'Trapezon' or sName == 'Trapezus' or sName == 'Trabzon'):
											city.setName('Tarabizun', False)
									elif (sName == 'Chach' or sName == 'Cheshih' or sName == 'Binkath'):
											city.setName('Shash', False)
									elif (sName == 'Iol Caesarea' or sName == 'Iol'):
											city.setName('Sharshal', False)
									elif (sName == 'Abdju' or sName == 'Abydos'):
											city.setName('Arabet', False)
									elif sName == 'Imu':
											city.setName('Kom el-Hisn', False)
									elif (sName == 'Lpqy' or sName == 'Leptis Magna' or sName == 'Lepcis'):
											city.setName('Libdeh al-Kubra', False)
									elif (sName == 'Villa Cisneros' or sName == 'Dakhla'):
											city.setName('ad-Dakhla', False)
									elif (sName == 'Persepolis' or sName == 'Parsa'):
											city.setName('Takht-e Jamshid', False)
									elif (sName == 'Cyrene' or sName == 'Kyrene'):
											city.setName('Shahat', False)
									elif sName == 'Sirajis':
											city.setName('Shiraz', False)
									elif (sName == 'Sparte' or sName == 'Esparta'):
											city.setName('Sparta', False)
									elif sName == 'Almer&#237;a':
											city.setName('Al-Mariyat', False)
									elif (sName == 'Or&#225;n' or sName == 'Oran'):
											city.setName('Wahran', False)
									elif (sName == 'Bug&#2237;a' or sName == 'B&#233;ja&#239;a'):
											city.setName('Bijayah', False)
									elif sName == 'Siwa':
											city.setName('Siwah', False)
									elif (sName == 'Venedig' or sName == 'Venise' or sName == 'Venecia' or sName == 'Venice' or sName == 'Veneza' or sName == 'Veneti&#235;' or sName == 'Venecija' or sName == 'Venetia' or sName == 'Venedik'):
											city.setName('Al-Bundukiyya', False)
									elif (sName == 'Toletum' or sName == 'Toledo'):
											city.setName('Tulaytulah', False)
									elif sName == 'Madrid':
											city.setName('Al-Magrit', False)
									elif (sName == 'Valentia' or sName == 'Valencia'):
											city.setName('Balansiyyah', False)
									elif (sName == 'Caesaraugusta' or sName == 'Zaragoza'):
											city.setName('Saraqustah', False)
									elif (sName == 'Pompaelo' or sName == 'Pamplona' or sName == 'Pampelune'):
											city.setName('Bambalunah', False)
									elif (sName == 'Portus Cale' or sName == 'Porto' or sName == 'Oporto'):
											city.setName('Burtuqal', False)
									elif (sName == 'Faro' or sName == 'Ossonoba'):
											city.setName("'Uhshunubah", False)
									elif sName == 'Akhetaten':
											city.setName("Al-'Amarna", False) 
									elif sName == 'Kuveyt':
											city.setName("Al-Kuwait", False)
									elif sName == 'Siraz':
											city.setName("Shiraz", False)
									elif sName == 'Basra':
											city.setName("Al-Basrah", False)
									elif sName == 'Riyad':
											city.setName("Ar-Riyad", False)
									elif sName == 'Necef':
											city.setName("An-Najaf", False)
									elif sName == 'Amman':
											city.setName("'Amman", False)
									elif sName == 'Hurgada':
											city.setName("Al-Ghardaqah", False)
									elif sName == "Tobruk":
											city.setName('Tubruq', False)
									elif (sName == 'Sala' or sName == 'Sala Colonia'):
											city.setName('Chellah', False)
									elif (sName == 'Mogador' or sName == 'Essaouira'):
											city.setName('Es-Sauirah', False)
									elif (sName == 'Praga' or sName == 'Prag' or sName == 'Praha'):
											city.setName('Birag', False)
									elif sName == 'Safakes':
											city.setName('Safaqis', False)
									elif (sName == 'Tacape' or sName == 'Gabes' or sName == 'Gab&#232;s'):
											city.setName('Qabis', False)
									elif (sName == 'Khartoum' or sName == 'Hartum'):
											city.setName('Al-Hartum', False)
									elif (sName == 'C&#243;rdoba' or sName == 'Corduba' or sName == 'C&#243;rdova'):
											city.setName('Qurtuba', False)
									#Turkey
									if (sName == 'Amisos' or sName == 'Amisus'):
											city.setName('Samsun', False)
									elif (sName == 'Milid' or sName == 'Malateia' or sName == 'Melitene'):
											city.setName('Malatya', False)
									elif (sName == 'Mazaka' or sName == 'Caesarea Mazaca' or sName == 'Kaisareia'):
											city.setName('Kayseri', False)
									elif (sName == 'Antiokheia Megale' or sName == 'Antiochia ad Orontem' or sName == 'Antakya'):
											city.setName('Antakiyyah', False)
									elif (sName == 'Alexandreia ad Issum' or sName == 'Iskenderun' or sName == 'Alexandretta'):
											city.setName('Al-Iskandarun', False)
									elif (sName == 'Ikonion' or sName == 'Iconium'):
											city.setName('Konya', False)
									elif (sName == 'Khalpe' or sName == 'Beroea' or sName == 'Halep'):
											city.setName('Halab', False)
									#Ethiopia
									elif sName == 'Muqdisho':
											city.setName('Maqadishu', False)

							elif (city.getOwner() == iKhmer): 
									if (sName == 'Malacca' or sName == 'Malakka'):
											city.setName('Bandar Melaka', False)

							elif (city.getOwner() == iSpain or city.getOwner() == iColombia or city.getOwner() == iMexico or city.getOwner() == iArgentina): 
									if (sName == 'Gadir' or sName == 'Qart-Gadir' or sName == 'Gades'):
											city.setName('C&#225;diz', False)
									elif (sName == 'Toletum' or sName == 'Tulaytulah'):
											city.setName('Toledo', False)
									elif (sName == 'Valentia' or sName == 'Balansiyyah'):
											city.setName('Valencia', False)
									elif sName == 'Tarraco':
											city.setName('Tarragona', False)
									elif (sName == 'Caesaraugusta' or sName == 'Saraqustah'):
											city.setName('Zaragoza', False)
									elif sName == 'Brigantium':
											city.setName('La Coru&#241;a', False)
									elif sName == 'Hispalis':
											city.setName('Sevilla', False)
									elif sName == 'Asturica Augusta':
											city.setName('Astorga', False)		
									elif sName == 'Emerita Augusta':
											city.setName('M&#233;rida', False)	
									elif (sName == 'Emporion' or sName == 'Emporiae'):
											city.setName('Ampurias', False)
									elif sName == 'Saguntum':
											city.setName('Sagunto', False)	
									elif (sName == 'Nova Carthago' or sName == 'Qart Hadasht'):
											city.setName('Cartagena', False)	
									elif (sName == 'Rusadir' or sName == 'Maliliyah'):
											city.setName('Melilla', False)	
									elif (sName == 'Tenochtitl&#225;n' or sName == 'Mexico City' or sName == 'Mexico' or sName == 'Mexiko-Stadt' or sName == 'Mexicopolis' or sName == 'Cidade do M&#233;xico' or sName == 'Mexico-stad'):
											city.setName('Ciudad de M&#233;xico', False)
									elif (sName == 'Melpum' or sName == 'Mailand' or sName == 'Mediolanum' or sName == 'Milan'):
											city.setName('Mil&#225n', False)
									elif sName == 'Numantia':
											city.setName('Numancia', False)
									elif (sName == 'Tingi' or sName == 'Tanger' or sName == 'Tanja'):
											city.setName('T&#225;nger', False)
									elif (sName == 'Malaka' or sName == 'Malaqah'):
											city.setName('Malaga', False)
									elif sName == 'Ishbiliya':
											city.setName('Sevilla', False)
									elif sName == 'Qurtubah':
											city.setName('C&#243;rdoba', False)
									elif sName == 'St. Augustine':
											city.setName('San Agust&#237;n', False)	
									elif (sName == 'Panormos' or sName == 'Panormus' or sName == 'Balharm' or sName == 'Ziz'):
											city.setName('Palermo', False)  
									elif (sName == 'Rome' or sName == 'Rom'):
											city.setName('Roma', False)
									elif (sName == 'Iol Caesarea' or sName == 'Iol' or sName == 'Sharshal'):
											city.setName('Cherchell', False)
									elif (sName == 'Massalia' or sName == 'Massilia' or sName == 'Marseille'):
											city.setName('Marsella', False)
									elif sName == 'Bracara Augusta':
											city.setName('Braga', False)
									elif (sName == 'Felicitas Julia' or sName == 'Allis Ubbo' or sName == 'Olissipo' or sName == "Al-Lixbuna"):
											city.setName('Lisboa', False)
									elif (sName == 'Pompaelo' or sName == 'Pampelune' or sName == 'Bambalunah'):
											city.setName('Pamplona', False)
									elif sName == 'Dar Beida':
											city.setName('Casablanca', False)
									elif sName == 'Sidi Ifni':
											city.setName('S.Cruz de Mar Peque&#241;a', False)
									elif sName == 'Pax Iulia':
											city.setName('Beja', False)
									elif (sName == 'Samarkand' or sName == 'Samarqand' or sName == 'Samarkant' or sName == 'Samarcande' or sName == 'Marakanda' or sName == 'Afrosiab'):
											city.setName('Samarcanda', False)
									elif (sName == 'ad-Dakhla' or sName == 'Dakhla'):
											city.setName('Villa Cisneros', False)
									elif (sName == 'Saint Domingue' or sName == 'Dakhla'):
											city.setName('Santo Domingo', False)
									elif (sName == 'Li&#232;ge' or sName == 'Luik' or sName == 'L&#252;ttich'):
											city.setName('Lieja', False)
									elif (sName == 'Sint-Helena' or sName == 'Saint Helena'):
											city.setName('Santa Helena', False)
									elif (sName == 'Cap Horn' or sName == 'Kaap Hoorn' or sName == 'Cape Horn'):
											city.setName('Cabo de Hornos', False)
									elif (sName == 'Pompeji' or sName == 'Pompeii' or sName == 'Pomp&#233;i'):
											city.setName('Pompeya', False)
									elif (sName == 'Athenae' or sName == 'Athenai' or sName == 'Athen' or sName == 'Athens' or sName == 'Atina' or sName == 'Ath&#232;nes'):
											city.setName('Atenas', False)
									elif (sName == 'Oea' or sName == 'Regio Tripolitana' or sName == 'Tarabulus' or sName == 'Tripolis' or sName == 'Trablus'):
											city.setName('Tripoli', False)
									elif (sName == 'Sparte' or sName == 'Sparta'):
											city.setName('Esparta', False)
									elif (sName == 'Bandar Melaka' or sName == 'Malakka'):
											city.setName('Malacca', False)
									elif (sName == 'Corunha' or sName == 'The Groyne' or sName == 'La Corogne'):
											city.setName('La Coru&#241;a', False)
									elif (sName == 'Burdigala' or sName == 'Bordeaux'):
											city.setName('Burdeos', False)
									elif (sName == 'Havana' or sName == 'Havanna' or sName == 'La Havane'):
											city.setName('La Habana', False)
									elif (sName == 'New Orleans' or sName == 'Nouvelle Orl&#233;ans' or sName == 'Nova Orle&#227;es'):
											city.setName('Nueva Orleans', False)
									elif (sName == 'Klein-Venedig'):
											city.setName('Venezuela', False)
									elif (sName == 'Trefel&#237;n'):
											city.setName('Trevelin', False)
									elif (sName == 'Porth Madryn'):
											city.setName('Puerto Madryn', False)
									elif sName == 'Lle Cul':
											city.setName('Villa La Angostura', False)
									elif sName == 'Spatzenkutter':
											city.setName('Asunci&#243;n', False)
									elif sName == 'Holtzel':
											city.setName('Colonia Nievas', False)
									elif sName == 'Dehler':
											city.setName('Colonia San Miguel', False)
									elif sName == 'Hildmann':
											city.setName('Santa Trinidad', False)
									elif sName == 'Onuba':
											city.setName('Huelva', False)
									elif (sName == 'Barcino' or sName == 'Barcelone'):
											city.setName('Barcelona', False)
									elif sName == 'Al-Mariyat':
											city.setName('Almer&#237;a', False)
									elif (sName == 'Cape of Good Hope' or sName == 'Capo de Boa Esperan&#231;a' or sName == 'Cap de Bonne-Esp&#233;rance' or sName == 'Kap der Guten Hoffnung' or sName == 'Kaap de Goede Hoop'):
											city.setName('Cabo de Buena Esperanza', False)
									elif (sName == 'Wahran' or sName == 'Oran'):
											city.setName('Or&#225;n', False)
									elif (sName == 'Bijayah' or sName == 'B&#233;ja&#239;a'):
											city.setName('Bug&#2237;a', False)
									elif sName == 'Victoriae Iuliobrigensium':
											city.setName('Santander', False)
									elif sName == 'Helmantica':
											city.setName('Salamanca', False)
									elif (sName == 'Portus Cale' or sName == 'Porto' or sName == 'Burtuqal'):
											city.setName('Oporto', False)
									elif (sName == 'Ossonoba' or sName == "'Uhshunubah"):
											city.setName('Faro', False)
									elif (sName == 'Venedig' or sName == 'Venise' or sName == 'Venetia' or sName == 'Venice' or sName == 'Veneza' or sName == 'Veneti&#235;' or sName == 'Venecija' or sName == 'Al-Bundukiyya' or sName == 'Venedik'):
											city.setName('Venecia', False)
									elif sName == 'Al-Magrit':
											city.setName('Madrid', False)
									elif (sName == 'Mogador' or sName == 'Es-Sauirah'):
											city.setName('Essaouira', False)
									elif sName == 'Brigantium':
											city.setName('Betanzos', False)
									elif sName == 'Maynilad':
											city.setName('Manila', False)
									elif (sName == 'Qurtuba' or sName == 'Corduba' or sName == 'C&#243;rdova'):
											city.setName('C&#243;rdoba', False)
									elif sName == 'Col&#244;nia do Sacramento':
											city.setName('Colonia del Sacramento', False)
									#inca
									elif sName == 'Quitu':
											city.setName('Quito', False)
									elif sName == 'Tucume':
											city.setName('T&#250;cume', False)
									elif sName == 'Chan-Chan':
											city.setName('Chanchan', False) #Trujillo
									elif sName == 'Pachacamaq':
											city.setName('Pachacamac', False)
									elif sName == 'Machu-Pikchu':
											city.setName('Machu Picchu', False)
									elif sName == 'Qusqu':
											city.setName('Cuzco', False)
									elif sName == 'Ariqipaya':
											city.setName('Arequipa', False)
									elif sName == 'Tiyawanaku':
											city.setName('Tiahuanaco', False) #Tihuanaku? #Tiwanaku? #Puno?
									elif sName == 'Caqonatambu':
											city.setName('Limatambo', False)
									elif sName == 'Coqimpu':
											city.setName('Coquimbo', False)
									elif sName == 'Ullantaytanpu':
											city.setName('Ollantaytambo', False)
									elif sName == 'Vitcos':
											city.setName('Piura', False)
									elif sName == 'Andahuailas':
											city.setName('Andahuaylas', False)
									elif sName == 'Acari':
											city.setName('Atico', False)
									elif sName == 'Lluli':
											city.setName('Juli', False)
									elif sName == 'Chuqiapu':
											city.setName('Chuquiapo', False)
									elif sName == 'Huanuqupampa':
											city.setName('Huanucopampa', False)
									elif sName == 'Tambuqcucha':
											city.setName('Tamboccocha', False)
									elif sName == 'Huaraz':
											city.setName('Huaras', False)
									elif sName == 'Cacsamalca':
											city.setName('Caxamalca', False)
									elif sName == 'Sauza':
											city.setName('Sausa', False)
									elif sName == 'Tampupuca':
											city.setName('Tambocolorado', False)
									elif sName == 'Huaqa':
											city.setName('Huaca', False)
									elif sName == 'Chuitu':
											city.setName('Chuito', False)
									elif sName == 'Cajamarca':
											city.setName('Caiamarca', False)
									elif sName == 'Lauricucha':
											city.setName('Hu&#225;nuco', False)
									elif sName == 'Tomebamba':
											city.setName('Cuenca', False)
									elif sName == 'Jauja':
											city.setName('Sausa', False)

							elif (city.getOwner() == iFrance): 
									if (sName == 'Lutetia' or sName == 'Lutetia Parisiorum' or sName == 'Parijs'):
											city.setName('Paris', False)
									elif sName == 'Rotomagus':
											city.setName('Rouen', False)
									elif (sName == 'Lugdunum' or sName == 'Lugodunon'):
											city.setName('Lyon', False)
									elif sName == 'Aquae Sextiae':
											city.setName('Aix-en-Provence', False)
									elif (sName == 'Massalia' or sName == 'Massilia' or sName == 'Marsella'):
											city.setName('Marseille', False)
									elif sName == 'Turonensis':
											city.setName('Tours', False)
									elif sName == 'Aurelia':
											city.setName('Orl&#233;ans', False)
									elif sName == 'Lapurdum':
											city.setName('Bayonne', False)
									elif (sName == 'Burdigala' or sName == 'Burdeos'):
											city.setName('Bordeaux', False)
									elif sName == 'Narbo Martius':
											city.setName('Narbonne', False)
									elif sName == 'Limonum':
											city.setName('Poitiers', False)
									elif sName == 'Tolosa':
											city.setName('Toulouse', False)
									elif sName == 'Caesarodunum':
											city.setName('Tours', False)
									elif sName == 'Portus Namnetum':
											city.setName('Nantes', False)
									elif sName == 'Gesocribate':
											city.setName('Brest', False)
									elif sName == 'Condate Redonum':
											city.setName('Rennes', False)
									elif sName == 'Augustodurum':
											city.setName('Bayeux', False)
									elif sName == 'Durocoturum':
											city.setName('Reims', False)
									elif sName == 'Cenabum Aureliani':
											city.setName('Orl&#233;ans', False)
									elif sName == 'Vesontio':
											city.setName('Besan&#231;on', False)
									elif sName == 'Lousonna':
											city.setName('Lausanne', False)
									elif (sName == 'Argentoratus' or sName == 'Stra&#223;burg'):
											city.setName('Strasbourg', False)
									elif sName == 'Augusta Treverorum':
											city.setName('Tr&#232;ves', False)
									elif sName == 'Gesoriacum':
											city.setName('Boulogne', False)
									elif (sName == 'Nijmegen' or sName == 'Batavodurum'):
											city.setName('Nim&#232;gue', False)
									elif sName == 'Iuliomagus':
											city.setName('Angers', False)
									elif sName == 'Iuliomagus':
											city.setName('Angers', False)
									elif sName == 'Nemausus':
											city.setName('N&#238;mes', False)
									elif (sName == 'Melpum' or sName == 'Mailand' or sName == 'Mediolanum' or sName == 'Mil&#225n'):
											city.setName('Milan', False)
									elif sName == 'Genava':
											city.setName('Gen&#232ve', False)
									elif sName == 'Castra Regina':
											city.setName('Ratisbonne', False)
									elif (sName == 'Aachen' or sName == 'Aquisgranum' or sName == 'Aken'):
											city.setName('Aix-la-Chapelle', False)
									elif (sName == 'Copenhagen' or sName == 'Kopenhagen' or sName == 'Kj&#248;bmandehavn'):
											city.setName('Copenhague', False)
									elif (sName == 'Al-Jazair' or sName == 'Cezayir'):
											city.setName('Alger', False)
									elif (sName == 'Tingi' or sName == 'T&#225;nger' or sName == 'Tanja'):
											city.setName('Tanger', False)
									elif (sName == 'Dubh Linn' or sName == '&#193;th Cliath'):
											city.setName('Dublin', False)
									elif (sName == 'Heithabyr' or sName == 'Haithabu'):
											city.setName('Hedeby', False)
									elif (sName == 'Epidamnos' or sName == 'Dyrrachium' or sName == 'Durr&#235;s' or sName == 'Drach' or sName == 'Dira&#231'):
											city.setName('Duras', False)
									elif (sName == 'Moguntiacum' or sName == 'Mogontiacum' or sName == 'Mainz'):
											city.setName('Mayence', False)
									elif (sName == 'Roma' or sName == 'Rom'):
											city.setName('Rome', False)
									elif sName == 'Bremen':
											city.setName('Br&#234;me', False)
									elif (sName == 'Iol Caesarea' or sName == 'Iol' or sName == 'Sharshal'):
											city.setName('Cherchell', False)
									elif (sName == 'Panormos' or sName == 'Panormus' or sName == 'Balharm' or sName == 'Ziz'):
											city.setName('Palermo', False) 
									elif (sName == 'Samarkand' or sName == 'Samarqand' or sName == 'Samarkant' or sName == 'Samarcanda' or sName == 'Marakanda' or sName == 'Afrosiab'):
											city.setName('Samarcande', False) 
									elif (sName == 'Santo Domingo' or sName == 'Dakhla'):
											city.setName('Saint Domingue', False)
									elif (sName == 'Brussels' or sName == 'Br&#252;ssel' or sName == 'Brussel'):
											city.setName('Bruxelles', False)
									elif (sName == 'Lieja' or sName == 'Luik' or sName == 'L&#252;ttich'):
											city.setName('Li&#232;ge', False)
									elif (sName == 'Hamburg' or sName == 'Iol' or sName == 'Hamborg'):
											city.setName('Hambourg', False)
									elif (sName == 'Knob Lake'):
											city.setName('Lac Knob', False)
									elif (sName == 'Quebec City'):
											city.setName('Qu&#233;bec', False)
									elif (sName == 'Sa&#245; Lu&#237;s'):
											city.setName('Saint Louis', False)
									elif (sName == 'New Orleans' or sName == 'Nueva Orleans' or sName == 'Nova Orle&#227;es'):
											city.setName('Nouvelle Orl&#233;ans', False)
									elif (sName == 'Cabo de Hornos' or sName == 'Kaap Hoorn' or sName == 'Cape Horn'):
											city.setName('Cap Horn', False)
									elif (sName == 'Little Chute'):
											city.setName('La Petite Chute', False)
									elif (sName == 'Vinland' or sName == 'Anse aux Meadows'):
											city.setName('Anse-aux-M&#233;duses', False)
									elif (sName == 'Agley' or sName == 'Oglej' or sName == 'Aquileia'):
											city.setName('Aquil&#233;e', False)
									elif (sName == 'Londinium' or sName == 'London'):
											city.setName('Londres', False)
									elif (sName == 'Pompeji' or sName == 'Pompeii' or sName == 'Pompeya'):
											city.setName('Pomp&#233;i', False)
									elif (sName == 'Athenae' or sName == 'Athenai' or sName == 'Athen' or sName == 'Athens' or sName == 'Atina' or sName == 'Atenas'):
											city.setName('Ath&#232;nes', False)
									elif (sName == 'Oea' or sName == 'Regio Tripolitana' or sName == 'Tarabulus' or sName == 'Tripolis' or sName == 'Trablus'):
											city.setName('Tripoli', False)
									elif (sName == 'Sparta' or sName == 'Esparta'):
											city.setName('Sparte', False)
									elif (sName == 'Tenochtitl&#225;n' or sName == 'Mexico City' or sName == 'Ciudad de M&#233;xico' or sName == 'Mexiko-Stadt' or sName == 'Mexicopolis' or sName == 'Cidade do M&#233;xico' or sName == 'Mexico-stad'):
											city.setName('Mexico', False)
									elif (sName == 'Fderik'):
											city.setName('Fort Gouraud', False)
									elif (sName == 'Illizi'):
											city.setName('Fort Polignac', False)
									elif (sName == 'Havana' or sName == 'Havanna' or sName == 'La Habana'):
											city.setName('La Havane', False)
									elif (sName == 'Klein-Venedig'):
											city.setName('Venezuela', False)
									elif sName == 'Sankt Thomas':
											city.setName('Saint Thomas', False)
									elif (sName == 'Guangzhou' or sName == 'Cant&#227;o'):
											city.setName('Canton', False)
									elif (sName == 'Cape of Good Hope' or sName == 'Capo de Boa Esperan&#231;a' or sName == 'Cabo de Buena Esperanza' or sName == 'Kap der Guten Hoffnung' or sName == 'Kaap de Goede Hoop'):
											city.setName('Cap de Bonne-Esp&#233;rance', False)
									elif (sName == 'Bijayah' or sName == 'Bug&#2237;a'):
											city.setName('B&#233;ja&#239;a', False)
									elif (sName == 'Or&#225;n' or sName == 'Wahran'):
											city.setName('Oran', False)
									elif (sName == 'Tharangambadi' or sName == 'Trankebar'):
											city.setName('Tranquebar', False)
									elif (sName == 'Venedig' or sName == 'Venecia' or sName == 'Venetia' or sName == 'Venice' or sName == 'Veneza' or sName == 'Veneti&#235;' or sName == 'Venecija' or sName == 'Al-Bundukiyya' or sName == 'Venedik'):
											city.setName('Venise', False)
									elif (sName == 'Wien' or sName == 'Vena' or sName == 'Vindobona' or sName == 'Viyana'):
											city.setName('Vienne', False)
									elif sName == 'Arguim':
											city.setName('Arguin', False)
									elif (sName == 'Corunha' or sName == 'The Groyne' or sName == 'La Coru&#241;a'):
											city.setName('La Corogne', False)
									elif (sName == 'Pompaelo' or sName == 'Pamplona' or sName == 'Bambalunah'):
											city.setName('Pampelune', False)
									elif (sName == 'Pondicherry' or sName == 'Puducherry'):
											city.setName('Pondich&#233;ry', False)
									elif (sName == 'Tacape' or sName == 'Gabes' or sName == 'Qabis'):
											city.setName('Gab&#232;s', False)
									elif (sName == 'Barcino' or sName == 'Barcelona'):
											city.setName('Barcelone', False)
									#Khmer
									elif sName == 'Bang Makok':
											city.setName('Bangkok', False)
									#Ethiopia
									elif sName == 'Jabuuti':
											city.setName('Djibouti', False)

							elif (city.getOwner() == iEngland): 
									if (sName == 'Londinium' or sName == 'Londres'):
											city.setName('London', False)
									elif sName == 'Ebracum':
											city.setName('York', False)
									elif sName == 'Aquae Sulis':
											city.setName('Bath', False)
									elif sName == 'Durovernum':
											city.setName('Canterbury', False)
									elif sName == 'Venta Belgarum':
											city.setName('Winchester', False)
									elif sName == 'Isca Dumnoniorum':
											city.setName('Exeter', False)
									elif sName == 'Deva':
											city.setName('Chester', False)
									elif sName == 'Camulodunum':
											city.setName('Colchester', False)
									elif sName == 'Isca Silurum':
											city.setName('Caerleon', False)
									elif sName == 'Mancunium':
											city.setName('Manchester', False)
									elif sName == 'Luguvallium':
											city.setName('Carlisle', False)
									elif (sName == 'Eblana' or sName == 'Dubh Linn'):
											city.setName('Dublin', False)
									elif sName == 'Luguvallium':
											city.setName('Carlisle', False)
									elif (sName == 'Melpum' or sName == 'Mailand' or sName == 'Mediolanum' or sName == 'Mil&#225n'):
											city.setName('Milan', False)
									elif sName == 'G&#246;teborg':
											city.setName('Gothenburg', False)
									elif (sName == 'Copenhague' or sName == 'Kopenhagen' or sName == 'Kj&#248;bmandehavn'):
											city.setName('Copenhagen', False)
									elif sName == 'Nieuw Amsterdam':
											city.setName('New York', False)
									elif (sName == 'Dubh Linn' or sName == '&#193;th Cliath'):
											city.setName('Dublin', False)
									elif sName == 'Deoraby':
											city.setName('Derby', False)
									elif sName == 'J&#243;rvik':
											city.setName('York', False)
									elif sName == 'Kirkjuvagr':
											city.setName('Kirkwall', False)
									elif sName == 'San Agust&#237;n':
											city.setName('St. Augustine', False)
									elif sName == 'B&#233;al Feirste':
											city.setName('Belfast', False)
									elif sName == 'Kaapstadt':
											city.setName('Cape Town', False)
									elif (sName == 'Santa Helena' or sName == 'Sint-Helena'):
											city.setName('Saint Helena', False)
									elif (sName == 'Bruxelles' or sName == 'Br&#252;ssel' or sName == 'Brussel'):
											city.setName('Brussels', False)
									elif (sName == 'Lac Knob'):
											city.setName('Knob Lake', False)
									elif (sName == 'Qu&#233;bec'):
											city.setName('Quebec City', False)
									elif (sName == 'Nueva Orleans' or sName == 'Nouvelle Orl&#233;ans' or sName == 'Nova Orle&#227;es'):
											city.setName('New Orleans', False)
									elif (sName == 'Cabo de Hornos' or sName == 'Kaap Hoorn' or sName == 'Cap Horn'):
											city.setName('Cape Horn', False)
									elif (sName == 'Fort Zeelandia' or sName == 'Paramaribo'):
											city.setName('Fort Willoughby', False)
									elif sName == 'Fort Goede Hoop':
											city.setName('Hartford', False)
									elif sName == 'Beverwyck':
											city.setName('Albany', False)
									elif sName == 'Fort Beversreede':
											city.setName('Philadelphia', False)
									elif sName == 'Wilmington':
											city.setName('Nieuwer-Amstel', False)
									elif (sName == 'La Petite Chute'):
											city.setName('Little Chute', False)
									elif (sName == 'Vinland' or sName == 'Anse-aux-M&#233;duses'):
											city.setName('Anse aux Meadows', False)
									elif (sName == 'Tenochtitl&#225;n' or sName == 'Ciudad de M&#233;xico' or sName == 'Mexico' or sName == 'Mexiko-Stadt' or sName == 'Mexicopolis' or sName == 'Cidade do M&#233;xico' or sName == 'Mexico-stad'):
											city.setName('Mexico City', False)
									elif (sName == 'Athenae' or sName == 'Athenai' or sName == 'Athen' or sName == 'Ath&#232;nes' or sName == 'Atina' or sName == 'Atenas'):
											city.setName('Athens', False)
									elif (sName == 'Oea' or sName == 'Regio Tripolitana' or sName == 'Tarabulus' or sName == 'Tripolis' or sName == 'Trablus'):
											city.setName('Tripoli', False)
									elif (sName == 'Sparte' or sName == 'Esparta'):
											city.setName('Sparta', False)
									elif (sName == 'Jekabforts'):
											city.setName('Fort James', False)
									elif sName == 'Novo-Arkhangelsk':
											city.setName('Sitka', False)
									elif sName == "Krepost' Rus'":
											city.setName("Fort Ross", False)
									elif (sName == 'Havanna' or sName == 'La Havane' or sName == 'La Habana'):
											city.setName('Havana', False)
									elif sName == 'Fort Kristina':
											city.setName('Wilmington', False)
									elif (sName == 'Klein-Venedig'):
											city.setName('Venezuela', False)
									elif sName == 'Sankt Thomas':
											city.setName('Saint Thomas', False)
									elif sName == 'Fort D&#233;troit':
											city.setName('Detroit', False)
									elif sName == 'Weihai':
											city.setName('Port Edward', False)
									elif (sName == 'Guangzhou' or sName == 'Cant&#227;o'):
											city.setName('Canton', False)
									elif (sName == 'Cap de Bonne-Esp&#233;rance' or sName == 'Capo de Boa Esperan&#231;a' or sName == 'Cabo de Buena Esperanza' or sName == 'Kap der Guten Hoffnung' or sName == 'Kaap de Goede Hoop'):
											city.setName('Cape of Good Hope', False)
									elif sName == 'Fort Frontenac':
											city.setName('Kingston', False)
									elif (sName == 'Frankfurt' or sName == 'Bona Mansio'):
											city.setName('Francfort', False)
									elif (sName == 'Venedig' or sName == 'Venecia' or sName == 'Venetia' or sName == 'Venise' or sName == 'Veneza' or sName == 'Veneti&#235;' or sName == 'Venecija' or sName == 'Al-Bundukiyya' or sName == 'Venedik'):
											city.setName('Venice', False)
									elif (sName == 'Hierusalem' or sName == 'Yerushalayim' or sName == 'Ierusalim' or sName == 'Aelia Capitolina' or sName == 'Aarru-Hetep' or sName == 'Kud&#252;s' or sName == 'Urshalim' or sName == 'Hierousalem' or sName == 'Urushalim' or sName == 'Al-Quds' or sName == 'Qods'): 
											city.setName('Jerusalem', False)
									elif (sName == 'Al-Iskandariya' or sName == 'Alexandreia' or sName == 'Iskenderiye' or sName == 'Eskendereyya'):
											city.setName('Alexandria', False)
									elif (sName == 'Al-Qahirah' or sName == 'Memphis' or sName == 'Ineb Hedj' or sName == 'Kahire' or sName == 'El-Qahirah'):
											city.setName('Cairo', False)
									elif sName == 'Arguim':
											city.setName('Arguin', False)
									elif (sName == 'Corunha' or sName == 'La Corogne' or sName == 'La Coru&#241;a'):
											city.setName('The Groyne', False)
									elif sName == "Tubruq":
											city.setName('Tobruk', False)
									elif (sName == 'Pondich&#233;ry' or sName == 'Puducherry'):
											city.setName('Pondicherry', False)
									elif (sName == 'Mumbai' or sName == 'Bombaim'):
											city.setName('Bombay', False)
									elif (sName == 'Al-Hartum' or sName == 'Hartum'):
											city.setName('Khartoum', False)
									elif sName == 'Neu Braunfels':
											city.setName('New Braunfels', False)

							elif (city.getOwner() == iGermany or city.getOwner() == iAustria): 
									if sName == 'Colonia Agrippina':
											city.setName('K&#246;ln', False)
									elif sName == 'Lentia':
											city.setName('Linz', False)
									elif sName == 'Gran':
											city.setName('Esztergom', False)
									elif (sName == 'Augusta Vindelicorum' or sName == 'Damasia'):
											city.setName('Augsburg', False)
									elif (sName == 'Moguntiacum' or sName == 'Mogontiacum' or sName == 'Mayence'):
											city.setName('Mainz', False)
									elif (sName == 'Vienne' or sName == 'Vena' or sName == 'Vindobona' or sName == 'Viyana'):
											city.setName('Wien', False)
									elif (sName == 'Castra Regina' or sName == 'Ratisbonne'):
											city.setName('Regensburg', False)
									elif (sName == 'Argentoratus' or sName == 'Strasbourg'):
											city.setName('Stra&#223;burg', False)
									elif sName == 'Constantia':
											city.setName('Konstanz', False)
									elif sName == 'Virunum':
											city.setName('Klagenfurt', False)
									elif sName == 'Augusta Treverorum':
											city.setName('Trier', False)
									elif (sName == 'Emona' or sName == 'Ljubljana' or sName == 'Aemona Iulia'):
											city.setName('Laibach', False)
									elif (sName == 'Melpum' or sName == 'Milan' or sName == 'Mediolanum' or sName == 'Mil&#225n'):
											city.setName('Mailand', False)
									elif sName == 'Genava':
											city.setName('Genf', False)
									elif sName == 'Dresde':
											city.setName('Dresden', False)
									elif sName == 'Groningue':
											city.setName('Groningen', False)
									elif sName == 'Br&#234;me':
											city.setName('Bremen', False)
									elif (sName == 'Hambourg' or sName == 'Hamborg'):
											city.setName('Hamburg', False)
									elif (sName == 'Francfort' or sName == 'Bona Mansio'):
											city.setName('Frankfurt', False)
									elif sName == 'Cassel':
											city.setName('Kassel', False)
									elif sName == 'Cobourg':
											city.setName('Coburg', False)
									elif sName == 'Hanovre':
											city.setName('Hannover', False)
									elif (sName == 'Aix-la-Chapelle' or sName == 'Aquisgranum' or sName == 'Aken'):
											city.setName('Aachen', False)
									elif (sName == 'Apulum' or sName == 'Apulon' or sName == 'Balgrad'):
											city.setName('Karlsburg', False)
									elif (sName == 'Napoca' or sName == 'Cluj-Napoca' or sName == 'Castrum Clus' or sName == 'Kalosvar'):
											city.setName('Klausenburg', False)
									elif sName == 'Gothenburg':
											city.setName('G&#246;teborg', False)
									elif sName == 'Gdansk':
											city.setName('Danzig', False)
									elif sName == 'Kaliningrad':
											city.setName('K&#246;nigsberg', False)
									elif sName == 'Moskva':
											city.setName('Moskau', False)
									elif (sName == 'Dubh Linn' or sName == '&#193;th Cliath'):
											city.setName('Dublin', False)
									elif (sName == 'Epidamnos' or sName == 'Dyrrachium' or sName == 'Duras' or sName == 'Drach' or sName == 'Dira&#231'):
											city.setName('Durr&#235;s', False)
									elif (sName == 'Copenhague' or sName == 'Copenhagen' or sName == 'Kj&#248;bmandehavn'):
											city.setName('Kopenhagen', False)
									elif (sName == 'Heithabyr' or sName == 'Hedeby'):
											city.setName('Haithabu', False)
									elif (sName == 'Athenai' or sName == 'Atina' or sName == 'Athenae' or sName == 'Athens' or sName == 'Atenas' or sName == 'Ath&#232;nes'):
											city.setName('Athen', False)
									elif (sName == 'Panormos' or sName == 'Panormus' or sName == 'Balharm' or sName == 'Ziz'):
											city.setName('Palermo', False)  
									elif (sName == 'Roma' or sName == 'Rome'):
											city.setName('Rom', False)
									elif sName == 'Br&#234;me':
											city.setName('Bremen', False)
									elif (sName == 'Marakanda' or sName == 'Samarqand' or sName == 'Samarkant' or sName == 'Samarcande' or sName == 'Samarcanda' or sName == 'Afrosiab'):
											city.setName('Samarkand', False)
									elif (sName == 'Konstantia' or sName == 'Tomis' or sName == 'Konstanca' or sName == 'Kustendje'):
											city.setName('K&#246;stendsche', False)
									elif (sName == 'Byzantium' or sName == 'Bizantiya'):
											city.setName('Byzantion', False)
									elif (sName == 'Qustantiniyah' or sName == 'Constantinopolis' or sName == 'Konstantinoupolis' or sName == 'Istanbul' or sName == 'Miklagard'):
											city.setName('Konstantinopel', False)
									elif (sName == 'Aquil&#233;e' or sName == 'Oglej' or sName == 'Aquileia'):
											city.setName('Agley', False)
									elif (sName == 'Pomp&#233;i' or sName == 'Pompeii' or sName == 'Pompeya'):
											city.setName('Pompeji', False)
									elif (sName == 'Sparte' or sName == 'Esparta'):
											city.setName('Sparta', False)
									elif (sName == 'Massalia' or sName == 'Massilia' or sName == 'Marsella'):
											city.setName('Marseille', False)
									elif (sName == 'Oea' or sName == 'Regio Tripolitana' or sName == 'Tarabulus' or sName == 'Tripoli' or sName == 'Trablus'):
											city.setName('Tripolis', False)
									elif (sName == 'Fort James'):
											city.setName('Jekabforts', False)
									elif (sName == 'Tenochtitl&#225;n' or sName == 'Mexico City' or sName == 'Ciudad de M&#233;xico' or sName == 'Mexicopolis' or sName == 'Mexico' or sName == 'Cidade do M&#233;xico' or sName == 'Mexico-stad'):
											city.setName('Mexiko-Stadt', False)
									elif (sName == 'Havana' or sName == 'La Havane' or sName == 'La Habana'):
											city.setName('Havanna', False)
									elif (sName == 'Nueva Orleans' or sName == 'Nouvelle Orl&#233;ans' or sName == 'Nova Orle&#227;es'):
											city.setName('New Orleans', False)
									elif (sName == 'Venezuela'):
											city.setName('Klein-Venedig', False)
									elif (sName == 'S&#227;o Leopoldo'):
											city.setName('S. Leopold', False)
									elif (sName == 'Cape of Good Hope' or sName == 'Capo de Boa Esperan&#231;a' or sName == 'Cabo de Buena Esperanza' or sName == 'Cap de Bonne-Esp&#233;rance' or sName == 'Kaap de Goede Hoop'):
											city.setName('Kap der Guten Hoffnung', False)
									elif sName == 'Vyborg':
											city.setName('Wiborg', False)
									elif (sName == 'Burdigala' or sName == 'Burdeos'):
											city.setName('Bordeaux', False)
									elif sName == 'Helsingfors':
											city.setName('Helsinki', False)
									elif (sName == 'Venetia' or sName == 'Venise' or sName == 'Venecia' or sName == 'Venice' or sName == 'Veneza' or sName == 'Veneti&#235;' or sName == 'Venecija' or sName == 'Al-Bundukiyya' or sName == 'Venedik'):
											city.setName('Venedig', False)
									elif sName == 'Arguim':
											city.setName('Arguin', False)
									elif (sName == 'Pokesu' or sName == 'Fort Hollandia'):
											city.setName('Gro&#223; Friedrichsburg', False)
									#east
									elif sName == 'Doliwa':
											city.setName('Romasdorf', False)
									elif sName == 'Dobruja':
											city.setName('Dobrudscha', False)
									elif sName == 'Kolomyia':
											city.setName('Kolomea', False)
									elif sName == 'Tonkoschurowka':
											city.setName('Marienthal', False)
									elif (sName == 'Spalatum' or sName == 'Aspalathos'):
											city.setName('Split', False)
									elif (sName == 'Salonae' or sName == 'Salona'):
											city.setName('Solin', False)
									elif (sName == 'Moncastrum' or sName == 'Tiraspol' or sName == 'Akkerman' or sName == 'Tyras'):
											city.setName('Wei&#223;enburg', False)
									elif sName == 'Tiran':
											city.setName('Tirana', False)
									elif (sName == 'Zantar' or sName == 'Iadera'):
											city.setName('Zadar', False) 
									elif sName == 'Klaipeda':
											city.setName('Memel', False)
									elif sName == 'Warszawa':
											city.setName('Warschau', False)
									elif (sName == 'Singidunum' or sName == 'Singidun' or sName == 'Beograd'):
											city.setName('Belgrad', False)
									elif (sName == 'Sirmium' or sName == 'Sirmion' or sName == 'Dimitrof&#231;e' or sName == 'Sremska Mitrovica'):
											city.setName('Syrmisch Mitrowitz', False)
									elif sName == "L'vov":
											city.setName('Lemberg', False)
									elif sName == 'Shirokolanovka':
											city.setName('Landau', False)
									elif sName == 'Brest-Litovsk':
											city.setName('Brest-Litowsk', False)
									elif (sName == 'Praga' or sName == 'Praha' or sName == 'Birag'):
											city.setName('Prag', False)
									elif sName == 'Tver':
											city.setName('Twer', False)
									#holland
									elif sName == 'Traiectum Eruditum':
											city.setName('Utrecht', False)
									elif (sName == 'Nim&#232;gue' or sName == 'Batavodurum'):
											city.setName('Nijmegen', False)
									elif (sName == 'Bruxelles' or sName == 'Brussel' or sName == 'Brussels'):
											city.setName('Br&#252;ssel', False)
									elif (sName == 'Lieja' or sName == 'Luik' or sName == 'Li&#232;ge'):
											city.setName('L&#252;ttich', False)

							elif (city.getOwner() == iRussia or city.getOwner() == iKievanRus): 
									if (sName == 'Singidunum' or sName == 'Singidun' or sName == 'Belgrad'):
											city.setName('Beograd', False)
									elif (sName == 'Emona' or sName == 'Laibach' or sName == 'Aemona Iulia'):
											city.setName('Ljubljana', False)
									elif (sName == 'Spalatum' or sName == 'Aspalathos'):
											city.setName('Split', False)
									elif (sName == 'Salonae' or sName == 'Salona'):
											city.setName('Solin', False)
									elif sName == 'Ragusium':
											city.setName('Dubrovnik', False)
									elif (sName == 'Sirmium' or sName == 'Sirmion' or sName == 'Dimitrof&#231;e' or sName == 'Syrmisch Mitrowitz'):
											city.setName('Sremska Mitrovica', False)
									elif (sName == 'Odessos' or sName == 'Odessus'):
											city.setName('Varna', False)
									elif (sName == 'Naissos' or sName == 'Naissus'):
											city.setName('Nis', False)
									elif sName == 'Philippopolis':
											city.setName('Plovdiv', False)
									elif (sName == 'Marakanda' or sName == 'Samarkand' or sName == 'Samarqand' or sName == 'Samarcande' or sName == 'Samarcanda' or sName == 'Afrosiab'):
											city.setName('Samarkant', False)
									elif (sName == 'Epidamnos' or sName == 'Dyrrachium' or sName == 'Duras' or sName == 'Dira&#231' or sName == 'Durr&#235;s'):
											city.setName('Drach', False)
									elif sName == 'Kefe':
											city.setName('Feodosiya', False)
									elif sName == 'Bosna Saraj':
											city.setName('Sarajevo', False)
									elif sName == 'Aldeigjuborg':
											city.setName('Staraja Ladoga', False)
									elif sName == 'Holmg&#229;rd':
											city.setName('Novgorod', False)
									elif sName == 'K&#246;nug&#229;rd':
											city.setName('Kiev', False)
									elif sName == 'Danzig':
											city.setName('Gdansk', False)
									elif sName == 'K&#246;nigsberg':
											city.setName('Kaliningrad', False)
									elif sName == 'Moskau':
											city.setName('Moskva', False)
									elif (sName == 'Tyras' or sName == 'Moncastrum' or sName == 'Akkerman' or sName == 'Wei&#223;enburg'):
											city.setName('Tiraspol', False) #Belgorod-Dnestrovskiy
									elif (sName == 'Chach' or sName == 'Shash' or sName == 'Cheshih' or sName == 'Binkath' or sName == 'Toshkent'):
											city.setName('Tashkent', False)
									elif (sName == 'Apulum' or sName == 'Apulon' or sName == 'Karlsburg'):
											city.setName('Balgrad', False)
									elif (sName == 'Napoca' or sName == 'Klausenburg' or sName == 'Castrum Clus' or sName == 'Kalosvar'):
											city.setName('Cluj-Napoca', False)
									elif (sName == 'Konstantia' or sName == 'Tomis' or sName == 'K&#246;stendsche' or sName == 'Kustendje'):
											city.setName('Konstanca', False)
									elif sName == 'Romasdorf':
											city.setName('Doliwa', False)
									elif sName == 'Dobrudscha':
											city.setName('Dobruja', False)
									elif sName == 'Kolomea':
											city.setName('Kolomyia', False)
									elif sName == 'Pokrovsk':
											city.setName('Engels', False)
									elif sName == 'Katharinenstadt':
											city.setName('Marx', False)
									elif sName == 'Marienthal':
											city.setName('Tonkoschurowka', False)
									elif sName == 'Saryk Atov':
											city.setName('Saratov', False)
									elif (sName == 'Aquil&#233;e' or sName == 'Agley' or sName == 'Aquileia'):
											city.setName('Oglej', False)
									elif (sName == 'Byzantion' or sName == 'Miklagard' or sName == 'Bizantiya' or sName == 'Constantinopolis' or sName == 'Qustantiniyah' or sName == 'Konstantinopel'):
											city.setName('Konstantinoupolis', False) #replace with proper Russian name
									elif (sName == 'Tenochtitl&#225;n' or sName == 'Mexico City' or sName == 'Ciudad de M&#233;xico' or sName == 'Mexiko-Stadt' or sName == 'Mexicopolis' or sName == 'Cidade do M&#233;xico' or sName == 'Mexico-stad'):
											city.setName('Mexico', False)
									elif sName == 'Sitka':
											city.setName('Novo-Arkhangelsk', False)
									elif sName == "Fort Ross":
											city.setName("Krepost' Rus'", False)
									elif (sName == 'Havanna' or sName == 'La Havane' or sName == 'La Habana'):
											city.setName('Havana', False)
									elif sName == 'Vyborg':
											city.setName('Wiborg', False)
									elif (sName == 'Chersonesos' or sName == 'Chersonesus'):
											city.setName('Khersones', False)
									elif sName == 'Tiran':
											city.setName('Tirana', False)
									elif sName == 'Helsingfors':
											city.setName('Helsinki', False)
									elif (sName == 'Venedig' or sName == 'Venecia' or sName == 'Venetia' or sName == 'Venise' or sName == 'Veneza' or sName == 'Veneti&#235;' or sName == 'Venice' or sName == 'Al-Bundukiyya' or sName == 'Venedik'):
											city.setName('Venecija', False)
									elif (sName == 'Zantar' or sName == 'Iadera'):
											city.setName('Zadar', False) 
									elif (sName == 'Vienne' or sName == 'Wien' or sName == 'Vindobona' or sName == 'Viyana'):
											city.setName('Vena', False)
									elif sName == 'Memel':
											city.setName('Klaipeda', False)
									elif sName == 'Warschau':
											city.setName('Warszawa', False)
									elif sName == "Grozni":
											city.setName('Groznij', False)
									elif sName == 'Lemberg':
											city.setName("L'vov", False)
									elif sName == 'Landau':
											city.setName('Shirokolanovka', False)
									elif sName == 'Brest-Litowsk':
											city.setName('Brest-Litovsk', False)
									elif (sName == 'Praga' or sName == 'Prag' or sName == 'Birag'):
											city.setName('Praha', False)
									elif sName == 'Artaxata':
											city.setName('Artashat', False)
									elif sName == 'Twer':
											city.setName('Tver', False)

							if (city.getOwner() == iHolland): 
									if sName == 'New York':
											city.setName('Nieuw Amsterdam', False)
									elif sName == 'Br&#234;me':
											city.setName('Bremen', False)
									elif sName == 'Cape Town':
											city.setName('Kaapstadt', False)
									elif sName == 'Groningue':
											city.setName('Groningen', False)
									elif sName == 'Traiectum Eruditum':
											city.setName('Utrecht', False)
									elif (sName == 'Nim&#232;gue' or sName == 'Batavodurum'):
											city.setName('Nijmegen', False)
									elif (sName == 'Aix-la-Chapelle' or sName == 'Aquisgranum' or sName == 'Aachen'):
											city.setName('Aken', False)
									elif (sName == 'Bruxelles' or sName == 'Br&#252;ssel' or sName == 'Brussels'):
											city.setName('Brussel', False)
									elif (sName == 'Lieja' or sName == 'L&#252;ttich' or sName == 'Li&#232;ge'):
											city.setName('Luik', False)
									elif (sName == 'Hamburg' or sName == 'Hambourg'):
											city.setName('Hamborg', False)
									elif (sName == 'Paris'):
											city.setName('Parijs', False)
									elif sName == 'Cuddalore':
											city.setName('Coedeloer', False)
									elif (sName == 'Cabo de Hornos' or sName == 'Cape Horn' or sName == 'Cap Horn'):
											city.setName('Kaap Hoorn', False)
									elif (sName == 'Santa Helena' or sName == 'Saint Helena'):
											city.setName('Sint-Helena', False)
									elif sName == 'Recife':
											city.setName('Mauritsstad', False)
									elif sName == 'Fortaleza':
											city.setName('Fort Schoonenburgh', False)
									elif (sName == 'Fort Willoughby' or sName == 'Paramaribo'):
											city.setName('Fort Zeelandia', False)
									elif sName == 'Georgetown':
											city.setName('Stabroek', False)
									elif sName == 'Hartford':
											city.setName('Fort Goede Hoop', False)
									elif sName == 'Albany':
											city.setName('Beverwyck', False)
									elif sName == 'Philadelphia':
											city.setName('Fort Beversreede', False)
									elif sName == 'Nieuwer-Amstel':
											city.setName('Wilmington', False)
									elif (sName == 'Tenochtitl&#225;n' or sName == 'Mexico City' or sName == 'Ciudad de M&#233;xico' or sName == 'Mexicopolis' or sName == 'Mexico' or sName == 'Cidade do M&#233;xico' or sName == 'Mexiko-Stadt'):
											city.setName('Mexico-stad', False)
									elif (sName == 'Bandar Melaka' or sName == 'Malacca'):
											city.setName('Malakka', False)
									elif (sName == 'Oea' or sName == 'Regio Tripolitana' or sName == 'Tarabulus' or sName == 'Tripolis' or sName == 'Trablus'):
											city.setName('Tripoli', False)
									elif (sName == 'Sparte' or sName == 'Esparta'):
											city.setName('Sparta', False)
									elif (sName == 'Roma' or sName == 'Rom'):
											city.setName('Rome', False)
									elif (sName == 'Dubh Linn' or sName == '&#193;th Cliath'):
											city.setName('Dublin', False)
									elif (sName == 'Qart-Hadasht' or sName == 'Qartaj' or sName == 'Karkhedon' or sName == 'Kartaca' or sName == 'Kartaca'):
											city.setName('Carthago', False)
									elif (sName == 'Fort James'):
											city.setName('Jekabforts', False)
									elif (sName == 'Havanna' or sName == 'La Havane' or sName == 'La Habana'):
											city.setName('Havana', False)
									elif (sName == 'Nueva Orleans' or sName == 'Nouvelle Orl&#233;ans' or sName == 'Nova Orle&#227;es'):
											city.setName('New Orleans', False)
									elif (sName == 'Klein-Venedig'):
											city.setName('Venezuela', False)
									elif (sName == 'Cape of Good Hope' or sName == 'Capo de Boa Esperan&#231;a' or sName == 'Cabo de Buena Esperanza' or sName == 'Cap de Bonne-Esp&#233;rance' or sName == 'Kap der Guten Hoffnung'):
											city.setName('Kaap de Goede Hoop', False)
									elif (sName == 'Burdigala' or sName == 'Burdeos'):
											city.setName('Bordeaux', False)
									elif (sName == 'Venedig' or sName == 'Venecia' or sName == 'Venetia' or sName == 'Venise' or sName == 'Veneza' or sName == 'Venecija' or sName == 'Venice' or sName == 'Al-Bundukiyya' or sName == 'Venedik'):
											city.setName('Veneti&#235;', False)
									elif sName == 'Arguim':
											city.setName('Arguin', False)
									elif (sName == 'Pokesu' or sName == 'Gro&#223; Friedrichsburg'):
											city.setName('Fort Hollandia', False)
									elif (sName == 'Massalia' or sName == 'Massilia' or sName == 'Marsella'):
											city.setName('Marseille', False)


							elif (city.getOwner() == iMali): 
									if sName == 'S.Cruz de Mar Peque&#241;a':
											city.setName('Sidi Ifni', False)
									elif (sName == 'Villa Cisneros' or sName == 'ad-Dakhla'):
											city.setName('Dakhla', False)
									elif (sName == 'Fort Gouraud'):
											city.setName('Fderik', False)
									elif (sName == 'Fort Polignac'):
											city.setName('Illizi', False)
									elif sName == 'Fort Christiansborg':
											city.setName('Osu', False)
									elif sName == 'Fort Prinsensten':
											city.setName('Keta', False)
									elif sName == 'Fort Witsten':
											city.setName('Takoradi', False)
									elif (sName == 'Fort Hollandia' or sName == 'Gro&#223; Friedrichsburg'):
											city.setName('Pokesu', False)


							if (city.getOwner() == iPortugal or city.getOwner() == iBrazil): 
									if (sName == 'Sint-Helena' or sName == 'Saint Helena'):
											city.setName('Santa Helena', False)
									elif (sName == 'Saint Louis'):
											city.setName('Sa&#245; Lu&#237;s', False)
									elif sName == 'Mauritsstad':
											city.setName('Recife', False)
									elif sName == 'Fort Schoonenburgh':
											city.setName('Fortaleza', False)
									elif (sName == 'Fort Willoughby' or sName == 'Fort Zeelandia'):
											city.setName('Paramaribo', False)
									elif (sName == 'Tenochtitl&#225;n' or sName == 'Ciudad de M&#233;xico' or sName == 'Mexico' or sName == 'Mexiko-Stadt' or sName == 'Mexicopolis' or sName == 'Mexico City' or sName == 'Mexico-stad'):
											city.setName('Cidade do M&#233;xico', False)
									elif (sName == 'Bandar Melaka' or sName == 'Malakka'):
											city.setName('Malacca', False)
									elif (sName == 'Oea' or sName == 'Regio Tripolitana' or sName == 'Tarabulus' or sName == 'Tripolis' or sName == 'Trablus'):
											city.setName('Tripoli', False)
									elif (sName == 'Sparte' or sName == 'Esparta'):
											city.setName('Sparta', False)
									elif (sName == 'Athenae' or sName == 'Athenai' or sName == 'Athen' or sName == 'Athens' or sName == 'Atina' or sName == 'Ath&#232;nes'):
											city.setName('Atenas', False)
									elif (sName == 'La Coru&#241;a' or sName == 'The Groyne' or sName == 'La Corogne'):
											city.setName('Corunha', False)
									elif (sName == 'Havanna' or sName == 'La Havane' or sName == 'La Habana'):
											city.setName('Havana', False)
									elif (sName == 'New Orleans' or sName == 'Nouvelle Orl&#233;ans' or sName == 'Nueva Orleans'):
											city.setName('Nova Orle&#227;es', False)
									elif (sName == 'Klein-Venedig'):
											city.setName('Venezuela', False)
									elif (sName == 'S. Leopold'):
											city.setName('S&#227;o Leopoldo', False)
									elif (sName == 'Guangzhou' or sName == 'Canton'):
											city.setName('Cant&#227;o', False)
									elif (sName == 'Cape of Good Hope' or sName == 'Kaap de Goede Hoop' or sName == 'Cabo de Buena Esperanza' or sName == 'Cap de Bonne-Esp&#233;rance' or sName == 'Kap der Guten Hoffnung'):
											city.setName('Capo de Boa Esperan&#231;a', False)
									elif (sName == 'Portus Cale' or sName == 'Porto' or sName == 'Burtuqal'):
											city.setName('Oporto', False)
									elif (sName == 'Venedig' or sName == 'Venecia' or sName == 'Venetia' or sName == 'Venise' or sName == 'Veneti&#235;' or sName == 'Venecija' or sName == 'Venice' or sName == 'Al-Bundukiyya' or sName == 'Venedik'):
											city.setName('Veneza', False)
									elif sName == 'Arguin':
											city.setName('Arguim', False)
									elif (sName == 'Ossonoba' or sName == "'Uhshunubah"):
											city.setName('Faro', False)
									elif (sName == 'Felicitas Julia' or sName == 'Allis Ubbo' or sName == 'Olissipo' or sName == "Al-Lixbuna"):
											city.setName('Lisboa', False)
									elif (sName == 'Essaouira' or sName == 'Es-Sauirah'):
											city.setName('Mogador', False)
									elif (sName == 'Mumbai' or sName == 'Bombay'):
											city.setName('Bombaim', False)
									elif (sName == 'Qurtuba' or sName == 'Corduba' or sName == 'C&#243;rdoba'):
											city.setName('C&#243;rdova', False)
									elif sName == 'Colonia del Sacramento':
											city.setName('Col&#244;nia do Sacramento', False)
									#inca (spanish names)
									elif sName == 'Quitu':
											city.setName('Quito', False)
									elif sName == 'Tucume':
											city.setName('T&#250;cume', False)
									elif sName == 'Chan-Chan':
											city.setName('Chanchan', False) #Trujillo
									elif sName == 'Pachacamaq':
											city.setName('Pachacamac', False)
									elif sName == 'Machu-Pikchu':
											city.setName('Machu Picchu', False)
									elif sName == 'Qusqu':
											city.setName('Cuzco', False)
									elif sName == 'Ariqipaya':
											city.setName('Arequipa', False)
									elif sName == 'Tiyawanaku':
											city.setName('Tiahuanaco', False) #Tihuanaku? #Tiwanaku? #Puno?
									elif sName == 'Caqonatambu':
											city.setName('Limatambo', False)
									elif sName == 'Coqimpu':
											city.setName('Coquimbo', False)
									elif sName == 'Ullantaytanpu':
											city.setName('Ollantaytambo', False)
									elif sName == 'Vitcos':
											city.setName('Piura', False)
									elif sName == 'Andahuailas':
											city.setName('Andahuaylas', False)
									elif sName == 'Acari':
											city.setName('Atico', False)
									elif sName == 'Lluli':
											city.setName('Juli', False)
									elif sName == 'Chuqiapu':
											city.setName('Chuquiapo', False)
									elif sName == 'Huanuqupampa':
											city.setName('Huanucopampa', False)
									elif sName == 'Tambuqcucha':
											city.setName('Tamboccocha', False)
									elif sName == 'Huaraz':
											city.setName('Huaras', False)
									elif sName == 'Cacsamalca':
											city.setName('Caxamalca', False)
									elif sName == 'Sauza':
											city.setName('Sausa', False)
									elif sName == 'Tampupuca':
											city.setName('Tambocolorado', False)
									elif sName == 'Huaqa':
											city.setName('Huaca', False)
									elif sName == 'Chuitu':
											city.setName('Chuito', False)
									elif sName == 'Cajamarca':
											city.setName('Caiamarca', False)
									elif sName == 'Lauricucha':
											city.setName('Hu&#225;nuco', False)
									elif sName == 'Tomebamba':
											city.setName('Cuenca', False)
									elif sName == 'Jauja':
											city.setName('Sausa', False)


							elif (city.getOwner() == iInca): 
									if sName == 'Quito':
											city.setName('Quitu', False)
									elif sName == 'T&#250;cume':
											city.setName('Tucume', False)
									elif sName == 'Chanchan':
											city.setName('Chan-Chan', False)
									elif sName == 'Pachacamac':
											city.setName('Pachacamaq', False)
									elif sName == 'Machu Picchu':
											city.setName('Machu-Pikchu', False)
									elif sName == 'Cuzco':
											city.setName('Qusqu', False)
									elif sName == 'Arequipa':
											city.setName('Ariqipaya', False)
									elif sName == 'Tiahuanaco': #Tihuanaku?
											city.setName('Tiyawanaku', False)  #Tiwanaku?
									elif sName == 'Limatambo':
											city.setName('Caqonatambu', False)
									elif sName == 'Coquimbo':
											city.setName('Coqimpu', False)
									elif sName == 'Ollantaytambo':
											city.setName('Ullantaytanpu', False)
									elif sName == 'Piura':
											city.setName('Vitcos', False)
									elif sName == 'Andahuaylas':
											city.setName('Andahuailas', False)
									elif sName == 'Atico':
											city.setName('Acari', False)
									elif sName == 'Juli':
											city.setName('Lluli', False)
									elif sName == 'Chuquiapo':
											city.setName('Chuqiapu', False)
									elif sName == 'Huanucopampa':
											city.setName('Huanuqupampa', False)
									elif sName == 'Tamboccocha':
											city.setName('Tambuqcucha', False)
									elif sName == 'Huaras':
											city.setName('Huaraz', False)
									elif sName == 'Caxamalca':
											city.setName('Cacsamalca', False)
									elif sName == 'Sausa':
											city.setName('Sauza', False)
									elif sName == 'Tambocolorado':
											city.setName('Tampupuca', False)
									elif sName == 'Huaca':
											city.setName('Huaqa', False)
									elif sName == 'Chuito':
											city.setName('Chuitu', False)
									elif sName == 'Caiamarca':
											city.setName('Cajamarca', False)
									elif sName == 'Hu&#225;nuco':
											city.setName('Lauricucha', False)
									elif sName == 'Cuenca':
											city.setName('Tomebamba', False)
									elif sName == 'Sausa':
											city.setName('Jauja', False)

							elif (city.getOwner() == iMongolia): 
									if (sName == 'Marakanda' or sName == 'Samarqand' or sName == 'Samarkant' or sName == 'Samarcande' or sName == 'Samarcanda' or sName == 'Afrosiab'):
											city.setName('Samarkand', False)
									elif sName == 'Beijing':
											city.setName('Khanbaliq', False)
									elif (sName == 'Shash' or sName == 'Cheshih' or sName == 'Binkath'):
											city.setName('Chach', False)

							elif (city.getOwner() == iTurkey): 
									if (sName == 'Byzantion' or sName == 'Constantinopolis' or sName == 'Konstantinoupolis' or sName == 'Miklagard' or sName == 'Bizantiya' or sName == 'Qustantiniyah' or sName == 'Konstantinopel'):
											city.setName('Istanbul', False)
											if (not gc.getPlayer(iTurkey).isHuman()):
													city.setHasRealBuilding((0), True) #palace
													acityList = PyPlayer(iTurkey).getCityList()
													for nCity in acityList:
															nCity.GetCy().setHasRealBuilding((0), False) #palace
									elif sName == 'Nicomedia':
											city.setName('Izmit', False)
									elif (sName == 'Pergamon' or sName == 'Pergamum'):
											city.setName('Bergama', False)
									elif (sName == 'Trapezon' or sName == 'Trapezus' or sName == 'Tarabizun'):
											city.setName('Trabzon', False)
									elif (sName == 'Antiokheia Megale' or sName == 'Antiochia ad Orontem' or sName == 'Antakiyyah'):
											city.setName('Antakya', False)
									elif (sName == 'Ikonion' or sName == 'Iconium'):
											city.setName('Konya', False)
									elif (sName == 'Antiokeia tes Pisidias' or sName == 'Antiochia Pisidiae'):
											city.setName('Aksehir', False)
									elif (sName == 'Halikarnassos' or sName == 'Halikarnassus'):
											city.setName('Bodrum', False)
									elif (sName == 'Ephesos' or sName == 'Ephesus'):
											city.setName('Efes', False)
									elif sName == 'Nicaea':
											city.setName('Iznik', False)
									elif (sName == 'Samarkand' or sName == 'Samarqand' or sName == 'Samarkant' or sName == 'Marakanda' or sName == 'Samarcande' or sName == 'Samarcanda' or sName == 'Afrosiab'):
											city.setName('Samarqand', False)
									elif (sName == 'Epidamnos' or sName == 'Dyrrachium' or sName == 'Duras' or sName == 'Drach' or sName == 'Durr&#235;s'):
											city.setName('Dira&#231;', False)
									elif sName == 'Sinope':
											city.setName('Sinop', False)
									elif sName == 'Hadrianopolis':
											city.setName('Edirne', False)
									elif sName == 'Edessa':
											city.setName('Urfa', False)
									elif (sName == 'Attaleia' or sName == 'Attalea'):
											city.setName('Antalya', False)
									elif sName == 'Al-Aqabah':
											city.setName('Akabe', False)
									elif (sName == 'Thessalonica' or sName == 'Thessaloniki'):
											city.setName('Sel&#226;nik', False)
									elif sName == 'Mosul':
											city.setName('Musul', False)
									elif sName == 'Halab':
											city.setName('Halep', False)
									elif (sName == 'Navarino' or sName == 'Neokastron'):
											city.setName('Anavarin', False)
									elif (sName == 'Al-Jazair' or sName == 'Alger'):
											city.setName('Cezayir', False)
									elif sName == 'Tunis':
											city.setName('Tunus', False)
									elif (sName == 'Al-Iskandariya' or sName == 'Alexandreia' or sName == 'Alexandria' or sName == 'Eskendereyya'):
											city.setName('Iskenderiye', False)
									elif (sName == 'Cairo' or sName == 'Memphis' or sName == 'Ineb Hedj' or sName == 'Al-Qahirah' or sName == 'El-Qahirah'):
											city.setName('Kahire', False)
									elif sName == 'Dimashq':
											city.setName('Sam', False)
									elif sName == 'Makkah':
											city.setName('Mekke', False)
									elif sName == 'Madinah':
											city.setName('Medine', False)
									elif (sName == 'Jerusalem' or sName == 'Yerushalayim' or sName == 'Ierusalim' or sName == 'Aelia Capitolina' or sName == 'Aarru-Hetep' or sName == 'Urshalim' or sName == 'Hierusalem' or sName == 'Hierousalem' or sName == 'Urushalim' or sName == 'Al-Quds' or sName == 'Qods'):
											city.setName('Kud&#252;s', False)
									elif sName == 'Baghdad':
											city.setName('Bagdat', False)
									elif (sName == 'Singidunum' or sName == 'Singidun' or sName == 'Beograd'):
											city.setName('Belgrad', False)
									elif (sName == 'Athenae' or sName == 'Athenai' or sName == 'Athen' or sName == 'Athens' or sName == 'Atenas' or sName == 'Ath&#232;nes'):
											city.setName('Atina', False)
									elif sName == 'Naupactus':
											city.setName('Inebahti', False)
									elif (sName == 'Qart-Hadasht' or sName == 'Qartaj' or sName == 'Karkhedon' or sName == 'Carthago' or sName == 'Kartaca'):
											city.setName('Kartaca', False)
									elif (sName == 'Tyras' or sName == 'Moncastrum' or sName == 'Tiraspol' or sName == 'Wei&#223;enburg'):
											city.setName('Akkerman', False)
									elif (sName == 'Anqarah' or sName == 'Ancyra'):
											city.setName('Ankara', False)	
									elif (sName == 'Chach' or sName == 'Shash' or sName == 'Cheshih' or sName == 'Binkath' or sName == 'Tashkent'):
											city.setName('Toshkent', False)
									elif (sName == 'Amisos' or sName == 'Amisus'):
											city.setName('Samsun', False)
									elif (sName == 'Milid' or sName == 'Malateia' or sName == 'Melitene'):
											city.setName('Malatya', False)
									elif (sName == 'Mazaka' or sName == 'Caesarea Mazaca' or sName == 'Kaisareia'):
											city.setName('Kayseri', False)
									elif (sName == 'Konstantia' or sName == 'Tomis' or sName == 'Konstanca' or sName == 'K&#246;stendsche'):
											city.setName('Kustendje', False)
									elif sName == 'Saratov':
											city.setName('Saryk Atov', False)
									elif (sName == 'Shushan' or sName == 'Shush' or sName == 'Seleukeia Susiana' or sName == 'Seleucia ad Eulaeum'):
											city.setName('Susa', False)
									elif sName == 'Parsa':
											city.setName('Persepolis', False)
									elif (sName == 'Alexandreia ad Issum' or sName == 'Al-Iskandarun' or sName == 'Alexandretta'):
											city.setName('Iskenderun', False)
									elif (sName == 'Sparte' or sName == 'Esparta'):
											city.setName('Sparta', False)
									elif (sName == 'Berenikis' or sName == 'Berenice' or sName == 'Hesperides' or sName == 'Bangazi'):
											city.setName('Bingazi', False)
									elif (sName == 'Oea' or sName == 'Regio Tripolitana' or sName == 'Tarabulus' or sName == 'Tripolis' or sName == 'Tripoli'):
											city.setName('Trablus', False)
									elif (sName == 'Tenochtitl&#225;n' or sName == 'Mexico City' or sName == 'Ciudad de M&#233;xico' or sName == 'Mexiko-Stadt' or sName == 'Mexicopolis' or sName == 'Cidade do M&#233;xico' or sName == 'Mexico-stad'):
											city.setName('Mexico', False)
									elif (sName == 'Niwt-Rst' or sName == 'Thebes' or sName == 'Thebae' or sName == 'Luxor'):
											city.setName('Luksor', False)
									elif (sName == "Pi-Ramesses" or sName == 'Avaris'):
											city.setName("Tell el-Dab'a", False)
									elif sName == 'Tirana':
											city.setName('Tiran', False)
									elif (sName == 'Venedig' or sName == 'Venecia' or sName == 'Venetia' or sName == 'Venise' or sName == 'Veneti&#235;' or sName == 'Venecija' or sName == 'Venice' or sName == 'Al-Bundukiyya' or sName == 'Veneza'):
											city.setName('Venedik', False)
									elif (sName == 'Zantar' or sName == 'Iadera'):
											city.setName('Zadar', False)
									elif (sName == 'Vienne' or sName == 'Wien' or sName == 'Vindobona' or sName == 'Vena'):
											city.setName('Viyana', False) 
									elif (sName == 'Sirmium' or sName == 'Sirmion' or sName == 'Syrmisch Mitrowitz' or sName == 'Sremska Mitrovica'):
											city.setName('Dimitrof&#231;e', False)
									elif sName == "Al-Kuwait":
											city.setName('Kuveyt', False)
									elif sName == "Shiraz":
											city.setName('Siraz', False)
									elif sName == "Al-Basrah":
											city.setName('Basra', False)
									elif sName == "Ar-Riyad":
											city.setName('Riyad', False)
									elif sName == "An-Najaf":
											city.setName('Necef', False)
									elif sName == "'Amman":
											city.setName('Amman', False)
									elif sName == "Al-Ghardaqah":
											city.setName('Hurgada', False)
									elif sName == "Tubruq":
											city.setName('Tobruk', False)
									elif (sName == 'Budapest' or sName == 'Aquincum'):
											city.setName('Budapeste', False)
									elif (sName == 'Napoca' or sName == 'Cluj-Napoca' or sName == 'Castrum Clus' or sName == 'Klausenburg'):
											city.setName('Kalosvar', False)
									elif sName == "Groznij":
											city.setName('Grozni', False)
									elif (sName == 'Praga' or sName == 'Praha' or sName == 'Birag'):
											city.setName('Prag', False)
									elif sName == 'Safaqis':
											city.setName('Safakes', False)
									elif (sName == 'Tacape' or sName == 'Qabis' or sName == 'Gab&#232;s'):
											city.setName('Gabes', False)
									elif (sName == 'Khartoum' or sName == 'Al-Hartum'):
											city.setName('Hartum', False)
									elif (sName == 'Babili' or sName == 'Babel' or sName == 'Babylon'):
											city.setName('Babil', False)
									elif (sName == 'Ninua' or sName == 'Nineve' or sName == 'Ninawa'):
											city.setName('Ninova', False)
									elif (sName == 'Tyrus' or sName == 'T&#253;ros' or sName == 'As-Sur'):
											city.setName('Sur', False)
									elif sName == 'Artaxata':
											city.setName('Artashat', False)
									elif (sName == 'Khalpe' or sName == 'Beroea' or sName == 'Halab'):
											city.setName('Halep', False)
											
							elif (city.getOwner() == iItaly): 
									if (sName == 'Venecia' or sName == 'Venecija' or sName == 'Venedig' or sName == 'Venedik' or sName == 'Veneti&#235' or sName == 'Venetia' or sName == 'Veneza'):
											city.setName('Venezia', False)
									elif (sName == 'Rome' or sName == 'Rom' or sName == 'Rom'):
											city.setName('Roma', False)
									elif (sName == 'Tarente'):
											city.setName('Taranto', False)
									elif (sName == 'Sarausa'):
											city.setName('Siracusa', False)

							elif (city.getOwner() == iAmerica): 
									if sName == 'Nieuw Amsterdam':
											city.setName('New York', False)
									elif sName == 'San Agust&#237;n':
											city.setName('St. Augustine', False)
									elif sName == 'Charles Town':
											city.setName('Charleston', False)
									elif sName == 'Fort Caroline':
											city.setName('Jacksonville', False)
									elif (sName == 'Lac Knob'):
											city.setName('Knob Lake', False)
									elif (sName == 'Qu&#233;bec'):
											city.setName('Quebec City', False)
									elif (sName == 'Nueva Orleans' or sName == 'Nouvelle Orl&#233;ans' or sName == 'Nova Orle&#227;es'):
											city.setName('New Orleans', False)
									elif sName == 'Fort Goede Hoop':
											city.setName('Hartford', False)
									elif sName == 'Beverwyck':
											city.setName('Albany', False)
									elif sName == 'Fort Beversreede':
											city.setName('Philadelphia', False)
									elif sName == 'Wilmington':
											city.setName('Nieuwer-Amstel', False)
									elif (sName == 'La Petite Chute'):
											city.setName('Little Chute', False)
									elif (sName == 'Vinland' or sName == 'Anse-aux-M&#233;duses'):
											city.setName('Anse aux Meadows', False)
									elif (sName == 'Tenochtitl&#225;n' or sName == 'Ciudad de M&#233;xico' or sName == 'Mexico' or sName == 'Mexiko-Stadt' or sName == 'Mexicopolis' or sName == 'Cidade do M&#233;xico' or sName == 'Mexico-stad'):
											city.setName('Mexico City', False)
									elif (sName == 'Londinium' or sName == 'Londres'):
											city.setName('London', False)
									elif (sName == 'Jekabforts'):
											city.setName('Fort James', False)
									elif sName == "Krepost' Rus'":
											city.setName("Fort Ross", False)
									elif (sName == 'Havanna' or sName == 'La Havane' or sName == 'La Habana'):
											city.setName('Havana', False)
									elif (sName == 'Klein-Venedig'):
											city.setName('Venezuela', False)
									elif sName == 'Sankt Thomas':
											city.setName('Saint Thomas', False)
									elif sName == 'Fort D&#233;troit':
											city.setName('Detroit', False)
									elif sName == 'Novo-Arkhangelsk':
											city.setName('Sitka', False)
									elif sName == 'Fort Frontenac':
											city.setName('Kingston', False)
									elif (sName == 'Hierusalem' or sName == 'Yerushalayim' or sName == 'Ierusalim' or sName == 'Aelia Capitolina' or sName == 'Aarru-Hetep' or sName == 'Kud&#252;s' or sName == 'Urshalim' or sName == 'Hierousalem' or sName == 'Urushalim' or sName == 'Al-Quds' or sName == 'Qods'): 
											city.setName('Jerusalem', False)
									elif sName == 'Neu Braunfels':
											city.setName('New Braunfels', False)

							if sName == 'Inbhir Nis' and city.getOwner() != iBarbarian:
									city.setName('Inverness', False)

			
#	def setValue(self, iPlayer, tCoords):
#		for id in tCoords:
#			for x in range(id[0]-2, id[0]+4):
#				for y in range(id[1]-2, id[1]+4):
#					area = gc.getMap().plot( x, y )
#					if not area.isWater() and not area.isPeak():
#						area.setFoundValue(iPlayer, 1000)
			
		
			
	def setup(self):
		pPortugal.changeGold(100)
		pSeljuk.changeGold(200)
		pItaly.changeGold(200)
		pMongolia.changeGold(250)
		pTurkey.changeGold(300)
		pIndia.changeGold(300)
		pAztecs.changeGold(600)
		pInca.changeGold(700)
		pIran.changeGold(400)
		pSweden.changeGold(300)
		pMughals.changeGold(800)
		pHolland.changeGold(200)
		pGermany.changeGold(400)
		pAmerica.changeGold(1500)
		pMexico.changeGold(1000)
		pBrazil.changeGold(1200)
		pColombia.changeGold(1000)
		pArgentina.changeGold(1000)
		pGreece.changeGold(1000)
		pEthiopia.changeGold(100)		
		
		pSpain.AI_setAttitudeExtra(iPortugal, 3)
		
#		self.declareWar(iTurkey, iMinor)

		if (pArabia.isHuman() == 0):
			pArabia.setHandicap(gc.getInfoTypeForString("HANDICAP_DEITY"))
		if (pPope.isHuman() == 0):
			pPope.setHandicap(gc.getInfoTypeForString("HANDICAP_DEITY"))
		if (pKhmer.isHuman() == 0):
			pKhmer.setHandicap(gc.getInfoTypeForString("HANDICAP_DEITY"))
		if (pChina.isHuman() == 0):
			pChina.setHandicap(gc.getInfoTypeForString("HANDICAP_DEITY"))
		if (pMali.isHuman() == 0):				
			pMali.setHandicap(gc.getInfoTypeForString("HANDICAP_DEITY"))
		if (pSwahili.isHuman() == 0):	
			pSwahili.setHandicap(gc.getInfoTypeForString("HANDICAP_DEITY"))	
		if (pChola.isHuman() == 0):	
			pChola.setHandicap(gc.getInfoTypeForString("HANDICAP_MONARCH"))	
		if (pFrance.isHuman() == 0):	
			pFrance.setHandicap(gc.getInfoTypeForString("HANDICAP_NOBLE"))	
		if (pEngland.isHuman() == 0):	
			pEngland.setHandicap(gc.getInfoTypeForString("HANDICAP_NOBLE"))	
		if (pAustria.isHuman() == 0):	
			pAustria.setHandicap(gc.getInfoTypeForString("HANDICAP_NOBLE"))	
		if (pAztecs.isHuman() == 0):	
			pAztecs.setHandicap(gc.getInfoTypeForString("HANDICAP_NOBLE"))	
		if (pInca.isHuman() == 0):	
			pInca.setHandicap(gc.getInfoTypeForString("HANDICAP_NOBLE"))
		if (pByzantium.isHuman() == 0):	
			pByzantium.setHandicap(gc.getInfoTypeForString("HANDICAP_DEITY"))
		if (pJapan.isHuman() == 0):	
			pJapan.setHandicap(gc.getInfoTypeForString("HANDICAP_NOBLE"))
		if (pKorea.isHuman() == 0):	
			pKorea.setHandicap(gc.getInfoTypeForString("HANDICAP_NOBLE"))
		if (pVikings.isHuman() == 0):	
			pVikings.setHandicap(gc.getInfoTypeForString("HANDICAP_NOBLE"))
		if (pPoland.isHuman() == 0):	
			pPoland.setHandicap(gc.getInfoTypeForString("HANDICAP_WARLORD"))
		if (pSeljuk.isHuman() == 0):	
			pSeljuk.setHandicap(gc.getInfoTypeForString("HANDICAP_SETTLER"))
		if (pMorocco.isHuman() == 0):	
			pMorocco.setHandicap(gc.getInfoTypeForString("HANDICAP_NOBLE"))
		if (pAztecs.isHuman() == 0):	
			pAztecs.setHandicap(gc.getInfoTypeForString("HANDICAP_DEITY"))
		if (pInca.isHuman() == 0):	
			pInca.setHandicap(gc.getInfoTypeForString("HANDICAP_DEITY"))
		if (pEthiopia.isHuman() == 0):	
			pEthiopia.setHandicap(gc.getInfoTypeForString("HANDICAP_DEITY"))
		if (pEgypt.isHuman() == 0):	
			pEgypt.setHandicap(gc.getInfoTypeForString("HANDICAP_DEITY"))
		if (pSpain.isHuman() == 0):	
			pSpain.setHandicap(gc.getInfoTypeForString("HANDICAP_NOBLE"))	
		if (pRussia.isHuman() == 0):				
			pRussia.setHandicap(gc.getInfoTypeForString("HANDICAP_NOBLE"))

		
	def changeFlag(self, iGameTurn):
		iGameTurn += 1
		iYear = CyGame().getTurnYear(iGameTurn)
		if(iYear == 1230):
			pSpain.setFlag("Art/Interface/TeamColor/CoronadeCastilla.dds", True)
		if(iYear == 1495):
			pSpain.setFlag("Art/Interface/TeamColor/Flag_of_Cross_of_Burgundy.dds", True)
		if(iYear == 1500):
			pEngland.setFlag("Art/Interface/TeamColor/england.dds", True)
		if(iYear == 1520):
			pVikings.setFlag("Art/Interface/TeamColor/denmark.dds", True)
		if(iYear == 1550):
			pRussia.setFlag("Art/Interface/TeamColor/russia.dds", True)				
		if(iYear == 1570):
			pPoland.setFlag("Art/Interface/TeamColor/Rzeczpospolita.dds", True)	
		if(iYear == 1793):
			pFrance.setFlag("Art/Interface/TeamColor/france.dds", True)	
		if(iYear == 1862):
			pItaly.setFlag("Art/Interface/TeamColor/italy.dds", True)	
		if(iYear == 1946):
			pItaly.setFlag("Art/Interface/TeamColor/italy1.dds", True)	
		if(iYear == 1700):
			pSpain.setFlag("Art/Interface/TeamColor/spBourbon.dds", True)	
		if(iYear == 1810):
			pSpain.setFlag("Art/Interface/TeamColor/spanish_empire.dds", True)
		if(iYear == 1806):
			pHolland.setFlag("Art/Interface/TeamColor/holland.dds", True)
		if(iYear == 1816):
			pGermany.setFlag("Art/Interface/TeamColor/germany.dds", True)
		if(iYear == 1868):
			pGermany.setFlag("Art/Interface/TeamColor/german_empire.dds", True)		
		if(iYear == 1919):
			pGermany.setFlag("Art/Interface/TeamColor/germany.dds", True)	
		if(iYear == 1804):
			pAustria.setFlag("Art/Interface/TeamColor/austriaHabsburg.dds", True)	
		if(iYear == 1869):
			pAustria.setFlag("Art/Interface/TeamColor/austria-hungary.dds", True)		
		if(iYear == 1919):
			pAustria.setFlag("Art/Interface/TeamColor/austria.dds", True)	
		if(iYear == 1808):
			pPoland.setFlag("Art/Interface/TeamColor/poland.dds", True)	
		if(iYear == 1736):
			pArabia.setFlag("Art/Interface/TeamColor/firstSaudiFlag.dds", True)	
		if(iYear == 1890):
			pBrazil.setFlag("Art/Interface/TeamColor/brazil.dds", True)	
		if(iYear == 1820):
			pInca.setFlag("Art/Interface/TeamColor/peru.dds", True)	
		if(iYear == 1380):
			pRussia.setFlag("Art/Interface/TeamColor/FlagDECAL_DoubleEagle.dds", True)				
			
	def setLeader(self, iPlayer, iLeader):
		if gc.getPlayer(iPlayer).getLeader() != iLeader:
			gc.getPlayer(iPlayer).setLeader(iLeader)

	def revival(self, iPlayer, tCoords, tNewCapital):
		for idx in tCoords:
			for x in range(idx[0]-1, idx[0]+2):
				for y in range(idx[1]-1, idx[1]+2):	
					city = gc.getMap().plot( x, y ).getPlotCity()
					if not city.isNone():
						OldOwner = city.getOwner()
						teamOwner = gc.getTeam(gc.getPlayer(OldOwner).getTeam())
						self.declareWar(iPlayer, iMinor)	
						gc.getPlayer(iPlayer).acquireCity(city, False, True)
						gc.getMap().plot(x, y).setCulture(iPlayer, 2000, True)
						gc.getMap().plot(x, y).setCulture(OldOwner, 0, True)
						city.setHasRealBuilding((iPalace), False)
						self.buildingsBuild(iPlayer, tNewCapital, iPalace)
						area = gc.getMap().plot( x, y )
						iNumUnitsInAPlot = area.getNumUnits()
						
						if iNumUnitsInAPlot:
							for i in range(iNumUnitsInAPlot):
								unit = area.getUnit(i)
								if not unit.isNone():
									self.makeUnit(unit.getUnitType(), 4, iPlayer, [x, y], 2)
									
								for t in range(iNumTechs):
										if (teamOwner.isHasTech(t)): 
												gc.getTeam(iPlayer).setHasTech(t, True, iPlayer, False, False)
								for l in range(iNumActivePlayers):
									gc.getTeam(iPlayer).makePeace(l)
									
		capital = gc.getMap().plot( tNewCapital[0], tNewCapital[1]).getPlotCity()
		self.makeUnit(capital.getConscriptUnit(), 4, iPlayer, tNewCapital, 7)	
									
	def revivalForOneCityCivs(self, iPlayer, tCoords, tNewCapital):
		for x in range(tCoords[0]-1, tCoords[0]+2):
			for y in range(tCoords[1]-1, tCoords[1]+2):	
				city = gc.getMap().plot( x, y ).getPlotCity()
				if not city.isNone():
					OldOwner = city.getOwner()
					teamOwner = gc.getTeam(gc.getPlayer(OldOwner).getTeam())
					teamPlayer = gc.getTeam(gc.getPlayer(iPlayer).getTeam())
					self.declareWar(iPlayer, iMinor)	
					gc.getPlayer(iPlayer).acquireCity(city, False, True)
					gc.getMap().plot(x, y).setCulture(iPlayer, 2000, True)
					gc.getMap().plot(x, y).setCulture(OldOwner, 0, True)
					city.setHasRealBuilding((iPalace), False)
					self.buildingsBuild(iPlayer, tNewCapital, iPalace)					
					area = gc.getMap().plot( x, y )
					iNumUnitsInAPlot = area.getNumUnits()
					
					if iNumUnitsInAPlot:
						for i in range(iNumUnitsInAPlot):
							unit = area.getUnit(i)
							if not unit.isNone():
								self.makeUnit(unit.getUnitType(), 4, iPlayer, [x, y], 2)
								
							for t in range(iNumTechs):
									if (teamOwner.isHasTech(t)): 
											gc.getTeam(iPlayer).setHasTech(t, True, iPlayer, False, False)
							for l in range(iNumActivePlayers):
								gc.getTeam(iPlayer).makePeace(l)
									
		capital = gc.getMap().plot( tNewCapital[0], tNewCapital[1]).getPlotCity()
		self.makeUnit(capital.getConscriptUnit(), 4, iPlayer, tNewCapital, 7)					
									
	def revivalDiameter5(self, iPlayer, tCoords, tNewCapital):
		for idx in tCoords:
			for x in range(idx[0]-2, idx[0]+4):
				for y in range(idx[1]-2, idx[1]+4):	
					city = gc.getMap().plot( x, y ).getPlotCity()
					if not city.isNone():
						OldOwner = city.getOwner()
						teamOwner = gc.getTeam(gc.getPlayer(OldOwner).getTeam())
						self.declareWar(iPlayer, iMinor)	
						gc.getPlayer(iPlayer).acquireCity(city, False, True)
						gc.getMap().plot(x, y).setCulture(iPlayer, 2000, True)
						gc.getMap().plot(x, y).setCulture(OldOwner, 0, True)
						city.setHasRealBuilding((iPalace), False)
						self.buildingsBuild(iPlayer, tNewCapital, iPalace)
						area = gc.getMap().plot( x, y )
						iNumUnitsInAPlot = area.getNumUnits()
						
						if iNumUnitsInAPlot:
							for i in range(iNumUnitsInAPlot):
								unit = area.getUnit(i)
								if not unit.isNone():
									self.makeUnit(unit.getUnitType(), 4, iPlayer, [x, y], 2)

								
								for t in range(iNumTechs):
										if (teamOwner.isHasTech(t)): 
												gc.getTeam(iPlayer).setHasTech(t, True, iPlayer, False, False)
								for l in range(iNumActivePlayers):
									gc.getTeam(iPlayer).makePeace(l)

		capital = gc.getMap().plot( tNewCapital[0], tNewCapital[1]).getPlotCity()
		self.makeUnit(capital.getConscriptUnit(), 4, iPlayer, tNewCapital, 7)	
									
						
	def destroyCiv(self):
		for iPreviousOwner in range(iNumActivePlayers):
			pPlayer = gc.getPlayer(iPreviousOwner)	
			capital = pPlayer.getCapitalCity()
			tCapital = (capital.getX(), capital.getY())
			capCoords = gc.getMap().plot( tCapital[0], tCapital[1] )
			iOldOwner = capCoords.getOwner() 
			for iTechs in range(iNumActivePlayers):
				teamOwner = gc.getTeam(gc.getPlayer(iTechs).getTeam())
				if(iOldOwner != iPreviousOwner):
					for mCity in PyPlayer(iPreviousOwner).getCityList():
						tCities = (mCity.GetCy().getX(), mCity.GetCy().getY())
						area = gc.getMap().plot( tCities[0], tCities[1] )
						iNumUnitsInAPlot = area.getNumUnits()
						
						if iNumUnitsInAPlot:
							for i in range(iNumUnitsInAPlot):
								unit = area.getUnit(i)
								for t in range(iNumTechs):
									if (teamOwner.isHasTech(t)): 
										gc.getTeam(iMinor).setHasTech(t, True, iMinor, False, False)				
										self.flipCity(tCities, 0, 1, iMinor, [iPreviousOwner], [unit.getUnitType(), 2])			
		
	def turns(self, iGameTurn):
		iGameTurn += 1
		iYear = CyGame().getTurnYear(iGameTurn)
		
##DYNAMIC CIV NAMES
		if (iYear == 1210):
			self.setCivName(iIndia, "TXT_KEY_CIV_INDIA_DELHI_SULTANATE_NAME", "", "")
		
		for nCivicOption in range (gc.getNumCivicOptionInfos()):
			if pEngland.getNumCities() > 5 and (pEngland.getCivics(nCivicOption) != iPoliceState or pEngland.getCivics(nCivicOption) != iUniversalSuffrage):
				self.setCivName(iEngland, "TXT_KEY_CIV_BRITAIN_EMPIRE_NAME", "", "")
				
			if pFrance.getCivics(nCivicOption) == iHereditaryRule or pFrance.getCivics(nCivicOption) == iDespotism:
				self.setCivName(iFrance, "TXT_KEY_CIV_KINGDOM_OF_FRANCE_NAME", "", "")
		
		
#DYNAMIC CIV NAMES END

	
		for x in range(iNumActivePlayers):
			if (iGameTurn % 60 == 55 and iGameTurn > 50):
				if (gc.getPlayer(x).isHuman() == 0):
					self.makePeace(x, iMinor)
			if (iGameTurn % 13 == 6 and iGameTurn > 50): 
				if (gc.getPlayer(x).isHuman() == 0):
					self.declareWar(x, iMinor)
				
		if not gc.getTeam(iAztecs).isAlive():
			self.declareWar(iSpain, iMinor)			
		if not gc.getTeam(iInca).isAlive():
			self.declareWar(iSpain, iMinor)			
	
		if not gc.getTeam(iEngland).isAlive():
			rand = random.randint(50, 100)
			if (iGameTurn % rand == 0):
				self.revival(iEngland, tEngRevivalArea, tLondon)
				
		if not gc.getTeam(iFrance).isAlive():
			rand1 = random.randint(50, 100)
			if (iGameTurn % rand1 == 0):
				self.revival(iFrance, tFrRevivalArea, tParis)
				
		if not gc.getTeam(iSpain).isAlive():
			rand2 = random.randint(50, 100)
			if (iGameTurn % rand2 == 0):
				self.revival(iSpain, tSpRevivalArea, tSantiago)
				
		if not gc.getTeam(iJapan).isAlive():
			rand3 = random.randint(50, 100)
			if (iGameTurn % rand3 == 0):
				self.revival(iJapan, tJapRevivalArea, tKyoto)

		if (iYear >= 1580):					
			if not gc.getTeam(iHolland).isAlive():
				rand4 = random.randint(50, 100)
				if (iGameTurn % rand4 == 0):
					self.revivalForOneCityCivs(iHolland, tAmsterdam, tAmsterdam)
				
		if not gc.getTeam(iKorea).isAlive():
			rand5 = random.randint(50, 100)
			if (iGameTurn % rand5 == 0):
				self.revivalForOneCityCivs(iKorea, tSeoul, tSeoul)
		
		if (iYear >= 1100):			
			if not gc.getTeam(iPortugal).isAlive():
				rand6 = random.randint(50, 100)
				if (iGameTurn % rand6 == 0):
					self.revivalForOneCityCivs(iPortugal, tLisbon, tLisbon)
					
		if(iYear >= 1170 and iYear <= 1860):
			if not gc.getTeam(iItaly).isAlive():
				rand7 = random.randint(50, 100)
				if (iGameTurn % rand7 == 0):
					self.revivalForOneCityCivs(iItaly, tVenice, tVenice)	

		if(iYear <= 1700): 					
			if not gc.getTeam(iAustria).isAlive():
				rand8 = random.randint(50, 100)
				if (iGameTurn % rand8 == 0):
					self.revival(iAustria, tAusRevivalArea, tSalzburg)	

		if not gc.getTeam(iPoland).isAlive():
			rand9 = random.randint(50, 100)
			if (iGameTurn % rand9 == 0):
				self.revivalForOneCityCivs(iPoland, tGniezno, tGniezno)

		if(iYear >= 1290 and iYear <= 1822):				
			if not gc.getTeam(iTurkey).isAlive():
				rand10 = random.randint(50, 100)
				if (iGameTurn % rand10 == 0):
					self.revival(iTurkey, tTurRevivalArea, tConstantinopolis)
					

		if(iYear <= 1650): 					
			if not gc.getTeam(iRussia).isAlive():
				rand11 = random.randint(50, 100)
				if (iGameTurn % rand11 == 0):
					self.revivalDiameter5(iRussia, tRusRevivalArea, tMoscow)

		if not gc.getTeam(iChina).isAlive():
			rand12 = random.randint(50, 100)
			if (iGameTurn % rand12 == 0):
				self.revival(iChina, tChiRevivalArea, tXijin)	

		if(iYear <= 1515):
			if not gc.getTeam(iVikings).isAlive():
				rand13 = random.randint(50, 100)
				if (iGameTurn % rand13 == 0):
					self.revival(iVikings, tDenRevivalArea, tRibe)

		if(iYear >= 1520):				
			if not gc.getTeam(iVikings).isAlive():
				rand14 = random.randint(50, 100)
				if (iGameTurn % rand14 == 0):
					self.revival(iVikings, tDen1RevivalArea, tRibe)	
			if not gc.getTeam(iSweden).isAlive():
				rand15 = random.randint(50, 100)
				if (iGameTurn % rand15 == 0):
					self.revival(iSweden, tSwedRevivalArea, tUppsala)	

		if(iYear >= 1822):
			if not gc.getTeam(iBrazil).isAlive():
				rand16 = random.randint(50, 100)
				if (iGameTurn % rand16 == 0):
					self.revival(iBrazil, tBrazilArea, tRio)
			if not gc.getTeam(iGreece).isAlive():
				rand17 = random.randint(50, 100)
				if (iGameTurn % rand17 == 0):
					self.revivalForOneCityCivs(iGreece, tAthens, tAthens)

		if(iYear >= 1820):
			if not gc.getTeam(iColombia).isAlive():
				rand18 = random.randint(50, 100)
				if (iGameTurn % rand18 == 0):
					self.revival(iColombia, tColombiaArea, tSantaFe)	

		if(iYear >= 1816):
			if not gc.getTeam(iArgentina).isAlive():
				rand19 = random.randint(50, 100)
				if (iGameTurn % rand19 == 0):
					self.revival(iArgentina, tArgentineArea, tBuenosAires)

		if(iYear <= 1886 and iYear >=1954):		
			if not gc.getTeam(iKhmer).isAlive():
				rand20 = random.randint(50, 100)
				if (iGameTurn % rand20 == 0):
						self.revival(iKhmer, tKhmRevivalArea, tAngkor)

		if(iYear >= 1860):
			if not gc.getTeam(iItaly).isAlive():
				rand21 = random.randint(50, 100)
				if (iGameTurn % rand21 == 0):
					self.revival(iItaly, tItRevivalArea, tRome)

		if(iYear >= 1700 and iYear <= 1945):
			if not gc.getTeam(iGermany).isAlive():
				rand22 = random.randint(50, 100)
				if (iGameTurn % rand22 == 0):
					self.revival(iGermany, tGerRevivalArea, tBerlin)
								
		if(iYear >= 1945):
			if not gc.getTeam(iGermany).isAlive():
				rand23 = random.randint(50, 100)
				if (iGameTurn % rand23 == 0):
					self.revival(iGermany, tGer1RevivalArea, tBerlin)

		if(iYear >= 1700 and iYear <= 1918):
			if not gc.getTeam(iAustria).isAlive():
				rand24 = random.randint(50, 100)
				if (iGameTurn % rand24 == 0):
					self.revival(iAustria, tAus1RevivalArea, tSalzburg)

		if(iYear >= 1918):								
			if not gc.getTeam(iAustria).isAlive():
				rand25 = random.randint(50, 100)
				if (iGameTurn % rand25 == 0):	
					self.revivalForOneCityCivs(iAustria, tSalzburg, tSalzburg)

		if(iYear >= 1822):
			if not gc.getTeam(iTurkey).isAlive():
				rand26 = random.randint(50, 100)
				if (iGameTurn % rand26 == 0):
					self.revival(iTurkey, tTur1RevivalArea, tConstantinopolis)	

		if(iYear >= 1600 and iYear <= 1991):	
			all=tRus1RevivalArea+tKievRevivalArea
			if not gc.getTeam(iRussia).isAlive():
				rand27 = random.randint(50, 100)
				if (iGameTurn % rand27 == 0):
					self.revivalDiameter5(iRussia, all, tMoscow)
								
		if(iYear >= 1991):	
			if not gc.getTeam(iRussia).isAlive():
				rand28 = random.randint(50, 100)
				if (iGameTurn % rand28 == 0):
					self.revivalDiameter5(iRussia, tRus1RevivalArea, tMoscow)

		if(iYear >= 1500):	
			if not gc.getTeam(iIran).isAlive():
				rand29 = random.randint(50, 100)
				if (iGameTurn % rand29 == 0):
					self.revival(iIran, tIranRevivalArea, tSiraz)

		if(iYear >= 1860):	
			if not gc.getTeam(iAmerica).isAlive():
				rand30 = random.randint(50, 100)
				if (iGameTurn % rand30 == 0):
					self.revival(iAmerica, tUSRevivalArea, tWashington)
								
		if(iYear >= 1820):	
			if not gc.getTeam(iMexico).isAlive():
				rand31 = random.randint(50, 100)
				if (iGameTurn % rand31 == 0):
					self.revival(iMexico, tMexRevivalArea, tTenochtitlan)

		if not gc.getTeam(iMali).isAlive():
			rand32 = random.randint(50, 100)
			if (iGameTurn % rand32 == 0):
				self.revivalForOneCityCivs(iMali, tTimbuktu, tTimbuktu)
				
		if not gc.getTeam(iMorocco).isAlive():
			rand33 = random.randint(50, 100)
			if (iGameTurn % rand33 == 0):
				self.revivalForOneCityCivs(iMorocco, tTanger, tTanger)
	
		if(iYear >= 1200):		
			if not gc.getTeam(iEthiopia).isAlive():
				rand34 = random.randint(50, 100)
				if (iGameTurn % rand34 == 0):
					self.revival(iEthiopia, tEthRevivalArea, tAksum)
					
		if(iYear >= 1736):		
			if not gc.getTeam(iArabia).isAlive():
				rand35 = random.randint(50, 100)
				if (iGameTurn % rand35 == 0):
					self.revival(iArabia, tArRevivalArea, tMecca)
					
		if(iYear >= 1250 and iYear <= 1515):
			if not gc.getTeam(iArabia).isAlive() and not gc.getTeam(iEgypt).isAlive():
				self.revival(iEgypt, tEgRevivalArea, tCairo)				
				

		if (gc.getTeam(iSpain).isHasMet(iAztecs) and gc.getTeam(iAztecs).isAlive()):
			if not gc.getTeam(iSpain).isVassal(iAztecs):	
				iRnd3 = random.randrange(1480, 1700, 5)
				if iYear == iRnd3:		
					gc.getTeam(iSpain).declareWar(iAztecs, True, WarPlanTypes.WARPLAN_TOTAL)
					gc.getTeam(iSpain).setPermanentWarPeace(iAztecs, True)
					self.makeUnit(iConquistador, 0, iSpain, tCp, 4)
					self.makeUnit(iCannon, 6, iSpain, tCp, 4)
				iRnd1 = random.randrange(1700, 1802, 3)
				if iYear == iRnd1:	
					gc.getTeam(iSpain).declareWar(iAztecs, True, WarPlanTypes.WARPLAN_TOTAL)
					gc.getTeam(iSpain).setPermanentWarPeace(iAztecs, True)
					self.makeUnit(iConquistador, 0, iSpain, tCp, 4)
					self.makeUnit(iCannon, 6, iSpain, tCp, 4)
		if (gc.getTeam(iSpain).isHasMet(iAztecs) and gc.getTeam(iAztecs).isAlive()):
			if not gc.getTeam(iSpain).isVassal(iAztecs):	
				iRnd4 = random.randrange(1480, 1700, 5)
				if iYear == iRnd4:		
					gc.getTeam(iSpain).declareWar(iInca, True, WarPlanTypes.WARPLAN_TOTAL)
					gc.getTeam(iSpain).setPermanentWarPeace(iInca, True)
					self.makeUnit(iConquistador, 0, iSpain, tCp1, 4)
					self.makeUnit(iCannon, 6, iSpain, tCp1, 4)
				iRnd3 = random.randrange(1700, 1802, 3)
				if iYear == iRnd3:	
					gc.getTeam(iSpain).declareWar(iInca, True, WarPlanTypes.WARPLAN_TOTAL)
					gc.getTeam(iSpain).setPermanentWarPeace(iInca, True)
					self.makeUnit(iConquistador, 0, iSpain, tCp1, 4)
					self.makeUnit(iCannon, 6, iSpain, tCp1, 4)
					
		if (gc.getTeam(iRussia).isHasMet(iMongolia) and (gc.getTeam(iMongolia).isAlive() and gc.getTeam(iRussia).isAlive())):
			if not gc.getTeam(iRussia).isVassal(iMongolia):	
				iRnd5 = random.randrange(1550, 1700, 5)
				if iYear == iRnd5:		
					gc.getTeam(iRussia).declareWar(iMongolia, True, WarPlanTypes.WARPLAN_TOTAL)
					gc.getTeam(iRussia).setPermanentWarPeace(iMongolia, True)
					
					
		if (gc.getTeam(iRussia).isHasMet(iMongolia) and (gc.getTeam(iMongolia).isAlive() and gc.getTeam(iRussia).isAlive())):
			if CyGame().getSorenRandNum(100, "iMongolia War With iRussia") <= 66:	
				if not gc.getTeam(iMongolia).isVassal(iRussia):	
					if iYear == random.randrange(1200, 1400, 10):				
						gc.getTeam(iMongolia).declareWar(iRussia, True, WarPlanTypes.WARPLAN_TOTAL)
						
		if (gc.getTeam(iArabia).isHasMet(iMongolia) and (gc.getTeam(iMongolia).isAlive() and gc.getTeam(iArabia).isAlive())):
			if CyGame().getSorenRandNum(100, "iMongolia War With iArabia") <= 66:	
				if not gc.getTeam(iMongolia).isVassal(iArabia):	
					if iYear == random.randrange(1200, 1400, 10):				
						gc.getTeam(iMongolia).declareWar(iArabia, True, WarPlanTypes.WARPLAN_TOTAL)
			
			
		if (iYear == 1100):
			#gc.getMap().plot(71, 30).setBonusType(iSugar) #Egypt
			gc.getMap().plot(72, 24).setBonusType(iSugar) #East Africa
			gc.getMap().plot(70, 17).setBonusType(iSugar) #Zimbabwe
			gc.getMap().plot(68, 11).setBonusType(iSugar) #South Africa

			gc.getMap().plot(66, 23).setBonusType(iBanana) #Central Africa
			gc.getMap().plot(67, 21).setBonusType(iBanana) #Central Africa

		if (iYear == 1200):
			gc.getMap().plot(57, 52).setBonusType(iWheat) #Amsterdam
				
		if (iYear == 1600):
			gc.getMap().plot(28, 46).setBonusType(iCow) #Washington area
			gc.getMap().plot(30, 49).setBonusType(iCow) #New York area
			gc.getMap().plot(25, 49).setBonusType(iCow) #Lakes
			gc.getMap().plot(24, 43).setBonusType(iCow) #Jacksonville area
			gc.getMap().plot(18, 46).setBonusType(iCow) #Colorado 
			gc.getMap().plot(11, 47).setBonusType(iCow) #California
			gc.getMap().plot(20, 45).setBonusType(iCow) #Texas
			gc.getMap().plot(37, 14).setBonusType(iCow) #Argentina
			gc.getMap().plot(33, 11).setBonusType(iCow) #Argentina
			gc.getMap().plot(35, 10).setBonusType(iCow) #Pampas
			
			gc.getMap().plot(22, 49).setBonusType(iPig) #Lakes
			
			gc.getMap().plot(21, 50).setBonusType(iWheat) #Canadian border
			gc.getMap().plot(19, 48).setBonusType(iWheat) #Midwest

			gc.getMap().plot(22, 33).setBonusType(iBanana) #Guatemala
			gc.getMap().plot(27, 31).setBonusType(iBanana) #Colombia
			gc.getMap().plot(43, 23).setBonusType(iBanana) #Brazil
			gc.getMap().plot(39, 26).setBonusType(iBanana) #Brazil

			gc.getMap().plot(49, 44).setBonusType(iCorn) #Galicia
			gc.getMap().plot(54, 48).setBonusType(iCorn) #France
			gc.getMap().plot(67, 47).setBonusType(iCorn) #Romania
			   

		if (iYear == 1700):
			gc.getMap().plot(26, 45).setBonusType(iHorse) #Washington area                        
			gc.getMap().plot(21, 48).setBonusType(iHorse) #Midwest
			gc.getMap().plot(19, 45).setBonusType(iHorse) #Texas
			gc.getMap().plot(40, 25).setBonusType(iHorse) #Brazil
			gc.getMap().plot(33, 10).setBonusType(iHorse) #Buenos Aires area
			gc.getMap().plot(32, 8).setBonusType(iHorse) #Pampas

			gc.getMap().plot(27, 36).setBonusType(iSugar) #Caribbean
			gc.getMap().plot(39, 25).setBonusType(iSugar) #Brazil
			gc.getMap().plot(37, 20).setBonusType(iSugar) #inner Brazil

			gc.getMap().plot(107, 50).setBonusType(iCorn) #Manchuria

		if (iYear == 1850):
			gc.getMap().plot(12, 45).setBonusType(iWine) #California
			gc.getMap().plot(31, 10).setBonusType(iWine) #Andes

			gc.getMap().plot(114, 11).setBonusType(iSheep) #Australia
			gc.getMap().plot(116, 13).setBonusType(iSheep) #Australia
			gc.getMap().plot(121, 6).setBonusType(iSheep) #New Zealand

			gc.getMap().plot(19, 41).setBonusType(iHorse) #Mexico

			gc.getMap().plot(58, 47).setBonusType(iRice) #Vercelli
			gc.getMap().plot(12, 49).setBonusType(iRice) #California
	
		
		if(iYear == 1030):
			self.makeUnit(iGhulam, 6, iSeljuk, tSeljuk, 15)
			self.declareWar(iSeljuk, iArabia)
			self.makePeace(iSeljuk, iBarbarian)
			
##DYNAMIC LEADERS
		if (iYear == 1220):							
			pArabia.setLeader(gc.getInfoTypeForString("LEADER_BAIBARS"))
		if (iYear == 1480):							
			pPortugal.setLeader(gc.getInfoTypeForString("LEADER_JOAO"))	
		if (iYear == 1520):							
			pTurkey.setLeader(gc.getInfoTypeForString("LEADER_SULEIMAN"))	
		if (iYear == 1645):							
			pFrance.setLeader(gc.getInfoTypeForString("LEADER_LOUIS_XIV"))	
		if (iYear == 1525):							
			pEngland.setLeader(gc.getInfoTypeForString("LEADER_ELIZABETH"))	
		if (iYear == 1525):							
			pSweden.setLeader(gc.getInfoTypeForString("LEADER_KARLXII"))
		if (iYear == 1260):							
			pMongolia.setLeader(gc.getInfoTypeForString("LEADER_KUBLAI_KHAN"))	
		if (iYear == 1590):				
			pVikings.setLeader(gc.getInfoTypeForString("LEADER_CHRISTIAN"))	
		if (iYear == 1485):				
			pAustria.setLeader(gc.getInfoTypeForString("LEADER_MAXIMILIAN"))
		if (iYear == 1560):				
			pSpain.setLeader(gc.getInfoTypeForString("LEADER_FILIPE"))	
		if (iYear == 1680):				
			pRussia.setLeader(gc.getInfoTypeForString("LEADER_PETER"))	
			pPoland.setLeader(gc.getInfoTypeForString("LEADER_SOBIESKI"))
		if (iYear == 1838):							
			pEngland.setLeader(gc.getInfoTypeForString("LEADER_VICTORIA"))	
		if (iYear == 1763):							
			pRussia.setLeader(gc.getInfoTypeForString("LEADER_CATHERINE"))	
		if (iYear == 1802):							
			pFrance.setLeader(gc.getInfoTypeForString("LEADER_NAPOLEON"))
		if (iYear == 1858):							
			pMexico.setLeader(gc.getInfoTypeForString("LEADER_JUAREZ"))		
		if (iYear == 1934):							
			pMexico.setLeader(gc.getInfoTypeForString("LEADER_CARDENAS"))					
		if (iYear == 1870):							
			pSwahili.setLeader(gc.getInfoTypeForString("LEADER_BARGHASH"))
		if (iYear == 1575):							
			pMorocco.setLeader(gc.getInfoTypeForString("LEADER_AHMAD_AL-MANSUR"))
		if (iYear == 1475):							
			pSpain.setLeader(gc.getInfoTypeForString("LEADER_ISABELLA"))
		if (iYear == 1690):							
			pChola.setLeader(gc.getInfoTypeForString("LEADER_MANGAMMAL"))
		if (iYear == 1828):							
			pPortugal.setLeader(gc.getInfoTypeForString("LEADER_MARIA_II"))	
		if (iYear == 1370):							
			pChina.setLeader(gc.getInfoTypeForString("LEADER_HONGWU"))	
		if (iYear == 1870):							
			pChina.setLeader(gc.getInfoTypeForString("LEADER_MEIJI"))	
		if (iYear == 1860):							
			pItaly.setLeader(gc.getInfoTypeForString("LEADER_CAVOUR"))	
		if (iYear == 1872):							
			pGermany.setLeader(gc.getInfoTypeForString("LEADER_BISMARCK"))
		if (iYear == 1848):							
			pAustria.setLeader(gc.getInfoTypeForString("LEADER_FRANZ_JOZEPH"))
		if (iYear == 1736):							
			pArabia.setLeader(gc.getInfoTypeForString("LEADER_SAUD"))
		if (iYear == 1545):							
			pRussia.setLeader(gc.getInfoTypeForString("LEADER_IVAN_IV"))	
		if (iYear == 1894):							
			pRussia.setLeader(gc.getInfoTypeForString("LEADER_NICHOLAS_II"))				
				
		if(iYear == 1100):
			pPortugal.setPlayable(True)
			self.makeUnit(iGhulam, 6, iSeljuk, tSeljuk1, 15)
			self.declareWar(iSeljuk, iByzantium)			
			self.fc(tLisbon, 0, 1, iPortugal, [iLongbowman, 2])
			gc.getMap().plot(tLisbon[0], tLisbon[1]).setCulture(iPortugal, 2000, True)
			self.culturespread(iPortugal, tLisbon, 1000)
			self.population(iPortugal ,tLisbon, 5)	
			if (pPortugal.isHuman() == 0):
				pPortugal.setHandicap(gc.getInfoTypeForString("HANDICAP_SETTLER"))
			self.makeUnit(iLongbowman, 4, iPortugal, tLisbon, 3)
			self.makeUnit(iPikeman, 4, iPortugal, tLisbon, 3)
			self.makeUnit(iSettler, 0, iPortugal, tLisbon, 1)
			self.makeUnit(iCrossbowman, 4, iPortugal, tLisbon, 2)
			self.makeUnit(iWorkBoat, 4, iPortugal, tLisbon, 1)
			self.makeUnit(iGalley, 4, iPortugal, tLisbon, 2)
			self.makeUnit(iWorker, 4, iPortugal, tLisbon, 3)
			self.makeUnit(iChristianMissionary, 4, iPortugal, tLisbon, 1)
			
			self.buildingsBuild(iPortugal, tLisbon, iGranary)
			self.buildingsBuild(iPortugal, tLisbon, iLibrary)
			self.buildingsBuild(iPortugal, tLisbon, iWalls)		
			self.buildingsBuild(iPortugal, tLisbon, iCastle)
			self.buildingsBuild(iPortugal, tLisbon, iForge)	
			self.buildingsBuild(iPortugal, tLisbon, iObelisk)	
			self.buildingsBuild(iPortugal, tLisbon, iTheatre)
			self.buildingsBuild(iPortugal, tLisbon, iBarracks)	
			self.buildingsBuild(iPortugal, tLisbon, iGrocer)	
			self.buildingsBuild(iPortugal, tLisbon, iMarket)
#			self.buildingsBuild(iPortugal, tLisbon, iTriumphalArch)			
			
		if(iYear == 1150):
			self.makeUnit(iIncanQuechua, 4, iInca, tCuzco, 5)			
			self.makeUnit(iArcher, 4, iInca, tCuzco, 3)			
			self.makeUnit(iWorker, 0, iInca, tCuzco, 3)					
			self.makeUnit(iSettler, 0, iInca, tCuzco, 4)					
			
		if(iYear == 1160):
			self.culturespread(iSpain, tBurgos, 1000)			
			
		if(iYear == 1170):
			pItaly.setPlayable(True)
			self.fc(tVenice, 0, 1, iItaly, [iLongbowman, 2])
			gc.getMap().plot(tVenice[0], tVenice[1]).setCulture(iItaly, 2000, True)
			if (pItaly.isHuman() == 0):
				pItaly.setHandicap(gc.getInfoTypeForString("HANDICAP_SETTLER"))
			self.makeUnit(iKnight, 4, iItaly, tVenice, 2)
			self.makeUnit(iCrossbowman, 4, iItaly, tVenice, 3)
			self.makeUnit(iPikeman, 4, iItaly, tVenice, 2)
			self.makeUnit(iTrebuchet, 4, iItaly, tVenice, 3)
			self.makeUnit(iGalley, 4, iItaly, tVenice, 1)
			self.makeUnit(iTrireme, 4, iItaly, tVenice, 1)
			self.culturespread(iItaly, tVenice, 1000)
			self.buildingsBuild(iItaly, tVenice, iGranary)
			self.buildingsBuild(iItaly, tVenice, iLibrary)
			self.buildingsBuild(iItaly, tVenice, iWalls)		
			self.buildingsBuild(iItaly, tVenice, iCastle)
			self.buildingsBuild(iItaly, tVenice, iArtStudio)	
			self.buildingsBuild(iItaly, tVenice, iObelisk)	
			self.buildingsBuild(iItaly, tVenice, iTheatre)	
			self.buildingsBuild(iItaly, tVenice, iBarracks)	
			self.buildingsBuild(iItaly, tVenice, iGrocer)	
			self.buildingsBuild(iItaly, tVenice, iMarket)			
		
		if(iYear == 1180):
			self.makeUnit(iWorker, 0, iItaly, tVenice, 3)

		if(iYear == 1200):
			pMongolia.setPlayable(True)
			pAztecs.setPlayable(True)
			pEthiopia.setPlayable(True)
			if (pMongolia.isHuman() == 0):
				pMongolia.setHandicap(gc.getInfoTypeForString("HANDICAP_SETTLER"))
			self.makeUnit(iSettler, 0, iMongolia, tKarakorum, 6)
			self.makeUnit(iLongbowman, 4, iMongolia, tKarakorum, 1)		
			self.makeUnit(iCrossbowman, 4, iMongolia, tKarakorum, 2)
			self.makeUnit(iWorker, 0, iMongolia, tKarakorum, 4)

			self.fc(tOaxaca, 0, 1, iAztecs, [iAztecJaguar, 2])
			pAztecs.found(tTenochtitlan[0], tTenochtitlan[1])
			self.buildingsBuild(iAztecs, tTenochtitlan, iPalace)			
			self.makeUnit(iAztecJaguar, 4, iAztecs, tTenochtitlan, 5)			
			self.makeUnit(iArcher, 4, iAztecs, tTenochtitlan, 3)			
			self.makeUnit(iWorker, 0, iAztecs, tTenochtitlan, 2)

			self.fc(tAksum, 0, 1, iEthiopia, [iLongbowman, 2])			
			self.makeUnit(iWarElephant, 4, iEthiopia, tAksum, 5)			
			self.makeUnit(iArcher, 4, iEthiopia, tAksum, 5)			
			self.makeUnit(iWorker, 0, iEthiopia, tAksum, 2)			
		
			
		if(iYear == 1210):
			if (pIndia.isHuman() == 0):
				pIndia.setHandicap(gc.getInfoTypeForString("HANDICAP_DEITY"))		
			pIndia.setPlayable(True)

			self.fc(tDelhi, 0, 1, iIndia, [iLongbowman, 2])	
			self.fc(tShimla, 0, 1, iIndia, [iLongbowman, 2])	
			self.fc(tBenares, 0, 1, iIndia, [iLongbowman, 2])	
			delhi =  gc.getMap().plot( tDelhi[0], tDelhi[1] ).getPlotCity()
			shimla =  gc.getMap().plot( tShimla[0], tShimla[1] ).getPlotCity()
			benares =  gc.getMap().plot( tBenares[0], tBenares[1] ).getPlotCity()
			delhi.setHasReligion(gc.getInfoTypeForString("RELIGION_ISLAM"), True, True, True)			
			shimla.setHasReligion(gc.getInfoTypeForString("RELIGION_ISLAM"), True, True, True)
			benares.setHasReligion(gc.getInfoTypeForString("RELIGION_ISLAM"), True, True, True)
			self.makeUnit(iWarElephant, 4, iIndia, tDelhi, 3)		
			self.makeUnit(iCrossbowman, 4, iIndia, tDelhi, 3)	
	

		if(iYear == 1210):
			for tMongoliaIdx in tMongoliaArea:
				for xMongolia in range(tMongoliaIdx[0]-1, tMongoliaIdx[0]+2):
					for yMongolia in range(tMongoliaIdx[1]-1, tMongoliaIdx[1]+2):
						self.fc([xMongolia, yMongolia], 0, 1, iMongolia, [iLongbowman, 2])	
			self.fc(tXijin, 0, 1, iMongolia, [iLongbowman, 2])	
			self.culturespread(iMongolia, tXijin, 1000)		
			self.fc(tXingqing, 0, 1, iMongolia, [iLongbowman, 2])			
			self.makeUnit(iMongolKeshik, 6, iMongolia, tKarakorum, 25)		
			
			
		if(iYear == 1220):
			iRnd = CyGame().getSorenRandNum(100, "iMongolia War With iChina")
			if iRnd <= 66:		
				self.declareWar(iMongolia, iChina)
				
		if(iYear == 1230):
			iRnd1= CyGame().getSorenRandNum(100, "iMongolia War With iKorea")
			if iRnd1 <= 66:		
				self.declareWar(iMongolia, iKorea)	
				
		if(iYear == 1802):
			iRnd3 = CyGame().getSorenRandNum(100, "iFrance War With iItaly")
			if iRnd3 <= 50:		
				self.declareWar(iFrance, iItaly)
			iRnd4 = CyGame().getSorenRandNum(100, "iFrance War With iPope")
			if iRnd4 <= 50:		
				self.declareWar(iFrance, iPope)
			iRnd5 = CyGame().getSorenRandNum(100, "iFrance War With iAustria")
			if iRnd5 <= 50:		
				self.declareWar(iFrance, iAustria)
			iRnd6 = CyGame().getSorenRandNum(100, "iFrance War With iGermany")
			if iRnd6 <= 50:		
				self.declareWar(iFrance, iGermany)
			iRnd8 = CyGame().getSorenRandNum(100, "iFrance War With iPortugal")
			if iRnd8 <= 50:		
				self.declareWar(iFrance, iPortugal)
			iRnd9 = CyGame().getSorenRandNum(100, "iFrance War With iEngland")
			if iRnd9 <= 50:		
				self.declareWar(iFrance, iEngland)
				
		if(iYear == 1808):
			iRnd7 = CyGame().getSorenRandNum(100, "iFrance War With iSpain")
			if iRnd7 <= 50:		
				self.declareWar(iFrance, iSpain)
			iRnd12 = CyGame().getSorenRandNum(100, "iFrance War With iHolland")
			if iRnd12 <= 50:		
				self.declareWar(iFrance, iHolland)
				
		if(iYear == 1812):
			iRnd10 = CyGame().getSorenRandNum(100, "iFrance War With iRussia")
			if iRnd10 <= 50:		
				self.declareWar(iFrance, iRussia)
			iRnd11 = CyGame().getSorenRandNum(100, "iFrance War With iPoland")
			if iRnd11 <= 50:		
				self.declareWar(iFrance, iPoland)
				
				
		if(iYear == 1840):	
			self.declareWar(iEngland, iMughals)
		if(iYear == 1870):	
			self.declareWar(iEngland, iSwahili)
		if(iYear == 1888):	
			self.declareWar(iFrance, iKhmer)
		if(iYear == 1896):	
			self.declareWar(iFrance, iMali)
		if(iYear == 1896):	
			self.declareWar(iFrance, iMorocco)
			
		if(iYear == 1280):
			seljukCapital = pSeljuk.getCapitalCity()
			tseljukCapital = (seljukCapital.getX(), seljukCapital.getY())					
			self.fc(tseljukCapital, 0, 1, iMinor, [iCamelArcher, 1])							
				
		if(iYear == 1300):
			sogut = gc.getMap().plot( tSogut[0], tSogut[1] )
			iNumUnitsInAPlotSogut = sogut.getNumUnits()
			
			if iNumUnitsInAPlotSogut:
				for o in range(iNumUnitsInAPlotSogut):
					enemyUnit = sogut.getUnit(o)
					if not enemyUnit.isNone():
						enemyUnit.kill(False, iByzantium)
#			pArabia.changeAnarchyTurns(60)
			pTurkey.setPlayable(True)
			if (pTurkey.isHuman() == 0):
				pTurkey.setHandicap(gc.getInfoTypeForString("HANDICAP_SETTLER"))
			self.makeUnit(iCrossbowman, 6, iTurkey, tSogut, 6)
			self.makeUnit(iHorseArcher, 6, iTurkey, tSogut, 6)
			self.makeUnit(iLongbowman, 6, iTurkey, tSogut, 4)
			self.makeUnit(iCannon, 6, iTurkey, tSogut, 6)
			self.makeUnit(iOttomanJanissary, 6, iTurkey, tSogut, 4)
			self.makeUnit(iKnight, 6, iTurkey, tSogut, 4)
			self.declareWar(iTurkey, iByzantium)
			
			for t in range(iNumActivePlayers):
				self.makePeace(t, iMinor)
			self.declareWar(iTurkey, iMinor)
			
			self.makeUnit(iWorker, 0, iTurkey, tAncyra, 4)
			self.fc(tAncyra, 0, 1, iTurkey, [iOttomanJanissary, 2])		
			self.culturespread(iTurkey, tAncyra, 1000)		
			self.buildingsBuild(iTurkey, tAncyra, iForge)
			self.buildingsBuild(iTurkey, tAncyra, iGranary)
			self.buildingsBuild(iTurkey, tAncyra, iLibrary)
			self.buildingsBuild(iTurkey, tAncyra, iBarracks)
			self.buildingsBuild(iTurkey, tAncyra, iWalls)
			self.buildingsBuild(iTurkey, tAncyra, iCastle)
			self.buildingsBuild(iTurkey, tAncyra, iMarket)
			self.buildingsBuild(iTurkey, tAncyra, iGrocer)
			self.buildingsBuild(iTurkey, tAncyra, iTheatre)
			self.buildingsBuild(iTurkey, tAncyra, iIslamicTemple)
			self.buildingsBuild(iTurkey, tAncyra, iIslamicMonastery)
			self.buildingsBuild(iTurkey, tAncyra, iAcademy)

			self.population(iTurkey ,tAncyra, 5)			
			self.fc(tTrapezus, 0, 1, iTurkey, [iOttomanJanissary, 2])	
			Ancyra =  gc.getMap().plot( tAncyra[0], tAncyra[1] ).getPlotCity()
			trapezus =  gc.getMap().plot( tTrapezus[0], tTrapezus[1] ).getPlotCity()
			Ancyra.setHasReligion(gc.getInfoTypeForString("RELIGION_ISLAM"), True, True, True)			
			trapezus.setHasReligion(gc.getInfoTypeForString("RELIGION_ISLAM"), True, True, True)
			self.culturespread(iTurkey, tTrapezus, 5000)	
			self.buildingsBuild(iTurkey, tTrapezus, iForge)
			self.buildingsBuild(iTurkey, tTrapezus, iGranary)
			self.buildingsBuild(iTurkey, tTrapezus, iLibrary)
			self.buildingsBuild(iTurkey, tTrapezus, iBarracks)
			self.buildingsBuild(iTurkey, tTrapezus, iWalls)
			self.buildingsBuild(iTurkey, tTrapezus, iCastle)
			self.buildingsBuild(iTurkey, tTrapezus, iMarket)
			self.buildingsBuild(iTurkey, tTrapezus, iGrocer)
			self.buildingsBuild(iTurkey, tTrapezus, iTheatre)
			self.buildingsBuild(iTurkey, tTrapezus, iIslamicTemple)
			self.buildingsBuild(iTurkey, tTrapezus, iIslamicMonastery)
			self.buildingsBuild(iTurkey, tTrapezus, iAcademy)
			

			
		if(iYear <= 1380):
			if (pRussia.isHuman() == 0):
				for xx in range(tMoscow[0]-1, tMoscow[0]+2):
					for yy in range(tMoscow[1]-1, tMoscow[1]+2):
						moscow = gc.getMap().plot( xx, yy )
						iNumU = moscow.getNumUnits()
						if iNumU:
							for p in range(iNumU):
								u = moscow.getUnit(p)
								if(u.getUnitType() == iSettler):
									if(u.getOwner() == iRussia):
										u.kill(False, iRussia)
										
		if(iYear == 1380):
			if (pRussia.isHuman() == 0):
#				pRussia.setHandicap(gc.getInfoTypeForString("HANDICAP_SETTLER"))
				pRussia.found(tMoscow[0], tMoscow[1])
				ruscityList = PyPlayer(iRussia).getCityList()
				for uCity in ruscityList:
					uCity.GetCy().setHasRealBuilding((0), False) #palace
				mos =  gc.getMap().plot( tMoscow[0], tMoscow[1] ).getPlotCity()
				mos.setHasRealBuilding((0), True)				

		if(iYear == 1400):
			if (pMongolia.isHuman() == 0):
				pMongolia.setHandicap(gc.getInfoTypeForString("HANDICAP_DEITY"))

		if(iYear == 1450):
			if (pSpain.isHuman() == 0):
				pSpain.setHandicap(gc.getInfoTypeForString("HANDICAP_SETTLER"))				
				
		if((iYear >= 1450) and(iYear <= 1600)):
			for iPlayer in range(iNumPlayers):
				pPlayer = gc.getPlayer(iPlayer)
				iCiv = pPlayer.getID()
				pTeam = gc.getTeam(pPlayer.getTeam())
				teamSpain = pTeam
				if (iCiv == iSpain):
					if (teamSpain.isHasTech(iOptics)):
						teamSpain.setHasTech(iAstronomy, True, iCiv, False, False)
				teamFrance = pTeam
				if (iCiv == iFrance):
					if (teamFrance.isHasTech(iOptics)):
						teamFrance.setHasTech(iAstronomy, True, iCiv, False, False)
				teamPortugal = pTeam
				if (iCiv == iPortugal):
					if (teamPortugal.isHasTech(iOptics)):
						teamPortugal.setHasTech(iAstronomy, True, iCiv, False, False)
				teamEngland = pTeam
				if (iCiv == iEngland):
					if (teamEngland.isHasTech(iOptics)):
						teamEngland.setHasTech(iAstronomy, True, iCiv, False, False)
				teamSweden = pTeam
				if (iCiv == iSweden):
					if (teamSweden.isHasTech(iOptics)):
						teamSweden.setHasTech(iAstronomy, True, iCiv, False, False)
				teamVikings = pTeam
				if (iCiv == iVikings):
					if (teamVikings.isHasTech(iOptics)):
						teamVikings.setHasTech(iAstronomy, True, iCiv, False, False)
				
		
		if(iYear == 1500):
			pIran.setPlayable(True)
			if (pIran.isHuman() == 0):
				pIran.setHandicap(gc.getInfoTypeForString("HANDICAP_CHIEFTAIN"))	
			self.fc(tSiraz, 0, 1, iIran, [iQizilbash, 2])		
			self.culturespread(iIran, tSiraz, 5000)	
			self.buildingsBuild(iIran, tSiraz, iForge)
			self.buildingsBuild(iIran, tSiraz, iGranary)
			self.buildingsBuild(iIran, tSiraz, iLibrary)
			self.buildingsBuild(iIran, tSiraz, iBarracks)
			self.buildingsBuild(iIran, tSiraz, iWalls)
			self.buildingsBuild(iIran, tSiraz, iCastle)
			self.buildingsBuild(iIran, tSiraz, iCaravanSerai)
			self.population(iIran ,tSiraz, 5)	
			self.fc(tGhazni, 0, 1, iIran, [iQizilbash, 2])	
			self.culturespread(iIran, tGhazni, 1000)	
			self.buildingsBuild(iIran, tGhazni, iForge)
			self.buildingsBuild(iIran, tGhazni, iGranary)
			self.buildingsBuild(iIran, tGhazni, iLibrary)
			self.buildingsBuild(iIran, tGhazni, iBarracks)
			self.buildingsBuild(iIran, tGhazni, iWalls)
			self.buildingsBuild(iIran, tGhazni, iCastle)
			self.buildingsBuild(iIran, tGhazni, iCaravanSerai)
			self.population(iIran ,tGhazni, 5)
			capitalCity2 = pIran.getCapitalCity()		
			self.makeUnit(iQizilbash, 4, iIran, [capitalCity2.getX(), capitalCity2.getY()], 6)			
			self.makeUnit(iCannon, 4, iIran, [capitalCity2.getX(), capitalCity2.getY()], 7)				
			self.makeUnit(iSettler, 0, iIran, [capitalCity2.getX(), capitalCity2.getY()], 2)				
			self.makeUnit(iWorker, 0, iIran, [capitalCity2.getX(), capitalCity2.getY()], 4)
			
		if(iYear == 1520):
			self.declareWar(iTurkey, iArabia)
			self.declareWar(iTurkey, iEgypt)
			gc.getTeam(iTurkey).setPermanentWarPeace(iArabia, True)	
			gc.getTeam(iTurkey).setPermanentWarPeace(iEgypt, True)				

		if(iYear == 1520):	
			pSweden.setPlayable(True)

			if (pVikings.isHuman() == 0):
				pVikings.setHandicap(gc.getInfoTypeForString("HANDICAP_SETTLER"))
			if (pSweden.isHuman() == 0):
				pSweden.setHandicap(gc.getInfoTypeForString("HANDICAP_WARLORD"))
			self.fc(tUppsala, 0, 1, iSweden, [gc.getInfoTypeForString("UNIT_SWEDISH_KAROLIN"), 2])	
			self.buildingsBuild(iSweden, tUppsala, iForge)
			self.buildingsBuild(iSweden, tUppsala, iGranary)
			self.buildingsBuild(iSweden, tUppsala, iLibrary)
			self.buildingsBuild(iSweden, tUppsala, iBarracks)
			self.buildingsBuild(iSweden, tUppsala, iWalls)
			self.buildingsBuild(iSweden, tUppsala, iCastle)			
			self.buildingsBuild(iSweden, tUppsala, gc.getInfoTypeForString("BUILDING_SWEDEN_RIKSBANK"))	
			self.buildingsBuild(iSweden, tUppsala, iGrocer)					
			self.buildingsBuild(iSweden, tUppsala, iMarket)					
			self.fc(tLund, 0, 1, iSweden, [gc.getInfoTypeForString("UNIT_SWEDISH_KAROLIN"), 2])
			self.culturespread(iSweden, tLund, 5000)	
			self.buildingsBuild(iSweden, tLund, iForge)
			self.buildingsBuild(iSweden, tLund, iGranary)
			self.buildingsBuild(iSweden, tLund, iLibrary)
			self.buildingsBuild(iSweden, tLund, iBarracks)
			self.buildingsBuild(iSweden, tLund, iCastle)			
			self.buildingsBuild(iSweden, tLund, gc.getInfoTypeForString("BUILDING_SWEDEN_RIKSBANK"))	
			self.buildingsBuild(iSweden, tLund, iGrocer)					
			self.buildingsBuild(iSweden, tLund, iMarket)	
			for tSwedishIdx in tSwedishArea:
				for xSwedish in range(tSwedishIdx[0]-1, tSwedishIdx[0]+2):
					for ySwedish in range(tSwedishIdx[1]-1, tSwedishIdx[1]+2):
						self.fc([xSwedish, ySwedish], 0, 1, iSweden, [gc.getInfoTypeForString("UNIT_SWEDISH_KAROLIN"), 2])
						self.buildingsBuild(iSweden, [xSwedish, ySwedish], iForge)
						self.buildingsBuild(iSweden, [xSwedish, ySwedish], iGranary)
						self.buildingsBuild(iSweden, [xSwedish, ySwedish], iLibrary)
						self.buildingsBuild(iSweden, [xSwedish, ySwedish], iBarracks)
						self.buildingsBuild(iSweden, [xSwedish, ySwedish], iCastle)			
						self.buildingsBuild(iSweden, [xSwedish, ySwedish], gc.getInfoTypeForString("BUILDING_SWEDEN_RIKSBANK"))	
						self.buildingsBuild(iSweden, [xSwedish, ySwedish], iGrocer)					
						self.buildingsBuild(iSweden, [xSwedish, ySwedish], iMarket)						
			capitalCity1 = pSweden.getCapitalCity()		
			self.makeUnit(gc.getInfoTypeForString("UNIT_SWEDISH_KAROLIN"), 4, iSweden, [capitalCity1.getX(), capitalCity1.getY()], 5)			
			self.makeUnit(iCannon, 4, iSweden, [capitalCity1.getX(), capitalCity1.getY()], 5)
			self.makeUnit(iKnight, 4, iSweden, [capitalCity1.getX(), capitalCity1.getY()], 3)
			self.makeUnit(iPikeman, 4, iSweden, [capitalCity1.getX(), capitalCity1.getY()], 3)			
			self.makeUnit(iSettler, 0, iSweden, [capitalCity1.getX(), capitalCity1.getY()], 3)				
			self.makeUnit(iWorker, 0, iSweden, [capitalCity1.getX(), capitalCity1.getY()], 4)	
			if (not gc.getGame().isReligionFounded(gc.getInfoTypeForString("RELIGION_PROTESTANTISM"))):
				pAustria.foundReligion(gc.getInfoTypeForString("RELIGION_PROTESTANTISM"), gc.getInfoTypeForString("RELIGION_PROTESTANTISM"), True)
	
		if(iYear == 1530):
			if (pMughals.isHuman() == 0):
				pMughals.setHandicap(gc.getInfoTypeForString("HANDICAP_EMPEROR"))
			pMughals.setPlayable(True)
			self.fc(tShimla, 0, 1, iMughals, [iMusketman, 2])	
			self.makeUnit(iSiegeElephant, 4, iMughals, tShimla, 10)			
			self.makeUnit(iMusketman, 4, iMughals, tShimla, 12)
			self.makeUnit(iKnight, 4, iMughals, tShimla, 10)
			self.makeUnit(iPikeman, 4, iMughals, tShimla, 6)		
			self.declareWar(iMughals, iIndia)			

			
		if(iYear == 1580):
			if (pSpain.isHuman() == 0):
				pSpain.setHandicap(gc.getInfoTypeForString("HANDICAP_EMPEROR"))	
			pHolland.setPlayable(True)
			if (pHolland.isHuman() == 0):
				pHolland.setHandicap(gc.getInfoTypeForString("HANDICAP_SETTLER"))
			self.fc(tAmsterdam, 0, 1, iHolland, [iMusketman, 2])
			gc.getMap().plot(tAmsterdam[0], tAmsterdam[1]).setCulture(iHolland, 2000, True)
			amsterdam = gc.getMap().plot( tAmsterdam[0], tAmsterdam[1] ).getPlotCity()
			if amsterdam.isNone():
				pHolland.found(tAmsterdam[0], tAmsterdam[1])
			self.makeUnit(iHollandOostindievaarder, 4, iHolland, tAmsterdamSea, 3)			
			self.makeUnit(iMusketman, 4, iHolland, tAmsterdam, 8)
			self.makeUnit(iPikeman, 4, iHolland, tAmsterdam, 6)
			self.makeUnit(iLongbowman, 4, iHolland, tAmsterdam, 4)
			self.makeUnit(iCuirassier, 4, iHolland, tAmsterdam, 10)
			self.population(iHolland ,tAmsterdam, 9)
			self.buildingsBuild(iHolland, tAmsterdam, iForge)
			self.buildingsBuild(iHolland, tAmsterdam, iWalls)
			self.buildingsBuild(iHolland, tAmsterdam, iCastle)
			self.buildingsBuild(iHolland, tAmsterdam, iTheatre)
			self.buildingsBuild(iHolland, tAmsterdam, iObelisk)
			self.buildingsBuild(iHolland, tAmsterdam, iMarket)
			self.buildingsBuild(iHolland, tAmsterdam, iGrocer)					
			self.buildingsBuild(iHolland, tAmsterdam, iLibrary)			
			self.buildingsBuild(iHolland, tAmsterdam, iBank)			
			self.buildingsBuild(iHolland, tAmsterdam, iHollandDike)	
			self.buildingsBuild(iHolland, tAmsterdam, iGranary)	
			self.buildingsBuild(iHolland, tAmsterdam, iBarracks)	
			self.buildingsBuild(iHolland, tAmsterdam, iUniversity)	
			self.buildingsBuild(iHolland, tAmsterdam, iCourthouse)	
			self.buildingsBuild(iHolland, tAmsterdam, iObservatory)	
			self.buildingsBuild(iHolland, tAmsterdam, iAqueduct)
			self.buildingsBuild(iHolland, tAmsterdam, iTriumphalArch)
			self.buildingsBuild(iHolland, tAmsterdam, iHeroicEpic)						
			

		if(iYear == 1585):
			self.culturespread(iHolland, tAmsterdam, 2000)
			amsterdam = gc.getMap().plot( tAmsterdam[0], tAmsterdam[1] ).getPlotCity()
			amsterdam.setHasReligion(gc.getInfoTypeForString("RELIGION_PROTESTANTISM"), True, True, True)
			self.makeUnit(iSettler, 0, iHolland, tAmsterdam, 3)
			self.makeUnit(iWorker, 0, iHolland, tAmsterdam, 3)

		if(iYear == 1700):	
			pGermany.setPlayable(True)
			if (pGermany.isHuman() == 0):
				pGermany.setHandicap(gc.getInfoTypeForString("HANDICAP_SETTLER"))
			self.fc(tBerlin, 0, 1, iGermany, [iRifleman, 2])
			self.fc(tTwangste, 0, 1, iGermany, [iRifleman, 2])
			self.fc(tHamburg, 0, 1, iGermany, [iRifleman, 2])
			gc.getMap().plot(tBerlin[0], tBerlin[1]).setCulture(iAustria, 0, True)
			gc.getMap().plot(tTwangste[0], tTwangste[1]).setCulture(iAustria, 0, True)
			gc.getMap().plot(tHamburg[0], tHamburg[1]).setCulture(iAustria, 0, True)
			gc.getMap().plot(tBerlin[0], tBerlin[1]).setCulture(iHolland, 0, True)
			gc.getMap().plot(tTwangste[0], tTwangste[1]).setCulture(iHolland, 0, True)
			gc.getMap().plot(tHamburg[0], tHamburg[1]).setCulture(iHolland, 0, True)
			gc.getMap().plot(tBerlin[0], tBerlin[1]).setCulture(iPoland, 0, True)
			gc.getMap().plot(tTwangste[0], tTwangste[1]).setCulture(iPoland, 0, True)
			gc.getMap().plot(tHamburg[0], tHamburg[1]).setCulture(iPoland, 0, True)
			amst = gc.getMap().plot( tAmsterdam[0], tAmsterdam[1] ).getPlotCity()
			amst.setCulture(iHolland, 3500, True)	
			gc.getMap().plot(tAmsterdam[0], tAmsterdam[1]).setCulture(iHolland, 2000, True)
			berlin = gc.getMap().plot( tBerlin[0], tBerlin[1] ).getPlotCity()
			if berlin.isNone():
				pGermany.found(tBerlin[0], tBerlin[1])

			self.makeUnit(iSettler, 0, iGermany, tBerlin, 1)				
			self.makeUnit(iWorker, 0, iGermany, tBerlin, 3)
			self.makeUnit(iRifleman, 4, iGermany, tBerlin, 11)
			self.makeUnit(iCannon, 4, iGermany, tBerlin, 5)
			self.culturespread(iGermany, tBerlin, 1000)
			self.culturespread(iGermany, tTwangste, 1000)
			self.culturespread(iGermany, tHamburg, 2000)
			self.buildingsBuild(iGermany, tBerlin, iForge)
			self.buildingsBuild(iGermany, tBerlin, iWalls)
			self.buildingsBuild(iGermany, tBerlin, iTheatre)
			self.buildingsBuild(iGermany, tBerlin, iMarket)
			self.buildingsBuild(iGermany, tBerlin, iGrocer)						
			self.buildingsBuild(iGermany, tBerlin, iLibrary)			
			self.buildingsBuild(iGermany, tBerlin, iBank)			
			self.buildingsBuild(iGermany, tBerlin, iGranary)	
			self.buildingsBuild(iGermany, tBerlin, iBarracks)	
			self.buildingsBuild(iGermany, tBerlin, iUniversity)	
			self.buildingsBuild(iGermany, tBerlin, iCourthouse)	
			self.buildingsBuild(iGermany, tBerlin, iObservatory)	
			self.buildingsBuild(iGermany, tBerlin, iAqueduct)
			self.buildingsBuild(iGermany, tBerlin, iPalace)
			self.buildingsBuild(iGermany, tBerlin, iMilitaryAcademy)	
			self.population(iGermany ,tBerlin, 10)	
			
			self.buildingsBuild(iGermany, tTwangste, iForge)
			self.buildingsBuild(iGermany, tTwangste, iWalls)
			self.buildingsBuild(iGermany, tTwangste, iTheatre)
			self.buildingsBuild(iGermany, tTwangste, iMarket)
			self.buildingsBuild(iGermany, tTwangste, iGrocer)					
			self.buildingsBuild(iGermany, tTwangste, iLibrary)			
			self.buildingsBuild(iGermany, tTwangste, iBank)			
			self.buildingsBuild(iGermany, tTwangste, iGranary)	
			self.buildingsBuild(iGermany, tTwangste, iBarracks)	
			self.buildingsBuild(iGermany, tTwangste, iUniversity)	
			self.buildingsBuild(iGermany, tTwangste, iCourthouse)	
			self.buildingsBuild(iGermany, tTwangste, iObservatory)	
			self.buildingsBuild(iGermany, tTwangste, iAqueduct)
			self.buildingsBuild(iGermany, tTwangste, iMilitaryAcademy)	
			
			self.buildingsBuild(iGermany, tHamburg, iForge)
			self.buildingsBuild(iGermany, tHamburg, iWalls)
			self.buildingsBuild(iGermany, tHamburg, iTheatre)
			self.buildingsBuild(iGermany, tHamburg, iMarket)
			self.buildingsBuild(iGermany, tHamburg, iGrocer)						
			self.buildingsBuild(iGermany, tHamburg, iLibrary)			
			self.buildingsBuild(iGermany, tHamburg, iBank)			
			self.buildingsBuild(iGermany, tHamburg, iGranary)	
			self.buildingsBuild(iGermany, tHamburg, iBarracks)	
			self.buildingsBuild(iGermany, tHamburg, iUniversity)	
			self.buildingsBuild(iGermany, tHamburg, iCourthouse)	
			self.buildingsBuild(iGermany, tHamburg, iObservatory)	
			self.buildingsBuild(iGermany, tHamburg, iAqueduct)
			self.buildingsBuild(iGermany, tHamburg, iMilitaryAcademy)
			
		if(iYear == 1736):
			if not gc.getTeam(iArabia).isAlive():
				for tArIdx in tArRevivalArea:
					for xArabia in range(tArIdx[0]-1, tArIdx[0]+2):
						for yArabia in range(tArIdx[1]-1, tArIdx[1]+2):	
							self.fc([xArabia, yArabia], 0, 1, iArabia, [iCuirassier, 2])	
							
				self.makeUnit(iWorker, 0, iAmerica, tWashington, 2)
				self.makeUnit(iPikeman, 6, iAmerica, tWashington, 3)
				self.makeUnit(iCannon, 6, iAmerica, tWashington, 5)						
				self.makeUnit(iMusketman, 6, iAmerica, tWashington, 4)
				self.makeUnit(iCuirassier, 6, iAmerica, tWashington, 10)

				for f in range(iNumTechs):
						if (gc.getTeam(iTurkey).isHasTech(f)): 
								gc.getTeam(iArabia).setHasTech(f, True, iArabia, False, False)					
			
		if(iYear == 1751):
			if (pFrance.isHuman() == 0):
				pFrance.setHandicap(gc.getInfoTypeForString("HANDICAP_CHIEFTAIN"))
			
		if(iYear == 1775):
			if (pEngland.isHuman() == 0):
				pEngland.setHandicap(gc.getInfoTypeForString("HANDICAP_CHIEFTAIN"))

			pAmerica.setPlayable(True)
			if (pAmerica.isHuman() == 0):
				pAmerica.setHandicap(gc.getInfoTypeForString("HANDICAP_SETTLER"))
			washington = gc.getMap().plot( tWashington[0], tWashington[1] ).getPlotCity()
			if washington.isNone():
				pAmerica.found(tWashington[0], tWashington[1])
			for tAmericaIdx in tUSArea:
				for xAmerica in range(tAmericaIdx[0]-1, tAmericaIdx[0]+2):
					for yAmerica in range(tAmericaIdx[1]-1, tAmericaIdx[1]+2):
						self.fc([xAmerica, yAmerica], 0, 1, iAmerica, [iRifleman, 2])	
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iForge)
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iWalls)
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iTheatre)
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iMarket)
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iGrocer)
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iAcademy)						
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iLibrary)			
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iBank)			
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iGranary)	
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iBarracks)	
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iUniversity)	
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iCourthouse)	
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iObservatory)	
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iAqueduct)
						self.buildingsBuild(iAmerica, [xAmerica, yAmerica], iMilitaryAcademy)							
						
						self.population(iAmerica, [xAmerica, yAmerica], 6)	
											
			self.makeUnit(iWorker, 0, iAmerica, tWashington, 4)
			self.makeUnit(iSettler, 0, iAmerica, tWashington, 5)
			self.makeUnit(iPikeman, 6, iAmerica, tWashington, 3)
			self.makeUnit(iCannon, 6, iAmerica, tWashington, 5)						
			self.makeUnit(iMusketman, 6, iAmerica, tWashington, 3)
			self.makeUnit(iRifleman, 6, iAmerica, tWashington, 4)			
			self.makeUnit(iGrenadier, 6, iAmerica, tWashington, 2)	

		if(iYear == 1600):
			if not gc.getTeam(iArabia).isAlive():
				if (pTurkey.isHuman() == 0):
					pTurkey.setHandicap(gc.getInfoTypeForString("HANDICAP_DEITY"))
			
		if(iYear == 1816):
			pArgentina.setPlayable(True)
			if (pArgentina.isHuman() == 0):
				pArgentina.setHandicap(gc.getInfoTypeForString("HANDICAP_CHIEFTAIN"))
			buenosaires = gc.getMap().plot( tBuenosAires[0], tBuenosAires[1] ).getPlotCity()
			if buenosaires.isNone():
				pArgentina.found(tBuenosAires[0], tBuenosAires[1])		
			for tArgentinaIdx in tArgentineArea:
				for xArgentina in range(tArgentinaIdx[0]-1, tArgentinaIdx[0]+2):
					for yArgentina in range(tArgentinaIdx[1]-1, tArgentinaIdx[1]+2):
						self.fc([xArgentina, yArgentina], 0, 1, iArgentina, [iRifleman, 2])	
			self.makeUnit(iWorker, 0, iArgentina, tBuenosAires, 2)
			self.makeUnit(iSettler, 0, iArgentina, tBuenosAires, 2)
			self.makeUnit(iCannon, 6, iArgentina, tBuenosAires, 4)						
			self.makeUnit(iRifleman, 6, iArgentina, tBuenosAires, 6)			
			self.makeUnit(gc.getInfoTypeForString("UNIT_ARGENTINE_GRENADIER_CAVALRY"), 6, iArgentina, tBuenosAires, 8)
			capitalCityArg = pArgentina.getCapitalCity()
			self.population(iArgentina ,[capitalCityArg.getX(), capitalCityArg.getY()], 5)				
			
			
		if(iYear == 1818):
			for xRemove in range(tSantaFe[0]-1, tSantaFe[0]+2):
				for yRemove in range(tSantaFe[1]-1, tSantaFe[1]+2):
					removeJungle = gc.getMap().plot( xRemove, yRemove )
					removeJungle.setFeatureType(-1, 0)
			
		if(iYear == 1820):
			pMexico.setPlayable(True)
			if (pMexico.isHuman() == 0):
				pMexico.setHandicap(gc.getInfoTypeForString("HANDICAP_CHIEFTAIN"))
			mexico = gc.getMap().plot( tTenochtitlan[0], tTenochtitlan[1] ).getPlotCity()
			if mexico.isNone():
				pMexico.found(tTenochtitlan[0], tTenochtitlan[1])
			for tMexicoIdx in tMexicoArea:
				for xMexico in range(tMexicoIdx[0]-1, tMexicoIdx[0]+2):
					for yMexico in range(tMexicoIdx[1]-1, tMexicoIdx[1]+2):
						self.fc([xMexico, yMexico], 0, 1, iMexico, [iRifleman, 2])	
																				
			capitalCityMex = pMexico.getCapitalCity()
			self.population(iMexico ,[capitalCityMex.getX(), capitalCityMex.getY()], 5)	
			
			self.makeUnit(iWorker, 0, iMexico, tTenochtitlan, 2)
			self.makeUnit(iCannon, 6, iMexico, tTenochtitlan, 4)						
			self.makeUnit(iRifleman, 6, iMexico, tTenochtitlan, 2)			
			self.makeUnit(iGrenadier, 6, iMexico, tTenochtitlan, 2)	
			self.makeUnit(gc.getInfoTypeForString("UNIT_MEXICO_RURALES"), 6, iMexico, tTenochtitlan, 2)
			
			pColombia.setPlayable(True)
			if (pColombia.isHuman() == 0):
				pColombia.setHandicap(gc.getInfoTypeForString("HANDICAP_WARLORD"))
			santafe = gc.getMap().plot( tSantaFe[0], tSantaFe[1] ).getPlotCity()
			if santafe.isNone():
				pColombia.found(tSantaFe[0], tSantaFe[1])
			for tColombiaIdx in tColombiaArea:
				for xColombia in range(tColombiaIdx[0]-1, tColombiaIdx[0]+2):
					for yColombia in range(tColombiaIdx[1]-1, tColombiaIdx[1]+2):
						self.fc([xColombia, yColombia], 0, 1, iColombia, [iRifleman, 2])
			self.makeUnit(iWorker, 0, iColombia, tSantaFe, 2)
			self.makeUnit(iCannon, 6, iColombia, tSantaFe, 2)						
			self.makeUnit(iRifleman, 6, iColombia, tSantaFe, 4)				
			self.makeUnit(gc.getInfoTypeForString("UNIT_COLOMBIAN_ALBION_LEGION"), 6, iColombia, tSantaFe, 4)	

			capitalCityCol = pColombia.getCapitalCity()
			self.population(iColombia ,[capitalCityCol.getX(), capitalCityCol.getY()], 5)

			if (pInca.isHuman() == 0):
				pInca.setHandicap(gc.getInfoTypeForString("HANDICAP_WARLORD"))
			if not gc.getTeam(iInca).isAlive():
				for tPeru in tPeruRevivalArea:
					for xPeru in range(tPeru[0]-1, tPeru[0]+2):
						for yPeru in range(tPeru[1]-1, tPeru[1]+2):
							self.fc([xPeru, yPeru], 0, 1, iInca, [iRifleman, 2])
				self.makeUnit(iWorker, 0, iInca, tCuzco, 2)
				self.makeUnit(iCannon, 6, iInca, tCuzco, 2)						
				self.makeUnit(iRifleman, 6, iInca, tCuzco, 4)				
				self.makeUnit(iGrenadier, 6, iInca, tCuzco, 4)	

			capitalCityInca = pInca.getCapitalCity()
			self.population(iInca ,[capitalCityInca.getX(), capitalCityInca.getY()], 5)

			for r in range(iNumTechs):
					if (gc.getTeam(iSpain).isHasTech(r)): 
							gc.getTeam(iInca).setHasTech(r, True, iInca, False, False)			
			
			
		if(iYear == 1822):
			pBrazil.setPlayable(True)
			if (pBrazil.isHuman() == 0):
				pBrazil.setHandicap(gc.getInfoTypeForString("HANDICAP_CHIEFTAIN"))
			rio = gc.getMap().plot( tRio[0], tRio[1] ).getPlotCity()
			if rio.isNone():
				pBrazil.found(tRio[0], tRio[1])
			for tBrazilIdx in tBrazilArea:
				for xBrazil in range(tBrazilIdx[0]-1, tBrazilIdx[0]+2):
					for yBrazil in range(tBrazilIdx[1]-1, tBrazilIdx[1]+2):
						self.fc([xBrazil, yBrazil], 0, 1, iBrazil, [iRifleman, 2])	
			self.makeUnit(iWorker, 0, iBrazil, tRio, 4)
			self.makeUnit(iSettler, 0, iBrazil, tRio, 2)
			self.makeUnit(iCannon, 6, iBrazil, tRio, 4)						
			self.makeUnit(iRifleman, 6, iBrazil, tRio, 7)			
			self.makeUnit(iGrenadier, 6, iBrazil, tRio, 5)	
			self.makeUnit(gc.getInfoTypeForString("UNIT_BRAZILIAN_BANDEIRANTES"), 6, iBrazil, tRio, 3)	
			
			capitalCityBrazil = pBrazil.getCapitalCity()
			self.population(iBrazil ,[capitalCityBrazil.getX(), capitalCityBrazil.getY()], 5)	

			pGreece.setPlayable(True)
			if (pGreece.isHuman() == 0):
				pGreece.setHandicap(gc.getInfoTypeForString("HANDICAP_SETTLER"))
			self.fc(tAthens, 0, 1, iGreece, [iRifleman, 2])	
																	
			self.makeUnit(iCannon, 6, iGreece, tAthens, 4)						
			self.makeUnit(iRifleman, 6, iGreece, tAthens, 8)			
			self.makeUnit(iGrenadier, 6, iGreece, tAthens, 6)				
			self.makeUnit(iCavalry, 6, iGreece, tAthens, 2)	

			self.buildingsBuild(iGreece, tAthens, iForge)
			self.buildingsBuild(iGreece, tAthens, iWalls)
			self.buildingsBuild(iGreece, tAthens, iTheatre)
			self.buildingsBuild(iGreece, tAthens, iMarket)
			self.buildingsBuild(iGreece, tAthens, iGrocer)						
			self.buildingsBuild(iGreece, tAthens, iLibrary)			
			self.buildingsBuild(iGreece, tAthens, iBank)			
			self.buildingsBuild(iGreece, tAthens, iGranary)	
			self.buildingsBuild(iGreece, tAthens, iBarracks)	
			self.buildingsBuild(iGreece, tAthens, iUniversity)	
			self.buildingsBuild(iGreece, tAthens, iCourthouse)	
			self.buildingsBuild(iGreece, tAthens, iObservatory)	
			self.buildingsBuild(iGreece, tAthens, iAqueduct)			
		
	def addTech(self):
		for iPlayer in range(iNumPlayers):
			pPlayer = gc.getPlayer(iPlayer)
			iCiv = pPlayer.getID()
			pTeam = gc.getTeam(pPlayer.getTeam())
			teamPortugal = pTeam
			if (iCiv == iPortugal):
					teamPortugal.setHasTech(iMining, True, iCiv, False, False)
					teamPortugal.setHasTech(iBronzeWorking, True, iCiv, False, False)
					teamPortugal.setHasTech(iIronWorking, True, iCiv, False, False)
					teamPortugal.setHasTech(iMetalCasting, True, iCiv, False, False)
					teamPortugal.setHasTech(iMachinery, True, iCiv, False, False)
					teamPortugal.setHasTech(iMysticism, True, iCiv, False, False)
					teamPortugal.setHasTech(iPolytheism, True, iCiv, False, False)
					teamPortugal.setHasTech(iMasonry, True, iCiv, False, False)
					teamPortugal.setHasTech(iPriesthood, True, iCiv, False, False)
					teamPortugal.setHasTech(iMonotheism, True, iCiv, False, False)
					teamPortugal.setHasTech(iTheology, True, iCiv, False, False)
					teamPortugal.setHasTech(iMonarchy, True, iCiv, False, False)
					teamPortugal.setHasTech(iDivineRight, True, iCiv, False, False)
					teamPortugal.setHasTech(iFishing, True, iCiv, False, False)
					teamPortugal.setHasTech(iSailing, True, iCiv, False, False)
					teamPortugal.setHasTech(iTheWheel, True, iCiv, False, False)
					teamPortugal.setHasTech(iPottery, True, iCiv, False, False)
					teamPortugal.setHasTech(iAgriculture, True, iCiv, False, False)
					teamPortugal.setHasTech(iWriting, True, iCiv, False, False)
					teamPortugal.setHasTech(iCodeOfLaws, True, iCiv, False, False)
					teamPortugal.setHasTech(iFeudalism, True, iCiv, False, False)
					teamPortugal.setHasTech(iGuilds, True, iCiv, False, False)
					teamPortugal.setHasTech(iAlphabet, True, iCiv, False, False)
					teamPortugal.setHasTech(iMathematics, True, iCiv, False, False)
					teamPortugal.setHasTech(iConstruction, True, iCiv, False, False)
					teamPortugal.setHasTech(iEngineering, True, iCiv, False, False)
					teamPortugal.setHasTech(iCurrency, True, iCiv, False, False)
					teamPortugal.setHasTech(iHunting, True, iCiv, False, False)
					teamPortugal.setHasTech(iArchery, True, iCiv, False, False)
					teamPortugal.setHasTech(iAnimalHusbandry, True, iCiv, False, False)
					teamPortugal.setHasTech(iHorsebackRiding, True, iCiv, False, False)
			teamSeljuk = pTeam
			if (iCiv == iSeljuk):
					teamSeljuk.setHasTech(iMining, True, iCiv, False, False)
					teamSeljuk.setHasTech(iBronzeWorking, True, iCiv, False, False)
					teamSeljuk.setHasTech(iIronWorking, True, iCiv, False, False)
					teamSeljuk.setHasTech(iMetalCasting, True, iCiv, False, False)
					teamSeljuk.setHasTech(iMachinery, True, iCiv, False, False)
					teamSeljuk.setHasTech(iMysticism, True, iCiv, False, False)
					teamSeljuk.setHasTech(iPolytheism, True, iCiv, False, False)
					teamSeljuk.setHasTech(iMasonry, True, iCiv, False, False)
					teamSeljuk.setHasTech(iPriesthood, True, iCiv, False, False)
					teamSeljuk.setHasTech(iMonotheism, True, iCiv, False, False)
					teamSeljuk.setHasTech(iTheology, True, iCiv, False, False)
					teamSeljuk.setHasTech(iMonarchy, True, iCiv, False, False)
					teamSeljuk.setHasTech(iDivineRight, True, iCiv, False, False)
					teamSeljuk.setHasTech(iFishing, True, iCiv, False, False)
					teamSeljuk.setHasTech(iSailing, True, iCiv, False, False)
					teamSeljuk.setHasTech(iTheWheel, True, iCiv, False, False)
					teamSeljuk.setHasTech(iPottery, True, iCiv, False, False)
					teamSeljuk.setHasTech(iAgriculture, True, iCiv, False, False)
					teamSeljuk.setHasTech(iWriting, True, iCiv, False, False)
					teamSeljuk.setHasTech(iCodeOfLaws, True, iCiv, False, False)
					teamSeljuk.setHasTech(iFeudalism, True, iCiv, False, False)
					teamSeljuk.setHasTech(iGuilds, True, iCiv, False, False)
					teamSeljuk.setHasTech(iAlphabet, True, iCiv, False, False)
					teamSeljuk.setHasTech(iMathematics, True, iCiv, False, False)
					teamSeljuk.setHasTech(iConstruction, True, iCiv, False, False)
					teamSeljuk.setHasTech(iEngineering, True, iCiv, False, False)
					teamSeljuk.setHasTech(iCurrency, True, iCiv, False, False)
					teamSeljuk.setHasTech(iHunting, True, iCiv, False, False)
					teamSeljuk.setHasTech(iArchery, True, iCiv, False, False)
					teamSeljuk.setHasTech(iAnimalHusbandry, True, iCiv, False, False)
					teamSeljuk.setHasTech(iHorsebackRiding, True, iCiv, False, False)
			teamMongolia = pTeam
			if (iCiv == iMongolia):
					teamMongolia.setHasTech(iMining, True, iCiv, False, False)
					teamMongolia.setHasTech(iBronzeWorking, True, iCiv, False, False)
					teamMongolia.setHasTech(iIronWorking, True, iCiv, False, False)
					teamMongolia.setHasTech(iMetalCasting, True, iCiv, False, False)
					teamMongolia.setHasTech(iMachinery, True, iCiv, False, False)
					teamMongolia.setHasTech(iMysticism, True, iCiv, False, False)
					teamMongolia.setHasTech(iPolytheism, True, iCiv, False, False)
					teamMongolia.setHasTech(iMeditation, True, iCiv, False, False)
					teamMongolia.setHasTech(iPriesthood, True, iCiv, False, False)
					teamMongolia.setHasTech(iMasonry, True, iCiv, False, False)
					teamMongolia.setHasTech(iMonarchy, True, iCiv, False, False)
					teamMongolia.setHasTech(iFishing, True, iCiv, False, False)
					teamMongolia.setHasTech(iTheWheel, True, iCiv, False, False)
					teamMongolia.setHasTech(iPottery, True, iCiv, False, False)
					teamMongolia.setHasTech(iAgriculture, True, iCiv, False, False)
					teamMongolia.setHasTech(iWriting, True, iCiv, False, False)
					teamMongolia.setHasTech(iCodeOfLaws, True, iCiv, False, False)
					teamMongolia.setHasTech(iFeudalism, True, iCiv, False, False)
					teamMongolia.setHasTech(iGuilds, True, iCiv, False, False)
					teamMongolia.setHasTech(iMathematics, True, iCiv, False, False)
					teamMongolia.setHasTech(iConstruction, True, iCiv, False, False)
					teamMongolia.setHasTech(iCurrency, True, iCiv, False, False)
					teamMongolia.setHasTech(iHunting, True, iCiv, False, False)
					teamMongolia.setHasTech(iArchery, True, iCiv, False, False)
					teamMongolia.setHasTech(iAnimalHusbandry, True, iCiv, False, False)
					teamMongolia.setHasTech(iHorsebackRiding, True, iCiv, False, False) 
			teamTurkey = pTeam
			if (iCiv == iTurkey):
					teamTurkey.setHasTech(iMining, True, iCiv, False, False)
					teamTurkey.setHasTech(iBronzeWorking, True, iCiv, False, False)
					teamTurkey.setHasTech(iIronWorking, True, iCiv, False, False)
					teamTurkey.setHasTech(iMetalCasting, True, iCiv, False, False)
					teamTurkey.setHasTech(iMachinery, True, iCiv, False, False)
					teamTurkey.setHasTech(iMysticism, True, iCiv, False, False)
					teamTurkey.setHasTech(iPolytheism, True, iCiv, False, False)
					teamTurkey.setHasTech(iMasonry, True, iCiv, False, False)
					teamTurkey.setHasTech(iPriesthood, True, iCiv, False, False)
					teamTurkey.setHasTech(iMonotheism, True, iCiv, False, False)
					teamTurkey.setHasTech(iTheology, True, iCiv, False, False)
					teamTurkey.setHasTech(iMonarchy, True, iCiv, False, False)
					teamTurkey.setHasTech(iDivineRight, True, iCiv, False, False)
					teamTurkey.setHasTech(iFishing, True, iCiv, False, False)
					teamTurkey.setHasTech(iSailing, True, iCiv, False, False)
					teamTurkey.setHasTech(iTheWheel, True, iCiv, False, False)
					teamTurkey.setHasTech(iPottery, True, iCiv, False, False)
					teamTurkey.setHasTech(iAgriculture, True, iCiv, False, False)
					teamTurkey.setHasTech(iWriting, True, iCiv, False, False)
					teamTurkey.setHasTech(iCodeOfLaws, True, iCiv, False, False)
					teamTurkey.setHasTech(iFeudalism, True, iCiv, False, False)
					teamTurkey.setHasTech(iCivilService, True, iCiv, False, False)
					teamTurkey.setHasTech(iGuilds, True, iCiv, False, False)
					teamTurkey.setHasTech(iGunpowder, True, iCiv, False, False)
					teamTurkey.setHasTech(iAlphabet, True, iCiv, False, False)
					teamTurkey.setHasTech(iMathematics, True, iCiv, False, False)
					teamTurkey.setHasTech(iCalendar, True, iCiv, False, False)
					teamTurkey.setHasTech(iConstruction, True, iCiv, False, False)
					teamTurkey.setHasTech(iEngineering, True, iCiv, False, False)
					teamTurkey.setHasTech(iCurrency, True, iCiv, False, False)
					teamTurkey.setHasTech(iHunting, True, iCiv, False, False)
					teamTurkey.setHasTech(iArchery, True, iCiv, False, False)
					teamTurkey.setHasTech(iAnimalHusbandry, True, iCiv, False, False)
					teamTurkey.setHasTech(iHorsebackRiding, True, iCiv, False, False)	
			teamItaly = pTeam
			if iCiv == iItaly:
				lItalianTechs =  [iMining, iBronzeWorking, iIronWorking, iMetalCasting, iMachinery, iMysticism, iPolytheism,
						iMasonry, iPriesthood, iMonotheism, iTheology, iMonarchy, iFishing, iSailing, iTheWheel,
						iPottery, iAgriculture, iWriting, iCodeOfLaws, iFeudalism, iGuilds, iAlphabet, iMathematics,
						iCalendar, iConstruction, iEngineering, iCurrency, iHunting, iArchery, iAnimalHusbandry,
						iHorsebackRiding, iAesthetics, iLiterature, iCompass, iCivilService, iMeditation]
				for iTech in lItalianTechs:
					teamItaly.setHasTech(iTech, True, iCiv, False, False)	

			teamIndia = pTeam
			if (iCiv == iIndia):
					teamIndia.setHasTech(iMining, True, iCiv, False, False)
					teamIndia.setHasTech(iBronzeWorking, True, iCiv, False, False)
					teamIndia.setHasTech(iIronWorking, True, iCiv, False, False)
					teamIndia.setHasTech(iMetalCasting, True, iCiv, False, False)
					teamIndia.setHasTech(iMachinery, True, iCiv, False, False)
					teamIndia.setHasTech(iMysticism, True, iCiv, False, False)
					teamIndia.setHasTech(iPolytheism, True, iCiv, False, False)
					teamIndia.setHasTech(iMasonry, True, iCiv, False, False)
					teamIndia.setHasTech(iPriesthood, True, iCiv, False, False)
					teamIndia.setHasTech(iMonotheism, True, iCiv, False, False)
					teamIndia.setHasTech(iTheology, True, iCiv, False, False)
					teamIndia.setHasTech(iMonarchy, True, iCiv, False, False)
					teamIndia.setHasTech(iDivineRight, True, iCiv, False, False)
					teamIndia.setHasTech(iFishing, True, iCiv, False, False)
					teamIndia.setHasTech(iSailing, True, iCiv, False, False)
					teamIndia.setHasTech(iTheWheel, True, iCiv, False, False)
					teamIndia.setHasTech(iPottery, True, iCiv, False, False)
					teamIndia.setHasTech(iAgriculture, True, iCiv, False, False)
					teamIndia.setHasTech(iWriting, True, iCiv, False, False)
					teamIndia.setHasTech(iCodeOfLaws, True, iCiv, False, False)
					teamIndia.setHasTech(iFeudalism, True, iCiv, False, False)
					teamIndia.setHasTech(iCivilService, True, iCiv, False, False)
					teamIndia.setHasTech(iGuilds, True, iCiv, False, False)
					teamIndia.setHasTech(iAlphabet, True, iCiv, False, False)
					teamIndia.setHasTech(iMathematics, True, iCiv, False, False)
					teamIndia.setHasTech(iCalendar, True, iCiv, False, False)
					teamIndia.setHasTech(iConstruction, True, iCiv, False, False)
					teamIndia.setHasTech(iEngineering, True, iCiv, False, False)
					teamIndia.setHasTech(iCurrency, True, iCiv, False, False)
					teamIndia.setHasTech(iHunting, True, iCiv, False, False)
					teamIndia.setHasTech(iArchery, True, iCiv, False, False)
					teamIndia.setHasTech(iAnimalHusbandry, True, iCiv, False, False)
					teamIndia.setHasTech(iHorsebackRiding, True, iCiv, False, False)	
			teamInca = pTeam
			if (iCiv == iInca):
					teamInca.setHasTech(iMining, True, iCiv, False, False)
					teamInca.setHasTech(iMysticism, True, iCiv, False, False)
					teamInca.setHasTech(iPolytheism, True, iCiv, False, False)
					teamInca.setHasTech(iMasonry, True, iCiv, False, False)
					teamInca.setHasTech(iPriesthood, True, iCiv, False, False)
					teamInca.setHasTech(iMonarchy, True, iCiv, False, False)
					teamInca.setHasTech(iFishing, True, iCiv, False, False)
					teamInca.setHasTech(iTheWheel, True, iCiv, False, False)
					teamInca.setHasTech(iPottery, True, iCiv, False, False)
					teamInca.setHasTech(iAgriculture, True, iCiv, False, False)
					teamInca.setHasTech(iWriting, True, iCiv, False, False)
					teamInca.setHasTech(iCodeOfLaws, True, iCiv, False, False)
					teamInca.setHasTech(iMathematics, True, iCiv, False, False)
					teamInca.setHasTech(iCurrency, True, iCiv, False, False)
					teamInca.setHasTech(iHunting, True, iCiv, False, False)
					teamInca.setHasTech(iArchery, True, iCiv, False, False)
					teamInca.setHasTech(iAnimalHusbandry, True, iCiv, False, False)
			teamAztecs = pTeam
			if (iCiv == iAztecs):
					teamAztecs.setHasTech(iMining, True, iCiv, False, False)
					teamAztecs.setHasTech(iBronzeWorking, True, iCiv, False, False)
					teamAztecs.setHasTech(iMysticism, True, iCiv, False, False)
					teamAztecs.setHasTech(iPolytheism, True, iCiv, False, False)
					teamAztecs.setHasTech(iMasonry, True, iCiv, False, False)
					teamAztecs.setHasTech(iPriesthood, True, iCiv, False, False)
					teamAztecs.setHasTech(iMonarchy, True, iCiv, False, False)
					teamAztecs.setHasTech(iFishing, True, iCiv, False, False)
					teamAztecs.setHasTech(iTheWheel, True, iCiv, False, False)
					teamAztecs.setHasTech(iPottery, True, iCiv, False, False)
					teamAztecs.setHasTech(iAgriculture, True, iCiv, False, False)
					teamAztecs.setHasTech(iWriting, True, iCiv, False, False)
					teamAztecs.setHasTech(iCodeOfLaws, True, iCiv, False, False)
					teamAztecs.setHasTech(iMathematics, True, iCiv, False, False)
					teamAztecs.setHasTech(iCalendar, True, iCiv, False, False)
					teamAztecs.setHasTech(iCurrency, True, iCiv, False, False)
					teamAztecs.setHasTech(iHunting, True, iCiv, False, False)
					teamAztecs.setHasTech(iArchery, True, iCiv, False, False)
			teamIran = pTeam
			if iCiv == iIran:
					teamIran.setHasTech(iMysticism, True, iCiv, False, False)
					teamIran.setHasTech(iMeditation, True, iCiv, False, False)
					teamIran.setHasTech(iPolytheism, True, iCiv, False, False)
					teamIran.setHasTech(iPriesthood, True, iCiv, False, False)
					teamIran.setHasTech(iMonotheism, True, iCiv, False, False)
					teamIran.setHasTech(iMonarchy, True, iCiv, False, False)
					teamIran.setHasTech(iLiterature, True, iCiv, False, False)
					teamIran.setHasTech(iCodeOfLaws, True, iCiv, False, False)
					teamIran.setHasTech(iFeudalism, True, iCiv, False, False)
					teamIran.setHasTech(iTheology, True, iCiv, False, False)
					teamIran.setHasTech(iMusic, True, iCiv, False, False)
					teamIran.setHasTech(iCivilService, True, iCiv, False, False)
					teamIran.setHasTech(iGuilds, True, iCiv, False, False)
					teamIran.setHasTech(iDivineRight, True, iCiv, False, False)
					teamIran.setHasTech(iFishing, True, iCiv, False, False)
					teamIran.setHasTech(iTheWheel, True, iCiv, False, False)
					teamIran.setHasTech(iAgriculture, True, iCiv, False, False)
					teamIran.setHasTech(iPottery, True, iCiv, False, False)
					teamIran.setHasTech(iAesthetics, True, iCiv, False, False)
					teamIran.setHasTech(iSailing, True, iCiv, False, False)
					teamIran.setHasTech(iWriting, True, iCiv, False, False)
					teamIran.setHasTech(iMathematics, True, iCiv, False, False)
					teamIran.setHasTech(iAlphabet, True, iCiv, False, False)
					teamIran.setHasTech(iCalendar, True, iCiv, False, False)
					teamIran.setHasTech(iCurrency, True, iCiv, False, False)
					teamIran.setHasTech(iPhilosophy, True, iCiv, False, False)
					teamIran.setHasTech(iPaper, True, iCiv, False, False)
					teamIran.setHasTech(iHunting, True, iCiv, False, False)
					teamIran.setHasTech(iMining, True, iCiv, False, False)
					teamIran.setHasTech(iArchery, True, iCiv, False, False)
					teamIran.setHasTech(iMasonry, True, iCiv, False, False)
					teamIran.setHasTech(iAnimalHusbandry, True, iCiv, False, False)
					teamIran.setHasTech(iBronzeWorking, True, iCiv, False, False)
					teamIran.setHasTech(iHorsebackRiding, True, iCiv, False, False)
					teamIran.setHasTech(iIronWorking, True, iCiv, False, False)
					teamIran.setHasTech(iMetalCasting, True, iCiv, False, False)
					teamIran.setHasTech(iCompass, True, iCiv, False, False)
					teamIran.setHasTech(iConstruction, True, iCiv, False, False)
					teamIran.setHasTech(iMachinery, True, iCiv, False, False)
					teamIran.setHasTech(iEngineering, True, iCiv, False, False)
					teamIran.setHasTech(iGunpowder, True, iCiv, False, False)
			teamSweden = pTeam
			if iCiv == iSweden:
				lSwedenTechs = [iMysticism, iMeditation, iPolytheism, iPriesthood, iMonotheism, iMonarchy, iLiterature, iCodeOfLaws, iDrama, iFeudalism, \
						iTheology, iMusic, iCivilService, iGuilds, iDivineRight, \
						iFishing, iTheWheel, iAgriculture, iPottery, iPrintingPress, iAstronomy, \
						iAesthetics, iSailing, iWriting, iMathematics, iAlphabet, iCalendar, iCurrency, iPhilosophy, iPaper, iBanking, iEducation, \
						iHunting, iMining, iArchery, iMasonry, iAnimalHusbandry, iBronzeWorking, iHorsebackRiding, iIronWorking, iMetalCasting, \
						iCompass, iConstruction, iMachinery, iEngineering, iOptics, iGunpowder]
				for iTech in lSwedenTechs:
					teamSweden.setHasTech(iTech, True, iCiv, False, False)
					
			teamMughals = pTeam
			if iCiv == iMughals:
				lMughalTechs = [iFishing, iTheWheel, iAgriculture, iHunting, iMysticism, iMining,
						  iSailing, iPottery, iAnimalHusbandry, iArchery, iMeditation, iPolytheism, iMasonry,
						  iHorsebackRiding, iPriesthood, iMonotheism, iBronzeWorking,
						  iWriting, iMetalCasting, iIronWorking,
						  iAesthetics, iMathematics, iAlphabet, iMonarchy, iCompass,
						  iLiterature, iCalendar, iConstruction, iCurrency, iMachinery,
						  iDrama, iEngineering, iCodeOfLaws, iFeudalism,
						  iMusic, iPhilosophy, iCivilService, iTheology, iOptics,
						  iDivineRight, iPaper, iGuilds,
						  iEducation, iBanking, iGunpowder, iPrintingPress, iAstronomy, iLiberalism, iConstitution]
				for iTech in lMughalTechs:
					teamMughals.setHasTech(iTech, True, iCiv, False, False)
			teamHolland = pTeam
			if (iCiv == iHolland):
					teamHolland.setHasTech(iMining, True, iCiv, False, False)
					teamHolland.setHasTech(iBronzeWorking, True, iCiv, False, False)
					teamHolland.setHasTech(iIronWorking, True, iCiv, False, False)
					teamHolland.setHasTech(iMetalCasting, True, iCiv, False, False)
					teamHolland.setHasTech(iMachinery, True, iCiv, False, False)
					teamHolland.setHasTech(iMysticism, True, iCiv, False, False)
					teamHolland.setHasTech(iPolytheism, True, iCiv, False, False)
					teamHolland.setHasTech(iMasonry, True, iCiv, False, False)
					teamHolland.setHasTech(iPriesthood, True, iCiv, False, False)
					teamHolland.setHasTech(iMonotheism, True, iCiv, False, False)
					teamHolland.setHasTech(iTheology, True, iCiv, False, False)
					teamHolland.setHasTech(iMonarchy, True, iCiv, False, False)
					teamHolland.setHasTech(iDivineRight, True, iCiv, False, False)
					teamHolland.setHasTech(iFishing, True, iCiv, False, False)
					teamHolland.setHasTech(iSailing, True, iCiv, False, False)
					teamHolland.setHasTech(iTheWheel, True, iCiv, False, False)
					teamHolland.setHasTech(iPottery, True, iCiv, False, False)
					teamHolland.setHasTech(iAgriculture, True, iCiv, False, False)
					teamHolland.setHasTech(iWriting, True, iCiv, False, False)
					teamHolland.setHasTech(iCodeOfLaws, True, iCiv, False, False)
					teamHolland.setHasTech(iFeudalism, True, iCiv, False, False)
					teamHolland.setHasTech(iGuilds, True, iCiv, False, False)
					teamHolland.setHasTech(iAlphabet, True, iCiv, False, False)
					teamHolland.setHasTech(iMathematics, True, iCiv, False, False)
					teamHolland.setHasTech(iConstruction, True, iCiv, False, False)
					teamHolland.setHasTech(iEngineering, True, iCiv, False, False)
					teamHolland.setHasTech(iCurrency, True, iCiv, False, False)
					teamHolland.setHasTech(iHunting, True, iCiv, False, False)
					teamHolland.setHasTech(iArchery, True, iCiv, False, False)
					teamHolland.setHasTech(iAnimalHusbandry, True, iCiv, False, False)
					teamHolland.setHasTech(iHorsebackRiding, True, iCiv, False, False)
					teamHolland.setHasTech(iGuilds, True, iCiv, False, False)
					teamHolland.setHasTech(iMeditation, True, iCiv, False, False)
					teamHolland.setHasTech(iCalendar, True, iCiv, False, False)
					teamHolland.setHasTech(iBanking, True, iCiv, False, False)
					teamHolland.setHasTech(iOptics, True, iCiv, False, False)
					teamHolland.setHasTech(iCivilService, True, iCiv, False, False)
					teamHolland.setHasTech(iCompass, True, iCiv, False, False)
					teamHolland.setHasTech(iGunpowder, True, iCiv, False, False)
					teamHolland.setHasTech(iPhilosophy, True, iCiv, False, False)
					teamHolland.setHasTech(iEducation, True, iCiv, False, False)
					teamHolland.setHasTech(iPaper, True, iCiv, False, False)
					teamHolland.setHasTech(iAstronomy, True, iCiv, False, False)
					teamHolland.setHasTech(iAesthetics, True, iCiv, False, False)
					teamHolland.setHasTech(iLiterature, True, iCiv, False, False)
					teamHolland.setHasTech(iDrama, True, iCiv, False, False)
					teamHolland.setHasTech(iMusic, True, iCiv, False, False)
					teamHolland.setHasTech(iMilitaryTradition, True, iCiv, False, False)		
					teamHolland.setHasTech(iLiberalism, True, iCiv, False, False)
			teamGermany= pTeam					
			if iCiv == iGermany:
				lGermanTechs = [iMysticism, iMeditation, iPolytheism, iPriesthood, iMonotheism, iMonarchy, iLiterature, iCodeOfLaws, iDrama, iFeudalism, \
						iTheology, iMusic, iCivilService, iGuilds, iDivineRight, iMilitaryTradition, iConstitution, iLiberalism, \
						iFishing, iTheWheel, iAgriculture, iPottery, iPrintingPress, iEconomics, iAstronomy, iScientificMethod, iChemistry, \
						iAesthetics, iSailing, iWriting, iMathematics, iAlphabet, iCalendar, iCurrency, iPhilosophy, iPaper, iBanking, iEducation, \
						iHunting, iMining, iArchery, iMasonry, iAnimalHusbandry, iBronzeWorking, iHorsebackRiding, iIronWorking, iMetalCasting, \
						iCompass, iConstruction, iMachinery, iEngineering, iOptics, iGunpowder, iReplaceableParts, iMilitaryScience, iRifling]
				for iTech in lGermanTechs:
					teamGermany.setHasTech(iTech, True, iCiv, False, False)
			teamAmerica= pTeam	
			if (iCiv == iAmerica):
				for x in range(iLiberalism+1):
						teamAmerica.setHasTech(x, True, iCiv, False, False)
				for x in range(iFishing, iChemistry+1):
						teamAmerica.setHasTech(x, True, iCiv, False, False)
				for x in range(iHunting, iRifling+1):
						teamAmerica.setHasTech(x, True, iCiv, False, False)
			teamBrazil= pTeam	
			if iCiv == iBrazil:
				lBrazilTechs = [iMysticism, iMeditation, iPolytheism, iPriesthood, iMonotheism, iMonarchy, iLiterature, iCodeOfLaws, iDrama, iFeudalism, \
						iTheology, iMusic, iCivilService, iGuilds, iDivineRight, iMilitaryTradition, iConstitution, iLiberalism, \
						iFishing, iTheWheel, iAgriculture, iPottery, iPrintingPress, iEconomics, iAstronomy, iScientificMethod, iChemistry, \
						iAesthetics, iSailing, iWriting, iMathematics, iAlphabet, iCalendar, iCurrency, iPhilosophy, iPaper, iBanking, iEducation, \
						iHunting, iMining, iArchery, iMasonry, iAnimalHusbandry, iBronzeWorking, iHorsebackRiding, iIronWorking, iMetalCasting, \
						iCompass, iConstruction, iMachinery, iEngineering, iOptics, iGunpowder, iReplaceableParts, iMilitaryScience, iRifling, \
						iNationalism, iDemocracy, iSteamPower]
				for iTech in lBrazilTechs:
					teamBrazil.setHasTech(iTech, True, iCiv, False, False)
			teamMexico= pTeam	
			if iCiv == iMexico:
				lMexicanTechs = [iMysticism, iMeditation, iPolytheism, iPriesthood, iMonotheism, iMonarchy, iLiterature, iCodeOfLaws, iDrama, iFeudalism, \
						iTheology, iMusic, iCivilService, iGuilds, iDivineRight, iMilitaryTradition, iConstitution, iLiberalism, \
						iFishing, iTheWheel, iAgriculture, iPottery, iPrintingPress, iEconomics, iAstronomy, iScientificMethod, iChemistry, \
						iAesthetics, iSailing, iWriting, iMathematics, iAlphabet, iCalendar, iCurrency, iPhilosophy, iPaper, iBanking, iEducation, \
						iHunting, iMining, iArchery, iMasonry, iAnimalHusbandry, iBronzeWorking, iHorsebackRiding, iIronWorking, iMetalCasting, \
						iCompass, iConstruction, iMachinery, iEngineering, iOptics, iGunpowder, iReplaceableParts, iMilitaryScience, iRifling]
				for iTech in lMexicanTechs:
					teamMexico.setHasTech(iTech, True, iCiv, False, False)
			teamColombia = pTeam
			if iCiv == iColombia:
				lColombianTechs = [iMysticism, iMeditation, iPolytheism, iPriesthood, iMonotheism, iMonarchy, iLiterature, iCodeOfLaws, iDrama, iFeudalism, \
						iTheology, iMusic, iCivilService, iGuilds, iDivineRight, iMilitaryTradition, iConstitution, iLiberalism, \
						iFishing, iTheWheel, iAgriculture, iPottery, iPrintingPress, iEconomics, iAstronomy, iScientificMethod, iChemistry, \
						iAesthetics, iSailing, iWriting, iMathematics, iAlphabet, iCalendar, iCurrency, iPhilosophy, iPaper, iBanking, iEducation, \
						iHunting, iMining, iArchery, iMasonry, iAnimalHusbandry, iBronzeWorking, iHorsebackRiding, iIronWorking, iMetalCasting, \
						iCompass, iConstruction, iMachinery, iEngineering, iOptics, iGunpowder, iReplaceableParts, iMilitaryScience, iRifling, 
						iNationalism, iSteamPower, iDemocracy]
				for iTech in lColombianTechs:
					teamColombia.setHasTech(iTech, True, iCiv, False, False)
			teamArgentina = pTeam
			if iCiv == iArgentina:
				lArgentineTechs = [iMysticism, iMeditation, iPolytheism, iPriesthood, iMonotheism, iMonarchy, iLiterature, iCodeOfLaws, iDrama, iFeudalism, \
						iTheology, iMusic, iCivilService, iGuilds, iDivineRight, iMilitaryTradition, iConstitution, iLiberalism, \
						iFishing, iTheWheel, iAgriculture, iPottery, iPrintingPress, iEconomics, iAstronomy, iScientificMethod, iChemistry, \
						iAesthetics, iSailing, iWriting, iMathematics, iAlphabet, iCalendar, iCurrency, iPhilosophy, iPaper, iBanking, iEducation, \
						iHunting, iMining, iArchery, iMasonry, iAnimalHusbandry, iBronzeWorking, iHorsebackRiding, iIronWorking, iMetalCasting, \
						iCompass, iConstruction, iMachinery, iEngineering, iOptics, iGunpowder, iReplaceableParts, iMilitaryScience, iRifling, \
						iNationalism, iDemocracy, iSteamPower]
				for iTech in lArgentineTechs:
					teamArgentina.setHasTech(iTech, True, iCiv, False, False)
			teamGreece = pTeam
			if iCiv == iGreece:
				lGreekTechs = [iMysticism, iMeditation, iPolytheism, iPriesthood, iMonotheism, iMonarchy, iLiterature, iCodeOfLaws, iDrama, iFeudalism, \
						iTheology, iMusic, iCivilService, iGuilds, iDivineRight, iMilitaryTradition, iConstitution, iLiberalism, \
						iFishing, iTheWheel, iAgriculture, iPottery, iPrintingPress, iEconomics, iAstronomy, iScientificMethod, iChemistry, \
						iAesthetics, iSailing, iWriting, iMathematics, iAlphabet, iCalendar, iCurrency, iPhilosophy, iPaper, iBanking, iEducation, \
						iHunting, iMining, iArchery, iMasonry, iAnimalHusbandry, iBronzeWorking, iHorsebackRiding, iIronWorking, iMetalCasting, \
						iCompass, iConstruction, iMachinery, iEngineering, iOptics, iGunpowder, iReplaceableParts, iMilitaryScience, iRifling, \
						iNationalism, iDemocracy, iSteamPower]
				for iTech in lGreekTechs:
					teamGreece.setHasTech(iTech, True, iCiv, False, False)
			teamEthiopia = pTeam
			if iCiv == iEthiopia:
				lEthiopianTechs = [iMysticism, iMeditation, iPolytheism, iPriesthood, iMonotheism, iMonarchy, iLiterature, iCodeOfLaws, iDrama, iFeudalism, \
						iTheology, iMusic, iCivilService, iGuilds, \
						iFishing, iTheWheel, iAgriculture, iPottery, \
						iAesthetics, iSailing, iWriting, iMathematics, iAlphabet, iCalendar, iCurrency, \
						iHunting, iMining, iArchery, iMasonry, iAnimalHusbandry, iBronzeWorking, iHorsebackRiding, iIronWorking, iMetalCasting, \
						iCompass, iConstruction]
				for iTech in lEthiopianTechs:
					teamEthiopia.setHasTech(iTech, True, iCiv, False, False)
     
