I'm fairly confident now that the crash to desktop is related to the caster being killed before the spell's code has fully run its course.
Assert Failed
File: CvXMLLoadUtilitySet.cpp
Line: 1688
Expression: bSuccess
Message:
----------------------------------------------------------
Assert Failed
File: CvGlobals.cpp
Line: 3718
Expression: strcmp(szType, "NONE")==0 || strcmp(szType, "")==0
Message: info type NO_BONUS not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
Is that supposed to be 2.7x larger than the old dll?
Or to have these pop up?
In a game as the Balseraphs where I'm able to steal units with loyalty with Mind III's domination. They should die according to the tooltip for loyalty. This is with 2.52 but I didn't see a change with 2.53.
Due to the naming of the BBAI log file, the game is crashing if you log something outside a game (with no active player).
(I'm (mis)using the BBAI logger to log XML loading stuff.)
So I just installed MNAI. All is good, except that I'm getting spammed with the message that BugOptions folder not found. Is it because I have installed a separate BUG for BTS?
When sharing a war, any AI should auto open borders btw, its probably the only mod where the normal behaviour does not happen. I could not reach by land the opp that some AI demanded to attack.
There's no FFH - More Naval AI folder in My Games > BTS.
Good align should not attack other Good align at pleased or friendly. Otherwise there's no roleplay and few points to alignments. Thats what I think anyway.
Create a directory with that name and try copying your BUG folder into it.
Unable to replicate this issue. I had no problems asking for and receiving Open Borders with civs with whom I shared a mutual military struggle. I even tested it where there was a civ who wouldn't share Open Borders because they were Annoyed at me. But as soon as I declared war on the civ they were currently fighting, they were happy to agree to Open Borders. It's not automatic, you still have to ask, but I did not see this issue during gameplay nor do I see anything in the code that would hinder Open Borders in the situation you describe.
For these sorts of reports, a savegame is most useful since I can look at the specific situation in your game.
Is it now intended that when researching a religion tech you don't receive a disciple anymore if youre not the first one to it?
When running MNAI with extramod (i have tried 0.4, 0.4 beta and 0.31) the game starts with an empty tech screen and no interface (alt+ I or ctrl + I doesnt work. Also i cant acess civilopedia or options in the main menu.
I have tried reinstalling BTS and MNAI.
This only happens with EMM installed, only MNAI works fine.
This is from the PythonErr2.log:
Spoiler :sys.path = ['..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\email', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\encodings', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\build', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\py', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\tools', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\colourchooser', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\editor', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\floatcanvas', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\masked', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\mixins', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\ogl', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\af', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ca', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\cs', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\da', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\de', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\el', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\es', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\eu', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\fi', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\fr', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\hi', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\hu', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\id', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\it', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ja', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\lv', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\nb', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\nl', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\pl', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\pt_BR', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ru', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\sl', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\sv', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\tr', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\uk', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\zh_CN', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\zh_TW', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\af\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ca\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\cs\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\da\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\de\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\el\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\es\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\eu\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\fi\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\fr\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\hi\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\hu\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\id\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\it\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ja\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\lv\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\nb\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\nl\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\pl\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\pt_BR\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ru\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\sl\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\sv\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\tr\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\uk\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\zh_CN\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\zh_TW\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\py\\tests', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\tools\\XRCed', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\tools\\XRCed\\src-images', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM']
sys.modules = {'zipimport': <module 'zipimport' (built-in)>, 'signal': <module 'signal' (built-in)>, '__builtin__': <module '__builtin__' (built-in)>, 'sys': <module 'sys' (built-in)>, '__main__': <module '__main__' (built-in)>, 'exceptions': <module 'exceptions' (built-in)>, 'CvPythonExtensions': <module 'CvPythonExtensions' (built-in)>}
sys.builtin_module_names = ('CvPythonExtensions', '__builtin__', '__main__', '_bisect', '_codecs', '_codecs_cn', '_codecs_hk', '_codecs_iso2022', '_codecs_jp', '_codecs_kr', '_codecs_tw', '_csv', '_heapq', '_hotshot', '_locale', '_multibytecodec', '_random', '_sre', '_subprocess', '_symtable', '_weakref', '_winreg', 'array', 'audioop', 'binascii', 'cPickle', 'cStringIO', 'cmath', 'collections', 'datetime', 'errno', 'exceptions', 'gc', 'imageop', 'imp', 'itertools', 'marshal', 'math', 'md5', 'mmap', 'msvcrt', 'nt', 'operator', 'parser', 'regex', 'rgbimg', 'sha', 'signal', 'strop', 'struct', 'sys', 'thread', 'time', 'xxsubtype', 'zipimport')
load_module CvEventInterface
load_module BugEventManager
load_module CvEventManager
load_module CvUtil
load_module traceback
load_module CvScreensInterface
load_module CvMainInterface
load_module ScreenInput
load_module CvScreenEnums
load_module time
load_module BugDll
load_module BugOptions
load_module BugConfig
load_module BugCore
load_module BugUtil
load_module BugPath
load_module BugConfigTracker
load_module shutil
load_module ColorUtil
load_module BugInit
load_module BugTypes
load_module xmllib
..\WARLORDS\ASSETS\PYTHON\SYSTEM\xmllib.py:9: DeprecationWarning: The xmllib module is obsolete. Use xml.sax instead.
05:07:50 DEBUG: BugConfig - registering xml handler BugConfig.RootHandler
05:07:50 DEBUG: BugConfig - registering bug handler BugConfig.BugHandler
05:07:50 DEBUG: BugConfig - registering load handler BugConfig.LoadHandler
05:07:50 DEBUG: BugConfig - registering config handler BugConfig.ConfigHandler
05:07:50 DEBUG: BugConfig - registering arg handler BugConfig.ArgHandler
load_module configobj
load_module __future__
load_module codecs
load_module validate
validate import failed
load_module RevInstances
load_module ScenarioFunctions
load_module Popup
load_module PyHelpers
load_module CustomFunctions
load_module CvCameraControls
load_module CvEspionageAdvisor
load_module CvWBDesc
load_module array
load_module BugOptionsScreen
load_module BugErrorOptionsTab
load_module BugOptionsTab
load_module BugHelp
05:07:51 INFO : BugCore - creating uninitialized mod Core
05:07:51 INFO : BugCore - creating uninitialized mod MainInterface
load_module CityUtil
05:07:51 INFO : BugCore - creating uninitialized mod NJAGC
05:07:51 INFO : BugCore - creating uninitialized mod Scores
05:07:51 INFO : BugCore - creating uninitialized mod CityScreen
05:07:51 INFO : BugCore - creating uninitialized mod Revolution
05:07:51 INFO : BugCore - creating uninitialized mod PLE
load_module Scoreboard
load_module DealUtil
load_module PlayerUtil
load_module TradeUtil
load_module DiplomacyUtil
load_module AttitudeUtil
load_module FontUtil
load_module GameUtil
load_module BugUnitPlot
load_module MonkeyTools
load_module UnitUtil
load_module ReminderEventManager
load_module SdToolKit
load_module BugData
load_module cPickle
load_module autolog
load_module CvModName
05:07:51 INFO : BugCore - creating uninitialized mod Autolog
05:07:51 INFO : BugCore - creating uninitialized mod Reminder
load_module CvAppInterface
load_module GGUtil
load_module GPUtil
load_module ProgressBarUtil
load_module PLE
load_module AStarTools
load_module RawYields
load_module CvTechChooser
load_module TechPrefs
05:07:51 INFO : BugCore - creating uninitialized mod Advisors
load_module CvForeignAdvisor
load_module math
load_module CvExoticForeignAdvisor
load_module IconGrid_BUG
load_module DomPyHelpers
load_module TechTree
load_module FavoriteCivicDetector
load_module CvReligionScreen
load_module ReligionUtil
load_module CvCorporationScreen
load_module CvSomniumInterface
load_module copy
load_module CvCivicsScreen
load_module CvVictoryScreen
load_module TechUtil
load_module GameSetUpCheck
load_module AutoSave
load_module MapFinder
load_module MapFinderStatusScreen
05:07:52 INFO : BugCore - creating uninitialized mod MapFinder
05:07:52 INFO : BugCore - creating uninitialized mod AutoSave
load_module Buffy
05:07:52 INFO : BugCore - creating uninitialized mod BUFFY
load_module CvOptionsScreen
load_module CvReplayScreen
load_module CvHallOfFameScreen
load_module CvDanQuayle
load_module CvGameUtils
load_module CvUnVictoryScreen
load_module CvDawnOfMan
load_module CvTechSplashScreen
load_module CvTopCivs
load_module random
load_module CvInfoScreen
load_module CvIntroMovieScreen
load_module CvVictoryMovieScreen
load_module CvWonderMovieScreen
load_module CvEraMovieScreen
load_module CvSpaceShipScreen
load_module SevoScreenEnums
load_module CvWorldBuilderScreen
load_module WBBuildingScreen
load_module WBCityDataScreen
load_module WBCityEditScreen
load_module WBPlayerScreen
load_module WBProjectScreen
load_module WBTeamScreen
load_module WBTechScreen
load_module WBPlayerUnits
load_module WBUnitScreen
load_module WBPromotionScreen
load_module WBPlotScreen
load_module WBEventScreen
load_module WBLandMarks
load_module WBCorporationScreen
load_module WBBonusScreen
load_module WBSpecialistScreen
load_module WBDiplomacyScreen
load_module CvDebugTools
load_module CvDebugInfoScreen
load_module CvMapGeneratorUtil
load_module CvGFCScreen
load_module CvPopupInterface
load_module CvScreenUtilsInterface
load_module CvOverlayScreenUtils
load_module CvDotMapOverlayScreen
load_module CvStrategyOverlay
05:07:54 INFO : BugCore - creating uninitialized mod StrategyOverlay
load_module CvTrophyHall
load_module Trophies
05:07:54 INFO : BugCore - creating uninitialized mod CustDomAdv
05:07:54 INFO : BugCore - creating uninitialized mod TechWindow
init-ing world builder screen
Traceback (most recent call last):
File "<string>", line 1, in ?
File "<string>", line 52, in load_module
File "CvEventInterface", line 17, in ?
File "<string>", line 52, in load_module
File "BugEventManager", line 102, in ?
File "<string>", line 52, in load_module
File "CvEventManager", line 11, in ?
File "<string>", line 52, in load_module
File "CvScreensInterface", line 1527, in ?
TypeError: __init__() takes exactly 2 arguments (1 given)
Traceback (most recent call last):
File "BugEventManager", line 361, in _handleDefaultEvent
File "RevEvents", line 435, in onCityAcquired
File "RevEvents", line 494, in checkRebelBonuses
RuntimeError: unidentifiable C++ exception
def _handleDefaultEvent(self, eventType, argsList):
if self.EventHandlerMap.has_key(eventType):
for eventHandler in self.EventHandlerMap[eventType]:
try:
[COLOR="Red"]eventHandler(argsList)[/COLOR]
except:
BugUtil.trace("Error in %s event handler %s", eventType, eventHandler)
def onCityAcquired( argsList ):
'City Acquired'
owner,playerType,pCity,bConquest,bTrade = argsList
[COLOR="Red"]checkRebelBonuses( argsList )[/COLOR]
updateRevolutionIndices( argsList )
# Init city script data (unit spawn counter, rebel player)
iRevCiv = RevData.getCityVal(pCity, 'RevolutionCiv')
RevData.initCity(pCity)
RevData.setCityVal( pCity, 'RevolutionCiv', iRevCiv )
iTurns = pCity.getOccupationTimer()
#if( LOG_DEBUG ) : CvUtil.pyPrint("Revolt - Occupations timer is currently %d"%(iTurns))
pCity.setRevolutionCounter( max([int(1.5*iTurns),3]) )
def checkRebelBonuses( argsList ) :
# Give bonuses to a rebel player who successfully captures one of their rebellious cities
owner,playerType,pCity,bConquest,bTrade = argsList
newOwnerID = pCity.getOwner()
newOwner = gc.getPlayer(newOwnerID)
newOwnerCiv = newOwner.getCivilizationType()
oldOwnerID = pCity.getPreviousOwner()
orgOwnerID = pCity.getOriginalOwner()
# TODO: Handle case where city is acquired by disorganized rebels
if( newOwnerID == gc.getBARBARIAN_PLAYER() and pCity.getRevolutionCounter() > 0 ) :
if( LOG_DEBUG ) : CvUtil.pyPrint("Revolt - City %s captured by barb rebels!"%(pCity.getName()))
oldOwner = gc.getPlayer(oldOwnerID)
if( not oldOwnerID == orgOwnerID ) :
orgOwner = gc.getPlayer(orgOwnerID)
#if( LOG_DEBUG ) : CvUtil.pyPrint("Revolt - City %s originally owned by %s!"%(pCity.getName(),orgOwner.getCivilizationDescription(0)))
if( pCity.countTotalCultureTimes100() > 100*100 ) :
if( not (oldOwnerID == pCity.findHighestCulture()) ) :
cultOwner = gc.getPlayer( pCity.findHighestCulture() )
#if( LOG_DEBUG ) : CvUtil.pyPrint("Revolt - City %s culturally dominated by %s!"%(pCity.getName(),cultOwner.getCivilizationDescription(0)))
elif( newOwnerCiv == RevData.getCityVal(pCity, 'RevolutionCiv') ) :
# TODO: Check whether revolt is active in RevoltData
if( (pCity.getReinforcementCounter() > 0 or (pCity.unhappyLevel(0) - pCity.happyLevel()) > 0) ) :
if( LOG_DEBUG ) : CvUtil.pyPrint("Revolt - Rebellious pCity %s is captured by rebel identity %s (%d)!!!"%(pCity.getName(),newOwner.getCivilizationDescription(0),newOwnerCiv))
newOwnerTeam = gc.getTeam(newOwner.getTeam())
oldOwner = gc.getPlayer(oldOwnerID)
oldOwnerTeam = gc.getTeam(oldOwner.getTeam())
if( oldOwnerTeam.isAVassal() ) :
for teamID in range(0,gc.getMAX_CIV_TEAMS()) :
if( oldOwnerTeam.isVassal(teamID) ) :
oldOwnerTeam = gc.getTeam( teamID )
ix = pCity.getX()
iy = pCity.getY()
[iWorker,iBestDefender,iCounter,iAttack] = RevUtils.getHandoverUnitTypes( pCity, newOwner, newOwner )
newUnitList = list()
# Couple units regardless of rebel status
[COLOR="Red"]newUnitList.append(newOwner.initUnit( iBestDefender, ix, iy, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH ))[/COLOR]
if( pCity.getPopulation() > 4 ) :
newUnitList.append(newOwner.initUnit( iCounter, ix, iy, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH ))
def checkRebelBonuses( argsList ) :
# Give bonuses to a rebel player who successfully captures one of their rebellious cities
owner,playerType,pCity,bConquest,bTrade = argsList
newOwnerID = pCity.getOwner()
newOwner = gc.getPlayer(newOwnerID)
newOwnerCiv = newOwner.getCivilizationType()
oldOwnerID = pCity.getPreviousOwner()
orgOwnerID = pCity.getOriginalOwner()
# TODO: Handle case where city is acquired by disorganized rebels
if( newOwnerID == gc.getBARBARIAN_PLAYER() and pCity.getRevolutionCounter() > 0 ) :
if( LOG_DEBUG ) : CvUtil.pyPrint("Revolt - City %s captured by barb rebels!"%(pCity.getName()))
oldOwner = gc.getPlayer(oldOwnerID)
if( not oldOwnerID == orgOwnerID ) :
orgOwner = gc.getPlayer(orgOwnerID)
#if( LOG_DEBUG ) : CvUtil.pyPrint("Revolt - City %s originally owned by %s!"%(pCity.getName(),orgOwner.getCivilizationDescription(0)))
if( pCity.countTotalCultureTimes100() > 100*100 ) :
if( not (oldOwnerID == pCity.findHighestCulture()) ) :
cultOwner = gc.getPlayer( pCity.findHighestCulture() )
#if( LOG_DEBUG ) : CvUtil.pyPrint("Revolt - City %s culturally dominated by %s!"%(pCity.getName(),cultOwner.getCivilizationDescription(0)))
elif( newOwnerCiv == RevData.getCityVal(pCity, 'RevolutionCiv') ) :
# TODO: Check whether revolt is active in RevoltData
if( (pCity.getReinforcementCounter() > 0 or (pCity.unhappyLevel(0) - pCity.happyLevel()) > 0) ) :
if( LOG_DEBUG ) : CvUtil.pyPrint("Revolt - Rebellious pCity %s is captured by rebel identity %s (%d)!!!"%(pCity.getName(),newOwner.getCivilizationDescription(0),newOwnerCiv))
newOwnerTeam = gc.getTeam(newOwner.getTeam())
oldOwner = gc.getPlayer(oldOwnerID)
oldOwnerTeam = gc.getTeam(oldOwner.getTeam())
if( oldOwnerTeam.isAVassal() ) :
for teamID in range(0,gc.getMAX_CIV_TEAMS()) :
if( oldOwnerTeam.isVassal(teamID) ) :
oldOwnerTeam = gc.getTeam( teamID )
ix = pCity.getX()
iy = pCity.getY()
[iWorker,iBestDefender,iCounter,iAttack] = RevUtils.getHandoverUnitTypes( pCity, newOwner, newOwner )
newUnitList = list()
# Couple units regardless of rebel status
[COLOR="Red"]if iBestDefender != -1:#Magister
newUnitList.append(newOwner.initUnit( iBestDefender, ix, iy, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH ))[/COLOR]
if( pCity.getPopulation() > 4 ) :
[COLOR="Red"]if iCounter != -1:#Magister
newUnitList.append(newOwner.initUnit( iCounter, ix, iy, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH ))[/COLOR]
if( newOwner.isRebel() ) :
# Extra benefits if still considered a rebel
mess = localText.getText("TXT_KEY_REV_MESS_YOUR_CAPTURE",())%(pCity.getName())
CyInterface().addMessage(newOwnerID, false, gc.getDefineINT("EVENT_MESSAGE_TIME"), mess, "AS2D_CITY_REVOLT", InterfaceMessageTypes.MESSAGE_TYPE_MINOR_EVENT, CyArtFileMgr().getInterfaceArtInfo("INTERFACE_RESISTANCE").getPath(), ColorTypes(8), ix, iy, True, True)
mess = localText.getText("TXT_KEY_REV_MESS_REBEL_CONTROL",())%(newOwner.getCivilizationDescription(0),pCity.getName())
CyInterface().addMessage(oldOwnerID, false, gc.getDefineINT("EVENT_MESSAGE_TIME"), mess, None, InterfaceMessageTypes.MESSAGE_TYPE_MINOR_EVENT, None, ColorTypes(7), -1, -1, False, False)
# Gold
iGold = game.getSorenRandNum(min([80,8*pCity.getPopulation()]),'Rev') + 8
mess = localText.getText("TXT_KEY_REV_MESS_YOUR_CAPTURE_GOLD",())%(pCity.getName(),iGold)
CyInterface().addMessage(newOwnerID, false, gc.getDefineINT("EVENT_MESSAGE_TIME"), mess, "AS2D_CITY_REVOLT", InterfaceMessageTypes.MESSAGE_TYPE_MINOR_EVENT, CyArtFileMgr().getInterfaceArtInfo("INTERFACE_RESISTANCE").getPath(), ColorTypes(8), ix, iy, False, False)
newOwner.changeGold( iGold )
# Culture
newCulVal = int( revCultureModifier*max([pCity.getCulture(oldOwnerID),pCity.countTotalCultureTimes100()/200]) )
newPlotVal = int( revCultureModifier*max([pCity.plot().getCulture(oldOwnerID),pCity.plot().countTotalCulture()/2]) )
RevUtils.giveCityCulture( pCity, newOwnerID, newCulVal, newPlotVal, overwriteHigher = False )
# Extra units
if(iWorker != -1):
newUnitList.append(newOwner.initUnit( iWorker, ix, iy, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH ))
if( pCity.getPopulation() > 7 ) :
[COLOR="Red"]if iBestDefender != -1:#Magister
newUnitList.append(newOwner.initUnit( iBestDefender, ix, iy, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH ))[/COLOR]
if( pCity.getPopulation() > 4 and newOwnerTeam.getPower(True) < oldOwnerTeam.getPower(True)/4 ) :
[COLOR="Red"]if iAttack != -1:#Magister
newUnitList.append(newOwner.initUnit( iAttack, ix, iy, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH ))[/COLOR]
if( newOwner.getNumCities() <= 1 ) :
# Extra units for first city captured
[COLOR="Red"]
if iCounter != -1:#Magister[/COLOR]
newUnitList.append(newOwner.initUnit( iCounter, ix, iy, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH ))
if( newOwnerTeam.getPower(True) < oldOwnerTeam.getPower(True)/2 ) :
[COLOR="Red"]if iBestDefender != -1:#Magister
newUnitList.append(newOwner.initUnit( iBestDefender, ix, iy, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH ))
if iAttack != -1:#Magister
newUnitList.append(newOwner.initUnit( iAttack, ix, iy, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH ))[/COLOR]
elif( newOwnerTeam.getPower(True) < oldOwnerTeam.getPower(True) ) :
[COLOR="Red"]if iAttack != -1:#Magister
newUnitList.append(newOwner.initUnit( iAttack, ix, iy, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH ))[/COLOR]