[core] Unify more Core/Lua TP Gain Functions#9859
Open
UmeboshiXI wants to merge 1 commit intoLandSandBoat:basefrom
Open
[core] Unify more Core/Lua TP Gain Functions#9859UmeboshiXI wants to merge 1 commit intoLandSandBoat:basefrom
UmeboshiXI wants to merge 1 commit intoLandSandBoat:basefrom
Conversation
WinterSolstice8
approved these changes
Apr 24, 2026
zach2good
reviewed
Apr 24, 2026
| @@ -2421,4 +2421,4 @@ | |||
| ((baseTp + 30) * sBlowMult * | |||
Contributor
There was a problem hiding this comment.
Is this truncation also happening here?
| ((baseTp + 30) * sBlowMult * | ||
| (1.0f + 0.01f * (float)PDefender->getMod(Mod::STORETP))))); // subtle blow also reduces the "+30" on mob tp gain | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
All of this is very hard to read, could you break out the additional terms like it does above:
// account for attacker's subtle blow which reduces the baseTP gain for the defender
float sBlow1 = std::clamp((float)(PAttacker->getMod(Mod::SUBTLE_BLOW) + sBlowMerit), -50.0f, 50.0f);
float sBlow2 = std::clamp((float)(PAttacker->getMod(Mod::SUBTLE_BLOW_II) + tandemBlowBonus), -50.0f, 50.0f);
float sBlowMult = (100.0f - std::clamp(sBlow1 + sBlow2, -75.0f, 75.0f)) / 100.0f;
Contributor
Author
There was a problem hiding this comment.
Hmm actually, I might sit down today and see about getting this working with our lua global. I hate this.
Contributor
Author
There was a problem hiding this comment.
Opted to hook up our TP lua functions to their equivalents in TakePhysicalDamage and TakeWeaponskillDamage.
7dede6d to
b0e02c1
Compare
b0e02c1 to
9a2000d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I affirm:
What does this pull request do?
Steps to test these changes
TP Returns based on this PR:
(Hit message came in late but it matched)

TP Returns from base LSB: