Skip to content

Commit

Permalink
Make Air Filtration CBM Useful (#1439)
Browse files Browse the repository at this point in the history
* Update character.cpp

* Update item.cpp

* Update bionics.json

* Update bionics.json

* Forgot to add "time" value.

Bionic thus didn't consume power when active

* One of the descriptions had extra spaces.
  • Loading branch information
KheirFerrum authored Apr 6, 2022
1 parent c67bb9d commit d8b3b31
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
19 changes: 16 additions & 3 deletions data/json/bionics.json
Original file line number Diff line number Diff line change
Expand Up @@ -807,11 +807,24 @@
{
"id": "bio_purifier",
"type": "bionic",
"name": { "str": "Air Filtration System" },
"description": "Surgically implanted in your trachea is an advanced filtration system. If toxins, or airborne diseases find their way into your windpipe, the filter will attempt to remove them.",
"name": { "str": "Air Filtration System (passive)" },
"description": "Surgically implanted in your trachea is an advanced filtration system. In it's passive form it will protect you against smoke inhalation. Once activated, it will prevent spores, toxins and diseases from being inhaled.",
"occupied_bodyparts": [ [ "torso", 4 ], [ "mouth", 2 ] ],
"env_protec": [ [ "mouth", 7 ] ],
"flags": [ "BIONIC_NPC_USABLE" ]
"flags": [ "BIONIC_NPC_USABLE" ],
"included_bionics": [ "bio_purifier_active" ]
},
{
"id": "bio_purifier_active",
"type": "bionic",
"name": { "str": "Air Filtration System (active)" },
"description": "Surgically implanted in your trachea is an advanced filtration system. In it's passive form it will protect you against smoke inhalation. Once activated, it will prevent spores, toxins and diseases from being inhaled.",
"env_protec": [ [ "mouth", 8 ] ],
"included": true,
"flags": [ "BIONIC_TOGGLED" , "BIONIC_NPC_USABLE" ],
"act_cost": "100 J",
"react_cost": "10 J",
"time": 1
},
{
"id": "bio_radscrubber",
Expand Down
2 changes: 1 addition & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6981,7 +6981,7 @@ int Character::get_env_resist( bodypart_id bp ) const

for( const bionic_id &bid : get_bionics() ) {
const auto EP = bid->env_protec.find( bp.id() );
if( EP != bid->env_protec.end() ) {
if( ( !bid->activated || has_active_bionic( bid ) ) && EP != bid->env_protec.end() ) {
ret += EP->second;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3239,7 +3239,7 @@ void item::bionic_info( std::vector<iteminfo> &info, const iteminfo_query *parts

if( !bid->env_protec.empty() ) {
info.push_back( iteminfo( "DESCRIPTION",
_( "<bold>Environmental Protection</bold>: " ),
bid->activated ? _( "<bold>Environmental Protection (activated)</bold>: " ) : _( "<bold>Environmental Protection</bold>: " ),
iteminfo::no_newline ) );
for( const std::pair< const bodypart_str_id, int > element : sorted_lex( bid->env_protec ) ) {
info.push_back( iteminfo( "CBM", body_part_name_as_heading( element.first->token, 1 ),
Expand Down

0 comments on commit d8b3b31

Please sign in to comment.