Commit 382d568f authored by salix5's avatar salix5

process_battle_command()

40-44: 5 blocks of damage step
parent 93e6fa28
...@@ -3342,11 +3342,15 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3342,11 +3342,15 @@ int32 field::process_battle_command(uint16 step) {
raise_event((card*)0, EVENT_BATTLE_START, 0, 0, 0, 0, 0); raise_event((card*)0, EVENT_BATTLE_START, 0, 0, 0, 0, 0);
process_single_event(); process_single_event();
process_instant_event(); process_instant_event();
if(core.new_fchain.size() || core.new_ochain.size()) { pduel->write_buffer8(MSG_HINT);
core.hint_timing[infos.turn_player] = TIMING_DAMAGE_STEP; pduel->write_buffer8(HINT_EVENT);
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, 0); pduel->write_buffer8(0);
core.units.begin()->arg1 = TRUE; pduel->write_buffer32(40);
} pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_EVENT);
pduel->write_buffer8(1);
pduel->write_buffer32(40);
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, TRUE);
core.temp_var[2] = 0; core.temp_var[2] = 0;
return FALSE; return FALSE;
} }
...@@ -3356,23 +3360,10 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3356,23 +3360,10 @@ int32 field::process_battle_command(uint16 step) {
core.units.begin()->arg1 = 0; core.units.begin()->arg1 = 0;
core.damage_calculated = TRUE; core.damage_calculated = TRUE;
core.selfdes_disabled = FALSE; core.selfdes_disabled = FALSE;
core.units.begin()->step = 30; core.units.begin()->step = 38;
return FALSE; return FALSE;
} }
if(!core.attack_target) { if(!core.attack_target) {
core.units.begin()->step = 23;
if(!core.units.begin()->arg1) {
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_EVENT);
pduel->write_buffer8(0);
pduel->write_buffer32(40);
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_EVENT);
pduel->write_buffer8(1);
pduel->write_buffer32(40);
core.hint_timing[infos.turn_player] = TIMING_DAMAGE_STEP;
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, 0);
}
return FALSE; return FALSE;
} }
core.sub_attacker = 0; core.sub_attacker = 0;
...@@ -3396,23 +3387,16 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3396,23 +3387,16 @@ int32 field::process_battle_command(uint16 step) {
raise_event((card*)0, EVENT_BATTLE_CONFIRM, 0, 0, 0, 0, 0); raise_event((card*)0, EVENT_BATTLE_CONFIRM, 0, 0, 0, 0, 0);
process_single_event(); process_single_event();
process_instant_event(); process_instant_event();
if(core.new_fchain.size() || core.new_ochain.size()) {
core.hint_timing[infos.turn_player] = TIMING_DAMAGE_STEP;
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, 0);
core.units.begin()->arg1 = TRUE;
}
if(!core.units.begin()->arg1) {
pduel->write_buffer8(MSG_HINT); pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_EVENT); pduel->write_buffer8(HINT_EVENT);
pduel->write_buffer8(0); pduel->write_buffer8(0);
pduel->write_buffer32(40); pduel->write_buffer32(41);
pduel->write_buffer8(MSG_HINT); pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_EVENT); pduel->write_buffer8(HINT_EVENT);
pduel->write_buffer8(1); pduel->write_buffer8(1);
pduel->write_buffer32(40); pduel->write_buffer32(41);
core.hint_timing[infos.turn_player] = TIMING_DAMAGE_STEP; core.hint_timing[infos.turn_player] = TIMING_DAMAGE_STEP;
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, 0); add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, 0);
}
return FALSE; return FALSE;
} }
case 23: { case 23: {
...@@ -3436,7 +3420,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3436,7 +3420,7 @@ int32 field::process_battle_command(uint16 step) {
core.units.begin()->arg1 = 0; core.units.begin()->arg1 = 0;
core.damage_calculated = TRUE; core.damage_calculated = TRUE;
core.selfdes_disabled = FALSE; core.selfdes_disabled = FALSE;
core.units.begin()->step = 30; core.units.begin()->step = 38;
return FALSE; return FALSE;
} }
return FALSE; return FALSE;
...@@ -3453,11 +3437,11 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3453,11 +3437,11 @@ int32 field::process_battle_command(uint16 step) {
pduel->write_buffer8(MSG_HINT); pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_EVENT); pduel->write_buffer8(HINT_EVENT);
pduel->write_buffer8(0); pduel->write_buffer8(0);
pduel->write_buffer32(41); pduel->write_buffer32(42);
pduel->write_buffer8(MSG_HINT); pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_EVENT); pduel->write_buffer8(HINT_EVENT);
pduel->write_buffer8(1); pduel->write_buffer8(1);
pduel->write_buffer32(41); pduel->write_buffer32(42);
core.hint_timing[infos.turn_player] = TIMING_DAMAGE_CAL; core.hint_timing[infos.turn_player] = TIMING_DAMAGE_CAL;
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, TRUE); add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, TRUE);
return FALSE; return FALSE;
...@@ -3468,7 +3452,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3468,7 +3452,7 @@ int32 field::process_battle_command(uint16 step) {
core.units.begin()->arg1 = 0; core.units.begin()->arg1 = 0;
core.damage_calculated = TRUE; core.damage_calculated = TRUE;
core.selfdes_disabled = FALSE; core.selfdes_disabled = FALSE;
core.units.begin()->step = 30; core.units.begin()->step = 38;
return FALSE; return FALSE;
} }
raise_single_event(core.attacker, 0, EVENT_DAMAGE_CALCULATING, 0, 0, 0, 0, 0); raise_single_event(core.attacker, 0, EVENT_DAMAGE_CALCULATING, 0, 0, 0, 0, 0);
...@@ -3477,6 +3461,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3477,6 +3461,7 @@ int32 field::process_battle_command(uint16 step) {
raise_event((card*)0, EVENT_DAMAGE_CALCULATING, 0, 0, 0, 0, 0); raise_event((card*)0, EVENT_DAMAGE_CALCULATING, 0, 0, 0, 0, 0);
process_single_event(); process_single_event();
process_instant_event(); process_instant_event();
//this timing does not exist in Master Rule 3
core.new_ochain.clear(); core.new_ochain.clear();
core.new_fchain.clear(); core.new_fchain.clear();
return FALSE; return FALSE;
...@@ -3566,20 +3551,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3566,20 +3551,7 @@ int32 field::process_battle_command(uint16 step) {
} }
process_single_event(); process_single_event();
process_instant_event(); process_instant_event();
if(!core.effect_damage_step) { //this timing does not exist in Master Rule 3
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_EVENT);
pduel->write_buffer8(0);
pduel->write_buffer32(43);
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_EVENT);
pduel->write_buffer8(1);
pduel->write_buffer32(43);
core.hint_timing[infos.turn_player] = TIMING_DAMAGE_CAL;
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, 0);
} else {
break_effect();
}
core.damage_calculated = TRUE; core.damage_calculated = TRUE;
if(core.effect_damage_step) if(core.effect_damage_step)
return TRUE; return TRUE;
...@@ -3687,30 +3659,29 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3687,30 +3659,29 @@ int32 field::process_battle_command(uint16 step) {
return FALSE; return FALSE;
} }
case 30: { case 30: {
if(!core.effect_damage_step || (core.effect_damage_step != 3)) { //EVENT_BATTLE_END was here, but this timing does not exist in Master Rule 3
core.units.begin()->arg1 = 1; core.units.begin()->arg1 = 1;
} else {
break_effect();
}
return FALSE; return FALSE;
} }
case 31: { case 31: {
core.flip_delayed = FALSE; core.flip_delayed = FALSE;
core.new_fchain.splice(core.new_fchain.begin(), core.new_fchain_b); core.new_fchain.splice(core.new_fchain.begin(), core.new_fchain_b);
core.new_ochain.splice(core.new_ochain.begin(), core.new_ochain_b); core.new_ochain.splice(core.new_ochain.begin(), core.new_ochain_b);
if(core.units.begin()->arg1) {
raise_single_event(core.attacker, 0, EVENT_BATTLED, 0, 0, PLAYER_NONE, 0, 0); raise_single_event(core.attacker, 0, EVENT_BATTLED, 0, 0, PLAYER_NONE, 0, 0);
if(core.attack_target) if(core.attack_target)
raise_single_event(core.attack_target, 0, EVENT_BATTLED, 0, 0, PLAYER_NONE, 0, 1); raise_single_event(core.attack_target, 0, EVENT_BATTLED, 0, 0, PLAYER_NONE, 0, 1);
raise_event((card*)0, EVENT_BATTLED, 0, 0, PLAYER_NONE, 0, 0); raise_event((card*)0, EVENT_BATTLED, 0, 0, PLAYER_NONE, 0, 0);
process_single_event(); process_single_event();
process_instant_event(); process_instant_event();
} pduel->write_buffer8(MSG_HINT);
if(!core.effect_damage_step || (core.effect_damage_step != 3)) { pduel->write_buffer8(HINT_EVENT);
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, FALSE, TRUE); pduel->write_buffer8(0);
} else { pduel->write_buffer32(43);
break_effect(); pduel->write_buffer8(MSG_HINT);
} pduel->write_buffer8(HINT_EVENT);
pduel->write_buffer8(1);
pduel->write_buffer32(43);
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, TRUE);
return FALSE; return FALSE;
} }
case 32: { case 32: {
...@@ -3764,15 +3735,20 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3764,15 +3735,20 @@ int32 field::process_battle_command(uint16 step) {
core.attack_target->set_status(STATUS_BATTLE_DESTROYED, FALSE); core.attack_target->set_status(STATUS_BATTLE_DESTROYED, FALSE);
core.attack_target->set_status(STATUS_OPPO_BATTLE, FALSE); core.attack_target->set_status(STATUS_OPPO_BATTLE, FALSE);
} }
if(!core.effect_damage_step || (core.effect_damage_step != 3)) { pduel->write_buffer8(MSG_HINT);
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, FALSE, FALSE); pduel->write_buffer8(HINT_EVENT);
} else { pduel->write_buffer8(0);
break_effect(); pduel->write_buffer32(44);
} pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_EVENT);
pduel->write_buffer8(1);
pduel->write_buffer32(44);
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, TRUE);
core.units.begin()->step = 38; core.units.begin()->step = 38;
return FALSE; return FALSE;
} }
case 39: { case 39: {
//end of damage step
core.units.begin()->step = -1; core.units.begin()->step = -1;
infos.phase = PHASE_BATTLE; infos.phase = PHASE_BATTLE;
pduel->write_buffer8(MSG_DAMAGE_STEP_END); pduel->write_buffer8(MSG_DAMAGE_STEP_END);
...@@ -3780,9 +3756,6 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3780,9 +3756,6 @@ int32 field::process_battle_command(uint16 step) {
adjust_all(); adjust_all();
if(core.effect_damage_step) if(core.effect_damage_step)
return TRUE; return TRUE;
if(core.chain_attack) {
core.chain_attack = TRUE;
}
return FALSE; return FALSE;
} }
case 40: { case 40: {
...@@ -3836,17 +3809,10 @@ int32 field::process_damage_step(uint16 step) { ...@@ -3836,17 +3809,10 @@ int32 field::process_damage_step(uint16 step) {
process_single_event(); process_single_event();
process_instant_event(); process_instant_event();
add_process(PROCESSOR_BATTLE_COMMAND, 26, 0, 0, 0, 0); add_process(PROCESSOR_BATTLE_COMMAND, 26, 0, 0, 0, 0);
if(core.units.begin()->arg2) { //skip timing
core.units.begin()->step = 2;
core.effect_damage_step = 3;
add_process(PROCESSOR_BATTLE_COMMAND, 27, 0, 0, 0, 0);
return FALSE;
} else {
core.units.begin()->step = 2; core.units.begin()->step = 2;
core.reserved = core.units.front(); core.reserved = core.units.front();
return TRUE; return TRUE;
} }
}
case 2: { case 2: {
core.effect_damage_step = 2; core.effect_damage_step = 2;
add_process(PROCESSOR_BATTLE_COMMAND, 27, 0, 0, 0, 0); add_process(PROCESSOR_BATTLE_COMMAND, 27, 0, 0, 0, 0);
......
...@@ -22,10 +22,11 @@ ...@@ -22,10 +22,11 @@
!system 28 战斗阶段开始 !system 28 战斗阶段开始
!system 30 战斗回卷,是否继续攻击? !system 30 战斗回卷,是否继续攻击?
!system 31 是否直接攻击? !system 31 是否直接攻击?
!system 40 伤害阶段中 !system 40 伤害步骤开始时
!system 41 即将计算战斗伤害 !system 41 伤害计算前
!system 42 即将结束伤害阶段 !system 42 伤害计算时
!system 43 即将产生战斗伤害 !system 43 伤害计算后
!system 44 伤害步骤结束时
!system 60 正面 !system 60 正面
!system 61 反面 !system 61 反面
!system 62 表效果适用中 !system 62 表效果适用中
......
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