Skip to content

Commit

Permalink
Onboard chemistry lab electrolysis (#36822)
Browse files Browse the repository at this point in the history
  • Loading branch information
1n17 authored and kevingranade committed Jan 10, 2020
1 parent c3807e0 commit 397d11e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
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

0 comments on commit 397d11e

Please sign in to comment.