Skip to content

Commit b209f87

Browse files
committed
bug: chasm warning
1 parent bfe186f commit b209f87

File tree

9 files changed

+170
-31
lines changed

9 files changed

+170
-31
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<!-- Bugs -->
22
<!-- ------ -->
3-
<!-- popup for jumping into a chasm -->
4-
<!-- Maybe auto-pause when damage taken? (Like walking on lava) -->
5-
<!-- I died by being burn alive by some "beacon of light" / brazier. -->
6-
<!-- some issue with key handling on chromebook -->
3+
<!-- popup for jumping into a chasm -->
4+
<!-- Maybe auto-pause when damage taken? (Like walking on lava) -->
5+
<!-- I died by being burn alive by some "beacon of light" / brazier. -->
76
<!-- ------ -->
87
<!-- -->
98
<!-- Performance -->
109
<!-- ------ -->
11-
<!-- sudo operf ./zorbash --playername discobob --seed victimlake --nodebug --quick-start -->
10+
<!-- sudo operf ./zorbash --playername discobob --seed victimlake --nodebug --quick-start -->
1211
<!-- opreport --demangle=smart --symbols| less -->
1312
<!-- ------ -->
1413
<!-- -->

data/gfx.tgz

3.89 KB
Binary file not shown.

python/gfx.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,26 @@ def init_tiles_16x16_1():
499499
"",
500500
############################################################
501501
"",
502+
"cursor_hazard.1",
503+
"cursor_hazard.2",
504+
"cursor_hazard.3",
505+
"cursor_hazard.4",
506+
"cursor_hazard.5",
507+
"cursor_hazard.6",
508+
"cursor_hazard.7",
509+
"cursor_hazard.8",
510+
"cursor_hazard.9",
511+
"cursor_hazard.10",
512+
"cursor_hazard.11",
513+
"cursor_hazard.12",
514+
"cursor_hazard_path.1",
515+
"",
516+
"",
517+
"",
518+
"",
519+
"",
520+
############################################################
521+
"",
502522
"cursor_select.1",
503523
"cursor_select.2",
504524
"cursor_select.3",
@@ -698,26 +718,6 @@ def init_tiles_16x16_1():
698718
"",
699719
"",
700720
############################################################
701-
"",
702-
"",
703-
"",
704-
"",
705-
"",
706-
"",
707-
"",
708-
"",
709-
"",
710-
"",
711-
"",
712-
"",
713-
"",
714-
"floor_pink_blood8.75",
715-
"floor_pink_blood8.50",
716-
"floor_pink_blood8.25",
717-
"",
718-
"",
719-
"",
720-
############################################################
721721
"key.1",
722722
"key.2",
723723
"key.3",
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import my
2+
import tp
3+
4+
5+
def tp_init(name):
6+
text_long_name = "cursor"
7+
self = tp.Tp(name, text_long_name)
8+
# begin sort marker
9+
my.gfx_ascii_shown(self, True)
10+
my.gfx_pixelart_animated(self, True)
11+
my.gfx_pixelart_reflection(self, True)
12+
my.gfx_pixelart_shadow(self, True)
13+
my.gfx_pixelart_show_outlined(self, True)
14+
my.is_cursor(self, True)
15+
my.is_floating(self, True)
16+
my.is_internal(self, True)
17+
my.is_moveable(self, True)
18+
my.is_tmp_thing(self, True)
19+
my.text_a_or_an(self, "the")
20+
my.text_description_short(self, "Cursor.")
21+
my.tick_prio(self, my.MAP_TICK_PRIO_NORMAL)
22+
my.z_depth(self, my.MAP_DEPTH_OBJ)
23+
my.z_prio(self, my.MAP_Z_PRIO_CURSOR)
24+
# end sort marker
25+
26+
delay = 50
27+
my.tile(self,
28+
ascii_bg_char="block", ascii_bg_col_name="red", ascii_fg_col_name="",
29+
tile=name + ".1", delay_ms=delay)
30+
my.tile(self,
31+
ascii_bg_char="block", ascii_bg_col_name="orange", ascii_fg_col_name="",
32+
tile=name + ".2", delay_ms=delay)
33+
my.tile(self,
34+
ascii_bg_char="block", ascii_bg_col_name="yellow", ascii_fg_col_name="",
35+
tile=name + ".3", delay_ms=delay)
36+
my.tile(self,
37+
ascii_bg_char="block", ascii_bg_col_name="red", ascii_fg_col_name="",
38+
tile=name + ".4", delay_ms=delay)
39+
my.tile(self,
40+
ascii_bg_char="block", ascii_bg_col_name="orange", ascii_fg_col_name="",
41+
tile=name + ".5", delay_ms=delay)
42+
my.tile(self,
43+
ascii_bg_char="block", ascii_bg_col_name="yellow", ascii_fg_col_name="",
44+
tile=name + ".6", delay_ms=delay)
45+
my.tile(self,
46+
ascii_bg_char="block", ascii_bg_col_name="red", ascii_fg_col_name="",
47+
tile=name + ".7", delay_ms=delay)
48+
my.tile(self,
49+
ascii_bg_char="block", ascii_bg_col_name="orange", ascii_fg_col_name="",
50+
tile=name + ".8", delay_ms=delay)
51+
my.tile(self,
52+
ascii_bg_char="block", ascii_bg_col_name="yellow", ascii_fg_col_name="",
53+
tile=name + ".9", delay_ms=delay)
54+
my.tile(self,
55+
ascii_bg_char="block", ascii_bg_col_name="red", ascii_fg_col_name="",
56+
tile=name + ".10", delay_ms=delay)
57+
my.tile(self,
58+
ascii_bg_char="block", ascii_bg_col_name="orange", ascii_fg_col_name="",
59+
tile=name + ".11", delay_ms=delay)
60+
my.tile(self,
61+
ascii_bg_char="block", ascii_bg_col_name="yellow", ascii_fg_col_name="",
62+
tile=name + ".12", delay_ms=delay)
63+
64+
my.tp_update(self)
65+
66+
67+
def init():
68+
tp_init(name="cursor_hazard")
69+
70+
71+
init()
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import my
2+
import tp
3+
4+
5+
def tp_init(name):
6+
text_long_name = "cursor path"
7+
self = tp.Tp(name, text_long_name)
8+
# begin sort marker
9+
my.gfx_ascii_shown(self, True)
10+
my.gfx_pixelart_animated(self, True)
11+
my.gfx_pixelart_reflection(self, True)
12+
my.gfx_pixelart_shadow(self, True)
13+
my.is_cursor_path(self, True)
14+
my.is_floating(self, True)
15+
my.is_internal(self, True)
16+
my.is_moveable(self, True)
17+
my.is_removable_if_out_of_slots(self, True)
18+
my.is_tmp_thing(self, True)
19+
my.text_a_or_an(self, "the")
20+
my.text_description_short(self, "Cursor path.")
21+
my.tick_prio(self, my.MAP_TICK_PRIO_NORMAL)
22+
my.z_depth(self, my.MAP_DEPTH_OBJ)
23+
my.z_prio(self, my.MAP_Z_PRIO_CURSOR)
24+
# end sort marker
25+
26+
delay = 50
27+
my.tile(self,
28+
ascii_bg_char="block", ascii_bg_col_name="red", ascii_fg_col_name="",
29+
ascii_bg_alpha=200,
30+
tile=name + ".1", delay_ms=delay)
31+
32+
my.tp_update(self)
33+
34+
35+
def init():
36+
tp_init(name="cursor_hazard_path")
37+
38+
39+
init()

