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
acde1b7c
Commit
acde1b7c
authored
Dec 02, 2019
by
nekrozar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Duel.IsPlayerCanMSet, Duel.IsPlayerCanSSet
parent
3ea372fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
interpreter.cpp
interpreter.cpp
+2
-0
libduel.cpp
libduel.cpp
+37
-0
scriptlib.h
scriptlib.h
+2
-0
No files found.
interpreter.cpp
View file @
acde1b7c
...
...
@@ -553,6 +553,8 @@ static const struct luaL_Reg duellib[] = {
{
"IsPlayerCanDiscardDeck"
,
scriptlib
::
duel_is_player_can_discard_deck
},
{
"IsPlayerCanDiscardDeckAsCost"
,
scriptlib
::
duel_is_player_can_discard_deck_as_cost
},
{
"IsPlayerCanSummon"
,
scriptlib
::
duel_is_player_can_summon
},
{
"IsPlayerCanMSet"
,
scriptlib
::
duel_is_player_can_mset
},
{
"IsPlayerCanSSet"
,
scriptlib
::
duel_is_player_can_sset
},
{
"IsPlayerCanSpecialSummon"
,
scriptlib
::
duel_is_player_can_spsummon
},
{
"IsPlayerCanFlipSummon"
,
scriptlib
::
duel_is_player_can_flipsummon
},
{
"IsPlayerCanSpecialSummonMonster"
,
scriptlib
::
duel_is_player_can_spsummon_monster
},
...
...
libduel.cpp
View file @
acde1b7c
...
...
@@ -3825,6 +3825,43 @@ int32 scriptlib::duel_is_player_can_summon(lua_State * L) {
}
return
1
;
}
int32
scriptlib
::
duel_is_player_can_mset
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32
playerid
=
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
{
lua_pushboolean
(
L
,
0
);
return
1
;
}
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
if
(
lua_gettop
(
L
)
==
1
)
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_player_can_action
(
playerid
,
EFFECT_CANNOT_MSET
));
else
{
check_param_count
(
L
,
3
);
check_param
(
L
,
PARAM_TYPE_CARD
,
3
);
int32
sumtype
=
lua_tointeger
(
L
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
3
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_player_can_mset
(
sumtype
,
playerid
,
pcard
,
playerid
));
}
return
1
;
}
int32
scriptlib
::
duel_is_player_can_sset
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32
playerid
=
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
{
lua_pushboolean
(
L
,
0
);
return
1
;
}
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
if
(
lua_gettop
(
L
)
==
1
)
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_player_can_action
(
playerid
,
EFFECT_CANNOT_SSET
));
else
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_player_can_sset
(
playerid
,
pcard
));
}
return
1
;
}
int32
scriptlib
::
duel_is_player_can_spsummon
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32
playerid
=
lua_tointeger
(
L
,
1
);
...
...
scriptlib.h
View file @
acde1b7c
...
...
@@ -549,6 +549,8 @@ public:
static
int32
duel_is_player_can_discard_deck
(
lua_State
*
L
);
static
int32
duel_is_player_can_discard_deck_as_cost
(
lua_State
*
L
);
static
int32
duel_is_player_can_summon
(
lua_State
*
L
);
static
int32
duel_is_player_can_mset
(
lua_State
*
L
);
static
int32
duel_is_player_can_sset
(
lua_State
*
L
);
static
int32
duel_is_player_can_spsummon
(
lua_State
*
L
);
static
int32
duel_is_player_can_flipsummon
(
lua_State
*
L
);
static
int32
duel_is_player_can_spsummon_monster
(
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