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

eoc: replace u_set_hp with math #70820

Merged
merged 3 commits into from
Jan 14, 2024

Conversation

andrei8l
Copy link
Contributor

Summary

None

Purpose of change

Continue migrating things to math

Describe the solution

  1. Replace "u_set_hp" with math's u_hp()
  2. Add ALL_MAJOR and ALL_MINOR special values to u_hp() to emulate "major_only" and "minor_only"
  3. Make widget clauses set a context variable and use math's u_hp() there too
  4. Delete "u_val": "hp"

Describe alternatives you've considered

N/A

Testing

Loaded a test with all mods.
Widget tests still pass.

Additional context

@GuardianDll can you double check the JSON please. In particular, there are some odd cases where all hp is set to 999 then individually to X that I might have misunderstood.

The old increase_only can be replaced with max( u_hp(...), ...) but that doesn't work well with ALL/ALL_MAJOR/ALL_MINOR. It

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. NPC / Factions NPCs, AI, Speech, Factions, Ownership Info / User Interface Game - player communication, menus, etc. [JSON] Changes (can be) made in JSON Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs Mods: Magiclysm Anything to do with the Magiclysm mod Mechanics: Enchantments / Spells Enchantments and spells Limbs Limbs, mutable limbs, and code related to them. Mods: Defense Mode Anything to do with the Defense Mode mod EOC: Effects On Condition Anything concerning Effects On Condition Mods: Xedra Evolved Anything to do with Xedra Evolved Mods: Mind Over Matter Mods: Sky Island Anything about the Sky Island mod <Bugfix> This is a fix for a bug (or closes open issue) labels Jan 10, 2024
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: @GuardianDll @Standing-Storm @wapcaplet

@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Jan 10, 2024
@GuardianDll
Copy link
Member

GuardianDll commented Jan 10, 2024

odd cases where all hp is set to 999 then individually to X that I might have misunderstood

iirc it's because, for some reason, when you die, even if prevent death event worked as expected, hp of all sublimbs goes to 0, and it can't be healed
don't know is it still a problem, someone need to test it in the future

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jan 10, 2024
@Maleclypse Maleclypse merged commit 88ec08a into CleverRaven:master Jan 14, 2024
@andrei8l andrei8l deleted the eoc-delete-u_set_hp branch January 14, 2024 04:46
@andrei8l
Copy link
Contributor Author

Thanks for merging

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` Code: Tests Measurement, self-control, statistics, balancing. <Documentation> Design documents, internal info, guides and help. EOC: Effects On Condition Anything concerning Effects On Condition Info / User Interface Game - player communication, menus, etc. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Limbs Limbs, mutable limbs, and code related to them. [Markdown] Markdown issues and PRs Mechanics: Enchantments / Spells Enchantments and spells Mods: Defense Mode Anything to do with the Defense Mode mod Mods: Magiclysm Anything to do with the Magiclysm mod Mods: Mind Over Matter Mods: Sky Island Anything about the Sky Island mod Mods: Xedra Evolved Anything to do with Xedra Evolved NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

u_set_hp with target_part as a variable object is wrong.
3 participants