diff rogue4/monsters.c @ 225:4f6e056438eb

Merge the GCC5 and build fix branches.
author John "Elwin" Edwards
date Wed, 02 Mar 2016 21:28:34 -0500
parents 1b73a8641b37
children e52a8a7ad4c5
line wrap: on
line diff
--- a/rogue4/monsters.c	Fri Feb 26 17:30:30 2016 -0500
+++ b/rogue4/monsters.c	Wed Mar 02 21:28:34 2016 -0500
@@ -15,6 +15,8 @@
 #include <ctype.h>
 #include "rogue.h"
 
+int exp_add(THING *tp);
+
 /*
  * List of monsters in rough order of vorpalness
  *
@@ -39,8 +41,8 @@
  *	Pick a monster to show up.  The lower the level,
  *	the meaner the monster.
  */
-randmonster(wander)
-bool wander;
+char
+randmonster(bool wander)
 {
     register int d;
     register char *mons;
@@ -61,10 +63,8 @@
  * new_monster:
  *	Pick a new monster and add it to the list
  */
-new_monster(tp, type, cp)
-register THING *tp;
-char type;
-register coord *cp;
+void
+new_monster(THING *tp, char type, coord *cp)
 {
     register struct monster *mp;
     register int lev_add;
@@ -109,8 +109,8 @@
  * expadd:
  *	Experience to add for this monster's level/hit points
  */
-exp_add(tp)
-register THING *tp;
+int
+exp_add(THING *tp)
 {
     register int mod;
 
@@ -129,7 +129,8 @@
  * wanderer:
  *	Create a new wandering monster and aim it at the player
  */
-wanderer()
+void
+wanderer(void)
 {
     register int i;
     register struct room *rp;
@@ -166,8 +167,7 @@
  *	What to do when the hero steps next to a monster
  */
 THING *
-wake_monster(y, x)
-int y, x;
+wake_monster(int y, int x)
 {
     register THING *tp;
     register struct room *rp;
@@ -226,7 +226,8 @@
  * genocide:
  *	Wipe one monster out of existence (for now...)
  */
-genocide()
+void
+genocide(void)
 {
     register THING *mp;
     register char c;
@@ -270,8 +271,8 @@
  * give_pack:
  *	Give a pack to a monster if it deserves one
  */
-give_pack(tp)
-register THING *tp;
+void
+give_pack(THING *tp)
 {
     if (rnd(100) < monsters[tp->t_type-'A'].m_carry)
 	attach(tp->t_pack, new_thing());