1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- 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);
- }
- }
- 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");
- return true;
- }
- east(room, mobile, input) {
- world.mud_moveMobile(mobile.id, this.id, "PhandalinTownSquare");
- 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;
- }
- }
- };
|