Mercurial > hg > early-roguelike
changeset 220:f54901b9c39b
XRogue: convert to ANSI-style function declarations.
| author | John "Elwin" Edwards |
|---|---|
| date | Wed, 02 Mar 2016 21:13:26 -0500 |
| parents | f9ef86cf22b2 |
| children | 4f6e056438eb |
| files | xrogue/actions.c xrogue/bolt.c xrogue/chase.c xrogue/command.c xrogue/daemon.c xrogue/daemons.c xrogue/eat.c xrogue/effects.c xrogue/encumb.c xrogue/fight.c xrogue/help.c xrogue/init.c xrogue/io.c xrogue/list.c xrogue/main.c xrogue/maze.c xrogue/misc.c xrogue/monsters.c xrogue/move.c xrogue/n_level.c xrogue/network.h xrogue/options.c xrogue/outside.c xrogue/pack.c xrogue/passages.c xrogue/player.c xrogue/potions.c xrogue/rings.c xrogue/rip.c xrogue/rogue.h xrogue/rooms.c xrogue/save.c xrogue/scrolls.c xrogue/state.c xrogue/sticks.c xrogue/things.c xrogue/trader.c xrogue/util.c xrogue/weapons.c xrogue/wear.c xrogue/wizard.c |
| diffstat | 41 files changed, 1282 insertions(+), 909 deletions(-) [+] |
line wrap: on
line diff
--- a/xrogue/actions.c Fri Feb 19 21:02:28 2016 -0500 +++ b/xrogue/actions.c Wed Mar 02 21:13:26 2016 -0500 @@ -24,12 +24,20 @@ int mf_count = 0; /* move_free counter - see actions.c(m_act()) */ int mf_jmpcnt = 0; /* move_free counter for # of jumps */ +void m_breathe(struct thing *tp); +void m_select(struct thing *th, bool flee); +void m_sonic(struct thing *tp); +void m_spell(struct thing *tp); +void m_summon(struct thing *tp); +bool m_use_it(struct thing *tp, bool flee, struct room *rer, struct room *ree); +bool m_use_pack(struct thing *monster, coord *defend_pos, int dist, + coord *shoot_dir); + /* * Did we disrupt a spell? */ -dsrpt_monster(tp, always, see_him) -register struct thing *tp; -bool always, see_him; +void +dsrpt_monster(struct thing *tp, bool always, bool see_him) { switch (tp->t_action) { case A_SUMMON: @@ -58,7 +66,8 @@ } } -dsrpt_player() +void +dsrpt_player(void) { int which, action; struct linked_list *item; @@ -87,7 +96,7 @@ if (purse > 0) { msg("Your gold goes flying everywhere!"); do { - item = spec_item(GOLD, NULL, NULL, NULL); + item = spec_item(GOLD, 0, 0, 0); obj = OBJPTR(item); obj->o_count = min(purse, rnd(20)+1); purse -= obj->o_count; @@ -125,8 +134,8 @@ * Otherwise, let it perform its chosen action. */ -m_act(tp) -register struct thing *tp; +void +m_act(struct thing *tp) { struct object *obj; bool flee; /* Are we scared? */ @@ -290,8 +299,8 @@ * Breathe in the chosen direction. */ -m_breathe(tp) -register struct thing *tp; +void +m_breathe(struct thing *tp) { register int damage; register char *breath = NULL; @@ -399,11 +408,11 @@ /* * m_select: * Select an action for the monster. + * flee: True if running away or player is inaccessible in wall */ -m_select(th, flee) -register struct thing *th; -register bool flee; /* True if running away or player is inaccessible in wall */ +void +m_select(struct thing *th, bool flee) { register struct room *rer, *ree; /* room of chaser, room of chasee */ int dist = INT_MIN; @@ -541,8 +550,8 @@ * The monster is sounding a sonic blast. */ -m_sonic(tp) -register struct thing *tp; +void +m_sonic(struct thing *tp) { register int damage; struct object blast = @@ -571,8 +580,8 @@ * The monster casts a spell. Currently this is limited to * magic missile. */ -m_spell(tp) -register struct thing *tp; +void +m_spell(struct thing *tp) { struct object missile = { @@ -594,8 +603,8 @@ * Summon aid. */ -m_summon(tp) -register struct thing *tp; +void +m_summon(struct thing *tp) { register char *helpname, *mname; int fail, numsum; @@ -668,10 +677,7 @@ */ bool -m_use_it(tp, flee, rer, ree) -register struct thing *tp; -bool flee; -register struct room *rer, *ree; +m_use_it(struct thing *tp, bool flee, struct room *rer, struct room *ree) { int dist; register coord *ee = tp->t_dest, *er = &tp->t_pos; @@ -836,7 +842,8 @@ } -reap() +void +reap(void) { _t_free_list(&rlist); } @@ -844,10 +851,11 @@ /* * runners: * Make all the awake monsters try to do something. + * segments: Number of segments since last called */ -runners(segments) -int segments; /* Number of segments since last called */
