Commit 50d0cef8 authored by wind2009's avatar wind2009

Fix 融合募兵

parent 40ba4def
Pipeline #38970 passed with stages
in 2 minutes and 18 seconds
...@@ -15,14 +15,16 @@ end ...@@ -15,14 +15,16 @@ 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)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_EXTRA,0,1,nil,tp) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_EXTRA,0,1,nil,tp)
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
local exg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_EXTRA,0,nil,tp)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
local og=Duel.GetOperatedGroup() local og=Duel.GetOperatedGroup()
e:SetLabelObject(og) e:SetLabelObject(og)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local cg=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_EXTRA,0,1,1,nil,tp) local cg=exg:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,cg) Duel.ConfirmCards(1-tp,cg)
og:Merge(cg) og:Merge(cg)
e:SetLabelObject(og) e:SetLabelObject(og)
og:KeepAlive()
end end
function s.cfilter(c,tp) function s.cfilter(c,tp)
return c:IsType(TYPE_FUSION) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,c) return c:IsType(TYPE_FUSION) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,c)
...@@ -34,12 +36,12 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -34,12 +36,12 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:IsCostChecked() end if chk==0 then return e:IsCostChecked() end
local og=e:GetLabelObject() local og=e:GetLabelObject()
local tc=og:Filter(aux.NOT(Card.IsType),nil,TYPE_FUSION):GetFirst() local tc=og:Filter(aux.NOT(Card.IsType),nil,TYPE_FUSION):GetFirst()
e:SetTargetCard(tc) Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local nc=Duel.GetFirstTarget() local nc=Duel.GetFirstTarget()
local fc=e:GetLabelObject():Filter(aux.TURE,nc):GetFirst() local fc=e:GetLabelObject():Filter(aux.TRUE,nc):GetFirst()
if not nc:IsRelateToChain() then nc=nil end if not nc:IsRelateToChain() then nc=nil end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nc,fc) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nc,fc)
...@@ -67,7 +69,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -67,7 +69,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit) e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2e1,tp) Duel.RegisterEffect(e1,tp)
end end
function s.splimit(e,c) function s.splimit(e,c)
return not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA) return not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA)
......
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