Skip to content

[core] getMobHP binding for mobskills#7736

Merged
zach2good merged 1 commit intoLandSandBoat:basefrom
UmeboshiXI:MOBSKILLS_MOBHP_BINDING
Jul 29, 2025
Merged

[core] getMobHP binding for mobskills#7736
zach2good merged 1 commit intoLandSandBoat:basefrom
UmeboshiXI:MOBSKILLS_MOBHP_BINDING

Conversation

@UmeboshiXI
Copy link
Copy Markdown
Contributor

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

Adds binding getMobHP binding for use in mobskill scripts. This retrieves the mob's HP when it firsts attempts to use the skill(Beginning of prepare time).

Use case: Many suicide skills use the mobs current HP(at the time it first started casting) for damage calculations.

Steps to test these changes

Currently not used, just ground work for upcoming PRs. You can test with prints.

  • Add a print in a onMobWeaponSkill(within a mobskill script) with the new binding: skill:getMobHP()
  • Force the mob to use the skill you edited with !tp 3000 when engaged or !exec target:useMobAbility(AbilityID, player)
  • See print returns mobs HP as it was on skill prepare rather than at time of execution.

Copy link
Copy Markdown
Contributor

@zach2good zach2good left a comment

Choose a reason for hiding this comment

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

Please change new functions to use trailing return syntax, and be const if possible:

auto CLuaMobSkill::getMobHP() const -> int32
{
  ....

Same applies in the header

@UmeboshiXI UmeboshiXI force-pushed the MOBSKILLS_MOBHP_BINDING branch from 30aa2dd to 2d9c01b Compare July 23, 2025 10:20
@UmeboshiXI UmeboshiXI force-pushed the MOBSKILLS_MOBHP_BINDING branch from 2d9c01b to 24e452b Compare July 23, 2025 10:31
@zach2good zach2good merged commit 9ea5da6 into LandSandBoat:base Jul 29, 2025
13 checks passed
claybie pushed a commit to claybie/LeafSpringCog that referenced this pull request Aug 11, 2025
…BINDING

[core] getMobHP binding for mobskills
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants