Commit 6e38611e authored by nanahira's avatar nanahira
parents 0d109dc5 323b0cc8
......@@ -3152,6 +3152,8 @@ int32 card::is_special_summonable(uint8 playerid, uint32 summon_type) {
return eset.size();
}
int32 card::is_can_be_special_summoned(effect* reason_effect, uint32 sumtype, uint8 sumpos, uint8 sumplayer, uint8 toplayer, uint8 nocheck, uint8 nolimit, uint32 zone) {
if(reason_effect->get_handler() == this)
reason_effect->status |= EFFECT_STATUS_SPSELF;
if(current.location == LOCATION_MZONE)
return FALSE;
if(current.location == LOCATION_REMOVED && (current.position & POS_FACEDOWN))
......@@ -3401,17 +3403,6 @@ int32 card::is_releasable_by_nonsummon(uint8 playerid) {
int32 card::is_releasable_by_effect(uint8 playerid, effect* peffect) {
if(!peffect)
return TRUE;
if(current.controler != playerid && !is_affected_by_effect(EFFECT_EXTRA_RELEASE)) {
effect_set eset;
filter_effect(EFFECT_EXTRA_RELEASE_NONSUM, &eset);
for(int32 i = 0; i < eset.size(); ++i) {
pduel->lua->add_param(peffect, PARAM_TYPE_EFFECT);
pduel->lua->add_param(REASON_EFFECT, PARAM_TYPE_INT);
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(3))
return FALSE;
}
}
effect_set eset;
filter_effect(EFFECT_UNRELEASABLE_EFFECT, &eset);
for(int32 i = 0; i < eset.size(); ++i) {
......
......@@ -119,6 +119,7 @@ public:
//status
#define EFFECT_STATUS_AVAILABLE 0x0001
//#define EFFECT_STATUS_ACTIVATED 0x0002
#define EFFECT_STATUS_SPSELF 0x0004
#define EFFECT_COUNT_CODE_OATH 0x10000000
#define EFFECT_COUNT_CODE_DUEL 0x20000000
......
......@@ -3942,8 +3942,6 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
pduel->write_buffer32(ptop->data.code | 0x80000000);
}
}
for(auto iter = param->leave.begin(); iter != param->leave.end(); ++iter)
raise_single_event(*iter, 0, EVENT_LEAVE_FIELD, (*iter)->current.reason_effect, (*iter)->current.reason, (*iter)->current.reason_player, 0, 0);
for(auto iter = param->discard.begin(); iter != param->discard.end(); ++iter)
raise_single_event(*iter, 0, EVENT_DISCARD, (*iter)->current.reason_effect, (*iter)->current.reason, (*iter)->current.reason_player, 0, 0);
if((core.global_flag & GLOBALFLAG_DETACH_EVENT) && param->detach.size()) {
......@@ -3953,8 +3951,6 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
}
}
process_single_event();
if(param->leave.size())
raise_event(&param->leave, EVENT_LEAVE_FIELD, reason_effect, reason, reason_player, 0, 0);
if(param->discard.size())
raise_event(&param->discard, EVENT_DISCARD, reason_effect, reason, reason_player, 0, 0);
if((core.global_flag & GLOBALFLAG_DETACH_EVENT) && param->detach.size())
......@@ -3967,6 +3963,10 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
exargs* param = (exargs*)targets;
core.units.begin()->ptarget = param->targets;
targets = param->targets;
for(auto iter = param->leave.begin(); iter != param->leave.end(); ++iter)
raise_single_event(*iter, 0, EVENT_LEAVE_FIELD, (*iter)->current.reason_effect, (*iter)->current.reason, (*iter)->current.reason_player, 0, 0);
if(param->leave.size())
raise_event(&param->leave, EVENT_LEAVE_FIELD, reason_effect, reason, reason_player, 0, 0);
delete param;
uint8 nloc;
card_set tohand, todeck, tograve, remove, released, destroyed, retgrave;
......
......@@ -2106,7 +2106,8 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
&& peffect->is_chainable(priority) && peffect->is_activateable(priority, clit->evt, TRUE)) {
for(auto cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait) {
if(cait->triggering_player == priority) {
if(std::any_of(core.new_ochain_h.begin(), core.new_ochain_h.end(), [=](chain ch) { return ch.chain_id == cait->chain_id; })) {
if((peffect->status & EFFECT_STATUS_SPSELF) && (cait->triggering_effect->status & EFFECT_STATUS_SPSELF)
&& std::any_of(core.new_ochain_h.begin(), core.new_ochain_h.end(), [=](chain ch) { return ch.chain_id == cait->chain_id; })) {
act = false;
break;
}
......
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