Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-THC-cards
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HiiragiGuardians
ygopro-THC-cards
Commits
6dff98bd
Commit
6dff98bd
authored
Jun 01, 2023
by
wyykak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace math.random with Duel.GetRandomNumber
Signed-off-by:
wyykak
<
wyy_1414@126.com
>
parent
1fcecead
Pipeline
#22036
passed with stage
in 1 minute and 19 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
51 deletions
+9
-51
expansions/script/nef/nef.lua
expansions/script/nef/nef.lua
+0
-25
script/c13959998.lua
script/c13959998.lua
+5
-8
script/c200305.lua
script/c200305.lua
+0
-7
script/c74561005.lua
script/c74561005.lua
+0
-2
script/c74561405.lua
script/c74561405.lua
+2
-5
script/c99999008.lua
script/c99999008.lua
+2
-4
No files found.
expansions/script/nef/nef.lua
View file @
6dff98bd
...
...
@@ -411,13 +411,6 @@ function Nef.GetFieldRightScale(tp)
end
end
-- function Nef.PendSummonLimitTarget(e,c,sump,sumtype,sumpos,targetp)
-- local c = nil
-- if e then c = e:GetHandler() end
-- return c and sumtype==SUMMON_TYPE_PENDULUM and _G["c" .. c:GetOriginalCode()].pend_filter==nil
-- and (c == Duel.GetFieldCard(tp,LOCATION_SZONE, 6) or c == Duel.GetFieldCard(tp,LOCATION_SZONE, 7))
-- end
function
Nef
.
EnableDualAttributeSP
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
...
@@ -455,28 +448,10 @@ function Nef.GetDate()
return
date
.
year
,
date
.
month
,
date
.
day
end
function
Nef
.
Log
(
message
)
-- if AI and AI.Chat ~= nil then AI.Chat(message) end
end
function
Nef
.
LogFormat
(
fmt
,
...
)
Debug
.
Message
(
string.format
(
fmt
,
...
))
end
function
Nef
.
GetRandomCardCode
(
num
,
command
)
-- local result = {}
-- local commandList = {
-- [0] = "Main",
-- [1] = "Extra"
-- }
-- local cardType = commandList[command]
-- for i=1,num do
-- local r = math.random(1,#CardList[cardType])
-- result[i] = CardList[cardType][r]
-- end
-- return result
end
function
Nef
.
kangbazi
(
e
,
te
)
if
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
IsActivated
()
then
local
ec
=
te
:
GetOwner
()
...
...
script/c13959998.lua
View file @
6dff98bd
...
...
@@ -148,9 +148,6 @@ end
function
this
.
op
(
e
,
tp
)
this
.
isPicking
=
true
if
Duel
.
GetTurnCount
()
==
1
then
math.randomseed
(
this
.
seed3
())
end
this
.
saveDeck
(
0
)
this
.
saveDeck
(
1
)
this
.
drawCount
=
Duel
.
GetFieldGroupCount
(
0
,
LOCATION_HAND
,
0
)
...
...
@@ -260,10 +257,10 @@ function this.ccGen(from,count)
end
local
g
=
{}
for
i
=
1
,
count
do
local
temp
=
this
.
CardList
[
from
][
math.random
(
1
,
#
this
.
CardList
[
from
])]
local
temp
=
this
.
CardList
[
from
][
Duel
.
GetRandomNumber
(
1
,
#
this
.
CardList
[
from
])]
local
at
=
this
.
CardList
[
from
..
"AliasTable"
]
if
#
at
[
temp
]
>
1
then
g
[
i
]
=
at
[
temp
][
math.random
(
1
,
#
at
[
temp
])]
g
[
i
]
=
at
[
temp
][
Duel
.
GetRandomNumber
(
1
,
#
at
[
temp
])]
else
g
[
i
]
=
temp
end
...
...
@@ -749,10 +746,10 @@ function this.picrandom(g)
for
_
,
v
in
pairs
(
g
)
do
if
this
.
CardList
.
MainAliasTable
[
v
]
then
local
at
=
this
.
CardList
.
MainAliasTable
rg
[
#
rg
+
1
]
=
at
[
v
][
math.random
(
1
,
#
at
[
v
])]
rg
[
#
rg
+
1
]
=
at
[
v
][
Duel
.
GetRandomNumber
(
1
,
#
at
[
v
])]
elseif
this
.
CardList
.
ExtraAliasTable
[
v
]
then
local
at
=
this
.
CardList
.
ExtraAliasTable
rg
[
#
rg
+
1
]
=
at
[
v
][
math.random
(
1
,
#
at
[
v
])]
rg
[
#
rg
+
1
]
=
at
[
v
][
Duel
.
GetRandomNumber
(
1
,
#
at
[
v
])]
else
rg
[
#
rg
+
1
]
=
v
end
...
...
@@ -768,7 +765,7 @@ function this.sample(g,ct)
if
i
>
cct
then
break
end
local
idx
=
math.random
(
1
,
cct
-
i
+
1
)
local
idx
=
Duel
.
GetRandomNumber
(
1
,
cct
-
i
+
1
)
rg
[
#
rg
+
1
]
=
g
[
idx
]
if
idx
<
cct
-
i
+
1
then
...
...
script/c200305.lua
View file @
6dff98bd
...
...
@@ -26,13 +26,6 @@ end
function
c200305
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c200305
.
filter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
--[[
local rand=math.random(1,g:GetCount())
local tc=g:GetFirst()
while rand>1 do
tc=g:GetNext()
rand=rand-1
end]]
tc
=
g
:
RandomSelect
(
tp
,
1
)
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
...
...
script/c74561005.lua
View file @
6dff98bd
...
...
@@ -112,8 +112,6 @@ function cCardno.operation(e,tp,eg,ep,ev,re,r,rp)
local
d1
,
d2
=
Duel
.
TossDice
(
tp
,
2
)
local
dice
=
d1
+
d2
--math.randomseed(os.time())
--local dice = math.random(1,12)
Duel
.
Hint
(
HINT_NUMBER
,
tp
,
dice
)
local
e1
=
Effect
.
CreateEffect
(
c
)
...
...
script/c74561405.lua
View file @
6dff98bd
...
...
@@ -109,11 +109,8 @@ function cCardno.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function
cCardno
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
--local d1,d2=Duel.TossDice(tp,2)
--local dice = d1+d2
math.randomseed
(
os.time
())
local
dice
=
math.random
(
1
,
12
)
local
dice
=
Duel
.
GetRandomNumber
(
1
,
12
)
Duel
.
Hint
(
HINT_NUMBER
,
tp
,
dice
)
local
e1
=
Effect
.
CreateEffect
(
c
)
...
...
script/c99999008.lua
View file @
6dff98bd
...
...
@@ -59,8 +59,7 @@ function c99999008.tg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function
c99999008
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
math.randomseed
(
os.time
())
local
dice
=
math.random
(
1
,
12
)
local
dice
=
Duel
.
GetRandomNumber
(
1
,
12
)
Duel
.
Hint
(
HINT_NUMBER
,
tp
,
dice
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
...
@@ -102,8 +101,7 @@ function c99999008.thop1(e,tp,eg,ep,ev,re,r,rp)
Duel
.
HintSelection
(
g
)
g
:
GetFirst
():
AddCounter
(
0x1999
,
1
)
end
math.randomseed
(
os.time
())
local
dice
=
math.random
(
1
,
12
)
local
dice
=
Duel
.
GetRandomNumber
(
1
,
12
)
Duel
.
Hint
(
HINT_NUMBER
,
tp
,
dice
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment