12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- module.exports = class PhandalinTownGreen {
- constructor() {
- this.id = this.constructor.name;
- this.name = "Phandalin Town Green";
- this.description = "A lush green clearing, the {hint}grass{/hint} blowing in the warm summer breeze. The sun shines harshly on this shadeless hill, but the {hint}children{/hint} playing here do not seem to mind.";
- this.filename = "phandalin/towngreen.js";
- this.type = "room";
- this.items = [];
- this.mobiles = [];
- this.roomExpires = 0;
- this.resetDelay = 12000000;
- this.roomExits = ["south", "east"];
- }
- mud_reset(time) {
- libs.Output.toRoom(this.id, "A {hint}child{/hint} laughs as she plays with her friends.");
- this.roomExpires = time + this.resetDelay;
- }
- mud_tick(time) {
- if(time >= this.roomExpires) {
- this.mud_reset(time);
- }
- }
- mud_getName() {
- return this.name;
- }
- mud_getDescription() {
- return this.description;
- }
- look(room, mobile, input) {
- switch(input[0]) {
- case "grass":
- libs.Output.toMobile(mobile.id, "The grass is bright green and full of tiny leaf-like {hint}insects{/hint}, hopping about.");
- return true;
- case "child":
- case "children":
- libs.Output.toMobile(mobile.id, "A few children who live in the town play around you. Some are trying to catch {hint}insects{/hint} and others are chasing each other and screaming with joy.");
- return true;
- case "insect":
- case "grasshopper":
- case "insects":
- case "grasshoppers":
- libs.Output.toMobile(mobile.id, "Tiny and leaf-shaped, the grasshoppers are an important staple of summer.");
- return true;
- }
- }
- south(room, mobile, input) {
- world.mud_moveMobile(mobile.id, this.id, "PhandalinRoad1", "leaves south");
- return true;
- }
- east(room, mobile, input) {
- world.mud_moveMobile(mobile.id, this.id, "PhandalinTownSquare", "leaves east");
- return true;
- }
- catch(room, mobile, input) {
- switch(input[0]) {
- case "bug":
- case "insect":
- case "leafhopper":
- case "grasshopper":
- libs.Output.toMobile(mobile.id, "You spend a little time disturbing the grass with your hands, and manage to grab a leafhopper.");
- libs.Output.toRoom(room.id, mobile.name + " flops around in the grass and stands up grinning.", mobile);
- var grasshopper = builder.mud_spawnItem("Leafhopper");
- grasshopper.heldBy = mobile.id;
- world.mud_addItemToMobile(mobile.id, grasshopper.id);
- return true;
- }
- }
- };
|