Exemple #1
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();
        }
Exemple #2
0
 protected override void SaveCompletionData()
 {
     Game.PlayerStats.ChallengeBlobBeaten = true;
     GameUtil.UnlockAchievement("FEAR_OF_SPACE");
 }
Exemple #3
0
        public override void OnEnter()
        {
            m_playerFrame.Opacity  = 0f;
            m_playerFrame.Position = m_player.Position;
            m_playerFrame.SetTraits(Game.PlayerStats.Traits);
            m_playerFrame.IsFemale = Game.PlayerStats.IsFemale;
            m_playerFrame.Class    = Game.PlayerStats.Class;
            m_playerFrame.Y       -= 120f;
            m_playerFrame.SetPortrait(Game.PlayerStats.HeadPiece, Game.PlayerStats.ShoulderPiece,
                                      Game.PlayerStats.ChestPiece);
            m_playerFrame.UpdateData();
            Tween.To(m_playerFrame, 1f, Tween.EaseNone, "delay", "4", "Opacity", "1");
            var item = new FamilyTreeNode
            {
                Name             = Game.PlayerStats.PlayerName,
                Age              = Game.PlayerStats.Age,
                ChildAge         = Game.PlayerStats.ChildAge,
                Class            = Game.PlayerStats.Class,
                HeadPiece        = Game.PlayerStats.HeadPiece,
                ChestPiece       = Game.PlayerStats.ChestPiece,
                ShoulderPiece    = Game.PlayerStats.ShoulderPiece,
                NumEnemiesBeaten = Game.PlayerStats.NumEnemiesBeaten,
                BeatenABoss      = Game.PlayerStats.NewBossBeaten,
                Traits           = Game.PlayerStats.Traits,
                IsFemale         = Game.PlayerStats.IsFemale
            };
            var traits = Game.PlayerStats.Traits;

            Game.PlayerStats.FamilyTreeArray.Add(item);
            if (Game.PlayerStats.CurrentBranches != null)
            {
                Game.PlayerStats.CurrentBranches.Clear();
            }
            Game.PlayerStats.IsDead           = true;
            Game.PlayerStats.Traits           = Vector2.Zero;
            Game.PlayerStats.NewBossBeaten    = false;
            Game.PlayerStats.RerolledChildren = false;
            Game.PlayerStats.HasArchitectFee  = false;
            Game.PlayerStats.NumEnemiesBeaten = 0;
            Game.PlayerStats.LichHealth       = 0;
            Game.PlayerStats.LichMana         = 0;
            Game.PlayerStats.LichHealthMod    = 1f;
            Game.PlayerStats.TimesDead++;
            Game.PlayerStats.LoadStartingRoom = true;
            Game.PlayerStats.EnemiesKilledInRun.Clear();
            if (Game.PlayerStats.SpecialItem != 1 && Game.PlayerStats.SpecialItem != 9 &&
                Game.PlayerStats.SpecialItem != 10 && Game.PlayerStats.SpecialItem != 11 &&
                Game.PlayerStats.SpecialItem != 12 && Game.PlayerStats.SpecialItem != 13)
            {
                Game.PlayerStats.SpecialItem = 0;
            }
            (ScreenManager.Game as Game).SaveManager.SaveFiles(SaveType.PlayerData, SaveType.Lineage, SaveType.MapData);
            (ScreenManager.Game as Game).SaveManager.SaveAllFileTypes(true);
            Game.PlayerStats.Traits = traits;
            if (Game.PlayerStats.TimesDead >= 20)
            {
                GameUtil.UnlockAchievement("FEAR_OF_LIFE");
            }
            SoundManager.StopMusic(0.5f);
            m_droppingStats = false;
            m_lockControls  = false;
            SoundManager.PlaySound("Player_Death_FadeToBlack");
            m_continueText.Text     = "Press [Input:" + 0 + "] to move on";
            m_player.Visible        = true;
            m_player.Opacity        = 1f;
            m_continueText.Opacity  = 0f;
            m_dialoguePlate.Opacity = 0f;
            m_playerGhost.Opacity   = 0f;
            m_spotlight.Opacity     = 0f;
            m_playerGhost.Position  = new Vector2(m_player.X - m_playerGhost.Width / 2, m_player.Bounds.Top - 20);
            Tween.RunFunction(3f, typeof(SoundManager), "PlaySound", "Player_Ghost");
            Tween.To(m_playerGhost, 0.5f, Linear.EaseNone, "delay", "3", "Opacity", "0.4");
            Tween.By(m_playerGhost, 2f, Linear.EaseNone, "delay", "3", "Y", "-150");
            m_playerGhost.Opacity = 0.4f;
            Tween.To(m_playerGhost, 0.5f, Linear.EaseNone, "delay", "4", "Opacity", "0");
            m_playerGhost.Opacity = 0f;
            m_playerGhost.PlayAnimation();
            Tween.To(this, 0.5f, Linear.EaseNone, "BackBufferOpacity", "1");
            Tween.To(m_spotlight, 0.1f, Linear.EaseNone, "delay", "1", "Opacity", "1");
            Tween.AddEndHandlerToLastTween(typeof(SoundManager), "PlaySound", "Player_Death_Spotlight");
            Tween.RunFunction(1.2f, typeof(SoundManager), "PlayMusic", "GameOverStinger", false, 0.5f);
            Tween.To(Camera, 1f, Quad.EaseInOut, "X", m_player.AbsX.ToString(), "Y",
                     (m_player.Bounds.Bottom - 10).ToString(), "Zoom", "1");
            Tween.RunFunction(2f, m_player, "RunDeathAnimation1");
            if (Game.PlayerStats.Traits.X == 13f || Game.PlayerStats.Traits.Y == 13f)
            {
                (m_dialoguePlate.GetChildAt(2) as TextObj).Text = "#)!(%*#@!%^";
                (m_dialoguePlate.GetChildAt(2) as TextObj).RandomizeSentence(true);
            }
            else
            {
                (m_dialoguePlate.GetChildAt(2) as TextObj).Text =
                    GameEV.GAME_HINTS[CDGMath.RandomInt(0, GameEV.GAME_HINTS.Length - 1)];
            }
            (m_dialoguePlate.GetChildAt(3) as TextObj).Text = "-" + Game.PlayerStats.PlayerName + "'s Parting Words";
            Tween.To(m_dialoguePlate, 0.5f, Tween.EaseNone, "delay", "2", "Opacity", "1");
            Tween.RunFunction(4f, this, "DropStats");
            Tween.To(m_continueText, 0.4f, Linear.EaseNone, "delay", "4", "Opacity", "1");
            base.OnEnter();
        }
