Commit bae07c87 authored by mercury233's avatar mercury233 Committed by GitHub

remove empty wrap (#2567)

parent 156c66a8
...@@ -6,8 +6,8 @@ function c50907446.initial_effect(c) ...@@ -6,8 +6,8 @@ function c50907446.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_FUSION_MATERIAL) e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetCondition(c50907446.FShaddollCondition()) e1:SetCondition(c50907446.FShaddollCondition)
e1:SetOperation(c50907446.FShaddollOperation()) e1:SetOperation(c50907446.FShaddollOperation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--cannot spsummon --cannot spsummon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -131,55 +131,51 @@ function c50907446.FShaddollSpFilter2(c,fc,tp,mc,chkf) ...@@ -131,55 +131,51 @@ function c50907446.FShaddollSpFilter2(c,fc,tp,mc,chkf)
or (c50907446.FShaddollFilter1(mc,sg) and c50907446.FShaddollFilter2(c))) or (c50907446.FShaddollFilter1(mc,sg) and c50907446.FShaddollFilter2(c)))
and (chkf==PLAYER_NONE or Duel.GetLocationCountFromEx(tp,tp,sg,fc)>0) and (chkf==PLAYER_NONE or Duel.GetLocationCountFromEx(tp,tp,sg,fc)>0)
end end
function c50907446.FShaddollCondition() function c50907446.FShaddollCondition(e,g,gc,chkf)
return function(e,g,gc,chkf) if g==nil then return aux.MustMaterialCheck(nil,e:GetHandlerPlayer(),EFFECT_MUST_BE_FMATERIAL) end
if g==nil then return aux.MustMaterialCheck(nil,e:GetHandlerPlayer(),EFFECT_MUST_BE_FMATERIAL) end local c=e:GetHandler()
local c=e:GetHandler() local mg=g:Filter(c50907446.FShaddollFilter,nil,c)
local mg=g:Filter(c50907446.FShaddollFilter,nil,c) local tp=e:GetHandlerPlayer()
local tp=e:GetHandlerPlayer() local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0) local exg=nil
local exg=nil if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then
if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then local fe=fc:IsHasEffect(81788994)
local fe=fc:IsHasEffect(81788994) exg=Duel.GetMatchingGroup(c50907446.FShaddollExFilter,tp,0,LOCATION_MZONE,mg,c,fe)
exg=Duel.GetMatchingGroup(c50907446.FShaddollExFilter,tp,0,LOCATION_MZONE,mg,c,fe) end
end if gc then
if gc then if not mg:IsContains(gc) then return false end
if not mg:IsContains(gc) then return false end return c50907446.FShaddollSpFilter1(gc,c,tp,mg,exg,chkf)
return c50907446.FShaddollSpFilter1(gc,c,tp,mg,exg,chkf) end
end return mg:IsExists(c50907446.FShaddollSpFilter1,1,nil,c,tp,mg,exg,chkf)
return mg:IsExists(c50907446.FShaddollSpFilter1,1,nil,c,tp,mg,exg,chkf)
end
end end
function c50907446.FShaddollOperation() function c50907446.FShaddollOperation(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf) local c=e:GetHandler()
local c=e:GetHandler() local mg=eg:Filter(c50907446.FShaddollFilter,nil,c)
local mg=eg:Filter(c50907446.FShaddollFilter,nil,c) local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0) local exg=nil
local exg=nil if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then
if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then local fe=fc:IsHasEffect(81788994)
local fe=fc:IsHasEffect(81788994) exg=Duel.GetMatchingGroup(c50907446.FShaddollExFilter,tp,0,LOCATION_MZONE,mg,c,fe)
exg=Duel.GetMatchingGroup(c50907446.FShaddollExFilter,tp,0,LOCATION_MZONE,mg,c,fe) end
end local g=nil
local g=nil if gc then
if gc then g=Group.FromCards(gc)
g=Group.FromCards(gc) mg:RemoveCard(gc)
mg:RemoveCard(gc) else
else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) g=mg:FilterSelect(tp,c50907446.FShaddollSpFilter1,1,1,nil,c,tp,mg,exg,chkf)
g=mg:FilterSelect(tp,c50907446.FShaddollSpFilter1,1,1,nil,c,tp,mg,exg,chkf) mg:Sub(g)
mg:Sub(g) end
end if exg and exg:IsExists(c50907446.FShaddollSpFilter2,1,nil,c,tp,g:GetFirst(),chkf)
if exg and exg:IsExists(c50907446.FShaddollSpFilter2,1,nil,c,tp,g:GetFirst(),chkf) and (mg:GetCount()==0 or (exg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0)))) then
and (mg:GetCount()==0 or (exg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0)))) then fc:RemoveCounter(tp,0x16,3,REASON_EFFECT)
fc:RemoveCounter(tp,0x16,3,REASON_EFFECT) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) local sg=exg:FilterSelect(tp,c50907446.FShaddollSpFilter2,1,1,nil,c,tp,g:GetFirst(),chkf)
local sg=exg:FilterSelect(tp,c50907446.FShaddollSpFilter2,1,1,nil,c,tp,g:GetFirst(),chkf) g:Merge(sg)
g:Merge(sg) else
else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) local sg=mg:FilterSelect(tp,c50907446.FShaddollSpFilter2,1,1,nil,c,tp,g:GetFirst(),chkf)
local sg=mg:FilterSelect(tp,c50907446.FShaddollSpFilter2,1,1,nil,c,tp,g:GetFirst(),chkf) g:Merge(sg)
g:Merge(sg) end
end Duel.SetFusionMaterial(g)
Duel.SetFusionMaterial(g)
end
end end
...@@ -1944,8 +1944,8 @@ function Auxiliary.EnablePendulumAttribute(c,reg) ...@@ -1944,8 +1944,8 @@ function Auxiliary.EnablePendulumAttribute(c,reg)
e1:SetCode(EFFECT_SPSUMMON_PROC_G) e1:SetCode(EFFECT_SPSUMMON_PROC_G)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetCondition(Auxiliary.PendCondition()) e1:SetCondition(Auxiliary.PendCondition)
e1:SetOperation(Auxiliary.PendOperation()) e1:SetOperation(Auxiliary.PendOperation)
e1:SetValue(SUMMON_TYPE_PENDULUM) e1:SetValue(SUMMON_TYPE_PENDULUM)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--register by default --register by default
...@@ -1985,29 +1985,27 @@ function Auxiliary.PConditionFilter(c,e,tp,lscale,rscale,eset) ...@@ -1985,29 +1985,27 @@ function Auxiliary.PConditionFilter(c,e,tp,lscale,rscale,eset)
and not c:IsForbidden() and not c:IsForbidden()
and (Auxiliary.PendulumChecklist&(0x1<<tp)==0 or Auxiliary.PConditionExtraFilter(c,e,tp,lscale,rscale,eset)) and (Auxiliary.PendulumChecklist&(0x1<<tp)==0 or Auxiliary.PConditionExtraFilter(c,e,tp,lscale,rscale,eset))
end end
function Auxiliary.PendCondition() function Auxiliary.PendCondition(e,c,og)
return function(e,c,og) if c==nil then return true end
if c==nil then return true end local tp=c:GetControler()
local tp=c:GetControler() local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)} if Auxiliary.PendulumChecklist&(0x1<<tp)~=0 and #eset==0 then return false end
if Auxiliary.PendulumChecklist&(0x1<<tp)~=0 and #eset==0 then return false end local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1) if rpz==nil or c==rpz then return false end
if rpz==nil or c==rpz then return false end local lscale=c:GetLeftScale()
local lscale=c:GetLeftScale() local rscale=rpz:GetRightScale()
local rscale=rpz:GetRightScale() if lscale>rscale then lscale,rscale=rscale,lscale end
if lscale>rscale then lscale,rscale=rscale,lscale end local loc=0
local loc=0 if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end if Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)>0 then loc=loc+LOCATION_EXTRA end
if Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)>0 then loc=loc+LOCATION_EXTRA end if loc==0 then return false end
if loc==0 then return false end local g=nil
local g=nil if og then
if og then g=og:Filter(Card.IsLocation,nil,loc)
g=og:Filter(Card.IsLocation,nil,loc) else
else g=Duel.GetFieldGroup(tp,loc,0)
g=Duel.GetFieldGroup(tp,loc,0) end
end return g:IsExists(Auxiliary.PConditionFilter,1,nil,e,tp,lscale,rscale,eset)
return g:IsExists(Auxiliary.PConditionFilter,1,nil,e,tp,lscale,rscale,eset)
end
end end
function Auxiliary.PendOperationCheck(ft1,ft2,ft) function Auxiliary.PendOperationCheck(ft1,ft2,ft)
return function(g) return function(g)
...@@ -2016,70 +2014,68 @@ function Auxiliary.PendOperationCheck(ft1,ft2,ft) ...@@ -2016,70 +2014,68 @@ function Auxiliary.PendOperationCheck(ft1,ft2,ft)
return #g<=ft and #exg<=ft2 and #mg<=ft1 return #g<=ft and #exg<=ft2 and #mg<=ft1
end end
end end
function Auxiliary.PendOperation() function Auxiliary.PendOperation(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
return function(e,tp,eg,ep,ev,re,r,rp,c,sg,og) local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1) local lscale=c:GetLeftScale()
local lscale=c:GetLeftScale() local rscale=rpz:GetRightScale()
local rscale=rpz:GetRightScale() if lscale>rscale then lscale,rscale=rscale,lscale end
if lscale>rscale then lscale,rscale=rscale,lscale end local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)} local tg=nil
local tg=nil local loc=0
local loc=0 local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft2=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
local ft2=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM) local ft=Duel.GetUsableMZoneCount(tp)
local ft=Duel.GetUsableMZoneCount(tp) local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp] if ect and ect<ft2 then ft2=ect end
if ect and ect<ft2 then ft2=ect end if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if Duel.IsPlayerAffectedByEffect(tp,59822133) then if ft1>0 then ft1=1 end
if ft1>0 then ft1=1 end if ft2>0 then ft2=1 end
if ft2>0 then ft2=1 end ft=1
ft=1 end
end if ft1>0 then loc=loc|LOCATION_HAND end
if ft1>0 then loc=loc|LOCATION_HAND end if ft2>0 then loc=loc|LOCATION_EXTRA end
if ft2>0 then loc=loc|LOCATION_EXTRA end if og then
if og then tg=og:Filter(Card.IsLocation,nil,loc):Filter(Auxiliary.PConditionFilter,nil,e,tp,lscale,rscale,eset)
tg=og:Filter(Card.IsLocation,nil,loc):Filter(Auxiliary.PConditionFilter,nil,e,tp,lscale,rscale,eset) else
else tg=Duel.GetMatchingGroup(Auxiliary.PConditionFilter,tp,loc,0,nil,e,tp,lscale,rscale,eset)
tg=Duel.GetMatchingGroup(Auxiliary.PConditionFilter,tp,loc,0,nil,e,tp,lscale,rscale,eset) end
end local ce=nil
local ce=nil local b1=Auxiliary.PendulumChecklist&(0x1<<tp)==0
local b1=Auxiliary.PendulumChecklist&(0x1<<tp)==0 local b2=#eset>0
local b2=#eset>0 if b1 and b2 then
if b1 and b2 then local options={1163}
local options={1163} for _,te in ipairs(eset) do
for _,te in ipairs(eset) do table.insert(options,te:GetDescription())
table.insert(options,te:GetDescription()) end
end local op=Duel.SelectOption(tp,table.unpack(options))
local op=Duel.SelectOption(tp,table.unpack(options)) if op>0 then
if op>0 then ce=eset[op]
ce=eset[op] end
end elseif b2 and not b1 then
elseif b2 and not b1 then local options={}
local options={} for _,te in ipairs(eset) do
for _,te in ipairs(eset) do table.insert(options,te:GetDescription())
table.insert(options,te:GetDescription()) end
end local op=Duel.SelectOption(tp,table.unpack(options))
local op=Duel.SelectOption(tp,table.unpack(options)) ce=eset[op+1]
ce=eset[op+1] end
end if ce then
if ce then tg=tg:Filter(Auxiliary.PConditionExtraFilterSpecific,nil,e,tp,lscale,rscale,ce)
tg=tg:Filter(Auxiliary.PConditionExtraFilterSpecific,nil,e,tp,lscale,rscale,ce) end
end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Auxiliary.GCheckAdditional=Auxiliary.PendOperationCheck(ft1,ft2,ft)
Auxiliary.GCheckAdditional=Auxiliary.PendOperationCheck(ft1,ft2,ft) local g=tg:SelectSubGroup(tp,Auxiliary.TRUE,true,1,math.min(#tg,ft))
local g=tg:SelectSubGroup(tp,Auxiliary.TRUE,true,1,math.min(#tg,ft)) Auxiliary.GCheckAdditional=nil
Auxiliary.GCheckAdditional=nil if not g then return end
if not g then return end if ce then
if ce then Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode())
Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode()) ce:UseCountLimit(tp)
ce:UseCountLimit(tp) else
else Auxiliary.PendulumChecklist=Auxiliary.PendulumChecklist|(0x1<<tp)
Auxiliary.PendulumChecklist=Auxiliary.PendulumChecklist|(0x1<<tp) end
end sg:Merge(g)
sg:Merge(g) Duel.HintSelection(Group.FromCards(c))
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(rpz))
Duel.HintSelection(Group.FromCards(rpz))
end
end end
--enable revive limit for monsters that are also pendulum sumonable from certain locations (Odd-Eyes Revolution Dragon) --enable revive limit for monsters that are also pendulum sumonable from certain locations (Odd-Eyes Revolution Dragon)
function Auxiliary.EnableReviveLimitPendulumSummonable(c, loc) function Auxiliary.EnableReviveLimitPendulumSummonable(c, loc)
......
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