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
0ac8029c
Commit
0ac8029c
authored
Mar 25, 2017
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
16aea8eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
24 deletions
+29
-24
card.cpp
card.cpp
+13
-9
card.h
card.h
+12
-11
field.cpp
field.cpp
+4
-4
No files found.
card.cpp
View file @
0ac8029c
...
...
@@ -105,7 +105,6 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
if
(
query_flag
&
QUERY_TYPE
)
q_cache
.
type
=
*
p
++
=
get_type
();
if
(
query_flag
&
QUERY_LEVEL
)
q_cache
.
level
=
*
p
++
=
get_level
();
if
(
query_flag
&
QUERY_RANK
)
q_cache
.
rank
=
*
p
++
=
get_rank
();
if
(
query_flag
&
QUERY_LINK
)
q_cache
.
link
=
*
p
++
=
get_link
();
if
(
query_flag
&
QUERY_ATTRIBUTE
)
q_cache
.
attribute
=
*
p
++
=
get_attribute
();
if
(
query_flag
&
QUERY_RACE
)
q_cache
.
race
=
*
p
++
=
get_race
();
if
(
query_flag
&
QUERY_ATTACK
)
q_cache
.
attack
=
*
p
++
=
get_attack
();
...
...
@@ -130,11 +129,6 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
q_cache
.
rank
=
tdata
;
*
p
++
=
tdata
;
}
else
query_flag
&=
~
QUERY_RANK
;
if
((
query_flag
&
QUERY_LINK
)
&&
((
uint32
)(
tdata
=
get_link
())
!=
q_cache
.
link
))
{
q_cache
.
link
=
tdata
;
*
p
++
=
tdata
;
}
else
query_flag
&=
~
QUERY_LINK
;
if
((
query_flag
&
QUERY_ATTRIBUTE
)
&&
((
uint32
)(
tdata
=
get_attribute
())
!=
q_cache
.
attribute
))
{
q_cache
.
attribute
=
tdata
;
*
p
++
=
tdata
;
...
...
@@ -202,6 +196,10 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
if
(
!
use_cache
)
{
if
(
query_flag
&
QUERY_LSCALE
)
q_cache
.
lscale
=
*
p
++
=
get_lscale
();
if
(
query_flag
&
QUERY_RSCALE
)
q_cache
.
rscale
=
*
p
++
=
get_rscale
();
if
(
query_flag
&
QUERY_LINK
)
{
q_cache
.
link
=
*
p
++
=
get_link
();
q_cache
.
link_marker
=
*
p
++
=
get_link_marker
();
}
}
else
{
if
((
query_flag
&
QUERY_LSCALE
)
&&
((
uint32
)(
tdata
=
get_lscale
())
!=
q_cache
.
lscale
))
{
q_cache
.
lscale
=
tdata
;
...
...
@@ -211,6 +209,12 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
q_cache
.
rscale
=
tdata
;
*
p
++
=
tdata
;
}
else
query_flag
&=
~
QUERY_RSCALE
;
if
((
query_flag
&
QUERY_LINK
)
&&
((
get_link
()
!=
q_cache
.
link
)
||
(
get_link_marker
()
!=
q_cache
.
link_marker
)))
{
q_cache
.
link
=
get_link
();
*
p
++
=
tdata
;
q_cache
.
link_marker
=
get_link_marker
();
*
p
++
=
tdata
;
}
else
query_flag
&=
~
QUERY_LINK
;
}
*
(
uint32
*
)
buf
=
(
byte
*
)
p
-
buf
;
*
(
uint32
*
)(
buf
+
4
)
=
query_flag
;
...
...
@@ -1074,13 +1078,13 @@ uint32 card::get_rscale() {
temp
.
rscale
=
0xffffffff
;
return
rscale
;
}
int32
card
::
get_link_marker
()
{
u
int32
card
::
get_link_marker
()
{
if
(
!
(
data
.
type
&
TYPE_LINK
))
return
0
;
return
data
.
link_marker
;
}
int32
card
::
is_link_marker
(
int32
dir
)
{
return
get_link_marker
()
&
dir
;
int32
card
::
is_link_marker
(
u
int32
dir
)
{
return
(
int32
)(
get_link_marker
()
&
dir
)
;
}
uint32
card
::
get_linked_zone
()
{
if
(
!
(
data
.
type
&
TYPE_LINK
)
||
current
.
location
!=
LOCATION_MZONE
)
...
...
card.h
View file @
0ac8029c
...
...
@@ -33,7 +33,7 @@ struct card_data {
int32
defense
;
uint32
lscale
;
uint32
rscale
;
int32
link_marker
;
u
int32
link_marker
;
};
struct
card_state
{
...
...
@@ -80,6 +80,7 @@ struct query_cache {
int32
is_disabled
;
uint32
lscale
;
uint32
rscale
;
uint32
link_marker
;
};
class
card
{
...
...
@@ -190,8 +191,8 @@ public:
uint32
get_race
();
uint32
get_lscale
();
uint32
get_rscale
();
int32
get_link_marker
();
int32
is_link_marker
(
int32
dir
);
u
int32
get_link_marker
();
int32
is_link_marker
(
u
int32
dir
);
uint32
get_linked_zone
();
void
get_linked_cards
(
card_set
*
cset
);
int32
is_position
(
int32
pos
);
...
...
@@ -494,13 +495,13 @@ public:
#define ASSUME_ATTACK 7
#define ASSUME_DEFENSE 8
#define LINK_MARKER_
TOP 0x
1
#define LINK_MARKER_
TOP_LEFT 0x
2
#define LINK_MARKER_
LEFT 0x
4
#define LINK_MARKER_
BOTTOM_LEFT 0x8
#define LINK_MARKER_
BOTTOM 0x1
0
#define LINK_MARKER_
BOTTOM_RIGHT 0x2
0
#define LINK_MARKER_
RIGHT 0x4
0
#define LINK_MARKER_TOP_RIGHT 0
x8
0
#define LINK_MARKER_
BOTTOM_LEFT 000
1
#define LINK_MARKER_
BOTTOM 000
2
#define LINK_MARKER_
BOTTOM_RIGHT 000
4
#define LINK_MARKER_
LEFT 0010
#define LINK_MARKER_
RIGHT 004
0
#define LINK_MARKER_
TOP_LEFT 010
0
#define LINK_MARKER_
TOP 020
0
#define LINK_MARKER_TOP_RIGHT 0
40
0
#endif
/* CARD_H_ */
field.cpp
View file @
0ac8029c
...
...
@@ -533,17 +533,17 @@ int32 field::get_useable_count_fromex(uint8 playerid, uint8 uplayer, uint32* lis
uint32
flag
=
player
[
playerid
].
disabled_location
|
player
[
playerid
].
used_location
;
uint32
used_flag
=
player
[
playerid
].
used_location
;
uint32
zones
=
get_linked_zone
(
playerid
);
flag
=
flag
&
~
zones
&
0x1f
;
flag
=
(
flag
|
~
zones
)
&
0x1f
;
used_flag
=
used_flag
&
0x1f
;
int32
used_count
=
field_used_count
[
flag
];
int32
maxcount
=
6
;
if
(
player
[
playerid
].
list_mzone
[
5
]
||
player
[
playerid
].
list_mzone
[
6
])
{
flag
|=
(
1
<<
5
)
|
(
1
<<
6
);
flag
|=
(
1
u
<<
5
)
|
(
1u
<<
6
);
maxcount
=
5
;
}
else
if
(
player
[
1
-
playerid
].
list_mzone
[
5
])
flag
|=
1
<<
6
;
flag
|=
1
u
<<
6
;
else
if
(
player
[
1
-
playerid
].
list_mzone
[
6
])
flag
|=
1
<<
5
;
flag
|=
1
u
<<
5
;
if
(
list
)
*
list
=
flag
;
int32
count
=
maxcount
-
used_count
;
...
...
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