Commit 10a78ee3 authored by salix5's avatar salix5

shuffle

1 in each main_phase
parent 90e82de4
......@@ -27,7 +27,7 @@ field::field(duel* pduel) {
this->pduel = pduel;
infos.field_id = 1;
infos.copy_id = 1;
infos.shuffle_count = 0;
infos.can_shuffle = TRUE;
infos.turn_id = 0;
infos.card_id = 1;
infos.phase = 0;
......
......@@ -115,7 +115,7 @@ struct field_info {
uint8 phase;
uint8 turn_player;
uint8 priorities[2];
uint8 shuffle_count;
uint8 can_shuffle;
};
struct lpcost {
int32 count;
......
......@@ -139,7 +139,7 @@ int32 field::select_idle_command(uint16 step, uint8 playerid) {
pduel->write_buffer8(1);
else
pduel->write_buffer8(0);
if(infos.shuffle_count < 2 && player[playerid].list_hand.size() > 1)
if(infos.can_shuffle && player[playerid].list_hand.size() > 1)
pduel->write_buffer8(1);
else
pduel->write_buffer8(0);
......@@ -156,7 +156,7 @@ int32 field::select_idle_command(uint16 step, uint8 playerid) {
|| (t == 5 && s >= core.select_chains.size())
|| (t == 6 && (infos.phase != PHASE_MAIN1 || !core.to_bp))
|| (t == 7 && !core.to_ep)
|| (t == 8 && !(infos.shuffle_count < 1 && player[playerid].list_hand.size() > 1))) {
|| (t == 8 && !(infos.can_shuffle && player[playerid].list_hand.size() > 1))) {
pduel->write_buffer8(MSG_RETRY);
return FALSE;
}
......
......@@ -2575,7 +2575,7 @@ int32 field::process_idle_command(uint16 step) {
} else if (ctype == 8) {
core.units.begin()->step = -1;
shuffle(infos.turn_player, LOCATION_HAND);
infos.shuffle_count++;
infos.can_shuffle = FALSE;
return FALSE;
} else {
core.units.begin()->step = 9;
......@@ -2679,7 +2679,7 @@ int32 field::process_idle_command(uint16 step) {
}
case 11: {
returns.ivalue[0] = core.units.begin()->arg1;
infos.shuffle_count = 0;
infos.can_shuffle = TRUE;
return TRUE;
}
case 12: {
......@@ -4045,6 +4045,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core.delayed_quick_tmp.clear();
pduel->write_buffer8(MSG_NEW_PHASE);
pduel->write_buffer8(infos.phase);
add_process(PROCESSOR_IDLE_COMMAND, 0, 0, 0, 0, 0);
return FALSE;
}
......@@ -4128,6 +4129,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core.delayed_quick_tmp.clear();
pduel->write_buffer8(MSG_NEW_PHASE);
pduel->write_buffer8(infos.phase);
infos.can_shuffle = TRUE;
add_process(PROCESSOR_IDLE_COMMAND, 0, 0, 0, 0, 0);
return FALSE;
}
......
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