X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=actions.c;h=6bee7760a9e2200574803cbb43339bda470334fd;hp=b079bd352f863da9e3dab42a30da543b34efa5a9;hb=df2830598c85240daa3b2020ca52644803952a0b;hpb=393010ec41c3c6c25fab05284a76c51ac3135a7b diff --git a/actions.c b/actions.c index b079bd3..6bee776 100644 --- a/actions.c +++ b/actions.c @@ -172,14 +172,15 @@ static int bigwords(token_t foo) * 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). */ { - char word[TOKLEN+1]; + char word[TOKLEN + 1]; packed_to_token(foo, word); int k = (int) get_special_vocab_id(word); - int spk = NOTHING_HAPPENS; if (game.foobar != 1 - k) { - if (game.foobar != 0 && game.loc == LOC_GIANTROOM) - spk = START_OVER; - rspeak(spk); + if (game.foobar != 0 && game.loc == LOC_GIANTROOM) { + rspeak( START_OVER); + } else { + rspeak(NOTHING_HAPPENS); + } return GO_CLEAROBJ; } else { game.foobar = k; @@ -190,7 +191,7 @@ static int bigwords(token_t foo) game.foobar = 0; if (game.place[EGGS] == objects[EGGS].plac || (TOTING(EGGS) && game.loc == objects[EGGS].plac)) { - rspeak(spk); + rspeak(NOTHING_HAPPENS); return GO_CLEAROBJ; } else { /* Bring back troll if we steal the eggs back from him before @@ -482,13 +483,12 @@ static int discard(token_t verb, token_t obj, bool just_do_it) DESTROY(BIRD); return GO_CLEAROBJ; } else if (obj == BEAR && AT(TROLL)) { - rspeak(TROLL_SCAMPERS); + state_change(TROLL, TROLL_GONE); move(TROLL, LOC_NOWHERE); move(TROLL + NOBJECTS, LOC_NOWHERE); move(TROLL2, objects[TROLL].plac); move(TROLL2 + NOBJECTS, objects[TROLL].fixd); juggle(CHASM); - game.prop[TROLL] = TROLL_GONE; } else if (obj != VASE || game.loc == objects[PILLOW].plac) { rspeak(OK_MAN); @@ -943,15 +943,15 @@ static int pour(token_t verb, token_t obj) return GO_CLEAROBJ; } if (!AT(DOOR)) { - if (obj != WATER) { + if (obj == WATER) { + /* cycle through the three plant states */ + state_change(PLANT, MOD(game.prop[PLANT] + 1, 3)); + game.prop[PLANT2] = game.prop[PLANT]; + return GO_MOVE; + } else { rspeak(SHAKING_LEAVES); return GO_CLEAROBJ; - } - /* FIXME: Arithmetic on state numbers */ - pspeak(PLANT, look, game.prop[PLANT] + 3, true); - game.prop[PLANT] = MOD(game.prop[PLANT] + 1, 3); - game.prop[PLANT2] = game.prop[PLANT]; - return GO_MOVE; + } } else { state_change(DOOR, (obj == OIL) ? DOOR_UNRUSTED : @@ -1042,9 +1042,9 @@ static int say(struct command_t *command) if (command->wd2 > 0) { a = command->wd2; command->wd1 = command->wd2; - strcpy(command->raw1, command->raw2); + strcpy(command->raw1, command->raw2); } - char word1[TOKLEN+1]; + char word1[TOKLEN + 1]; packed_to_token(command->wd1, word1); int wd = (int) get_vocab_id(word1); /* FIXME: magic numbers */