Commit a7e90695 authored by wind2009's avatar wind2009

Fix

parent c87f4f4a
Pipeline #30325 failed with stages
in 1 minute
No preview for this file type
...@@ -18,17 +18,16 @@ function s.initial_effect(c) ...@@ -18,17 +18,16 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_MAIN_END)
e2:SetCountLimit(1,id+o) e2:SetCountLimit(1,id+o)
e2:SetTarget(s.fsptg) e2:SetTarget(s.fsptg)
e2:SetOperation(s.fsptg) e2:SetOperation(s.fspop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--search --search
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2)) e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_BE_MATERIAL) e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCountLimit(1,id+o*2) e3:SetCountLimit(1,id+o*2)
e3:SetCondition(s.thcon) e3:SetCondition(s.thcon)
...@@ -41,7 +40,7 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -41,7 +40,7 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end if chk==0 then return not e:GetHandler():IsPublic() end
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsSetCard(0x1b1,0x1b7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x1b1,0x1bc) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
...@@ -61,7 +60,7 @@ function s.filter1(c,e) ...@@ -61,7 +60,7 @@ function s.filter1(c,e)
return not c:IsImmuneToEffect(e) return not c:IsImmuneToEffect(e)
end end
function s.filter2(c,e,tp,m,f,chkf) function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x1b7) and (not f or f(c)) return c:IsType(TYPE_FUSION) and c:IsSetCard(0x1bc) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function s.fsptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.fsptg(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -101,13 +100,13 @@ function s.fspop(e,tp,eg,ep,ev,re,r,rp) ...@@ -101,13 +100,13 @@ function s.fspop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil) local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or ce and not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1) tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else elseif ce~=nil then
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf) local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation() local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2) fop(ce,e,tp,tc,mat2)
......
...@@ -4,10 +4,9 @@ function s.initial_effect(c) ...@@ -4,10 +4,9 @@ function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(s.fscon) e1:SetCondition(s.fscon)
e1:SetTarget(s.fstg) e1:SetTarget(s.fstg)
e1:SetOperation(s.fsop) e1:SetOperation(s.fsop)
...@@ -36,7 +35,7 @@ function s.filter(c,e,tp,m,f,chkf) ...@@ -36,7 +35,7 @@ function s.filter(c,e,tp,m,f,chkf)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk) function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk)
res1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local res1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp) local mg1=Duel.GetFusionMaterial(tp)
...@@ -51,27 +50,14 @@ function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -51,27 +50,14 @@ function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
end end
if chk==0 then return res1 or res2 end if chk==0 then return res1 or res2 end
local off=1 local op=aux.SelectFromOptions(tp,
local ops={} {res1,aux.Stringid(id,2),1},
local opval={} {res2,aux.Stringid(id,3),2})
if res1 then e:SetLabel(op)
ops[off]=aux.Stringid(id,2) if op==1 then
opval[off-1]=1
off=off+1
end
if res2 then
ops[off]=aux.Stringid(id,3)
opval[off-1]=2
off=off+1
end
if off==1 then return end
local op=Duel.SelectOption(tp,table.unpack(ops))
if opval[op]==1 then
e:SetLabel(1)
e:SetCategory(CATEGORY_SPECIAL_SUMMON) e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
elseif opval[op]==2 then elseif op==2 then
e:SetLabel(2)
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
...@@ -103,15 +89,14 @@ function s.fsop(e,tp,eg,ep,ev,re,r,rp) ...@@ -103,15 +89,14 @@ function s.fsop(e,tp,eg,ep,ev,re,r,rp)
::cancel:: ::cancel::
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=sg:Select(tp,1,1,nil):GetFirst() local tc=sg:Select(tp,1,1,nil):GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not (sg2:IsContains(tc) if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or ce and not Duel.SelectYesNo(tp,ce:GetDescription())) then
and Duel.SelectYesNo(tp,ce:GetDescription()))) then
local mat=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) local mat=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
if #mat==0 then goto cancel end if #mat==0 then goto cancel end
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.SendtoGrave(mat,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.SendtoGrave(mat,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else elseif ce~=nil then
local mat=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf) local mat=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
if #mat==0 then goto cancel end if #mat==0 then goto cancel end
local fop=ce:GetOperation() local fop=ce:GetOperation()
......
...@@ -27,7 +27,7 @@ function s.initial_effect(c) ...@@ -27,7 +27,7 @@ function s.initial_effect(c)
end end
function s.cfilter(c,re,tp) function s.cfilter(c,re,tp)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP)
and c:IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_MONSTER) and c:IsReason(REASON_COST) and re:IsActivated()
and (not c:IsPreviousLocation(LOCATION_ONFIELD) or bit.band(c:GetPreviousTypeOnField(),TYPE_SPELL+TYPE_TRAP)~=0) and (not c:IsPreviousLocation(LOCATION_ONFIELD) or bit.band(c:GetPreviousTypeOnField(),TYPE_SPELL+TYPE_TRAP)~=0)
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -4,7 +4,6 @@ function s.initial_effect(c) ...@@ -4,7 +4,6 @@ function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_TO_GRAVE) e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
...@@ -33,17 +32,19 @@ end ...@@ -33,17 +32,19 @@ end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,re,tp) return eg:IsExists(s.cfilter,1,nil,re,tp)
end end
function s.setfilter(c) function s.setfilter(c,tp,ex)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
and (c:IsType(TYPE_FIELD)
or ex and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
or Duel.GetLocationCount(tp,LOCATION_SZONE)>1)
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (e:GetHandler():IsLocation(LOCATION_SZONE) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 or Duel.GetLocationCount(tp,LOCATION_SZONE)>1) local c=e:GetHandler()
and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,c,tp,c:IsLocation(LOCATION_SZONE)) end
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.setfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.setfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,tp,true)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then if tc and Duel.SSet(tp,tc)~=0 then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
......
...@@ -20,6 +20,7 @@ function s.initial_effect(c) ...@@ -20,6 +20,7 @@ function s.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,id) e2:SetCountLimit(1,id)
e2:SetCondition(s.setcon) e2:SetCondition(s.setcon)
e2:SetTarget(s.settg) e2:SetTarget(s.settg)
...@@ -35,7 +36,7 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -35,7 +36,7 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp)
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,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end
if chk==0 then return true end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,3,nil) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
......
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