Mercurial > hg > early-roguelike
diff xrogue/sticks.c @ 220:f54901b9c39b
XRogue: convert to ANSI-style function declarations.
author | John "Elwin" Edwards |
---|---|
date | Wed, 02 Mar 2016 21:13:26 -0500 |
parents | ce0cf824c192 |
children | 7c1cb43f346e |
line wrap: on
line diff
--- a/xrogue/sticks.c Fri Feb 19 21:02:28 2016 -0500 +++ b/xrogue/sticks.c Wed Mar 02 21:13:26 2016 -0500 @@ -21,16 +21,15 @@ #include <string.h> #include "rogue.h" +void drain(int ymin, int ymax, int xmin, int xmax); + /* * zap a stick and see what happens */ -do_zap(zapper, obj, direction, which, flags) -struct thing *zapper; -struct object *obj; -coord *direction; -int which; -int flags; +void +do_zap(struct thing *zapper, struct object *obj, coord *direction, int which, + int flags) { register struct linked_list *item = NULL; register struct thing *tp; @@ -647,8 +646,8 @@ * Do drain hit points from player shtick */ -drain(ymin, ymax, xmin, xmax) -int ymin, ymax, xmin, xmax; +void +drain(int ymin, int ymax, int xmin, int xmax) { register int i, j, count; register struct thing *ick; @@ -727,8 +726,8 @@ * initialize a stick */ -fix_stick(cur) -register struct object *cur; +void +fix_stick(struct object *cur) { if (EQUAL(ws_type[cur->o_which], "staff")) { cur->o_weight = 100; @@ -768,8 +767,8 @@ * Use the wand that our monster is wielding. */ -m_use_wand(monster) -register struct thing *monster; +void +m_use_wand(struct thing *monster) { register struct object *obj; @@ -794,14 +793,16 @@ */ msg("%s points a %s at you!", prname(monster_name(monster), TRUE), ws_type[obj->o_which]); - do_zap(monster, obj, &monster->t_newpos, obj->o_which, NULL); + do_zap(monster, obj, &monster->t_newpos, obj->o_which, 0); monster->t_wand /= 2; /* chance lowers with each use */ } +/* + * type: type of item, NULL means stick + * which: which item + */ bool -need_dir(type, which) -int type, /* type of item, NULL means stick */ - which; /* which item */ +need_dir(int type, int which) { if (type == STICK || type == 0) { switch (which) { @@ -831,9 +832,8 @@ * let the player zap a stick and see what happens */ -player_zap(which, flag) -int which; -int flag; +bool +player_zap(int which, int flag) { register struct linked_list *item; register struct object *obj; @@ -869,7 +869,7 @@ switch (obj->o_which) { case ORCUS_WAND: /* msg(nothing); */ - read_scroll(S_PETRIFY, NULL, FALSE); + read_scroll(S_PETRIFY, 0, FALSE); return(TRUE); when MING_STAFF: which = WS_MISSILE;