Skip to content

Commit

Permalink
Added AI code for evaluating the production bonus from Apostolic Pala…
Browse files Browse the repository at this point in the history
…ce. [advc.079]

Replays (again) record when a civ switches to Free Religion. [advc.106]

UWAI: Reduced the war utility counted for catching up in score during the endgame.

Added "the" to announcements about completed wonders so that it says "has completed the Great Lighthouse" again. [advc.008e]
Tbd.: Also says e.g. "the Stonehenge" now.

Renamed "Quechua" to "Quechua Warrior"; now consistent with Oromo Warrior. [advc.004g]

Debug mode: Fixed some (Vanilla) bugs in the Top-Cities/Wonders tab. Should now display correct info when switching to the perspective of another civ. [advc.001d]
  • Loading branch information
f1rpo committed May 11, 2018
1 parent a3a6037 commit b5cb45f
Show file tree
Hide file tree
Showing 8 changed files with 411 additions and 131 deletions.
43 changes: 24 additions & 19 deletions Assets/Python/Screens/CvInfoScreen.py
Expand Up @@ -1678,8 +1678,8 @@ def drawTopCities(self):
iDistance = 350

self.szCityAnimWidgets.append(self.getNextWidgetName())

if (pCity.isRevealed(gc.getGame().getActiveTeam(), false)):
# advc.001d: Replaced gc.getGame().getActiveTeam() with self.iActiveTeam
if (pCity.isRevealed(self.iActiveTeam, false)):
screen.addPlotGraphicGFC(self.szCityAnimWidgets[iWidgetLoop], self.X_CITY_ANIMATION, self.Y_ROWS_CITIES[iWidgetLoop] + self.Y_CITY_ANIMATION_BUFFER - self.H_CITY_ANIMATION / 2, self.W_CITY_ANIMATION, self.H_CITY_ANIMATION, pPlot, iDistance, false, WidgetTypes.WIDGET_GENERAL, -1, -1)

# Draw Wonder icons
Expand Down Expand Up @@ -1808,8 +1808,8 @@ def determineCityData(self):
szTurnFounded = localText.getText("TXT_KEY_TIME_BC", (-iTurnYear,))#"%d %s" %(-iTurnYear, self.TEXT_BC)
else:
szTurnFounded = localText.getText("TXT_KEY_TIME_AD", (iTurnYear,))#"%d %s" %(iTurnYear, self.TEXT_AD)
# advc.001d: hasMet clause commented out
if (pCity.isRevealed(gc.getGame().getActiveTeam())):# or gc.getTeam(pPlayer.getTeam()).isHasMet(gc.getGame().getActiveTeam())):
# advc.001d: hasMet clause commented out, replaced gc.getGame().getActiveTeam() with self.iActiveTeam
if (pCity.isRevealed(self.iActiveTeam)):# or gc.getTeam(pPlayer.getTeam()).isHasMet(gc.getGame().getActiveTeam())):
self.szCityNames[iRankLoop] = pCity.getName().upper()
self.szCityDescs[iRankLoop] = ("%s, %s" %(pPlayer.getCivilizationAdjective(0), localText.getText("TXT_KEY_MISC_FOUNDED_IN", (szTurnFounded,))))
else:
Expand Down Expand Up @@ -2055,7 +2055,8 @@ def drawWondersList(self):
szStatsText += "\n"

if (pProjectInfo.getProductionCost() > 0):
szCost = localText.getText("TXT_KEY_PEDIA_COST", (gc.getActivePlayer().getProjectProductionNeeded(self.iWonderID),))
# advc.001d: Replaced gc.getActivePlayer with self.pActivePlayer
szCost = localText.getText("TXT_KEY_PEDIA_COST", (self.pActivePlayer.getProjectProductionNeeded(self.iWonderID),))
szStatsText += szCost.upper() + (u"%c" % gc.getYieldInfo(YieldTypes.YIELD_PRODUCTION).getChar()) + "\n"

if (isWorldProject(self.iWonderID)):
Expand Down Expand Up @@ -2138,7 +2139,8 @@ def drawWondersList(self):
# Building attributes

if (pWonderInfo.getProductionCost() > 0):
szCost = localText.getText("TXT_KEY_PEDIA_COST", (gc.getActivePlayer().getBuildingProductionNeeded(self.iWonderID),))
# advc.001d: Replaced gc.getActivePlayer with self.pActivePlayer
szCost = localText.getText("TXT_KEY_PEDIA_COST", (self.pActivePlayer.getBuildingProductionNeeded(self.iWonderID),))
szStatsText += szCost.upper() + (u"%c" % gc.getYieldInfo(YieldTypes.YIELD_PRODUCTION).getChar()) + "\n"

