Commit fdb86c96 authored by DailyShana's avatar DailyShana

update REASON_RETURN and remove EVENT_RETURN_TO_GRAVE

parent 45ecd97f
......@@ -516,7 +516,6 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EVENT_LEVEL_UP 1200
#define EVENT_PAY_LPCOST 1201
#define EVENT_DETACH_MATERIAL 1202
#define EVENT_RETURN_TO_GRAVE 1203
#define EVENT_TURN_END 1210
#define EVENT_PHASE 0x1000
#define EVENT_PHASE_START 0x2000
......
......@@ -268,6 +268,8 @@ void field::send_to(card_set* targets, effect* reason_effect, uint32 reason, uin
p = reason_player;
if(destination & (LOCATION_GRAVE | LOCATION_REMOVED) || p == PLAYER_NONE)
p = pcard->owner;
if(destination == LOCATION_GRAVE && pcard->current.location == LOCATION_REMOVED)
pcard->current.reason |= REASON_RETURN;
uint32 pos = position;
if(destination != LOCATION_REMOVED)
pos = POS_FACEUP;
......@@ -4126,7 +4128,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
core.units.begin()->ptarget = param->targets;
targets = param->targets;
delete param;
card_set tohand, todeck, tograve, remove, discard, released, destroyed, retgrave;
card_set tohand, todeck, tograve, remove, discard, released, destroyed;
card_set equipings, overlays;
for(auto& pcard : targets->container) {
uint8 nloc = pcard->current.location;
......@@ -4159,15 +4161,10 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
todeck.insert(pcard);
raise_single_event(pcard, 0, EVENT_TO_DECK, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0);
}
if(nloc == LOCATION_GRAVE) {
if(pcard->current.reason & REASON_RETURN) {
retgrave.insert(pcard);
raise_single_event(pcard, 0, EVENT_RETURN_TO_GRAVE, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0);
} else {
if(nloc == LOCATION_GRAVE && !(pcard->current.reason & REASON_RETURN)) {
tograve.insert(pcard);
raise_single_event(pcard, 0, EVENT_TO_GRAVE, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0);
}
}
if(nloc == LOCATION_REMOVED || ((pcard->data.type & TYPE_TOKEN) && pcard->sendto_param.location == LOCATION_REMOVED)) {
remove.insert(pcard);
raise_single_event(pcard, 0, EVENT_REMOVE, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0);
......@@ -4205,8 +4202,6 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
raise_event(&released, EVENT_RELEASE, reason_effect, reason, reason_player, 0, 0);
if(destroyed.size())
raise_event(&destroyed, EVENT_DESTROYED, reason_effect, reason, reason_player, 0, 0);
if(retgrave.size())
raise_event(&retgrave, EVENT_RETURN_TO_GRAVE, reason_effect, reason, reason_player, 0, 0);
raise_event(&targets->container, EVENT_MOVE, reason_effect, reason, reason_player, 0, 0);
process_single_event();
process_instant_event();
......
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