private void lblsearchoption2_Click(object sender, EventArgs e) { lblresults.Text = "The bad news is you are dead, and you took half of the country side with you."; lblsearchoption2.Text = ""; lblsearchoption1.Text = ""; Thread.Sleep(2000); Gameover go = new Gameover(); go.Show(); this.Hide(); }
private void lblact2_Click(object sender, EventArgs e) { if (weakness == false) { if (info.strength >= 2) { int rngnum = rng.Next(0, 4); int dragonrngnum = rng.Next(0, 3); if (dragonrngnum == 1) { if (rngnum == 1) { info.dragonhealth = info.dragonhealth - 1; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 1 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else if (rngnum == 2) { info.dragonhealth = info.dragonhealth - 2; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 2 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else { info.dragonhealth = info.dragonhealth - 3; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 3 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } } else if (dragonrngnum == 2) { if (rngnum == 1) { info.dragonhealth = info.dragonhealth - 1; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 1 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else if (rngnum == 2) { info.dragonhealth = info.dragonhealth - 2; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 2 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else { lblresults.Text = "You miss"; attacked = true; } } } else if (info.strength == 1) { int rngnum = rng.Next(0, 4); int dragonrngnum = rng.Next(0, 3); if (dragonrngnum == 1) { if (rngnum == 1) { lblresults.Text = "Your sword bounces off the dragons scales."; attacked = true; } else if (rngnum == 2) { lblresults.Text = "The dragon knocks you over with it's tale stoping you from attacking."; attacked = true; } else { info.dragonhealth = info.dragonhealth - 1; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 1 damage to the dragon. Only because the dragon caught your sword in it's claw causing a small cut."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } } else if (dragonrngnum == 2) { if (rngnum == 1) { info.dragonhealth = info.dragonhealth - 2; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 2 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else if (rngnum == 2) { info.dragonhealth = info.dragonhealth - 1; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 1 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else { lblresults.Text = "You miss"; attacked = true; } } } else { lblresults.Text = "You attack the dragon without a plan and you miss the dragon completly."; attacked = true; } } else //if weakness == true; { if (info.strength >= 2) { lblresults.Text = "You attack the dragon."; int rngnum = rng.Next(0, 4); int dragonrngnum = rng.Next(0, 3); if (dragonrngnum == 1) { if (rngnum == 1) { info.dragonhealth = info.dragonhealth - 3; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 3 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else if (rngnum == 2) { info.dragonhealth = info.dragonhealth - 4; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 4 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else { info.dragonhealth = info.dragonhealth - 5; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 5 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } } else if (dragonrngnum == 2) { if (rngnum == 1) { info.dragonhealth = info.dragonhealth - 2; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 2 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else if (rngnum == 2) { info.dragonhealth = info.dragonhealth - 1; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 1 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else { lblresults.Text = "You miss"; attacked = true; } } } else if (info.strength == 1) { lblresults.Text = "You throw your sword at the dragon."; int rngnum = rng.Next(0, 4); int dragonrngnum = rng.Next(0, 3); if (dragonrngnum == 1) { if (rngnum == 1) { info.dragonhealth = info.dragonhealth - 2; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 2 damage to the dragon and you retrieve your sword."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else if (rngnum == 2) { info.dragonhealth = info.dragonhealth - 3; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 3 damage to the dragon and you retrieve your sword."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else { info.dragonhealth = info.dragonhealth - 4; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 4 damage to the dragon and you retrieve your sword."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } } else if (dragonrngnum == 2) { if (rngnum == 1) { info.dragonhealth = info.dragonhealth - 2; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 2 damage to the dragon and you retrieve your sword."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else if (rngnum == 2) { info.dragonhealth = info.dragonhealth - 1; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 1 damage to the dragon and you retrieve your sword."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else { lblresults.Text = "You miss but you end up retrieving your sword."; attacked = true; } } } else { lblresults.Text = "You try try to attack the dragon. But the dragon holds you in place at a safe distance with a long stick."; lblact2.Text = ""; attacked = true; } } if (attacked == true) { int dragonrngnum = rng.Next(0, 4); lblresults.Text = "After you finish attacking, the dragon decidies to attack you."; if (dragonrngnum == 1) { info.health = info.health - 2; lblhealthnum.Text = "" + info.health; attacked = false; if (info.health <= 0) { Gameover go = new Gameover(); go.Show(); this.Hide(); } } else if (dragonrngnum == 2) { info.health = info.health - 4; lblhealthnum.Text = "" + info.health; attacked = false; if (info.health <= 0) { Gameover go = new Gameover(); go.Show(); this.Hide(); } } else { lblresults.Text = "The dragon misses."; attacked = false; } } }
private void lblact3_Click_1(object sender, EventArgs e) { if (weakness == false) { if (info.magic >= 2) { int rngnum = rng.Next(0, 4); int dragonrngnum = rng.Next(0, 3); if (dragonrngnum == 1) { if (rngnum == 1) { info.dragonhealth = info.dragonhealth - 2; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 2 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else if (rngnum == 2) { info.dragonhealth = info.dragonhealth - 3; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 3 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else { info.dragonhealth = info.dragonhealth - 4; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 4 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } } else if (dragonrngnum == 2) { if (rngnum == 1) { info.dragonhealth = info.dragonhealth - 2; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 2 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else if (rngnum == 2) { info.dragonhealth = info.dragonhealth - 3; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 3 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else { lblresults.Text = "You miss"; } } } else if (info.magic == 1) { int rngnum = rng.Next(0, 4); int dragonrngnum = rng.Next(0, 3); if (dragonrngnum == 1) { if (rngnum == 1) { lblresults.Text = "Your spell bounces off the dragons scales."; attacked = true; } else if (rngnum == 2) { lblresults.Text = "The dragon knocks you over with it's tale stoping you from attacking."; attacked = true; } else { info.dragonhealth = info.dragonhealth - 1; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 1 damage to the dragon because you went for a low blow. The dragon's face."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } } else if (dragonrngnum == 2) { if (rngnum == 1) { info.dragonhealth = info.dragonhealth - 3; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 3 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else if (rngnum == 2) { info.dragonhealth = info.dragonhealth - 1; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 2 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else { lblresults.Text = "You miss"; attacked = true; } } } else { lblresults.Text = "You attack the dragon without a plan and you miss the dragon completly."; attacked = true; } } else //if weakness == true; { if (info.magic >= 2) { int rngnum = rng.Next(0, 4); int dragonrngnum = rng.Next(0, 3); if (dragonrngnum == 1) { if (rngnum == 1) { info.dragonhealth = info.dragonhealth - 4; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 4 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else if (rngnum == 2) { info.dragonhealth = info.dragonhealth - 5; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 5 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else { info.dragonhealth = info.dragonhealth - 6; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 6 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } } else if (dragonrngnum == 2) { if (rngnum == 1) { info.dragonhealth = info.dragonhealth - 3; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 3 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else if (rngnum == 2) { info.dragonhealth = info.dragonhealth - 2; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You deal 2 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else { lblresults.Text = "You miss"; attacked = true; } } } else if (info.magic == 1) { lblresults.Text = "You cast a random spell and hope that it works."; int rngnum = rng.Next(0, 4); int dragonrngnum = rng.Next(0, 3); if (dragonrngnum == 1) { if (rngnum == 1) { info.dragonhealth = info.dragonhealth - 3; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You cast a confusion spell on the dragon so it falls onto a convenient pile of swords. The dragon takes 3 points of damage."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else if (rngnum == 2) { info.dragonhealth = info.dragonhealth - 4; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You cast frostblot and deal 4 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else { info.dragonhealth = info.dragonhealth - 5; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You cast animate dead causing multiple nearby skeletons to shudder to life again and start to stumble torwads the dragon. The skeletons deal 5 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } } else if (dragonrngnum == 2) { if (rngnum == 1) { info.dragonhealth = info.dragonhealth - 3; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You cast fire bolt dealing 3 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else if (rngnum == 2) { info.dragonhealth = info.dragonhealth - 2; lbldragonhealth.Text = "" + info.dragonhealth; lblresults.Text = "You cast a mind control spell but you end up contoling a very large mass of ants. The ants deal 2 damage to the dragon."; attacked = true; if (info.dragonhealth <= 0) { win = true; lblact2.Text = ""; lblact3.Text = ""; } } else { lblresults.Text = "You miss but you end up causing a massive explosion."; attacked = true; } } } else { lblresults.Text = "You try try to attack the dragon. But the dragon casts a counter spell that negates any spell cast within it's range"; lblact3.Text = ""; attacked = true; } } if (attacked == true) { int dragonrngnum = rng.Next(0, 4); lblresults.Text = "After you finish attacking, the dragon decidies to attack you."; if (dragonrngnum == 1) { info.health = info.health - 2; lblhealthnum.Text = "" + info.health; attacked = false; if (info.health <= 0) { Gameover go = new Gameover(); go.Show(); this.Hide(); } } else if (dragonrngnum == 2) { info.health = info.health - 4; lblhealthnum.Text = "" + info.health; attacked = false; if (info.health <= 0) { Gameover go = new Gameover(); go.Show(); this.Hide(); } } else { lblresults.Text = "The dragon misses."; attacked = false; } } }
private void lblact2_Click(object sender, EventArgs e) { if (info.strength >= 3) { int rngnum = rng.Next(0, 4); if (rngnum == 1 || rngnum == 2) { if (info.luck >= 3) { lblresults.Text = "You swing your sword and chop of it's long tongue. You deal 4 points of damage to the mimic."; mimichealth = mimichealth - 4; lblmimichealthnum.Text = "" + mimichealth; if (mimichealth <= 0) { Thread.Sleep(750); lblresults.Text = "You have killed the mimic. You find a gold key on it's dead body."; lblact2.Text = ""; door = true; } } else if (info.luck >= 3) { lblresults.Text = "You swing your sword and slice clean through the top right corner of the mimic. You deal 5 points of damage to the mimic."; mimichealth = mimichealth - 5; lblmimichealthnum.Text = "" + mimichealth; if (mimichealth <= 0) { Thread.Sleep(750); lblresults.Text = "You have killed the mimic. You find a gold key on it's dead body."; lblact2.Text = ""; door = true; } } } else { lblresults.Text = "You attacked the mimic but only end up grazing it. You deal 1 point of damage to the mimic."; mimichealth = mimichealth - 1; lblmimichealthnum.Text = "" + mimichealth; if (mimichealth <= 0) { Thread.Sleep(750); lblresults.Text = "You have killed the mimic. You find a gold key on it's dead body."; lblact2.Text = ""; door = true; } } } else { int rngnum = rng.Next(0, 3); if (rngnum == 1) { lblresults.Text = "You swing your sword at the mimic and get you sword stuck in it's side. You quickly pull your sword out but not before the mimic bites you. You take 2 points of damage."; info.health = info.health - 2; lblhealthnum.Text = "" + info.health; if (info.health <= 0) { Gameover go = new Gameover(); go.Show(); this.Hide(); } mimichealth = mimichealth - 3; lblmimichealthnum.Text = "" + mimichealth; if (mimichealth <= 0) { Thread.Sleep(750); lblresults.Text = "You have killed the mimic. You find a gold key on it's dead body."; lblact2.Text = ""; door = true; } lblact4.Text = "4. Heal"; } else { lblresults.Text = "You stab the mimic with your sword. You deal 3 points of damage to the mimic."; mimichealth = mimichealth - 3; lblmimichealthnum.Text = "" + mimichealth; if (mimichealth <= 0) { Thread.Sleep(750); lblresults.Text = "You have killed the mimic. You find a gold key on it's dead body."; lblact2.Text = ""; door = true; } } } }
private void lblact4_Click(object sender, EventArgs e) { if (info.health == 10) { lblresults.Text = "You are already at full health. Please select another option."; } else if (info.health == 9 || info.health == 8) { info.health = 10; lblresults.Text = "You heal to full health."; lblhealthnum.Text = "" + info.health; lblact4.Text = ""; } else if (info.health == 7) { info.health = 9; lblresults.Text = "You heal for two points of damage."; lblhealthnum.Text = "" + info.health; lblact4.Text = ""; } else if (info.health == 6) { info.health = 8; lblresults.Text = "You heal for two points of damage."; lblhealthnum.Text = "" + info.health; lblact4.Text = ""; } else if (info.health == 5) { info.health = 7; lblresults.Text = "You heal for two points of damage."; lblhealthnum.Text = "" + info.health; lblact4.Text = ""; } else if (info.health == 4) { info.health = 6; lblresults.Text = "You heal for two points of damage."; lblhealthnum.Text = "" + info.health; lblact4.Text = ""; } else if (info.health == 3) { info.health = 5; lblresults.Text = "You heal for two points of damage."; lblhealthnum.Text = "" + info.health; lblact4.Text = ""; } else if (info.health == 2) { info.health = 4; lblresults.Text = "You heal for two points of damage."; lblhealthnum.Text = "" + info.health; lblact4.Text = ""; } else if (info.health == 1) { info.health = 3; lblresults.Text = "You heal for two points of damage."; lblhealthnum.Text = "" + info.health; lblact4.Text = ""; } else { Gameover go = new Gameover(); go.Show(); this.Hide(); } }