doggo-quest-logic
Version:
The game logic for the Doggo Quest text-based game sample project
43 lines (42 loc) • 1.95 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const GameObjectBase_1 = require("../GameObjectBase");
const Room_1 = require("../Room");
const BackDoorObject_1 = require("./BackDoorObject");
const BowlObject_1 = require("./BowlObject");
const DiningChairObject_1 = require("./DiningChairObject");
const TableObject_1 = require("./TableObject");
class DiningObject extends GameObjectBase_1.GameObjectBase {
constructor(room) {
super('dining');
this.room = room;
this.children = [
new TableObject_1.TableObject(room),
new DiningChairObject_1.DiningChairObject(room),
new BackDoorObject_1.BackDoorObject(room),
new BowlObject_1.BowlObject(room),
];
if (this.room === Room_1.Room.Dining) {
this.smell = 'It smells like a mixture of old food and the air from outside.';
this.lick = `You're not going to just lick the floor. You need to be more specific!`;
this.eat = this.CantBeSeriousMessage;
this.pull = this.CantBeSeriousMessage;
this.push = this.CantBeSeriousMessage;
}
else {
this.smell = `You can't really smell all the details from here; you'll need to get closer.`;
this.lick = this.TooFarMessage;
this.push = this.TooFarMessage;
this.pull = this.TooFarMessage;
this.eat = this.TooFarMessage;
}
this.think = 'The dining room is where I beg daddy for food while mommy and daddy are eating at the table.';
}
matches(reduced, room) {
return super.matches(reduced, room)
|| (room === Room_1.Room.Entryway && reduced === 'room')
|| (room === Room_1.Room.Living && reduced === 'room')
|| (room === Room_1.Room.Kitchen && reduced === 'room');
}
}
exports.DiningObject = DiningObject;