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
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
MyCard
ygopro-core
Commits
0dcb83ef
Commit
0dcb83ef
authored
Jun 28, 2017
by
nekrozar
Committed by
mercury233
Jun 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Card.GetXyzType&Card.IsXyzType (#99)
parent
a68af2c2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
1 deletion
+29
-1
card.cpp
card.cpp
+6
-1
card.h
card.h
+1
-0
interpreter.cpp
interpreter.cpp
+2
-0
libcard.cpp
libcard.cpp
+18
-0
scriptlib.h
scriptlib.h
+2
-0
No files found.
card.cpp
View file @
0dcb83ef
...
@@ -440,6 +440,11 @@ uint32 card::get_synchro_type() {
...
@@ -440,6 +440,11 @@ uint32 card::get_synchro_type() {
return
data
.
type
;
return
data
.
type
;
return
get_type
();
return
get_type
();
}
}
uint32
card
::
get_xyz_type
()
{
if
(
current
.
location
==
LOCATION_SZONE
&&
(
data
.
type
&
TYPE_MONSTER
))
return
data
.
type
;
return
get_type
();
}
uint32
card
::
get_link_type
()
{
uint32
card
::
get_link_type
()
{
if
(
current
.
location
==
LOCATION_SZONE
&&
(
data
.
type
&
TYPE_MONSTER
))
if
(
current
.
location
==
LOCATION_SZONE
&&
(
data
.
type
&
TYPE_MONSTER
))
return
data
.
type
;
return
data
.
type
;
...
@@ -3415,7 +3420,7 @@ int32 card::is_can_be_ritual_material(card* scard) {
...
@@ -3415,7 +3420,7 @@ int32 card::is_can_be_ritual_material(card* scard) {
int32
card
::
is_can_be_xyz_material
(
card
*
scard
)
{
int32
card
::
is_can_be_xyz_material
(
card
*
scard
)
{
if
(
data
.
type
&
TYPE_TOKEN
)
if
(
data
.
type
&
TYPE_TOKEN
)
return
FALSE
;
return
FALSE
;
if
(
!
(
get_type
()
&
TYPE_MONSTER
))
if
(
!
(
get_
xyz_
type
()
&
TYPE_MONSTER
))
return
FALSE
;
return
FALSE
;
if
(
is_status
(
STATUS_FORBIDDEN
))
if
(
is_status
(
STATUS_FORBIDDEN
))
return
FALSE
;
return
FALSE
;
...
...
card.h
View file @
0dcb83ef
...
@@ -179,6 +179,7 @@ public:
...
@@ -179,6 +179,7 @@ public:
uint32
get_type
();
uint32
get_type
();
uint32
get_fusion_type
();
uint32
get_fusion_type
();
uint32
get_synchro_type
();
uint32
get_synchro_type
();
uint32
get_xyz_type
();
uint32
get_link_type
();
uint32
get_link_type
();
int32
get_base_attack
();
int32
get_base_attack
();
int32
get_attack
();
int32
get_attack
();
...
...
interpreter.cpp
View file @
0dcb83ef
...
@@ -29,6 +29,7 @@ static const struct luaL_Reg cardlib[] = {
...
@@ -29,6 +29,7 @@ static const struct luaL_Reg cardlib[] = {
{
"GetOriginalType"
,
scriptlib
::
card_get_origin_type
},
{
"GetOriginalType"
,
scriptlib
::
card_get_origin_type
},
{
"GetFusionType"
,
scriptlib
::
card_get_fusion_type
},
{
"GetFusionType"
,
scriptlib
::
card_get_fusion_type
},
{
"GetSynchroType"
,
scriptlib
::
card_get_synchro_type
},
{
"GetSynchroType"
,
scriptlib
::
card_get_synchro_type
},
{
"GetXyzType"
,
scriptlib
::
card_get_xyz_type
},
{
"GetLinkType"
,
scriptlib
::
card_get_link_type
},
{
"GetLinkType"
,
scriptlib
::
card_get_link_type
},
{
"GetLevel"
,
scriptlib
::
card_get_level
},
{
"GetLevel"
,
scriptlib
::
card_get_level
},
{
"GetRank"
,
scriptlib
::
card_get_rank
},
{
"GetRank"
,
scriptlib
::
card_get_rank
},
...
@@ -92,6 +93,7 @@ static const struct luaL_Reg cardlib[] = {
...
@@ -92,6 +93,7 @@ static const struct luaL_Reg cardlib[] = {
{
"IsType"
,
scriptlib
::
card_is_type
},
{
"IsType"
,
scriptlib
::
card_is_type
},
{
"IsFusionType"
,
scriptlib
::
card_is_fusion_type
},
{
"IsFusionType"
,
scriptlib
::
card_is_fusion_type
},
{
"IsSynchroType"
,
scriptlib
::
card_is_synchro_type
},
{
"IsSynchroType"
,
scriptlib
::
card_is_synchro_type
},
{
"IsXyzType"
,
scriptlib
::
card_is_xyz_type
},
{
"IsLinkType"
,
scriptlib
::
card_is_link_type
},
{
"IsLinkType"
,
scriptlib
::
card_is_link_type
},
{
"IsRace"
,
scriptlib
::
card_is_race
},
{
"IsRace"
,
scriptlib
::
card_is_race
},
{
"IsAttribute"
,
scriptlib
::
card_is_attribute
},
{
"IsAttribute"
,
scriptlib
::
card_is_attribute
},
...
...
libcard.cpp
View file @
0dcb83ef
...
@@ -168,6 +168,13 @@ int32 scriptlib::card_get_synchro_type(lua_State *L) {
...
@@ -168,6 +168,13 @@ int32 scriptlib::card_get_synchro_type(lua_State *L) {
lua_pushinteger
(
L
,
pcard
->
get_synchro_type
());
lua_pushinteger
(
L
,
pcard
->
get_synchro_type
());
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_get_xyz_type
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
lua_pushinteger
(
L
,
pcard
->
get_xyz_type
());
return
1
;
}
int32
scriptlib
::
card_get_link_type
(
lua_State
*
L
)
{
int32
scriptlib
::
card_get_link_type
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
...
@@ -675,6 +682,17 @@ int32 scriptlib::card_is_synchro_type(lua_State *L) {
...
@@ -675,6 +682,17 @@ int32 scriptlib::card_is_synchro_type(lua_State *L) {
lua_pushboolean
(
L
,
0
);
lua_pushboolean
(
L
,
0
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_is_xyz_type
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
ttype
=
lua_tointeger
(
L
,
2
);
if
(
pcard
->
get_xyz_type
()
&
ttype
)
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
0
);
return
1
;
}
int32
scriptlib
::
card_is_link_type
(
lua_State
*
L
)
{
int32
scriptlib
::
card_is_link_type
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
...
...
scriptlib.h
View file @
0dcb83ef
...
@@ -31,6 +31,7 @@ public:
...
@@ -31,6 +31,7 @@ public:
static
int32
card_get_origin_type
(
lua_State
*
L
);
static
int32
card_get_origin_type
(
lua_State
*
L
);
static
int32
card_get_fusion_type
(
lua_State
*
L
);
static
int32
card_get_fusion_type
(
lua_State
*
L
);
static
int32
card_get_synchro_type
(
lua_State
*
L
);
static
int32
card_get_synchro_type
(
lua_State
*
L
);
static
int32
card_get_xyz_type
(
lua_State
*
L
);
static
int32
card_get_link_type
(
lua_State
*
L
);
static
int32
card_get_link_type
(
lua_State
*
L
);
static
int32
card_get_level
(
lua_State
*
L
);
static
int32
card_get_level
(
lua_State
*
L
);
static
int32
card_get_rank
(
lua_State
*
L
);
static
int32
card_get_rank
(
lua_State
*
L
);
...
@@ -94,6 +95,7 @@ public:
...
@@ -94,6 +95,7 @@ public:
static
int32
card_is_type
(
lua_State
*
L
);
static
int32
card_is_type
(
lua_State
*
L
);
static
int32
card_is_fusion_type
(
lua_State
*
L
);
static
int32
card_is_fusion_type
(
lua_State
*
L
);
static
int32
card_is_synchro_type
(
lua_State
*
L
);
static
int32
card_is_synchro_type
(
lua_State
*
L
);
static
int32
card_is_xyz_type
(
lua_State
*
L
);
static
int32
card_is_link_type
(
lua_State
*
L
);
static
int32
card_is_link_type
(
lua_State
*
L
);
static
int32
card_is_race
(
lua_State
*
L
);
static
int32
card_is_race
(
lua_State
*
L
);
static
int32
card_is_attribute
(
lua_State
*
L
);
static
int32
card_is_attribute
(
lua_State
*
L
);
...
...
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