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
xiaoye
ygopro-core
Commits
b579cda9
Commit
b579cda9
authored
Oct 25, 2024
by
salix5
Committed by
GitHub
Oct 25, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix card::xyz_remove (#645)
parent
8da5c416
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
15 deletions
+18
-15
card.cpp
card.cpp
+6
-5
field.cpp
field.cpp
+7
-3
libduel.cpp
libduel.cpp
+2
-2
operations.cpp
operations.cpp
+3
-5
No files found.
card.cpp
View file @
b579cda9
...
...
@@ -1570,12 +1570,11 @@ int32 card::get_old_union_count() {
return
count
;
}
void
card
::
xyz_overlay
(
card_set
*
materials
)
{
if
(
materials
->
size
()
==
0
)
if
(
materials
->
empty
()
)
return
;
card_set
des
,
leave_grave
,
leave_deck
;
card_vector
cv
;
for
(
auto
&
pcard
:
*
materials
)
cv
.
push_back
(
pcard
);
cv
.
assign
(
materials
->
begin
(),
materials
->
end
());
std
::
sort
(
cv
.
begin
(),
cv
.
end
(),
card
::
card_operation_sort
);
if
(
pduel
->
game_field
->
core
.
global_flag
&
GLOBALFLAG_DECK_REVERSE_CHECK
)
{
int32
d0
=
(
int32
)
pduel
->
game_field
->
player
[
0
].
list_main
.
size
()
-
1
,
s0
=
d0
;
...
...
@@ -1622,9 +1621,9 @@ void card::xyz_overlay(card_set* materials) {
pduel
->
game_field
->
remove_unique_card
(
pcard
);
if
(
pcard
->
equiping_target
)
pcard
->
unequip
();
des
.
insert
(
pcard
->
equiping_cards
.
begin
(),
pcard
->
equiping_cards
.
end
());
for
(
auto
cit
=
pcard
->
equiping_cards
.
begin
();
cit
!=
pcard
->
equiping_cards
.
end
();)
{
card
*
equipc
=
*
cit
++
;
des
.
insert
(
equipc
);
equipc
->
unequip
();
}
pcard
->
clear_card_target
();
...
...
@@ -1681,7 +1680,9 @@ void card::xyz_add(card* mat) {
void
card
::
xyz_remove
(
card
*
mat
)
{
if
(
mat
->
overlay_target
!=
this
)
return
;
xyz_materials
.
erase
(
xyz_materials
.
begin
()
+
mat
->
current
.
sequence
);
if
(
std
::
find
(
xyz_materials
.
begin
(),
xyz_materials
.
end
(),
mat
)
==
xyz_materials
.
end
())
return
;
xyz_materials
.
erase
(
std
::
remove
(
xyz_materials
.
begin
(),
xyz_materials
.
end
(),
mat
),
xyz_materials
.
end
());
mat
->
previous
.
controler
=
mat
->
current
.
controler
;
mat
->
previous
.
location
=
mat
->
current
.
location
;
mat
->
previous
.
sequence
=
mat
->
current
.
sequence
;
...
...
field.cpp
View file @
b579cda9
...
...
@@ -1963,11 +1963,13 @@ void field::get_xyz_material(lua_State* L, card* scard, int32 findex, uint32 lv,
}
}
void
field
::
get_overlay_group
(
uint8
self
,
uint8
s
,
uint8
o
,
card_set
*
pset
)
{
if
(
!
check_playerid
(
self
))
return
;
uint8
c
=
s
;
for
(
int32
p
=
0
;
p
<
2
;
++
p
)
{
if
(
c
)
{
for
(
auto
&
pcard
:
player
[
self
].
list_mzone
)
{
if
(
pcard
&&
!
pcard
->
get_status
(
STATUS_SUMMONING
|
STATUS_SPSUMMON_STEP
)
&&
pcard
->
xyz_materials
.
size
())
if
(
pcard
&&
!
pcard
->
is_treated_as_not_on_field
(
)
&&
pcard
->
xyz_materials
.
size
())
pset
->
insert
(
pcard
->
xyz_materials
.
begin
(),
pcard
->
xyz_materials
.
end
());
}
}
...
...
@@ -1976,12 +1978,14 @@ void field::get_overlay_group(uint8 self, uint8 s, uint8 o, card_set* pset) {
}
}
int32
field
::
get_overlay_count
(
uint8
self
,
uint8
s
,
uint8
o
)
{
if
(
!
check_playerid
(
self
))
return
0
;
uint8
c
=
s
;
int32
count
=
0
;
for
(
int32
p
=
0
;
p
<
2
;
++
p
)
{
if
(
c
)
{
for
(
auto
&
pcard
:
player
[
self
].
list_mzone
)
{
if
(
pcard
&&
!
pcard
->
get_status
(
STATUS_SUMMONING
|
STATUS_SPSUMMON_STEP
))
if
(
pcard
&&
!
pcard
->
is_treated_as_not_on_field
(
))
count
+=
(
int32
)
pcard
->
xyz_materials
.
size
();
}
}
...
...
@@ -3283,7 +3287,7 @@ int32 field::is_player_can_remove_counter(uint8 playerid, card * pcard, uint8 s,
return
FALSE
;
}
int32
field
::
is_player_can_remove_overlay_card
(
uint8
playerid
,
card
*
pcard
,
uint8
s
,
uint8
o
,
uint16
min
,
uint32
reason
)
{
if
((
pcard
&&
pcard
->
xyz_materials
.
size
()
>=
min
)
||
(
!
pcard
&&
get_overlay_count
(
playerid
,
s
,
o
)
>=
min
))
if
((
pcard
&&
(
int32
)
pcard
->
xyz_materials
.
size
()
>=
min
)
||
(
!
pcard
&&
get_overlay_count
(
playerid
,
s
,
o
)
>=
min
))
return
TRUE
;
auto
pr
=
effects
.
continuous_effect
.
equal_range
(
EFFECT_OVERLAY_REMOVE_REPLACE
);
tevent
e
;
...
...
libduel.cpp
View file @
b579cda9
...
...
@@ -1610,7 +1610,7 @@ int32 scriptlib::duel_shuffle_setcard(lua_State *L) {
pduel
->
write_buffer8
(
MSG_SHUFFLE_SET_CARD
);
pduel
->
write_buffer8
(
loc
);
pduel
->
write_buffer8
(
ct
);
for
(
u
int32
i
=
0
;
i
<
ct
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
ct
;
++
i
)
{
card
*
pcard
=
ms
[
i
];
pduel
->
write_buffer32
(
pcard
->
get_info_location
());
if
(
loc
==
LOCATION_MZONE
)
...
...
@@ -1623,7 +1623,7 @@ int32 scriptlib::duel_shuffle_setcard(lua_State *L) {
pduel
->
game_field
->
raise_event
(
&
pgroup
->
container
,
EVENT_MOVE
,
pduel
->
game_field
->
core
.
reason_effect
,
0
,
pduel
->
game_field
->
core
.
reason_player
,
tp
,
0
);
pduel
->
game_field
->
process_single_event
();
pduel
->
game_field
->
process_instant_event
();
for
(
u
int32
i
=
0
;
i
<
ct
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
ct
;
++
i
)
{
if
(
ms
[
i
]
->
xyz_materials
.
size
())
pduel
->
write_buffer32
(
ms
[
i
]
->
get_info_location
());
else
...
...
operations.cpp
View file @
b579cda9
...
...
@@ -784,7 +784,7 @@ int32 field::remove_overlay_card(uint16 step, uint32 reason, card* pcard, uint8
case
0
:
{
core
.
select_options
.
clear
();
core
.
select_effects
.
clear
();
if
((
pcard
&&
pcard
->
xyz_materials
.
size
()
>=
min
)
||
(
!
pcard
&&
get_overlay_count
(
rplayer
,
s
,
o
)
>=
min
))
{
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
);
}
...
...
@@ -845,13 +845,11 @@ int32 field::remove_overlay_card(uint16 step, uint32 reason, card* pcard, uint8
}
core
.
select_cards
.
clear
();
if
(
pcard
)
{
for
(
auto
&
mcard
:
pcard
->
xyz_materials
)
core
.
select_cards
.
push_back
(
mcard
);
core
.
select_cards
.
assign
(
pcard
->
xyz_materials
.
begin
(),
pcard
->
xyz_materials
.
end
());
}
else
{
card_set
cset
;
get_overlay_group
(
rplayer
,
s
,
o
,
&
cset
);
for
(
auto
&
xcard
:
cset
)
core
.
select_cards
.
push_back
(
xcard
);
core
.
select_cards
.
assign
(
cset
.
begin
(),
cset
.
end
());
}
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
...
...
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