Exemple #1
0
        private void nextTurnButton_Click(object sender, EventArgs e)
        {
            // Get damage dealt/health remaining values
            int healthRemaining = player.takeDamage(monsterDamage, 0);
            int damageDealt     = player.dealDamage(0);

            monsterHealth -= damageDealt;

            // Update display
            resultLabel.Text        = "Your party fought the monster.";
            monsterHealthLabel.Text = "The monster's health is " + monsterHealth;
            partyHealthLabel.Text   = "Your party's cumulative health is " + healthRemaining;

            if (healthRemaining <= 0)
            {
                resultLabel.Text = "Your party has all died. Sorry for your luck!";
            }
            else if (monsterHealth <= 0)
            {
                resultLabel.Text = "You have killed the monster! Congratulations!";
            }
        }
Exemple #2
0
 public override int dealDamage(int diff)
 {
     return(player.dealDamage(diff + DAMAGE_DIFF));
 }