townsquare.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. module.exports = class PhandalinTownSquare {
  2. constructor() {
  3. this.id = this.constructor.name;
  4. this.name = "Phandalin Town Square";
  5. this.description = "The square is a large, well-trodden area that acts as the hub for the town. The lush grass of the green to the west beacons to you. You can see a shrine to the north and a tall, important looking building to the southeast. There is a big yellow-and-black sign here.";
  6. this.filename = "phandalin/townsquare.js";
  7. this.type = "room";
  8. this.items = [];
  9. this.mobiles = [];
  10. this.roomExpires = 0;
  11. this.resetDelay = 12000000;
  12. this.roomExits = ["west", "north", "south", "southwest", "east"];
  13. }
  14. mud_reset(time) {
  15. libs.Output.toRoom(this.id, "One of the townsfolk smiles as he passes by.");
  16. this.roomExpires = time + this.resetDelay;
  17. }
  18. mud_tick(time) {
  19. if(time >= this.roomExpires) {
  20. this.mud_reset(time);
  21. }
  22. }
  23. mud_getDescription() {
  24. return this.description;
  25. }
  26. look(room, mobile, input) {
  27. switch(input[0]) {
  28. case "sign":
  29. libs.Output.toMobile(mobile.id, "This town is currently under construction! Please take care not to fall off the edge of reality!\r\n\t\t-Midas");
  30. return true;
  31. }
  32. }
  33. read(room, mobile, input) {
  34. switch(input[0]) {
  35. case "sign":
  36. libs.Output.toMobile(mobile.id, "This town is currently under construction! Please take care not to fall off the edge of reality!\r\n\t\t-Midas");
  37. return true;
  38. }
  39. }
  40. north(room, mobile, input) {
  41. world.mud_moveMobile(mobile.id, this.id, "PhandalinShrineLuck");
  42. return true;
  43. }
  44. west(room, mobile, input) {
  45. world.mud_moveMobile(mobile.id, this.id, "PhandalinTownGreen");
  46. return true;
  47. }
  48. east(room, mobile, input) {
  49. world.mud_moveMobile(mobile.id, this.id, "PhandalinRoad7");
  50. return true;
  51. }
  52. south(room, mobile, input) {
  53. world.mud_moveMobile(mobile.id, this.id, "PhandalinRoad6");
  54. return true;
  55. }
  56. southwest(room, mobile, input) {
  57. world.mud_moveMobile(mobile.id, this.id, "PhandalinRoad1");
  58. return true;
  59. }
  60. };