… | |
… | |
52 | |
52 | |
53 | if (wall->flag [FLAG_IS_QUAD] && visible) |
53 | if (wall->flag [FLAG_IS_QUAD] && visible) |
54 | { |
54 | { |
55 | maptile *m = wall->map; |
55 | maptile *m = wall->map; |
56 | |
56 | |
57 | if (m->tile_path [TILE_UP]) |
57 | if (ob->map->tile_path [TILE_UP] && wall->map->tile_path [TILE_UP]) |
|
|
58 | { |
58 | if (maptile *up = m->tile_available (TILE_UP)) |
59 | maptile *wall_up = wall->map->tile_available (TILE_UP); |
|
|
60 | maptile *ob_up = ob ->map->tile_available (TILE_UP); |
|
|
61 | |
|
|
62 | if (wall_up && ob_up) |
59 | { |
63 | { |
60 | if (ob->blocked (up, ob->x, ob->y) || has_floor (up, ob->x, ob->y)) |
64 | if (ob->blocked (ob_up, ob->x, ob->y) || has_floor (ob_up, ob->x, ob->y)) |
61 | ob->failmsg (format ("Ouch, you hit your head while climbing the %s! H<Didn't you see the ceiling?>", query_name (wall))); |
65 | ob->failmsg (format ("Ouch, you hit your head while climbing the %s! H<Didn't you see the ceiling? :)>", query_name (wall))); |
62 | //TODO: reduce health |
66 | //TODO: reduce health |
63 | else if (ob->blocked (up, wall->x, wall->y)) |
67 | else if (ob->blocked (wall_up, wall->x, wall->y)) |
64 | ob->failmsg (format ("You try to climb up, but the %s is too high for you!", query_name (wall))); |
68 | ob->failmsg (format ("You try to climb up, but the %s is too high for you! H<No free space on top of this block.>", query_name (wall))); |
65 | //TODO: reduce health |
69 | //TODO: reduce health |
66 | else |
70 | else |
67 | { |
71 | { |
68 | ob->statusmsg (format ("You successfully climb up the %s.", query_name (wall))); |
72 | ob->statusmsg (format ("You successfully climb up the %s.", query_name (wall))); |
69 | // here we assume that ob is a player... |
73 | // here we assume that ob is a player... |
70 | ob->enter_map (up, wall->x, wall->y); |
74 | ob->enter_map (wall_up, wall->x, wall->y); |
71 | } |
75 | } |
72 | } |
76 | } |
73 | else |
77 | else |
74 | ob->failmsg (format ("You try to climb the %s, but you fall down! H<Try again.>", query_name (wall))); |
78 | ob->failmsg (format ("You try to climb the %s, but you fall down! H<Try again.>", query_name (wall))); |
|
|
79 | } |
75 | else |
80 | else |
76 | ob->failmsg (format ("You fail to climb up the %s! H<You cannot climb up here.>", query_name (wall))); |
81 | ob->failmsg (format ("You fail to climb up the %s! H<You cannot climb up here.>", query_name (wall))); |
77 | |
82 | |
78 | |
83 | |
79 | return; |
84 | return; |
… | |
… | |
182 | float mountain = mountain_gen.ridgedmultifractal (P * 0.004); |
187 | float mountain = mountain_gen.ridgedmultifractal (P * 0.004); |
183 | |
188 | |
184 | //TODO: mountains should not lower the height, should they? |
189 | //TODO: mountains should not lower the height, should they? |
185 | t = valley < 0 ? T_VALLEY : T_MOUNTAIN; |
190 | t = valley < 0 ? T_VALLEY : T_MOUNTAIN; |
186 | c = blend0 (vec3d (0, 0.8, 0), vec3d (0.8, 0, 0), valley, 0.1f); |
191 | c = blend0 (vec3d (0, 0.8, 0), vec3d (0.8, 0, 0), valley, 0.1f); |
187 | h = blend0 (base_height + continent * 300, base_height + mountain * xy_gradient * 400, valley, 0.1f); |
192 | h = blend0 (base_height + continent * 300*0, base_height + mountain * xy_gradient * 400, valley, 0.1f); |
188 | |
193 | |
189 | if (river1 < 0.01f) |
194 | if (river1 < 0.01f) |
190 | { |
195 | { |
191 | // main rivers - they cut deeply into the mountains (base_height * 0.9f) |
196 | // main rivers - they cut deeply into the mountains (base_height * 0.9f) |
192 | t = T_RIVER; |
197 | t = T_RIVER; |
… | |
… | |
204 | } |
209 | } |
205 | |
210 | |
206 | if (continent < 0) |
211 | if (continent < 0) |
207 | { |
212 | { |
208 | t = T_OCEAN; |
213 | t = T_OCEAN; |
|
|
214 | h0 = 0; |
209 | min_it (h, min (continent * 200, -1)); |
215 | min_it (h, min (continent * 200, -1)); |
210 | c = vec3d (0, 0, 1); |
216 | c = vec3d (0, 0, 1); |
211 | } |
217 | } |
212 | |
218 | |
213 | // now we have the base height, and base terrain |
219 | // now we have the base height, and base terrain |