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