Commit 646883d1 authored by wind2009's avatar wind2009

Fix

parent 90b88403
Pipeline #30446 passed with stages
in 2 minutes and 31 seconds
No preview for this file type
...@@ -64,27 +64,29 @@ end ...@@ -64,27 +64,29 @@ end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local eft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM) local eft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
if ft<=0 then return end if ft>0 then
if ft>=3 then ft=3 end if ft>=3 then ft=3 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(s.spfilter2,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,e,tp) local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter2),tp,LOCATION_GRAVE+LOCATION_EXTRA,0,nil,e,tp)
if g:GetCount()==0 then return end if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,s.gcheck,false,1,ft,tp,eft) local sg=g:SelectSubGroup(tp,s.gcheck,false,1,ft,tp,eft)
if sg:GetCount()>0 then if sg:GetCount()>0 then
local exg=sg:Filter(s.ftfilter,nil) local exg=sg:Filter(s.ftfilter,nil)
sg:Sub(exg) sg:Sub(exg)
if exg:GetCount()>0 then if exg:GetCount()>0 then
for tc in aux.Next(exg) do for tc in aux.Next(exg) do
Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
if sg:GetCount()>0 then
for tc in aux.Next(sg) do
Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
Duel.SpecialSummonComplete()
end end
end end
if sg:GetCount()>0 then
for tc in aux.Next(sg) do
Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
Duel.SpecialSummonComplete()
end end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -104,7 +106,7 @@ function s.cfilter(c,tp) ...@@ -104,7 +106,7 @@ function s.cfilter(c,tp)
and c:IsSetCard(0x1047) and c:IsSetCard(0x1047)
end end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp) function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp) return eg:IsExists(s.cfilter,1,e:GetHandler(),tp)
end end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -114,7 +116,7 @@ function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -114,7 +116,7 @@ function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.spop2(e,tp,eg,ep,ev,re,r,rp) function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
end end
\ No newline at end of file
...@@ -44,6 +44,7 @@ end ...@@ -44,6 +44,7 @@ end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,0))
end end
function s.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
...@@ -77,6 +78,7 @@ end ...@@ -77,6 +78,7 @@ end
function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,1))
end end
function s.sumop(e,tp,eg,ep,ev,re,r,rp) function s.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
...@@ -96,8 +98,8 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -96,8 +98,8 @@ 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
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_HAND,0,1,nil) end and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -105,7 +107,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -105,7 +107,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SendtoGrave(g,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) if tc and Duel.SendtoGrave(g,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE)
and c:IsRelateToChain() then and c:IsRelateToChain() and aux.NecroValleyFilter()(c) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
end end
\ No newline at end of file
...@@ -83,7 +83,7 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,7 +83,7 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,0,nil,e) local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,0,nil,e)
if g:GetCount()>0 then if g:GetCount()>0 then
for tc in aux.Next(g) do for tc in aux.Next(g) do
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
...@@ -93,4 +93,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,4 +93,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end end
\ No newline at end of file
...@@ -46,35 +46,23 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -46,35 +46,23 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
if ce~=nil then if ce~=nil then
local fgroup=ce:GetTarget() local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp) local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue() local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf) res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end end
end end
if chk==0 then return res and Duel.GetFlagEffect(tp,id)==0 or Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,nil) local b1=res and Duel.GetFlagEffect(tp,id)==0
and Duel.GetFlagEffect(tp,id+o)==0 end local b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,nil) and Duel.GetFlagEffect(tp,id+o)==0
local off=1 if chk==0 then return b1 or b2 end
local ops={} local op=aux.SelectFromOptions(tp,
local opval={} {b1,aux.Stringid(id,1)},
if res and Duel.GetFlagEffect(tp,id)==0 then {b2,aux.Stringid(id,2)})
ops[off]=aux.Stringid(id,0) e:SetLabel(op)
opval[off-1]=1 if op==1 then
off=off+1
end
if Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,nil)
and Duel.GetFlagEffect(tp,id+o)==0 then
ops[off]=aux.Stringid(id,1)
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+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES) e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
elseif opval[op]==2 then elseif op==2 then
e:SetLabel(2) e:SetLabel(2)
e:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
Duel.RegisterFlagEffect(tp,id+o,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,id+o,RESET_PHASE+PHASE_END,0,1)
...@@ -103,7 +91,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -103,7 +91,7 @@ function s.activate(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
aux.FCheckAdditional=tc.branded_fusion_check or s.fcheck aux.FCheckAdditional=tc.branded_fusion_check or s.fcheck
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
aux.FCheckAdditional=nil aux.FCheckAdditional=nil
...@@ -111,7 +99,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -111,7 +99,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
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,mg3,nil,chkf) local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation() local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2) fop(ce,e,tp,tc,mat2)
...@@ -144,4 +132,4 @@ function s.damval(e,re,val,r,rp,rc) ...@@ -144,4 +132,4 @@ function s.damval(e,re,val,r,rp,rc)
if r&REASON_EFFECT==REASON_EFFECT then if r&REASON_EFFECT==REASON_EFFECT then
return math.ceil(val/2) return math.ceil(val/2)
else return val end else return val end
end end
\ No newline at end of file
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