def reqKidnap(caster):
pCity = caster.plot().getPlotCity()
if pCity.getTeam() == caster.getTeam():
return False
i = 0
i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_PRIEST'))
i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ARTIST'))
i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_MERCHANT'))
i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ENGINEER'))
i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_SCIENTIST'))
if i == 0:
return False
return True
def spellKidnap(caster):
pCity = caster.plot().getPlotCity()
if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_PRIEST')) > 0:
iUnit = gc.getInfoTypeForString('UNIT_PROPHET')
iSpec = gc.getInfoTypeForString('SPECIALIST_GREAT_PRIEST')
if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ARTIST')) > 0:
iUnit = gc.getInfoTypeForString('UNIT_ARTIST')
iSpec = gc.getInfoTypeForString('SPECIALIST_GREAT_ARTIST')
if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_MERCHANT')) > 0:
iUnit = gc.getInfoTypeForString('UNIT_MERCHANT')
iSpec = gc.getInfoTypeForString('SPECIALIST_GREAT_MERCHANT')
if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ENGINEER')) > 0:
iUnit = gc.getInfoTypeForString('UNIT_ENGINEER')
iSpec = gc.getInfoTypeForString('SPECIALIST_GREAT_ENGINEER')
if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_SCIENTIST')) > 0:
iUnit = gc.getInfoTypeForString('UNIT_SCIENTIST')
iSpec = gc.getInfoTypeForString('SPECIALIST_GREAT_SCIENTIST')
iChance = caster.baseCombatStr() * 8
pPlayer = gc.getPlayer(caster.getOwner())
if CyGame().getSorenRandNum(100, "Kidnap") <= iChance:
newUnit = pPlayer.initUnit(iUnit, caster.getX(), caster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
pCity.changeFreeSpecialistCount(iSpec, -1)
else:
if CyGame().getSorenRandNum(100, "Kidnap") <= 50:
caster.setXY(pPlayer.getCapitalCity().getX(), pPlayer.getCapitalCity().getY(), false, true, true)
else:
caster.kill(True, 0)
startWar(caster.getOwner(), pCity.getOwner())
def reqKidnap(caster):
pCity = caster.plot().getPlotCity()
if pCity.getTeam() == caster.getTeam():
return False
i = 0
i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_PRIEST'))
i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ARTIST'))
i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_MERCHANT'))
i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ENGINEER'))
i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_SCIENTIST'))
if i == 0:
return False
return True
def spellKidnap(caster):
pCity = caster.plot().getPlotCity()
listUnits = []
listSpecs = []
if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_PRIEST')) > 0:
for i in range(pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_PRIEST'))):
listUnits.append(gc.getInfoTypeForString('UNIT_PROPHET'))
listSpecs.append(gc.getInfoTypeForString('SPECIALIST_GREAT_PRIEST'))
if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ARTIST')) > 0:
for i in range(pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ARTIST'))):
listUnits.append(gc.getInfoTypeForString('UNIT_ARTIST'))
listSpecs.append(gc.getInfoTypeForString('SPECIALIST_GREAT_ARTIST'))
if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_MERCHANT')) > 0:
for i in range(pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_MERCHANT'))):
listUnits.append(gc.getInfoTypeForString('UNIT_MERCHANT'))
listSpecs.append(gc.getInfoTypeForString('SPECIALIST_GREAT_MERCHANT'))
if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ENGINEER')) > 0:
for i in range(pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ENGINEER'))):
listUnits.append(gc.getInfoTypeForString('UNIT_ENGINEER'))
listSpecs.append(gc.getInfoTypeForString('SPECIALIST_GREAT_ENGINEER'))
if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_SCIENTIST')) > 0:
for i in range(pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_SCIENTIST'))):
listUnits.append(gc.getInfoTypeForString('UNIT_SCIENTIST'))
listSpecs.append(gc.getInfoTypeForString('SPECIALIST_GREAT_SCIENTIST'))
iChance = caster.baseCombatStr() * 8
iChance = iChance + caster.getExperience()
if iChance > 80:
iChance = 80
pPlayer = gc.getPlayer(caster.getOwner())
if CyGame().getSorenRandNum(100, "Kidnap") <= iChance:
i = CyGame().getSorenRandNum(len(listUnits), "Bob")
newUnit = pPlayer.initUnit(listUnits[i], caster.getX(), caster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
pCity.changeFreeSpecialistCount(listSpecs[i], -1)
else:
if CyGame().getSorenRandNum(100, "Kidnap") <= 50:
caster.setXY(pPlayer.getCapitalCity().getX(), pPlayer.getCapitalCity().getY(), false, true, true)
else:
caster.kill(True, 0)
startWar(caster.getOwner(), pCity.getOwner())
def spellKidnap(caster):
pCity = caster.plot().getPlotCity()
listUnits = [gc.getInfoTypeForString(item) for item in ['UNIT_PROPHET', 'UNIT_ARTIST', 'UNIT_MERCHANT', 'UNIT_ENGINEER', 'UNIT_SCIENTIST']]
listSpecs = [gc.getInfoTypeForString(item) for item in ['SPECIALIST_GREAT_PRIEST', 'SPECIALIST_GREAT_ARTIST', 'SPECIALIST_GREAT_MERCHANT', 'SPECIALIST_GREAT_ENGINEER', 'SPECIALIST_GREAT_SCIENTIST']]
listSpecsChance = []
for iSpe in listSpecs :
for j in range(pCity.getFreeSpecialistCount(iSpe)) : # range(0) = []
listSpecsChance.append(iSpe)
iChance = caster.baseCombatStr() * 8
iChance = iChance + caster.getExperience()
if iChance > 80:
iChance = 80
pPlayer = gc.getPlayer(caster.getOwner())
if CyGame().getSorenRandNum(100, "Kidnap") <= iChance:
iSpecialist = listSpecsChance[CyGame().getSorenRandNum(len(listSpecsChance), "FfH : Specialist Choice")]
newUnit = pPlayer.initUnit(listUnits[listSpecs.index(iSpecialist)], caster.getX(), caster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
pCity.changeFreeSpecialistCount(iSpecialist, -1)
else:
if CyGame().getSorenRandNum(100, "Kidnap") <= 50:
caster.setXY(pPlayer.getCapitalCity().getX(), pPlayer.getCapitalCity().getY(), false, true, true)
else:
caster.kill(True, 0)
startWar(caster.getOwner(), pCity.getOwner())