Skip to content

Commit

Permalink
make portablwe own item, add to cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
marilynias committed Dec 19, 2024
1 parent d2145c1 commit c6475d0
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 41 deletions.
18 changes: 14 additions & 4 deletions data/json/construction/furniture_tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 6 additions & 1 deletion data/json/construction_group.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down
60 changes: 58 additions & 2 deletions data/json/furniture_and_terrain/furniture-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
12 changes: 7 additions & 5 deletions data/json/items/tool/metalworking.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
26 changes: 2 additions & 24 deletions data/json/recipes/recipe_others.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
19 changes: 14 additions & 5 deletions src/iexamine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
Expand Down Expand Up @@ -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() );
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit c6475d0

Please sign in to comment.