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
a65f8a04
Commit
a65f8a04
authored
Feb 12, 2025
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into develop
parents
2b445afc
fe48b4fb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
33 deletions
+33
-33
card.cpp
card.cpp
+19
-19
duel.cpp
duel.cpp
+5
-2
field.cpp
field.cpp
+3
-3
libdebug.cpp
libdebug.cpp
+0
-4
ocgapi.cpp
ocgapi.cpp
+4
-3
operations.cpp
operations.cpp
+2
-2
No files found.
card.cpp
View file @
a65f8a04
...
...
@@ -2608,11 +2608,11 @@ void card::filter_effect_container(const effect_container& container, uint32_t c
}
void
card
::
filter_effect
(
uint32_t
code
,
effect_set
*
eset
,
uint8_t
sort
)
{
filter_effect_container
(
single_effect
,
code
,
default_single_filter
,
*
eset
);
for
(
const
auto
&
pcard
:
equiping_cards
)
for
(
auto
&
pcard
:
equiping_cards
)
filter_effect_container
(
pcard
->
equip_effect
,
code
,
default_equip_filter
,
*
eset
);
for
(
const
auto
&
pcard
:
effect_target_owner
)
for
(
auto
&
pcard
:
effect_target_owner
)
filter_effect_container
(
pcard
->
target_effect
,
code
,
default_target_filter
,
*
eset
);
for
(
const
auto
&
pcard
:
xyz_materials
)
for
(
auto
&
pcard
:
xyz_materials
)
filter_effect_container
(
pcard
->
xmaterial_effect
,
code
,
default_xmaterial_filter
,
*
eset
);
filter_effect_container
(
pduel
->
game_field
->
effects
.
aura_effect
,
code
,
default_aura_filter
,
*
eset
);
if
(
sort
)
...
...
@@ -2620,17 +2620,17 @@ void card::filter_effect(uint32_t code, effect_set* eset, uint8_t sort) {
}
void
card
::
filter_single_continuous_effect
(
uint32_t
code
,
effect_set
*
eset
,
uint8_t
sort
)
{
filter_effect_container
(
single_effect
,
code
,
accept_filter
,
*
eset
);
for
(
const
auto
&
pcard
:
equiping_cards
)
for
(
auto
&
pcard
:
equiping_cards
)
filter_effect_container
(
pcard
->
equip_effect
,
code
,
accept_filter
,
*
eset
);
auto
target_filter
=
[](
card
*
c
,
effect
*
peffect
)
->
bool
{
return
peffect
->
is_target
(
c
);
};
for
(
const
auto
&
pcard
:
effect_target_owner
)
for
(
auto
&
pcard
:
effect_target_owner
)
filter_effect_container
(
pcard
->
target_effect
,
code
,
target_filter
,
*
eset
);
auto
xmaterial_filter
=
[](
card
*
c
,
effect
*
peffect
)
->
bool
{
return
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
);
};
for
(
const
auto
&
pcard
:
xyz_materials
)
for
(
auto
&
pcard
:
xyz_materials
)
filter_effect_container
(
pcard
->
xmaterial_effect
,
code
,
xmaterial_filter
,
*
eset
);
if
(
sort
)
eset
->
sort
();
...
...
@@ -2643,7 +2643,7 @@ void card::filter_self_effect(uint32_t code, effect_set* eset, uint8_t sort) {
auto
xmaterial_filter
=
[](
card
*
c
,
effect
*
peffect
)
->
bool
{
return
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
);
};
for
(
const
auto
&
pcard
:
xyz_materials
)
for
(
auto
&
pcard
:
xyz_materials
)
filter_effect_container
(
pcard
->
xmaterial_effect
,
code
,
xmaterial_filter
,
*
eset
);
if
(
sort
)
eset
->
sort
();
...
...
@@ -2652,17 +2652,17 @@ void card::filter_self_effect(uint32_t code, effect_set* eset, uint8_t sort) {
void
card
::
filter_immune_effect
()
{
immune_effect
.
clear
();
filter_effect_container
(
single_effect
,
EFFECT_IMMUNE_EFFECT
,
accept_filter
,
immune_effect
);
for
(
const
auto
&
pcard
:
equiping_cards
)
for
(
auto
&
pcard
:
equiping_cards
)
filter_effect_container
(
pcard
->
equip_effect
,
EFFECT_IMMUNE_EFFECT
,
accept_filter
,
immune_effect
);
auto
target_filter
=
[](
card
*
c
,
effect
*
peffect
)
->
bool
{
return
peffect
->
is_target
(
c
);
};
for
(
const
auto
&
pcard
:
effect_target_owner
)
for
(
auto
&
pcard
:
effect_target_owner
)
filter_effect_container
(
pcard
->
target_effect
,
EFFECT_IMMUNE_EFFECT
,
target_filter
,
immune_effect
);
auto
xmaterial_filter
=
[](
card
*
c
,
effect
*
peffect
)
->
bool
{
return
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
);
};
for
(
const
auto
&
pcard
:
xyz_materials
)
for
(
auto
&
pcard
:
xyz_materials
)
filter_effect_container
(
pcard
->
xmaterial_effect
,
EFFECT_IMMUNE_EFFECT
,
xmaterial_filter
,
immune_effect
);
filter_effect_container
(
pduel
->
game_field
->
effects
.
aura_effect
,
EFFECT_IMMUNE_EFFECT
,
target_filter
,
immune_effect
);
immune_effect
.
sort
();
...
...
@@ -2930,17 +2930,17 @@ effect* card::is_affected_by_effect(uint32_t code) {
effect
*
peffect
=
find_effect
(
single_effect
,
code
,
default_single_filter
);
if
(
peffect
)
return
peffect
;
for
(
const
auto
&
pcard
:
equiping_cards
)
{
for
(
auto
&
pcard
:
equiping_cards
)
{
peffect
=
find_effect
(
pcard
->
equip_effect
,
code
,
default_equip_filter
);
if
(
peffect
)
return
peffect
;
}
for
(
const
auto
&
pcard
:
effect_target_owner
)
{
for
(
auto
&
pcard
:
effect_target_owner
)
{
peffect
=
find_effect
(
pcard
->
target_effect
,
code
,
default_target_filter
);
if
(
peffect
)
return
peffect
;
}
for
(
const
auto
&
pcard
:
xyz_materials
)
{
for
(
auto
&
pcard
:
xyz_materials
)
{
peffect
=
find_effect
(
pcard
->
xmaterial_effect
,
code
,
default_xmaterial_filter
);
if
(
peffect
)
return
peffect
;
...
...
@@ -2960,7 +2960,7 @@ effect* card::is_affected_by_effect(int32_t code, card* target) {
auto
equip_filter
=
[](
card
*
c
,
effect
*
peffect
,
card
*
target
)
->
bool
{
return
default_equip_filter
(
c
,
peffect
)
&&
peffect
->
get_value
(
target
);
};
for
(
const
auto
&
pcard
:
equiping_cards
)
{
for
(
auto
&
pcard
:
equiping_cards
)
{
peffect
=
find_effect_with_target
(
pcard
->
equip_effect
,
code
,
equip_filter
,
target
);
if
(
peffect
)
return
peffect
;
...
...
@@ -2968,7 +2968,7 @@ effect* card::is_affected_by_effect(int32_t code, card* target) {
auto
target_filter
=
[](
card
*
c
,
effect
*
peffect
,
card
*
target
)
->
bool
{
return
default_target_filter
(
c
,
peffect
)
&&
peffect
->
get_value
(
target
);
};
for
(
const
auto
&
pcard
:
effect_target_owner
)
{
for
(
auto
&
pcard
:
effect_target_owner
)
{
peffect
=
find_effect_with_target
(
pcard
->
target_effect
,
code
,
target_filter
,
target
);
if
(
peffect
)
return
peffect
;
...
...
@@ -2976,7 +2976,7 @@ effect* card::is_affected_by_effect(int32_t code, card* target) {
auto
xmaterial_filter
=
[](
card
*
c
,
effect
*
peffect
,
card
*
target
)
->
bool
{
return
default_xmaterial_filter
(
c
,
peffect
)
&&
peffect
->
get_value
(
target
);
};
for
(
const
auto
&
pcard
:
xyz_materials
)
{
for
(
auto
&
pcard
:
xyz_materials
)
{
peffect
=
find_effect_with_target
(
pcard
->
xmaterial_effect
,
code
,
xmaterial_filter
,
target
);
if
(
peffect
)
return
peffect
;
...
...
@@ -4151,7 +4151,7 @@ int32_t card::is_can_be_link_material(card* scard) {
* @param filter Lua function filter(e)
*/
int32_t
card
::
is_original_effect_property
(
int32_t
filter
)
{
for
(
const
auto
&
peffect
:
initial_effect
)
{
for
(
auto
&
peffect
:
initial_effect
)
{
pduel
->
lua
->
add_param
(
peffect
,
PARAM_TYPE_EFFECT
);
if
(
pduel
->
lua
->
check_condition
(
filter
,
1
))
return
TRUE
;
...
...
@@ -4162,7 +4162,7 @@ int32_t card::is_original_effect_property(int32_t filter) {
* @param filter Lua function filter(e)
*/
int32_t
card
::
is_effect_property
(
int32_t
filter
)
{
for
(
const
auto
&
peffect
:
initial_effect
)
{
for
(
auto
&
peffect
:
initial_effect
)
{
if
(
current
.
is_location
(
LOCATION_MZONE
)
&&
!
peffect
->
is_monster_effect
())
continue
;
if
(
current
.
is_location
(
LOCATION_SZONE
)
&&
!
peffect
->
in_range
(
this
))
...
...
@@ -4171,7 +4171,7 @@ int32_t card::is_effect_property(int32_t filter) {
if
(
pduel
->
lua
->
check_condition
(
filter
,
1
))
return
TRUE
;
}
for
(
const
auto
&
peffect
:
owning_effect
)
{
for
(
auto
&
peffect
:
owning_effect
)
{
if
(
current
.
is_location
(
LOCATION_MZONE
)
&&
!
peffect
->
is_monster_effect
())
continue
;
if
(
current
.
is_location
(
LOCATION_SZONE
)
&&
!
peffect
->
in_range
(
this
))
...
...
duel.cpp
View file @
a65f8a04
...
...
@@ -18,7 +18,7 @@
duel
::
duel
()
{
lua
=
new
interpreter
(
this
);
game_field
=
new
field
(
this
);
game_field
->
temp_card
=
new_card
(
0
);
game_field
->
temp_card
=
new_card
(
TEMP_CARD_ID
);
message_buffer
.
reserve
(
SIZE_MESSAGE_BUFFER
);
#ifdef _WIN32
_set_error_mode
(
_OUT_TO_MSGBOX
);
...
...
@@ -45,8 +45,11 @@ void duel::clear() {
cards
.
clear
();
groups
.
clear
();
effects
.
clear
();
assumes
.
clear
();
sgroups
.
clear
();
uncopy
.
clear
();
game_field
=
new
field
(
this
);
game_field
->
temp_card
=
new_card
(
0
);
game_field
->
temp_card
=
new_card
(
TEMP_CARD_ID
);
}
card
*
duel
::
new_card
(
uint32_t
code
)
{
card
*
pcard
=
new
card
(
this
);
...
...
field.cpp
View file @
a65f8a04
...
...
@@ -801,11 +801,11 @@ int32_t field::get_szone_limit(uint8_t playerid, uint8_t uplayer, uint32_t reaso
}
uint32_t
field
::
get_linked_zone
(
int32_t
playerid
)
{
uint32_t
zones
=
0
;
for
(
const
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
)
zones
|=
pcard
->
get_linked_zone
()
&
0xffff
;
}
for
(
const
auto
&
pcard
:
player
[
1
-
playerid
].
list_mzone
)
{
for
(
auto
&
pcard
:
player
[
1
-
playerid
].
list_mzone
)
{
if
(
pcard
)
zones
|=
pcard
->
get_linked_zone
()
>>
16
;
}
...
...
@@ -1932,7 +1932,7 @@ void field::ritual_release(const card_set& material) {
card_set
rel
;
card_set
rem
;
card_set
tgy
;
for
(
const
auto
&
pcard
:
material
)
{
for
(
auto
&
pcard
:
material
)
{
if
(
pcard
->
current
.
location
==
LOCATION_GRAVE
)
rem
.
insert
(
pcard
);
else
if
(
pcard
->
current
.
location
==
LOCATION_OVERLAY
||
pcard
->
current
.
location
==
LOCATION_EXTRA
)
...
...
libdebug.cpp
View file @
a65f8a04
...
...
@@ -148,10 +148,6 @@ int32_t scriptlib::debug_reload_field_begin(lua_State *L) {
pduel
->
game_field
->
core
.
duel_rule
=
1
;
else
pduel
->
game_field
->
core
.
duel_rule
=
CURRENT_RULE
;
if
(
pduel
->
game_field
->
core
.
duel_rule
==
MASTER_RULE3
)
{
pduel
->
game_field
->
player
[
0
].
szone_size
=
8
;
pduel
->
game_field
->
player
[
1
].
szone_size
=
8
;
}
return
0
;
}
int32_t
scriptlib
::
debug_reload_field_end
(
lua_State
*
L
)
{
...
...
ocgapi.cpp
View file @
a65f8a04
...
...
@@ -70,13 +70,14 @@ extern "C" DECL_DLLEXPORT intptr_t create_duel(uint_fast32_t seed) {
}
extern
"C"
DECL_DLLEXPORT
void
start_duel
(
intptr_t
pduel
,
uint32_t
options
)
{
duel
*
pd
=
(
duel
*
)
pduel
;
pd
->
game_field
->
core
.
duel_options
|=
options
&
0xffff
;
int32_t
duel_rule
=
options
>>
16
;
uint16_t
duel_rule
=
options
>>
16
;
uint16_t
duel_options
=
options
&
0xffff
;
pd
->
game_field
->
core
.
duel_options
|=
duel_options
;
if
(
duel_rule
>=
1
&&
duel_rule
<=
CURRENT_RULE
)
pd
->
game_field
->
core
.
duel_rule
=
duel_rule
;
else
if
(
options
&
DUEL_OBSOLETE_RULING
)
//provide backward compatibility with replay
pd
->
game_field
->
core
.
duel_rule
=
1
;
else
if
(
pd
->
game_field
->
core
.
duel_rule
<
1
||
pd
->
game_field
->
core
.
duel_rule
>
CURRENT_RULE
)
pd
->
game_field
->
core
.
duel_rule
=
CURRENT_RULE
;
if
(
pd
->
game_field
->
core
.
duel_rule
==
MASTER_RULE3
)
{
pd
->
game_field
->
player
[
0
].
szone_size
=
8
;
...
...
operations.cpp
View file @
a65f8a04
...
...
@@ -397,13 +397,13 @@ int32_t field::draw(uint16_t step, effect* reason_effect, uint32_t reason, uint8
pduel
->
write_buffer8
(
MSG_DRAW
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
((
uint8_t
)
cv
.
size
());
for
(
const
auto
&
pcard
:
cv
)
for
(
auto
&
pcard
:
cv
)
pduel
->
write_buffer32
(
pcard
->
data
.
code
|
(
pcard
->
is_position
(
POS_FACEUP
)
?
0x80000000
:
0
));
if
(
core
.
deck_reversed
&&
(
public_count
<
cv
.
size
()))
{
pduel
->
write_buffer8
(
MSG_CONFIRM_CARDS
);
pduel
->
write_buffer8
(
1
-
playerid
);
pduel
->
write_buffer8
((
uint8_t
)
drawed_set
->
size
());
for
(
const
auto
&
pcard
:
*
drawed_set
)
{
for
(
auto
&
pcard
:
*
drawed_set
)
{
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
...
...
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