Commit ee9029d7 authored by Tachibana's avatar Tachibana

ndyd

parent b63b8bb6
No preview for this file type
--2pick Maintenance Utility
c13959997={}
Duel.LoadScript("c13959997.lua")
tpu=c13959997
cl=c13959996
local cc=13959995
local this=_G["c"..cc]
function this.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_SET_AVAILABLE|EFFECT_FLAG_CANNOT_DISABLE|EFFECT_FLAG_CANNOT_INACTIVATE|EFFECT_FLAG_CANNOT_NEGATE|EFFECT_FLAG_DAMAGE_STEP|EFFECT_FLAG_DAMAGE_CAL|EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_DECK|LOCATION_HAND|LOCATION_MZONE|LOCATION_SZONE|LOCATION_GRAVE|LOCATION_REMOVED)
e1:SetOperation(this.op1)
c:RegisterEffect(e1)
end
function this.displayOnField(tp,g1,g2)
local cg1=Group.CreateGroup()
local cg2=Group.CreateGroup()
local ct1={}
local ct2={}
for k,v in pairs(g1) do
if k>10 then break end
local c=Duel.CreateToken(tp,v)
if k<=5 then
Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP_ATTACK,false,1<<(k-1))
else
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false,1<<(k-6))
end
cg1:AddCard(c)
ct1[c]=v
end
for k,v in pairs(g2) do
if k>10 then break end
local c=Duel.CreateToken(tp,v)
if k<=5 then
Duel.MoveToField(c,tp,1-tp,LOCATION_MZONE,POS_FACEUP_ATTACK,false,1<<(k-1))
else
Duel.MoveToField(c,tp,1-tp,LOCATION_SZONE,POS_FACEUP,false,1<<(k-6))
end
cg2:AddCard(c)
ct2[c]=v
end
return cg1,cg2,ct1,ct2
end
function this.op1(e,tp)
local ml,el,mat,eat=tpu.loadCardList(false,true)
Debug.Message("已从c13959996.lua加载卡表")
Debug.Message("主卡组数量:"..#ml)
Debug.Message("额外卡组数量:"..#el)
local quit=false
while not quit do
local opts={}
for i=0,8 do
opts[i+1]=aux.Stringid(cc,i)
end
local option=Duel.SelectOption(tp,table.unpack(opts))
if option==0 then
tpu.writeList(tpu.toList(tpu.toSet(ml)),"2pick/cardlist.main.txt")
tpu.writeList(tpu.toList(tpu.toSet(el)),"2pick/cardlist.extra.txt")
elseif option==1 then
ml=tpu.loadList("2pick/cardlist.main.txt")
el=tpu.loadList("2pick/cardlist.extra.txt")
elseif option==2 then
tpu.writeList(tpu.toList(tpu.loadSet(cl.BlackList)),"2pick/blacklist.txt")
elseif option==3 then
cl.BlackList=tpu.dumpSet(tpu.toSet(tpu.loadList("2pick/blacklist.txt")))
elseif option==4 then
tpu.writeList(tpu.toList(tpu.loadSet(cl.BanList)),"2pick/banlist.txt")
elseif option==5 then
cl.BanList=tpu.dumpSet(tpu.toSet(tpu.loadList("2pick/banlist.txt")))
elseif option==6 then
Debug.Message("正在刷新卡表……")
local nml={}
local nel={}
local nmat={}
local neat={}
for i=10000,99999999 do
local cc,ca,ctype=Duel.ReadCard(i,CARDDATA_CODE,CARDDATA_ALIAS,CARDDATA_TYPE)
if cc then
local dif=cc-ca
local real=0
if dif>-10 and dif<10 then
real=ca
else
real=cc
end
local at=0
if ctype&TYPE_TOKEN==0 then
if ctype&(TYPE_FUSION|TYPE_SYNCHRO|TYPE_XYZ|TYPE_LINK)>0 then
at=neat
else
at=nmat
end
if not at[real] then
at[real]={}
end
at[real][#at[real]+1]=cc
end
end
end
local bldelCount=0
local blldelCount=0
local ms=tpu.toSet(ml)
local es=tpu.toSet(el)
local bs=tpu.loadSet(cl.BanList)
local bls=tpu.loadSet(cl.BlackList)
local mdelta={}
local edelta={}
tpu.initSet(ms)
tpu.initSet(es)
tpu.initSet(bs)
tpu.initSet(bls)
for k,_ in pairs(nmat) do
nml[#nml+1]=k
if not ms:contains(k) then
mdelta[#mdelta+1]=k
else
ms:del(k)
end
end
for k,_ in pairs(neat) do
nel[#nel+1]=k
if not es:contains(k) then
edelta[#edelta+1]=k
else
es:del(k)
end
end
for _,v in pairs(tpu.toList(ms)) do
if bs:contains(v) then
bs:del(v)
bldelCount=bldelCount+1
end
if bls:contains(v) then
bls:del(v)
blldelCount=blldelCount+1
end
end
for _,v in pairs(tpu.toList(es)) do
if bs:contains(v) then
bs:del(v)
bldelCount=bldelCount+1
end
if bls:contains(v) then
bls:del(v)
blldelCount=blldelCount+1
end
end
Debug.Message("卡表扫描已完成")
Debug.Message("主卡组数量:"..#nml)
Debug.Message("额外卡组数量:"..#nel)
Debug.Message("主卡组新增:"..#mdelta)
Debug.Message("额外卡组新增:"..#edelta)
Debug.Message("主卡组删除:"..#tpu.toList(ms))
Debug.Message("额外卡组删除:"..#tpu.toList(es))
Debug.Message("黑名单删除:"..blldelCount)
Debug.Message("禁卡表删除:"..bldelCount)
if Duel.SelectYesNo(tp,aux.Stringid(cc,9)) then
Debug.Message("请选择需要加入黑名单的卡片")
local ct=1
local delta={}
table.move(mdelta,1,#mdelta,1,delta)
table.move(edelta,1,#edelta,#delta+1,delta)
while ct<=#delta do
local disp={}
table.move(delta,ct,ct+9,1,disp)
local cg1,_,ct1,_=this.displayOnField(tp,disp,{})
local sel=cg1:Select(tp,0,10,nil)
sel:ForEach(function(c)bls:add(ct1[c])end)
ct=ct+10
Duel.Exile(cg1,REASON_RULE)
end
Debug.Message("请选择需要加入禁卡表的卡片")
ct=1
while ct<=#delta do
local disp={}
table.move(delta,ct,ct+9,1,disp)
local cg1,_,ct1,_=this.displayOnField(tp,disp,{})
local sel=cg1:Select(tp,0,10,nil)
sel:ForEach(function(c)bs:add(ct1[c])end)
ct=ct+10
Duel.Exile(cg1,REASON_RULE)
end
else
tpu.writeList(mdelta,"2pick/delta.main.txt")
tpu.writeList(edelta,"2pick/delta.extra.txt")
Debug.Message("新增卡表已输出,请自行编辑黑名单和禁卡表")
end
ml=nml
el=nel
mat=nmat
eat=neat
cl.BlackList=tpu.dumpSet(bls)
cl.BanList=tpu.dumpSet(bs)
elseif option==7 then
local fml={}
local fel={}
tpu.initSet(fml)
tpu.initSet(fel)
for _,v in pairs(ml) do
for _,v2 in pairs(mat[v]) do
fml:add(v2)
end
end
for _,v in pairs(el) do
for _,v2 in pairs(eat[v]) do
fel:add(v2)
end
end
cl.Main=tpu.dumpSet(fml)
cl.Extra=tpu.dumpSet(fel)
local f=io.open("2pick/c13959996.lua","w")
f:write(this.template)
f:write("this.Main=\""..cl.Main.."\"\n")
f:write("this.Extra=\""..cl.Extra.."\"\n")
f:write("this.BlackList=\""..cl.BlackList.."\"\n")
f:write("this.BanList=\""..cl.BanList.."\"\n")
f:flush()
f:close()
elseif option==8 then
quit=true
end
end
end
this.template="--2pick Card List\n\nlocal cc=13959996\nlocal this=_G[\"c\"..cc]\n\nfunction this.initial_effect(c)\n\nend\n\n"
This diff is collapsed.
--2pick utilities
c13959996={}
Duel.LoadScript("c13959996.lua")
local cc=13959997
local this=_G["c"..cc]
function this.initial_effect(c)
end
function this.loadList(fname)
local result={}
local ct=1
for l in io.lines(fname) do
if l:sub(1,1)~="#" and tonumber(l) then
result[ct]=tonumber(l)
ct=ct+1
end
end
return result
end
function this.writeList(t,fname)
local f=io.open(fname,"w")
f:write(table.concat(t,"\n"))
f:flush()
f:close()
end
function this.toSet(t)
local result={}
for _,v in pairs(t) do
local cur=result
for i=1,#tostring(v) do
local c=tostring(v):sub(i,i)
if not cur[tonumber(c)] then
cur[tonumber(c)]={}
end
cur=cur[tonumber(c)]
if i==#tostring(v) then
cur[10]=true
end
end
end
return result
end
function this.toList(s)
local result={}
this.stol(s,result,"")
return result
end
function this.stol(s,t,prefix)
for i=0,9 do
if s[i] then
this.stol(s[i],t,prefix..i)
end
end
if s[10] then
t[#t+1]=tonumber(prefix)
end
end
function this.stostr(s)
local a="a"
local result=""
for i=0,9 do
if s[i] then
result=result..i
result=result..this.stostr(s[i])
result=result..")"
end
end
if s[10] then
result=result.."-"
end
return result
end
function this.dumpSet(s)
local result=this.stostr(s)
local cpr=""
local ct=0
local A="A"
for i=1,#result do
if result:sub(i,i)~=")" then
if ct~=0 then
cpr=cpr..string.char(A:byte()+ct-1)
ct=0
end
if result:sub(i,i)~="-" then
cpr=cpr..result:sub(i,i)
end
else
ct=ct+1
end
end
if ct~=0 then
cpr=cpr..string.char(A:byte()+ct-1)
end
return cpr
end
function this.loadSet(str)
local result={}
local stack={result}
local sp=1
for i=1,#str do
local c=str:sub(i,i)
local A=("A"):byte()
if c:byte()>=A then
stack[sp][10]=true
sp=sp-(c:byte()-A+1)
else
stack[sp][tonumber(c)]={}
stack[sp+1]=stack[sp][tonumber(c)]
sp=sp+1
end
end
return result
end
function this.contains(s,op)
local sop=tostring(op)
local cur=s
local found=false
for i=1,#sop do
if cur[tonumber(sop:sub(i,i))] then
cur=cur[tonumber(sop:sub(i,i))]
else
break
end
if i==#sop and cur[10] then
found=true
end
end
return found
end
function this.add(s,op)
local sop=tostring(op)
local cur=s
for i=1,#sop do
if not cur[tonumber(sop:sub(i,i))] then
cur[tonumber(sop:sub(i,i))]={}
end
cur=cur[tonumber(sop:sub(i,i))]
if i==#sop then
cur[10]=true
end
end
end
function this.del(s,op)
if not this.contains(s,op) then return end
local stack={s}
local sp=1
local sop=tostring(op)
for i=1,#sop do
stack[sp+1]=stack[sp][tonumber(sop:sub(i,i))]
sp=sp+1
end
stack[sp][10]=nil
while sp>1 do
local isEmpty=true
for i=0,10 do
if stack[sp][i] then
isEmpty=false
break
end
end
if isEmpty then
stack[sp-1][tonumber(sop:sub(sp-1,sp-1))]=nil
sp=sp-1
else
break
end
end
end
function this.initSet(s)
s.contains=this.contains
s.add=this.add
s.del=this.del
end
function this.loadCardList(useBanList,ignoreBlackList)
local cl=c13959996
local mainList=this.toList(this.loadSet(cl.Main))
local extraList=this.toList(this.loadSet(cl.Extra))
local ml={}
local el={}
local mat={}
local eat={}
for _,v in pairs(mainList) do
local ca=Duel.ReadCard(v,CARDDATA_ALIAS)
if not ca then
Debug.Message("警告!卡片"..v.."不存在,卡表可能需要更新!")
ca=0
end
local dif=ca-v
local real=0
if dif>-10 and dif<10 then
real=ca
else
real=v
end
if not mat[real] then
mat[real]={}
end
mat[real][#mat[real]+1]=v
end
for _,v in pairs(extraList) do
local ca=Duel.ReadCard(v,CARDDATA_ALIAS)
if not ca then
Debug.Message("警告!卡片"..v.."不存在,卡表可能需要更新!")
ca=0
end
local dif=ca-v
local real=0
if dif>-10 and dif<10 then
real=ca
else
real=v
end
if not eat[real] then
eat[real]={}
end
eat[real][#eat[real]+1]=v
end
local bl=this.loadSet(cl.BanList)
local bll=this.loadSet(cl.BlackList)
this.initSet(bl)
this.initSet(bll)
for k,_ in pairs(mat) do
if (ignoreBlackList or not bll:contains(k)) and (not useBanList or not bl:contains(k)) then
ml[#ml+1]=k
end
end
for k,_ in pairs(eat) do
if (ignoreBlackList or not bll:contains(k)) and (not useBanList or not bl:contains(k)) then
el[#el+1]=k
end
end
return ml,el,mat,eat
end
\ No newline at end of file
This diff is collapsed.
--平安时代的歌仙-小·町
local m=20100501
local cm=_G["c"..m]
Duel.LoadScript("c20100000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,20100500)
C9.KomachiMonster(c,m)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetCountLimit(1,m+2)
e1:SetLabel(0)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function cm.costfilter(c)
return c:IsSetCard(0x3c92) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() and not c:IsCode(m)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingTarget(Card.IsCode,tp,0,LOCATION_MZONE,1,nil,20100500)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
g:KeepAlive()
e:SetLabelObject(g)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
local sg0=Duel.SelectMatchingCard(tp,Card.IsCode,tp,0,LOCATION_MZONE,1,1,nil,20100500)
if #sg0==0 then return end
local tc=sg0:GetFirst()
if not tc:IsImmuneToEffect(e) then
local gc=e:GetLabelObject():GetFirst()
local m=_G["c"..gc:GetCode()]
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_TYPE)
e3:SetValue(TYPE_MONSTER+TYPE_EFFECT)
e3:SetReset(C9.S_Reset)
tc:RegisterEffect(e3,true)
local he=m.huyuurei_effect
he:SetReset(C9.S_Reset)
tc:RegisterEffect(he)
--splimit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e5:SetTargetRange(0,1)
e5:SetReset(C9.S_Reset)
e5:SetTarget(function(e,c) return not c:IsRace(RACE_PSYCHO) end)
local e6=e5:Clone()
e6:SetCode(EFFECT_CANNOT_SUMMON)
tc:RegisterEffect(e5)
tc:RegisterEffect(e6)
local id=gc:GetOriginalCode()
tc:RegisterFlagEffect(id,C9.S_Reset,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,0))
end
end
\ No newline at end of file
--困窘零落的船夫-小·町
local m=20100502
local cm=_G["c"..m]
Duel.LoadScript("c20100000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,20100500)
--huyuurei_effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e1:SetCondition(function (e,tp) return tp~=e:GetHandlerPlayer() end)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
cm.huyuurei_effect=e1
C9.KomachiMonster(c,m)
end
function cm.filter(c)
return c:IsSetCard(0x3c92) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--三途河的引路人-小·町
local m=20100504
local cm=_G["c"..m]
Duel.LoadScript("c20100000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,20100500)
--huyuurei_effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e1:SetCondition(function (e,tp) return tp~=e:GetHandlerPlayer() end)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
cm.huyuurei_effect=e1
C9.KomachiMonster(c,m)
end
function cm.filter(c)
return c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP) and aux.IsCodeListed(c,20100500)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--川雾里的摆渡人-小·町
local m=20100506
local cm=_G["c"..m]
Duel.LoadScript("c20100000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,20100500)
--huyuurei_effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetDescription(aux.Stringid(m,0))
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e1:SetCondition(function (e,tp) return tp~=e:GetHandlerPlayer() end)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
cm.huyuurei_effect=e1
C9.KomachiMonster(c,m)
end
function cm.GetFartherSequence(c,h) --获取c距离h最远的区域并返回序号,没有的场合返回false
local tp=h:GetControler()
local seq1=c:GetSequence()
local seq2=h:GetSequence()
local p=(seq1>seq2) and 1 or -1
for i = 2+2*p,seq1+p,-p do
if Duel.CheckLocation(tp,LOCATION_MZONE,i) then return i end
end
return false
end
function cm.GetCloserSequence(c,h) --获取c距离h最远的区域并返回序号,没有的场合返回false
local tp=h:GetControler()
local seq1=c:GetSequence()
local seq2=h:GetSequence()
local p=(seq1>seq2) and 1 or -1
for i = seq2+p, seq1-p,p do
if Duel.CheckLocation(tp,LOCATION_MZONE,i) then return i end
end
return false
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local closer=Duel.IsExistingMatchingCard(cm.GetCloserSequence,c:GetControler(),LOCATION_MZONE,0,1,c,c)
local farther=Duel.IsExistingMatchingCard(cm.GetFartherSequence,c:GetControler(),LOCATION_MZONE,0,1,c,c)
if chk==0 then return closer or farther end
local a=0
if not closer then a=1 end
if closer and farther and Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))==1 then a=1 end
e:SetLabel(a)
end
function cm.opfilter(c)
return c:GetSequence()<=4
end
function cm.GetDistance(c,h)
return math.abs(c:GetSequence()-h:GetSequence())
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local op=e:GetLabel()
local p=c:GetControler()
local mg=Duel.GetMatchingGroup(cm.opfilter,p,LOCATION_MZONE,0,c)
if #mg==0 then return end
if op==0 then
while #mg>0 do
local tc=mg:GetMinGroup(cm.GetDistance,c):GetFirst()
local seq=cm.GetCloserSequence(tc,c)
if seq then
Duel.MoveSequence(tc,seq)
end
mg:RemoveCard(tc)
end
end
if op==1 then
while #mg>0 do
local tc=mg:GetMaxGroup(cm.GetDistance,c):GetFirst()
local seq=cm.GetFartherSequence(tc,c)
if seq then
Duel.MoveSequence(tc,seq)
end
mg:RemoveCard(tc)
end
end
end
\ No newline at end of file
--江户气质的死神-小·町
local m=20100508
local cm=_G["c"..m]
Duel.LoadScript("c20100000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,20100500)
--huyuurei_effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(cm.htg)
e1:SetValue(-2000)
cm.huyuurei_effect=e1
C9.KomachiMonster(c,m)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(cm.cost)
c:RegisterEffect(e3)
--Change types
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLED)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.con)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
end
function cm.htg(e,c)
return math.abs(e:GetHandler():GetSequence()-c:GetSequence())==1
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToBattle() then return false end
local bt=c:GetBattleTarget()
if not bt or bt:IsCode(20100500) then return false end
return bt:IsRelateToBattle() and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local at=c:GetBattleTarget()
if at and not at:IsCode(20100500) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
at:RegisterEffect(e1)
end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bt=c:GetBattleTarget()
if not c:IsRelateToBattle() or not bt:IsRelateToBattle() then return end
if not bt:IsImmuneToEffect(e) then
if bt:IsType(TYPE_EFFECT) then bt:ReplaceEffect(20100500,C9.S_Reset) end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(0)
e1:SetReset(C9.S_Reset)
bt:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
bt:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetValue(20100500)
e3:SetReset(C9.S_Reset)
bt:RegisterEffect(e3,true)
end
end
--引渡灵魂的舵手-小·町
local m=20100510
local cm=_G["c"..m]
Duel.LoadScript("c20100000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,20100500)
--huyuurei_effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(cm.htg)
cm.huyuurei_effect=e1
C9.KomachiMonster(c,m)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+1)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
end
function cm.htg(e,c)
return math.abs(e:GetHandler():GetSequence()-c:GetSequence())==1
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCode,tp,0,LOCATION_MZONE,1,nil,20100500) end
local hg=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_MZONE,nil,20100500)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,hg,hg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,#hg*1500)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local hg=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_MZONE,nil,20100500)
if #hg>0 then
local dc=Duel.Destroy(hg,REASON_EFFECT)
if dc>0 then
Duel.BreakEffect()
Duel.Damage(1-tp,dc*1500,REASON_EFFECT)
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetLabel(tp)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c,sump,sumtype,sumpos,targetp,se)
if targetp and targetp~=e:GetLabel() then return false end
return not c:IsRace(RACE_PSYCHO)
end)
e1:SetReset(C9.E_Reset)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e2,tp)
end
\ No newline at end of file
--彼远端的领航者-小·町
local m=20100512
local cm=_G["c"..m]
Duel.LoadScript("c20100000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,20100500)
--huyuurei_effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetTarget(cm.htg)
e1:SetValue(1)
cm.huyuurei_effect=e1
C9.KomachiMonster(c,m)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,m+1)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
end
function cm.htg(e,c)
return math.abs(e:GetHandler():GetSequence()-c:GetSequence())==1
end
function cm.filter(c,tp,x1,y1)
if c:IsLocation(LOCATION_FZONE) then return false end
local x,y=C9.GetCoordinate(c,tp)
return (math.abs(x-x1)+math.abs(y-y1))==1
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsCode(20100500) and chkc:IsControler(1-tp) and chkc:IsCanBeEffectTarget(e) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(Card.IsCode,tp,0,LOCATION_MZONE,1,nil,20100500) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sh=Duel.SelectTarget(tp,Card.IsCode,tp,0,LOCATION_MZONE,1,1,nil,20100500)
local x,y=C9.GetCoordinate(sh:GetFirst(),tp)
local ng=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,nil,tp,x,y)
ng:Merge(sh)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,ng,ng:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local hc=Duel.GetFirstTarget()
C9.RE_Check(hc,e)
local x,y=C9.GetCoordinate(hc,tp)
local ng=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,nil,tp,x,y)
ng:Merge(hc)
if Duel.Destroy(ng,REASON_EFFECT)>0 then
Duel.BreakEffect()
Duel.Damage(1-tp,800,REASON_EFFECT)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetLabel(tp)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c,sump,sumtype,sumpos,targetp,se)
if targetp and targetp~=e:GetLabel() then return false end
return not c:IsRace(RACE_PSYCHO)
end)
e1:SetReset(C9.E_Reset)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e2,tp)
end
\ No newline at end of file
--浮·生·尽·头·皆·小·町
local m=20100514
local cm=_G["c"..m]
Duel.LoadScript("c20100000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,20100500)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--sp from GY
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(m)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(1,0)
c:RegisterEffect(e4)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(cm.idcon)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
c:RegisterEffect(e3)
end
function cm.filter(c)
return c:IsSetCard(0x3c92) and c:IsAbleToGrave()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
function cm.idcon(e)
return Duel.IsExistingMatchingCard(Card.IsCode,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil,20100500)
end
\ No newline at end of file
--地狱『无间之狭间』
local m=20100516
local cm=_G["c"..m]
Duel.LoadScript("c20100000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,20100500)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.GetAdjacentZone(c,op)
if not c:IsLocation(LOCATION_ONFIELD) then return nil end
local zone=0
local seq=c:GetSequence()
if seq>4 then return nil end
if seq>0 then zone=zone | 2^(seq-1) end
if seq<4 then zone=zone | 2^(seq+1) end
if c:IsLocation(LOCATION_SZONE) then zone=zone<<8 end
if op then zone=zone<<16 end
return zone
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tpl=Duel.GetTurnPlayer()
local ct=2
if tpl==tp then ct=3 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_MUST_USE_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetLabel(tp)
e1:SetValue(cm.frcval)
e1:SetReset(C9.E_Reset,ct)
Duel.RegisterEffect(e1,tp)
end
function cm.frcval(e,c,fp,rp,r)
local p=e:GetLabel()
if rp==p then return 0xffffff end
local hg=Duel.GetMatchingGroup(Card.IsCode,p,0,LOCATION_MZONE,nil,20100500)
if #hg==0 then return 0xffffffff end
local zone=0
local hc=hg:GetFirst()
local a,b=false,false
while hc do
local z1=cm.GetAdjacentZone(hc,true)
zone=zone | z1
local seq=hc:GetSequence()
if seq>0 and Duel.CheckLocation(1-p,LOCATION_MZONE,seq-1) then a=true end
if seq<4 and Duel.CheckLocation(1-p,LOCATION_MZONE,seq+1) then b=true end
hc=hg:GetNext()
end
if a or b then
return zone | 0x600060
else
return 0xffffffff
end
end
\ No newline at end of file
--魂符『魂之游戏』
local m=20100517
local cm=_G["c"..m]
Duel.LoadScript("c20100000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,20100500)
--act in hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetCondition(function(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_EXTRA,0)==0
end)
c:RegisterEffect(e1)
--move
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCategory(CATEGORY_DISABLE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsCode(20100500) end
if chk==0 then return Duel.IsExistingTarget(Card.IsCode,tp,0,LOCATION_MZONE,1,nil,20100500)
and Duel.GetLocationCount(1-tp,LOCATION_MZONE,PLAYER_NONE,0)>0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg=Duel.SelectTarget(tp,Card.IsCode,tp,0,LOCATION_MZONE,1,1,nil,20100500)
end
function cm.dfilter(c,seq1,seq2)
if c:IsDisabled() or c:IsType(TYPE_NORMAL) then return false end
return C9.IsBetween(c:GetSequence(),seq1,seq2)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or Duel.GetLocationCount(1-tp,LOCATION_MZONE,PLAYER_NONE,0)<1 then return end
if tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,0,LOCATION_MZONE,0)
local nseq=math.log(s,2)-16
local seq1=tc:GetSequence()
Duel.MoveSequence(tc,nseq)
local seq2=tc:GetSequence()
if seq1~=seq2 then
Duel.BreakEffect()
local dg=Duel.GetMatchingGroup(cm.dfilter,tp,0,LOCATION_MZONE,nil,seq1,seq2)
local nc=dg:GetFirst()
while nc do
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(C9.S_Reset)
nc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
nc:RegisterEffect(e2)
if nc:IsType(TYPE_TRAPMONSTER) then
local e3=e1:Clone()
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
nc:RegisterEffect(e3)
end
nc=dg:GetNext()
end
end
end
--死符『区别死者之镰』
local m=20100518
local cm=_G["c"..m]
Duel.LoadScript("c20100000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,20100500)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
end
function cm.filter2(c,tp,x1,y1,distance)
if c:IsLocation(LOCATION_FZONE) then return false end
local x,y=C9.GetCoordinate(c,tp)
return (math.abs(x-x1)+math.abs(y-y1))==distance
end
function cm.filter1(c,tp,distance)
if not c:IsCode(20100500) then return false end
local x,y=C9.GetCoordinate(c,tp)
return Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,tp,x,y,distance)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return end
if chk==0 then return Duel.IsExistingTarget(cm.filter1,tp,0,LOCATION_MZONE,1,nil,tp,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sh=Duel.SelectTarget(tp,cm.filter1,tp,0,LOCATION_MZONE,1,1,nil,tp,2)
local x,y=C9.GetCoordinate(sh:GetFirst(),tp)
local dg=Duel.GetMatchingGroup(cm.filter2,tp,0,LOCATION_ONFIELD,sh:GetFirst(),tp,x,y,2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,dg:GetCount(),0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
C9.RE_Check(tc,e)
local x,y=C9.GetCoordinate(tc,tp)
local dg=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,tc,tp,x,y,2)
local dg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,tc,tp,x,y,1)
if #dg>0 and Duel.Destroy(dg,REASON_EFFECT)>2 and #dg1>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Destroy(dg1,REASON_EFFECT)
end
end
--魂符『生魂流离之镰』
local m=20100519
local cm=_G["c"..m]
Duel.LoadScript("c20100000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,20100500)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return C9.SetCardCheck(chkc,0x3c92) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(C9.SetCardCheck,tp,LOCATION_MZONE,0,1,nil,0x3c92) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,C9.SetCardCheck,tp,LOCATION_MZONE,0,1,1,nil,0x3c92)
if Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_EXTRA,0)==0 and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(function (e,ep,tp) return tp==ep end)
end
end
function cm.actcon(e)
local c=e:GetHandler()
return (Duel.GetAttacker()==c or Duel.GetAttackTarget()==c) and e:GetOwnerPlayer()==e:GetHandlerPlayer()
end
function cm.aop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(m,C9.SE_Reset,0,1)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
C9.RE_Check(tc,e)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(C9.SE_Reset)
e1:SetValue(1400)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetCondition(cm.actcon)
e2:SetValue(1)
e2:SetReset(C9.SE_Reset)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_PIERCE)
e3:SetReset(C9.SE_Reset)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e4:SetValue(2)
e4:SetReset(C9.SE_Reset)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_ATTACK_ANNOUNCE)
e5:SetRange(LOCATION_MZONE)
e5:SetOperation(cm.aop)
e5:SetReset(C9.SE_Reset)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e6:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(function (e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetFlagEffect(m)==3 end)
e6:SetOperation(function (e,tp,eg,ep,ev,re,r,rp) Duel.ChangeBattleDamage(ep,ev+2000) end)
e6:SetReset(C9.SE_Reset)
C9.RegisterEffect_Batch(tc,e1,e2,e3,e4,e5,e6)
end
--脱魂的仪式
local m=20100520
local cm=_G["c"..m]
Duel.LoadScript("c20100000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,20100500)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_CONTROL)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.filter1(c,tp)
local seq=c:GetSequence()
return c:IsCode(20100500) and Duel.IsExistingMatchingCard(cm.filter2,tp,0,LOCATION_MZONE,2,c,seq)
end
function cm.filter2(c,seq)
if c:GetSequence()>4 then return false end
return math.abs(c:GetSequence()-seq)==1
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local hg=Duel.GetMatchingGroup(cm.filter1,tp,0,LOCATION_MZONE,nil,tp)
local tc=hg:GetFirst()
local cg=Group.CreateGroup()
while tc do
local ng=Duel.GetMatchingGroup(cm.filter2,tp,0,LOCATION_MZONE,tc,tc:GetSequence())
cg:Merge(ng)
tc=hg:GetNext()
end
local ccg=cg:FilterCount(Card.IsControlerCanBeChanged,nil)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)>0 and #hg>0 and ccg>0 end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,cg,1,0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local cz=Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)
local hg=Duel.GetMatchingGroup(cm.filter1,tp,0,LOCATION_MZONE,nil,tp)
if #hg*cz<1 then return end
local tc=hg:GetFirst()
local cg=Group.CreateGroup()
while tc do
local ng=Duel.GetMatchingGroup(cm.filter2,tp,0,LOCATION_MZONE,tc,tc:GetSequence())
cg:Merge(ng)
tc=hg:GetNext()
end
local ccg=cg:Filter(Card.IsControlerCanBeChanged,nil)
local ct=math.min(#ccg,cz)
if ct>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local scg=ccg:Select(tp,1,ct,nil)
Duel.GetControl(scg,tp)
end
end
\ No newline at end of file
--投钱『隔夜钱』
local m=20100521
local cm=_G["c"..m]
Duel.LoadScript("c20100000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,20100500)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.cfilter(c)
return aux.IsCodeListed(c,20100500) and c:IsAbleToGraveAsCost()
end
function cm.sfilter(c)
return aux.IsCodeListed(c,20100500) and c:IsAbleToHand()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,e:GetHandler())
Duel.SendtoGrave(sg,REASON_COST)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.sfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
if chk==0 then return g:GetClassCount(Card.GetCode)>1 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK+LOCATION_GRAVE)
if Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_EXTRA,0)==0 and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(function(e,rp,tp) return tp==rp or not e:GetHandler():IsType(TYPE_MONSTER) end)
end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.sfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
if g:GetClassCount(Card.GetCode)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,tg1:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg2=g:Select(tp,1,1,nil)
tg1:Merge(tg2)
Duel.SendtoHand(tg1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg1)
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