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
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
MyCard
ygopro-core
Commits
fefb0c47
Commit
fefb0c47
authored
Apr 12, 2020
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor refactor of xyz overlay
parent
1b2b74ae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
50 deletions
+31
-50
card.cpp
card.cpp
+27
-39
card.h
card.h
+1
-1
libdebug.cpp
libdebug.cpp
+3
-10
No files found.
card.cpp
View file @
fefb0c47
...
...
@@ -1408,64 +1408,52 @@ void card::xyz_overlay(card_set* materials) {
if
(
materials
->
size
()
==
0
)
return
;
card_set
des
;
if
(
materials
->
size
()
==
1
)
{
card
*
pcard
=
*
materials
->
begin
();
field
::
card_vector
cv
;
for
(
auto
&
pcard
:
*
materials
)
cv
.
push_back
(
pcard
);
std
::
sort
(
cv
.
begin
(),
cv
.
end
(),
card
::
card_operation_sort
);
for
(
auto
&
pcard
:
cv
)
{
if
(
pcard
->
overlay_target
==
this
)
continue
;
pcard
->
current
.
reason
=
REASON_XYZ
+
REASON_MATERIAL
;
pcard
->
reset
(
RESET_LEAVE
+
RESET_OVERLAY
,
RESET_EVENT
);
if
(
pcard
->
unique_code
)
pduel
->
game_field
->
remove_unique_card
(
pcard
);
if
(
pcard
->
equiping_target
)
pcard
->
unequip
();
for
(
auto
cit
=
pcard
->
equiping_cards
.
begin
();
cit
!=
pcard
->
equiping_cards
.
end
();)
{
card
*
equipc
=
*
cit
++
;
des
.
insert
(
equipc
);
equipc
->
unequip
();
}
pcard
->
clear_card_target
();
xyz_add
(
pcard
,
&
des
);
}
else
{
field
::
card_vector
cv
;
for
(
auto
&
pcard
:
*
materials
)
cv
.
push_back
(
pcard
);
std
::
sort
(
cv
.
begin
(),
cv
.
end
(),
card
::
card_operation_sort
);
for
(
auto
&
pcard
:
cv
)
{
pcard
->
reset
(
RESET_LEAVE
+
RESET_OVERLAY
,
RESET_EVENT
);
if
(
pcard
->
unique_code
)
pduel
->
game_field
->
remove_unique_card
(
pcard
);
if
(
pcard
->
equiping_target
)
pcard
->
unequip
();
pcard
->
clear_card_target
();
xyz_add
(
pcard
,
&
des
);
pduel
->
write_buffer8
(
MSG_MOVE
);
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
pduel
->
write_buffer32
(
pcard
->
get_info_location
());
if
(
pcard
->
overlay_target
)
{
pcard
->
overlay_target
->
xyz_remove
(
pcard
);
}
else
{
pcard
->
enable_field_effect
(
false
);
pduel
->
game_field
->
remove_card
(
pcard
);
pduel
->
game_field
->
add_to_disable_check_list
(
pcard
);
}
xyz_add
(
pcard
);
pduel
->
write_buffer32
(
pcard
->
get_info_location
());
pduel
->
write_buffer32
(
pcard
->
current
.
reason
);
}
if
(
des
.
size
())
pduel
->
game_field
->
destroy
(
&
des
,
0
,
REASON_LOST_TARGET
+
REASON_RULE
,
PLAYER_NONE
);
else
pduel
->
game_field
->
adjust_instant
();
}
void
card
::
xyz_add
(
card
*
mat
,
card_set
*
des
)
{
if
(
mat
->
overlay_target
==
this
)
void
card
::
xyz_add
(
card
*
mat
)
{
if
(
mat
->
current
.
controler
!=
PLAYER_NONE
||
mat
->
overlay_target
)
return
;
pduel
->
write_buffer8
(
MSG_MOVE
);
pduel
->
write_buffer32
(
mat
->
data
.
code
);
pduel
->
write_buffer32
(
mat
->
get_info_location
());
if
(
mat
->
overlay_target
)
{
mat
->
overlay_target
->
xyz_remove
(
mat
);
}
else
{
mat
->
enable_field_effect
(
false
);
pduel
->
game_field
->
remove_card
(
mat
);
pduel
->
game_field
->
add_to_disable_check_list
(
mat
);
}
pduel
->
write_buffer8
(
current
.
controler
);
pduel
->
write_buffer8
(
current
.
location
|
LOCATION_OVERLAY
);
pduel
->
write_buffer8
(
current
.
sequence
);
pduel
->
write_buffer8
(
current
.
position
);
pduel
->
write_buffer32
(
REASON_XYZ
+
REASON_MATERIAL
);
xyz_materials
.
push_back
(
mat
);
for
(
auto
cit
=
mat
->
equiping_cards
.
begin
();
cit
!=
mat
->
equiping_cards
.
end
();)
{
auto
rm
=
cit
++
;
des
->
insert
(
*
rm
);
(
*
rm
)
->
unequip
();
}
mat
->
overlay_target
=
this
;
mat
->
current
.
controler
=
PLAYER_NONE
;
mat
->
current
.
location
=
LOCATION_OVERLAY
;
mat
->
current
.
sequence
=
(
uint8
)
xyz_materials
.
size
()
-
1
;
mat
->
current
.
reason
=
REASON_XYZ
+
REASON_MATERIAL
;
for
(
auto
&
eit
:
mat
->
xmaterial_effect
)
{
effect
*
peffect
=
eit
.
second
;
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
...
...
card.h
View file @
fefb0c47
...
...
@@ -244,7 +244,7 @@ public:
int32
get_union_count
();
int32
get_old_union_count
();
void
xyz_overlay
(
card_set
*
materials
);
void
xyz_add
(
card
*
mat
,
card_set
*
des
);
void
xyz_add
(
card
*
mat
);
void
xyz_remove
(
card
*
mat
);
void
apply_field_effect
();
void
cancel_field_effect
();
...
...
libdebug.cpp
View file @
fefb0c47
...
...
@@ -61,16 +61,9 @@ int32 scriptlib::debug_add_card(lua_State *L) {
card
*
pcard
=
pduel
->
new_card
(
code
);
pcard
->
owner
=
owner
;
card
*
fcard
=
pduel
->
game_field
->
get_field_card
(
playerid
,
location
,
sequence
);
fcard
->
xyz_materials
.
push_back
(
pcard
);
pcard
->
overlay_target
=
fcard
;
pcard
->
current
.
controler
=
PLAYER_NONE
;
pcard
->
current
.
location
=
LOCATION_OVERLAY
;
pcard
->
current
.
sequence
=
(
uint8
)
fcard
->
xyz_materials
.
size
()
-
1
;
for
(
auto
&
eit
:
pcard
->
xmaterial_effect
)
{
effect
*
peffect
=
eit
.
second
;
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
pduel
->
game_field
->
add_effect
(
peffect
);
}
fcard
->
xyz_add
(
pcard
);
if
(
proc
)
pcard
->
set_status
(
STATUS_PROC_COMPLETE
,
TRUE
);
interpreter
::
card2value
(
L
,
pcard
);
return
1
;
}
...
...
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