예제 #1
0
        public void DeleteSave()
        {
            var flag        = false;
            var profileSlot = Game.GameConfig.ProfileSlot;

            if (Game.GameConfig.ProfileSlot == m_selectedIndex + 1)
            {
                flag = true;
            }
            Game.GameConfig.ProfileSlot = (byte)(m_selectedIndex + 1);
            //Game.PlayerStats.Dispose();
            (ScreenManager.Game as Game).SaveManager.ClearAllFileTypes(false);
            (ScreenManager.Game as Game).SaveManager.ClearAllFileTypes(true);
            //SkillSystem.ResetAllTraits();
            //Game.PlayerStats = new PlayerStats();
            //(ScreenManager as RCScreenManager).Player.Reset();
            Game.GameConfig.ProfileSlot = profileSlot;
            if (flag)
            {
                Game.PlayerStats.Dispose();
                SkillSystem.ResetAllTraits();
                Game.PlayerStats = new PlayerStats();
                (ScreenManager as RCScreenManager).Player.Reset();
                SoundManager.StopMusic(1f);
                (ScreenManager as RCScreenManager).DisplayScreen(23, true);
                return;
            }
            m_deleteProfileText.Visible = false;
            CheckSaveHeaders(m_slotArray[m_selectedIndex], (byte)(m_selectedIndex + 1));
        }
예제 #2
0
 public void TollPaid(bool chargeFee)
 {
     if (chargeFee)
     {
         var num = Game.PlayerStats.Gold * (1f - SkillSystem.GetSkill(SkillType.Prices_Down).ModifierAmount);
         Game.PlayerStats.Gold -= (int)num;
         if (num > 0f)
         {
             Player.AttachedLevel.TextManager.DisplayNumberStringText(-(int)num, "gold", Color.Yellow,
                                                                      new Vector2(Player.X, Player.Bounds.Top));
         }
     }
     if (Game.PlayerStats.SpokeToTollCollector && Game.PlayerStats.SpecialItem != 1 &&
         Game.PlayerStats.SpecialItem != 12 && Game.PlayerStats.SpecialItem != 13 &&
         Game.PlayerStats.SpecialItem != 11 && Game.PlayerStats.SpecialItem != 9 &&
         Game.PlayerStats.SpecialItem != 10)
     {
         Player.AttachedLevel.ImpactEffectPool.DisplayDeathEffect(m_tollCollector.Position);
         SoundManager.PlaySound("Charon_Laugh");
         HideTollCollector();
     }
     else
     {
         Game.PlayerStats.SpokeToTollCollector = true;
         SoundManager.PlaySound("Charon_Laugh");
         m_tollCollector.ChangeSprite("NPCTollCollectorLaugh_Character");
         m_tollCollector.AnimationDelay = 0.05f;
         m_tollCollector.PlayAnimation();
         Tween.RunFunction(1f, Player.AttachedLevel.ImpactEffectPool, "DisplayDeathEffect",
                           m_tollCollector.Position);
         Tween.RunFunction(1f, this, "HideTollCollector");
     }
     if (Game.PlayerStats.SpecialItem == 1 || Game.PlayerStats.SpecialItem == 10 ||
         Game.PlayerStats.SpecialItem == 9 || Game.PlayerStats.SpecialItem == 13 ||
         Game.PlayerStats.SpecialItem == 11 || Game.PlayerStats.SpecialItem == 12)
     {
         if (Game.PlayerStats.SpecialItem == 9)
         {
             Game.PlayerStats.ChallengeEyeballUnlocked = true;
         }
         else if (Game.PlayerStats.SpecialItem == 10)
         {
             Game.PlayerStats.ChallengeSkullUnlocked = true;
         }
         else if (Game.PlayerStats.SpecialItem == 11)
         {
             Game.PlayerStats.ChallengeFireballUnlocked = true;
         }
         else if (Game.PlayerStats.SpecialItem == 12)
         {
             Game.PlayerStats.ChallengeBlobUnlocked = true;
         }
         else if (Game.PlayerStats.SpecialItem == 13)
         {
             Game.PlayerStats.ChallengeLastBossUnlocked = true;
         }
         Game.PlayerStats.SpecialItem = 0;
         Player.AttachedLevel.UpdatePlayerHUDSpecialItem();
     }
 }
예제 #3
0
        public static bool Upgraded(byte classType)
        {
            switch (classType)
            {
            case 0:
                return(SkillSystem.GetSkill(SkillType.Knight_Up).ModifierAmount > 0f);

            case 1:
                return(SkillSystem.GetSkill(SkillType.Mage_Up).ModifierAmount > 0f);

            case 2:
                return(SkillSystem.GetSkill(SkillType.Barbarian_Up).ModifierAmount > 0f);

            case 3:
                return(SkillSystem.GetSkill(SkillType.Assassin_Up).ModifierAmount > 0f);

            case 4:
                return(SkillSystem.GetSkill(SkillType.Ninja_Up).ModifierAmount > 0f);

            case 5:
                return(SkillSystem.GetSkill(SkillType.Banker_Up).ModifierAmount > 0f);

            case 6:
                return(SkillSystem.GetSkill(SkillType.SpellSword_Up).ModifierAmount > 0f);

            case 7:
                return(SkillSystem.GetSkill(SkillType.Lich_Up).ModifierAmount > 0f);

            default:
                return(false);
            }
        }
