+/*
+ * Actions for the duneon-running code.
+ *
+ * Copyright (c) 1977, 2005 by Will Crowther and Don Woods
+ * Copyright (c) 2017 by Eric S. Raymond
+ * SPDX-License-Identifier: BSD-2-clause
+ */
+
if (game.place[EGGS] == LOC_NOWHERE && game.place[TROLL] == LOC_NOWHERE && game.prop[TROLL] == TROLL_UNPAID)
game.prop[TROLL] = TROLL_PAIDONCE;
if (HERE(EGGS))
if (game.place[EGGS] == LOC_NOWHERE && game.place[TROLL] == LOC_NOWHERE && game.prop[TROLL] == TROLL_UNPAID)
game.prop[TROLL] = TROLL_PAIDONCE;
if (HERE(EGGS))
- pspeak(EGGS, look, EGGS_VANISHED, true);
+ pspeak(EGGS, look, true, EGGS_VANISHED);
- pspeak(EGGS, look, EGGS_HERE, true);
+ pspeak(EGGS, look, true, EGGS_HERE);
- pspeak(EGGS, look, EGGS_DONE, true);
+ pspeak(EGGS, look, true, EGGS_DONE);
- pspeak(BATTERY, look, FRESH_BATTERIES, true);
+ pspeak(BATTERY, look, true, FRESH_BATTERIES);
if (game.prop[URN] != URN_EMPTY) {
state_change(URN, URN_DARK);
} else {
if (game.prop[URN] != URN_EMPTY) {
state_change(URN, URN_DARK);
} else {
- pspeak(URN, change, URN_DARK, true);
+ pspeak(URN, change, true, URN_DARK);
- pspeak(i, touch, -1, false);
+ pspeak(i, touch, false, -1);
- pspeak(i, hear, mi, true, game.zzword);
+ pspeak(i, hear, true, mi, game.zzword);
- pspeak(command.obj, study, game.prop[command.obj], true);
+ pspeak(command.obj, study, true, game.prop[command.obj]);
- (command.word[1].id == XYZZY ||
- command.word[1].id == PLUGH ||
- command.word[1].id == PLOVER)) {
- return GO_WORD2;
+ (command.word[1].id == XYZZY ||
+ command.word[1].id == PLUGH ||
+ command.word[1].id == PLOVER)) {
+ return GO_WORD2;
- command.word[1].id == FIE ||
- command.word[1].id == FOE ||
- command.word[1].id == FOO ||
- command.word[1].id == FUM ||
- command.word[1].id == PART)) {
+ command.word[1].id == FIE ||
+ command.word[1].id == FOE ||
+ command.word[1].id == FOO ||
+ command.word[1].id == FUM ||
+ command.word[1].id == PART)) {
return bigwords(command.word[1].id);
}
sspeak(OKEY_DOKEY, command.word[1].raw);
return bigwords(command.word[1].id);
}
sspeak(OKEY_DOKEY, command.word[1].raw);
- /* Previously, actions that result in a message, but don't do anything
- * further were called "specials". Now they're handled here as normal
+ /* Previously, actions that result in a message, but don't do anything
+ * further were called "specials". Now they're handled here as normal
* actions. If noaction is true, then we spit out the message and return */
if (actions[command.verb].noaction) {
speak(actions[command.verb].message);
return GO_CLEAROBJ;
}
* actions. If noaction is true, then we spit out the message and return */
if (actions[command.verb].noaction) {
speak(actions[command.verb].message);
return GO_CLEAROBJ;
}
if (command.part == unknown) {
/* Analyse an object word. See if the thing is here, whether
* we've got a verb yet, and so on. Object must be here
if (command.part == unknown) {
/* Analyse an object word. See if the thing is here, whether
* we've got a verb yet, and so on. Object must be here
- /* KEYS is not special, anything not NO_OBJECT or INTRANSITIVE
- * will do here. We're preventing interpretation as an intransitive
- * verb when the word is unknown. */
+ /* KEYS is not special, anything not NO_OBJECT or INTRANSITIVE
+ * will do here. We're preventing interpretation as an intransitive
+ * verb when the word is unknown. */
command.obj = command.word[1].raw[0] != '\0' ? KEYS : NO_OBJECT;
if (command.obj == NO_OBJECT ||
command.obj == INTRANSITIVE) {
command.obj = command.word[1].raw[0] != '\0' ? KEYS : NO_OBJECT;
if (command.obj == NO_OBJECT ||
command.obj == INTRANSITIVE) {