X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=actions.c;h=f2ec65adac01a042d5b8b7283d4e89f9bee2ca4f;hb=7eaefce61d74fbc73daabd3f42f048038366b5ad;hp=ae463219171b05ea1525c2ef2a55c4eb2b0baa91;hpb=73af0e3a55cb241a10c8abee9a1241e240cf650b;p=open-adventure.git diff --git a/actions.c b/actions.c index ae46321..f2ec65a 100644 --- a/actions.c +++ b/actions.c @@ -523,13 +523,14 @@ static int eat(token_t verb, token_t obj) static int extinguish(token_t verb, int obj) /* Extinguish. Lamp, urn, dragon/volcano (nice try). */ { - int spk = actions[verb].message; if (obj == INTRANSITIVE) { if (HERE(LAMP) && game.prop[LAMP] == LAMP_BRIGHT) obj = LAMP; if (HERE(URN) && game.prop[URN] == URN_LIT) - obj = obj * NOBJECTS + URN; - if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS) + obj = URN; + if (obj == INTRANSITIVE || + HERE(LAMP) && game.prop[LAMP] == LAMP_BRIGHT && + HERE(URN) && game.prop[URN] == URN_LIT) return GO_UNKNOWN; } @@ -539,13 +540,16 @@ static int extinguish(token_t verb, int obj) } else { pspeak(URN, change, URN_DARK); } - return GO_CLEAROBJ; + } else if (obj == LAMP) { state_change(LAMP, LAMP_DARK); - spk = DARK(game.loc) ? PITCH_DARK : NO_MESSAGE; - } else if (obj == DRAGON || obj == VOLCANO) - spk = BEYOND_POWER; - rspeak(spk); + rspeak(DARK(game.loc) ? PITCH_DARK : NO_MESSAGE); + } else if (obj == DRAGON || obj == VOLCANO) { + rspeak(BEYOND_POWER); + + } else { + rspeak(actions[verb].message); + } return GO_CLEAROBJ; } @@ -737,7 +741,9 @@ static int light(token_t verb, token_t obj) obj = LAMP; if (HERE(URN) && game.prop[URN] == URN_DARK) obj = URN; - if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS) + if (obj == INTRANSITIVE || + HERE(LAMP) && game.prop[LAMP] == LAMP_DARK && game.limit >= 0 && + HERE(URN) && game.prop[URN] == URN_DARK) return GO_UNKNOWN; }