relationshipLevel() clean-up (#2627)
* Diplomacy Clean-up * Better formatting * Quickfix * Fix counterpoint
This commit is contained in:
parent
b3a7528818
commit
39e5d0df0f
1 changed files with 15 additions and 22 deletions
|
@ -136,15 +136,12 @@ class DiplomacyManager() {
|
|||
if(civInfo.isPlayerCivilization())
|
||||
return otherCiv().getDiplomacyManager(civInfo).relationshipLevel()
|
||||
|
||||
if(civInfo.isCityState()){
|
||||
if (influence<=-60) return RelationshipLevel.Unforgivable
|
||||
if (influence<=-30) return RelationshipLevel.Enemy
|
||||
if(civInfo.isCityState()) {
|
||||
if(influence <= -60) return RelationshipLevel.Unforgivable
|
||||
if(influence <= -30 || civInfo.isAtWarWith(otherCiv())) return RelationshipLevel.Enemy
|
||||
|
||||
if(civInfo.isAtWarWith(otherCiv()))
|
||||
return RelationshipLevel.Enemy // See below, same with major civs
|
||||
|
||||
if(influence>=60) return RelationshipLevel.Ally
|
||||
if(influence>=30) return RelationshipLevel.Friend
|
||||
if(influence >= 60) return RelationshipLevel.Ally
|
||||
if(influence >= 30) return RelationshipLevel.Friend
|
||||
return RelationshipLevel.Neutral
|
||||
}
|
||||
|
||||
|
@ -152,19 +149,16 @@ class DiplomacyManager() {
|
|||
// maybe we need to average their views of each other? That makes sense to me.
|
||||
|
||||
val opinion = opinionOfOtherCiv()
|
||||
if(opinion<=-80) return RelationshipLevel.Unforgivable
|
||||
if(opinion<=-40) return RelationshipLevel.Enemy
|
||||
|
||||
// This is here because when you're at war you can either be enemy OR unforgivable,
|
||||
// depending on the opinion
|
||||
if(civInfo.isAtWarWith(otherCiv()))
|
||||
return RelationshipLevel.Enemy
|
||||
|
||||
if(opinion<=-15) return RelationshipLevel.Competitor
|
||||
if(opinion>=80) return RelationshipLevel.Ally
|
||||
if(opinion>=40) return RelationshipLevel.Friend
|
||||
if(opinion>=15) return RelationshipLevel.Favorable
|
||||
return RelationshipLevel.Neutral
|
||||
return when {
|
||||
opinion <= -80 -> RelationshipLevel.Unforgivable
|
||||
opinion <= -40 || civInfo.isAtWarWith(otherCiv()) -> RelationshipLevel.Enemy /* During wartime, the estimation in which you are held may be enemy OR unforgivable */
|
||||
opinion <= -15 -> RelationshipLevel.Competitor
|
||||
|
||||
opinion >= 80 -> RelationshipLevel.Ally
|
||||
opinion >= 40 -> RelationshipLevel.Friend
|
||||
opinion >= 15 -> RelationshipLevel.Favorable
|
||||
else -> RelationshipLevel.Neutral
|
||||
}
|
||||
}
|
||||
|
||||
/** Returns the number of turns to degrade from Ally or from Friend */
|
||||
|
@ -233,7 +227,6 @@ class DiplomacyManager() {
|
|||
fun getCommonKnownCivs(): Set<CivilizationInfo> = civInfo.getKnownCivs().intersect(otherCiv().getKnownCivs())
|
||||
|
||||
/** Returns true when the [civInfo]'s territory is considered allied for [otherCiv].
|
||||
*
|
||||
* This includes friendly and allied city-states and the open border treaties.
|
||||
*/
|
||||
fun isConsideredFriendlyTerritory(): Boolean {
|
||||
|
|
Loading…
Reference in a new issue