Пример #1
0
 public override void SyncData(IDataStore dataStore)
 {
     dataStore.SyncData("_warExhaustionManager", ref _warExhaustionManager);
     if (dataStore.IsLoading)
     {
         if (_warExhaustionManager == null)
         {
             this._warExhaustionManager = new WarExhaustionManager();
         }
         this._warExhaustionManager.Sync();
     }
 }
Пример #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);
        }
Пример #3
0
 public WarExhaustionBehavior()
 {
     _warExhaustionManager = new WarExhaustionManager();
 }