[COLOR="Red"] bDeleteEverything[/COLOR] = False
pCapital = gc.getMap().plot(tCapital[0], tCapital[1])
if (pCapital.isOwned()):
if (iCiv == iHuman or not gc.getPlayer(iHuman).isAlive()):
if not (pCapital.isCity() and pCapital.getPlotCity().isHolyCity()):
[COLOR="Red"]bDeleteEverything[/COLOR] = True
print ("bDeleteEverything 1")
else:
[COLOR="Red"]bDeleteEverything[/COLOR] = True
for x in range(tCapital[0] - 1, tCapital[0] + 2): # from x-1 to x+1
for y in range(tCapital[1] - 1, tCapital[1] + 2): # from y-1 to y+1
pCurrent=gc.getMap().plot(x, y)
if (pCurrent.isCity() and (pCurrent.getPlotCity().getOwner() == iHuman or pCurrent.getPlotCity().isHolyCity())):
[COLOR="Red"]bDeleteEverything[/COLOR] = False
print ("bDeleteEverything 2")
break
break
print ("bDeleteEverything", bDeleteEverything)
if (not gc.getMap().plot(tCapital[0], tCapital[1]).isOwned()):
if (iCiv == iNetherlands or iCiv == iPortugal or (iCiv == iRome and utils.getReborn(iCiv) == 1) or iCiv == iByzantium): #dangerous starts
self.setDeleteMode(0, iCiv)
self.birthInFreeRegion(iCiv, tCapital, tTopLeft, tBottomRight)
elif ([COLOR="Red"]bDeleteEverything[/COLOR]):
for x in range(tCapital[0] - 1, tCapital[0] + 2): # from x-1 to x+1
for y in range(tCapital[1] - 1, tCapital[1] + 2): # from y-1 to y+1
self.setDeleteMode(0, iCiv)
#print ("deleting", x, y)
pCurrent=gc.getMap().plot(x, y)
#self.moveOutUnits(x, y, tCapital[0], tCapital[1])
for iLoopCiv in range(iNumTotalPlayers+1): #Barbarians as well
if (iCiv != iLoopCiv):
utils.flipUnitsInArea(tTopLeft, tBottomRight, iCiv, iLoopCiv, True, False)
if (pCurrent.isCity()):
pCurrent.eraseAIDevelopment() #new function, similar to erase but won't delete rivers, resources and features()
for iLoopCiv in range(iNumTotalPlayers+1): #Barbarians as well
if (iCiv != iLoopCiv):
pCurrent.setCulture(iLoopCiv, 0, True)
pCurrent.setOwner(-1)
self.birthInFreeRegion(iCiv, tCapital, tTopLeft, tBottomRight)
else:
self.birthInForeignBorders(iCiv, tTopLeft, tBottomRight, tBroaderTopLeft, tBroaderBottomRight)