예제 #1
0
        private void upgradeButton_MouseClick(object sender, MouseEventArgs e)
        {
            long cost = costs["Upgrade"];

            if (_state.Player.Wallet.Coins - cost < 0)
            {
                VendorTextBox.Text = vendorDialog[vendor][2];
            }
            else
            {
                if (_state.Player.Tiers[0] < 250)
                {
                    MessageBox.Show("You have to max out your Normal Tier before being able to uncap the vendor.");
                }
                else
                {
                    if (_state.Player.VendorCap + 1 <= _state.GetCap())
                    {
                        _state.Player.Wallet.Coins -= cost;
                        _state.Player.VendorCap++;
                        VendorTextBox.Text = vendorDialog[vendor][1];
                        UpdatePlayerCoins(_state.Player.Wallet.Coins);
                        RollWares();
                        _state.Save.SaveGame(_state.Player);
                    }
                    else
                    {
                        MessageBox.Show("Your shop is currently at max level.");
                    }
                }
            }
        }
예제 #2
0
        private void ProcessDamage(Enemy target, int t)
        {
            _dungeon.UpdateEnemyHealth();
            if (target.HP == 0)
            {
                if (!_dungeon.IsTroopDead())
                {
                    // disable current checked button and check a new button
                    SetTargetButtonEnabled(t, false);
                    ChangeTargetButtonChecked();
                    CheckTurnEnd();
                }
                else
                {
                    // distribute loot
                    _dungeon.DistributeLoot();

                    // increment fight counters
                    _dh.IncrementFightCounter();
                    if (_dh.GetFightCounter() >= 0)
                    {
                        UpdateFightCounter();                                                                                                                                    // update fight counter
                        _state.Player.Wallet.AddDellenCoin(_state.Random.Next(100, 201) * _dh.GetFightCounter() * (_state.DungeonType + 1) * (_state.Player.Minions.Count + 1)); // get paid for last fight
                        _dungeon.SetUpEnemyGUI();                                                                                                                                // load another set of fighters if we still have more fights left
                        InitializeHPAndTurns();                                                                                                                                  // reset the HP to maxg
                    }
                    else
                    {
                        // end the dungeon
                        _state.Music.Stop();
                        if (_state.DungeonType == Enemies.DungeonType.FINAL)
                        {
                            string[] d =
                            {
                                "The time has come.",
                                "You have slain the Ascended God, Rickeus Martineus.",
                                "You truly are a gamer.",
                                $"Now, the world will fear the wrath of {_state.Player.Name}",
                                "If you take a screencap of this dialog box, you may even end up in the RPGMaker game!!!!",
                                "Anyway, that's all the content I have for you.",
                                "You will not get anything new beyond this point so that's about it.",
                                "This is the end.",
                                "Goodbye."
                            };

                            DialogBox db = new DialogBox(d);
                            db.StartPosition = FormStartPosition.Manual;
                            db.Location      = _state.Location;
                            db.ShowDialog();
                        }
                        else
                        {
                            MessageBox.Show("Dungeon Complete.");
                            _state.ProcessCompletedTier(battleMembers.Count);
                            if (_state.dungeonTiers[_state.DungeonType] == _state.GetCap(_state.DungeonType))
                            {
                                _state.Player.CompletionTracker.Add(true);
                            }
                        }

                        _dungeon.CloseGUI();
                    }
                }
            }
            else
            {
                // the target is not dead, we need to check the turns
                _dgc.SetTurnText(_dh.GetTurnString());
                // if we're out of turns, start timer
                CheckTurnEnd();
            }
        }