Пример #1
0
        public bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject textObject, bool forcePlayerCharacterCosts = false)
        {
            textObject = null;
            bool hasDeclareWarCooldown = CooldownManager.HasDeclareWarCooldown(kingdom, otherKingdom, out float elapsedTime);

            if (hasDeclareWarCooldown)
            {
                int declareWarCooldownDuration = Settings.Instance.DeclareWarCooldownInDays;

                textObject = new TextObject(DECLARE_WAR_COOLDOWN);
                textObject.SetTextVariable("ELAPSED_DAYS", (float)Math.Floor(elapsedTime));
                textObject.SetTextVariable("REQUIRED_DAYS", declareWarCooldownDuration);
            }
            return(!hasDeclareWarCooldown);
        }
Пример #2
0
        public bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject textObject, bool forcePlayerCharacterCosts = false, bool bypassCosts = false)
        {
            textObject = null;
            bool hasDeclareWarCooldown = CooldownManager.HasDeclareWarCooldown(kingdom, otherKingdom, out float elapsedTime);
            bool hasLowWarExhaustion   = true;

            if (Settings.Instance.EnableWarExhaustion)
            {
                hasLowWarExhaustion = WarExhaustionManager.Instance.HasLowWarExhaustion(kingdom, otherKingdom);
            }

            if (!hasLowWarExhaustion)
            {
                int lowWarExhaustionThreshold = (int)WarExhaustionManager.GetLowWarExhaustion();
                textObject = new TextObject(WAR_EXHAUSTION_TOO_HIGH);
                textObject.SetTextVariable("LOW_WAR_EXHAUSTION_THRESHOLD", lowWarExhaustionThreshold);
                textObject.SetTextVariable("CURRENT_WAR_EXHAUSTION", (int)Math.Ceiling(WarExhaustionManager.Instance.GetWarExhaustion(kingdom, otherKingdom)));
            }

            return(hasLowWarExhaustion);
        }
 public static bool ConsiderWarPatch(Clan clan, IFaction otherMapFaction)
 {
     return(!CooldownManager.HasDeclareWarCooldown(clan, otherMapFaction, out _));
 }
Пример #4
0
 private static bool ConsiderWarPrefix(Clan clan, IFaction otherMapFaction)
 => !CooldownManager.HasDeclareWarCooldown(clan, otherMapFaction, out _);