protected override bool ApplyConditionInternal(Kingdom kingdom, Kingdom otherKingdom, ref TextObject textObject, bool forcePlayerCharacterCosts = false)
        {
            bool hasEnoughGold = DiplomacyCostCalculator.DetermineCostForMakingPeace(kingdom, otherKingdom, forcePlayerCharacterCosts).GoldCost.CanPayCost();

            if (!hasEnoughGold)
            {
                textObject = FailedConditionText;
            }
            return(hasEnoughGold);
        }
        public KingdomWarItemVMExtensionVM(StanceLink stanceLink, Action <KingdomWarItemVM> onSelect, Action <KingdomWarItemVM> onAction) : base(stanceLink, onSelect, onAction)
        {
            this.SendMessengerActionName = new TextObject("{=cXfcwzPp}Send Messenger").ToString();
            HybridCost costForMakingPeace = DiplomacyCostCalculator.DetermineCostForMakingPeace(Faction1 as Kingdom, Faction2 as Kingdom, true);

            this.InfluenceCost = (int)costForMakingPeace.InfluenceCost.Value;
            this.GoldCost      = (int)costForMakingPeace.GoldCost.Value;
            this.ActionName    = GameTexts.FindText("str_kingdom_propose_peace_action", null).ToString();
            this.AllianceText  = new TextObject("{=zpNalMeA}Alliances").ToString();
            this.WarsText      = new TextObject("{=y5tXjbLK}Wars").ToString();
            this.PactsText     = new TextObject("{=noWHMN1W}Non-Aggression Pacts").ToString();
            UpdateDiplomacyProperties();
        }
Esempio n. 3
0
        public static void ApplyPeace(Kingdom kingdomMakingPeace, Kingdom otherKingdom, bool forcePlayerCharacterCosts = false)
        {
            HybridCost diplomacyCost = DiplomacyCostCalculator.DetermineCostForMakingPeace(kingdomMakingPeace, otherKingdom, forcePlayerCharacterCosts);

            if (!otherKingdom.Leader.IsHumanPlayerCharacter)
            {
                AcceptPeace(kingdomMakingPeace, otherKingdom, diplomacyCost);
            }
            else if (!CooldownManager.HasPeaceProposalCooldownWithPlayerKingdom(kingdomMakingPeace))
            {
                CreatePeaceInquiry(kingdomMakingPeace, otherKingdom, diplomacyCost);
            }
        }