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
93056400
Commit
93056400
authored
May 21, 2018
by
nekrozar
Committed by
nanahira
May 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Card.IsLevel/Rank/Link (#163)
* update * update
parent
e5a9ad93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
15 deletions
+39
-15
libcard.cpp
libcard.cpp
+39
-15
No files found.
libcard.cpp
View file @
93056400
...
@@ -893,33 +893,57 @@ int32 scriptlib::card_is_level(lua_State *L) {
...
@@ -893,33 +893,57 @@ int32 scriptlib::card_is_level(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
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
tlevel
=
lua_tointeger
(
L
,
2
);
uint32
level
=
pcard
->
get_level
();
if
(
pcard
->
get_level
()
==
tlevel
)
uint32
count
=
lua_gettop
(
L
)
-
1
;
lua_pushboolean
(
L
,
1
);
uint32
result
=
FALSE
;
else
for
(
uint32
i
=
0
;
i
<
count
;
++
i
)
{
lua_pushboolean
(
L
,
0
);
if
(
lua_isnil
(
L
,
i
+
2
))
continue
;
uint32
tlevel
=
lua_tointeger
(
L
,
i
+
2
);
if
(
level
==
tlevel
)
{
result
=
TRUE
;
break
;
}
}
lua_pushboolean
(
L
,
result
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_is_rank
(
lua_State
*
L
)
{
int32
scriptlib
::
card_is_rank
(
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
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
trank
=
lua_tointeger
(
L
,
2
);
uint32
rank
=
pcard
->
get_rank
();
if
(
pcard
->
get_rank
()
==
trank
)
uint32
count
=
lua_gettop
(
L
)
-
1
;
lua_pushboolean
(
L
,
1
);
uint32
result
=
FALSE
;
else
for
(
uint32
i
=
0
;
i
<
count
;
++
i
)
{
lua_pushboolean
(
L
,
0
);
if
(
lua_isnil
(
L
,
i
+
2
))
continue
;
uint32
trank
=
lua_tointeger
(
L
,
i
+
2
);
if
(
rank
==
trank
)
{
result
=
TRUE
;
break
;
}
}
lua_pushboolean
(
L
,
result
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_is_link
(
lua_State
*
L
)
{
int32
scriptlib
::
card_is_link
(
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
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
tlink
=
lua_tointeger
(
L
,
2
);
uint32
link
=
pcard
->
get_link
();
if
(
pcard
->
get_link
()
==
tlink
)
uint32
count
=
lua_gettop
(
L
)
-
1
;
lua_pushboolean
(
L
,
1
);
uint32
result
=
FALSE
;
else
for
(
uint32
i
=
0
;
i
<
count
;
++
i
)
{
lua_pushboolean
(
L
,
0
);
if
(
lua_isnil
(
L
,
i
+
2
))
continue
;
uint32
tlink
=
lua_tointeger
(
L
,
i
+
2
);
if
(
link
==
tlink
)
{
result
=
TRUE
;
break
;
}
}
lua_pushboolean
(
L
,
result
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_is_race
(
lua_State
*
L
)
{
int32
scriptlib
::
card_is_race
(
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