Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-scripts-888
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
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
MyCard
ygopro-scripts-888
Commits
2d2045d5
Commit
2d2045d5
authored
Sep 22, 2021
by
salix5
Committed by
GitHub
Sep 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: change dice (#1705)
Now the player will choose the index of the results, not the rolled number.
parent
673e137e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
c35772782.lua
c35772782.lua
+5
-4
c39454112.lua
c39454112.lua
+5
-4
utility.lua
utility.lua
+4
-0
No files found.
c35772782.lua
View file @
2d2045d5
...
@@ -84,19 +84,20 @@ end
...
@@ -84,19 +84,20 @@ end
function
c35772782
.
diceop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c35772782
.
diceop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cc
=
Duel
.
GetCurrentChain
()
local
cc
=
Duel
.
GetCurrentChain
()
local
cid
=
Duel
.
GetChainInfo
(
cc
,
CHAININFO_CHAIN_ID
)
local
cid
=
Duel
.
GetChainInfo
(
cc
,
CHAININFO_CHAIN_ID
)
if
c35772782
[
0
]
~=
cid
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
35772782
,
1
))
then
if
aux
.
dice_chain_id
~=
cid
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
35772782
,
1
))
then
Duel
.
Hint
(
HINT_CARD
,
0
,
35772782
)
Duel
.
Hint
(
HINT_CARD
,
0
,
35772782
)
e
:
GetHandler
():
RegisterFlagEffect
(
35772782
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
e
:
GetHandler
():
RegisterFlagEffect
(
35772782
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
local
dc
=
{
Duel
.
GetDiceResult
()}
local
dc
=
{
Duel
.
GetDiceResult
()}
local
ac
=
1
local
ac
=
1
local
ct
=
bit
.
band
(
ev
,
0xff
)
+
bit
.
rshift
(
ev
,
16
)
local
ct
=
(
ev
&
0xff
)
+
(
ev
>>
16
&
0xff
)
if
ct
>
1
then
if
ct
>
1
then
--choose the index of results
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
35772782
,
2
))
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
35772782
,
2
))
local
val
,
idx
=
Duel
.
AnnounceNumber
(
tp
,
table.unpack
(
dc
,
1
,
ct
))
local
val
,
idx
=
Duel
.
AnnounceNumber
(
tp
,
table.unpack
(
aux
.
idx_table
,
1
,
ct
))
ac
=
idx
+
1
ac
=
idx
+
1
end
end
dc
[
ac
]
=
7
dc
[
ac
]
=
7
Duel
.
SetDiceResult
(
table.unpack
(
dc
))
Duel
.
SetDiceResult
(
table.unpack
(
dc
))
c35772782
[
0
]
=
cid
aux
.
dice_chain_id
=
cid
end
end
end
end
c39454112.lua
View file @
2d2045d5
...
@@ -16,19 +16,20 @@ end
...
@@ -16,19 +16,20 @@ end
function
c39454112
.
diceop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c39454112
.
diceop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cc
=
Duel
.
GetCurrentChain
()
local
cc
=
Duel
.
GetCurrentChain
()
local
cid
=
Duel
.
GetChainInfo
(
cc
,
CHAININFO_CHAIN_ID
)
local
cid
=
Duel
.
GetChainInfo
(
cc
,
CHAININFO_CHAIN_ID
)
if
c39454112
[
0
]
~=
cid
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
39454112
,
0
))
then
if
aux
.
dice_chain_id
~=
cid
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
39454112
,
0
))
then
Duel
.
Hint
(
HINT_CARD
,
0
,
39454112
)
Duel
.
Hint
(
HINT_CARD
,
0
,
39454112
)
local
dc
=
{
Duel
.
GetDiceResult
()}
local
dc
=
{
Duel
.
GetDiceResult
()}
local
ac
=
1
local
ac
=
1
local
ct
=
bit
.
band
(
ev
,
0xff
)
+
bit
.
rshift
(
ev
,
16
)
local
ct
=
(
ev
&
0xff
)
+
(
ev
>>
16
&
0xff
)
if
ct
>
1
then
if
ct
>
1
then
--choose the index of results
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
39454112
,
1
))
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
39454112
,
1
))
local
val
,
idx
=
Duel
.
AnnounceNumber
(
tp
,
table.unpack
(
dc
,
1
,
ct
))
local
val
,
idx
=
Duel
.
AnnounceNumber
(
tp
,
table.unpack
(
aux
.
idx_table
,
1
,
ct
))
ac
=
idx
+
1
ac
=
idx
+
1
end
end
if
dc
[
ac
]
==
1
or
dc
[
ac
]
==
3
or
dc
[
ac
]
==
5
then
dc
[
ac
]
=
6
if
dc
[
ac
]
==
1
or
dc
[
ac
]
==
3
or
dc
[
ac
]
==
5
then
dc
[
ac
]
=
6
else
dc
[
ac
]
=
1
end
else
dc
[
ac
]
=
1
end
Duel
.
SetDiceResult
(
table.unpack
(
dc
))
Duel
.
SetDiceResult
(
table.unpack
(
dc
))
c39454112
[
0
]
=
cid
aux
.
dice_chain_id
=
cid
end
end
end
end
utility.lua
View file @
2d2045d5
...
@@ -40,6 +40,10 @@ function bit.replace(r,v,field,width)
...
@@ -40,6 +40,10 @@ function bit.replace(r,v,field,width)
return
(
r
&~
(
m
<<
f
))
|
((
v
&
m
)
<<
f
)
return
(
r
&~
(
m
<<
f
))
|
((
v
&
m
)
<<
f
)
end
end
--the chain id of the results modified by EVENT_TOSS_DICE_NEGATE
Auxiliary
.
dice_chain_id
=
0
Auxiliary
.
idx_table
=
table.pack
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
)
function
Auxiliary
.
Stringid
(
code
,
id
)
function
Auxiliary
.
Stringid
(
code
,
id
)
return
code
*
16
+
id
return
code
*
16
+
id
end
end
...
...
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