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
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local eft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
if ft<=0 then return end
if ft>=3 then ft=3 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)
if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,s.gcheck,false,1,ft,tp,eft)
if sg:GetCount()>0 then
local exg=sg:Filter(s.ftfilter,nil)
sg:Sub(exg)
if exg:GetCount()>0 then
for tc in aux.Next(exg) do
Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP)
if ft>0 then
if ft>=3 then ft=3 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter2),tp,LOCATION_GRAVE+LOCATION_EXTRA,0,nil,e,tp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,s.gcheck,false,1,ft,tp,eft)
if sg:GetCount()>0 then
local exg=sg:Filter(s.ftfilter,nil)
sg:Sub(exg)
if exg:GetCount()>0 then
for tc in aux.Next(exg) do
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
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
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -104,7 +106,7 @@ function s.cfilter(c,tp)
and c:IsSetCard(0x1047)
end
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
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -114,7 +116,7 @@ function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
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)
end
end
\ No newline at end of file
end
......@@ -44,6 +44,7 @@ end
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
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,0))
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......@@ -77,6 +78,7 @@ end
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
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,1))
end
function s.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
......@@ -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
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
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_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -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 tc=g:GetFirst()
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)
end
end
\ No newline at end of file
end
......@@ -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)
if g:GetCount()>0 then
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(c)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......@@ -93,4 +93,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
end
\ No newline at end of file
end
......@@ -46,35 +46,23 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mg3=fgroup(ce,e,tp)
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
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)
and Duel.GetFlagEffect(tp,id+o)==0 end
local off=1
local ops={}
local opval={}
if res and Duel.GetFlagEffect(tp,id)==0 then
ops[off]=aux.Stringid(id,0)
opval[off-1]=1
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)
local b1=res and Duel.GetFlagEffect(tp,id)==0
local b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,nil) and Duel.GetFlagEffect(tp,id+o)==0
if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,1)},
{b2,aux.Stringid(id,2)})
e:SetLabel(op)
if op==1 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
elseif opval[op]==2 then
elseif op==2 then
e:SetLabel(2)
e:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
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
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
aux.FCheckAdditional=nil
......@@ -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.BreakEffect()
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 fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
......@@ -144,4 +132,4 @@ function s.damval(e,re,val,r,rp,rc)
if r&REASON_EFFECT==REASON_EFFECT then
return math.ceil(val/2)
else return val end
end
\ No newline at end of file
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