Exemple #4
0
 protected override void SaveCompletionData()
 {
     Game.PlayerStats.ChallengeLastBossBeaten = true;
     GameUtil.UnlockAchievement("FEAR_OF_RELATIVES");
 }
Exemple #5
0
        public virtual void OpenChest(ItemDropManager itemDropManager, PlayerObj player)
        {
            if (!IsOpen && !IsLocked)
            {
                SoundManager.Play3DSound(this, Game.ScreenManager.Player, "Chest_Open_Large");
                GoToFrame(2);
                if (IsEmpty)
                {
                    return;
                }
                if (ChestType == 3)
                {
                    GameUtil.UnlockAchievement("LOVE_OF_GOLD");
                }
                if (ForcedItemType == 0)
                {
                    var   num  = CDGMath.RandomInt(1, 100);
                    var   num2 = 0;
                    int[] array;
                    if (ChestType == 1)
                    {
                        array = GameEV.BRONZECHEST_ITEMDROP_CHANCE;
                    }
                    else if (ChestType == 2)
                    {
                        array = GameEV.SILVERCHEST_ITEMDROP_CHANCE;
                    }
                    else
                    {
                        array = GameEV.GOLDCHEST_ITEMDROP_CHANCE;
                    }
                    var num3 = 0;
                    for (var i = 0; i < array.Length; i++)
                    {
                        num3 += array[i];
                        if (num <= num3)
                        {
                            num2 = i;
                            break;
                        }
                    }
                    if (num2 == 0)
                    {
                        GiveGold(itemDropManager);
                    }
                    else if (num2 == 1)
                    {
                        GiveStatDrop(itemDropManager, player, 1, 0);
                    }
                    else
                    {
                        GivePrint(itemDropManager, player);
                    }
                }
                else
                {
                    switch (ForcedItemType)
                    {
                    case 1:
                    case 10:
                    case 11:
                        GiveGold(itemDropManager, (int)ForcedAmount);
                        break;

                    case 4:
                    case 5:
                    case 6:
                    case 7:
                    case 8:
                    case 9:
                        GiveStatDrop(itemDropManager, player, 1, ForcedItemType);
                        break;

                    case 12:
                    case 13:
                        GivePrint(itemDropManager, player);
                        break;

                    case 14:
                        GiveStatDrop(itemDropManager, player, 3, 0);
                        break;

                    case 15:
                    case 16:
                    case 17:
                    case 18:
                    case 19:
                        GiveStatDrop(itemDropManager, player, 1, ForcedItemType);
                        break;
                    }
                }
                player.AttachedLevel.RefreshMapChestIcons();
            }
        }
Exemple #6
0
 protected override void SaveCompletionData()
 {
     Game.PlayerStats.ChallengeEyeballBeaten = true;
     GameUtil.UnlockAchievement("FEAR_OF_BLINDNESS");
 }