def _willPassTest(self, city): if (CityUtil.willGrowThisTurn(city)): iExtra = 1 elif (CityUtil.willShrinkThisTurn(city)): iExtra = -1 else: iExtra = 0 iHappy = city.happyLevel() iUnhappy = city.unhappyLevel(iExtra) if (iUnhappy > 0 and city.getHurryAngerTimer() > 0 and city.getHurryAngerTimer() % city.flatHurryAngerLength() == 0): iUnhappy -= 1 if (iUnhappy > 0 and city.getConscriptAngerTimer() and city.getConscriptAngerTimer() % city.flatConscriptAngerLength() == 0): iUnhappy -= 1 if (iUnhappy > 0 and city.getDefyResolutionAngerTimer() > 0 and city.getDefyResolutionAngerTimer() % city.flatDefyResolutionAngerLength() == 0): iUnhappy -= 1 if (iUnhappy > 0 and city.getEspionageHappinessCounter() > 0): iUnhappy -= 1 if (iHappy > 0 and city.getHappinessTimer() == 1): iHappy -= self.kiTempHappy if (iHappy < 0): iHappy = 0 if (iUnhappy < 0): iUnhappy = 0 return iHappy < iUnhappy
def _willPassTest(self, city): if (CityUtil.willGrowThisTurn(city)): iExtra = 1 elif (CityUtil.willShrinkThisTurn(city)): iExtra = -1 else: iExtra = 0 iHappy = city.happyLevel() iUnhappy = city.unhappyLevel(iExtra) if (iUnhappy > 0 and city.getHurryAngerTimer() > 0 and city.getHurryAngerTimer() % city.flatHurryAngerLength() == 0): iUnhappy -= 1 if (iUnhappy > 0 and city.getConscriptAngerTimer() and city.getConscriptAngerTimer() % city.flatConscriptAngerLength() == 0): iUnhappy -= 1 if (iUnhappy > 0 and city.getDefyResolutionAngerTimer() > 0 and city.getDefyResolutionAngerTimer() % city.flatDefyResolutionAngerLength() == 0): iUnhappy -= 1 if (iUnhappy > 0 and city.getEspionageHappinessCounter() > 0): iUnhappy -= 1 if (iHappy > 0 and city.getHappinessTimer() == 1): iHappy -= self.kiTempHappy if (iHappy < 0): iHappy = 0 if (iUnhappy < 0): iUnhappy = 0 return iHappy < iUnhappy
def checkCity(self, cityId, city, iPlayer, player): if Civ4lertsOpt.isShowCityPendingGrowthAlert(): if CityUtil.willGrowThisTurn(city): message = TRNSLTR.getText("TXT_KEY_CIV4LERTS_ON_CITY_PENDING_GROWTH", (city.getName(), city.getPopulation() + 1)) addMessageAtPlot(iPlayer, message, "Art/Interface/Symbols/Food/food05.dds", city.getX(), city.getY()) elif CityUtil.willShrinkThisTurn(city): message = TRNSLTR.getText("TXT_KEY_CIV4LERTS_ON_CITY_PENDING_SHRINKAGE", (city.getName(), city.getPopulation() - 1)) addMessageAtPlot(iPlayer, message, "Art/Interface/Symbols/Food/food05.dds", city.getX(), city.getY())
def _willPassTest(self, city): if (CityUtil.willGrowThisTurn(city)): iExtra = 1 elif (CityUtil.willShrinkThisTurn(city)): iExtra = -1 else: iExtra = 0 # badHealth() doesn't take iExtra! iHealthRate = city.healthRate(False, iExtra) if (city.getEspionageHealthCounter() > 0): iHealthRate += 1 return iHealthRate < 0
def _willPassTest(self, city): if (CityUtil.willGrowThisTurn(city)): iExtra = 1 elif (CityUtil.willShrinkThisTurn(city)): iExtra = -1 else: iExtra = 0 # badHealth() doesn't take iExtra! iHealthRate = city.healthRate(False, iExtra) if (city.getEspionageHealthCounter() > 0): iHealthRate += 1 return iHealthRate < 0
def checkCity(self, cityId, city, iPlayer, player): if (Civ4lertsOpt.isShowCityPendingGrowthAlert()): if (CityUtil.willGrowThisTurn(city)): message = localText.getText( "TXT_KEY_CIV4LERTS_ON_CITY_PENDING_GROWTH", (city.getName(), city.getPopulation() + 1)) icon = "Art/Interface/Symbols/Food/food05.dds" addMessageAtCity(iPlayer, message, icon, city) elif (CityUtil.willShrinkThisTurn(city)): message = localText.getText( "TXT_KEY_CIV4LERTS_ON_CITY_PENDING_SHRINKAGE", (city.getName(), city.getPopulation() - 1)) icon = "Art/Interface/Symbols/Food/food05.dds" addMessageAtCity(iPlayer, message, icon, city)
def checkCity(self, cityId, city, iPlayer, player): if (Civ4lertsOpt.isShowCityPendingGrowthAlert()): if (CityUtil.willGrowThisTurn(city)): if Civ4lertsOpt.isShowPendingPositive(): # advc.106d message = localText.getText( "TXT_KEY_CIV4LERTS_ON_CITY_PENDING_GROWTH", (city.getName(), city.getPopulation() + 1)) icon = "Art/Interface/Symbols/Food/food05.dds" addMessageAtCity(iPlayer, message, icon, city) elif (CityUtil.willShrinkThisTurn(city)): message = localText.getText( "TXT_KEY_CIV4LERTS_ON_CITY_PENDING_SHRINKAGE", (city.getName(), city.getPopulation() - 1)) icon = "Art/Interface/Symbols/Food/food05.dds" addMessageAtCity(iPlayer, message, icon, city)