Commit 2c3800be authored by VanillaSalt's avatar VanillaSalt

update IsControlerCanBeChanged

parent da5dc2c3
...@@ -3256,12 +3256,12 @@ int32 card::is_capable_change_control() { ...@@ -3256,12 +3256,12 @@ int32 card::is_capable_change_control() {
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
int32 card::is_control_can_be_changed() { int32 card::is_control_can_be_changed(int32 ignore_mzone) {
if(current.controler == PLAYER_NONE) if(current.controler == PLAYER_NONE)
return FALSE; return FALSE;
if(current.location != LOCATION_MZONE) if(current.location != LOCATION_MZONE)
return FALSE; return FALSE;
if(pduel->game_field->get_useable_count(1 - current.controler, LOCATION_MZONE, current.controler, LOCATION_REASON_CONTROL) <= 0) if(!ignore_mzone && pduel->game_field->get_useable_count(1 - current.controler, LOCATION_MZONE, current.controler, LOCATION_REASON_CONTROL) <= 0)
return FALSE; return FALSE;
if((get_type() & TYPE_TRAPMONSTER) && pduel->game_field->get_useable_count(1 - current.controler, LOCATION_SZONE, current.controler, LOCATION_REASON_CONTROL) <= 0) if((get_type() & TYPE_TRAPMONSTER) && pduel->game_field->get_useable_count(1 - current.controler, LOCATION_SZONE, current.controler, LOCATION_REASON_CONTROL) <= 0)
return FALSE; return FALSE;
......
...@@ -297,7 +297,7 @@ public: ...@@ -297,7 +297,7 @@ public:
int32 is_capable_change_position(uint8 playerid); int32 is_capable_change_position(uint8 playerid);
int32 is_capable_turn_set(uint8 playerid); int32 is_capable_turn_set(uint8 playerid);
int32 is_capable_change_control(); int32 is_capable_change_control();
int32 is_control_can_be_changed(); int32 is_control_can_be_changed(int32 ignore_mzone);
int32 is_capable_be_battle_target(card* pcard); int32 is_capable_be_battle_target(card* pcard);
int32 is_capable_be_effect_target(effect* peffect, uint8 playerid); int32 is_capable_be_effect_target(effect* peffect, uint8 playerid);
int32 is_can_be_fusion_material(card* fcard); int32 is_can_be_fusion_material(card* fcard);
......
...@@ -1954,7 +1954,10 @@ int32 scriptlib::card_is_controler_can_be_changed(lua_State *L) { ...@@ -1954,7 +1954,10 @@ int32 scriptlib::card_is_controler_can_be_changed(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
if(pcard->is_control_can_be_changed()) int32 ign = FALSE;
if(lua_gettop(L) >= 2)
ign = lua_toboolean(L, 2);
if(pcard->is_control_can_be_changed(ign))
lua_pushboolean(L, 1); lua_pushboolean(L, 1);
else else
lua_pushboolean(L, 0); lua_pushboolean(L, 0);
......
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