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

Update and cleanup the Xyz procedure #1130

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open

Update and cleanup the Xyz procedure #1130

wants to merge 29 commits into from

Conversation

edo9300
Copy link
Member

@edo9300 edo9300 commented Apr 9, 2024

Do a major cleanup of the xyz procedure removing various redoundancies and trying to make the code less convoluted.
All the various effects affecting the xyz procedure have been assigned a proper constant to make them more easily usable by other cards

EFFECT_XYZ_MAT_FROM_GRAVE           = 511002793
EFFECT_SPELL_XYZ_MAT                = 511000189 --Solid Overlay and similar cards
EFFECT_EQUIP_SPELL_XYZ_MAT          = 511001175
EFFECT_ORICHALCUM_CHAIN             = 511002116
EFFECT_DOUBLE_XYZ_MATERIAL          = 511001225
EFFECT_SATELLARKNIGHT_CAPELLA       = 86466163
EFFECT_STAR_SERAPH_SOVEREIGNTY      = 91110378

The behaviour for the "automatic material selection" has been also changed to make it less bug prone, now if must_use is provided to Duel.XyzSummon and if minc and maxc both correspond to the size of the must_use group, then no user selection will be performed (Advanced Heraldry Art, Shining Hope Road, etc.). This changes the current behaviour, so that if only mg is provided to Duel.XyzSummon, the player will still be able to select the cards, making so cards that summon using a specific material pool (Galaxy Tyranno, Goblin Biker Grand Stampede, etc.) no longer have to pass maxc and minc to not break things. Cards got updated accordingly.
Another minor thing that got changed, is the addition of the new "constant" Xyz.InfiniteMats, to be used in Xyz.AddProcedure instead of passing the magic value 99, to abstract away the logic from the user. (In future it will then be declared as a sentinel value making people no longer able to pass 99 to indicate infinite materials.)

edo9300 added 27 commits May 19, 2024 11:24
It was used when the xyz had an extra filter function on its materials while parsing EFFECT_SPELL_XYZ_MAT, being it a random generic token with properties this check is redoundant and most of the times it won't work, as if a card has a filter then it requires specific properties from the monster, now EFFECT_SPELL_XYZ_MAT will only be applied if the xyz has no filter function
Remove repeated checks for GetCardEffect, also properly short circuit the recursive function if a valid material set is found
Add more early returns and avoid extra recursions
Use the same function to check for a valid summonable xyz
If a must material group is passed to the xyz proc, and the min and max values match the size of that group, then if those materials are valid within the material group, the selection will be skipped
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.

1 participant