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)
return GO_UNKNOWN;
}
} 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;
}
> extinguish
-I'm afraid I don't understand.
+The urn is now dark.
> look
The forest thins out here to reveal a steep cliff. There is no way
down, but a small ledge can be seen to the west across the chasm.
-A small oil flame extrudes from an urn embedded in the rock.
+A small urn full of oil is embedded in the rock.
-> extinguish urn
+> light
-The urn is now dark.
+The urn is now lit.
> look
The forest thins out here to reveal a steep cliff. There is no way
down, but a small ledge can be seen to the west across the chasm.
-A small urn full of oil is embedded in the rock.
+A small oil flame extrudes from an urn embedded in the rock.
> extinguish urn