예제 #1
0
 public override void OnEnter()
 {
     m_bossDoorOpening = false;
     if (Game.PlayerStats.ReadLastDiary && LinkedRoom.LinkedRoom != null)
     {
         LinkedRoom = LinkedRoom.LinkedRoom;
     }
     Game.PlayerStats.LoadStartingRoom = false;
     if (Game.PlayerStats.DiaryEntry < 1)
     {
         m_speechBubble.Visible = true;
     }
     else
     {
         m_speechBubble.Visible = false;
     }
     if (InputManager.GamePadIsConnected(PlayerIndex.One))
     {
         m_mapIcon.SetButton(Game.GlobalInput.ButtonList[9]);
         m_mapIcon.Scale = new Vector2(1f, 1f);
     }
     else
     {
         m_mapIcon.SetKey(Game.GlobalInput.KeyList[9]);
         m_mapIcon.Scale = new Vector2(0.5f, 0.5f);
     }
     if (!m_allFilesSaved)
     {
         Player.Game.SaveManager.SaveAllFileTypes(false);
         m_allFilesSaved = true;
     }
     if (Game.PlayerStats.EyeballBossBeaten)
     {
         RevealSymbol(GameTypes.LevelType.CASTLE, false);
     }
     if (Game.PlayerStats.FairyBossBeaten)
     {
         RevealSymbol(GameTypes.LevelType.GARDEN, false);
     }
     if (Game.PlayerStats.BlobBossBeaten)
     {
         RevealSymbol(GameTypes.LevelType.DUNGEON, false);
     }
     if (Game.PlayerStats.FireballBossBeaten)
     {
         RevealSymbol(GameTypes.LevelType.TOWER, false);
     }
     if (Game.PlayerStats.EyeballBossBeaten && Game.PlayerStats.FairyBossBeaten &&
         Game.PlayerStats.BlobBossBeaten && Game.PlayerStats.FireballBossBeaten &&
         !Game.PlayerStats.FinalDoorOpened && Player.ScaleX > 0.1f)
     {
         PlayBossDoorAnimation();
     }
     else if (Game.PlayerStats.FinalDoorOpened)
     {
         m_bossDoor.Locked = false;
         m_bossDoorSprite.ChangeSprite("LastDoorOpen_Character");
         m_bossDoorSprite.GoToFrame(m_bossDoorSprite.TotalFrames);
     }
     if (!m_gateClosed)
     {
         CloseGate(true);
     }
     if (Game.PlayerStats.EyeballBossBeaten && Game.PlayerStats.FairyBossBeaten &&
         Game.PlayerStats.BlobBossBeaten && Game.PlayerStats.FireballBossBeaten &&
         !Game.PlayerStats.FinalDoorOpened && Player.ScaleX > 0.1f)
     {
         Game.PlayerStats.FinalDoorOpened = true;
         Player.AttachedLevel.RunCinematicBorders(6f);
     }
     base.OnEnter();
 }
예제 #2
0
 public string AddKeyIcon(string text, int startIndex, int endIndex)
 {
     KeyIconObj keyIconObj = new KeyIconObj();
     Vector2 arg_0B_0 = Vector2.Zero;
     string text2 = text.Substring(startIndex, endIndex - startIndex + 1);
     string oldValue = text2;
     if (text2.Contains("Input"))
     {
         string text3 = text2.Replace("[Input:", "");
         text3 = text3.Replace("]", "");
         byte index = byte.Parse(text3);
         if (InputManager.GamePadIsConnected(PlayerIndex.One))
         {
             Buttons buttons = Game.GlobalInput.ButtonList[(int)index];
             text2 = text2.Replace(text3, buttons.ToString());
             text2 = text2.Replace("Input", "Button");
         }
         else
         {
             Keys keys = Game.GlobalInput.KeyList[(int)index];
             text2 = text2.Replace(text3, keys.ToString());
             text2 = text2.Replace("Input", "Key");
         }
     }
     if (text2.Contains("Key"))
     {
         string text4 = text2.Replace("[Key:", "");
         text4 = text4.Replace("]", "");
         bool upperCase = true;
         if (text4 == "Enter" || text4 == "Space")
         {
             upperCase = false;
         }
         keyIconObj.SetKey(new Keys?((Keys)Enum.Parse(typeof(Keys), text4)), upperCase);
         float y = (base.Font.MeasureString("0") * this.m_internalFontSizeScale * this.Scale).Y;
         keyIconObj.Scale = new Vector2(y / (float)keyIconObj.Height, y / (float)keyIconObj.Height) * this.ForcedScale;
         this.m_yOffset = y / 2f;
         string text5 = " ";
         while (base.Font.MeasureString(text5).X * this.m_internalFontSizeScale.X * this.Scale.X < (float)keyIconObj.Width)
         {
             text5 += " ";
         }
         string text6 = text.Substring(0, text.IndexOf("["));
         text = text.Replace(oldValue, text5);
         float num = base.Font.MeasureString(text5).X * this.m_internalFontSizeScale.X * this.Scale.X;
         num /= 2f;
         float num2 = base.Font.MeasureString(text6).X * this.m_internalFontSizeScale.X * this.Scale.X;
         float item = num2 + num;
         this.m_iconOffset.Add(item);
     }
     else
     {
         string text7 = text2.Replace("[Button:", "");
         text7 = text7.Replace("]", "");
         keyIconObj.SetButton((Buttons)Enum.Parse(typeof(Buttons), text7));
         float y2 = (base.Font.MeasureString("0") * this.m_internalFontSizeScale * this.Scale).Y;
         keyIconObj.Scale = new Vector2(y2 / (float)keyIconObj.Height, y2 / (float)keyIconObj.Height) * this.ForcedScale;
         this.m_yOffset = y2 / 2f;
         string text8 = " ";
         while (base.Font.MeasureString(text8).X * this.m_internalFontSizeScale.X * this.Scale.X < (float)keyIconObj.Width)
         {
             text8 += " ";
         }
         string text9 = text.Substring(0, text.IndexOf("["));
         text = text.Replace(oldValue, text8);
         float num3 = base.Font.MeasureString(text8).X * this.m_internalFontSizeScale.X * this.Scale.X;
         num3 /= 2f;
         float num4 = base.Font.MeasureString(text9).X * this.m_internalFontSizeScale.X * this.Scale.X;
         float item2 = num4 + num3;
         this.m_iconOffset.Add(item2);
     }
     this.m_iconList.Add(keyIconObj);
     return text;
 }
