Commit fe8a298c authored by wyykak's avatar wyykak

change newline

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