Commit eb499896 authored by salix5's avatar salix5

EVENT_DAMAGE_STEP_END

http://www.db.yugioh-card.com/yugiohdb/faq_search.action?ope=5&fid=19155&keyword=&tag=-1
Now unexpected ending of damage step will raise EVENT_DAMAGE_STEP_END.
parent 8a34f836
......@@ -1484,7 +1484,7 @@ int32 field::check_spsummon_once(card* pcard, uint8 playerid) {
auto iter = core.spsummon_once_map[playerid].find(pcard->spsummon_code);
return (iter == core.spsummon_once_map[playerid].end()) || (iter->second == 0);
}
// increase the binary custom counter
// increase the binary custom counter 1~5
void field::check_card_counter(card* pcard, int32 counter_type, int32 playerid) {
auto& counter_map = (counter_type == 1) ? core.summon_counter :
(counter_type == 2) ? core.normalsummon_counter :
......
......@@ -3185,7 +3185,7 @@ int32 field::process_battle_command(uint16 step) {
case 21: {
if(core.attacker->current.location != LOCATION_MZONE || core.attacker->fieldid_r != core.pre_field[0]
|| (core.attack_target && (core.attack_target->current.location != LOCATION_MZONE || core.attack_target->fieldid_r != core.pre_field[1]))) {
core.units.begin()->step = 37;
core.units.begin()->step = 32;
return FALSE;
}
if(!core.attack_target) {
......@@ -3226,7 +3226,7 @@ int32 field::process_battle_command(uint16 step) {
if(core.attacker->current.location != LOCATION_MZONE || core.attacker->fieldid_r != core.pre_field[0]
|| ((core.attacker->current.position & POS_DEFENSE) && !(core.attacker->is_affected_by_effect(EFFECT_DEFENSE_ATTACK)))
|| (core.attack_target && (core.attack_target->current.location != LOCATION_MZONE || core.attack_target->fieldid_r != core.pre_field[1]))) {
core.units.begin()->step = 37;
core.units.begin()->step = 32;
return FALSE;
}
return FALSE;
......@@ -3255,7 +3255,7 @@ int32 field::process_battle_command(uint16 step) {
case 25: {
if(core.attacker->current.location != LOCATION_MZONE || core.attacker->fieldid_r != core.pre_field[0]
|| (core.attack_target && (core.attack_target->current.location != LOCATION_MZONE || core.attack_target->fieldid_r != core.pre_field[1]))) {
core.units.begin()->step = 37;
core.units.begin()->step = 32;
return FALSE;
}
raise_single_event(core.attacker, 0, EVENT_DAMAGE_CALCULATING, 0, 0, 0, 0, 0);
......@@ -3472,7 +3472,6 @@ int32 field::process_battle_command(uint16 step) {
return FALSE;
}
case 31: {
core.units.begin()->arg1 = 1;
core.flip_delayed = FALSE;
core.new_fchain.splice(core.new_fchain.begin(), core.new_fchain_b);
core.new_ochain.splice(core.new_ochain.begin(), core.new_ochain_b);
......@@ -3508,6 +3507,12 @@ int32 field::process_battle_command(uint16 step) {
}
case 33: {
core.units.begin()->ptarget = 0;
// for unexpected end of damage step
core.damage_calculated = TRUE;
core.selfdes_disabled = FALSE;
core.flip_delayed = FALSE;
core.new_fchain.splice(core.new_fchain.begin(), core.new_fchain_b);
core.new_ochain.splice(core.new_ochain.begin(), core.new_ochain_b);
card_set ing;
card_set ed;
if(core.attacker->is_status(STATUS_BATTLE_DESTROYED) && (core.attacker->current.reason & REASON_BATTLE)) {
......@@ -3552,14 +3557,6 @@ int32 field::process_battle_command(uint16 step) {
return FALSE;
}
case 38: {
core.units.begin()->arg1 = 0;
core.damage_calculated = TRUE;
core.selfdes_disabled = FALSE;
core.flip_delayed = FALSE;
core.new_fchain.splice(core.new_fchain.begin(), core.new_fchain_b);
core.new_ochain.splice(core.new_ochain.begin(), core.new_ochain_b);
if(core.new_fchain.size() || core.new_ochain.size())
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, 0);
return FALSE;
}
case 39: {
......
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