Commit a43d4924 authored by salix5's avatar salix5

EFFECT_CANNOT_TO_DECK

parent fef642dd
......@@ -2203,6 +2203,8 @@ int32 card::is_capable_send_to_grave(uint8 playerid) {
int32 card::is_capable_send_to_hand(uint8 playerid) {
if(is_status(STATUS_LEAVE_CONFIRMED))
return FALSE;
if((current.location == LOCATION_EXTRA) && (data.type & (TYPE_FUSION + TYPE_SYNCHRO + TYPE_XYZ)))
return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_TO_HAND))
return FALSE;
if(!pduel->game_field->is_player_can_send_to_hand(playerid, this))
......@@ -2212,6 +2214,8 @@ int32 card::is_capable_send_to_hand(uint8 playerid) {
int32 card::is_capable_send_to_deck(uint8 playerid) {
if(is_status(STATUS_LEAVE_CONFIRMED))
return FALSE;
if((current.location == LOCATION_EXTRA) && (data.type & (TYPE_FUSION + TYPE_SYNCHRO + TYPE_XYZ)))
return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_TO_DECK))
return FALSE;
if(!pduel->game_field->is_player_can_send_to_deck(playerid, this))
......@@ -2219,7 +2223,7 @@ int32 card::is_capable_send_to_deck(uint8 playerid) {
return TRUE;
}
int32 card::is_capable_send_to_extra(uint8 playerid) {
if(!(data.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ)))
if(!(data.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_PENDULUM)))
return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_TO_DECK))
return FALSE;
......
......@@ -463,6 +463,8 @@ int32 effect::is_chainable(uint8 tp) {
}
return TRUE;
}
//return: this can be reset or not
//RESET_CODE can only reset single effect
int32 effect::reset(uint32 reset_level, uint32 reset_type) {
switch (reset_type) {
case RESET_EVENT: {
......
......@@ -151,7 +151,7 @@ void field::add_card(uint8 playerid, card* pcard, uint8 location, uint8 sequence
pcard->operation_param = (pcard->operation_param & 0x00ffffff) | (POS_FACEDOWN_DEFENCE << 24);
}
if ((pcard->data.type & TYPE_PENDULUM) && (location == LOCATION_GRAVE)
&& !pcard->is_affected_by_effect(EFFECT_CANNOT_TO_DECK) && is_player_can_send_to_deck(playerid, pcard)
&& pcard->is_capable_send_to_extra(playerid)
&& (((pcard->previous.location == LOCATION_MZONE) && !pcard->is_status(STATUS_SUMMON_DISABLED))
|| ((pcard->previous.location == LOCATION_SZONE) && !pcard->is_status(STATUS_ACTIVATE_DISABLED)))) {
location = LOCATION_EXTRA;
......@@ -2154,8 +2154,6 @@ int32 field::is_player_can_send_to_grave(uint8 playerid, card * pcard) {
}
int32 field::is_player_can_send_to_hand(uint8 playerid, card * pcard) {
effect_set eset;
if((pcard->current.location == LOCATION_EXTRA) && (pcard->data.type & (TYPE_FUSION + TYPE_SYNCHRO + TYPE_XYZ)))
return FALSE;
filter_player_effect(playerid, EFFECT_CANNOT_TO_HAND, &eset);
for(int32 i = 0; i < eset.size(); ++i) {
if(!eset[i]->target)
......@@ -2170,8 +2168,6 @@ int32 field::is_player_can_send_to_hand(uint8 playerid, card * pcard) {
}
int32 field::is_player_can_send_to_deck(uint8 playerid, card * pcard) {
effect_set eset;
if((pcard->current.location == LOCATION_EXTRA) && (pcard->data.type & (TYPE_FUSION + TYPE_SYNCHRO + TYPE_XYZ)))
return FALSE;
filter_player_effect(playerid, EFFECT_CANNOT_TO_DECK, &eset);
for(int32 i = 0; i < eset.size(); ++i) {
if(!eset[i]->target)
......
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