for k in range(CommerceTypes.NUM_COMMERCE_TYPES):
Expand Down Expand Up @@ -2206,8 +2208,8 @@ def calculateWondersList(self):
self.aaWondersBeingBuilt = []
self.aaWondersBuilt = []
self.iNumWonders = 0

self.pActivePlayer = gc.getPlayer(CyGame().getActivePlayer())
# advc.001d: Commented out. Already set properly by caller.
#self.pActivePlayer = gc.getPlayer(CyGame().getActivePlayer())

# Loop through players to determine Wonders
for iPlayerLoop in range(gc.getMAX_PLAYERS()):
Expand Down Expand Up @@ -2372,8 +2374,8 @@ def calculateWondersList_BUG(self):

if (self.pActiveTeam.isHasMet(iPlayerTeam)
and self.iInvestigateCityMission != -1 # K-Mod, bugfix
and self.pActivePlayer.canDoEspionageMission(self.iInvestigateCityMission, pCity.getOwner(), pCity.plot(), -1)
and pCity.isRevealed(gc.getGame().getActiveTeam())):
and self.pActivePlayer.canDoEspionageMission(self.iInvestigateCityMission, pCity.getOwner(), pCity.plot(), -1) # advc.001d: Replaced gc.getGame().getActiveTeam with self.iActiveTeam
and pCity.isRevealed(self.iActiveTeam)):
self.aaWondersBeingBuilt_BUG.append([iProjectLoop,pPlayer.getCivilizationShortDescription(0), pCity, iPlayerLoop])

# Loop through buildings
Expand All @@ -2395,8 +2397,8 @@ def calculateWondersList_BUG(self):

if (self.pActiveTeam.isHasMet(iPlayerTeam)
and self.iInvestigateCityMission != -1 # K-Mod, bugfix
and self.pActivePlayer.canDoEspionageMission(self.iInvestigateCityMission, pCity.getOwner(), pCity.plot(), -1)
and pCity.isRevealed(gc.getGame().getActiveTeam())):
and self.pActivePlayer.canDoEspionageMission(self.iInvestigateCityMission, pCity.getOwner(), pCity.plot(), -1) # advc.001d: Replaced gc.getGame().getActiveTeam with self.iActiveTeam
and pCity.isRevealed(self.iActiveTeam)):
self.aaWondersBeingBuilt_BUG.append([iBuildingLoop,pPlayer.getCivilizationShortDescription(0), pCity, iPlayerLoop])

if (pCity.getNumBuilding(iBuildingLoop) > 0):
Expand All @@ -2419,8 +2421,8 @@ def calculateWondersList_BUG(self):

if (self.pActiveTeam.isHasMet(iPlayerTeam)
and self.iInvestigateCityMission != -1 # K-Mod, bugfix
and self.pActivePlayer.canDoEspionageMission(self.iInvestigateCityMission, pCity.getOwner(), pCity.plot(), -1)
and pCity.isRevealed(gc.getGame().getActiveTeam())):
and self.pActivePlayer.canDoEspionageMission(self.iInvestigateCityMission, pCity.getOwner(), pCity.plot(), -1) # advc.001d: Replaced gc.getGame().getActiveTeam with self.iActiveTeam
and pCity.isRevealed(self.iActiveTeam)):
self.aaWondersBeingBuilt_BUG.append([iBuildingLoop,pPlayer.getCivilizationShortDescription(0), pCity, iPlayerLoop])

# Has this city built a wonder?
Expand All @@ -2431,7 +2433,7 @@ def calculateWondersList_BUG(self):
# advc.001d (comment): To hide (finished)
# national wonders of other teams, remove
# this code block:
elif (self.pActiveTeam.isHasMet(iPlayerTeam) and pCity.isRevealed(gc.getGame().getActiveTeam())):
elif (self.pActiveTeam.isHasMet(iPlayerTeam) and pCity.isRevealed(self.iActiveTeam)):
self.aaWondersBuilt_BUG.append([pCity.getBuildingOriginalTime(iBuildingLoop),iBuildingLoop,True,pPlayer.getCivilizationShortDescription(0), pCity, iPlayerLoop])
self.iNumWonders += 1

Expand Down Expand Up @@ -2524,7 +2526,8 @@ def drawWondersList_BUG(self):
szTurnYearBuilt = u"<font=2>%c</font>" % gc.getYieldInfo(YieldTypes.YIELD_PRODUCTION).getChar()

