chore(modding): Rename Austrian unique to remove trailing dot

This commit is contained in:
yairm210
2025-01-11 19:40:45 +02:00
parent 714242aa4c
commit 39ebaad85a
4 changed files with 11 additions and 5 deletions

View File

@ -42,7 +42,7 @@ object UseGoldAutomation {
val knownCityStates = civ.getKnownCivs().filter { it.isCityState && MotivationToAttackAutomation.hasAtLeastMotivationToAttack(civ, it, 0f) <= 0 }.toList()
// canBeMarriedBy checks actual cost, but it can't be below 500*speedmodifier, and the later check is expensive
if (civ.gold >= 330 && civ.getHappiness() > 0 && civ.hasUnique(UniqueType.CityStateCanBeBoughtForGold)) {
if (civ.gold >= 330 && civ.getHappiness() > 0 && (civ.hasUnique(UniqueType.CityStateCanBeBoughtForGold) || civ.hasUnique(UniqueType.CityStateCanBeBoughtForGoldOld))) {
for (cityState in knownCityStates.toList() ) { // Materialize sequence as diplomaticMarriage may kill a CS
if (cityState.cityStateFunctions.canBeMarriedBy(civ))
cityState.cityStateFunctions.diplomaticMarriage(civ)

View File

@ -297,7 +297,7 @@ class CityStateFunctions(val civInfo: Civilization) {
)
newAllyCiv.cache.updateViewableTiles()
newAllyCiv.cache.updateCivResources()
for (unique in newAllyCiv.getMatchingUniques(UniqueType.CityStateCanBeBoughtForGold))
for (unique in newAllyCiv.getMatchingUniques(UniqueType.CityStateCanBeBoughtForGold) + newAllyCiv.getMatchingUniques(UniqueType.CityStateCanBeBoughtForGoldOld))
newAllyCiv.getDiplomacyManager(civInfo)!!.setFlag(DiplomacyFlags.MarriageCooldown, unique.params[0].toInt())
// Join the wars of our new ally - loop through all civs they are at war with
@ -363,7 +363,7 @@ class CityStateFunctions(val civInfo: Civilization) {
&& civInfo.cities.any()
&& civInfo.getDiplomacyManager(otherCiv)!!.isRelationshipLevelEQ(RelationshipLevel.Ally)
&& !otherCiv.getDiplomacyManager(civInfo)!!.hasFlag(DiplomacyFlags.MarriageCooldown)
&& otherCiv.getMatchingUniques(UniqueType.CityStateCanBeBoughtForGold).any()
&& (otherCiv.getMatchingUniques(UniqueType.CityStateCanBeBoughtForGold).any() || otherCiv.getMatchingUniques(UniqueType.CityStateCanBeBoughtForGoldOld).any())
&& otherCiv.gold >= getDiplomaticMarriageCost())
}

View File

@ -71,7 +71,13 @@ enum class UniqueType(
CityStateMoreGiftedUnits("Militaristic City-States grant units [amount] times as fast when you are at war with a common nation", UniqueTarget.Global),
CityStateGoldGiftsProvideMoreInfluence("Gifts of Gold to City-States generate [relativeAmount]% more Influence", UniqueTarget.Global),
CityStateCanBeBoughtForGold("Can spend Gold to annex or puppet a City-State that has been your ally for [amount] turns.", UniqueTarget.Global),
CityStateCanBeBoughtForGold("Can spend Gold to annex or puppet a City-State that has been your Ally for [amount] turns", UniqueTarget.Global),
@Deprecated("As of 4.15.2", ReplaceWith("Can spend Gold to annex or puppet a City-State that has been your Ally for [amount] turns"))
CityStateCanBeBoughtForGoldOld("Can spend Gold to annex or puppet a City-State that has been your ally for [amount] turns.", UniqueTarget.Global),
CityStateTerritoryAlwaysFriendly("City-State territory always counts as friendly territory", UniqueTarget.Global),
CityStateCanGiftGreatPeople("Allied City-States will occasionally gift Great People", UniqueTarget.Global), // used in Policy

View File

@ -306,7 +306,7 @@ class CityStateDiplomacyTable(private val diplomacyScreen: DiplomacyScreen) {
}
private fun getDiplomaticMarriageButton(otherCiv: Civilization): TextButton? {
if (!viewingCiv.hasUnique(UniqueType.CityStateCanBeBoughtForGold))
if (!viewingCiv.hasUnique(UniqueType.CityStateCanBeBoughtForGold) && !viewingCiv.hasUnique(UniqueType.CityStateCanBeBoughtForGoldOld))
return null
val diplomaticMarriageButton =