Commit 0a05f9cb authored by Vury Leo's avatar Vury Leo Committed by wind2009

Add ペンデュラム more ドラゴン族 to new fusion

parent 70ababf1
--オッドアイズ・フュージョン
function c48144509.initial_effect(c)
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
local e1=FusionSpell.CreateSummonEffect(c,{
fusfilter=s.fusfilter,
pre_select_mat_location=s.pre_select_mat_location,
fusion_spell_matfilter=s.fusion_spell_matfilter,
additional_fcheck=s.fcheck
})
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,48144509+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c48144509.target)
e1:SetOperation(c48144509.activate)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
end
function c48144509.filter1(c,e)
return c:IsAbleToGrave() and not c:IsImmuneToEffect(e)
function s.fusfilter(c)
return c:IsRace(RACE_DRAGON)
end
function c48144509.exfilter0(c)
return c:IsSetCard(0x99) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function c48144509.exfilter1(c,e)
return c:IsSetCard(0x99) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave() and not c:IsImmuneToEffect(e)
end
function c48144509.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_DRAGON) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c48144509.fcheck(tp,sg,fc)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=2
end
function c48144509.gcheck(sg)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=2
end
function c48144509.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsAbleToGrave,nil)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then
local sg=Duel.GetMatchingGroup(c48144509.exfilter0,tp,LOCATION_EXTRA,0,nil)
if sg:GetCount()>0 then
mg1:Merge(sg)
aux.FCheckAdditional=c48144509.fcheck
aux.GCheckAdditional=c48144509.gcheck
end
end
local res=Duel.IsExistingMatchingCard(c48144509.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c48144509.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c48144509.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c48144509.filter1,nil,e)
local exmat=false
--- @type FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION
function s.pre_select_mat_location(tc,tp)
local location=LOCATION_HAND|LOCATION_MZONE
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then
local sg=Duel.GetMatchingGroup(c48144509.exfilter1,tp,LOCATION_EXTRA,0,nil,e)
if sg:GetCount()>0 then
mg1:Merge(sg)
exmat=true
end
location=location|LOCATION_EXTRA
end
if exmat then
aux.FCheckAdditional=c48144509.fcheck
aux.GCheckAdditional=c48144509.gcheck
end
local sg1=Duel.GetMatchingGroup(c48144509.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c48144509.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
return location
end
function s.fusion_spell_matfilter(c)
--- materials from extra must be オッドアイズ
if c:IsLocation(LOCATION_EXTRA) and not c:IsFusionSetCard(0x99) then
return false
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
mg1:RemoveCard(tc)
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
if exmat then
aux.FCheckAdditional=c48144509.fcheck
aux.GCheckAdditional=c48144509.gcheck
end
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
return true
end
--- @type FUSION_FGCHECK_FUNCTION
function s.fcheck(tp,mg,fc,mg_all)
--- Can have at most 2 from extra deck
if mg:FilterCount(function(c) return c:IsLocation(LOCATION_EXTRA) end,nil)>2 then
return false
end
return true
end
......@@ -32,41 +32,53 @@ function s.initial_effect(c)
e3:SetOperation(s.spop1)
c:RegisterEffect(e3)
--fusion summon
local e4=Effect.CreateEffect(c)
local e4=FusionSpell.CreateSummonEffect(c,{
fusfilter=s.fusfilter,
pre_select_mat_location=LOCATION_MZONE|LOCATION_REMOVED,
mat_operation_code_map={
{ [LOCATION_DECK]=FusionSpell.FUSION_OPERATION_GRAVE },
{ [0xff]=FusionSpell.FUSION_OPERATION_SHUFFLE }
},
extra_target=s.extra_target
})
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_STANDBY)
e4:SetCountLimit(1,id+o)
e4:SetRange(LOCATION_MZONE)
e4:SetTarget(s.fsptg)
e4:SetOperation(s.fspop)
c:RegisterEffect(e4)
end
function s.ffilter(c,fc,sub,mg,sg)
if not c:IsFusionSetCard(0x133) then return false end
if not sg then return true end
return not sg:IsExists(Card.IsLevel,1,c,c:GetLevel())
and sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute())
end
function s.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function s.fusfilter(c)
function s.selffusfilter(c)
return c:IsSetCard(0x133) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function s.fselect(g)
return g:GetClassCount(Card.GetLevel)==2 and aux.SameValueCheck(g,Card.GetFusionAttribute) and g:IsExists(Card.IsLocation,1,nil,LOCATION_ONFIELD) and g:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE)
end
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local fg=Duel.GetMatchingGroup(s.fusfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local fg=Duel.GetMatchingGroup(s.selffusfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
return fg:CheckSubGroup(s.fselect,2,2)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local cp=c:GetControler()
local g=Duel.GetMatchingGroup(s.fusfilter,cp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local g=Duel.GetMatchingGroup(s.selffusfilter,cp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,cp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(cp,s.fselect,true,2,2)
if sg then
......@@ -75,20 +87,24 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
return true
else return false end
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
local sg=e:GetLabelObject()
c:SetMaterial(sg)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x133) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelBelow(4)
end
function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function s.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......@@ -97,84 +113,15 @@ function s.spop1(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.filter0(c,e)
return c:IsLocation(LOCATION_MZONE) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function s.filter1(c,e)
return c:IsFaceupEx() and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_DRAGON) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
function s.fusfilter(c)
return c:IsRace(RACE_DRAGON)
end
function s.fsptg(e,tp,eg,ep,ev,re,r,rp,chk)
function s.extra_target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter0,nil,e)
local mg2=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_REMOVED,0,nil,e)
mg1:Merge(mg2)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
return true
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_MZONE+LOCATION_REMOVED)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function s.fspop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter0,nil,e)
local mg2=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.filter1),tp,LOCATION_MZONE+LOCATION_REMOVED,0,nil,e)
mg1:Merge(mg2)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
::cancel::
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 ce~=nil and not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
if #mat==0 then goto cancel end
tc:SetMaterial(mat)
if mat:IsExists(Card.IsFacedown,1,nil) then
local cg=mat:Filter(Card.IsFacedown,nil)
Duel.ConfirmCards(1-tp,cg)
end
if mat:Filter(s.cfilter,nil):GetCount()>0 then
local cg=mat:Filter(s.cfilter,nil)
Duel.HintSelection(cg)
end
Duel.SendtoDeck(mat,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
elseif ce~=nil then
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
if #mat2==0 then goto cancel end
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function s.cfilter(c)
return c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED)
end
--ペンデュラム・フュージョン
function c65646587.initial_effect(c)
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,65646587+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c65646587.target)
e1:SetOperation(c65646587.activate)
local e1=FusionSpell.CreateSummonEffect(c,{
pre_select_mat_location=s.pre_select_mat_location
})
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
end
function c65646587.filter0(c,e)
return c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
end
function c65646587.filter1(c,e)
return c:IsOnField() and not c:IsImmuneToEffect(e)
end
function c65646587.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c65646587.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
if Duel.GetFieldGroupCount(tp,LOCATION_PZONE,0)>=2 then
mg1:Merge(Duel.GetMatchingGroup(c65646587.filter0,tp,LOCATION_PZONE,0,nil,e))
end
local res=Duel.IsExistingMatchingCard(c65646587.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c65646587.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c65646587.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c65646587.filter1,nil,e)
function s.pre_select_mat_location(tc,tp)
local location=LOCATION_MZONE
if Duel.GetFieldGroupCount(tp,LOCATION_PZONE,0)>=2 then
mg1:Merge(Duel.GetMatchingGroup(c65646587.filter0,tp,LOCATION_PZONE,0,nil,e))
end
local sg1=Duel.GetMatchingGroup(c65646587.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c65646587.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
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
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
location=location|LOCATION_PZONE
end
return location
end
--EMユーゴーレム
function c73511233.initial_effect(c)
local s,id,o=GetID()
function s.initial_effect(c)
aux.EnablePendulumAttribute(c)
--salvage
local e1=Effect.CreateEffect(c)
......@@ -9,128 +10,75 @@ function c73511233.initial_effect(c)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1)
e1:SetCondition(c73511233.thcon)
e1:SetTarget(c73511233.thtg)
e1:SetOperation(c73511233.thop)
e1:SetCondition(s.thcon)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--reg
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c73511233.effcon)
e2:SetOperation(c73511233.regop)
e2:SetCondition(s.effcon)
e2:SetOperation(s.regop)
c:RegisterEffect(e2)
--fusion
local e3=Effect.CreateEffect(c)
local e3=FusionSpell.CreateSummonEffect(c,{
matfilter=s.matfilter,
pre_select_mat_location=LOCATION_MZONE,
gc=s.gc
})
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c73511233.spcon)
e3:SetTarget(c73511233.sptg)
e3:SetOperation(c73511233.spop)
e3:SetCondition(s.spcon)
c:RegisterEffect(e3)
end
function c73511233.thcfilter(c,tp)
function s.thcfilter(c,tp)
return c:IsControler(tp) and c:IsSummonType(SUMMON_TYPE_FUSION)
end
function c73511233.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg and eg:IsExists(c73511233.thcfilter,1,nil,tp)
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg and eg:IsExists(s.thcfilter,1,nil,tp)
end
function c73511233.thfilter(c)
function s.thfilter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(0x98,0x99,0x9f)
and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c73511233.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c73511233.thfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA)
end
function c73511233.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)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c73511233.thfilter),tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c73511233.effcon(e,tp,eg,ep,ev,re,r,rp)
function s.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c73511233.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(73511233,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
function s.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c73511233.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(73511233)~=0
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id)~=0
end
function c73511233.spfilter0(c)
return c:IsRace(RACE_DRAGON) and c:IsOnField()
function s.matfilter(c,e)
return c:IsRace(RACE_DRAGON) or c==e:GetHandler()
end
function c73511233.spfilter1(c,e)
return c73511233.spfilter0(c) and not c:IsImmuneToEffect(e)
end
function c73511233.spfilter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
end
function c73511233.spfilter3(c)
return c:IsCanBeFusionMaterial() and c:IsRace(RACE_DRAGON)
end
function c73511233.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c73511233.spfilter0,nil)
mg1:AddCard(c)
local res=Duel.IsExistingMatchingCard(c73511233.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp):Filter(c73511233.spfilter3,nil)
mg2:AddCard(c)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c73511233.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c73511233.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or c:IsControler(1-tp) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(c73511233.spfilter1,nil,e)
mg1:AddCard(c)
local sg1=Duel.GetMatchingGroup(c73511233.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp):Filter(c73511233.spfilter3,nil)
mg2:AddCard(c)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c73511233.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
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
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,c,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
function s.gc(e)
return e:GetHandler()
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