mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 15:29:32 +07:00
Resolved #8759 - 'upon declaring friendship' triggers for both sides
This commit is contained in:
@ -247,7 +247,7 @@ object NextTurnAutomation {
|
||||
}
|
||||
|
||||
private fun respondToPopupAlerts(civInfo: Civilization) {
|
||||
for (popupAlert in civInfo.popupAlerts) {
|
||||
for (popupAlert in civInfo.popupAlerts.toList()) { // toList because this can trigger other things that give alerts, like Golden Age
|
||||
if (popupAlert.type == AlertType.DemandToStopSettlingCitiesNear) { // we're called upon to make a decision
|
||||
val demandingCiv = civInfo.gameInfo.getCivilization(popupAlert.value)
|
||||
val diploManager = civInfo.getDiplomacyManager(demandingCiv)
|
||||
|
@ -7,7 +7,6 @@ import com.unciv.logic.civilization.AlertType
|
||||
import com.unciv.logic.civilization.Civilization
|
||||
import com.unciv.logic.civilization.NotificationCategory
|
||||
import com.unciv.logic.civilization.NotificationIcon
|
||||
import com.unciv.logic.civilization.PlayerType
|
||||
import com.unciv.logic.civilization.PopupAlert
|
||||
import com.unciv.logic.trade.Trade
|
||||
import com.unciv.logic.trade.TradeOffer
|
||||
@ -822,10 +821,6 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
|
||||
setFlag(DiplomacyFlags.DeclarationOfFriendship, 30)
|
||||
otherCivDiplomacy().setFlag(DiplomacyFlags.DeclarationOfFriendship, 30)
|
||||
|
||||
if (otherCiv().playerType == PlayerType.Human)
|
||||
otherCiv().addNotification("[${civInfo.civName}] and [$otherCivName] have signed the Declaration of Friendship!",
|
||||
NotificationCategory.Diplomacy, civInfo.civName, NotificationIcon.Diplomacy, otherCivName)
|
||||
|
||||
for (thirdCiv in getCommonKnownCivs().filter { it.isMajorCiv() }) {
|
||||
thirdCiv.addNotification("[${civInfo.civName}] and [$otherCivName] have signed the Declaration of Friendship!",
|
||||
NotificationCategory.Diplomacy, civInfo.civName, NotificationIcon.Diplomacy, otherCivName)
|
||||
@ -834,6 +829,8 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
|
||||
|
||||
for (unique in civInfo.getTriggeredUniques(UniqueType.TriggerUponDeclaringFriendship))
|
||||
UniqueTriggerActivation.triggerCivwideUnique(unique, civInfo)
|
||||
for (unique in otherCiv().getTriggeredUniques(UniqueType.TriggerUponDeclaringFriendship))
|
||||
UniqueTriggerActivation.triggerCivwideUnique(unique, otherCiv())
|
||||
}
|
||||
|
||||
private fun setFriendshipBasedModifier() {
|
||||
|
Reference in New Issue
Block a user