Commit 68d46afa authored by mercury233's avatar mercury233 Committed by GitHub

add EVENT_BREAK_EFFECT (#1481)

parent 04940115
--電脳堺姫-娘々 --電脳堺姫-娘々
function c8736823.initial_effect(c) function c8736823.initial_effect(c)
--same effect send this card to grave and spsummon another card check --same effect send this card to grave and spsummon another card check
--not fully implemented
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_TO_GRAVE) e0:SetCode(EVENT_TO_GRAVE)
...@@ -47,6 +46,12 @@ function c8736823.checkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,6 +46,12 @@ function c8736823.checkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetOperation(c8736823.resetop) e1:SetOperation(c8736823.resetop)
e1:SetLabelObject(e) e1:SetLabelObject(e)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_BREAK_EFFECT)
e2:SetOperation(c8736823.resetop2)
e2:SetReset(RESET_CHAIN)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp)
end end
end end
function c8736823.resetop(e,tp,eg,ep,ev,re,r,rp) function c8736823.resetop(e,tp,eg,ep,ev,re,r,rp)
...@@ -54,6 +59,12 @@ function c8736823.resetop(e,tp,eg,ep,ev,re,r,rp) ...@@ -54,6 +59,12 @@ function c8736823.resetop(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabelObject(nil) e:GetLabelObject():SetLabelObject(nil)
e:Reset() e:Reset()
end end
function c8736823.resetop2(e,tp,eg,ep,ev,re,r,rp)
local e1=e:GetLabelObject()
e1:GetLabelObject():SetLabelObject(nil)
e1:Reset()
e:Reset()
end
function c8736823.cfilter(c,tp,se) function c8736823.cfilter(c,tp,se)
return c:IsFaceup() and c:IsLevel(3) and c:IsControler(tp) and (se==nil or c:GetReasonEffect()~=se) return c:IsFaceup() and c:IsLevel(3) and c:IsControler(tp) and (se==nil or c:GetReasonEffect()~=se)
end end
......
--ティンダングル・イントルーダー --ティンダングル・イントルーダー
function c94142993.initial_effect(c) function c94142993.initial_effect(c)
--same effect send this card to grave and spsummon another card check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_TO_GRAVE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetOperation(c94142993.checkop)
c:RegisterEffect(e0)
--flip --flip
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(94142993,0)) e1:SetDescription(aux.Stringid(94142993,0))
...@@ -28,11 +35,41 @@ function c94142993.initial_effect(c) ...@@ -28,11 +35,41 @@ function c94142993.initial_effect(c)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_GRAVE) e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,94142995) e3:SetCountLimit(1,94142995)
e3:SetLabelObject(e0)
e3:SetCondition(c94142993.spcon) e3:SetCondition(c94142993.spcon)
e3:SetTarget(c94142993.sptg) e3:SetTarget(c94142993.sptg)
e3:SetOperation(c94142993.spop) e3:SetOperation(c94142993.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c94142993.checkop(e,tp,eg,ep,ev,re,r,rp)
if (r&REASON_EFFECT)>0 then
e:SetLabelObject(re)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(c94142993.resetop)
e1:SetLabelObject(e)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_BREAK_EFFECT)
e2:SetOperation(c94142993.resetop2)
e2:SetReset(RESET_CHAIN)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp)
end
end
function c94142993.resetop(e,tp,eg,ep,ev,re,r,rp)
--this will run after EVENT_SPSUMMON_SUCCESS
e:GetLabelObject():SetLabelObject(nil)
e:Reset()
end
function c94142993.resetop2(e,tp,eg,ep,ev,re,r,rp)
local e1=e:GetLabelObject()
e1:GetLabelObject():SetLabelObject(nil)
e1:Reset()
e:Reset()
end
function c94142993.thfilter(c) function c94142993.thfilter(c)
return c:IsSetCard(0x10b) and c:IsAbleToHand() return c:IsSetCard(0x10b) and c:IsAbleToHand()
end end
...@@ -62,11 +99,12 @@ function c94142993.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -62,11 +99,12 @@ function c94142993.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
end end
end end
function c94142993.cfilter(c,tp) function c94142993.cfilter(c,tp,se)
return c:IsPosition(POS_FACEDOWN_DEFENSE) and c:IsControler(tp) return c:IsPosition(POS_FACEDOWN_DEFENSE) and c:IsControler(tp) and (se==nil or c:GetReasonEffect()~=se)
end end
function c94142993.spcon(e,tp,eg,ep,ev,re,r,rp) function c94142993.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c94142993.cfilter,1,nil,tp) local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(c94142993.cfilter,1,nil,tp,se)
end end
function c94142993.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c94142993.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -585,6 +585,7 @@ EVENT_BECOME_TARGET =1028 --成为效果对象时 ...@@ -585,6 +585,7 @@ EVENT_BECOME_TARGET =1028 --成为效果对象时
EVENT_DESTROYED =1029 --被破坏时 EVENT_DESTROYED =1029 --被破坏时
EVENT_MOVE =1030 --移動卡片(急兔馬) EVENT_MOVE =1030 --移動卡片(急兔馬)
EVENT_ADJUST =1040 --adjust_all()调整後(御前试合) EVENT_ADJUST =1040 --adjust_all()调整後(御前试合)
EVENT_BREAK_EFFECT =1050 --Duel.BreakEffect()被调用时
EVENT_SUMMON_SUCCESS =1100 --通常召唤成功时 EVENT_SUMMON_SUCCESS =1100 --通常召唤成功时
EVENT_FLIP_SUMMON_SUCCESS =1101 --翻转召唤成功时 EVENT_FLIP_SUMMON_SUCCESS =1101 --翻转召唤成功时
EVENT_SPSUMMON_SUCCESS =1102 --特殊召唤成功时 EVENT_SPSUMMON_SUCCESS =1102 --特殊召唤成功时
......
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