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

Fix dazzling blinding you when already blind(folded) #61099

Merged
merged 3 commits into from
Sep 28, 2022

Conversation

Venera3
Copy link
Member

@Venera3 Venera3 commented Sep 18, 2022

Summary

None

Purpose of change

Fix #61097

Describe the solution

Add BLIND to fd_dazzle's worn character immunity flags.
Handle blindfolds and similar optional worn field immunity flags by adding immunity_flags_worn_any to field type definitions - any one bodypart of the given types wearing their respective flag will grant immunity to the field in question.

Describe alternatives you've considered

None

Testing

Installed Glare Compensators before the change, walked into dazzling fields before and after activating it, got blinded both times.
After the changes only activated dampeners protect you.

After the optional flag changes both blindfolds and flash protection. will protect you from being blinded

Additional context

None?

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Sep 18, 2022
@Night-Pryanik
Copy link
Contributor

I'm working on fix for this issue as well. Please test your changes. Simple adding flag will make this CBM protect from dazzling even when it's non-activated.

@Venera3
Copy link
Member Author

Venera3 commented Sep 18, 2022

Looking at the code "active_flags": [ "BLIND" ] only confers the flag when activated, but fair's fair I suppose.

@Venera3 Venera3 marked this pull request as draft September 18, 2022 17:29
@Venera3
Copy link
Member Author

Venera3 commented Sep 18, 2022

Watch me forget bionics aren't considered worn like an idjit. Tested, works as inteded for the bionic, I might need to rejig the logic to allow for multiple optional flags to be worn.
Thank you.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Sep 18, 2022
@Night-Pryanik
Copy link
Contributor

My solution was to add check for active bionic with flag that grants immunity to Character::is_immune_field:

for( const bionic &bio : *my_bionics ) {
    if( bio.info().activated ) {
        if( has_active_bionic( bio.id ) && bio.info().has_active_flag( flag ) ) {
            return true;
        }
    }
}

@Venera3
Copy link
Member Author

Venera3 commented Sep 18, 2022

Active bionic flags are counted for Character::has_flag already, which routes this whole thing through my beloved charflags so that part was just sloppiness on my part. It did remind me that I ignored blindfolds, so I'll fiddle with it a bit to see if I can hook up a not-too-clunky solution.

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs labels Sep 23, 2022
@Venera3 Venera3 marked this pull request as ready for review September 23, 2022 10:50
@dseguin dseguin merged commit 51ee560 into CleverRaven:master Sep 28, 2022
captainego pushed a commit to captainego/Cataclysm-DDA that referenced this pull request Oct 9, 2022
* Update field_type.json

* Update field_type.json

* Blind fix fix

Co-authored-by: Venera3 <Venera3@users.noreply.github.com>
captainego pushed a commit to captainego/Cataclysm-DDA that referenced this pull request Oct 9, 2022
* Update field_type.json

* Update field_type.json

* Blind fix fix

Co-authored-by: Venera3 <Venera3@users.noreply.github.com>
sparr pushed a commit to sparr/Cataclysm-DDA that referenced this pull request Dec 10, 2022
* Update field_type.json

* Update field_type.json

* Blind fix fix

Co-authored-by: Venera3 <Venera3@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optical Dampers CBM does not block "blinding flare" effect from some enemies
3 participants