Added denunceation

This commit is contained in:
Yair Morgenstern 2019-06-01 23:20:02 +03:00
parent f60ebbb7e1
commit 36da3359db
3 changed files with 58 additions and 6 deletions

View File

@ -2589,6 +2589,14 @@
Portuguese:"Perfeito!" Portuguese:"Perfeito!"
} }
// Denunceation flavour texts
"Denounce ([numberOfTurns] turns)":{
}
"We will remember this.":{
}
// Relationship states, from worst (Unforgivable) to best (Ally) // Relationship states, from worst (Unforgivable) to best (Ally)
"Unforgivable":{ "Unforgivable":{
@ -2729,11 +2737,19 @@
} }
"Your so-called 'friendship' is worth nothing.":{ // When we have a decleration of friendship to someone and we declare war on them "Your so-called 'friendship' is worth nothing.":{ // When we have a decleration of friendship to someone and we declare war on them
Italian:"La tua cosiddetta 'amicizia' non vale nulla!" Italian:"La tua cosiddetta 'amicizia' non vale nulla!"
Portuguese:"Sua chamada 'amizade' não vale nada." Portuguese:"Sua chamada 'amizade' não vale nada."
} }
"You have publically denounced us!":{
}
"You have denounced our allies":{
}
"You have denounced our enemies":{
}
////// Overview screen ////// Overview screen

View File

@ -27,6 +27,7 @@ enum class DiplomacyFlags{
DeclinedPeace, DeclinedPeace,
DeclaredWar, DeclaredWar,
DeclarationOfFriendship, DeclarationOfFriendship,
Denunceation,
BorderConflict BorderConflict
} }
@ -36,11 +37,14 @@ enum class DiplomaticModifiers{
CapturedOurCities, CapturedOurCities,
DeclaredFriendshipWithOurEnemies, DeclaredFriendshipWithOurEnemies,
BetrayedDeclarationOfFriendship, BetrayedDeclarationOfFriendship,
Denunciation,
DenouncedOurAllies,
YearsOfPeace, YearsOfPeace,
SharedEnemy, SharedEnemy,
DeclarationOfFriendship, DeclarationOfFriendship,
DeclaredFriendshipWithOurAllies, DeclaredFriendshipWithOurAllies,
DenouncedOurEnemies,
OpenBorders OpenBorders
} }
@ -219,8 +223,10 @@ class DiplomacyManager() {
removeUntenebleTrades() removeUntenebleTrades()
updateHasOpenBorders() updateHasOpenBorders()
if(diplomaticStatus==DiplomaticStatus.Peace) if(diplomaticStatus==DiplomaticStatus.Peace) {
addModifier(DiplomaticModifiers.YearsOfPeace,0.5f) if(diplomaticModifiers[DiplomaticModifiers.YearsOfPeace.name]!! < 30)
addModifier(DiplomaticModifiers.YearsOfPeace, 0.5f)
}
else revertToZero(DiplomaticModifiers.YearsOfPeace,-0.5f) // war makes you forget the good ol' days else revertToZero(DiplomaticModifiers.YearsOfPeace,-0.5f) // war makes you forget the good ol' days
var openBorders = 0 var openBorders = 0
@ -351,12 +357,30 @@ class DiplomacyManager() {
if(thirdCiv==otherCiv() || !thirdCiv.knows(otherCivName)) continue if(thirdCiv==otherCiv() || !thirdCiv.knows(otherCivName)) continue
val thirdCivRelationshipWithOtherCiv = thirdCiv.getDiplomacyManager(otherCiv()).relationshipLevel() val thirdCivRelationshipWithOtherCiv = thirdCiv.getDiplomacyManager(otherCiv()).relationshipLevel()
when(thirdCivRelationshipWithOtherCiv){ when(thirdCivRelationshipWithOtherCiv){
RelationshipLevel.Unforgivable -> addModifier(DiplomaticModifiers.DeclaredFriendshipWithOurEnemies,15f) RelationshipLevel.Unforgivable -> addModifier(DiplomaticModifiers.DeclaredFriendshipWithOurEnemies,-15f)
RelationshipLevel.Enemy -> addModifier(DiplomaticModifiers.DeclaredFriendshipWithOurEnemies,5f) RelationshipLevel.Enemy -> addModifier(DiplomaticModifiers.DeclaredFriendshipWithOurEnemies,-5f)
RelationshipLevel.Friend -> addModifier(DiplomaticModifiers.DeclaredFriendshipWithOurAllies,5f) RelationshipLevel.Friend -> addModifier(DiplomaticModifiers.DeclaredFriendshipWithOurAllies,5f)
RelationshipLevel.Ally -> addModifier(DiplomaticModifiers.DeclaredFriendshipWithOurAllies,15f) RelationshipLevel.Ally -> addModifier(DiplomaticModifiers.DeclaredFriendshipWithOurAllies,15f)
} }
} }
} }
fun denounce(){
setModifier(DiplomaticModifiers.Denunciation,-35f)
otherCivDiplomacy().setModifier(DiplomaticModifiers.Denunciation,-35f)
setFlag(DiplomacyFlags.Denunceation,30)
otherCivDiplomacy().setFlag(DiplomacyFlags.Denunceation,30)
for(thirdCiv in civInfo.getKnownCivs().filter { it.isMajorCiv() }){
if(thirdCiv==otherCiv() || !thirdCiv.knows(otherCivName)) continue
val thirdCivRelationshipWithOtherCiv = thirdCiv.getDiplomacyManager(otherCiv()).relationshipLevel()
when(thirdCivRelationshipWithOtherCiv){
RelationshipLevel.Unforgivable -> addModifier(DiplomaticModifiers.DenouncedOurEnemies,15f)
RelationshipLevel.Enemy -> addModifier(DiplomaticModifiers.DenouncedOurEnemies,5f)
RelationshipLevel.Friend -> addModifier(DiplomaticModifiers.DenouncedOurAllies,-5f)
RelationshipLevel.Ally -> addModifier(DiplomaticModifiers.DenouncedOurAllies,-15f)
}
}
}
//endregion //endregion
} }

View File

@ -209,6 +209,15 @@ class DiplomacyScreen:CameraStageBaseScreen() {
diplomacyTable.add(declareFriendshipButton).row() diplomacyTable.add(declareFriendshipButton).row()
} }
if(!diplomacyManager.hasFlag(DiplomacyFlags.Denunceation)){
val denounceButton = TextButton("Denounce ([30] turns)".tr(),skin)
denounceButton.onClick {
diplomacyManager.denounce()
setRightSideFlavorText(otherCiv,"We will remember this.".tr(),"Very well.".tr())
}
diplomacyTable.add(denounceButton).row()
}
val declareWarButton = getDeclareWarButton(diplomacyManager, otherCiv) val declareWarButton = getDeclareWarButton(diplomacyManager, otherCiv)
diplomacyTable.add(declareWarButton).row() diplomacyTable.add(declareWarButton).row()
} }
@ -229,6 +238,9 @@ class DiplomacyScreen:CameraStageBaseScreen() {
DeclaredFriendshipWithOurAllies -> "You have declared friendship with our allies" DeclaredFriendshipWithOurAllies -> "You have declared friendship with our allies"
OpenBorders -> "Our open borders have brought us closer together." OpenBorders -> "Our open borders have brought us closer together."
BetrayedDeclarationOfFriendship -> "Your so-called 'friendship' is worth nothing." BetrayedDeclarationOfFriendship -> "Your so-called 'friendship' is worth nothing."
Denunciation -> "You have publically denounced us!"
DenouncedOurAllies -> "You have denounced our allies"
DenouncedOurEnemies -> "You have denounced our enemies"
} }
text = text.tr() + " " text = text.tr() + " "
if (modifier.value > 0) text += "+" if (modifier.value > 0) text += "+"