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
439288c0
Commit
439288c0
authored
May 28, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'patch-deck-seq-oppo' of github.com:Fluorohydride/ygopro-core into develop
parents
a3b75211
2067edc9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
25 deletions
+21
-25
card.cpp
card.cpp
+3
-3
field.h
field.h
+1
-0
playerop.cpp
playerop.cpp
+17
-22
No files found.
card.cpp
View file @
439288c0
...
@@ -97,7 +97,7 @@ bool card::card_operation_sort(card* c1, card* c2) {
...
@@ -97,7 +97,7 @@ bool card::card_operation_sort(card* c1, card* c2) {
return
c1
->
overlay_target
->
current
.
sequence
<
c2
->
overlay_target
->
current
.
sequence
;
return
c1
->
overlay_target
->
current
.
sequence
<
c2
->
overlay_target
->
current
.
sequence
;
else
else
return
c1
->
current
.
sequence
<
c2
->
current
.
sequence
;
return
c1
->
current
.
sequence
<
c2
->
current
.
sequence
;
}
else
if
(
c1
->
current
.
location
&
LOCATION_DECK
&&
!
pduel
->
game_field
->
core
.
select_deck_seq_preserved
)
{
}
else
if
(
c1
->
current
.
location
&
LOCATION_DECK
&&
cp1
==
pduel
->
game_field
->
core
.
selecting_player
&&
!
pduel
->
game_field
->
core
.
select_deck_seq_preserved
)
{
// if deck reversed and the card being at the top, it should go first
// if deck reversed and the card being at the top, it should go first
if
(
pduel
->
game_field
->
core
.
deck_reversed
)
{
if
(
pduel
->
game_field
->
core
.
deck_reversed
)
{
if
(
c1
->
current
.
sequence
==
pduel
->
game_field
->
player
[
cp1
].
list_main
.
size
()
-
1
)
if
(
c1
->
current
.
sequence
==
pduel
->
game_field
->
player
[
cp1
].
list_main
.
size
()
-
1
)
...
@@ -1518,8 +1518,8 @@ int32 card::is_all_column() {
...
@@ -1518,8 +1518,8 @@ int32 card::is_all_column() {
return
FALSE
;
return
FALSE
;
}
}
uint8
card
::
get_select_sequence
(
uint8
*
deck_seq_pointer
)
{
uint8
card
::
get_select_sequence
(
uint8
*
deck_seq_pointer
)
{
if
(
current
.
location
==
LOCATION_DECK
&&
!
pduel
->
game_field
->
core
.
select_deck_seq_preserved
)
{
if
(
current
.
location
==
LOCATION_DECK
&&
current
.
controler
==
pduel
->
game_field
->
core
.
selecting_player
&&
!
pduel
->
game_field
->
core
.
select_deck_seq_preserved
)
{
return
deck_seq_pointer
[
current
.
controler
]
++
;
return
*
deck_seq_pointer
++
;
}
else
{
}
else
{
return
current
.
sequence
;
return
current
.
sequence
;
}
}
...
...
field.h
View file @
439288c0
...
@@ -348,6 +348,7 @@ struct processor {
...
@@ -348,6 +348,7 @@ struct processor {
uint8
current_player
{
PLAYER_NONE
};
uint8
current_player
{
PLAYER_NONE
};
uint8
conti_player
{
PLAYER_NONE
};
uint8
conti_player
{
PLAYER_NONE
};
uint8
select_deck_seq_preserved
{
FALSE
};
uint8
select_deck_seq_preserved
{
FALSE
};
uint8
selecting_player
{
PLAYER_NONE
};
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>>
summon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>>
summon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>>
normalsummon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>>
normalsummon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>>
spsummon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>>
spsummon_counter
;
...
...
playerop.cpp
View file @
439288c0
...
@@ -226,6 +226,7 @@ int32 field::select_card(uint16 step, uint8 playerid, uint8 cancelable, uint8 mi
...
@@ -226,6 +226,7 @@ int32 field::select_card(uint16 step, uint8 playerid, uint8 cancelable, uint8 mi
returns
.
bvalue
[
0
]
=
0
;
returns
.
bvalue
[
0
]
=
0
;
if
(
max
==
0
||
core
.
select_cards
.
empty
())
if
(
max
==
0
||
core
.
select_cards
.
empty
())
return
TRUE
;
return
TRUE
;
core
.
selecting_player
=
playerid
;
std
::
sort
(
core
.
select_cards
.
begin
(),
core
.
select_cards
.
end
(),
card
::
card_operation_sort
);
std
::
sort
(
core
.
select_cards
.
begin
(),
core
.
select_cards
.
end
(),
card
::
card_operation_sort
);
if
(
core
.
select_cards
.
size
()
>
UINT8_MAX
)
if
(
core
.
select_cards
.
size
()
>
UINT8_MAX
)
core
.
select_cards
.
resize
(
UINT8_MAX
);
core
.
select_cards
.
resize
(
UINT8_MAX
);
...
@@ -248,12 +249,10 @@ int32 field::select_card(uint16 step, uint8 playerid, uint8 cancelable, uint8 mi
...
@@ -248,12 +249,10 @@ int32 field::select_card(uint16 step, uint8 playerid, uint8 cancelable, uint8 mi
pduel
->
write_buffer8
(
min
);
pduel
->
write_buffer8
(
min
);
pduel
->
write_buffer8
(
max
);
pduel
->
write_buffer8
(
max
);
pduel
->
write_buffer8
((
uint8
)
core
.
select_cards
.
size
());
pduel
->
write_buffer8
((
uint8
)
core
.
select_cards
.
size
());
uint8
deck_seq_pointer
[
2
];
uint8
deck_seq_pointer
;
deck_seq_pointer
[
0
]
=
0
;
deck_seq_pointer
[
1
]
=
0
;
for
(
auto
&
pcard
:
core
.
select_cards
)
{
for
(
auto
&
pcard
:
core
.
select_cards
)
{
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer32
(
pcard
->
get_select_info_location
(
deck_seq_pointer
));
pduel
->
write_buffer32
(
pcard
->
get_select_info_location
(
&
deck_seq_pointer
));
}
}
return
FALSE
;
return
FALSE
;
}
else
{
}
else
{
...
@@ -287,6 +286,7 @@ int32 field::select_unselect_card(uint16 step, uint8 playerid, uint8 cancelable,
...
@@ -287,6 +286,7 @@ int32 field::select_unselect_card(uint16 step, uint8 playerid, uint8 cancelable,
returns
.
bvalue
[
i
+
1
]
=
i
;
returns
.
bvalue
[
i
+
1
]
=
i
;
return
TRUE
;
return
TRUE
;
}
}
core
.
selecting_player
=
playerid
;
std
::
sort
(
core
.
select_cards
.
begin
(),
core
.
select_cards
.
end
(),
card
::
card_operation_sort
);
std
::
sort
(
core
.
select_cards
.
begin
(),
core
.
select_cards
.
end
(),
card
::
card_operation_sort
);
if
(
core
.
select_cards
.
size
()
>
UINT8_MAX
)
if
(
core
.
select_cards
.
size
()
>
UINT8_MAX
)
core
.
select_cards
.
resize
(
UINT8_MAX
);
core
.
select_cards
.
resize
(
UINT8_MAX
);
...
@@ -299,17 +299,15 @@ int32 field::select_unselect_card(uint16 step, uint8 playerid, uint8 cancelable,
...
@@ -299,17 +299,15 @@ int32 field::select_unselect_card(uint16 step, uint8 playerid, uint8 cancelable,
pduel
->
write_buffer8
(
min
);
pduel
->
write_buffer8
(
min
);
pduel
->
write_buffer8
(
max
);
pduel
->
write_buffer8
(
max
);
pduel
->
write_buffer8
((
uint8
)
core
.
select_cards
.
size
());
pduel
->
write_buffer8
((
uint8
)
core
.
select_cards
.
size
());
uint8
deck_seq_pointer
[
2
];
uint8
deck_seq_pointer
;
deck_seq_pointer
[
0
]
=
0
;
deck_seq_pointer
[
1
]
=
0
;
for
(
auto
&
pcard
:
core
.
select_cards
)
{
for
(
auto
&
pcard
:
core
.
select_cards
)
{
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer32
(
pcard
->
get_select_info_location
(
deck_seq_pointer
));
pduel
->
write_buffer32
(
pcard
->
get_select_info_location
(
&
deck_seq_pointer
));
}
}
pduel
->
write_buffer8
((
uint8
)
core
.
unselect_cards
.
size
());
pduel
->
write_buffer8
((
uint8
)
core
.
unselect_cards
.
size
());
for
(
auto
&
pcard
:
core
.
unselect_cards
)
{
for
(
auto
&
pcard
:
core
.
unselect_cards
)
{
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer32
(
pcard
->
get_select_info_location
(
deck_seq_pointer
));
pduel
->
write_buffer32
(
pcard
->
get_select_info_location
(
&
deck_seq_pointer
));
}
}
return
FALSE
;
return
FALSE
;
}
else
{
}
else
{
...
@@ -507,6 +505,7 @@ int32 field::select_tribute(uint16 step, uint8 playerid, uint8 cancelable, uint8
...
@@ -507,6 +505,7 @@ int32 field::select_tribute(uint16 step, uint8 playerid, uint8 cancelable, uint8
returns
.
bvalue
[
0
]
=
0
;
returns
.
bvalue
[
0
]
=
0
;
if
(
max
==
0
||
core
.
select_cards
.
empty
())
if
(
max
==
0
||
core
.
select_cards
.
empty
())
return
TRUE
;
return
TRUE
;
core
.
selecting_player
=
playerid
;
std
::
sort
(
core
.
select_cards
.
begin
(),
core
.
select_cards
.
end
(),
card
::
card_operation_sort
);
std
::
sort
(
core
.
select_cards
.
begin
(),
core
.
select_cards
.
end
(),
card
::
card_operation_sort
);
if
(
core
.
select_cards
.
size
()
>
UINT8_MAX
)
if
(
core
.
select_cards
.
size
()
>
UINT8_MAX
)
core
.
select_cards
.
resize
(
UINT8_MAX
);
core
.
select_cards
.
resize
(
UINT8_MAX
);
...
@@ -526,14 +525,12 @@ int32 field::select_tribute(uint16 step, uint8 playerid, uint8 cancelable, uint8
...
@@ -526,14 +525,12 @@ int32 field::select_tribute(uint16 step, uint8 playerid, uint8 cancelable, uint8
pduel
->
write_buffer8
(
min
);
pduel
->
write_buffer8
(
min
);
pduel
->
write_buffer8
(
max
);
pduel
->
write_buffer8
(
max
);
pduel
->
write_buffer8
((
uint8
)
core
.
select_cards
.
size
());
pduel
->
write_buffer8
((
uint8
)
core
.
select_cards
.
size
());
uint8
deck_seq_pointer
[
2
];
uint8
deck_seq_pointer
;
deck_seq_pointer
[
0
]
=
0
;
deck_seq_pointer
[
1
]
=
0
;
for
(
auto
&
pcard
:
core
.
select_cards
)
{
for
(
auto
&
pcard
:
core
.
select_cards
)
{
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
get_select_sequence
(
deck_seq_pointer
));
pduel
->
write_buffer8
(
pcard
->
get_select_sequence
(
&
deck_seq_pointer
));
pduel
->
write_buffer8
(
pcard
->
release_param
);
pduel
->
write_buffer8
(
pcard
->
release_param
);
}
}
return
FALSE
;
return
FALSE
;
...
@@ -597,15 +594,14 @@ int32 field::select_counter(uint16 step, uint8 playerid, uint16 countertype, uin
...
@@ -597,15 +594,14 @@ int32 field::select_counter(uint16 step, uint8 playerid, uint16 countertype, uin
pduel
->
write_buffer16
(
countertype
);
pduel
->
write_buffer16
(
countertype
);
pduel
->
write_buffer16
(
count
);
pduel
->
write_buffer16
(
count
);
pduel
->
write_buffer8
((
uint8
)
core
.
select_cards
.
size
());
pduel
->
write_buffer8
((
uint8
)
core
.
select_cards
.
size
());
core
.
selecting_player
=
playerid
;
std
::
sort
(
core
.
select_cards
.
begin
(),
core
.
select_cards
.
end
(),
card
::
card_operation_sort
);
std
::
sort
(
core
.
select_cards
.
begin
(),
core
.
select_cards
.
end
(),
card
::
card_operation_sort
);
uint8
deck_seq_pointer
[
2
];
uint8
deck_seq_pointer
;
deck_seq_pointer
[
0
]
=
0
;
deck_seq_pointer
[
1
]
=
0
;
for
(
auto
&
pcard
:
core
.
select_cards
)
{
for
(
auto
&
pcard
:
core
.
select_cards
)
{
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
get_select_sequence
(
deck_seq_pointer
));
pduel
->
write_buffer8
(
pcard
->
get_select_sequence
(
&
deck_seq_pointer
));
pduel
->
write_buffer16
(
pcard
->
get_counter
(
countertype
));
pduel
->
write_buffer16
(
pcard
->
get_counter
(
countertype
));
}
}
return
FALSE
;
return
FALSE
;
...
@@ -640,6 +636,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
...
@@ -640,6 +636,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
returns
.
bvalue
[
0
]
=
0
;
returns
.
bvalue
[
0
]
=
0
;
if
(
core
.
select_cards
.
empty
())
if
(
core
.
select_cards
.
empty
())
return
TRUE
;
return
TRUE
;
core
.
selecting_player
=
playerid
;
std
::
sort
(
core
.
select_cards
.
begin
(),
core
.
select_cards
.
end
(),
card
::
card_operation_sort
);
std
::
sort
(
core
.
select_cards
.
begin
(),
core
.
select_cards
.
end
(),
card
::
card_operation_sort
);
if
(
core
.
select_cards
.
size
()
>
UINT8_MAX
)
if
(
core
.
select_cards
.
size
()
>
UINT8_MAX
)
core
.
select_cards
.
resize
(
UINT8_MAX
);
core
.
select_cards
.
resize
(
UINT8_MAX
);
...
@@ -657,14 +654,12 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
...
@@ -657,14 +654,12 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
pduel
->
write_buffer8
(
min
);
pduel
->
write_buffer8
(
min
);
pduel
->
write_buffer8
(
max
);
pduel
->
write_buffer8
(
max
);
pduel
->
write_buffer8
((
uint8
)
core
.
must_select_cards
.
size
());
pduel
->
write_buffer8
((
uint8
)
core
.
must_select_cards
.
size
());
uint8
deck_seq_pointer
[
2
];
uint8
deck_seq_pointer
;
deck_seq_pointer
[
0
]
=
0
;
deck_seq_pointer
[
1
]
=
0
;
for
(
auto
&
pcard
:
core
.
must_select_cards
)
{
for
(
auto
&
pcard
:
core
.
must_select_cards
)
{
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
get_select_sequence
(
deck_seq_pointer
));
pduel
->
write_buffer8
(
pcard
->
get_select_sequence
(
&
deck_seq_pointer
));
pduel
->
write_buffer32
(
pcard
->
sum_param
);
pduel
->
write_buffer32
(
pcard
->
sum_param
);
}
}
pduel
->
write_buffer8
((
uint8
)
core
.
select_cards
.
size
());
pduel
->
write_buffer8
((
uint8
)
core
.
select_cards
.
size
());
...
@@ -672,7 +667,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
...
@@ -672,7 +667,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
get_select_sequence
(
deck_seq_pointer
));
pduel
->
write_buffer8
(
pcard
->
get_select_sequence
(
&
deck_seq_pointer
));
pduel
->
write_buffer32
(
pcard
->
sum_param
);
pduel
->
write_buffer32
(
pcard
->
sum_param
);
}
}
return
FALSE
;
return
FALSE
;
...
...
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