Guru-Meditation
Warlord
- Joined
- Oct 9, 2010
- Messages
- 125
Yay! New release!
I've prepared all the fixes Magister mentioned and placed them conveniently into appropriate folders. Just merge the main folder and they should get replaced properly. The thing is that there is still at least one game breaking bug. My game crashed around turn 120 on Epic.
EDIT: From what I can see the game crashed on turn 121 after Barbarians finished moving all of it's units or at least that was the last entry in the log before the crash.
I've never seen why the Amurites should have any special attraction to this feature. Sure, Kylorin fought there, but it was always hostile territory. Canonically it is haunted by Hollow Men, who killed everyone who tried to explore it in the time between Kylorin leaving and Auric arriving.thanks.
really interesting
two questions:
-currently Amurite and Illian have a running race toward Letum Frigus. If it generates hollow men, Amurite will have a much harder time to get the bonus with their early scouts..
-would a spell giving "needs lvl X to enter tile" (X = 2, 3 4 ?) be possible ? or is it only available to improvements ? If yes, what spell sphere would correspond thematically ? (I thought that great Ward could work with "need lvl 3 to enter tile" so that you could protect a city from swarms... or 1 turn summons, until the archmage is assassinated...)
def atRangeUpdateWarding(pCaster, pPlot):
iLevel = 0
iAffinity = gc.getInfoTypeForString('PROMOTION_AFFINITY_FORCE')
iMana = gc.getInfoTypeForString('BONUS_MANA_FORCE')
for i in xrange(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(i)
if pUnit.isHasPromotion(iAffinity):
iLevel = max(iLevel, min(pUnit.getLevel(), cf.getNumBonusEffective(pUnit.getOwner(), iMana, pUnit) ) )
pPlot.setMinLevel(iLevel)
if iLevel == 0:
pPlot.setImprovementType(-1)
if iImprovement == gc.getInfoTypeForString('IMPROVEMENT_RING_OF_WARDING'):
pPlot.setMinLevel(0)
pPlot.setTempImprovementType(gc.getInfoTypeForString('IMPROVEMENT_RING_OF_WARDING'), min(pCaster.getLevel(), cf.getNumBonusEffective(pCaster.getOwner(), iMana, pUnit) ) )
def unitCannotMoveInto(self,argsList):
ePlayer = argsList[0]
iUnitId = argsList[1]
pUnit = gc.getPlayer(ePlayer).getUnit(iUnitId)
if not pUnit.isAlive():
pPlot = CyMap().plot(argsList[2], argsList[3])
if pPlot.getTeam() != pUnit.getTeam():
if pPlot.isOwned():
#The compact requires that the gods' prevent their greater servants from directly harming those whose souls they don't already own
#Balors and the avatar units of each Infernal leader, before the AC 100 event
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_BOUND_BY_COMPACT')):
if gc.getTerrainInfo(pPlot.getTerrainType()).getTerrainDown() == -1:#i.e., is not Hell terrain
if gc.getPlayer(pPlot.getOwner()).getStateReligion() != gc.getInfoTypeForString('RELIGION_THE_ASHEN_VEIL'):
return True
if pPlot.isCity():#eliminates superforts that would count as isEnemyCity, since for some reason forts were being counted as having every building
if pPlot.isEnemyCity(pUnit):#The plot has a city or superfort whose owner is at war with unit's owner, or the unit is hidden nationality.
#The Ring of Warding spell-building prevents hostile summons from entering/attacking the city
if not pUnit.isImmuneToMagic(): #Runewyns are immune to and can dispell Rings of Warding
## if pUnit.isHiddenNationality() or gc.getTeam(pUnit.getTeam()).isAtWar(pPlot.getTeam()):
pCity = pPlot.getPlotCity()
if pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_SHRINE_OF_ARAWN')):
if pUnit.getRace() == gc.getInfoTypeForString('PROMOTION_UNDEAD'):
if pUnit.getLevel()//3 < pCity.getNumBonuses(gc.getInfoTypeForString('BONUS_MANA_DEATH')):
return True
if pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_RING_OF_WARDING_GREATER')):
if pUnit.getSummoner() != -1 or pUnit.isPermanentSummon() or pUnit.getDuration() > 0 or pUnit.getRace() in [gc.getInfoTypeForString('PROMOTION_UNDEAD'), gc.getInfoTypeForString('PROMOTION_ELEMENTAL'),gc.getInfoTypeForString('PROMOTION_ANGEL'), gc.getInfoTypeForString('PROMOTION_DEMON')]:
if pUnit.getLevel()//3 < pCity.getNumBonuses (gc.getInfoTypeForString('BONUS_MANA_FORCE')):
return True
elif pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_RING_OF_WARDING')):
if pUnit.getSummoner() != -1 or pUnit.isPermanentSummon() or pUnit.getDuration() > 0:
if pUnit.getLevel()//2 < pCity.getNumBonuses(gc.getInfoTypeForString('BONUS_MANA_FORCE')):
return True
elif pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_BOUND_BY_COMPACT')):
if gc.getTerrainInfo(pPlot.getTerrainType()).getTerrainDown() == -1:#i.e., is not Hell terrain
return True
if pPlot.isPythonActive():
if pUnit.isAutomated() or not pUnit.isHuman():
if pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_HALLOWED_GROUND'):
if pUnit.getRace() in [gc.getInfoTypeForString('PROMOTION_DEMON'),gc.getInfoTypeForString('PROMOTION_UNDEAD')]:
return False
iImprovement = pPlot.getImprovementType()
if iImprovement == gc.getInfoTypeForString('IMPROVEMENT_TARCHS_TOWER'):
if not pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_CHANNELING2')):
return True
elif iImprovement == gc.getInfoTypeForString('IMPROVEMENT_MAELSTROM'):
if not pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_AFFINITY_AIR')):
return True
elif iImprovement == gc.getInfoTypeForString('IMPROVEMENT_MIRROR_OF_HEAVEN'):
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_VAMPIRE')):
return True
elif pUnit.getUnitClassType() == gc.getInfoTypeForString('UNITCLASS_SHADOWRIDER'):
return True
elif iImprovement == gc.getInfoTypeForString('IMPROVEMENT_WHISPERING_WOOD'):
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_DEASIL_CHARM')):
pass
elif pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_SHADOWWALK')):
pass
elif pUnit.getUnitClassType() == gc.getInfoTypeForString('UNITCLASS_AURIC'):
pass
else:
return True
return False
def unitCannotMoveInto(self,argsList):
ePlayer = argsList[0]
iUnitId = argsList[1]
pUnit = gc.getPlayer(ePlayer).getUnit(iUnitId)
pPlot = CyMap().plot(argsList[2], argsList[3])
if pPlot.getTeam() != pUnit.getTeam():
if pPlot.isOwned():
#The compact requires that the gods' prevent their greater servants from directly harming those whose souls they don't already own
#Balors and the avatar units of each Infernal leader, before the AC 100 event
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_BOUND_BY_COMPACT')):
if gc.getTerrainInfo(pPlot.getTerrainType()).getTerrainDown() == -1:#i.e., is not Hell terrain
if gc.getPlayer(pPlot.getOwner()).getStateReligion() != gc.getInfoTypeForString('RELIGION_THE_ASHEN_VEIL'):
return True
if pPlot.isCity():#eliminates superforts that would count as isEnemyCity, since for some reason forts were being counted as having every building
if pPlot.isEnemyCity(pUnit):#The plot has a city or superfort whose owner is at war with unit's owner, or the unit is hidden nationality.
#The Ring of Warding spell-building prevents hostile summons from entering/attacking the city
if not pUnit.isImmuneToMagic(): #Runewyns are immune to and can dispell Rings of Warding
## if pUnit.isHiddenNationality() or gc.getTeam(pUnit.getTeam()).isAtWar(pPlot.getTeam()):
pCity = pPlot.getPlotCity()
if pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_RING_OF_WARDING_GREATER')):
if pUnit.getLevel()//3 < pCity.getNumBonuses(gc.getInfoTypeForString('BONUS_MANA_FORCE')):
return True
elif not pUnit.isAlive():
if pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_RING_OF_WARDING')):
if pUnit.getSummoner() != -1 or pUnit.isPermanentSummon() or pUnit.getDuration() > 0:
if pUnit.getLevel()//2 < pCity.getNumBonuses(gc.getInfoTypeForString('BONUS_MANA_FORCE')):
return True
if pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_SHRINE_OF_ARAWN')):
if pUnit.getRace() == gc.getInfoTypeForString('PROMOTION_UNDEAD'):
if pUnit.getLevel()//3 < pCity.getNumBonuses(gc.getInfoTypeForString('BONUS_MANA_DEATH')):
return True
elif pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_BOUND_BY_COMPACT')):
if gc.getTerrainInfo(pPlot.getTerrainType()).getTerrainDown() == -1:#i.e., is not Hell terrain
return True
if pPlot.isPythonActive():
if pUnit.isAutomated() or not pUnit.isHuman():
if pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_HALLOWED_GROUND'):
if pUnit.getRace() in [gc.getInfoTypeForString('PROMOTION_DEMON'),gc.getInfoTypeForString('PROMOTION_UNDEAD')]:
return False
iImprovement = pPlot.getImprovementType()
if iImprovement == gc.getInfoTypeForString('IMPROVEMENT_TARCHS_TOWER'):
if not pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_CHANNELING2')):
return True
elif iImprovement == gc.getInfoTypeForString('IMPROVEMENT_MAELSTROM'):
if not pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_AFFINITY_AIR')):
return True
elif iImprovement == gc.getInfoTypeForString('IMPROVEMENT_MIRROR_OF_HEAVEN'):
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_VAMPIRE')):
return True
elif pUnit.getUnitClassType() == gc.getInfoTypeForString('UNITCLASS_SHADOWRIDER'):
return True
elif iImprovement == gc.getInfoTypeForString('IMPROVEMENT_WHISPERING_WOOD'):
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_DEASIL_CHARM')):
pass
elif pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_SHADOWWALK')):
pass
elif pUnit.getUnitClassType() == gc.getInfoTypeForString('UNITCLASS_AURIC'):
pass
else:
return True
return False
woooah !
many thanks.
I was really only wondering if it could work for a city (using a temporary building for example).. I didn't expect any real code.
and I have to hang myself for being the cause of you reporting the upload ....
anyway, my idea was mostly theoretical. And game-wise, I thought that being able to use an archmage to forbid access to low-level units could be interesting enough, even if the level is low (2-3 max) (which is better so that it doesn"t become OP), and even if your units are blocked (magic, especially Force, is neutral).
However if you want to give access to your units, it's easy, move the Archmage, wait a turn,... and hop, it's good.
I didn't think about Runwynes; but for an easy way to offset that, Runewynes could come with free xp, even if it's not the smartest solution.
if iUnit == gc.getInfoTypeForString('UNIT_RUNEWYN'):
unit.setLevel(7)