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

Fix missing ProcessAction between the last mana being paid and the spell being cast. #13396

Merged
merged 4 commits into from
Mar 15, 2025

Conversation

Grath
Copy link
Contributor

@Grath Grath commented Feb 27, 2025

Fixes #9669

This is necessary so that, among other things, the Rain of Riches watcher can see that the last mana of a spell was a Treasure before the spell is cast - at which point it needs to already have Cascade.

The spell casting sequence already contains many calls to processAction - processAction happens after each MANA_ADDED event, this adds one additional one after the final MANA_PAID event but before the ensuing SPELL_CAST event.
image

…ell being cast.

This is necessary so that, among other things, the Rain of Riches watcher can see that the last mana of a spell was a Treasure before the spell is cast - at which point it needs to already have Cascade.
@JayDi85
Copy link
Member

JayDi85 commented Feb 27, 2025

Add all related tests from #12127

@JayDi85 JayDi85 self-assigned this Feb 27, 2025
…ell being cast.

This is necessary so that, among other things, the Rain of Riches watcher can see that the last mana of a spell was a Treasure before the spell is cast - at which point it needs to already have Cascade.
@github-actions github-actions bot added the tests label Feb 27, 2025
@Grath
Copy link
Contributor Author

Grath commented Feb 27, 2025

Already added the tests to master (I split this up so that fixing Rain of Riches' broken logic could be committed at minimum, so that as long as you use your treasure first the cascade will work, as long as there's more than one mana to pay), but unskipped the tests in this PR which are currently failing due to this problem.

@Grath
Copy link
Contributor Author

Grath commented Feb 27, 2025

As it stands, without this processAction call, it is impossible to use Rain of Riches to make a 1 mana value spell cascade (because there's only one mana to be paid with a treasure), and to make a 2+ mana value spell cascade you must use your treasure before the last mana is paid so that the spell will gain cascade before the SPELL_CAST event fires.

@alexander-novo
Copy link
Contributor

It's a shame that the effort to fix this card had to be duplicated three times, but I'm glad things are moving forward.

@Grath
Copy link
Contributor Author

Grath commented Mar 7, 2025

I mean, most of the code I used for this came directly from Susucr's pull request, I just revived the effort and I merged the mechanical fixes to the card without asking permission because there was no reason not to at least fix the card while JayDi considers whether or not we're allowed to fix the engine.

Copy link
Contributor

@xenohedron xenohedron left a comment

Choose a reason for hiding this comment

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

There is still no good reason not to merge this fix

@Grath
Copy link
Contributor Author

Grath commented Mar 13, 2025

There have been at least a dozen reports about Rain of Riches being bugged, between Github and the Discord. There is no way to fix it without processing actions then because we need to observe if the last mana was a treasure and apply the ability to give the spell Cascade before it actually gets cast. This is the correct and necessary solution.

@xenohedron xenohedron merged commit a9bffe4 into magefree:master Mar 15, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rain of Riches does not cascade
4 participants