Exemple #1
0
 public KingdomWarItemVMExtensionVM(StanceLink stanceLink, Action <KingdomWarItemVM> onSelect, Action <KingdomWarItemVM> onAction) : base(stanceLink, onSelect, onAction)
 {
     this.SendMessengerActionName = new TextObject("{=cXfcwzPp}Send Messenger").ToString();
     this.InfluenceCost           = (int)DiplomacyCostCalculator.DetermineInfluenceCostForMakingPeace(Faction1 as Kingdom);
     this.GoldCost   = DiplomacyCostCalculator.DetermineGoldCostForMakingPeace(this.Faction1 as Kingdom, this.Faction2 as Kingdom);
     this.ActionName = GameTexts.FindText("str_kingdom_propose_peace_action", null).ToString();
     UpdateDiplomacyProperties();
 }
Exemple #2
0
        public bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject textObject, bool forcePlayerCharacterCosts = false)
        {
            textObject = null;
            Hero heroPayingCosts = forcePlayerCharacterCosts ? Hero.MainHero : kingdom.Leader;
            bool hasEnoughGold   = heroPayingCosts.Gold >= DiplomacyCostCalculator.DetermineGoldCostForMakingPeace(kingdom, otherKingdom);

            if (!hasEnoughGold)
            {
                textObject = new TextObject(NOT_ENOUGH_GOLD);
            }
            return(hasEnoughGold);
        }