public static bool CreateMegaladon() { { Console.ForegroundColor = ConsoleColor.DarkYellow; try { Console.WriteLine("Name the Zoo's Megaladon:"); string name = Console.ReadLine(); Console.WriteLine("What is the Megaladon's super power?"); string superPower = Console.ReadLine(); Console.WriteLine("What is Megaladon's BodyLength?"); int length = int.Parse(Console.ReadLine()); Megalodon megaladon = new Megalodon(superPower, name, length); int bodyLength = megaladon.BodyLength; bool attack = megaladon.Attack(); bool heal = megaladon.Heal(); Console.ReadKey(); return(true); } catch (Exception ex) { Console.WriteLine($"Megaladon - Exception thrown: {ex.Message}"); return(false); } } }
// Checking to see if Override works, pegacorn will have a specific attack public void MegladonInheritsPolymorph() { string superPower = "Speed flight"; // string superPower2 = "healer"; string name = "aldo"; int length = 100; Megalodon mega = new Megalodon(superPower, name, length); Assert.Equal(mega.Attack(), mega.Attack()); Assert.Equal(mega.Heal(), mega.Heal()); Assert.IsAssignableFrom <ISwim>(mega); }
private void AddMegalodon(int number) { for (int i = 0; i < number; i++) { while (true) { byte x = (byte)_random.Next(0, NumCols); byte y = (byte)_random.Next(0, NumRows); if (_cells[x, y] == null) { _cells[x, y] = new Megalodon(new Coordinate(x, y)); } else { continue; } break; } } }
protected virtual void FinishEffect(Point3D p, Map map, Mobile from) { from.RevealingAction(); Server.Engines.Harvest.Fishing.FishingSkill(from, 11); int count = Utility.RandomMinMax(1, 3); int onBoat = 0; string monster = ""; Point3D SpawnAt = p; switch (Utility.Random(17)) { case 0: monster = "SeaHag"; SpawnAt = from.Location; onBoat = 1; break; case 1: monster = "WaterWeird"; break; case 2: monster = "SeaweedElemental"; break; case 3: monster = "Kraken"; break; case 4: monster = "GiantEel"; break; case 5: monster = "GiantSquid"; break; case 6: monster = "SeaSerpent"; break; case 7: monster = "SeaDrake"; break; case 8: monster = "EyeOfTheDeep"; break; case 9: monster = "Typhoon"; break; case 10: monster = "SteamElemental"; break; case 11: monster = "BoneSailor"; SpawnAt = from.Location; onBoat = 1; break; case 12: monster = "Trituns"; SpawnAt = from.Location; onBoat = 1; break; case 13: monster = "Shark"; break; case 14: monster = "GreatWhite"; break; case 15: monster = "Megalodon"; break; case 16: monster = "Calamari"; break; } for (int i = 0; map != null && i < count; ++i) { BaseCreature spawn = new SeaHag(); if (monster == "SeaHag") { spawn = new SeaHag(); } else if (monster == "WaterWeird") { spawn = new WaterWeird(); } else if (monster == "SeaweedElemental") { spawn = new SeaweedElemental(); } else if (monster == "Kraken") { spawn = new Kraken(); } else if (monster == "GiantEel") { spawn = new GiantEel(); } else if (monster == "GiantSquid") { spawn = new GiantSquid(); } else if (monster == "SeaSerpent") { spawn = new SeaSerpent(); } else if (monster == "SeaDrake") { spawn = new SeaDrake(); } else if (monster == "EyeOfTheDeep") { spawn = new EyeOfTheDeep(); } else if (monster == "Typhoon") { spawn = new Typhoon(); } else if (monster == "SteamElemental") { spawn = new SteamElemental(); } else if (monster == "BoneSailor") { spawn = new BoneSailor(); } else if (monster == "Shark") { spawn = new Shark(); } else if (monster == "GreatWhite") { spawn = new GreatWhite(); } else if (monster == "Megalodon") { spawn = new Megalodon(); } else if (monster == "Calamari") { spawn = new Calamari(); } else if (monster == "Trituns") { switch (Utility.Random(2)) { case 0: spawn = new TritunMage(); break; case 1: spawn = new Tritun(); break; } } Spawn(SpawnAt, map, spawn, onBoat); spawn.WhisperHue = 999; // SO TASK MANAGER DELETES THEM EVENTUALLY spawn.Combatant = from; } Delete(); }