mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 06:51:30 -04:00
relationshipLevel() clean-up (#2627)
* Diplomacy Clean-up * Better formatting * Quickfix * Fix counterpoint
This commit is contained in:
parent
b3a7528818
commit
39e5d0df0f
@ -136,15 +136,12 @@ class DiplomacyManager() {
|
|||||||
if(civInfo.isPlayerCivilization())
|
if(civInfo.isPlayerCivilization())
|
||||||
return otherCiv().getDiplomacyManager(civInfo).relationshipLevel()
|
return otherCiv().getDiplomacyManager(civInfo).relationshipLevel()
|
||||||
|
|
||||||
if(civInfo.isCityState()){
|
if(civInfo.isCityState()) {
|
||||||
if (influence<=-60) return RelationshipLevel.Unforgivable
|
if(influence <= -60) return RelationshipLevel.Unforgivable
|
||||||
if (influence<=-30) return RelationshipLevel.Enemy
|
if(influence <= -30 || civInfo.isAtWarWith(otherCiv())) return RelationshipLevel.Enemy
|
||||||
|
|
||||||
if(civInfo.isAtWarWith(otherCiv()))
|
if(influence >= 60) return RelationshipLevel.Ally
|
||||||
return RelationshipLevel.Enemy // See below, same with major civs
|
if(influence >= 30) return RelationshipLevel.Friend
|
||||||
|
|
||||||
if(influence>=60) return RelationshipLevel.Ally
|
|
||||||
if(influence>=30) return RelationshipLevel.Friend
|
|
||||||
return RelationshipLevel.Neutral
|
return RelationshipLevel.Neutral
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,19 +149,16 @@ class DiplomacyManager() {
|
|||||||
// maybe we need to average their views of each other? That makes sense to me.
|
// maybe we need to average their views of each other? That makes sense to me.
|
||||||
|
|
||||||
val opinion = opinionOfOtherCiv()
|
val opinion = opinionOfOtherCiv()
|
||||||
if(opinion<=-80) return RelationshipLevel.Unforgivable
|
return when {
|
||||||
if(opinion<=-40) return RelationshipLevel.Enemy
|
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 */
|
||||||
// This is here because when you're at war you can either be enemy OR unforgivable,
|
opinion <= -15 -> RelationshipLevel.Competitor
|
||||||
// depending on the opinion
|
|
||||||
if(civInfo.isAtWarWith(otherCiv()))
|
opinion >= 80 -> RelationshipLevel.Ally
|
||||||
return RelationshipLevel.Enemy
|
opinion >= 40 -> RelationshipLevel.Friend
|
||||||
|
opinion >= 15 -> RelationshipLevel.Favorable
|
||||||
if(opinion<=-15) return RelationshipLevel.Competitor
|
else -> RelationshipLevel.Neutral
|
||||||
if(opinion>=80) return RelationshipLevel.Ally
|
}
|
||||||
if(opinion>=40) return RelationshipLevel.Friend
|
|
||||||
if(opinion>=15) return RelationshipLevel.Favorable
|
|
||||||
return RelationshipLevel.Neutral
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the number of turns to degrade from Ally or from Friend */
|
/** 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())
|
fun getCommonKnownCivs(): Set<CivilizationInfo> = civInfo.getKnownCivs().intersect(otherCiv().getKnownCivs())
|
||||||
|
|
||||||
/** Returns true when the [civInfo]'s territory is considered allied for [otherCiv].
|
/** Returns true when the [civInfo]'s territory is considered allied for [otherCiv].
|
||||||
*
|
|
||||||
* This includes friendly and allied city-states and the open border treaties.
|
* This includes friendly and allied city-states and the open border treaties.
|
||||||
*/
|
*/
|
||||||
fun isConsideredFriendlyTerritory(): Boolean {
|
fun isConsideredFriendlyTerritory(): Boolean {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user