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
f7cd7af5
Commit
f7cd7af5
authored
Jan 04, 2024
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
780e3abd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
35 deletions
+39
-35
Classes/ocgcore/common.h
Classes/ocgcore/common.h
+4
-0
Classes/ocgcore/effect.h
Classes/ocgcore/effect.h
+2
-2
Classes/ocgcore/field.cpp
Classes/ocgcore/field.cpp
+7
-7
Classes/ocgcore/field.h
Classes/ocgcore/field.h
+23
-23
Classes/ocgcore/libduel.cpp
Classes/ocgcore/libduel.cpp
+2
-2
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+1
-1
No files found.
Classes/ocgcore/common.h
View file @
f7cd7af5
...
...
@@ -24,6 +24,10 @@ typedef signed char int8;
#define ADD_BIT(x,y) ((x)|=(y))
#define REMOVE_BIT(x,y) ((x)&=~(y))
constexpr
bool
match_all
(
uint32
x
,
uint32
y
)
{
return
(
x
&
y
)
==
y
;
}
#define OPERATION_SUCCESS 1
#define OPERATION_FAIL 0
#define OPERATION_CANCELED -1
...
...
Classes/ocgcore/effect.h
View file @
f7cd7af5
...
...
@@ -34,7 +34,7 @@ public:
uint8
effect_owner
{
PLAYER_NONE
};
uint32
description
{
0
};
uint32
code
{
0
};
uint32
flag
[
2
]{
0
};
uint32
flag
[
2
]{};
uint32
id
{
0
};
uint16
type
{
0
};
uint16
copy_id
{
0
};
...
...
@@ -47,7 +47,7 @@ public:
uint32
reset_flag
{
0
};
uint32
count_code
{
0
};
uint32
category
{
0
};
uint32
hint_timing
[
2
]{
0
};
uint32
hint_timing
[
2
]{};
uint32
card_type
{
0
};
uint32
active_type
{
0
};
uint16
active_location
{
0
};
...
...
Classes/ocgcore/field.cpp
View file @
f7cd7af5
...
...
@@ -1701,7 +1701,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
effect
*
re
=
core
.
reason_effect
;
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
!=
exc
&&
!
(
exg
&&
exg
->
has_card
(
pcard
))
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
,
reason
)
&&
(
reason
!=
REASON_EFFECT
||
pcard
->
is_releasable_by_effect
(
playerid
,
re
))
&&
(
reason
!=
REASON_EFFECT
||
pcard
->
is_releasable_by_effect
(
playerid
,
re
))
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
if
(
release_list
)
release_list
->
insert
(
pcard
);
...
...
@@ -1712,7 +1712,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
if
(
use_hand
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_hand
)
{
if
(
pcard
&&
pcard
!=
exc
&&
!
(
exg
&&
exg
->
has_card
(
pcard
))
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
,
reason
)
&&
(
reason
!=
REASON_EFFECT
||
pcard
->
is_releasable_by_effect
(
playerid
,
re
))
&&
(
reason
!=
REASON_EFFECT
||
pcard
->
is_releasable_by_effect
(
playerid
,
re
))
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
if
(
release_list
)
release_list
->
insert
(
pcard
);
...
...
@@ -1724,9 +1724,9 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
int32
ex_oneof_max
=
0
;
for
(
auto
&
pcard
:
player
[
1
-
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
!=
exc
&&
!
(
exg
&&
exg
->
has_card
(
pcard
))
&&
(
pcard
->
is_position
(
POS_FACEUP
)
||
!
use_con
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
,
reason
)
&&
(
reason
!=
REASON_EFFECT
||
pcard
->
is_releasable_by_effect
(
playerid
,
re
))
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
,
reason
)
&&
(
reason
!=
REASON_EFFECT
||
pcard
->
is_releasable_by_effect
(
playerid
,
re
))
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
pcard
->
release_param
=
1
;
if
(
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE
))
{
if
(
ex_list
)
...
...
@@ -1863,7 +1863,7 @@ int32 field::get_draw_count(uint8 playerid) {
void
field
::
get_ritual_material
(
uint8
playerid
,
effect
*
peffect
,
card_set
*
material
,
uint8
no_level
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
->
is_affect_by_effect
(
peffect
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
,
REASON_EFFECT
)
&&
pcard
->
is_releasable_by_effect
(
playerid
,
peffect
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
,
REASON_EFFECT
)
&&
pcard
->
is_releasable_by_effect
(
playerid
,
peffect
)
&&
(
no_level
||
pcard
->
get_level
()
>
0
))
material
->
insert
(
pcard
);
if
(
pcard
&&
pcard
->
is_affected_by_effect
(
EFFECT_OVERLAY_RITUAL_MATERIAL
))
...
...
@@ -1874,7 +1874,7 @@ void field::get_ritual_material(uint8 playerid, effect* peffect, card_set* mater
for
(
auto
&
pcard
:
player
[
1
-
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
->
is_affect_by_effect
(
peffect
)
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE
)
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
,
REASON_EFFECT
)
&&
pcard
->
is_releasable_by_effect
(
playerid
,
peffect
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
,
REASON_EFFECT
)
&&
pcard
->
is_releasable_by_effect
(
playerid
,
peffect
)
&&
(
no_level
||
pcard
->
get_level
()
>
0
))
material
->
insert
(
pcard
);
}
...
...
Classes/ocgcore/field.h
View file @
f7cd7af5
...
...
@@ -123,17 +123,17 @@ struct field_info {
int32
field_id
{
0
};
int16
copy_id
{
0
};
int16
turn_id
{
0
};
int16
turn_id_by_player
[
2
]{
0
};
int16
turn_id_by_player
[
2
]{};
int16
card_id
{
0
};
uint16
phase
{
0
};
uint8
turn_player
{
0
};
uint8
priorities
[
2
]{
0
};
uint8
priorities
[
2
]{};
uint8
can_shuffle
{
TRUE
};
};
struct
lpcost
{
int32
count
{
0
};
int32
amount
{
0
};
int32
lpstack
[
8
]{
0
};
int32
lpstack
[
8
]{};
};
struct
processor_unit
{
uint16
type
{
0
};
...
...
@@ -249,9 +249,9 @@ struct processor {
std
::
unordered_map
<
uint32
,
uint32
>
spsummon_once_map
[
2
];
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>>
xmaterial_lst
;
int32
temp_var
[
4
]{
0
};
int32
temp_var
[
4
]{};
uint32
global_flag
{
0
};
uint16
pre_field
[
2
]{
0
};
uint16
pre_field
[
2
]{};
std
::
set
<
uint16
>
opp_mzone
;
chain_limit_list
chain_limit
;
chain_limit_list
chain_limit_p
;
...
...
@@ -284,19 +284,19 @@ struct processor {
uint8
attack_cancelable
{
FALSE
};
uint8
attack_rollback
{
FALSE
};
uint8
effect_damage_step
{
0
};
int32
battle_damage
[
2
]{
0
};
int32
summon_count
[
2
]{
0
};
uint8
extra_summon
[
2
]{
FALSE
};
int32
spe_effect
[
2
]{
0
};
int32
battle_damage
[
2
]{};
int32
summon_count
[
2
]{};
uint8
extra_summon
[
2
]{};
int32
spe_effect
[
2
]{};
int32
duel_options
{
0
};
int32
duel_rule
{
CURRENT_RULE
};
//current rule: 5, Master Rule 2020
uint32
copy_reset
{
0
};
uint8
copy_reset_count
{
0
};
uint32
last_control_changed_id
{
0
};
uint32
set_group_used_zones
{
0
};
uint8
set_group_seq
[
7
]{
0
};
uint8
dice_result
[
5
]{
0
};
uint8
coin_result
[
MAX_COIN_COUNT
]{
0
};
uint8
set_group_seq
[
7
]{};
uint8
dice_result
[
5
]{};
uint8
coin_result
[
MAX_COIN_COUNT
]{};
int32
coin_count
{
0
};
bool
is_target_ready
{
false
};
...
...
@@ -309,25 +309,25 @@ struct processor {
card
*
chain_attack_target
{
nullptr
};
uint8
attack_player
{
PLAYER_NONE
};
uint8
selfdes_disabled
{
FALSE
};
uint8
overdraw
[
2
]{
FALSE
};
uint8
overdraw
[
2
]{};
int32
check_level
{
0
};
uint8
shuffle_check_disabled
{
FALSE
};
uint8
shuffle_hand_check
[
2
]{
FALSE
};
uint8
shuffle_deck_check
[
2
]{
FALSE
};
uint8
shuffle_hand_check
[
2
]{};
uint8
shuffle_deck_check
[
2
]{};
uint8
deck_reversed
{
FALSE
};
uint8
remove_brainwashing
{
FALSE
};
uint8
flip_delayed
{
FALSE
};
uint8
damage_calculated
{
FALSE
};
uint8
hand_adjusted
{
FALSE
};
uint8
summon_state_count
[
2
]{
0
};
uint8
normalsummon_state_count
[
2
]{
0
};
uint8
flipsummon_state_count
[
2
]{
0
};
uint8
spsummon_state_count
[
2
]{
0
};
uint8
attack_state_count
[
2
]{
0
};
uint8
battle_phase_count
[
2
]{
0
};
uint8
battled_count
[
2
]{
0
};
uint8
summon_state_count
[
2
]{};
uint8
normalsummon_state_count
[
2
]{};
uint8
flipsummon_state_count
[
2
]{};
uint8
spsummon_state_count
[
2
]{};
uint8
attack_state_count
[
2
]{};
uint8
battle_phase_count
[
2
]{};
uint8
battled_count
[
2
]{};
uint8
phase_action
{
FALSE
};
uint32
hint_timing
[
2
]{
0
};
uint32
hint_timing
[
2
]{};
uint8
current_player
{
PLAYER_NONE
};
uint8
conti_player
{
PLAYER_NONE
};
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>>
summon_counter
;
...
...
Classes/ocgcore/libduel.cpp
View file @
f7cd7af5
...
...
@@ -1824,14 +1824,14 @@ int32 scriptlib::duel_disable_summon(lua_State *L) {
sumplayer
=
pcard
->
summon_player
;
pcard
->
set_status
(
STATUS_SUMMONING
,
FALSE
);
pcard
->
set_status
(
STATUS_SUMMON_DISABLED
,
TRUE
);
if
((
pcard
->
summon_info
&
SUMMON_TYPE_PENDULUM
)
!=
SUMMON_TYPE_PENDULUM
)
if
(
!
match_all
(
pcard
->
summon_info
,
SUMMON_TYPE_FLIP
)
&&
!
match_all
(
pcard
->
summon_info
,
SUMMON_TYPE_DUAL
)
)
pcard
->
set_status
(
STATUS_PROC_COMPLETE
,
FALSE
);
}
else
{
for
(
auto
&
pcard
:
pgroup
->
container
)
{
sumplayer
=
pcard
->
summon_player
;
pcard
->
set_status
(
STATUS_SUMMONING
,
FALSE
);
pcard
->
set_status
(
STATUS_SUMMON_DISABLED
,
TRUE
);
if
((
pcard
->
summon_info
&
SUMMON_TYPE_PENDULUM
)
!=
SUMMON_TYPE_PENDULUM
)
if
(
!
match_all
(
pcard
->
summon_info
,
SUMMON_TYPE_FLIP
)
&&
!
match_all
(
pcard
->
summon_info
,
SUMMON_TYPE_DUAL
)
)
pcard
->
set_status
(
STATUS_PROC_COMPLETE
,
FALSE
);
}
}
...
...
Classes/ocgcore/operations.cpp
View file @
f7cd7af5
...
...
@@ -3865,7 +3865,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
struct
exargs
{
group
*
targets
{
nullptr
};
card_set
leave_field
,
leave_grave
,
leave_deck
,
detach
;
bool
show_decktop
[
2
]{
false
};
bool
show_decktop
[
2
]{};
card_vector
cv
;
card_vector
::
iterator
cvit
;
effect
*
predirect
{
nullptr
};
...
...
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