Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onboard chemistry lab electrolysis #36822

Merged
merged 5 commits into from Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/json/recipes/recipe_electronics.json
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,7 @@
"components": [
[ [ "frame", 1 ] ],
[ [ "chemistry_set", 1 ] ],
[ [ "electrolysis_kit", 1 ] ],
[ [ "water_faucet", 1 ] ],
[ [ "power_supply", 1 ] ],
[ [ "cable", 5 ] ]
Expand Down
3 changes: 2 additions & 1 deletion data/json/vehicleparts/vehicle_parts.json
Original file line number Diff line number Diff line change
Expand Up @@ -2283,7 +2283,7 @@
"broken_symbol": "x",
"broken_color": "light_gray",
"damage_modifier": 10,
"description": "A small chemistry station, including a hotplate powered by the vehicle's batteries. 'e'xamine the tile with the chemistry lab to access the water faucet or to heat up food with the hotplate. If you attempt craft an item that needs one of the chemistry lab's functions, it will automatically be selected as a tool.",
"description": "A small chemistry station, including a hotplate and electrolysis setup powered by the vehicle's batteries. 'e'xamine the tile with the chemistry lab to access the water faucet or to heat up food with the hotplate. If you attempt craft an item that needs one of the chemistry lab's functions, it will automatically be selected as a tool.",
"durability": 80,
"size": 200,
"item": "chemlab",
Expand All @@ -2298,6 +2298,7 @@
{ "item": "steel_lump", "count": [ 4, 7 ] },
{ "item": "steel_chunk", "count": [ 4, 7 ] },
{ "item": "scrap", "count": [ 4, 7 ] },
{ "item": "cable", "charges": [ 30, 50 ] },
{ "item": "chemistry_set", "charges": 0, "prob": 50 },
{ "item": "hotplate", "charges": 0, "prob": 50 }
],
Expand Down
5 changes: 5 additions & 0 deletions src/inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,11 @@ void inventory::form_from_map( map &m, std::vector<tripoint> pts, const Characte
chemistry_set.charges = veh->fuel_left( "battery", true );
chemistry_set.item_tags.insert( "PSEUDO" );
add_item( chemistry_set );

item electrolysis_kit( "electrolysis_kit", 0 );
electrolysis_kit.charges = veh->fuel_left( "battery", true );
electrolysis_kit.item_tags.insert( "PSEUDO" );
add_item( electrolysis_kit );
}
}
pts.clear();
Expand Down
2 changes: 2 additions & 0 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4852,6 +4852,8 @@ std::list<item> map::use_charges( const tripoint &origin, const int range,
ftype = "battery";
} else if( type == "hotplate" ) {
ftype = "battery";
} else if( type == "electrolysis_kit" ) {
ftype = "battery";
}

// TODO: add a sane birthday arg
Expand Down