mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-13 17:28:57 +07:00
AI war motivation taked relationship level into account
This commit is contained in:
@ -413,6 +413,7 @@ object NextTurnAutomation{
|
|||||||
val combatStrengthRatio = ourCombatStrength / theirCombatStrength
|
val combatStrengthRatio = ourCombatStrength / theirCombatStrength
|
||||||
val combatStrengthModifier = when {
|
val combatStrengthModifier = when {
|
||||||
combatStrengthRatio > 3f -> 30
|
combatStrengthRatio > 3f -> 30
|
||||||
|
combatStrengthRatio > 2.5f -> 25
|
||||||
combatStrengthRatio > 2f -> 20
|
combatStrengthRatio > 2f -> 20
|
||||||
combatStrengthRatio > 1.5f -> 10
|
combatStrengthRatio > 1.5f -> 10
|
||||||
else -> 0
|
else -> 0
|
||||||
@ -436,10 +437,23 @@ object NextTurnAutomation{
|
|||||||
if (!landPathBFS.hasReachedTile(theirCity.getCenterTile()))
|
if (!landPathBFS.hasReachedTile(theirCity.getCenterTile()))
|
||||||
modifierMap["No land path"] = -10
|
modifierMap["No land path"] = -10
|
||||||
|
|
||||||
if(civInfo.getDiplomacyManager(otherCiv).hasFlag(DiplomacyFlags.ResearchAgreement))
|
val diplomacyManager = civInfo.getDiplomacyManager(otherCiv)
|
||||||
|
if(diplomacyManager.hasFlag(DiplomacyFlags.ResearchAgreement))
|
||||||
modifierMap["Research Agreement"] = -5
|
modifierMap["Research Agreement"] = -5
|
||||||
|
|
||||||
if(civInfo.getDiplomacyManager(otherCiv).resourcesFromTrade().any { it.amount > 0 })
|
if(diplomacyManager.hasFlag(DiplomacyFlags.DeclarationOfFriendship))
|
||||||
|
modifierMap["Declaration of Friendship"] = -10
|
||||||
|
|
||||||
|
val relationshipModifier = when(diplomacyManager.relationshipLevel()){
|
||||||
|
RelationshipLevel.Unforgivable -> 10
|
||||||
|
RelationshipLevel.Enemy -> 5
|
||||||
|
RelationshipLevel.Ally -> -5 // this is so that ally + DoF is not too unbalanced -
|
||||||
|
// still possible for AI to declare war for isolated city
|
||||||
|
else -> 0
|
||||||
|
}
|
||||||
|
modifierMap["Relationship"] = relationshipModifier
|
||||||
|
|
||||||
|
if(diplomacyManager.resourcesFromTrade().any { it.amount > 0 })
|
||||||
modifierMap["Receiving trade resources"] = -5
|
modifierMap["Receiving trade resources"] = -5
|
||||||
|
|
||||||
if(theirCity.getTiles().none { it.neighbors.any { it.getOwner()==theirCity.civInfo && it.getCity() != theirCity } })
|
if(theirCity.getTiles().none { it.neighbors.any { it.getOwner()==theirCity.civInfo && it.getCity() != theirCity } })
|
||||||
|
Reference in New Issue
Block a user