aboutsummaryrefslogtreecommitdiff
path: root/queen/logic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'queen/logic.cpp')
-rw-r--r--queen/logic.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/queen/logic.cpp b/queen/logic.cpp
index 38fe57326b..6a1f40364a 100644
--- a/queen/logic.cpp
+++ b/queen/logic.cpp
@@ -116,6 +116,11 @@ Verb State::findDefaultVerb(uint16 state) {
}
+StateUse State::findUse(uint16 state) {
+ return (state & (1 << 10)) ? STATE_USE : STATE_USE_ON;
+}
+
+
void State::alterOn(uint16 *objState, StateOn state) {
switch (state) {
case STATE_ON_ON:
@@ -1926,6 +1931,36 @@ Verb Logic::findVerb(int16 cursorx, int16 cursory) const {
}
+uint16 Logic::findObjectFromZone(uint16 zoneNum) {
+
+ // l.316-327 select.c
+ uint16 noun = zoneNum;
+ uint16 objectMax = _objMax[_currentRoom];
+ if (zoneNum > objectMax) {
+ // this is an area box, check for associated object
+ uint16 obj = _area[_currentRoom][zoneNum - objectMax].object;
+ if (obj != 0) {
+ // there is an object, get its number
+ noun = obj - _roomData[_currentRoom];
+ }
+ }
+ return noun;
+}
+
+
+const char *Logic::verbName(Verb v) const {
+
+ if (v != VERB_NONE && v < 13) {
+ return _verbName[v];
+ }
+ else {
+ error("Logic::verbName() - Invalid verb %d", v);
+ return NULL;
+ }
+}
+
+
+
void Logic::update() {
_graphics->update(_currentRoom);
_input->delay();