Valkrionn
The Hamster King
How do you add civ-specific art for improvements?
Are there other hidden factors at work with magic resistance?
Vehem said the base is 20%, but so far, it seems to be much higher. In a few seperate tests, I'm seeing 2/7 successes, or 3/13, on a spell with no resistance modifier. Which surely means it should be working 80% of the time?
The targets in question are just warriors standing around. Some on hills, some on flatlands. Does terrain affect magic damage and resistance rates?
From what I'm seeing, magic resist rates seem to be significantly higher than 20%.
Is a "success" a successful cast or a successful resist? Of it's resist, the numbers look right. Otherwise it should just be down to the target unit level and any promotions they had - terrain shouldn't be a factor...
If you've given those warriors to Cernunnos for testing purposes - they're probably Magic resistant (he has that trait).
# ngomele start
iBuildFarm = gc.getInfoTypeForString('BUILD_FARM')
iBuildQuarry = gc.getInfoTypeForString('BUILD_QUARRY')
iBuildForester = gc.getInfoTypeForString('BUILD_FOREST_PRESERVE')
iBuildPasture = gc.getInfoTypeForString('BUILD_PASTURE')
iWheat = gc.getInfoTypeForString('BONUS_WHEAT')
iCorn = gc.getInfoTypeForString('BONUS_CORN')
iRice = gc.getInfoTypeForString('BONUS_RICE')
iFlax = gc.getInfoTypeForString('BONUS_FLAX')
iMarble = gc.getInfoTypeForString('BONUS_MARBLE')
iSheutStone = gc.getInfoTypeForString('BONUS_SHEUT_STONE')
iDuskwood = gc.getInfoTypeForString('BONUS_DUSKWOOD')
if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_NGOMELE'):
pPlot = CyMap().plot(iX, iY)
if pPlot.getOwner() == iPlayer:
if pPlot.isCity() == False:
if (iBuild == iBuildFarm):
if pPlot.getBonusType(-1) == iWheat:
return 1
if pPlot.getBonusType(-1) == iCorn:
return 1
if pPlot.getBonusType(-1) == iRice:
return 1
if pPlot.getBonusType(-1) == iFlax:
return 1
else:
return 0
if (iBuild == iBuildQuarry):
if pPlot.getBonusType(-1) == iMarble:
return 1
if pPlot.getBonusType(-1) == iSheutStone:
return 1
else:
return 0
if (iBuild == iBuildForester):
if pPlot.getBonusType(-1) == iDuskwood:
return 1
else:
return 0
if (iBuild == iBuildPasture):
if not pPlot.isHills():
if pPlot.getTerrainType() == gc.getInfoTypeForString('TERRAIN_GRASS'):
if pPlot.getImprovementType() != iBuildPasture:
return 1
return 0
Thanks for the tipLooks like you want them to only be able to build anything on appropriate resources. You could return a negative value if there is a resource at all, which should leave the DLL to decide if it is allowed or not. Simplifies some of your checks if that works.
Well, I'm stupidFor your pasture issue: Add some print statements so you can be certain it is ever checking your function at all. The check of improvement type against Pasute BUILD ORDER is not a good idea though, Improvement != Build Order. Very different XML files, so very different enumerations.
Thanks for the tip
Could it slow the game? I've some issues right now but nothing I can really understand. Once, I tried some feature and everytime I selected a Scout or a Hunter, it lagged. Then, when I holded right click on a tile a moved the mouse around, it lagged. After, I tried another feature and that was the arcane units that were causing problems, the exact same one. It's confusing. Especially considering that neither the recon nor the arcane units have anything to do with the CanBuild code I added.Be careful with CanBuild - it get's a *lot* of calls during the game (millions) - need to keep the Python as tight as you can...