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] = {}
globetrot.pair[i]["first"] = i
globetrot.pair[i]["second"] = 0
end end
local g=Duel.GetDecktopGroup(1,5) function globetrot.quick_sort(start, last)
local tc=g:GetFirst() local left, right = start, last
while tc do if left < right then
result=result+tc:GetCode() while left < right do
tc=g:GetNext() while globetrot.pair[left]["second"] <= globetrot.pair[start]["second"] and left < last do
left = left + 1
end end
g:DeleteGroup() while globetrot.pair[right]["second"] >= globetrot.pair[start]["second"] and right > start do
Strong_Boxer_random_seed=result right = right - 1
function Strong_Boxer_roll(min,max) end
if min==max then return min end if left < right then
min=tonumber(min) local _first = globetrot.pair[left]["first"]
max=tonumber(max) local _second = globetrot.pair[left]["second"]
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 globetrot.pair[left]["first"] = globetrot.pair[right]["first"]
if min~=nil then globetrot.pair[left]["second"] = globetrot.pair[right]["second"]
if max==nil then globetrot.pair[right]["first"] = _first
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[right]["second"] = _second
return math.floor(random_number*min)+1
else else
local random_number=Strong_Boxer_random_seed/2147484647 break
if random_number<min then end
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647
random_number=Strong_Boxer_random_seed/2147484647
end end
return math.floor((max-min)*random_number)+1+min 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
end end
return Strong_Boxer_random_seed
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] = {}
globetrot.pair[i]["first"] = i
globetrot.pair[i]["second"] = 0
end end
local g=Duel.GetDecktopGroup(1,5) function globetrot.quick_sort(start, last)
local tc=g:GetFirst() local left, right = start, last
while tc do if left < right then
result=result+tc:GetCode() while left < right do
tc=g:GetNext() while globetrot.pair[left]["second"] <= globetrot.pair[start]["second"] and left < last do
left = left + 1
end end
g:DeleteGroup() while globetrot.pair[right]["second"] >= globetrot.pair[start]["second"] and right > start do
Strong_Boxer_random_seed=result right = right - 1
function Strong_Boxer_roll(min,max) end
if min==max then return min end if left < right then
min=tonumber(min) local _first = globetrot.pair[left]["first"]
max=tonumber(max) local _second = globetrot.pair[left]["second"]
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 globetrot.pair[left]["first"] = globetrot.pair[right]["first"]
if min~=nil then globetrot.pair[left]["second"] = globetrot.pair[right]["second"]
if max==nil then globetrot.pair[right]["first"] = _first
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[right]["second"] = _second
return math.floor(random_number*min)+1
else else
local random_number=Strong_Boxer_random_seed/2147484647 break
if random_number<min then end
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647
random_number=Strong_Boxer_random_seed/2147484647
end end
return math.floor((max-min)*random_number)+1+min 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
end end
return Strong_Boxer_random_seed
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] = {}
globetrot.pair[i]["first"] = i
globetrot.pair[i]["second"] = 0
end end
local g=Duel.GetDecktopGroup(1,5) function globetrot.quick_sort(start, last)
local tc=g:GetFirst() local left, right = start, last
while tc do if left < right then
result=result+tc:GetCode() while left < right do
tc=g:GetNext() while globetrot.pair[left]["second"] <= globetrot.pair[start]["second"] and left < last do
left = left + 1
end end
g:DeleteGroup() while globetrot.pair[right]["second"] >= globetrot.pair[start]["second"] and right > start do
Strong_Boxer_random_seed=result right = right - 1
function Strong_Boxer_roll(min,max) end
if min==max then return min end if left < right then
min=tonumber(min) local _first = globetrot.pair[left]["first"]
max=tonumber(max) local _second = globetrot.pair[left]["second"]
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 globetrot.pair[left]["first"] = globetrot.pair[right]["first"]
if min~=nil then globetrot.pair[left]["second"] = globetrot.pair[right]["second"]
if max==nil then globetrot.pair[right]["first"] = _first
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[right]["second"] = _second
return math.floor(random_number*min)+1
else else
local random_number=Strong_Boxer_random_seed/2147484647 break
if random_number<min then end
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647
random_number=Strong_Boxer_random_seed/2147484647
end end
return math.floor((max-min)*random_number)+1+min 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
end end
return Strong_Boxer_random_seed
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] = {}
globetrot.pair[i]["first"] = i
globetrot.pair[i]["second"] = 0
end end
local g=Duel.GetDecktopGroup(1,5) function globetrot.quick_sort(start, last)
local tc=g:GetFirst() local left, right = start, last
while tc do if left < right then
result=result+tc:GetCode() while left < right do
tc=g:GetNext() while globetrot.pair[left]["second"] <= globetrot.pair[start]["second"] and left < last do
left = left + 1
end end
g:DeleteGroup() while globetrot.pair[right]["second"] >= globetrot.pair[start]["second"] and right > start do
Strong_Boxer_random_seed=result right = right - 1
function Strong_Boxer_roll(min,max) end
if min==max then return min end if left < right then
min=tonumber(min) local _first = globetrot.pair[left]["first"]
max=tonumber(max) local _second = globetrot.pair[left]["second"]
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 globetrot.pair[left]["first"] = globetrot.pair[right]["first"]
if min~=nil then globetrot.pair[left]["second"] = globetrot.pair[right]["second"]
if max==nil then globetrot.pair[right]["first"] = _first
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[right]["second"] = _second
return math.floor(random_number*min)+1
else else
local random_number=Strong_Boxer_random_seed/2147484647 break
if random_number<min then end
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647
random_number=Strong_Boxer_random_seed/2147484647
end end
return math.floor((max-min)*random_number)+1+min 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
end end
return Strong_Boxer_random_seed
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] = {}
globetrot.pair[i]["first"] = i
globetrot.pair[i]["second"] = 0
end end
local g=Duel.GetDecktopGroup(1,5) function globetrot.quick_sort(start, last)
local tc=g:GetFirst() local left, right = start, last
while tc do if left < right then
result=result+tc:GetCode() while left < right do
tc=g:GetNext() while globetrot.pair[left]["second"] <= globetrot.pair[start]["second"] and left < last do
left = left + 1
end end
g:DeleteGroup() while globetrot.pair[right]["second"] >= globetrot.pair[start]["second"] and right > start do
Strong_Boxer_random_seed=result right = right - 1
function Strong_Boxer_roll(min,max) end
if min==max then return min end if left < right then
min=tonumber(min) local _first = globetrot.pair[left]["first"]
max=tonumber(max) local _second = globetrot.pair[left]["second"]
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 globetrot.pair[left]["first"] = globetrot.pair[right]["first"]
if min~=nil then globetrot.pair[left]["second"] = globetrot.pair[right]["second"]
if max==nil then globetrot.pair[right]["first"] = _first
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[right]["second"] = _second
return math.floor(random_number*min)+1
else else
local random_number=Strong_Boxer_random_seed/2147484647 break
if random_number<min then end
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647
random_number=Strong_Boxer_random_seed/2147484647
end end
return math.floor((max-min)*random_number)+1+min 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
end end
return Strong_Boxer_random_seed
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] = {}
globetrot.pair[i]["first"] = i
globetrot.pair[i]["second"] = 0
end end
local g=Duel.GetDecktopGroup(1,5) function globetrot.quick_sort(start, last)
local tc=g:GetFirst() local left, right = start, last
while tc do if left < right then
result=result+tc:GetCode() while left < right do
tc=g:GetNext() while globetrot.pair[left]["second"] <= globetrot.pair[start]["second"] and left < last do
left = left + 1
end end
g:DeleteGroup() while globetrot.pair[right]["second"] >= globetrot.pair[start]["second"] and right > start do
Strong_Boxer_random_seed=result right = right - 1
function Strong_Boxer_roll(min,max) end
if min==max then return min end if left < right then
min=tonumber(min) local _first = globetrot.pair[left]["first"]
max=tonumber(max) local _second = globetrot.pair[left]["second"]
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647 globetrot.pair[left]["first"] = globetrot.pair[right]["first"]
if min~=nil then globetrot.pair[left]["second"] = globetrot.pair[right]["second"]
if max==nil then globetrot.pair[right]["first"] = _first
local random_number=Strong_Boxer_random_seed/2147484647 globetrot.pair[right]["second"] = _second
return math.floor(random_number*min)+1
else else
local random_number=Strong_Boxer_random_seed/2147484647 break
if random_number<min then end
Strong_Boxer_random_seed=(Strong_Boxer_random_seed*16807)%2147484647
random_number=Strong_Boxer_random_seed/2147484647
end end
return math.floor((max-min)*random_number)+1+min 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
end end
return Strong_Boxer_random_seed
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