Mercurial > hg > early-roguelike
comparison srogue/things.c @ 217:94a0d9dd5ce1
Super-Rogue: convert to ANSI-style function declarations.
This fixes most of the build warnings.
author | John "Elwin" Edwards |
---|---|
date | Sun, 31 Jan 2016 13:45:07 -0500 |
parents | 3aa87373c908 |
children | 0250220d8cdd |
comparison
equal
deleted
inserted
replaced
216:b24545357d2e | 217:94a0d9dd5ce1 |
---|---|
18 #include <ctype.h> | 18 #include <ctype.h> |
19 #include <string.h> | 19 #include <string.h> |
20 #include "rogue.h" | 20 #include "rogue.h" |
21 #include "rogue.ext" | 21 #include "rogue.ext" |
22 | 22 |
23 void basic_init(struct object *cur); | |
23 | 24 |
24 /* | 25 /* |
25 * inv_name: | 26 * inv_name: |
26 * Return the name of something as it would appear in an inventory. | 27 * Return the name of something as it would appear in an inventory. |
27 */ | 28 */ |
28 char * | 29 char * |
29 inv_name(obj, drop) | 30 inv_name(struct object *obj, bool drop) |
30 struct object *obj; | |
31 bool drop; | |
32 { | 31 { |
33 reg char *pb, *tn, *pl; | 32 reg char *pb, *tn, *pl; |
34 reg int wh, knowit; | 33 reg int wh, knowit; |
35 char nm[3], *inm, *q; | 34 char nm[3], *inm, *q; |
36 | 35 |
181 | 180 |
182 /* | 181 /* |
183 * money: | 182 * money: |
184 * Add to characters purse | 183 * Add to characters purse |
185 */ | 184 */ |
186 money() | 185 void |
186 money(void) | |
187 { | 187 { |
188 reg struct room *rp; | 188 reg struct room *rp; |
189 reg struct linked_list *item; | 189 reg struct linked_list *item; |
190 reg struct thing *tp; | 190 reg struct thing *tp; |
191 | 191 |
213 | 213 |
214 /* | 214 /* |
215 * drop: | 215 * drop: |
216 * put something down | 216 * put something down |
217 */ | 217 */ |
218 drop(item) | 218 int |
219 struct linked_list *item; | 219 drop(struct linked_list *item) |
220 { | 220 { |
221 reg char ch; | 221 reg char ch; |
222 reg struct linked_list *ll, *nll; | 222 reg struct linked_list *ll, *nll; |
223 reg struct object *op; | 223 reg struct object *op; |
224 | 224 |
279 | 279 |
280 /* | 280 /* |
281 * dropcheck: | 281 * dropcheck: |
282 * Do special checks for dropping or unweilding|unwearing|unringing | 282 * Do special checks for dropping or unweilding|unwearing|unringing |
283 */ | 283 */ |
284 dropcheck(op) | 284 bool |
285 struct object *op; | 285 dropcheck(struct object *op) |
286 { | 286 { |
287 if (op == NULL) | 287 if (op == NULL) |
288 return TRUE; | 288 return TRUE; |
289 if (levtype == POSTLEV) { | 289 if (levtype == POSTLEV) { |
290 if (o_on(op,ISCURSED) && o_on(op,ISKNOW)) { | 290 if (o_on(op,ISCURSED) && o_on(op,ISKNOW)) { |
318 /* | 318 /* |
319 * new_thing: | 319 * new_thing: |
320 * Return a new thing | 320 * Return a new thing |
321 */ | 321 */ |
322 struct linked_list * | 322 struct linked_list * |
323 new_thing(treas, type, which) | 323 new_thing(bool treas, int type, int which) |
324 int type, which; | |
325 bool treas; | |
326 { | 324 { |
327 struct linked_list *item; | 325 struct linked_list *item; |
328 struct magic_item *mi; | 326 struct magic_item *mi; |
329 struct object *cur; | 327 struct object *cur; |
330 int chance, whi; | 328 int chance, whi; |
402 | 400 |
403 /* | 401 /* |
404 * basic_init: | 402 * basic_init: |
405 * Set all params of an object to the basic values. | 403 * Set all params of an object to the basic values. |
406 */ | 404 */ |
407 basic_init(cur) | 405 void |
408 struct object *cur; | 406 basic_init(struct object *cur) |
409 { | 407 { |
410 cur->o_ac = 11; | 408 cur->o_ac = 11; |
411 cur->o_count = 1; | 409 cur->o_count = 1; |
412 cur->o_launch = 0; | 410 cur->o_launch = 0; |
413 cur->o_typname = NULL; | 411 cur->o_typname = NULL; |
421 | 419 |
422 /* | 420 /* |
423 * extras: | 421 * extras: |
424 * Return the number of extra items to be created | 422 * Return the number of extra items to be created |
425 */ | 423 */ |
426 extras() | 424 int |
425 extras(void) | |
427 { | 426 { |
428 reg int i; | 427 reg int i; |
429 | 428 |
430 i = rnd(100); | 429 i = rnd(100); |
431 if (i < 4) /* 4% for 2 more */ | 430 if (i < 4) /* 4% for 2 more */ |
439 | 438 |
440 /* | 439 /* |
441 * pick_one: | 440 * pick_one: |
442 * Pick an item out of a list of nitems possible magic items | 441 * Pick an item out of a list of nitems possible magic items |
443 */ | 442 */ |
444 pick_one(mag) | 443 int |
445 struct magic_item *mag; | 444 pick_one(struct magic_item *mag) |
446 { | 445 { |
447 reg struct magic_item *start; | 446 reg struct magic_item *start; |
448 reg int i; | 447 reg int i; |
449 | 448 |
450 start = mag; | 449 start = mag; |