Commit c69cb14f authored by fallenstardust's avatar fallenstardust

sync ocgcore

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