Commit c69cb14f authored by fallenstardust's avatar fallenstardust

sync ocgcore

parent e26b45e2
...@@ -1979,12 +1979,14 @@ uint8 card::refresh_control_status() { ...@@ -1979,12 +1979,14 @@ uint8 card::refresh_control_status() {
effect* peffect = eset.get_last(); effect* peffect = eset.get_last();
if(peffect->id >= last_id) { if(peffect->id >= last_id) {
card* pcard = peffect->get_handler(); card* pcard = peffect->get_handler();
pduel->game_field->core.readjust_map[pcard]++; uint8 val = (uint8)peffect->get_value(this);
if(pduel->game_field->core.readjust_map[pcard] > 3) { if(val != current.controler)
pduel->game_field->core.readjust_map[pcard]++;
if(pduel->game_field->core.readjust_map[pcard] > 5) {
pduel->game_field->send_to(pcard, 0, REASON_RULE, peffect->get_handler_player(), PLAYER_NONE, LOCATION_GRAVE, 0, POS_FACEUP); pduel->game_field->send_to(pcard, 0, REASON_RULE, peffect->get_handler_player(), PLAYER_NONE, LOCATION_GRAVE, 0, POS_FACEUP);
return final; return final;
} }
final = (uint8)peffect->get_value(this); final = val;
} }
} }
return final; return final;
......
...@@ -436,15 +436,12 @@ int32 effect::is_activate_check(uint8 playerid, const tevent& e, int32 neglect_c ...@@ -436,15 +436,12 @@ int32 effect::is_activate_check(uint8 playerid, const tevent& e, int32 neglect_c
pduel->game_field->restore_lp_cost(); pduel->game_field->restore_lp_cost();
return result; return result;
} }
// check if pcard is the target of the field effect this
int32 effect::is_target(card* pcard) { int32 effect::is_target(card* pcard) {
if(type & EFFECT_TYPE_ACTIONS) if(type & EFFECT_TYPE_ACTIONS)
return FALSE; return FALSE;
if(type & (EFFECT_TYPE_SINGLE | EFFECT_TYPE_EQUIP | EFFECT_TYPE_XMATERIAL) && !(type & EFFECT_TYPE_FIELD)) if(type & (EFFECT_TYPE_SINGLE | EFFECT_TYPE_EQUIP | EFFECT_TYPE_XMATERIAL) && !(type & EFFECT_TYPE_FIELD))
return TRUE; return TRUE;
if((type & EFFECT_TYPE_TARGET) && !(type & EFFECT_TYPE_FIELD)) { if((type & EFFECT_TYPE_TARGET) && !(type & EFFECT_TYPE_FIELD)) {
if(pcard->get_status(STATUS_SUMMONING | STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED | STATUS_SPSUMMON_STEP))
return FALSE;
return is_fit_target_function(pcard); return is_fit_target_function(pcard);
} }
if(pcard && !is_flag(EFFECT_FLAG_SET_AVAILABLE) && (pcard->current.location & LOCATION_ONFIELD) if(pcard && !is_flag(EFFECT_FLAG_SET_AVAILABLE) && (pcard->current.location & LOCATION_ONFIELD)
......
...@@ -2620,6 +2620,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2620,6 +2620,7 @@ int32 field::process_battle_command(uint16 step) {
return FALSE; return FALSE;
} }
case 8: { case 8: {
core.attack_cancelable = TRUE;
pduel->write_buffer8(MSG_ATTACK); pduel->write_buffer8(MSG_ATTACK);
pduel->write_buffer32(core.attacker->get_info_location()); pduel->write_buffer32(core.attacker->get_info_location());
if(core.attack_target) { if(core.attack_target) {
...@@ -2703,6 +2704,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2703,6 +2704,7 @@ int32 field::process_battle_command(uint16 step) {
add_process(PROCESSOR_SELECT_YESNO, 0, 0, 0, infos.turn_player, 30); add_process(PROCESSOR_SELECT_YESNO, 0, 0, 0, infos.turn_player, 30);
else { else {
returns.ivalue[0] = TRUE; returns.ivalue[0] = TRUE;
core.attack_cancelable = FALSE;
} }
return FALSE; return FALSE;
} }
...@@ -2711,7 +2713,6 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2711,7 +2713,6 @@ int32 field::process_battle_command(uint16 step) {
if(returns.ivalue[0]) { if(returns.ivalue[0]) {
core.units.begin()->arg1 = TRUE; core.units.begin()->arg1 = TRUE;
core.units.begin()->arg3 = FALSE; core.units.begin()->arg3 = FALSE;
core.attack_cancelable = TRUE;
core.units.begin()->step = 3; core.units.begin()->step = 3;
} }
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