Commit 828c8466 authored by wyykak's avatar wyykak

Merge branch 'patch-3' into 'master'

Update c21061.lua 修复跳红

See merge request !23
parents 9882e3e7 69ae68f5
Pipeline #15353 passed with stage
in 58 seconds
......@@ -26,7 +26,7 @@ function c21061.initial_effect(c)
c:RegisterEffect(e2)
end
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)
if g:GetCount()>0 then
local g1=g:GetMinGroup(Card.GetAttack)
......@@ -62,34 +62,32 @@ function c21061.op(e,tp,eg,ep,ev,re,r,rp)
local sel=e:GetLabel()
if sel <1 then return end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local g1=g:GetMinGroup(Card.GetAttack)
local g2=g:GetMaxGroup(Card.GetAttack):Filter(Card.IsCanTurnSet,nil)
if sel==1 and g1:GetCount()>0 then
Duel.Destroy(g1,REASON_EFFECT)
elseif sel==2 and g2:GetCount()>0 then
Duel.ChangePosition(g2,POS_FACEDOWN_DEFENSE)
else
return
end
if g:GetCount()>0 then
local g1=g:GetMinGroup(Card.GetAttack)
local g2=g:GetMaxGroup(Card.GetAttack):Filter(Card.IsCanTurnSet,nil)
if sel==1 and g1:GetCount()>0 then
Duel.Destroy(g1,REASON_EFFECT)
elseif sel==2 and g2:GetCount()>0 then
Duel.ChangePosition(g2,POS_FACEDOWN_DEFENSE)
end
end
end
function c21061.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c21061.desfilter(c)
return c:IsFacedown() and c:IsDestructable()
return c:IsFacedown()
end
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 chk==0 then return true end
if Duel.IsExistingTarget(c21061.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c21061.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
if chk==0 then return Duel.IsExistingTarget(c21061.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c21061.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c21061.desop(e,tp,eg,ep,ev,re,r,rp)
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)
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