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

Jsonize environemental protection form CBMs #32939

Merged
merged 6 commits into from
Aug 6, 2019

Conversation

Fris0uman
Copy link
Contributor

@Fris0uman Fris0uman commented Aug 5, 2019

Summary

SUMMARY: Infrastructure "Jsonize Environemental protection form cbm"

Purpose of change

Jsonize Environemental protection form cbm. Bump protection from eye armor and air filtration from 2 to 7.

Describe the solution

Add env_protec value in bionic_data, use this value in get_env_resist

Describe alternatives you've considered

Just changing harcoded value without json stuff.

Additional context

Did one test with environemental protection bumped to 27 for air filtration in json and walked through tear gas without coughing.

Adresses #30012, although I didn't see anything in the code about poison resistance from air filtration cbm

data/json/bionics.json Outdated Show resolved Hide resolved
@Fris0uman Fris0uman changed the title Jsonize environemental protection form CBMs [WIP] Jsonize environemental protection form CBMs Aug 5, 2019
@Fris0uman Fris0uman changed the title [WIP] Jsonize environemental protection form CBMs Jsonize environemental protection form CBMs Aug 5, 2019
@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON Bionics CBM (Compact Bionic Modules) labels Aug 6, 2019
@ZhilkinSerg ZhilkinSerg merged commit 67c4e98 into CleverRaven:master Aug 6, 2019
@Fris0uman Fris0uman deleted the env_proc_cbm branch August 6, 2019 08:10
ret = 5;
for( const bionic &bio : *my_bionics ) {
for( const auto &element : bio.info().env_protec ) {
if( element.first == bp || ( bp == bp_eyes && element.first == bp_head ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why special-case the eyes? People can just add eyes as well if they mean it, right?

if( ret > 5 ) {
ret = 5;
for( const bionic &bio : *my_bionics ) {
for( const auto &element : bio.info().env_protec ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have a std::map here, so you shouldn't need to loop over it. Although it would be a little awkward to do the lookup if you keep the eyes special case code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bionics CBM (Compact Bionic Modules) [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants