Skip to content

Commit

Permalink
Remove ledge trap hack (#78254)
Browse files Browse the repository at this point in the history
* Rip out tr_ledge hack

* Make non Character creatures fall again

* Typify and rename ledge -> try_fall

* Add tr_ledge obsoletion

* Remove t_hole

* Fix climbing down triggering falling first resulting in you burying yourself

* Update map.cpp

* Fix being grapple pulled off a roof sending you into the ground

* Fix spawned NPCs not falling until they move

* Fix spawned monsters not falling until they move

Not the most ideal looking spot for this but its the only place all the calls I could find filter down to

* Fix a test expecting spawned NPCs to float

* Another test that expects floating to be fine

* Appease our clang overlords

* More appeasement

* Did you know stashing changes for one branch on another by accident and forgetting about them is not great?

* More fixes

* Appease our clang overlords

* Fix some since typified stuff
  • Loading branch information
Procyonae authored Dec 19, 2024
1 parent 109a8a0 commit eed3ee5
Show file tree
Hide file tree
Showing 56 changed files with 403 additions and 330 deletions.
19 changes: 0 additions & 19 deletions data/core/traps.json

This file was deleted.

3 changes: 2 additions & 1 deletion data/json/furniture_and_terrain/terrain-floors-indoor.json
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,7 @@
"color": "white",
"move_cost": 2,
"connect_groups": "INDOORFLOOR",
"//": "TODO: Should break when you step on it if there's no supporting terrain below, might want some warning akin to examine_action ledge",
"flags": [ "TRANSPARENT", "FLAMMABLE_ASH", "INDOORS", "NO_FLOOR" ],
"bash": {
"str_min": 1,
Expand All @@ -1719,11 +1720,11 @@
"name": "open air",
"description": "An area of open air.",
"//": "Actually, this is a thin membrane of bullshit to keep wasp eggs levitating.",
"//1": "Why do we want eggs to levitate??",
"symbol": " ",
"looks_like": "t_open_air",
"color": "i_cyan",
"move_cost": 2,
"trap": "tr_ledge",
"flags": [ "TRANSPARENT" ],
"examine_action": "ledge"
}
Expand Down
6 changes: 3 additions & 3 deletions data/json/furniture_and_terrain/terrain-highways.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"str_max": 300,
"sound": "concrete cracking and metal screeching!",
"sound_fail": "whump!",
"ter_set": "t_hole",
"ter_set": "t_null",
"items": [ { "item": "rock", "count": [ 4, 20 ] }, { "item": "rebar", "count": [ 10, 20 ] } ]
}
},
Expand All @@ -37,7 +37,7 @@
"str_max": 300,
"sound": "concrete cracking and metal screeching!",
"sound_fail": "whump!",
"ter_set": "t_hole",
"ter_set": "t_null",
"items": [ { "item": "rock", "count": [ 4, 20 ] }, { "item": "rebar", "count": [ 10, 20 ] } ]
}
},
Expand All @@ -56,7 +56,7 @@
"str_max": 300,
"sound": "concrete cracking and metal screeching!",
"sound_fail": "whump!",
"ter_set": "t_hole",
"ter_set": "t_null",
"items": [ { "item": "rock", "count": [ 4, 20 ] }, { "item": "rebar", "count": [ 10, 20 ] } ]
}
}
Expand Down
36 changes: 17 additions & 19 deletions data/json/furniture_and_terrain/terrain-roofs.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"color": "i_cyan",
"move_cost": 2,
"roof": "t_flat_roof",
"trap": "tr_ledge",
"flags": [ "TRANSPARENT", "NO_FLOOR", "EMPTY_SPACE" ],
"examine_action": "ledge"
},
Expand All @@ -20,7 +19,6 @@
"symbol": " ",
"color": "i_cyan",
"move_cost": 2,
"trap": "tr_ledge",
"roof": "t_flat_roof",
"examine_action": "ledge",
"connect_groups": "INDOORFLOOR",
Expand All @@ -34,7 +32,6 @@
"symbol": " ",
"color": "i_cyan",
"move_cost": 2,
"trap": "tr_ledge",
"flags": [ "TRANSPARENT", "NO_FLOOR", "EMPTY_SPACE" ],
"examine_action": "ledge"
},
Expand Down Expand Up @@ -113,7 +110,7 @@
"color": "dark_gray",
"move_cost": 2,
"flags": [ "TRANSPARENT", "FLAT", "ROAD" ],
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_hole", "bash_below": false }
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_null", "bash_below": false }
},
{
"type": "terrain",
Expand All @@ -125,7 +122,7 @@
"color": "dark_gray",
"move_cost": 2,
"flags": [ "TRANSPARENT", "FLAMMABLE", "FLAT" ],
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_hole", "bash_below": false }
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_null", "bash_below": false }
},
{
"type": "terrain",
Expand All @@ -137,7 +134,7 @@
"color": "green",
"move_cost": 2,
"flags": [ "TRANSPARENT", "FLAMMABLE", "FLAT" ],
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_hole", "bash_below": false }
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_null", "bash_below": false }
},
{
"type": "terrain",
Expand All @@ -149,7 +146,7 @@
"color": "yellow",
"move_cost": 2,
"flags": [ "TRANSPARENT", "FLAMMABLE" ],
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_hole", "bash_below": false }
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_null", "bash_below": false }
},
{
"type": "terrain",
Expand All @@ -161,7 +158,7 @@
"color": "light_gray",
"move_cost": 2,
"flags": [ "TRANSPARENT", "FLAT", "ROAD" ],
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_hole", "bash_below": false }
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_null", "bash_below": false }
},
{
"type": "terrain",
Expand All @@ -173,7 +170,7 @@
"color": "white",
"move_cost": 2,
"flags": [ "TRANSPARENT", "FLAT", "FLAMMABLE" ],
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_hole", "bash_below": false }
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_null", "bash_below": false }
},
{
"type": "terrain",
Expand All @@ -184,6 +181,7 @@
"looks_like": "t_linoleum_white",
"color": "cyan",
"move_cost": 2,
"//": "TODO: Should break when you step on it if there's no supporting terrain below, might want some warning akin to examine_action ledge",
"flags": [ "TRANSPARENT", "TRANSPARENT_FLOOR" ],
"bash": {
"str_min": 3,
Expand All @@ -204,7 +202,7 @@
"color": "brown",
"move_cost": 2,
"flags": [ "TRANSPARENT", "FLAT" ],
"bash": { "str_min": 100, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_hole", "bash_below": false }
"bash": { "str_min": 100, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_null", "bash_below": false }
},
{
"type": "terrain",
Expand Down Expand Up @@ -233,7 +231,7 @@
"sound_fail": "slap!",
"sound_vol": 8,
"sound_fail_vol": 4,
"ter_set": "t_hole",
"ter_set": "t_null",
"bash_below": false
}
},
Expand All @@ -255,7 +253,7 @@
"sound_fail": "slap!",
"sound_vol": 15,
"sound_fail_vol": 10,
"ter_set": "t_hole",
"ter_set": "t_null",
"bash_below": false
}
},
Expand All @@ -269,7 +267,7 @@
"color": "dark_gray",
"move_cost": 2,
"flags": [ "TRANSPARENT", "FLAT", "ROAD" ],
"bash": { "str_min": 100, "str_max": 400, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_hole", "bash_below": false }
"bash": { "str_min": 100, "str_max": 400, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_null", "bash_below": false }
},
{
"type": "terrain",
Expand All @@ -281,7 +279,7 @@
"color": "brown",
"move_cost": 2,
"flags": [ "TRANSPARENT", "FLAMMABLE", "FLAT" ],
"bash": { "str_min": 50, "str_max": 400, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_hole", "bash_below": false }
"bash": { "str_min": 50, "str_max": 400, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_null", "bash_below": false }
},
{
"type": "terrain",
Expand All @@ -293,7 +291,7 @@
"color": "brown",
"move_cost": 2,
"flags": [ "TRANSPARENT", "FLAMMABLE_HARD", "FLAT" ],
"bash": { "str_min": 50, "str_max": 400, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_hole", "bash_below": false }
"bash": { "str_min": 50, "str_max": 400, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_null", "bash_below": false }
},
{
"type": "terrain",
Expand All @@ -305,7 +303,7 @@
"color": "dark_gray",
"move_cost": 2,
"flags": [ "TRANSPARENT", "FLAT", "ROAD" ],
"bash": { "str_min": 200, "str_max": 500, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_hole", "bash_below": false }
"bash": { "str_min": 200, "str_max": 500, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_null", "bash_below": false }
},
{
"type": "terrain",
Expand All @@ -329,7 +327,7 @@
"color": "green",
"move_cost": 2,
"flags": [ "TRANSPARENT", "FLAMMABLE" ],
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_hole", "bash_below": false }
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_null", "bash_below": false }
},
{
"type": "terrain",
Expand All @@ -340,7 +338,7 @@
"color": "red",
"move_cost": 2,
"flags": [ "TRANSPARENT", "FLAT", "ROAD" ],
"bash": { "str_min": 48, "str_max": 80, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_hole", "bash_below": false }
"bash": { "str_min": 48, "str_max": 80, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_null", "bash_below": false }
},
{
"type": "terrain",
Expand All @@ -351,7 +349,7 @@
"color": "blue",
"move_cost": 2,
"flags": [ "TRANSPARENT", "FLAMMABLE_HARD" ],
"bash": { "str_min": 1, "str_max": 8, "sound": "rrrrip!", "sound_fail": "slap!", "ter_set": "t_hole", "bash_below": false }
"bash": { "str_min": 1, "str_max": 8, "sound": "rrrrip!", "sound_fail": "slap!", "ter_set": "t_null", "bash_below": false }
},
{
"type": "terrain",
Expand Down
12 changes: 0 additions & 12 deletions data/json/furniture_and_terrain/terrain-traps.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
[
{
"type": "terrain",
"id": "t_hole",
"name": "empty space",
"description": "An area of empty space.",
"symbol": " ",
"color": "black",
"move_cost": 2,
"trap": "tr_ledge",
"flags": [ "TRANSPARENT", "NO_FLOOR", "EMPTY_SPACE" ],
"examine_action": "ledge"
},
{
"type": "terrain",
"id": "t_pit_shallow",
Expand Down
5 changes: 2 additions & 3 deletions data/json/furniture_and_terrain/terrain-windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -4384,18 +4384,17 @@
"symbol": "0",
"color": "light_cyan",
"move_cost": 2,
"trap": "tr_ledge",
"coverage": 0,
"examine_action": "ledge",
"deconstruct": { "ter_set": "t_hole", "items": [ { "item": "2x4", "count": [ 3, 4 ] }, { "item": "nail", "charges": [ 12, 16 ] } ] },
"deconstruct": { "ter_set": "t_null", "items": [ { "item": "2x4", "count": [ 3, 4 ] }, { "item": "nail", "charges": [ 12, 16 ] } ] },
"bash": {
"str_min": 1,
"str_max": 1,
"sound": "whump!",
"sound_fail": "whack!",
"sound_vol": 12,
"sound_fail_vol": 8,
"ter_set": "t_hole",
"ter_set": "t_null",
"items": [ { "item": "2x4", "count": [ 2, 4 ] } ]
},
"flags": [ "TRANSPARENT", "NO_FLOOR", "FLAMMABLE" ]
Expand Down
2 changes: 1 addition & 1 deletion data/json/furniture_and_terrain/terrain_vitrified.json
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@
"move_cost": 2,
"connect_groups": "INDOORFLOOR",
"flags": [ "SUPPORTS_ROOF", "TRANSPARENT", "INDOORS", "UNSTABLE" ],
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_hole", "bash_below": true }
"bash": { "str_min": 30, "str_max": 210, "sound": "crash!", "sound_fail": "whump!", "ter_set": "t_null", "bash_below": true }
},
{
"type": "terrain",
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen/drive-in_theater.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
}
},
"terrain": {
"│": "t_hole",
"│": "t_open_air",
".": "t_region_groundcover",
"V": "t_region_groundcover",
"$": "t_region_groundcover",
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen/farm.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF "
],
"palettes": [ "farm" ],
"terrain": { "│": "t_hole" },
"terrain": { "│": "t_open_air" },
"place_item": [
{ "item": "straw_pile", "x": [ 3, 5 ], "y": [ 5, 7 ], "amount": [ 0, 8 ] },
{ "item": "cattlefodder", "x": [ 3, 5 ], "y": [ 5, 7 ], "amount": [ 0, 4 ] },
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen/farm_dairy_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
],
"sealed_item": { "#": { "item": { "item": "seed_corn", "chance": 100 }, "furniture": "f_plant_seedling" } },
"terrain": {
"│": "t_hole",
"│": "t_open_air",
" ": [ [ "t_region_groundcover", 99 ], [ "t_region_shrub", 1 ] ],
",": [ [ "t_region_soil", 200 ], [ "t_region_groundcover", 5 ] ],
";": [ [ "t_dirtfloor_no_roof", 80 ], [ "t_region_soil", 20 ] ],
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen/isherwood_farms/farm_isherwood.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"F F ",
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF "
],
"terrain": { "│": "t_hole", "<": "t_ladder_up", ",": "t_woodchips" },
"terrain": { "│": "t_open_air", "<": "t_ladder_up", ",": "t_woodchips" },
"place_item": [
{ "item": "straw_pile", "x": [ 3, 5 ], "y": [ 5, 7 ], "amount": [ 0, 8 ] },
{ "item": "cattlefodder", "x": [ 3, 5 ], "y": [ 5, 7 ], "amount": [ 0, 4 ] },
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen/lab_subway_vent_shaft.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
",": "t_region_groundcover_urban",
".": "t_metal_floor_no_roof",
"=": "t_metal_ventilation_shutter",
"`": "t_hole",
"`": "t_open_air",
"w": "t_bridge",
"~": "t_water_pool_shallow",
"<": "t_ladder_up",
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen/megastore.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"id": "megastore",
"palettes": [ "parametrized_highrise_walls_palette" ],
"terrain": {
"│": "t_hole",
"│": "t_open_air",
" ": "t_region_groundcover_urban",
"_": "t_pavement",
",": "t_concrete",
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen/microlab/microlab_reactor.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
],
"palettes": [ "microlab_generic" ],
"items": { "d": { "item": "cop_armory", "chance": 5 }, "l": { "item": "decontamination_room", "chance": 70 } },
"terrain": { "-": "t_wall_metal", "`": "t_hole", "#": "t_rock", "G": "t_card_science", "g": "t_bridge", "A": "t_bridge" },
"terrain": { "-": "t_wall_metal", "`": "t_open_air", "#": "t_rock", "G": "t_card_science", "g": "t_bridge", "A": "t_bridge" },
"furniture": { "A": "f_nuclear_fuel_cell" }
}
},
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen/mine/mine_shaft.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
" ",
" "
],
"terrain": { "<": "t_ladder_up", ">": "t_ladder_down", "#": "t_grate", ".": "t_hole" }
"terrain": { "<": "t_ladder_up", ">": "t_ladder_down", "#": "t_grate", ".": "t_open_air" }
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen/mobile_home_park/mobile_home_park.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
{ "vehicle": "parking_garage", "x": 17, "y": 12, "chance": 20, "rotation": 0 },
{ "vehicle": "parking_garage", "x": 17, "y": 17, "chance": 20, "rotation": 0 }
],
"terrain": { "│": "t_hole", "b": "t_concrete", "Z": "t_sai_box" }
"terrain": { "│": "t_open_air", "b": "t_concrete", "Z": "t_sai_box" }
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen/private_resort.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"││││││││││││││││││││││││|......................|||||||..cc...|||+||# F "
],
"palettes": [ "p_resort_palette_main_floor" ],
"terrain": { "│": "t_hole", "L": "t_thconc_floor" },
"terrain": { "│": "t_open_air", "L": "t_thconc_floor" },
"place_fields": [ { "field": "fd_bile", "x": [ 25, 46 ], "y": [ 5, 22 ], "repeat": [ 40, 60 ] } ],
"items": {
"N": [
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen_palettes/collapsed_tower.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"w": "t_door_c",
"y": "t_pavement_y",
"z": "t_region_shrub_decorative",
"`": "t_hole",
"`": "t_open_air",
"{": "t_door_glass_c",
"|": "t_concrete_wall",
"~": "t_water_sh"
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen_palettes/convention_center_palette.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
],
"terrain": {
"│": "t_hole",
"│": "t_open_air",
"_": "t_concrete",
"A": "t_concrete",
"f": "t_chainfence",
Expand Down
Loading

0 comments on commit eed3ee5

Please sign in to comment.