Commit 2e2f392d authored by DailyShana's avatar DailyShana

update

parent 779170a6
...@@ -3406,11 +3406,11 @@ int32 card::is_capable_send_to_grave(uint8 playerid) { ...@@ -3406,11 +3406,11 @@ int32 card::is_capable_send_to_grave(uint8 playerid) {
int32 card::is_capable_send_to_hand(uint8 playerid) { int32 card::is_capable_send_to_hand(uint8 playerid) {
if(is_status(STATUS_LEAVE_CONFIRMED)) if(is_status(STATUS_LEAVE_CONFIRMED))
return FALSE; return FALSE;
if((current.location == LOCATION_EXTRA) && (data.type & (TYPE_FUSION + TYPE_SYNCHRO + TYPE_XYZ + TYPE_LINK))) if((current.location == LOCATION_EXTRA) && is_extra_deck_monster())
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_TO_HAND)) if(is_affected_by_effect(EFFECT_CANNOT_TO_HAND))
return FALSE; return FALSE;
if(data.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK) && !is_capable_send_to_deck(playerid)) if(is_extra_deck_monster() && !is_capable_send_to_deck(playerid))
return FALSE; return FALSE;
if(!pduel->game_field->is_player_can_send_to_hand(playerid, this)) if(!pduel->game_field->is_player_can_send_to_hand(playerid, this))
return FALSE; return FALSE;
...@@ -3419,7 +3419,7 @@ int32 card::is_capable_send_to_hand(uint8 playerid) { ...@@ -3419,7 +3419,7 @@ int32 card::is_capable_send_to_hand(uint8 playerid) {
int32 card::is_capable_send_to_deck(uint8 playerid) { int32 card::is_capable_send_to_deck(uint8 playerid) {
if(is_status(STATUS_LEAVE_CONFIRMED)) if(is_status(STATUS_LEAVE_CONFIRMED))
return FALSE; return FALSE;
if((current.location == LOCATION_EXTRA) && (data.type & (TYPE_FUSION + TYPE_SYNCHRO + TYPE_XYZ + TYPE_LINK))) if((current.location == LOCATION_EXTRA) && is_extra_deck_monster())
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_TO_DECK)) if(is_affected_by_effect(EFFECT_CANNOT_TO_DECK))
return FALSE; return FALSE;
...@@ -3428,7 +3428,7 @@ int32 card::is_capable_send_to_deck(uint8 playerid) { ...@@ -3428,7 +3428,7 @@ int32 card::is_capable_send_to_deck(uint8 playerid) {
return TRUE; return TRUE;
} }
int32 card::is_capable_send_to_extra(uint8 playerid) { int32 card::is_capable_send_to_extra(uint8 playerid) {
if(!(data.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_PENDULUM | TYPE_LINK))) if(!is_extra_deck_monster() && !(data.type & TYPE_PENDULUM))
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_TO_DECK)) if(is_affected_by_effect(EFFECT_CANNOT_TO_DECK))
return FALSE; return FALSE;
...@@ -3466,7 +3466,7 @@ int32 card::is_capable_cost_to_grave(uint8 playerid) { ...@@ -3466,7 +3466,7 @@ int32 card::is_capable_cost_to_grave(uint8 playerid) {
int32 card::is_capable_cost_to_hand(uint8 playerid) { int32 card::is_capable_cost_to_hand(uint8 playerid) {
uint32 redirect = 0; uint32 redirect = 0;
uint32 dest = LOCATION_HAND; uint32 dest = LOCATION_HAND;
if(data.type & (TYPE_TOKEN | TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) if(data.type & (TYPE_TOKEN) || is_extra_deck_monster())
return FALSE; return FALSE;
if(current.location == LOCATION_HAND) if(current.location == LOCATION_HAND)
return FALSE; return FALSE;
...@@ -3489,7 +3489,7 @@ int32 card::is_capable_cost_to_hand(uint8 playerid) { ...@@ -3489,7 +3489,7 @@ int32 card::is_capable_cost_to_hand(uint8 playerid) {
int32 card::is_capable_cost_to_deck(uint8 playerid) { int32 card::is_capable_cost_to_deck(uint8 playerid) {
uint32 redirect = 0; uint32 redirect = 0;
uint32 dest = LOCATION_DECK; uint32 dest = LOCATION_DECK;
if(data.type & (TYPE_TOKEN | TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) if(data.type & (TYPE_TOKEN) || is_extra_deck_monster())
return FALSE; return FALSE;
if(current.location == LOCATION_DECK) if(current.location == LOCATION_DECK)
return FALSE; return FALSE;
...@@ -3512,7 +3512,7 @@ int32 card::is_capable_cost_to_deck(uint8 playerid) { ...@@ -3512,7 +3512,7 @@ int32 card::is_capable_cost_to_deck(uint8 playerid) {
int32 card::is_capable_cost_to_extra(uint8 playerid) { int32 card::is_capable_cost_to_extra(uint8 playerid) {
uint32 redirect = 0; uint32 redirect = 0;
uint32 dest = LOCATION_DECK; uint32 dest = LOCATION_DECK;
if(!(data.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK))) if(!is_extra_deck_monster())
return FALSE; return FALSE;
if(current.location == LOCATION_EXTRA) if(current.location == LOCATION_EXTRA)
return FALSE; return FALSE;
......
...@@ -188,6 +188,7 @@ public: ...@@ -188,6 +188,7 @@ public:
explicit card(duel* pd); explicit card(duel* pd);
~card(); ~card();
static bool card_operation_sort(card* c1, card* c2); static bool card_operation_sort(card* c1, card* c2);
const bool is_extra_deck_monster() { return !!(data.type & 0x4802040); }
uint32 get_infos(byte* buf, int32 query_flag, int32 use_cache = TRUE); uint32 get_infos(byte* buf, int32 query_flag, int32 use_cache = TRUE);
uint32 get_info_location(); uint32 get_info_location();
......
...@@ -162,7 +162,7 @@ void field::add_card(uint8 playerid, card* pcard, uint8 location, uint8 sequence ...@@ -162,7 +162,7 @@ void field::add_card(uint8 playerid, card* pcard, uint8 location, uint8 sequence
return; return;
if (!is_location_useable(playerid, location, sequence)) if (!is_location_useable(playerid, location, sequence))
return; return;
if((pcard->data.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) && (location & (LOCATION_HAND | LOCATION_DECK))) { if(pcard->is_extra_deck_monster() && (location & (LOCATION_HAND | LOCATION_DECK))) {
location = LOCATION_EXTRA; location = LOCATION_EXTRA;
pcard->sendto_param.position = POS_FACEDOWN_DEFENSE; pcard->sendto_param.position = POS_FACEDOWN_DEFENSE;
} }
...@@ -300,7 +300,7 @@ void field::move_card(uint8 playerid, card* pcard, uint8 location, uint8 sequenc ...@@ -300,7 +300,7 @@ void field::move_card(uint8 playerid, card* pcard, uint8 location, uint8 sequenc
return; return;
uint8 preplayer = pcard->current.controler; uint8 preplayer = pcard->current.controler;
uint8 presequence = pcard->current.sequence; uint8 presequence = pcard->current.sequence;
if((pcard->data.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) && (location & (LOCATION_HAND | LOCATION_DECK))) { if(pcard->is_extra_deck_monster() && (location & (LOCATION_HAND | LOCATION_DECK))) {
location = LOCATION_EXTRA; location = LOCATION_EXTRA;
pcard->sendto_param.position = POS_FACEDOWN_DEFENSE; pcard->sendto_param.position = POS_FACEDOWN_DEFENSE;
} }
...@@ -991,7 +991,7 @@ void field::swap_deck_and_grave(uint8 playerid) { ...@@ -991,7 +991,7 @@ void field::swap_deck_and_grave(uint8 playerid) {
player[playerid].list_grave.swap(player[playerid].list_main); player[playerid].list_grave.swap(player[playerid].list_main);
card_vector ex; card_vector ex;
for(auto clit = player[playerid].list_main.begin(); clit != player[playerid].list_main.end(); ) { for(auto clit = player[playerid].list_main.begin(); clit != player[playerid].list_main.end(); ) {
if((*clit)->data.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) { if((*clit)->is_extra_deck_monster()) {
ex.push_back(*clit); ex.push_back(*clit);
clit = player[playerid].list_main.erase(clit); clit = player[playerid].list_main.erase(clit);
} else } else
...@@ -3272,7 +3272,7 @@ int32 field::is_player_can_send_to_hand(uint8 playerid, card * pcard) { ...@@ -3272,7 +3272,7 @@ int32 field::is_player_can_send_to_hand(uint8 playerid, card * pcard) {
if (pduel->lua->check_condition(eset[i]->target, 3)) if (pduel->lua->check_condition(eset[i]->target, 3))
return FALSE; return FALSE;
} }
if((pcard->data.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) && !is_player_can_send_to_deck(playerid, pcard)) if(pcard->is_extra_deck_monster() && !is_player_can_send_to_deck(playerid, pcard))
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
......
...@@ -2112,7 +2112,7 @@ int32 scriptlib::card_is_able_to_deck_or_extra_as_cost(lua_State *L) { ...@@ -2112,7 +2112,7 @@ int32 scriptlib::card_is_able_to_deck_or_extra_as_cost(lua_State *L) {
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);
uint32 p = pcard->pduel->game_field->core.reason_player; uint32 p = pcard->pduel->game_field->core.reason_player;
int32 val = (pcard->data.type & 0x4802040) ? pcard->is_capable_cost_to_extra(p) : pcard->is_capable_cost_to_deck(p); int32 val = pcard->is_extra_deck_monster() ? pcard->is_capable_cost_to_extra(p) : pcard->is_capable_cost_to_deck(p);
if(val) if(val)
lua_pushboolean(L, 1); lua_pushboolean(L, 1);
else else
......
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