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

            if (!hasEnoughInfluence)
            {
                textObject = FailedConditionText;
            }
            return(hasEnoughInfluence);
        }
示例#2
0
        public KingdomTruceItemVMExtensionVM(IFaction faction1, IFaction faction2, Action <KingdomDiplomacyItemVM> onSelection, Action <KingdomTruceItemVM> onAction) : base(faction1, faction2, onSelection, onAction)
        {
            this.SendMessengerActionName = new TextObject("{=cXfcwzPp}Send Messenger").ToString();
            this.AllianceActionName      = new TextObject("{=0WPWbx70}Form Alliance").ToString();
            this.InfluenceCost           = (int)DiplomacyCostCalculator.DetermineCostForDeclaringWar(Faction1 as Kingdom, true).Value;
            this.ActionName = GameTexts.FindText("str_kingdom_declate_war_action", null).ToString();
            this.NonAggressionPactActionName = new TextObject("{=9pY0NQrk}Form Pact").ToString();

            TextObject textObject = new TextObject("{=9zlQNtlX}Form a non-aggression pact lasting {PACT_DURATION_DAYS} days.");

            textObject.SetTextVariable("PACT_DURATION_DAYS", Settings.Instance.NonAggressionPactDuration);
            this.NonAggressionPactHelpText = textObject.ToString();

            this.AllianceText = new TextObject("{=zpNalMeA}Alliances").ToString();
            this.WarsText     = new TextObject("{=y5tXjbLK}Wars").ToString();
            this.PactsText    = new TextObject(StringConstants.NonAggressionPacts).ToString();
            UpdateDiplomacyProperties();
        }
示例#3
0
 protected virtual void ExecuteExecutiveAction()
 {
     DiplomacyCostCalculator.DetermineCostForDeclaringWar(Faction1 as Kingdom, true).ApplyCost();
     DeclareWarAction.Apply(Faction1, Faction2);
 }