Mercurial > hg > early-roguelike
comparison arogue7/weapons.c @ 219:f9ef86cf22b2
Advanced Rogue 7: convert to ANSI-style function declarations.
Almost 1500 lines of compiler warnings remain, and the GCC developers
are already working on a new version with even more warnings turned on
by default.
| author | John "Elwin" Edwards |
|---|---|
| date | Fri, 19 Feb 2016 21:02:28 -0500 |
| parents | b786053d2f37 |
| children | 28e22fb35989 |
comparison
equal
deleted
inserted
replaced
| 218:56e748983fa8 | 219:f9ef86cf22b2 |
|---|---|
| 20 #include "curses.h" | 20 #include "curses.h" |
| 21 #include <ctype.h> | 21 #include <ctype.h> |
| 22 #include <string.h> | 22 #include <string.h> |
| 23 #include "rogue.h" | 23 #include "rogue.h" |
| 24 | 24 |
| 25 boomerang(ydelta, xdelta, item, tp) | 25 void |
| 26 int ydelta, xdelta; | 26 boomerang(int ydelta, int xdelta, struct linked_list *item, struct thing *tp) |
| 27 register struct linked_list *item; | |
| 28 register struct thing *tp; | |
| 29 { | 27 { |
| 30 register struct object *obj; | 28 register struct object *obj; |
| 31 struct thing midpoint; | 29 struct thing midpoint; |
| 32 coord oldpos; | 30 coord oldpos; |
| 33 | 31 |
| 54 /* | 52 /* |
| 55 * do the actual motion on the screen done by an object traveling | 53 * do the actual motion on the screen done by an object traveling |
| 56 * across the room. Note that we should not look at any field in | 54 * across the room. Note that we should not look at any field in |
| 57 * tp other than t_pos unless we change boomerang(). | 55 * tp other than t_pos unless we change boomerang(). |
| 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 */ |
| 113 /* | 109 /* |
| 114 * fall: | 110 * fall: |
| 115 * Drop an item someplace around here. | 111 * Drop an item someplace around here. |
| 116 */ | 112 */ |
| 117 | 113 |
| 118 fall(item, pr) | 114 void |
| 119 register struct linked_list *item; | 115 fall(struct linked_list *item, bool pr) |
| 120 bool pr; | |
| 121 { | 116 { |
| 122 register struct object *obj; | 117 register struct object *obj; |
| 123 register struct room *rp; | 118 register struct room *rp; |
| 124 register int i; | 119 register int i; |
| 125 struct object *tobj; | 120 struct object *tobj; |
| 168 | 163 |
| 169 /* | 164 /* |
| 170 * Does the missile hit the monster | 165 * Does the missile hit the monster |
| 171 */ | 166 */ |
| 172 | 167 |
| 173 hit_monster(y, x, obj, tp) | 168 bool |
| 174 register int y, x; | 169 hit_monster(int y, int x, struct object *obj, struct thing *tp) |
| 175 struct object *obj; | |
| 176 register struct thing *tp; | |
| 177 { | 170 { |
| 178 static coord mp; | 171 static coord mp; |
| 179 | 172 |
| 180 mp.y = y; | 173 mp.y = y; |
| 181 mp.x = x; | 174 mp.x = x; |
| 201 /* | 194 /* |
| 202 * init_weapon: | 195 * init_weapon: |
| 203 * Set up the initial goodies for a weapon | 196 * Set up the initial goodies for a weapon |
| 204 */ | 197 */ |
| 205 | 198 |
| 206 init_weapon(weap, type) | 199 void |
| 207 register struct object *weap; | 200 init_weapon(struct object *weap, char type) |
| 208 char type; | |
| 209 { | 201 { |
| 210 register struct init_weps *iwp; | 202 register struct init_weps *iwp; |
| 211 | 203 |
| 212 iwp = &weaps[type]; | 204 iwp = &weaps[type]; |
| 213 strncpy(weap->o_damage, iwp->w_dam, sizeof(weap->o_damage)); | 205 strncpy(weap->o_damage, iwp->w_dam, sizeof(weap->o_damage)); |
| 226 /* | 218 /* |
| 227 * missile: | 219 * missile: |
| 228 * Fire a missile in a given direction | 220 * Fire a missile in a given direction |
| 229 */ | 221 */ |
| 230 | 222 |
| 231 missile(ydelta, xdelta, item, tp) | 223 void |
| 232 int ydelta, xdelta; | 224 missile(int ydelta, int xdelta, struct linked_list *item, struct thing *tp) |
| 233 register struct linked_list *item; | |
| 234 register struct thing *tp; | |
| 235 { | 225 { |
| 236 register struct object *obj; | 226 register struct object *obj; |
| 237 register struct linked_list *nitem; | 227 register struct linked_list *nitem; |
| 238 char ch; | 228 char ch; |
| 239 | 229 |
| 301 * num: | 291 * num: |
| 302 * Figure out the plus number for armor/weapons | 292 * Figure out the plus number for armor/weapons |
| 303 */ | 293 */ |
| 304 | 294 |
| 305 char * | 295 char * |
| 306 num(n1, n2) | 296 num(int n1, int n2) |
| 307 register int n1, n2; | |
| 308 { | 297 { |
| 309 static char numbuf[LINELEN]; | 298 static char numbuf[LINELEN]; |
| 310 | 299 |
| 311 if (n1 == 0 && n2 == 0) { | 300 if (n1 == 0 && n2 == 0) { |
| 312 return "+0"; | 301 return "+0"; |
| 322 /* | 311 /* |
| 323 * wield: | 312 * wield: |
| 324 * Pull out a certain weapon | 313 * Pull out a certain weapon |
| 325 */ | 314 */ |
| 326 | 315 |
| 327 wield() | 316 void |
| 317 wield(void) | |
| 328 { | 318 { |
| 329 register struct linked_list *item; | 319 register struct linked_list *item; |
| 330 register struct object *obj, *oweapon; | 320 register struct object *obj, *oweapon; |
| 331 | 321 |
| 332 /* | 322 /* |
