public Consumables CreateRandomConsumable(int itemLevel) { Potion createdPotion = new Potion("", 1); int whichPotion = GetRandom(1, 3); switch (whichPotion) { case 1: Health_Potion newPotion = new Health_Potion("", itemLevel); createdPotion = newPotion; break; case 2: Fire_Potion newPotion1 = new Fire_Potion("", itemLevel); createdPotion = newPotion1; break; } return(createdPotion); }
public Monster CreateTroll() { ItemFactory code = new ItemFactory(); Troll troll = new Troll(0, 0, ""); int positionX = GetRandom(1, 6); int positionY = GetRandom(1, 6); int level = GetRandom(troll.MinLevel, troll.MaxLevel); int amplifier = GetRandom(0, level); int pickedMonsterName = GetRandom(1, 8); if (pickedMonsterName == 1 || pickedMonsterName == 2 || pickedMonsterName == 3) { Barg_The_Ugly_Brute Enemy = new Barg_The_Ugly_Brute(level, positionX, positionY, "B"); troll = Enemy; int doesbarggetweapon = GetRandom(0, 5); if (doesbarggetweapon == 3) { troll.EntityWeapon = code.CreateRandomWeapon(GetRandom(0, 5)); } else if (troll.EntityWeapon == null) { Fists trollBaseWeapon = new Fists("Fists"); troll.EntityWeapon = trollBaseWeapon; } int doesbarggetarmor = GetRandom(0, 5); if (doesbarggetarmor == 3) { troll.EntityArmor = code.CreateRandomArmor(GetRandom(0, 5)); } else if (troll.EntityArmor == null) { Hides newTrollArmor = new Hides(""); troll.EntityArmor = newTrollArmor; } int doesBargGetPotion = GetRandom(0, 5); if (doesBargGetPotion == 3) { int howManyPotions = GetRandom(-2, 4); if (howManyPotions < 1) { howManyPotions = 0; } else { int whichPotion = 0; while (howManyPotions > 0) { whichPotion = GetRandom(1, 3); if (whichPotion == 1) { Health_Potion newPotion = new Health_Potion("Health_Potion", level); newPotion.potionNumber = troll.entityPotions.Count + 1; troll.entityPotions.Add(newPotion); } else if (whichPotion == 2) { Fire_Potion newPotion1 = new Fire_Potion("Fire_Potion", level); newPotion1.potionNumber = troll.entityPotions.Count + 1; troll.entityPotions.Add(newPotion1); } howManyPotions -= 1; } while (troll.entityPotions.Count < 3) { Potion empty = new Potion("Empty_Potion", troll.entityPotions.Count + 1); troll.entityPotions.Add(empty); } } } Enemy.DoBargAmplifiers(amplifier); } else if (pickedMonsterName == 4 || pickedMonsterName == 5 || pickedMonsterName == 6) { Klerg_The_Iceberg Enemy = new Klerg_The_Iceberg(level, positionX, positionY, "K"); troll = Enemy; int doesklerggetweapon = GetRandom(0, 5); if (doesklerggetweapon == 3) { troll.EntityWeapon = code.CreateRandomWeapon(GetRandom(0, 5)); } else if (troll.EntityWeapon == null) { Fists trollBaseWeapon = new Fists("Fists"); troll.EntityWeapon = trollBaseWeapon; } int doesklerggetarmor = GetRandom(0, 5); if (doesklerggetarmor == 3) { troll.EntityArmor = code.CreateRandomArmor(GetRandom(0, 5)); } else if (troll.EntityArmor == null) { Hides newTrollArmor = new Hides(""); troll.EntityArmor = newTrollArmor; } int doesKlergGetPotion = GetRandom(0, 5); if (doesKlergGetPotion == 3) { int howManyPotions = GetRandom(-2, 4); if (howManyPotions < 1) { howManyPotions = 0; } else { int whichPotion = 0; while (howManyPotions > 0) { whichPotion = GetRandom(1, 3); if (whichPotion == 1) { Health_Potion newPotion = new Health_Potion("Health_Potion", level); newPotion.potionNumber = troll.entityPotions.Count + 1; troll.entityPotions.Add(newPotion); } else if (whichPotion == 2) { Fire_Potion newPotion1 = new Fire_Potion("Fire_Potion", level); newPotion1.potionNumber = troll.entityPotions.Count + 1; troll.entityPotions.Add(newPotion1); } howManyPotions -= 1; } while (troll.entityPotions.Count < 3) { Potion empty = new Potion("Empty_Potion", troll.entityPotions.Count + 1); troll.entityPotions.Add(empty); } } } Enemy.DoKlergAmplifiers(amplifier); } else if (pickedMonsterName == 7) { Grauldog Enemy = new Grauldog(level, positionX, positionY, "$"); troll = Enemy; Grauldogs_Trusty_Club newWeaponForGrauldog = new Grauldogs_Trusty_Club("Grauldog's Trusty Club", GetRandom(1, 10)); troll.EntityWeapon = newWeaponForGrauldog; if (troll.EntityWeapon == null) { Fists trollBaseWeapon = new Fists("Fists"); troll.EntityWeapon = trollBaseWeapon; } int doesGrauldoggetarmor = GetRandom(2, 4); if (doesGrauldoggetarmor == 3) { troll.EntityArmor = code.CreateRandomArmor(GetRandom(0, 10)); } else if (troll.EntityArmor == null) { Hides newTrollArmor = new Hides(""); troll.EntityArmor = newTrollArmor; } int doesGrauldogGetPotion = GetRandom(0, 5); if (doesGrauldogGetPotion == 3) { int howManyPotions = GetRandom(-2, 4); if (howManyPotions < 1) { howManyPotions = 0; } else { int whichPotion = 0; while (howManyPotions > 0) { whichPotion = GetRandom(1, 3); if (whichPotion == 1) { Health_Potion newPotion = new Health_Potion("Health_Potion", level); newPotion.potionNumber = troll.entityPotions.Count + 1; troll.entityPotions.Add(newPotion); } else if (whichPotion == 2) { Fire_Potion newPotion1 = new Fire_Potion("Fire_Potion", level); newPotion1.potionNumber = troll.entityPotions.Count + 1; troll.entityPotions.Add(newPotion1); } howManyPotions -= 1; } while (troll.entityPotions.Count < 3) { Potion empty = new Potion("Empty_Potion", troll.entityPotions.Count + 1); troll.entityPotions.Add(empty); } } } Enemy.DoGrauldogAmplifiers(amplifier); } return(troll); }
public Monster CreateHuman() { ItemFactory code = new ItemFactory(); Human barbarian = new Human(0, 0, ""); int positionX = GetRandom(1, 6); int positionY = GetRandom(1, 6); int level = GetRandom(barbarian.MinLevel, barbarian.MaxLevel); int amplifier = GetRandom(0, level); int pickedMonsterName = GetRandom(1, 3); if (pickedMonsterName == 1) { Gulfard_The_Wolfherd Enemy = new Gulfard_The_Wolfherd(level, positionX, positionY, "G"); barbarian = Enemy; int doesGulfardgetweapon = GetRandom(1, 4); if (doesGulfardgetweapon == 3) { barbarian.EntityWeapon = code.CreateRandomWeapon(GetRandom(1, 5)); } else if (barbarian.EntityWeapon == null) { Fists barbarianBaseWeapon = new Fists("Fists"); barbarian.EntityWeapon = barbarianBaseWeapon; } int doesGulfardgetarmor = GetRandom(1, 4); if (doesGulfardgetarmor == 3) { barbarian.EntityArmor = code.CreateRandomArmor(GetRandom(1, 5)); } else if (barbarian.EntityArmor == null) { Hides newBarbarianArmor = new Hides(""); barbarian.EntityArmor = newBarbarianArmor; } int doesGulfardGetPotion = GetRandom(0, 5); if (doesGulfardGetPotion == 3) { int howManyPotions = GetRandom(-2, 4); if (howManyPotions < 1) { howManyPotions = 0; } else { int whichPotion = 0; while (howManyPotions > 0) { whichPotion = GetRandom(1, 3); if (whichPotion == 1) { Health_Potion newPotion = new Health_Potion("Health_Potion", level); newPotion.potionNumber = barbarian.entityPotions.Count + 1; barbarian.entityPotions.Add(newPotion); } else if (whichPotion == 2) { Fire_Potion newPotion1 = new Fire_Potion("Fire_Potion", level); newPotion1.potionNumber = barbarian.entityPotions.Count + 1; barbarian.entityPotions.Add(newPotion1); } howManyPotions -= 1; } while (barbarian.entityPotions.Count < 3) { Potion empty = new Potion("Empty_Potion", barbarian.entityPotions.Count + 1); barbarian.entityPotions.Add(empty); } } } Enemy.DoGulfardAmplifiers(amplifier); } else if (pickedMonsterName == 2) { Berk_The_Jerk Enemy = new Berk_The_Jerk(level, positionX, positionY, "J"); barbarian = Enemy; int doesBerkgetweapon = GetRandom(1, 4); if (doesBerkgetweapon == 3) { barbarian.EntityWeapon = code.CreateRandomWeapon(GetRandom(1, 5)); } else if (barbarian.EntityWeapon == null) { Fists BerkBaseWeapon = new Fists("Fists"); barbarian.EntityWeapon = BerkBaseWeapon; } int doesberkgetarmor = GetRandom(0, 5); if (doesberkgetarmor == 3) { barbarian.EntityArmor = code.CreateRandomArmor(GetRandom(1, 5)); } else if (barbarian.EntityArmor == null) { Hides newBerkArmor = new Hides(""); barbarian.EntityArmor = newBerkArmor; } int doesBerkGetPotion = GetRandom(0, 5); if (doesBerkGetPotion == 3) { int howManyPotions = GetRandom(-2, 4); if (howManyPotions < 1) { howManyPotions = 0; } else { int whichPotion = 0; while (howManyPotions > 0) { whichPotion = GetRandom(1, 3); if (whichPotion == 1) { Health_Potion newPotion = new Health_Potion("Health_Potion", level); newPotion.potionNumber = barbarian.entityPotions.Count + 1; barbarian.entityPotions.Add(newPotion); } else if (whichPotion == 2) { Fire_Potion newPotion1 = new Fire_Potion("Fire_Potion", level); newPotion1.potionNumber = barbarian.entityPotions.Count + 1; barbarian.entityPotions.Add(newPotion1); } howManyPotions -= 1; } while (barbarian.entityPotions.Count < 3) { Potion empty = new Potion("Empty_Potion", barbarian.entityPotions.Count + 1); barbarian.entityPotions.Add(empty); } } } Enemy.DoBerkAmplifiers(amplifier); } return(barbarian); }
static void PlayerChooseLoadout() { Render code = new Render(); Program code1 = new Program(); code.RenderPlayerChoosing(1); string info2 = Console.ReadLine(); int playerInput; try { playerInput = Int32.Parse(info2); } catch { Console.WriteLine("Creation Error... Shutting...Down...."); PlayerChooseLoadout(); return; } switch (playerInput) { case 1: player1.classType = "Warrior"; Console.WriteLine("Warrior it is..."); break; case 2: player1.classType = "Mage"; Console.WriteLine("Mage it is..."); break; case 3: player1.classType = "Rogue"; Console.WriteLine("Rogue it is..."); break; default: Console.WriteLine("Creation Error... Shutting...Down...."); PlayerChooseLoadout(); return; } code.RenderPlayerChoosing(2); string info = Console.ReadLine(); try { playerInput = Int32.Parse(info); } catch { Console.WriteLine("Creation Error... Shutting...Down...."); PlayerChooseLoadout(); return; } int weaponLevel = GetRandom(1, 5); ItemFactory code3 = new ItemFactory(); switch (playerInput) { case 1: Broadsword PlayerWeapon = new Broadsword("", weaponLevel); player1.EntityWeapon = PlayerWeapon; Console.WriteLine("Broadsword it is..."); break; case 2: Mace PlayerWeapon2 = new Mace("", weaponLevel); player1.EntityWeapon = PlayerWeapon2; Console.WriteLine("Mace it is..."); break; case 3: Daggers PlayerWeapon3 = new Daggers("", weaponLevel); player1.EntityWeapon = PlayerWeapon3; Console.WriteLine("Twin Daggers it is..."); break; case 4: Axe PlayerWeapon4 = new Axe("", weaponLevel); player1.EntityWeapon = PlayerWeapon4; Console.WriteLine("War Axe it is..."); break; case 5: Weapon PlayerWeapon5 = code3.CreateRandomWeapon(weaponLevel); player1.EntityWeapon = PlayerWeapon5; Console.WriteLine(player1.EntityWeapon.name + " it is..."); break; default: Console.WriteLine("Creation Error... Shutting...Down...."); PlayerChooseLoadout(); return; } code.RenderPlayerChoosing(3); string info1 = Console.ReadLine(); try { playerInput = Int32.Parse(info1); } catch { Console.WriteLine("Creation Error... Restarting..."); PlayerChooseLoadout(); return; } int armorLevel = GetRandom(1, 5); switch (playerInput) { case 1: Chainmail PlayerArmor = new Chainmail("", armorLevel); player1.EntityArmor = PlayerArmor; Console.WriteLine("Chainmail it is..."); break; case 2: Leather PlayerArmor2 = new Leather("", armorLevel); player1.EntityArmor = PlayerArmor2; Console.WriteLine("Thick Leather it is..."); break; case 3: Cloth PlayerArmor3 = new Cloth("", armorLevel); player1.EntityArmor = PlayerArmor3; Console.WriteLine("Sleek Silken Thinking Cloth... is that even armor?"); break; case 4: Plate PlayerArmor4 = new Plate("", armorLevel); player1.EntityArmor = PlayerArmor4; Console.WriteLine("Plate it is..."); break; case 5: Armor PlayerArmor5 = code3.CreateRandomArmor(armorLevel); player1.EntityArmor = PlayerArmor5; Console.WriteLine(player1.EntityArmor.name + " it is..."); break; default: Console.WriteLine("Creation Error... Restarting..."); PlayerChooseLoadout(); return; } code.RenderPlayerChoosing(4); string info3 = Console.ReadLine(); try { playerInput = Int32.Parse(info3); } catch { Console.WriteLine("Creation Error... Restarting..."); PlayerChooseLoadout(); return; } int potionLevel = GetRandom(1, 5); switch (playerInput) { case 1: Health_Potion playerPotion = new Health_Potion("Health_Potion", potionLevel); player1.entityPotions.Add(playerPotion); Console.WriteLine("Health Potion it is..."); break; case 2: Fire_Potion playerPotion1 = new Fire_Potion("Fire_Potion", potionLevel); player1.entityPotions.Add(playerPotion1); Console.WriteLine("Fire Potion it is..."); break; default: Console.WriteLine("Creation Error... Restarting..."); PlayerChooseLoadout(); return; } while (player1.entityPotions.Count < 4) { Potion empty = new Potion("Empty_Potion", player1.entityPotions.Count + 1); player1.entityPotions.Add(empty); } ColorWriter(ConsoleColor.Gray, "ready yourself, Gladiator...\n"); Thread.Sleep(1000); int howManyMonsters = GetRandom(1, 5); MonsterIntro(player1, howManyMonsters); }