Commit ee286b9c authored by JoyJ's avatar JoyJ

use Duel.GetRandomNumber

parent 7c1a7d73
...@@ -54,12 +54,7 @@ function CUNGUI.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -54,12 +54,7 @@ function CUNGUI.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function CUNGUI.operation(e,tp,eg,ep,ev,re,r,rp,chk) function CUNGUI.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local add=0 local add=0
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
while add==0 do while add==0 do
local code=math.random(#CUNGUI.forbidden) local code=math.random(#CUNGUI.forbidden)
local tc=Duel.CreateToken(tp,CUNGUI.forbidden[code]) local tc=Duel.CreateToken(tp,CUNGUI.forbidden[code])
......
...@@ -22,12 +22,7 @@ function CUNGUI.AdjustOperation() ...@@ -22,12 +22,7 @@ function CUNGUI.AdjustOperation()
CUNGUI.RegisterForbiddenRule(0) CUNGUI.RegisterForbiddenRule(0)
CUNGUI.RegisterForbiddenRule(1) CUNGUI.RegisterForbiddenRule(1)
end end
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
if CUNGUI.RuleCard[0] and not CUNGUI.RuleCard[0]:IsLocation(LOCATION_REMOVED+LOCATION_ONFIELD) then if CUNGUI.RuleCard[0] and not CUNGUI.RuleCard[0]:IsLocation(LOCATION_REMOVED+LOCATION_ONFIELD) then
Duel.Remove(CUNGUI.RuleCard[0],POS_FACEUP,REASON_RULE) Duel.Remove(CUNGUI.RuleCard[0],POS_FACEUP,REASON_RULE)
end end
......
...@@ -62,12 +62,7 @@ function CUNGUI.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -62,12 +62,7 @@ function CUNGUI.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function CUNGUI.operation(e,tp,eg,ep,ev,re,r,rp,chk) function CUNGUI.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local add=0 local add=0
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
while add<2 do while add<2 do
local code=math.random(#CUNGUI.ZexalWeapons) local code=math.random(#CUNGUI.ZexalWeapons)
local tc=Duel.CreateToken(tp,CUNGUI.ZexalWeapons[code]) local tc=Duel.CreateToken(tp,CUNGUI.ZexalWeapons[code])
......
...@@ -25,12 +25,7 @@ function Auxiliary.PreloadUds() ...@@ -25,12 +25,7 @@ function Auxiliary.PreloadUds()
Duel.RegisterEffect(e1,0) Duel.RegisterEffect(e1,0)
end end
function CUNGUI.AdjustOperation() function CUNGUI.AdjustOperation()
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
if not CUNGUI.RuleCardInit then if not CUNGUI.RuleCardInit then
CUNGUI.RuleCardInit = true CUNGUI.RuleCardInit = true
CUNGUI.RegisterCardRule(0) CUNGUI.RegisterCardRule(0)
......
...@@ -21,12 +21,7 @@ function Auxiliary.PreloadUds() ...@@ -21,12 +21,7 @@ function Auxiliary.PreloadUds()
Duel.RegisterEffect(e1,0) Duel.RegisterEffect(e1,0)
end end
function CUNGUI.AdjustOperation() function CUNGUI.AdjustOperation()
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
if not CUNGUI.RuleCardInit then if not CUNGUI.RuleCardInit then
CUNGUI.RuleCardInit = true CUNGUI.RuleCardInit = true
CUNGUI.RegisterCardRule(0) CUNGUI.RegisterCardRule(0)
......
...@@ -22,12 +22,7 @@ end ...@@ -22,12 +22,7 @@ end
CUNGUI.RegisteredMonsters = Group.CreateGroup() CUNGUI.RegisteredMonsters = Group.CreateGroup()
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp) function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
local g = Duel.GetMatchingGroup(aux.TRUE,0,0x7f,0x7f,nil) local g = Duel.GetMatchingGroup(aux.TRUE,0,0x7f,0x7f,nil)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects) g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
if not CUNGUI.DrawInit then if not CUNGUI.DrawInit then
......
...@@ -18,12 +18,7 @@ function Auxiliary.PreloadUds() ...@@ -18,12 +18,7 @@ function Auxiliary.PreloadUds()
Duel.RegisterEffect(e1,0) Duel.RegisterEffect(e1,0)
end end
function CUNGUI.AdjustOperation() function CUNGUI.AdjustOperation()
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
if not CUNGUI.RuleCardInit then if not CUNGUI.RuleCardInit then
CUNGUI.RuleCardInit = true CUNGUI.RuleCardInit = true
CUNGUI.RegisterCardRule(0) CUNGUI.RegisterCardRule(0)
......
...@@ -27,12 +27,7 @@ function Auxiliary.PreloadUds() ...@@ -27,12 +27,7 @@ function Auxiliary.PreloadUds()
Duel.RegisterEffect(e1,0) Duel.RegisterEffect(e1,0)
end end
function CUNGUI.AdjustOperation() function CUNGUI.AdjustOperation()
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
if not CUNGUI.RuleCardInit then if not CUNGUI.RuleCardInit then
CUNGUI.RuleCardInit = true CUNGUI.RuleCardInit = true
CUNGUI.RegisterCardRule(0) CUNGUI.RegisterCardRule(0)
......
...@@ -23,12 +23,7 @@ function Auxiliary.PreloadUds() ...@@ -23,12 +23,7 @@ function Auxiliary.PreloadUds()
Duel.RegisterEffect(e1,0) Duel.RegisterEffect(e1,0)
end end
function CUNGUI.AdjustOperation() function CUNGUI.AdjustOperation()
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
if not CUNGUI.RuleCardInit then if not CUNGUI.RuleCardInit then
CUNGUI.RuleCardInit = true CUNGUI.RuleCardInit = true
CUNGUI.RegisterCardRule(0) CUNGUI.RegisterCardRule(0)
......
...@@ -19,12 +19,7 @@ end ...@@ -19,12 +19,7 @@ end
CUNGUI.RegisteredMonsters = Group.CreateGroup() CUNGUI.RegisteredMonsters = Group.CreateGroup()
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp) function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
local g = Duel.GetMatchingGroup(Card.IsType,0,0x7f,0x7f,nil,TYPE_MONSTER) local g = Duel.GetMatchingGroup(Card.IsType,0,0x7f,0x7f,nil,TYPE_MONSTER)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects) g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
if not CUNGUI.DrawInit then if not CUNGUI.DrawInit then
......
...@@ -28,12 +28,7 @@ function Auxiliary.PreloadUds() ...@@ -28,12 +28,7 @@ function Auxiliary.PreloadUds()
Duel.RegisterEffect(e1,0) Duel.RegisterEffect(e1,0)
end end
function CUNGUI.AdjustOperation() function CUNGUI.AdjustOperation()
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
if not CUNGUI.RuleCardInit then if not CUNGUI.RuleCardInit then
CUNGUI.RuleCardInit = true CUNGUI.RuleCardInit = true
CUNGUI.RegisterCardRule(0) CUNGUI.RegisterCardRule(0)
......
...@@ -20,12 +20,7 @@ function Auxiliary.PreloadUds() ...@@ -20,12 +20,7 @@ function Auxiliary.PreloadUds()
Duel.RegisterEffect(e1,0) Duel.RegisterEffect(e1,0)
end end
function CUNGUI.AdjustOperation() function CUNGUI.AdjustOperation()
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
if not CUNGUI.RuleCardInit then if not CUNGUI.RuleCardInit then
CUNGUI.RuleCardInit = true CUNGUI.RuleCardInit = true
CUNGUI.RegisterCardRule(0) CUNGUI.RegisterCardRule(0)
......
...@@ -17,12 +17,7 @@ function Auxiliary.PreloadUds() ...@@ -17,12 +17,7 @@ function Auxiliary.PreloadUds()
Duel.RegisterEffect(e1,0) Duel.RegisterEffect(e1,0)
end end
function CUNGUI.AdjustOperation() function CUNGUI.AdjustOperation()
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
if not CUNGUI.RuleCardInit then if not CUNGUI.RuleCardInit then
CUNGUI.RuleCardInit = true CUNGUI.RuleCardInit = true
CUNGUI.RegisterCardRule(0) CUNGUI.RegisterCardRule(0)
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
CUNGUI = {} CUNGUI = {}
CUNGUI.RuleCardCode=90140980 CUNGUI.RuleCardCode=90140980
math.random = Duel.GetRandomNumber math.random = Duel.GetRandomNumber or math.random
CUNGUI.forbidden={91869203,20663556,44910027,51858306,7563579,17330916,34945480,90411554,8903700, CUNGUI.forbidden={91869203,20663556,44910027,51858306,7563579,17330916,34945480,90411554,8903700,
11384280,17412721,50588353,34124316,2563463,88071625,61665245,52653092,48905153,85115440,59537380, 11384280,17412721,50588353,34124316,2563463,88071625,61665245,52653092,48905153,85115440,59537380,
......
...@@ -21,12 +21,7 @@ end ...@@ -21,12 +21,7 @@ end
CUNGUI.RegisteredMonsters = Group.CreateGroup() CUNGUI.RegisteredMonsters = Group.CreateGroup()
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp) function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
local g = Duel.GetMatchingGroup(Card.IsType,0,0x7f,0x7f,nil,TYPE_MONSTER) local g = Duel.GetMatchingGroup(Card.IsType,0,0x7f,0x7f,nil,TYPE_MONSTER)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects) g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
if not CUNGUI.DrawInit then if not CUNGUI.DrawInit then
......
...@@ -19,12 +19,7 @@ end ...@@ -19,12 +19,7 @@ end
CUNGUI.RegisteredMonsters = Group.CreateGroup() CUNGUI.RegisteredMonsters = Group.CreateGroup()
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp) function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
local g = Duel.GetMatchingGroup(Card.IsType,0,0x7f,0x7f,nil,TYPE_MONSTER) local g = Duel.GetMatchingGroup(Card.IsType,0,0x7f,0x7f,nil,TYPE_MONSTER)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects) g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
if not CUNGUI.DrawInit then if not CUNGUI.DrawInit then
......
...@@ -22,12 +22,7 @@ function Auxiliary.PreloadUds() ...@@ -22,12 +22,7 @@ function Auxiliary.PreloadUds()
Duel.RegisterEffect(e1,0) Duel.RegisterEffect(e1,0)
end end
function CUNGUI.AdjustOperation() function CUNGUI.AdjustOperation()
if not CUNGUI.RandomSeedInit then math.random = Duel.GetRandomNumber or math.random
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
if not CUNGUI.RuleCardInit then if not CUNGUI.RuleCardInit then
CUNGUI.RuleCardInit = true CUNGUI.RuleCardInit = true
CUNGUI.RegisterCardRule(0) CUNGUI.RegisterCardRule(0)
......
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