Commit d3a9bf14 authored by DailyShana's avatar DailyShana

duel rule for puzzle

parent bd1b0397
...@@ -83,6 +83,7 @@ field::field(duel* pduel) { ...@@ -83,6 +83,7 @@ field::field(duel* pduel) {
core.limit_xyz_maxc = 0; core.limit_xyz_maxc = 0;
core.last_control_changed_id = 0; core.last_control_changed_id = 0;
core.duel_options = 0; core.duel_options = 0;
core.duel_rule = 0;
core.attacker = 0; core.attacker = 0;
core.attack_target = 0; core.attack_target = 0;
core.attack_rollback = FALSE; core.attack_rollback = FALSE;
......
...@@ -144,8 +144,15 @@ int32 scriptlib::debug_reload_field_begin(lua_State *L) { ...@@ -144,8 +144,15 @@ int32 scriptlib::debug_reload_field_begin(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
duel* pduel = interpreter::get_duel_info(L); duel* pduel = interpreter::get_duel_info(L);
uint32 flag = lua_tointeger(L, 1); uint32 flag = lua_tointeger(L, 1);
int32 rule = lua_tointeger(L, 2);
pduel->clear(); pduel->clear();
pduel->game_field->core.duel_options = flag; pduel->game_field->core.duel_options = flag;
if (rule)
pduel->game_field->core.duel_rule = rule;
else if (flag & DUEL_OBSOLETE_RULING)
pduel->game_field->core.duel_rule = 1;
else
pduel->game_field->core.duel_rule = 3;
return 0; return 0;
} }
int32 scriptlib::debug_reload_field_end(lua_State *L) { int32 scriptlib::debug_reload_field_end(lua_State *L) {
......
...@@ -76,7 +76,7 @@ extern "C" DECL_DLLEXPORT void start_duel(ptr pduel, int options) { ...@@ -76,7 +76,7 @@ extern "C" DECL_DLLEXPORT void start_duel(ptr pduel, int options) {
pd->game_field->core.duel_rule = duel_rule; pd->game_field->core.duel_rule = duel_rule;
else if(options & DUEL_OBSOLETE_RULING) //provide backward compatibility with replay else if(options & DUEL_OBSOLETE_RULING) //provide backward compatibility with replay
pd->game_field->core.duel_rule = 1; pd->game_field->core.duel_rule = 1;
else else if(!pd->game_field->core.duel_rule)
pd->game_field->core.duel_rule = 3; pd->game_field->core.duel_rule = 3;
pd->game_field->core.shuffle_hand_check[0] = FALSE; pd->game_field->core.shuffle_hand_check[0] = FALSE;
pd->game_field->core.shuffle_hand_check[1] = FALSE; pd->game_field->core.shuffle_hand_check[1] = 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