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
c3ecac89
Commit
c3ecac89
authored
Apr 14, 2017
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add GetLocationCountFromEx
parent
caa4a123
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
interpreter.cpp
interpreter.cpp
+1
-0
libduel.cpp
libduel.cpp
+19
-0
scriptlib.h
scriptlib.h
+1
-0
No files found.
interpreter.cpp
View file @
c3ecac89
...
@@ -407,6 +407,7 @@ static const struct luaL_Reg duellib[] = {
...
@@ -407,6 +407,7 @@ static const struct luaL_Reg duellib[] = {
{
"IncreaseSummonedCount"
,
scriptlib
::
duel_increase_summon_count
},
{
"IncreaseSummonedCount"
,
scriptlib
::
duel_increase_summon_count
},
{
"CheckSummonedCount"
,
scriptlib
::
duel_check_summon_count
},
{
"CheckSummonedCount"
,
scriptlib
::
duel_check_summon_count
},
{
"GetLocationCount"
,
scriptlib
::
duel_get_location_count
},
{
"GetLocationCount"
,
scriptlib
::
duel_get_location_count
},
{
"GetLocationCountFromEx"
,
scriptlib
::
duel_get_location_count_fromex
},
{
"GetFieldCard"
,
scriptlib
::
duel_get_field_card
},
{
"GetFieldCard"
,
scriptlib
::
duel_get_field_card
},
{
"CheckLocation"
,
scriptlib
::
duel_check_location
},
{
"CheckLocation"
,
scriptlib
::
duel_check_location
},
{
"GetCurrentChain"
,
scriptlib
::
duel_get_current_chain
},
{
"GetCurrentChain"
,
scriptlib
::
duel_get_current_chain
},
...
...
libduel.cpp
View file @
c3ecac89
...
@@ -1514,6 +1514,25 @@ int32 scriptlib::duel_get_location_count(lua_State *L) {
...
@@ -1514,6 +1514,25 @@ int32 scriptlib::duel_get_location_count(lua_State *L) {
return
1
;
return
1
;
}
}
}
}
int32
scriptlib
::
duel_get_location_count_fromex
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
uint32
playerid
=
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
uint32
uplayer
=
pduel
->
game_field
->
core
.
reason_player
;
if
(
lua_gettop
(
L
)
>=
2
)
uplayer
=
lua_tointeger
(
L
,
2
);
uint32
zone
=
0xff
;
if
(
pduel
->
game_field
->
core
.
duel_rule
>=
4
)
{
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count_fromex
(
0
,
playerid
,
uplayer
,
zone
));
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_spsummonable_count_fromex
(
0
,
playerid
,
uplayer
,
zone
));
}
else
{
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count
(
playerid
,
LOCATION_MZONE
,
uplayer
,
LOCATION_REASON_TOFIELD
,
zone
));
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_tofield_count
(
playerid
,
LOCATION_MZONE
,
uplayer
,
zone
));
}
return
2
;
}
int32
scriptlib
::
duel_get_field_card
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_get_field_card
(
lua_State
*
L
)
{
check_param_count
(
L
,
3
);
check_param_count
(
L
,
3
);
uint32
playerid
=
lua_tointeger
(
L
,
1
);
uint32
playerid
=
lua_tointeger
(
L
,
1
);
...
...
scriptlib.h
View file @
c3ecac89
...
@@ -404,6 +404,7 @@ public:
...
@@ -404,6 +404,7 @@ public:
static
int32
duel_increase_summon_count
(
lua_State
*
L
);
static
int32
duel_increase_summon_count
(
lua_State
*
L
);
static
int32
duel_check_summon_count
(
lua_State
*
L
);
static
int32
duel_check_summon_count
(
lua_State
*
L
);
static
int32
duel_get_location_count
(
lua_State
*
L
);
static
int32
duel_get_location_count
(
lua_State
*
L
);
static
int32
duel_get_location_count_fromex
(
lua_State
*
L
);
static
int32
duel_get_field_card
(
lua_State
*
L
);
static
int32
duel_get_field_card
(
lua_State
*
L
);
static
int32
duel_check_location
(
lua_State
*
L
);
static
int32
duel_check_location
(
lua_State
*
L
);
static
int32
duel_get_current_chain
(
lua_State
*
L
);
static
int32
duel_get_current_chain
(
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