Esempio n. 1
0
        /// <summary>
        ///     Sets the guard remaining seconds.
        /// </summary>
        public void SetGuardRemainingSeconds(int secs)
        {
            this._guardTime = LogicTime.GetSecondsInTicks(secs);

            int logicTime      = this._level.GetLogicTime();
            int startGuardTime = logicTime;

            if (this._shieldTime >= logicTime)
            {
                startGuardTime = this._shieldTime;
            }

            this._startGuardTime = startGuardTime;
        }
Esempio n. 2
0
        public void SetShieldRemainingSeconds(int secs)
        {
            this.m_shieldTime = LogicTime.GetSecondsInTicks(secs) + this.m_level.GetLogicTime().GetTick();

            int logicTime      = this.m_level.GetLogicTime().GetTick();
            int startGuardTime = this.m_shieldTime;

            if (this.m_shieldTime < logicTime)
            {
                startGuardTime = logicTime;
            }

            this.m_startGuardTime = startGuardTime;
        }
Esempio n. 3
0
        /// <summary>
        ///     Loads the home state.
        /// </summary>
        public void LoadHomeState(LogicClientHome home, LogicAvatar homeOwnerAvatar, int currentTimestamp, int secondsSinceLastSave, int secondsSinceLastMaintenance)
        {
            if (home != null)
            {
                this._state = 1;

                if (LogicDataTables.GetGlobals().StartInLastUsedVillage())
                {
                    int lastUsedVillage = homeOwnerAvatar.GetVillageToGoTo();

                    if (!this._level.GetMissionManager().HasTravel(homeOwnerAvatar))
                    {
                        lastUsedVillage = 0;
                    }

                    if (lastUsedVillage < 0)
                    {
                        Debugger.Warning("VillageToGoTo<0");
                    }
                    else
                    {
                        if (lastUsedVillage > 1)
                        {
                            Debugger.Warning("VillageToGoTo too big");
                        }
                        else
                        {
                            this._level.SetVillageType(lastUsedVillage);
                        }
                    }
                }

                this._secondsSinceLastMaintenance = secondsSinceLastMaintenance;
                this._currentTimestamp            = currentTimestamp;
                this._configuration.Load((LogicJSONObject)LogicJSONParser.Parse(home.GetGlobalJSON()));
                this._calendar.Load(home.GetCalendarJSON(), currentTimestamp);

                if (this._battleTimer != null)
                {
                    this._battleTimer.Destruct();
                    this._battleTimer = null;
                }

                this._level.SetHome(home, true);
                this._level.SetHomeOwnerAvatar(homeOwnerAvatar);
                this._level.FastForwardTime(secondsSinceLastSave);

                homeOwnerAvatar.SetLevel(this._level);

                this._level.LoadingFinished();

                this._shieldTime      = LogicTime.GetSecondsInTicks(home.GetShieldDurationSeconds());
                this._guardTime       = LogicTime.GetSecondsInTicks(home.GetGuardDurationSeconds());
                this._maintenanceTime = LogicTime.GetSecondsInTicks(home.GetNextMaintenanceSeconds());

                int logicTime      = this._level.GetLogicTime();
                int startGuardTime = logicTime;

                if (this._shieldTime >= logicTime)
                {
                    startGuardTime = this._shieldTime;
                }

                this._startGuardTime = startGuardTime;

                if (LogicDataTables.GetGlobals().UseVillageObjects())
                {
                    this._level.LoadVillageObjects();
                }
            }
        }
Esempio n. 4
0
 /// <summary>
 ///     Sets the maintenance remaining seconds.
 /// </summary>
 public void SetMaintenanceRemainingSeconds(int secs)
 {
     this._maintenanceTime = LogicTime.GetSecondsInTicks(secs) + this._level.GetLogicTime();
 }
Esempio n. 5
0
 public void SetPersonalBreakCooldownSeconds(int secs)
 {
     this.m_personalBreakTime = LogicTime.GetSecondsInTicks(secs) + this.m_level.GetLogicTime().GetTick();
 }