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
b0d70e5f
Commit
b0d70e5f
authored
Nov 19, 2024
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
9021766a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
19 deletions
+25
-19
Classes/ocgcore/card.cpp
Classes/ocgcore/card.cpp
+6
-6
Classes/ocgcore/card.h
Classes/ocgcore/card.h
+1
-1
Classes/ocgcore/effect.h
Classes/ocgcore/effect.h
+7
-1
Classes/ocgcore/field.h
Classes/ocgcore/field.h
+4
-4
Classes/ocgcore/libduel.cpp
Classes/ocgcore/libduel.cpp
+2
-2
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+5
-5
No files found.
Classes/ocgcore/card.cpp
View file @
b0d70e5f
...
...
@@ -133,6 +133,11 @@ bool card::card_operation_sort(card* c1, card* c2) {
return
c1
->
current
.
sequence
<
c2
->
current
.
sequence
;
}
}
bool
card
::
check_card_setcode
(
uint32
code
,
uint32
value
)
{
card_data
dat
;
::
read_card
(
code
,
&
dat
);
return
dat
.
is_setcode
(
value
);
}
void
card
::
attacker_map
::
addcard
(
card
*
pcard
)
{
auto
fid
=
pcard
?
pcard
->
fieldid_r
:
0
;
auto
pr
=
emplace
(
fid
,
std
::
make_pair
(
pcard
,
0
));
...
...
@@ -488,11 +493,6 @@ inline bool check_setcode(uint16_t setcode, uint32 value) {
uint32
setsubtype
=
value
&
0xf000U
;
return
(
setcode
&
0x0fffU
)
==
settype
&&
(
setcode
&
0xf000U
&
setsubtype
)
==
setsubtype
;
}
bool
card
::
check_card_setcode
(
uint32
code
,
uint32
value
)
{
card_data
dat
;
::
read_card
(
code
,
&
dat
);
return
dat
.
is_setcode
(
value
);
}
int32
card
::
is_set_card
(
uint32
set_code
)
{
uint32
code1
=
get_code
();
card_data
dat1
;
...
...
@@ -3636,7 +3636,7 @@ int32 card::is_setable_szone(uint8 playerid, uint8 ignore_fd) {
}
int32
card
::
is_affect_by_effect
(
effect
*
reason_effect
)
{
if
(
is_status
(
STATUS_SUMMONING
))
return
reason_effect
&&
(
reason_effect
->
code
==
EFFECT_CANNOT_DISABLE_SUMMON
||
reason_effect
->
code
==
EFFECT_CANNOT_DISABLE_SPSUMMON
);
return
reason_effect
&&
affect_summoning_effect
.
find
(
reason_effect
->
code
)
!=
affect_summoning_effect
.
end
(
);
if
(
!
reason_effect
||
reason_effect
->
is_flag
(
EFFECT_FLAG_IGNORE_IMMUNE
))
return
TRUE
;
if
(
reason_effect
->
is_immuned
(
this
))
...
...
Classes/ocgcore/card.h
View file @
b0d70e5f
...
...
@@ -219,6 +219,7 @@ public:
explicit
card
(
duel
*
pd
);
~
card
()
=
default
;
static
bool
card_operation_sort
(
card
*
c1
,
card
*
c2
);
static
bool
check_card_setcode
(
uint32
code
,
uint32
value
);
bool
is_extra_deck_monster
()
const
{
return
!!
(
data
.
type
&
TYPES_EXTRA_DECK
);
}
int32
get_infos
(
byte
*
buf
,
uint32
query_flag
,
int32
use_cache
=
TRUE
);
...
...
@@ -227,7 +228,6 @@ public:
std
::
tuple
<
uint32
,
uint32
>
get_original_code_rule
()
const
;
uint32
get_code
();
uint32
get_another_code
();
static
bool
check_card_setcode
(
uint32
code
,
uint32
value
);
int32
is_set_card
(
uint32
set_code
);
int32
is_origin_set_card
(
uint32
set_code
);
int32
is_pre_set_card
(
uint32
set_code
);
...
...
Classes/ocgcore/effect.h
View file @
b0d70e5f
...
...
@@ -44,7 +44,7 @@ public:
int32
reset_count
{
0
};
uint32
reset_flag
{
0
};
uint32
count_code
{
0
};
uint
32
category
{
0
};
uint
64
category
{
0
};
uint32
hint_timing
[
2
]{};
uint32
card_type
{
0
};
uint32
active_type
{
0
};
...
...
@@ -578,4 +578,10 @@ const std::unordered_set<uint32> continuous_event{
};
bool
is_continuous_event
(
uint32
code
);
const
std
::
unordered_set
<
uint32
>
affect_summoning_effect
{
EFFECT_CANNOT_DISABLE_SUMMON
,
EFFECT_CANNOT_DISABLE_SPSUMMON
,
EVENT_BE_PRE_MATERIAL
,
};
#endif
/* EFFECT_H_ */
Classes/ocgcore/field.h
View file @
b0d70e5f
...
...
@@ -126,10 +126,10 @@ struct field_effect {
};
struct
field_info
{
int32
field_id
{
1
};
int16
copy_id
{
1
};
int16
turn_id
{};
int16
turn_id_by_player
[
2
]{};
int16
card_id
{
1
};
u
int16
copy_id
{
1
};
u
int16
turn_id
{};
u
int16
turn_id_by_player
[
2
]{};
u
int16
card_id
{
1
};
uint16
phase
{};
uint8
turn_player
{};
uint8
priorities
[
2
]{};
...
...
Classes/ocgcore/libduel.cpp
View file @
b0d70e5f
...
...
@@ -1990,7 +1990,7 @@ int32 scriptlib::duel_get_mzone_count(lua_State *L) {
used_location
[
p
]
|=
digit
;
list_mzone
[
p
].
push_back
(
pcard
);
}
else
list_mzone
[
p
].
push_back
(
0
);
list_mzone
[
p
].
push_back
(
nullptr
);
digit
<<=
1
;
}
used_location
[
p
]
|=
pduel
->
game_field
->
player
[
p
].
used_location
&
0xff00
;
...
...
@@ -2049,7 +2049,7 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
used_location
[
p
]
|=
digit
;
list_mzone
[
p
].
push_back
(
pcard
);
}
else
list_mzone
[
p
].
push_back
(
0
);
list_mzone
[
p
].
push_back
(
nullptr
);
digit
<<=
1
;
}
used_location
[
p
]
|=
pduel
->
game_field
->
player
[
p
].
used_location
&
0xff00
;
...
...
Classes/ocgcore/operations.cpp
View file @
b0d70e5f
...
...
@@ -641,7 +641,7 @@ int32 field::pay_lp_cost(uint32 step, uint8 playerid, uint32 cost, uint32 must_p
core
.
select_effects
.
clear
();
if
(
val
<=
player
[
playerid
].
lp
)
{
core
.
select_options
.
push_back
(
11
);
core
.
select_effects
.
push_back
(
0
);
core
.
select_effects
.
push_back
(
nullptr
);
}
if
(
must_pay
)
{
if
(
core
.
select_options
.
size
()
==
0
)
...
...
@@ -786,7 +786,7 @@ int32 field::remove_overlay_card(uint16 step, uint32 reason, card* pcard, uint8
core
.
select_effects
.
clear
();
if
((
pcard
&&
(
int32
)
pcard
->
xyz_materials
.
size
()
>=
min
)
||
(
!
pcard
&&
get_overlay_count
(
rplayer
,
s
,
o
)
>=
min
))
{
core
.
select_options
.
push_back
(
12
);
core
.
select_effects
.
push_back
(
0
);
core
.
select_effects
.
push_back
(
nullptr
);
}
auto
pr
=
effects
.
continuous_effect
.
equal_range
(
EFFECT_OVERLAY_REMOVE_REPLACE
);
tevent
e
;
...
...
@@ -1529,7 +1529,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
core
.
select_effects
.
clear
();
core
.
select_options
.
clear
();
if
(
ignore_count
||
core
.
summon_count
[
sumplayer
]
<
get_summon_count_limit
(
sumplayer
))
{
core
.
select_effects
.
push_back
(
0
);
core
.
select_effects
.
push_back
(
nullptr
);
core
.
select_options
.
push_back
(
1
);
}
if
(
!
ignore_count
&&
!
core
.
extra_summon
[
sumplayer
])
{
...
...
@@ -2104,7 +2104,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
core
.
select_effects
.
clear
();
core
.
select_options
.
clear
();
if
(
res
>
0
)
{
core
.
select_effects
.
push_back
(
0
);
core
.
select_effects
.
push_back
(
nullptr
);
core
.
select_options
.
push_back
(
1
);
}
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
...
...
@@ -2129,7 +2129,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
core
.
select_effects
.
clear
();
core
.
select_options
.
clear
();
if
(
ignore_count
||
core
.
summon_count
[
setplayer
]
<
get_summon_count_limit
(
setplayer
))
{
core
.
select_effects
.
push_back
(
0
);
core
.
select_effects
.
push_back
(
nullptr
);
core
.
select_options
.
push_back
(
1
);
}
if
(
!
ignore_count
&&
!
core
.
extra_summon
[
setplayer
])
{
...
...
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