예제 #4
0
        public override void OnEnter()
        {
            var flag = true;

            foreach (var current in SkillSystem.SkillArray)
            {
                if (current.CurrentLevel < 1)
                {
                    flag = false;
                    break;
                }
            }
            if (flag)
            {
                GameUtil.UnlockAchievement("FEAR_OF_DECISIONS");
            }
            if (Game.PlayerStats.CurrentLevel >= 50)
            {
                GameUtil.UnlockAchievement("FEAR_OF_WEALTH");
            }
            m_lockControls = false;
            m_manor.GetChildAt(23).Visible = true;
            m_manor.GetChildAt(23).Opacity = 1f;
            Camera.Position = new Vector2(660f, 360f);
            var skillArray = SkillSystem.GetSkillArray();

            for (var i = 0; i < skillArray.Length; i++)
            {
                if (skillArray[i].CurrentLevel > 0)
                {
                    SetVisible(skillArray[i], false);
                }
            }
            if (!SoundManager.IsMusicPlaying)
            {
                SoundManager.PlayMusic("SkillTreeSong", true, 1f);
            }
            var skill = SkillSystem.GetSkill((int)m_selectedTraitIndex.X, (int)m_selectedTraitIndex.Y);

            m_selectionIcon.Position = SkillSystem.GetSkillPosition(skill);
            UpdateDescriptionPlate(skill);
            m_dialoguePlate.Visible = true;
            m_confirmText.Text      = "[Input:" + 0 + "] to purchase/upgrade skill";
            m_toggleIconsText.Text  = "[Input:" + 9 + "] to toggle icons off";
            m_continueText.Text     = "[Input:" + 2 + "] to exit the manor";
            if (InputManager.GamePadIsConnected(PlayerIndex.One))
            {
                m_navigationText.Text = "[Button:LeftStick] to navigate skills";
            }
            else
            {
                m_navigationText.Text = "Arrow keys to navigate skills";
            }
            SkillSystem.UpdateAllTraitSprites();
            base.OnEnter();
        }
예제 #5
0
 public void LoadSaveData()
 {
     SkillSystem.ResetAllTraits();
     Game.PlayerStats.Dispose();
     Game.PlayerStats = new PlayerStats();
     (ScreenManager as RCScreenManager).Player.Reset();
     (ScreenManager.Game as Game).SaveManager.LoadFiles(null, SaveType.PlayerData, SaveType.Lineage,
                                                        SaveType.UpgradeData);
     Game.ScreenManager.Player.CurrentHealth = Game.PlayerStats.CurrentHealth;
     Game.ScreenManager.Player.CurrentMana   = Game.PlayerStats.CurrentMana;
 }
예제 #6
0
 public void DeleteSave()
 {
     IsActive = false;
     Game.PlayerStats.Dispose();
     (m_parentScreen.ScreenManager.Game as Game).SaveManager.ClearAllFileTypes(false);
     (m_parentScreen.ScreenManager.Game as Game).SaveManager.ClearAllFileTypes(true);
     SkillSystem.ResetAllTraits();
     Game.PlayerStats = new PlayerStats();
     (m_parentScreen.ScreenManager as RCScreenManager).Player.Reset();
     SoundManager.StopMusic(1f);
     (m_parentScreen.ScreenManager as RCScreenManager).DisplayScreen(23, true);
 }
예제 #7
0
 public void StorePlayerData()
 {
     m_storedPlayerStats = Game.PlayerStats;
     Game.PlayerStats    = new PlayerStats();
     Game.PlayerStats.TutorialComplete = true;
     m_storedScale = Player.Scale;
     Player.Scale  = new Vector2(2f, 2f);
     SkillSystem.ResetAllTraits();
     Player.OverrideInternalScale(Player.Scale);
     StoredHP = Player.CurrentHealth;
     StoredMP = Player.CurrentMana;
 }
예제 #8
0
        public void SetSkillIconVisible(SkillObj skill)
        {
            var num = 0f;

            foreach (var current in SkillSystem.GetAllConnectingTraits(skill))
            {
                if (!current.Visible)
                {
                    current.Visible = true;
                    current.Opacity = 0f;
                    Tween.To(current, 0.2f, Linear.EaseNone, "Opacity", "1");
                    num += 0.2f;
                }
            }
            Tween.RunFunction(num, this, "UnlockControls");
            Tween.RunFunction(num, this, "CheckForSkillUnlock", skill, true);
        }
예제 #9
0
 public void UpdateSpellIcon()
 {
     m_spellIcon.Visible   = false;
     m_iconHolder1.Opacity = 0.5f;
     m_spellCost.Visible   = false;
     if (Game.PlayerStats.Spell != 0)
     {
         m_spellIcon.ChangeSprite(SpellType.Icon(Game.PlayerStats.Spell));
         m_spellIcon.Visible   = true;
         m_iconHolder1.Opacity = 1f;
         m_spellCost.Text      =
             (int)
             (SpellEV.GetManaCost(Game.PlayerStats.Spell) *
              (1f - SkillSystem.GetSkill(SkillType.Mana_Cost_Down).ModifierAmount)) + " mp";
         m_spellCost.Visible = true;
     }
 }
