Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
fallenstardust
YGOMobile
Commits
1518fdaa
Commit
1518fdaa
authored
Jan 27, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
818b3cdb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
21 deletions
+20
-21
Classes/ocgcore/card.cpp
Classes/ocgcore/card.cpp
+4
-4
Classes/ocgcore/field.cpp
Classes/ocgcore/field.cpp
+3
-4
Classes/ocgcore/field.h
Classes/ocgcore/field.h
+1
-1
Classes/ocgcore/playerop.cpp
Classes/ocgcore/playerop.cpp
+12
-12
No files found.
Classes/ocgcore/card.cpp
View file @
1518fdaa
...
...
@@ -82,12 +82,12 @@ bool card::card_operation_sort(card* c1, card* c2) {
}
if
(
c1
->
current
.
location
!=
c2
->
current
.
location
)
return
c1
->
current
.
location
<
c2
->
current
.
location
;
if
(
c1
->
current
.
location
&
LOCATION_OVERLAY
)
{
if
(
c1
->
current
.
location
==
LOCATION_OVERLAY
)
{
if
(
c1
->
overlay_target
&&
c2
->
overlay_target
&&
c1
->
overlay_target
->
current
.
sequence
!=
c2
->
overlay_target
->
current
.
sequence
)
return
c1
->
overlay_target
->
current
.
sequence
<
c2
->
overlay_target
->
current
.
sequence
;
else
return
c1
->
current
.
sequence
<
c2
->
current
.
sequence
;
}
else
if
(
c1
->
current
.
location
&
LOCATION_DECK
&&
pduel
->
game_field
->
is_select_hide_deck_sequence
(
cp1
))
{
}
else
if
(
c1
->
current
.
location
==
LOCATION_DECK
&&
pduel
->
game_field
->
is_select_hide_deck_sequence
(
cp1
))
{
// if deck reversed and the card being at the top, it should go first
if
(
pduel
->
game_field
->
core
.
deck_reversed
)
{
if
(
c1
->
current
.
sequence
==
pduel
->
game_field
->
player
[
cp1
].
list_main
.
size
()
-
1
)
...
...
@@ -105,8 +105,8 @@ bool card::card_operation_sort(card* c1, card* c2) {
return
c2_faceup
;
}
// sort deck as card property
auto
c1_type
=
c1
->
data
.
type
&
0x7
;
auto
c2_type
=
c2
->
data
.
type
&
0x7
;
auto
c1_type
=
c1
->
data
.
type
&
(
TYPE_MONSTER
|
TYPE_SPELL
|
TYPE_TRAP
)
;
auto
c2_type
=
c2
->
data
.
type
&
(
TYPE_MONSTER
|
TYPE_SPELL
|
TYPE_TRAP
)
;
// monster should go before spell, and then trap
if
(
c1_type
!=
c2_type
)
return
c1_type
>
c2_type
;
...
...
Classes/ocgcore/field.cpp
View file @
1518fdaa
...
...
@@ -12,6 +12,7 @@
#include "effect.h"
#include "interpreter.h"
#include <cstring>
#include <algorithm>
int32_t
field
::
field_used_count
[
32
]
=
{
0
,
1
,
1
,
2
,
1
,
2
,
2
,
3
,
1
,
2
,
2
,
3
,
2
,
3
,
3
,
4
,
1
,
2
,
2
,
3
,
2
,
3
,
3
,
4
,
2
,
3
,
3
,
4
,
3
,
4
,
4
,
5
};
...
...
@@ -1094,11 +1095,9 @@ void field::reverse_deck(uint8_t playerid) {
if
(
count
==
0
)
return
;
for
(
int32_t
i
=
0
;
i
<
count
/
2
;
++
i
)
{
card
*
tmp
=
player
[
playerid
].
list_main
[
i
];
tmp
->
current
.
sequence
=
count
-
1
-
i
;
player
[
playerid
].
list_main
[
i
]
->
current
.
sequence
=
count
-
1
-
i
;
player
[
playerid
].
list_main
[
count
-
1
-
i
]
->
current
.
sequence
=
i
;
player
[
playerid
].
list_main
[
i
]
=
player
[
playerid
].
list_main
[
count
-
1
-
i
];
player
[
playerid
].
list_main
[
count
-
1
-
i
]
=
tmp
;
std
::
swap
(
player
[
playerid
].
list_main
[
i
],
player
[
playerid
].
list_main
[
count
-
1
-
i
]);
}
}
void
field
::
refresh_player_info
(
uint8_t
playerid
)
{
...
...
Classes/ocgcore/field.h
View file @
1518fdaa
...
...
@@ -348,7 +348,7 @@ struct processor {
uint8_t
current_player
{
PLAYER_NONE
};
uint8_t
conti_player
{
PLAYER_NONE
};
uint8_t
select_deck_sequence_revealed
{
FALSE
};
uint8_t
selecting_player
{
PLAYER_NONE
};
uint8_t
selecting_player
{
0
};
activity_map
summon_counter
;
activity_map
normalsummon_counter
;
activity_map
spsummon_counter
;
...
...
Classes/ocgcore/playerop.cpp
View file @
1518fdaa
...
...
@@ -261,10 +261,10 @@ int32_t field::select_card(uint16_t step, uint8_t playerid, uint8_t cancelable,
pduel
->
write_buffer8
(
min
);
pduel
->
write_buffer8
(
max
);
pduel
->
write_buffer8
((
uint8_t
)
core
.
select_cards
.
size
());
uint8_t
deck_seq
_pointer
=
0
;
uint8_t
deck_seq
=
0
;
for
(
auto
&
pcard
:
core
.
select_cards
)
{
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
));
}
return
FALSE
;
}
else
{
...
...
@@ -305,15 +305,15 @@ int32_t field::select_unselect_card(uint16_t step, uint8_t playerid, uint8_t can
pduel
->
write_buffer8
(
min
);
pduel
->
write_buffer8
(
max
);
pduel
->
write_buffer8
((
uint8_t
)
core
.
select_cards
.
size
());
uint8_t
deck_seq
_pointer
=
0
;
uint8_t
deck_seq
=
0
;
for
(
auto
&
pcard
:
core
.
select_cards
)
{
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
));
}
pduel
->
write_buffer8
((
uint8_t
)
core
.
unselect_cards
.
size
());
for
(
auto
&
pcard
:
core
.
unselect_cards
)
{
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
));
}
return
FALSE
;
}
else
{
...
...
@@ -530,12 +530,12 @@ int32_t field::select_tribute(uint16_t step, uint8_t playerid, uint8_t cancelabl
pduel
->
write_buffer8
(
min
);
pduel
->
write_buffer8
(
max
);
pduel
->
write_buffer8
((
uint8_t
)
core
.
select_cards
.
size
());
uint8_t
deck_seq
_pointer
=
0
;
uint8_t
deck_seq
=
0
;
for
(
auto
&
pcard
:
core
.
select_cards
)
{
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
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
));
pduel
->
write_buffer8
(
pcard
->
release_param
);
}
return
FALSE
;
...
...
@@ -605,12 +605,12 @@ int32_t field::select_counter(uint16_t step, uint8_t playerid, uint16_t countert
pduel
->
write_buffer8
((
uint8_t
)
core
.
select_cards
.
size
());
core
.
selecting_player
=
playerid
;
std
::
sort
(
core
.
select_cards
.
begin
(),
core
.
select_cards
.
end
(),
card
::
card_operation_sort
);
uint8_t
deck_seq
_pointer
=
0
;
uint8_t
deck_seq
=
0
;
for
(
auto
&
pcard
:
core
.
select_cards
)
{
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
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
));
pduel
->
write_buffer16
(
pcard
->
get_counter
(
countertype
));
}
return
FALSE
;
...
...
@@ -663,12 +663,12 @@ int32_t field::select_with_sum_limit(int16_t step, uint8_t playerid, int32_t acc
pduel
->
write_buffer8
(
min
);
pduel
->
write_buffer8
(
max
);
pduel
->
write_buffer8
((
uint8_t
)
core
.
must_select_cards
.
size
());
uint8_t
deck_seq
_pointer
=
0
;
uint8_t
deck_seq
=
0
;
for
(
auto
&
pcard
:
core
.
must_select_cards
)
{
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
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
));
pduel
->
write_buffer32
(
pcard
->
sum_param
);
}
pduel
->
write_buffer8
((
uint8_t
)
core
.
select_cards
.
size
());
...
...
@@ -676,7 +676,7 @@ int32_t field::select_with_sum_limit(int16_t step, uint8_t playerid, int32_t acc
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
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
));
pduel
->
write_buffer32
(
pcard
->
sum_param
);
}
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