Exemple #1
0
        public override void OnEnter()
        {
            (ScreenManager.Game as Game).SaveManager.ResetAutosave();
            m_player.DisableAllWeight = false;
            m_player.StopAllSpells();
            m_player.Scale = new Vector2(2f, 2f);
            ShoutMagnitude = 3f;

            //if (Game.PlayerStats.Traits.X == 6f || Game.PlayerStats.Traits.Y == 6f)
            //    m_player.Scale *= 1.5f;
            //else if (Game.PlayerStats.Traits.X == 7f || Game.PlayerStats.Traits.Y == 7f)
            //    m_player.Scale = new Vector2(1.35f, 1.35f);

            //if (Game.PlayerStats.Traits.X == 10f || Game.PlayerStats.Traits.Y == 10f)
            //{
            //    m_player.ScaleX *= 0.825f;
            //    m_player.ScaleY *= 1.15f;
            //}
            //else if (Game.PlayerStats.Traits.X == 9f || Game.PlayerStats.Traits.Y == 9f)
            //{
            //    m_player.ScaleX *= 1.25f;
            //    m_player.ScaleY *= 1.175f;
            //}

            m_player.CurrentHealth = Game.PlayerStats.CurrentHealth;
            m_player.CurrentMana   = Game.PlayerStats.CurrentMana;
            if (LevelEV.RUN_TESTROOM)
            {
                Game.ScreenManager.Player.CurrentHealth = Game.ScreenManager.Player.MaxHealth;
                Game.ScreenManager.Player.CurrentMana   = Game.ScreenManager.Player.MaxMana;
            }

            BuildRenderChain();

            var args = new RogueAPI.LevelEnterEventArgs(this, m_player, _renderChain);

            RogueAPI.Event <RogueAPI.LevelEnterEventArgs> .Trigger(args);

            m_player.UpdateInternalScale();
            CheckForRoomTransition();
            UpdateCamera();
            UpdatePlayerHUDAbilities();
            m_player.UpdateEquipmentColours();
            m_player.StopAllSpells();

            if (Game.PlayerStats.Class == 13)
            {
                m_miniMapDisplay.AddAllIcons(RoomList);
                (ScreenManager as RCScreenManager).AddIconsToMap(RoomList);
            }

            if (Game.PlayerStats.EyeballBossBeaten)
            {
                GameUtil.UnlockAchievement("FEAR_OF_EYES");
            }

            if (Game.PlayerStats.FairyBossBeaten)
            {
                GameUtil.UnlockAchievement("FEAR_OF_GHOSTS");
            }

            if (Game.PlayerStats.BlobBossBeaten)
            {
                GameUtil.UnlockAchievement("FEAR_OF_SLIME");
            }

            if (Game.PlayerStats.FireballBossBeaten)
            {
                GameUtil.UnlockAchievement("FEAR_OF_FIRE");
            }

            if (Game.PlayerStats.LastbossBeaten || Game.PlayerStats.TimesCastleBeaten > 0)
            {
                GameUtil.UnlockAchievement("FEAR_OF_FATHERS");
            }

            if (Game.PlayerStats.TimesCastleBeaten > 1)
            {
                GameUtil.UnlockAchievement("FEAR_OF_TWINS");
            }

            if (Game.PlayerStats.ChallengeEyeballBeaten)
            {
                GameUtil.UnlockAchievement("FEAR_OF_BLINDNESS");
            }

            if (Game.PlayerStats.ChallengeSkullBeaten)
            {
                GameUtil.UnlockAchievement("FEAR_OF_BONES");
            }

            if (Game.PlayerStats.ChallengeFireballBeaten)
            {
                GameUtil.UnlockAchievement("FEAR_OF_CHEMICALS");
            }

            if (Game.PlayerStats.ChallengeBlobBeaten)
            {
                GameUtil.UnlockAchievement("FEAR_OF_SPACE");
            }

            if (Game.PlayerStats.ChallengeLastBossBeaten)
            {
                GameUtil.UnlockAchievement("FEAR_OF_RELATIVES");
            }

            if (Game.PlayerStats.EnemiesKilledList[5].W > 0f &&
                Game.PlayerStats.EnemiesKilledList[12].W > 0f &&
                Game.PlayerStats.EnemiesKilledList[15].W > 0f &&
                Game.PlayerStats.EnemiesKilledList[22].W > 0f &&
                Game.PlayerStats.EnemiesKilledList[32].W > 0f)
            {
                GameUtil.UnlockAchievement("FEAR_OF_ANIMALS");
            }

            if (Game.PlayerStats.TotalHoursPlayed + Game.PlaySessionLength >= 20f)
            {
                GameUtil.UnlockAchievement("FEAR_OF_SLEEP");
            }

            if (Game.PlayerStats.TotalRunesFound > 10)
            {
                GameUtil.UnlockAchievement("LOVE_OF_MAGIC");
            }


            base.OnEnter();
        }