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

[AFS] bionic difficulty tweaks #42202

Merged
merged 1 commit into from
Jul 17, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions data/mods/Aftershock/options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"type": "furniture",
"id": "f_autodoc",
"name": "Autodoc Mk. XI",
"symbol": "&",
"color": "light_cyan",
"copy-from": "f_autodoc",
"flags": [ "TRANSPARENT", "AUTODOC" ],
"examine_action": "autodoc",
"//": "Easy installation",
"surgery_skill_multiplier": 999999
},
{
"id": "anesthetic",
"type": "requirement",
"//": "Anesthetic cost removed in this mod, as autodocs do all the heavy lifting.",
"tools": [ ]
},
{
"type": "EXTERNAL_OPTION",
"name": "CBM_SLOTS_ENABLED",
"stype": "bool",
"value": true
}
]
12 changes: 10 additions & 2 deletions src/game_inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,11 @@ class bionic_install_preset: public inventory_selector_preset
const int duration = loc.get_item()->type->bionic->difficulty * 2;
const requirement_data req_anesth = *requirement_id( "anesthetic" ) *
duration * weight;
return string_format( _( "%i mL" ), req_anesth.get_tools().front().front().count );
int count = 0;
if( !req_anesth.get_tools().empty() && !req_anesth.get_tools().front().empty() ) {
count = req_anesth.get_tools().front().front().count;
}
return string_format( _( "%i mL" ), count );
}
};

Expand Down Expand Up @@ -1928,7 +1932,11 @@ class bionic_uninstall_preset : public inventory_selector_preset
const int duration = loc.get_item()->type->bionic->difficulty * 2;
const requirement_data req_anesth = *requirement_id( "anesthetic" ) *
duration * weight;
return string_format( _( "%i mL" ), req_anesth.get_tools().front().front().count );
int count = 0;
if( !req_anesth.get_tools().empty() && !req_anesth.get_tools().front().empty() ) {
count = req_anesth.get_tools().front().front().count;
}
return string_format( _( "%i mL" ), count );
}
};

Expand Down