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
dde64688
Commit
dde64688
authored
Jan 11, 2024
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
card_data: add is_alternative()
parent
a517fad9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
card.cpp
card.cpp
+1
-1
card.h
card.h
+0
-2
card_data.h
card_data.h
+6
-0
interpreter.cpp
interpreter.cpp
+1
-1
No files found.
card.cpp
View file @
dde64688
...
...
@@ -421,7 +421,7 @@ uint32 card::get_info_location() {
}
// get the printed code on card
uint32
card
::
get_original_code
()
const
{
if
(
data
.
alias
&&
(
data
.
alias
<
data
.
code
+
CARD_ARTWORK_VERSIONS_OFFSET
)
&&
(
data
.
code
<
data
.
alias
+
CARD_ARTWORK_VERSIONS_OFFSET
))
if
(
data
.
is_alternative
(
))
return
data
.
alias
;
else
return
data
.
code
;
...
...
card.h
View file @
dde64688
...
...
@@ -429,6 +429,4 @@ public:
#define SUMMON_INFO_REASON_EFFECT 0x200
#define SUMMON_INFO_REASON_PLAYER 0x400
#define CARD_ARTWORK_VERSIONS_OFFSET 10
#endif
/* CARD_H_ */
card_data.h
View file @
dde64688
...
...
@@ -4,6 +4,8 @@
#include "common.h"
#include <vector>
constexpr
int
CARD_ARTWORK_VERSIONS_OFFSET
=
10
;
struct
card_data
{
uint32
code
{};
uint32
alias
{};
...
...
@@ -43,6 +45,10 @@ struct card_data {
return
false
;
}
bool
is_alternative
()
const
{
return
alias
&&
(
alias
<
code
+
CARD_ARTWORK_VERSIONS_OFFSET
)
&&
(
code
<
alias
+
CARD_ARTWORK_VERSIONS_OFFSET
);
}
void
set_setcode
(
uint64
value
)
{
setcode
.
clear
();
while
(
value
)
{
...
...
interpreter.cpp
View file @
dde64688
...
...
@@ -56,7 +56,7 @@ int32 interpreter::register_card(card *pcard) {
//some userdata may be created in script like token so use current_state
lua_rawgeti
(
current_state
,
LUA_REGISTRYINDEX
,
pcard
->
ref_handle
);
//load script
if
(
pcard
->
data
.
alias
&&
(
pcard
->
data
.
alias
<
pcard
->
data
.
code
+
CARD_ARTWORK_VERSIONS_OFFSET
)
&&
(
pcard
->
data
.
code
<
pcard
->
data
.
alias
+
CARD_ARTWORK_VERSIONS_OFFSET
))
if
(
pcard
->
data
.
is_alternative
(
))
load_card_script
(
pcard
->
data
.
alias
);
else
load_card_script
(
pcard
->
data
.
code
);
...
...
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