Resource icon

Malleus Maleficarum Wonder (XML+Python) 2016-10-05



It will continuously purge non-state religions (the chance and rate of doing so is dependent on the size of your empire). Currently, it does not remove religious buildings or holy cities, but I labeled where and how in the python to change this to your liking

It also blocks non-state religious spread from foreign missionaries - which you might think is redundant but keep in mind you can capture new cities with non-state religions.

There are some tricky parts to adding this due to errors in the original BTS code:

In the PythonCallbackDefines XML file you are changing this:

Code:
	<Define>
		<DefineName>USE_CANNOT_SPREAD_RELIGION_CALLBACK</DefineName>
		<iDefineIntVal>0</iDefineIntVal>
	</Define>

to this:

Code:
	<Define>
		<DefineName>USE_USE_CANNOT_SPREAD_RELIGION_CALLBACK</DefineName>
		<iDefineIntVal>1</iDefineIntVal>
	</Define>

Note the double Use_Use

Also in the CvGameUtils Python file you're not just adding code you need to comment out the original code that was there so:
Spoiler :

Code:
## Witches Hammer Start ##
#
## NOTE: Due to an error in the actual BTS code you will have to comment out the original def cannotSpreadReligion callback (adding # before it) as below: ##
#
#	def cannotSpreadReligion(self,argsList):
#		iOwner, iUnitID, iReligion, iX, iY = argsList[0]
#		return False

	def cannotSpreadReligion(self,argsList):
		iOwner, iUnitID, iReligion, iX, iY = argsList

		pPlot = CyMap().plot(iX, iY)
		pPlayer = gc.getPlayer(pPlot.getOwner())

		b_Witches = gc.getInfoTypeForString("BUILDING_WITCHES_HAMMER")
		obsoleteTech = gc.getBuildingInfo(b_Witches).getObsoleteTech()

		if pPlot.getOwner( ) >= 0:
			if ( gc.getTeam(pPlayer.getTeam()).isHasTech(obsoleteTech) == false or obsoleteTech == -1 ):
				for iCity in range(pPlayer.getNumCities()):
					ppCity = pPlayer.getCity(iCity)
					if ppCity.getNumActiveBuilding(b_Witches) == true:
	
						if pPlayer.getStateReligion( ) != iReligion:
							return True

		return False

## Witches Hammer End ##


There additional code in that file as well as another python file. Everything is labeled 'Witches Hammer' I recommend downloading and using winmerge to help combine the files.

Special Thanks to Dresden for helping me with the python

XML, Button: me (tsentom1)
python: tsentom1, dresden
Model: Model taken from Fall from Heaven 2, I added the flame effect.
Movie: Taken from one of Gir's Mods

Thread

Edit: Added a wonder movie
  • witches_SMc.jpg
    witches_SMc.jpg
    120.6 KB · Views: 77
Author
tsentom1
Downloads
487
Views
487
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from tsentom1

Top Bottom