Mercurial > hg > early-roguelike
diff xrogue/monsters.c @ 220:f54901b9c39b
XRogue: convert to ANSI-style function declarations.
author | John "Elwin" Edwards |
---|---|
date | Wed, 02 Mar 2016 21:13:26 -0500 |
parents | e6179860cb76 |
children | 7c1cb43f346e |
line wrap: on
line diff
--- a/xrogue/monsters.c Fri Feb 19 21:02:28 2016 -0500 +++ b/xrogue/monsters.c Wed Mar 02 21:13:26 2016 -0500 @@ -19,14 +19,15 @@ #include <curses.h> #include <ctype.h> #include <string.h> +#include <stdlib.h> #include "rogue.h" /* * Check_residue takes care of any effect of the monster */ -check_residue(tp) -register struct thing *tp; +void +check_residue(struct thing *tp) { /* * Take care of special abilities @@ -70,13 +71,11 @@ /* * Creat_mons creates the specified monster -- any if 0 + * person: where to create next to */ bool -creat_mons(person, monster, report) -struct thing *person; /* Where to create next to */ -short monster; -bool report; +creat_mons(struct thing *person, short monster, bool report) { struct linked_list *nitem; register struct thing *tp; @@ -131,9 +130,7 @@ */ void -genmonsters(least, treas) -register int least; -bool treas; +genmonsters(int least, bool treas) { reg int i; reg struct room *rp = &rooms[0]; @@ -180,8 +177,7 @@ */ short -id_monst(monster) -register char monster; +id_monst(char monster) { register short result; @@ -215,11 +211,8 @@ * Pick a new monster and add it to the list */ -new_monster(item, type, cp, max_monster) -struct linked_list *item; -short type; -coord *cp; -bool max_monster; +void +new_monster(struct linked_list *item, short type, coord *cp, bool max_monster) { register struct thing *tp; register struct monster *mp; @@ -428,8 +421,7 @@ */ short -randmonster(wander, no_unique) -register bool wander, no_unique; +randmonster(bool wander, bool no_unique) { register int d, cur_level, range, i; @@ -491,8 +483,8 @@ * to purchase something. */ -sell(tp) -register struct thing *tp; +void +sell(struct thing *tp) { register struct linked_list *item, *seller; register struct linked_list *sellpack; @@ -588,8 +580,7 @@ */ struct linked_list * -wake_monster(y, x) -int y, x; +wake_monster(int y, int x) { register struct thing *tp; register struct linked_list *it; @@ -786,7 +777,8 @@ * A wandering monster has awakened and is headed for the player */ -wanderer() +void +wanderer(void) { register int i; register struct room *hr = roomin(&hero);