Commit 0681b280 authored by GuGu's avatar GuGu

Update c28011.lua

parent 90ff1843
Pipeline #42376 passed with stage
in 1 minute and 16 seconds
......@@ -13,6 +13,7 @@ function c28011.initial_effect(c)
--Activate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(28011,1))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
......@@ -62,16 +63,18 @@ function c28011.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c28011.cfilter(c)
return not c:IsPublic()
local b1=c:IsSetCard(0x208) and Duel.IsExistingMatchingCard(c28011.filter2,tp,0,LOCATION_MZONE,1,nil)
local b2=not c:IsSetCard(0x208) and Duel.IsExistingMatchingCard(c28011.filter1,tp,0,LOCATION_MZONE,1,nil)
return not c:IsPublic() and (b1 or b2)
end
function c28011.jfilter(c)
return c:IsAbleToRemove() or c:IsDestructable()
return c28011.filter1(c) or c28011.filter2(c)
end
function c28011.filter1(c)
return c:IsSetCard(0x208) and c:IsAbleToRemove() and c:IsFaceup()
end
function c28011.filter2(c)
return not c:IsSetCard(0x208) and c:IsDestructable() and c:IsFaceup()
return (not c:IsSetCard(0x208) and c:IsDestructable() and c:IsFaceup()) or c:IsFacedown()
end
function c28011.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28011.cfilter,tp,LOCATION_HAND,0,1,nil)
......@@ -81,14 +84,16 @@ function c28011.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c28011.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
if g:GetFirst():IsSetCard(0x208) then
local sg1=Duel.SelectMatchingCard(tp,c28011.filter2,tp,0,LOCATION_MZONE,1,1,e:GetHandler())
Duel.Destroy(sg1,REASON_EFFECT)
else local sg2=Duel.SelectMatchingCard(tp,c28011.filter1,tp,0,LOCATION_MZONE,1,1,e:GetHandler())
Duel.Remove(sg2,POS_FACEUP,REASON_EFFECT)
if g:GetCount()>0 then
Duel.ConfirmCards(1-tp,g)
if g:GetFirst():IsSetCard(0x208) then
local sg1=Duel.SelectMatchingCard(tp,c28011.filter2,tp,0,LOCATION_MZONE,1,1,e:GetHandler())
Duel.Destroy(sg1,REASON_EFFECT)
else local sg2=Duel.SelectMatchingCard(tp,c28011.filter1,tp,0,LOCATION_MZONE,1,1,e:GetHandler())
Duel.Remove(sg2,POS_FACEUP,REASON_EFFECT)
end
Duel.ShuffleHand(tp)
end
Duel.ShuffleHand(tp)
end
function c28011.filter(c,tp)
return c:IsSetCard(0xc211) and c:GetControler()==tp and c:GetReasonPlayer()==1-tp
......
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