Commit d9b8d63f authored by wyykak's avatar wyykak

remove useless files

Signed-off-by: wyykak's avatarwyykak <wyy_1414@126.com>
parent 6d0ba635
Pipeline #29055 passed with stage
in 20 seconds
This diff is collapsed.
--
Gds={}
--
local Gdslist = {}
local Gdsflag=86300000
local Gdsflag2=86400000
--梦符自定义时点
function Gds.Adjustdreamsequence(c)
if Gds.Adjustdream == nil then
Gds.Adjustdream = true
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e1:SetOperation(Gds.dsop)
Duel.RegisterEffect(e1,0)
local e2=Effect.GlobalEffect()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetOperation(Gds.dsop2)
Duel.RegisterEffect(e2,0)
end
end
function Gds.dsop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(0,Gdsflag)>0 then return end
Duel.RegisterFlagEffect(0,Gdsflag,RESET_PHASE+PHASE_END,0,1)
local g=Duel.GetMatchingGroup(aux.TRUE,0,0xff,0xff,nil)
if g:GetCount()>0 then
local gc=g:GetCount()
for i=1,gc do
Gdslist[i]={}
end
local tc=g:GetFirst()
local ti=1
while tc do
Gdslist[ti][1]=tc
Gdslist[ti][2]=tc:GetSequence()
Gdslist[ti][3]=tc:GetFieldID()
tc:RegisterFlagEffect(Gdsflag+ti,RESET_PHASE+PHASE_END,0,1)
ti=ti+1
tc=g:GetNext()
end
end
end
function Gds.dsop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(0,Gdsflag)<=0 then return end
local g=Duel.GetMatchingGroup(aux.TRUE,0,LOCATION_DECK,LOCATION_DECK,nil):Filter(Card.IsOriginalSetCard,nil,0x279)
local tc=g:GetFirst()
while tc do
local ti=1
local ci=1
while ti>0 do
if tc:GetFlagEffect(Gdsflag+ti)>0 then
ci=ti
ti=0
else
ti=ti+1
end
end
local seq=tc:GetSequence()
local fid=tc:GetFieldID()
local dtseq=Duel.GetFieldGroupCount(tc:GetControler(),LOCATION_DECK,0)-1
if seq==0 and seq~=Gdslist[ci][2] and fid==Gdslist[ci][3] and tc:IsLocation(LOCATION_DECK) then
Duel.RaiseEvent(tc,EVENT_CUSTOM+86379010,e,0,0,tc:GetControler(),seq)
end
if seq==dtseq and seq~=Gdslist[ci][2] and fid==Gdslist[ci][3] and tc:IsLocation(LOCATION_DECK) then
tc:RegisterFlagEffect(Gdsflag2,RESET_EVENT+0x1fe0000,0,1)
if tc:GetFlagEffect(Gdsflag2)<2 then
Duel.RaiseEvent(tc,EVENT_CUSTOM+86379010,e,0,0,tc:GetControler(),seq)
end
end
if seq~=dtseq then
if tc:GetFlagEffect(Gdsflag2)>0 then
tc:ResetFlagEffect(Gdsflag2)
end
end
Gdslist[ci][2]=tc:GetSequence()
Gdslist[ci][3]=tc:GetFieldID()
tc=g:GetNext()
end
end
--检查卡组中公开的卡
function Gds.Checkdeckpublic(c)
if Gds.Checkdeck == nil then
Gds.Checkdeck = true
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86379011,2))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_DECK)
e1:SetCondition(Gds.cdpcon)
e1:SetOperation(Gds.cdpop)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetTargetRange(LOCATION_DECK,LOCATION_DECK)
e2:SetTarget(Gds.efcdptg)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,0)
end
end
function Gds.cdpcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local c=e:GetHandler()
return Duel.GetCurrentChain()==0 and (c:IsFaceup() or Duel.IsPlayerAffectedByEffect(tp,31027))
end
function Gds.cdpfilter(c)
return c:IsFaceup() or Duel.IsPlayerAffectedByEffect(c:GetControler(),31027)
end
function Gds.cdpop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(Gds.cdpfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
end
end
function Gds.efcdptg(e,c)
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(Gds.cdpfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()<=0 then return false end
return g:IsContains(c)
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
elseif c:IsOriginalSetCard(0x226,0x703) then
return 86379009
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
--
Afi={}
--AFI
local AFI = false
EVENT_ADJ_LOC = 2000
EVENT_ADJ_ATK = 2001
EVENT_ADJ_DEF = 2002
EVENT_ADJ_LEV = 2003
EVENT_ADJ_RANK = 2004
EVENT_ADJ_RACE = 2005
EVENT_ADJ_ATTR = 2006
EVENT_ADJ_DISABLE = 2007
local ms = {}
ms[0] = {}
ms[1] = {}
for i = 0, 6 do
ms[0][i] = {}
ms[1][i] = {}
end
local lasts = {}
function Afi.AdjustFieldInfoStore(c)
if AFI == true then return end
AFI = true
--store
local g=Group.CreateGroup()
g:KeepAlive()
--adjust
local e0 = Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetCode(EVENT_ADJUST)
e0:SetOperation(Afi.AdjustFieldInfoCheck)
e0:SetLabelObject(g)
Duel.RegisterEffect(e0, 0)
end
function Afi.AdjustFieldInfoCheck(e,tp,eg,ep,ev,re,r,rp)
--define
local g = Duel.GetMatchingGroup(aux.TRUE, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
local preg = e:GetLabelObject()
if g:GetCount()>0 then
--check
Afi.AdjustFieldInfoCheckMI(g, preg, e)
--renew
preg:Clear()
preg:Merge(g)
Afi.AdjustFieldInfoRenewMI(g)
else
if preg:GetCount()==0 then return end
preg:Clear()
end
end
function Afi.AdjustFieldInfoCheckMI(g, preg, e)
local n = -1 -- now seq
local p = -1 -- now player
local pn = -1 -- pre seq
local pp = -1 -- pre player
local tempg1 = {} -- up group(newVal > oldVal or cannot compare)
local tempg2 = {} -- down group(newVal < oldVal)
local isChange = not g:Equal(preg)
for i = 0, 7 do
tempg1[i] = Group.CreateGroup()
tempg2[i] = Group.CreateGroup()
end
local tempc = g:GetFirst()
while(tempc) do
p = tempc:GetControler()
n = tempc:GetSequence()
if preg:IsContains(tempc) then
pp, pn = Afi.AdjustFieldInfoFindMI(tempc)
if pp < 0 or pn < 0 or ms[pp][pn][-1] ~= tempc:GetFieldID() then
-- do nothing
else
if n ~= pn and p == pp then
Duel.RaiseSingleEvent(tempc, EVENT_ADJ_LOC, e, 0, 0, 0, pn)
tempg1[0]:AddCard(tempc)
end
--
local attack = ms[pp][pn][1]
if attack ~= tempc:GetAttack() then
Duel.RaiseSingleEvent(tempc, EVENT_ADJ_ATK, e, 0, 0, 0, attack)
if attack < tempc:GetAttack() then
tempg1[1]:AddCard(tempc)
else
tempg2[1]:AddCard(tempc)
end
end
--
local def = ms[pp][pn][2]
if def ~= tempc:GetDefense() then
Duel.RaiseSingleEvent(tempc, EVENT_ADJ_DEF, e, 0, 0, 0, def)
if def < tempc:GetDefense() then
tempg1[2]:AddCard(tempc)
else
tempg2[2]:AddCard(tempc)
end
end
--
local lv = ms[pp][pn][3]
if lv ~= tempc:GetLevel() then
Duel.RaiseSingleEvent(tempc, EVENT_ADJ_LEV, e, 0, 0, 0, lv)
if lv < tempc:GetLevel() then
tempg1[3]:AddCard(tempc)
else
tempg2[3]:AddCard(tempc)
end
end
--
local rank = ms[pp][pn][4]
if rank ~= tempc:GetRank() then
Duel.RaiseSingleEvent(tempc, EVENT_ADJ_RANK, e, 0, 0, 0, rank)
if rank < tempc:GetRank() then
tempg1[4]:AddCard(tempc)
else
tempg2[4]:AddCard(tempc)
end
end
--
local race = ms[pp][pn][5]
if race ~= tempc:GetRace() then
Duel.RaiseSingleEvent(tempc, EVENT_ADJ_RACE, e, 0, 0, 0, race)
tempg1[5]:AddCard(tempc)
end
--
local attr = ms[pp][pn][6]
if attr ~= tempc:GetAttribute() then
Duel.RaiseSingleEvent(tempc, EVENT_ADJ_ATTR, e, 0, 0, 0, attr)
tempg1[6]:AddCard(tempc)
end
--
local disable = ms[pp][pn][7]
if disable ~= tempc:IsDisabled() then
if tempc:IsDisabled() then
Duel.RaiseSingleEvent(tempc, EVENT_ADJ_DISABLE, e, 0, 0, 0, 1)
else
Duel.RaiseSingleEvent(tempc, EVENT_ADJ_DISABLE, e, 0, 0, 0, 2)
end
if disable == false then
tempg1[7]:AddCard(tempc)
else
tempg2[7]:AddCard(tempc)
end
end
end
end
tempc = g:GetNext()
end
for i = 0, 7 do
if tempg1[i]:GetCount() > 0 then
Duel.RaiseEvent(tempg1[i], 2000+i, e, 0, 0, 0, 1)
isChange = true
end
if tempg2[i]:GetCount() > 0 then
Duel.RaiseEvent(tempg2[i], 2000+i, e, 0, 0, 0, 2)
isChange = true
end
end
if isChange then
lasts = Nef.DeepCopy(ms)
end
end
function Afi.AdjustFieldInfoRenewMI(g)
local n = -1
local p = -1
for i = 0, 6 do
ms[0][i][0] = nil
ms[1][i][0] = nil
end
tempc = g:GetFirst()
while(tempc) do
n = tempc:GetSequence()
p = tempc:GetControler()
ms[p][n][0] = tempc
ms[p][n][-1] = tempc:GetFieldID()
ms[p][n][1] = tempc:GetAttack()
ms[p][n][2] = tempc:GetDefense()
ms[p][n][3] = tempc:GetLevel()
ms[p][n][4] = tempc:GetRank()
ms[p][n][5] = tempc:GetRace()
ms[p][n][6] = tempc:GetAttribute()
ms[p][n][7] = tempc:IsDisabled()
tempc = g:GetNext()
end
end
function Afi.AdjustFieldInfoFindMI(c)
local i, j
for i = 0, 1 do
for j = 0, 6 do
if ms[i][j][0] == c then return i, j end
end
end
return -1, -1
end
function Afi.AFIFindLastMI(c)
local i, j
for i = 0, 1 do
for j = 0, 6 do
if lasts[i][j][0] == c then return i, j end
end
end
return -1, -1
end
\ No newline at end of file
This diff is collapsed.
--dark synchro summon
DS = {}
function DS.AddDarkSynchroProcedure(c,f1,f2,dslv)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(DS.syncon(f1,f2,dslv))
e1:SetTarget(DS.syntg(f1,f2,dslv))
e1:SetOperation(DS.synop(f1,f2,dslv))
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
end
function DS.AddDarkSynchroProcedureWithDesc(c,f1,f2,dslv,desc)
local e1=Effect.CreateEffect(c)
e1:SetDescription(desc)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(DS.syncon(f1,f2,dslv))
e1:SetTarget(DS.syntg(f1,f2,dslv))
e1:SetOperation(DS.synop(f1,f2,dslv))
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
end
--dark synchro summon
--暗黑调整过滤
function DS.matfilter1(c,syncard,f1)
return c:IsSetCard(0x6208) and c:IsType(TYPE_TUNER) and c:IsFaceup() and c:IsCanBeSynchroMaterial(syncard) and (not f1 or f1(c))
end
--非调整过滤
function DS.matfilter2(c,syncard,f2)
return c:IsFaceup() and c:IsCanBeSynchroMaterial(syncard) and not c:IsType(TYPE_TUNER) and (not f2 or f2(c))
end
function DS.selfilter(c,syncard,lv,f1,f2,smg)
return DS.matfilter1(c,syncard,f1) and smg:IsExists(DS.selfilter2,1,c,syncard,c:GetSynchroLevel(syncard)-lv,c,f2)
end
function DS.selfilter2(c,syncard,lv,tuner,f2)
local tp=syncard:GetControler()
local clv=c:GetSynchroLevel(syncard)
if c:GetFlagEffect(30000)>0 then
clv=-clv
end
return DS.matfilter2(c,syncard,f2) and clv==lv and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,tuner),syncard)>0
end
function DS.syncon(f1,f2,dslv)
return function (e,c,tuner,mg)
if c==nil then return true end
local tp=c:GetControler()
local smg=mg
if not smg then
smg=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil)
end
local lv=dslv or c:GetLevel()
if tuner then
return DS.selfilter(tuner,c,lv,f1,f2,smg)
else
return smg:IsExists(DS.selfilter,1,nil,c,lv,f1,f2,smg)
end
end
end
function DS.syntg(f1,f2,dslv)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,tuner,mg)
local smg=mg
if not smg then
smg=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil)
end
local lv = dslv or c:GetLevel()
--选择调整
local tc
if not (tuner and DS.selfilter(tuner,c,lv,f1,f2,smg)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
tc=smg:FilterSelect(tp,DS.selfilter,1,1,nil,c,lv,f1,f2,smg):GetFirst()
else
tc=tuner
end
if not tc then return false end
--选择非调整
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local ntc=smg:FilterSelect(tp,DS.selfilter2,1,1,tc,c,tc:GetSynchroLevel(c)-lv,tc,f2):GetFirst()
if ntc then
local g=Group.FromCards(tc,ntc)
g:KeepAlive()
e:SetLabelObject(g)
return true
else
return false
end
end
end
function DS.synop(f1,f2,dslv)
return function (e,tp,eg,ep,ev,re,r,rp,c,tuner,mg)
local g=e:GetLabelObject()
c:SetMaterial(g)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_RULE)
g:DeleteGroup()
end
end
--黑暗同调怪兽通用限制
function DS.DarkSynLimit(c)
--cannot xyz
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
c:RegisterEffect(e1)
--cannot synchro
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e2)
end
--黑暗同调怪兽通用限制2(可做黑暗同调素材使用,黑暗同调黑暗调整
function DS.DarkSynTunerLimit(c)
--cannot xyz
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
c:RegisterEffect(e1)
--cannot synchro
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e2:SetValue(DS.synlimit)
c:RegisterEffect(e2)
end
--黑暗调整怪兽通用限制
function DS.DarkTunerLimit(c)
--synchro summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(DS.synlimit)
c:RegisterEffect(e1)
end
--synlimit
function DS.synlimit(e,c)
if c and not c:IsSetCard(0x5208) then return true end
end
--高级黑暗同调怪兽不能用同调以外方法特殊召唤及特招不会被无效属性
function DS.CantSp(c)
--cannot special summon
local e3=Effect.CreateEffect(c)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
e3:SetValue(aux.FALSE)
c:RegisterEffect(e3)
--CANNOT_DISABLE_SPSUMMON
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e4)
end
\ No newline at end of file
--
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
--
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
end
\ No newline at end of file
--
Msc={}
--mscarr
local mscarr = {}
local mscarr2 = {}
for i=0,7 do
mscarr[i] = {}
for j=0,7 do
mscarr[i][j] = 0
end
end
for i=0,5 do
mscarr2[i] = {}
for j=1,4 do
mscarr2[i][j] = 0
end
end
--
mscarr[1][5] = 888184
mscarr[1][6] = 888183
mscarr[2][5] = 888185
mscarr[5][6] = 888186
mscarr[2][3] = 888167
mscarr[3][4] = 888168
mscarr[0][3] = 888169
mscarr[1][2] = 888170
mscarr[1][3] = 888171
mscarr[2][4] = 888172
mscarr[0][2] = 888174
mscarr[0][1] = 888175
mscarr[0][4] = 888173
--mscarr[0][4] = 888176
--mscarr[0][4] = 888194
--
mscarr2[3][2] = 888136
mscarr2[2][2] = 888137
mscarr2[1][2] = 888138
mscarr2[0][2] = 888139
mscarr2[4][2] = 888140
mscarr2[3][3] = 888151
mscarr2[2][3] = 888152
mscarr2[1][3] = 888153
mscarr2[0][3] = 888154
mscarr2[4][3] = 888155
function unpack(t, i)
i = i or 1
if t[i] then
return t[i], unpack(t, i + 1)
end
end
function Msc.GetScSetCard(c1)
local sn1 = -1
if c1:IsSetCard(0x178) then sn1 = 3
elseif c1:IsSetCard(0x179) then sn1 = 2
elseif c1:IsSetCard(0x180) then sn1 = 1
elseif c1:IsSetCard(0x181) then sn1 = 0
elseif c1:IsSetCard(0x182) then sn1 = 4
elseif c1:IsSetCard(0x183) then sn1 = 5
elseif c1:IsSetCard(0x184) then sn1 = 6
elseif c1:GetOriginalCode()==22200 then sn1 = 7 end
return sn1
end
function Msc.IsCanMix2(c1,c2)
local sn1 = Msc.GetScSetCard(c1)
local sn2 = Msc.GetScSetCard(c2)
if sn1==7 or sn2==7 then return true end
if sn1<0 or sn1>6 then return false end
if sn2<0 or sn2>6 then return false end
if bit.bor(mscarr[sn1][sn2],mscarr[sn2][sn1])~=0 then return true end
return false
end
function Msc.GetMix2(c1,c2,tp)
local sn1 = Msc.GetScSetCard(c1)
local sn2 = Msc.GetScSetCard(c2)
local code = bit.bor(mscarr[sn1][sn2],mscarr[sn2][sn1])
if code == 888173 then
local temp = Duel.SelectOption(tp, 22200*16+10, 22200*16+11, 22200*16+12)
if temp == 0 then code = 888173
elseif temp == 1 then code = 888176
elseif temp == 2 then code = 888194
end
end
return code
end
function Msc.GetMix2or3(sn1,num,tp)
local code = mscarr2[sn1][num]
return code
end
function Msc.ScMix(g,tp)
local c1 = g:GetFirst()
local c2 = g:GetNext()
local code = Msc.GetMix2(c1,c2,tp)
local token=Duel.CreateToken(tp,code)
return token
end
function Msc.ScMix2(g,tp,flag)
local c1 = g:GetFirst()
local sn1 = Msc.GetScSetCard(c1)
local num = g:GetCount()
local code = Msc.GetMix2or3(sn1,num+flag,tp)
local token=Duel.CreateToken(tp,code)
return token
end
function Msc.ScMixWithLW(g,tp)
local c1 = g:GetFirst()
local sn1 = Msc.GetScSetCard(c1)
local code = 0
local temp = 0
local select_tabel_string = {}
local select_tabel_int = {}
local tabel_hpoint = 1
while temp<7 do
if bit.bor(mscarr[sn1][temp],mscarr[temp][sn1]) ~= 0 then
select_tabel_string[tabel_hpoint] = 22200*16+temp
select_tabel_int[tabel_hpoint] = temp
tabel_hpoint = tabel_hpoint + 1
end
temp = temp + 1
end
if tabel_hpoint>0 then
temp = Duel.SelectOption(tp, unpack(select_tabel_string))
temp = temp + 1
code = bit.bor(mscarr[sn1][select_tabel_int[temp]],mscarr[select_tabel_int[temp]][sn1])
if code == 888173 then
local temp2 = Duel.SelectOption(tp, 22200*16+10, 22200*16+11, 22200*16+12)
if temp2 == 0 then code = 888173
elseif temp2 == 1 then code = 888176
elseif temp2 == 2 then code = 888194
end
end
local token=Duel.CreateToken(tp,code)
return token
end
return 0
-- while code == 0 do
-- temp = Duel.SelectOption(tp, 22200*16+0, 22200*16+1, 22200*16+2, 22200*16+3, 22200*16+4, 22200*16+5, 22200*16+6)
-- code = bit.bor(mscarr[sn1][temp],mscarr[temp][sn1])
-- if code==0 then Duel.SelectOption(tp,22200*16+7) end
-- end
-- if code == 888173 then
-- local temp2 = Duel.SelectOption(tp, 22200*16+10, 22200*16+11, 22200*16+12)
-- if temp2 == 0 then code = 888173
-- elseif temp2 == 1 then code = 888176
-- elseif temp2 == 2 then code = 888194
-- end
-- end
-- local token=Duel.CreateToken(tp,code)
-- return token
end
function Msc.RegScMixEffect(c)
local e3=Effect.CreateEffect(c)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetDescription(aux.Stringid(22200,8))
e3:SetCountLimit(1)
e3:SetRange(LOCATION_SZONE)
e3:SetTarget(Msc.RegScMixEffectTarget)
e3:SetOperation(Msc.RegScMixEffectOperation)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetDescription(aux.Stringid(22200,9))
e4:SetTarget(Msc.RegScMixEffectTarget2)
e4:SetOperation(Msc.RegScMixEffectOperation2)
c:RegisterEffect(e4)
end
function Msc.RScMEdactfilter(c)
return c:IsFaceup() and c:IsSetCard(0x811)
end
function Msc.RScMEmfilter1(c,this_card)
return c:IsFaceup() and Msc.IsCanMix2(c,this_card)
end
function Msc.RScMEmfilter2(c,setcode)
local sn = Msc.GetScSetCard(c)
return c:IsFaceup() and (sn==setcode or sn==7)
end
function Msc.RScMEmfilterForTheLW(c)
return c:GetOriginalCode()==22200
end
function Msc.RegScMixEffectTarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local mq=Duel.IsExistingMatchingCard(Msc.RScMEdactfilter,tp,LOCATION_MZONE,0,1,nil)
if chk==0 then return (mq or Duel.CheckLPCost(tp,1000)) and
Duel.IsExistingMatchingCard(Msc.RScMEmfilter1,tp,LOCATION_SZONE,0,1,c,c) end
if not mq then
Duel.PayLPCost(tp,1000)
end
Duel.SetChainLimit(aux.FALSE)
end
function Msc.RegScMixEffectOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c then return end
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Msc.RScMEmfilter1,tp,LOCATION_SZONE,0,1,1,c,c)
if g:GetCount()>0 then g:AddCard(c) end
local flag = g:FilterCount(Msc.RScMEmfilterForTheLW,nil)
if flag==1 then
if Duel.SendtoGrave(g,REASON_MATERIAL)~=0 then
--if not e:GetHandler():GetActivateEffect():IsActivatable(tp) then return end
g:Remove(Msc.RScMEmfilterForTheLW,nil)
local tc = Msc.ScMixWithLW(g,tp)
if tc ~= 0 then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false)
Duel.ConfirmCards(1-tp,tc)
end
end
elseif flag==0 then
if Duel.SendtoGrave(g,REASON_MATERIAL)~=0 then
--if not e:GetHandler():GetActivateEffect():IsActivatable(tp) then return end
local tc = Msc.ScMix(g,tp)
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false)
Duel.ConfirmCards(1-tp,tc)
end
end
end
function Msc.RegScMixEffectTarget2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local sn=Msc.GetScSetCard(c)
local mq=Duel.IsExistingMatchingCard(Msc.RScMEdactfilter,tp,LOCATION_MZONE,0,1,nil)
if chk==0 then return (mq or Duel.CheckLPCost(tp,1000))
and sn>=0 and sn<=4
and Duel.IsExistingMatchingCard(Msc.RScMEmfilter2,tp,LOCATION_SZONE,0,1,c,sn) end
if not mq then
Duel.PayLPCost(tp,1000)
end
Duel.SetChainLimit(aux.FALSE)
end
function Msc.RegScMixEffectOperation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c then return end
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Msc.RScMEmfilter2,tp,LOCATION_SZONE,0,1,2,c,Msc.GetScSetCard(c))
if g:GetCount()>0 then g:AddCard(c) end
local flag = g:FilterCount(Msc.RScMEmfilterForTheLW,nil)
if flag==1 then g:Remove(Msc.RScMEmfilterForTheLW,nil) end
if Duel.SendtoGrave(g,REASON_MATERIAL)~=0 then
--if not e:GetHandler():GetActivateEffect():IsActivatable(tp) then return end
local tc = Msc.ScMix2(g,tp,flag)
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false)
Duel.ConfirmCards(1-tp,tc)
end
end
\ No newline at end of file
This diff is collapsed.
--
require "expansions/script/nef/nef"
Uds={}
local Udsflag = true
Uds.dataList = {}
Uds.cardList = {}
--rewrite
function Auxiliary.PreloadUds()
Uds.regCardData()
Uds.regSelectCard()
end
function Uds.regCardData()
-- Uds.dataList = {
-- [1] = {desc=aux.Stringid(37001,1), code=37001, cost=6},
-- [2] = {desc=aux.Stringid(37001,2), code=37002, cost=6},
-- [3] = {desc=aux.Stringid(37001,3), code=37003, cost=3},
-- [4] = {desc=aux.Stringid(37001,4), code=37004, cost=3},
-- [5] = {desc=aux.Stringid(37001,5), code=37005, cost=2},
-- [6] = {desc=aux.Stringid(37001,6), code=37006, cost=5},
-- [7] = {desc=aux.Stringid(37001,7), code=37007, cost=5},
-- [8] = {desc=aux.Stringid(37001,8), code=37008, cost=4},
-- [9] = {desc=aux.Stringid(37001,9), code=37009, cost=9},
-- [10] = {desc=aux.Stringid(37001,10), code=37010, cost=4},
-- }
Uds.dataList = {
[37001] = 6,
[37002] = 6,
[37003] = 3,
[37004] = 3,
[37005] = 2,
[37006] = 5,
[37007] = 5,
[37008] = 4,
[37009] = 9,
[37010] = 4,
[37011] = 3,
[37012] = 2,
}
end
function Uds.regSelectCard()
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_ADJUST)
-- e1:SetCode(EVENT_PHASE+PHASE_DRAW)
e1:SetOperation(Uds.rscop)
Duel.RegisterEffect(e1,0)
end
function Uds.rscop(e,tp,eg,ep,ev,re,r,rp)
--
if not Duel.SelectYesNo(tp,aux.Stringid(37000,2)) or not Duel.SelectYesNo(1-tp,aux.Stringid(37000,2)) then e:Reset()
return end
for k,v in pairs(Uds.dataList) do
local token0=Duel.CreateToken(0, k)
local token1=Duel.CreateToken(1, k)
Duel.Remove(token0,POS_FACEDOWN,REASON_RULE)
Duel.Remove(token1,POS_FACEDOWN,REASON_RULE)
end
local function checkCost(c, availableCost, trick)
local code = c:GetCode()
if code == 37000 then return trick < 2 end
return Uds.dataList[code] and Uds.dataList[code] <= availableCost
end
-- 初始选卡
for player=0,1 do
local availableCost=10
local trick = 0
while availableCost>0 do
if Duel.GetMatchingGroupCount(checkCost, player, LOCATION_REMOVED, 0, nil, availableCost, trick)>0 then
local g=Duel.SelectMatchingCard(player, checkCost, player, LOCATION_REMOVED, 0, 1, 1, nil, availableCost, trick)
local tc=g:GetFirst()
if tc:GetCode()~=37000 then
Uds.initCard(tc:GetCode(),player)
availableCost = availableCost - Uds.dataList[tc:GetCode()]
else
trick = trick + 1
end
else
availableCost = 0
end
end
-- -- 初始化table
-- local availableCost=10
-- local t={}
-- for k,v in pairs(Uds.dataList) do
-- t[k]=v
-- end
-- while availableCost>0 and #t>0 do
-- Duel.Hint(HINT_MESSAGE,player,aux.Stringid(37000,0))
-- local sel=Duel.SelectOption(player,Nef.unpackOneMember(t, "desc"))+1
-- local code=t[sel].code
-- Uds.initCard(code,player)
-- -- 维护table
-- availableCost=availableCost-t[sel].cost
-- for k=#t,1,-1 do
-- v=t[k]
-- if v.cost > availableCost then
-- table.remove(t, k)
-- end
-- end
-- end
-- local token=Duel.CreateToken(player,37000)
-- Duel.Remove(token,POS_FACEUP,REASON_RULE)
-- Duel.RaiseSingleEvent(e:GetHandler(),EVENT_REMOVE,e,REASON_RULE,player,player,0)
-- for i=1,2 do
-- if Duel.SelectYesNo(player,aux.Stringid(37000,1)) then
-- local token=Duel.CreateToken(player,37000)
-- Duel.Remove(token,POS_FACEDOWN,REASON_RULE)
-- end
-- end
end
--销毁本效果
e:Reset()
end
function Uds.initCard(code, player)
if Uds.cardList[code] == nil then
-- 初始化数据结构
Uds.cardList[code] = {}
Uds.cardList[code][0] = 0
Uds.cardList[code][1] = 0
end
-- 初始化符卡
-- local token=Duel.CreateToken(player,code)
-- Duel.Remove(token,POS_FACEDOWN,REASON_RULE)
-- 存储使用次数
Uds.cardList[code][player] = Uds.cardList[code][player] + 1
end
function Uds.regUdsEffect(e,code)
local e1=e:Clone()
e1:SetLabel(code)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetOperation(Uds.setop)
Duel.RegisterEffect(e1,0)
local e2=e1:Clone()
Duel.RegisterEffect(e2,1)
end
function Uds.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Uds.cardList[e:GetLabel()] == nil then return end -- 排除没有被初始化的符卡
if Uds.cardList[e:GetLabel()][e:GetOwnerPlayer()] < 1 then return end -- 该玩家发动次数不足
if not Duel.SelectYesNo(tp,aux.Stringid(e:GetLabel(),0)) then return end
-- 维护发动次数
Uds.cardList[e:GetLabel()][e:GetOwnerPlayer()] = Uds.cardList[e:GetLabel()][e:GetOwnerPlayer()] - 1
-- 创建符卡
local token=Duel.CreateToken(e:GetOwnerPlayer(),e:GetLabel())
Duel.MoveToField(token, e:GetOwnerPlayer(), e:GetOwnerPlayer(), LOCATION_SZONE, POS_FACEDOWN, false)
end
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