[MOD] Lawyer Unit: Remove Corporations from a City

RE: overpowered = ability to pick and choose....

I understand your position tsentom1 and you make a valid point. But, I think that a better check on a lawyer’s power is to make the cost of the ‘remove corporation’ mission fairly expensive – depending on the size of the corporation. This reflects the high costs of taking a dominant corporation to trial.

Also, the number of lawyer units could be restricted as with missionaries. Finally, the lawyer unit could be good for only a one-time use. In that way, the lawyer is extremely useful but very limited. Essentially, a player would train a lawyer to for his/her one big day in court.

I suggest this because I like your idea very much and I am considering adding your mod to my own. However, I do not like the idea of all corporations being removed since a player can only spread the corporations he/she has available. In other words, if the city you want to remove one corp. from is the same city that has another corp. that you want to keep, then basically you're throwing out the baby with the bathwater. Unless you could create a ‘franchisor’ unit to spread others’ corporations into your cities!

What’cha think?
 
I was hoping someone with better python coding skills could take a look at this attachment. I got this mod to work somehow by merging it with orions inquisition 2.5.
However, it has a python error. The error pops up when there is no corporation in a city and you press the remove corp. button.

I tried to code in a showbutton function, but I'm just not familar enough with it. Anyways if you press the button as described above, you get an HC error about how it hasn't been defined.

What would make it go away would be to hide the mission button or to define HC when there is no corporation as a very large negative number.
 
I would look in the inquisition.py and duplicate the showInquisitionButton function using corporations instead of religions. Then use that. I can't find a copy of the code on my machine to help any more (if it does help that is) I lost a great deal of stuff to a hard disk crash awhile back. :(
 
Thanks for the information. I tried that before, but I'm not familar enough with python syntax, which causes C++ mismatches. Here is the code if you can think of what to do.

Code:
def showInquisitionButton(pUnit):
	# Orion's Inquisition Mod
	pUnitOwner = gc.getPlayer(pUnit.getOwner())
	iStateReligion = pUnitOwner.getStateReligion()
	iUnitType = pUnit.getUnitType()
	ProceedWithInquisition = False
	zShowButton = False
		
	if iStateReligion != -1 :
	
		MyXInquisitor = str(getReligionInquisitor(iStateReligion))
		InquisitorType = CvUtil.findInfoTypeNum(gc.getUnitInfo, gc.getNumUnitInfos(), MyXInquisitor)
		
		if iUnitType == InquisitorType:
			# Need to find a better way to fix the next line
			#pUnit.setUnitAIType(UnitAITypes.UNITAI_UNKNOWN)
			pCity = gc.getMap().plot( pUnit.getX(), pUnit.getY() ).getPlotCity()
			pCityPlayer = gc.getPlayer(pCity.getOwner())
			if ( pCity.getOwner( ) == pUnit.getOwner( ) ) or ( gc.getTeam( pCityPlayer.getTeam( ) ).isVassal( gc.getPlayer( pUnit. getOwner( ) ).getTeam( ) ) ): 
				ProceedWithInquisition = True
			elif isOC_FOREIGN_INQUISITIONS():
				#Foriegn Inquisition Check
				if (pCity.getOwner() != pUnit.getOwner()):
					iPlayerA = pUnit.getOwner( )
					iPlayerB = pCity.getOwner( )
					if hasOpenBordersAgreement(iPlayerA, iPlayerB):
						if hasMatchingStateReligion(iPlayerA, iPlayerB):
							ProceedWithInquisition = True
							
			if ProceedWithInquisition:
				if pCity.isHasReligion(iStateReligion):
					for iReligionLoop in range(gc.getNumReligionInfos( )):
						if pCity.isHasReligion(iReligionLoop):
							if iReligionLoop != iStateReligion:
								# If game option prevents Inquisition of Holy City.
								if not isOC_INQUISITOR_CAN_REMOVE_HOLY_CITY():
									# Does City Have one or more non-state religions that are not Holy City religions
									if ocCityHasNonStateReligion(pCity, iStateReligion):
										zShowButton = True
								elif isOC_INQUISITOR_CAN_REMOVE_HOLY_CITY():
									zShowButton = True

	return zShowButton
 
OK, I'll look at it later today and get back to you. The Lawyer Unit is supposed to remove all corporations or all except the corp it belongs to? Much easier if the former. ;)
 
Here is the basic code. I have not tested it and there may be some dyslexic errors:blush:

Code:
##
## option isOC_FOREIGN_LITIGATIONS true mans can remove corporations from other nation's cities
##

def isOC_FOREIGN_LITIGATIONS():
	return gc.getDefineINT("OC_FOREIGN_LITIGATIONS") != 0


def showLawyerButton(pUnit):
	pUnitOwner = gc.getPlayer(pUnit.getOwner())
	iUnitType = pUnit.getUnitType()
	ProceedWithLitigation = False
	zShowButton = False
	
	if iUnitType == gc.getInfoTypeForString("UNIT_LAWYER"):
		pCity = gc.getMap().plot( pUnit.getX(), pUnit.getY() ).getPlotCity()
		if pCity == None:  ## Check the plot is a city
			return False
		pCityPlayer = gc.getPlayer(pCity.getOwner())
		if ( pCity.getOwner( ) == pUnit.getOwner( ) ) or ( gc.getTeam( pCityPlayer.getTeam( ) ).isVassal( gc.getPlayer( pUnit. getOwner( ) ).getTeam( ) ) ): 
			ProceedWithLitigation = True
		elif isOC_FOREIGN_LITIGATIONS():
			#Foriegn Inquisition Check
			if (pCity.getOwner() != pUnit.getOwner()):
				iPlayerA = pUnit.getOwner( )
				iPlayerB = pCity.getOwner( )
				if hasOpenBordersAgreement(iPlayerA, iPlayerB):
					ProceedWithLitigation = True
						
		if ProceedWithLitigation:
			for iCorporationLoop in range(gc.getNumCorporationInfos( )):
				if pCity.isHasCorporation (iCorporationLoop):
					#~ zShowButton = True
					return True  ## get out of the loop asap

	return zShowButton

I have assumed that the Lawyer can only work in the nation it belongs to and its vassals unless an option is set.
 
Does anyone have this for BTS 319? Cause it looks really interesting. And I know no one replied in this thread for 8 years...
EDIT: platyping created something exactly like this for BtS 319 so nevermind this.
 
Last edited:
Does anyone have this for BTS 319? Cause it looks really interesting. And I know no one replied in this thread for 8 years...
I think C2C has something similar.
 
Top Bottom