doggo-quest-logic
Version:
The game logic for the Doggo Quest text-based game sample project
38 lines (37 loc) • 1.8 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const GameObjectBase_1 = require("../GameObjectBase");
const CouchObject_1 = require("../LivingArea/CouchObject");
const Room_1 = require("../Room");
const TableObject_1 = require("./TableObject");
const TelevisionObject_1 = require("./TelevisionObject");
const ToyBoxObject_1 = require("./ToyBoxObject");
class LivingRoomObject extends GameObjectBase_1.GameObjectBase {
constructor(room) {
super('livingroom');
this.children = [
new CouchObject_1.CouchObject(room),
new TableObject_1.TableObject(room),
new TelevisionObject_1.TelevisionObject(room),
new ToyBoxObject_1.ToyBoxObject(room),
];
if (room !== Room_1.Room.Living) {
this.smell = this.TooFarMessage;
this.lick = this.TooFarMessage;
this.eat = this.TooFarMessage;
}
else {
this.smell = `It smells like fun! This is the room I get to play with toys and run around in!`;
this.lick = `I don't think so. The carpet isn't that fun to lick.`;
this.eat = this.CantBeSeriousMessage;
}
this.push = this.CantBeSeriousMessage;
this.pull = this.CantBeSeriousMessage;
this.think = `I love the living room! I get to run around and play here while mommy and daddy watch TV.`;
this.look = `The living room has a bunch of carpet to run around in, as well as a couch, table, TV, and a toy box with all my fun stuff in it!`;
}
matches(reduced, room) {
return super.matches(reduced, room) || (reduced === 'room' && room !== Room_1.Room.Living) || reduced === 'living';
}
}
exports.LivingRoomObject = LivingRoomObject;