src/level_create.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ void Level::create(point3d world_at, point grid_at, uint32_t seed, int difficult
109109
things_gc_force();
110110

111111
if (! cursor && player) {
112-
cursor = thing_new("cursor", player->curr_at);
112+
if (is_hazard(player->curr_at)) {
113+
cursor = thing_new("cursor_hazard", player->curr_at);
114+
} else {
115+
cursor = thing_new("cursor", player->curr_at);
116+
}
113117
cursor->hide();
114118
is_map_mini_valid = true;
115119
}

src/level_cursor.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,11 @@ void Level::cursor_recreate(point curr_at)
193193
game->request_destination_ok = true;
194194
}
195195
} else {
196-
cursor = thing_new("cursor", curr_at);
196+
if (is_hazard(curr_at)) {
197+
cursor = thing_new("cursor_hazard", curr_at);
198+
} else {
199+
cursor = thing_new("cursor", curr_at);
200+
}
197201
game->request_destination_ok = true;
198202
}
199203

src/level_cursor_path.cpp

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,13 @@ bool Level::cursor_path_draw_line(Thingp it, point start, point end)
268268
continue;
269269
}
270270
}
271-
thing_new("cursor_path", point(c.x, c.y));
271+
272+
point curr_at(c.x, c.y);
273+
if (is_hazard(curr_at)) {
274+
thing_new("cursor_hazard_path", curr_at);
275+
} else {
276+
thing_new("cursor_path", curr_at);
277+
}
272278
}
273279

274280
pcg_random_allowed--;
@@ -300,7 +306,13 @@ void Level::cursor_path_draw_straight_line(Thingp it, point start, point end)
300306
continue;
301307
}
302308
}
303-
thing_new("cursor_path", point(c.x, c.y));
309+
310+
point curr_at(c.x, c.y);
311+
if (is_hazard(curr_at)) {
312+
thing_new("cursor_hazard_path", curr_at);
313+
} else {
314+
thing_new("cursor_path", curr_at);
315+
}
304316
}
305317
pcg_random_allowed--;
306318
}
@@ -321,7 +333,13 @@ bool Level::cursor_path_draw_line(Thingp it, const std::vector< point > &move_pa
321333
continue;
322334
}
323335
}
324-
thing_new("cursor_path", point(c.x, c.y));
336+
337+
point curr_at(c.x, c.y);
338+
if (is_hazard(curr_at)) {
339+
thing_new("cursor_hazard_path", curr_at);
340+
} else {
341+
thing_new("cursor_path", curr_at);
342+
}
325343
}
326344
pcg_random_allowed--;
327345
return true;

src/level_tick.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ void Level::tick_(void)
157157
// Create the cursor if not yet.
158158
//
159159
if (! cursor) {
160-
cursor = thing_new("cursor", player->curr_at);
160+
if (is_hazard(player->curr_at)) {
161+
cursor = thing_new("cursor_hazard", player->curr_at);
162+
} else {
163+
cursor = thing_new("cursor", player->curr_at);
164+
}
161165
}
162166

163167
//

0 commit comments

Comments
 (0)