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