Commit 1d341758 authored by POLYMER's avatar POLYMER

fix

parent d7eaa45c
...@@ -48,41 +48,60 @@ function cm.initial_effect(c) ...@@ -48,41 +48,60 @@ function cm.initial_effect(c)
e4:SetCondition(cm.con4) e4:SetCondition(cm.con4)
e4:SetOperation(cm.op4) e4:SetOperation(cm.op4)
c:RegisterEffect(e4) c:RegisterEffect(e4)
if not Strong_Boxer_random_seed then if not _globetrot then
local result=0 _globetrot=true
local g=Duel.GetDecktopGroup(0,5) globetrot = {}
local tc=g:GetFirst() globetrot.x = 5
while tc do globetrot.pair = {}
result=result+tc:GetCode() for i = 1, globetrot.x do
tc=g:GetNext() globetrot.pair[i] = {}
end globetrot.pair[i]["first"] = i
local g=Duel.GetDecktopGroup(1,5) globetrot.pair[i]["second"] = 0
local tc=g:GetFirst() end
while tc do function globetrot.quick_sort(start, last)
result=result+tc:GetCode() local left, right = start, last
tc=g:GetNext() if left < right then
end while left < right do
g:DeleteGroup() while globetrot.pair[left]["second"] <= globetrot.pair[start]["second"] and left < last do
Strong_Boxer_random_seed=result left = left + 1
function Strong_Boxer_roll(min,max) end
if min==max then return min end while globetrot.pair[right]["second"] >= globetrot.pair[start]["second"] and right > start do
min=tonumber(min) right = right - 1
max=tonumber(max) end
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 if left < right then
if min~=nil then local _first = globetrot.pair[left]["first"]
if max==nil then local _second = globetrot.pair[left]["second"]
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[left]["first"] = globetrot.pair[right]["first"]
return math.floor(random_number*min)+1 globetrot.pair[left]["second"] = globetrot.pair[right]["second"]
else globetrot.pair[right]["first"] = _first
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[right]["second"] = _second
if random_number<min then else
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 break
random_number=Strong_Boxer_random_seed/2147484647
end end
return math.floor((max-min)*random_number)+1+min
end end
local _first = globetrot.pair[start]["first"]
local _second = globetrot.pair[start]["second"]
globetrot.pair[start]["first"] = globetrot.pair[right]["first"]
globetrot.pair[start]["second"] = globetrot.pair[right]["second"]
globetrot.pair[right]["first"] = _first
globetrot.pair[right]["second"] = _second
globetrot.quick_sort(start, right - 1)
globetrot.quick_sort(right + 1, last)
end end
return Strong_Boxer_random_seed end
function globetrot.random(seed,num)
local s = num or 0
seed = math.floor(math.abs(seed))
seed = (seed * 16807) % 2147483647
local n = seed % 5
n = (n < 0) and (n + 5) or n
local res = n + 1
globetrot.quick_sort(1, globetrot.x)
if s <= 3 and res ~= globetrot.pair[1]["first"] and globetrot.pair[globetrot.x]["second"] - globetrot.pair[1]["second"] > 1 then
res = globetrot.pair[1]["first"]
end
return res
end end
end end
if not cm._ then if not cm._ then
...@@ -155,8 +174,16 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -155,8 +174,16 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
cm.A_status[tp+1] = false cm.A_status[tp+1] = false
local x local x
while true do while true do
x = Strong_Boxer_roll(1,5) x = Duel.GetRandomNumber(1,5)
if cm[tostring(x)](c) then break end x = globetrot.random(x)
if cm[tostring(x)](c) then
for i = 1, globetrot.x do
if globetrot.pair[i]["first"] == x then
globetrot.pair[i]["second"] = globetrot.pair[i]["second"] + 1
end
end
break
end
end end
cm._return(c,x) cm._return(c,x)
return false return false
......
...@@ -48,41 +48,60 @@ function cm.initial_effect(c) ...@@ -48,41 +48,60 @@ function cm.initial_effect(c)
e4:SetCondition(cm.con4) e4:SetCondition(cm.con4)
e4:SetOperation(cm.op4) e4:SetOperation(cm.op4)
c:RegisterEffect(e4) c:RegisterEffect(e4)
if not Strong_Boxer_random_seed then if not _globetrot then
local result=0 _globetrot=true
local g=Duel.GetDecktopGroup(0,5) globetrot = {}
local tc=g:GetFirst() globetrot.x = 5
while tc do globetrot.pair = {}
result=result+tc:GetCode() for i = 1, globetrot.x do
tc=g:GetNext() globetrot.pair[i] = {}
end globetrot.pair[i]["first"] = i
local g=Duel.GetDecktopGroup(1,5) globetrot.pair[i]["second"] = 0
local tc=g:GetFirst() end
while tc do function globetrot.quick_sort(start, last)
result=result+tc:GetCode() local left, right = start, last
tc=g:GetNext() if left < right then
end while left < right do
g:DeleteGroup() while globetrot.pair[left]["second"] <= globetrot.pair[start]["second"] and left < last do
Strong_Boxer_random_seed=result left = left + 1
function Strong_Boxer_roll(min,max) end
if min==max then return min end while globetrot.pair[right]["second"] >= globetrot.pair[start]["second"] and right > start do
min=tonumber(min) right = right - 1
max=tonumber(max) end
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 if left < right then
if min~=nil then local _first = globetrot.pair[left]["first"]
if max==nil then local _second = globetrot.pair[left]["second"]
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[left]["first"] = globetrot.pair[right]["first"]
return math.floor(random_number*min)+1 globetrot.pair[left]["second"] = globetrot.pair[right]["second"]
else globetrot.pair[right]["first"] = _first
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[right]["second"] = _second
if random_number<min then else
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 break
random_number=Strong_Boxer_random_seed/2147484647
end end
return math.floor((max-min)*random_number)+1+min
end end
local _first = globetrot.pair[start]["first"]
local _second = globetrot.pair[start]["second"]
globetrot.pair[start]["first"] = globetrot.pair[right]["first"]
globetrot.pair[start]["second"] = globetrot.pair[right]["second"]
globetrot.pair[right]["first"] = _first
globetrot.pair[right]["second"] = _second
globetrot.quick_sort(start, right - 1)
globetrot.quick_sort(right + 1, last)
end end
return Strong_Boxer_random_seed end
function globetrot.random(seed,num)
local s = num or 0
seed = math.floor(math.abs(seed))
seed = (seed * 16807) % 2147483647
local n = seed % 5
n = (n < 0) and (n + 5) or n
local res = n + 1
globetrot.quick_sort(1, globetrot.x)
if s <= 3 and res ~= globetrot.pair[1]["first"] and globetrot.pair[globetrot.x]["second"] - globetrot.pair[1]["second"] > 1 then
res = globetrot.pair[1]["first"]
end
return res
end end
end end
if not cm._ then if not cm._ then
...@@ -155,8 +174,16 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -155,8 +174,16 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
cm.A_status[tp+1] = false cm.A_status[tp+1] = false
local x local x
while true do while true do
x = Strong_Boxer_roll(1,5) x = Duel.GetRandomNumber(1,5)
if cm[tostring(x)](c) then break end x = globetrot.random(x)
if cm[tostring(x)](c) then
for i = 1, globetrot.x do
if globetrot.pair[i]["first"] == x then
globetrot.pair[i]["second"] = globetrot.pair[i]["second"] + 1
end
end
break
end
end end
cm._return(c,x) cm._return(c,x)
return false return false
......
...@@ -48,41 +48,60 @@ function cm.initial_effect(c) ...@@ -48,41 +48,60 @@ function cm.initial_effect(c)
e4:SetCondition(cm.con4) e4:SetCondition(cm.con4)
e4:SetOperation(cm.op4) e4:SetOperation(cm.op4)
c:RegisterEffect(e4) c:RegisterEffect(e4)
if not Strong_Boxer_random_seed then if not _globetrot then
local result=0 _globetrot=true
local g=Duel.GetDecktopGroup(0,5) globetrot = {}
local tc=g:GetFirst() globetrot.x = 5
while tc do globetrot.pair = {}
result=result+tc:GetCode() for i = 1, globetrot.x do
tc=g:GetNext() globetrot.pair[i] = {}
end globetrot.pair[i]["first"] = i
local g=Duel.GetDecktopGroup(1,5) globetrot.pair[i]["second"] = 0
local tc=g:GetFirst() end
while tc do function globetrot.quick_sort(start, last)
result=result+tc:GetCode() local left, right = start, last
tc=g:GetNext() if left < right then
end while left < right do
g:DeleteGroup() while globetrot.pair[left]["second"] <= globetrot.pair[start]["second"] and left < last do
Strong_Boxer_random_seed=result left = left + 1
function Strong_Boxer_roll(min,max) end
if min==max then return min end while globetrot.pair[right]["second"] >= globetrot.pair[start]["second"] and right > start do
min=tonumber(min) right = right - 1
max=tonumber(max) end
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 if left < right then
if min~=nil then local _first = globetrot.pair[left]["first"]
if max==nil then local _second = globetrot.pair[left]["second"]
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[left]["first"] = globetrot.pair[right]["first"]
return math.floor(random_number*min)+1 globetrot.pair[left]["second"] = globetrot.pair[right]["second"]
else globetrot.pair[right]["first"] = _first
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[right]["second"] = _second
if random_number<min then else
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 break
random_number=Strong_Boxer_random_seed/2147484647
end end
return math.floor((max-min)*random_number)+1+min
end end
local _first = globetrot.pair[start]["first"]
local _second = globetrot.pair[start]["second"]
globetrot.pair[start]["first"] = globetrot.pair[right]["first"]
globetrot.pair[start]["second"] = globetrot.pair[right]["second"]
globetrot.pair[right]["first"] = _first
globetrot.pair[right]["second"] = _second
globetrot.quick_sort(start, right - 1)
globetrot.quick_sort(right + 1, last)
end end
return Strong_Boxer_random_seed end
function globetrot.random(seed,num)
local s = num or 0
seed = math.floor(math.abs(seed))
seed = (seed * 16807) % 2147483647
local n = seed % 5
n = (n < 0) and (n + 5) or n
local res = n + 1
globetrot.quick_sort(1, globetrot.x)
if s <= 3 and res ~= globetrot.pair[1]["first"] and globetrot.pair[globetrot.x]["second"] - globetrot.pair[1]["second"] > 1 then
res = globetrot.pair[1]["first"]
end
return res
end end
end end
if not cm._ then if not cm._ then
...@@ -155,8 +174,16 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -155,8 +174,16 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
cm.A_status[tp+1] = false cm.A_status[tp+1] = false
local x local x
while true do while true do
x = Strong_Boxer_roll(1,5) x = Duel.GetRandomNumber(1,5)
if cm[tostring(x)](c) then break end x = globetrot.random(x)
if cm[tostring(x)](c) then
for i = 1, globetrot.x do
if globetrot.pair[i]["first"] == x then
globetrot.pair[i]["second"] = globetrot.pair[i]["second"] + 1
end
end
break
end
end end
cm._return(c,x) cm._return(c,x)
return false return false
......
...@@ -48,41 +48,60 @@ function cm.initial_effect(c) ...@@ -48,41 +48,60 @@ function cm.initial_effect(c)
e4:SetCondition(cm.con4) e4:SetCondition(cm.con4)
e4:SetOperation(cm.op4) e4:SetOperation(cm.op4)
c:RegisterEffect(e4) c:RegisterEffect(e4)
if not Strong_Boxer_random_seed then if not _globetrot then
local result=0 _globetrot=true
local g=Duel.GetDecktopGroup(0,5) globetrot = {}
local tc=g:GetFirst() globetrot.x = 5
while tc do globetrot.pair = {}
result=result+tc:GetCode() for i = 1, globetrot.x do
tc=g:GetNext() globetrot.pair[i] = {}
end globetrot.pair[i]["first"] = i
local g=Duel.GetDecktopGroup(1,5) globetrot.pair[i]["second"] = 0
local tc=g:GetFirst() end
while tc do function globetrot.quick_sort(start, last)
result=result+tc:GetCode() local left, right = start, last
tc=g:GetNext() if left < right then
end while left < right do
g:DeleteGroup() while globetrot.pair[left]["second"] <= globetrot.pair[start]["second"] and left < last do
Strong_Boxer_random_seed=result left = left + 1
function Strong_Boxer_roll(min,max) end
if min==max then return min end while globetrot.pair[right]["second"] >= globetrot.pair[start]["second"] and right > start do
min=tonumber(min) right = right - 1
max=tonumber(max) end
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 if left < right then
if min~=nil then local _first = globetrot.pair[left]["first"]
if max==nil then local _second = globetrot.pair[left]["second"]
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[left]["first"] = globetrot.pair[right]["first"]
return math.floor(random_number*min)+1 globetrot.pair[left]["second"] = globetrot.pair[right]["second"]
else globetrot.pair[right]["first"] = _first
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[right]["second"] = _second
if random_number<min then else
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 break
random_number=Strong_Boxer_random_seed/2147484647
end end
return math.floor((max-min)*random_number)+1+min
end end
local _first = globetrot.pair[start]["first"]
local _second = globetrot.pair[start]["second"]
globetrot.pair[start]["first"] = globetrot.pair[right]["first"]
globetrot.pair[start]["second"] = globetrot.pair[right]["second"]
globetrot.pair[right]["first"] = _first
globetrot.pair[right]["second"] = _second
globetrot.quick_sort(start, right - 1)
globetrot.quick_sort(right + 1, last)
end end
return Strong_Boxer_random_seed end
function globetrot.random(seed,num)
local s = num or 0
seed = math.floor(math.abs(seed))
seed = (seed * 16807) % 2147483647
local n = seed % 5
n = (n < 0) and (n + 5) or n
local res = n + 1
globetrot.quick_sort(1, globetrot.x)
if s <= 3 and res ~= globetrot.pair[1]["first"] and globetrot.pair[globetrot.x]["second"] - globetrot.pair[1]["second"] > 1 then
res = globetrot.pair[1]["first"]
end
return res
end end
end end
if not cm._ then if not cm._ then
...@@ -155,8 +174,16 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -155,8 +174,16 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
cm.A_status[tp+1] = false cm.A_status[tp+1] = false
local x local x
while true do while true do
x = Strong_Boxer_roll(1,5) x = Duel.GetRandomNumber(1,5)
if cm[tostring(x)](c) then break end x = globetrot.random(x)
if cm[tostring(x)](c) then
for i = 1, globetrot.x do
if globetrot.pair[i]["first"] == x then
globetrot.pair[i]["second"] = globetrot.pair[i]["second"] + 1
end
end
break
end
end end
cm._return(c,x) cm._return(c,x)
return false return false
......
...@@ -48,41 +48,60 @@ function cm.initial_effect(c) ...@@ -48,41 +48,60 @@ function cm.initial_effect(c)
e4:SetCondition(cm.con4) e4:SetCondition(cm.con4)
e4:SetOperation(cm.op4) e4:SetOperation(cm.op4)
c:RegisterEffect(e4) c:RegisterEffect(e4)
if not Strong_Boxer_random_seed then if not _globetrot then
local result=0 _globetrot=true
local g=Duel.GetDecktopGroup(0,5) globetrot = {}
local tc=g:GetFirst() globetrot.x = 5
while tc do globetrot.pair = {}
result=result+tc:GetCode() for i = 1, globetrot.x do
tc=g:GetNext() globetrot.pair[i] = {}
end globetrot.pair[i]["first"] = i
local g=Duel.GetDecktopGroup(1,5) globetrot.pair[i]["second"] = 0
local tc=g:GetFirst() end
while tc do function globetrot.quick_sort(start, last)
result=result+tc:GetCode() local left, right = start, last
tc=g:GetNext() if left < right then
end while left < right do
g:DeleteGroup() while globetrot.pair[left]["second"] <= globetrot.pair[start]["second"] and left < last do
Strong_Boxer_random_seed=result left = left + 1
function Strong_Boxer_roll(min,max) end
if min==max then return min end while globetrot.pair[right]["second"] >= globetrot.pair[start]["second"] and right > start do
min=tonumber(min) right = right - 1
max=tonumber(max) end
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 if left < right then
if min~=nil then local _first = globetrot.pair[left]["first"]
if max==nil then local _second = globetrot.pair[left]["second"]
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[left]["first"] = globetrot.pair[right]["first"]
return math.floor(random_number*min)+1 globetrot.pair[left]["second"] = globetrot.pair[right]["second"]
else globetrot.pair[right]["first"] = _first
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[right]["second"] = _second
if random_number<min then else
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 break
random_number=Strong_Boxer_random_seed/2147484647
end end
return math.floor((max-min)*random_number)+1+min
end end
local _first = globetrot.pair[start]["first"]
local _second = globetrot.pair[start]["second"]
globetrot.pair[start]["first"] = globetrot.pair[right]["first"]
globetrot.pair[start]["second"] = globetrot.pair[right]["second"]
globetrot.pair[right]["first"] = _first
globetrot.pair[right]["second"] = _second
globetrot.quick_sort(start, right - 1)
globetrot.quick_sort(right + 1, last)
end end
return Strong_Boxer_random_seed end
function globetrot.random(seed,num)
local s = num or 0
seed = math.floor(math.abs(seed))
seed = (seed * 16807) % 2147483647
local n = seed % 5
n = (n < 0) and (n + 5) or n
local res = n + 1
globetrot.quick_sort(1, globetrot.x)
if s <= 3 and res ~= globetrot.pair[1]["first"] and globetrot.pair[globetrot.x]["second"] - globetrot.pair[1]["second"] > 1 then
res = globetrot.pair[1]["first"]
end
return res
end end
end end
if not cm._ then if not cm._ then
...@@ -155,8 +174,16 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -155,8 +174,16 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
cm.A_status[tp+1] = false cm.A_status[tp+1] = false
local x local x
while true do while true do
x = Strong_Boxer_roll(1,5) x = Duel.GetRandomNumber(1,5)
if cm[tostring(x)](c) then break end x = globetrot.random(x)
if cm[tostring(x)](c) then
for i = 1, globetrot.x do
if globetrot.pair[i]["first"] == x then
globetrot.pair[i]["second"] = globetrot.pair[i]["second"] + 1
end
end
break
end
end end
cm._return(c,x) cm._return(c,x)
return false return false
......
...@@ -48,41 +48,60 @@ function cm.initial_effect(c) ...@@ -48,41 +48,60 @@ function cm.initial_effect(c)
e4:SetCondition(cm.con4) e4:SetCondition(cm.con4)
e4:SetOperation(cm.op4) e4:SetOperation(cm.op4)
c:RegisterEffect(e4) c:RegisterEffect(e4)
if not Strong_Boxer_random_seed then if not _globetrot then
local result=0 _globetrot=true
local g=Duel.GetDecktopGroup(0,5) globetrot = {}
local tc=g:GetFirst() globetrot.x = 5
while tc do globetrot.pair = {}
result=result+tc:GetCode() for i = 1, globetrot.x do
tc=g:GetNext() globetrot.pair[i] = {}
end globetrot.pair[i]["first"] = i
local g=Duel.GetDecktopGroup(1,5) globetrot.pair[i]["second"] = 0
local tc=g:GetFirst() end
while tc do function globetrot.quick_sort(start, last)
result=result+tc:GetCode() local left, right = start, last
tc=g:GetNext() if left < right then
end while left < right do
g:DeleteGroup() while globetrot.pair[left]["second"] <= globetrot.pair[start]["second"] and left < last do
Strong_Boxer_random_seed=result left = left + 1
function Strong_Boxer_roll(min,max) end
if min==max then return min end while globetrot.pair[right]["second"] >= globetrot.pair[start]["second"] and right > start do
min=tonumber(min) right = right - 1
max=tonumber(max) end
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 if left < right then
if min~=nil then local _first = globetrot.pair[left]["first"]
if max==nil then local _second = globetrot.pair[left]["second"]
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[left]["first"] = globetrot.pair[right]["first"]
return math.floor(random_number*min)+1 globetrot.pair[left]["second"] = globetrot.pair[right]["second"]
else globetrot.pair[right]["first"] = _first
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[right]["second"] = _second
if random_number<min then else
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 break
random_number=Strong_Boxer_random_seed/2147484647
end end
return math.floor((max-min)*random_number)+1+min
end end
local _first = globetrot.pair[start]["first"]
local _second = globetrot.pair[start]["second"]
globetrot.pair[start]["first"] = globetrot.pair[right]["first"]
globetrot.pair[start]["second"] = globetrot.pair[right]["second"]
globetrot.pair[right]["first"] = _first
globetrot.pair[right]["second"] = _second
globetrot.quick_sort(start, right - 1)
globetrot.quick_sort(right + 1, last)
end end
return Strong_Boxer_random_seed end
function globetrot.random(seed,num)
local s = num or 0
seed = math.floor(math.abs(seed))
seed = (seed * 16807) % 2147483647
local n = seed % 5
n = (n < 0) and (n + 5) or n
local res = n + 1
globetrot.quick_sort(1, globetrot.x)
if s <= 3 and res ~= globetrot.pair[1]["first"] and globetrot.pair[globetrot.x]["second"] - globetrot.pair[1]["second"] > 1 then
res = globetrot.pair[1]["first"]
end
return res
end end
end end
if not cm._ then if not cm._ then
...@@ -155,8 +174,16 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -155,8 +174,16 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
cm.A_status[tp+1] = false cm.A_status[tp+1] = false
local x local x
while true do while true do
x = Strong_Boxer_roll(1,5) x = Duel.GetRandomNumber(1,5)
if cm[tostring(x)](c) then break end x = globetrot.random(x)
if cm[tostring(x)](c) then
for i = 1, globetrot.x do
if globetrot.pair[i]["first"] == x then
globetrot.pair[i]["second"] = globetrot.pair[i]["second"] + 1
end
end
break
end
end end
cm._return(c,x) cm._return(c,x)
return false return false
......
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