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
b794b34f
Commit
b794b34f
authored
Sep 30, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Fluorohydride/ygopro-core
parents
c3e93a53
242b903f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
10 deletions
+32
-10
card.cpp
card.cpp
+17
-4
common.h
common.h
+3
-0
operations.cpp
operations.cpp
+12
-6
No files found.
card.cpp
View file @
b794b34f
...
...
@@ -2173,18 +2173,31 @@ void card::release_relation(effect* peffect) {
int32
card
::
leave_field_redirect
(
uint32
reason
)
{
effect_set
es
;
uint32
redirect
;
uint32
redirects
=
0
;
if
(
data
.
type
&
TYPE_TOKEN
)
return
0
;
filter_effect
(
EFFECT_LEAVE_FIELD_REDIRECT
,
&
es
);
for
(
int32
i
=
0
;
i
<
es
.
size
();
++
i
)
{
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
))
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
))
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
))
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
;
}
int32
card
::
destination_redirect
(
uint8
destination
,
uint32
reason
)
{
...
...
common.h
View file @
b794b34f
...
...
@@ -50,6 +50,9 @@ struct card_sort {
#define LOCATION_ONFIELD 0x0c //
#define LOCATION_FZONE 0x100 //
#define LOCATION_PZONE 0x200 //
//For redirect
#define LOCATION_DECKBOT 0x10001 //Return to deck bottom
#define LOCATION_DECKSHF 0x20001 //Return to deck and shuffle
//Positions
#define POS_FACEUP_ATTACK 0x1
...
...
operations.cpp
View file @
b794b34f
...
...
@@ -1064,13 +1064,16 @@ int32 field::swap_control(uint16 step, effect* reason_effect, uint8 reason_playe
uint8
s1
=
pcard1
->
current
.
sequence
;
uint32
flag
;
get_useable_count
(
NULL
,
p1
,
LOCATION_MZONE
,
reason_player
,
LOCATION_REASON_CONTROL
,
0xff
,
&
flag
);
flag
=
(
flag
&
~
(
1
<<
s1
)
&
0xff
)
|
~
0x1f
;
if
(
reason_player
==
p1
)
flag
=
(
flag
&
~
(
1
<<
s1
)
&
0xff
)
|
~
0x1f
;
else
flag
=
((
flag
&
~
(
1
<<
s1
))
<<
16
&
0xff0000
)
|
~
0x1f0000
;
card
*
pcard2
=
*
targets2
->
it
;
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
p1
);
pduel
->
write_buffer8
(
reason_player
);
pduel
->
write_buffer32
(
pcard2
->
data
.
code
);
add_process
(
PROCESSOR_SELECT_PLACE
,
0
,
0
,
0
,
p1
,
flag
,
1
);
add_process
(
PROCESSOR_SELECT_PLACE
,
0
,
0
,
0
,
reason_player
,
flag
,
1
);
return
FALSE
;
}
case
2
:
{
...
...
@@ -1080,13 +1083,16 @@ int32 field::swap_control(uint16 step, effect* reason_effect, uint8 reason_playe
uint8
s2
=
pcard2
->
current
.
sequence
;
uint32
flag
;
get_useable_count
(
NULL
,
p2
,
LOCATION_MZONE
,
reason_player
,
LOCATION_REASON_CONTROL
,
0xff
,
&
flag
);
flag
=
(
flag
&
~
(
1
<<
s2
)
&
0xff
)
|
~
0x1f
;
if
(
reason_player
==
p2
)
flag
=
(
flag
&
~
(
1
<<
s2
)
&
0xff
)
|
~
0x1f
;
else
flag
=
((
flag
&
~
(
1
<<
s2
))
<<
16
&
0xff0000
)
|
~
0x1f0000
;
card
*
pcard1
=
*
targets1
->
it
;
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
p2
);
pduel
->
write_buffer8
(
reason_player
);
pduel
->
write_buffer32
(
pcard1
->
data
.
code
);
add_process
(
PROCESSOR_SELECT_PLACE
,
0
,
0
,
0
,
p2
,
flag
,
1
);
add_process
(
PROCESSOR_SELECT_PLACE
,
0
,
0
,
0
,
reason_player
,
flag
,
1
);
return
FALSE
;
}
case
3
:
{
...
...
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