townsquare.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.\r\nThere 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_getName() {
  24. return this.name;
  25. }
  26. mud_getDescription() {
  27. return this.description;
  28. }
  29. look(room, mobile, input) {
  30. switch(input[0]) {
  31. case "sign":
  32. 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");
  33. return true;
  34. }
  35. }
  36. read(room, mobile, input) {
  37. switch(input[0]) {
  38. case "sign":
  39. 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");
  40. return true;
  41. }
  42. }
  43. north(room, mobile, input) {
  44. world.mud_moveMobile(mobile.id, this.id, "PhandalinShrineLuck", "leaves north");
  45. return true;
  46. }
  47. west(room, mobile, input) {
  48. world.mud_moveMobile(mobile.id, this.id, "PhandalinTownGreen", "leaves west");
  49. return true;
  50. }
  51. east(room, mobile, input) {
  52. world.mud_moveMobile(mobile.id, this.id, "PhandalinRoad7", "leaves east");
  53. return true;
  54. }
  55. south(room, mobile, input) {
  56. world.mud_moveMobile(mobile.id, this.id, "PhandalinRoad6", "leaves south");
  57. return true;
  58. }
  59. southwest(room, mobile, input) {
  60. world.mud_moveMobile(mobile.id, this.id, "PhandalinRoad1", "leaves southwest");
  61. return true;
  62. }
  63. };