未验证 提交 293b3265 编写于 作者: F Fris0uman 提交者: GitHub

Allow players to uncover electric wires in the walls to connect appliances (#53983)

上级 94f0268f
......@@ -3039,6 +3039,18 @@
"pre_special": "check_empty",
"post_special": "done_appliance"
},
{
"type": "construction",
"id": "app_wall_wiring",
"group": "reveal_wall_wiring",
"category": "APPLIANCE",
"required_skills": [ [ "fabrication", 0 ] ],
"time": "0 s",
"qualities": [ { "id": "CUT", "level": 2 } ],
"tools": [ [ [ "pliers", -1 ] ] ],
"pre_flags": "WIRED_WALL",
"post_special": "done_appliance"
},
{
"type": "construction",
"id": "constr_pontoon_dp",
......
......@@ -1104,6 +1104,11 @@
"id": "place_standing_lamp",
"name": "Place Standing Lamp"
},
{
"type": "construction_group",
"id": "reveal_wall_wiring",
"name": "Reveal Wall Wirings"
},
{
"type": "construction_group",
"id": "place_forge",
......
......@@ -25,7 +25,17 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "FLAMMABLE", "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [
"FLAMMABLE",
"NOITEM",
"SUPPORTS_ROOF",
"WALL",
"NO_SCENT",
"AUTO_WALL_SYMBOL",
"MINEABLE",
"BLOCK_WIND",
"WIRED_WALL"
],
"bash": {
"str_min": 30,
"str_max": 210,
......@@ -97,7 +107,18 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "FLAMMABLE", "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "CHIP", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [
"FLAMMABLE",
"NOITEM",
"SUPPORTS_ROOF",
"WALL",
"NO_SCENT",
"CHIP",
"AUTO_WALL_SYMBOL",
"MINEABLE",
"BLOCK_WIND",
"WIRED_WALL"
],
"bash": {
"str_min": 30,
"str_max": 210,
......@@ -119,7 +140,18 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "FLAMMABLE", "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "CHIP", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [
"FLAMMABLE",
"NOITEM",
"SUPPORTS_ROOF",
"WALL",
"NO_SCENT",
"CHIP",
"AUTO_WALL_SYMBOL",
"MINEABLE",
"BLOCK_WIND",
"WIRED_WALL"
],
"bash": {
"str_min": 30,
"str_max": 210,
......@@ -141,7 +173,18 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "FLAMMABLE", "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "CHIP", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [
"FLAMMABLE",
"NOITEM",
"SUPPORTS_ROOF",
"WALL",
"NO_SCENT",
"CHIP",
"AUTO_WALL_SYMBOL",
"MINEABLE",
"BLOCK_WIND",
"WIRED_WALL"
],
"bash": {
"str_min": 30,
"str_max": 210,
......@@ -163,7 +206,18 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "FLAMMABLE", "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "CHIP", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [
"FLAMMABLE",
"NOITEM",
"SUPPORTS_ROOF",
"WALL",
"NO_SCENT",
"CHIP",
"AUTO_WALL_SYMBOL",
"MINEABLE",
"BLOCK_WIND",
"WIRED_WALL"
],
"bash": {
"str_min": 30,
"str_max": 210,
......@@ -185,7 +239,18 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "FLAMMABLE", "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "CHIP", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [
"FLAMMABLE",
"NOITEM",
"SUPPORTS_ROOF",
"WALL",
"NO_SCENT",
"CHIP",
"AUTO_WALL_SYMBOL",
"MINEABLE",
"BLOCK_WIND",
"WIRED_WALL"
],
"bash": {
"str_min": 30,
"str_max": 210,
......@@ -207,7 +272,18 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "FLAMMABLE", "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "CHIP", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [
"FLAMMABLE",
"NOITEM",
"SUPPORTS_ROOF",
"WALL",
"NO_SCENT",
"CHIP",
"AUTO_WALL_SYMBOL",
"MINEABLE",
"BLOCK_WIND",
"WIRED_WALL"
],
"bash": {
"str_min": 30,
"str_max": 210,
......@@ -229,7 +305,18 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "FLAMMABLE", "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "CHIP", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [
"FLAMMABLE",
"NOITEM",
"SUPPORTS_ROOF",
"WALL",
"NO_SCENT",
"CHIP",
"AUTO_WALL_SYMBOL",
"MINEABLE",
"BLOCK_WIND",
"WIRED_WALL"
],
"bash": {
"str_min": 30,
"str_max": 210,
......@@ -269,7 +356,7 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND", "WIRED_WALL" ],
"connects_to": "WALL",
"bash": {
"str_min": 60,
......@@ -291,7 +378,7 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND", "WIRED_WALL" ],
"connects_to": "WALL",
"bash": {
"str_min": 80,
......@@ -400,7 +487,7 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND", "WIRED_WALL" ],
"bash": {
"str_min": 70,
"str_max": 300,
......@@ -442,7 +529,7 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_metal_flat_roof",
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND", "WIRED_WALL" ],
"oxytorch": {
"result": "t_scrap_wall_halfway",
"duration": "14 seconds",
......@@ -494,7 +581,7 @@
"coverage": 100,
"looks_like": "t_wall_metal",
"roof": "t_metal_flat_roof",
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND", "WIRED_WALL" ],
"bash": {
"str_min": 200,
"str_max": 600,
......@@ -519,7 +606,7 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND", "WIRED_WALL" ],
"connects_to": "WALL",
"bash": {
"str_min": 90,
......@@ -562,7 +649,7 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND", "WIRED_WALL" ],
"connects_to": "WALL",
"bash": {
"str_min": 120,
......@@ -677,7 +764,7 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "FLAMMABLE", "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "BLOCK_WIND" ],
"flags": [ "FLAMMABLE", "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "BLOCK_WIND", "WIRED_WALL" ],
"connects_to": "WALL",
"bash": {
"str_min": 12,
......@@ -778,7 +865,17 @@
"move_cost": 0,
"coverage": 100,
"roof": "t_flat_roof",
"flags": [ "FLAMMABLE", "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ],
"flags": [
"FLAMMABLE",
"NOITEM",
"SUPPORTS_ROOF",
"WALL",
"NO_SCENT",
"AUTO_WALL_SYMBOL",
"MINEABLE",
"BLOCK_WIND",
"WIRED_WALL"
],
"connects_to": "WALL",
"bash": {
"str_min": 60,
......
......@@ -71,5 +71,18 @@
"price_postapoc": 5000,
"symbol": "L",
"color": "white"
},
{
"type": "GENERIC",
"id": "wall_wiring",
"name": { "str": "wall wiring" },
"description": "Electric wires used to run power through walls.",
"weight": "1 g",
"material": [ "plastic", "copper" ],
"volume": "1 ml",
"price": 100,
"price_postapoc": 10,
"symbol": "~",
"color": "white"
}
]
......@@ -90,6 +90,7 @@
"broken_symbol": "-",
"categories": [ "lighting" ],
"color": "white",
"location": "structure",
"broken_color": "blue",
"durability": 20,
"description": "An electrical device containing an electric lamp that provides illumination.",
......@@ -102,5 +103,20 @@
{ "item": "scrap", "count": [ 1, 2 ] }
],
"flags": [ "CIRCLE_LIGHT", "APPLIANCE", "ENABLED_DRAINS_EPOWER", "CTRL_ELECTRONIC" ]
},
{
"id": "ap_wall_wiring",
"type": "vehicle_part",
"name": { "str": "wall wirings" },
"item": "wall_wiring",
"location": "structure",
"symbol": "_",
"categories": [ "other" ],
"broken_symbol": "/",
"color": "white",
"broken_color": "red",
"durability": 20,
"description": "Electric wires embedded in the wall.",
"flags": [ "APPLIANCE" ]
}
]
......@@ -652,6 +652,7 @@ List of known flags, used in both `terrain.json` and `furniture.json`.
- ```USABLE_FIRE``` This terrain or furniture counts as a nearby fire for crafting.
- ```WALL``` This terrain is an upright obstacle. Used for fungal conversion, and also implies `CONNECT_TO_WALL`.
- ```WINDOW``` This terrain is a window, though it may be closed, broken, or covered up. Used by the tiles code to align furniture sprites away from the window.
- ```WIRED_WALL``` This terrain is a wall with electric wires inside. Allows the `Reveal wall wirings` construction.
- ```WORKOUT_LEGS``` This furniture is for training your legs. Needed for checks like `is_limb_broken()`.
- ```WORKOUT_ARMS``` This furniture is for training your arms. Needed for checks like `is_limb_broken()`.
......
......@@ -1678,6 +1678,7 @@ request](https://github.com/CleverRaven/Cataclysm-DDA/pull/36657) and the
"components": [ [ [ "spear_wood", 4 ], [ "pointy_stick", 4 ] ] ], // Items used in construction
"pre_special": "check_empty", // Required something that isn't terrain
"pre_terrain": "t_pit", // Alternative to pre_special; Required terrain to build on
"pre_flags": [ "WALL" ], // Flags beginning terrain must have
"post_terrain": "t_pit_spiked" // Terrain type after construction is complete
```
......
......@@ -99,6 +99,7 @@ static const vproto_id vehicle_prototype_none( "none" );
static const std::string flag_INITIAL_PART( "INITIAL_PART" );
static const std::string flag_APPLIANCE( "APPLIANCE" );
static const std::string flag_CANT_DRAG( "CANT_DRAG" );
static bool finalized = false;
......@@ -1032,6 +1033,7 @@ void complete_construction( Character *you )
return;
}
const construction &built = pc->id.obj();
you->activity.str_values.emplace_back( built.str_id );
const auto award_xp = [&]( Character & practicer ) {
for( const auto &pr : built.required_skills ) {
practicer.practice( pr.first, static_cast<int>( ( 10 + 15 * pr.second ) *
......@@ -1331,10 +1333,19 @@ void construct::done_appliance( const tripoint &p )
return;
}
const vpart_id &vpart = vpart_from_item( get_avatar().lastconsumed );
veh->install_part( point_zero, vpart );
const std::string &constrcut_id = get_avatar().activity.get_str_value( 0 );
if( constrcut_id == STATIC( "app_wall_wiring" ) ) {
veh->install_part( point_zero, vpart_from_item( STATIC( itype_id( "wall_wiring" ) ) ) );
veh->name = _( "wall wiring" );
veh->add_tag( flag_CANT_DRAG );
} else {
veh->install_part( point_zero, vpart );
veh->name = vpart->name();
}
veh->add_tag( flag_APPLIANCE );
veh->name = vpart->name();
// Update the vehicle cache immediately,
// or the appliance will be invisible for the first couple of turns.
here.add_vehicle_to_cache( veh );
......
......@@ -152,6 +152,8 @@ static const zone_type_id zone_type_VEHICLE_DECONSTRUCT( "VEHICLE_DECONSTRUCT" )
static const zone_type_id zone_type_VEHICLE_REPAIR( "VEHICLE_REPAIR" );
static const zone_type_id zone_type_zone_disassemble( "zone_disassemble" );
static const std::string flag_CANT_DRAG( "CANT_DRAG" );
#define dbg(x) DebugLog((x),D_GAME) << __FILE__ << ":" << __LINE__ << ": "
#if defined(__ANDROID__)
......@@ -639,6 +641,10 @@ static void grab()
if( !vp->vehicle().handle_potential_theft( you ) ) {
return;
}
if( vp->vehicle().has_tag( flag_CANT_DRAG ) ) {
add_msg( m_info, _( "There's nothing to grab there!" ) );
return;
}
you.grab( object_type::VEHICLE, grabp - you.pos() );
add_msg( _( "You grab the %s." ), vp->vehicle().name );
} else if( here.has_furn( grabp ) ) { // If not, grab furniture if present
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册