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
6989d65c
Commit
6989d65c
authored
Feb 04, 2026
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into patch-synchro-1
parents
4862a9d8
6a650623
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
55 deletions
+49
-55
field.cpp
field.cpp
+41
-39
field.h
field.h
+1
-0
ocgapi.cpp
ocgapi.cpp
+6
-15
ocgapi.h
ocgapi.h
+1
-1
No files found.
field.cpp
View file @
6989d65c
...
@@ -498,13 +498,44 @@ int32_t field::get_pzone_sequence(uint8_t pseq) const {
...
@@ -498,13 +498,44 @@ int32_t field::get_pzone_sequence(uint8_t pseq) const {
return
7
;
return
7
;
}
}
}
}
const
card_vector
*
field
::
get_field_vector
(
uint8_t
playerid
,
uint8_t
location
)
const
{
if
(
!
check_playerid
(
playerid
))
return
nullptr
;
switch
(
location
)
{
case
LOCATION_MZONE
:
return
&
player
[
playerid
].
list_mzone
;
case
LOCATION_SZONE
:
return
&
player
[
playerid
].
list_szone
;
case
LOCATION_DECK
:
return
&
player
[
playerid
].
list_main
;
case
LOCATION_HAND
:
return
&
player
[
playerid
].
list_hand
;
case
LOCATION_GRAVE
:
return
&
player
[
playerid
].
list_grave
;
case
LOCATION_REMOVED
:
return
&
player
[
playerid
].
list_remove
;
case
LOCATION_EXTRA
:
return
&
player
[
playerid
].
list_extra
;
default:
return
nullptr
;
}
}
card
*
field
::
get_field_card
(
uint8_t
playerid
,
uint32_t
general_location
,
uint8_t
sequence
)
const
{
card
*
field
::
get_field_card
(
uint8_t
playerid
,
uint32_t
general_location
,
uint8_t
sequence
)
const
{
if
(
!
check_playerid
(
playerid
))
if
(
!
check_playerid
(
playerid
))
return
nullptr
;
return
nullptr
;
switch
(
general_location
)
{
switch
(
general_location
)
{
case
LOCATION_MZONE
:
{
case
LOCATION_MZONE
:
if
(
sequence
<
(
int32_t
)
player
[
playerid
].
list_mzone
.
size
())
case
LOCATION_DECK
:
return
player
[
playerid
].
list_mzone
[
sequence
];
case
LOCATION_HAND
:
case
LOCATION_GRAVE
:
case
LOCATION_REMOVED
:
case
LOCATION_EXTRA
:
{
auto
ptr
=
get_field_vector
(
playerid
,
general_location
);
if
(
!
ptr
)
return
nullptr
;
auto
&
container
=
*
ptr
;
if
(
sequence
<
container
.
size
())
return
container
[
sequence
];
else
else
return
nullptr
;
return
nullptr
;
break
;
break
;
...
@@ -531,41 +562,6 @@ card* field::get_field_card(uint8_t playerid, uint32_t general_location, uint8_t
...
@@ -531,41 +562,6 @@ card* field::get_field_card(uint8_t playerid, uint32_t general_location, uint8_t
return
nullptr
;
return
nullptr
;
break
;
break
;
}
}
case
LOCATION_DECK
:
{
if
(
sequence
<
player
[
playerid
].
list_main
.
size
())
return
player
[
playerid
].
list_main
[
sequence
];
else
return
nullptr
;
break
;
}
case
LOCATION_HAND
:
{
if
(
sequence
<
player
[
playerid
].
list_hand
.
size
())
return
player
[
playerid
].
list_hand
[
sequence
];
else
return
nullptr
;
break
;
}
case
LOCATION_GRAVE
:
{
if
(
sequence
<
player
[
playerid
].
list_grave
.
size
())
return
player
[
playerid
].
list_grave
[
sequence
];
else
return
nullptr
;
break
;
}
case
LOCATION_REMOVED
:
{
if
(
sequence
<
player
[
playerid
].
list_remove
.
size
())
return
player
[
playerid
].
list_remove
[
sequence
];
else
return
nullptr
;
break
;
}
case
LOCATION_EXTRA
:
{
if
(
sequence
<
player
[
playerid
].
list_extra
.
size
())
return
player
[
playerid
].
list_extra
[
sequence
];
else
return
nullptr
;
break
;
}
}
}
return
nullptr
;
return
nullptr
;
}
}
...
@@ -2692,7 +2688,7 @@ int32_t field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int3
...
@@ -2692,7 +2688,7 @@ int32_t field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int3
++
location_count
;
++
location_count
;
}
}
if
(
min
==
0
)
{
if
(
min
==
0
)
{
if
(
location_count
>
0
&&
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
0
,
0
,
0xffff
,
2
))
{
if
(
location_count
>
0
&&
must_list
.
size
()
==
0
&&
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
0
,
0
,
0xffff
,
2
))
{
pduel
->
restore_assumes
();
pduel
->
restore_assumes
();
return
TRUE
;
return
TRUE
;
}
}
...
@@ -2704,6 +2700,12 @@ int32_t field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int3
...
@@ -2704,6 +2700,12 @@ int32_t field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int3
}
}
if
(
must_list
.
size
())
{
if
(
must_list
.
size
())
{
for
(
auto
&
mcard
:
must_list
)
{
for
(
auto
&
mcard
:
must_list
)
{
if
(
mg
)
{
if
(
!
mg
->
has_card
(
mcard
))
{
pduel
->
restore_assumes
();
return
FALSE
;
}
}
if
(
pcheck
)
if
(
pcheck
)
pcheck
->
get_value
(
mcard
);
pcheck
->
get_value
(
mcard
);
if
((
mcard
->
current
.
location
==
LOCATION_MZONE
&&
!
mcard
->
is_position
(
POS_FACEUP
))
||
!
mcard
->
is_can_be_synchro_material
(
pcard
,
tuner
))
{
if
((
mcard
->
current
.
location
==
LOCATION_MZONE
&&
!
mcard
->
is_position
(
POS_FACEUP
))
||
!
mcard
->
is_can_be_synchro_material
(
pcard
,
tuner
))
{
...
...
field.h
View file @
6989d65c
...
@@ -383,6 +383,7 @@ public:
...
@@ -383,6 +383,7 @@ public:
void
set_control
(
card
*
pcard
,
uint8_t
playerid
,
uint16_t
reset_phase
,
uint8_t
reset_count
);
void
set_control
(
card
*
pcard
,
uint8_t
playerid
,
uint16_t
reset_phase
,
uint8_t
reset_count
);
int32_t
get_pzone_sequence
(
uint8_t
pseq
)
const
;
int32_t
get_pzone_sequence
(
uint8_t
pseq
)
const
;
const
card_vector
*
get_field_vector
(
uint8_t
playerid
,
uint8_t
location
)
const
;
card
*
get_field_card
(
uint8_t
playerid
,
uint32_t
general_location
,
uint8_t
sequence
)
const
;
card
*
get_field_card
(
uint8_t
playerid
,
uint32_t
general_location
,
uint8_t
sequence
)
const
;
int32_t
is_location_useable
(
uint8_t
playerid
,
uint32_t
general_location
,
uint8_t
sequence
)
const
;
int32_t
is_location_useable
(
uint8_t
playerid
,
uint32_t
general_location
,
uint8_t
sequence
)
const
;
int32_t
get_useable_count
(
card
*
pcard
,
uint8_t
playerid
,
uint8_t
location
,
uint8_t
uplayer
,
uint32_t
reason
,
uint32_t
zone
=
0xff
,
uint32_t
*
list
=
nullptr
);
int32_t
get_useable_count
(
card
*
pcard
,
uint8_t
playerid
,
uint8_t
location
,
uint8_t
uplayer
,
uint32_t
reason
,
uint32_t
zone
=
0xff
,
uint32_t
*
list
=
nullptr
);
...
...
ocgapi.cpp
View file @
6989d65c
...
@@ -204,7 +204,7 @@ OCGCORE_API void new_tag_card(intptr_t pduel, uint32_t code, uint8_t owner, uint
...
@@ -204,7 +204,7 @@ OCGCORE_API void new_tag_card(intptr_t pduel, uint32_t code, uint8_t owner, uint
* @param buf int32_t array
* @param buf int32_t array
* @return buffer length in bytes
* @return buffer length in bytes
*/
*/
OCGCORE_API
int32_t
query_card
(
intptr_t
pduel
,
uint8_t
playerid
,
uint8_t
location
,
uint8_t
sequence
,
int32_t
query_flag
,
byte
*
buf
,
int32_t
use_cache
)
{
OCGCORE_API
int32_t
query_card
(
intptr_t
pduel
,
uint8_t
playerid
,
uint8_t
location
,
uint8_t
sequence
,
u
int32_t
query_flag
,
byte
*
buf
,
int32_t
use_cache
)
{
if
(
!
check_playerid
(
playerid
))
if
(
!
check_playerid
(
playerid
))
return
LEN_FAIL
;
return
LEN_FAIL
;
duel
*
ptduel
=
(
duel
*
)
pduel
;
duel
*
ptduel
=
(
duel
*
)
pduel
;
...
@@ -213,22 +213,13 @@ OCGCORE_API int32_t query_card(intptr_t pduel, uint8_t playerid, uint8_t locatio
...
@@ -213,22 +213,13 @@ OCGCORE_API int32_t query_card(intptr_t pduel, uint8_t playerid, uint8_t locatio
if
(
location
==
LOCATION_MZONE
||
location
==
LOCATION_SZONE
)
if
(
location
==
LOCATION_MZONE
||
location
==
LOCATION_SZONE
)
pcard
=
ptduel
->
game_field
->
get_field_card
(
playerid
,
location
,
sequence
);
pcard
=
ptduel
->
game_field
->
get_field_card
(
playerid
,
location
,
sequence
);
else
{
else
{
card_vector
*
lst
=
nullptr
;
auto
ptr
=
ptduel
->
game_field
->
get_field_vector
(
playerid
,
location
);
if
(
location
==
LOCATION_HAND
)
if
(
!
ptr
)
lst
=
&
ptduel
->
game_field
->
player
[
playerid
].
list_hand
;
else
if
(
location
==
LOCATION_GRAVE
)
lst
=
&
ptduel
->
game_field
->
player
[
playerid
].
list_grave
;
else
if
(
location
==
LOCATION_REMOVED
)
lst
=
&
ptduel
->
game_field
->
player
[
playerid
].
list_remove
;
else
if
(
location
==
LOCATION_EXTRA
)
lst
=
&
ptduel
->
game_field
->
player
[
playerid
].
list_extra
;
else
if
(
location
==
LOCATION_DECK
)
lst
=
&
ptduel
->
game_field
->
player
[
playerid
].
list_main
;
else
return
LEN_FAIL
;
return
LEN_FAIL
;
if
(
sequence
>=
(
int32_t
)
lst
->
size
())
auto
&
lst
=
*
ptr
;
if
(
sequence
>=
lst
.
size
())
return
LEN_FAIL
;
return
LEN_FAIL
;
pcard
=
(
*
lst
)
[
sequence
];
pcard
=
lst
[
sequence
];
}
}
if
(
pcard
)
{
if
(
pcard
)
{
return
pcard
->
get_infos
(
buf
,
query_flag
,
use_cache
);
return
pcard
->
get_infos
(
buf
,
query_flag
,
use_cache
);
...
...
ocgapi.h
View file @
6989d65c
...
@@ -53,7 +53,7 @@ OCGCORE_API int32_t get_message(intptr_t pduel, byte* buf);
...
@@ -53,7 +53,7 @@ OCGCORE_API int32_t get_message(intptr_t pduel, byte* buf);
OCGCORE_API
uint32_t
process
(
intptr_t
pduel
);
OCGCORE_API
uint32_t
process
(
intptr_t
pduel
);
OCGCORE_API
void
new_card
(
intptr_t
pduel
,
uint32_t
code
,
uint8_t
owner
,
uint8_t
playerid
,
uint8_t
location
,
uint8_t
sequence
,
uint8_t
position
);
OCGCORE_API
void
new_card
(
intptr_t
pduel
,
uint32_t
code
,
uint8_t
owner
,
uint8_t
playerid
,
uint8_t
location
,
uint8_t
sequence
,
uint8_t
position
);
OCGCORE_API
void
new_tag_card
(
intptr_t
pduel
,
uint32_t
code
,
uint8_t
owner
,
uint8_t
location
);
OCGCORE_API
void
new_tag_card
(
intptr_t
pduel
,
uint32_t
code
,
uint8_t
owner
,
uint8_t
location
);
OCGCORE_API
int32_t
query_card
(
intptr_t
pduel
,
uint8_t
playerid
,
uint8_t
location
,
uint8_t
sequence
,
int32_t
query_flag
,
byte
*
buf
,
int32_t
use_cache
);
OCGCORE_API
int32_t
query_card
(
intptr_t
pduel
,
uint8_t
playerid
,
uint8_t
location
,
uint8_t
sequence
,
u
int32_t
query_flag
,
byte
*
buf
,
int32_t
use_cache
);
OCGCORE_API
int32_t
query_field_count
(
intptr_t
pduel
,
uint8_t
playerid
,
uint8_t
location
);
OCGCORE_API
int32_t
query_field_count
(
intptr_t
pduel
,
uint8_t
playerid
,
uint8_t
location
);
OCGCORE_API
int32_t
query_field_card
(
intptr_t
pduel
,
uint8_t
playerid
,
uint8_t
location
,
uint32_t
query_flag
,
byte
*
buf
,
int32_t
use_cache
);
OCGCORE_API
int32_t
query_field_card
(
intptr_t
pduel
,
uint8_t
playerid
,
uint8_t
location
,
uint32_t
query_flag
,
byte
*
buf
,
int32_t
use_cache
);
OCGCORE_API
int32_t
query_field_info
(
intptr_t
pduel
,
byte
*
buf
);
OCGCORE_API
int32_t
query_field_info
(
intptr_t
pduel
,
byte
*
buf
);
...
...
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