Commit 399f4166 authored by salix5's avatar salix5

field::solve_chain(), remove_oath_effect()

1. Now the next point event of EVENT_SPSUMMON is in special_summon_rule().
2. EVENT_SPSUMMON is only available for global events.
3. Negating sp_summon will not remove oath effects.
parent 19e09ff5
...@@ -1543,8 +1543,6 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc, ...@@ -1543,8 +1543,6 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
core.units.begin()->step = 14; core.units.begin()->step = 14;
return FALSE; return FALSE;
} }
if(proc)
remove_oath_effect(proc);
if(target->current.location == LOCATION_MZONE) if(target->current.location == LOCATION_MZONE)
send_to(target, 0, REASON_RULE, sumplayer, sumplayer, LOCATION_GRAVE, 0, 0); send_to(target, 0, REASON_RULE, sumplayer, sumplayer, LOCATION_GRAVE, 0, 0);
adjust_instant(); adjust_instant();
...@@ -2217,7 +2215,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target, ui ...@@ -2217,7 +2215,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target, ui
core.units.begin()->step = 14; core.units.begin()->step = 14;
return FALSE; return FALSE;
} }
remove_oath_effect(core.units.begin()->peffect);
if(target->current.location == LOCATION_MZONE) if(target->current.location == LOCATION_MZONE)
send_to(target, 0, REASON_RULE, sumplayer, sumplayer, LOCATION_GRAVE, 0, 0); send_to(target, 0, REASON_RULE, sumplayer, sumplayer, LOCATION_GRAVE, 0, 0);
adjust_instant(); adjust_instant();
...@@ -2345,7 +2342,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target, ui ...@@ -2345,7 +2342,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target, ui
card_set cset; card_set cset;
for(auto cit = pgroup->container.begin(); cit != pgroup->container.end(); ++cit) { for(auto cit = pgroup->container.begin(); cit != pgroup->container.end(); ++cit) {
if(!(*cit)->is_affected_by_effect(EFFECT_CANNOT_DISABLE_SPSUMMON)) { if(!(*cit)->is_affected_by_effect(EFFECT_CANNOT_DISABLE_SPSUMMON)) {
raise_single_event(*cit, 0, EVENT_SPSUMMON, (*cit)->current.reason_effect, 0, (*cit)->summon_player, (*cit)->summon_player, 0);
cset.insert(*cit); cset.insert(*cit);
} }
(*cit)->set_status(STATUS_SUMMONING, TRUE); (*cit)->set_status(STATUS_SUMMONING, TRUE);
......
...@@ -1585,6 +1585,9 @@ int32 field::process_phase_event(int16 step, int32 phase) { ...@@ -1585,6 +1585,9 @@ int32 field::process_phase_event(int16 step, int32 phase) {
} }
return TRUE; return TRUE;
} }
// skip_trigger = lower byte of arg1
// skip_freechain = higher byte of arg1
// skip_new = arg2
int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_freechain, int32 skip_new) { int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_freechain, int32 skip_new) {
switch(step) { switch(step) {
case 0: { case 0: {
...@@ -3660,6 +3663,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3660,6 +3663,7 @@ int32 field::process_battle_command(uint16 step) {
} }
return TRUE; return TRUE;
} }
// perform damage calculation by an effect
int32 field::process_damage_step(uint16 step) { int32 field::process_damage_step(uint16 step) {
switch(step) { switch(step) {
case 0: { case 0: {
...@@ -4741,16 +4745,18 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2 ...@@ -4741,16 +4745,18 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
core.chain_limit_p = 0; core.chain_limit_p = 0;
} }
reset_chain(); reset_chain();
if(core.summoning_card || core.effect_damage_step == 1) if(core.summoning_card)
core.subunits.push_back(core.reserved); core.subunits.push_back(core.reserved);
return FALSE; return FALSE;
} }
case 13: { case 13: {
raise_event((card*)0, EVENT_CHAIN_END, 0, 0, 0, 0, 0); raise_event((card*)0, EVENT_CHAIN_END, 0, 0, 0, 0, 0);
process_instant_event(); process_instant_event();
core.hint_timing[0] |= TIMING_CHAIN_END; if(chainend_arg1 != 0x101 || chainend_arg2 != TRUE){
core.hint_timing[1] |= TIMING_CHAIN_END; core.hint_timing[0] |= TIMING_CHAIN_END;
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, chainend_arg1, chainend_arg2); core.hint_timing[1] |= TIMING_CHAIN_END;
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, chainend_arg1, chainend_arg2);
}
returns.ivalue[0] = TRUE; returns.ivalue[0] = TRUE;
return TRUE; return TRUE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment