Commit 780bfeec authored by Vury Leo's avatar Vury Leo Committed by wind2009

Add 捕食植物 and 闇属性 to new fusion

parent 485c0055
--捕食惑星 --捕食惑星
function c51858200.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
...@@ -11,117 +12,66 @@ function c51858200.initial_effect(c) ...@@ -11,117 +12,66 @@ function c51858200.initial_effect(c)
e0:SetCode(EVENT_LEAVE_FIELD_P) e0:SetCode(EVENT_LEAVE_FIELD_P)
e0:SetRange(LOCATION_SZONE) e0:SetRange(LOCATION_SZONE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetOperation(c51858200.regop) e0:SetOperation(s.regop)
c:RegisterEffect(e0) c:RegisterEffect(e0)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(51858200,0)) e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_LEAVE_FIELD) e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,51858200) e2:SetCountLimit(1,id)
e2:SetCondition(c51858200.thcon) e2:SetCondition(s.thcon)
e2:SetTarget(c51858200.thtg) e2:SetTarget(s.thtg)
e2:SetOperation(c51858200.thop) e2:SetOperation(s.thop)
e2:SetLabelObject(e0) e2:SetLabelObject(e0)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--fusion summon --fusion summon
local e3=Effect.CreateEffect(c) local e3=FusionSpell.CreateSummonEffect(c,{
e3:SetDescription(aux.Stringid(51858200,1)) matfilter=s.matfilter
})
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE) e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost) e3:SetCost(aux.bfgcost)
e3:SetTarget(c51858200.sptg)
e3:SetOperation(c51858200.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c51858200.cfilter(c)
function s.cfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:GetCounter(0x1041)>0 return c:IsLocation(LOCATION_MZONE) and c:GetCounter(0x1041)>0
end end
function c51858200.regop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(c51858200.cfilter,1,nil) then function s.regop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(s.cfilter,1,nil) then
e:SetLabel(1) e:SetLabel(1)
else e:SetLabel(0) end else e:SetLabel(0) end
end end
function c51858200.thcon(e,tp,eg,ep,ev,re,r,rp)
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetLabel()==1 return e:GetLabelObject():GetLabel()==1
end end
function c51858200.thfilter(c)
function s.thfilter(c)
return c:IsSetCard(0xf3) and c:IsAbleToHand() return c:IsSetCard(0xf3) and c:IsAbleToHand()
end end
function c51858200.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 true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c51858200.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,c51858200.thfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function c51858200.spfilter1(c,e)
return c:IsSetCard(0x10f3) and not c:IsImmuneToEffect(e) function s.matfilter(c)
end return c:IsSetCard(0x10f3)
function c51858200.spfilter2(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 c51858200.spfilter3(c)
return c:IsCanBeFusionMaterial() and c:IsSetCard(0x10f3)
end
function c51858200.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsSetCard,nil,0x10f3)
local res=Duel.IsExistingMatchingCard(c51858200.spfilter2,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(c51858200.spfilter3,nil)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c51858200.spfilter2,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 c51858200.spop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c51858200.spfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(c51858200.spfilter2,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(c51858200.spfilter3,nil)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c51858200.spfilter2,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()
end
end end
--捕食植物ブフォリキュラ --捕食植物ブフォリキュラ
local s,id,o=GetID() local s,id,o=GetID()
function c70427670.initial_effect(c) function s.initial_effect(c)
aux.EnablePendulumAttribute(c) aux.EnablePendulumAttribute(c)
--Pendulum Effect : Fusion Summon --Pendulum Effect : Fusion Summon
local e1=Effect.CreateEffect(c) local e1=FusionSpell.CreateSummonEffect(c,{
e1:SetDescription(aux.Stringid(70427670,0)) fusfilter=s.fusfilter
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) })
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,70427670) e1:SetCountLimit(1,id)
e1:SetTarget(c70427670.fustg)
e1:SetOperation(c70427670.fusop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Monster Effect : Send to Hand (Pendulum Monster) --Monster Effect : Send to Hand (Pendulum Monster)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(70427670,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND) e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL) e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCountLimit(1,70427670+o) e2:SetCountLimit(1,id+o)
e2:SetCondition(c70427670.thcon) e2:SetCondition(s.thcon)
e2:SetTarget(c70427670.thtg) e2:SetTarget(s.thtg)
e2:SetOperation(c70427670.thop) e2:SetOperation(s.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c70427670.fusfilter1(c,e)
return not c:IsImmuneToEffect(e) function s.fusfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK)
end end
function c70427670.fusfilter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsAttribute(ATTRIBUTE_DARK) and (not f or f(c)) function s.thcon(e,tp,eg,ep,ev,re,r,rp)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c70427670.fustg(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(c70427670.fusfilter2,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(c70427670.fusfilter2,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 c70427670.fusop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c70427670.fusfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(c70427670.fusfilter2,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(c70427670.fusfilter2,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()
end
end
function c70427670.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup() and c:IsLocation(LOCATION_EXTRA)) and r==REASON_FUSION return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup() and c:IsLocation(LOCATION_EXTRA)) and r==REASON_FUSION
end end
function c70427670.thfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_PENDULUM) and not c:IsCode(70427670) and c:IsAbleToHand() function s.thfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_PENDULUM) and not c:IsCode(id) and c:IsAbleToHand()
end end
function c70427670.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c70427670.thfilter,tp,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_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
end end
function c70427670.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,c70427670.thfilter,tp,LOCATION_EXTRA,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
end end
......
--プレデター・プライム・フュージョン --プレデター・プライム・フュージョン
function c8148322.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_MZONE,
e1:SetCode(EVENT_FREE_CHAIN) pre_select_mat_opponent_location=LOCATION_MZONE,
additional_fgoalcheck=s.fgoalcheck
})
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,8148322+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c8148322.condition) e1:SetCondition(s.condition)
e1:SetTarget(c8148322.target)
e1:SetOperation(c8148322.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c8148322.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x10f3) function s.fusfilter(c)
end return c:IsAttribute(ATTRIBUTE_DARK)
function c8148322.condition(e,tp,eg,ep,ev,re,r,rp) end
return Duel.IsExistingMatchingCard(c8148322.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end ---@type FUSION_FGCHECK_FUNCTION
function c8148322.filter0(c) function s.fgoalcheck(tp,mg,tc,mg_all)
return c:IsFaceup() and c:IsCanBeFusionMaterial() ---Must including 2 or more DARK monsters you control
end ---@param c Card
function c8148322.filter1(c,e) if mg_all:FilterCount(function(c) return c:IsControler(tp) and c:IsFusionAttribute(ATTRIBUTE_DARK) and c:IsOnField() end,nil)<2 then
return c:IsFaceup() and c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e) return false
end
function c8148322.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsAttribute(ATTRIBUTE_DARK)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c8148322.filter3(c,e)
return c:IsOnField() and not c:IsImmuneToEffect(e)
end
function c8148322.ffilter(c,tp)
return c:IsOnField() and c:IsControler(tp)
end
function c8148322.fcheck(tp,sg,fc)
return sg:FilterCount(c8148322.ffilter,nil,tp)>=2
end
function c8148322.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)
local mg2=Duel.GetMatchingGroup(c8148322.filter0,tp,0,LOCATION_MZONE,nil)
mg1:Merge(mg2)
aux.FGoalCheckAdditional=c8148322.fcheck
local res=Duel.IsExistingMatchingCard(c8148322.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
aux.FGoalCheckAdditional=nil
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(c8148322.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) return true
end end
function c8148322.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp function s.cfilter(c)
local mg1=Duel.GetFusionMaterial(tp):Filter(c8148322.filter3,nil,e) return c:IsFaceup() and c:IsSetCard(0x10f3)
local mg2=Duel.GetMatchingGroup(c8148322.filter1,tp,0,LOCATION_MZONE,nil,e) end
mg1:Merge(mg2)
aux.FGoalCheckAdditional=c8148322.fcheck function s.condition(e,tp,eg,ep,ev,re,r,rp)
local sg1=Duel.GetMatchingGroup(c8148322.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
aux.FGoalCheckAdditional=nil
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(c8148322.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
aux.FGoalCheckAdditional=c8148322.fcheck
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
aux.FGoalCheckAdditional=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,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end end
--捕食植物サンデウ・キンジー --捕食植物サンデウ・キンジー
function c89181134.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--fusattribute --fusattribute
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_FUSION_ATTRIBUTE) e1:SetCode(EFFECT_CHANGE_FUSION_ATTRIBUTE)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c89181134.attrtg) e1:SetTarget(s.attrtg)
e1:SetValue(c89181134.attrval) e1:SetValue(s.attrval)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--fusion summon --fusion summon
local e2=Effect.CreateEffect(c) local e2=FusionSpell.CreateSummonEffect(c,{
e2:SetDescription(aux.Stringid(89181134,0)) fusfilter=s.fusfilter,
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) pre_select_mat_opponent_location=LOCATION_MZONE,
additional_fcheck=s.fcheck,
gc=s.gc
})
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,89181134) e2:SetCountLimit(1,id)
e2:SetTarget(c89181134.target)
e2:SetOperation(c89181134.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c89181134.attrtg(e,c)
function s.attrtg(e,c)
return c:GetCounter(0x1041)>0 return c:GetCounter(0x1041)>0
end end
function c89181134.attrval(e,c,rp)
function s.attrval(e,c,rp)
if rp==e:GetHandlerPlayer() then if rp==e:GetHandlerPlayer() then
return ATTRIBUTE_DARK return ATTRIBUTE_DARK
else return c:GetAttribute() end else return c:GetAttribute() end
end end
function c89181134.filter0(c)
return c:IsCanBeFusionMaterial() and c:IsFaceup() and c:GetCounter(0x1041)>0 function s.fusfilter(c)
end return c:IsAttribute(ATTRIBUTE_DARK)
function c89181134.filter1(c,e) end
return not c:IsImmuneToEffect(e)
end --- @type FUSION_FGCHECK_FUNCTION
function c89181134.filter2(c,e,tp,m,f,gc,chkf) function s.fcheck(tp,mg,tc,mg_all)
return c:IsType(TYPE_FUSION) and c:IsAttribute(ATTRIBUTE_DARK) and (not f or f(c)) --- can only use monsters with a Predator Counter your opponent controls
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf) local mg_opponent=mg:Filter(function(c) return c:IsControler(1-tp) end,nil)
end --- @param c Card
function c89181134.filter3(c,e) if mg_opponent:IsExists(function(c) return c:GetCounter(0x1041)<1 end,1,nil) then
return c89181134.filter0(c) and not c:IsImmuneToEffect(e) return false
end
function c89181134.target(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)
local mg2=Duel.GetMatchingGroup(c89181134.filter0,tp,0,LOCATION_MZONE,nil)
mg1:Merge(mg2)
local res=Duel.IsExistingMatchingCard(c89181134.filter2,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 mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c89181134.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,c,chkf)
end
end
return res
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) return true
end end
function c89181134.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() function s.gc(e)
local chkf=tp return e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or (c:IsControler(1-tp) and c:GetCounter(0x1041)<=0) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(c89181134.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c89181134.filter3,tp,0,LOCATION_MZONE,nil,e)
mg1:Merge(mg2)
local sg1=Duel.GetMatchingGroup(c89181134.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,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(c89181134.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,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,mg3,c,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end end
...@@ -2,14 +2,11 @@ ...@@ -2,14 +2,11 @@
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=FusionSpell.CreateSummonEffect(c,{
fusfilter=s.fusfilter
})
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.condition) e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--search --search
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -24,20 +21,22 @@ function s.initial_effect(c) ...@@ -24,20 +21,22 @@ function s.initial_effect(c)
e2:SetOperation(s.spop) e2:SetOperation(s.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
s.fusion_effect=true
function s.condition1(e,tp,eg,ep,ev,re,r,rp) function s.condition1(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) return Duel.GetTurnPlayer()==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
and Duel.IsExistingMatchingCard(nil,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) and Duel.IsExistingMatchingCard(nil,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsSetCard(0x21) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x21) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) 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 Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
...@@ -55,69 +54,17 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,69 +54,17 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function s.splimit(e,c) function s.splimit(e,c)
return not (c:IsType(TYPE_SYNCHRO) or c:IsType(TYPE_FUSION)) and c:IsLocation(LOCATION_EXTRA) return not (c:IsType(TYPE_SYNCHRO) or c:IsType(TYPE_FUSION)) and c:IsLocation(LOCATION_EXTRA)
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
return Duel.IsExistingMatchingCard(nil,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) return Duel.IsExistingMatchingCard(nil,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
or ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end end
function s.filter1(c,e)
return not c:IsImmuneToEffect(e) function s.fusfilter(c)
end return c:IsAttribute(ATTRIBUTE_DARK)
function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsAttribute(ATTRIBUTE_DARK) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function s.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(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 mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.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 s.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(s.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(s.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()
end
end 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