core: prompt context phase 4, the core asks whether to use an effect (TICKET-451, v1.7.0)
The core's own "use this effect?" prompts carry the asked effect in their PROCESSOR_SELECT_EFFECTYN / SELECT_YESNO unit (optional trigger, lone quick trigger 221, activation 94, replacements 218 / 219 / 220, Scrap Chimera), and the unit pushes it on core.ygol_running as phase 4 while the prompt is open. Contract row, changelog, binding PromptContext.PhaseAsk, probe check: an optional End Phase trigger is asked with that card, index 2, phase 4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ca2004112b
commit
3f84b0b50b
10 files changed
+63
-20
No files matched your search
+16
-8
@@ -84,7 +84,11 @@ uint32_t field::process() {
|
||||
}
|
||||
}
|
||||
case PROCESSOR_SELECT_EFFECTYN: {
|
||||
if (it->step == 0 && it->peffect)
|
||||
ygol_push_running(this, it->peffect, YGOL_PHASE_ASK); // [YGOL] v1.7.0 prompt context: the core asks whether to use this effect
|
||||
if (select_effect_yes_no(it->step, it->arg1, it->arg2, (card*)it->ptarget)) {
|
||||
if (it->peffect)
|
||||
ygol_pop_running(this);
|
||||
core.units.pop_front();
|
||||
return pduel->buffer_size();
|
||||
} else {
|
||||
@@ -93,7 +97,11 @@ uint32_t field::process() {
|
||||
}
|
||||
}
|
||||
case PROCESSOR_SELECT_YESNO: {
|
||||
if (it->step == 0 && it->peffect)
|
||||
ygol_push_running(this, it->peffect, YGOL_PHASE_ASK); // [YGOL] v1.7.0 prompt context
|
||||
if (select_yes_no(it->step, it->arg1, it->arg2)) {
|
||||
if (it->peffect)
|
||||
ygol_pop_running(this);
|
||||
core.units.pop_front();
|
||||
return pduel->buffer_size();
|
||||
} else {
|
||||
@@ -728,7 +736,7 @@ uint32_t field::process() {
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
// [YGOL] v1.7.0 prompt context: remember which effect function runs, so ygol_query_prompt_context can name it at a prompt
|
||||
static void ygol_push_running(field* pfield, effect* peffect, uint8_t phase) {
|
||||
void ygol_push_running(field* pfield, effect* peffect, uint8_t phase) {
|
||||
processor::ygol_running_effect running;
|
||||
running.handler = peffect->get_handler();
|
||||
if(!running.handler)
|
||||
@@ -745,7 +753,7 @@ static void ygol_push_running(field* pfield, effect* peffect, uint8_t phase) {
|
||||
}
|
||||
pfield->core.ygol_running.push_back(running);
|
||||
}
|
||||
static void ygol_pop_running(field* pfield) {
|
||||
void ygol_pop_running(field* pfield) {
|
||||
if(!pfield->core.ygol_running.empty())
|
||||
pfield->core.ygol_running.pop_back();
|
||||
}
|
||||
@@ -776,7 +784,7 @@ int32_t field::execute_cost(uint16_t step, effect * triggering_effect, uint8_t t
|
||||
core.units.begin()->arg2 = core.shuffle_check_disabled;
|
||||
core.shuffle_check_disabled = FALSE;
|
||||
++core.check_level;
|
||||
ygol_push_running(this, triggering_effect, 1);
|
||||
ygol_push_running(this, triggering_effect, YGOL_PHASE_COST);
|
||||
}
|
||||
core.reason_effect = triggering_effect;
|
||||
core.reason_player = triggering_player;
|
||||
@@ -830,7 +838,7 @@ int32_t field::execute_operation(uint16_t step, effect * triggering_effect, uint
|
||||
core.units.begin()->arg2 = core.shuffle_check_disabled;
|
||||
core.shuffle_check_disabled = FALSE;
|
||||
++core.check_level;
|
||||
ygol_push_running(this, triggering_effect, 3);
|
||||
ygol_push_running(this, triggering_effect, YGOL_PHASE_OPERATION);
|
||||
}
|
||||
core.reason_effect = triggering_effect;
|
||||
core.reason_player = triggering_player;
|
||||
@@ -889,7 +897,7 @@ int32_t field::execute_target(uint16_t step, effect * triggering_effect, uint8_t
|
||||
core.units.begin()->arg2 = core.shuffle_check_disabled;
|
||||
core.shuffle_check_disabled = FALSE;
|
||||
++core.check_level;
|
||||
ygol_push_running(this, triggering_effect, 2);
|
||||
ygol_push_running(this, triggering_effect, YGOL_PHASE_TARGET);
|
||||
}
|
||||
core.reason_effect = triggering_effect;
|
||||
core.reason_player = triggering_player;
|
||||
@@ -1181,7 +1189,7 @@ int32_t field::process_phase_event(int16_t step, int32_t phase) {
|
||||
else
|
||||
pduel->write_buffer32(26);
|
||||
if(tf_count == 0 && to_count == 1 && fc_count == 0 && cn_count == 0) {
|
||||
add_process(PROCESSOR_SELECT_EFFECTYN, 0, 0, (group*)core.select_chains[0].triggering_effect->get_handler(), check_player, 0);
|
||||
add_process(PROCESSOR_SELECT_EFFECTYN, 0, core.select_chains[0].triggering_effect, (group*)core.select_chains[0].triggering_effect->get_handler(), check_player, 0); // [YGOL] v1.7.0 prompt context: the asked effect rides in peffect
|
||||
return FALSE;
|
||||
} else {
|
||||
add_process(PROCESSOR_SELECT_CHAIN, 0, 0, 0, check_player, core.spe_effect[check_player]);
|
||||
@@ -1432,7 +1440,7 @@ int32_t field::process_point_event(int16_t step, int32_t skip_trigger, int32_t s
|
||||
core.units.begin()->step = 5;
|
||||
return FALSE;
|
||||
} else if(core.select_chains.size() == 1 && !core.current_chain.size()) {
|
||||
add_process(PROCESSOR_SELECT_EFFECTYN, 0, 0, (group*)core.select_chains[0].triggering_effect->get_handler(), core.current_player, 221);
|
||||
add_process(PROCESSOR_SELECT_EFFECTYN, 0, core.select_chains[0].triggering_effect, (group*)core.select_chains[0].triggering_effect->get_handler(), core.current_player, 221); // [YGOL] v1.7.0 prompt context
|
||||
return FALSE;
|
||||
} else {
|
||||
add_process(PROCESSOR_SELECT_CHAIN, 0, 0, 0, core.current_player, 0x7f);
|
||||
@@ -4253,7 +4261,7 @@ int32_t field::add_chain(uint16_t step) {
|
||||
returns.ivalue[0] = TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
add_process(PROCESSOR_SELECT_EFFECTYN, 0, 0, (group*)peffect->get_handler(), playerid, 94);
|
||||
add_process(PROCESSOR_SELECT_EFFECTYN, 0, peffect, (group*)peffect->get_handler(), playerid, 94); // [YGOL] v1.7.0 prompt context
|
||||
} else
|
||||
returns.ivalue[0] = FALSE;
|
||||
return FALSE;
|
||||
|
||||
Reference in new issue
Block a user