projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Second part of fix for "fee fie foe foo" and "fum", with test.
[open-adventure.git]
/
actions.c
diff --git
a/actions.c
b/actions.c
index 9917199bc5bcef7bed8a7ca38ba1174ba1e63df4..fe6daa10ea0004d9db5abd393659851021fc0196 100644
(file)
--- a/
actions.c
+++ b/
actions.c
@@
-187,9
+187,10
@@
static phase_codes_t attack(command_t command)
}
static phase_codes_t bigwords(vocab_t id)
}
static phase_codes_t bigwords(vocab_t id)
-/* FEE FIE FOE FOO (AND FUM). Advance to next state if given in proper order.
- * Look up foo in special section of vocab to determine which word we've got.
- * Last word zips the eggs back to the giant room (unless already there). */
+/* Only called on FEE FIE FOE FOO (AND FUM). Advance to next state if given
+ * in proper order. Look up foo in special section of vocab to determine which
+ * word we've got. Last word zips the eggs back to the giant room (unless
+ * already there). */
{
if ((game.foobar == WORD_EMPTY && id == FEE) ||
(game.foobar == FEE && id == FIE) ||
{
if ((game.foobar == WORD_EMPTY && id == FEE) ||
(game.foobar == FEE && id == FIE) ||
@@
-206,6
+207,8
@@
static phase_codes_t bigwords(vocab_t id)
(TOTING(EGGS) && game.loc == objects[EGGS].plac)) {
rspeak(NOTHING_HAPPENS);
return GO_CLEAROBJ;
(TOTING(EGGS) && game.loc == objects[EGGS].plac)) {
rspeak(NOTHING_HAPPENS);
return GO_CLEAROBJ;
+ } else if (id == FUM) {
+ goto fum;
} else {
/* Bring back troll if we steal the eggs back from him before
* crossing. */
} else {
/* Bring back troll if we steal the eggs back from him before
* crossing. */
@@
-222,12
+225,13
@@
static phase_codes_t bigwords(vocab_t id)
return GO_CLEAROBJ;
}
} else {
return GO_CLEAROBJ;
}
} else {
+ fum:
if (game.loc == LOC_GIANTROOM) {
rspeak(START_OVER);
} else {
if (game.loc == LOC_GIANTROOM) {
rspeak(START_OVER);
} else {
- /* This is new be
g
avior in Open Adventure - sounds better when
+ /* This is new be
h
avior in Open Adventure - sounds better when
* player isn't in the Giant Room. */
* player isn't in the Giant Room. */
- rspeak(
WELL_POINTLES
S);
+ rspeak(
NOTHING_HAPPEN
S);
}
game.foobar = WORD_EMPTY;
return GO_CLEAROBJ;
}
game.foobar = WORD_EMPTY;
return GO_CLEAROBJ;
@@
-845,15
+849,20
@@
static phase_codes_t fly(verb_t verb, obj_t obj)
rspeak(RUG_NOTHING1);
return GO_CLEAROBJ;
}
rspeak(RUG_NOTHING1);
return GO_CLEAROBJ;
}
- game.oldlc2 = game.oldloc;
- game.oldloc = game.loc;
- if (game.prop[SAPPH] == STATE_NOTFOUND) {
- game.newloc = game.place[SAPPH];
+ if (game.loc == LOC_CLIFF) {
+ game.oldlc2 = game.oldloc;
+ game.oldloc = game.loc;
+ game.newloc = LOC_LEDGE;
rspeak(RUG_GOES);
rspeak(RUG_GOES);
- } else {
+ } else if (game.loc == LOC_LEDGE) {
+ game.oldlc2 = game.oldloc;
+ game.oldloc = game.loc;
game.newloc = LOC_CLIFF;
rspeak(RUG_RETURNS);
game.newloc = LOC_CLIFF;
rspeak(RUG_RETURNS);
+ } else {
+ /* should never happen */
+ rspeak(NOTHING_HAPPENS);
}
return GO_TERMINATE;
}
}
return GO_TERMINATE;
}
@@
-920,12
+929,13
@@
static phase_codes_t light(verb_t verb, obj_t obj)
static phase_codes_t listen(void)
/* Listen. Intransitive only. Print stuff based on object sound proprties. */
{
static phase_codes_t listen(void)
/* Listen. Intransitive only. Print stuff based on object sound proprties. */
{
+ bool soundlatch = false;
vocab_t sound = locations[game.loc].sound;
if (sound != SILENT) {
rspeak(sound);
if (!locations[game.loc].loud)
rspeak(NO_MESSAGE);
vocab_t sound = locations[game.loc].sound;
if (sound != SILENT) {
rspeak(sound);
if (!locations[game.loc].loud)
rspeak(NO_MESSAGE);
-
return GO_CLEAROBJ
;
+
soundlatch = true
;
}
for (obj_t i = 1; i <= NOBJECTS; i++) {
if (!HERE(i) ||
}
for (obj_t i = 1; i <= NOBJECTS; i++) {
if (!HERE(i) ||
@@
-944,9
+954,10
@@
static phase_codes_t listen(void)
rspeak(NO_MESSAGE);
if (i == BIRD && mi == BIRD_ENDSTATE)
DESTROY(BIRD);
rspeak(NO_MESSAGE);
if (i == BIRD && mi == BIRD_ENDSTATE)
DESTROY(BIRD);
-
return GO_CLEAROBJ
;
+
soundlatch = true
;
}
}
- rspeak(ALL_SILENT);
+ if (!soundlatch)
+ rspeak(ALL_SILENT);
return GO_CLEAROBJ;
}
return GO_CLEAROBJ;
}
@@
-1354,8
+1365,8
@@
phase_codes_t action(command_t command)
/* FALL THROUGH */;
else if (command.obj == DWARF && atdwrf(game.loc) > 0)
/* FALL THROUGH */;
/* FALL THROUGH */;
else if (command.obj == DWARF && atdwrf(game.loc) > 0)
/* FALL THROUGH */;
- else if ((LIQUID() == command.obj && HERE(BOTTLE)) ||
-
command.obj == LIQLOC(game.loc
))
+ else if (
!game.closed && (
(LIQUID() == command.obj && HERE(BOTTLE)) ||
+
command.obj == LIQLOC(game.loc)
))
/* FALL THROUGH */;
else if (command.obj == OIL && HERE(URN) && game.prop[URN] != URN_EMPTY) {
command.obj = URN;
/* FALL THROUGH */;
else if (command.obj == OIL && HERE(URN) && game.prop[URN] != URN_EMPTY) {
command.obj = URN;