1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- module.exports = class Book {
- constructor() {
- this.id = 0;
- this.name = "a leather-bound book";
- this.description = "A beautiful old book bound in aged brown leather.";
- this.type = "item";
- this.keywords = ["book"];
- this.resetDelay = 12000000;
- this.mud_reset(0);
- this.filename = "book.js";
- this.heldBy = -1;
- this.value = 25;
- this.itemSlot = libs.ItemSlot.MainHand;
- }
- mud_reset(time) {
- this.itemExpires = time + this.resetDelay;
- }
- mud_tick(time) {
- if(time >= this.itemExpires) {
- this.mud_reset(time);
- }
- }
- mud_getName() {
- return "{item}" + this.name + "{/item}";
- }
- mud_getDescription() {
- return this.description;
- }
- read(room, mobile, input) {
- if(this.isWorn == mobile.id) {
- libs.Output.toMobile(mobile.id, "Flipping briefly through the book, you see the pages are all blank.", mobile);
- return true;
- } else if(this.isWorn != mobile.id) {
- libs.Output.toMobile(mobile.id, "You would have to {hint}hold{/hint} a book first.", mobile);
- return true;
- }
- }
- }
|