Example #1
0
        public bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject?textObject, bool forcePlayerCharacterCosts = false, bool bypassCosts = false)
        {
            textObject = null;
            var hasEnoughTimeElapsed = !CooldownManager.HasBreakAllianceCooldown(kingdom, otherKingdom, out var elapsedDaysUntilNow);

            if (!hasEnoughTimeElapsed)
            {
                textObject = new TextObject(TOO_SOON);
                textObject.SetTextVariable("ELAPSED_DAYS", (float)Math.Floor(elapsedDaysUntilNow));
                textObject.SetTextVariable("REQUIRED_DAYS", Settings.Instance !.MinimumAllianceDuration);
            }

            return(hasEnoughTimeElapsed);
        }