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
08d55ffd
Commit
08d55ffd
authored
Jan 14, 2021
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Card.IsPreviousControler, IsSummonLocation, IsSummonPlayer
parent
225a846f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
libcard.cpp
libcard.cpp
+36
-0
scriptlib.h
scriptlib.h
+3
-0
No files found.
libcard.cpp
View file @
08d55ffd
...
...
@@ -1161,6 +1161,28 @@ int32 scriptlib::card_is_summon_type(lua_State *L) {
lua_pushboolean(L, 0);
return 1;
}
int32 scriptlib::card_is_summon_location(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**)lua_touserdata(L, 1);
uint32 tloc = (uint32)lua_tointeger(L, 2);
if(((pcard->summon_info >> 16) & 0xff) & tloc)
lua_pushboolean(L, 1);
else
lua_pushboolean(L, 0);
return 1;
}
int32 scriptlib::card_is_summon_player(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**)lua_touserdata(L, 1);
uint32 con = (uint32)lua_tointeger(L, 2);
if(pcard->summon_player == con)
lua_pushboolean(L, 1);
else
lua_pushboolean(L, 0);
return 1;
}
int32 scriptlib::card_is_status(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
...
...
@@ -2425,6 +2447,17 @@ int32 scriptlib::card_is_controler(lua_State *L) {
lua_pushboolean(L, 0);
return 1;
}
int32 scriptlib::card_is_pre_controler(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 con = (uint32)lua_tointeger(L, 2);
if(pcard->previous.controler == con)
lua_pushboolean(L, 1);
else
lua_pushboolean(L, 0);
return 1;
}
int32 scriptlib::card_is_onfield(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
...
...
@@ -3245,6 +3278,8 @@ static const struct luaL_Reg cardlib[] = {
{ "IsLinkAttribute", scriptlib::card_is_link_attribute },
{ "IsReason", scriptlib::card_is_reason },
{ "IsSummonType", scriptlib::card_is_summon_type },
{ "IsSummonLocation", scriptlib::card_is_summon_location },
{ "IsSummonPlayer", scriptlib::card_is_summon_player },
{ "IsStatus", scriptlib::card_is_status },
{ "IsNotTuner", scriptlib::card_is_not_tuner },
{ "SetStatus", scriptlib::card_set_status },
...
...
@@ -3343,6 +3378,7 @@ static const struct luaL_Reg cardlib[] = {
{ "IsPosition", scriptlib::card_is_position },
{ "IsPreviousPosition", scriptlib::card_is_pre_position },
{ "IsControler", scriptlib::card_is_controler },
{ "IsPreviousControler", scriptlib::card_is_pre_controler },
{ "IsOnField", scriptlib::card_is_onfield },
{ "IsLocation", scriptlib::card_is_location },
{ "IsPreviousLocation", scriptlib::card_is_pre_location },
...
...
scriptlib.h
View file @
08d55ffd
...
...
@@ -123,6 +123,8 @@ public:
static
int32
card_is_link_attribute
(
lua_State
*
L
);
static
int32
card_is_reason
(
lua_State
*
L
);
static
int32
card_is_summon_type
(
lua_State
*
L
);
static
int32
card_is_summon_location
(
lua_State
*
L
);
static
int32
card_is_summon_player
(
lua_State
*
L
);
static
int32
card_is_status
(
lua_State
*
L
);
static
int32
card_is_not_tuner
(
lua_State
*
L
);
static
int32
card_set_status
(
lua_State
*
L
);
...
...
@@ -221,6 +223,7 @@ public:
static
int32
card_is_position
(
lua_State
*
L
);
static
int32
card_is_pre_position
(
lua_State
*
L
);
static
int32
card_is_controler
(
lua_State
*
L
);
static
int32
card_is_pre_controler
(
lua_State
*
L
);
static
int32
card_is_onfield
(
lua_State
*
L
);
static
int32
card_is_location
(
lua_State
*
L
);
static
int32
card_is_pre_location
(
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