Ejemplo n.º 1
0
        private void UpdateActionAvailability()
        {
            this.IsMessengerAvailable = MessengerManager.CanSendMessengerWithInfluenceCost(Faction2Leader.Hero, this.SendMessengerInfluenceCost);
            this.IsOptionAvailable    = WarAndPeaceConditions.CanMakePeaceExceptions(this).IsEmpty();
            string makePeaceException = WarAndPeaceConditions.CanMakePeaceExceptions(this).FirstOrDefault()?.ToString();

            this.ActionHint = makePeaceException != null ? new HintViewModel(makePeaceException) : new HintViewModel();
        }
Ejemplo n.º 2
0
        protected virtual void UpdateActionAvailability()
        {
            this.IsMessengerAvailable = MessengerManager.CanSendMessengerWithInfluenceCost(Faction2Leader.Hero, this.SendMessengerInfluenceCost);
            this.IsOptionAvailable    = WarAndPeaceConditions.CanDeclareWarExceptions(this).IsEmpty();
            string allianceException = AllianceConditions.CanFormAllianceExceptions(this, true).FirstOrDefault()?.ToString();

            this.IsAllianceAvailable = allianceException == null;
            string declareWarException = WarAndPeaceConditions.CanDeclareWarExceptions(this).FirstOrDefault()?.ToString();

            this.ActionHint            = declareWarException != null ? new HintViewModel(declareWarException) : new HintViewModel();
            this.AllianceHint          = allianceException != null ? new HintViewModel(allianceException) : new HintViewModel();
            this.AllianceInfluenceCost = (int)DiplomacyCostCalculator.DetermineInfluenceCostForFormingAlliance(Faction1 as Kingdom, Faction2 as Kingdom, true);
        }
        public static bool ConsiderWarDecisionPatch(Clan clan, Kingdom kingdom, IFaction otherFaction, bool __result)
        {
            Kingdom otherKingdom = otherFaction as Kingdom;

            if (otherKingdom != null && !WarAndPeaceConditions.CanDeclareWar(kingdom, otherKingdom))
            {
                __result = false;
                return(false);
            }
            else
            {
                return(true);
            }
        }
        public static bool ConsiderPeacePatch(Clan clan, Clan otherClan, Kingdom kingdom, IFaction otherFaction, out MakePeaceKingdomDecision decision, bool __result)
        {
            decision = null;
            Kingdom otherKingdom = otherFaction as Kingdom;

            if (otherKingdom != null && !WarAndPeaceConditions.CanProposePeace(kingdom, otherKingdom))
            {
                __result = false;
                return(false);
            }
            else
            {
                return(true);
            }
        }