Spocko
Warlord
Hi RogerBacon,
I've just played all the way through a game with BadPeople and I think it is an absolutely vital mod because it adds a whole new dimension to the game.
But I want to add more risk to it, specifically, the level of risk associated with when a spy is caught taking action and is detained. First, I want to get a handle on setting a condition based on whether the player has Scotland Yard (so they can detect said actions, even involving foreign bads in foreign cities). And I want an elegant message that says "A Mongolian bad person is causing trouble in the Egyptian city of Alexandria."
So far, I have this message except the adjective (Egyptian) of the owner of the victim city (Alexandria). I can't figure out how to pull this adjective and post it to CyInterface (herein declared as victimCivAdjective).
Here's what I have (with most of this code being yours!), with inconsequential code snipped:
My Python skills are at the "informed cut-and-paste" level, so this may be a no-brainer for you
Thanks for your help!!
Spocko
I've just played all the way through a game with BadPeople and I think it is an absolutely vital mod because it adds a whole new dimension to the game.
But I want to add more risk to it, specifically, the level of risk associated with when a spy is caught taking action and is detained. First, I want to get a handle on setting a condition based on whether the player has Scotland Yard (so they can detect said actions, even involving foreign bads in foreign cities). And I want an elegant message that says "A Mongolian bad person is causing trouble in the Egyptian city of Alexandria."
So far, I have this message except the adjective (Egyptian) of the owner of the victim city (Alexandria). I can't figure out how to pull this adjective and post it to CyInterface (herein declared as victimCivAdjective).
Here's what I have (with most of this code being yours!), with inconsequential code snipped:
Code:
def runBadPeopleList(self, iPlayer):
...
for i in range (len(self.BadPeopleWatch)):
# Check the list for BadPeoples belonging to this player
if (iPlayer == self.BadPeopleWatch[i][0]):
pUnit = self.BadPeopleWatch[i][2]
iCounter = self.BadPeopleWatch[i][3]
pUnitInfo = PyInfo.UnitInfo(pUnit.getUnitType())
if ((pUnit.plot().isCity() == True) and (pUnit.getOwner() != pUnit.plot().getPlotCity().getOwner())):
# BadPeople is ready to make his move..
if (iCounter < 1):
pPlayer = gc.getPlayer(pUnit.getOwner())
# adjKey = pPlayer.getCivilizationAdjectiveKey() ... not used anywhere in this class
civAdjective = gc.getCivilizationInfo(pPlayer.getCivilizationType()).getAdjective(0)
victimCivAdjective = gc.getCivilizationInfo(pUnit.plot().getPlotCity().getOwner().getCivilizationType()).getAdjective(0)
# eventually, display this message only on conditions related to Scotland Yard, etc....
humanHasScotlandYard = 1
if (humanHasScotlandYard == 1):
scotlandyardBrief = "A %s bad person is causing trouble in the %s city of %s" %(civAdjective,victimCivAdjective,(pUnit.plot().getPlotCity().getName()))
CyInterface().addImmediateMessage(scotlandyardBrief, "")
My Python skills are at the "informed cut-and-paste" level, so this may be a no-brainer for you
Thanks for your help!!
Spocko
