Commit e703bf12 authored by GuGu's avatar GuGu

Update c10099.lua

parent 924bd242
Pipeline #33204 passed with stage
in 17 seconds
......@@ -5,8 +5,9 @@ function c10099.initial_effect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCondition(c10099.con1)
e1:SetTarget(c10099.tg1)
e1:SetOperation(c10099.op1)
c:RegisterEffect(e1)
--
......@@ -23,72 +24,32 @@ function c10099.initial_effect(c)
end
--
function c10099.cfilter1(c,tp)
return (c:IsFaceup() and c:IsSetCard(0x100) and c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(c10099.cfilter1_1,tp,LOCATION_MZONE,0,1,c))
or (c:IsFaceup() and c:IsSetCard(0x200) and c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(c10099.cfilter1_2,tp,LOCATION_MZONE,0,1,c))
return c:IsFaceup() and c:IsSetCard(0x100,0x200) and c:IsAbleToRemoveAsCost()
end
function c10099.cfilter1_1(c)
return c:IsFaceup() and c:IsSetCard(0x200) and c:IsAbleToRemoveAsCost()
end
function c10099.cfilter1_2(c)
return c:IsFaceup() and c:IsSetCard(0x100) and c:IsAbleToRemoveAsCost()
end
function c10099.cfilter1_3(c)
return c:IsFaceup() and (c:IsSetCard(0x100) or c:IsSetCard(0x200)) and c:IsAbleToRemoveAsCost()
end
function c10099.mzfilter(c)
return c:GetSequence()<5
function c10099.cfilter2(sg,tp)
return Duel.GetMZoneCount(tp,sg,tp)>0 and sg:CheckSubGroup(aux.gfcheck,2,2,Card.IsSetCard,0x100,0x200)
end
function c10099.con1(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local mg=Duel.GetMatchingGroup(c10099.cfilter1,tp,LOCATION_MZONE,0,nil,tp)
return ft>-2 and mg:GetCount()>0 and (ft>0 or mg:IsExists(c10099.mzfilter,1,nil))
return mg:CheckSubGroup(c10099.cfilter2,2,2,tp)
end
function c10099.tg1(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c10099.cfilter1,tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,c10099.cfilter2,true,2,2,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
--
function c10099.op1(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c10099.cfilter1,tp,LOCATION_MZONE,0,nil,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=nil
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
g=mg:Select(tp,1,1,nil)
local tc=g:GetFirst()
if tc:IsSetCard(0x100) and not tc:IsSetCard(0x200) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,c10099.cfilter1_1,tp,LOCATION_MZONE,0,1,1,nil)
g:Merge(sg)
end
if tc:IsSetCard(0x200) and not tc:IsSetCard(0x100) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,c10099.cfilter1_2,tp,LOCATION_MZONE,0,1,1,nil)
g:Merge(sg)
end
if tc:IsSetCard(0x200) and tc:IsSetCard(0x100) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,c10099.cfilter1_3,tp,LOCATION_MZONE,0,1,1,nil)
g:Merge(sg)
end
elseif ft==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
g=mg:FilterSelect(tp,c10099.mzfilter,1,1,nil)
if tc:IsSetCard(0x100) and not tc:IsSetCard(0x200) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,c10099.cfilter1_1,tp,LOCATION_MZONE,0,1,1,nil)
g:Merge(sg)
end
if tc:IsSetCard(0x200) and not tc:IsSetCard(0x100) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,c10099.cfilter1_2,tp,LOCATION_MZONE,0,1,1,nil)
g:Merge(sg)
end
if tc:IsSetCard(0x200) and tc:IsSetCard(0x100) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,c10099.cfilter1_3,tp,LOCATION_MZONE,0,1,1,nil)
g:Merge(sg)
end
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
local g=e:GetLabelObject()
Duel.Remove(g,POS_FACEUP,REASON_SPSUMMON)
g:DeleteGroup()
local e1_4=Effect.CreateEffect(c)
e1_4:SetType(EFFECT_TYPE_SINGLE)
e1_4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
......@@ -116,10 +77,10 @@ function c10099.val1_5(e,c)
end
--
function c10099.tfilter2(c)
return c:IsAbleToHand() and not c:IsCode(10099)
return c:IsAbleToHand() and c:IsSetCard(0x100,0x200) and c:IsType(TYPE_MONSTER) and not c:IsCode(10099)
end
function c10099.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_MZONE) and chkc:IsControler(e:GetHandlerPlayer()) and c10099.tfilter2(chkc) end
if chk==0 then return Duel.IsExistingTarget(c10099.tfilter2,tp,LOCATION_GRAVE+LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c10099.tfilter2,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,1,1,nil)
......
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