예제 #10
0
 public override void OnEnter()
 {
     m_lockControls = false;
     SoundManager.PlayMusic("SkillTreeSong", true, 1f);
     m_storedMusicVol = SoundManager.GlobalMusicVolume;
     SoundManager.GlobalMusicVolume = 0f;
     if (SoundManager.AudioEngine != null)
     {
         SoundManager.AudioEngine.GetCategory("Legacy").SetVolume(m_storedMusicVol);
     }
     if (Game.LineageSongCue != null && Game.LineageSongCue.IsPlaying)
     {
         Game.LineageSongCue.Stop(AudioStopOptions.Immediate);
         Game.LineageSongCue.Dispose();
     }
     Game.LineageSongCue = SoundManager.GetMusicCue("LegacySong");
     if (Game.LineageSongCue != null)
     {
         Game.LineageSongCue.Play();
     }
     LoadFamilyTreeData();
     LoadCurrentBranches();
     Camera.Position = m_selectedLineageObj.Position;
     UpdateDescriptionPlate();
     m_confirmText.Text = "[Input:" + 0 + "] to select a child";
     if (InputManager.GamePadIsConnected(PlayerIndex.One))
     {
         m_navigationText.Text = "[Button:LeftStick] to view family tree";
     }
     else
     {
         m_navigationText.Text = "Arrow keys to view family tree";
     }
     m_rerollText.Text = "[Input:" + 9 + "] to re-roll your children once";
     if (SkillSystem.GetSkill(SkillType.Randomize_Children).ModifierAmount > 0f &&
         !Game.PlayerStats.RerolledChildren)
     {
         m_rerollText.Visible = true;
     }
     else
     {
         m_rerollText.Visible = false;
     }
     base.OnEnter();
 }
예제 #11
0
        public override void Draw(GameTime gameTime)
        {
            m_cloud1.Y = (m_cloud2.Y = (m_cloud3.Y = (m_cloud4.Y = (m_cloud5.Y = Camera.TopLeftCorner.Y * 0.2f))));
            m_bg.Y     = Camera.TopLeftCorner.Y * 0.2f;
            Camera.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, null,
                         Camera.GetTransformation());
            m_bg.Draw(Camera);
            m_cloud1.Draw(Camera);
            m_cloud2.Draw(Camera);
            m_cloud3.Draw(Camera);
            m_cloud4.Draw(Camera);
            m_cloud5.Draw(Camera);
            Camera.GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp;
            m_manor.Draw(Camera);
            m_impactEffectPool.Draw(Camera);
            Camera.GraphicsDevice.SamplerStates[0] = SamplerState.LinearClamp;
            m_selectionIcon.Draw(Camera);
            var skillArray = SkillSystem.GetSkillArray();

            for (var i = 0; i < skillArray.Length; i++)
            {
                var skillObj = skillArray[i];
                if (skillObj.TraitType != SkillType.Filler && skillObj.TraitType != SkillType.Null && skillObj.Visible)
                {
                    skillObj.Draw(Camera);
                }
            }
            Camera.End();
            Camera.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null);
            m_dialoguePlate.Draw(Camera);
            m_continueText.Draw(Camera);
            m_toggleIconsText.Draw(Camera);
            m_confirmText.Draw(Camera);
            m_navigationText.Draw(Camera);
            m_playerMoney.Draw(Camera);
            Camera.GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp;
            m_descriptionDivider.Draw(Camera);
            m_coinIcon.Draw(Camera);
            Camera.End();
            base.Draw(gameTime);
        }
예제 #12
0
        public void SetVisible(SkillObj trait, bool fadeIn)
        {
            var manorPiece = SkillSystem.GetManorPiece(trait);

            if (fadeIn)
            {
                SetManorPieceVisible(manorPiece, trait);
                return;
            }
            var childAt = m_manor.GetChildAt(manorPiece);

            childAt.Opacity = 1f;
            childAt.Visible = true;
            foreach (var current in SkillSystem.GetAllConnectingTraits(trait))
            {
                if (!current.Visible)
                {
                    current.Visible = true;
                    current.Opacity = 1f;
                }
            }
            if (m_manor.GetChildAt(7).Visible&& m_manor.GetChildAt(16).Visible)
            {
                (m_manor.GetChildAt(7) as SpriteObj).GoToFrame(2);
            }
            if (m_manor.GetChildAt(6).Visible&& m_manor.GetChildAt(16).Visible)
            {
                (m_manor.GetChildAt(6) as SpriteObj).GoToFrame(2);
            }
            if (m_manor.GetChildAt(2).Visible)
            {
                var spriteObj = m_manor.GetChildAt(32) as SpriteObj;
                spriteObj.Visible = true;
                spriteObj.Opacity = 1f;
                spriteObj.PlayAnimation();
                spriteObj.OverrideParentAnimationDelay = true;
                spriteObj.AnimationDelay = 0.0333333351f;
                spriteObj.Visible        = true;
            }
        }
예제 #13
0
        public static byte GetRandomClass()
        {
            var list = new List <byte> {
                0, 1, 2, 3
            };

            if (SkillSystem.GetSkill(SkillType.Ninja_Unlock).ModifierAmount > 0f)
            {
                list.Add(4);
            }
            if (SkillSystem.GetSkill(SkillType.Banker_Unlock).ModifierAmount > 0f)
            {
                list.Add(5);
            }
            if (SkillSystem.GetSkill(SkillType.Spellsword_Unlock).ModifierAmount > 0f)
            {
                list.Add(6);
            }
            if (SkillSystem.GetSkill(SkillType.Lich_Unlock).ModifierAmount > 0f)
            {
                list.Add(7);
            }
            if (SkillSystem.GetSkill(SkillType.SuperSecret).ModifierAmount > 0f)
            {
                list.Add(16);
            }
            if (Game.PlayerStats.ChallengeLastBossBeaten)
            {
                list.Add(17);
            }
            var b = list[CDGMath.RandomInt(0, list.Count - 1)];

            if (Upgraded(b))
            {
                b += 8;
            }
            return(b);
        }
예제 #14
0
 private void HandleInput()
 {
     if (!m_controlsLocked)
     {
         if (Player.State != 4)
         {
             if (m_blacksmithIcon.Visible &&
                 (Game.GlobalInput.JustPressed(16) || Game.GlobalInput.JustPressed(17)))
             {
                 MovePlayerTo(m_blacksmith);
             }
             if (m_enchantressIcon.Visible &&
                 (Game.GlobalInput.JustPressed(16) || Game.GlobalInput.JustPressed(17)))
             {
                 MovePlayerTo(m_enchantress);
             }
             if (m_architectIcon.Visible &&
                 (Game.GlobalInput.JustPressed(16) || Game.GlobalInput.JustPressed(17)))
             {
                 var rCScreenManager = Player.AttachedLevel.ScreenManager as RCScreenManager;
                 if ((Game.ScreenManager.Game as Game).SaveManager.FileExists(SaveType.Map))
                 {
                     if (!Game.PlayerStats.LockCastle)
                     {
                         if (!Game.PlayerStats.SpokeToArchitect)
                         {
                             Game.PlayerStats.SpokeToArchitect = true;
                             rCScreenManager.DialogueScreen.SetDialogue("Meet Architect");
                         }
                         else
                         {
                             rCScreenManager.DialogueScreen.SetDialogue("Meet Architect 2");
                         }
                         rCScreenManager.DialogueScreen.SetDialogueChoice("ConfirmTest1");
                         rCScreenManager.DialogueScreen.SetConfirmEndHandler(this, "ActivateArchitect");
                         rCScreenManager.DialogueScreen.SetCancelEndHandler(typeof(Console), "WriteLine",
                                                                            "Canceling Selection");
                     }
                     else
                     {
                         rCScreenManager.DialogueScreen.SetDialogue("Castle Already Locked Architect");
                     }
                 }
                 else
                 {
                     rCScreenManager.DialogueScreen.SetDialogue("No Castle Architect");
                 }
                 rCScreenManager.DisplayScreen(13, true);
             }
         }
         if (m_tollCollectorIcon.Visible &&
             (Game.GlobalInput.JustPressed(16) || Game.GlobalInput.JustPressed(17)))
         {
             var rCScreenManager2 = Player.AttachedLevel.ScreenManager as RCScreenManager;
             if (Game.PlayerStats.SpecialItem == 1)
             {
                 Tween.RunFunction(0.1f, this, "TollPaid", false);
                 rCScreenManager2.DialogueScreen.SetDialogue("Toll Collector Obol");
                 rCScreenManager2.DisplayScreen(13, true);
                 return;
             }
             if (Game.PlayerStats.SpecialItem == 9)
             {
                 rCScreenManager2.DialogueScreen.SetDialogue("Challenge Icon Eyeball");
                 RunTollPaidSelection(rCScreenManager2);
                 return;
             }
             if (Game.PlayerStats.SpecialItem == 10)
             {
                 rCScreenManager2.DialogueScreen.SetDialogue("Challenge Icon Skull");
                 RunTollPaidSelection(rCScreenManager2);
                 return;
             }
             if (Game.PlayerStats.SpecialItem == 11)
             {
                 rCScreenManager2.DialogueScreen.SetDialogue("Challenge Icon Fireball");
                 RunTollPaidSelection(rCScreenManager2);
                 return;
             }
             if (Game.PlayerStats.SpecialItem == 12)
             {
                 rCScreenManager2.DialogueScreen.SetDialogue("Challenge Icon Blob");
                 RunTollPaidSelection(rCScreenManager2);
                 return;
             }
             if (Game.PlayerStats.SpecialItem == 13)
             {
                 rCScreenManager2.DialogueScreen.SetDialogue("Challenge Icon Last Boss");
                 RunTollPaidSelection(rCScreenManager2);
                 return;
             }
             if (!Game.PlayerStats.SpokeToTollCollector)
             {
                 rCScreenManager2.DialogueScreen.SetDialogue("Meet Toll Collector 1");
             }
             else
             {
                 var num = SkillSystem.GetSkill(SkillType.Prices_Down).ModifierAmount *100f;
                 rCScreenManager2.DialogueScreen.SetDialogue("Meet Toll Collector Skip" +
                                                             (int)Math.Round(num, MidpointRounding.AwayFromZero));
             }
             RunTollPaidSelection(rCScreenManager2);
         }
     }
 }
예제 #15
0
 public override void HandleInput()
 {
     if (!m_cameraTweening && !m_lockControls)
     {
         var flag = false;
         if (Game.GlobalInput.JustPressed(9))
         {
             if (SkillSystem.IconsVisible)
             {
                 m_toggleIconsText.Text   = "[Input:" + 9 + "] to toggle icons on";
                 m_confirmText.Visible    = false;
                 m_continueText.Visible   = false;
                 m_navigationText.Visible = false;
                 SkillSystem.HideAllIcons();
                 m_selectionIcon.Opacity      = 0f;
                 m_dialoguePlate.Opacity      = 0f;
                 m_descriptionDivider.Opacity = 0f;
                 m_coinIcon.Opacity           = 0f;
                 m_playerMoney.Opacity        = 0f;
                 m_titleText.Opacity          = 0f;
             }
             else
             {
                 m_toggleIconsText.Text   = "[Input:" + 9 + "] to toggle icons off";
                 m_confirmText.Visible    = true;
                 m_continueText.Visible   = true;
                 m_navigationText.Visible = true;
                 SkillSystem.ShowAllIcons();
                 m_selectionIcon.Opacity      = 1f;
                 m_dialoguePlate.Opacity      = 1f;
                 m_descriptionDivider.Opacity = 1f;
                 m_coinIcon.Opacity           = 1f;
                 m_playerMoney.Opacity        = 1f;
                 m_titleText.Opacity          = 1f;
             }
             flag = true;
         }
         if (SkillSystem.IconsVisible)
         {
             var selectedTraitIndex = m_selectedTraitIndex;
             var vector             = new Vector2(-1f, -1f);
             if (Game.GlobalInput.JustPressed(16) || Game.GlobalInput.JustPressed(17))
             {
                 vector =
                     SkillSystem.GetSkillLink((int)m_selectedTraitIndex.X, (int)m_selectedTraitIndex.Y).TopLink;
                 var skill = SkillSystem.GetSkill(SkillType.SuperSecret);
                 if (!m_cameraTweening && skill.Visible && vector == new Vector2(7f, 1f))
                 {
                     m_cameraTweening = true;
                     Tween.To(Camera, 0.5f, Quad.EaseOut, "Y", 60f.ToString());
                     Tween.AddEndHandlerToLastTween(this, "EndCameraTween");
                 }
             }
             else if (Game.GlobalInput.JustPressed(18) || Game.GlobalInput.JustPressed(19))
             {
                 vector =
                     SkillSystem.GetSkillLink((int)m_selectedTraitIndex.X, (int)m_selectedTraitIndex.Y)
                     .BottomLink;
             }
             if (Game.GlobalInput.JustPressed(20) || Game.GlobalInput.JustPressed(21))
             {
                 vector =
                     SkillSystem.GetSkillLink((int)m_selectedTraitIndex.X, (int)m_selectedTraitIndex.Y)
                     .LeftLink;
             }
             else if (Game.GlobalInput.JustPressed(22) || Game.GlobalInput.JustPressed(23))
             {
                 vector =
                     SkillSystem.GetSkillLink((int)m_selectedTraitIndex.X, (int)m_selectedTraitIndex.Y)
                     .RightLink;
             }
             if (vector.X != -1f && vector.Y != -1f)
             {
                 var skill2 = SkillSystem.GetSkill((int)vector.X, (int)vector.Y);
                 if (skill2.TraitType != SkillType.Null && skill2.Visible)
                 {
                     m_selectedTraitIndex = vector;
                 }
             }
             if (selectedTraitIndex != m_selectedTraitIndex)
             {
                 var skill3 = SkillSystem.GetSkill((int)m_selectedTraitIndex.X,
                                                   (int)m_selectedTraitIndex.Y);
                 m_selectionIcon.Position = SkillSystem.GetSkillPosition(skill3);
                 UpdateDescriptionPlate(skill3);
                 SoundManager.PlaySound("ShopMenuMove");
                 skill3.Scale = new Vector2(1.1f, 1.1f);
                 Tween.To(skill3, 0.1f, Back.EaseOutLarge, "ScaleX", "1", "ScaleY", "1");
                 m_dialoguePlate.Visible = true;
             }
             var skill4 = SkillSystem.GetSkill((int)m_selectedTraitIndex.X, (int)m_selectedTraitIndex.Y);
             if ((Game.GlobalInput.JustPressed(0) || Game.GlobalInput.JustPressed(1)) &&
                 Game.PlayerStats.Gold >= skill4.TotalCost && skill4.CurrentLevel < skill4.MaxLevel)
             {
                 SoundManager.PlaySound("TraitUpgrade");
                 if (!m_fadingIn)
                 {
                     Game.PlayerStats.Gold -= skill4.TotalCost;
                     SetVisible(skill4, true);
                     SkillSystem.LevelUpTrait(skill4, true);
                     if (skill4.CurrentLevel >= skill4.MaxLevel)
                     {
                         SoundManager.PlaySound("TraitMaxxed");
                     }
                     UpdateDescriptionPlate(skill4);
                 }
             }
             else if ((Game.GlobalInput.JustPressed(0) || Game.GlobalInput.JustPressed(1)) &&
                      Game.PlayerStats.Gold < skill4.TotalCost)
             {
                 SoundManager.PlaySound("TraitPurchaseFail");
             }
             if (Game.GlobalInput.JustPressed(2) || (Game.GlobalInput.JustPressed(3) && !flag))
             {
                 m_lockControls = true;
                 var rCScreenManager = ScreenManager as RCScreenManager;
                 var levelScreen     = rCScreenManager.GetLevelScreen();
                 levelScreen.Reset();
                 if (levelScreen.CurrentRoom is StartingRoomObj)
                 {
                     rCScreenManager.StartWipeTransition();
                     Tween.RunFunction(0.2f, rCScreenManager, "HideCurrentScreen");
                     Tween.RunFunction(0.2f, levelScreen.CurrentRoom, "OnEnter");
                 }
                 else
                 {
                     (ScreenManager as RCScreenManager).DisplayScreen(15, true);
                 }
             }
             if (!LevelEV.RUN_DEMO_VERSION && !LevelEV.CREATE_RETAIL_VERSION &&
                 InputManager.JustPressed(Keys.Q, PlayerIndex.One))
             {
                 foreach (var current in SkillSystem.SkillArray)
                 {
                     if (current.CurrentLevel < current.MaxLevel)
                     {
                         SetVisible(current, false);
                         SkillSystem.LevelUpTrait(current, false);
                         CheckForSkillUnlock(current, false);
                     }
                 }
             }
         }
         base.HandleInput();
     }
 }
