public EncyclopediaHeroPageVMExtensionVM(EncyclopediaPageArgs args) : base(args)
 {
     _grantFiefInterface = new GrantFiefInterface();
     _hero = (Obj as Hero) !;
     _sendMessengerCost      = DiplomacyCostCalculator.DetermineCostForSendingMessenger();
     SendMessengerCost       = (int)_sendMessengerCost.Value;
     SendMessengerActionName = new TextObject("{=cXfcwzPp}Send Messenger").ToString();
     GrantFiefActionName     = new TextObject("{=LpoyhORp}Grant Fief").ToString();
     RefreshValues();
 }
        protected override bool ApplyConditionInternal(Kingdom kingdom, Kingdom otherKingdom, ref TextObject?textObject, bool forcePlayerCharacterCosts = false)
        {
            DiplomacyCost influenceCost      = DiplomacyCostCalculator.DetermineCostForFormingNonAggressionPact(kingdom, otherKingdom, forcePlayerCharacterCosts).InfluenceCost;
            var           hasEnoughInfluence = influenceCost.CanPayCost();

            if (!hasEnoughInfluence)
            {
                textObject = FailedConditionText;
            }

            return(hasEnoughInfluence);
        }
Example #3
0
        public static bool CanSendMessengerWithCost(Hero opposingLeader, DiplomacyCost diplomacyCost)
        {
            var canPayCost = diplomacyCost.CanPayCost();

            return(canPayCost && IsTargetHeroAvailable(opposingLeader));
        }
Example #4
0
 public void SendMessengerWithCost(Hero targetHero, DiplomacyCost diplomacyCost)
 {
     diplomacyCost.ApplyCost();
     SendMessenger(targetHero);
 }
 private static void AcceptPeace(Kingdom kingdomMakingPeace, Kingdom otherKingdom, DiplomacyCost diplomacyCost)
 {
     LogFactory.Get <KingdomPeaceAction>()
     .LogTrace($"[{CampaignTime.Now}] {kingdomMakingPeace.Name} secured peace with {otherKingdom.Name} (cost: {diplomacyCost.Value}).");
     diplomacyCost.ApplyCost();
     MakePeaceAction.Apply(kingdomMakingPeace, otherKingdom);
 }
Example #6
0
 private static void AcceptPeace(Kingdom kingdomMakingPeace, Kingdom otherKingdom, DiplomacyCost diplomacyCost)
 {
     diplomacyCost.ApplyCost();
     MakePeaceAction.Apply(kingdomMakingPeace, otherKingdom);
 }