Commit 11476d63 authored by fallenstardust's avatar fallenstardust

sync ocgcore

parent 90865214
...@@ -155,8 +155,9 @@ struct card_sort { ...@@ -155,8 +155,9 @@ struct card_sort {
#define REASON_REPLACE 0x1000000 // #define REASON_REPLACE 0x1000000 //
#define REASON_DRAW 0x2000000 // #define REASON_DRAW 0x2000000 //
#define REASON_REDIRECT 0x4000000 // #define REASON_REDIRECT 0x4000000 //
//#define REASON_REVEAL 0x8000000 // #define REASON_REVEAL 0x8000000 //
#define REASON_LINK 0x10000000 // #define REASON_LINK 0x10000000 //
#define REASON_LOST_OVERLAY 0x20000000 //
//Status //Status
#define STATUS_DISABLED 0x0001 // #define STATUS_DISABLED 0x0001 //
......
...@@ -2874,13 +2874,15 @@ int32 field::is_player_can_discard_deck_as_cost(uint8 playerid, int32 count) { ...@@ -2874,13 +2874,15 @@ int32 field::is_player_can_discard_deck_as_cost(uint8 playerid, int32 count) {
return FALSE; return FALSE;
if(is_player_affected_by_effect(playerid, EFFECT_CANNOT_DISCARD_DECK)) if(is_player_affected_by_effect(playerid, EFFECT_CANNOT_DISCARD_DECK))
return FALSE; return FALSE;
if((count == 1) && core.deck_reversed) card* topcard = player[playerid].list_main.back();
return player[playerid].list_main.back()->is_capable_cost_to_grave(playerid); if((count == 1) && topcard->is_position(POS_FACEUP))
return topcard->is_capable_cost_to_grave(playerid);
bool cant_remove = !is_player_can_action(playerid, EFFECT_CANNOT_REMOVE);
effect_set eset; effect_set eset;
filter_field_effect(EFFECT_TO_GRAVE_REDIRECT, &eset); filter_field_effect(EFFECT_TO_GRAVE_REDIRECT, &eset);
for(int32 i = 0; i < eset.size(); ++i) { for(int32 i = 0; i < eset.size(); ++i) {
uint32 redirect = eset[i]->get_value(); uint32 redirect = eset[i]->get_value();
if((redirect & LOCATION_REMOVED) && player[playerid].list_main.back()->is_affected_by_effect(EFFECT_CANNOT_REMOVE)) if((redirect & LOCATION_REMOVED) && (cant_remove || topcard->is_affected_by_effect(EFFECT_CANNOT_REMOVE)))
continue; continue;
uint8 p = eset[i]->get_handler_player(); uint8 p = eset[i]->get_handler_player();
if((p == playerid && eset[i]->s_range & LOCATION_DECK) || (p != playerid && eset[i]->o_range & LOCATION_DECK)) if((p == playerid && eset[i]->s_range & LOCATION_DECK) || (p != playerid && eset[i]->o_range & LOCATION_DECK))
......
...@@ -4270,7 +4270,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -4270,7 +4270,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
if(equipings.size()) if(equipings.size())
destroy(&equipings, 0, REASON_RULE + REASON_LOST_TARGET, PLAYER_NONE); destroy(&equipings, 0, REASON_RULE + REASON_LOST_TARGET, PLAYER_NONE);
if(overlays.size()) if(overlays.size())
send_to(&overlays, 0, REASON_RULE + REASON_LOST_TARGET, PLAYER_NONE, PLAYER_NONE, LOCATION_GRAVE, 0, POS_FACEUP); send_to(&overlays, 0, REASON_RULE + REASON_LOST_OVERLAY, PLAYER_NONE, PLAYER_NONE, LOCATION_GRAVE, 0, POS_FACEUP);
adjust_instant(); adjust_instant();
return FALSE; return FALSE;
} }
...@@ -4580,7 +4580,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret, ...@@ -4580,7 +4580,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
if(target->xyz_materials.size()) { if(target->xyz_materials.size()) {
card_set overlays; card_set overlays;
overlays.insert(target->xyz_materials.begin(), target->xyz_materials.end()); overlays.insert(target->xyz_materials.begin(), target->xyz_materials.end());
send_to(&overlays, 0, REASON_LOST_TARGET + REASON_RULE, PLAYER_NONE, PLAYER_NONE, LOCATION_GRAVE, 0, POS_FACEUP); send_to(&overlays, 0, REASON_LOST_OVERLAY + REASON_RULE, PLAYER_NONE, PLAYER_NONE, LOCATION_GRAVE, 0, POS_FACEUP);
} }
} }
if((target->previous.location == LOCATION_SZONE) && target->equiping_target) if((target->previous.location == LOCATION_SZONE) && target->equiping_target)
......
...@@ -3713,6 +3713,10 @@ int32 field::process_turn(uint16 step, uint8 turn_player) { ...@@ -3713,6 +3713,10 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
pduel->write_buffer16(infos.phase); pduel->write_buffer16(infos.phase);
raise_event((card*)0, EVENT_PREDRAW, 0, 0, 0, turn_player, 0); raise_event((card*)0, EVENT_PREDRAW, 0, 0, 0, turn_player, 0);
process_instant_event(); process_instant_event();
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_EVENT);
pduel->write_buffer8(turn_player);
pduel->write_buffer32(27);
if(core.new_fchain.size() || core.new_ochain.size()) if(core.new_fchain.size() || core.new_ochain.size())
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, 0); add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, 0);
return FALSE; return FALSE;
......
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