Commit ae0a925d authored by wind2009's avatar wind2009

Merge branch 'new-fusion-HERO' into 'master'

Add HERO to new fusion + use sumtype instead of SUMMON_TYPE_FUSION

See merge request !16
parents b70d2fcc 1b7523b5
--ダーク・コーリング --ダーク・コーリング
function c12071500.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,94820406) aux.AddCodeList(c,94820406)
--Activate --Activate
local e1=Effect.CreateEffect(c) FusionSpell.RegisterSummonEffect(c,{
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) fusfilter=s.fusfilter,
e1:SetType(EFFECT_TYPE_ACTIVATE) pre_select_mat_location=LOCATION_HAND|LOCATION_GRAVE,
e1:SetCode(EVENT_FREE_CHAIN) mat_operation_code_map={
e1:SetTarget(c12071500.target) { [LOCATION_REMOVED]=FusionSpell.FUSION_OPERATION_GRAVE },
e1:SetOperation(c12071500.activate) { [0xff]=FusionSpell.FUSION_OPERATION_BANISH }
c:RegisterEffect(e1) },
extra_target=s.extra_target,
sumtype=SUMMON_VALUE_DARK_FUSION
})
end end
function c12071500.filter0(c)
return c:IsLocation(LOCATION_HAND) and c:IsAbleToRemove() function s.fusfilter(c)
return c.dark_calling==true
end end
function c12071500.filter1(c,e)
return c:IsLocation(LOCATION_HAND) and c:IsAbleToRemove() and not c:IsImmuneToEffect(e) function s.extra_target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c12071500.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c.dark_calling and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_DARK_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c12071500.filter3(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function c12071500.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local chkf=tp return true
local mg1=Duel.GetFusionMaterial(tp):Filter(c12071500.filter0,nil)
local mg2=Duel.GetMatchingGroup(c12071500.filter3,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local res=Duel.IsExistingMatchingCard(c12071500.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(c12071500.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,2,tp,LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,2,tp,LOCATION_HAND+LOCATION_GRAVE)
end end
function c12071500.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c12071500.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c12071500.filter3,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local sg1=Duel.GetMatchingGroup(c12071500.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(c12071500.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
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.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_VALUE_DARK_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2,SUMMON_VALUE_DARK_FUSION)
end
tc:CompleteProcedure()
end
end
--D-フュージョン --D-フュージョン
function c26841274.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) FusionSpell.RegisterSummonEffect(c,{
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) matfilter=s.matfilter,
e1:SetType(EFFECT_TYPE_ACTIVATE) pre_select_mat_location=LOCATION_MZONE,
e1:SetCode(EVENT_FREE_CHAIN) stage_x_operation=s.stage_x_operation
e1:SetTarget(c26841274.target) })
e1:SetOperation(c26841274.activate)
c:RegisterEffect(e1)
end end
function c26841274.filter1(c,e)
return c:IsOnField() and c:IsSetCard(0xc008) and (not e or not c:IsImmuneToEffect(e)) function s.matfilter(c)
return c:IsSetCard(0xc008)
end end
function c26841274.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c)) --- @type FUSION_SPELL_STAGE_X_CALLBACK_FUNCTION
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) function s.stage_x_operation(e,tc,tp,stage)
end if stage==FusionSpell.STAGE_BEFORE_SUMMON_COMPLETE then
function c26841274.filter3(c)
return c:IsCanBeFusionMaterial() and c:IsSetCard(0xc008)
end
function c26841274.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c26841274.filter1,nil)
local res=Duel.IsExistingMatchingCard(c26841274.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):Filter(c26841274.filter3,nil)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c26841274.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 c26841274.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c26841274.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c26841274.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):Filter(c26841274.filter3,nil)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c26841274.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
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
...@@ -76,6 +25,5 @@ function c26841274.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -76,6 +25,5 @@ function c26841274.activate(e,tp,eg,ep,ev,re,r,rp)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
tc:CompleteProcedure()
end end
end end
--ミラクル・フュージョン --ミラクル・フュージョン
function c45906428.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) FusionSpell.RegisterSummonEffect(c,{
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) fusfilter=s.fusfilter,
e1:SetType(EFFECT_TYPE_ACTIVATE) pre_select_mat_location=LOCATION_MZONE|LOCATION_GRAVE,
e1:SetCode(EVENT_FREE_CHAIN) mat_operation_code_map={
e1:SetTarget(c45906428.target) { [LOCATION_REMOVED]=FusionSpell.FUSION_OPERATION_GRAVE },
e1:SetOperation(c45906428.activate) { [0xff]=FusionSpell.FUSION_OPERATION_BANISH }
c:RegisterEffect(e1) },
extra_target=s.extra_target
})
end end
function c45906428.filter0(c) function s.fusfilter(c)
return c:IsOnField() and c:IsAbleToRemove() return c:IsSetCard(0x3008)
end end
function c45906428.filter1(c,e)
return c:IsOnField() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e) function s.extra_target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c45906428.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x3008) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c45906428.filter3(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function c45906428.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local chkf=tp return true
local mg1=Duel.GetFusionMaterial(tp):Filter(c45906428.filter0,nil)
local mg2=Duel.GetMatchingGroup(c45906428.filter3,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local res=Duel.IsExistingMatchingCard(c45906428.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(c45906428.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE)
end end
function c45906428.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c45906428.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c45906428.filter3,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local sg1=Duel.GetMatchingGroup(c45906428.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(c45906428.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
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.Remove(mat1,POS_FACEUP,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,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
--フュージョン・デステニー --フュージョン・デステニー
function c52947044.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--activate --activate
local e1=Effect.CreateEffect(c) local e1=FusionSpell.CreateSummonEffect(c,{
fusfilter=s.fusfilter,
pre_select_mat_location=LOCATION_HAND|LOCATION_DECK,
stage_x_operation=s.stage_x_operation,
additional_fcheck=s.fcheck
})
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,52947044+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c52947044.target)
e1:SetOperation(c52947044.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c52947044.filter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave() function s.fusfilter(c)
return aux.IsMaterialListSetCard(c,0xc008)==true
end end
function c52947044.filter1(c,e)
return not c:IsImmuneToEffect(e) and c:IsLocation(LOCATION_HAND) --- @type FUSION_FGCHECK_FUNCTION
end function s.fcheck(tp,mg,fc,mg_all)
function c52947044.filter2(c,e,tp,m,f,chkf) --- Must include 1 Destiny HERO monster as material
return c:IsType(TYPE_FUSION) and aux.IsMaterialListSetCard(c,0xc008) and (not f or f(c)) if not mg_all:IsExists(function(c) return c:IsFusionSetCard(0xc008) end,1,nil) then
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) return false
end
function c52947044.fcheck(tp,sg,fc)
return sg:IsExists(Card.IsFusionSetCard,1,nil,0xc008)
end
function c52947044.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsLocation,nil,LOCATION_HAND)
local mg2=Duel.GetMatchingGroup(c52947044.filter0,tp,LOCATION_DECK,0,nil)
mg1:Merge(mg2)
aux.FCheckAdditional=c52947044.fcheck
local res=Duel.IsExistingMatchingCard(c52947044.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(c52947044.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
aux.FCheckAdditional=nil
return res
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) return true
end end
function c52947044.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() --- @type FUSION_SPELL_STAGE_X_CALLBACK_FUNCTION
local chkf=tp function s.stage_x_operation(e,tc,tp,stage)
local mg1=Duel.GetFusionMaterial(tp):Filter(c52947044.filter1,nil,e) if stage==FusionSpell.STAGE_BEFORE_SUMMON_COMPLETE then
local mg2=Duel.GetMatchingGroup(c52947044.filter0,tp,LOCATION_DECK,0,nil) tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
mg1:Merge(mg2) local e1=Effect.CreateEffect(e:GetHandler())
aux.FCheckAdditional=c52947044.fcheck
local sg1=Duel.GetMatchingGroup(c52947044.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(c52947044.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
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,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
tc:RegisterFlagEffect(52947044,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCondition(c52947044.descon) e1:SetCondition(s.descon)
e1:SetOperation(c52947044.desop) e1:SetOperation(s.desop)
e1:SetReset(RESET_PHASE+PHASE_END,2) e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount()) e1:SetLabel(Duel.GetTurnCount())
e1:SetLabelObject(tc) e1:SetLabelObject(tc)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
elseif stage==FusionSpell.STAGE_AT_ALL_OPERATION_FINISH then
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(s.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end end
aux.FCheckAdditional=nil
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(c52947044.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end end
function c52947044.descon(e,tp,eg,ep,ev,re,r,rp)
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
return Duel.GetTurnCount()~=e:GetLabel() and tc:GetFlagEffect(52947044)~=0 return Duel.GetTurnCount()~=e:GetLabel() and tc:GetFlagEffect(id)~=0
end end
function c52947044.desop(e,tp,eg,ep,ev,re,r,rp)
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT)
end end
function c52947044.splimit(e,c)
function s.splimit(e,c)
return not (c:IsAttribute(ATTRIBUTE_DARK) and c:IsSetCard(0x8)) return not (c:IsAttribute(ATTRIBUTE_DARK) and c:IsSetCard(0x8))
end end
--平行世界融合 --平行世界融合
function c54283059.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=FusionSpell.CreateSummonEffect(c,{
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) fusfilter=s.fusfilter,
e1:SetType(EFFECT_TYPE_ACTIVATE) pre_select_mat_location=LOCATION_REMOVED,
e1:SetCode(EVENT_FREE_CHAIN) mat_operation_code_map={
e1:SetCost(c54283059.cost) { [LOCATION_DECK]=FusionSpell.FUSION_OPERATION_GRAVE },
e1:SetTarget(c54283059.target) { [0xff]=FusionSpell.FUSION_OPERATION_SHUFFLE }
e1:SetOperation(c54283059.activate) }
})
e1:SetCost(s.cost)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c54283059.cost(e,tp,eg,ep,ev,re,r,rp,chk)
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0 end if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -19,71 +23,14 @@ function c54283059.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -19,71 +23,14 @@ function c54283059.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(e) e1:SetLabelObject(e)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetTarget(c54283059.sumlimit) e1:SetTarget(s.sumlimit)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c54283059.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
function s.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return e:GetLabelObject()~=se return e:GetLabelObject()~=se
end end
function c54283059.filter0(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() function s.fusfilter(c)
end return c:IsSetCard(0x3008)
function c54283059.filter1(c,e)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function c54283059.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x3008) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c54283059.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(c54283059.filter0,tp,LOCATION_REMOVED,0,nil)
local res=Duel.IsExistingMatchingCard(c54283059.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,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(c54283059.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c54283059.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg=Duel.GetMatchingGroup(c54283059.filter1,tp,LOCATION_REMOVED,0,nil,e)
local sg1=Duel.GetMatchingGroup(c54283059.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,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(c54283059.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
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 mat=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf)
tc:SetMaterial(mat)
Duel.HintSelection(mat)
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)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end end
...@@ -2,37 +2,34 @@ ...@@ -2,37 +2,34 @@
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
aux.AddCodeList(c,94820406,72043279) aux.AddCodeList(c,94820406,72043279)
--- fusion effect
local e0=FusionSpell.CreateSummonEffect(c,{
fusfilter=s.fusfilter,
pre_select_mat_location=LOCATION_MZONE|LOCATION_GRAVE|LOCATION_REMOVED,
mat_operation_code_map={
{ [LOCATION_DECK]=FusionSpell.FUSION_OPERATION_GRAVE },
{ [0xff]=FusionSpell.FUSION_OPERATION_SHUFFLE }
},
sumtype=SUMMON_VALUE_DARK_FUSION
})
--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:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetLabelObject(e0)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
s.fusion_effect=true
function s.filter1(c,e) function s.fusfilter(c)
return (c:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() return c.dark_calling==true
and not c:IsImmuneToEffect(e)
end
function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c.dark_calling and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_DARK_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
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)
local chkf=tp local fusion_effect=e:GetLabelObject()
local mg=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
local b0=Duel.GetFlagEffect(tp,id)==0 or not e:IsCostChecked() local b0=Duel.GetFlagEffect(tp,id)==0 or not e:IsCostChecked()
local b1=b0 and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf) local b1=b0 and fusion_effect:GetTarget()(e,tp,eg,ep,ev,re,r,rp,0)
if b0 and not b1 then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
b1=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
local b2=Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_DECK,0,1,nil) local b2=Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_DECK,0,1,nil)
and (Duel.GetFlagEffect(tp,id+o)==0 or not e:IsCostChecked()) and (Duel.GetFlagEffect(tp,id+o)==0 or not e:IsCostChecked())
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
...@@ -67,56 +64,16 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -67,56 +64,16 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetOperation(s.thop) e:SetOperation(s.thop)
end end
end end
function s.fsop(e,tp,eg,ep,ev,re,r,rp) function s.fsop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp local fusion_effect=e:GetLabelObject()
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.filter1),tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e) fusion_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,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 and not Duel.SelectYesNo(tp,ce:GetDescription()))) then
local mat=Duel.SelectFusionMaterial(tp,tc,mg,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_VALUE_DARK_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,SUMMON_VALUE_DARK_FUSION)
end
tc:CompleteProcedure()
end
end
function s.cfilter(c)
return c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) or (c:IsLocation(LOCATION_MZONE) and c:IsFaceup())
end end
function s.thfilter2(c) function s.thfilter2(c)
return c:IsCode(94820406,72043279) and c:IsAbleToHand() return c:IsCode(94820406,72043279) and c:IsAbleToHand()
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)
local g=Duel.SelectMatchingCard(tp,s.thfilter2,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.thfilter2,tp,LOCATION_DECK,0,1,1,nil)
......
--ダーク・フュージョン --ダーク・フュージョン
function c94820406.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) FusionSpell.RegisterSummonEffect(c,{
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) fusfilter=s.fusfilter,
e1:SetType(EFFECT_TYPE_ACTIVATE) sumtype=SUMMON_VALUE_DARK_FUSION,
e1:SetCode(EVENT_FREE_CHAIN) stage_x_operation=s.stage_x_operation
e1:SetTarget(c94820406.target) })
e1:SetOperation(c94820406.activate)
c:RegisterEffect(e1)
end end
function c94820406.filter1(c,e)
return not c:IsImmuneToEffect(e) function s.fusfilter(c)
return c:IsRace(RACE_FIEND)
end end
function c94820406.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_FIEND) and (not f or f(c)) --- @type FUSION_SPELL_STAGE_X_CALLBACK_FUNCTION
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) function s.stage_x_operation(e,tc,tp,stage)
end if stage==FusionSpell.STAGE_BEFORE_SUMMON_COMPLETE then
function c94820406.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(c94820406.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(c94820406.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 c94820406.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c94820406.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c94820406.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(c94820406.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,SUMMON_TYPE_FUSION)
end
tc:CompleteProcedure()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
......
...@@ -2742,7 +2742,7 @@ function FusionSpell.GetSummonOperation( ...@@ -2742,7 +2742,7 @@ function FusionSpell.GetSummonOperation(
if fusion_succeeded==true then if fusion_succeeded==true then
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummonStep(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,sumpos) Duel.SpecialSummonStep(tc,sumtype,tp,tp,false,false,sumpos)
end end
else else
--- hint opponent that this effect is applied --- hint opponent that this effect is applied
......
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