Commit 25ae2929 authored by gg123gg's avatar gg123gg Committed by GitHub

Add files via upload

parent ad263295
...@@ -2,143 +2,154 @@ ...@@ -2,143 +2,154 @@
local m=11200300 local m=11200300
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TODECK) e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost) e1:SetCost(cm.cost)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.activate) e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter) Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
--OP --OP
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_FZONE) e2:SetRange(LOCATION_FZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetProperty(EFFECT_FLAG_NO_TURN_RESET) e2:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetCondition(cm.thcon) e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg) e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop) e2:SetOperation(cm.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--todeck --todeck
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_FZONE) e4:SetRange(LOCATION_FZONE)
e4:SetCode(EVENT_LEAVE_FIELD) e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(cm.descon2) e4:SetCondition(cm.descon2)
e4:SetOperation(cm.desop2) e4:SetOperation(cm.desop2)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function cm.counterfilter(c) function cm.counterfilter(c)
return c:IsType(TYPE_FUSION) return c:IsType(TYPE_FUSION)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end if chk==0 then return Duel.GetCustomActivityCount(m,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)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit) e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function cm.splimit(e,c) function cm.splimit(e,c)
return not c:IsType(TYPE_FUSION) return not c:IsType(TYPE_FUSION)
end end
function cm.rmfilter(c) function cm.rmfilter(c)
return c:IsFacedown() and c:IsAbleToRemove() return c:IsFacedown() and c:IsAbleToRemove()
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_EXTRA,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(cm.rmfilter,tp,LOCATION_EXTRA,0,nil) local g=Duel.GetMatchingGroup(cm.rmfilter,tp,LOCATION_EXTRA,0,nil)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
local tc=g:RandomSelect(tp,1):GetFirst() local tc=g:RandomSelect(tp,1):GetFirst()
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and not tc:IsType(TYPE_FUSION) then if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and not tc:IsType(TYPE_FUSION) then
Duel.SendtoDeck(c,nil,2,REASON_EFFECT) Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end end
end end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp) function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function cm.filter0(c)
return c:IsOnField() and c:IsAbleToRemove()
end end
function cm.filter1(c,e) function cm.filter1(c,e)
return not c:IsImmuneToEffect(e) return c:IsOnField() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end end
function cm.filter2(c,e,tp,m,f,chkf) function cm.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c)) 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) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.filter3(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp) local mg1=Duel.GetFusionMaterial(tp):Filter(cm.filter0,nil)
local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) local mg2=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_GRAVE,0,nil)
if not res then mg1:Merge(mg2)
local ce=Duel.GetChainMaterial(tp) local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if ce~=nil then if not res then
local fgroup=ce:GetTarget() local ce=Duel.GetChainMaterial(tp)
local mg2=fgroup(ce,e,tp) if ce~=nil then
local mf=ce:GetValue() local fgroup=ce:GetTarget()
res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf) local mg3=fgroup(ce,e,tp)
end local mf=ce:GetValue()
end res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
return res end
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.filter1,nil,e) local mg1=Duel.GetFusionMaterial(tp):Filter(cm.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local mg2=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_GRAVE,0,nil)
local mg2=nil mg1:Merge(mg2)
local sg2=nil local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local ce=Duel.GetChainMaterial(tp) local mg3=nil
if ce~=nil then local sg2=nil
local fgroup=ce:GetTarget() local ce=Duel.GetChainMaterial(tp)
mg2=fgroup(ce,e,tp) if ce~=nil then
local mf=ce:GetValue() local fgroup=ce:GetTarget()
sg2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf) mg3=fgroup(ce,e,tp)
end local mf=ce:GetValue()
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then sg2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
local sg=sg1:Clone() end
if sg2 then sg:Merge(sg2) end if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=sg1:Clone()
local tg=sg:Select(tp,1,1,nil) if sg2 then sg:Merge(sg2) end
local tc=tg:GetFirst() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then local tg=sg:Select(tp,1,1,nil)
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) local tc=tg:GetFirst()
tc:SetMaterial(mat1) if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
Duel.BreakEffect() tc:SetMaterial(mat1)
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
else Duel.BreakEffect()
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf) Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
local fop=ce:GetOperation() else
fop(ce,e,tp,tc,mat2) local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
end local fop=ce:GetOperation()
tc:CompleteProcedure() fop(ce,e,tp,tc,mat2)
end end
tc:CompleteProcedure()
end
end end
function cm.ffilter(c,tp) function cm.ffilter(c,tp)
return c:IsType(TYPE_FUSION) and c:IsFaceup() and c:IsControler(tp) return c:IsType(TYPE_FUSION) and c:IsFaceup() and c:IsControler(tp)
end end
function cm.descon2(e,tp,eg,ep,ev,re,r,rp) function cm.descon2(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:Filter(cm.ffilter,nil,tp) local tc=eg:Filter(cm.ffilter,nil,tp)
return tc:GetCount()>0 return tc:GetCount()>0
end end
function cm.desop2(e,tp,eg,ep,ev,re,r,rp) function cm.desop2(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT) Duel.SendtoHand(e:GetHandler(),tp,REASON_EFFECT)
end end
\ No newline at end of file
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