mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 15:01:09 -04:00
AI is willing to trade Open Borders when unfriendly... for ridiculous prices
This commit is contained in:
parent
08d0a0013c
commit
1898c6f9f1
@ -179,7 +179,15 @@ class TradeEvaluation{
|
||||
return sumOfStats.toInt() * 100
|
||||
}
|
||||
TradeType.Agreement -> {
|
||||
if(offer.name == "Open Borders") return 100
|
||||
if(offer.name == "Open Borders"){
|
||||
when(civInfo.getDiplomacyManager(tradePartner).relationshipLevel()){
|
||||
RelationshipLevel.Unforgivable -> return 10000
|
||||
RelationshipLevel.Enemy -> return 2000
|
||||
RelationshipLevel.Competitor -> return 500
|
||||
RelationshipLevel.Neutral -> return 200
|
||||
RelationshipLevel.Favorable,RelationshipLevel.Friend,RelationshipLevel.Ally -> return 100
|
||||
}
|
||||
}
|
||||
throw Exception("Invalid agreement type!")
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package com.unciv.logic.trade
|
||||
import com.unciv.Constants
|
||||
import com.unciv.logic.civilization.CivilizationInfo
|
||||
import com.unciv.logic.civilization.diplomacy.DiplomaticStatus
|
||||
import com.unciv.logic.civilization.diplomacy.RelationshipLevel
|
||||
import com.unciv.models.gamebasics.tile.ResourceType
|
||||
import com.unciv.models.gamebasics.tr
|
||||
|
||||
@ -26,8 +25,7 @@ class TradeLogic(val ourCivilization:CivilizationInfo, val otherCivilization: Ci
|
||||
&& otherCivilization.tech.getTechUniques().contains("Enables Open Borders agreements")) {
|
||||
val relationshipLevel = otherCivilization.getDiplomacyManager(civInfo).relationshipLevel()
|
||||
|
||||
if(relationshipLevel >= RelationshipLevel.Neutral)
|
||||
offers.add(TradeOffer("Open Borders", TradeType.Agreement, 30))
|
||||
offers.add(TradeOffer("Open Borders", TradeType.Agreement, 30))
|
||||
}
|
||||
|
||||
for(entry in civInfo.getCivResources()
|
||||
|
Loading…
x
Reference in New Issue
Block a user