Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Arcadia_2._0
- {
- class Program
- {
- int GenerateDamage(int finaldamage)
- {
- Random rand; // Declares a new Random
- rand = new Random(); //
- finaldamage = rand.Next(5, 20);
- return finaldamage; // Returns randomly generated final damage.
- }
- int Defend(int blockvalue)
- {
- Random rand;
- rand = new Random();
- blockvalue = rand.Next(1, 7);
- return blockvalue; //Returns your random block value.
- }
- int HeroDamage(int herodam)
- {
- Random rand;
- rand = new Random();
- herodam = rand.Next(2, 14);
- return herodam; //Returns your damage value.
- }
- int MonsterDamage(int monsterdam)
- {
- Random rand;
- rand = new Random();
- monsterdam = rand.Next(5, 9);
- return monsterdam; //Returns monsters damage value.
- }
- static void Main(string[] args)
- {
- Program program = new Program();
- Random rand;
- rand = new Random();
- int HeroHits;
- int MonsterHits;
- int BlockValue;
- int BlockValueRaw;
- int MonsterDamage;
- int HeroDamage;
- string startcombat;
- HeroHits = rand.Next(50, 100);
- MonsterHits = rand.Next(50, 100);
- Console.WriteLine("Welcome to Thunder Dome. You're paid for fighting monsters");
- Console.WriteLine("in the arena here. A lumbering beast trods out of the gates and");
- Console.WriteLine("roars at you in anger. You draw your greatsword and rush at him");
- Console.WriteLine("with anger in your eyes. Let the battle begin!");
- Console.WriteLine("[Press Enter to Begin the Battle!]");
- Console.ReadLine();
- do
- {
- Console.Write(@"
- ***************************************
- The Hero's Hitpoints are {0}
- The Monster's Hitpoints are {1}
- ***************************************
- ", HeroHits, MonsterHits);
- Console.Write (@"
- ___________________________
- What dost thou wish to do?
- (A)ttack
- (D)efend
- ___________________________
- ");
- startcombat = Console.ReadLine();
- switch (startcombat)
- {
- case "A":
- case "a":
- HeroDamage = program.HeroDamage(0);
- MonsterDamage = program.MonsterDamage(0);
- Console.WriteLine("You swing your shining greatsword, digging your blade into");
- Console.WriteLine("The creature's soft underbelly, causing it to screech in agony");
- Console.WriteLine("You deal {0} damage!", HeroDamage);
- MonsterHits -= HeroDamage;
- Console.WriteLine("The monster gnashes its jaws and rushes at you, swinging down");
- Console.WriteLine("with it's hand which was riddled with claws. It shreds through");
- Console.WriteLine("your armor, dealing {0} damage!", MonsterDamage);
- HeroHits -= MonsterDamage;
- break;
- case "D":
- case "d":
- BlockValueRaw = program.Defend(0);
- MonsterDamage = program.MonsterDamage(0);
- BlockValue = MonsterDamage -= BlockValueRaw;
- Console.WriteLine("You lift your shield, bracing yourself for impact");
- Console.WriteLine("The creature rushes forward, snarling and hissing in attempt");
- Console.WriteLine("to bull-rush you.");
- Console.WriteLine("It's head make scontact with your shield, forcing you back onto");
- Console.WriteLine("the ground. You take {0} damage,", BlockValue);
- HeroHits -= BlockValue;
- Console.WriteLine("but it is lessened by your defensive stance!");
- break;
- default:
- MonsterDamage = program.MonsterDamage(0);
- Console.WriteLine("You were indecisive in your choice and the monster took initiative");
- Console.WriteLine("dealing critical damage! You were hit for {0}", (MonsterDamage * 2));
- HeroHits -= (MonsterDamage * 2);
- break;
- }
- }
- while (HeroHits >= 0 && MonsterHits >= 0);
- if (HeroHits >= 0)
- {
- Console.WriteLine("You have defeated the monster");
- }
- else
- {
- Console.WriteLine("The monster has defeated you");
- }
- Console.ReadLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment