After-combat notification for promotable units - see #4697

This commit is contained in:
Yair Morgenstern 2022-12-03 23:12:01 +02:00
parent c9ed9d5d74
commit 1d5d445c19
3 changed files with 5 additions and 4 deletions

View File

@ -817,6 +817,7 @@ We have captured a barbarian encampment and recovered [goldAmount] gold! =
An enemy [unitType] has joined us! =
After an unknown civilization entered the [eraName], we have recruited [spyName] as a spy! =
We have recruited [spyName] as a spy! =
[unitName] can be promoted! =
# This might be needed for a rewrite of Germany's unique - see #7376
A barbarian [unitType] has joined us! =

View File

@ -483,10 +483,8 @@ object Battle {
if (thisCombatant !is MapUnitCombatant) return
val modConstants = thisCombatant.unit.civInfo.gameInfo.ruleSet.modOptions.constants
if (thisCombatant.unit.promotions.totalXpProduced() >= modConstants.maxXPfromBarbarians
&& otherCombatant.getCivInfo().isBarbarian()
) {
&& otherCombatant.getCivInfo().isBarbarian())
return
}
val stateForConditionals = StateForConditionals(civInfo = thisCombatant.getCivInfo(), ourCombatant = thisCombatant, theirCombatant = otherCombatant)
@ -515,6 +513,9 @@ object Battle {
val greatGeneralPointsGained = (xpGained * greatGeneralPointsModifier).toInt()
thisCombatant.getCivInfo().greatPeople.greatGeneralPoints += greatGeneralPointsGained
}
if (!thisCombatant.isDefeated() && thisCombatant.unit.promotions.canBePromoted())
thisCombatant.getCivInfo().addNotification("[${thisCombatant.unit.name}] can be promoted!",thisCombatant.getTile().position, thisCombatant.unit.name)
}
private fun conquerCity(city: CityInfo, attacker: MapUnitCombatant) {

View File

@ -96,7 +96,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
// Stat percentage boosts
StatPercentBonus("[relativeAmount]% [stat]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
StatPercentBonusCities("[relativeAmount]% [stat] [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
// Todo: Add support for specialist next to buildingName
StatPercentFromObject("[relativeAmount]% [stat] from every [tileFilter/buildingFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
AllStatsPercentFromObject("[relativeAmount]% Yield from every [tileFilter/buildingFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
StatPercentFromReligionFollowers("[relativeAmount]% [stat] from every follower, up to [relativeAmount]%", UniqueTarget.FollowerBelief),