Commit 7e89155a authored by Chrono-Genex's avatar Chrono-Genex Committed by GitHub

fix (#2029)

parent 53f74a8c
...@@ -19,19 +19,20 @@ end ...@@ -19,19 +19,20 @@ end
function c43011492.condition(e,tp,eg,ep,ev,re,r,rp) function c43011492.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c43011492.filter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c43011492.filter,tp,LOCATION_MZONE,0,1,nil)
end end
function c43011492.desfilter(c) function c43011492.desfilter(c,res)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP) and (not res or c:IsAbleToRemove())
end
function c43011492.filter1(c)
return c:IsCode(44133040) and c:IsFaceup()
end end
function c43011492.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c43011492.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c43011492.desfilter(chkc) and chkc:IsControler(1-tp) end local res=Duel.IsExistingMatchingCard(c43011492.filter1,tp,LOCATION_SZONE,0,1,nil)
if chk==0 then return Duel.IsExistingTarget(c43011492.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end if chkc then return chkc:IsOnField() and c43011492.desfilter(chkc,res) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(c43011492.desfilter,tp,0,LOCATION_ONFIELD,1,nil,res) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c43011492.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,c43011492.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil,res)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function c43011492.filter1(c)
return c:IsCode(44133040) and c:IsFaceup()
end
function c43011492.activate(e,tp,eg,ep,ev,re,r,rp) function c43011492.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
......
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