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
abc797dd
Commit
abc797dd
authored
Nov 09, 2024
by
salix5
Committed by
GitHub
Nov 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add field::get_pzone_sequence() (#656)
parent
d92fb763
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
23 deletions
+35
-23
field.cpp
field.cpp
+22
-16
field.h
field.h
+3
-1
libcard.cpp
libcard.cpp
+7
-3
libdebug.cpp
libdebug.cpp
+1
-1
operations.cpp
operations.cpp
+2
-2
No files found.
field.cpp
View file @
abc797dd
...
...
@@ -486,7 +486,21 @@ void field::set_control(card* pcard, uint8 playerid, uint16 reset_phase, uint8 r
pcard
->
current
.
controler
=
playerid
;
}
card
*
field
::
get_field_card
(
uint8
playerid
,
uint32
general_location
,
uint8
sequence
)
{
int32
field
::
get_pzone_sequence
(
uint8
pseq
)
const
{
if
(
core
.
duel_rule
>=
NEW_MASTER_RULE
)
{
if
(
!
pseq
)
return
0
;
else
return
4
;
}
else
{
if
(
!
pseq
)
return
6
;
else
return
7
;
}
}
card
*
field
::
get_field_card
(
uint8
playerid
,
uint32
general_location
,
uint8
sequence
)
const
{
if
(
!
check_playerid
(
playerid
))
return
nullptr
;
switch
(
general_location
)
{
...
...
@@ -512,12 +526,9 @@ card* field::get_field_card(uint8 playerid, uint32 general_location, uint8 seque
break
;
}
case
LOCATION_PZONE
:
{
if
(
sequence
==
0
)
{
card
*
pcard
=
player
[
playerid
].
list_szone
[
core
.
duel_rule
>=
NEW_MASTER_RULE
?
0
:
6
];
return
(
pcard
&&
pcard
->
current
.
pzone
)
?
pcard
:
0
;
}
else
if
(
sequence
==
1
)
{
card
*
pcard
=
player
[
playerid
].
list_szone
[
core
.
duel_rule
>=
NEW_MASTER_RULE
?
4
:
7
];
return
(
pcard
&&
pcard
->
current
.
pzone
)
?
pcard
:
0
;
if
(
sequence
==
0
||
sequence
==
1
)
{
card
*
pcard
=
player
[
playerid
].
list_szone
[
get_pzone_sequence
(
sequence
)];
return
(
pcard
&&
pcard
->
current
.
pzone
)
?
pcard
:
nullptr
;
}
else
return
nullptr
;
break
;
...
...
@@ -587,13 +598,8 @@ int32 field::is_location_useable(uint8 playerid, uint32 general_location, uint8
}
else
if
(
general_location
==
LOCATION_PZONE
)
{
if
(
sequence
>=
2
)
return
FALSE
;
if
(
core
.
duel_rule
>=
NEW_MASTER_RULE
)
{
if
(
flag
&
(
0x100U
<<
(
sequence
*
4
)))
return
FALSE
;
}
else
{
if
(
flag
&
(
0x100U
<<
(
6
+
sequence
)))
return
FALSE
;
}
if
(
flag
&
(
0x100U
<<
get_pzone_sequence
(
sequence
)))
return
FALSE
;
}
return
TRUE
;
}
...
...
@@ -1504,7 +1510,7 @@ int32 field::filter_matching_card(lua_State* L, int32 findex, uint8 self, uint32
}
if
(
location
&
LOCATION_PZONE
)
{
for
(
int32
i
=
0
;
i
<
2
;
++
i
)
{
card
*
pcard
=
player
[
self
].
list_szone
[
core
.
duel_rule
>=
NEW_MASTER_RULE
?
i
*
4
:
i
+
6
];
card
*
pcard
=
player
[
self
].
list_szone
[
get_pzone_sequence
(
i
)
];
if
(
pcard
&&
pcard
->
current
.
pzone
&&
!
pcard
->
is_treated_as_not_on_field
()
&&
pcard
!=
pexception
&&
!
(
pexgroup
&&
pexgroup
->
has_card
(
pcard
))
&&
pduel
->
lua
->
check_filter
(
L
,
pcard
,
findex
,
extraargs
)
...
...
@@ -1630,7 +1636,7 @@ int32 field::filter_field_card(uint8 self, uint32 location1, uint32 location2, g
}
if
(
location
&
LOCATION_PZONE
)
{
for
(
int32
i
=
0
;
i
<
2
;
++
i
)
{
card
*
pcard
=
player
[
self
].
list_szone
[
core
.
duel_rule
>=
NEW_MASTER_RULE
?
i
*
4
:
i
+
6
];
card
*
pcard
=
player
[
self
].
list_szone
[
get_pzone_sequence
(
i
)
];
if
(
pcard
&&
pcard
->
current
.
pzone
)
{
result
.
insert
(
pcard
);
}
...
...
field.h
View file @
abc797dd
...
...
@@ -388,7 +388,9 @@ public:
void
swap_card
(
card
*
pcard1
,
card
*
pcard2
,
uint8
new_sequence1
,
uint8
new_sequence2
);
void
swap_card
(
card
*
pcard1
,
card
*
pcard2
);
void
set_control
(
card
*
pcard
,
uint8
playerid
,
uint16
reset_phase
,
uint8
reset_count
);
card
*
get_field_card
(
uint8
playerid
,
uint32
general_location
,
uint8
sequence
);
int32
get_pzone_sequence
(
uint8
pseq
)
const
;
card
*
get_field_card
(
uint8
playerid
,
uint32
general_location
,
uint8
sequence
)
const
;
int32
is_location_useable
(
uint8
playerid
,
uint32
general_location
,
uint8
sequence
)
const
;
int32
get_useable_count
(
card
*
pcard
,
uint8
playerid
,
uint8
location
,
uint8
uplayer
,
uint32
reason
,
uint32
zone
=
0xff
,
uint32
*
list
=
nullptr
);
int32
get_useable_count_fromex
(
card
*
pcard
,
uint8
playerid
,
uint8
uplayer
,
uint32
zone
=
0xff
,
uint32
*
list
=
nullptr
);
...
...
libcard.cpp
View file @
abc797dd
...
...
@@ -393,10 +393,14 @@ int32 scriptlib::card_get_current_scale(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
.
pzone
&&
pcard
->
current
.
sequence
==
(
pcard
->
pduel
->
game_field
->
core
.
duel_rule
>=
NEW_MASTER_RULE
?
0
:
6
))
lua_pushinteger
(
L
,
pcard
->
get_lscale
());
if
(
pcard
->
current
.
pzone
)
{
if
(
pcard
->
current
.
sequence
==
pcard
->
pduel
->
game_field
->
get_pzone_sequence
(
0
))
lua_pushinteger
(
L
,
pcard
->
get_lscale
());
else
lua_pushinteger
(
L
,
pcard
->
get_rscale
());
}
else
lua_pushinteger
(
L
,
pcard
->
get_rscale
()
);
lua_pushinteger
(
L
,
pcard
->
data
.
lscale
);
return
1
;
}
int32
scriptlib
::
card_is_link_marker
(
lua_State
*
L
)
{
...
...
libdebug.cpp
View file @
abc797dd
...
...
@@ -43,7 +43,7 @@ int32 scriptlib::debug_add_card(lua_State *L) {
position
=
POS_FACEDOWN_DEFENSE
;
pcard
->
sendto_param
.
position
=
position
;
if
(
location
==
LOCATION_PZONE
)
{
int32
seq
=
pduel
->
game_field
->
core
.
duel_rule
>=
NEW_MASTER_RULE
?
sequence
*
4
:
sequence
+
6
;
int32
seq
=
pduel
->
game_field
->
get_pzone_sequence
(
sequence
)
;
pduel
->
game_field
->
add_card
(
playerid
,
pcard
,
LOCATION_SZONE
,
seq
,
TRUE
);
}
else
{
pduel
->
game_field
->
add_card
(
playerid
,
pcard
,
location
,
sequence
);
...
...
operations.cpp
View file @
abc797dd
...
...
@@ -4566,9 +4566,9 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
}
else
if
(
pzone
&&
location
==
LOCATION_SZONE
&&
(
target
->
data
.
type
&
TYPE_PENDULUM
))
{
uint32
flag
=
0
;
if
(
is_location_useable
(
playerid
,
LOCATION_PZONE
,
0
))
flag
|=
0x1
u
<<
(
core
.
duel_rule
>=
NEW_MASTER_RULE
?
8
:
14
);
flag
|=
0x1
00U
<<
get_pzone_sequence
(
0
);
if
(
is_location_useable
(
playerid
,
LOCATION_PZONE
,
1
))
flag
|=
0x1
u
<<
(
core
.
duel_rule
>=
NEW_MASTER_RULE
?
12
:
15
);
flag
|=
0x1
00U
<<
get_pzone_sequence
(
1
);
if
(
!
flag
)
{
core
.
units
.
begin
()
->
step
=
3
;
if
(
target
->
current
.
location
!=
LOCATION_GRAVE
)
...
...
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