comparison arogue7/new_level.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 adfa37e67084
children
comparison
equal deleted inserted replaced
218:56e748983fa8 219:f9ef86cf22b2
14 14
15 #include "curses.h" 15 #include "curses.h"
16 #include "rogue.h" 16 #include "rogue.h"
17 #define TERRASAVE 3 17 #define TERRASAVE 3
18 18
19 void put_things(LEVTYPE ltype);
20
19 /* 21 /*
20 * new_level: 22 * new_level:
21 * Dig and draw a new level 23 * Dig and draw a new level
22 * 24 * ltype: designates type of level to create
23 */ 25 */
24 26
25 new_level(ltype) 27 void
26 LEVTYPE ltype; /* designates type of level to create */ 28 new_level(LEVTYPE ltype)
27 { 29 {
28 register int rm, i, cnt; 30 register int rm, i, cnt;
29 register char ch; 31 register char ch;
30 register struct linked_list *item; 32 register struct linked_list *item;
31 register struct thing *tp; 33 register struct thing *tp;
432 cur_max = level; 434 cur_max = level;
433 435
434 status(TRUE); 436 status(TRUE);
435 437
436 /* Do we sense any food on this level? */ 438 /* Do we sense any food on this level? */
437 if (cur_relic[SURTUR_RING]) quaff(P_FFIND, NULL, NULL, FALSE); 439 if (cur_relic[SURTUR_RING]) quaff(P_FFIND, 0, 0, FALSE);
438 } 440 }
439 441
440 /* 442 /*
441 * Pick a room that is really there 443 * Pick a room that is really there
442 */ 444 */
443 445
444 rnd_room() 446 int
447 rnd_room(void)
445 { 448 {
446 register int rm; 449 register int rm;
447 450
448 if (levtype != NORMLEV) 451 if (levtype != NORMLEV)
449 rm = 0; 452 rm = 0;
455 } 458 }
456 459
457 /* 460 /*
458 * put_things: 461 * put_things:
459 * put potions and scrolls on this level 462 * put potions and scrolls on this level
463 * ltype: designates type of level to create
460 */ 464 */
461 465
462 put_things(ltype) 466 void
463 LEVTYPE ltype; /* designates type of level to create */ 467 put_things(LEVTYPE ltype)
464 { 468 {
465 register int i, rm, cnt; 469 register int i, rm, cnt;
466 register struct object *cur; 470 register struct object *cur;
467 register struct linked_list *item, *nextitem, *exitptr; 471 register struct linked_list *item, *nextitem, *exitptr;
468 int length, width; 472 int length, width;
476 480
477 /* 481 /*
478 * There is a chance that there is a treasure room on this level 482 * There is a chance that there is a treasure room on this level
479 */ 483 */
480 if (ltype != MAZELEV && rnd(HARDER) < level - 10) { 484 if (ltype != MAZELEV && rnd(HARDER) < level - 10) {
481 register j; 485 int j;
482 register struct room *rp; 486 register struct room *rp;
483 487
484 /* Count the number of free spaces */ 488 /* Count the number of free spaces */
485 i = 0; /* 0 tries */ 489 i = 0; /* 0 tries */
486 do { 490 do {