diff --git a/python/things/dungeon/acid.py b/python/things/dungeon/acid.py index f16f16b15..c82145058 100644 --- a/python/things/dungeon/acid.py +++ b/python/things/dungeon/acid.py @@ -19,6 +19,7 @@ def acid_init(name, text_long_name, text_short_name, tiles=[], left_tiles=[]): my.is_interesting(self, True) my.is_loggable(self, True) my.is_obs_ai(self, True) + my.is_only_one_per_tile(self, True) my.is_removable_if_out_of_slots(self, True) my.is_tickable(self, True) # for lifespan my.lifespan_dice(self, "1d20+20") diff --git a/python/things/dungeon/ascend_dungeon.py b/python/things/dungeon/ascend_dungeon.py index b79da3a0d..94162dafd 100644 --- a/python/things/dungeon/ascend_dungeon.py +++ b/python/things/dungeon/ascend_dungeon.py @@ -38,6 +38,7 @@ def tp_init(name, text_long_name, text_short_name): my.is_described_when_hovering_over(self, True) my.is_interesting(self, True) my.is_obs_spawn_monst(self, True) + my.is_only_one_per_tile(self, True) my.light_color(self, "yellow") my.light_dist(self, 3) my.normal_placement_rules(self, True) diff --git a/python/things/dungeon/ascend_sewer.py b/python/things/dungeon/ascend_sewer.py index bc7fee3e9..1d434e3a7 100644 --- a/python/things/dungeon/ascend_sewer.py +++ b/python/things/dungeon/ascend_sewer.py @@ -24,6 +24,7 @@ def tp_init(name, tiles=[], left1_tiles=[]): my.is_described_when_hovering_over(self, True) my.is_interesting(self, True) my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.is_tickable(self, True) my.light_color(self, "lime") my.light_dist(self, 1) diff --git a/python/things/dungeon/basalt.py b/python/things/dungeon/basalt.py index b88c40a6e..3e65accfd 100644 --- a/python/things/dungeon/basalt.py +++ b/python/things/dungeon/basalt.py @@ -23,6 +23,7 @@ def basalt_init(name, text_long_name, tiles=[]): my.is_interesting(self, True) my.is_loggable(self, True) my.is_obs_ai(self, True) + my.is_only_one_per_tile(self, True) my.is_tickable(self, True) my.text_a_or_an(self, "") my.text_description_short(self, "Warm to the touch basalt.") diff --git a/python/things/dungeon/bridge.py b/python/things/dungeon/bridge.py index 52a2c3735..fef816c0d 100644 --- a/python/things/dungeon/bridge.py +++ b/python/things/dungeon/bridge.py @@ -34,6 +34,7 @@ def tp_init(name, tiles=[], bot3_tiles=[]): my.is_described_when_hovering_over(self, True) my.is_flat(self, True) my.is_interesting(self, True) + my.is_only_one_per_tile(self, True) my.on_death_do(self, "bridge.on_death()") my.text_a_or_an(self, "the") my.text_description_short(self, "Shaky bridge.") diff --git a/python/things/dungeon/chasm.py b/python/things/dungeon/chasm.py index ab9165dab..6f7f5efce 100644 --- a/python/things/dungeon/chasm.py +++ b/python/things/dungeon/chasm.py @@ -21,6 +21,7 @@ def chasm_init(name, text_long_name, tiles=[]): my.is_described_when_hovering_over(self, True) my.is_hazard(self, True) my.is_obs_ai(self, True) + my.is_only_one_per_tile(self, True) my.text_a_or_an(self, "a") my.text_description_short(self, "%%fg=red$A yawning chasm to the unknown below%%fg=reset$ (double click to jump into).") my.tick_prio(self, my.MAP_TICK_PRIO_NORMAL) diff --git a/python/things/dungeon/corridor.py b/python/things/dungeon/corridor.py index bb0617034..1e843c181 100644 --- a/python/things/dungeon/corridor.py +++ b/python/things/dungeon/corridor.py @@ -15,6 +15,7 @@ def tp_init(name, tiles=[], bot3_tiles=[]): my.is_cursor_can_hover_over(self, True) my.is_described_when_hovering_over(self, True) my.is_flat(self, True) + my.is_only_one_per_tile(self, True) my.text_a_or_an(self, "the") my.text_description_short(self, "The dirty dungeon corridor.") my.tick_prio(self, my.MAP_TICK_PRIO_NORMAL) diff --git a/python/things/dungeon/deep_water.py b/python/things/dungeon/deep_water.py index 75e5e5a91..1297b6ca3 100644 --- a/python/things/dungeon/deep_water.py +++ b/python/things/dungeon/deep_water.py @@ -28,6 +28,7 @@ def tp_init(name, text_long_name, tiles=[]): my.is_hazard(self, True) my.is_interesting(self, True) my.is_obs_ai(self, True) + my.is_only_one_per_tile(self, True) my.text_a_or_an(self, "the") my.text_description_short(self, "A pool of deep dank water, with things in it.") my.z_depth(self, my.MAP_DEPTH_LIQUID) diff --git a/python/things/dungeon/descend_dungeon.py b/python/things/dungeon/descend_dungeon.py index 8cc93ece0..a075996d0 100644 --- a/python/things/dungeon/descend_dungeon.py +++ b/python/things/dungeon/descend_dungeon.py @@ -29,6 +29,7 @@ def tp_init(name, text_long_name, text_short_name): my.is_described_when_hovering_over(self, True) my.is_interesting(self, True) my.is_obs_spawn_monst(self, True) + my.is_only_one_per_tile(self, True) my.light_color(self, "white") my.light_dist(self, 1) my.normal_placement_rules(self, True) diff --git a/python/things/dungeon/descend_sewer.py b/python/things/dungeon/descend_sewer.py index 69b2550f2..5e9744fca 100644 --- a/python/things/dungeon/descend_sewer.py +++ b/python/things/dungeon/descend_sewer.py @@ -24,6 +24,7 @@ def tp_init(name, tiles=[], left1_tiles=[]): my.is_described_when_hovering_over(self, True) my.is_interesting(self, True) my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.is_tickable(self, True) my.light_color(self, "lime") my.light_dist(self, 1) diff --git a/python/things/dungeon/dirt.py b/python/things/dungeon/dirt.py index 3eaa5f4df..1a2188e6b 100644 --- a/python/things/dungeon/dirt.py +++ b/python/things/dungeon/dirt.py @@ -23,6 +23,7 @@ def tp_init(name, tiles=[], left1_tiles=[], bot3_tiles=[]): my.is_described_when_hovering_over(self, True) my.is_dirt(self, True) my.is_flat(self, True) + my.is_only_one_per_tile(self, True) my.text_a_or_an(self, "the") my.text_description_short(self, "Some exciting dirt") my.tick_prio(self, my.MAP_TICK_PRIO_NORMAL) diff --git a/python/things/dungeon/dry_grass.py b/python/things/dungeon/dry_grass.py index 766898048..bcd4f320f 100644 --- a/python/things/dungeon/dry_grass.py +++ b/python/things/dungeon/dry_grass.py @@ -33,6 +33,7 @@ def tp_init(name, tiles=[]): my.is_dry_grass(self, True) my.is_grass(self, True) my.is_interesting(self, True) + my.is_only_one_per_tile(self, True) my.nutrition_dice(self, "1d4") my.on_hit_and_now_dead_do(self, "dry_grass.on_hit_and_now_dead()") my.temperature_max(self, 50) diff --git a/python/things/dungeon/dry_grass_dead.py b/python/things/dungeon/dry_grass_dead.py index f9fd49974..a5a0a0a84 100644 --- a/python/things/dungeon/dry_grass_dead.py +++ b/python/things/dungeon/dry_grass_dead.py @@ -21,6 +21,7 @@ def tp_init(name, tiles=[]): my.is_dry_grass(self, True) my.is_grass(self, True) my.is_interesting(self, True) + my.is_only_one_per_tile(self, True) my.nutrition_dice(self, "1d2") my.temperature_max(self, 50) my.temperature_min(self, 0) diff --git a/python/things/dungeon/dry_grass_trampled.py b/python/things/dungeon/dry_grass_trampled.py index 0f579e5c0..86a14eee3 100644 --- a/python/things/dungeon/dry_grass_trampled.py +++ b/python/things/dungeon/dry_grass_trampled.py @@ -30,6 +30,7 @@ def tp_init(name, tiles=[]): my.is_dry_grass_trampled(self, True) my.is_grass(self, True) my.is_interesting(self, True) + my.is_only_one_per_tile(self, True) my.nutrition_dice(self, "1d3") my.on_hit_and_now_dead_do(self, "me.on_hit_and_now_dead()") my.temperature_max(self, 50) diff --git a/python/things/dungeon/fire.py b/python/things/dungeon/fire.py index 83dfa0d66..230244f44 100644 --- a/python/things/dungeon/fire.py +++ b/python/things/dungeon/fire.py @@ -33,6 +33,7 @@ def tp_init(name, text_long_name): my.is_interesting(self, True) my.is_loggable(self, True) my.is_moveable(self, True) + my.is_only_one_per_tile(self, True) my.is_tickable(self, True) my.lifespan_dice(self, "1d20+20") my.light_color(self, "orange") diff --git a/python/things/dungeon/floor.py b/python/things/dungeon/floor.py index edc3aa3c1..9b250e386 100644 --- a/python/things/dungeon/floor.py +++ b/python/things/dungeon/floor.py @@ -22,6 +22,7 @@ def tp_init(name, tiles=[], bot3_tiles=[]): my.is_described_when_hovering_over(self, True) my.is_flat(self, True) my.is_floor(self, True) + my.is_only_one_per_tile(self, True) my.text_a_or_an(self, "the") my.text_description_short(self, "The unwashed dungeon floor.") my.tick_prio(self, my.MAP_TICK_PRIO_NORMAL) diff --git a/python/things/dungeon/floor_green_blood.py b/python/things/dungeon/floor_green_blood.py index c09aeadba..e58175e32 100644 --- a/python/things/dungeon/floor_green_blood.py +++ b/python/things/dungeon/floor_green_blood.py @@ -21,6 +21,7 @@ def tp_init(name, text_long_name): my.is_flat(self, True) my.is_green_blood(self, True) my.is_interesting(self, True) + my.is_only_one_per_tile(self, True) my.is_removable_if_out_of_slots(self, True) my.normal_placement_rules(self, True) my.nutrition_dice(self, "1d4") diff --git a/python/things/dungeon/floor_ice.py b/python/things/dungeon/floor_ice.py index fd75b26a1..cdb7982eb 100644 --- a/python/things/dungeon/floor_ice.py +++ b/python/things/dungeon/floor_ice.py @@ -22,6 +22,7 @@ def tp_init(name, tiles=[], bot3_tiles=[]): my.is_described_when_hovering_over(self, True) my.is_flat(self, True) my.is_floor(self, True) + my.is_only_one_per_tile(self, True) my.text_a_or_an(self, "the") my.text_description_short(self, "The icy dungeon floor.") my.tick_prio(self, my.MAP_TICK_PRIO_NORMAL) diff --git a/python/things/dungeon/floor_lava.py b/python/things/dungeon/floor_lava.py index 99ba793a3..7590b4eea 100644 --- a/python/things/dungeon/floor_lava.py +++ b/python/things/dungeon/floor_lava.py @@ -22,6 +22,7 @@ def tp_init(name, tiles=[], bot3_tiles=[]): my.is_described_when_hovering_over(self, True) my.is_flat(self, True) my.is_floor(self, True) + my.is_only_one_per_tile(self, True) my.text_a_or_an(self, "the") my.text_description_short(self, "The scalding dungeon floor.") my.tick_prio(self, my.MAP_TICK_PRIO_NORMAL) diff --git a/python/things/dungeon/floor_red_blood.py b/python/things/dungeon/floor_red_blood.py index 137e38503..3f89d0d69 100644 --- a/python/things/dungeon/floor_red_blood.py +++ b/python/things/dungeon/floor_red_blood.py @@ -20,6 +20,7 @@ def tp_init(name, text_long_name): my.is_described_when_hovering_over(self, True) my.is_flat(self, True) my.is_interesting(self, True) + my.is_only_one_per_tile(self, True) my.is_red_blood(self, True) my.is_removable_if_out_of_slots(self, True) my.normal_placement_rules(self, True) diff --git a/python/things/dungeon/foliage.py b/python/things/dungeon/foliage.py index 06667c264..908535d28 100644 --- a/python/things/dungeon/foliage.py +++ b/python/things/dungeon/foliage.py @@ -35,6 +35,7 @@ def tp_init(name, tiles=[]): my.is_hittable(self, True) my.is_interesting(self, True) my.is_light_blocker_for_monst(self, True) # to give cover to the player + my.is_only_one_per_tile(self, True) my.noise_blocker(self, True) my.nutrition_dice(self, "1d6") my.temperature_max(self, 50) diff --git a/python/things/dungeon/foliage_large.py b/python/things/dungeon/foliage_large.py index 812aab026..3f6155bb8 100644 --- a/python/things/dungeon/foliage_large.py +++ b/python/things/dungeon/foliage_large.py @@ -36,6 +36,7 @@ def tp_init(name, tiles=[]): my.is_hittable(self, True) my.is_interesting(self, True) my.is_light_blocker_for_monst(self, True) # to give cover to the player + my.is_only_one_per_tile(self, True) my.noise_blocker(self, True) my.nutrition_dice(self, "1d8") my.temperature_max(self, 50) diff --git a/python/things/dungeon/foliage_large_sickly.py b/python/things/dungeon/foliage_large_sickly.py index 1b8306c3b..0ab99978e 100644 --- a/python/things/dungeon/foliage_large_sickly.py +++ b/python/things/dungeon/foliage_large_sickly.py @@ -37,6 +37,7 @@ def tp_init(name, tiles=[]): my.is_hittable(self, True) my.is_interesting(self, True) my.is_light_blocker_for_monst(self, True) # to give cover to the player + my.is_only_one_per_tile(self, True) my.noise_blocker(self, True) my.nutrition_dice(self, "1d5") my.temperature_max(self, 50) diff --git a/python/things/dungeon/foliage_sickly.py b/python/things/dungeon/foliage_sickly.py index eb9ca5fc6..789156fd2 100644 --- a/python/things/dungeon/foliage_sickly.py +++ b/python/things/dungeon/foliage_sickly.py @@ -36,6 +36,7 @@ def tp_init(name, tiles=[]): my.is_hittable(self, True) my.is_interesting(self, True) my.is_light_blocker_for_monst(self, True) # to give cover to the player + my.is_only_one_per_tile(self, True) my.noise_blocker(self, True) my.nutrition_dice(self, "1d3") my.temperature_max(self, 50) diff --git a/python/things/dungeon/gargoyle_podium.py b/python/things/dungeon/gargoyle_podium.py index 00814528f..fb2ab4e32 100644 --- a/python/things/dungeon/gargoyle_podium.py +++ b/python/things/dungeon/gargoyle_podium.py @@ -14,6 +14,7 @@ def tp_init(name, text_long_name, tiles=[]): my.gfx_pixelart_show_outlined(self, True) my.gfx_pixelart_submergible(self, True) my.is_able_to_fall(self, True) + my.is_only_one_per_tile(self, True) my.text_a_or_an(self, "an") my.text_description_short(self, "An empty podium. With claw marks.") my.tick_prio(self, my.MAP_TICK_PRIO_NORMAL) diff --git a/python/things/dungeon/lava.py b/python/things/dungeon/lava.py index a1ab8dca9..e1ce09763 100644 --- a/python/things/dungeon/lava.py +++ b/python/things/dungeon/lava.py @@ -39,6 +39,7 @@ def lava_init(name, text_long_name, tiles=[]): my.is_interesting(self, True) my.is_lava(self, True) my.is_obs_ai(self, True) + my.is_only_one_per_tile(self, True) my.is_tickable(self, True) my.light_color(self, "red") my.light_dist(self, 2) diff --git a/python/things/dungeon/pillar.py b/python/things/dungeon/pillar.py index eb91583cb..14dbee7eb 100644 --- a/python/things/dungeon/pillar.py +++ b/python/things/dungeon/pillar.py @@ -28,6 +28,7 @@ def tp_init(name, text_long_name, tiles=[]): my.is_obs_spawn(self, True) my.is_obs_throwing(self, True) my.is_obs_wall_or_door(self, True) + my.is_only_one_per_tile(self, True) my.is_pillar(self, True) my.text_a_or_an(self, "a") my.text_description_short(self, "An aged and moss-covered stone pillar.") diff --git a/python/things/dungeon/portal.py b/python/things/dungeon/portal.py index b254272c8..c58ae2d3f 100644 --- a/python/things/dungeon/portal.py +++ b/python/things/dungeon/portal.py @@ -32,6 +32,7 @@ def tp_init(name, text_long_name, text_short_name): my.is_obs_shooting(self, True) my.is_obs_spawn_monst(self, True) my.is_obs_throwing(self, True) + my.is_only_one_per_tile(self, True) my.is_portal(self, True) my.light_color(self, "purple") my.light_dist(self, 3) diff --git a/python/things/dungeon/ripple_large.py b/python/things/dungeon/ripple_large.py index 124e7ec08..2a5c50870 100644 --- a/python/things/dungeon/ripple_large.py +++ b/python/things/dungeon/ripple_large.py @@ -9,6 +9,7 @@ def tp_init(name): my.gfx_pixelart_animated(self, True) my.gfx_pixelart_reflection(self, True) my.gfx_pixelart_shadow(self, True) + my.is_only_one_per_tile(self, True) my.is_removable_if_out_of_slots(self, True) my.is_ripple(self, True) my.is_tmp_thing(self, True) diff --git a/python/things/dungeon/ripple_small.py b/python/things/dungeon/ripple_small.py index 4f34e5000..330ba9e22 100644 --- a/python/things/dungeon/ripple_small.py +++ b/python/things/dungeon/ripple_small.py @@ -9,6 +9,7 @@ def tp_init(name): my.gfx_pixelart_animated(self, True) my.gfx_pixelart_reflection(self, True) my.gfx_pixelart_shadow(self, True) + my.is_only_one_per_tile(self, True) my.is_removable_if_out_of_slots(self, True) my.is_ripple(self, True) my.is_tmp_thing(self, True) diff --git a/python/things/dungeon/rock.py b/python/things/dungeon/rock.py index 099b23749..6a98ecdf7 100644 --- a/python/things/dungeon/rock.py +++ b/python/things/dungeon/rock.py @@ -57,6 +57,7 @@ def tp_init( my.is_obs_spawn(self, True) my.is_obs_throwing(self, True) my.is_obs_wall_or_door(self, True) + my.is_only_one_per_tile(self, True) my.is_rock(self, True) my.is_stone(self, True) my.is_very_hard(self, True) diff --git a/python/things/dungeon/rock_ice.py b/python/things/dungeon/rock_ice.py index b2b8880f7..356c7c720 100644 --- a/python/things/dungeon/rock_ice.py +++ b/python/things/dungeon/rock_ice.py @@ -55,6 +55,7 @@ def tp_init( my.is_obs_spawn(self, True) my.is_obs_throwing(self, True) my.is_obs_wall_or_door(self, True) + my.is_only_one_per_tile(self, True) my.is_rock_ice(self, True) my.is_very_hard(self, True) my.is_wall(self, True) diff --git a/python/things/dungeon/rock_lava.py b/python/things/dungeon/rock_lava.py index a51976953..157e39201 100644 --- a/python/things/dungeon/rock_lava.py +++ b/python/things/dungeon/rock_lava.py @@ -55,6 +55,7 @@ def tp_init( my.is_obs_spawn(self, True) my.is_obs_throwing(self, True) my.is_obs_wall_or_door(self, True) + my.is_only_one_per_tile(self, True) my.is_rock(self, True) my.is_stone(self, True) my.is_very_hard(self, True) diff --git a/python/things/dungeon/small_fire.py b/python/things/dungeon/small_fire.py index ea5f2623f..0531d9542 100644 --- a/python/things/dungeon/small_fire.py +++ b/python/things/dungeon/small_fire.py @@ -30,6 +30,7 @@ def tp_init(name, text_long_name): my.is_interesting(self, True) my.is_loggable(self, True) my.is_moveable(self, True) + my.is_only_one_per_tile(self, True) my.is_tickable(self, True) my.lifespan_dice(self, "1d10+10") my.light_color(self, "orange") diff --git a/python/things/dungeon/smoke.py b/python/things/dungeon/smoke.py index 203e18a6c..d75e6b13a 100644 --- a/python/things/dungeon/smoke.py +++ b/python/things/dungeon/smoke.py @@ -16,6 +16,7 @@ def tp_init(name): my.gfx_pixelart_shadow(self, True) my.gfx_pixelart_shadow_short(self, True) my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.is_removable_if_out_of_slots(self, True) my.is_smoke(self, True) my.is_tickable(self, True) diff --git a/python/things/dungeon/spiderweb.py b/python/things/dungeon/spiderweb.py index 881754376..f7d818c06 100644 --- a/python/things/dungeon/spiderweb.py +++ b/python/things/dungeon/spiderweb.py @@ -32,6 +32,7 @@ def tp_init(name, tiles=[]): my.is_immune_to_cold(self, True) my.is_interesting(self, True) # So robot can see and break out my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.is_spiderweb(self, True) my.is_sticky(self, True) my.normal_placement_rules(self, True) diff --git a/python/things/dungeon/steam.py b/python/things/dungeon/steam.py index 863504c39..d09e3a7db 100644 --- a/python/things/dungeon/steam.py +++ b/python/things/dungeon/steam.py @@ -18,6 +18,7 @@ def tp_init(name): my.is_described_when_hovering_over(self, True) my.is_interesting(self, True) my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.is_removable_if_out_of_slots(self, True) my.is_steam(self, True) my.is_tickable(self, True) diff --git a/python/things/dungeon/wall_dungeon.py b/python/things/dungeon/wall_dungeon.py index 250256f5c..46dd35dab 100644 --- a/python/things/dungeon/wall_dungeon.py +++ b/python/things/dungeon/wall_dungeon.py @@ -57,6 +57,7 @@ def tp_init( my.is_obs_spawn(self, True) my.is_obs_throwing(self, True) my.is_obs_wall_or_door(self, True) + my.is_only_one_per_tile(self, True) my.is_stone(self, True) my.is_wall_dungeon(self, True) my.is_wall(self, True) diff --git a/python/things/dungeon/wall_floor.py b/python/things/dungeon/wall_floor.py index 0bea37254..e7ea34046 100644 --- a/python/things/dungeon/wall_floor.py +++ b/python/things/dungeon/wall_floor.py @@ -12,6 +12,7 @@ def tp_init(name, tiles=[], left1_tiles=[], bot3_tiles=[]): my.gfx_pixelart_shown_in_bg(self, True) my.is_cursor_can_hover_over(self, True) my.is_floor(self, True) + my.is_only_one_per_tile(self, True) my.text_a_or_an(self, "the") my.text_description_short(self, "The unwashed dungeon foundation.") my.tick_prio(self, my.MAP_TICK_PRIO_NORMAL) diff --git a/python/things/dungeon/wall_sewer.py b/python/things/dungeon/wall_sewer.py index 23cbe8b5d..349a9658b 100644 --- a/python/things/dungeon/wall_sewer.py +++ b/python/things/dungeon/wall_sewer.py @@ -52,6 +52,7 @@ def tp_init( my.is_obs_spawn(self, True) my.is_obs_throwing(self, True) my.is_obs_wall_or_door(self, True) + my.is_only_one_per_tile(self, True) my.is_sewer_wall(self, True) my.is_stone(self, True) my.is_wall(self, True) diff --git a/python/things/dungeon/water.py b/python/things/dungeon/water.py index 5da08132d..9b25d1a10 100644 --- a/python/things/dungeon/water.py +++ b/python/things/dungeon/water.py @@ -27,6 +27,7 @@ def tp_init(name, text_long_name, tiles=[]): my.is_hazard(self, True) my.is_interesting(self, True) my.is_obs_ai(self, True) + my.is_only_one_per_tile(self, True) my.is_shallow_water(self, True) my.text_a_or_an(self, "the") my.text_description_short(self, "Some shallow water.") diff --git a/python/things/dungeon/webball.py b/python/things/dungeon/webball.py index 3f0fb2787..1a6607184 100644 --- a/python/things/dungeon/webball.py +++ b/python/things/dungeon/webball.py @@ -26,6 +26,7 @@ def tp_init(name, tiles=[]): my.is_hittable(self, True) my.is_interesting(self, True) # So robot can see and break out my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.is_spiderweb(self, True) my.is_sticky(self, True) my.normal_placement_rules(self, False) diff --git a/python/things/dungeon/wet_grass.py b/python/things/dungeon/wet_grass.py index a4ef4aa69..2b698c425 100644 --- a/python/things/dungeon/wet_grass.py +++ b/python/things/dungeon/wet_grass.py @@ -24,6 +24,7 @@ def tp_init(name, tiles=[]): my.is_described_when_hovering_over(self, True) my.is_grass(self, True) my.is_interesting(self, True) + my.is_only_one_per_tile(self, True) my.is_wet_grass(self, True) my.nutrition_dice(self, "1d5") my.temperature_max(self, 50) diff --git a/python/things/dungeon/wet_grass_trampled.py b/python/things/dungeon/wet_grass_trampled.py index a5f8e6642..cdad7c446 100644 --- a/python/things/dungeon/wet_grass_trampled.py +++ b/python/things/dungeon/wet_grass_trampled.py @@ -21,6 +21,7 @@ def tp_init(name, tiles=[]): my.is_described_when_hovering_over(self, True) my.is_grass(self, True) my.is_interesting(self, True) + my.is_only_one_per_tile(self, True) my.is_wet_grass(self, True) my.is_wet_grass_trampled(self, True) my.nutrition_dice(self, "1d4") diff --git a/python/things/effects/attack_green.py b/python/things/effects/attack_green.py index 4292a2f56..d95a04c7a 100644 --- a/python/things/effects/attack_green.py +++ b/python/things/effects/attack_green.py @@ -15,6 +15,7 @@ def tp_init(name, text_long_name): my.gfx_pixelart_show_outlined(self, True) my.is_loggable(self, True) my.is_moveable(self, True) + my.is_only_one_per_tile(self, True) my.is_removable_if_out_of_slots(self, True) my.text_a_or_an(self, "a") my.tick_prio(self, my.MAP_TICK_PRIO_VERY_HIGH) diff --git a/python/things/effects/attack_major_green.py b/python/things/effects/attack_major_green.py index 9f46456b4..b84a9e99f 100644 --- a/python/things/effects/attack_major_green.py +++ b/python/things/effects/attack_major_green.py @@ -15,6 +15,7 @@ def tp_init(name, text_long_name): my.gfx_pixelart_show_outlined(self, True) my.is_loggable(self, True) my.is_moveable(self, True) + my.is_only_one_per_tile(self, True) my.is_removable_if_out_of_slots(self, True) my.text_a_or_an(self, "a") my.tick_prio(self, my.MAP_TICK_PRIO_VERY_HIGH) diff --git a/python/things/effects/attack_major_orange.py b/python/things/effects/attack_major_orange.py index 1c29e281a..db477d858 100644 --- a/python/things/effects/attack_major_orange.py +++ b/python/things/effects/attack_major_orange.py @@ -15,6 +15,7 @@ def tp_init(name, text_long_name): my.gfx_pixelart_show_outlined(self, True) my.is_loggable(self, True) my.is_moveable(self, True) + my.is_only_one_per_tile(self, True) my.is_removable_if_out_of_slots(self, True) my.text_a_or_an(self, "a") my.tick_prio(self, my.MAP_TICK_PRIO_VERY_HIGH) diff --git a/python/things/effects/attack_major_red.py b/python/things/effects/attack_major_red.py index 54d47e494..1e5834577 100644 --- a/python/things/effects/attack_major_red.py +++ b/python/things/effects/attack_major_red.py @@ -15,6 +15,7 @@ def tp_init(name, text_long_name): my.gfx_pixelart_show_outlined(self, True) my.is_loggable(self, True) my.is_moveable(self, True) + my.is_only_one_per_tile(self, True) my.is_removable_if_out_of_slots(self, True) my.text_a_or_an(self, "a") my.tick_prio(self, my.MAP_TICK_PRIO_VERY_HIGH) diff --git a/python/things/effects/attack_orange.py b/python/things/effects/attack_orange.py index 422be47fc..def12e8bd 100644 --- a/python/things/effects/attack_orange.py +++ b/python/things/effects/attack_orange.py @@ -15,6 +15,7 @@ def tp_init(name, text_long_name): my.gfx_pixelart_show_outlined(self, True) my.is_loggable(self, True) my.is_moveable(self, True) + my.is_only_one_per_tile(self, True) my.is_removable_if_out_of_slots(self, True) my.text_a_or_an(self, "a") my.tick_prio(self, my.MAP_TICK_PRIO_VERY_HIGH) diff --git a/python/things/effects/attack_punch.py b/python/things/effects/attack_punch.py index 3d0887281..5342dcbb6 100644 --- a/python/things/effects/attack_punch.py +++ b/python/things/effects/attack_punch.py @@ -17,6 +17,7 @@ def init1(name, text_long_name): my.gfx_pixelart_show_outlined(self, True) my.is_loggable(self, True) my.is_moveable(self, True) + my.is_only_one_per_tile(self, True) my.is_removable_if_out_of_slots(self, True) my.text_a_or_an(self, "a") my.text_description_short(self, "Punch out.") diff --git a/python/things/effects/attack_red.py b/python/things/effects/attack_red.py index fae840159..9cad5c749 100644 --- a/python/things/effects/attack_red.py +++ b/python/things/effects/attack_red.py @@ -15,6 +15,7 @@ def tp_init(name, text_long_name): my.gfx_pixelart_show_outlined(self, True) my.is_loggable(self, True) my.is_moveable(self, True) + my.is_only_one_per_tile(self, True) my.is_removable_if_out_of_slots(self, True) my.text_a_or_an(self, "a") my.tick_prio(self, my.MAP_TICK_PRIO_VERY_HIGH) diff --git a/python/things/effects/explosion_cold.py b/python/things/effects/explosion_cold.py index 7af5e252e..347221467 100644 --- a/python/things/effects/explosion_cold.py +++ b/python/things/effects/explosion_cold.py @@ -18,6 +18,7 @@ def tp_init(name, text_long_name, text_short_name): my.is_explosion(self, True) my.is_floating(self, True) my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.noise_on_born(self, 70) my.on_born_do(self, "me.on_born()") my.text_hits(self, "blasts") diff --git a/python/things/effects/explosion_destroy_floor.py b/python/things/effects/explosion_destroy_floor.py index 963c8953c..4636d62bf 100644 --- a/python/things/effects/explosion_destroy_floor.py +++ b/python/things/effects/explosion_destroy_floor.py @@ -22,6 +22,7 @@ def tp_init(name, text_long_name, text_short_name): my.is_explosion(self, True) my.is_floating(self, True) my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.noise_on_born(self, 100) my.on_born_do(self, "me.on_born()") my.text_hits(self, "blasts") diff --git a/python/things/effects/explosion_fire.py b/python/things/effects/explosion_fire.py index 31e1699d7..b2fa1af52 100644 --- a/python/things/effects/explosion_fire.py +++ b/python/things/effects/explosion_fire.py @@ -18,6 +18,7 @@ def tp_init(name, text_long_name, text_short_name): my.is_explosion(self, True) my.is_floating(self, True) my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.noise_on_born(self, 70) my.on_born_do(self, "me.on_born()") my.text_hits(self, "blasts") diff --git a/python/things/effects/explosion_major.py b/python/things/effects/explosion_major.py index a3fe40b73..baef67fd9 100644 --- a/python/things/effects/explosion_major.py +++ b/python/things/effects/explosion_major.py @@ -43,6 +43,7 @@ def tp_init(name, text_long_name, text_short_name): my.is_fire(self, True) my.is_floating(self, True) my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.light_color(self, "yellow") my.light_dist(self, 4) my.noise_on_born(self, 100) diff --git a/python/things/effects/ghost_explosion.py b/python/things/effects/ghost_explosion.py index a9d532b46..fa14e03bf 100644 --- a/python/things/effects/ghost_explosion.py +++ b/python/things/effects/ghost_explosion.py @@ -15,6 +15,7 @@ def tp_init(name): my.is_explosion(self, True) my.is_floating(self, True) my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.noise_on_born(self, 21) my.tick_prio(self, my.MAP_TICK_PRIO_VERY_HIGH) my.z_depth(self, my.MAP_DEPTH_OBJ) diff --git a/python/things/effects/green_splatter.py b/python/things/effects/green_splatter.py index 323409c84..3f8d0085e 100644 --- a/python/things/effects/green_splatter.py +++ b/python/things/effects/green_splatter.py @@ -15,6 +15,7 @@ def tp_init(name, text_long_name): my.gfx_pixelart_show_outlined(self, True) my.is_green_splatter(self, True) my.is_moveable(self, True) + my.is_only_one_per_tile(self, True) my.is_removable_if_out_of_slots(self, True) my.is_splatter(self, True) my.is_tmp_thing(self, True) diff --git a/python/things/effects/magical_effect.py b/python/things/effects/magical_effect.py index bd27942ca..ec03f33a4 100644 --- a/python/things/effects/magical_effect.py +++ b/python/things/effects/magical_effect.py @@ -19,6 +19,7 @@ def tp_init(name): my.is_explosion(self, True) my.is_floating(self, True) my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.noise_on_born(self, 50) my.on_born_do(self, "me.on_born()") my.tick_prio(self, my.MAP_TICK_PRIO_VERY_HIGH) diff --git a/python/things/effects/mob_explosion.py b/python/things/effects/mob_explosion.py index 7b2ca1c22..5adefb9cd 100644 --- a/python/things/effects/mob_explosion.py +++ b/python/things/effects/mob_explosion.py @@ -18,6 +18,7 @@ def tp_init(name): my.is_explosion(self, True) my.is_floating(self, True) my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.noise_on_born(self, 50) my.on_born_do(self, "me.on_born()") my.tick_prio(self, my.MAP_TICK_PRIO_VERY_HIGH) diff --git a/python/things/effects/red_splatter.py b/python/things/effects/red_splatter.py index deabd7db4..d98ddf247 100644 --- a/python/things/effects/red_splatter.py +++ b/python/things/effects/red_splatter.py @@ -13,6 +13,7 @@ def tp_init(name, text_long_name): my.gfx_pixelart_show_outlined(self, True) my.is_able_to_fall(self, True) my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.is_red_splatter(self, True) my.is_removable_if_out_of_slots(self, True) my.is_splatter(self, True) diff --git a/python/things/effects/teleport_in.py b/python/things/effects/teleport_in.py index d05a5aa85..a3cbf2eff 100644 --- a/python/things/effects/teleport_in.py +++ b/python/things/effects/teleport_in.py @@ -19,6 +19,7 @@ def tp_init(name): my.gfx_pixelart_shadow_short(self, True) my.is_floating(self, True) my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.light_color(self, "cyan") my.light_dist(self, 2) my.noise_on_born(self, 100) diff --git a/python/things/effects/teleport_out.py b/python/things/effects/teleport_out.py index 12bf929f1..82cf8cd43 100644 --- a/python/things/effects/teleport_out.py +++ b/python/things/effects/teleport_out.py @@ -19,6 +19,7 @@ def tp_init(name): my.gfx_pixelart_shadow_short(self, True) my.is_floating(self, True) my.is_loggable(self, True) + my.is_only_one_per_tile(self, True) my.light_color(self, "cyan") my.light_dist(self, 2) my.noise_on_born(self, 100) diff --git a/src/level_biome_chasms.cpp b/src/level_biome_chasms.cpp index a46c95a76..efbe72ad5 100644 --- a/src/level_biome_chasms.cpp +++ b/src/level_biome_chasms.cpp @@ -444,7 +444,11 @@ void Level::create_biome_chasms_place_floors(Dungeonp d, std::string what, int f cnt++; } - auto t = thing_new(new_thing, point(X, Y)); + auto t = thing_new(new_thing, point(X, Y)); + if (! t) { + continue; + } + auto tile = tile_find(tilename); if (unlikely(! tile)) { ERR("Floor tile %s not found", tilename.c_str()); diff --git a/src/level_biome_common.cpp b/src/level_biome_common.cpp index 7f60ee8f2..9402ab1ce 100644 --- a/src/level_biome_common.cpp +++ b/src/level_biome_common.cpp @@ -538,6 +538,10 @@ void Level::place_random_treasure(Dungeonp d) // Be nice and enchant this lost treasure. // auto t = thing_new(tp->name(), point(x, y)); + if (! t) { + continue; + } + if (pcg_random_range(0, 100) < 20) { t->enchant_randomly(); } diff --git a/src/level_biome_dungeon.cpp b/src/level_biome_dungeon.cpp index 99b9533a3..62ffbba81 100644 --- a/src/level_biome_dungeon.cpp +++ b/src/level_biome_dungeon.cpp @@ -806,7 +806,11 @@ void Level::create_biome_dungeon_place_walls(Dungeonp d, Tpp tp, int variant, in cnt++; } - auto t = thing_new(what, point(X, Y)); + auto t = thing_new(what, point(X, Y)); + if (! t) { + continue; + } + auto tile = tile_find(tilename); if (unlikely(! tile)) { ERR("Wall tile %s not found", tilename.c_str()); @@ -890,7 +894,11 @@ void Level::create_biome_dungeon_place_rocks(Dungeonp d, int variant, int block_ cnt++; } - auto t = thing_new(what, point(X, Y)); + auto t = thing_new(what, point(X, Y)); + if (! t) { + continue; + } + auto tile = tile_find(tilename); if (unlikely(! tile)) { ERR("Rock tile %s not found", tilename.c_str()); @@ -1006,7 +1014,10 @@ void Level::create_biome_dungeon_place_floors(Dungeonp d, std::string what, int cnt++; } - auto t = thing_new(new_thing, point(X, Y)); + auto t = thing_new(new_thing, point(X, Y)); + if (! t) { + continue; + } auto tile = tile_find(tilename); if (unlikely(! tile)) { ERR("Floor tile %s not found", tilename.c_str()); diff --git a/src/level_biome_flooded.cpp b/src/level_biome_flooded.cpp index 3f73ffad0..e7c7823cc 100644 --- a/src/level_biome_flooded.cpp +++ b/src/level_biome_flooded.cpp @@ -598,7 +598,11 @@ void Level::create_biome_flooded_place_walls(Dungeonp d, Tpp tp, int variant, in cnt++; } - auto t = thing_new(what, point(X, Y)); + auto t = thing_new(what, point(X, Y)); + if (! t) { + continue; + } + auto tile = tile_find(tilename); if (unlikely(! tile)) { ERR("Wall tile %s not found", tilename.c_str()); @@ -682,7 +686,11 @@ void Level::create_biome_flooded_place_rocks(Dungeonp d, int variant, int block_ cnt++; } - auto t = thing_new(what, point(X, Y)); + auto t = thing_new(what, point(X, Y)); + if (! t) { + continue; + } + auto tile = tile_find(tilename); if (unlikely(! tile)) { ERR("Rock tile %s not found", tilename.c_str()); @@ -798,7 +806,11 @@ void Level::create_biome_flooded_place_floors(Dungeonp d, std::string what, int cnt++; } - auto t = thing_new(new_thing, point(X, Y)); + auto t = thing_new(new_thing, point(X, Y)); + if (! t) { + continue; + } + auto tile = tile_find(tilename); if (unlikely(! tile)) { ERR("Floor tile %s not found", tilename.c_str()); diff --git a/src/level_biome_ice.cpp b/src/level_biome_ice.cpp index 77d7dfbbe..363d9ecfa 100644 --- a/src/level_biome_ice.cpp +++ b/src/level_biome_ice.cpp @@ -455,7 +455,11 @@ void Level::create_biome_ice_place_rocks(Dungeonp d, int variant, int block_widt cnt++; } - auto t = thing_new(what, point(X, Y)); + auto t = thing_new(what, point(X, Y)); + if (! t) { + continue; + } + auto tile = tile_find(tilename); if (unlikely(! tile)) { ERR("Rock tile %s not found", tilename.c_str()); @@ -755,7 +759,11 @@ void Level::create_biome_ice_place_floors(Dungeonp d, std::string what, int floo cnt++; } - auto t = thing_new(new_thing, point(X, Y)); + auto t = thing_new(new_thing, point(X, Y)); + if (! t) { + continue; + } + auto tile = tile_find(tilename); if (unlikely(! tile)) { ERR("Floor tile %s not found", tilename.c_str()); diff --git a/src/level_biome_lava.cpp b/src/level_biome_lava.cpp index 5d191cea1..633d8b129 100644 --- a/src/level_biome_lava.cpp +++ b/src/level_biome_lava.cpp @@ -471,14 +471,20 @@ void Level::create_biome_lava_place_rocks(Dungeonp d, int variant, int block_wid cnt++; } - auto t = thing_new(what, point(X, Y)); - auto tile = tile_find(tilename); - if (unlikely(! tile)) { - ERR("Rock tile %s not found", tilename.c_str()); - return; + auto t = thing_new(what, point(X, Y)); + if (! t) { + continue; } - t->tile_curr = tile->global_index; + if (t) { + auto tile = tile_find(tilename); + if (unlikely(! tile)) { + ERR("Rock tile %s not found", tilename.c_str()); + return; + } + + t->tile_curr = tile->global_index; + } } } } @@ -726,7 +732,11 @@ void Level::create_biome_lava_place_floors(Dungeonp d, std::string what, int flo cnt++; } - auto t = thing_new(new_thing, point(X, Y)); + auto t = thing_new(new_thing, point(X, Y)); + if (! t) { + continue; + } + auto tile = tile_find(tilename); if (unlikely(! tile)) { ERR("Floor tile %s not found", tilename.c_str()); diff --git a/src/level_biome_sewer.cpp b/src/level_biome_sewer.cpp index f3c467e2f..c5072dd52 100644 --- a/src/level_biome_sewer.cpp +++ b/src/level_biome_sewer.cpp @@ -446,7 +446,11 @@ void Level::create_biome_sewer_place_walls(int variant, int block_width, int blo cnt++; } - auto t = thing_new(what, point(X, Y)); + auto t = thing_new(what, point(X, Y)); + if (! t) { + continue; + } + auto tile = tile_find(tilename); if (unlikely(! tile)) { ERR("wall tile %s not found", tilename.c_str()); diff --git a/src/level_biome_swamp.cpp b/src/level_biome_swamp.cpp index 5ef255a44..b579d4ded 100644 --- a/src/level_biome_swamp.cpp +++ b/src/level_biome_swamp.cpp @@ -373,7 +373,11 @@ void Level::create_biome_swamp_place_rocks(Dungeonp d, int variant, int block_wi cnt++; } - auto t = thing_new(what, point(X, Y)); + auto t = thing_new(what, point(X, Y)); + if (! t) { + continue; + } + auto tile = tile_find(tilename); if (unlikely(! tile)) { ERR("Rock tile %s not found", tilename.c_str()); diff --git a/src/level_create.cpp b/src/level_create.cpp index c1d9044b7..e50cf1918 100644 --- a/src/level_create.cpp +++ b/src/level_create.cpp @@ -114,7 +114,9 @@ void Level::create(point3d world_at, point grid_at, uint32_t seed, int difficult } else { cursor = thing_new("cursor", player->curr_at); } - cursor->hide(); + if (cursor) { + cursor->hide(); + } is_map_mini_valid = true; } diff --git a/src/level_map_update.cpp b/src/level_map_update.cpp index 0a94554e2..966260f06 100644 --- a/src/level_map_update.cpp +++ b/src/level_map_update.cpp @@ -73,8 +73,10 @@ void Level::update_water_next_to_lava(bool &changed) if (! is_starting) { if (! is_steam(x, y)) { auto steam = thing_new("steam", point(x, y)); - changed = true; - steam->lifespan_set(pcg_random_range(1, 10)); + if (steam) { + changed = true; + steam->lifespan_set(pcg_random_range(1, 10)); + } } } } @@ -101,8 +103,10 @@ void Level::update_water_next_to_lava(bool &changed) if (! is_starting) { if (! is_steam(x, y)) { auto steam = thing_new("steam", point(x, y)); - changed = true; - steam->lifespan_set(pcg_random_range(1, 10)); + if (steam) { + changed = true; + steam->lifespan_set(pcg_random_range(1, 10)); + } } } } diff --git a/src/my_py_thing.hpp b/src/my_py_thing.hpp index bde9543ed..43c60545f 100644 --- a/src/my_py_thing.hpp +++ b/src/my_py_thing.hpp @@ -451,6 +451,7 @@ PyObject *thing_is_obs_wall_or_door(PyObject *obj, PyObject *args, PyObject *key PyObject *thing_is_obs_when_dead(PyObject *obj, PyObject *args, PyObject *keywds); PyObject *thing_is_ogre(PyObject *obj, PyObject *args, PyObject *keywds); PyObject *thing_is_on_fire(PyObject *obj, PyObject *args, PyObject *keywds); +PyObject *thing_is_only_one_per_tile(PyObject *obj, PyObject *args, PyObject *keywds); PyObject *thing_is_openable(PyObject *obj, PyObject *args, PyObject *keywds); PyObject *thing_is_organic(PyObject *obj, PyObject *args, PyObject *keywds); PyObject *thing_is_pack(PyObject *obj, PyObject *args, PyObject *keywds); @@ -562,7 +563,6 @@ PyObject *thing_is_unused_flag137(PyObject *obj, PyObject *args, PyObject *keywd PyObject *thing_is_unused_flag138(PyObject *obj, PyObject *args, PyObject *keywds); PyObject *thing_is_unused_flag139(PyObject *obj, PyObject *args, PyObject *keywds); PyObject *thing_is_unused_flag13(PyObject *obj, PyObject *args, PyObject *keywds); -PyObject *thing_is_unused_flag140(PyObject *obj, PyObject *args, PyObject *keywds); PyObject *thing_is_unused_flag142(PyObject *obj, PyObject *args, PyObject *keywds); PyObject *thing_is_unused_flag14(PyObject *obj, PyObject *args, PyObject *keywds); PyObject *thing_is_unused_flag15(PyObject *obj, PyObject *args, PyObject *keywds); diff --git a/src/my_py_tp.hpp b/src/my_py_tp.hpp index 51b0c21c6..a9d0e55d6 100644 --- a/src/my_py_tp.hpp +++ b/src/my_py_tp.hpp @@ -536,6 +536,7 @@ TP_SET_PROTO(is_obs_throwing) TP_SET_PROTO(is_obs_wall_or_door) TP_SET_PROTO(is_obs_when_dead) TP_SET_PROTO(is_ogre) +TP_SET_PROTO(is_only_one_per_tile) TP_SET_PROTO(is_openable) TP_SET_PROTO(is_organic) TP_SET_PROTO(is_pillar) @@ -652,7 +653,6 @@ TP_SET_PROTO(is_unused_flag137) TP_SET_PROTO(is_unused_flag138) TP_SET_PROTO(is_unused_flag139) TP_SET_PROTO(is_unused_flag14) -TP_SET_PROTO(is_unused_flag140) TP_SET_PROTO(is_unused_flag142) TP_SET_PROTO(is_unused_flag15) TP_SET_PROTO(is_unused_flag16) diff --git a/src/my_thing.hpp b/src/my_thing.hpp index afbf51adb..e4e0d9273 100644 --- a/src/my_thing.hpp +++ b/src/my_thing.hpp @@ -1629,6 +1629,7 @@ typedef class Thing_ int is_obs_wall_or_door(void); int is_obs_when_dead(void); int is_ogre(void); + int is_only_one_per_tile(void); int is_openable(void); int is_organic(void); int is_pillar(void); @@ -1740,7 +1741,6 @@ typedef class Thing_ int is_unused_flag138(void); int is_unused_flag139(void); int is_unused_flag13(void); - int is_unused_flag140(void); int is_unused_flag142(void); int is_unused_flag14(void); int is_unused_flag15(void); diff --git a/src/my_thing_template.hpp b/src/my_thing_template.hpp index 741080067..d10061492 100644 --- a/src/my_thing_template.hpp +++ b/src/my_thing_template.hpp @@ -553,6 +553,7 @@ class Tp int _is_obs_wall_or_door {}; int _is_obs_when_dead {}; int _is_ogre {}; + int _is_only_one_per_tile {}; int _is_openable {}; int _is_organic {}; int _is_pillar {}; @@ -666,7 +667,6 @@ class Tp int _is_unused_flag138 {}; int _is_unused_flag139 {}; int _is_unused_flag14 {}; - int _is_unused_flag140 {}; int _is_unused_flag142 {}; int _is_unused_flag15 {}; int _is_unused_flag16 {}; @@ -1863,6 +1863,7 @@ class Tp int is_obs_wall_or_door(void) const; int is_obs_when_dead(void) const; int is_ogre(void) const; + int is_only_one_per_tile(void) const; int is_openable(void) const; int is_organic(void) const; int is_pillar(void) const; @@ -1974,7 +1975,6 @@ class Tp int is_unused_flag138(void) const; int is_unused_flag139(void) const; int is_unused_flag13(void) const; - int is_unused_flag140(void) const; int is_unused_flag142(void) const; int is_unused_flag14(void) const; int is_unused_flag15(void) const; @@ -2612,6 +2612,7 @@ class Tp void is_obs_wall_or_door_set(int v); void is_obs_when_dead_set(int v); void is_ogre_set(int v); + void is_only_one_per_tile_set(int v); void is_openable_set(int v); void is_organic_set(int v); void is_pillar_set(int v); @@ -2723,7 +2724,6 @@ class Tp void is_unused_flag138_set(int v); void is_unused_flag139_set(int v); void is_unused_flag13_set(int v); - void is_unused_flag140_set(int v); void is_unused_flag142_set(int v); void is_unused_flag14_set(int v); void is_unused_flag15_set(int v); diff --git a/src/py_thing_get.cpp b/src/py_thing_get.cpp index 3f9d29765..7205d43b8 100644 --- a/src/py_thing_get.cpp +++ b/src/py_thing_get.cpp @@ -472,6 +472,7 @@ THING_BODY_GET_BOOL(thing_is_obs_wall_or_door, is_obs_wall_or_door) THING_BODY_GET_BOOL(thing_is_obs_when_dead, is_obs_when_dead) THING_BODY_GET_BOOL(thing_is_ogre, is_ogre) THING_BODY_GET_BOOL(thing_is_on_fire, is_on_fire) +THING_BODY_GET_BOOL(thing_is_only_one_per_tile, is_only_one_per_tile) THING_BODY_GET_BOOL(thing_is_openable, is_openable) THING_BODY_GET_BOOL(thing_is_organic, is_organic) THING_BODY_GET_BOOL(thing_is_pack, is_monst_pack) @@ -583,7 +584,6 @@ THING_BODY_GET_BOOL(thing_is_unused_flag137, is_unused_flag137) THING_BODY_GET_BOOL(thing_is_unused_flag138, is_unused_flag138) THING_BODY_GET_BOOL(thing_is_unused_flag139, is_unused_flag139) THING_BODY_GET_BOOL(thing_is_unused_flag13, is_unused_flag13) -THING_BODY_GET_BOOL(thing_is_unused_flag140, is_unused_flag140) THING_BODY_GET_BOOL(thing_is_unused_flag142, is_unused_flag142) THING_BODY_GET_BOOL(thing_is_unused_flag14, is_unused_flag14) THING_BODY_GET_BOOL(thing_is_unused_flag15, is_unused_flag15) diff --git a/src/py_tp.cpp b/src/py_tp.cpp index 2b0e3daa2..ba6fdb2f1 100644 --- a/src/py_tp.cpp +++ b/src/py_tp.cpp @@ -1233,6 +1233,7 @@ TP_BODY_SET_INT(is_obs_throwing) TP_BODY_SET_INT(is_obs_wall_or_door) TP_BODY_SET_INT(is_obs_when_dead) TP_BODY_SET_INT(is_ogre) +TP_BODY_SET_INT(is_only_one_per_tile) TP_BODY_SET_INT(is_openable) TP_BODY_SET_INT(is_organic) TP_BODY_SET_INT(is_pillar) @@ -1346,7 +1347,6 @@ TP_BODY_SET_INT(is_unused_flag137) TP_BODY_SET_INT(is_unused_flag138) TP_BODY_SET_INT(is_unused_flag139) TP_BODY_SET_INT(is_unused_flag14) -TP_BODY_SET_INT(is_unused_flag140) TP_BODY_SET_INT(is_unused_flag142) TP_BODY_SET_INT(is_unused_flag15) TP_BODY_SET_INT(is_unused_flag16) diff --git a/src/python_methods.cpp b/src/python_methods.cpp index 55a60f8d5..1014eef9e 100644 --- a/src/python_methods.cpp +++ b/src/python_methods.cpp @@ -704,6 +704,7 @@ static PyMethodDef python_c_METHODS[] = { MY_ADD_PYTHON_FUNCTION(thing_is_obs_when_dead), MY_ADD_PYTHON_FUNCTION(thing_is_ogre), MY_ADD_PYTHON_FUNCTION(thing_is_on_fire), + MY_ADD_PYTHON_FUNCTION(thing_is_only_one_per_tile), MY_ADD_PYTHON_FUNCTION(thing_is_openable), MY_ADD_PYTHON_FUNCTION(thing_is_organic), MY_ADD_PYTHON_FUNCTION(thing_is_pack), @@ -817,7 +818,6 @@ static PyMethodDef python_c_METHODS[] = { MY_ADD_PYTHON_FUNCTION(thing_is_unused_flag138), MY_ADD_PYTHON_FUNCTION(thing_is_unused_flag139), MY_ADD_PYTHON_FUNCTION(thing_is_unused_flag14), - MY_ADD_PYTHON_FUNCTION(thing_is_unused_flag140), MY_ADD_PYTHON_FUNCTION(thing_is_unused_flag142), MY_ADD_PYTHON_FUNCTION(thing_is_unused_flag15), MY_ADD_PYTHON_FUNCTION(thing_is_unused_flag16), @@ -1542,6 +1542,7 @@ static PyMethodDef python_c_METHODS[] = { MY_ADD_PYTHON_TP_FUNCTION(is_obs_wall_or_door), MY_ADD_PYTHON_TP_FUNCTION(is_obs_when_dead), MY_ADD_PYTHON_TP_FUNCTION(is_ogre), + MY_ADD_PYTHON_TP_FUNCTION(is_only_one_per_tile), MY_ADD_PYTHON_TP_FUNCTION(is_openable), MY_ADD_PYTHON_TP_FUNCTION(is_organic), MY_ADD_PYTHON_TP_FUNCTION(is_pillar), @@ -1655,7 +1656,6 @@ static PyMethodDef python_c_METHODS[] = { MY_ADD_PYTHON_TP_FUNCTION(is_unused_flag138), MY_ADD_PYTHON_TP_FUNCTION(is_unused_flag139), MY_ADD_PYTHON_TP_FUNCTION(is_unused_flag14), - MY_ADD_PYTHON_TP_FUNCTION(is_unused_flag140), MY_ADD_PYTHON_TP_FUNCTION(is_unused_flag142), MY_ADD_PYTHON_TP_FUNCTION(is_unused_flag15), MY_ADD_PYTHON_TP_FUNCTION(is_unused_flag16), diff --git a/src/thing_api.cpp b/src/thing_api.cpp index e50afe112..637f9a294 100644 --- a/src/thing_api.cpp +++ b/src/thing_api.cpp @@ -895,10 +895,10 @@ int Thing::is_unused_flag139(void) TRACE_NO_INDENT(); return (tp()->is_unused_flag139()); } -int Thing::is_unused_flag140(void) +int Thing::is_only_one_per_tile(void) { TRACE_NO_INDENT(); - return (tp()->is_unused_flag140()); + return (tp()->is_only_one_per_tile()); } int Thing::is_unused_flag142(void) { diff --git a/src/thing_init.cpp b/src/thing_init.cpp index 07ecfdb39..dbb595c89 100644 --- a/src/thing_init.cpp +++ b/src/thing_init.cpp @@ -16,6 +16,7 @@ Thingp Level::thing_new(Tpp tp, const point at, Thingp owner) err("No tp provided for thing creation"); return nullptr; } + return thing_new(tp->name(), at, owner); } @@ -26,6 +27,25 @@ Thingp Level::thing_new(const std::string &tp_name, Thingp owner) Thingp Level::thing_new(const std::string &name, const point at, Thingp owner) { + auto tp = tp_find(name); + if (! tp) { + return nullptr; + } + + // + // Ensure things like chasms don't pile up on the same tile. + // + if (tp->is_only_one_per_tile()) { + FOR_ALL_THINGS_AT_DEPTH(this, o, at.x, at.y, tp->z_depth) + { + if (o->tp() == tp) { + dbg("Do not create %s as already exist at %s", name.c_str(), at.to_string().c_str()); + return nullptr; + } + } + FOR_ALL_THINGS_END() + } + auto t = new class Thing_(); t->init(this, name, at, owner); return t; diff --git a/src/thing_match.cpp b/src/thing_match.cpp index 327e2d99b..25a75a24f 100644 --- a/src/thing_match.cpp +++ b/src/thing_match.cpp @@ -355,6 +355,7 @@ bool Tp::matches(const std::string &what) if (is_obs_wall_or_door() && (what == "is_obs_wall_or_door")) { return true; } if (is_obs_when_dead() && (what == "is_obs_when_dead")) { return true; } if (is_ogre() && (what == "is_ogre")) { return true; } + if (is_only_one_per_tile() && (what == "is_only_one_per_tile")) { return true; } if (is_openable() && (what == "is_openable")) { return true; } if (is_organic() && (what == "is_organic")) { return true; } if (is_pillar() && (what == "is_pillar")) { return true; } @@ -462,7 +463,6 @@ bool Tp::matches(const std::string &what) if (is_unused_flag138() && (what == "is_unused_flag138")) { return true; } if (is_unused_flag139() && (what == "is_unused_flag139")) { return true; } if (is_unused_flag13() && (what == "is_unused_flag13")) { return true; } - if (is_unused_flag140() && (what == "is_unused_flag140")) { return true; } if (is_unused_flag142() && (what == "is_unused_flag142")) { return true; } if (is_unused_flag14() && (what == "is_unused_flag14")) { return true; } if (is_unused_flag15() && (what == "is_unused_flag15")) { return true; } @@ -958,6 +958,7 @@ bool Thing::matches(const std::string &what) if (is_obs_wall_or_door() && (what == "is_obs_wall_or_door")) { return true; } if (is_obs_when_dead() && (what == "is_obs_when_dead")) { return true; } if (is_ogre() && (what == "is_ogre")) { return true; } + if (is_only_one_per_tile() && (what == "is_only_one_per_tile")) { return true; } if (is_openable() && (what == "is_openable")) { return true; } if (is_organic() && (what == "is_organic")) { return true; } if (is_pillar() && (what == "is_pillar")) { return true; } @@ -1066,7 +1067,6 @@ bool Thing::matches(const std::string &what) if (is_unused_flag138() && (what == "is_unused_flag138")) { return true; } if (is_unused_flag139() && (what == "is_unused_flag139")) { return true; } if (is_unused_flag13() && (what == "is_unused_flag13")) { return true; } - if (is_unused_flag140() && (what == "is_unused_flag140")) { return true; } if (is_unused_flag142() && (what == "is_unused_flag142")) { return true; } if (is_unused_flag14() && (what == "is_unused_flag14")) { return true; } if (is_unused_flag15() && (what == "is_unused_flag15")) { return true; } @@ -1551,6 +1551,7 @@ std::function< int(Thingp) > Thing::matches_to_func(const std::string &what) if (what == "is_obs_wall_or_door") { return &Thing::is_obs_wall_or_door; } if (what == "is_obs_when_dead") { return &Thing::is_obs_when_dead; } if (what == "is_ogre") { return &Thing::is_ogre; } + if (what == "is_only_one_per_tile") { return &Thing::is_only_one_per_tile; } if (what == "is_openable") { return &Thing::is_openable; } if (what == "is_organic") { return &Thing::is_organic; } if (what == "is_pillar") { return &Thing::is_pillar; } @@ -1658,7 +1659,6 @@ std::function< int(Thingp) > Thing::matches_to_func(const std::string &what) if (what == "is_unused_flag138") { return &Thing::is_unused_flag138; } if (what == "is_unused_flag139") { return &Thing::is_unused_flag139; } if (what == "is_unused_flag13") { return &Thing::is_unused_flag13; } - if (what == "is_unused_flag140") { return &Thing::is_unused_flag140; } if (what == "is_unused_flag142") { return &Thing::is_unused_flag142; } if (what == "is_unused_flag14") { return &Thing::is_unused_flag14; } if (what == "is_unused_flag15") { return &Thing::is_unused_flag15; } diff --git a/src/thing_template_fn.cpp b/src/thing_template_fn.cpp index 1da0ecd7a..6e65103d0 100644 --- a/src/thing_template_fn.cpp +++ b/src/thing_template_fn.cpp @@ -638,6 +638,7 @@ int Tp::is_obs_throwing(void) const { return _is_obs_throwing; } int Tp::is_obs_wall_or_door(void) const { return _is_obs_wall_or_door; } int Tp::is_obs_when_dead(void) const { return _is_obs_when_dead; } int Tp::is_ogre(void) const { return _is_ogre; } +int Tp::is_only_one_per_tile(void) const { return _is_only_one_per_tile; } int Tp::is_openable(void) const { return _is_openable; } int Tp::is_organic(void) const { return _is_organic; } int Tp::is_pillar(void) const { return _is_pillar; } @@ -749,7 +750,6 @@ int Tp::is_unused_flag137(void) const { return _is_unused_flag137; } int Tp::is_unused_flag138(void) const { return _is_unused_flag138; } int Tp::is_unused_flag139(void) const { return _is_unused_flag139; } int Tp::is_unused_flag13(void) const { return _is_unused_flag13; } -int Tp::is_unused_flag140(void) const { return _is_unused_flag140; } int Tp::is_unused_flag142(void) const { return _is_unused_flag142; } int Tp::is_unused_flag14(void) const { return _is_unused_flag14; } int Tp::is_unused_flag15(void) const { return _is_unused_flag15; } @@ -1387,6 +1387,7 @@ void Tp::is_obs_throwing_set(int v) { _is_obs_throwing = v; } void Tp::is_obs_wall_or_door_set(int v) { _is_obs_wall_or_door = v; } void Tp::is_obs_when_dead_set(int v) { _is_obs_when_dead = v; } void Tp::is_ogre_set(int v) { _is_ogre = v; } +void Tp::is_only_one_per_tile_set(int v) { _is_only_one_per_tile = v; } void Tp::is_openable_set(int v) { _is_openable = v; } void Tp::is_organic_set(int v) { _is_organic = v; } void Tp::is_pillar_set(int v) { _is_pillar = v; } @@ -1498,7 +1499,6 @@ void Tp::is_unused_flag137_set(int v) { _is_unused_flag137 = v; } void Tp::is_unused_flag138_set(int v) { _is_unused_flag138 = v; } void Tp::is_unused_flag139_set(int v) { _is_unused_flag139 = v; } void Tp::is_unused_flag13_set(int v) { _is_unused_flag13 = v; } -void Tp::is_unused_flag140_set(int v) { _is_unused_flag140 = v; } void Tp::is_unused_flag142_set(int v) { _is_unused_flag142 = v; } void Tp::is_unused_flag14_set(int v) { _is_unused_flag14 = v; } void Tp::is_unused_flag15_set(int v) { _is_unused_flag15 = v; }