Moved state_change to misc.c to start using it in main.c, too
This commit is contained in:
parent
df422fe2ed
commit
40ff648431
5 changed files with 17 additions and 14 deletions
|
@ -6,13 +6,6 @@
|
||||||
|
|
||||||
static int fill(token_t, token_t);
|
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)
|
static int attack(struct command_t *command)
|
||||||
/* Attack. Assume target if unambiguous. "Throw" also links here.
|
/* Attack. Assume target if unambiguous. "Throw" also links here.
|
||||||
* Attackable objects fall into two categories: enemies (snake,
|
* Attackable objects fall into two categories: enemies (snake,
|
||||||
|
|
2
advent.h
2
advent.h
|
@ -242,6 +242,8 @@ extern int resume(void);
|
||||||
extern int restore(FILE *);
|
extern int restore(FILE *);
|
||||||
extern long initialise(void);
|
extern long initialise(void);
|
||||||
extern int action(struct command_t *command);
|
extern int action(struct command_t *command);
|
||||||
|
extern void state_change(long obj, long state);
|
||||||
|
|
||||||
|
|
||||||
void bug(enum bugtype, const char *) __attribute__((__noreturn__));
|
void bug(enum bugtype, const char *) __attribute__((__noreturn__));
|
||||||
|
|
||||||
|
|
|
@ -2963,11 +2963,6 @@ arbitrary_messages: !!omap
|
||||||
- TROLL_SATISFIED: 'The troll catches your treasure and scurries away out of sight.'
|
- TROLL_SATISFIED: 'The troll catches your treasure and scurries away out of sight.'
|
||||||
- TROLL_BLOCKS: 'The troll refuses to let you cross.'
|
- TROLL_BLOCKS: 'The troll refuses to let you cross.'
|
||||||
- BRIDGE_GONE: 'There is no longer any way across the chasm.'
|
- 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_HANDS: 'With what? Your bare hands? Against *HIS* bear hands??'
|
||||||
- BEAR_CONFUSED: 'The bear is confused; he only wants to be your friend.'
|
- 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!'
|
- ALREADY_DEAD: 'For crying out loud, the poor thing is already dead!'
|
||||||
|
@ -3497,6 +3492,13 @@ objects: !!omap
|
||||||
descriptions:
|
descriptions:
|
||||||
- 'A rickety wooden bridge extends across the chasm, vanishing into the\nmist. A notice posted on the bridge reads, "Stop! Pay troll!"'
|
- '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.'
|
- '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:
|
- TROLL:
|
||||||
words: ['troll']
|
words: ['troll']
|
||||||
inventory: '*troll'
|
inventory: '*troll'
|
||||||
|
|
3
main.c
3
main.c
|
@ -726,8 +726,7 @@ static void playermove( int motion)
|
||||||
game.prop[TROLL] = TROLL_PAIDONCE;
|
game.prop[TROLL] = TROLL_PAIDONCE;
|
||||||
if (!TOTING(BEAR))
|
if (!TOTING(BEAR))
|
||||||
return;
|
return;
|
||||||
rspeak(BRIDGE_COLLAPSE);
|
state_change(CHASM, BRIDGE_WRECKED);
|
||||||
game.prop[CHASM] = BRIDGE_WRECKED;
|
|
||||||
game.prop[TROLL] = TROLL_GONE;
|
game.prop[TROLL] = TROLL_GONE;
|
||||||
drop(BEAR, game.newloc);
|
drop(BEAR, game.newloc);
|
||||||
game.fixed[BEAR] = IS_FIXED;
|
game.fixed[BEAR] = IS_FIXED;
|
||||||
|
|
7
misc.c
7
misc.c
|
@ -689,3 +689,10 @@ void bug(enum bugtype num, const char *error_string)
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
/* end */
|
/* 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);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue