stick.js 665 B

123456789101112131415161718192021222324252627282930313233343536
  1. module.exports = class Stick {
  2. constructor() {
  3. this.id = 0;
  4. this.name = "a stick";
  5. this.description = "A small crooked stick, splintered on the ends.";
  6. this.type = "item";
  7. this.keywords = ["stick"];
  8. this.resetDelay = 12000000;
  9. this.itemExpires = 0;
  10. this.filename = "stick.js";
  11. this.value = 2;
  12. }
  13. mud_init() {
  14. world.mud_addItemToRoom("PhandalinTownGreen", this.id);
  15. }
  16. mud_reset(time) {
  17. this.itemExpires = time + this.resetDelay;
  18. }
  19. mud_tick(time) {
  20. if(time >= this.itemExpires) {
  21. this.mud_reset(time);
  22. }
  23. }
  24. mud_getName() {
  25. return "{item}" + this.name + "{/item}";
  26. }
  27. mud_getDescription() {
  28. return this.description;
  29. }
  30. }