Commit 1d44c448 authored by mercury233's avatar mercury233
parents 382d1024 6ea137f8
...@@ -2075,9 +2075,9 @@ int32 card::leave_field_redirect(uint32 reason) { ...@@ -2075,9 +2075,9 @@ int32 card::leave_field_redirect(uint32 reason) {
return LOCATION_REMOVED; return LOCATION_REMOVED;
// the ruling for the priority of the following redirects can't be confirmed for now // the ruling for the priority of the following redirects can't be confirmed for now
if(redirects & LOCATION_DECK) { if(redirects & LOCATION_DECK) {
if(redirects & LOCATION_DECKBOT) if((redirects & LOCATION_DECKBOT) == LOCATION_DECKBOT)
return LOCATION_DECKBOT; return LOCATION_DECKBOT;
if(redirects & LOCATION_DECKSHF) if((redirects & LOCATION_DECKSHF) == LOCATION_DECKSHF)
return LOCATION_DECKSHF; return LOCATION_DECKSHF;
return LOCATION_DECK; return LOCATION_DECK;
} }
......
...@@ -1487,6 +1487,14 @@ int32 scriptlib::duel_disable_shuffle_check(lua_State *L) { ...@@ -1487,6 +1487,14 @@ int32 scriptlib::duel_disable_shuffle_check(lua_State *L) {
pduel->game_field->core.shuffle_check_disabled = disable; pduel->game_field->core.shuffle_check_disabled = disable;
return 0; return 0;
} }
int32 scriptlib::duel_disable_self_destroy_check(lua_State* L) {
duel* pduel = interpreter::get_duel_info(L);
uint8 disable = TRUE;
if(lua_gettop(L) > 0)
disable = lua_toboolean(L, 1);
pduel->game_field->core.selfdes_disabled = disable;
return 0;
}
int32 scriptlib::duel_shuffle_deck(lua_State *L) { int32 scriptlib::duel_shuffle_deck(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
uint32 playerid = (uint32)lua_tointeger(L, 1); uint32 playerid = (uint32)lua_tointeger(L, 1);
...@@ -4505,6 +4513,7 @@ static const struct luaL_Reg duellib[] = { ...@@ -4505,6 +4513,7 @@ static const struct luaL_Reg duellib[] = {
{ "DiscardDeck", scriptlib::duel_discard_deck }, { "DiscardDeck", scriptlib::duel_discard_deck },
{ "DiscardHand", scriptlib::duel_discard_hand }, { "DiscardHand", scriptlib::duel_discard_hand },
{ "DisableShuffleCheck", scriptlib::duel_disable_shuffle_check }, { "DisableShuffleCheck", scriptlib::duel_disable_shuffle_check },
{ "DisableSelfDestroyCheck", scriptlib::duel_disable_self_destroy_check },
{ "ShuffleDeck", scriptlib::duel_shuffle_deck }, { "ShuffleDeck", scriptlib::duel_shuffle_deck },
{ "ShuffleExtra", scriptlib::duel_shuffle_extra }, { "ShuffleExtra", scriptlib::duel_shuffle_extra },
{ "ShuffleHand", scriptlib::duel_shuffle_hand }, { "ShuffleHand", scriptlib::duel_shuffle_hand },
......
...@@ -861,12 +861,12 @@ int32 field::get_control(uint16 step, effect* reason_effect, uint8 reason_player ...@@ -861,12 +861,12 @@ int32 field::get_control(uint16 step, effect* reason_effect, uint8 reason_player
change = false; change = false;
if(!pcard->is_affect_by_effect(reason_effect)) if(!pcard->is_affect_by_effect(reason_effect))
change = false; change = false;
if(core.duel_rule <= 4 && (pcard->get_type() & TYPE_TRAPMONSTER) && get_useable_count(pcard, playerid, LOCATION_SZONE, playerid, LOCATION_REASON_CONTROL) <= 0) if(core.duel_rule <= 4 && (pcard->get_type() & TYPE_TRAPMONSTER) && get_useable_count(pcard, playerid, LOCATION_SZONE, reason_player, LOCATION_REASON_CONTROL) <= 0)
change = false; change = false;
if(!change) if(!change)
targets->container.erase(pcard); targets->container.erase(pcard);
} }
int32 fcount = get_useable_count(NULL, playerid, LOCATION_MZONE, playerid, LOCATION_REASON_CONTROL, zone); int32 fcount = get_useable_count(NULL, playerid, LOCATION_MZONE, reason_player, LOCATION_REASON_CONTROL, zone);
if(fcount <= 0) { if(fcount <= 0) {
destroy_set->swap(targets->container); destroy_set->swap(targets->container);
core.units.begin()->step = 5; core.units.begin()->step = 5;
...@@ -910,7 +910,7 @@ int32 field::get_control(uint16 step, effect* reason_effect, uint8 reason_player ...@@ -910,7 +910,7 @@ int32 field::get_control(uint16 step, effect* reason_effect, uint8 reason_player
return FALSE; return FALSE;
} }
card* pcard = *targets->it; card* pcard = *targets->it;
move_to_field(pcard, playerid, playerid, LOCATION_MZONE, pcard->current.position, FALSE, 0, FALSE, zone); move_to_field(pcard, (reason_player != PLAYER_NONE) ? reason_player : playerid, playerid, LOCATION_MZONE, pcard->current.position, FALSE, 0, FALSE, zone);
return FALSE; return FALSE;
} }
case 4: { case 4: {
......
...@@ -433,6 +433,7 @@ public: ...@@ -433,6 +433,7 @@ public:
static int32 duel_discard_deck(lua_State *L); static int32 duel_discard_deck(lua_State *L);
static int32 duel_discard_hand(lua_State *L); static int32 duel_discard_hand(lua_State *L);
static int32 duel_disable_shuffle_check(lua_State *L); static int32 duel_disable_shuffle_check(lua_State *L);
static int32 duel_disable_self_destroy_check(lua_State *L);
static int32 duel_shuffle_deck(lua_State *L); static int32 duel_shuffle_deck(lua_State *L);
static int32 duel_shuffle_extra(lua_State *L); static int32 duel_shuffle_extra(lua_State *L);
static int32 duel_shuffle_hand(lua_State *L); static int32 duel_shuffle_hand(lua_State *L);
......
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