diff xrogue/actions.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 e52a8a7ad4c5
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 */
+int
+runners(int segments)
 {
     register struct linked_list *item;
     register struct thing *tp = NULL;
@@ -961,11 +969,7 @@
  * Only care about relics and wands for now.
  */
 bool
-m_use_pack(monster, defend_pos, dist, shoot_dir)
-register struct thing *monster;
-coord *defend_pos;
-register int dist;
-register coord *shoot_dir;
+m_use_pack(struct thing *monster, coord *defend_pos, int dist, coord *shoot_dir)
 {
     register struct object *obj;
     register struct linked_list *pitem, *relic, *stick;