Commit fd5d5bf7 authored by salix5's avatar salix5

REASON_BATTLE

parent 4c9f4146
......@@ -3028,7 +3028,9 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
card_set leave_p, destroying;
for(auto cit = targets->container.begin(); cit != targets->container.end(); ++cit) {
card* pcard = *cit;
if((pcard->current.location == LOCATION_MZONE) && pcard->is_status(STATUS_BATTLE_DESTROYED) && !(pcard->current.reason & (REASON_DESTROY | REASON_EFFECT))) {
if((pcard->current.location == LOCATION_MZONE) && pcard->is_status(STATUS_BATTLE_DESTROYED)
&& !(pcard->current.reason & REASON_RULE)
&& (pcard->current.reason & (REASON_DESTROY | REASON_EFFECT)) != (REASON_DESTROY | REASON_EFFECT)) {
pcard->current.reason |= REASON_DESTROY | REASON_BATTLE;
raise_single_event(pcard, 0, EVENT_DESTROY, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0);
destroying.insert(pcard);
......
......@@ -3705,6 +3705,7 @@ int32 field::process_battle_command(uint16 step) {
card_set ing;
card_set ed;
if(core.attacker->is_status(STATUS_BATTLE_DESTROYED)
&& !(core.attacker->current.reason & REASON_RULE)
&& !((core.attacker->current.reason & REASON_EFFECT + REASON_DESTROY) == REASON_EFFECT + REASON_DESTROY)) {
raise_single_event(core.attack_target, 0, EVENT_BATTLE_DESTROYING, 0, core.attacker->current.reason, core.attack_target->current.controler, 0, 1);
raise_single_event(core.attacker, 0, EVENT_BATTLE_DESTROYED, 0, core.attacker->current.reason, core.attack_target->current.controler, 0, 0);
......@@ -3712,6 +3713,7 @@ int32 field::process_battle_command(uint16 step) {
ed.insert(core.attacker);
}
if(core.attack_target && core.attack_target->is_status(STATUS_BATTLE_DESTROYED)
&& !(core.attack_target->current.reason & REASON_RULE)
&& !((core.attack_target->current.reason & REASON_EFFECT + REASON_DESTROY) == REASON_EFFECT + REASON_DESTROY)) {
raise_single_event(core.attacker, 0, EVENT_BATTLE_DESTROYING, 0, core.attack_target->current.reason, core.attacker->current.controler, 0, 0);
raise_single_event(core.attack_target, 0, EVENT_BATTLE_DESTROYED, 0, core.attack_target->current.reason, core.attacker->current.controler, 0, 1);
......
......@@ -99,7 +99,7 @@ function c53334471.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
g1:Merge(g2)
if g1:GetCount()>0 then
Duel.SendtoGrave(g1,REASON_EFFECT)
Duel.SendtoGrave(g1,REASON_RULE)
Duel.Readjust()
end
end
......@@ -46,12 +46,15 @@ function c81907872.posop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangePosition(c,POS_FACEDOWN_DEFENCE)
end
end
function c81907872.cfilter(c,tp)
return c:IsControler(tp) and c:GetPreviousControler()==tp and c:IsSetCard(0x8d) and c:IsReason(REASON_DESTROY) and c:IsType(TYPE_MONSTER)
and (not c:IsReason(REASON_BATTLE) or c==Duel.GetAttackTarget()) and not c:IsPreviousLocation(LOCATION_SZONE)
function c81907872.cfilter1(c,tp)
return c:IsControler(tp) and c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY+REASON_EFFECT) and c:IsSetCard(0x8d) and c:IsType(TYPE_MONSTER)
and not c:IsPreviousLocation(LOCATION_SZONE)
end
function c81907872.cfilter2(c)
return c:IsReason(REASON_BATTLE) and c:IsStatus(STATUS_OPPO_BATTLE) and c==Duel.GetAttackTarget()
end
function c81907872.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and eg:IsExists(c81907872.cfilter,1,nil,tp)
return (rp~=tp and eg:IsExists(c81907872.cfilter1,1,nil,tp)) or eg:IsExists(c81907872.cfilter2,1,nil)
end
function c81907872.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -99,7 +99,7 @@ function c90846359.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
g1:Merge(g2)
if g1:GetCount()>0 then
Duel.SendtoGrave(g1,REASON_EFFECT)
Duel.SendtoGrave(g1,REASON_RULE)
Duel.Readjust()
end
end
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