DieselBiscuit
Shoggoth tickler
Current version: 0.2 (download)
This mod gives access to dwarven and elven workers with the civics related to the Runes of Kilmorph and the Fellowship of the Leaves religons, Arete and Guardian of Nature.
Features:
As briefly discussed in Maniacs mod thread (my apologies for that, Maniac) and based on an idea from Mr. Underhill, here's a small mod that allows adherents of the Fellowship and Runes to get workers based on their religion. The effect is implemented as spells available to regular workers. To be able to use the spell, the player must have the religious restricted civic (Guardian of Nature or Arete) and the worker must be standing in a city with a temple of the religion.
The default cost for this is 100 gold and the default maximum allowed workers of this type per player is 5. Both these variables are easily modifiable in the code.
Heres the code:
Edit Nov 10:
I've been able to get full version zipped and available for download at this location (same as above). Have fun
This mod gives access to dwarven and elven workers with the civics related to the Runes of Kilmorph and the Fellowship of the Leaves religons, Arete and Guardian of Nature.
Features:
- Spells to upgrade workers available to civs running the Arete and Guardian of Nature civics.
- Dwarven and Elven workers created this way revert to regular workers if their civic is abandoned.
- Captured religious workers revert to regular workers.
- CivilioPedia entries for both spells.
- Easily customisable variables for cost to upgrade and available religious workers.
- Does not break save games.
As briefly discussed in Maniacs mod thread (my apologies for that, Maniac) and based on an idea from Mr. Underhill, here's a small mod that allows adherents of the Fellowship and Runes to get workers based on their religion. The effect is implemented as spells available to regular workers. To be able to use the spell, the player must have the religious restricted civic (Guardian of Nature or Arete) and the worker must be standing in a city with a temple of the religion.
The default cost for this is 100 gold and the default maximum allowed workers of this type per player is 5. Both these variables are easily modifiable in the code.
Heres the code:
Spoiler :
Code:
Spell: Blessing of Cernunnos
Effect: Allows conversion of regular workers to elven workers. Economy civic must be
Guardian of Nature and the worker to be upgraded must be in a city with a
Temple of Leaves. Abandoning Guardian of Nature will cause elven workers made
this way to revert to plain workers.
Files Affected: Assets\python\FFHSpells.py
Assets\python\CvEventManager.py
Assets\xml\units\CIV4SpellInfos.xml
Assets\xml\units\CIV4UnitInfos.xml
Assets\xml\text\CIV4GameText_FFH2.xml
Known Issues: Doesn't revert civ-specific workers (Lanun, goblin, etc.) to their original form).
Breaks Saves: No
Code Addition 1:
File: Assets\python\FFHSpells.py
<code>
#add to: canDisabledCast
if eSpell == gc.getInfoTypeForString('SPELL_BLESSING_OF_CERNUNNOS'):
return False
#add end
def reqBlessingOfCernunnos(caster):
pPlayer = gc.getPlayer(caster.getOwner())
if not canCast(caster):
return False
if caster.getUnitType() == gc.getInfoTypeForString('UNIT_ELVEN_WORKER'):
return False
if caster.getUnitClassType() != gc.getInfoTypeForString('UNITCLASS_WORKER'):
return False
if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_LJOSALFAR'):
return False
pPlot = caster.plot()
if pPlot.isCity() == False:
return False
pCity = pPlot.getPlotCity()
if pCity.hasBuilding(gc.getInfoTypeForString('BUILDING_TEMPLE_OF_LEAVES')) == False:
return False
pPlayer = gc.getPlayer(caster.getOwner())
#if pPlayer.getStateReligion() != gc.getInfoTypeForString('RELIGION_FELLOWSHIP_OF_LEAVES'):
# return False
if not pPlayer.isCivic(gc.getInfoTypeForString('CIVIC_GUARDIAN_OF_NATURE')):
return False
pTeam = gc.getTeam(pPlayer.getTeam())
if not pTeam.isHasTech(gc.getInfoTypeForString('TECH_HIDDEN_PATHS')):
return False
py = PyPlayer(caster.getOwner())
# Set the limit of units available with this variable
iLimit = 5
iNum = 0
for pUnit in py.getUnitList():
if (pUnit.getUnitType() == gc.getInfoTypeForString('UNIT_ELVEN_WORKER')):
iNum = iNum + 1
if iNum >= iLimit:
return False
# Set the cost of upgrading with this variable
iCost = 100
if pPlayer.getGold() < iCost:
return False
if (pPlayer.getGold() < (2*iCost) and pPlayer.isHuman() == False):
return False
return True
def spellBlessingOfCernunnos(caster):
doCast(caster)
pPlayer = gc.getPlayer(caster.getOwner())
newUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_ELVEN_WORKER'), caster.getX(), caster.getY(), UnitAITypes.UNITAI_WORKER)
bElf = caster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_ELF'))
newUnit.convert(caster)
newUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_FELLOWSHIP_OF_LEAVES'), true)
if not bElf:
newUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_ELF'), false)
# Set the cost of upgrading with this variable
iCost = 100
pPlayer.changeGold(-iCost)
newUnit.finishMoves()
</code>
Code Addition 2
File: Assets\python\CvEventManager.py
<code>
#add to: onCombatResult
if pLoser.getUnitType() == gc.getInfoTypeForString('UNIT_ELVEN_WORKER'):
unitType = gc.getInfoTypeForString('UNIT_ELVEN_WORKER')
if pLoser.isHasPromotion(gc.getInfoTypeForString('PROMOTION_FELLOWSHIP_OF_LEAVES')):
unitType = gc.getInfoTypeForString('UNIT_WORKER')
bUncaptured = False
cf.FFHConvert(pWinner, pLoser, unitType, False)
#add end
</code>
Code Addition 3:
File: Assets\xml\units\CIV4Spellinfos.xml
<code>
<SpellInfo>
<Type>SPELL_BLESSING_OF_CERNUNNOS</Type>
<Description>TXT_KEY_SPELL_BLESSING_OF_CERNUNNOS</Description>
<Civilopedia>TXT_KEY_SPELL_OF_CERNUNNOS_PEDIA</Civilopedia>
<Strategy>NONE</Strategy>
<Help>TXT_KEY_SPELL_BLESSING_OF_CERNUNNOS_HELP</Help>
<PromotionPrereq1>NONE</PromotionPrereq1>
<PromotionPrereq2>NONE</PromotionPrereq2>
<iRangeSelectNum>-1</iRangeSelectNum>
<SpellFlavors>
</SpellFlavors>
<Effect>EFFECT_NATURE_SUMMON</Effect>
<Sound>AS3D_SPELL_BLOOM</Sound>
<PyResult>FFHSpells.spellBlessingOfCernunnos(pCaster)</PyResult>
<PyRequirement>FFHSpells.reqBlessingOfCernunnos(pCaster)</PyRequirement>
<PyValidUnitTargets></PyValidUnitTargets>
<PyAIWeight></PyAIWeight>
<HotKey></HotKey>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/Buttons/Units/Elvenworker.dds</Button>
</SpellInfo>
</code>
Code Change 1:
File: Assets\xml\units\CIV4UnitInfos.xml
<code>
#change in entry for elven worker:
<Capture>NONE</Capture>
#change end
</code>
Code Addition 4:
File: Assets\text\CIV4GameText_FFH2.xml
<code>
<TEXT>
<Tag>TXT_KEY_SPELL_BLESSING_OF_CERNUNNOS</Tag>
<English>Blessing of Cernunnos</English>
<French>Blessing of Cernunnos</French>
<German>Blessing of Cernunnos</German>
<Italian>Blessing of Cernunnos</Italian>
<Spanish>Blessing of Cernunnos</Spanish>
</TEXT>
<TEXT>
<Tag>TXT_KEY_SPELL_BLESSING_OF_CERNUNNOS_HELP</Tag>
<English>Transforms an ordinary worker into an elven worker</English>
<French>Transforms an ordinary worker into an elven worker</French>
<German>Transforms an ordinary worker into an elven worker</German>
<Italian>Transforms an ordinary worker into an elven worker</Italian>
<Spanish>Transforms an ordinary worker into an elven worker</Spanish>
</TEXT>
<TEXT>
<Tag>TXT_KEY_SPELL_BLESSING_OF_CERNUNNOS_PEDIA</Tag>
<English> Delving deep into the knowledge of the forests and ways of nature, workers studying in a Temple of the Leaves can aquire such a degree of symbiotism with the living forest that they effectively become elven workers.</English>
<French> Delving deep into the knowledge of the forests and ways of nature, workers studying in a Temple of the Leaves can aquire such a degree of symbiotism with the living forest that they effectively become elven workers.</French>
<German> Delving deep into the knowledge of the forests and ways of nature, workers studying in a Temple of the Leaves can aquire such a degree of symbiotism with the living forest that they effectively become elven workers.</German>
<Italian> Delving deep into the knowledge of the forests and ways of nature, workers studying in a Temple of the Leaves can aquire such a degree of symbiotism with the living forest that they effectively become elven workers.</Italian>
<Spanish> Delving deep into the knowledge of the forests and ways of nature, workers studying in a Temple of the Leaves can aquire such a degree of symbiotism with the living forest that they effectively become elven workers.</Spanish>
</TEXT>
</code>
Spell: Blessing of Kilmorph
Effect: Allows conversion of regular workers to dwarven workers. Labor civic must be Arete
and the worker to be upgraded must be in a city with a Temple of Kilmorph.
Abandoning Arete will cause dwarven workers made this way to revert to plain workers.
Files Affected: Assets\python\FFHSpells.py
Assets\python\CvEventManager.py
Assets\xml\units\CIV4UnitInfos.xml
Assets\xml\units\CIV4SpellInfos.xml
Assets\xml\text\CIV4GameText_FFH2.xml
Known Issues: Doesn't revert civ-spesific workers (Lanun, goblin, etc.) to their original form).
Breaks Saves: No
Code Addition 1:
File: Assets\python\FFHSpells.py
<code>
#add to: canDisabledCast
if eSpell == gc.getInfoTypeForString('SPELL_BLESSING_OF_KILMORPH'):
return False
#add end
def reqBlessingOfKilmorph(caster):
pPlayer = gc.getPlayer(caster.getOwner())
if not canCast(caster):
return False
if caster.getUnitType() == gc.getInfoTypeForString('UNIT_DWARVEN_WORKER'):
return False
if caster.getUnitClassType() != gc.getInfoTypeForString('UNITCLASS_WORKER'):
return False
if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_KHAZAD'):
return False
pPlot = caster.plot()
if pPlot.isCity() == False:
return False
pCity = pPlot.getPlotCity()
if pCity.hasBuilding(gc.getInfoTypeForString('BUILDING_TEMPLE_OF_KILMORPH')) == False:
return False
pPlayer = gc.getPlayer(caster.getOwner())
#if pPlayer.getStateReligion() != gc.getInfoTypeForString('RELIGION_RUNES_OF_KILMORPH'):
# return False
if not pPlayer.isCivic(gc.getInfoTypeForString('CIVIC_ARETE')):
return False
pTeam = gc.getTeam(pPlayer.getTeam())
if not pTeam.isHasTech(gc.getInfoTypeForString('TECH_ARETE')):
return False
py = PyPlayer(caster.getOwner())
# Set the limit of units available with this variable
iLimit = 5
iNum = 0
for pUnit in py.getUnitList():
if (pUnit.getUnitType() == gc.getInfoTypeForString('UNIT_DWARVEN_WORKER')):
iNum = iNum + 1
if iNum >= iLimit:
return False
# Set the cost of upgrading with this variable
iCost = 100
if pPlayer.getGold() < iCost:
return False
if (pPlayer.getGold() < (2*iCost) and pPlayer.isHuman() == False):
return False
return True
def spellBlessingOfKilmorph(caster):
doCast(caster)
pPlayer = gc.getPlayer(caster.getOwner())
newUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_DWARVEN_WORKER'), caster.getX(), caster.getY(), UnitAITypes.UNITAI_WORKER)
bDwarf = caster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_DWARF'))
newUnit.convert(caster)
newUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_RUNES_OF_KILMORPH'), true)
if not bDwarf:
newUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_DWARF'), false)
# Set the cost of upgrading with this variable
iCost = 100
pPlayer.changeGold(-iCost)
newUnit.finishMoves()
</code>
Code Addition 2
File: Assets\python\CvEventManager.py
<code>
#add to: onCombatResult
if pLoser.getUnitType() == gc.getInfoTypeForString('UNIT_DWARVEN_WORKER'):
unitType = gc.getInfoTypeForString('UNIT_DWARVEN_WORKER')
if pLoser.isHasPromotion(gc.getInfoTypeForString('PROMOTION_RUNES_OF_KILMORPH')):
unitType = gc.getInfoTypeForString('UNIT_WORKER')
bUncaptured = False
cf.FFHConvert(pWinner, pLoser, unitType, False)
#add end
</code>
Code Addition 3:
File: Assets\xml\units\CIV4Spellinfos.xml
<code>
<SpellInfo>
<Type>SPELL_BLESSING_OF_KILMORPH</Type>
<Description>TXT_KEY_SPELL_BLESSING_OF_KILMORPH</Description>
<Civilopedia>TXT_KEY_SPELL_BLESSING_OF_KILMORPH_PEDIA</Civilopedia>
<Strategy>NONE</Strategy>
<Help>TXT_KEY_SPELL_BLESSING_OF_KILMORPH_HELP</Help>
<PromotionPrereq1>NONE</PromotionPrereq1>
<PromotionPrereq2>NONE</PromotionPrereq2>
<iRangeSelectNum>-1</iRangeSelectNum>
<SpellFlavors>
</SpellFlavors>
<Effect>EFFECT_SPELL2</Effect>
<Sound>AS3D_SPELL_KIKIJUB_SELECT</Sound>
<PyResult>FFHSpells.spellBlessingOfKilmorph(pCaster)</PyResult>
<PyRequirement>FFHSpells.reqBlessingOfKilmorph(pCaster)</PyRequirement>
<PyValidUnitTargets></PyValidUnitTargets>
<PyAIWeight></PyAIWeight>
<HotKey></HotKey>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/Buttons/Units/Dwarvenworker.dds</Button>
</SpellInfo>
</code>
Code Change 1:
<code>
#change in entry for dwarven worker:
<Capture>NONE</Capture>
#change end
</code>
Code Addition 4:
File: Assets\text\CIV4GameText_FFH2.xml
<code>
<TEXT>
<Tag>TXT_KEY_SPELL_BLESSING_OF_KILMORPH</Tag>
<English>Blessing of Kilmorph</English>
<French>Blessing of Kilmorph</French>
<German>Blessing of Kilmorph</German>
<Italian>Blessing of Kilmorph</Italian>
<Spanish>Blessing of Kilmorph</Spanish>
</TEXT>
<TEXT>
<Tag>TXT_KEY_SPELL_BLESSING_OF_KILMORPH_HELP</Tag>
<English>Transforms an ordinary worker into an dwarven worker</English>
<French>Transforms an ordinary worker into an dwarven worker</French>
<German>Transforms an ordinary worker into an dwarven worker</German>
<Italian>Transforms an ordinary worker into an dwarven worker</Italian>
<Spanish>Transforms an ordinary worker into an dwarven worker</Spanish>
</TEXT>
<TEXT>
<Tag>TXT_KEY_SPELL_BLESSING_OF_KILMORPH_PEDIA</Tag>
<English> With the knowledge of Arete, a civilization adhering to the Runes of Kilmorph can bring their workers to a temple dedicated to her and ask them to be fully initiated into the Ways of the Earthmother. This gives them an increased affinity with dwarven stoneworking and effectively transforms the worker into a dwarven worker.</English>
<French> With the knowledge of Arete, a civilization adhering to the Runes of Kilmorph can bring their workers to a temple dedicated to her and ask them to be fully initiated into the Ways of the Earthmother. This gives them an increased affinity with dwarven stoneworking and effectively transforms the worker into a dwarven worker.</French>
<German> With the knowledge of Arete, a civilization adhering to the Runes of Kilmorph can bring their workers to a temple dedicated to her and ask them to be fully initiated into the Ways of the Earthmother. This gives them an increased affinity with dwarven stoneworking and effectively transforms the worker into a dwarven worker.</German>
<Italian> With the knowledge of Arete, a civilization adhering to the Runes of Kilmorph can bring their workers to a temple dedicated to her and ask them to be fully initiated into the Ways of the Earthmother. This gives them an increased affinity with dwarven stoneworking and effectively transforms the worker into a dwarven worker.</Italian>
<Spanish> With the knowledge of Arete, a civilization adhering to the Runes of Kilmorph can bring their workers to a temple dedicated to her and ask them to be fully initiated into the Ways of the Earthmother. This gives them an increased affinity with dwarven stoneworking and effectively transforms the worker into a dwarven worker.</Spanish>
</TEXT>
</code>
Edit Nov 10:
I've been able to get full version zipped and available for download at this location (same as above). Have fun
