Weekend is over, and I have to say: Sorry keldath (and everyone else), I just don't have time to do any modding anymore (besides small bugfixes maybe).
I'm sorry.
Thank you, The_J for all your dedication to this community and Civ4 in general!
Weekend is over, and I have to say: Sorry keldath (and everyone else), I just don't have time to do any modding anymore (besides small bugfixes maybe).
I'm sorry.
if( pHeadSelectedCity.isHasBuilding( gc.getInfoTypeForString( 'BUILDING_FORGE' ) ) ) :
if( pHeadSelectedCity.getNumBuilding( gc.getInfoTypeForString( 'BUILDING_FORGE' ) ) > 0 ) :
Neither of which is correct.
Both of them will still return true if the city has the building without building it, such as monument from Stonehenge.
getNumRealBuilding
FORGE not FORCE
There's no even trigger for project completion, therefore this would also have involved some Python. An event can also give only 1 unit, not multiple.
But else that's not a bad idea, could probably be something done like that for world wonders.
def onUnitPromoted(self, argsList):
'Unit Promoted'
pUnit, iPromotion = argsList
player = PyPlayer(pUnit.getOwner())
###Heroic Strength Promotion start###
pPlayer = gc.getPlayer(pUnit.getOwner())
lStrengthPromotions = [
"PROMOTION_HEROIC_STRENGTH1",
"PROMOTION_HEROIC_STRENGTH2",
"PROMOTION_HEROIC_STRENGTH3"
]
if not pPlayer.isNone() and not pPlayer.isBarbarian() and pPlayer.isAlive():
if (pUnit.getDomainType() == DomainTypes.DOMAIN_LAND):
for iHeroicStrengthPro in range(len(lStrengthPromotions)):
MyPromotion = str(lStrengthPromotions[iHeroicStrengthPro])
#CyInterface().addImmediateMessage(str(MyPromotion), "")
iStrPromotion = gc.getInfoTypeForString(str(MyPromotion))
if pPlayer.isHuman():
#CyInterface().addImmediateMessage("A", "")
if (iPromotion == iStrPromotion):
if pUnit.isHasPromotion(iStrPromotion):
pUnit.setBaseCombatStr(pUnit.baseCombatStr() + 1)
break
elif not pPlayer.isHuman():
if (iPromotion<>iStrPromotion):
if not pUnit.isHasPromotion(iStrPromotion):
if pUnit.canAcquirePromotion(iStrPromotion):
decision = CyGame().getSorenRandNum(4, "strength")
if (decision == 1 or decision == 2):
# Remove promotion in favor of Heroic Strength promotion.
pUnit.setHasPromotion(iPromotion, False)
pUnit.setHasPromotion(iStrPromotion, True)
pUnit.setBaseCombatStr(pUnit.baseCombatStr() + 1)
break
###Heroic Strength Promotion End###
<>
The promotion fails when a unit is promoted.
Wait a second, am I actually seeing theoperator in there?! How weird, I've only ever seen != or not == usedCode:<>
The Python assumes the XML is properly written. ...And yes it does work.
Perhaps later, I might just release a new complete Python version of the mod.