Mercurial > hg > early-roguelike
comparison arogue7/outside.c @ 225:4f6e056438eb
Merge the GCC5 and build fix branches.
author | John "Elwin" Edwards |
---|---|
date | Wed, 02 Mar 2016 21:28:34 -0500 |
parents | f9ef86cf22b2 |
children |
comparison
equal
deleted
inserted
replaced
224:4d0f53998e8a | 225:4f6e056438eb |
---|---|
13 */ | 13 */ |
14 | 14 |
15 #include "curses.h" | 15 #include "curses.h" |
16 #include "rogue.h" | 16 #include "rogue.h" |
17 | 17 |
18 extern char rnd_terrain(), get_terrain(); | 18 char rnd_terrain(void); |
19 char get_terrain(char one, char two, char three, char four); | |
19 | 20 |
20 /* | 21 /* |
21 * init_terrain: | 22 * init_terrain: |
22 * Get the single "outside room" set up correctly | 23 * Get the single "outside room" set up correctly |
23 */ | 24 */ |
24 | 25 |
25 void | 26 void |
26 init_terrain() | 27 init_terrain(void) |
27 { | 28 { |
28 register struct room *rp; | 29 register struct room *rp; |
29 | 30 |
30 for (rp = rooms; rp < &rooms[MAXROOMS]; rp++) { | 31 for (rp = rooms; rp < &rooms[MAXROOMS]; rp++) { |
31 rp->r_flags = ISGONE; /* kill all rooms */ | 32 rp->r_flags = ISGONE; /* kill all rooms */ |
40 } | 41 } |
41 | 42 |
42 | 43 |
43 | 44 |
44 void | 45 void |
45 do_terrain(basey, basex, deltay, deltax, fresh) | 46 do_terrain(int basey, int basex, int deltay, int deltax, bool fresh) |
46 int basey, basex, deltay, deltax; | 47 { |
47 bool fresh; | 48 register int cury, curx; /* Current y and x positions */ |
48 { | |
49 register cury, curx; /* Current y and x positions */ | |
50 | 49 |
51 /* Lay out the boundary */ | 50 /* Lay out the boundary */ |
52 for (cury=1; cury<lines-2; cury++) { /* Vertical "walls" */ | 51 for (cury=1; cury<lines-2; cury++) { /* Vertical "walls" */ |
53 mvaddch(cury, 0, '|'); | 52 mvaddch(cury, 0, '|'); |
54 mvaddch(cury, cols-1, '|'); | 53 mvaddch(cury, cols-1, '|'); |
127 * rnd_terrain: | 126 * rnd_terrain: |
128 * return a weighted, random type of outside terrain | 127 * return a weighted, random type of outside terrain |
129 */ | 128 */ |
130 | 129 |
131 char | 130 char |
132 rnd_terrain() | 131 rnd_terrain(void) |
133 { | 132 { |
134 int chance = rnd(100); | 133 int chance = rnd(100); |
135 | 134 |
136 /* Forest is most likely */ | 135 /* Forest is most likely */ |
137 if (chance < 60) return(FOREST); | 136 if (chance < 60) return(FOREST); |
151 * get_terrain: | 150 * get_terrain: |
152 * return a terrain weighted by what is surrounding | 151 * return a terrain weighted by what is surrounding |
153 */ | 152 */ |
154 | 153 |
155 char | 154 char |
156 get_terrain(one, two, three, four) | 155 get_terrain(char one, char two, char three, char four) |
157 char one, two, three, four; | |
158 { | 156 { |
159 register int i; | 157 register int i; |
160 int forest = 0, mountain = 0, lake = 0, meadow = 0, total = 0; | 158 int forest = 0, mountain = 0, lake = 0, meadow = 0, total = 0; |
161 char surrounding[4]; | 159 char surrounding[4]; |
162 | 160 |
205 * lake_check: | 203 * lake_check: |
206 * Determine if the player would drown | 204 * Determine if the player would drown |
207 */ | 205 */ |
208 | 206 |
209 void | 207 void |
210 lake_check(place) | 208 lake_check(coord *place) |
211 coord *place; | 209 { |
212 { | 210 } |
213 } |