Exemple #1
0
        private void TurnStartButton_Click(object sender, EventArgs e)
        {
            Test.Play();
            if (AttackPrompt == true)
            {
                if (MainPlayer.EntityStats.charHP > 0 || EnemyBandit.EntityStats.charHP > 0)
                {
                    Battle();
                }
                if (MainPlayer.EntityStats.charHP <= 0)
                {
                    TurnStartButton.Visible = false;
                    SkillButton.Visible     = false;
                    TurnStartButton.Visible = false;
                    OkayBtn.Visible         = true;
                    MainPlayerSprite.ChangeAnimation(3);
                    OkayBtn.Text = "Game Over!";
                }
                if (EnemyType == false)
                {
                    if ((MainPlayer.EntityStats.charHP <= 0) && (EnemyBandit.EntityStats.charHP <= 0))
                    {
                        TurnStartButton.Visible = false;
                        SkillButton.Visible     = false;
                        TurnStartButton.Visible = false;
                        OkayBtn.Visible         = true;
                        MainPlayerSprite.ChangeAnimation(3);
                        EnemySprite.ChangeAnimation(2);
                        OkayBtn.Text = "Game Over!";
                    }

                    if (EnemyBandit.EntityStats.charHP <= 0)
                    {
                        TurnStartButton.Visible = false;
                        SkillButton.Visible     = false;
                        TurnStartButton.Visible = false;
                        OkayBtn.Visible         = true;
                        EnemySprite.ChangeAnimation(2);
                        int gold = EnemyBandit.GenerateEXP();
                        int xp   = EnemyBandit.GenerateGold();
                        MainPlayer.PlayerExp  += xp;
                        MainPlayer.PlayerGold += gold;
                        GameOuputLabel.Text    = MainPlayer.EntityName + " has gained " + xp + " experience, and " + gold + " gold! You have healed up to " + MaxHP + " !";
                        MainPlayer.LevelUp(MainPlayer.generateLevelRequirement());
                        ExpBar.Maximum = MainPlayer.generateLevelRequirement();
                        MainPlayer.EntityStats.charHP = MaxHP;
                        OkayBtn.Text = "You win!";
                        RefreshAllLabels();
                    }
                }
                else
                {
                    if ((MainPlayer.EntityStats.charHP <= 0) && (EnemySlime.EntityStats.charHP <= 0))
                    {
                        TurnStartButton.Visible = false;
                        SkillButton.Visible     = false;
                        TurnStartButton.Visible = false;
                        OkayBtn.Visible         = true;
                        MainPlayerSprite.ChangeAnimation(3);
                        EnemySprite.ChangeAnimation(3);
                        OkayBtn.Text = "Game Over!";
                    }

                    if (EnemySlime.EntityStats.charHP <= 0)
                    {
                        TurnStartButton.Visible = false;
                        SkillButton.Visible     = false;
                        TurnStartButton.Visible = false;
                        OkayBtn.Visible         = true;
                        EnemySprite.ChangeAnimation(3);
                        int gold = EnemySlime.GenerateEXP();
                        int xp   = EnemySlime.GenerateGold();
                        MainPlayer.PlayerExp         += xp;
                        MainPlayer.PlayerGold        += gold;
                        GameOuputLabel.Text           = MainPlayer.EntityName + " has gained " + xp + " experience, and " + gold + " gold! You have healed up to " + MaxHP + " !";
                        GameOuputLabel.Text          += MainPlayer.LevelUp(MainPlayer.generateLevelRequirement());
                        ExpBar.Maximum                = MainPlayer.generateLevelRequirement();
                        MainPlayer.EntityStats.charHP = MaxHP;
                        OkayBtn.Text = "You win!";
                        RefreshAllLabels();
                    }
                }
            }
        }