Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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-2pick
Commits
d5ba63aa
Commit
d5ba63aa
authored
Sep 04, 2017
by
Yuzurisa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
t
parent
6d74aa5b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
ocgcore/interpreter.cpp
ocgcore/interpreter.cpp
+2
-0
ocgcore/libcard.cpp
ocgcore/libcard.cpp
+24
-0
ocgcore/scriptlib.h
ocgcore/scriptlib.h
+2
-0
No files found.
ocgcore/interpreter.cpp
View file @
d5ba63aa
...
...
@@ -208,6 +208,8 @@ static const struct luaL_Reg cardlib[] = {
{
"IsLevelAbove"
,
scriptlib
::
card_is_level_above
},
{
"IsRankBelow"
,
scriptlib
::
card_is_rank_below
},
{
"IsRankAbove"
,
scriptlib
::
card_is_rank_above
},
{
"IsLinkBelow"
,
scriptlib
::
card_is_link_below
},
{
"IsLinkAbove"
,
scriptlib
::
card_is_link_above
},
{
"IsAttackBelow"
,
scriptlib
::
card_is_attack_below
},
{
"IsAttackAbove"
,
scriptlib
::
card_is_attack_above
},
{
"IsDefenseBelow"
,
scriptlib
::
card_is_defense_below
},
...
...
ocgcore/libcard.cpp
View file @
d5ba63aa
...
...
@@ -2016,6 +2016,30 @@ int32 scriptlib::card_is_rank_above(lua_State *L) {
lua_pushboolean
(
L
,
pcard
->
get_rank
()
>=
rnk
);
return
1
;
}
int32
scriptlib
::
card_is_link_below
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
lnk
=
lua_tointeger
(
L
,
2
);
if
(
!
(
pcard
->
data
.
type
&
TYPE_LINK
)
||
(
pcard
->
status
&
STATUS_NO_LEVEL
)
||
(
!
(
pcard
->
data
.
type
&
TYPE_MONSTER
)
&&
!
(
pcard
->
current
.
location
&
LOCATION_MZONE
)))
lua_pushboolean
(
L
,
0
);
else
lua_pushboolean
(
L
,
pcard
->
get_link
()
<=
lnk
);
return
1
;
}
int32
scriptlib
::
card_is_link_above
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
lnk
=
lua_tointeger
(
L
,
2
);
if
(
!
(
pcard
->
data
.
type
&
TYPE_LINK
)
||
(
pcard
->
status
&
STATUS_NO_LEVEL
)
||
(
!
(
pcard
->
data
.
type
&
TYPE_MONSTER
)
&&
!
(
pcard
->
current
.
location
&
LOCATION_MZONE
)))
lua_pushboolean
(
L
,
0
);
else
lua_pushboolean
(
L
,
pcard
->
get_link
()
>=
lnk
);
return
1
;
}
int32
scriptlib
::
card_is_attack_below
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
...
...
ocgcore/scriptlib.h
View file @
d5ba63aa
...
...
@@ -210,6 +210,8 @@ public:
static
int32
card_is_level_above
(
lua_State
*
L
);
static
int32
card_is_rank_below
(
lua_State
*
L
);
static
int32
card_is_rank_above
(
lua_State
*
L
);
static
int32
card_is_link_below
(
lua_State
*
L
);
static
int32
card_is_link_above
(
lua_State
*
L
);
static
int32
card_is_attack_below
(
lua_State
*
L
);
static
int32
card_is_attack_above
(
lua_State
*
L
);
static
int32
card_is_defense_below
(
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