public override Weapon DropWeapon() { Weapon wg = new EmptyWeaponSlot(); wg.Create(); return(wg); }
public void SortWeaponList() { for (int a = 0; a < 5; a++) { int FirstEmptyIndex = -1; for (int i = 0; i < WeaponList.Length; i++) { if (WeaponList[i].name == "Empty") { FirstEmptyIndex = i; break; } } if (FirstEmptyIndex == -1 || FirstEmptyIndex == 4) { return; } for (int i = FirstEmptyIndex + 1; i < WeaponList.Length; i++) { if (WeaponList[i].name != "Empty") { WeaponList[FirstEmptyIndex] = WeaponList[i]; WeaponList[i] = new EmptyWeaponSlot(); WeaponList[i].Create(); } } } }
public int Attack(int i) { Weapon w = WeaponList[i]; random = new Random(); int dmg = 0; if (random.Next(0, 9) + stats["luck"] / 5 >= 8) { dmg = Convert.ToInt32((w.baseDmg + w.highRange) * 1.5); Console.WriteLine("CRITICAL HIT!"); } else { dmg = w.baseDmg + random.Next(w.lowRange, w.highRange); } w.durability--; if (w.durability <= 0) { Console.WriteLine("\n{0} Broke.", w.name); WeaponList[i] = new EmptyWeaponSlot(); WeaponList[i].Create(); SortWeaponList(); } int totalDmg = Convert.ToInt32(dmg + (0.33 * stats["strength"])); return(totalDmg); }
public void NewPlayer() //init player { health = 100; maxHealth = 100; dead = false; attackDamage = 7; numHealthPotions = 3; healthPotionHealAmount = 35; numFood = 100; enemiesKilled = 0; // part of score stamina = 5; speed = 5; running = true; hungerCounter = 0; Weapon Fist = new Fists(); Fist.Create(); WeaponList[0] = Fist; Weapon EmptySlot = new EmptyWeaponSlot(); EmptySlot.Create(); WeaponList[1] = EmptySlot; WeaponList[2] = EmptySlot; WeaponList[3] = EmptySlot; WeaponList[4] = EmptySlot; score = 0; TotalHourAte = 0; waitHungerWarning = 0; }
public override Weapon DropWeapon() { random = new Random(); if (random.Next(0, 100) <= dropRate) { Weapon wg = new TuskDagger(); wg.Create(); return(wg); } else { Weapon wg = new EmptyWeaponSlot(); wg.Create(); return(wg); } }
public override Weapon DropWeapon() { random = new Random(); if (random.Next(0, 100) <= dropRate) { Weapon wg = new FlamingFeatherDarts(); wg.Create(); return(wg); } else { Weapon wg = new EmptyWeaponSlot(); wg.Create(); return(wg); } }
public int Attack(int i) { Weapon w = WeaponList[i]; random = new Random(); int dmg = w.baseDmg + random.Next(w.lowRange, w.highRange); w.durability--; if (w.durability <= 0) { Console.WriteLine("\n{0} Broke.", w.name); WeaponList[i] = new EmptyWeaponSlot(); WeaponList[i].Create(); SortWeaponList(); } return(dmg); }
public void NewPlayer() //init player { health = 100; maxHealth = 100; dead = false; attackDamage = 7; numHealthPotions = 3; healthPotionHealAmount = 35; numFood = 100; enemiesKilled = 0; // part of score stamina = 5; speed = 5; running = true; hungerCounter = 0; Weapon Fist = new Fists(); Fist.Create(); //WeaponList[0]=Fist; Weapon EmptySlot = new EmptyWeaponSlot(); EmptySlot.Create(); WeaponList = new Weapon[5] { Fist, EmptySlot, EmptySlot, EmptySlot, EmptySlot }; //WeaponList[2]=EmptySlot; //WeaponList[3]=EmptySlot; //WeaponList[4]=EmptySlot; Spell Empty = new EmptySpellSlot(); Empty.Create(); SpellBook = new Spell[5] { Empty, Empty, Empty, Empty, Empty }; //SpellBook[0] = Empty; //SpellBook[1] = Empty; //SpellBook[2] = Empty; //SpellBook[3] = Empty; //SpellBook[4] = Empty; score = 0; TotalHourAte = 0; waitHungerWarning = 0; exp = 0; expToNextLevel = 2; Lvl = 1; MP = 25; AP = 5; stats.Add("strength", 0); stats.Add("speed", 0); stats.Add("health", 0); stats.Add("defence", 0); stats.Add("magic", 0); stats.Add("precision", 0); stats.Add("luck", 0); Console.WriteLine("Welcome young traveller! What do you want to be called?"); name = Console.ReadLine().ToUpper(); if (name == "NARPA") { health = 99999; maxHealth = 99999; Weapon NarpasSword = new NarpasSword(); NarpasSword.Create(); WeaponList[1] = NarpasSword; stamina = 999; speed = 999; } }