Manifold
ModderProtectionAdvocate
- Joined
- Aug 27, 2007
- Messages
- 1,580
EDIT: Result is at the end
this is the code now
i wanna fit this in
it seems done twice
the nuke is the chimere and the fighter is the pegasus.
this is the code now
Code:
def onCombatResult(self, argsList):
'Combat Result'
pWinner,pLoser = argsList
playerX = PyPlayer(pWinner.getOwner())
unitX = PyInfo.UnitInfo(pWinner.getUnitType())
playerY = PyPlayer(pLoser.getOwner())
unitY = PyInfo.UnitInfo(pLoser.getUnitType())
###unit after palace captured start part 2
iX = pLoser.getX()
iY = pLoser.getY()
iPlayer = pWinner.getOwner()
pPlayer = gc.getPlayer(iPlayer)
myplot = CyMap().plot(iX,iY)
if myplot.isCity()==True:
pCity = myplot.getPlotCity()
if pCity.isCapital() :
WinnerPlayer = gc.getPlayer(pWinner.getOwner())
iThisTeam = WinnerPlayer.getTeam()
ThisTeam = gc.getTeam(iThisTeam)
NumDef = 0
for i in range (gc.getMAX_PLAYERS ()):
CurPlayer = gc.getPlayer(i)
iCurTeam = CurPlayer.getTeam()
if iThisTeam ==iCurTeam:continue
if ThisTeam.isAtWar(iCurTeam):
CurDef = myplot.getNumDefenders(i)
NumDef = NumDef+CurDef
if NumDef >=2:
break
if NumDef<=1:
self.CapturedCapital = True
return
###mnit after palace captured end part 2
if (not self.__LOG_COMBAT):
return
if playerX and playerX and unitX and playerY:
CvUtil.pyPrint('Player %d Civilization %s Unit %s has defeated Player %d Civilization %s Unit %s'
%(playerX.getID(), playerX.getCivilizationName(), unitX.getDescription(),
playerY.getID(), playerY.getCivilizationName(), unitY.getDescription()))
i wanna fit this in
Code:
###Chimere dead###
if pLoser.getUnitType() == gc.getInfoTypeForString('UNIT_TACTICAL_NUKE'):
iX = pLoser.getX()
iY = pLoser.getY()
pPlot = CyMap().plot(iX, iY)
pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_VOLCANO'), -1)
newUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_FIGHTER'), pPlot.getX(), pPlot.getY()+1, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_WEST)
###Chimere END###
it seems done twice
the nuke is the chimere and the fighter is the pegasus.