示例#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();
 }
        public bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject textObject, bool forcePlayerCharacterCosts = false)
        {
            textObject = null;
            Hero heroPayingCosts    = forcePlayerCharacterCosts ? Hero.MainHero : kingdom.Leader;
            bool hasEnoughInfluence = heroPayingCosts.Clan.Influence >= DiplomacyCostCalculator.DetermineInfluenceCostForMakingPeace(kingdom);

            if (!hasEnoughInfluence)
            {
                textObject = new TextObject(NOT_ENOUGH_INFLUENCE);
            }
            return(hasEnoughInfluence);
        }