Commit 038ecdfe authored by VanillaSalt's avatar VanillaSalt

tweak

parent e90ab044
......@@ -3057,7 +3057,7 @@ int32 scriptlib::duel_rock_paper_scissors(lua_State * L) {
uint8 repeat = TRUE;
if (lua_gettop(L) > 0)
repeat = lua_toboolean(L, 1);
pduel->game_field->add_process(PROCESSOR_ROCK_PAPER_SCISSORS, 1, 0, 0, repeat, 0);
pduel->game_field->add_process(PROCESSOR_ROCK_PAPER_SCISSORS, 0, 0, 0, repeat, 0);
return lua_yield(L, 0);
}
int32 scriptlib::duel_get_coin_result(lua_State * L) {
......
......@@ -5520,30 +5520,29 @@ int32 field::toss_dice(uint16 step, effect * reason_effect, uint8 reason_player,
}
int32 field::rock_paper_scissors(uint16 step, uint8 repeat) {
switch (step) {
case 1: {
case 0: {
pduel->write_buffer8(MSG_ROCK_PAPER_SCISSORS);
pduel->write_buffer8(0);
return FALSE;
}
case 2: {
case 1: {
core.units.begin()->arg2 = returns.ivalue[0];
pduel->write_buffer8(MSG_ROCK_PAPER_SCISSORS);
pduel->write_buffer8(1);
return FALSE;
}
case 3: {
core.units.begin()->arg2 = core.units.begin()->arg2 + (returns.ivalue[0] << 2);
case 2: {
int32 hand0 = core.units.begin()->arg2;
int32 hand1 = returns.ivalue[0];
pduel->write_buffer8(MSG_HAND_RES);
pduel->write_buffer8(core.units.begin()->arg2);
if((core.units.begin()->arg2 & 0x3) == ((core.units.begin()->arg2 >> 2) & 0x3)) {
pduel->write_buffer8(hand0 + (hand1 << 2));
if(hand0 == hand1) {
if(repeat) {
core.units.begin()->step = 0;
core.units.begin()->step = -1;
return FALSE;
} else
returns.ivalue[0] = PLAYER_NONE;
} else if(((core.units.begin()->arg2 & 0x3) == 1 && ((core.units.begin()->arg2 >> 2) & 0x3) == 2)
|| ((core.units.begin()->arg2 & 0x3) == 2 && ((core.units.begin()->arg2 >> 2) & 0x3) == 3)
|| ((core.units.begin()->arg2 & 0x3) == 3 && ((core.units.begin()->arg2 >> 2) & 0x3) == 1)) {
} else if((hand0 == 1 && hand1 == 2) || (hand0 == 2 && hand1 == 3) || (hand0 == 3 && hand1 == 1)) {
returns.ivalue[0] = 1;
} else {
returns.ivalue[0] = 0;
......@@ -5551,4 +5550,5 @@ int32 field::rock_paper_scissors(uint16 step, uint8 repeat) {
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