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

Allow EOCs to read item tool qualities #79511

Merged
merged 5 commits into from
Feb 4, 2025

Conversation

QuillInkwell
Copy link
Contributor

Summary

Infrastructure "Allow EOCs to read item tool qualities"

Purpose of change

I'm reworking the hacking EOCs in Aftershock and I could get around a lot of jank and redundant code by reading the tool quality directly from the beta talker.

As opposed to the current solution of creating 6 redundant eocs that will become invalid the moment a tool has it's hacking quality changed without updating the backend eocs. In fact just factoring in tool quality into the condition statement basically eliminates the need to manually list out every possible hacking tool id. Further reducing jank.

While this change doesn't necessarily open any doors we didn't already have access to, it does allow us to write EOCs that utilize tool qualities in a more robust and clean way.

Describe the solution

Add a new math function quality(). This function is valid only on item talkers and returns the level of a specified quality ID. It takes the tool quality id as an argument and has an optional kwarg "boiling", which when true requires an item to be empty to have it's boiling quality.

Describe alternatives you've considered

Not doing this, thus leaving in the EOC Jank.

Testing

Created a test EOC. Verified function produced the correct number when checking a tool's quality.
Tested a quality the tool did not have. Verified produced result as expected.
Attempted to use the function on a non-item talker. Var was not assigned and debug message was correctly thrown.

Additional context

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. NPC / Factions NPCs, AI, Speech, Factions, Ownership [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs labels Feb 3, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Auto-requesting reviews from non-collaborators: @andrei8l

@github-actions github-actions bot added Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Feb 3, 2025
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 3, 2025
src/math_parser_diag.cpp Outdated Show resolved Hide resolved
src/math_parser_diag.cpp Outdated Show resolved Hide resolved
Rename Boiling to strict,
Remove redundant branching and error throwing code
@QuillInkwell
Copy link
Contributor Author

Thank you kindly. I've gone ahead and incorporated those revisions.

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 3, 2025
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 4, 2025
@GuardianDll GuardianDll merged commit 3c801a2 into CleverRaven:master Feb 4, 2025
27 checks passed
@QuillInkwell QuillInkwell deleted the more_eoc_stuff branch February 4, 2025 15:45
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 [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style <Documentation> Design documents, internal info, guides and help. json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants