platyping
Sleeping Dragon
Code:
pPlayer = gc.getPlayer(pWinner.getOwner())
pPlayerLoser = gc.getPlayer(pLoser.getOwner())
if not ([COLOR="red"]pPlayer[/COLOR].isBarbarian()):
if (unitX.getUnitCombatType() == gc.getInfoTypeForString("UNITCOMBAT_NAVAL")) or (unitX.getUnitCombatType() == gc.getInfoTypeForString("UNITCOMBAT_MELEE")) or (unitX.getUnitCombatType() == gc.getInfoTypeForString("UNITCOMBAT_GUN")) or (unitX.getUnitCombatType() == gc.getInfoTypeForString("UNITCOMBAT_ARCHER")):
if (unitY.getUnitCombatType() == gc.getInfoTypeForString("UNITCOMBAT_NAVAL")) or (unitY.getUnitCombatType() == gc.getInfoTypeForString("UNITCOMBAT_SIEGE")):
[COLOR="Blue"]if not (unitY.getUnitClassType() == gc.getInfoTypeForString("UNITCLASS_PRIVATEER")):
if not (unitY.getUnitClassType() == gc.getInfoTypeForString("UNITCLASS_PRIVATEER")):[/COLOR] if CyGame().getSorenRandNum(100, "Bob") <= 25:
iUnit = pLoser.getUnitType()
newUnit = pPlayer.initUnit([COLOR="red"]iUnit[/COLOR], pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
newUnit.finishMoves()
newUnit.setDamage(50, [COLOR="Red"]-1[/COLOR])
[COLOR="Lime"]CyInterface().addMessage(pPlayer.getID(),true,20,CyTranslator().getText("TXT_LALALA",(unitY.getDescription(),)),'',0,'',-1, -1, -1, true,true)[/COLOR]
1) Already defined above, y still do extra work
2) This command allows you to display a message just for that player, winner for this case. You can add a button, adjust the duration, colour of the button etc if you want
3) Why are there 2 lines checking the same condition, whether Unit Y is privateer class?