Ejemplo n.º 1
0
        public override GameSupportResult OnUpdate(GameState state)
        {
            if (_onceFlag)
            {
                return(GameSupportResult.DoNothing);
            }

            if (FirstMap.Contains(state.CurrentMap.ToLower()) && this._introIndex != -1)
            {
                var newIntro = state.GetEntInfoByIndex(_introIndex);

                if (newIntro.EntityPtr == IntPtr.Zero)
                {
                    _introIndex = -1;
                    _onceFlag   = true;
                    Debug.WriteLine("deepdown start");
                    return(GameSupportResult.PlayerGainedControl);
                }
            }
            else if (LastMap.Contains(state.CurrentMap.ToLower()))
            {
                float splitTime = state.FindOutputFireTime("AlyxWakeUp1", 7);

                if (_splitTime == 0f && splitTime != 0f)
                {
                    Debug.WriteLine("deepdown end");
                    _onceFlag  = true;
                    _splitTime = splitTime;
                    return(GameSupportResult.PlayerLostControl);
                }

                _splitTime = splitTime;
            }
            return(GameSupportResult.DoNothing);
        }
Ejemplo n.º 2
0
        // called on the first tick when player is fully in the game (according to demos)
        /// <summary>
        /// Actions to do when a new session starts and the player is fully in the game
        /// </summary>
        /// <param name="state">GameState</param>
        public virtual void OnSessionStart(GameState state)
        {
            _onceFlag = false;

            string map = _mapsLowercase ? state.CurrentMap.ToLower() : state.CurrentMap;

            this.IsFirstMap = FirstMap.Contains(map);
            this.IsLastMap  = LastMap.Contains(map);
        }