core: ygol_query_prompt_context names the effect that asks a prompt (TICKET-451, v1.7.0)

field::execute_cost / execute_target / execute_operation push the running
effect (handler, description, stable index, phase 1 / 2 / 3, chain link) on
core.ygol_running at step 0 and pop it when the function finishes; the
innermost entry is the effect that asks. effect::ygol_script_index is stamped
in card::add_effect while the card loads (initial_effect.size()), 0xffff
otherwise. The export writes 22 bytes; a handler the asking player does not
control and that is not face-up answers code 0, index 0xffff, description 0.
Export gates 335 / 856 / 850 -> 336 / 857 / 851.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
donnyandClaude Opus 5.5 committed 2026-11-08 16:05:08 -07:00
1 parent 4cd908d7af
commit b6ef8a31bc
10 files changed
+109 -10

No files matched your search

+7 -3
View File
@@ -1958,10 +1958,14 @@ int32_t card::add_effect(effect* peffect) {
return 0;
peffect->id = pduel->game_field->infos.field_id++;
peffect->card_type = data.type;
if (get_status(STATUS_INITIALIZING))
if (get_status(STATUS_INITIALIZING)) {
peffect->flag[0] |= EFFECT_FLAG_INITIAL;
else if (get_status(STATUS_COPYING_EFFECT))
peffect->flag[0] |= EFFECT_FLAG_COPY;
peffect->ygol_script_index = (uint16_t)initial_effect.size(); // [YGOL] v1.7.0 prompt context: the script's registration order
} else {
peffect->ygol_script_index = 0xffff;
if (get_status(STATUS_COPYING_EFFECT))
peffect->flag[0] |= EFFECT_FLAG_COPY;
}
if (get_status(STATUS_COPYING_EFFECT)) {
peffect->copy_id = pduel->game_field->infos.copy_id;
peffect->reset_flag |= pduel->game_field->core.copy_reset;