Resolved #2071 - AI will wait 20 turns between proposing research agreements if declined
This commit is contained in:
parent
2cf5645629
commit
97a07d3530
3 changed files with 5 additions and 1 deletions
|
@ -319,7 +319,8 @@ class NextTurnAutomation{
|
|||
|
||||
val canSignResearchAgreementCiv = civInfo.getKnownCivs()
|
||||
.asSequence()
|
||||
.filter { civInfo.canSignResearchAgreementsWith(it) }
|
||||
.filter { civInfo.canSignResearchAgreementsWith(it)
|
||||
&& !civInfo.getDiplomacyManager(it).hasFlag(DiplomacyFlags.DeclinedResearchAgreement) }
|
||||
.sortedByDescending { it.statsForNextTurn.science }
|
||||
|
||||
val duration = when(civInfo.gameInfo.gameParameters.gameSpeed) {
|
||||
|
|
|
@ -23,6 +23,7 @@ enum class RelationshipLevel{
|
|||
enum class DiplomacyFlags{
|
||||
DeclinedLuxExchange,
|
||||
DeclinedPeace,
|
||||
DeclinedResearchAgreement,
|
||||
DeclaredWar,
|
||||
DeclarationOfFriendship,
|
||||
ResearchAgreement,
|
||||
|
|
|
@ -69,6 +69,8 @@ class TradePopup(worldScreen: WorldScreen): Popup(worldScreen){
|
|||
val diplomacyManager = requestingCiv.getDiplomacyManager(viewingCiv)
|
||||
if(trade.ourOffers.all { it.type==TradeType.Luxury_Resource } && trade.theirOffers.all { it.type==TradeType.Luxury_Resource })
|
||||
diplomacyManager.setFlag(DiplomacyFlags.DeclinedLuxExchange,20) // offer again in 20 turns
|
||||
if(trade.ourOffers.any { it.type==TradeType.Agreement && it.name==Constants.researchAgreement })
|
||||
diplomacyManager.setFlag(DiplomacyFlags.DeclinedResearchAgreement,20) // offer again in 20 turns
|
||||
|
||||
if(trade.ourOffers.any{ it.type==TradeType.Treaty && it.name== Constants.peaceTreaty })
|
||||
diplomacyManager.setFlag(DiplomacyFlags.DeclinedPeace,5)
|
||||
|
|
Loading…
Reference in a new issue