public void BlackBearIsAHungryAnimal() { BlackBear baloo = new BlackBear(); Assert.Equal("The black bears are hungry! Feed them!", baloo.Feed()); Assert.IsAssignableFrom <Animals>(baloo); }
public void BlackBearCanSpeakAndEat() { BlackBear baloo = new BlackBear(); Assert.Equal("RAR!", baloo.Speak()); Assert.Equal("Employees are feeding the black bears.", baloo.StaffFeedAnimal()); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); BlackBear blackBear = new BlackBear(); Coho coho = new Coho(); GreyWolf greyWolf = new GreyWolf(); LionFish lionFish = new LionFish(); PinkSalmon pinkSalmon = new PinkSalmon(); PolarBear polarBear = new PolarBear(); Console.WriteLine(polarBear.Swim()); Console.WriteLine(pinkSalmon.Eat()); Console.WriteLine(blackBear.Nurse()); Console.WriteLine(lionFish.Sleep()); Console.WriteLine(greyWolf.Play()); Console.WriteLine(coho.Migrate()); IRun bBear = new BlackBear(); Console.WriteLine(bBear.TopSpeed); Console.WriteLine(greyWolf.Run()); Console.WriteLine(pinkSalmon.EatsBugs()); Console.WriteLine(pinkSalmon.favoriteBug); Console.WriteLine(blackBear.favoriteBug); Console.WriteLine(blackBear.EatsBugs()); }
static void Main(string[] args) { Console.WriteLine("Welcome to the Zoo!"); Cow cow = new Cow(); BlackBear blackbear = new BlackBear(); PolarBear polarBear = new PolarBear(); Ostrich ostrich = new Ostrich(); Goose goose = new Goose(); Tortise tortise = new Tortise(); Crocodile crocodile = new Crocodile(); Console.WriteLine($"Cow: {cow.PlowField()}"); Console.WriteLine($"Black Bear: {blackbear.ClimbTree()}"); Console.WriteLine($"Polar Bear: {polarBear.Sleep()}"); Console.WriteLine($"Polar Bear: {polarBear.Prey}"); Console.WriteLine($"Polar Bear: {polarBear.HuntingGround()}"); Console.WriteLine($"Ostrich: {ostrich.Sprint()}"); Console.WriteLine($"Ostrich: {ostrich.Race()}"); Console.WriteLine($"Ostrich: When I race, do I wear blinders? {ostrich.WearBlinders}"); Console.WriteLine($"Goose: {goose.Sound()}"); Console.WriteLine($"Tortise: {tortise.HideInShell()}"); Console.WriteLine($"Crocodile: {crocodile.BirdTeethClean()}"); }
public override void Damage(Mobile m) { base.Damage(m); if (m.Alive) { Item item = m.FindItemOnLayer(Layer.OuterTorso); if (item is GMRobe) { AOS.Damage(m, 0, 0, 0, 0, 0, 0); } else { // Forest noises if (Utility.RandomDouble() < 0.008) { m.PlaySound(Utility.RandomList(0x000, 0x001, 0x002)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Bird chirps if (Utility.RandomDouble() < 0.002) { m.PlaySound(Utility.RandomList(0x094, 0x095, 0x096, 0x097, 0x0D1, 0x0D2)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Cricket noises if (Utility.RandomDouble() < 0.003) { m.PlaySound(Utility.RandomList(0x00A, 0x00B)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Turdy Encounter 1 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Malas) { int x1 = m.X + 8; int y1 = m.Y + 8; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature turdyencounter; switch (Utility.Random(2)) { default: case 0: turdyencounter = new Turdy(); break; case 1: turdyencounter = new Turdy(); break; } turdyencounter.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); turdyencounter.Combatant = m; AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTurdyEncounter), turdyencounter); } } } // Turdy Encounter 2 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Malas) { int x2 = m.X - 8; int y2 = m.Y - 8; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature turdyencounter; switch (Utility.Random(2)) { default: case 0: turdyencounter = new Turdy(); break; case 1: turdyencounter = new Turdy(); break; } turdyencounter.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); turdyencounter.Combatant = m; AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTurdyEncounter), turdyencounter); } } } // Random Encounter 1 if (Utility.RandomDouble() < 0.0002) { if (m.Map == Map.Malas) { int x1 = m.X + 8; int y1 = m.Y + 8; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature encounterb; switch (Utility.Random(2)) { default: case 0: encounterb = new AutumnwoodAdventurer(); break; case 1: encounterb = new AutumnwoodAdventurer(); break; } encounterb.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterB), encounterb); } } } // Random Encounter 2 if (Utility.RandomDouble() < 0.0002) { if (m.Map == Map.Malas) { int x2 = m.X - 8; int y2 = m.Y - 8; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature encounterb; switch (Utility.Random(2)) { default: case 0: encounterb = new AutumnwoodAdventurer(); break; case 1: encounterb = new AutumnwoodAdventurer(); break; } encounterb.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterB), encounterb); } } } // Tamable Encounter 1 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Malas) { int x1 = m.X + 8; int y1 = m.Y + 8; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature tameable; switch (Utility.Random(23)) { default: case 0: tameable = new Bird(); break; case 1: tameable = new Boar(); break; case 2: tameable = new BlackBear(); break; case 3: tameable = new Bull(); break; case 4: tameable = new Chicken(); break; case 5: tameable = new Cow(); break; case 6: tameable = new ForestBat(); break; case 7: tameable = new Goat(); break; case 8: tameable = new GreatHart(); break; case 9: tameable = new GreenSlime(); break; case 10: tameable = new GreySquirrel(); break; case 11: tameable = new GreyWolfPup(); break; case 12: tameable = new Hind(); break; case 13: tameable = new Horse(); break; case 14: tameable = new LargeFrog(); break; case 15: tameable = new Ogumo(); break; case 16: tameable = new Panther(); break; case 17: tameable = new Pig(); break; case 18: tameable = new Rabbit(); break; case 19: tameable = new Rat(); break; case 20: tameable = new RhinoBeetle(); break; case 21: tameable = new RunningPants(); break; case 22: tameable = new Sheep(); break; } tameable.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTameable), tameable); } } } // Tamable Encounter 2 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Malas) { int x2 = m.X - 8; int y2 = m.Y - 8; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature tameable; switch (Utility.Random(23)) { default: case 0: tameable = new Bird(); break; case 1: tameable = new Boar(); break; case 2: tameable = new BlackBear(); break; case 3: tameable = new Bull(); break; case 4: tameable = new Chicken(); break; case 5: tameable = new Cow(); break; case 6: tameable = new ForestBat(); break; case 7: tameable = new Goat(); break; case 8: tameable = new GreatHart(); break; case 9: tameable = new GreenSlime(); break; case 10: tameable = new GreySquirrel(); break; case 11: tameable = new GreyWolfPup(); break; case 12: tameable = new Hind(); break; case 13: tameable = new Horse(); break; case 14: tameable = new LargeFrog(); break; case 15: tameable = new Ogumo(); break; case 16: tameable = new Panther(); break; case 17: tameable = new Pig(); break; case 18: tameable = new Rabbit(); break; case 19: tameable = new Rat(); break; case 20: tameable = new RhinoBeetle(); break; case 21: tameable = new RunningPants(); break; case 22: tameable = new Sheep(); break; } tameable.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTameable), tameable); } } } // Random Treasure Chest 1 if (Utility.RandomDouble() < 0.0005) { if (m.Map == Map.Malas) { int x1 = m.X + 12; int y1 = m.Y + 12; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseContainer treasurechest; if (m.Skills.Tracking.Base > 14.9) { switch (Utility.Random(2)) { default: case 0: treasurechest = new AutumnwoodTreasureChest1(); break; case 1: treasurechest = new AutumnwoodTreasureChest1(); break; } treasurechest.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest); } } } } // Random Treasure Chest 2 if (Utility.RandomDouble() < 0.0005) { if (m.Map == Map.Malas) { int x2 = m.X - 12; int y2 = m.Y - 12; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseContainer treasurechest; if (m.Skills.Tracking.Base > 14.9) { switch (Utility.Random(2)) { default: case 0: treasurechest = new AutumnwoodTreasureChest1(); break; case 1: treasurechest = new AutumnwoodTreasureChest1(); break; } treasurechest.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest); } } } } } } }
public void BlackBearInheritsNurse() { BlackBear blackBear = new BlackBear(); Assert.Equal("Nursing", blackBear.Nurse()); }
public void BlackBearsRun() { BlackBear blackBear = new BlackBear(); Assert.Equal("Runs Really Fast", blackBear.Run()); }
public void BlackBearsEatBugs() { BlackBear blackBear = new BlackBear(); Assert.Equal("Digs up beetles to eat!", blackBear.EatsBugs()); }
public void BlackBearInheritBirth() { BlackBear blackBear = new BlackBear(); Assert.Equal("I have to nurse my young.", blackBear.Birth()); }
public override void Damage(Mobile m) { base.Damage(m); if (m.Alive) { Item item = m.FindItemOnLayer(Layer.OuterTorso); if (item is GMRobe) { AOS.Damage(m, 0, 0, 0, 0, 0, 0); } else if (item is GMRobeExplosion) { AOS.Damage(m, 0, 0, 0, 0, 0, 0); m.PlaySound(Utility.RandomList(0x307, 0x308)); } else if (item is GMRobeHoly) { AOS.Damage(m, 0, 0, 0, 0, 0, 0); m.FixedParticles(0x375A, 1, 30, 9966, 88, 2, EffectLayer.Head); m.FixedParticles(0x37B9, 1, 30, 9502, 85, 3, EffectLayer.Head); m.FixedParticles(0x376A, 1, 31, 9961, 80, 0, EffectLayer.Waist); m.FixedParticles(0x37C4, 1, 31, 9502, 88, 2, EffectLayer.Waist); } else if (item is GMRobeTrailfire) { AOS.Damage(m, 0, 0, 0, 0, 0, 0); m.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot); } else { // Wind if (Utility.RandomDouble() < 0.09) { m.PlaySound(Utility.RandomList(0x014, 0x15, 0x016, 0x5C7)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Thunderstorm if (Utility.RandomDouble() < 0.06) { m.PlaySound(Utility.RandomList(0x028, 0x029, 0x206)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Lightning Strike if (Utility.RandomDouble() < 0.01) { m.PlaySound(Utility.RandomList(0x5CE)); m.BoltEffect(0x480); AOS.Damage(m, Utility.RandomMinMax(12, 35), 0, 0, 0, 0, 100); } // Random Encounter 1 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Malas) { int x1 = m.X + 12; int y1 = m.Y + 12; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature encountera; switch (Utility.Random(3)) { default: case 0: encountera = new Ettin(); break; case 1: encountera = new Ogre(); break; case 2: encountera = new Troll(); break; } encountera.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); encountera.Combatant = m; AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(3.0), new TimerStateCallback(DeleteEncounterA), encountera); } } } // Random Encounter 2 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Malas) { int x2 = m.X - 12; int y2 = m.Y - 12; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature encountera; switch (Utility.Random(3)) { default: case 0: encountera = new Ettin(); break; case 1: encountera = new Ogre(); break; case 2: encountera = new Troll(); break; } encountera.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); encountera.Combatant = m; AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(3.0), new TimerStateCallback(DeleteEncounterA), encountera); } } } // Tamable Encounter 1 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Malas) { int x1 = m.X + 12; int y1 = m.Y + 12; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature tameable; switch (Utility.Random(5)) { default: case 0: tameable = new Bird(); break; case 1: tameable = new BlackBear(); break; case 2: tameable = new DireWolf(); break; case 3: tameable = new Goat(); break; case 4: tameable = new Horse(); break; } tameable.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(2.0), new TimerStateCallback(DeleteTameable), tameable); } } } // Tamable Encounter 2 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Malas) { int x2 = m.X - 12; int y2 = m.Y - 12; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature tameable; switch (Utility.Random(5)) { default: case 0: tameable = new Bird(); break; case 1: tameable = new BlackBear(); break; case 2: tameable = new DireWolf(); break; case 3: tameable = new Goat(); break; case 4: tameable = new Horse(); break; } tameable.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(2.0), new TimerStateCallback(DeleteTameable), tameable); } } } } } }
public override void Damage(Mobile m) { base.Damage(m); if (m.Alive) { Item item = m.FindItemOnLayer(Layer.OuterTorso); if (item is GMRobe) { AOS.Damage(m, 0, 0, 0, 0, 0, 0); } else { // Forest noises if (Utility.RandomDouble() < 0.008) { m.PlaySound(Utility.RandomList(0x000, 0x001, 0x002)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Bird chirps if (Utility.RandomDouble() < 0.002) { m.PlaySound(Utility.RandomList(0x094, 0x095, 0x096, 0x097, 0x0D1, 0x0D2)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Random Encounter 1 if (Utility.RandomDouble() < 0.003) { if (m.Map == Map.Malas) { int x1 = m.X + 8; int y1 = m.Y + 8; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature encountera; switch (Utility.Random(11)) { default: case 0: encountera = new AlytharrForestHart(); break; case 1: encountera = new AlytharrGrassSnake(); break; case 2: encountera = new BlackLizard(); break; case 3: encountera = new Centaur(); break; case 4: encountera = new HillToad(); break; case 5: encountera = new MinorBloodElemental(); break; case 6: encountera = new Pixie(); break; case 7: encountera = new WyvernYoungling(); break; case 8: encountera = new BlackBear(); break; case 9: encountera = new Crane(); break; case 10: encountera = new Panther(); break; } encountera.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterA), encountera); } } } // Random Encounter 2 if (Utility.RandomDouble() < 0.003) { if (m.Map == Map.Malas) { int x2 = m.X - 8; int y2 = m.Y - 8; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature encountera; switch (Utility.Random(11)) { default: case 0: encountera = new AlytharrForestHart(); break; case 1: encountera = new AlytharrGrassSnake(); break; case 2: encountera = new BlackLizard(); break; case 3: encountera = new Centaur(); break; case 4: encountera = new HillToad(); break; case 5: encountera = new MinorBloodElemental(); break; case 6: encountera = new Pixie(); break; case 7: encountera = new WyvernYoungling(); break; case 8: encountera = new BlackBear(); break; case 9: encountera = new Crane(); break; case 10: encountera = new Panther(); break; } encountera.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterA), encountera); } } } // Random Treasure Chest 1 if (Utility.RandomDouble() < 0.0005) { if (m.Map == Map.Malas) { int x1 = m.X + 12; int y1 = m.Y + 12; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseContainer treasurechest; if (m.Skills.Tracking.Base > 9.9) { switch (Utility.Random(2)) { default: case 0: treasurechest = new AlytharrRegionTreasureChest1(); break; case 1: treasurechest = new AlytharrRegionTreasureChest1(); break; } treasurechest.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest); } } } } // Random Treasure Chest 2 if (Utility.RandomDouble() < 0.0005) { if (m.Map == Map.Malas) { int x2 = m.X - 12; int y2 = m.Y - 12; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseContainer treasurechest; if (m.Skills.Tracking.Base > 9.9) { switch (Utility.Random(2)) { default: case 0: treasurechest = new AlytharrRegionTreasureChest1(); break; case 1: treasurechest = new AlytharrRegionTreasureChest1(); break; } treasurechest.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest); } } } } } } }
public override void OnDoubleClick(Mobile from) { if (IsChildOf(from.Backpack)) { int hours, minutes; Clock.GetTime(Map, Location.X, Location.Y, out hours, out minutes); if (hours <= 19) { #region Spawn Random Ambush switch (Utility.Random(3)) { case 0: { from.SendMessage("*As your gaze scans the horizon, you notice a group of brigands closing in*"); #region Define Mobiles To Spawn // I've reserved spawn01-spawn09; however, you can add as many variables as you like as long as they are unique Mobile spawn01 = new Brigand(); Mobile spawn02 = new Brigand(); Mobile spawn03 = new Brigand(); Mobile spawn04 = new Brigand(); Mobile spawn05 = new Brigand(); Mobile spawn06 = new Brigand(); #endregion switch (Utility.Random(2)) { case 1: { /// <summary> /// Don't forget to plug in the spawn variables you add above below: /// </summary> spawn01.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map); spawn02.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map); spawn03.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map); spawn04.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map); spawn05.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map); spawn06.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map); break; } case 0: { switch (Utility.Random(4)) { case 0: from.SendMessage("*As your gaze scans the horizon, all seems too quiet*"); break; case 1: from.SendMessage("*As your gaze scans the horizon, you hear breaking branches in the distance*"); break; // Sometimes a subspawn is the perfect ambiance/ detail to role-playing on a server case 2: from.SendMessage("*You notice the ground moving beneath your feet*"); Mobile subspawn01 = new Rat(); subspawn01.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map); break; case 3: from.SendMessage("*As your gaze scans the horizon, you feel confident all is well*"); break; } break; } } break; } case 1: { from.SendMessage("*As your gaze scans the horizon, you notice an Ettin patrol nearby*"); #region Define Mobiles To Spawn // I've reserved spawn11-spawn19; however, you can add as many variables as you like as long as they are unique Mobile spawn11 = new Ettin(); Mobile spawn12 = new Ettin(); Mobile spawn13 = new Ettin(); Mobile spawn14 = new Ettin(); Mobile spawn15 = new Ettin(); Mobile spawn16 = new Ettin(); #endregion switch (Utility.Random(2)) { case 1: { /// <summary> /// Don't forget to plug in the spawn variables you add above below: /// </summary> spawn11.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map); spawn12.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map); spawn13.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map); spawn14.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map); spawn15.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map); spawn16.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map); break; } case 0: { switch (Utility.Random(2, 4)) { case 0: from.SendMessage("*As your gaze scans the horizon, all seems too quiet*"); break; case 1: from.SendMessage("*As your gaze scans the horizon, you hear breaking branches in the distance*"); break; // Sometimes a subspawn is the perfect ambiance/ detail to role-playing on a server case 2: from.SendMessage("*You notice the ground moving beneath your feet*"); Mobile subspawn11 = new Rat(); subspawn11.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map); break; case 3: from.SendMessage("*As your gaze scans the horizon, you feel confident all is well*"); break; } break; } } break; } case 2: // This case makes the Scout Spyglass act like a normal Spyglass { if (hours < 5 || hours > 17) { from.SendLocalizedMessage(1055040); // You gaze up into the glittering night sky. With great care, you compose a chart of the most prominent star patterns. } else { from.SendLocalizedMessage(1055039); // You gaze up into the sky, but it is not dark enough to see any stars. } break; } } #endregion } else { #region Spawn Random Ambush switch (Utility.Random(3)) { case 0: { from.SendMessage("*As your gaze scans the horizon, you notice a group of black bears closing in*"); #region Define Mobiles To Spawn // I've reserved spawn21-spawn29; however, you can add as many variables as you like as long as they are unique Mobile spawn21 = new BlackBear(); Mobile spawn22 = new BlackBear(); Mobile spawn23 = new BlackBear(); Mobile spawn24 = new BlackBear(); Mobile spawn25 = new BlackBear(); Mobile spawn26 = new BlackBear(); #endregion switch (Utility.Random(2)) { case 1: { /// <summary> /// Don't forget to plug in the spawn variables you add above below: /// </summary> spawn21.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map); spawn22.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map); spawn23.MoveToWorld(new Point3D(from.X + 20, from.Y, from.Z), from.Map); spawn24.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map); spawn25.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map); spawn26.MoveToWorld(new Point3D(from.X, from.Y + 20, from.Z), from.Map); break; } case 0: { switch (Utility.Random(4)) { case 0: from.SendMessage("*As your gaze scans the horizon, all seems too quiet*"); break; case 1: from.SendMessage("*As your gaze scans the horizon, you hear breaking branches in the distance*"); break; // Sometimes a subspawn is the perfect ambiance/ detail to role-playing on a server case 2: from.SendMessage("*You notice the ground moving beneath your feet*"); Mobile subspawn21 = new Rat(); subspawn21.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map); break; case 3: from.SendMessage("*As your gaze scans the horizon, you feel confident all is well*"); break; } break; } } break; } case 1: { from.SendMessage("*As your gaze scans the horizon, you notice an Fire Gargoyle patrol nearby*"); #region Define Mobiles To Spawn // I've reserved spawn31-spawn39; however, you can add as many variables as you like as long as they are unique Mobile spawn31 = new FireGargoyle(); Mobile spawn32 = new FireSteed(); Mobile spawn33 = new FireGargoyle(); Mobile spawn34 = new FireSteed(); Mobile spawn35 = new FireGargoyle(); Mobile spawn36 = new FireBeetle(); #endregion switch (Utility.Random(2)) { case 1: { /// <summary> /// Don't forget to plug in the spawn variables you add above below: /// </summary> spawn31.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map); spawn32.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map); spawn33.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map); spawn34.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map); spawn35.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map); spawn36.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map); break; } case 0: { switch (Utility.Random(4)) { case 0: from.SendMessage("*As your gaze scans the horizon, all seems too quiet*"); break; case 1: from.SendMessage("*As your gaze scans the horizon, you hear breaking branches in the distance*"); break; // Sometimes a subspawn is the perfect ambiance/ detail to role-playing on a server case 2: from.SendMessage("*You notice the ground moving beneath your feet*"); Mobile subspawn31 = new Rat(); subspawn31.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map); break; case 3: from.SendMessage("*As your gaze scans the horizon, you feel confident all is well*"); break; } break; } } break; } case 2: // This case makes the Scout Spyglass act like a normal Spyglass { if (hours < 5 || hours > 17) { from.SendLocalizedMessage(1055040); // You gaze up into the glittering night sky. With great care, you compose a chart of the most prominent star patterns. } else { from.SendLocalizedMessage(1055039); // You gaze up into the sky, but it is not dark enough to see any stars. } break; } } #endregion } --this.UsesRemaining; if (this.UsesRemaining == 0) { this.Delete(); } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } }
public override void OnCast() { if (CheckSequence()) { double time = DamagingSkill(Caster) * 2; if (time > 480) { time = 480.0; } if (time < 120) { time = 120.0; } int creatures = Caster.FollowersMax - Caster.Followers; if (creatures > 3) { creatures = 3; } TimeSpan duration = TimeSpan.FromSeconds(time); BaseCreature m_Creature = new Rabbit(); while (creatures > 0) { creatures--; switch (Utility.RandomMinMax(0, 10)) { case 0: m_Creature = new BlackBear(); break; case 1: m_Creature = new BrownBear(); break; case 2: m_Creature = new DireWolf(); break; case 3: m_Creature = new Panther(); break; case 4: m_Creature = new Tiger(); break; case 5: m_Creature = new TimberWolf(); break; case 6: m_Creature = new Scorpion(); break; case 7: m_Creature = new GiantSpider(); break; case 8: m_Creature = new HugeLizard(); break; case 9: m_Creature = new GiantToad(); break; case 10: m_Creature = new Slime(); break; } m_Creature.ControlSlots = 1; SpellHelper.Summon(m_Creature, Caster, 0x216, duration, false, false); } m_Creature.FixedParticles(0x3728, 8, 20, 5042, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0), 0, EffectLayer.Head); Server.Misc.Research.ConsumeScroll(Caster, true, spellIndex, false); } FinishSequence(); }
public void BlackBearCanInheritSleep() { BlackBear blackBear = new BlackBear(); Assert.Equal("ZZZ... ZZZ... ZZZ...", blackBear.Sleep()); }
public void BlackBearCanInheritEat() { BlackBear blackBear = new BlackBear(); Assert.Equal("I like to eat meat!!!", blackBear.Eat()); }
static void Main(string[] args) { // Brown bear instance BrownBear yogi = new BrownBear(); yogi.AnimalCount++; Console.WriteLine($"{yogi.Speak()} I'm a brown bear!"); Console.WriteLine($"There are {yogi.AnimalCount} brown bears in the Zoo."); Console.WriteLine($"Is the brown bear a warm blooded animal? {yogi.IsWarmBlooded}"); Console.WriteLine(yogi.BearHug()); Console.WriteLine(yogi.GuestFeedAnimal()); Console.WriteLine(); // Tiger instance Tiger tony = new Tiger(); Console.WriteLine(tony.Feed()); Console.WriteLine(tony.StaffFeedAnimal()); Console.WriteLine(tony.Swim()); Console.WriteLine(); // Black bear instance BlackBear baloo = new BlackBear(); Console.WriteLine($"{baloo.Speak()} I'm a black bear!"); Console.WriteLine(baloo.Swim()); Console.WriteLine(); // Platypus instance Platypus abomination = new Platypus(); Console.WriteLine($"I'm a platypus! Am I venomous? {abomination.IsVenomous}"); Console.WriteLine(abomination.Feed()); Console.WriteLine(); // Alligator instance Alligator seeYaLater = new Alligator(); Console.WriteLine($"There are {seeYaLater.AnimalCount} alligators in the zoo."); Console.WriteLine($"Do gators lay eggs? {seeYaLater.LaysEggs}"); Console.WriteLine(seeYaLater.Feed()); Console.WriteLine(); // Sea Turtle instance SeaTurtle timmy = new SeaTurtle(); Console.WriteLine($"I'm a sea turtle! Do I lay eggs? {timmy.LaysEggs}"); Console.WriteLine(timmy.Swim()); Console.WriteLine(); // Box Turtle instance BoxTurtle michaelangelo = new BoxTurtle(); Console.WriteLine($"I'm a box turtle! Can I swim? {michaelangelo.LivesInWater}"); Console.WriteLine(michaelangelo.Feed()); Console.WriteLine(); // King Cobra instance KingCobra commander = new KingCobra(); Console.WriteLine($"I'm a king cobra! Am I venomous? {commander.IsVenomous}"); Console.WriteLine($"Do I lay eggs? {commander.LaysEggs}"); Console.WriteLine(commander.Feed()); }
public void BlackBearsInheritSleep() { BlackBear blackBear = new BlackBear(); Assert.Equal("Sleeps in caves", blackBear.Sleep()); }
public override void Damage(Mobile m) { base.Damage(m); if (m.Alive) { Item item = m.FindItemOnLayer(Layer.OuterTorso); if (item is GMRobe) { AOS.Damage(m, 0, 0, 0, 0, 0, 0); } else { // Bank Music if (Utility.RandomDouble() < 0.001) { m.Send(Network.PlayMusic.GetInstance(MusicName.Stones2)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Flamestrike if (Utility.RandomDouble() < 0.01) { m.Stam -= 20; m.Mana -= 25; m.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot); m.PlaySound(0x208); m.PlaySound(m.Female ? 814 : 1088); m.Say("*ahhhh!*"); AOS.Damage(m, Utility.Random(15, 25), 0, 100, 0, 0, 0); } // Forest Music if (Utility.RandomDouble() < 0.001) { m.Send(Network.PlayMusic.GetInstance(MusicName.Linelle)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Greater Heal if (Utility.RandomDouble() < 0.01) { m.Hits += (Utility.Random(250, 300)); m.Stam += (Utility.Random(250, 300)); m.Mana += (Utility.Random(250, 300)); m.FixedParticles(0x375A, 1, 30, 9966, 88, 2, EffectLayer.Head); m.FixedParticles(0x37B9, 1, 30, 9502, 85, 3, EffectLayer.Head); m.FixedParticles(0x376A, 1, 31, 9961, 80, 0, EffectLayer.Waist); m.FixedParticles(0x37C4, 1, 31, 9502, 88, 2, EffectLayer.Waist); m.PlaySound(0x202); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Ice Blast if (Utility.RandomDouble() < 0.01) { m.Stam -= 10; m.Mana -= 20; m.FixedParticles(0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist); m.PlaySound(0x0FC); AOS.Damage(m, Utility.Random(15, 25), 0, 0, 100, 0, 0); } // Lightning Strike if (Utility.RandomDouble() < 0.01) { m.PlaySound(Utility.RandomList(0x5CE)); m.BoltEffect(0x480); AOS.Damage(m, Utility.RandomMinMax(12, 35), 0, 0, 0, 0, 100); } // Random Encounter 1 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Tokuno) { int x1 = m.X + 12; int y1 = m.Y + 12; int z1 = Map.Tokuno.GetAverageZ(x1, y1); if (Map.Tokuno.CanSpawnMobile(x1, y1, z1)) { BaseCreature encountera; switch (Utility.Random(3)) { default: case 0: encountera = new RunningPants(); break; case 1: encountera = new RunningPants(); break; case 2: encountera = new RunningPants(); break; } encountera.MoveToWorld(new Point3D(x1, y1, z1), Map.Tokuno); encountera.Combatant = m; IceFieldIceFlame ice = new IceFieldIceFlame(); ice.MoveToWorld(new Point3D(encountera.X + 5, encountera.Y, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame icea = new IceFieldIceFlame(); icea.MoveToWorld(new Point3D(encountera.X + 5, encountera.Y + 5, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame iceb = new IceFieldIceFlame(); iceb.MoveToWorld(new Point3D(encountera.X + 5, encountera.Y - 5, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame icec = new IceFieldIceFlame(); icec.MoveToWorld(new Point3D(encountera.X, encountera.Y + 5, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame iced = new IceFieldIceFlame(); iced.MoveToWorld(new Point3D(encountera.X, encountera.Y - 5, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame icee = new IceFieldIceFlame(); icee.MoveToWorld(new Point3D(encountera.X - 5, encountera.Y, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame icef = new IceFieldIceFlame(); icef.MoveToWorld(new Point3D(encountera.X - 5, encountera.Y - 5, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame iceg = new IceFieldIceFlame(); iceg.MoveToWorld(new Point3D(encountera.X - 5, encountera.Y + 5, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame iceh = new IceFieldIceFlame(); iceh.ItemID = 0x8e1; iceh.MoveToWorld(new Point3D(encountera.X, encountera.Y, encountera.Z + 19), encountera.Map); m.PlaySound(0x208); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(3.0), new TimerStateCallback(DeleteEncounterA), encountera); } } } // Random Encounter 2 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Tokuno) { int x2 = m.X - 12; int y2 = m.Y - 12; int z2 = Map.Tokuno.GetAverageZ(x2, y2); if (Map.Tokuno.CanSpawnMobile(x2, y2, z2)) { BaseCreature encountera; switch (Utility.Random(3)) { default: case 0: encountera = new RunningPants(); break; case 1: encountera = new RunningPants(); break; case 2: encountera = new RunningPants(); break; } encountera.MoveToWorld(new Point3D(x2, y2, z2), Map.Tokuno); encountera.Combatant = m; IceFieldIceFlame ice = new IceFieldIceFlame(); ice.MoveToWorld(new Point3D(encountera.X + 5, encountera.Y, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame icea = new IceFieldIceFlame(); icea.MoveToWorld(new Point3D(encountera.X + 5, encountera.Y + 5, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame iceb = new IceFieldIceFlame(); iceb.MoveToWorld(new Point3D(encountera.X + 5, encountera.Y - 5, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame icec = new IceFieldIceFlame(); icec.MoveToWorld(new Point3D(encountera.X, encountera.Y + 5, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame iced = new IceFieldIceFlame(); iced.MoveToWorld(new Point3D(encountera.X, encountera.Y - 5, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame icee = new IceFieldIceFlame(); icee.MoveToWorld(new Point3D(encountera.X - 5, encountera.Y, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame icef = new IceFieldIceFlame(); icef.MoveToWorld(new Point3D(encountera.X - 5, encountera.Y - 5, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame iceg = new IceFieldIceFlame(); iceg.MoveToWorld(new Point3D(encountera.X - 5, encountera.Y + 5, encountera.Z), encountera.Map); m.PlaySound(0x208); IceFieldIceFlame iceh = new IceFieldIceFlame(); iceh.ItemID = 0x8e1; iceh.MoveToWorld(new Point3D(encountera.X, encountera.Y, encountera.Z + 19), encountera.Map); m.PlaySound(0x208); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(3.0), new TimerStateCallback(DeleteEncounterA), encountera); } } } // Tamable Encounter 1 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Tokuno) { int x1 = m.X + 12; int y1 = m.Y + 12; int z1 = Map.Tokuno.GetAverageZ(x1, y1); if (Map.Tokuno.CanSpawnMobile(x1, y1, z1)) { BaseCreature tameable; switch (Utility.Random(5)) { default: case 0: tameable = new Bird(); break; case 1: tameable = new BlackBear(); break; case 2: tameable = new DireWolf(); break; case 3: tameable = new Goat(); break; case 4: tameable = new Horse(); break; } tameable.MoveToWorld(new Point3D(x1, y1, z1), Map.Tokuno); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(2.0), new TimerStateCallback(DeleteTameable), tameable); } } } // Tamable Encounter 2 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Tokuno) { int x2 = m.X - 12; int y2 = m.Y - 12; int z2 = Map.Tokuno.GetAverageZ(x2, y2); if (Map.Tokuno.CanSpawnMobile(x2, y2, z2)) { BaseCreature tameable; switch (Utility.Random(5)) { default: case 0: tameable = new Bird(); break; case 1: tameable = new BlackBear(); break; case 2: tameable = new DireWolf(); break; case 3: tameable = new Goat(); break; case 4: tameable = new Horse(); break; } tameable.MoveToWorld(new Point3D(x2, y2, z2), Map.Tokuno); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(2.0), new TimerStateCallback(DeleteTameable), tameable); } } } } } }
public void BlackBearCanClimbTree() { BlackBear blackBear = new BlackBear(); Assert.Equal("Let's climb a tree!", blackBear.ClimbTree()); }