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())
#############################
## Start Modifaction Block ##
#############################
xType = unitX.getUnitCombatType()
yType = unitY.getUnitCombatType()
if (yType != gc.getInfoTypeForString("UNITCOMBAT_SIEGE") and yType != gc.getInfoTypeForString("UNITCOMBAT_ARMOR") and yType != gc.getInfoTypeForString("UNITCOMBAT_HELICOPTER") and yType != gc.getInfoTypeForString("UNITCOMBAT_NAVAL") and yType != gc.getInfoTypeForString("NONE")):
if (xType != gc.getInfoTypeForString("UNITCOMBAT_HELICOPTER") and xType != gc.getInfoTypeForString("NONE")):
iRand = random.randint(1, 100)
if (iRand <= 5):
newUnit = playerX.player.initUnit(pLoser.getUnitType(), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI)
newUnit.finishMoves()
newUnit.setDamage(50, False)
newUnit.setExperience(pLoser.getExperience(), -1)
newUnit.setLevel(pLoser.getLevel())
for iCount in range(gc.getNumPromotionInfos()):
if (pLoser.isHasPromotion(iCount)):
newUnit.setHasPromotion(iCount, True)
##End Snaitf code and start LittleRedPoint slavery code :) code#################################################
player = gc.getActivePlayer()
xType = unitX.getUnitCombatType()
yType = unitY.getUnitCombatType()
unitSlave = gc.getInfoTypeForString("UNIT_SLAVE")
if (player.isCivic(gc.getInfoTypeForString("CIVIC_SLAVERY"))):
if (yType != gc.getInfoTypeForString("UNITCOMBAT_SIEGE") and yType != gc.getInfoTypeForString("UNITCOMBAT_ARMOR") and yType != gc.getInfoTypeForString("UNITCOMBAT_HELICOPTER") and yType != gc.getInfoTypeForString("UNITCOMBAT_NAVAL") and yType != gc.getInfoTypeForString("NONE")):
if (xType != gc.getInfoTypeForString("UNITCOMBAT_HELICOPTER") and xType != gc.getInfoTypeForString("NONE")):
iRand = random.randint(1, 100)
if (iRand >= 80):
newUnit = playerX.player.initUnit(unitSlave, pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI)
newUnit.finishMoves()
#############################
## End Modifaction Block ##
#############################