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] Fix Discern Weakness #72790

Merged
merged 8 commits into from
May 5, 2024

Conversation

Standing-Storm
Copy link
Contributor

@Standing-Storm Standing-Storm commented Apr 2, 2024

Summary

Mods "[MoM] Fix Discern Weakness"

Purpose of change

Discern Weakness has never really worked, at first because monsters couldn't take enchantments and then because effects couldn't read the stats of the originator. But now that I know more about EoCs I know how to fix this.

Describe the solution

Rather than Discern Weakness directly applying an effect, it evokes an EoC. First it saves the psion's Intelligence, Discern Weakness power level, and Nether Attunement as variables onto the target, and then the target applies the effect on themselves with its power level derived from those variables.

Describe alternatives you've considered

Testing

Tested and works. Looks like the changes to enchant code in #73227 fixed the bugs with variable-based monster enchants.

Debugged Intelligence and power level to 50 and:
image
Chunky salsa

Additional context

@Standing-Storm Standing-Storm marked this pull request as draft April 2, 2024 14:57
@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Mods Issues related to mods or modding EOC: Effects On Condition Anything concerning Effects On Condition Mods: Mind Over Matter labels Apr 2, 2024
@GuardianDll
Copy link
Member

Fyi monsters can get enchantments now

@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Apr 2, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Apr 2, 2024
@Standing-Storm
Copy link
Contributor Author

Standing-Storm commented Apr 2, 2024

Fyi monsters can get enchantments now

Right, but even after that was changed it still didn't work (because the effect saw u_spell_level('clair_spot_weakness') and went "Oh, this monster doesn't know that power" and multiplied by 0), so that's the part I need to fix.

@RedMisao
Copy link
Contributor

RedMisao commented Apr 2, 2024

If it works for you, effects can be detected on monsters (*) with EoCs, using the duration of the effect as a sort of internal timer from the monster's side.
At the same time, if you apply an effect -> enchantment with intermittent_activation -> spell on yourself, you can check any tagged monsters around you with the spell -> eoc, using an effect/var on the monster as condition, then force them to cast spells as u_cast_spell (**).

(*) Not sure if this is a bug or not. The doc mentions that monsters can't be the talker of u_has_effect, but it works consistently for me, using above for conditional spells, emulate disease spells and custom var acumulation over time.
(**) Would be simpler if intermittent_activation worked on monsters.

@Standing-Storm
Copy link
Contributor Author

Unfortunately, applying this throws an error message that appears to be caused by a bug in enchant on monster code. I'll make a bug report later.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 4, 2024
Copy link
Contributor

github-actions bot commented May 4, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@github-actions github-actions bot added the stale Closed for lack of activity, but still valid. label May 4, 2024
@Standing-Storm Standing-Storm marked this pull request as ready for review May 5, 2024 01:48
@github-actions github-actions bot removed the stale Closed for lack of activity, but still valid. label May 5, 2024
@Maleclypse Maleclypse merged commit eefe407 into CleverRaven:master May 5, 2024
25 checks passed
@Standing-Storm Standing-Storm deleted the discern-weakness branch May 5, 2024 18: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 EOC: Effects On Condition Anything concerning Effects On Condition [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.

4 participants