예제 #16
0
 public override void HandleInput()
 {
     if (!m_lockControls)
     {
         var selectedSlot = m_selectedSlot;
         if (Game.GlobalInput.JustPressed(18) || Game.GlobalInput.JustPressed(19))
         {
             m_selectedIndex++;
             if (m_selectedIndex >= m_slotArray.Count)
             {
                 m_selectedIndex = 0;
             }
             m_selectedSlot = m_slotArray[m_selectedIndex];
             SoundManager.PlaySound("frame_swap");
             m_deleteProfileText.Visible = true;
             if (m_selectedSlot.ID == 0)
             {
                 m_deleteProfileText.Visible = false;
             }
         }
         if (Game.GlobalInput.JustPressed(16) || Game.GlobalInput.JustPressed(17))
         {
             m_selectedIndex--;
             if (m_selectedIndex < 0)
             {
                 m_selectedIndex = m_slotArray.Count - 1;
             }
             m_selectedSlot = m_slotArray[m_selectedIndex];
             SoundManager.PlaySound("frame_swap");
             m_deleteProfileText.Visible = true;
             if (m_selectedSlot.ID == 0)
             {
                 m_deleteProfileText.Visible = false;
             }
         }
         if (m_selectedSlot != selectedSlot)
         {
             selectedSlot.TextureColor   = Color.White;
             m_selectedSlot.TextureColor = Color.Yellow;
         }
         if (Game.GlobalInput.JustPressed(2) || Game.GlobalInput.JustPressed(3))
         {
             ExitTransition();
         }
         if (Game.GlobalInput.JustPressed(0) || Game.GlobalInput.JustPressed(1))
         {
             SoundManager.PlaySound("Map_On");
             Game.GameConfig.ProfileSlot = (byte)(m_selectedIndex + 1);
             var game = ScreenManager.Game as Game;
             game.SaveConfig();
             if (game.SaveManager.FileExists(SaveType.PlayerData))
             {
                 (ScreenManager as RCScreenManager).DisplayScreen(3, true);
             }
             else
             {
                 SkillSystem.ResetAllTraits();
                 Game.PlayerStats.Dispose();
                 Game.PlayerStats = new PlayerStats();
                 (ScreenManager as RCScreenManager).Player.Reset();
                 Game.ScreenManager.Player.CurrentHealth = Game.PlayerStats.CurrentHealth;
                 Game.ScreenManager.Player.CurrentMana   = Game.PlayerStats.CurrentMana;
                 (ScreenManager as RCScreenManager).DisplayScreen(23, true);
             }
         }
         if (Game.GlobalInput.JustPressed(26) && m_deleteProfileText.Visible)
         {
             SoundManager.PlaySound("Map_On");
             DeleteSaveAsk();
         }
     }
     base.HandleInput();
 }
예제 #17
0
        public void GiveReward(PlayerObj player, TextManager textManager)
        {
            switch (DropType)
            {
            case 1:
            case 10:
            case 11:
            {
                player.AttachedLevel.ItemDropCollected(DropType);
                var num = 1f;
                if (Game.PlayerStats.HasArchitectFee)
                {
                    num = 0.6f;
                }
                var num2 =
                    (int)Math.Round(m_amount * (1f + player.TotalGoldBonus) * num, MidpointRounding.AwayFromZero);
                Game.PlayerStats.Gold += num2;
                textManager.DisplayNumberStringText(num2, "gold", Color.Yellow, new Vector2(X, Bounds.Top));
                if (DropType == 10)
                {
                    PlayAnimation(1, 1);
                }
                break;
            }

            case 2:
            {
                var num3 =
                    (int)(player.MaxHealth * (m_amount + SkillSystem.GetSkill(SkillType.Potion_Up).ModifierAmount));
                player.CurrentHealth += num3;
                textManager.DisplayNumberStringText(num3, "hp recovered", Color.LawnGreen,
                                                    new Vector2(X, Bounds.Top));
                SoundManager.Play3DSound(this, Game.ScreenManager.Player, "Collect_Health");
                return;
            }

            case 3:
            {
                var num4 =
                    (int)(player.MaxMana * (m_amount + SkillSystem.GetSkill(SkillType.Potion_Up).ModifierAmount));
                player.CurrentMana += num4;
                textManager.DisplayNumberStringText(num4, "mp recovered", Color.LawnGreen,
                                                    new Vector2(X, Bounds.Top));
                SoundManager.Play3DSound(this, Game.ScreenManager.Player, "Collect_Mana");
                return;
            }

            case 4:
                Game.PlayerStats.BonusStrength++;
                textManager.DisplayStringNumberText("Attack Up", 1, Color.LightSteelBlue, new Vector2(X, Bounds.Top));
                return;

            case 5:
                Game.PlayerStats.BonusMagic++;
                textManager.DisplayStringNumberText("Magic Up", 1, Color.LightSteelBlue, new Vector2(X, Bounds.Top));
                return;

            case 6:
                Game.PlayerStats.BonusDefense++;
                textManager.DisplayStringNumberText("Armor Up", 2, Color.LightSteelBlue, new Vector2(X, Bounds.Top));
                return;

            case 7:
                Game.PlayerStats.BonusHealth++;
                textManager.DisplayStringNumberText("Max Health Up", 5, Color.LightSteelBlue,
                                                    new Vector2(X, Bounds.Top));
                player.CurrentHealth += 5;
                return;

            case 8:
                Game.PlayerStats.BonusMana++;
                textManager.DisplayStringNumberText("Max Mana Up", 5, Color.LightSteelBlue,
                                                    new Vector2(X, Bounds.Top));
                player.CurrentMana += 5f;
                return;

            case 9:
                Game.PlayerStats.BonusWeight++;
                textManager.DisplayStringNumberText("Max Weight Up", 5, Color.LightSteelBlue,
                                                    new Vector2(X, Bounds.Top));
                break;

            default:
                return;
            }
        }
