Dancing Hoskuld
Deity
I am back and as soon as I get AAranda's, Tsentom1's and Orion Veteran's wonders balanced and into a pack I will have a look at this. Testing OK but balance still a bit off.
that's cool. is this the version available for download in your OP?
## Sid Meier's Civilization 4
## Copyright Firaxis Games 2006
##
## Animal Placing - placing of an animal resource on the map.
from CvPythonExtensions import *
import CvUtil
import sys
import BugUtil
import PyHelpers
#~ import CvEventInterface
#~ import CvWorldBuilderScreen
# globals
gc = CyGlobalContext()
localText = CyTranslator()
PyPlayer = PyHelpers.PyPlayer
PyInfo = PyHelpers.PyInfo
###################################################
def onImprovementBuilt(argsList):
'Improvement Built'
iImprovement, iX, iY = argsList
# NotSoGood start
pPlot = CyMap().plot(iX, iY)
if iImprovement == gc.getInfoTypeForString("IMPROVEMENT_BONUS_HORSE"):
pPlot.setImprovementType(-1)
pPlot.setBonusType(gc.getInfoTypeForString("BONUS_HORSE"))
elif iImprovement == gc.getInfoTypeForString("IMPROVEMENT_BONUS_COW"):
pPlot.setImprovementType(-1)
pPlot.setBonusType(gc.getInfoTypeForString("BONUS_COW"))
elif iImprovement == gc.getInfoTypeForString("IMPROVEMENT_BONUS_DEER"):
pPlot.setImprovementType(-1)
pPlot.setBonusType(gc.getInfoTypeForString("BONUS_DEER"))
elif iImprovement == gc.getInfoTypeForString("IMPROVEMENT_BONUS_PIG"):
pPlot.setImprovementType(-1)
pPlot.setBonusType(gc.getInfoTypeForString("BONUS_PIG"))
elif iImprovement == gc.getInfoTypeForString("IMPROVEMENT_BONUS_SHEEP"):
pPlot.setImprovementType(-1)
pPlot.setBonusType(gc.getInfoTypeForString("BONUS_SHEEP"))
elif iImprovement == gc.getInfoTypeForString("IMPROVEMENT_BONUS_FUR"):
pPlot.setImprovementType(-1)
pPlot.setBonusType(gc.getInfoTypeForString("BONUS_FUR"))
elif iImprovement == gc.getInfoTypeForString("IMPROVEMENT_BONUS_IVORY"):
pPlot.setImprovementType(-1)
pPlot.setBonusType(gc.getInfoTypeForString("BONUS_IVORY"))
# NotSoGood end
CvUtil.pyPrint('Improvement %s was built at %d, %d'
%(PyInfo.ImprovementInfo(iImprovement).getDescription(), iX, iY))
def canBuild(argsList):
iX, iY, iBuild, iPlayer = argsList
# NotSoGood start
plot = CyMap().plot(iX, iY)
player = gc.getPlayer(iPlayer)
if iBuild == gc.getInfoTypeForString("BUILD_BONUS_HORSE"):
if plot.isAdjacentPlotGroupConnectedBonus(iPlayer, gc.getInfoTypeForString("BONUS_HORSE")) and plot.getBonusType(player.getTeam()) == -1:
return 1
else:
return 0
elif iBuild == gc.getInfoTypeForString("BUILD_BONUS_COW"):
if plot.isAdjacentPlotGroupConnectedBonus(iPlayer, gc.getInfoTypeForString("BONUS_COW")) and plot.getBonusType(player.getTeam()) == -1:
return 1
else:
return 0
elif iBuild == gc.getInfoTypeForString("BUILD_BONUS_DEER"):
if plot.isAdjacentPlotGroupConnectedBonus(iPlayer, gc.getInfoTypeForString("BONUS_DEER")) and plot.getBonusType(player.getTeam()) == -1:
return 1
else:
return 0
elif iBuild == gc.getInfoTypeForString("BUILD_BONUS_PIG"):
if plot.isAdjacentPlotGroupConnectedBonus(iPlayer, gc.getInfoTypeForString("BONUS_PIG")) and plot.getBonusType(player.getTeam()) == -1:
return 1
else:
return 0
elif iBuild == gc.getInfoTypeForString("BUILD_BONUS_SHEEP"):
if plot.isAdjacentPlotGroupConnectedBonus(iPlayer, gc.getInfoTypeForString("BONUS_SHEEP")) and plot.getBonusType(player.getTeam()) == -1:
return 1
else:
return 0
elif iBuild == gc.getInfoTypeForString("BUILD_BONUS_FUR"):
if plot.isAdjacentPlotGroupConnectedBonus(iPlayer, gc.getInfoTypeForString("BONUS_FUR")) and plot.getBonusType(player.getTeam()) == -1:
return 1
else:
return 0
elif iBuild == gc.getInfoTypeForString("BUILD_BONUS_IVORY"):
if plot.isAdjacentPlotGroupConnectedBonus(iPlayer, gc.getInfoTypeForString("BONUS_IVORY")) and plot.getBonusType(player.getTeam()) == -1:
return 1
else:
return 0
# NotSoGood end
return -1 # Returning -1 means ignore; 0 means Build cannot be performed; 1 or greater means it can
i did. i think i can merge it together.
Dancing Hoskuld, NotSoGood @ any headway on making this work the correct way yet?
I am not getting the time I need to work on any of this at the moment. I am about to package up all my stuff and post it. I will have another look after that, if I remember rightly one of the events was not firing or maybe I had not declared the global/object variable properly.
I am not getting the time I need to work on any of this at the moment. I am about to package up all my stuff and post it. I will have another look after that, if I remember rightly one of the events was not firing or maybe I had not declared the global/object variable properly.
Can you post the current code? I have played with BUG in my mod and I could try to make it work.
Strategyonly, do you still have the BuildInfos and ImprovementInfos?
<load mod="AnimalPlacing"/>