예제 #1
0
        public override void RightClick(Player player)
        {
            DBTPlayer dbtPlayer = player.GetModPlayer <DBTPlayer>();

            dbtPlayer.WishActive = true;
            SoundHelper.PlayCustomSound("Sounds/DBSummon", player, 0.5f);
            dbtPlayer.DestroyOneOfEachDragonBall(dbtPlayer.player);
        }
예제 #2
0
        private void GrantWish(UIMouseEvent evt, UIElement listeningElement)
        {
            Player    player    = Main.LocalPlayer;
            DBTPlayer modPlayer = Main.LocalPlayer.GetModPlayer <DBTPlayer>();
            bool      usedWish  = false;

            switch (wishSelection)
            {
            case WishSelectionID.Power:
                if (modPlayer.PowerWishesLeft > 0)
                {
                    usedWish = true;
                    DoPowerWish();
                    SoundHelper.PlayCustomSound("Sounds/WishGranted", player.Center);
                }
                else
                {
                    Main.PlaySound(SoundID.MenuClose);
                }
                break;

            case WishSelectionID.Wealth:
                usedWish = true;
                DoWealthWish();
                SoundHelper.PlayCustomSound("Sounds/WishGranted", player.Center);
                break;

            case WishSelectionID.Immortality:
                if (modPlayer.ImmortalityWishesLeft > 0)
                {
                    usedWish = true;
                    DoImmortalityWish();
                    SoundHelper.PlayCustomSound("Sounds/WishGranted", player.Center);
                }
                else
                {
                    Main.PlaySound(SoundID.MenuClose);
                }
                break;

            case WishSelectionID.Genetic:
                usedWish = true;
                DoGeneticWish();
                SoundHelper.PlayCustomSound("Sounds/WishGranted", player.Center);
                break;

            case WishSelectionID.Awakening:
                if (modPlayer.AwakeningWishesLeft > 0)
                {
                    usedWish = true;
                    DoAwakeningWish();
                    SoundHelper.PlayCustomSound("Sounds/WishGranted", player.Center);
                }
                else
                {
                    Main.PlaySound(SoundID.MenuClose);
                }
                break;

            default:
                break;
            }

            if (usedWish)
            {
                wishSelection = WishSelectionID.None;
                modPlayer.DestroyOneOfEachDragonBall(modPlayer.player);
                modPlayer.WishActive = false;
                Main.PlaySound(SoundID.MenuClose);
            }

            Initialize();
        }