The Great Apple
Big Cheese
Try:
I'm assuming the unitclass for the unit is UNITCLASS_CRUISE_MISSILE in the XML. Otherwise there may be a typo or something that I'm missing.
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())
if pWinner.getUnitClassType() == gc.getInfoTypeForString("UNITCLASS_CRUISE_MISSILE"):
pWinner.kill(0, pWinner.getOwner())
CvUtil.pyPrint("The Cruise Misile has detonated!")
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()))