comparison xrogue/weapons.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 28e22fb35989
comparison
equal deleted inserted replaced
219:f9ef86cf22b2 220:f54901b9c39b
19 #include <curses.h> 19 #include <curses.h>
20 #include <ctype.h> 20 #include <ctype.h>
21 #include <string.h> 21 #include <string.h>
22 #include "rogue.h" 22 #include "rogue.h"
23 23
24 boomerang(ydelta, xdelta, item, tp) 24 void
25 int ydelta, xdelta; 25 boomerang(int ydelta, int xdelta, struct linked_list *item, struct thing *tp)
26 register struct linked_list *item;
27 register struct thing *tp;
28 { 26 {
29 register struct object *obj; 27 register struct object *obj;
30 struct thing midpoint; 28 struct thing midpoint;
31 coord oldpos; 29 coord oldpos;
32 30
54 * do the actual motion on the screen done by an object traveling 52 * do the actual motion on the screen done by an object traveling
55 * across the room. Note that we should not look at any field in 53 * across the room. Note that we should not look at any field in
56 * tp other than t_pos unless we change boomerang(). 54 * tp other than t_pos unless we change boomerang().
57 */ 55 */
58 56
59 do_motion(obj, ydelta, xdelta, tp) 57 void
60 register struct object *obj; 58 do_motion(struct object *obj, int ydelta, int xdelta, struct thing *tp)
61 register int ydelta, xdelta;
62 register struct thing *tp;
63 { 59 {
64 60
65 /* 61 /*
66 * Come fly with us ... 62 * Come fly with us ...
67 */ 63 */
115 /* 111 /*
116 * fall: 112 * fall:
117 * Drop an item someplace around here. 113 * Drop an item someplace around here.
118 */ 114 */
119 115
120 fall(item, pr) 116 void
121 register struct linked_list *item; 117 fall(struct linked_list *item, bool pr)
122 bool pr;
123 { 118 {
124 register struct object *obj; 119 register struct object *obj;
125 register struct room *rp; 120 register struct room *rp;
126 register int i; 121 register int i;
127 struct object *tobj; 122 struct object *tobj;
169 164
170 /* 165 /*
171 * Does the missile hit the monster 166 * Does the missile hit the monster
172 */ 167 */
173 168
174 hit_monster(y, x, obj, tp) 169 bool
175 register int y, x; 170 hit_monster(int y, int x, struct object *obj, struct thing *tp)
176 struct object *obj;
177 register struct thing *tp;
178 { 171 {
179 static coord mp; 172 static coord mp;
180 173
181 mp.y = y; 174 mp.y = y;
182 mp.x = x; 175 mp.x = x;
202 /* 195 /*
203 * init_weapon: 196 * init_weapon:
204 * Set up the initial goodies for a weapon 197 * Set up the initial goodies for a weapon
205 */ 198 */
206 199
207 init_weapon(weap, type) 200 void
208 register struct object *weap; 201 init_weapon(struct object *weap, char type)
209 char type;
210 { 202 {
211 register struct init_weps *iwp; 203 register struct init_weps *iwp;
212 204
213 iwp = &weaps[type]; 205 iwp = &weaps[type];
214 strcpy(weap->o_damage,iwp->w_dam); 206 strcpy(weap->o_damage,iwp->w_dam);
227 /* 219 /*
228 * missile: 220 * missile:
229 * Fire a missile in a given direction 221 * Fire a missile in a given direction
230 */ 222 */
231 223
232 missile(ydelta, xdelta, item, tp) 224 void
233 int ydelta, xdelta; 225 missile(int ydelta, int xdelta, struct linked_list *item, struct thing *tp)
234 register struct linked_list *item;
235 register struct thing *tp;
236 { 226 {
237 register struct object *obj; 227 register struct object *obj;
238 register struct linked_list *nitem; 228 register struct linked_list *nitem;
239 char ch; 229 char ch;
240 230
306 * num: 296 * num:
307 * Figure out the plus number for armor/weapons 297 * Figure out the plus number for armor/weapons
308 */ 298 */
309 299
310 char * 300 char *
311 num(n1, n2) 301 num(int n1, int n2)
312 register int n1, n2;
313 { 302 {
314 static char numbuf[LINELEN/2]; 303 static char numbuf[LINELEN/2];
315 304
316 if (n1 == 0 && n2 == 0) { 305 if (n1 == 0 && n2 == 0) {
317 return "+0"; 306 return "+0";
327 /* 316 /*
328 * wield: 317 * wield:
329 * Pull out a certain weapon 318 * Pull out a certain weapon
330 */ 319 */
331 320
332 wield() 321 void
322 wield(void)
333 { 323 {
334 register struct linked_list *item; 324 register struct linked_list *item;
335 register struct object *obj, *oweapon; 325 register struct object *obj, *oweapon;
336 326
337 /* 327 /*