Ploeperpengel
academic precarity
Cool works now, thx Kael

iUndead = gc.getInfoTypeForString('PROMOTION_UNDEAD')
py = PyPlayer(iPlayer)
for pUnit in py.getUnitList():
pPlot = pUnit.plot()
if pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_SC1') and pUnit.getDamage() >= 25 and CyGame().getSorenRandNum(100, "Turn") < 16:
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_WINTERBORN')):
pUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_WINTERBORN'), False)
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_NOMAD')):
pUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_NOMAD'), False)
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_DWARF')):
pUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_DWARF'), False)
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_ELF')):
pUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_ELF'), False)
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_ORC')):
pUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_ORC'), False)
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_DARK_ELF')):
pUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_DARK_ELF'), False)
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_LIZARDMAN')):
pUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_LIZARDMAN'), False)
pUnit.setHasPromotion(iUndead, True)
def doUndead(self):
iSC1 = gc.getInfoTypeForString('FEATURE_SC1')
iUndead = gc.getInfoTypeForString('PROMOTION_UNDEAD')
for i in range (CyMap().numPlots()):
pPlot = CyMap().plotByIndex(i)
if pPlot.getFeatureType() == iSC1
for i in range(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(i)
if pUnit.isAlive():
if pUnit.getDamage() >= 25:
if CyGame().getSorenRandNum(100, "Turn") < 16:
pUnit.setHasPromotion(iUndead, True)
Have you tried just applying Undead? I am pretty sure that it won't force the other racial promotions off of the unit, but I personally don't see any problem with an Undead Dwarven unit TBH.
Kael actually set it up so that any promotion with <bRace>1</bRace> is automatically removed when any other promotion with <bRace>1</bRace> is granted. These are not the same thing as default races though.
Winterborn and Nomad are not technically races (although they are default races) and so would not be automatically removed, but the rest would.
I'd be inclined to model this after doHellTerrain(self) in Custom Functions.py, adding...
If it were generated first and the rest of the function was all within its if statement (meaning that either all units that meet the criteria that turn would turn undead or none of them would) then this would run much faster (especially on turns where it doesn't have to do anything).
for i in range(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(i)
if (pUnit.getRace() != iDemon or pUnit.getRace() != iAngel):
if pUnit.getDamage() >= 25:
if CyGame().getSorenRandNum(6, "Turn") =< 1:
pUnit.setHasPromotion(iUndead, True)
bool CvUnit::canBuild(const CvPlot* pPlot, BuildTypes eBuild, bool bTestVisible) const
{
FAssertMsg(eBuild < GC.getNumBuildInfos(), "Index out of bounds");
//WH:Ploeperpengel modify
ImprovementTypes eImprovement;
//WH:end modify
...
//WH:Ploeperpengel so only workers of prereqciv build improvements with prereqciv
if (GC.getBuildInfo(eBuild).getImprovement() != NO_IMPROVEMENT)
{
eImprovement = ((ImprovementTypes)(GC.getBuildInfo(eBuild).getImprovement()));
if (GC.getImprovementInfo(eImprovement).getPrereqCivilization() != NO_CIVILIZATION)
{
if (GC.getImprovementInfo(eImprovement).getPrereqCivilization() != GET_PLAYER(getOwnerINLINE()).getCivilizationType())
{
return false;
}
}
}
//WH:Ploeperpengel end modify
Any word on an ETA for the 0.32g patch? (Or 0.32h if that is out by then?)
Could I get SDK of CvGameCoreDLL032"e" still?
I'm Japanese and always play BtS of Japanese edition.
Latest version of BtS Japanese edition is 3.13, not 3.17.
So we can't play current version of FfH2 on Japanese edition, can only version "e".
(there is localize patch by volunteer.)
I want to try converting latest version of FfH2 for BtS 3.13.
Therefore, I need CvGameCoreDLL032"e".
FfH2 is great mod thx!!