Commit 3a95a668 authored by salix5's avatar salix5

field::send_to()

parent cd93c0a5
...@@ -3463,17 +3463,20 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -3463,17 +3463,20 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
equipings.insert(equipc); equipings.insert(equipc);
} }
} }
// adjust card state and raise events
if(!(pcard->data.type & TYPE_TOKEN)) { if(!(pcard->data.type & TYPE_TOKEN)) {
pcard->enable_field_effect(true);
if(nloc == LOCATION_HAND) { if(nloc == LOCATION_HAND) {
pcard->enable_field_effect(true);
tohand.insert(pcard); tohand.insert(pcard);
pcard->reset(RESET_TOHAND, RESET_EVENT); pcard->reset(RESET_TOHAND, RESET_EVENT);
raise_single_event(pcard, 0, EVENT_TO_HAND, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0); raise_single_event(pcard, 0, EVENT_TO_HAND, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0);
} else if(nloc == LOCATION_DECK || nloc == LOCATION_EXTRA) { } else if(nloc == LOCATION_DECK || nloc == LOCATION_EXTRA) {
pcard->enable_field_effect(true);
todeck.insert(pcard); todeck.insert(pcard);
pcard->reset(RESET_TODECK, RESET_EVENT); pcard->reset(RESET_TODECK, RESET_EVENT);
raise_single_event(pcard, 0, EVENT_TO_DECK, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0); raise_single_event(pcard, 0, EVENT_TO_DECK, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0);
} else if(nloc == LOCATION_GRAVE) { } else if(nloc == LOCATION_GRAVE) {
pcard->enable_field_effect(true);
pcard->reset(RESET_TOGRAVE, RESET_EVENT); pcard->reset(RESET_TOGRAVE, RESET_EVENT);
if(pcard->current.reason & REASON_RETURN) { if(pcard->current.reason & REASON_RETURN) {
retgrave.insert(pcard); retgrave.insert(pcard);
...@@ -3483,8 +3486,14 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -3483,8 +3486,14 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
tograve.insert(pcard); tograve.insert(pcard);
raise_single_event(pcard, 0, EVENT_TO_GRAVE, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0); raise_single_event(pcard, 0, EVENT_TO_GRAVE, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0);
} }
} else if(nloc == LOCATION_REMOVED){
if(pcard->current.position & POS_FACEUP)
pcard->enable_field_effect(true);
else
pcard->enable_field_effect(false);
} }
} }
// EVENT_REMOVE is a special case since tokens are involved
if(nloc == LOCATION_REMOVED || ((pcard->data.type & TYPE_TOKEN) && ((pcard->operation_param >> 8) & 0xff) == LOCATION_REMOVED)) { if(nloc == LOCATION_REMOVED || ((pcard->data.type & TYPE_TOKEN) && ((pcard->operation_param >> 8) & 0xff) == LOCATION_REMOVED)) {
remove.insert(pcard); remove.insert(pcard);
if(pcard->current.reason & REASON_TEMPORARY) if(pcard->current.reason & REASON_TEMPORARY)
......
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