mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-10 12:51:16 +07:00
Warmongering doesn't apply to civs that are angry at the target civ (#11874)
* Team war now applies warmongering * Shared war now applies to team war
This commit is contained in:
parent
dc09ab883b
commit
15d532e287
@ -36,7 +36,7 @@ object DeclareWar {
|
||||
onWarDeclared(diplomacyManager, true)
|
||||
onWarDeclared(otherCivDiplomacy, false)
|
||||
|
||||
changeOpinions(diplomacyManager, declareWarReason.warType)
|
||||
changeOpinions(diplomacyManager, declareWarReason)
|
||||
|
||||
breakTreaties(diplomacyManager)
|
||||
|
||||
@ -164,27 +164,31 @@ object DeclareWar {
|
||||
diplomacyManager.removeFlag(DiplomacyFlags.BorderConflict)
|
||||
}
|
||||
|
||||
private fun changeOpinions(diplomacyManager: DiplomacyManager, warType: WarType) {
|
||||
private fun changeOpinions(diplomacyManager: DiplomacyManager, declareWarReason: DeclareWarReason) {
|
||||
val civInfo = diplomacyManager.civInfo
|
||||
val otherCiv = diplomacyManager.otherCiv()
|
||||
val otherCivDiplomacy = diplomacyManager.otherCivDiplomacy()
|
||||
val warType = declareWarReason.warType
|
||||
|
||||
otherCivDiplomacy.setModifier(DiplomaticModifiers.DeclaredWarOnUs, -20f)
|
||||
otherCivDiplomacy.removeModifier(DiplomaticModifiers.ReturnedCapturedUnits)
|
||||
|
||||
// Apply warmongering
|
||||
if (warType == WarType.DirectWar || warType == WarType.JoinWar) {
|
||||
if (warType == WarType.DirectWar || warType == WarType.JoinWar || warType == WarType.TeamWar) {
|
||||
for (thirdCiv in civInfo.getKnownCivs()) {
|
||||
if (!thirdCiv.isAtWarWith(otherCiv))
|
||||
// We don't want this modify to stack if there is a defensive pact
|
||||
if (!thirdCiv.isAtWarWith(otherCiv)
|
||||
&& thirdCiv.getDiplomacyManager(otherCiv)?.isRelationshipLevelGT(RelationshipLevel.Competitor) != false
|
||||
&& thirdCiv != declareWarReason.allyCiv) {
|
||||
// We don't want this modify to stack if there is a defensive pact
|
||||
thirdCiv.getDiplomacyManager(civInfo)!!
|
||||
.addModifier(DiplomaticModifiers.WarMongerer, -5f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Apply shared enemy modifiers
|
||||
for (thirdCiv in diplomacyManager.getCommonKnownCivs()) {
|
||||
if (thirdCiv.isAtWarWith(otherCiv) && !thirdCiv.isAtWarWith(civInfo)) {
|
||||
if ((thirdCiv.isAtWarWith(otherCiv) || thirdCiv == declareWarReason.allyCiv) && !thirdCiv.isAtWarWith(civInfo)) {
|
||||
// Improve our relations
|
||||
if (thirdCiv.isCityState) thirdCiv.getDiplomacyManager(civInfo)!!.addInfluence(10f)
|
||||
else thirdCiv.getDiplomacyManager(civInfo)!!.addModifier(DiplomaticModifiers.SharedEnemy, 5f * civInfo.getPersonality().modifierFocus(PersonalityValue.Loyal, .3f))
|
||||
|
Loading…
Reference in New Issue
Block a user