static int fill(token_t, token_t);
-static void state_change(long obj, long state)
-/* Object must have a change-message list for this to be useful; only some do */
-{
- game.prop[obj] = state;
- pspeak(obj, change, state, true);
-}
-
static int attack(struct command_t *command)
/* Attack. Assume target if unambiguous. "Throw" also links here.
* Attackable objects fall into two categories: enemies (snake,
extern int restore(FILE *);
extern long initialise(void);
extern int action(struct command_t *command);
+extern void state_change(long obj, long state);
+
void bug(enum bugtype, const char *) __attribute__((__noreturn__));
- TROLL_SATISFIED: 'The troll catches your treasure and scurries away out of sight.'
- TROLL_BLOCKS: 'The troll refuses to let you cross.'
- BRIDGE_GONE: 'There is no longer any way across the chasm.'
-- BRIDGE_COLLAPSE: |-
- Just as you reach the other side, the bridge buckles beneath the
- weight of the bear, which was still following you around. You
- scrabble desperately for support, but as the bridge collapses you
- stumble back and fall into the chasm.
- BEAR_HANDS: 'With what? Your bare hands? Against *HIS* bear hands??'
- BEAR_CONFUSED: 'The bear is confused; he only wants to be your friend.'
- ALREADY_DEAD: 'For crying out loud, the poor thing is already dead!'
descriptions:
- 'A rickety wooden bridge extends across the chasm, vanishing into the\nmist. A notice posted on the bridge reads, "Stop! Pay troll!"'
- 'The wreckage of a bridge (and a dead bear) can be seen at the bottom\nof the chasm.'
+ changes:
+ - ''
+ - |-
+ Just as you reach the other side, the bridge buckles beneath the
+ weight of the bear, which was still following you around. You
+ scrabble desperately for support, but as the bridge collapses you
+ stumble back and fall into the chasm.
- TROLL:
words: ['troll']
inventory: '*troll'
game.prop[TROLL] = TROLL_PAIDONCE;
if (!TOTING(BEAR))
return;
- rspeak(BRIDGE_COLLAPSE);
- game.prop[CHASM] = BRIDGE_WRECKED;
+ state_change(CHASM, BRIDGE_WRECKED);
game.prop[TROLL] = TROLL_GONE;
drop(BEAR, game.newloc);
game.fixed[BEAR] = IS_FIXED;
// LCOV_EXCL_STOP
/* end */
+
+void state_change(long obj, long state)
+/* Object must have a change-message list for this to be useful; only some do */
+{
+ game.prop[obj] = state;
+ pspeak(obj, change, state, true);
+}
\ No newline at end of file