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
a6f01789
Commit
a6f01789
authored
Jul 27, 2024
by
mercury233
Committed by
GitHub
Jul 27, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Card.IsCanBePlacedOnField (#536)
parent
3008a77c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
libcard.cpp
libcard.cpp
+22
-0
scriptlib.h
scriptlib.h
+1
-0
No files found.
libcard.cpp
View file @
a6f01789
...
...
@@ -2330,6 +2330,27 @@ int32 scriptlib::card_is_can_be_special_summoned(lua_State *L) {
lua_pushboolean(L, 0);
return 1;
}
int32 scriptlib::card_is_can_be_placed_on_field(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 toplayer = pcard->pduel->game_field->core.reason_player;
if(lua_gettop(L) >= 2)
toplayer = (uint32)lua_tointeger(L, 2);
if(toplayer != 0 && toplayer != 1) {
lua_pushboolean(L, 0);
return 1;
}
uint32 tolocation = LOCATION_SZONE;
if(lua_gettop(L) >= 3)
tolocation = (uint32)lua_tointeger(L, 3);
if(pcard->is_status(STATUS_FORBIDDEN)
|| pcard->pduel->game_field->check_unique_onfield(pcard, toplayer, tolocation, NULL))
lua_pushboolean(L, 0);
else
lua_pushboolean(L, 1);
return 1;
}
int32 scriptlib::card_is_able_to_hand(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
...
...
@@ -3569,6 +3590,7 @@ static const struct luaL_Reg cardlib[] = {
{ "IsMSetable", scriptlib::card_is_msetable },
{ "IsSSetable", scriptlib::card_is_ssetable },
{ "IsCanBeSpecialSummoned", scriptlib::card_is_can_be_special_summoned },
{ "IsCanBePlacedOnField", scriptlib::card_is_can_be_placed_on_field },
{ "IsAbleToHand", scriptlib::card_is_able_to_hand },
{ "IsAbleToDeck", scriptlib::card_is_able_to_deck },
{ "IsAbleToExtra", scriptlib::card_is_able_to_extra },
...
...
scriptlib.h
View file @
a6f01789
...
...
@@ -217,6 +217,7 @@ public:
static
int32
card_is_link_summonable
(
lua_State
*
L
);
static
int32
card_is_can_be_summoned
(
lua_State
*
L
);
static
int32
card_is_can_be_special_summoned
(
lua_State
*
L
);
static
int32
card_is_can_be_placed_on_field
(
lua_State
*
L
);
static
int32
card_is_able_to_hand
(
lua_State
*
L
);
static
int32
card_is_able_to_grave
(
lua_State
*
L
);
static
int32
card_is_able_to_deck
(
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