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
8e539a65
Commit
8e539a65
authored
Jun 19, 2025
by
mercury233
Committed by
GitHub
Jun 19, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update reason & add reason_effect for field::is_player_can_remove (#755)
parent
234de2e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
card.cpp
card.cpp
+6
-4
field.cpp
field.cpp
+4
-2
field.h
field.h
+1
-1
No files found.
card.cpp
View file @
8e539a65
...
...
@@ -2280,12 +2280,13 @@ int32_t card::leave_field_redirect(uint32_t reason) {
return
0
;
filter_effect
(
EFFECT_LEAVE_FIELD_REDIRECT
,
&
es
);
for
(
effect_set
::
size_type
i
=
0
;
i
<
es
.
size
();
++
i
)
{
redirect
=
es
[
i
]
->
get_value
(
this
,
0
);
effect
*
peffect
=
es
[
i
];
redirect
=
peffect
->
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
))
redirects
|=
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
))
redirects
|=
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
|
REASON_REDIRECT
,
peffect
))
redirects
|=
redirect
;
}
if
(
redirects
&
LOCATION_REMOVED
)
...
...
@@ -2318,12 +2319,13 @@ int32_t card::destination_redirect(uint8_t destination, uint32_t reason) {
else
return
0
;
for
(
effect_set
::
size_type
i
=
0
;
i
<
es
.
size
();
++
i
)
{
redirect
=
es
[
i
]
->
get_value
(
this
,
0
);
effect
*
peffect
=
es
[
i
];
redirect
=
peffect
->
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
))
return
redirect
;
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
))
return
redirect
;
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
))
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
|
REASON_REDIRECT
,
peffect
))
return
redirect
;
if
((
redirect
&
LOCATION_GRAVE
)
&&
!
is_affected_by_effect
(
EFFECT_CANNOT_TO_GRAVE
)
&&
pduel
->
game_field
->
is_player_can_send_to_grave
(
es
[
i
]
->
get_handler_player
(),
this
))
return
redirect
;
...
...
field.cpp
View file @
8e539a65
...
...
@@ -3367,7 +3367,9 @@ int32_t field::is_player_can_send_to_deck(uint8_t playerid, card * pcard) {
}
return
TRUE
;
}
int32_t
field
::
is_player_can_remove
(
uint8_t
playerid
,
card
*
pcard
,
uint32_t
reason
)
{
int32_t
field
::
is_player_can_remove
(
uint8_t
playerid
,
card
*
pcard
,
uint32_t
reason
,
effect
*
reason_effect
)
{
if
(
!
reason_effect
)
reason_effect
=
core
.
reason_effect
;
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_REMOVE
,
&
eset
);
for
(
effect_set
::
size_type
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
...
...
@@ -3377,7 +3379,7 @@ int32_t field::is_player_can_remove(uint8_t playerid, card * pcard, uint32_t rea
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
reason
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
core
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason_effect
,
PARAM_TYPE_EFFECT
);
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
5
))
return
FALSE
;
}
...
...
field.h
View file @
8e539a65
...
...
@@ -500,7 +500,7 @@ public:
int32_t
is_player_can_send_to_grave
(
uint8_t
playerid
,
card
*
pcard
);
int32_t
is_player_can_send_to_hand
(
uint8_t
playerid
,
card
*
pcard
);
int32_t
is_player_can_send_to_deck
(
uint8_t
playerid
,
card
*
pcard
);
int32_t
is_player_can_remove
(
uint8_t
playerid
,
card
*
pcard
,
uint32_t
reason
);
int32_t
is_player_can_remove
(
uint8_t
playerid
,
card
*
pcard
,
uint32_t
reason
,
effect
*
reason_effect
=
nullptr
);
int32_t
is_chain_negatable
(
uint8_t
chaincount
);
int32_t
is_chain_disablable
(
uint8_t
chaincount
);
int32_t
is_chain_disabled
(
uint8_t
chaincount
);
...
...
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