Commit f31844fd authored by salix5's avatar salix5

revert, field::process_point_event()

simplify the condtion of had trigger
parent 399f4166
......@@ -58,7 +58,8 @@ int32 effect::is_disable_related() {
return FALSE;
}
// check if a single/field/equip effect is available
// check range, EFFECT_FLAG_OWNER_RELATE, STATUS_BATTLE_DESTROYED, STATUS_EFFECT_ENABLED
// check properties: range, EFFECT_FLAG_OWNER_RELATE, STATUS_BATTLE_DESTROYED, STATUS_EFFECT_ENABLED
// check fucntions: condition
int32 effect::is_available() {
if (type & EFFECT_TYPE_ACTIONS)
return FALSE;
......@@ -237,7 +238,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
if(((type & EFFECT_TYPE_FIELD) || ((type & EFFECT_TYPE_SINGLE) && (is_flag(EFFECT_FLAG_SINGLE_RANGE)))) && (handler->current.location & LOCATION_ONFIELD)
&& (!handler->is_position(POS_FACEUP) || !handler->is_status(STATUS_EFFECT_ENABLED)))
return FALSE;
if((type & EFFECT_TYPE_SINGLE) && (is_flag(EFFECT_FLAG_SINGLE_RANGE)) && !in_range(handler->current.location, handler->current.sequence))
if((type & EFFECT_TYPE_SINGLE) && is_flag(EFFECT_FLAG_SINGLE_RANGE) && !in_range(handler->current.location, handler->current.sequence))
return FALSE;
if((is_flag(EFFECT_FLAG_OWNER_RELATE)) && !(is_flag(EFFECT_FLAG_CANNOT_DISABLE)) && owner->is_status(STATUS_DISABLED))
return FALSE;
......@@ -263,7 +264,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
pduel->game_field->restore_lp_cost();
return result;
}
// check EFFECT_CANNOT_ACTIVATE, EFFECT_ACTIVATE_COST
// check functions: value of EFFECT_CANNOT_ACTIVATE, target, cost of EFFECT_ACTIVATE_COST
int32 effect::is_action_check(uint8 playerid) {
effect_set eset;
pduel->game_field->filter_player_effect(playerid, EFFECT_CANNOT_ACTIVATE, &eset);
......@@ -289,7 +290,7 @@ int32 effect::is_action_check(uint8 playerid) {
}
return TRUE;
}
// check condition, cost(chk=0), target(chk=0)
// check functions: condition, cost(chk=0), target(chk=0)
int32 effect::is_activate_ready(uint8 playerid, const tevent& e, int32 neglect_cond, int32 neglect_cost, int32 neglect_target) {
if (!neglect_cond && condition) {
pduel->lua->add_param(this, PARAM_TYPE_EFFECT);
......@@ -334,6 +335,7 @@ int32 effect::is_activate_ready(uint8 playerid, const tevent& e, int32 neglect_c
}
return TRUE;
}
// check functions: condition
int32 effect::is_condition_check(uint8 playerid, const tevent& e) {
if(!(type & EFFECT_TYPE_ACTIVATE) && (handler->current.location & (LOCATION_ONFIELD | LOCATION_REMOVED)) && !handler->is_position(POS_FACEUP))
return FALSE;
......
......@@ -1730,9 +1730,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
if(peffect->is_chainable(tp) && peffect->is_activateable(tp, clit->evt, TRUE)
&& (peffect->code == EVENT_FLIP && infos.phase == PHASE_DAMAGE || (clit->triggering_location & 0x43)
|| !(peffect->handler->current.location & 0x43) || peffect->handler->is_position(POS_FACEUP))) {
if(!(peffect->is_flag(EFFECT_FLAG_FIELD_ONLY)) && clit->triggering_location == LOCATION_HAND
&& (((peffect->type & EFFECT_TYPE_SINGLE) && !(peffect->is_flag(EFFECT_FLAG_SINGLE_RANGE)) && peffect->handler->is_has_relation(*clit))
|| (peffect->range & LOCATION_HAND))) {
if(!(peffect->is_flag(EFFECT_FLAG_FIELD_ONLY)) && clit->triggering_location == LOCATION_HAND && (peffect->range & LOCATION_HAND)) {
core.new_ochain_h.push_back(*clit);
act = false;
} else if((peffect->is_flag(EFFECT_FLAG_FIELD_ONLY)) || !(peffect->type & EFFECT_TYPE_FIELD)
......@@ -1791,9 +1789,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
if(peffect->is_chainable(tp) && peffect->is_activateable(tp, clit->evt, TRUE)
&& (peffect->code == EVENT_FLIP && infos.phase == PHASE_DAMAGE || (clit->triggering_location & 0x43)
|| !(peffect->handler->current.location & 0x43) || peffect->handler->is_position(POS_FACEUP))) {
if(!(peffect->is_flag(EFFECT_FLAG_FIELD_ONLY)) && clit->triggering_location == LOCATION_HAND
&& (((peffect->type & EFFECT_TYPE_SINGLE) && !(peffect->is_flag(EFFECT_FLAG_SINGLE_RANGE)) && peffect->handler->is_has_relation(*clit))
|| (peffect->range & LOCATION_HAND))) {
if(!(peffect->is_flag(EFFECT_FLAG_FIELD_ONLY)) && clit->triggering_location == LOCATION_HAND && (peffect->range & LOCATION_HAND)) {
continue;
} else if((peffect->is_flag(EFFECT_FLAG_FIELD_ONLY)) || !(peffect->type & EFFECT_TYPE_FIELD)
|| peffect->in_range(clit->triggering_location, clit->triggering_sequence)) {
......@@ -2078,7 +2074,7 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
act = false;
break;
}
if((peffect->is_flag(EFFECT_FLAG_CHAIN_UNIQUE)) && (cait->triggering_effect->handler->data.code == peffect->handler->data.code)) {
if(cait->triggering_effect->handler->data.code == peffect->handler->data.code) {
act = false;
break;
}
......@@ -4745,7 +4741,7 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
core.chain_limit_p = 0;
}
reset_chain();
if(core.summoning_card)
if(core.summoning_card || core.effect_damage_step == 1)
core.subunits.push_back(core.reserved);
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