civIVffh2isgreat
Chieftain
- Joined
- May 18, 2019
- Messages
- 37
Hi, I 've been asking myself this question. I know civ4 is old, but is for me the best civ game.
def spellDivineRetribution1(caster):
for iPlayer in range(gc.getMAX_PLAYERS()):
player = gc.getPlayer(iPlayer)
if player.isAlive():
if player.getAlignment() == gc.getInfoTypeForString('ALIGNMENT_GOOD'):
py = PyPlayer(iPlayer)
for pUnit in py.getUnitList():
if (pUnit.getRace() == iDemon or pUnit.getRace() == iUndead):
pUnit.doDamage(50, 100, caster, gc.getInfoTypeForString('DAMAGE_HOLY'), false)
It does not appear that you have defined iDemon or iUndead anywhere in this function. Those are not globals defined for the whole file, so they need to be declared within this definition or you will get errors..Did xml, tried python but got bad.
What's wrong with this one:
Code:def spellDivineRetribution1(caster): for iPlayer in range(gc.getMAX_PLAYERS()): player = gc.getPlayer(iPlayer) if player.isAlive(): if player.getAlignment() == gc.getInfoTypeForString('ALIGNMENT_GOOD'): py = PyPlayer(iPlayer) for pUnit in py.getUnitList(): if (pUnit.getRace() == iDemon or pUnit.getRace() == iUndead): pUnit.doDamage(50, 100, caster, gc.getInfoTypeForString('DAMAGE_HOLY'), false)
def spellDivineRetribution1(pCaster):
iHoly = gc.getInfoTypeForString('DAMAGE_HOLY')
lTargetRaces = [gc.getInfoTypeForString('PROMOTION_UNDEAD'), gc.getInfoTypeForString('PROMOTION_DEMON')]
for iPlayer in range(gc.getMAX_PLAYERS()):
pPlayer = gc.getPlayer(iPlayer)
if pPlayer.isAlive():
if pPlayer.getAlignment() == gc.getInfoTypeForString('ALIGNMENT_GOOD'):
py = PyPlayer(iPlayer)
for pUnit in py.getUnitList():
if pUnit.getRace() in lTargetRaces:
pUnit.doDamage(50, 100, pCaster, iHoly, False)
def spellDivineRetribution1(caster):
for iPlayer in range(gc.getMAX_PLAYERS()):
player = gc.getPlayer(iPlayer)
if player.isAlive():
if player.getAlignment() == gc.getInfoTypeForString('ALIGNMENT_EVIL'):
py = PyPlayer(iPlayer)
for pUnit in py.getUnitList():
pUnit.doDamage(50, 100, caster, gc.getInfoTypeForString('DAMAGE_HOLY'), false)
def spellDivineRetribution1(caster):
for iPlayer in range(gc.getMAX_PLAYERS()):
player = gc.getPlayer(iPlayer)
if player.isAlive():
if player.getAlignment() == gc.getInfoTypeForString('ALIGNMENT_EVIL'):
py = PyPlayer(iPlayer)
for pUnit in py.getUnitList():
pUnit.doDamage(50, 100, caster, gc.getInfoTypeForString('DAMAGE_HOLY'), false)