tsentom1,
Your Python wonders are really amazing. I'm looking at including a couple in my next release of CivFusion.
There was a forum member named GIR who also had some neat Python wonders but he hasn't been around a while to my knowledge. One of them, Petra, had a neat effect where it would give you a 25% chance of receiving a UB of another civ when you built a building. For example, if you built a Stable, you would have 25% chance of receiving a Ger, even if you were playing Spain or England or any other civ. However, there is a bug in the code. Using this example, let's say you are playing Spain and you have the Petra wonder. You build a Stable and are lucky enough to receive a Ger instead. However, you can still build a Stable, which should not happen. If you receive the UB from Petra, you should no longer be able to build the standard building.
Anyways, I was wondering if I posted the code if you wouldn't mind looking at it and seeing if you could fix it. If not, no worries, but I thought I would ask.
Cheers,
ripple01
In the CvGameUtils File
Code:
def cannotConstruct(self,argsList):
pCity = argsList[0]
eBuilding = argsList[1]
bContinue = argsList[2]
bTestVisible = argsList[3]
bIgnoreCost = argsList[4]
## Petra Mod begins ##
lgleicheBC = []
buildingClassType = gc.getBuildingInfo(eBuilding).getBuildingClassType()
for i in range(gc.getNumBuildingInfos()):
if ( buildingClassType == gc.getBuildingInfo(i).getBuildingClassType() ):
lgleicheBC.append(i)
if ( len(lgleicheBC) >= 2 ):
if ( eBuilding == lgleicheBC[0] ):
for i in range(len(lgleicheBC)-1):
if ( pCity.getNumActiveBuilding(lgleicheBC[i +1])==true ):
return True
### Petra Mod ends ###
return False
Gir actually had a partial check, thanks to his and Dresden's code for this
You also need to open up the PythonCallBack XML file and change Cannot Construct from a 0 to a 1