Add ocgapi callback to check if a set of opcodes would allow for a card to be declred - #174
Open
edo9300 wants to merge 2 commits into
Open
Add ocgapi callback to check if a set of opcodes would allow for a card to be declred#174edo9300 wants to merge 2 commits into
edo9300 wants to merge 2 commits into
Conversation
DyXel
requested changes
Jul 11, 2026
| options.push_back(TYPE_MONSTER | TYPE_SPELL | TYPE_TRAP); | ||
| options.push_back(OPCODE_ISTYPE); | ||
| } | ||
| lua_pushboolean(L, pduel->filter_allows_declaring_cards(options)); |
Collaborator
There was a problem hiding this comment.
Reminder to raise error if count<0. Will help debugging later.
DyXel
added a commit
to DyXel/Multirole
that referenced
this pull request
Jul 12, 2026
Untested. Depends on edo9300/ygopro-core#174 We use the given opcodes to build an SQL query that checks the count of the cards that match the criteria, this query depends on a custom SQL function (`ocg_is_set`) to check setcodes, which is also implemented here.
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.
A new ocgapi options parameter has been added
existCardsToDeclare, which will return wether a list of opcodes allow for at least a card to be declared. This will be directly used by the new lua functionDuel.HasAnnounceableCard.