doggo-quest-logic
Version:
The game logic for the Doggo Quest text-based game sample project
36 lines (35 loc) • 1.6 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const GameObjectBase_1 = require("../GameObjectBase");
const Room_1 = require("../Room");
const FrontDoorObject_1 = require("./FrontDoorObject");
const GateObject_1 = require("./GateObject");
const StairsObject_1 = require("./StairsObject");
class HallwayObject extends GameObjectBase_1.GameObjectBase {
constructor(room) {
super('hallway');
this.children = [
new FrontDoorObject_1.FrontDoorObject(),
new StairsObject_1.StairsObject(),
new GateObject_1.GateObject(),
];
this.look = `The hallway is narrow, dark, and uninteresting. It exists to connect the stairs, front door, and office to the dining room and the rest of the floor.`;
if (room !== Room_1.Room.Entryway) {
this.smell = this.TooFarMessage;
this.lick = this.TooFarMessage;
this.eat = this.TooFarMessage;
}
else {
this.smell = `It smells sort of boring, honestly.`;
this.lick = `There's nothing interesting on the floor to lick.`;
this.eat = this.CantBeSeriousMessage;
}
this.push = this.CantBeSeriousMessage;
this.pull = this.CantBeSeriousMessage;
this.think = `I don't really love the hallway. It's just a place to be when I'm going to other places.`;
}
matches(reduced, room) {
return super.matches(reduced, room) || reduced === 'hall' || reduced === 'entryway';
}
}
exports.HallwayObject = HallwayObject;