road01.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. module.exports = class PhandalinRoad1 {
  2. constructor() {
  3. this.id = this.constructor.name;
  4. this.name = "Phandalin Road";
  5. this.description = "A well worn dirt road leading to the town green to the north. The bustle of the town square is heard to the northeast.";
  6. this.filename = "phandalin/road01.js";
  7. this.type = "room";
  8. this.items = [];
  9. this.mobiles = [];
  10. this.roomExpires = 0;
  11. this.resetDelay = 12000000;
  12. this.roomExits = ["north", "northeast", "south"];
  13. }
  14. mud_reset(time) {
  15. libs.Output.toRoom(this.id, "One of the townsfolk smiles as she 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. south(room, mobile, input) {
  30. world.mud_moveMobile(mobile.id, this.id, "PhandalinRoad2", "leaves south");
  31. return true;
  32. }
  33. north(room, mobile, input) {
  34. world.mud_moveMobile(mobile.id, this.id, "PhandalinTownGreen", "leaves north");
  35. return true;
  36. }
  37. west(room, mobile, input) {
  38. world.mud_moveMobile(mobile.id, this.id, "PhandalinGrassField", "leaves west");
  39. return true;
  40. }
  41. northeast(room, mobile, input) {
  42. world.mud_moveMobile(mobile.id, this.id, "PhandalinTownSquare", "leaves northeast");
  43. return true;
  44. }
  45. };