コード例 #1
0
    public void Update()
    {
        if (GameGlobals.TestGameEvent(Types.s_iGE_FirstSpawners))
        {
            return;
        }

        // If we don't have objects...
        bool bHaveObjects = false;

        foreach (GameObject go in m_aRoomObjects)
        {
            if (null != go)
            {
                bHaveObjects = true;
            }
        }

        // Open the door and set the event...
        if (!bHaveObjects)
        {
            m_aDoorRight.Open();
            GameGlobals.SetGameEvent(Types.s_iGE_FirstSpawners);
        }
    }
コード例 #2
0
 public bool AddGameEventForPlayer()
 {
     switch (m_iEvent)
     {
     case EGameEvent._EXIT_KEY: GameGlobals.SetGameEvent(Types.s_iGE_ExitKey); break;
     }
     return(true);
 }
コード例 #3
0
 public void OnSwitchFlip()
 {
     if (GameGlobals.TestGameEvent(Types.s_iGE_SimplePatrolRouteSwitch))
     {
         return;
     }
     GameGlobals.SetGameEvent(Types.s_iGE_SimplePatrolRouteSwitch);
     OpenAllDoors();
 }
コード例 #4
0
    private void Start()
    {
        // Splash screen only gets shown once...
        GameGlobals.SetGameEvent(Types.s_iGE_IntroShown);

        if (m_gcGameStateManager.CanChangeState())
        {
            m_gcGameStateManager.ChangeState(EGameStates._MAINMENU_ENTER, "", false);
        }
    }
コード例 #5
0
    public void OnSwitchFlip()
    {
        if (GameGlobals.TestGameEvent(Types.s_iGE_AnotherSecretDoor))
        {
            return;
        }

        GameGlobals.SetGameEvent(Types.s_iGE_AnotherSecretDoor);
        m_aDoors[0].Open();
    }
コード例 #6
0
    public void OnSwitchFlip()
    {
        if (GameGlobals.TestGameEvent(Types.s_iGE_LaserIntroDoorToggled))
        {
            return;
        }

        GameGlobals.SetGameEvent(Types.s_iGE_LaserIntroDoorToggled);
        m_aDoors[0].Open();
    }
コード例 #7
0
    void Update()
    {
        if (!m_bCheckSwarmHealth)
        {
            return;
        }

        if (m_gcSwarm.GetBlobCount() == 0)
        {
            m_gcDoorRight.Open();
            GameGlobals.SetGameEvent(Types.s_iGE_SwarmKilled);
            m_bCheckSwarmHealth = false;
        }
    }
コード例 #8
0
    public override void OnRoomEnter()
    {
        base.OnRoomEnter();

        if (!GameGlobals.TestGameEvent(Types.s_iGE_TopOfFallFirstEntry))
        {
            GameGlobals.SetGameEvent(Types.s_iGE_TopOfFallFirstEntry);
            TimerManager.AddTimer(Types.s_fPLAYER_RoomTransitionDuration, DelayedCloseDoor);
        }
        else
        {
            m_aDoors[0].CloseInstant();
        }
    }
コード例 #9
0
    public override void OnRoomEnter()
    {
        GAssert.Assert(null != m_gcDoorway, "rc_EmptyRoom: Doorway for game event not setup!");
        base.OnRoomEnter();

        if (!GameGlobals.TestGameEvent(Types.s_iGE_PassedLaserIntroRoom))
        {
            TimerManager.AddTimer(Types.s_fDUR_RoomEntryDoorCloseDelay, DelayedCloseDoor);
            GameGlobals.SetGameEvent(Types.s_iGE_PassedLaserIntroRoom);
        }
        else
        {
            m_gcDoorway.CloseInstant();
        }
    }
コード例 #10
0
    void Update()
    {
        if (!GameGlobals.TestGameEvent(Types.s_iGE_FirstBrains))
        {
            // If we don't have objects...
            bool bHaveObjects = false;
            foreach (GameObject go in m_aRoomObjects)
            {
                if (null != go)
                {
                    bHaveObjects = true;
                }
            }

            // ...Open the door and set the event.
            if (!bHaveObjects)
            {
                m_gcDoorLeft.Open();
                GameGlobals.SetGameEvent(Types.s_iGE_FirstBrains);
            }
        }
    }
コード例 #11
0
    // Check for the complete (death) of the wave, spawn rewards and unlock the player!
    //
    public virtual void Update()
    {
        // Early outs
        {
            if (GameGlobals.TestGameEvent(m_iEventBitField))
            {
                return;
            }
            if (!m_bIsActive)
            {
                return;
            }
            if (m_iWaveNumber < m_iNumberOfWaves)
            {
                return;
            }
        }


        // If there are active gameObjects (we spawned them) then the player can't exit...
        bool bStillPlaying = false;

        foreach (GameObject go in m_aRoomObjects)
        {
            if (null != go)
            {
                bStillPlaying = true;
            }
        }


        if (!bStillPlaying)
        {
            // DeInit any additional objects
            {
                foreach (GameObject go in m_aAdditionalObjects)
                {
                    if (null == go)
                    {
                        continue;
                    }
                    Types.IRoom_EnemyObject[] aGC = go.GetComponents <Types.IRoom_EnemyObject>();
                    foreach (Types.IRoom_EnemyObject gc in aGC)
                    {
                        gc.OnRoomExit();
                    }
                    go.SetActive(false);
                }
            }

            // Spawn the rewards!
            foreach (GameObject go in m_aRewards)
            {
                if (null == go)
                {
                    continue;
                }

                Vector2 vPos       = Vector2.zero;
                Vector2 vDist      = Vector2.zero;
                Vector2 vPlayerPos = GameInstance.Object.GetPlayerPosition();
                bool    bChecking  = true;

                do
                {
                    vPos  = new Vector2(Random.Range(-m_vHalfRoomBounds.x + 0.25f, m_vHalfRoomBounds.x - 0.25f), Random.Range(-m_vHalfRoomBounds.y + 0.25f, m_vHalfRoomBounds.y - 0.25f));
                    vPos += m_vRoomOrigin;
                    vDist = vPlayerPos - vPos;
                    if (vDist.magnitude > m_fDistanceFromPlayer)
                    {
                        bChecking = false;
                    }
                }while (bChecking);

                Instantiate(go, vPos, Quaternion.identity);
                if (null != m_goRewardEffect)
                {
                    Instantiate(m_goRewardEffect, vPos, Quaternion.identity);
                }
            }

            // Play Audio
            GameInstance.Object.GetAudioManager().PlayAudio(EGameSFX._SFX_ROBOTRON_COMPLETE);


            // Add the achivement
            switch (m_iEvent)
            {
            case ERobotronEvents._RB1_IckleBaddies: GameMode.AchievementUnlocked(Types.EAchievementIdentifier._PartyLike2084); break;

            case ERobotronEvents._RB2_Enforcers: GameMode.AchievementUnlocked(Types.EAchievementIdentifier._SmashTV); break;

            case ERobotronEvents._RB3_FloatingLaserBrains: GameMode.AchievementUnlocked(Types.EAchievementIdentifier._TotalCarnage); break;

            case ERobotronEvents._RB4_LoadsaBaddies: /* The key will be delivered in this room */ break;

            case ERobotronEvents._RB5_CircularShotTwats: GameMode.AchievementUnlocked(Types.EAchievementIdentifier._Llamatron); break;
            }

            // Save event in GameGlobals...
            OpenAllDoors();
            GameGlobals.SetGameEvent(m_iEventBitField);
            m_bIsActive = false;
        }
    }