Commit 68b470a7 authored by fallenstardust's avatar fallenstardust

fix LEDE-JP044 script

parent b7f77fbe
Pipeline #24867 passed with stages
in 1 minute
...@@ -19,6 +19,7 @@ function s.initial_effect(c) ...@@ -19,6 +19,7 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_POSITION) e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetTarget(s.postg) e2:SetTarget(s.postg)
...@@ -45,14 +46,15 @@ function s.filter(c,e) ...@@ -45,14 +46,15 @@ function s.filter(c,e)
return c:IsCanChangePosition() and (not e or c:IsRelateToEffect(e)) return c:IsCanChangePosition() and (not e or c:IsRelateToEffect(e))
end end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk) function s.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(s.filter,1,e:GetHandler(),nil) and Duel.CheckRemoveOverlayCard(tp,1,1,1,REASON_EFFECT) end if chk==0 then return eg:IsExists(s.filter,1,nil,e) and not eg:IsContains(e:GetHandler()) and Duel.CheckRemoveOverlayCard(tp,1,1,1,REASON_EFFECT) end
Duel.SetTargetCard(eg) local tc=eg:FilterSelect(tp,s.filter,1,1,nil,e)
Duel.SetOperationInfo(0,CATEGORY_POSITION,eg,eg:GetCount(),0,0) Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end end
function s.posop(e,tp,eg,ep,ev,re,r,rp) function s.posop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(s.filter,e:GetHandler(),e) local tc=Duel.GetFirstTarget()
if Duel.RemoveOverlayCard(tp,1,1,1,1,REASON_EFFECT)~=0 then if tc:IsRelateToEffect(e) and Duel.RemoveOverlayCard(tp,1,1,1,1,REASON_EFFECT)~=0 then
Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK) Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end end
end end
function s.negcon(e,tp,eg,ep,ev,re,r,rp) function s.negcon(e,tp,eg,ep,ev,re,r,rp)
......
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