cyther
Lord of the Dance
That wouldn't slow down the game any noticeable amount at all.
def spellEnterPortal(caster):
pPlot = caster.plot()
iX = pPlot.getPortalExitX()
iY = pPlot.getPortalExitY()
pExitPlot = CyMap().plot(iX,iY)
if not pPlot.isNone():
caster.setXY(iX, iY, false, true, true)
def spellEnterPortal(caster):
pPlotCaster = caster.plot()
iX = pPlotCaster.getPortalExitX()
iY = pPlotCaster.getPortalExitY()
if iY < 1 and iX < 1:
iBestValue = 0
pBestPlot = -1
iArea1 = pPlotCaster.area().getNumTiles()
for i in range (CyMap().numPlots()):
iValue = 0
pPlot = CyMap().plotByIndex(i)
if not pPlot.isWater():
if not pPlot.isPeak():
if not pPlot.isCity():
if pPlot.getImprovementType() == -1:
if pPlot.getBonusType(-1) == -1:
iValue = CyGame().getSorenRandNum(1000, "Portal")
if not pPlot.isOwned():
iValue += 300
iArea2 = pPlot.area().getNumTiles()
if iArea1 != iArea2:
iValue += 200
if iValue > iBestValue:
iBestValue = iValue
pBestPlot = pPlot
if pBestPlot != -1:
iX = pBestPlot.getX()
iY = pBestPlot.getY()
pPlotCaster.setPortalExitX(iX)
pPlotCaster.setPortalExitY(iY)
pBestPlot.setImprovementType(gc.getInfoTypeForString('IMPROVEMENT_PORTAL'))
pBestPlot.setPortalExitX(caster.getX())
pBestPlot.setPortalExitY(caster.getY())
pExitPlot = CyMap().plot(iX,iY)
if not pExitPlot.isNone():
caster.setXY(iX, iY, false, true, true)
Have you already tried adding a NotUnitAI tag for UNITAI_CITY_DEFENSE on Pyre Zombies? I don't know if you're absolutely dead-set on not modding the XML or not. I seem to recall reading in another thread that this didn't solve the problem, though, so... *shrugs*1) Is there a Python check that prevents units from upgrading? I want to prevent the Sheaim AI from upgrading all its warriors on city guard duty to Pyre zombies since that results in lots of military unhappiness.
I've noticed this, too. AFAIK, this doesn't seem possible to prevent without disabling the Arete civic for them, which you obviously won't want to do as it's pretty much their 'thing' flavour-wise.2) Is there a Python check that prevents rushbuying? As soon as the Khazad get access to rushbuying they waste all their gold.
You can loop through the number of city squares you're checking (21 for non-sprawling civs and 37 for Kuriotates) and call getCityIndexPlot(iIndex) CyCity object for each one.3) Is there a way in the plot system to check only the fat cross of a city without explicitly mentioning every plot you want to check?
Right now I use the loop that the temple of the hand python effect uses, but that one also checks the plots, which are two diagonal spaces away and not workable by the city.
There theoretically shouldn't be any need for this because you can set 'NotUnitAIs' in the XML. Again, if you're dead against modifying the XML, though, it's going to be a little more difficult and you'll probably have to hack your way around it by checking for silly AI choices in the 'onUnitBuilt' event and setting them to something more sensible.4) Is there a way in Python to prevent certain units from gaining certain UnitAIs ? I noticed that in FFH the AI will use chariots, berserkers or horse archers as city defenders, which does not make a lot of sense.
def postCombatFrostlingLost(pCaster, pOpponent):
if pOpponent.isHasPromotion(gc.getInfoTypeForString('PROMOTION_WINTERBORN'))
iPlayer = pOpponent.getOwner()
pPlayer = gc.getPlayer(iPlayer)
newUnit = pPlayer.initUnit(pOpponent.getUnitType(), pOpponent.getX(), pOpponent.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
for iCount in range(gc.getNumPromotionInfos()):
if (unit.isHasPromotion(iCount)):
if gc.getPromotionInfo(iCount).isEquipment() == False:
newUnit.setHasPromotion(iCount, true)
if unit.getRace() == gc.getInfoTypeForString('PROMOTION_FROSTLING')
if attacker == gc.getInfoTypeForString('CIVILIZATION_ILLIANS'):
newUnit = attacker.initUnit(unit.getUnitType(), unit.getX(), unit.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
for iCount in range(gc.getNumPromotionInfos()):
if (unit.isHasPromotion(iCount)):
if gc.getPromotionInfo(iCount).isEquipment() == False:
newUnit.setHasPromotion(iCount, true)
3.19 Patch notes said:- AI uses Warlords to make super-medic units