From ca9224818ab4dafe6b472656582043619c9ee82e Mon Sep 17 00:00:00 2001 From: marilynias Date: Tue, 17 Dec 2024 13:40:48 +0100 Subject: [PATCH 1/3] make char_kiln item deployable --- data/json/construction/furniture_tools.json | 13 ++-- data/json/construction_group.json | 4 +- .../furniture-tools.json | 5 +- data/json/items/tool/metalworking.json | 67 +------------------ .../migration_items.json | 15 +++++ data/json/recipes/recipe_others.json | 22 ------ data/json/uncraft/recipe_deconstruction.json | 9 --- 7 files changed, 29 insertions(+), 106 deletions(-) diff --git a/data/json/construction/furniture_tools.json b/data/json/construction/furniture_tools.json index c4a4c82f45d7f..315d861a6b63a 100644 --- a/data/json/construction/furniture_tools.json +++ b/data/json/construction/furniture_tools.json @@ -291,14 +291,15 @@ { "type": "construction", "id": "constr_kiln_metal_empty", - "group": "build_metal_charcoal_kiln", + "group": "place_metal_charcoal_kiln", "category": "FURN", - "required_skills": [ [ "fabrication", 3 ] ], - "time": "60 m", - "qualities": [ [ { "id": "HAMMER", "level": 2 } ], [ { "id": "SAW_M", "level": 1 } ] ], - "components": [ [ [ "metal_tank", 4 ] ], [ [ "pipe", 4 ] ] ], + "required_skills": [ [ "fabrication", 0 ] ], + "time": "1 m", + "components": [ [ [ "char_kiln", 1 ] ] ], + "pre_note": "Can be deconstructed without tools.", "pre_special": "check_empty", - "post_terrain": "f_kiln_metal_empty" + "post_terrain": "f_kiln_metal_empty", + "activity_level": "MODERATE_EXERCISE" }, { "type": "construction", diff --git a/data/json/construction_group.json b/data/json/construction_group.json index 0a457c2f9ad7b..1c62d9c2674fd 100644 --- a/data/json/construction_group.json +++ b/data/json/construction_group.json @@ -428,8 +428,8 @@ }, { "type": "construction_group", - "id": "build_metal_charcoal_kiln", - "name": "Build Metal Charcoal Kiln" + "id": "place_metal_charcoal_kiln", + "name": "Place Metal Charcoal Kiln" }, { "type": "construction_group", diff --git a/data/json/furniture_and_terrain/furniture-tools.json b/data/json/furniture_and_terrain/furniture-tools.json index 1c9c0f7532b55..ca7b2efc59d18 100644 --- a/data/json/furniture_and_terrain/furniture-tools.json +++ b/data/json/furniture_and_terrain/furniture-tools.json @@ -401,8 +401,8 @@ "examine_action": "kiln_empty", "max_volume": "250 L", "crafting_pseudo_item": "fake_char_kiln", - "flags": [ "CONTAINER", "FIRE_CONTAINER", "PLACE_ITEM" ], - "deconstruct": { "items": [ { "item": "metal_tank", "count": [ 1, 4 ] }, { "item": "pipe", "count": [ 2, 4 ] } ] }, + "flags": [ "CONTAINER", "FIRE_CONTAINER", "PLACE_ITEM", "EASY_DECONSTRUCT" ], + "deconstruct": { "items": [ { "item": "char_kiln", "count": 1 } ] }, "bash": { "str_min": 12, "str_max": 40, @@ -428,7 +428,6 @@ "required_str": -1, "examine_action": "kiln_full", "flags": [ "NOITEM", "SEALED", "CONTAINER", "FIRE_CONTAINER", "SUPPRESS_SMOKE", "PLACE_ITEM" ], - "deconstruct": { "items": [ { "item": "metal_tank", "count": [ 1, 4 ] }, { "item": "pipe", "count": [ 2, 4 ] } ] }, "bash": { "str_min": 12, "str_max": 40, diff --git a/data/json/items/tool/metalworking.json b/data/json/items/tool/metalworking.json index 69d81cf7af083..683ceb8cabfb5 100644 --- a/data/json/items/tool/metalworking.json +++ b/data/json/items/tool/metalworking.json @@ -123,8 +123,8 @@ "id": "char_kiln", "type": "GENERIC", "category": "tools", - "name": { "str": "charcoal kiln" }, - "description": "A stout metal box used for producing charcoal via pyrolysis: the incomplete burning of organic materials in the absence of oxygen.", + "name": { "str": "metal charcoal kiln" }, + "description": "A stout metal box used for producing charcoal via pyrolysis: the incomplete burning of organic materials in the absence of oxygen. Needs to be placed via the construction menu.", "weight": "16770 g", "volume": "65 L", "price": "160 USD", @@ -132,8 +132,7 @@ "material": [ "steel" ], "symbol": ";", "color": "dark_gray", - "use_action": [ "HEAT_LIQUID_ITEMS" ], - "qualities": [ [ "BOIL", 2 ], [ "CONTAIN", 1 ] ] + "use_action": { "type": "deploy_furn", "furn_type": "f_kiln_metal_empty" } }, { "id": "chisel", @@ -232,66 +231,6 @@ "use_action": { "type": "link_up", "cable_length": 2, "charge_rate": "1400 W" }, "melee_damage": { "bash": 8 } }, - { - "id": "kiln_done", - "type": "TOOL", - "category": "tools", - "name": { "str": "finished charcoal kiln" }, - "description": "A charcoal kiln that has finished burning. Disassemble it to get the charcoal.", - "weight": "27170 g", - "volume": "65 L", - "price": "1 USD", - "price_postapoc": "5 USD", - "material": [ "steel" ], - "symbol": ";", - "color": "brown" - }, - { - "id": "kiln_full", - "type": "TOOL", - "category": "tools", - "name": { "str": "filled charcoal kiln" }, - "description": "A kiln filled with wood which will become charcoal after a slow period of burning.", - "weight": "45142 g", - "volume": "65 L", - "price": "1 USD", - "price_postapoc": "5 USD", - "material": [ "steel", "wood" ], - "symbol": ";", - "color": "brown", - "use_action": { - "target": "kiln_lit", - "msg": "You light the wood.", - "need_fire": 1, - "need_fire_msg": "You need something to light it with!", - "menu_text": "Light wood", - "type": "transform" - }, - "flags": [ "ALLOWS_REMOTE_USE" ] - }, - { - "id": "kiln_lit", - "type": "GENERIC", - "category": "tools", - "name": { "str": "lit charcoal kiln" }, - "description": "A kiln full of wood that has been lit; better drop it!", - "weight": "15142 g", - "volume": "10 L", - "price": "1 USD", - "price_postapoc": "5 USD", - "material": [ "steel", "wood" ], - "symbol": ";", - "color": "brown", - "use_action": { - "target": "kiln_done", - "msg": "The kiln's embers have died out; you can now disassemble it to get the charcoal.", - "moves": 0, - "type": "delayed_transform", - "transform_age": 21600, - "not_ready_msg": "The kiln is still burning." - }, - "flags": [ "TRADER_AVOID", "ALLOWS_REMOTE_USE" ] - }, { "id": "link_sheet", "type": "TOOL", diff --git a/data/json/obsoletion_and_migration_0.I/migration_items.json b/data/json/obsoletion_and_migration_0.I/migration_items.json index a2fe4bc62b159..90e2befd7cace 100644 --- a/data/json/obsoletion_and_migration_0.I/migration_items.json +++ b/data/json/obsoletion_and_migration_0.I/migration_items.json @@ -2159,5 +2159,20 @@ "id": "peanutbutter_imitation", "type": "MIGRATION", "replace": "peanutbutter" + }, + { + "id": "kiln_full", + "type": "MIGRATION", + "replace": "char_kiln" + }, + { + "id": "kiln_lit", + "type": "MIGRATION", + "replace": "char_kiln" + }, + { + "id": "kiln_done", + "type": "MIGRATION", + "replace": "char_kiln" } ] diff --git a/data/json/recipes/recipe_others.json b/data/json/recipes/recipe_others.json index ffbe3eac6fd6f..8c2f95be0a8c8 100644 --- a/data/json/recipes/recipe_others.json +++ b/data/json/recipes/recipe_others.json @@ -1606,28 +1606,6 @@ [ [ "pipe_fittings", 4 ] ] ] }, - { - "type": "recipe", - "activity_level": "MODERATE_EXERCISE", - "result": "kiln_full", - "category": "CC_OTHER", - "subcategory": "CSC_OTHER_MATERIALS", - "skill_used": "fabrication", - "difficulty": 1, - "time": "1 m", - "autolearn": true, - "components": [ - [ - [ "splinter", 200 ], - [ "2x4", 12 ], - [ "stick", 20 ], - [ "bone_any", 156, "LIST" ], - [ "skewer_bone", 2000 ], - [ "log", 1 ] - ], - [ [ "char_kiln", 1 ] ] - ] - }, { "type": "recipe", "activity_level": "MODERATE_EXERCISE", diff --git a/data/json/uncraft/recipe_deconstruction.json b/data/json/uncraft/recipe_deconstruction.json index 19bba557da2ef..a4b4ac85ae974 100644 --- a/data/json/uncraft/recipe_deconstruction.json +++ b/data/json/uncraft/recipe_deconstruction.json @@ -3058,15 +3058,6 @@ "qualities": [ { "id": "SAW_M", "level": 2 } ], "components": [ [ [ "sheet_metal_small", 2 ] ] ] }, - { - "result": "kiln_done", - "type": "uncraft", - "activity_level": "LIGHT_EXERCISE", - "skill_used": "fabrication", - "difficulty": 1, - "time": "3 m", - "components": [ [ [ "charcoal", 5000 ] ], [ [ "char_kiln", 1 ] ] ] - }, { "type": "uncraft", "activity_level": "MODERATE_EXERCISE", From d2145c192a71295a7f6783541b2dd8bdaa16700d Mon Sep 17 00:00:00 2001 From: marilynias Date: Tue, 17 Dec 2024 15:05:59 +0100 Subject: [PATCH 2/3] add missing space --- data/json/items/tool/metalworking.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/items/tool/metalworking.json b/data/json/items/tool/metalworking.json index 683ceb8cabfb5..2ad0cb3c6c70d 100644 --- a/data/json/items/tool/metalworking.json +++ b/data/json/items/tool/metalworking.json @@ -124,7 +124,7 @@ "type": "GENERIC", "category": "tools", "name": { "str": "metal charcoal kiln" }, - "description": "A stout metal box used for producing charcoal via pyrolysis: the incomplete burning of organic materials in the absence of oxygen. Needs to be placed via the construction menu.", + "description": "A stout metal box used for producing charcoal via pyrolysis: the incomplete burning of organic materials in the absence of oxygen. Needs to be placed via the construction menu.", "weight": "16770 g", "volume": "65 L", "price": "160 USD", From c6475d0c613eb06ef2c7be04968f03d1404f905a Mon Sep 17 00:00:00 2001 From: marilynias Date: Thu, 19 Dec 2024 15:14:04 +0100 Subject: [PATCH 3/3] make portablwe own item, add to cpp --- data/json/construction/furniture_tools.json | 18 ++++-- data/json/construction_group.json | 7 ++- .../furniture-tools.json | 60 ++++++++++++++++++- data/json/items/tool/metalworking.json | 12 ++-- data/json/recipes/recipe_others.json | 26 +------- src/iexamine.cpp | 19 ++++-- 6 files changed, 101 insertions(+), 41 deletions(-) diff --git a/data/json/construction/furniture_tools.json b/data/json/construction/furniture_tools.json index 315d861a6b63a..3ca9c1cadd6be 100644 --- a/data/json/construction/furniture_tools.json +++ b/data/json/construction/furniture_tools.json @@ -291,15 +291,25 @@ { "type": "construction", "id": "constr_kiln_metal_empty", - "group": "place_metal_charcoal_kiln", + "group": "build_metal_charcoal_kiln", + "category": "FURN", + "required_skills": [ [ "fabrication", 3 ] ], + "time": "60 m", + "qualities": [ [ { "id": "HAMMER", "level": 2 } ], [ { "id": "SAW_M", "level": 1 } ] ], + "components": [ [ [ "metal_tank", 4 ] ], [ [ "pipe", 4 ] ] ], + "pre_special": "check_empty", + "post_terrain": "f_kiln_metal_empty" + }, + { + "type": "construction", + "id": "constr_kiln_portable_empty", + "group": "place_char_kiln", "category": "FURN", "required_skills": [ [ "fabrication", 0 ] ], "time": "1 m", "components": [ [ [ "char_kiln", 1 ] ] ], - "pre_note": "Can be deconstructed without tools.", "pre_special": "check_empty", - "post_terrain": "f_kiln_metal_empty", - "activity_level": "MODERATE_EXERCISE" + "post_terrain": "f_kiln_portable_empty" }, { "type": "construction", diff --git a/data/json/construction_group.json b/data/json/construction_group.json index 1c62d9c2674fd..b226c32f3e98c 100644 --- a/data/json/construction_group.json +++ b/data/json/construction_group.json @@ -428,7 +428,12 @@ }, { "type": "construction_group", - "id": "place_metal_charcoal_kiln", + "id": "build_metal_charcoal_kiln", + "name": "Build Metal Charcoal Kiln" + }, + { + "type": "construction_group", + "id": "place_char_kiln", "name": "Place Metal Charcoal Kiln" }, { diff --git a/data/json/furniture_and_terrain/furniture-tools.json b/data/json/furniture_and_terrain/furniture-tools.json index ca7b2efc59d18..cbfc29c3cf047 100644 --- a/data/json/furniture_and_terrain/furniture-tools.json +++ b/data/json/furniture_and_terrain/furniture-tools.json @@ -389,10 +389,11 @@ }, { "type": "furniture", - "id": "f_kiln_metal_empty", + "id": "f_kiln_portable_empty", "name": "metal charcoal kiln", "looks_like": "f_kiln_empty", "description": "A metal kiln designed to burn wood and organic material into charcoal in the absence of oxygen. Much more efficient than its archaic rock counterpart.", + "//": "based on p13 of http://ir.kefri.org/jspui/bitstream/123456789/117/1/Charcoal%20Production%20using%20Improved%20Earth%20Portable%20metal%20Drum%20and%20Casamance%20Kilns%20Forest%20Products%20Research%20Centre%20Karura%20Issue%20May%202006.pdf", "symbol": "U", "color": "blue", "move_cost_mod": -1, @@ -401,8 +402,62 @@ "examine_action": "kiln_empty", "max_volume": "250 L", "crafting_pseudo_item": "fake_char_kiln", - "flags": [ "CONTAINER", "FIRE_CONTAINER", "PLACE_ITEM", "EASY_DECONSTRUCT" ], + "flags": [ "CONTAINER", "FIRE_CONTAINER", "PLACE_ITEM" ], "deconstruct": { "items": [ { "item": "char_kiln", "count": 1 } ] }, + "bash": { + "str_min": 12, + "str_max": 40, + "sound": "metal screeching!", + "sound_fail": "clang!", + "items": [ + { "item": "steel_lump", "count": [ 2, 12 ] }, + { "item": "steel_chunk", "count": [ 4, 15 ] }, + { "item": "pipe", "count": [ 0, 1 ] } + ] + } + }, + { + "type": "furniture", + "id": "f_kiln_portable_full", + "name": "filled metal charcoal kiln", + "looks_like": "f_kiln_metal_empty", + "description": "A metal kiln designed to burn wood and organic material into charcoal in the absence of oxygen. Much more efficient than its archaic rock counterpart.", + "symbol": "U", + "color": "blue_red", + "move_cost_mod": -1, + "coverage": 40, + "required_str": -1, + "examine_action": "kiln_full", + "deconstruct": { "items": [ { "item": "char_kiln", "count": 1 } ] }, + "flags": [ "NOITEM", "SEALED", "CONTAINER", "FIRE_CONTAINER", "SUPPRESS_SMOKE", "PLACE_ITEM" ], + "bash": { + "str_min": 12, + "str_max": 40, + "sound": "metal screeching!", + "sound_fail": "clang!", + "items": [ + { "item": "steel_lump", "count": [ 2, 12 ] }, + { "item": "steel_chunk", "count": [ 4, 15 ] }, + { "item": "pipe", "count": [ 0, 1 ] } + ] + } + }, + { + "type": "furniture", + "id": "f_kiln_metal_empty", + "name": "metal charcoal kiln", + "looks_like": "f_kiln_empty", + "description": "A metal kiln designed to burn wood and organic material into charcoal in the absence of oxygen. Much more efficient than its archaic rock counterpart.", + "symbol": "U", + "color": "blue", + "move_cost_mod": -1, + "coverage": 40, + "required_str": -1, + "examine_action": "kiln_empty", + "max_volume": "250 L", + "crafting_pseudo_item": "fake_char_kiln", + "flags": [ "CONTAINER", "FIRE_CONTAINER", "PLACE_ITEM" ], + "deconstruct": { "items": [ { "item": "metal_tank", "count": [ 1, 4 ] }, { "item": "pipe", "count": [ 2, 4 ] } ] }, "bash": { "str_min": 12, "str_max": 40, @@ -427,6 +482,7 @@ "coverage": 40, "required_str": -1, "examine_action": "kiln_full", + "deconstruct": { "items": [ { "item": "metal_tank", "count": [ 1, 4 ] }, { "item": "pipe", "count": [ 2, 4 ] } ] }, "flags": [ "NOITEM", "SEALED", "CONTAINER", "FIRE_CONTAINER", "SUPPRESS_SMOKE", "PLACE_ITEM" ], "bash": { "str_min": 12, diff --git a/data/json/items/tool/metalworking.json b/data/json/items/tool/metalworking.json index 2ad0cb3c6c70d..349d3f258ab93 100644 --- a/data/json/items/tool/metalworking.json +++ b/data/json/items/tool/metalworking.json @@ -123,16 +123,18 @@ "id": "char_kiln", "type": "GENERIC", "category": "tools", - "name": { "str": "metal charcoal kiln" }, - "description": "A stout metal box used for producing charcoal via pyrolysis: the incomplete burning of organic materials in the absence of oxygen. Needs to be placed via the construction menu.", - "weight": "16770 g", - "volume": "65 L", + "name": { "str": "portable charcoal kiln" }, + "description": "A somewhat portable drum kiln to produce charcoal via pyrolysis: the incomplete burning of organic materials in the absence of oxygen. Needs to be deployed before use.", + "//": "Based on https://github.com/user-attachments/files/18196633/UsingimprovedkilnstoproducecharcoalinKenya-Apracticalguide.pdf Page 6", + "weight": "21 kg", + "volume": "201 L", "price": "160 USD", "price_postapoc": "10 USD", "material": [ "steel" ], + "pocket_data": [ { "pocket_type": "CONTAINER", "rigid": true, "max_contains_volume": "200 L", "max_contains_weight": "500 kg" } ], "symbol": ";", "color": "dark_gray", - "use_action": { "type": "deploy_furn", "furn_type": "f_kiln_metal_empty" } + "use_action": { "type": "deploy_furn", "furn_type": "f_kiln_portable_empty" } }, { "id": "chisel", diff --git a/data/json/recipes/recipe_others.json b/data/json/recipes/recipe_others.json index 8c2f95be0a8c8..e849acd9c4ba4 100644 --- a/data/json/recipes/recipe_others.json +++ b/data/json/recipes/recipe_others.json @@ -1580,31 +1580,9 @@ "time": "1 h 30 m", "autolearn": true, "book_learn": [ [ "textbook_fabrication", 2 ], [ "manual_fabrication", 2 ] ], - "qualities": [ - { "id": "HAMMER", "level": 3 }, - { "id": "SAW_M", "level": 1 }, - { "id": "SCREW", "level": 1 }, - { "id": "WRENCH", "level": 1 } - ], - "tools": [ - [ - [ "welder", 150 ], - [ "welding_kit", 150 ], - [ "welder_crude", 225 ], - [ "integrated_welder", 225 ], - [ "soldering_iron", 225 ], - [ "soldering_iron_portable", 225 ], - [ "integrated_electrokit", 225 ], - [ "oxy_torch", 30 ] - ] - ], + "qualities": [ { "id": "HAMMER", "level": 3 }, [ { "id": "SAW_M", "level": 1 }, { "id": "CUT", "level": 1 } ] ], "proficiencies": [ { "proficiency": "prof_metalworking" } ], - "components": [ - [ [ "steel_lump", 5 ], [ "steel_chunk", 20 ], [ "scrap", 60 ] ], - [ [ "metal_tank", 1 ] ], - [ [ "pipe", 6 ] ], - [ [ "pipe_fittings", 4 ] ] - ] + "components": [ [ [ "55gal_drum", 1 ] ], [ [ "pipe", 2 ] ] ] }, { "type": "recipe", diff --git a/src/iexamine.cpp b/src/iexamine.cpp index 1f38e0fc7b76e..7ead65915e1f1 100644 --- a/src/iexamine.cpp +++ b/src/iexamine.cpp @@ -146,6 +146,8 @@ static const furn_str_id furn_f_kiln_empty( "f_kiln_empty" ); static const furn_str_id furn_f_kiln_full( "f_kiln_full" ); static const furn_str_id furn_f_kiln_metal_empty( "f_kiln_metal_empty" ); static const furn_str_id furn_f_kiln_metal_full( "f_kiln_metal_full" ); +static const furn_str_id furn_f_kiln_portable_empty( "f_kiln_portable_empty" ); +static const furn_str_id furn_f_kiln_portable_full( "f_kiln_portable_full" ); static const furn_str_id furn_f_metal_smoking_rack( "f_metal_smoking_rack" ); static const furn_str_id furn_f_metal_smoking_rack_active( "f_metal_smoking_rack_active" ); static const furn_str_id furn_f_safe_o( "f_safe_o" ); @@ -2949,6 +2951,8 @@ void iexamine::kiln_empty( Character &you, const tripoint_bub_ms &examp ) next_kiln_type = furn_f_kiln_full; } else if( cur_kiln_type == furn_f_kiln_metal_empty ) { next_kiln_type = furn_f_kiln_metal_full; + } else if( cur_kiln_type == furn_f_kiln_portable_empty ) { + next_kiln_type = furn_f_kiln_portable_full; } else { debugmsg( "Examined furniture has action kiln_empty, but is of type %s", cur_kiln_type.id().c_str() ); @@ -2987,8 +2991,11 @@ void iexamine::kiln_empty( Character &you, const tripoint_bub_ms &examp ) const float skill = you.get_skill_level( skill_fabrication ); int loss = 0; // if the current kiln is a metal one, use a more efficient conversion rate otherwise default to assuming it is a rock pit kiln - if( cur_kiln_type == furn_f_kiln_metal_empty ) { + if (cur_kiln_type == furn_f_kiln_metal_empty){ loss = 20 - 2 * skill; + } + else if(cur_kiln_type == furn_f_kiln_portable_empty){ + loss = 25 - 2 * skill; } else { loss = 60 - 2 * skill; } @@ -3038,13 +3045,15 @@ void iexamine::kiln_full( Character &, const tripoint_bub_ms &examp ) map &here = get_map(); const furn_id &cur_kiln_type = here.furn( examp ); furn_id next_kiln_type = furn_str_id::NULL_ID(); - if( cur_kiln_type == furn_f_kiln_full ) { - next_kiln_type = furn_f_kiln_empty; - } else if( cur_kiln_type == furn_f_kiln_metal_full ) { + if( cur_kiln_type == furn_f_kiln_metal_full ) { next_kiln_type = furn_f_kiln_metal_empty; + } else if( cur_kiln_type == furn_f_kiln_portable_full ){ + next_kiln_type = furn_f_kiln_portable_empty; + } else if( cur_kiln_type == furn_f_kiln_full ){ + next_kiln_type = furn_f_kiln_empty; } else { debugmsg( "Examined furniture has action kiln_full, but is of type %s", - cur_kiln_type.id().c_str() ); + cur_kiln_type.id().c_str() ); return; } map_stack items = here.i_at( examp );