예제 #18
0
 public override void HandleInput()
 {
     if (!m_lockControls && (m_selectTween == null || (m_selectTween != null && !m_selectTween.Active)))
     {
         var selectedLineageObj   = m_selectedLineageObj;
         var selectedLineageIndex = m_selectedLineageIndex;
         if (Game.GlobalInput.JustPressed(9) &&
             SkillSystem.GetSkill(SkillType.Randomize_Children).ModifierAmount > 0f &&
             !Game.PlayerStats.RerolledChildren)
         {
             m_lockControls = true;
             SoundManager.PlaySound("frame_woosh_01", "frame_woosh_02");
             if (m_xShift != 0)
             {
                 m_xShift = 0;
                 Tween.By(m_descriptionPlate, 0.2f, Back.EaseOut, "delay", "0.2", "X", "-600");
                 m_selectTween = Tween.To(Camera, 0.3f, Quad.EaseOut, "delay", "0.2", "X",
                                          (m_masterArray.Count * m_xPosOffset).ToString());
             }
             (ScreenManager as RCScreenManager).StartWipeTransition();
             Tween.RunFunction(0.2f, this, "RerollCurrentBranch");
         }
         if (Game.GlobalInput.Pressed(20) || Game.GlobalInput.Pressed(21))
         {
             if (Camera.X > m_masterArray[0].X + 10f)
             {
                 SoundManager.PlaySound("frame_swoosh_01");
                 m_selectTween = Tween.By(Camera, 0.3f, Quad.EaseOut, "X", (-m_xPosOffset).ToString());
                 if (m_xShift == 0)
                 {
                     Tween.By(m_descriptionPlate, 0.2f, Back.EaseIn, "X", "600");
                 }
                 m_xShift--;
             }
         }
         else if ((Game.GlobalInput.Pressed(22) || Game.GlobalInput.Pressed(23)) && m_xShift < 0)
         {
             SoundManager.PlaySound("frame_swoosh_01");
             m_selectTween = Tween.By(Camera, 0.3f, Quad.EaseOut, "X", m_xPosOffset.ToString());
             m_xShift++;
             if (m_xShift == 0)
             {
                 Tween.By(m_descriptionPlate, 0.2f, Back.EaseOut, "X", "-600");
             }
         }
         if (m_xShift == 0)
         {
             if (Game.GlobalInput.JustPressed(16) || Game.GlobalInput.JustPressed(17))
             {
                 if (m_selectedLineageIndex > 0)
                 {
                     SoundManager.PlaySound("frame_swap");
                 }
                 m_selectedLineageIndex--;
                 if (m_selectedLineageIndex < 0)
                 {
                     m_selectedLineageIndex = 0;
                 }
                 if (m_selectedLineageIndex != selectedLineageIndex)
                 {
                     UpdateDescriptionPlate();
                     m_selectTween = Tween.By(m_currentBranchArray[0], 0.3f, Quad.EaseOut, "Y", "450");
                     Tween.By(m_currentBranchArray[1], 0.3f, Quad.EaseOut, "Y", "450");
                     Tween.By(m_currentBranchArray[2], 0.3f, Quad.EaseOut, "Y", "450");
                 }
             }
             else if (Game.GlobalInput.JustPressed(18) || Game.GlobalInput.JustPressed(19))
             {
                 if (m_selectedLineageIndex < m_currentBranchArray.Count - 1)
                 {
                     SoundManager.PlaySound("frame_swap");
                 }
                 m_selectedLineageIndex++;
                 if (m_selectedLineageIndex > m_currentBranchArray.Count - 1)
                 {
                     m_selectedLineageIndex = m_currentBranchArray.Count - 1;
                 }
                 if (m_selectedLineageIndex != selectedLineageIndex)
                 {
                     UpdateDescriptionPlate();
                     m_selectTween = Tween.By(m_currentBranchArray[0], 0.3f, Quad.EaseOut, "Y", "-450");
                     Tween.By(m_currentBranchArray[1], 0.3f, Quad.EaseOut, "Y", "-450");
                     Tween.By(m_currentBranchArray[2], 0.3f, Quad.EaseOut, "Y", "-450");
                 }
             }
         }
         m_selectedLineageObj = m_currentBranchArray[m_selectedLineageIndex];
         if (Game.GlobalInput.JustPressed(0) || Game.GlobalInput.JustPressed(1))
         {
             if (m_xShift == 0)
             {
                 if (selectedLineageObj == m_selectedLineageObj)
                 {
                     var rCScreenManager = ScreenManager as RCScreenManager;
                     rCScreenManager.DialogueScreen.SetDialogue("LineageChoiceWarning");
                     rCScreenManager.DialogueScreen.SetDialogueChoice("ConfirmTest1");
                     rCScreenManager.DialogueScreen.SetConfirmEndHandler(this, "StartGame");
                     rCScreenManager.DialogueScreen.SetCancelEndHandler(typeof(Console), "WriteLine",
                                                                        "Canceling Selection");
                     (ScreenManager as RCScreenManager).DisplayScreen(13, true);
                 }
             }
             else
             {
                 m_xShift = 0;
                 SoundManager.PlaySound("frame_woosh_01", "frame_woosh_02");
                 Tween.By(m_descriptionPlate, 0.2f, Back.EaseOut, "X", "-600");
                 m_selectTween = Tween.To(Camera, 0.3f, Quad.EaseOut, "X",
                                          (m_masterArray.Count * m_xPosOffset).ToString());
             }
         }
         base.HandleInput();
     }
 }
