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
28f7de0f
Commit
28f7de0f
authored
Aug 12, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Duel.LoadScript
parent
43002460
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
interpreter.cpp
interpreter.cpp
+1
-0
libduel.cpp
libduel.cpp
+10
-0
scriptlib.h
scriptlib.h
+1
-0
No files found.
interpreter.cpp
View file @
28f7de0f
...
...
@@ -393,6 +393,7 @@ static const struct luaL_Reg duellib[] = {
{
"MoveTurnCount"
,
scriptlib
::
duel_move_turn_count
},
{
"GetCardsInZone"
,
scriptlib
::
duel_get_cards_in_zone
},
{
"XyzSummonByRose"
,
scriptlib
::
duel_xyz_summon_by_rose
},
{
"LoadScript"
,
scriptlib
::
duel_load_script
},
{
"EnableGlobalFlag"
,
scriptlib
::
duel_enable_global_flag
},
{
"GetLP"
,
scriptlib
::
duel_get_lp
},
...
...
libduel.cpp
View file @
28f7de0f
...
...
@@ -197,6 +197,16 @@ int32 scriptlib::duel_xyz_summon_by_rose(lua_State *L) {
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_XYZ
);
return
lua_yield
(
L
,
0
);
}
int32
scriptlib
::
duel_load_script
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_STRING
,
1
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
const
char
*
pstr
=
lua_tostring
(
L
,
1
);
char
filename
[
64
];
sprintf
(
filename
,
"./script/%s"
,
pstr
);
lua_pushboolean
(
L
,
pduel
->
lua
->
load_script
((
char
*
)
filename
));
return
1
;
}
int32
scriptlib
::
duel_enable_global_flag
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
...
...
scriptlib.h
View file @
28f7de0f
...
...
@@ -37,6 +37,7 @@ public:
static
int32
duel_move_turn_count
(
lua_State
*
L
);
static
int32
duel_get_cards_in_zone
(
lua_State
*
L
);
static
int32
duel_xyz_summon_by_rose
(
lua_State
*
L
);
static
int32
duel_load_script
(
lua_State
*
L
);
//card lib
static
int32
card_get_code
(
lua_State
*
L
);
static
int32
card_get_origin_code
(
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