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
d2fa7fcf
Commit
d2fa7fcf
authored
Sep 29, 2020
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
3238c9dd
972a3806
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
card.cpp
card.cpp
+17
-4
common.h
common.h
+3
-0
No files found.
card.cpp
View file @
d2fa7fcf
...
@@ -2058,18 +2058,31 @@ void card::release_relation(effect* peffect) {
...
@@ -2058,18 +2058,31 @@ void card::release_relation(effect* peffect) {
int32
card
::
leave_field_redirect
(
uint32
reason
)
{
int32
card
::
leave_field_redirect
(
uint32
reason
)
{
effect_set
es
;
effect_set
es
;
uint32
redirect
;
uint32
redirect
;
uint32
redirects
=
0
;
if
(
data
.
type
&
TYPE_TOKEN
)
if
(
data
.
type
&
TYPE_TOKEN
)
return
0
;
return
0
;
filter_effect
(
EFFECT_LEAVE_FIELD_REDIRECT
,
&
es
);
filter_effect
(
EFFECT_LEAVE_FIELD_REDIRECT
,
&
es
);
for
(
int32
i
=
0
;
i
<
es
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
es
.
size
();
++
i
)
{
redirect
=
es
[
i
]
->
get_value
(
this
,
0
);
redirect
=
es
[
i
]
->
get_value
(
this
,
0
);
if
((
redirect
&
LOCATION_HAND
)
&&
!
is_affected_by_effect
(
EFFECT_CANNOT_TO_HAND
)
&&
pduel
->
game_field
->
is_player_can_send_to_hand
(
es
[
i
]
->
get_handler_player
(),
this
))
if
((
redirect
&
LOCATION_HAND
)
&&
!
is_affected_by_effect
(
EFFECT_CANNOT_TO_HAND
)
&&
pduel
->
game_field
->
is_player_can_send_to_hand
(
es
[
i
]
->
get_handler_player
(),
this
))
re
turn
redirect
;
re
directs
|=
redirect
;
else
if
((
redirect
&
LOCATION_DECK
)
&&
!
is_affected_by_effect
(
EFFECT_CANNOT_TO_DECK
)
&&
pduel
->
game_field
->
is_player_can_send_to_deck
(
es
[
i
]
->
get_handler_player
(),
this
))
else
if
((
redirect
&
LOCATION_DECK
)
&&
!
is_affected_by_effect
(
EFFECT_CANNOT_TO_DECK
)
&&
pduel
->
game_field
->
is_player_can_send_to_deck
(
es
[
i
]
->
get_handler_player
(),
this
))
re
turn
redirect
;
re
directs
|=
redirect
;
else
if
((
redirect
&
LOCATION_REMOVED
)
&&
!
is_affected_by_effect
(
EFFECT_CANNOT_REMOVE
)
&&
pduel
->
game_field
->
is_player_can_remove
(
es
[
i
]
->
get_handler_player
(),
this
,
REASON_EFFECT
))
else
if
((
redirect
&
LOCATION_REMOVED
)
&&
!
is_affected_by_effect
(
EFFECT_CANNOT_REMOVE
)
&&
pduel
->
game_field
->
is_player_can_remove
(
es
[
i
]
->
get_handler_player
(),
this
,
REASON_EFFECT
))
return
redirect
;
redirects
|=
redirect
;
}
}
if
(
redirects
&
LOCATION_REMOVED
)
return
LOCATION_REMOVED
;
// the ruling for the priority of the following redirects can't be confirmed for now
if
(
redirects
&
LOCATION_DECK
)
{
if
(
redirects
&
LOCATION_DECKBOT
)
return
LOCATION_DECKBOT
;
if
(
redirects
&
LOCATION_DECKSHF
)
return
LOCATION_DECKSHF
;
return
LOCATION_DECK
;
}
if
(
redirects
&
LOCATION_HAND
)
return
LOCATION_HAND
;
return
0
;
return
0
;
}
}
int32
card
::
destination_redirect
(
uint8
destination
,
uint32
reason
)
{
int32
card
::
destination_redirect
(
uint8
destination
,
uint32
reason
)
{
...
...
common.h
View file @
d2fa7fcf
...
@@ -50,6 +50,9 @@ struct card_sort {
...
@@ -50,6 +50,9 @@ struct card_sort {
#define LOCATION_ONFIELD 0x0c //
#define LOCATION_ONFIELD 0x0c //
#define LOCATION_FZONE 0x100 //
#define LOCATION_FZONE 0x100 //
#define LOCATION_PZONE 0x200 //
#define LOCATION_PZONE 0x200 //
//For redirect
#define LOCATION_DECKBOT 0x10001 //Return to deck bottom
#define LOCATION_DECKSHF 0x20001 //Return to deck and shuffle
//Positions
//Positions
#define POS_FACEUP_ATTACK 0x1
#define POS_FACEUP_ATTACK 0x1
...
...
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