Commit 5d92d2ce authored by VanillaSalt's avatar VanillaSalt

fix

parent 53cbd350
......@@ -16,18 +16,12 @@ function c33846209.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c33846209.costfilter(c,e,dg)
function c33846209.desfilter(c,tc)
return c:GetEquipTarget()~=tc
end
function c33846209.costfilter(c)
if c:IsFacedown() or c:GetLevel()~=4 or not c:IsType(TYPE_DUAL) then return false end
local a=0
if dg:IsContains(c) then a=1 end
if c:GetEquipCount()==0 then return dg:GetCount()-a>=1 end
local eg=c:GetEquipGroup()
local tc=eg:GetFirst()
while tc do
if dg:IsContains(tc) then a=a+1 end
tc=eg:GetNext()
end
return dg:GetCount()-a>=1
return Duel.IsExistingTarget(c33846209.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,c)
end
function c33846209.tgfilter(c,e)
return c:IsCanBeEffectTarget(e)
......@@ -35,28 +29,22 @@ end
function c33846209.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc~=e:GetHandler() end
if chk==0 then
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return false end
if not Duel.IsPlayerCanDraw(tp,1) then return false end
if e:GetLabel()==1 then
e:SetLabel(0)
local rg=Duel.GetReleaseGroup(tp)
local dg=Duel.GetMatchingGroup(c33846209.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler(),e)
local res=rg:IsExists(c33846209.costfilter,1,e:GetHandler(),e,dg)
return res
return Duel.CheckReleaseGroup(tp,c33846209.costfilter,1,e:GetHandler())
else
return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler())
return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler())
end
end
if e:GetLabel()==1 then
e:SetLabel(0)
local rg=Duel.GetReleaseGroup(tp)
local dg=Duel.GetMatchingGroup(c33846209.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler(),e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:FilterSelect(tp,c33846209.costfilter,1,1,e:GetHandler(),e,dg)
local sg=Duel.SelectReleaseGroup(tp,c33846209.costfilter,1,1,e:GetHandler())
Duel.Release(sg,REASON_COST)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c33846209.activate(e,tp,eg,ep,ev,re,r,rp)
......
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