… | |
… | |
21 | */ |
21 | */ |
22 | |
22 | |
23 | #include <global.h> |
23 | #include <global.h> |
24 | |
24 | |
25 | #include "noise.h" |
25 | #include "noise.h" |
|
|
26 | |
|
|
27 | ///////////////////////////////////////////////////////////////////////////// |
|
|
28 | |
|
|
29 | void |
|
|
30 | move_into_wall (object *ob, object *wall) |
|
|
31 | { |
|
|
32 | bool visible = !wall->invisible && !ob->flag [FLAG_BLIND]; |
|
|
33 | |
|
|
34 | if (wall->flag [FLAG_IS_QUAD] && visible) |
|
|
35 | { |
|
|
36 | maptile *m = wall->map; |
|
|
37 | printf ("hi\n");//D |
|
|
38 | |
|
|
39 | if (m->tile_path [TILE_UP]) |
|
|
40 | if (maptile *up = m->tile_available (TILE_UP)) |
|
|
41 | { |
|
|
42 | if (ob->blocked (up, ob->x, ob->y)) |
|
|
43 | ob->failmsg (format ("Ouch, you hit your head while climbing the %s! H<Didn't you see the ceiling?>", query_name (wall))); |
|
|
44 | //TODO: reduce health |
|
|
45 | else if (ob->blocked (up, wall->x, wall->y)) |
|
|
46 | ob->failmsg (format ("You try to climb up, but the %s is too high for you!", query_name (wall))); |
|
|
47 | //TODO: reduce health |
|
|
48 | else |
|
|
49 | { |
|
|
50 | ob->statusmsg (format ("You successfully climb up the %s.", query_name (wall))); |
|
|
51 | // here we assume that ob is a player... |
|
|
52 | ob->enter_map (up, wall->x, wall->y); |
|
|
53 | } |
|
|
54 | } |
|
|
55 | else |
|
|
56 | ob->failmsg (format ("You try to climb the %s, but you fall down! H<Try again.>", query_name (wall))); |
|
|
57 | else |
|
|
58 | ob->failmsg (format ("You fail to climb up the %s! H<You cannot climb up here.>", query_name (wall))); |
|
|
59 | |
|
|
60 | |
|
|
61 | return; |
|
|
62 | } |
|
|
63 | |
|
|
64 | if (ob->contr->ns->bumpmsg) |
|
|
65 | { |
|
|
66 | ob->play_sound (sound_find ("bump_wall")); |
|
|
67 | |
|
|
68 | ob->statusmsg (visible |
|
|
69 | ? format ("You bump into the %s.", query_name (wall)) |
|
|
70 | : "You bump into something." |
|
|
71 | ); |
|
|
72 | } |
|
|
73 | } |
|
|
74 | |
|
|
75 | ///////////////////////////////////////////////////////////////////////////// |
26 | |
76 | |
27 | #define FANCY_GRAPHICS 0 |
77 | #define FANCY_GRAPHICS 0 |
28 | |
78 | |
29 | static void |
79 | static void |
30 | gen_quadspace (maptile *m, int mx, int my, int x, int y, int z) |
80 | gen_quadspace (maptile *m, int mx, int my, int x, int y, int z) |
… | |
… | |
235 | for (int mx = 0; mx < 50; ++mx) |
285 | for (int mx = 0; mx < 50; ++mx) |
236 | for (int my = 0; my < 50; ++my) |
286 | for (int my = 0; my < 50; ++my) |
237 | gen_quadspace (m, mx, my, x + mx, y + my, z); |
287 | gen_quadspace (m, mx, my, x + mx, y + my, z); |
238 | } |
288 | } |
239 | |
289 | |
|
|
290 | ///////////////////////////////////////////////////////////////////////////// |
|
|
291 | |
240 | void noise_test (); |
292 | void noise_test (); |
241 | void noise_test () |
293 | void noise_test () |
242 | { |
294 | { |
243 | #if 1 |
295 | #if 1 |
244 | int Nw = 700; |
296 | int Nw = 700; |