예제 #19
0
 protected override void LoadContent()
 {
     if (!m_contentLoaded)
     {
         m_contentLoaded = true;
         LoadAllSpriteFonts();
         LoadAllEffects();
         LoadAllSpritesheets();
         SoundManager.Initialize("Content\\Audio\\RogueCastleXACTProj.xgs");
         SoundManager.LoadWaveBank("Content\\Audio\\SFXWaveBank.xwb");
         SoundManager.LoadWaveBank("Content\\Audio\\MusicWaveBank.xwb", true);
         SoundManager.LoadSoundBank("Content\\Audio\\SFXSoundBank.xsb");
         SoundManager.LoadSoundBank("Content\\Audio\\MusicSoundBank.xsb", true);
         SoundManager.GlobalMusicVolume = GameConfig.MusicVolume;
         SoundManager.GlobalSFXVolume   = GameConfig.SFXVolume;
         if (InputManager.GamePadIsConnected(PlayerIndex.One))
         {
             InputManager.SetPadType(PlayerIndex.One, PadTypes.GamePad);
         }
         InputManager.UseDirectInput = GameConfig.EnableDirectInput;
         GenericTexture = new Texture2D(GraphicsDevice, 1, 1);
         GenericTexture.SetData(new[]
         {
             Color.White
         });
         if (!LevelEV.LOAD_SPLASH_SCREEN)
         {
             LevelBuilder2.Initialize();
             LevelParser.ParseRooms("Map_1x1", Content);
             LevelParser.ParseRooms("Map_1x2", Content);
             LevelParser.ParseRooms("Map_1x3", Content);
             LevelParser.ParseRooms("Map_2x1", Content);
             LevelParser.ParseRooms("Map_2x2", Content);
             LevelParser.ParseRooms("Map_2x3", Content);
             LevelParser.ParseRooms("Map_3x1", Content);
             LevelParser.ParseRooms("Map_3x2", Content);
             LevelParser.ParseRooms("Map_Special", Content);
             LevelParser.ParseRooms("Map_DLC1", Content, true);
             LevelBuilder2.IndexRoomList();
         }
         SkillSystem.Initialize();
         var areaStruct = new AreaStruct
         {
             Name        = "The Grand Entrance",
             LevelType   = GameTypes.LevelType.CASTLE,
             TotalRooms  = new Vector2(24f, 28f),
             BossInArea  = true,
             SecretRooms = new Vector2(1f, 3f),
             BonusRooms  = new Vector2(2f, 3f),
             Color       = Color.White
         };
         var areaStruct2 = new AreaStruct
         {
             LevelType   = GameTypes.LevelType.GARDEN,
             TotalRooms  = new Vector2(23f, 27f),
             BossInArea  = true,
             SecretRooms = new Vector2(1f, 3f),
             BonusRooms  = new Vector2(2f, 3f),
             Color       = Color.Green
         };
         var areaStruct3 = new AreaStruct
         {
             LevelType   = GameTypes.LevelType.TOWER,
             TotalRooms  = new Vector2(23f, 27f),
             BossInArea  = true,
             SecretRooms = new Vector2(1f, 3f),
             BonusRooms  = new Vector2(2f, 3f),
             Color       = Color.DarkBlue
         };
         var areaStruct4 = new AreaStruct
         {
             LevelType   = GameTypes.LevelType.DUNGEON,
             TotalRooms  = new Vector2(23f, 27f),
             BossInArea  = true,
             SecretRooms = new Vector2(1f, 3f),
             BonusRooms  = new Vector2(2f, 3f),
             Color       = Color.Red
         };
         var areaStruct5 = new AreaStruct
         {
             Name        = "The Grand Entrance",
             LevelType   = GameTypes.LevelType.CASTLE,
             TotalRooms  = new Vector2(24f, 27f),
             BossInArea  = true,
             SecretRooms = new Vector2(2f, 3f),
             BonusRooms  = new Vector2(2f, 3f),
             Color       = Color.White
         };
         var areaStruct6 = default(AreaStruct);
         areaStruct6.Name        = "The Grand Entrance";
         areaStruct6.LevelType   = GameTypes.LevelType.GARDEN;
         areaStruct6.TotalRooms  = new Vector2(12f, 14f);
         areaStruct6.BossInArea  = true;
         areaStruct6.SecretRooms = new Vector2(2f, 3f);
         areaStruct6.BonusRooms  = new Vector2(1f, 2f);
         areaStruct6.Color       = Color.Green;
         var areaStruct7 = default(AreaStruct);
         areaStruct7.Name        = "The Grand Entrance";
         areaStruct7.LevelType   = GameTypes.LevelType.DUNGEON;
         areaStruct7.TotalRooms  = new Vector2(12f, 14f);
         areaStruct7.BossInArea  = true;
         areaStruct7.SecretRooms = new Vector2(2f, 3f);
         areaStruct7.BonusRooms  = new Vector2(1f, 2f);
         areaStruct7.Color       = Color.Red;
         var areaStruct8 = default(AreaStruct);
         areaStruct8.Name        = "The Grand Entrance";
         areaStruct8.LevelType   = GameTypes.LevelType.TOWER;
         areaStruct8.TotalRooms  = new Vector2(12f, 14f);
         areaStruct8.BossInArea  = true;
         areaStruct8.SecretRooms = new Vector2(2f, 3f);
         areaStruct8.BonusRooms  = new Vector2(1f, 2f);
         areaStruct8.Color       = Color.DarkBlue;
         Area1List = new[]
         {
             areaStruct,
             areaStruct2,
             areaStruct3,
             areaStruct4
         };
         if (LevelEV.RUN_DEMO_VERSION)
         {
             Area1List = new[]
             {
                 areaStruct5
             };
         }
     }
 }