Commit 44be82bf authored by Huangnan's avatar Huangnan

fix

parent 615fff08
Pipeline #40696 failed with stages
in 9 minutes and 44 seconds
--除你粉籍 --璃亚梦护卫队
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetCost(s.cost) e1:SetCost(s.cost)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.prop) e1:SetOperation(s.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
...@@ -24,41 +24,43 @@ function s.initial_effect(c) ...@@ -24,41 +24,43 @@ function s.initial_effect(c)
e2:SetOperation(s.prop2) e2:SetOperation(s.prop2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100) e:SetLabel(100)
if chk==0 then return true end if chk==0 then return true end
end end
function s.costfilter(c,tp) function s.costfilter(c,tp)
return c:IsCode(21000826) return c:IsCode(21000826) and c:IsLocation(LOCATION_MZONE) and c:IsReleasable()
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local dg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
if chk==0 then if chk==0 then
if e:GetLabel()~=100 then return false end if e:GetLabel()~=100 then return false end
e:SetLabel(0) e:SetLabel(0)
return Duel.CheckReleaseGroup(REASON_COST,tp,s.costfilter,1,nil) and dg:GetCount()>0 local g=Duel.GetMatchingGroup(s.costfilter,tp,LOCATION_MZONE,0,nil)
local dg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
return g:GetCount()>0 and dg:GetCount()>0
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=Duel.SelectReleaseGroup(REASON_COST,tp,s.costfilter,1,dg:GetCount(),c,c,tp) local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_MZONE,0,1,99,nil)
local sgcount = Duel.Release(sg,REASON_COST) local count=Duel.Release(g,REASON_COST)
e:SetLabel(sgcount) e:SetLabel(count)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,sgcount,0,0) local dg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,count,0,0)
end end
function s.prop(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local count=e:GetLabel() local count=e:GetLabel()
if count<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,count,count,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,count,count,e:GetHandler())
if g:GetCount()==count then if g:GetCount()==count then
Duel.HintSelection(g) Duel.HintSelection(g)
if Duel.Destroy(g,REASON_EFFECT)>0 and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then if Duel.Destroy(g,REASON_EFFECT)>0 then
if Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
end end
end end
end
end end
function s.cfilter(c) function s.cfilter(c)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSetCard(0x609) return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSetCard(0x609)
end end
......
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