Skip to content

Commit

Permalink
Merge pull request #73232 from PatrikLundell/roof_construction
Browse files Browse the repository at this point in the history
Implemented scaffolding + doc
  • Loading branch information
Maleclypse authored Apr 26, 2024
2 parents 7b14ff4 + 55a974f commit 5ce0a13
Show file tree
Hide file tree
Showing 5 changed files with 267 additions and 10 deletions.
83 changes: 83 additions & 0 deletions data/json/construction.json
Original file line number Diff line number Diff line change
Expand Up @@ -9126,5 +9126,88 @@
"pre_special": "check_empty",
"post_terrain": "f_piano",
"activity_level": "LIGHT_EXERCISE"
},
{
"type": "construction",
"id": "constr_scaffolding_pipe_up",
"group": "build_scaffolding",
"category": "CONSTRUCT",
"required_skills": [ [ "fabrication", 3 ] ],
"time": "30 m",
"qualities": [ [ { "id": "WRENCH", "level": 1 } ] ],
"components": [
[ [ "pipe", 46 ] ],
[ [ "pipe_fittings", 55 ] ],
[ [ "2x4", 4 ], [ "wood_panel", 1 ] ],
[ [ "stick", 2 ] ],
[ [ "rope_natural", 2, "LIST" ] ]
],
"pre_note": "Constructs scaffolding on the tile and provides a platform on the Z level above.",
"pre_special": [ "check_empty", "check_single_support", "check_up_OK", "check_nofloor_above" ],
"post_special": "add_roof",
"post_terrain": "t_scaffolding_pipe_up"
},
{
"type": "construction",
"id": "constr_scaffolding_pipe_down",
"group": "build_scaffolding",
"category": "CONSTRUCT",
"required_skills": [ [ "fabrication", 3 ] ],
"time": "10 m",
"qualities": [ [ { "id": "WRENCH", "level": 1 } ] ],
"components": [
[ [ "pipe", 46 ] ],
[ [ "pipe_fittings", 55 ] ],
[ [ "2x4", 4 ], [ "wood_panel", 1 ] ],
[ [ "stick", 2 ] ],
[ [ "rope_natural", 2, "LIST" ] ]
],
"pre_note": "Builds another scaffolding level.",
"pre_terrain": "t_scaffolding_pipe_down",
"pre_special": [ "check_up_OK", "check_nofloor_above" ],
"post_terrain": "t_scaffolding_pipe_updown",
"post_special": "add_matching_down_above"
},
{
"type": "construction",
"id": "remove_scaffolding_pipe_up",
"group": "remove_scaffolding",
"category": "CONSTRUCT",
"required_skills": [ [ "fabrication", 3 ] ],
"time": "30 m",
"qualities": [ [ { "id": "WRENCH", "level": 1 } ] ],
"pre_note": "Removes scaffolding.",
"pre_terrain": "t_scaffolding_pipe_up",
"pre_special": "check_matching_down_above",
"post_special": "remove_above",
"post_terrain": "t_dirt",
"byproducts": [
{ "item": "pipe", "count": 46 },
{ "item": "pipe_fittings", "count": 55 },
{ "item": "2x4", "count": 4 },
{ "item": "stick", "count": 2 },
{ "item": "rope_30", "count": 2 }
]
},
{
"type": "construction",
"id": "remove_scaffolding_pipe_down_above_updown",
"group": "remove_scaffolding",
"category": "CONSTRUCT",
"required_skills": [ [ "fabrication", 3 ] ],
"time": "30 m",
"qualities": [ [ { "id": "WRENCH", "level": 1 } ] ],
"pre_note": "Removes down scaffolding from directly above the construction tile.",
"pre_terrain": "t_scaffolding_pipe_updown",
"pre_special": "check_matching_down_above",
"post_special": "remove_above",
"post_terrain": "t_scaffolding_pipe_down",
"byproducts": [
{ "item": "pipe", "count": 46 },
{ "item": "pipe_fittings", "count": 55 },
{ "item": "2x4", "count": 4 },
{ "item": "stick", "count": 2 },
{ "item": "rope_30", "count": 2 }
]
}
]
10 changes: 10 additions & 0 deletions data/json/construction_group.json
Original file line number Diff line number Diff line change
Expand Up @@ -1978,5 +1978,15 @@
"type": "construction_group",
"id": "place_piano",
"name": "Place Piano"
},
{
"type": "construction_group",
"id": "build_scaffolding",
"name": "Place Scaffolding"
},
{
"type": "construction_group",
"id": "remove_scaffolding",
"name": "Remove Scaffolding"
}
]
62 changes: 62 additions & 0 deletions data/json/furniture_and_terrain/terrain-zlevel-transitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,68 @@
"items": [ { "item": "steel_chunk", "count": [ 1, 6 ] }, { "item": "scrap", "count": [ 3, 12 ] } ]
}
},
{
"type": "terrain",
"id": "t_scaffolding_pipe_up",
"name": "scaffolding up",
"description": "Scaffolding leading up.",
"symbol": "<",
"looks_like": "t_ladder_up",
"color": "dark_gray",
"move_cost": 2,
"roof": "t_scaffolding_pipe_down",
"flags": [ "TRANSPARENT", "GOES_UP", "PLACE_ITEM", "DIFFICULT_Z", "SUPPORTS_ROOF", "SINGLE_SUPPORT" ],
"bash": {
"str_min": 20,
"str_max": 150,
"sound": "metal screeching!",
"sound_fail": "clang!",
"ter_set": "t_dirt",
"items": [
{ "item": "pipe", "count": [ 10, 46 ] },
{ "item": "pipe_fittings", "count": [ 10, 55 ] },
{ "item": "2x4", "count": [ 1, 4 ] },
{ "item": "stick", "count": [ 0, 2 ] },
{ "item": "rope_30", "count": [ 0, 2 ] }
]
}
},
{
"type": "terrain",
"id": "t_scaffolding_pipe_down",
"name": "scaffolding down",
"description": "Scaffolding leading down.",
"symbol": ">",
"looks_like": "t_ladder_down",
"color": "dark_gray",
"move_cost": 2,
"flags": [ "TRANSPARENT", "GOES_DOWN", "PLACE_ITEM", "DIFFICULT_Z", "SINGLE_SUPPORT" ],
"bash": { "str_min": 20, "str_max": 150, "sound": "metal screeching!", "sound_fail": "clang!", "ter_set": "t_open_air" }
},
{
"type": "terrain",
"id": "t_scaffolding_pipe_updown",
"name": "scaffolding up/down",
"description": "Scaffolding leading up and down.",
"symbol": "H",
"color": "dark_gray",
"move_cost": 2,
"flags": [ "TRANSPARENT", "GOES_UP", "GOES_DOWN", "PLACE_ITEM", "DIFFICULT_Z", "SUPPORTS_ROOF", "SINGLE_SUPPORT" ],
"bash": {
"str_min": 20,
"str_max": 150,
"sound": "metal screeching!",
"sound_fail": "clang!",
"ter_set": "t_scaffolding_pipe_down",
"items": [
{ "item": "pipe", "count": [ 10, 46 ] },
{ "item": "pipe_fittings", "count": [ 10, 55 ] },
{ "item": "2x4", "count": [ 1, 4 ] },
{ "item": "stick", "count": [ 0, 2 ] },
{ "item": "rope_30", "count": [ 0, 2 ] }
]
}
},
{
"type": "terrain",
"id": "t_ramp_down_high",
Expand Down
35 changes: 31 additions & 4 deletions doc/JSON_INFO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2447,10 +2447,11 @@ request](https://github.com/CleverRaven/Cataclysm-DDA/pull/36657) and the
"vehicle_start": true, // Hardcoded check for construction recipe, that result into vehicle frame; Can be used only with `done_vehicle`
"time": "30 m", // Time required to complete construction. Integers will be read as minutes or a time string can be used.
"components": [ [ [ "spear_wood", 4 ], [ "pointy_stick", 4 ] ] ], // Items used in construction
"pre_special": "check_empty", // Required something that isn't terrain
"pre_special": [ "check_empty", "check_up_OK" ], // Required something that isn't terrain. The syntax also allows for a square bracket enclosed list of specials which all have to be fulfilled
"pre_terrain": "t_pit", // Alternative to pre_special; Required terrain to build on
"pre_flags": [ "WALL", { "flag": "DIGGABLE", "force_terrain": true } ], // Flags beginning furniture/terrain must have. force_ter forces the flag to apply to the underlying terrain
"post_terrain": "t_pit_spiked", // Terrain type after construction is complete
"post_special": "done_mine_upstairs", // Required to do something beyond setting the post terrain. The syntax also allows for a square bracket enclosed list of specials which all have to be fulfilled
"pre_note": "Build a spikes on a diggable terrain", // Create an annotation to this recipe
"dark_craftable": true, // If true, you can construct it with lack of light
"byproducts": [ { "item": "material_soil", "count": [ 2, 5 ] } } ], // Items, that would be left after construction
Expand All @@ -2463,19 +2464,45 @@ request](https://github.com/CleverRaven/Cataclysm-DDA/pull/36657) and the
| `check_channel` | Must be empty and have a current in at least one orthogonal tile
| `check_empty` | Tile is empty (no furniture, trap, item, or vehicle) and flat terrain
| `check_empty_lite` | Tile is empty (no furniture, trap, item, or vehicle)
| `check_support` | Must have at least two solid walls/obstructions nearby on orthogonals (non-diagonal directions only) to support the tile
| `check_support_below` | Must have at least two solid walls/obstructions at the Z level below on orthogonals (non-diagonal directions only) to support the tile and be empty lite but with a ledge trap acceptable, as well as open air
| `check_support` | Must have at least two solid walls/obstructions nearby on orthogonals (non-diagonal directions only) or solid support directly below to support the tile
| `check_support_below` | Must have at least two solid walls/obstructions at the Z level below on orthogonals (non-diagonal directions only) or solid support directly below to support the tile and be empty lite but with a ledge trap acceptable, as well as open air
| `check_single_support` | Must have solid support directly below to support the tile
| `check_stable` | Tile on level below has a flag `SUPPORTS_ROOF`
| `check_empty_stable` | Tile is empty and stable
| `check_nofloor_above` | Tile on level above has a flag `NO_FLOOR`
| `check_deconstruction` | The furniture (or tile, if no furniture) in the target tile must have a "deconstruct" entry
| `check_empty_up_OK` | Tile is empty and is below the maximum possible elevation (can build up here)
| `check_up_OK` | Tile is below the maximum possible elevation (can build up here)
| `check_down_OK` | Tile is above the lowest possible elevation (can dig down here)
| `check_no_trap` | There is no trap object in this tile
| `check_ramp_low` | Both this and the next level above can be built up one additional Z level
| `check_ramp_high` | There is a complete downramp on the next higher level, and both this and next level above can be built up one additional Z level
| `check_no_wiring` | The tile must either be free of a vehicle, or at least a vehicle that doesn't have the WIRING flag
| `check_matching_down_above`| The tile directly above must have the same base identifier but with a suffix of 'down'
| post_special | Description
|--- |---
| `done_trunk_plank` | Generate logs and then planks here (under the assumption the tile was a trunk or stump)
| `done_grave` | Finish grave digging by performing burial activities
| `done_vehicle` | Create a new vehicle and name it
| `done_appliance` | Finish the placement of a partially placed appliance
| `done_wiring` | Place a wiring "appliance" at the location
| `done_deconstruct` | Finish deconstruction of furniture or, if not present, terrain
| `done_dig_grave` | Finish digging up a grave and find what's inside of it
| `done_dig_grave_nospawn`| Finish digging up a grave and retrieve a coffin (which is not an option above)
| `done_dig_stair` | Finish diggins stairs downwards (with handling of what's beneath and how to get up)
| `done_mine_downstair` | Same as the previous one, but mining rather than digging
| `done_mine_upstair` | Finish mining stairs from below
| `done_wood_stairs` | Finish building stairs from below
| `done_window_curtains` | Finish boarding up window and get materials from curtains
| `done_extract_maybe_revert_to_dirt`| Finish sand/clay extraction, which may exhaust the resource
| `done_mark_firewood` | Sets a firewood source trap at the location
| `done_mark_practice_target`| Sets a target practice trap at the location
| `done_ramp_low` | Sets a t_ramp_down_low at the tile above the target
| `done_ramp_high` | Sets a t_ramp_down_high at the tile above the target
| `done_matching_down_above`| The terrain on the Z level above is set to the corresponding terrain at this level, but with the "down" suffix instead
| `remove_above` | Remove the terrain at the Z level above and replace it with t_open_air
| `add_roof` | Add the roof specified for the terrain at the site to the tile above
### Scent_types
Expand Down
Loading

0 comments on commit 5ce0a13

Please sign in to comment.