# Check to see if active player can see this city
if pCity and pCity.isRevealed(gc.getGame().getActiveTeam()):
# advc.001d: replaced gc.getGame().getActiveTeam with self.iActiveTeam
if pCity and pCity.isRevealed(self.iActiveTeam):
szCityName = pCity.getName()
else:
szCityName = u""
Expand Down Expand Up @@ -2571,7 +2574,8 @@ def drawWondersList_BUG(self):
szTurnYearBuilt = BugUtil.getDisplayYear(iTurnYearBuilt)

# Check to see if active player can see this city
if pCity and pCity.isRevealed(gc.getGame().getActiveTeam()):
# advc.001d: Replaced gc.getGame().getActiveTeam with self.iActiveTeam
if pCity and pCity.isRevealed(self.iActiveTeam):
szCityName = pCity.getName()
else:
szCityName = u""
Expand All @@ -2581,7 +2585,8 @@ def drawWondersList_BUG(self):
szCityName = localText.changeTextColor(szCityName, color)

screen.appendTableRow(self.szWondersTable)
if bKnown and pCity and pCity.isRevealed(gc.getGame().getActiveTeam()):
# advc.001d: Replaced gc.getGame().getActiveTeam with self.iActiveTeam
if bKnown and pCity and pCity.isRevealed(self.iActiveTeam):
screen.setTableText(self.szWondersTable, 0, iWonderLoop+iWBB, "", zoomArt, WidgetTypes.WIDGET_ZOOM_CITY, pCity.getOwner(), pCity.getID(), CvUtil.FONT_LEFT_JUSTIFY)
screen.setTableText(self.szWondersTable, 1, iWonderLoop+iWBB, szWonderName , "", iWidget, iWonderType, -1, CvUtil.FONT_LEFT_JUSTIFY)
screen.setTableInt (self.szWondersTable, 2, iWonderLoop+iWBB, szTurnYearBuilt, "", WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_RIGHT_JUSTIFY)
Expand Down Expand Up @@ -3026,7 +3031,7 @@ def handleInput (self, inputClass):
if (inputClass.getFunctionName() == self.DEBUG_DROPDOWN_ID):
iIndex = screen.getSelectedPullDownID(self.DEBUG_DROPDOWN_ID)
self.iActivePlayer = screen.getPullDownData(self.DEBUG_DROPDOWN_ID, iIndex)

self.reset() # advc.001d
self.pActivePlayer = gc.getPlayer(self.iActivePlayer)
self.iActiveTeam = self.pActivePlayer.getTeam()
self.pActiveTeam = gc.getTeam(self.iActiveTeam)
Expand Down
97 changes: 97 additions & 0 deletions Assets/XML/Text/CIV4GameText_advc.008e.xml
Expand Up @@ -918,5 +918,102 @@
<Plural>0:1</Plural>
</Spanish>
</TEXT>
<!-- Projects -->
<TEXT>
<Tag>TXT_KEY_PROJECT_MANHATTAN_PROJECT</Tag>
<English>Manhattan Project</English>
<French>
<Text>Projet Manhattan</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</French>
<German>
<Text>Manhattan-Projekt</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</German>
<Italian>
<Text>Manhattan Project</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</Italian>
<Spanish>
<Text>Proyecto Manhattan</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</Spanish>
</TEXT>
<TEXT>
<Tag>TXT_KEY_PROJECT_THE_INTERNET</Tag>
<English>Internet</English>
<French>
<Text>Internet</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</French>
<German>
<Text>Internet</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</German>
<Italian>
<Text>Internet</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</Italian>
<Spanish>
<Text>Internet</Text>
<Gender>Female</Gender>
<Plural>0</Plural>
</Spanish>
</TEXT>
<TEXT>
<Tag>TXT_KEY_PROJECT_SDI</Tag>
<English>SDI</English>
<French>
<Text>IDS</Text>
<Gender>Female</Gender>
<Plural>0</Plural>
</French>
<German>
<Text>SDI</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</German>
<Italian>
<Text>SDI</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</Italian>
<Spanish>
<Text>SDI</Text>
<Gender>Female</Gender>
<Plural>0</Plural>
</Spanish>
</TEXT>
<TEXT>
<Tag>TXT_KEY_PROJECT_APOLLO_PROGRAM</Tag>
<English>Apollo Program</English>
<French>
<Text>Programme Apollo</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</French>
<German>
<Text>Apollo-Programm</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</German>
<Italian>
<Text>Programma Apollo</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</Italian>
<Spanish>
<Text>Programa Apollo</Text>
<Gender>Male</Gender>
<Plural>0</Plural>
</Spanish>
</TEXT>

</Civ4GameText>

0 comments on commit b5cb45f

Please sign in to comment.