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

[MoM] Psi equation fixes #70536

Merged
merged 9 commits into from
Dec 31, 2023

Conversation

Standing-Storm
Copy link
Contributor

@Standing-Storm Standing-Storm commented Dec 30, 2023

Summary

Mods "[MoM] Psi equation fixes"

Purpose of change

I made a mistake in the equation--in order to prevent the psi equation from influencing the magic equation, I took out the cap for psi_effective_skill. Unfortunately, that led to very strange behavior, since when effective skill was above 30 it stated to come back down the other side of the convex function. And it didn't even work, since when it hit 30 effective skill by Magiclysm's formula it suddenly snapped to zero.

Describe the solution

Re-work the formula slightly so that powers with the PSIONIC flag check up to 40 effective skill instead of 30:

if( ( effective_skill > 30.0f && !has_flag(spell_flag::PSIONIC ) ) || ( psi_effective_skill > 40.0f && has_flag(spell_flag::PSIONIC ) ) )

This makes sure that magic follows the magic formula and psi follows the psi formula, and it also gives psi more room to breathe so that focus can take effect--previously it was very easy to hit the 30 effectiveness skill cap and jump straight to "no failure chance" since focus calculations take place further down the function.

I also went through and added "skill": "metaphysics" to every power that was missing it.

Describe alternatives you've considered

Testing

At metaphysics 0 with high focus, fail chance is a coinflip. At metaphysics 0 with low focus, powers are unusable. That's fine with me--this is the equivalent of attacking a zombie with melee skill 0 at high stamina and low stamina. Train your skills if you want to be successful.

At metaphysics 6 with high focus, fail chance is basically nil. At metaphysics 6 with low focus, fail chance ranged from 5% to 20% depending on power level.

At metaphysics 10, low-Difficulty powers always succeeded even at low focus and even at extremely high (500+) levels of pain reducing Intelligence to 0. Even high-Difficulty powers only had a 20% failure chance.

(I might want to do something with flags or something to make pain itself have an effect on psi above and beyond loss of intelligence, since even Professor X would have trouble if all of his limbs were broken and he was suffering from arterial bleeding, but that's out of scope for this PR)

At no point did I witness higher skill or power level causing an increase in failure chance.

Additional context

Lesson to self--always test with a slime mutant.

@github-actions github-actions bot requested a review from KorGgenT December 30, 2023 23:46
@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Mods Issues related to mods or modding [C++] Changes (can be) made in C++. Previously named `Code` Mods: Mind Over Matter labels Dec 30, 2023
src/magic.cpp Outdated Show resolved Hide resolved
src/magic.cpp Outdated Show resolved Hide resolved
src/magic.cpp Outdated Show resolved Hide resolved
Standing-Storm and others added 6 commits December 30, 2023 17:49
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@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 BasicBuildPassed This PR builds correctly, label assigned by github actions labels Dec 30, 2023
@Maleclypse Maleclypse merged commit 502fa46 into CleverRaven:master Dec 31, 2023
24 of 28 checks passed
@Standing-Storm Standing-Storm deleted the psi-equation-fixes branch December 31, 2023 03:19
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` [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Mods: Mind Over Matter Mods Issues related to mods or modding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants