diff --git a/data/json/construction.json b/data/json/construction.json index 86a0ff56b1cf..2e01e281b523 100644 --- a/data/json/construction.json +++ b/data/json/construction.json @@ -7,6 +7,7 @@ "required_skills": [ [ "fabrication", 0 ] ], "time": "20 m", "qualities": [ [ { "id": "PRY", "level": 1 } ], [ { "id": "SCREW", "level": 1 } ] ], + "deny_flags": [ "ADV_DECONSTRUCT" ], "pre_special": "check_deconstruct", "post_flags": [ "keep_items" ], "post_special": "done_deconstruct" @@ -20,6 +21,7 @@ "time": "10 s", "pre_note": "Certain terrain and furniture can be deconstructed without any tools.", "pre_flags": "EASY_DECONSTRUCT", + "deny_flags": [ "ADV_DECONSTRUCT" ], "pre_special": "check_deconstruct", "post_flags": [ "keep_items" ], "dark_craftable": true, diff --git a/data/json/deconstruction.json b/data/json/deconstruction.json index 6514f6a622ed..b16ac7aa2843 100644 --- a/data/json/deconstruction.json +++ b/data/json/deconstruction.json @@ -786,9 +786,10 @@ "required_skills": [ [ "fabrication", 2 ] ], "time": "90 m", "using": [ [ "object_deconstruction_advanced", 1 ] ], - "byproducts": [ { "item": "rock", "count": [ 35, 40 ] } ], "pre_furniture": "f_fireplace", - "post_furniture": "f_null", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -799,14 +800,10 @@ "required_skills": [ [ "fabrication", 2 ], [ "electronics", 3 ] ], "time": "90 m", "using": [ [ "advanced_electronics_high_voltage", 1 ] ], - "byproducts": [ - { "item": "scrap", "count": [ 1, 4 ] }, - { "item": "scrap_copper", "count": [ 10, 20 ] }, - { "item": "cable", "charges": [ 20, 100 ] }, - { "item": "pipe", "count": [ 1, 2 ] } - ], "pre_furniture": "f_electrical_conduit", - "post_furniture": "f_null", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -817,18 +814,10 @@ "required_skills": [ [ "fabrication", 3 ], [ "electronics", 8 ] ], "time": "120 m", "using": [ [ "advanced_electronics_high_voltage", 1 ] ], - "byproducts": [ - { "item": "scrap", "count": [ 1, 4 ] }, - { "item": "cable", "charges": [ 100, 800 ] }, - { "item": "pipe", "count": [ 0, 4 ] }, - { "item": "circuit", "count": [ 0, 5 ] }, - { "item": "e_scrap", "count": [ 2, 8 ] }, - { "item": "amplifier", "count": [ 0, 4 ] }, - { "item": "power_supply", "count": [ 0, 2 ] }, - { "item": "metal_tank_little", "count": [ 0, 6 ] } - ], "pre_furniture": "f_capacitor", - "post_furniture": "f_null", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -838,20 +827,10 @@ "required_skills": [ [ "electronics", 0 ] ], "time": "20 m", "qualities": [ { "id": "SCREW", "level": 1 } ], - "byproducts": [ - { "item": "processor", "count": [ 1, 2 ] }, - { "item": "RAM", "count": [ 4, 8 ] }, - { "item": "cable", "charges": [ 4, 6 ] }, - { "item": "large_lcd_screen", "count": 1 }, - { "item": "e_scrap", "count": [ 10, 16 ] }, - { "item": "circuit", "count": [ 6, 10 ] }, - { "item": "power_supply", "count": [ 2, 4 ] }, - { "item": "amplifier", "count": [ 2, 4 ] }, - { "item": "plastic_chunk", "count": [ 10, 12 ] }, - { "item": "scrap", "count": [ 6, 8 ] } - ], "pre_terrain": "t_console_broken", - "post_terrain": "t_floor", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -861,20 +840,10 @@ "required_skills": [ [ "electronics", 0 ] ], "time": "20 m", "qualities": [ { "id": "SCREW", "level": 1 } ], - "byproducts": [ - { "item": "processor", "count": [ 1, 2 ] }, - { "item": "RAM", "count": [ 4, 8 ] }, - { "item": "cable", "charges": [ 4, 6 ] }, - { "item": "large_lcd_screen", "count": 1 }, - { "item": "e_scrap", "count": [ 10, 16 ] }, - { "item": "circuit", "count": [ 6, 10 ] }, - { "item": "power_supply", "count": [ 2, 4 ] }, - { "item": "amplifier", "count": [ 2, 4 ] }, - { "item": "plastic_chunk", "count": [ 10, 12 ] }, - { "item": "scrap", "count": [ 6, 8 ] } - ], "pre_terrain": "t_console", - "post_terrain": "t_floor", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -885,13 +854,10 @@ "required_skills": [ [ "fabrication", 2 ], [ "electronics", 6 ] ], "time": "90 m", "using": [ [ "advanced_electronics_high_voltage", 1 ] ], - "byproducts": [ - { "item": "plut_generator_item", "charges": [ 1, 1 ] }, - { "item": "power_supply", "charges": [ 3, 3 ] }, - { "item": "cable", "charges": [ 15, 15 ] } - ], "pre_terrain": "t_plut_generator", - "post_terrain": "t_concrete", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -902,13 +868,10 @@ "required_skills": [ [ "fabrication", 2 ], [ "electronics", 6 ] ], "time": "30 m", "using": [ [ "advanced_electronics_high_voltage", 1 ] ], - "byproducts": [ - { "item": "plut_generator_item", "charges": [ 1, 1 ] }, - { "item": "power_supply", "charges": [ 3, 3 ] }, - { "item": "cable", "charges": [ 15, 15 ] } - ], "pre_furniture": "f_grid_plut_generator", - "post_furniture": "f_null", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -918,19 +881,10 @@ "required_skills": [ [ "electronics", 1 ] ], "time": "30 m", "using": [ [ "advanced_electronics_low_voltage", 1 ] ], - "byproducts": [ - { "item": "RAM", "count": [ 4, 8 ] }, - { "item": "cable", "charges": [ 16, 40 ] }, - { "item": "small_lcd_screen", "count": [ 2, 4 ] }, - { "item": "e_scrap", "count": [ 12, 24 ] }, - { "item": "circuit", "count": [ 6, 30 ] }, - { "item": "power_supply", "count": [ 4, 8 ] }, - { "item": "amplifier", "count": [ 3, 6 ] }, - { "item": "plastic_chunk", "count": [ 4, 8 ] }, - { "item": "scrap", "count": [ 8, 16 ] } - ], "pre_terrain": "t_sai_box", - "post_terrain": "t_concrete", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -940,18 +894,10 @@ "required_skills": [ [ "electronics", 1 ] ], "time": "35 m", "using": [ [ "advanced_electronics_low_voltage", 1 ] ], - "byproducts": [ - { "item": "RAM", "count": [ 1, 2 ] }, - { "item": "cable", "charges": [ 4, 24 ] }, - { "item": "e_scrap", "count": [ 4, 12 ] }, - { "item": "circuit", "count": [ 2, 12 ] }, - { "item": "power_supply", "count": [ 1, 4 ] }, - { "item": "amplifier", "count": [ 1, 3 ] }, - { "item": "plastic_chunk", "count": [ 2, 6 ] }, - { "item": "scrap", "count": [ 6, 12 ] } - ], "pre_terrain": "t_sai_box_damaged", - "post_terrain": "t_concrete", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -961,17 +907,10 @@ "required_skills": [ [ "electronics", 5 ] ], "time": "60 m", "using": [ [ "advanced_electronics_high_voltage", 1 ] ], - "byproducts": [ - { "item": "cable", "charges": [ 8, 24 ] }, - { "item": "power_supply", "count": [ 4, 8 ] }, - { "item": "amplifier", "count": [ 8, 16 ] }, - { "item": "steel_chunk", "count": [ 4, 16 ] }, - { "item": "scrap", "count": [ 12, 24 ] }, - { "item": "sheet_metal", "count": [ 6, 12 ] }, - { "item": "ceramic_shard", "count": [ 2, 6 ] } - ], "pre_terrain": "t_oil_circ_brkr_l", - "post_terrain": "t_concrete", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -981,17 +920,10 @@ "required_skills": [ [ "electronics", 5 ] ], "time": "45 m", "using": [ [ "advanced_electronics_high_voltage", 1 ] ], - "byproducts": [ - { "item": "cable", "charges": [ 4, 12 ] }, - { "item": "power_supply", "count": [ 3, 6 ] }, - { "item": "amplifier", "count": [ 6, 12 ] }, - { "item": "steel_chunk", "count": [ 2, 12 ] }, - { "item": "scrap", "count": [ 8, 18 ] }, - { "item": "sheet_metal", "count": [ 4, 8 ] }, - { "item": "ceramic_shard", "count": [ 1, 4 ] } - ], "pre_terrain": "t_oil_circ_brkr_s", - "post_terrain": "t_concrete", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -1001,20 +933,10 @@ "required_skills": [ [ "electronics", 1 ] ], "time": "45 m", "using": [ [ "advanced_electronics_low_voltage", 1 ] ], - "byproducts": [ - { "item": "RAM", "count": [ 2, 6 ] }, - { "item": "cable", "charges": [ 4, 24 ] }, - { "item": "small_lcd_screen", "count": [ 6, 12 ] }, - { "item": "e_scrap", "count": [ 16, 24 ] }, - { "item": "circuit", "count": [ 12, 30 ] }, - { "item": "power_supply", "count": [ 6, 8 ] }, - { "item": "amplifier", "count": [ 6, 8 ] }, - { "item": "plastic_chunk", "count": [ 2, 4 ] }, - { "item": "scrap", "count": [ 8, 16 ] }, - { "item": "sheet_metal", "count": [ 2, 4 ] } - ], "pre_terrain": "t_switchgear_l", - "post_terrain": "t_concrete", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -1024,20 +946,10 @@ "required_skills": [ [ "electronics", 1 ] ], "time": "35 m", "using": [ [ "advanced_electronics_low_voltage", 1 ] ], - "byproducts": [ - { "item": "RAM", "count": [ 1, 2 ] }, - { "item": "cable", "charges": [ 2, 8 ] }, - { "item": "small_lcd_screen", "count": [ 2, 6 ] }, - { "item": "e_scrap", "count": [ 6, 12 ] }, - { "item": "circuit", "count": [ 8, 24 ] }, - { "item": "power_supply", "count": [ 2, 6 ] }, - { "item": "amplifier", "count": [ 1, 4 ] }, - { "item": "plastic_chunk", "count": [ 1, 2 ] }, - { "item": "scrap", "count": [ 4, 8 ] }, - { "item": "sheet_metal", "count": [ 1, 2 ] } - ], "pre_terrain": "t_switchgear_s", - "post_terrain": "t_concrete", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -1047,14 +959,10 @@ "required_skills": [ [ "electronics", 0 ] ], "time": "20 m", "using": [ [ "advanced_electronics_low_voltage", 1 ] ], - "byproducts": [ - { "item": "cable", "charges": [ 0, 4 ] }, - { "item": "scrap", "count": [ 8, 12 ] }, - { "item": "steel_chunk", "count": [ 2, 4 ] }, - { "item": "ceramic_shard", "count": [ 8, 16 ] } - ], "pre_terrain": "t_lgtn_arrest", - "post_terrain": "t_concrete", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -1064,22 +972,10 @@ "required_skills": [ [ "electronics", 2 ] ], "time": "35 m", "using": [ [ "advanced_electronics_high_voltage", 1 ] ], - "byproducts": [ - { "item": "RAM", "count": [ 12, 24 ] }, - { "item": "cable", "charges": [ 6, 12 ] }, - { "item": "small_lcd_screen", "count": [ 8, 16 ] }, - { "item": "e_scrap", "count": [ 8, 12 ] }, - { "item": "circuit", "count": [ 6, 18 ] }, - { "item": "power_supply", "count": [ 8, 12 ] }, - { "item": "amplifier", "count": [ 2, 4 ] }, - { "item": "plastic_chunk", "count": [ 4, 8 ] }, - { "item": "scrap", "count": [ 2, 6 ] }, - { "item": "sheet_metal", "count": [ 1, 2 ] }, - { "item": "lead", "charges": [ 1, 2 ] }, - { "item": "ceramic_shard", "count": [ 2, 6 ] } - ], "pre_terrain": "t_station_disc", - "post_terrain": "t_concrete", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -1089,16 +985,10 @@ "required_skills": [ [ "electronics", 3 ] ], "time": "45 m", "using": [ [ "advanced_electronics_high_voltage", 1 ] ], - "byproducts": [ - { "item": "scrap", "count": [ 12, 16 ] }, - { "item": "steel_chunk", "count": [ 4, 6 ] }, - { "item": "lead", "charges": [ 4, 16 ] }, - { "item": "cable", "charges": [ 60, 120 ] }, - { "item": "sheet_metal", "count": [ 2, 6 ] }, - { "item": "ceramic_shard", "count": [ 4, 12 ] } - ], "pre_terrain": "t_current_trans", - "post_terrain": "t_concrete", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" }, { @@ -1108,16 +998,11 @@ "required_skills": [ [ "electronics", 4 ] ], "time": "55 m", "using": [ [ "advanced_electronics_high_voltage", 1 ] ], - "byproducts": [ - { "item": "scrap", "count": [ 12, 16 ] }, - { "item": "steel_chunk", "count": [ 4, 6 ] }, - { "item": "lead", "charges": [ 12, 32 ] }, - { "item": "cable", "charges": [ 20, 40 ] }, - { "item": "sheet_metal", "count": [ 2, 6 ] }, - { "item": "ceramic_shard", "count": [ 4, 12 ] } - ], + "byproducts": [ ], "pre_terrain": "t_potential_trans", - "post_terrain": "t_concrete", + "pre_special": "check_deconstruct", + "post_flags": [ "keep_items" ], + "post_special": "done_deconstruct", "group": "advanced_object_deconstruction" } ] diff --git a/data/json/furniture_and_terrain/furniture-appliances.json b/data/json/furniture_and_terrain/furniture-appliances.json index 42f1f2a45d9e..d3fcb21f80ba 100644 --- a/data/json/furniture_and_terrain/furniture-appliances.json +++ b/data/json/furniture_and_terrain/furniture-appliances.json @@ -2508,7 +2508,14 @@ "move_cost_mod": -1, "coverage": 60, "required_str": -1, - "flags": [ "TRANSPARENT", "NOITEM", "REDUCE_SCENT", "PERMEABLE" ], + "flags": [ "TRANSPARENT", "NOITEM", "REDUCE_SCENT", "PERMEABLE", "ADV_DECONSTRUCT" ], + "deconstruct": { + "items": [ + { "item": "plut_generator_item", "count": 1 }, + { "item": "cable", "charges": 15 }, + { "item": "power_supply", "count": 3 } + ] + }, "bash": { "str_min": 50, "str_max": 400, @@ -2524,13 +2531,6 @@ "//": "Variable reduction, destroy_threshold equal to str_min instead of str_max due to delicate electronics", "ranged": { "reduction": [ 25, 50 ], "destroy_threshold": 50, "block_unaimed_chance": "50%" } }, - "deconstruct": { - "items": [ - { "item": "plut_generator_item", "count": 1 }, - { "item": "cable", "charges": 15 }, - { "item": "power_supply", "count": 3 } - ] - }, "//2": "Please keep steady_consumer to 300 s or more to avoid lag.", "active": [ "steady_consumer", { "power": -100, "consume_every": "300 s" } ] }, diff --git a/data/json/furniture_and_terrain/furniture-fireplaces.json b/data/json/furniture_and_terrain/furniture-fireplaces.json index ed8c4c521b9e..4f3a637c5e78 100644 --- a/data/json/furniture_and_terrain/furniture-fireplaces.json +++ b/data/json/furniture_and_terrain/furniture-fireplaces.json @@ -9,7 +9,8 @@ "move_cost_mod": 2, "coverage": 90, "required_str": -1, - "flags": [ "TRANSPARENT", "CONTAINER", "FIRE_CONTAINER", "SUPPRESS_SMOKE", "PLACE_ITEM", "MINEABLE" ], + "flags": [ "TRANSPARENT", "CONTAINER", "FIRE_CONTAINER", "SUPPRESS_SMOKE", "PLACE_ITEM", "MINEABLE", "ADV_DECONSTRUCT" ], + "deconstruct": { "items": [ { "item": "rock", "count": [ 35, 40 ] } ] }, "examine_action": "fireplace", "bash": { "str_min": 50, diff --git a/data/json/furniture_and_terrain/furniture-industrial.json b/data/json/furniture_and_terrain/furniture-industrial.json index a85dd8e1451d..ce7767fcf3a5 100644 --- a/data/json/furniture_and_terrain/furniture-industrial.json +++ b/data/json/furniture_and_terrain/furniture-industrial.json @@ -227,7 +227,15 @@ "move_cost_mod": 1, "coverage": 30, "required_str": -1, - "flags": [ "TRANSPARENT", "NOCOLLIDE" ], + "flags": [ "TRANSPARENT", "NOCOLLIDE", "ADV_DECONSTRUCT" ], + "deconstruct": { + "items": [ + { "item": "scrap", "count": [ 1, 4 ] }, + { "item": "scrap_copper", "count": [ 10, 20 ] }, + { "item": "cable", "charges": [ 20, 100 ] }, + { "item": "pipe", "count": [ 1, 2 ] } + ] + }, "bash": { "str_min": 10, "str_max": 100, @@ -254,7 +262,19 @@ "move_cost_mod": 4, "coverage": 40, "required_str": -1, - "flags": [ "TRANSPARENT", "MOUNTABLE" ], + "flags": [ "TRANSPARENT", "MOUNTABLE", "ADV_DECONSTRUCT" ], + "deconstruct": { + "items": [ + { "item": "scrap", "count": [ 1, 4 ] }, + { "item": "cable", "charges": [ 100, 800 ] }, + { "item": "pipe", "count": [ 0, 4 ] }, + { "item": "circuit", "count": [ 0, 5 ] }, + { "item": "e_scrap", "count": [ 2, 8 ] }, + { "item": "amplifier", "count": [ 0, 4 ] }, + { "item": "power_supply", "count": [ 0, 2 ] }, + { "item": "metal_tank_little", "count": [ 0, 6 ] } + ] + }, "bash": { "str_min": 25, "str_max": 200, diff --git a/data/json/furniture_and_terrain/terrain-manufactured.json b/data/json/furniture_and_terrain/terrain-manufactured.json index a7473da10f5c..0357ef14b819 100644 --- a/data/json/furniture_and_terrain/terrain-manufactured.json +++ b/data/json/furniture_and_terrain/terrain-manufactured.json @@ -713,7 +713,15 @@ "color": "light_green", "looks_like": "t_machinery_electronic", "move_cost": 0, - "flags": [ "TRANSPARENT", "NOITEM", "REDUCE_SCENT", "PERMEABLE" ], + "flags": [ "TRANSPARENT", "NOITEM", "REDUCE_SCENT", "PERMEABLE", "ADV_DECONSTRUCT" ], + "deconstruct": { + "ter_set": "t_concrete", + "items": [ + { "item": "plut_generator_item", "charges": [ 1, 1 ] }, + { "item": "power_supply", "charges": [ 3, 3 ] }, + { "item": "cable", "charges": [ 15, 15 ] } + ] + }, "bash": { "str_min": 50, "str_max": 400, @@ -742,7 +750,21 @@ "looks_like": "t_machinery_electronic", "move_cost": 0, "coverage": 90, - "flags": [ "NOITEM", "WALL" ], + "flags": [ "NOITEM", "WALL", "ADV_DECONSTRUCT" ], + "deconstruct": { + "ter_set": "t_concrete", + "items": [ + { "item": "RAM", "count": [ 4, 8 ] }, + { "item": "cable", "charges": [ 16, 40 ] }, + { "item": "small_lcd_screen", "count": [ 2, 4 ] }, + { "item": "e_scrap", "count": [ 12, 24 ] }, + { "item": "circuit", "count": [ 6, 30 ] }, + { "item": "power_supply", "count": [ 4, 8 ] }, + { "item": "amplifier", "count": [ 3, 6 ] }, + { "item": "plastic_chunk", "count": [ 4, 8 ] }, + { "item": "scrap", "count": [ 8, 16 ] } + ] + }, "bash": { "str_min": 8, "str_max": 80, @@ -763,7 +785,20 @@ "looks_like": "f_wreckage", "move_cost": 0, "coverage": 90, - "flags": [ "NOITEM", "WALL" ], + "flags": [ "NOITEM", "WALL", "ADV_DECONSTRUCT" ], + "deconstruct": { + "ter_set": "t_concrete", + "items": [ + { "item": "RAM", "count": [ 1, 2 ] }, + { "item": "cable", "charges": [ 4, 24 ] }, + { "item": "e_scrap", "count": [ 4, 12 ] }, + { "item": "circuit", "count": [ 2, 12 ] }, + { "item": "power_supply", "count": [ 1, 4 ] }, + { "item": "amplifier", "count": [ 1, 3 ] }, + { "item": "plastic_chunk", "count": [ 2, 6 ] }, + { "item": "scrap", "count": [ 6, 12 ] } + ] + }, "bash": { "str_min": 6, "str_max": 80, @@ -791,7 +826,19 @@ "looks_like": "t_machinery_electronic", "move_cost": 0, "coverage": 90, - "flags": [ "TRANSPARENT", "FLAMMABLE", "NOITEM", "WALL", "PERMEABLE" ], + "flags": [ "TRANSPARENT", "FLAMMABLE", "NOITEM", "WALL", "PERMEABLE", "ADV_DECONSTRUCT" ], + "deconstruct": { + "ter_set": "t_concrete", + "items": [ + { "item": "cable", "charges": [ 8, 24 ] }, + { "item": "power_supply", "count": [ 4, 8 ] }, + { "item": "amplifier", "count": [ 8, 16 ] }, + { "item": "steel_chunk", "count": [ 4, 16 ] }, + { "item": "scrap", "count": [ 12, 24 ] }, + { "item": "sheet_metal", "count": [ 6, 12 ] }, + { "item": "ceramic_shard", "count": [ 2, 6 ] } + ] + }, "bash": { "str_min": 20, "str_max": 150, @@ -818,7 +865,19 @@ "looks_like": "t_machinery_electronic", "move_cost": 0, "coverage": 65, - "flags": [ "TRANSPARENT", "FLAMMABLE", "NOITEM", "WALL", "PERMEABLE" ], + "flags": [ "TRANSPARENT", "FLAMMABLE", "NOITEM", "WALL", "PERMEABLE", "ADV_DECONSTRUCT" ], + "deconstruct": { + "ter_set": "t_concrete", + "items": [ + { "item": "cable", "charges": [ 4, 12 ] }, + { "item": "power_supply", "count": [ 3, 6 ] }, + { "item": "amplifier", "count": [ 6, 12 ] }, + { "item": "steel_chunk", "count": [ 2, 12 ] }, + { "item": "scrap", "count": [ 8, 18 ] }, + { "item": "sheet_metal", "count": [ 4, 8 ] }, + { "item": "ceramic_shard", "count": [ 1, 4 ] } + ] + }, "bash": { "str_min": 20, "str_max": 150, @@ -845,7 +904,22 @@ "looks_like": "t_machinery_electronic", "move_cost": 0, "coverage": 90, - "flags": [ "TRANSPARENT", "NOITEM", "WALL", "PERMEABLE" ], + "flags": [ "TRANSPARENT", "NOITEM", "WALL", "PERMEABLE", "ADV_DECONSTRUCT" ], + "deconstruct": { + "ter_set": "t_concrete", + "items": [ + { "item": "RAM", "count": [ 2, 6 ] }, + { "item": "cable", "charges": [ 4, 24 ] }, + { "item": "small_lcd_screen", "count": [ 6, 12 ] }, + { "item": "e_scrap", "count": [ 16, 24 ] }, + { "item": "circuit", "count": [ 12, 30 ] }, + { "item": "power_supply", "count": [ 6, 8 ] }, + { "item": "amplifier", "count": [ 6, 8 ] }, + { "item": "plastic_chunk", "count": [ 2, 4 ] }, + { "item": "scrap", "count": [ 8, 16 ] }, + { "item": "sheet_metal", "count": [ 2, 4 ] } + ] + }, "bash": { "str_min": 20, "str_max": 150, @@ -871,7 +945,22 @@ "looks_like": "t_machinery_electronic", "move_cost": 0, "coverage": 65, - "flags": [ "TRANSPARENT", "NOITEM", "WALL", "PERMEABLE" ], + "flags": [ "TRANSPARENT", "NOITEM", "WALL", "PERMEABLE", "ADV_DECONSTRUCT" ], + "deconstruct": { + "ter_set": "t_concrete", + "items": [ + { "item": "RAM", "count": [ 1, 2 ] }, + { "item": "cable", "charges": [ 2, 8 ] }, + { "item": "small_lcd_screen", "count": [ 2, 6 ] }, + { "item": "e_scrap", "count": [ 6, 12 ] }, + { "item": "circuit", "count": [ 8, 24 ] }, + { "item": "power_supply", "count": [ 2, 6 ] }, + { "item": "amplifier", "count": [ 1, 4 ] }, + { "item": "plastic_chunk", "count": [ 1, 2 ] }, + { "item": "scrap", "count": [ 4, 8 ] }, + { "item": "sheet_metal", "count": [ 1, 2 ] } + ] + }, "bash": { "str_min": 20, "str_max": 150, @@ -900,7 +989,16 @@ "color": "i_light_gray", "looks_like": "t_machinery_electronic", "move_cost": 0, - "flags": [ "TRANSPARENT", "NOITEM", "WALL", "PERMEABLE" ], + "flags": [ "TRANSPARENT", "NOITEM", "WALL", "PERMEABLE", "ADV_DECONSTRUCT" ], + "deconstruct": { + "ter_set": "t_concrete", + "items": [ + { "item": "cable", "charges": [ 0, 4 ] }, + { "item": "scrap", "count": [ 8, 12 ] }, + { "item": "steel_chunk", "count": [ 2, 4 ] }, + { "item": "ceramic_shard", "count": [ 8, 16 ] } + ] + }, "bash": { "str_min": 20, "str_max": 150, @@ -924,7 +1022,24 @@ "color": "light_gray", "looks_like": "t_machinery_electronic", "move_cost": 0, - "flags": [ "TRANSPARENT", "NOITEM", "WALL", "PERMEABLE" ], + "flags": [ "TRANSPARENT", "NOITEM", "WALL", "PERMEABLE", "ADV_DECONSTRUCT" ], + "deconstruct": { + "ter_set": "t_concrete", + "items": [ + { "item": "RAM", "count": [ 12, 24 ] }, + { "item": "cable", "charges": [ 6, 12 ] }, + { "item": "small_lcd_screen", "count": [ 8, 16 ] }, + { "item": "e_scrap", "count": [ 8, 12 ] }, + { "item": "circuit", "count": [ 6, 18 ] }, + { "item": "power_supply", "count": [ 8, 12 ] }, + { "item": "amplifier", "count": [ 2, 4 ] }, + { "item": "plastic_chunk", "count": [ 4, 8 ] }, + { "item": "scrap", "count": [ 2, 6 ] }, + { "item": "sheet_metal", "count": [ 1, 2 ] }, + { "item": "lead", "charges": [ 1, 2 ] }, + { "item": "ceramic_shard", "count": [ 2, 6 ] } + ] + }, "bash": { "str_min": 20, "str_max": 150, @@ -950,7 +1065,18 @@ "looks_like": "t_machinery_electronic", "move_cost": 0, "coverage": 50, - "flags": [ "TRANSPARENT", "NOITEM", "WALL", "PERMEABLE" ], + "flags": [ "TRANSPARENT", "NOITEM", "WALL", "PERMEABLE", "ADV_DECONSTRUCT" ], + "deconstruct": { + "ter_set": "t_concrete", + "items": [ + { "item": "scrap", "count": [ 12, 16 ] }, + { "item": "steel_chunk", "count": [ 4, 6 ] }, + { "item": "lead", "charges": [ 4, 16 ] }, + { "item": "cable", "charges": [ 60, 120 ] }, + { "item": "sheet_metal", "count": [ 2, 6 ] }, + { "item": "ceramic_shard", "count": [ 4, 12 ] } + ] + }, "bash": { "str_min": 20, "str_max": 150, @@ -979,7 +1105,18 @@ "looks_like": "t_machinery_electronic", "move_cost": 0, "coverage": 50, - "flags": [ "TRANSPARENT", "NOITEM", "WALL", "PERMEABLE" ], + "flags": [ "TRANSPARENT", "NOITEM", "WALL", "PERMEABLE", "ADV_DECONSTRUCT" ], + "deconstruct": { + "ter_set": "t_concrete", + "items": [ + { "item": "scrap", "count": [ 12, 16 ] }, + { "item": "steel_chunk", "count": [ 4, 6 ] }, + { "item": "lead", "charges": [ 12, 32 ] }, + { "item": "cable", "charges": [ 20, 40 ] }, + { "item": "sheet_metal", "count": [ 2, 6 ] }, + { "item": "ceramic_shard", "count": [ 4, 12 ] } + ] + }, "bash": { "str_min": 20, "str_max": 150, diff --git a/data/json/furniture_and_terrain/terrain-mechanisms.json b/data/json/furniture_and_terrain/terrain-mechanisms.json index b5bd2c68b290..6768342680bd 100644 --- a/data/json/furniture_and_terrain/terrain-mechanisms.json +++ b/data/json/furniture_and_terrain/terrain-mechanisms.json @@ -9,7 +9,22 @@ "move_cost": 0, "coverage": 50, "roof": "t_flat_roof", - "flags": [ "TRANSPARENT", "NOITEM", "INDOORS", "SHORT", "PERMEABLE" ], + "flags": [ "TRANSPARENT", "NOITEM", "INDOORS", "SHORT", "PERMEABLE", "ADV_DECONSTRUCT" ], + "deconstruct": { + "ter_set": "t_floor", + "items": [ + { "item": "processor", "count": [ 1, 2 ] }, + { "item": "RAM", "count": [ 4, 8 ] }, + { "item": "cable", "charges": [ 4, 6 ] }, + { "item": "large_lcd_screen", "count": 1 }, + { "item": "e_scrap", "count": [ 10, 16 ] }, + { "item": "circuit", "count": [ 6, 10 ] }, + { "item": "power_supply", "count": [ 2, 4 ] }, + { "item": "amplifier", "count": [ 2, 4 ] }, + { "item": "plastic_chunk", "count": [ 10, 12 ] }, + { "item": "scrap", "count": [ 6, 8 ] } + ] + }, "bash": { "str_min": 16, "str_max": 150, @@ -43,7 +58,22 @@ "coverage": 50, "light_emitted": 10, "roof": "t_flat_roof", - "flags": [ "TRANSPARENT", "CONSOLE", "NOITEM", "INDOORS", "SHORT", "PERMEABLE" ], + "flags": [ "TRANSPARENT", "CONSOLE", "NOITEM", "INDOORS", "SHORT", "PERMEABLE", "ADV_DECONSTRUCT" ], + "deconstruct": { + "ter_set": "t_floor", + "items": [ + { "item": "processor", "count": [ 1, 2 ] }, + { "item": "RAM", "count": [ 4, 8 ] }, + { "item": "cable", "charges": [ 4, 6 ] }, + { "item": "large_lcd_screen", "count": 1 }, + { "item": "e_scrap", "count": [ 10, 16 ] }, + { "item": "circuit", "count": [ 6, 10 ] }, + { "item": "power_supply", "count": [ 2, 4 ] }, + { "item": "amplifier", "count": [ 2, 4 ] }, + { "item": "plastic_chunk", "count": [ 10, 12 ] }, + { "item": "scrap", "count": [ 6, 8 ] } + ] + }, "bash": { "str_min": 8, "str_max": 150, diff --git a/doc/src/content/docs/en/mod/json/reference/json_flags.md b/doc/src/content/docs/en/mod/json/reference/json_flags.md index c423df3c07da..2ed877c89b24 100644 --- a/doc/src/content/docs/en/mod/json/reference/json_flags.md +++ b/doc/src/content/docs/en/mod/json/reference/json_flags.md @@ -518,6 +518,9 @@ List of known flags, used in both `terrain.json` and `furniture.json`. | O ``` +- `ADV_DECONSTRUCT` This cannot be deconstructed using normal deconstruction; a specially-defined + construction action is necessary. Most of these fall under the "`advanced_object_deconstruction`" + group. - `BARRICADABLE_DOOR_DAMAGED` - `BARRICADABLE_DOOR_REINFORCED_DAMAGED` - `BARRICADABLE_DOOR_REINFORCED` diff --git a/src/construction.cpp b/src/construction.cpp index e0a52c5ec599..d0a21f6bd49e 100644 --- a/src/construction.cpp +++ b/src/construction.cpp @@ -983,6 +983,13 @@ bool can_construct( const construction &con, const tripoint &p ) bool place_okay = con.pre_special( p ); // see if the terrain type checks out place_okay &= has_pre_terrain( con, p ); + // see if the (deny) flags check out + place_okay &= std::none_of( con.deny_flags.begin(), con.deny_flags.end(), + [&p, &here]( const std::string & flag ) -> bool { + const furn_id &furn = here.furn( p ); + const ter_id &ter = here.ter( p ); + return furn == f_null ? ter->has_flag( flag ) : furn->has_flag( flag ); + } ); // see if the flags check out place_okay &= std::all_of( con.pre_flags.begin(), con.pre_flags.end(), [&p, &here]( const std::string & flag ) -> bool { @@ -1658,6 +1665,7 @@ void construction::load( const JsonObject &jo, const std::string &/*src*/ ) optional( jo, was_loaded, "post_terrain", post_terrain ); optional( jo, was_loaded, "post_furniture", post_furniture ); assign( jo, "pre_flags", pre_flags ); + optional( jo, was_loaded, "deny_flags", deny_flags ); optional( jo, was_loaded, "post_flags", post_flags ); if( jo.has_member( "byproducts" ) ) { @@ -1728,7 +1736,12 @@ void construction::load( const JsonObject &jo, const std::string &/*src*/ ) if( !post_special || !s.empty() ) { auto it = post_special_map.find( s ); if( it != post_special_map.end() ) { - post_special = it->second; + if( s == "done_deconstruct" && ( !post_terrain.is_empty() || !post_furniture.is_empty() ) ) { + jo.throw_error( "Can't use post_special function \"done_deconstruct\" alongside post_terrain/post_furniture fields", + s ); + } else { + post_special = it->second; + } } else { debugmsg( "Unknown post_special function \"%s\"", s ); } @@ -1783,7 +1796,7 @@ void construction::check() const void construction::finalize() { if( !group.is_valid() ) { - debugmsg( "Invalid construction group (%s) defiend for construction (%s)", group, id ); + debugmsg( "Invalid construction group (%s) defined for construction (%s)", group, id ); } if( vehicle_start ) { std::vector frame_items; diff --git a/src/construction.h b/src/construction.h index 64b09ef00174..d310349ff181 100644 --- a/src/construction.h +++ b/src/construction.h @@ -65,6 +65,9 @@ struct construction { // Flags beginning terrain must have std::set pre_flags; + // Flags that exclude a given terrain tile + std::set deny_flags; + // Post construction flags std::set post_flags; diff --git a/src/mapdata.h b/src/mapdata.h index cc96c6b637e9..1dfde25ae0b9 100644 --- a/src/mapdata.h +++ b/src/mapdata.h @@ -224,6 +224,7 @@ struct pry_result { * OPENCLOSE_INSIDE - If it's a door (with an 'open' or 'close' field), it can only be opened or closed if you're inside. * PERMEABLE - Allows gases to flow through unimpeded. * RAMP - Higher z-levels can be accessed from this tile + * ADV_DECONSTRUCT - Player cannot use "Deconstruct (Simple) Furniture"; alternative means are required * EASY_DECONSTRUCT - Player can deconstruct this without tools * HIDE_PLACE - Creature on this tile can't be seen by other creature not standing on adjacent tiles * BLOCK_WIND - This tile will partially block wind