Esempio n. 1
0
 public override void OnEnter()
 {
     m_icon.Visible = false;
     if (ID == -1 && !RoomCompleted)
     {
         do
         {
             RandomizeItem();
         } while (ItemType == Game.PlayerStats.SpecialItem);
     }
     else if (ID != -1)
     {
         ItemType = (byte)ID;
         m_icon.ChangeSprite(SpecialItemType.SpriteName(ItemType));
         if (RoomCompleted)
         {
             m_icon.Visible         = false;
             m_speechBubble.Visible = false;
         }
     }
     if (RoomCompleted)
     {
         m_pedestal.TextureColor = new Color(100, 100, 100);
     }
     else
     {
         m_pedestal.TextureColor = Color.White;
     }
     base.OnEnter();
 }
Esempio n. 2
0
 public void UpdateSpecialItemIcon()
 {
     m_specialItemIcon.Visible = false;
     m_iconHolder2.Opacity     = 0.5f;
     if (Game.PlayerStats.SpecialItem != 0)
     {
         m_specialItemIcon.Visible = true;
         m_specialItemIcon.ChangeSprite(SpecialItemType.SpriteName(Game.PlayerStats.SpecialItem));
         m_iconHolder2.Opacity = 1f;
     }
 }
Esempio n. 3
0
 private void RandomizeItem()
 {
     if (Game.PlayerStats.Traits.X == 3f || Game.PlayerStats.Traits.Y == 3f || Game.PlayerStats.Traits.X == 4f ||
         Game.PlayerStats.Traits.Y == 4f || Game.PlayerStats.Traits.X == 20f || Game.PlayerStats.Traits.Y == 20f ||
         Game.PlayerStats.Traits.X == 1f || Game.PlayerStats.Traits.Y == 1f || Game.PlayerStats.Traits.X == 29f ||
         Game.PlayerStats.Traits.Y == 29f)
     {
         if (CDGMath.RandomInt(1, 100) <= 30)
         {
             ItemType = 8;
         }
         else
         {
             ItemType = GetRandomItem();
         }
     }
     else
     {
         ItemType = GetRandomItem();
     }
     m_icon.ChangeSprite(SpecialItemType.SpriteName(ItemType));
     ID = ItemType;
 }
Esempio n. 4
0
        public override void OnEnter()
        {
            m_tripStat1.Visible = false;
            m_tripStat2.Visible = false;
            m_tripStat1.Scale   = Vector2.One;
            m_tripStat2.Scale   = Vector2.One;
            if (m_itemType != 7)
            {
                (ScreenManager.Game as Game).SaveManager.SaveFiles(SaveType.PlayerData, SaveType.UpgradeData);
            }
            m_itemSprite.Rotation         = 0f;
            m_itemSprite.Scale            = Vector2.One;
            m_itemStartPos.X              = m_itemStartPos.X - Camera.TopLeftCorner.X;
            m_itemStartPos.Y              = m_itemStartPos.Y - Camera.TopLeftCorner.Y;
            m_storedMusicVolume           = SoundManager.GlobalMusicVolume;
            m_songName                    = SoundManager.GetCurrentMusicName();
            m_lockControls                = true;
            m_continueText.Opacity        = 0f;
            m_continueText.Text           = "[Input:" + 0 + "]  to continue";
            m_itemFoundText.Position      = m_itemEndPos;
            m_itemFoundText.Y            += 70f;
            m_itemFoundText.Scale         = Vector2.Zero;
            m_tripStat1FoundText.Position = m_itemFoundText.Position;
            m_tripStat2FoundText.Position = m_itemFoundText.Position;
            m_tripStat1FoundText.Scale    = Vector2.Zero;
            m_tripStat2FoundText.Scale    = Vector2.Zero;
            m_tripStat1FoundText.Visible  = false;
            m_tripStat2FoundText.Visible  = false;
            switch (m_itemType)
            {
            case 1:
                m_itemSpinning = true;
                m_itemSprite.ChangeSprite("BlueprintIcon_Sprite");
                m_itemFoundSprite.ChangeSprite("BlueprintFoundText_Sprite");
                m_itemFoundText.Text = EquipmentBaseType.ToString((int)m_itemInfo.Y) + " " +
                                       EquipmentCategoryType.ToString2((int)m_itemInfo.X);
                break;

            case 2:
                m_itemSpinning = true;
                m_itemSprite.ChangeSprite("RuneIcon_Sprite");
                m_itemFoundSprite.ChangeSprite("RuneFoundText_Sprite");
                m_itemFoundText.Text = EquipmentAbilityType.ToString((int)m_itemInfo.Y) + " Rune (" +
                                       EquipmentCategoryType.ToString2((int)m_itemInfo.X) + ")";
                m_itemSprite.AnimationDelay = 0.05f;
                GameUtil.UnlockAchievement("LOVE_OF_MAGIC");
                break;

            case 3:
            case 6:
                m_itemSprite.ChangeSprite(GetStatSpriteName((int)m_itemInfo.X));
                m_itemFoundText.Text        = GetStatText((int)m_itemInfo.X);
                m_itemSprite.AnimationDelay = 0.05f;
                m_itemFoundSprite.ChangeSprite("StatFoundText_Sprite");
                if (m_itemType == 6)
                {
                    m_tripStat1FoundText.Visible = true;
                    m_tripStat2FoundText.Visible = true;
                    m_tripStat1.ChangeSprite(GetStatSpriteName((int)m_tripStatData.X));
                    m_tripStat2.ChangeSprite(GetStatSpriteName((int)m_tripStatData.Y));
                    m_tripStat1.Visible        = true;
                    m_tripStat2.Visible        = true;
                    m_tripStat1.AnimationDelay = 0.05f;
                    m_tripStat2.AnimationDelay = 0.05f;
                    Tween.RunFunction(0.1f, m_tripStat1, "PlayAnimation", true);
                    Tween.RunFunction(0.2f, m_tripStat2, "PlayAnimation", true);
                    m_tripStat1FoundText.Text = GetStatText((int)m_tripStatData.X);
                    m_tripStat2FoundText.Text = GetStatText((int)m_tripStatData.Y);
                    m_itemFoundText.Y        += 50f;
                    m_tripStat1FoundText.Y    = m_itemFoundText.Y + 50f;
                }
                break;

            case 4:
                m_itemSprite.ChangeSprite(SpellType.Icon((byte)m_itemInfo.X));
                m_itemFoundSprite.ChangeSprite("SpellFoundText_Sprite");
                m_itemFoundText.Text = SpellType.ToString((byte)m_itemInfo.X);
                break;

            case 5:
                m_itemSprite.ChangeSprite(SpecialItemType.SpriteName((byte)m_itemInfo.X));
                m_itemFoundSprite.ChangeSprite("ItemFoundText_Sprite");
                m_itemFoundText.Text = SpecialItemType.ToString((byte)m_itemInfo.X);
                break;

            case 7:
                m_itemSprite.ChangeSprite(GetMedallionImage((int)m_itemInfo.X));
                m_itemFoundSprite.ChangeSprite("ItemFoundText_Sprite");
                if (m_itemInfo.X == 19f)
                {
                    m_itemFoundText.Text = "Medallion completed!";
                }
                else
                {
                    m_itemFoundText.Text = "You've collected a medallion piece!";
                }
                break;
            }
            m_itemSprite.PlayAnimation();
            ItemSpinAnimation();
            base.OnEnter();
        }