예제 #3
0
        public string AddKeyIcon(string text, int startIndex, int endIndex)
        {
            var keyIconObj = new KeyIconObj();
            var arg_0B_0   = Vector2.Zero;
            var text2      = text.Substring(startIndex, endIndex - startIndex + 1);
            var oldValue   = text2;

            if (text2.Contains("Input"))
            {
                var text3 = text2.Replace("[Input:", "");
                text3 = text3.Replace("]", "");
                var index = byte.Parse(text3);
                if (InputManager.GamePadIsConnected(PlayerIndex.One))
                {
                    var buttons = Game.GlobalInput.ButtonList[index];
                    text2 = text2.Replace(text3, buttons.ToString());
                    text2 = text2.Replace("Input", "Button");
                }
                else
                {
                    var keys = Game.GlobalInput.KeyList[index];
                    text2 = text2.Replace(text3, keys.ToString());
                    text2 = text2.Replace("Input", "Key");
                }
            }
            if (text2.Contains("Key"))
            {
                var text4 = text2.Replace("[Key:", "");
                text4 = text4.Replace("]", "");
                var upperCase = true;
                if (text4 == "Enter" || text4 == "Space")
                {
                    upperCase = false;
                }
                keyIconObj.SetKey((Keys)Enum.Parse(typeof(Keys), text4), upperCase);
                var y = (Font.MeasureString("0") * m_internalFontSizeScale * Scale).Y;
                keyIconObj.Scale = new Vector2(y / keyIconObj.Height, y / keyIconObj.Height) * ForcedScale;
                m_yOffset        = y / 2f;
                var text5 = " ";
                while (Font.MeasureString(text5).X *m_internalFontSizeScale.X *Scale.X < keyIconObj.Width)
                {
                    text5 += " ";
                }
                var text6 = text.Substring(0, text.IndexOf("["));
                text = text.Replace(oldValue, text5);
                var num = Font.MeasureString(text5).X *m_internalFontSizeScale.X *Scale.X;
                num /= 2f;
                var num2 = Font.MeasureString(text6).X *m_internalFontSizeScale.X *Scale.X;
                var item = num2 + num;
                m_iconOffset.Add(item);
            }
            else
            {
                var text7 = text2.Replace("[Button:", "");
                text7 = text7.Replace("]", "");
                keyIconObj.SetButton((Buttons)Enum.Parse(typeof(Buttons), text7));
                var y2 = (Font.MeasureString("0") * m_internalFontSizeScale * Scale).Y;
                keyIconObj.Scale = new Vector2(y2 / keyIconObj.Height, y2 / keyIconObj.Height) * ForcedScale;
                m_yOffset        = y2 / 2f;
                var text8 = " ";
                while (Font.MeasureString(text8).X *m_internalFontSizeScale.X *Scale.X < keyIconObj.Width)
                {
                    text8 += " ";
                }
                var text9 = text.Substring(0, text.IndexOf("["));
                text = text.Replace(oldValue, text8);
                var num3 = Font.MeasureString(text8).X *m_internalFontSizeScale.X *Scale.X;
                num3 /= 2f;
                var num4  = Font.MeasureString(text9).X *m_internalFontSizeScale.X *Scale.X;
                var item2 = num4 + num3;
                m_iconOffset.Add(item2);
            }
            m_iconList.Add(keyIconObj);
            return(text);
        }