Commit 6a48ca8e authored by wyykak's avatar wyykak

update

parent 12980090
Pipeline #5965 passed with stages
in 25 minutes and 17 seconds
--Design/Image/Script: wyykak --Design/Image/Script: wyykak
c13959997={} c13959997={}
Duel.LoadScript("c13959997.lua") Duel.LoadScript("c13959997.lua")
local cc=13959998 local cc=13959998
local this=_G["c"..cc] local this=_G["c"..cc]
local rerollc={76815942,17994645,55863245,44155002,68319538,7391448,75326861,34408491,24221808,87460579,40939228,21123811} local rerollc={76815942,17994645,55863245,44155002,68319538,7391448,75326861,34408491,24221808,87460579,40939228,21123811}
this.maincount=40 this.maincount=40
this.extracount=20 this.extracount=20
this.useBanList=true this.useBanList=true
this.skillEnabled=false this.skillEnabled=false
this.CardList={} this.CardList={}
this.clCode=13959996 this.clCode=13959996
this.drawCount=5
function this.initial_effect(c)
if not this.gc then function this.initial_effect(c)
this.gc=true if not this.gc then
local e1=Effect.CreateEffect(c) this.gc=true
e1:SetType(EFFECT_TYPE_CONTINUOUS) local e1=Effect.CreateEffect(c)
e1:SetCode(EVENT_PHASE_START|PHASE_DRAW) e1:SetType(EFFECT_TYPE_CONTINUOUS)
e1:SetCondition(this.con) e1:SetCode(EVENT_PHASE_START|PHASE_DRAW)
e1:SetOperation(this.op) e1:SetCondition(this.con)
Duel.RegisterEffect(e1,0) e1:SetOperation(this.op)
local es1=Effect.CreateEffect(c) Duel.RegisterEffect(e1,0)
es1:SetType(EFFECT_TYPE_FIELD) local es1=Effect.CreateEffect(c)
es1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) es1:SetType(EFFECT_TYPE_FIELD)
es1:SetCode(EFFECT_SKIP_DP) es1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
es1:SetTargetRange(1,1) es1:SetCode(EFFECT_SKIP_DP)
es1:SetCondition(this.con1) es1:SetTargetRange(1,1)
Duel.RegisterEffect(es1,0) es1:SetCondition(this.con1)
local es2=es1:Clone() Duel.RegisterEffect(es1,0)
es2:SetCode(EFFECT_SKIP_SP) local es2=es1:Clone()
es2:SetCondition(this.con2) es2:SetCode(EFFECT_SKIP_SP)
Duel.RegisterEffect(es2,0) es2:SetCondition(this.con2)
local es3=es2:Clone() Duel.RegisterEffect(es2,0)
es3:SetCode(EFFECT_SKIP_M1) local es3=es2:Clone()
Duel.RegisterEffect(es3,0) es3:SetCode(EFFECT_SKIP_M1)
local es6=es1:Clone() Duel.RegisterEffect(es3,0)
es6:SetCode(EFFECT_CANNOT_BP) local es6=es1:Clone()
es6:SetCondition(this.con3) es6:SetCode(EFFECT_CANNOT_BP)
Duel.RegisterEffect(es6,0) es6:SetCondition(this.con3)
local es7=es2:Clone() Duel.RegisterEffect(es6,0)
es7:SetCode(EFFECT_CANNOT_ACTIVATE) local es7=es2:Clone()
es7:SetValue(aux.TRUE) es7:SetCode(EFFECT_CANNOT_ACTIVATE)
Duel.RegisterEffect(es7,0) es7:SetValue(aux.TRUE)
local es8=Effect.CreateEffect(c) Duel.RegisterEffect(es7,0)
es8:SetType(EFFECT_TYPE_FIELD) local es8=Effect.CreateEffect(c)
es8:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_IGNORE_RANGE) es8:SetType(EFFECT_TYPE_FIELD)
es8:SetTargetRange(0xff,0xff) es8:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_IGNORE_RANGE)
es8:SetCode(EFFECT_DISABLE) es8:SetTargetRange(0xff,0xff)
es8:SetCondition(this.con4) es8:SetCode(EFFECT_DISABLE)
Duel.RegisterEffect(es8,0) es8:SetCondition(this.con4)
local es9=es7:Clone() Duel.RegisterEffect(es8,0)
es9:SetCondition(this.con5) local es9=es7:Clone()
Duel.RegisterEffect(es9,0) es9:SetCondition(this.con5)
Duel.RegisterFlagEffect(0,cc,0,0,1) Duel.RegisterEffect(es9,0)
Duel.RegisterFlagEffect(1,cc,0,0,1) Duel.RegisterFlagEffect(0,cc,0,0,1)
local es10=es1:Clone() Duel.RegisterFlagEffect(1,cc,0,0,1)
es10:SetCode(EFFECT_DRAW_COUNT) local es10=es1:Clone()
es10:SetValue(0) es10:SetCode(EFFECT_DRAW_COUNT)
es10:SetCondition(this.con6) es10:SetValue(0)
Duel.RegisterEffect(es10,0) es10:SetCondition(this.con6)
end Duel.RegisterEffect(es10,0)
end end
end
function this.con6()
return this.isTag and Duel.GetTurnCount()==3 function this.con6()
end return this.isTag and Duel.GetTurnCount()==3
end
function this.con1()
return this.isTag and ({false,true,false,true,true})[Duel.GetTurnCount()] function this.con1()
end return this.isTag and ({false,true,false,true,true})[Duel.GetTurnCount()]
function this.con2() end
return this.isTag and ({true,true,true,true})[Duel.GetTurnCount()] function this.con2()
end return this.isTag and ({true,true,true,true})[Duel.GetTurnCount()]
function this.con3() end
return this.isTag and ({true,true,true,true,true})[Duel.GetTurnCount()] function this.con3()
end return this.isTag and ({true,true,true,true,true})[Duel.GetTurnCount()]
end
function this.con4()
return this.isPicking function this.con4()
end return this.isPicking
end
function this.con5()
return Duel.GetCurrentPhase()==PHASE_DRAW and (Duel.GetTurnCount()==1 or (this.isTag and Duel.GetTurnCount()==3)) function this.con5()
end return Duel.GetCurrentPhase()==PHASE_DRAW and (Duel.GetTurnCount()==1 or (this.isTag and Duel.GetTurnCount()==3))
end
function this.con()
return Duel.GetTurnCount()==1 or (this.isTag and Duel.GetTurnCount()==3) function this.con()
end return Duel.GetTurnCount()==1 or (this.isTag and Duel.GetTurnCount()==3)
end
function this.seed()
local g=Group.CreateGroup() function this.seed()
local gt={} local g=Group.CreateGroup()
for i=0,15 do local gt={}
local c=Duel.CreateToken(0,10000) for i=0,15 do
gt[c]=i local c=Duel.CreateToken(0,10000)
g:AddCard(c) gt[c]=i
end g:AddCard(c)
Duel.SendtoDeck(g,0,0,REASON_RULE) end
local result=0 Duel.SendtoDeck(g,0,0,REASON_RULE)
for i=0,7 do local result=0
result=result+(gt[g:RandomSelect(0,1):GetFirst()]<<(4*i)) for i=0,7 do
end result=result+(gt[g:RandomSelect(0,1):GetFirst()]<<(4*i))
Duel.Exile(g,REASON_RULE) end
g:DeleteGroup() Duel.Exile(g,REASON_RULE)
return result g:DeleteGroup()
end return result
end
function this.seed2()
local result=0 function this.seed2()
for i=0,31 do local result=0
result=result+(Duel.TossCoin(0,1)<<i) for i=0,31 do
end result=result+(Duel.TossCoin(0,1)<<i)
return result end
end return result
end
function this.seed3()
local result=0 function this.seed3()
local g=Duel.GetFieldGroup(0,0xff,0xff):RandomSelect(0,8) local result=0
local ct={} local g=Duel.GetFieldGroup(0,0xff,0xff):RandomSelect(0,8)
local c=g:GetFirst() local ct={}
for i=0,7 do local c=g:GetFirst()
ct[c]=i for i=0,7 do
c=g:GetNext() ct[c]=i
end c=g:GetNext()
for i=0,10 do end
result=result+(ct[g:RandomSelect(0,1):GetFirst()]<<(3*i)) for i=0,10 do
end result=result+(ct[g:RandomSelect(0,1):GetFirst()]<<(3*i))
g:DeleteGroup() end
return result&0xffffffff g:DeleteGroup()
end return result&0xffffffff
end
function this.saveDeck(tp)
if not this.deckList then function this.saveDeck(tp)
this.deckList={} if not this.deckList then
this.extraList={} this.deckList={}
end this.extraList={}
this.deckList[tp]={} end
this.extraList[tp]={} this.deckList[tp]={}
local dl=this.deckList[tp] this.extraList[tp]={}
local el=this.extraList[tp] local dl=this.deckList[tp]
Duel.GetMatchingGroup(function(c) return c:GetOriginalCode()~=cc end,tp,LOCATION_DECK|LOCATION_HAND,0,nil):ForEach(function(c) dl[#dl+1]=c:GetOriginalCode() end) local el=this.extraList[tp]
Duel.GetFieldGroup(tp,LOCATION_EXTRA,0):ForEach(function(c) el[#el+1]=c:GetOriginalCode() end) Duel.GetMatchingGroup(function(c) return c:GetOriginalCode()~=cc end,tp,LOCATION_DECK|LOCATION_HAND,0,nil):ForEach(function(c) dl[#dl+1]=c:GetOriginalCode() end)
end Duel.GetFieldGroup(tp,LOCATION_EXTRA,0):ForEach(function(c) el[#el+1]=c:GetOriginalCode() end)
end
function this.op(e,tp)
this.isPicking=true function this.op(e,tp)
if Duel.GetTurnCount()==1 then this.isPicking=true
math.randomseed(this.seed3()) if Duel.GetTurnCount()==1 then
end math.randomseed(this.seed3())
this.saveDeck(0) end
this.saveDeck(1) this.saveDeck(0)
Duel.Exile(Duel.GetFieldGroup(0,LOCATION_DECK|LOCATION_EXTRA|LOCATION_HAND,LOCATION_DECK|LOCATION_EXTRA|LOCATION_HAND),REASON_RULE) this.saveDeck(1)
if Duel.GetTurnCount()==1 then this.drawCount=Duel.GetFieldGroupCount(0,LOCATION_HAND,0)
this.isTag=Duel.SelectYesNo(0,aux.Stringid(cc,8)) Duel.Exile(Duel.GetFieldGroup(0,LOCATION_DECK|LOCATION_EXTRA|LOCATION_HAND,LOCATION_DECK|LOCATION_EXTRA|LOCATION_HAND),REASON_RULE)
if Duel.SelectYesNo(0,aux.Stringid(cc,2)) then if Duel.GetTurnCount()==1 then
Debug.Message("字段限制解除") this.isTag=Duel.SelectYesNo(0,aux.Stringid(cc,8))
this.setOverride() if Duel.SelectYesNo(0,aux.Stringid(cc,2)) then
end Debug.Message("字段限制解除")
if Duel.SelectYesNo(0,aux.Stringid(cc,4)) then this.setOverride()
Debug.Message("种族限制解除") end
this.raceOverride() if Duel.SelectYesNo(0,aux.Stringid(cc,4)) then
end Debug.Message("种族限制解除")
if Duel.SelectYesNo(0,aux.Stringid(cc,5)) then this.raceOverride()
Debug.Message("属性限制解除") end
this.attrOverride() if Duel.SelectYesNo(0,aux.Stringid(cc,5)) then
end Debug.Message("属性限制解除")
if Duel.SelectYesNo(0,aux.Stringid(cc,9)) then this.attrOverride()
Debug.Message("仪式强化已启用") end
this.ritualEnhance(e:GetHandler()) if Duel.SelectYesNo(0,aux.Stringid(cc,9)) then
end Debug.Message("仪式强化已启用")
if Duel.SelectYesNo(0,aux.Stringid(13959997,3)) then this.ritualEnhance(e:GetHandler())
this.skillEnabled=true end
Debug.Message("技能已启用") if Duel.SelectYesNo(0,aux.Stringid(13959997,3)) then
end this.skillEnabled=true
if Duel.SelectYesNo(0,aux.Stringid(cc,14)) then Debug.Message("技能已启用")
if Duel.SelectYesNo(0,aux.Stringid(13959997,0)) then end
this.maincount=Duel.AnnounceLevel(0,1,10)*10 if Duel.SelectYesNo(0,aux.Stringid(cc,14)) then
end if Duel.SelectYesNo(0,aux.Stringid(13959997,0)) then
if Duel.SelectYesNo(0,aux.Stringid(13959997,1)) then this.maincount=Duel.AnnounceLevel(0,1,10)*10
this.extracount=Duel.AnnounceLevel(0,1,10)*10 end
end if Duel.SelectYesNo(0,aux.Stringid(13959997,1)) then
this.useBanList=Duel.SelectYesNo(0,aux.Stringid(13959997,2)) this.extracount=Duel.AnnounceLevel(0,1,10)*10
if Duel.SelectYesNo(0,aux.Stringid(13959997,6)) then end
this.clCode=({13959996,13959994})[Duel.SelectOption(0,aux.Stringid(13959997,7),aux.Stringid(13959997,8))+1] this.useBanList=Duel.SelectYesNo(0,aux.Stringid(13959997,2))
end if Duel.SelectYesNo(0,aux.Stringid(13959997,6)) then
end this.clCode=({13959996,13959994})[Duel.SelectOption(0,aux.Stringid(13959997,7),aux.Stringid(13959997,8))+1]
this.option=Duel.SelectOption(0,aux.Stringid(cc,0),aux.Stringid(cc,1),aux.Stringid(cc,6),aux.Stringid(cc,7),aux.Stringid(cc,11),aux.Stringid(cc,10),aux.Stringid(13959997,4),aux.Stringid(13959997,5)) end
local n=0 end
if this.option==0 then this.option=Duel.SelectOption(0,aux.Stringid(cc,0),aux.Stringid(cc,1),aux.Stringid(cc,6),aux.Stringid(cc,7),aux.Stringid(cc,11),aux.Stringid(cc,10),aux.Stringid(13959997,4),aux.Stringid(13959997,5))
Debug.Message("本局决斗使用2pick规则") local n=0
this.f=function() this.twopick(this.maincount,this.extracount) end if this.option==0 then
elseif this.option==1 then Debug.Message("本局决斗使用2pick规则")
Debug.Message("本局决斗使用自定义轮抽规则(类MTG)") this.f=function() this.twopick(this.maincount,this.extracount) end
Duel.Hint(0,HINT_SELECTMSG,aux.Stringid(cc,3)) elseif this.option==1 then
n=Duel.AnnounceLevel(0,2,12) Debug.Message("本局决斗使用自定义轮抽规则(类MTG)")
this.f=function() this.custompick(this.maincount,this.extracount,n) end Duel.Hint(0,HINT_SELECTMSG,aux.Stringid(cc,3))
elseif this.option==2 then n=Duel.AnnounceLevel(0,2,12)
Debug.Message("本局决斗使用无竞争n选1规则") this.f=function() this.custompick(this.maincount,this.extracount,n) end
Duel.Hint(0,HINT_SELECTMSG,aux.Stringid(cc,3)) elseif this.option==2 then
n=Duel.AnnounceLevel(0,2,12) Debug.Message("本局决斗使用无竞争n选1规则")
this.f=function() this.npick(this.maincount,this.extracount,n) end Duel.Hint(0,HINT_SELECTMSG,aux.Stringid(cc,3))
elseif this.option==3 then n=Duel.AnnounceLevel(0,2,12)
Debug.Message("本局决斗使用整组2pick规则") this.f=function() this.npick(this.maincount,this.extracount,n) end
Duel.Hint(0,HINT_SELECTMSG,aux.Stringid(cc,3)) elseif this.option==3 then
n=Duel.AnnounceLevel(0,1,10) Debug.Message("本局决斗使用整组2pick规则")
this.f=function() this.twopickn(this.maincount,this.extracount,n) end Duel.Hint(0,HINT_SELECTMSG,aux.Stringid(cc,3))
elseif this.option==4 then n=Duel.AnnounceLevel(0,1,10)
Debug.Message("本局决斗使用全随机规则") this.f=function() this.twopickn(this.maincount,this.extracount,n) end
this.f=function() this.fullrandom(this.maincount,this.extracount) end elseif this.option==4 then
elseif this.option==5 then Debug.Message("本局决斗使用全随机规则")
Debug.Message("本局决斗使用20张场上轮选规则") this.f=function() this.fullrandom(this.maincount,this.extracount) end
Duel.Hint(0,HINT_SELECTMSG,aux.Stringid(cc,3)) elseif this.option==5 then
n=Duel.AnnounceLevel(0) Debug.Message("本局决斗使用20张场上轮选规则")
this.f=function() this.fpick(this.maincount,this.extracount,n) end Duel.Hint(0,HINT_SELECTMSG,aux.Stringid(cc,3))
elseif this.option==6 then n=Duel.AnnounceLevel(0)
Debug.Message("本局决斗使用部分随机规则") this.f=function() this.fpick(this.maincount,this.extracount,n) end
n=Duel.AnnounceLevel(0,1,10) elseif this.option==6 then
this.f=function() this.partialrandom(n) end Debug.Message("本局决斗使用部分随机规则")
elseif this.option==7 then n=Duel.AnnounceLevel(0,1,10)
Debug.Message("本局决斗使用部分卡组交换规则") this.f=function() this.partialrandom(n) end
n=Duel.AnnounceLevel(0,1,10) elseif this.option==7 then
this.f=function() this.swapmode(n) end Debug.Message("本局决斗使用部分卡组交换规则")
end n=Duel.AnnounceLevel(0,1,10)
end this.f=function() this.swapmode(n) end
this.f() end
Duel.ConfirmCards(0,Duel.GetFieldGroup(0,LOCATION_DECK,0)) end
Duel.ConfirmCards(1,Duel.GetFieldGroup(1,LOCATION_DECK,0)) this.f()
Duel.SelectMatchingCard(0,nil,0,LOCATION_EXTRA,0,0,99,nil) Duel.ConfirmCards(0,Duel.GetFieldGroup(0,LOCATION_DECK,0))
Duel.SelectMatchingCard(1,nil,1,LOCATION_EXTRA,0,0,99,nil) Duel.ConfirmCards(1,Duel.GetFieldGroup(1,LOCATION_DECK,0))
if this.skillEnabled then Duel.SelectMatchingCard(0,nil,0,LOCATION_EXTRA,0,0,99,nil)
Duel.SendtoDeck(Duel.CreateToken(0,Duel.AnnounceCard(0,0xe39,OPCODE_ISSETCARD)),0,0,REASON_RULE) Duel.SelectMatchingCard(1,nil,1,LOCATION_EXTRA,0,0,99,nil)
Duel.SendtoDeck(Duel.CreateToken(1,Duel.AnnounceCard(1,0xe39,OPCODE_ISSETCARD)),1,0,REASON_RULE) if this.skillEnabled then
end Duel.SendtoDeck(Duel.CreateToken(0,Duel.AnnounceCard(0,0xe39,OPCODE_ISSETCARD)),0,0,REASON_RULE)
Duel.ShuffleDeck(0) Duel.SendtoDeck(Duel.CreateToken(1,Duel.AnnounceCard(1,0xe39,OPCODE_ISSETCARD)),1,0,REASON_RULE)
Duel.ShuffleDeck(1) end
Duel.ShuffleExtra(0) Duel.ShuffleDeck(0)
Duel.ShuffleExtra(1) Duel.ShuffleDeck(1)
Duel.ShuffleExtra(0)
if not this.isTag or Duel.GetTurnCount()==5 then Duel.ShuffleExtra(1)
this.isPicking=false
end if not this.isTag or Duel.GetTurnCount()==5 then
Duel.Draw(0,5,REASON_RULE) this.isPicking=false
Duel.Draw(1,5,REASON_RULE) end
this.reroll(0) Duel.Draw(0,this.drawCount,REASON_RULE)
this.reroll(1) Duel.Draw(1,this.drawCount,REASON_RULE)
this.isPicking=false this.reroll(0)
Duel.ResetTimeLimit(0) this.reroll(1)
Duel.ResetTimeLimit(1) this.isPicking=false
end Duel.ResetTimeLimit(0)
Duel.ResetTimeLimit(1)
function this.ccGen(from,count) end
if not this.CardList.Main then
local ml,el,mat,eat=c13959997.loadCardList(this.useBanList,false,this.clCode) function this.ccGen(from,count)
this.CardList.Main=ml if not this.CardList.Main then
this.CardList.Extra=el local ml,el,mat,eat=c13959997.loadCardList(this.useBanList,false,this.clCode)
this.CardList.MainAliasTable=mat this.CardList.Main=ml
this.CardList.ExtraAliasTable=eat this.CardList.Extra=el
end this.CardList.MainAliasTable=mat
local g={} this.CardList.ExtraAliasTable=eat
for i=1,count do end
local temp=this.CardList[from][math.random(1,#this.CardList[from])] local g={}
local at=this.CardList[from.."AliasTable"] for i=1,count do
if #at[temp]>1 then local temp=this.CardList[from][math.random(1,#this.CardList[from])]
g[i]=at[temp][math.random(1,#at[temp])] local at=this.CardList[from.."AliasTable"]
else if #at[temp]>1 then
g[i]=temp g[i]=at[temp][math.random(1,#at[temp])]
end else
end g[i]=temp
return g end
end end
return g
function this.ccSelect(g,tp) end
local cg=Group.CreateGroup()
for k,v in pairs(g) do function this.ccSelect(g,tp)
local c=Duel.CreateToken(tp,v) local cg=Group.CreateGroup()
c:RegisterFlagEffect(cc,0,0,0,k) for k,v in pairs(g) do
cg:AddCard(c) local c=Duel.CreateToken(tp,v)
end c:RegisterFlagEffect(cc,0,0,0,k)
local result cg:AddCard(c)
if #cg>1 then end
result=cg:Select(tp,1,1,nil):GetFirst() local result
else if #cg>1 then
result=cg:GetFirst() result=cg:Select(tp,1,1,nil):GetFirst()
end else
table.remove(g,result:GetFlagEffectLabel(cc)) result=cg:GetFirst()
cg:DeleteGroup() end
return result table.remove(g,result:GetFlagEffectLabel(cc))
end cg:DeleteGroup()
return result
function this.twopick(mainc,extrac) end
local count=0
while count<mainc do function this.twopick(mainc,extrac)
local g=this.ccGen("Main",2) local count=0
local tp=count%2 while count<mainc do
local c=this.ccSelect(g,tp) local g=this.ccGen("Main",2)
local c1=c local tp=count%2
local c2=Duel.CreateToken(1-tp,g[1]) local c=this.ccSelect(g,tp)
Duel.SendtoDeck(c1,tp,0,REASON_RULE) local c1=c
Duel.SendtoDeck(c2,1-tp,0,REASON_RULE) local c2=Duel.CreateToken(1-tp,g[1])
-- Duel.ConfirmCards(tp,c1) Duel.SendtoDeck(c1,tp,0,REASON_RULE)
Duel.ConfirmCards(1-tp,c2) Duel.SendtoDeck(c2,1-tp,0,REASON_RULE)
count=count+1 -- Duel.ConfirmCards(tp,c1)
end Duel.ConfirmCards(1-tp,c2)
count=0 count=count+1
while count<extrac do end
local g=this.ccGen("Extra",2) count=0
local tp=count%2 while count<extrac do
local c=this.ccSelect(g,tp) local g=this.ccGen("Extra",2)
local c1=c local tp=count%2
local c2=Duel.CreateToken(1-tp,g[1]) local c=this.ccSelect(g,tp)
Duel.SendtoDeck(c1,tp,0,REASON_RULE) local c1=c
Duel.SendtoDeck(c2,1-tp,0,REASON_RULE) local c2=Duel.CreateToken(1-tp,g[1])
-- Duel.ConfirmCards(tp,c1) Duel.SendtoDeck(c1,tp,0,REASON_RULE)
Duel.ConfirmCards(1-tp,c2) Duel.SendtoDeck(c2,1-tp,0,REASON_RULE)
count=count+1 -- Duel.ConfirmCards(tp,c1)
end Duel.ConfirmCards(1-tp,c2)
end count=count+1
end
function this.custompick(mainc,extrac,packc) end
local count=0
local packs={} function this.custompick(mainc,extrac,packc)
local packnum=8*mainc//packc local count=0
if mainc%packc~=0 then packnum=packnum+1 end local packs={}
for i=1,packnum do local packnum=8*mainc//packc
packs[i]=this.ccGen("Main",packc) if mainc%packc~=0 then packnum=packnum+1 end
end for i=1,packnum do
local cp=1 packs[i]=this.ccGen("Main",packc)
while count<mainc do end
local tp=0 local cp=1
while #packs[cp]==0 do while count<mainc do
if cp==packnum then local tp=0
cp=1 while #packs[cp]==0 do
else if cp==packnum then
cp=cp+1 cp=1
end else
end cp=cp+1
local c1=this.ccSelect(packs[cp],tp) end
while #packs[cp]==0 do end
if cp==packnum then local c1=this.ccSelect(packs[cp],tp)
cp=1 while #packs[cp]==0 do
else if cp==packnum then
cp=cp+1 cp=1
end else
end cp=cp+1
local c2=this.ccSelect(packs[cp],1-tp) end
Duel.SendtoDeck(c1,tp,0,REASON_RULE) end
Duel.SendtoDeck(c2,1-tp,0,REASON_RULE) local c2=this.ccSelect(packs[cp],1-tp)
-- Duel.ConfirmCards(tp,c1) Duel.SendtoDeck(c1,tp,0,REASON_RULE)
-- Duel.ConfirmCards(1-tp,c2) Duel.SendtoDeck(c2,1-tp,0,REASON_RULE)
count=count+1 -- Duel.ConfirmCards(tp,c1)
if cp==packnum then -- Duel.ConfirmCards(1-tp,c2)
cp=1 count=count+1
else if cp==packnum then
cp=cp+1 cp=1
end else
end cp=cp+1
count=0 end
packs={} end
packnum=8*extrac//packc count=0
if extrac%packc~=0 then packnum=packnum+1 end packs={}
for i=1,packnum do packnum=8*extrac//packc
packs[i]=this.ccGen("Extra",packc) if extrac%packc~=0 then packnum=packnum+1 end
end for i=1,packnum do
cp=1 packs[i]=this.ccGen("Extra",packc)
while count<extrac do end
local tp=0 cp=1
while #packs[cp]==0 do while count<extrac do
if cp==packnum then local tp=0
cp=1 while #packs[cp]==0 do
else if cp==packnum then
cp=cp+1 cp=1
end else
end cp=cp+1
local c1=this.ccSelect(packs[cp],tp) end
while #packs[cp]==0 do end
if cp==packnum then local c1=this.ccSelect(packs[cp],tp)
cp=1 while #packs[cp]==0 do
else if cp==packnum then
cp=cp+1 cp=1
end else
end cp=cp+1
local c2=this.ccSelect(packs[cp],1-tp) end
Duel.SendtoDeck(c1,tp,0,REASON_RULE) end
Duel.SendtoDeck(c2,1-tp,0,REASON_RULE) local c2=this.ccSelect(packs[cp],1-tp)
-- Duel.ConfirmCards(tp,c1) Duel.SendtoDeck(c1,tp,0,REASON_RULE)
-- Duel.ConfirmCards(1-tp,c2) Duel.SendtoDeck(c2,1-tp,0,REASON_RULE)
count=count+1 -- Duel.ConfirmCards(tp,c1)
if cp==packnum then -- Duel.ConfirmCards(1-tp,c2)
cp=1 count=count+1
else if cp==packnum then
cp=cp+1 cp=1
end else
end cp=cp+1
end end
end
function this.setOverride() end
Card.IsSetCard=aux.TRUE
Card.IsPreviousSetCard=aux.TRUE function this.setOverride()
Card.IsFusionSetCard=aux.TRUE Card.IsSetCard=aux.TRUE
Card.IsLinkSetCard=aux.TRUE Card.IsPreviousSetCard=aux.TRUE
Card.IsOriginalSetCard=aux.TRUE Card.IsFusionSetCard=aux.TRUE
end Card.IsLinkSetCard=aux.TRUE
Card.IsOriginalSetCard=aux.TRUE
function this.raceOverride() end
Card.IsRace=function(c) return c and c:IsType(TYPE_MONSTER) end
Card.IsLinkRace=function(c) return c and c:IsType(TYPE_MONSTER) end function this.raceOverride()
Card.GetRace=function(c) if c and c:IsType(TYPE_MONSTER) then return RACE_ALL end return nil end Card.IsRace=function(c) return c and c:IsType(TYPE_MONSTER) end
Card.GetLinkRace=function(c) if c and c:IsType(TYPE_MONSTER) then return RACE_ALL end return nil end Card.IsLinkRace=function(c) return c and c:IsType(TYPE_MONSTER) end
Card.GetOriginalRace=function(c) if c and c:GetOriginalType()&TYPE_MONSTER>0 then return RACE_ALL end return nil end Card.GetRace=function(c) if c and c:IsType(TYPE_MONSTER) then return RACE_ALL end return nil end
end Card.GetLinkRace=function(c) if c and c:IsType(TYPE_MONSTER) then return RACE_ALL end return nil end
Card.GetOriginalRace=function(c) if c and c:GetOriginalType()&TYPE_MONSTER>0 then return RACE_ALL end return nil end
function this.attrOverride() end
Card.IsAttribute=function(c) return c and c:IsType(TYPE_MONSTER) end
Card.IsFusionAttribute=function(c) return c and c:IsType(TYPE_MONSTER) end function this.attrOverride()
Card.IsLinkAttribute=function(c) return c and c:IsType(TYPE_MONSTER) end Card.IsAttribute=function(c) return c and c:IsType(TYPE_MONSTER) end
Card.GetAttribute=function(c) if c and c:IsType(TYPE_MONSTER) then return 0x7f end return nil end Card.IsFusionAttribute=function(c) return c and c:IsType(TYPE_MONSTER) end
Card.GetFusionAttribute=function(c) if c and c:IsType(TYPE_MONSTER) then return 0x7f end return nil end Card.IsLinkAttribute=function(c) return c and c:IsType(TYPE_MONSTER) end
Card.GetLinkAttribute=function(c) if c and c:IsType(TYPE_MONSTER) then return 0x7f end return nil end Card.GetAttribute=function(c) if c and c:IsType(TYPE_MONSTER) then return 0x7f end return nil end
Card.GetOriginalAttribute=function(c) if c and c:GetOriginalType()&TYPE_MONSTER>0 then return 0x7f end return nil end Card.GetFusionAttribute=function(c) if c and c:IsType(TYPE_MONSTER) then return 0x7f end return nil end
end Card.GetLinkAttribute=function(c) if c and c:IsType(TYPE_MONSTER) then return 0x7f end return nil end
Card.GetOriginalAttribute=function(c) if c and c:GetOriginalType()&TYPE_MONSTER>0 then return 0x7f end return nil end
function this.ritualEnhance(c) end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) function this.ritualEnhance(c)
e1:SetCode(EFFECT_ADD_TYPE) local e1=Effect.CreateEffect(c)
e1:SetValue(TYPE_RITUAL) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_IGNORE_RANGE) e1:SetCode(EFFECT_ADD_TYPE)
e1:SetTargetRange(0xff,0xff) e1:SetValue(TYPE_RITUAL)
e1:SetTarget(function(e,c1) return c1:GetOriginalType()&TYPE_MONSTER==TYPE_MONSTER end) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_IGNORE_RANGE)
Duel.RegisterEffect(e1,0) e1:SetTargetRange(0xff,0xff)
e1:SetTarget(function(e,c1) return c1:GetOriginalType()&TYPE_MONSTER==TYPE_MONSTER end)
local e2=aux.AddRitualProcUltimate(c, Duel.RegisterEffect(e1,0)
function(c1,e,tp) return c1==e:GetHandler() end,
Card.GetLevel, local e2=aux.AddRitualProcUltimate(c,
"Greater", function(c1,e,tp) return c1==e:GetHandler() end,
LOCATION_HAND, Card.GetLevel,
nil, "Greater",
nil) LOCATION_HAND,
e2:SetType(EFFECT_TYPE_IGNITION) nil,
e2:SetRange(LOCATION_HAND) nil)
e2:SetDescription(aux.Stringid(cc,13)) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
local reg=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(cc,13))
reg:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_GRANT)
reg:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_IGNORE_RANGE) local reg=Effect.CreateEffect(c)
reg:SetTargetRange(0xff,0xff) reg:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_GRANT)
reg:SetTarget(function(e,c1) return c1:GetOriginalType()&(TYPE_RITUAL|TYPE_MONSTER)==(TYPE_RITUAL|TYPE_MONSTER) end) reg:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_IGNORE_RANGE)
reg:SetLabelObject(e2) reg:SetTargetRange(0xff,0xff)
Duel.RegisterEffect(reg,0) reg:SetTarget(function(e,c1) return c1:GetOriginalType()&(TYPE_RITUAL|TYPE_MONSTER)==(TYPE_RITUAL|TYPE_MONSTER) end)
end reg:SetLabelObject(e2)
Duel.RegisterEffect(reg,0)
function this.ccEnhance(c,n) end
local ccop=function(e,tp,eg,ep,ev,re,r,rp)
local tgc=Duel.AnnounceCard(tp) function this.ccEnhance(c,n)
local ce=Effect.CreateEffect(e:GetHandler()) local ccop=function(e,tp,eg,ep,ev,re,r,rp)
ce:SetType(EFFECT_TYPE_SINGLE) local tgc=Duel.AnnounceCard(tp)
ce:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_IGNORE_RANGE|EFFECT_FLAG_UNCOPYABLE|EFFECT_FLAG_CANNOT_DISABLE) local ce=Effect.CreateEffect(e:GetHandler())
ce:SetCode(EFFECT_CHANGE_CODE) ce:SetType(EFFECT_TYPE_SINGLE)
ce:SetValue(tgc) ce:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_IGNORE_RANGE|EFFECT_FLAG_UNCOPYABLE|EFFECT_FLAG_CANNOT_DISABLE)
e:GetHandler():RegisterEffect(ce) ce:SetCode(EFFECT_CHANGE_CODE)
Duel.BreakEffect() ce:SetValue(tgc)
if Duel.SelectYesNo(tp,aux.Stringid(13959997,5)) then e:GetHandler():RegisterEffect(ce)
Duel.SendtoDeck(e:GetHandler(),tp,2,REASON_EFFECT) Duel.BreakEffect()
end if Duel.SelectYesNo(tp,aux.Stringid(13959997,5)) then
end Duel.SendtoDeck(e:GetHandler(),tp,2,REASON_EFFECT)
end
local e1=Effect.CreateEffect(c) end
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetDescription(aux.Stringid(13959997,4)) local e1=Effect.CreateEffect(c)
e1:SetRange(LOCATION_ONFIELD|LOCATION_HAND) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(n,13959998|EFFECT_COUNT_CODE_DUEL) e1:SetDescription(aux.Stringid(13959997,4))
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_UNCOPYABLE|EFFECT_FLAG_CANNOT_DISABLE) e1:SetRange(LOCATION_ONFIELD|LOCATION_HAND)
e1:SetOperation(ccop) e1:SetCountLimit(n,13959998|EFFECT_COUNT_CODE_DUEL)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_UNCOPYABLE|EFFECT_FLAG_CANNOT_DISABLE)
local reg=Effect.CreateEffect(c) e1:SetOperation(ccop)
reg:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_GRANT)
reg:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_IGNORE_RANGE) local reg=Effect.CreateEffect(c)
reg:SetTargetRange(0xff,0xff) reg:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_GRANT)
reg:SetTarget(aux.TRUE) reg:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_IGNORE_RANGE)
reg:SetLabelObject(e1) reg:SetTargetRange(0xff,0xff)
Duel.RegisterEffect(reg,0) reg:SetTarget(aux.TRUE)
end reg:SetLabelObject(e1)
Duel.RegisterEffect(reg,0)
function this.npick(mainc,extrac,n) end
local count=0
while count<mainc do function this.npick(mainc,extrac,n)
local g1=this.ccGen("Main",n) local count=0
local g2=this.ccGen("Main",n) while count<mainc do
local c1=this.ccSelect(g1,0) local g1=this.ccGen("Main",n)
local c2=this.ccSelect(g2,1) local g2=this.ccGen("Main",n)
Duel.SendtoDeck(c1,0,0,REASON_RULE) local c1=this.ccSelect(g1,0)
Duel.SendtoDeck(c2,1,0,REASON_RULE) local c2=this.ccSelect(g2,1)
-- Duel.ConfirmCards(0,c1) Duel.SendtoDeck(c1,0,0,REASON_RULE)
-- Duel.ConfirmCards(1,c2) Duel.SendtoDeck(c2,1,0,REASON_RULE)
count=count+1 -- Duel.ConfirmCards(0,c1)
end -- Duel.ConfirmCards(1,c2)
count=0 count=count+1
while count<extrac do end
local g1=this.ccGen("Extra",n) count=0
local g2=this.ccGen("Extra",n) while count<extrac do
local c1=this.ccSelect(g1,0) local g1=this.ccGen("Extra",n)
local c2=this.ccSelect(g2,1) local g2=this.ccGen("Extra",n)
Duel.SendtoDeck(c1,0,0,REASON_RULE) local c1=this.ccSelect(g1,0)
Duel.SendtoDeck(c2,1,0,REASON_RULE) local c2=this.ccSelect(g2,1)
-- Duel.ConfirmCards(0,c1) Duel.SendtoDeck(c1,0,0,REASON_RULE)
-- Duel.ConfirmCards(1,c2) Duel.SendtoDeck(c2,1,0,REASON_RULE)
count=count+1 -- Duel.ConfirmCards(0,c1)
end -- Duel.ConfirmCards(1,c2)
end count=count+1
end
function this.fSelect(tp,g1,g2) end
local cg1,cg2=this.displayOnField(tp,g1,g2)
local cg=Group.CreateGroup(cg1,cg2) function this.fSelect(tp,g1,g2)
if cg1:IsContains(cg:Select(tp,1,1,nil):GetFirst()) then local cg1,cg2=this.displayOnField(tp,g1,g2)
Duel.Exile(cg2,REASON_RULE) local cg=Group.CreateGroup(cg1,cg2)
cg2:DeleteGroup() if cg1:IsContains(cg:Select(tp,1,1,nil):GetFirst()) then
cg:DeleteGroup() Duel.Exile(cg2,REASON_RULE)
return cg1 cg2:DeleteGroup()
else cg:DeleteGroup()
Duel.Exile(cg1,REASON_RULE) return cg1
cg1:DeleteGroup() else
cg:DeleteGroup() Duel.Exile(cg1,REASON_RULE)
return cg2 cg1:DeleteGroup()
end cg:DeleteGroup()
end return cg2
end
function this.displayOnField(tp,g1,g2) end
local cg1=Group.CreateGroup()
local cg2=Group.CreateGroup() function this.displayOnField(tp,g1,g2)
local ct1={} local cg1=Group.CreateGroup()
local ct2={} local cg2=Group.CreateGroup()
for k,v in pairs(g1) do local ct1={}
if k>10 then break end local ct2={}
local c=Duel.CreateToken(tp,v) for k,v in pairs(g1) do
if k<=5 then if k>10 then break end
Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP_ATTACK,false,1<<(k-1)) local c=Duel.CreateToken(tp,v)
else if k<=5 then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false,1<<(k-6)) Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP_ATTACK,false,1<<(k-1))
end else
cg1:AddCard(c) Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false,1<<(k-6))
ct1[c]=v end
end cg1:AddCard(c)
for k,v in pairs(g2) do ct1[c]=v
if k>10 then break end end
local c=Duel.CreateToken(tp,v) for k,v in pairs(g2) do
if k<=5 then if k>10 then break end
Duel.MoveToField(c,tp,1-tp,LOCATION_MZONE,POS_FACEUP_ATTACK,false,1<<(k-1)) local c=Duel.CreateToken(tp,v)
else if k<=5 then
Duel.MoveToField(c,tp,1-tp,LOCATION_SZONE,POS_FACEUP,false,1<<(k-6)) Duel.MoveToField(c,tp,1-tp,LOCATION_MZONE,POS_FACEUP_ATTACK,false,1<<(k-1))
end else
cg2:AddCard(c) Duel.MoveToField(c,tp,1-tp,LOCATION_SZONE,POS_FACEUP,false,1<<(k-6))
ct2[c]=v end
end cg2:AddCard(c)
return cg1,cg2,ct1,ct2 ct2[c]=v
end end
return cg1,cg2,ct1,ct2
function this.twopickn(mainc,extrac,n) end
local count=0
while count<mainc do function this.twopickn(mainc,extrac,n)
local g11=this.ccGen("Main",n) local count=0
local g12=this.ccGen("Main",n) while count<mainc do
local g21=this.ccGen("Main",n) local g11=this.ccGen("Main",n)
local g22=this.ccGen("Main",n) local g12=this.ccGen("Main",n)
local c1=this.fSelect(0,g11,g12) local g21=this.ccGen("Main",n)
Duel.SendtoDeck(c1,0,0,REASON_RULE) local g22=this.ccGen("Main",n)
local c2=this.fSelect(1,g21,g22) local c1=this.fSelect(0,g11,g12)
Duel.SendtoDeck(c2,1,0,REASON_RULE) Duel.SendtoDeck(c1,0,0,REASON_RULE)
-- Duel.ConfirmCards(0,c1) local c2=this.fSelect(1,g21,g22)
-- Duel.ConfirmCards(1,c2) Duel.SendtoDeck(c2,1,0,REASON_RULE)
count=count+n -- Duel.ConfirmCards(0,c1)
end -- Duel.ConfirmCards(1,c2)
count=0 count=count+n
while count<extrac do end
local g11=this.ccGen("Extra",n) count=0
local g12=this.ccGen("Extra",n) while count<extrac do
local g21=this.ccGen("Extra",n) local g11=this.ccGen("Extra",n)
local g22=this.ccGen("Extra",n) local g12=this.ccGen("Extra",n)
local c1=this.fSelect(0,g11,g12) local g21=this.ccGen("Extra",n)
Duel.SendtoDeck(c1,0,0,REASON_RULE) local g22=this.ccGen("Extra",n)
local c2=this.fSelect(1,g21,g22) local c1=this.fSelect(0,g11,g12)
Duel.SendtoDeck(c2,1,0,REASON_RULE) Duel.SendtoDeck(c1,0,0,REASON_RULE)
-- Duel.ConfirmCards(0,c1) local c2=this.fSelect(1,g21,g22)
-- Duel.ConfirmCards(1,c2) Duel.SendtoDeck(c2,1,0,REASON_RULE)
count=count+n -- Duel.ConfirmCards(0,c1)
end -- Duel.ConfirmCards(1,c2)
end count=count+n
end
function this.fpick(mainc,extrac,n) end
local change=function(c,ct,from)
local ncc=this.ccGen(from,1)[1] function this.fpick(mainc,extrac,n)
ct[c]=ncc local change=function(c,ct,from)
c:SetEntityCode(ncc,true) local ncc=this.ccGen(from,1)[1]
end ct[c]=ncc
local count=0 c:SetEntityCode(ncc,true)
local reroll={} end
reroll[0]=n local count=0
reroll[1]=n local reroll={}
local rerollCard={} reroll[0]=n
rerollCard[0]=Duel.CreateToken(0,rerollc[reroll[0]]) reroll[1]=n
rerollCard[1]=Duel.CreateToken(1,rerollc[reroll[1]]) local rerollCard={}
Duel.SendtoHand(rerollCard[0],0,REASON_RULE) rerollCard[0]=Duel.CreateToken(0,rerollc[reroll[0]])
Duel.SendtoHand(rerollCard[1],1,REASON_RULE) rerollCard[1]=Duel.CreateToken(1,rerollc[reroll[1]])
Duel.MoveToField(rerollCard[0],0,0,LOCATION_MZONE,POS_FACEUP_ATTACK,false,1<<5) Duel.SendtoHand(rerollCard[0],0,REASON_RULE)
Duel.MoveToField(rerollCard[1],1,1,LOCATION_MZONE,POS_FACEUP_ATTACK,false,1<<5) Duel.SendtoHand(rerollCard[1],1,REASON_RULE)
local g1=this.ccGen("Main",10) Duel.MoveToField(rerollCard[0],0,0,LOCATION_MZONE,POS_FACEUP_ATTACK,false,1<<5)
local g2=this.ccGen("Main",10) Duel.MoveToField(rerollCard[1],1,1,LOCATION_MZONE,POS_FACEUP_ATTACK,false,1<<5)
local cg1,cg2,ct1,ct2=this.displayOnField(0,g1,g2) local g1=this.ccGen("Main",10)
local tp=0 local g2=this.ccGen("Main",10)
local rerolled=false local cg1,cg2,ct1,ct2=this.displayOnField(0,g1,g2)
while count<mainc do local tp=0
local sg=Duel.GetFieldGroup(tp,LOCATION_MZONE|LOCATION_SZONE,LOCATION_MZONE|LOCATION_SZONE) local rerolled=false
if rerollCard[1-tp] then while count<mainc do
sg:RemoveCard(rerollCard[1-tp]) local sg=Duel.GetFieldGroup(tp,LOCATION_MZONE|LOCATION_SZONE,LOCATION_MZONE|LOCATION_SZONE)
end if rerollCard[1-tp] then
if rerollCard[tp] and rerolled then sg:RemoveCard(rerollCard[1-tp])
sg:RemoveCard(rerollCard[tp]) end
end if rerollCard[tp] and rerolled then
local sc=sg:Select(tp,1,1,nil):GetFirst() sg:RemoveCard(rerollCard[tp])
if sc==rerollCard[tp] then end
cg1:ForEach(change,ct1,"Main") local sc=sg:Select(tp,1,1,nil):GetFirst()
cg2:ForEach(change,ct2,"Main") if sc==rerollCard[tp] then
rerolled=true cg1:ForEach(change,ct1,"Main")
reroll[tp]=reroll[tp]-1 cg2:ForEach(change,ct2,"Main")
if reroll[tp]==0 then rerolled=true
Duel.Exile(rerollCard[tp],REASON_RULE) reroll[tp]=reroll[tp]-1
rerollCard[tp]=nil if reroll[tp]==0 then
else Duel.Exile(rerollCard[tp],REASON_RULE)
rerollCard[tp]:SetEntityCode(rerollc[reroll[tp]],true) rerollCard[tp]=nil
end else
else rerollCard[tp]:SetEntityCode(rerollc[reroll[tp]],true)
if ct1[sc] then end
Duel.SendtoDeck(Duel.CreateToken(tp,ct1[sc]),tp,0,REASON_RULE) else
change(sc,ct1,"Main") if ct1[sc] then
else Duel.SendtoDeck(Duel.CreateToken(tp,ct1[sc]),tp,0,REASON_RULE)
Duel.SendtoDeck(Duel.CreateToken(tp,ct2[sc]),tp,0,REASON_RULE) change(sc,ct1,"Main")
change(sc,ct2,"Main") else
end Duel.SendtoDeck(Duel.CreateToken(tp,ct2[sc]),tp,0,REASON_RULE)
if tp==1 then change(sc,ct2,"Main")
count=count+1 end
end if tp==1 then
tp=1-tp count=count+1
rerolled=false end
end tp=1-tp
end rerolled=false
cg1:ForEach(change,ct1,"Extra") end
cg2:ForEach(change,ct2,"Extra") end
tp=0 cg1:ForEach(change,ct1,"Extra")
count=0 cg2:ForEach(change,ct2,"Extra")
rerolled=false tp=0
while count<extrac do count=0
local sg=Duel.GetFieldGroup(tp,LOCATION_MZONE|LOCATION_SZONE,LOCATION_MZONE|LOCATION_SZONE) rerolled=false
if rerollCard[1-tp] then while count<extrac do
sg:RemoveCard(rerollCard[1-tp]) local sg=Duel.GetFieldGroup(tp,LOCATION_MZONE|LOCATION_SZONE,LOCATION_MZONE|LOCATION_SZONE)
end if rerollCard[1-tp] then
if rerollCard[tp] and rerolled then sg:RemoveCard(rerollCard[1-tp])
sg:RemoveCard(rerollCard[tp]) end
end if rerollCard[tp] and rerolled then
local sc=sg:Select(tp,1,1,nil):GetFirst() sg:RemoveCard(rerollCard[tp])
if sc==rerollCard[tp] then end
cg1:ForEach(change,ct1,"Extra") local sc=sg:Select(tp,1,1,nil):GetFirst()
cg2:ForEach(change,ct2,"Extra") if sc==rerollCard[tp] then
rerolled=true cg1:ForEach(change,ct1,"Extra")
reroll[tp]=reroll[tp]-1 cg2:ForEach(change,ct2,"Extra")
if reroll[tp]==0 then rerolled=true
Duel.Exile(rerollCard[tp],REASON_RULE) reroll[tp]=reroll[tp]-1
rerollCard[tp]=nil if reroll[tp]==0 then
else Duel.Exile(rerollCard[tp],REASON_RULE)
rerollCard[tp]:SetEntityCode(rerollc[reroll[tp]],true) rerollCard[tp]=nil
end else
else rerollCard[tp]:SetEntityCode(rerollc[reroll[tp]],true)
if ct1[sc] then end
Duel.SendtoDeck(Duel.CreateToken(tp,ct1[sc]),tp,0,REASON_RULE) else
change(sc,ct1,"Extra") if ct1[sc] then
else Duel.SendtoDeck(Duel.CreateToken(tp,ct1[sc]),tp,0,REASON_RULE)
Duel.SendtoDeck(Duel.CreateToken(tp,ct2[sc]),tp,0,REASON_RULE) change(sc,ct1,"Extra")
change(sc,ct2,"Extra") else
end Duel.SendtoDeck(Duel.CreateToken(tp,ct2[sc]),tp,0,REASON_RULE)
if tp==1 then change(sc,ct2,"Extra")
count=count+1 end
end if tp==1 then
tp=1-tp count=count+1
rerolled=false end
end tp=1-tp
end rerolled=false
Duel.Exile(Duel.GetFieldGroup(0,LOCATION_MZONE|LOCATION_SZONE,LOCATION_MZONE|LOCATION_SZONE),REASON_RULE) end
end end
Duel.Exile(Duel.GetFieldGroup(0,LOCATION_MZONE|LOCATION_SZONE,LOCATION_MZONE|LOCATION_SZONE),REASON_RULE)
function this.fullrandom(mainc,extrac) end
for i=0,1 do
Duel.SelectYesNo(i,aux.Stringid(cc,15)) function this.fullrandom(mainc,extrac)
local mg=Group.CreateGroup() for i=0,1 do
local eg=Group.CreateGroup() Duel.SelectYesNo(i,aux.Stringid(cc,15))
for _,v in pairs(this.ccGen("Main",mainc)) do local mg=Group.CreateGroup()
mg:AddCard(Duel.CreateToken(i,v)) local eg=Group.CreateGroup()
end for _,v in pairs(this.ccGen("Main",mainc)) do
Duel.SendtoDeck(mg,i,0,REASON_RULE) mg:AddCard(Duel.CreateToken(i,v))
for _,v in pairs(this.ccGen("Extra",extrac)) do end
eg:AddCard(Duel.CreateToken(i,v)) Duel.SendtoDeck(mg,i,0,REASON_RULE)
end for _,v in pairs(this.ccGen("Extra",extrac)) do
Duel.SendtoDeck(eg,i,0,REASON_RULE) eg:AddCard(Duel.CreateToken(i,v))
mg:DeleteGroup() end
eg:DeleteGroup() Duel.SendtoDeck(eg,i,0,REASON_RULE)
Duel.SelectYesNo(i,aux.Stringid(cc,15)) mg:DeleteGroup()
end eg:DeleteGroup()
end Duel.SelectYesNo(i,aux.Stringid(cc,15))
end
function this.reroll(tp) end
local ct=3
while ct>0 and Duel.SelectYesNo(tp,aux.Stringid(cc,12)) do function this.reroll(tp)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0) local ct=3
Duel.SendtoDeck(g,tp,0,REASON_RULE) while ct>0 and Duel.SelectYesNo(tp,aux.Stringid(cc,12)) do
Duel.ShuffleDeck(tp) local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.Draw(tp,#g-1,REASON_RULE) Duel.SendtoDeck(g,tp,0,REASON_RULE)
ct=ct-1 Duel.ShuffleDeck(tp)
end Duel.Draw(tp,#g-1,REASON_RULE)
end ct=ct-1
end
function this.picrandom(g) end
if not this.CardList.Main then
local ml,el,mat,eat=c13959997.loadCardList(this.useBanList,false,this.clCode) function this.picrandom(g)
this.CardList.Main=ml if not this.CardList.Main then
this.CardList.Extra=el local ml,el,mat,eat=c13959997.loadCardList(this.useBanList,false,this.clCode)
this.CardList.MainAliasTable=mat this.CardList.Main=ml
this.CardList.ExtraAliasTable=eat this.CardList.Extra=el
end this.CardList.MainAliasTable=mat
local rg={} this.CardList.ExtraAliasTable=eat
for _,v in pairs(g) do end
if this.CardList.MainAliasTable[v] then local rg={}
local at=this.CardList.MainAliasTable for _,v in pairs(g) do
rg[#rg+1]=at[v][math.random(1,#at[v])] if this.CardList.MainAliasTable[v] then
elseif this.CardList.ExtraAliasTable[v] then local at=this.CardList.MainAliasTable
local at=this.CardList.ExtraAliasTable rg[#rg+1]=at[v][math.random(1,#at[v])]
rg[#rg+1]=at[v][math.random(1,#at[v])] elseif this.CardList.ExtraAliasTable[v] then
else local at=this.CardList.ExtraAliasTable
rg[#rg+1]=v rg[#rg+1]=at[v][math.random(1,#at[v])]
end else
end rg[#rg+1]=v
return rg end
end end
return rg
function this.sample(g,ct) end
local cct=#g
local rg={} function this.sample(g,ct)
local remains={} local cct=#g
for i=1,ct do local rg={}
if i>cct then local remains={}
break for i=1,ct do
end if i>cct then
local idx=math.random(1,cct-i+1) break
end
rg[#rg+1]=g[idx] local idx=math.random(1,cct-i+1)
if idx<cct-i+1 then
g[idx]=g[cct-i+1] rg[#rg+1]=g[idx]
end if idx<cct-i+1 then
end g[idx]=g[cct-i+1]
for i=1,cct-ct do end
remains[i]=g[i] end
end for i=1,cct-ct do
return rg,remains remains[i]=g[i]
end end
return rg,remains
function this.partialrandom(n) end
for i=0,1 do
Duel.SelectYesNo(i,aux.Stringid(cc,15)) function this.partialrandom(n)
local mg=Group.CreateGroup() for i=0,1 do
local eg=Group.CreateGroup() Duel.SelectYesNo(i,aux.Stringid(cc,15))
local mc=math.floor(#this.deckList[i]*n/10) local mg=Group.CreateGroup()
local ec=math.floor(#this.extraList[i]*n/10) local eg=Group.CreateGroup()
for _,v in pairs(this.picrandom(this.sample(this.deckList[i],mc))) do local mc=math.floor(#this.deckList[i]*n/10)
mg:AddCard(Duel.CreateToken(i,v)) local ec=math.floor(#this.extraList[i]*n/10)
end for _,v in pairs(this.picrandom(this.sample(this.deckList[i],mc))) do
for _,v in pairs(this.ccGen("Main",#this.deckList[i]-mc)) do mg:AddCard(Duel.CreateToken(i,v))
mg:AddCard(Duel.CreateToken(i,v)) end
end for _,v in pairs(this.ccGen("Main",#this.deckList[i]-mc)) do
Duel.SendtoDeck(mg,i,0,REASON_RULE) mg:AddCard(Duel.CreateToken(i,v))
for _,v in pairs(this.picrandom(this.sample(this.extraList[i],ec))) do end
eg:AddCard(Duel.CreateToken(i,v)) Duel.SendtoDeck(mg,i,0,REASON_RULE)
end for _,v in pairs(this.picrandom(this.sample(this.extraList[i],ec))) do
for _,v in pairs(this.ccGen("Extra",#this.extraList[i]-ec)) do eg:AddCard(Duel.CreateToken(i,v))
eg:AddCard(Duel.CreateToken(i,v)) end
end for _,v in pairs(this.ccGen("Extra",#this.extraList[i]-ec)) do
Duel.SendtoDeck(eg,i,0,REASON_RULE) eg:AddCard(Duel.CreateToken(i,v))
mg:DeleteGroup() end
eg:DeleteGroup() Duel.SendtoDeck(eg,i,0,REASON_RULE)
Duel.SelectYesNo(i,aux.Stringid(cc,15)) mg:DeleteGroup()
end eg:DeleteGroup()
end Duel.SelectYesNo(i,aux.Stringid(cc,15))
end
function this.swapmode(n) end
local mg={}
local eg={} function this.swapmode(n)
mg[0]=Group.CreateGroup() local mg={}
mg[1]=Group.CreateGroup() local eg={}
eg[0]=Group.CreateGroup() mg[0]=Group.CreateGroup()
eg[1]=Group.CreateGroup() mg[1]=Group.CreateGroup()
for i=0,1 do eg[0]=Group.CreateGroup()
local mcg,mcgr=this.sample(this.deckList[i],math.floor(#this.deckList[i]*n/10)) eg[1]=Group.CreateGroup()
local ecg,ecgr=this.sample(this.extraList[i],math.floor(#this.extraList[i]*n/10)) for i=0,1 do
for _,v in pairs(mcg) do local mcg,mcgr=this.sample(this.deckList[i],math.floor(#this.deckList[i]*n/10))
mg[1-i]:AddCard(Duel.CreateToken(1-i,v)) local ecg,ecgr=this.sample(this.extraList[i],math.floor(#this.extraList[i]*n/10))
end for _,v in pairs(mcg) do
for _,v in pairs(mcgr) do mg[1-i]:AddCard(Duel.CreateToken(1-i,v))
mg[i]:AddCard(Duel.CreateToken(i,v)) end
end for _,v in pairs(mcgr) do
for _,v in pairs(ecg) do mg[i]:AddCard(Duel.CreateToken(i,v))
eg[1-i]:AddCard(Duel.CreateToken(1-i,v)) end
end for _,v in pairs(ecg) do
for _,v in pairs(ecgr) do eg[1-i]:AddCard(Duel.CreateToken(1-i,v))
eg[i]:AddCard(Duel.CreateToken(i,v)) end
end for _,v in pairs(ecgr) do
end eg[i]:AddCard(Duel.CreateToken(i,v))
for i=0,1 do end
Duel.SelectYesNo(i,aux.Stringid(cc,15)) end
Duel.SendtoDeck(mg[i],i,0,REASON_RULE) for i=0,1 do
Duel.SendtoDeck(eg[i],i,0,REASON_RULE) Duel.SelectYesNo(i,aux.Stringid(cc,15))
Duel.SelectYesNo(i,aux.Stringid(cc,15)) Duel.SendtoDeck(mg[i],i,0,REASON_RULE)
end Duel.SendtoDeck(eg[i],i,0,REASON_RULE)
Duel.SelectYesNo(i,aux.Stringid(cc,15))
end
end end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment