Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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
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
nanahira
ygopro-core
Commits
60484c53
Commit
60484c53
authored
Oct 31, 2021
by
mercury233
Committed by
GitHub
Oct 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Duel.SendtoDeck shuffle (#411)
parent
b2867197
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
10 deletions
+24
-10
common.h
common.h
+5
-0
field.cpp
field.cpp
+18
-9
libdebug.cpp
libdebug.cpp
+1
-1
No files found.
common.h
View file @
60484c53
...
...
@@ -53,6 +53,10 @@ struct card_sort {
//For redirect
#define LOCATION_DECKBOT 0x10001 //Return to deck bottom
#define LOCATION_DECKSHF 0x20001 //Return to deck and shuffle
//For Duel.SendtoDeck
#define SEQ_DECKTOP 0 //Return to deck top
#define SEQ_DECKBOTTOM 1 //Return to deck bottom
#define SEQ_DECKSHUFFLE 2 //Return to deck and shuffle
//Positions
#define POS_FACEUP_ATTACK 0x1
...
...
@@ -390,6 +394,7 @@ struct card_sort {
#define DUEL_PSEUDO_SHUFFLE 0x10
#define DUEL_TAG_MODE 0x20
#define DUEL_SIMPLE_AI 0x40
#define DUEL_RETURN_DECK_TOP 0x80
//Activity
#define ACTIVITY_SUMMON 1
...
...
field.cpp
View file @
60484c53
...
...
@@ -137,15 +137,21 @@ void field::add_card(uint8 playerid, card* pcard, uint8 location, uint8 sequence
break
;
}
case
LOCATION_DECK
:
{
if
(
sequence
==
0
)
{
//deck top
if
(
sequence
==
SEQ_DECKTOP
)
{
player
[
playerid
].
list_main
.
push_back
(
pcard
);
pcard
->
current
.
sequence
=
(
uint8
)
player
[
playerid
].
list_main
.
size
()
-
1
;
}
else
if
(
sequence
==
1
)
{
//deck bottom
}
else
if
(
sequence
==
SEQ_DECKBOTTOM
)
{
player
[
playerid
].
list_main
.
insert
(
player
[
playerid
].
list_main
.
begin
(),
pcard
);
reset_sequence
(
playerid
,
LOCATION_DECK
);
}
else
{
//deck top & shuffle
player
[
playerid
].
list_main
.
push_back
(
pcard
);
pcard
->
current
.
sequence
=
(
uint8
)
player
[
playerid
].
list_main
.
size
()
-
1
;
}
else
{
// SEQ_DECKSHUFFLE
if
(
core
.
duel_options
&
DUEL_RETURN_DECK_TOP
)
{
player
[
playerid
].
list_main
.
push_back
(
pcard
);
pcard
->
current
.
sequence
=
(
uint8
)
player
[
playerid
].
list_main
.
size
()
-
1
;
}
else
{
player
[
playerid
].
list_main
.
insert
(
player
[
playerid
].
list_main
.
begin
(),
pcard
);
reset_sequence
(
playerid
,
LOCATION_DECK
);
}
if
(
!
core
.
shuffle_check_disabled
)
core
.
shuffle_deck_check
[
playerid
]
=
TRUE
;
}
...
...
@@ -264,12 +270,15 @@ void field::move_card(uint8 playerid, card* pcard, uint8 location, uint8 sequenc
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer32
(
pcard
->
get_info_location
());
player
[
preplayer
].
list_main
.
erase
(
player
[
preplayer
].
list_main
.
begin
()
+
pcard
->
current
.
sequence
);
if
(
sequence
==
0
)
{
//deck top
if
(
sequence
==
SEQ_DECKTOP
)
{
player
[
playerid
].
list_main
.
push_back
(
pcard
);
}
else
if
(
sequence
==
1
)
{
}
else
if
(
sequence
==
SEQ_DECKBOTTOM
)
{
player
[
playerid
].
list_main
.
insert
(
player
[
playerid
].
list_main
.
begin
(),
pcard
);
}
else
{
player
[
playerid
].
list_main
.
push_back
(
pcard
);
}
else
{
// SEQ_DECKSHUFFLE
if
(
core
.
duel_options
&
DUEL_RETURN_DECK_TOP
)
player
[
playerid
].
list_main
.
push_back
(
pcard
);
else
player
[
playerid
].
list_main
.
insert
(
player
[
playerid
].
list_main
.
begin
(),
pcard
);
if
(
!
core
.
shuffle_check_disabled
)
core
.
shuffle_deck_check
[
playerid
]
=
TRUE
;
}
...
...
libdebug.cpp
View file @
60484c53
...
...
@@ -146,7 +146,7 @@ int32 scriptlib::debug_reload_field_begin(lua_State *L) {
uint32
flag
=
(
uint32
)
lua_tointeger
(
L
,
1
);
int32
rule
=
(
int32
)
lua_tointeger
(
L
,
2
);
pduel
->
clear
();
pduel
->
game_field
->
core
.
duel_options
=
flag
;
pduel
->
game_field
->
core
.
duel_options
|
=
flag
;
if
(
rule
)
pduel
->
game_field
->
core
.
duel_rule
=
rule
;
else
if
(
flag
&
DUEL_OBSOLETE_RULING
)
...
...
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