Commit fe8a298c authored by wyykak's avatar wyykak

change newline

parent 7e27d97e
Arcol={} Arcol={}
function Arcol.GetLostCode(c) function Arcol.GetLostCode(c)
if c:GetOriginalCode()==22001 then if c:GetOriginalCode()==22001 then
return 22035 return 22035
elseif c:GetOriginalCode()==20026 then elseif c:GetOriginalCode()==20026 then
return 20044 return 20044
elseif c:IsOriginalSetCard(0x338) then elseif c:IsOriginalSetCard(0x338) then
return 999101 return 999101
elseif c:IsOriginalSetCard(0x300) then elseif c:IsOriginalSetCard(0x300) then
return 86379247 return 86379247
elseif c:IsOriginalSetCard(0xaa5) then elseif c:IsOriginalSetCard(0xaa5) then
return 86379744 return 86379744
else return false end else return false end
end end
\ No newline at end of file
Millux={} Millux={}
os=require('os') os=require('os')
table=require('table') table=require('table')
io=require('io') io=require('io')
function Millux.rabat_return(c,code,num) function Millux.rabat_return(c,code,num)
--return --return
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation e1:SetOperation
(function(e,tp,eg,ep,ev,re,r,rp) (function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(code,num)) e1:SetDescription(aux.Stringid(code,num))
e1:SetCategory(CATEGORY_TOHAND) e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCondition( e1:SetCondition(
function(e,tp,eg,ep,ev,re,r,rp) function(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsHasEffect(50008207) return not e:GetHandler():IsHasEffect(50008207)
end) end)
e1:SetTarget( e1:SetTarget(
function(e,tp,eg,ep,ev,re,r,rp,chk) function(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,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end) end)
e1:SetOperation( e1:SetOperation(
function(e,tp,eg,ep,ev,re,r,rp) function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT) Duel.SendtoHand(c,nil,REASON_EFFECT)
end end
end) end)
e1:SetReset(RESET_EVENT+0x1ec0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1ec0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(0) e2:SetProperty(0)
e2:SetCondition( e2:SetCondition(
function(e,tp,eg,ep,ev,re,r,rp) function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsHasEffect(50008207) return e:GetHandler():IsHasEffect(50008207)
end) end)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end) end)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function Millux.return_con(e,tp,eg,ep,ev,re,r,rp) function Millux.return_con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end end
function Millux.penlimit(c) function Millux.penlimit(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetTarget(Millux.splimit) e1:SetTarget(Millux.splimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function Millux.splimit(e,c,sump,sumtype,sumpos,targetp) function Millux.splimit(e,c,sump,sumtype,sumpos,targetp)
if c:IsRitualType(TYPE_RITUAL) then return false end if c:IsRitualType(TYPE_RITUAL) then return false end
return bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM return bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end end
Millux.loaded_metatable_list=Millux.loaded_metatable_list or {} Millux.loaded_metatable_list=Millux.loaded_metatable_list or {}
function Millux.LoadMetatable(code) function Millux.LoadMetatable(code)
local m1=_G["c"..code] local m1=_G["c"..code]
if m1 then return m1 end if m1 then return m1 end
local m2=Millux.loaded_metatable_list[code] local m2=Millux.loaded_metatable_list[code]
if m2 then return m2 end if m2 then return m2 end
_G["c"..code]={} _G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
local mt=_G["c"..code] local mt=_G["c"..code]
_G["c"..code]=nil _G["c"..code]=nil
if mt then if mt then
Millux.loaded_metatable_list[code]=mt Millux.loaded_metatable_list[code]=mt
return mt return mt
end end
else else
_G["c"..code]=nil _G["c"..code]=nil
end end
end end
function Millux.is_series(c,series,v,f,...) function Millux.is_series(c,series,v,f,...)
local codet=nil local codet=nil
if type(c)=="number" then if type(c)=="number" then
codet={c} codet={c}
elseif type(c)=="table" then elseif type(c)=="table" then
codet=c codet=c
elseif type(c)=="userdata" then elseif type(c)=="userdata" then
local f=f or Card.GetCode local f=f or Card.GetCode
codet={f(c)} codet={f(c)}
end end
local ncodet={...} local ncodet={...}
for i,code in pairs(codet) do for i,code in pairs(codet) do
for i,ncode in pairs(ncodet) do for i,ncode in pairs(ncodet) do
if code==ncode then return true end if code==ncode then return true end
end end
local mt=Millux.LoadMetatable(code) local mt=Millux.LoadMetatable(code)
if mt and mt["is_series_with_"..series] and (not v or mt["is_series_with_"..series]==v) then return true end if mt and mt["is_series_with_"..series] and (not v or mt["is_series_with_"..series]==v) then return true end
end end
return false return false
end end
function Millux.cannot_acctivate(c) function Millux.cannot_acctivate(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
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_ACTIVATE) e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,1) e1:SetTargetRange(0,1)
e1:SetValue(aclimit) e1:SetValue(aclimit)
e1:SetCondition(actcon) e1:SetCondition(actcon)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function aclimit(e,re,tp) function aclimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e) return not re:GetHandler():IsImmuneToEffect(e)
end end
function actcon(e) function actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler() return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end end
return Millux return Millux
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
-- --
Dss={} Dss={}
local dssflag = false local dssflag = false
--rewrite --rewrite
-- function Auxiliary.Stringid(code,id) -- function Auxiliary.Stringid(code,id)
-- if dssflag==true then -- if dssflag==true then
-- dssflag = false -- dssflag = false
-- Dss.setting() -- Dss.setting()
-- end -- end
-- return code*16+id -- return code*16+id
-- end -- end
function Dss.setting() function Dss.setting()
local e2=Effect.GlobalEffect() local e2=Effect.GlobalEffect()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PREDRAW) e2:SetCode(EVENT_PREDRAW)
e2:SetCondition(Dss.drawcon) e2:SetCondition(Dss.drawcon)
e2:SetTarget(Dss.drawtg) e2:SetTarget(Dss.drawtg)
e2:SetOperation(Dss.drawop) e2:SetOperation(Dss.drawop)
Duel.RegisterEffect(e2, 0) Duel.RegisterEffect(e2, 0)
end end
function Dss.drawcon(e,tp,eg,ep,ev,re,r,rp) function Dss.drawcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==1 return Duel.GetTurnCount()==1
end end
function Dss.drawtg(e,tp,eg,ep,ev,re,r,rp,chk) function Dss.drawtg(e,tp,eg,ep,ev,re,r,rp,chk)
local dt=Duel.GetDrawCount(Duel.GetTurnPlayer()) local dt=Duel.GetDrawCount(Duel.GetTurnPlayer())
if dt~=0 then if dt~=0 then
_replace_count=0 _replace_count=0
_replace_max=dt _replace_max=dt
local e1=Effect.GlobalEffect() local e1=Effect.GlobalEffect()
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_DRAW_COUNT) e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW) e1:SetReset(RESET_PHASE+PHASE_DRAW)
e1:SetValue(0) e1:SetValue(0)
Duel.RegisterEffect(e1,Duel.GetTurnPlayer()) Duel.RegisterEffect(e1,Duel.GetTurnPlayer())
local e0=Effect.GlobalEffect() local e0=Effect.GlobalEffect()
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE) e0:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_PHASE+PHASE_END) e0:SetCode(EVENT_PHASE+PHASE_END)
e0:SetCondition(Dss.drawcon2) e0:SetCondition(Dss.drawcon2)
e0:SetReset(RESET_PHASE+PHASE_END) e0:SetReset(RESET_PHASE+PHASE_END)
e0:SetOperation(Dss.drawop2) e0:SetOperation(Dss.drawop2)
Duel.RegisterEffect(e0, Duel.GetTurnPlayer()) Duel.RegisterEffect(e0, Duel.GetTurnPlayer())
end end
end end
function Dss.drawop(e,tp,eg,ep,ev,re,r,rp) function Dss.drawop(e,tp,eg,ep,ev,re,r,rp)
_replace_count=_replace_count+1 _replace_count=_replace_count+1
if _replace_count>_replace_max then return end if _replace_count>_replace_max then return end
end end
function Dss.drawcon2(e,tp,eg,ep,ev,re,r,rp) function Dss.drawcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_END return Duel.GetCurrentPhase()==PHASE_END
end end
function Dss.drawop2(e,tp,eg,ep,ev,re,r,rp) function Dss.drawop2(e,tp,eg,ep,ev,re,r,rp)
-- if Duel.SelectYesNo(Duel.GetTurnPlayer(), 25096*16+0) then -- if Duel.SelectYesNo(Duel.GetTurnPlayer(), 25096*16+0) then
Duel.Draw(Duel.GetTurnPlayer(),1,REASON_RULE) Duel.Draw(Duel.GetTurnPlayer(),1,REASON_RULE)
-- end -- end
e:Reset() e:Reset()
end end
\ No newline at end of file
-- --
Elf={} Elf={}
local ElfGlobalAttr = {} local ElfGlobalAttr = {}
ElfGlobalAttr[0] = 0 ElfGlobalAttr[0] = 0
ElfGlobalAttr[1] = 0 ElfGlobalAttr[1] = 0
function Elf.GetElfAttr(tp) function Elf.GetElfAttr(tp)
return ElfGlobalAttr[tp] return ElfGlobalAttr[tp]
end end
function Elf.SetElfAttr(tp,attr) function Elf.SetElfAttr(tp,attr)
ElfGlobalAttr[tp] = attr ElfGlobalAttr[tp] = attr
end end
-- --
Ets={} Ets={}
--ETS --ETS
local ETStore = {} local ETStore = {}
function Ets.EffectTempStore(e,num) function Ets.EffectTempStore(e,num)
if ETStore[num]==nil then ETStore[num]=e end if ETStore[num]==nil then ETStore[num]=e end
end end
function Ets.EffectTempCloneConChange(c,num,f) function Ets.EffectTempCloneConChange(c,num,f)
if ETStore[num]~=nil then if ETStore[num]~=nil then
local e0=ETStore[num]:Clone() local e0=ETStore[num]:Clone()
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_DAMAGE_STEP) e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_DAMAGE_STEP)
e0:SetCondition(f) e0:SetCondition(f)
e0:SetLabel(num) e0:SetLabel(num)
c:RegisterEffect(e0) c:RegisterEffect(e0)
end end
end end
function Ets.RegCommonEffect(c) function Ets.RegCommonEffect(c)
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(c:GetOriginalCode(),0)) e0:SetDescription(aux.Stringid(c:GetOriginalCode(),0))
e0:SetCategory(CATEGORY_DESTROY) e0:SetCategory(CATEGORY_DESTROY)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e0:SetCode(EVENT_BATTLE_DESTROYING) e0:SetCode(EVENT_BATTLE_DESTROYING)
e0:SetCondition(Ets.con0) e0:SetCondition(Ets.con0)
e0:SetTarget(Ets.tg) e0:SetTarget(Ets.tg)
e0:SetOperation(Ets.op) e0:SetOperation(Ets.op)
c:RegisterEffect(e0) c:RegisterEffect(e0)
local e1=e0:Clone() local e1=e0:Clone()
e1:SetCondition(Ets.con1) e1:SetCondition(Ets.con1)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
c:RegisterEffect(e1) c:RegisterEffect(e1)
return e0,e1 return e0,e1
end end
function Ets.con0(e,tp,eg,ep,ev,re,r,rp) function Ets.con0(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:GetFlagEffect(999100)>0 then return false end if c:GetFlagEffect(999100)>0 then return false end
local bc=c:GetBattleTarget() local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and bc:IsType(TYPE_MONSTER) return c:IsRelateToBattle() and bc:IsType(TYPE_MONSTER)
end end
function Ets.con1(e,tp,eg,ep,ev,re,r,rp) function Ets.con1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:GetFlagEffect(999100)<1 then return false end if c:GetFlagEffect(999100)<1 then return false end
local bc=c:GetBattleTarget() local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and bc:IsType(TYPE_MONSTER) return c:IsRelateToBattle() and bc:IsType(TYPE_MONSTER)
end end
function Ets.tg(e,tp,eg,ep,ev,re,r,rp,chk) function Ets.tg(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_DESTROY,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,0,0)
end end
function Ets.op(e,tp,eg,ep,ev,re,r,rp) function Ets.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT) Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end end
\ No newline at end of file
--module for fusion material func --module for fusion material func
--script by Nanahira --script by Nanahira
Fus=Fus or {} Fus=Fus or {}
local table=require("table") local table=require("table")
function Fus.CodeFilter(code) function Fus.CodeFilter(code)
return function(c) return function(c)
return c:IsFusionCode(code) return c:IsFusionCode(code)
end end
end end
function Fus.AddFusionProcCode2(c,code1,code2,sub,insf) function Fus.AddFusionProcCode2(c,code1,code2,sub,insf)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local mt=_G["c"..c:GetOriginalCode()] local mt=_G["c"..c:GetOriginalCode()]
mt.hana_mat={Fus.CodeFilter(code1),Fus.CodeFilter(code2)} mt.hana_mat={Fus.CodeFilter(code1),Fus.CodeFilter(code2)}
aux.AddFusionProcCode2(c,code1,code2,sub,insf) aux.AddFusionProcCode2(c,code1,code2,sub,insf)
end end
function Fus.AddFusionProcCode3(c,code1,code2,code3,sub,insf) function Fus.AddFusionProcCode3(c,code1,code2,code3,sub,insf)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local mt=_G["c"..c:GetOriginalCode()] local mt=_G["c"..c:GetOriginalCode()]
mt.hana_mat={Fus.CodeFilter(code1),Fus.CodeFilter(code2),Fus.CodeFilter(code3)} mt.hana_mat={Fus.CodeFilter(code1),Fus.CodeFilter(code2),Fus.CodeFilter(code3)}
aux.AddFusionProcCode3(c,code1,code2,code3,sub,insf) aux.AddFusionProcCode3(c,code1,code2,code3,sub,insf)
end end
function Fus.AddFusionProcCode4(c,code1,code2,code3,code4,sub,insf) function Fus.AddFusionProcCode4(c,code1,code2,code3,code4,sub,insf)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local mt=_G["c"..c:GetOriginalCode()] local mt=_G["c"..c:GetOriginalCode()]
mt.hana_mat={Fus.CodeFilter(code1),Fus.CodeFilter(code2),Fus.CodeFilter(code3),Fus.CodeFilter(code4)} mt.hana_mat={Fus.CodeFilter(code1),Fus.CodeFilter(code2),Fus.CodeFilter(code3),Fus.CodeFilter(code4)}
aux.AddFusionProcCode4(c,code1,code2,code3,code4,sub,insf) aux.AddFusionProcCode4(c,code1,code2,code3,code4,sub,insf)
end end
function Fus.AddFusionProcCodeFun(c,code1,f,cc,sub,insf) function Fus.AddFusionProcCodeFun(c,code1,f,cc,sub,insf)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local mt=_G["c"..c:GetOriginalCode()] local mt=_G["c"..c:GetOriginalCode()]
mt.hana_mat={Fus.CodeFilter(code1),f} mt.hana_mat={Fus.CodeFilter(code1),f}
aux.AddFusionProcCodeFun(c,code1,f,cc,sub,insf) aux.AddFusionProcCodeFun(c,code1,f,cc,sub,insf)
end end
function Fus.AddFusionProcFun2(c,f1,f2,insf) function Fus.AddFusionProcFun2(c,f1,f2,insf)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local mt=_G["c"..c:GetOriginalCode()] local mt=_G["c"..c:GetOriginalCode()]
mt.hana_mat={f1,f2} mt.hana_mat={f1,f2}
aux.AddFusionProcFun2(c,f1,f2,insf) aux.AddFusionProcFun2(c,f1,f2,insf)
end end
function Fus.AddFusionProcCodeRep(c,code1,cc,sub,insf) function Fus.AddFusionProcCodeRep(c,code1,cc,sub,insf)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local mt=_G["c"..c:GetOriginalCode()] local mt=_G["c"..c:GetOriginalCode()]
mt.hana_mat={} mt.hana_mat={}
for i=1,cc do for i=1,cc do
table.insert(mt.hana_mat,Fus.CodeFilter(code1)) table.insert(mt.hana_mat,Fus.CodeFilter(code1))
end end
aux.AddFusionProcCodeRep(c,code1,cc,sub,insf) aux.AddFusionProcCodeRep(c,code1,cc,sub,insf)
end end
function Fus.AddFusionProcFunRep(c,f,cc,insf) function Fus.AddFusionProcFunRep(c,f,cc,insf)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local mt=_G["c"..c:GetOriginalCode()] local mt=_G["c"..c:GetOriginalCode()]
mt.hana_mat={} mt.hana_mat={}
for i=1,cc do for i=1,cc do
table.insert(mt.hana_mat,f) table.insert(mt.hana_mat,f)
end end
aux.AddFusionProcFunRep(c,f,cc,insf) aux.AddFusionProcFunRep(c,f,cc,insf)
end end
function Fus.AddFusionProcFunFunRep(c,f1,f2,minc,maxc,insf) function Fus.AddFusionProcFunFunRep(c,f1,f2,minc,maxc,insf)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local mt=_G["c"..c:GetOriginalCode()] local mt=_G["c"..c:GetOriginalCode()]
mt.hana_mat={f1} mt.hana_mat={f1}
for i=1,maxc do for i=1,maxc do
table.insert(mt.hana_mat,f2) table.insert(mt.hana_mat,f2)
end end
aux.AddFusionProcFunFunRep(c,f1,f2,minc,maxc,insf) aux.AddFusionProcFunFunRep(c,f1,f2,minc,maxc,insf)
end end
function Fus.AddFusionProcCodeFunRep(c,code1,f,minc,maxc,sub,insf) function Fus.AddFusionProcCodeFunRep(c,code1,f,minc,maxc,sub,insf)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local mt=_G["c"..c:GetOriginalCode()] local mt=_G["c"..c:GetOriginalCode()]
mt.hana_mat={Fus.CodeFilter(code1)} mt.hana_mat={Fus.CodeFilter(code1)}
for i=1,maxc do for i=1,maxc do
table.insert(mt.hana_mat,f) table.insert(mt.hana_mat,f)
end end
aux.AddFusionProcCodeFunRep(c,code1,f,minc,maxc,sub,insf) aux.AddFusionProcCodeFunRep(c,code1,f,minc,maxc,sub,insf)
end end
function Fus.AddFusionProcFunMulti(c,insf,...) function Fus.AddFusionProcFunMulti(c,insf,...)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local funs={...} local funs={...}
local mt=_G["c"..c:GetOriginalCode()] local mt=_G["c"..c:GetOriginalCode()]
mt.hana_mat=funs mt.hana_mat=funs
local n=#funs local n=#funs
aux.AddFusionProcMix(c,true,insf,...) aux.AddFusionProcMix(c,true,insf,...)
end end
function Fus.NonImmuneFilter(c,e) function Fus.NonImmuneFilter(c,e)
return not c:IsImmuneToEffect(e) return not c:IsImmuneToEffect(e)
end end
function Fus.FusionMaterialFilter(c,oppo) function Fus.FusionMaterialFilter(c,oppo)
if oppo and c:IsLocation(LOCATION_ONFIELD+LOCATION_REMOVED) and c:IsFacedown() then return false end if oppo and c:IsLocation(LOCATION_ONFIELD+LOCATION_REMOVED) and c:IsFacedown() then return false end
return c:IsCanBeFusionMaterial() and c:IsType(TYPE_MONSTER) return c:IsCanBeFusionMaterial() and c:IsType(TYPE_MONSTER)
end end
function Fus.GetFusionMaterial(tp,loc,oloc,f,gc,e,...) function Fus.GetFusionMaterial(tp,loc,oloc,f,gc,e,...)
local g1=Duel.GetFusionMaterial(tp) local g1=Duel.GetFusionMaterial(tp)
if loc then if loc then
local floc=bit.band(loc,LOCATION_ONFIELD+LOCATION_HAND) local floc=bit.band(loc,LOCATION_ONFIELD+LOCATION_HAND)
if floc~=0 then if floc~=0 then
g1=g1:Filter(Card.IsLocation,nil,floc) g1=g1:Filter(Card.IsLocation,nil,floc)
else else
g1:Clear() g1:Clear()
end end
local eloc=loc-floc local eloc=loc-floc
if eloc~=0 then if eloc~=0 then
local g2=Duel.GetMatchingGroup(Fus.FusionMaterialFilter,tp,eloc,0,nil) local g2=Duel.GetMatchingGroup(Fus.FusionMaterialFilter,tp,eloc,0,nil)
g1:Merge(g2) g1:Merge(g2)
end end
end end
if oloc and oloc~=0 then if oloc and oloc~=0 then
local g3=Duel.GetMatchingGroup(Fus.FusionMaterialFilter,tp,0,oloc,nil,true) local g3=Duel.GetMatchingGroup(Fus.FusionMaterialFilter,tp,0,oloc,nil,true)
g1:Merge(g3) g1:Merge(g3)
end end
if f then g1=g1:Filter(f,nil,...) end if f then g1=g1:Filter(f,nil,...) end
if gc then g1:RemoveCard(gc) end if gc then g1:RemoveCard(gc) end
if e then g1=g1:Filter(Fus.NonImmuneFilter,nil,e) end if e then g1=g1:Filter(Fus.NonImmuneFilter,nil,e) end
return g1 return g1
end end
function Fus.CheckMaterialSingle(c,fc,mc) function Fus.CheckMaterialSingle(c,fc,mc)
local tp=fc:GetControler() local tp=fc:GetControler()
if not c:IsCanBeFusionMaterial(fc) or Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc),fc)<=0 then return false end if not c:IsCanBeFusionMaterial(fc) or Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc),fc)<=0 then return false end
local t=fc.hana_mat local t=fc.hana_mat
if not t then return false end if not t then return false end
for i,f in pairs(t) do for i,f in pairs(t) do
if f(c) then return true end if f(c) then return true end
end end
return false return false
end end
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Duel.LoadScript("nef/nef.lua") Duel.LoadScript("nef/nef.lua")
Duel.LoadScript("nef/msc.lua") Duel.LoadScript("nef/msc.lua")
Duel.LoadScript("nef/fus.lua") Duel.LoadScript("nef/fus.lua")
Duel.LoadScript("nef/ets.lua") Duel.LoadScript("nef/ets.lua")
Duel.LoadScript("nef/elf.lua") Duel.LoadScript("nef/elf.lua")
Duel.LoadScript("nef/dss.lua") Duel.LoadScript("nef/dss.lua")
Duel.LoadScript("nef/afi.lua") Duel.LoadScript("nef/afi.lua")
-- require "expansions/script/nef/nef" -- require "expansions/script/nef/nef"
-- require "expansions/script/nef/msc" -- require "expansions/script/nef/msc"
-- require "expansions/script/nef/fus" -- require "expansions/script/nef/fus"
-- require "expansions/script/nef/ets" -- require "expansions/script/nef/ets"
-- require "expansions/script/nef/elf" -- require "expansions/script/nef/elf"
-- require "expansions/script/nef/dss" -- require "expansions/script/nef/dss"
-- require "expansions/script/nef/afi" -- require "expansions/script/nef/afi"
-- require "nef/nef" -- require "nef/nef"
-- require "nef/msc" -- require "nef/msc"
-- require "nef/fus" -- require "nef/fus"
-- require "nef/ets" -- require "nef/ets"
-- require "nef/elf" -- require "nef/elf"
-- require "nef/dss" -- require "nef/dss"
-- require "nef/afi" -- require "nef/afi"
\ 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