Commit 973f3a6a authored by DailyShana's avatar DailyShana

update trigger effect in deck

similar to hand trigger when chaining
parent 91edd76b
......@@ -3341,16 +3341,17 @@ int32 field::check_cteffect_hint(effect* peffect, uint8 playerid) {
}
return FALSE;
}
int32 field::check_hand_trigger(chain& ch) {
int32 field::check_nonpublic_trigger(chain& ch) {
effect* peffect = ch.triggering_effect;
card* phandler = peffect->get_handler();
if(!peffect->is_flag(EFFECT_FLAG_FIELD_ONLY)
&& ((peffect->type & EFFECT_TYPE_SINGLE) && !peffect->is_flag(EFFECT_FLAG_SINGLE_RANGE)
&& phandler->is_has_relation(ch) && ch.triggering_location == LOCATION_HAND
|| (peffect->range & LOCATION_HAND))) {
&& phandler->is_has_relation(ch) && (ch.triggering_location & (LOCATION_HAND | LOCATION_DECK))
|| (peffect->range & (LOCATION_HAND | LOCATION_DECK)))) {
ch.flag |= CHAIN_HAND_TRIGGER;
core.new_ochain_h.push_back(ch);
if(ch.triggering_location == LOCATION_HAND && phandler->is_position(POS_FACEDOWN)
|| ch.triggering_location == LOCATION_DECK
|| peffect->range && !peffect->in_range(ch))
return FALSE;
}
......
......@@ -481,7 +481,7 @@ public:
int32 get_cteffect(effect* peffect, int32 playerid, int32 store);
int32 get_cteffect_evt(effect* feffect, int32 playerid, const tevent& e, int32 store);
int32 check_cteffect_hint(effect* peffect, uint8 playerid);
int32 check_hand_trigger(chain& ch);
int32 check_nonpublic_trigger(chain& ch);
int32 check_trigger_effect(const chain& ch) const;
int32 check_spself_from_hand_trigger(const chain& ch) const;
int32 is_able_to_enter_bp();
......
......@@ -1367,7 +1367,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
clit->set_triggering_state(phandler);
}
uint8 tp = clit->triggering_player;
if(check_hand_trigger(*clit) && check_trigger_effect(*clit)
if(check_nonpublic_trigger(*clit) && check_trigger_effect(*clit)
&& peffect->is_chainable(tp) && peffect->is_activateable(tp, clit->evt, TRUE)
&& check_spself_from_hand_trigger(*clit)) {
if(tp == core.current_player)
......@@ -1666,9 +1666,9 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
ch.triggering_player = phandler->current.controler;
ch.set_triggering_state(phandler);
}
if(ch.triggering_player == priority && ch.triggering_location == LOCATION_HAND
&& phandler->is_position(POS_FACEDOWN) && !phandler->is_status(STATUS_CHAINING) && phandler->is_has_relation(ch)
&& peffect->is_chainable(priority) && peffect->is_activateable(priority, ch.evt, TRUE)
if(ch.triggering_player == priority && !phandler->is_status(STATUS_CHAINING)
&& (ch.triggering_location == LOCATION_HAND && phandler->is_position(POS_FACEDOWN) || ch.triggering_location == LOCATION_DECK)
&& phandler->is_has_relation(ch) && peffect->is_chainable(priority) && peffect->is_activateable(priority, ch.evt, TRUE)
&& check_spself_from_hand_trigger(ch))
core.select_chains.push_back(ch);
}
......
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