diff xrogue/chase.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/chase.c	Fri Feb 19 21:02:28 2016 -0500
+++ b/xrogue/chase.c	Wed Mar 02 21:13:26 2016 -0500
@@ -19,16 +19,18 @@
 #include <ctype.h>
 #include <curses.h>
 #include <limits.h>
+#include <stdlib.h>
 #include "rogue.h"
 
+bool straight_shot(int ery, int erx, int eey, int eex, coord *shooting);
+
 /*
  * Canblink checks if the monster can teleport (blink).  If so, it will
  * try to blink the monster next to the player.
  */
 
 bool
-can_blink(tp)
-register struct thing *tp;
+can_blink(struct thing *tp)
 {
     register int y, x, index=9;
     coord tryp; /* To hold the coordinates for use in diag_ok */
@@ -123,8 +125,7 @@
  */
 
 int
-can_shoot(er, ee, shoot_dir)
-register coord *er, *ee, *shoot_dir;
+can_shoot(coord *er, coord *ee, coord *shoot_dir)
 {
     /* 
      * They must be in the same room or very close (at door)
@@ -150,15 +151,13 @@
  *      Find the spot for the chaser(er) to move closer to the
  *      chasee(ee).  Rer is the room of the chaser, and ree is the
  *      room of the creature being chased (chasee).
+ * 	flee: True if destination (ee) is player and monster is running away
+ *	or the player is in a wall and the monster can't get to it
  */
 
-chase(tp, ee, rer, ree, flee)
-register struct thing *tp;
-register coord *ee;
-register struct room *rer, *ree;
-bool flee; /* True if destination (ee) is player and monster is running away
-            * or the player is in a wall and the monster can't get to it
-            */
+void
+chase(struct thing *tp, coord *ee, struct room *rer, struct room *ree, 
+      bool flee)
 {
     int dist, thisdist, monst_dist = INT_MAX; 
     register coord *er = &tp->t_pos; 
@@ -495,8 +494,8 @@
  *      Make one thing chase another.
  */
 
-do_chase(th)
-register struct thing *th;
+void
+do_chase(struct thing *th)
 {
     register struct room *orig_rer,     /* Original room of chaser */
                          *new_room;     /* new room of monster */
@@ -812,8 +811,7 @@
  */
 
 struct linked_list *
-get_hurl(tp)
-register struct thing *tp;
+get_hurl(struct thing *tp)
 {
     struct linked_list *arrow=NULL, *bolt=NULL, *rock=NULL,
         *spear = NULL, *dagger=NULL, *dart=NULL, *aklad=NULL;
@@ -860,9 +858,8 @@
  *      Set a monster running after something
  */
 
-runto(runner, spot)
-register struct thing *runner;
-coord *spot;
+void
+runto(struct thing *runner, coord *spot)
 {
     if (on(*runner, ISSTONE))
         return;
@@ -888,9 +885,7 @@
  */
 
 bool
-straight_shot(ery, erx, eey, eex, shooting)
-register int ery, erx, eey, eex;
-register coord *shooting;
+straight_shot(int ery, int erx, int eey, int eex, coord *shooting)
 {
     register int dy, dx;        /* Deltas */
     unsigned char ch;