Commit 69ae68f5 authored by GuGu's avatar GuGu

Update c21061.lua 修复跳红

parent 9882e3e7
...@@ -26,7 +26,7 @@ function c21061.initial_effect(c) ...@@ -26,7 +26,7 @@ function c21061.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c21061.tg(e,tp,eg,ep,ev,re,r,rp,chk) function c21061.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
local g1=g:GetMinGroup(Card.GetAttack) local g1=g:GetMinGroup(Card.GetAttack)
...@@ -62,34 +62,32 @@ function c21061.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -62,34 +62,32 @@ function c21061.op(e,tp,eg,ep,ev,re,r,rp)
local sel=e:GetLabel() local sel=e:GetLabel()
if sel <1 then return end if sel <1 then return end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local g1=g:GetMinGroup(Card.GetAttack) if g:GetCount()>0 then
local g2=g:GetMaxGroup(Card.GetAttack):Filter(Card.IsCanTurnSet,nil) local g1=g:GetMinGroup(Card.GetAttack)
if sel==1 and g1:GetCount()>0 then local g2=g:GetMaxGroup(Card.GetAttack):Filter(Card.IsCanTurnSet,nil)
Duel.Destroy(g1,REASON_EFFECT) if sel==1 and g1:GetCount()>0 then
elseif sel==2 and g2:GetCount()>0 then Duel.Destroy(g1,REASON_EFFECT)
Duel.ChangePosition(g2,POS_FACEDOWN_DEFENSE) elseif sel==2 and g2:GetCount()>0 then
else Duel.ChangePosition(g2,POS_FACEDOWN_DEFENSE)
return end
end end
end end
function c21061.drcon(e,tp,eg,ep,ev,re,r,rp) function c21061.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21061.desfilter(c) function c21061.desfilter(c)
return c:IsFacedown() and c:IsDestructable() return c:IsFacedown()
end end
function c21061.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c21061.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c21061.desfilter(chkc) end if chkc then return chkc:IsOnField() and c21061.desfilter(chkc) end
if chk==0 then return true end if chk==0 then return Duel.IsExistingTarget(c21061.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
if Duel.IsExistingTarget(c21061.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,c21061.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local g=Duel.SelectTarget(tp,c21061.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
end end
function c21061.desop(e,tp,eg,ep,ev,re,r,rp) function c21061.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsFacedown() and tc:IsRelateToEffect(e) then if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT)
end end
end end
\ No newline at end of file
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