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
0c9c455b
Commit
0c9c455b
authored
Jan 12, 2023
by
Chrono-Genex
Committed by
GitHub
Jan 12, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add EVENT_LEAVE_DECK (#486)
parent
bec96706
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
card.cpp
card.cpp
+11
-3
effect.h
effect.h
+1
-0
operations.cpp
operations.cpp
+10
-1
No files found.
card.cpp
View file @
0c9c455b
...
@@ -1408,7 +1408,7 @@ int32 card::get_old_union_count() {
...
@@ -1408,7 +1408,7 @@ int32 card::get_old_union_count() {
void
card
::
xyz_overlay
(
card_set
*
materials
)
{
void
card
::
xyz_overlay
(
card_set
*
materials
)
{
if
(
materials
->
size
()
==
0
)
if
(
materials
->
size
()
==
0
)
return
;
return
;
card_set
des
,
leave_grave
;
card_set
des
,
leave_grave
,
leave_deck
;
field
::
card_vector
cv
;
field
::
card_vector
cv
;
for
(
auto
&
pcard
:
*
materials
)
for
(
auto
&
pcard
:
*
materials
)
cv
.
push_back
(
pcard
);
cv
.
push_back
(
pcard
);
...
@@ -1478,12 +1478,20 @@ void card::xyz_overlay(card_set* materials) {
...
@@ -1478,12 +1478,20 @@ void card::xyz_overlay(card_set* materials) {
if
(
pcard
->
previous
.
location
==
LOCATION_GRAVE
)
{
if
(
pcard
->
previous
.
location
==
LOCATION_GRAVE
)
{
leave_grave
.
insert
(
pcard
);
leave_grave
.
insert
(
pcard
);
pduel
->
game_field
->
raise_single_event
(
pcard
,
0
,
EVENT_LEAVE_GRAVE
,
pduel
->
game_field
->
core
.
reason_effect
,
pcard
->
current
.
reason
,
pduel
->
game_field
->
core
.
reason_player
,
0
,
0
);
pduel
->
game_field
->
raise_single_event
(
pcard
,
0
,
EVENT_LEAVE_GRAVE
,
pduel
->
game_field
->
core
.
reason_effect
,
pcard
->
current
.
reason
,
pduel
->
game_field
->
core
.
reason_player
,
0
,
0
);
}
else
if
(
pcard
->
previous
.
location
==
LOCATION_DECK
||
pcard
->
previous
.
location
==
LOCATION_EXTRA
)
{
leave_deck
.
insert
(
pcard
);
pduel
->
game_field
->
raise_single_event
(
pcard
,
0
,
EVENT_LEAVE_DECK
,
pduel
->
game_field
->
core
.
reason_effect
,
pcard
->
current
.
reason
,
pduel
->
game_field
->
core
.
reason_player
,
0
,
0
);
}
}
pduel
->
write_buffer32
(
pcard
->
get_info_location
());
pduel
->
write_buffer32
(
pcard
->
get_info_location
());
pduel
->
write_buffer32
(
pcard
->
current
.
reason
);
pduel
->
write_buffer32
(
pcard
->
current
.
reason
);
}
}
if
(
leave_grave
.
size
())
{
if
(
leave_grave
.
size
()
||
leave_deck
.
size
())
{
pduel
->
game_field
->
raise_event
(
&
leave_grave
,
EVENT_LEAVE_GRAVE
,
pduel
->
game_field
->
core
.
reason_effect
,
REASON_XYZ
+
REASON_MATERIAL
,
pduel
->
game_field
->
core
.
reason_player
,
0
,
0
);
if
(
leave_grave
.
size
())
{
pduel
->
game_field
->
raise_event
(
&
leave_grave
,
EVENT_LEAVE_GRAVE
,
pduel
->
game_field
->
core
.
reason_effect
,
REASON_XYZ
+
REASON_MATERIAL
,
pduel
->
game_field
->
core
.
reason_player
,
0
,
0
);
}
if
(
leave_deck
.
size
())
{
pduel
->
game_field
->
raise_event
(
&
leave_deck
,
EVENT_LEAVE_DECK
,
pduel
->
game_field
->
core
.
reason_effect
,
REASON_XYZ
+
REASON_MATERIAL
,
pduel
->
game_field
->
core
.
reason_player
,
0
,
0
);
}
pduel
->
game_field
->
process_single_event
();
pduel
->
game_field
->
process_single_event
();
pduel
->
game_field
->
process_instant_event
();
pduel
->
game_field
->
process_instant_event
();
}
}
...
...
effect.h
View file @
0c9c455b
...
@@ -493,6 +493,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
...
@@ -493,6 +493,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EVENT_DESTROYED 1029
#define EVENT_DESTROYED 1029
#define EVENT_MOVE 1030
#define EVENT_MOVE 1030
#define EVENT_LEAVE_GRAVE 1031
#define EVENT_LEAVE_GRAVE 1031
#define EVENT_LEAVE_DECK 1032
#define EVENT_ADJUST 1040
#define EVENT_ADJUST 1040
#define EVENT_BREAK_EFFECT 1050
#define EVENT_BREAK_EFFECT 1050
#define EVENT_SUMMON_SUCCESS 1100
#define EVENT_SUMMON_SUCCESS 1100
...
...
operations.cpp
View file @
0c9c455b
...
@@ -3798,7 +3798,7 @@ int32 field::send_replace(uint16 step, group * targets, card * target) {
...
@@ -3798,7 +3798,7 @@ int32 field::send_replace(uint16 step, group * targets, card * target) {
int32
field
::
send_to
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
)
{
int32
field
::
send_to
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
)
{
struct
exargs
{
struct
exargs
{
group
*
targets
;
group
*
targets
;
card_set
leave_field
,
leave_grave
,
detach
;
card_set
leave_field
,
leave_grave
,
leave_deck
,
detach
;
bool
show_decktop
[
2
];
bool
show_decktop
[
2
];
card_vector
cv
;
card_vector
cv
;
card_vector
::
iterator
cvit
;
card_vector
::
iterator
cvit
;
...
@@ -4083,6 +4083,8 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -4083,6 +4083,8 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
param
->
leave_field
.
insert
(
pcard
);
param
->
leave_field
.
insert
(
pcard
);
}
else
if
(
oloc
==
LOCATION_GRAVE
)
{
}
else
if
(
oloc
==
LOCATION_GRAVE
)
{
param
->
leave_grave
.
insert
(
pcard
);
param
->
leave_grave
.
insert
(
pcard
);
}
else
if
(
oloc
==
LOCATION_DECK
||
oloc
==
LOCATION_EXTRA
)
{
param
->
leave_deck
.
insert
(
pcard
);
}
}
if
(
pcard
->
previous
.
location
==
LOCATION_OVERLAY
)
if
(
pcard
->
previous
.
location
==
LOCATION_OVERLAY
)
pcard
->
previous
.
controler
=
control_player
;
pcard
->
previous
.
controler
=
control_player
;
...
@@ -4190,6 +4192,8 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -4190,6 +4192,8 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
raise_single_event
(
pcard
,
0
,
EVENT_LEAVE_FIELD
,
pcard
->
current
.
reason_effect
,
pcard
->
current
.
reason
,
pcard
->
current
.
reason_player
,
0
,
0
);
raise_single_event
(
pcard
,
0
,
EVENT_LEAVE_FIELD
,
pcard
->
current
.
reason_effect
,
pcard
->
current
.
reason
,
pcard
->
current
.
reason_player
,
0
,
0
);
for
(
auto
&
pcard
:
param
->
leave_grave
)
for
(
auto
&
pcard
:
param
->
leave_grave
)
raise_single_event
(
pcard
,
0
,
EVENT_LEAVE_GRAVE
,
pcard
->
current
.
reason_effect
,
pcard
->
current
.
reason
,
pcard
->
current
.
reason_player
,
0
,
0
);
raise_single_event
(
pcard
,
0
,
EVENT_LEAVE_GRAVE
,
pcard
->
current
.
reason_effect
,
pcard
->
current
.
reason
,
pcard
->
current
.
reason_player
,
0
,
0
);
for
(
auto
&
pcard
:
param
->
leave_deck
)
raise_single_event
(
pcard
,
0
,
EVENT_LEAVE_DECK
,
pcard
->
current
.
reason_effect
,
pcard
->
current
.
reason
,
pcard
->
current
.
reason_player
,
0
,
0
);
if
((
core
.
global_flag
&
GLOBALFLAG_DETACH_EVENT
)
&&
param
->
detach
.
size
())
{
if
((
core
.
global_flag
&
GLOBALFLAG_DETACH_EVENT
)
&&
param
->
detach
.
size
())
{
for
(
auto
&
pcard
:
param
->
detach
)
{
for
(
auto
&
pcard
:
param
->
detach
)
{
if
(
pcard
->
current
.
location
&
LOCATION_MZONE
)
if
(
pcard
->
current
.
location
&
LOCATION_MZONE
)
...
@@ -4201,6 +4205,8 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -4201,6 +4205,8 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
raise_event
(
&
param
->
leave_field
,
EVENT_LEAVE_FIELD
,
reason_effect
,
reason
,
reason_player
,
0
,
0
);
raise_event
(
&
param
->
leave_field
,
EVENT_LEAVE_FIELD
,
reason_effect
,
reason
,
reason_player
,
0
,
0
);
if
(
param
->
leave_grave
.
size
())
if
(
param
->
leave_grave
.
size
())
raise_event
(
&
param
->
leave_grave
,
EVENT_LEAVE_GRAVE
,
reason_effect
,
reason
,
reason_player
,
0
,
0
);
raise_event
(
&
param
->
leave_grave
,
EVENT_LEAVE_GRAVE
,
reason_effect
,
reason
,
reason_player
,
0
,
0
);
if
(
param
->
leave_deck
.
size
())
raise_event
(
&
param
->
leave_deck
,
EVENT_LEAVE_DECK
,
reason_effect
,
reason
,
reason_player
,
0
,
0
);
if
((
core
.
global_flag
&
GLOBALFLAG_DETACH_EVENT
)
&&
param
->
detach
.
size
())
if
((
core
.
global_flag
&
GLOBALFLAG_DETACH_EVENT
)
&&
param
->
detach
.
size
())
raise_event
(
&
param
->
detach
,
EVENT_DETACH_MATERIAL
,
reason_effect
,
reason
,
reason_player
,
0
,
0
);
raise_event
(
&
param
->
detach
,
EVENT_DETACH_MATERIAL
,
reason_effect
,
reason
,
reason_player
,
0
,
0
);
process_instant_event
();
process_instant_event
();
...
@@ -4674,6 +4680,9 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
...
@@ -4674,6 +4680,9 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
if
(
target
->
previous
.
location
==
LOCATION_GRAVE
)
{
if
(
target
->
previous
.
location
==
LOCATION_GRAVE
)
{
raise_single_event
(
target
,
0
,
EVENT_LEAVE_GRAVE
,
target
->
current
.
reason_effect
,
target
->
current
.
reason
,
move_player
,
0
,
0
);
raise_single_event
(
target
,
0
,
EVENT_LEAVE_GRAVE
,
target
->
current
.
reason_effect
,
target
->
current
.
reason
,
move_player
,
0
,
0
);
raise_event
(
target
,
EVENT_LEAVE_GRAVE
,
target
->
current
.
reason_effect
,
target
->
current
.
reason
,
move_player
,
0
,
0
);
raise_event
(
target
,
EVENT_LEAVE_GRAVE
,
target
->
current
.
reason_effect
,
target
->
current
.
reason
,
move_player
,
0
,
0
);
}
else
if
(
target
->
previous
.
location
==
LOCATION_DECK
||
target
->
previous
.
location
==
LOCATION_EXTRA
)
{
raise_single_event
(
target
,
0
,
EVENT_LEAVE_DECK
,
target
->
current
.
reason_effect
,
target
->
current
.
reason
,
move_player
,
0
,
0
);
raise_event
(
target
,
EVENT_LEAVE_DECK
,
target
->
current
.
reason_effect
,
target
->
current
.
reason
,
move_player
,
0
,
0
);
}
}
raise_single_event
(
target
,
0
,
EVENT_MOVE
,
target
->
current
.
reason_effect
,
target
->
current
.
reason
,
target
->
current
.
reason_player
,
0
,
0
);
raise_single_event
(
target
,
0
,
EVENT_MOVE
,
target
->
current
.
reason_effect
,
target
->
current
.
reason
,
target
->
current
.
reason_player
,
0
,
0
);
raise_event
(
target
,
EVENT_MOVE
,
target
->
current
.
reason_effect
,
target
->
current
.
reason
,
target
->
current
.
reason_player
,
0
,
0
);
raise_event
(
target
,
EVENT_MOVE
,
target
->
current
.
reason_effect
,
target
->
current
.
reason
,
target
->
current
.
reason_player
,
0
,
0
);
...
...
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