Commit 35099ba1 authored by salix5's avatar salix5

field::process_point_event()

parent b8ca2d52
......@@ -250,6 +250,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
int32 effect::is_action_check(uint8 playerid) {
effect_set eset;
pduel->game_field->filter_player_effect(playerid, EFFECT_CANNOT_ACTIVATE, &eset);
......@@ -275,6 +276,7 @@ int32 effect::is_action_check(uint8 playerid) {
}
return TRUE;
}
// check 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);
......@@ -320,7 +322,7 @@ int32 effect::is_activate_ready(uint8 playerid, const tevent& e, int32 neglect_c
return TRUE;
}
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)))
if(!(type & EFFECT_TYPE_ACTIVATE) && (handler->current.location & (LOCATION_ONFIELD | LOCATION_REMOVED)) && !handler->is_position(POS_FACEUP))
return FALSE;
if(!condition)
return TRUE;
......
......@@ -1750,7 +1750,8 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
uint8 tp = clit->triggering_player;
bool act = true;
if(peffect->is_chainable(tp) && peffect->is_activateable(tp, clit->evt, TRUE)
&& ((peffect->code == EVENT_FLIP) || (clit->triggering_location & 0x3) || !(peffect->handler->current.location & 0x3) || peffect->handler->is_status(STATUS_IS_PUBLIC))) {
&& (peffect->code == EVENT_FLIP && infos.phase == PHASE_DAMAGE || (clit->triggering_location & 0x3)
|| !(peffect->handler->current.location & 0x3) || peffect->handler->is_status(STATUS_IS_PUBLIC))) {
if(peffect->flag & EFFECT_FLAG_CHAIN_UNIQUE) {
if(tp == infos.turn_player) {
for(auto tpit = core.tpchain.begin(); tpit != core.tpchain.end(); ++tpit) {
......@@ -1852,7 +1853,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
uint8 tp = clit->triggering_player;
bool act = true;
if(peffect->is_chainable(tp) && peffect->is_activateable(tp, clit->evt, TRUE)
&& ((peffect->code == EVENT_FLIP) || (clit->triggering_location & 0x3)
&& (peffect->code == EVENT_FLIP && infos.phase == PHASE_DAMAGE || (clit->triggering_location & 0x3)
|| !(peffect->handler->current.location & 0x3) || peffect->handler->is_status(STATUS_IS_PUBLIC))) {
if(!(peffect->flag & EFFECT_FLAG_FIELD_ONLY) && clit->triggering_location == LOCATION_HAND
&& (((peffect->type & EFFECT_TYPE_SINGLE) && !(peffect->flag & EFFECT_FLAG_SINGLE_RANGE) && peffect->handler->is_has_relation(peffect))
......@@ -1913,7 +1914,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
continue;
bool act = true;
if(peffect->is_chainable(tp) && peffect->is_activateable(tp, clit->evt, TRUE)
&& ((peffect->code == EVENT_FLIP) || (clit->triggering_location & 0x3)
&& (peffect->code == EVENT_FLIP && infos.phase == PHASE_DAMAGE || (clit->triggering_location & 0x3)
|| !(peffect->handler->current.location & 0x3) || peffect->handler->is_status(STATUS_IS_PUBLIC))) {
if(!(peffect->flag & EFFECT_FLAG_FIELD_ONLY) && clit->triggering_location == LOCATION_HAND
&& (((peffect->type & EFFECT_TYPE_SINGLE) && !(peffect->flag & EFFECT_FLAG_SINGLE_RANGE) && peffect->handler->is_has_relation(peffect))
......
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