def onUnitPromoted(self, argsList):
'Unit Promoted'
pUnit, iPromotion = argsList
player = PyPlayer(pUnit.getOwner())
## Bomba Start ##
if pUnit.isHasPromotion(gc.getInfoTypeForString("PROMOTION_BOMB")):
pPlot = CyMap().plot(iX, iY)
if iRoute == gc.getInfoTypeForString('ROUTE_ROAD'):
pPlot.setRouteType(-1)
if pPlot.isPeak():
pPlot.setPlotType(PlotTypes.PLOT_HILLS, True, True)
def onUnitPromoted(self, argsList):
'Unit Promoted'
pUnit, iPromotion = argsList
player = PyPlayer(pUnit.getOwner())
### Bomba Start ###
if pUnit.isHasPromotion(gc.getInfoTypeForString("PROMOTION_BOMB")):
### Get the Plot from the Unit ###
iX= pUnit.getX()
iY= pUnit.getY()
pPlot = CyMap().plot(iX, iY)
### Roads are bombed away ###
if pPlot.getRouteType() != -1:
pPlot.setRouteType(-1)
### Peas are bombed to Hills ###
if pPlot.isPeak():
pPlot.setPlotType(PlotTypes.PLOT_HILLS, True, True)
hiwould like a Python modcomp that if a civ has X civic than it is immune to foreign culture
I would like a building/wonder in my mod that would establish a religion in my empire. Does anyone know if there is already a code for this somewhere, or even a minimod? thanks HROCHland
That's exactly how things work in my modThank you very much for your reply. If I may, I will tell you exactly what I mean. When I added the Druidic tradition to the religions, I noticed that Judaism became somewhat neglected by the game. That is why I added the Bait ha mikdash (Solomon's temple) among the wonders. I would need a code so that the player, if he builds Solomon's temple, found Judaism.
I just looked it up in vanilla and sadly CvPlayer::canBuild doesn't have a python callback. It only test if a tech is present to unlock, but there is no code to hide it again. It can be added without too much hassle, relatively speaking for C++ changes in mods, but it does require the DLL file to be recompiled. I didn't check if adv-civ has added one, but I find it unlikely. Generally speaking, if the DLL is being modded, it will be best to have all the new stuff in the DLL file for performance reasons. Pushing the same calculations to python will slow down the game. It's also easier to just do it in C++ since you have to modify C++ anyway.So ... there's no clever and quick solution outside SDK?