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
f5840678
Commit
f5840678
authored
Apr 30, 2024
by
mercury233
Committed by
GitHub
Apr 30, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add card::is_treated_as_not_on_field (#572)
* add card::is_treated_as_not_on_field * fix get material
parent
7c07b01d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
23 deletions
+29
-23
card.cpp
card.cpp
+6
-4
card.h
card.h
+1
-0
effect.cpp
effect.cpp
+1
-1
field.cpp
field.cpp
+14
-12
libcard.cpp
libcard.cpp
+7
-6
No files found.
card.cpp
View file @
f5840678
...
...
@@ -1286,8 +1286,7 @@ int32 card::is_link_marker(uint32 dir) {
return
(
int32
)(
get_link_marker
()
&
dir
);
}
uint32
card
::
get_linked_zone
()
{
if
(
!
(
data
.
type
&
TYPE_LINK
)
||
current
.
location
!=
LOCATION_MZONE
||
get_status
(
STATUS_SUMMONING
|
STATUS_SUMMON_DISABLED
|
STATUS_SPSUMMON_STEP
))
if
(
!
(
data
.
type
&
TYPE_LINK
)
||
current
.
location
!=
LOCATION_MZONE
||
is_treated_as_not_on_field
())
return
0
;
int32
zones
=
0
;
int32
s
=
current
.
sequence
;
...
...
@@ -1343,8 +1342,7 @@ void card::get_linked_cards(card_set* cset) {
pduel
->
game_field
->
get_cards_in_zone
(
cset
,
linked_zone
>>
16
,
1
-
p
,
LOCATION_MZONE
);
}
uint32
card
::
get_mutual_linked_zone
()
{
if
(
!
(
data
.
type
&
TYPE_LINK
)
||
current
.
location
!=
LOCATION_MZONE
||
get_status
(
STATUS_SUMMONING
|
STATUS_SUMMON_DISABLED
|
STATUS_SPSUMMON_STEP
))
if
(
!
(
data
.
type
&
TYPE_LINK
)
||
current
.
location
!=
LOCATION_MZONE
||
is_treated_as_not_on_field
())
return
0
;
int32
zones
=
0
;
int32
p
=
current
.
controler
;
...
...
@@ -1507,6 +1505,10 @@ int32 card::is_all_column() {
return
TRUE
;
return
FALSE
;
}
int32
card
::
is_treated_as_not_on_field
()
{
return
get_status
(
STATUS_SUMMONING
|
STATUS_SUMMON_DISABLED
|
STATUS_ACTIVATE_DISABLED
|
STATUS_SPSUMMON_STEP
);
}
void
card
::
equip
(
card
*
target
,
uint32
send_msg
)
{
if
(
equiping_target
)
return
;
...
...
card.h
View file @
f5840678
...
...
@@ -268,6 +268,7 @@ public:
uint32
get_column_zone
(
int32
location
);
void
get_column_cards
(
card_set
*
cset
);
int32
is_all_column
();
int32
is_treated_as_not_on_field
();
void
equip
(
card
*
target
,
uint32
send_msg
=
TRUE
);
void
unequip
();
...
...
effect.cpp
View file @
f5840678
...
...
@@ -473,7 +473,7 @@ int32 effect::is_target(card* pcard) {
&&
!
pcard
->
is_position
(
POS_FACEUP
))
return
FALSE
;
if
(
!
is_flag
(
EFFECT_FLAG_IGNORE_RANGE
))
{
if
(
pcard
->
get_status
(
STATUS_SUMMONING
|
STATUS_SUMMON_DISABLED
|
STATUS_ACTIVATE_DISABLED
|
STATUS_SPSUMMON_STEP
))
if
(
pcard
->
is_treated_as_not_on_field
(
))
return
FALSE
;
if
(
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
return
FALSE
;
...
...
field.cpp
View file @
f5840678
...
...
@@ -1446,7 +1446,7 @@ int32 field::filter_matching_card(int32 findex, uint8 self, uint32 location1, ui
for
(
uint32
p
=
0
;
p
<
2
;
++
p
)
{
if
(
location
&
LOCATION_MZONE
)
{
for
(
auto
&
pcard
:
player
[
self
].
list_mzone
)
{
if
(
pcard
&&
!
pcard
->
get_status
(
STATUS_SUMMONING
|
STATUS_SUMMON_DISABLED
|
STATUS_SPSUMMON_STEP
)
if
(
pcard
&&
!
pcard
->
is_treated_as_not_on_field
(
)
&&
pcard
!=
pexception
&&
!
(
pexgroup
&&
pexgroup
->
has_card
(
pcard
))
&&
pduel
->
lua
->
check_matching
(
pcard
,
findex
,
extraargs
)
&&
(
!
is_target
||
pcard
->
is_capable_be_effect_target
(
core
.
reason_effect
,
core
.
reason_player
)))
{
...
...
@@ -1465,7 +1465,7 @@ int32 field::filter_matching_card(int32 findex, uint8 self, uint32 location1, ui
}
if
(
location
&
LOCATION_SZONE
)
{
for
(
auto
&
pcard
:
player
[
self
].
list_szone
)
{
if
(
pcard
&&
!
pcard
->
is_
status
(
STATUS_ACTIVATE_DISABLED
)
if
(
pcard
&&
!
pcard
->
is_
treated_as_not_on_field
(
)
&&
pcard
!=
pexception
&&
!
(
pexgroup
&&
pexgroup
->
has_card
(
pcard
))
&&
pduel
->
lua
->
check_matching
(
pcard
,
findex
,
extraargs
)
&&
(
!
is_target
||
pcard
->
is_capable_be_effect_target
(
core
.
reason_effect
,
core
.
reason_player
)))
{
...
...
@@ -1484,7 +1484,7 @@ int32 field::filter_matching_card(int32 findex, uint8 self, uint32 location1, ui
}
if
(
location
&
LOCATION_FZONE
)
{
card
*
pcard
=
player
[
self
].
list_szone
[
5
];
if
(
pcard
&&
!
pcard
->
is_
status
(
STATUS_ACTIVATE_DISABLED
)
if
(
pcard
&&
!
pcard
->
is_
treated_as_not_on_field
(
)
&&
pcard
!=
pexception
&&
!
(
pexgroup
&&
pexgroup
->
has_card
(
pcard
))
&&
pduel
->
lua
->
check_matching
(
pcard
,
findex
,
extraargs
)
&&
(
!
is_target
||
pcard
->
is_capable_be_effect_target
(
core
.
reason_effect
,
core
.
reason_player
)))
{
...
...
@@ -1503,7 +1503,7 @@ int32 field::filter_matching_card(int32 findex, uint8 self, uint32 location1, ui
if
(
location
&
LOCATION_PZONE
)
{
for
(
int32
i
=
0
;
i
<
2
;
++
i
)
{
card
*
pcard
=
player
[
self
].
list_szone
[
core
.
duel_rule
>=
4
?
i
*
4
:
i
+
6
];
if
(
pcard
&&
pcard
->
current
.
pzone
&&
!
pcard
->
is_
status
(
STATUS_ACTIVATE_DISABLED
)
if
(
pcard
&&
pcard
->
current
.
pzone
&&
!
pcard
->
is_
treated_as_not_on_field
(
)
&&
pcard
!=
pexception
&&
!
(
pexgroup
&&
pexgroup
->
has_card
(
pcard
))
&&
pduel
->
lua
->
check_matching
(
pcard
,
findex
,
extraargs
)
&&
(
!
is_target
||
pcard
->
is_capable_be_effect_target
(
core
.
reason_effect
,
core
.
reason_player
)))
{
...
...
@@ -1895,7 +1895,7 @@ void field::get_ritual_material(uint8 playerid, effect* peffect, card_set* mater
void
field
::
get_fusion_material
(
uint8
playerid
,
card_set
*
material_all
,
card_set
*
material_base
,
uint32
location
)
{
if
(
location
&
LOCATION_MZONE
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
&&
!
pcard
->
is_
status
(
STATUS_SUMMONING
))
if
(
pcard
&&
!
pcard
->
is_
treated_as_not_on_field
(
))
material_base
->
insert
(
pcard
);
}
}
...
...
@@ -1931,13 +1931,13 @@ void field::get_fusion_material(uint8 playerid, card_set* material_all, card_set
}
if
(
location
&
LOCATION_SZONE
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_szone
)
{
if
(
pcard
&&
pcard
->
data
.
type
&
TYPE_MONSTER
)
if
(
pcard
&&
pcard
->
data
.
type
&
TYPE_MONSTER
&&
!
pcard
->
is_treated_as_not_on_field
()
)
material_base
->
insert
(
pcard
);
}
}
if
(
location
&
LOCATION_PZONE
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_szone
)
{
if
(
pcard
&&
pcard
->
current
.
pzone
&&
pcard
->
data
.
type
&
TYPE_MONSTER
)
if
(
pcard
&&
pcard
->
current
.
pzone
&&
pcard
->
data
.
type
&
TYPE_MONSTER
&&
!
pcard
->
is_treated_as_not_on_field
()
)
material_base
->
insert
(
pcard
);
}
}
...
...
@@ -1979,12 +1979,14 @@ void field::get_xyz_material(card* scard, int32 findex, uint32 lv, int32 maxc, g
}
else
{
int32
playerid
=
scard
->
current
.
controler
;
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
pcard
->
is_can_be_xyz_material
(
scard
)
&&
(
xyz_level
=
pcard
->
check_xyz_level
(
scard
,
lv
))
if
(
pcard
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
!
pcard
->
is_treated_as_not_on_field
()
&&
pcard
->
is_can_be_xyz_material
(
scard
)
&&
(
xyz_level
=
pcard
->
check_xyz_level
(
scard
,
lv
))
&&
(
findex
==
0
||
pduel
->
lua
->
check_matching
(
pcard
,
findex
,
0
)))
core
.
xmaterial_lst
.
emplace
((
xyz_level
>>
12
)
&
0xf
,
pcard
);
}
for
(
auto
&
pcard
:
player
[
1
-
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
pcard
->
is_can_be_xyz_material
(
scard
)
&&
(
xyz_level
=
pcard
->
check_xyz_level
(
scard
,
lv
))
if
(
pcard
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
!
pcard
->
is_treated_as_not_on_field
()
&&
pcard
->
is_can_be_xyz_material
(
scard
)
&&
(
xyz_level
=
pcard
->
check_xyz_level
(
scard
,
lv
))
&&
pcard
->
is_affected_by_effect
(
EFFECT_XYZ_MATERIAL
)
&&
(
findex
==
0
||
pduel
->
lua
->
check_matching
(
pcard
,
findex
,
0
)))
core
.
xmaterial_lst
.
emplace
((
xyz_level
>>
12
)
&
0xf
,
pcard
);
}
...
...
@@ -2533,7 +2535,7 @@ void field::get_synchro_material(uint8 playerid, card_set* material, effect* ptu
int32
location
=
ptuner
->
value
;
if
(
location
&
LOCATION_MZONE
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
)
if
(
pcard
&&
!
pcard
->
is_treated_as_not_on_field
()
)
material
->
insert
(
pcard
);
}
}
...
...
@@ -2545,11 +2547,11 @@ void field::get_synchro_material(uint8 playerid, card_set* material, effect* ptu
}
}
else
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
)
if
(
pcard
&&
!
pcard
->
is_treated_as_not_on_field
()
)
material
->
insert
(
pcard
);
}
for
(
auto
&
pcard
:
player
[
1
-
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_SYNCHRO_MATERIAL
))
if
(
pcard
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_SYNCHRO_MATERIAL
)
&&
!
pcard
->
is_treated_as_not_on_field
()
)
material
->
insert
(
pcard
);
}
for
(
auto
&
pcard
:
player
[
playerid
].
list_hand
)
{
...
...
libcard.cpp
View file @
f5840678
...
...
@@ -824,7 +824,7 @@ int32 scriptlib::card_get_location(lua_State *L) {
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
if
(
pcard
->
get_status
(
STATUS_SUMMONING
|
STATUS_SUMMON_DISABLED
|
STATUS_ACTIVATE_DISABLED
|
STATUS_SPSUMMON_STEP
))
if
(
pcard
->
is_treated_as_not_on_field
(
))
lua_pushinteger
(
L
,
0
);
else
lua_pushinteger
(
L
,
pcard
->
current
.
location
);
...
...
@@ -2613,8 +2613,7 @@ int32 scriptlib::card_is_onfield(lua_State *L) {
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
if
((
pcard
->
current
.
location
&
LOCATION_ONFIELD
)
&&
!
pcard
->
get_status
(
STATUS_SUMMONING
|
STATUS_SUMMON_DISABLED
|
STATUS_ACTIVATE_DISABLED
|
STATUS_SPSUMMON_STEP
))
if
((
pcard
->
current
.
location
&
LOCATION_ONFIELD
)
&&
!
pcard
->
is_treated_as_not_on_field
())
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
0
);
...
...
@@ -2625,13 +2624,15 @@ int32 scriptlib::card_is_location(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
loc
=
(
uint32
)
lua_tointeger
(
L
,
2
);
if
(
pcard
->
current
.
location
==
LOCATION_MZONE
)
{
if
((
loc
&
LOCATION_MZONE
)
&&
!
pcard
->
get_status
(
STATUS_SUMMONING
|
STATUS_SUMMON_DISABLED
|
STATUS_SPSUMMON_STEP
))
if
(
pcard
->
is_treated_as_not_on_field
())
{
lua_pushboolean
(
L
,
0
);
}
else
if
(
pcard
->
current
.
location
==
LOCATION_MZONE
)
{
if
(
loc
&
LOCATION_MZONE
)
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
0
);
}
else
if
(
pcard
->
current
.
location
==
LOCATION_SZONE
)
{
if
(
pcard
->
current
.
is_location
(
loc
)
&&
!
pcard
->
is_status
(
STATUS_ACTIVATE_DISABLED
)
)
if
(
pcard
->
current
.
is_location
(
loc
))
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
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