Mercurial > hg > early-roguelike
comparison arogue7/wizard.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 | 1cd604c827a3 |
children | e52a8a7ad4c5 |
comparison
equal
deleted
inserted
replaced
218:56e748983fa8 | 219:f9ef86cf22b2 |
---|---|
17 * under strange circumstances) | 17 * under strange circumstances) |
18 */ | 18 */ |
19 | 19 |
20 #include "curses.h" | 20 #include "curses.h" |
21 #include <stdlib.h> | 21 #include <stdlib.h> |
22 #include <string.h> | |
22 #include <ctype.h> | 23 #include <ctype.h> |
23 #include "rogue.h" | 24 #include "rogue.h" |
24 #ifdef PC7300 | 25 #ifdef PC7300 |
25 #include "menu.h" | 26 #include "menu.h" |
26 #endif | 27 #endif |
27 | 28 |
29 int getbless(void); | |
28 | 30 |
29 /* | 31 /* |
30 * create_obj: | 32 * create_obj: |
31 * Create any object for wizard, scroll, magician, or cleric | 33 * Create any object for wizard, scroll, magician, or cleric |
32 */ | 34 */ |
33 create_obj(prompt, which_item, which_type) | 35 void |
34 bool prompt; | 36 create_obj(bool prompt, int which_item, int which_type) |
35 int which_item, which_type; | |
36 { | 37 { |
37 reg struct linked_list *item; | 38 reg struct linked_list *item; |
38 reg struct object *obj; | 39 reg struct object *obj; |
39 reg int wh; | 40 reg int wh; |
40 reg char ch, newitem, newtype, whc, msz, *pt; | 41 reg char ch, newitem, newtype, whc, msz, *pt; |
327 | 328 |
328 /* | 329 /* |
329 * getbless: | 330 * getbless: |
330 * Get a blessing for a wizards object | 331 * Get a blessing for a wizards object |
331 */ | 332 */ |
332 getbless() | 333 int |
334 getbless(void) | |
333 { | 335 { |
334 reg char bless; | 336 reg char bless; |
335 | 337 |
336 msg("Blessing? (+,-,n)"); | 338 msg("Blessing? (+,-,n)"); |
337 bless = wgetch(msgw); | 339 bless = wgetch(msgw); |
344 } | 346 } |
345 | 347 |
346 /* | 348 /* |
347 * get a non-monster death type | 349 * get a non-monster death type |
348 */ | 350 */ |
349 getdeath() | 351 int |
352 getdeath(void) | |
350 { | 353 { |
351 register int i; | 354 register int i; |
352 int which_death; | 355 int which_death; |
353 char label[80]; | 356 char label[80]; |
354 | 357 |
379 static char Displines[NUMMONST+1][LINELEN+1]; /* The lines themselves */ | 382 static char Displines[NUMMONST+1][LINELEN+1]; /* The lines themselves */ |
380 #endif | 383 #endif |
381 | 384 |
382 /* | 385 /* |
383 * make a monster for the wizard | 386 * make a monster for the wizard |
384 */ | 387 * showall -> show uniques and genocided creatures |
385 makemonster(showall, label, action) | 388 */ |
386 bool showall; /* showall -> show uniques and genocided creatures */ | 389 short |
387 char *label, *action; | 390 makemonster(bool showall, char *label, char *action) |
388 { | 391 { |
389 #ifdef PC7300 | 392 #ifdef PC7300 |
390 register int nextmonst; | 393 register int nextmonst; |
391 #endif | 394 #endif |
392 register int i; | 395 register int i; |
437 } | 440 } |
438 #endif | 441 #endif |
439 | 442 |
440 /* Print out the monsters */ | 443 /* Print out the monsters */ |
441 while (num_monst > 0) { | 444 while (num_monst > 0) { |
442 register left_limit; | 445 int left_limit; |
443 | 446 |
444 if (num_monst < num_lines) left_limit = (num_monst+1)/2; | 447 if (num_monst < num_lines) left_limit = (num_monst+1)/2; |
445 else left_limit = num_lines/2; | 448 else left_limit = num_lines/2; |
446 | 449 |
447 wclear(hw); | 450 wclear(hw); |
506 /* | 509 /* |
507 * passwd: | 510 * passwd: |
508 * see if user knows password | 511 * see if user knows password |
509 */ | 512 */ |
510 | 513 |
511 passwd() | 514 bool |
515 passwd(void) | |
512 { | 516 { |
513 register char *sp, c; | 517 register char *sp, c; |
514 char buf[LINELEN], *crypt(); | 518 char buf[LINELEN], *crypt(); |
515 | 519 |
516 msg("Wizard's Password:"); | 520 msg("Wizard's Password:"); |
533 /* | 537 /* |
534 * teleport: | 538 * teleport: |
535 * Bamf the hero someplace else | 539 * Bamf the hero someplace else |
536 */ | 540 */ |
537 | 541 |
538 teleport() | 542 int |
543 teleport(void) | |
539 { | 544 { |
540 register struct room *new_rp = NULL, *old_rp = roomin(&hero); | 545 register struct room *new_rp = NULL, *old_rp = roomin(&hero); |
541 register int rm, which; | 546 register int rm, which; |
542 coord old; | 547 coord old; |
543 bool got_position = FALSE; | 548 bool got_position = FALSE; |
634 /* | 639 /* |
635 * whatis: | 640 * whatis: |
636 * What a certin object is | 641 * What a certin object is |
637 */ | 642 */ |
638 | 643 |
639 whatis(what) | 644 void |
640 struct linked_list *what; | 645 whatis(struct linked_list *what) |
641 { | 646 { |
642 register struct object *obj; | 647 register struct object *obj; |
643 register struct linked_list *item; | 648 register struct linked_list *item; |
644 | 649 |
645 if (what == NULL) { /* do we need to ask which one? */ | 650 if (what == NULL) { /* do we need to ask which one? */ |