Skip to content

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
masterfrom
card-announce-filter
Open

Add ocgapi callback to check if a set of opcodes would allow for a card to be declred#174
edo9300 wants to merge 2 commits into
masterfrom
card-announce-filter

Conversation

@edo9300

@edo9300 edo9300 commented Jun 20, 2026

Copy link
Copy Markdown
Owner

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 function Duel.HasAnnounceableCard.

Comment thread libduel.cpp
options.push_back(TYPE_MONSTER | TYPE_SPELL | TYPE_TRAP);
options.push_back(OPCODE_ISTYPE);
}
lua_pushboolean(L, pduel->filter_allows_declaring_cards(options));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.
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.

2 participants