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
7be39515
Commit
7be39515
authored
Apr 14, 2017
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
divide
parent
a3bab1dd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
25 deletions
+31
-25
interpreter.cpp
interpreter.cpp
+1
-0
libduel.cpp
libduel.cpp
+29
-25
scriptlib.h
scriptlib.h
+1
-0
No files found.
interpreter.cpp
View file @
7be39515
...
...
@@ -408,6 +408,7 @@ static const struct luaL_Reg duellib[] = {
{
"CheckSummonedCount"
,
scriptlib
::
duel_check_summon_count
},
{
"GetLocationCount"
,
scriptlib
::
duel_get_location_count
},
{
"GetLocationCountFromEx"
,
scriptlib
::
duel_get_location_count_fromex
},
{
"GetUsableMZoneCount"
,
scriptlib
::
duel_get_usable_mzone_count
},
{
"GetLinkedZone"
,
scriptlib
::
duel_get_linked_zone
},
{
"GetFieldCard"
,
scriptlib
::
duel_get_field_card
},
{
"CheckLocation"
,
scriptlib
::
duel_check_location
},
...
...
libduel.cpp
View file @
7be39515
...
...
@@ -1494,25 +1494,8 @@ int32 scriptlib::duel_get_location_count(lua_State *L) {
if
(
lua_gettop
(
L
)
>
3
)
reason
=
lua_tointeger
(
L
,
4
);
uint32
zone
=
0xff
;
if
(
location
==
LOCATION_MZONE
)
{
uint32
flag1
,
flag2
;
int32
ct1
=
pduel
->
game_field
->
get_useable_count
(
playerid
,
location
,
uplayer
,
reason
,
zone
,
&
flag1
);
if
(
pduel
->
game_field
->
core
.
duel_rule
>=
4
)
{
int32
ct2
=
pduel
->
game_field
->
get_useable_count_fromex
(
0
,
playerid
,
uplayer
,
zone
,
&
flag2
);
int32
ct3
=
field
::
field_used_count
[
~
(
flag1
|
flag2
)
&
0x1f
];
lua_pushinteger
(
L
,
ct1
);
lua_pushinteger
(
L
,
ct2
);
lua_pushinteger
(
L
,
ct1
+
ct2
-
ct3
);
}
else
{
lua_pushinteger
(
L
,
ct1
);
lua_pushinteger
(
L
,
ct1
);
lua_pushinteger
(
L
,
ct1
);
}
return
3
;
}
else
{
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count
(
playerid
,
location
,
uplayer
,
reason
));
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count
(
playerid
,
location
,
uplayer
,
reason
,
zone
));
return
1
;
}
}
int32
scriptlib
::
duel_get_location_count_fromex
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
...
...
@@ -1524,14 +1507,35 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
if
(
lua_gettop
(
L
)
>=
2
)
uplayer
=
lua_tointeger
(
L
,
2
);
uint32
zone
=
0xff
;
if
(
pduel
->
game_field
->
core
.
duel_rule
>=
4
)
{
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
{
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
;
return
1
;
}
int32
scriptlib
::
duel_get_usable_mzone_count
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
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
)
{
uint32
flag1
,
flag2
;
int32
ct1
=
pduel
->
game_field
->
get_tofield_count
(
playerid
,
LOCATION_MZONE
,
uplayer
,
zone
,
&
flag1
);
int32
ct2
=
pduel
->
game_field
->
get_spsummonable_count_fromex
(
0
,
playerid
,
uplayer
,
zone
,
&
flag2
);
int32
ct3
=
field
::
field_used_count
[
~
(
flag1
|
flag2
)
&
0x1f
];
int32
count
=
ct1
+
ct2
-
ct3
;
int32
limit
=
pduel
->
game_field
->
get_mzone_limit
(
playerid
,
uplayer
,
LOCATION_REASON_TOFIELD
);
if
(
count
>
limit
)
count
=
limit
;
lua_pushinteger
(
L
,
count
);
}
else
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count
(
playerid
,
LOCATION_MZONE
,
uplayer
,
LOCATION_REASON_TOFIELD
,
zone
));
return
1
;
}
int32
scriptlib
::
duel_get_linked_zone
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
...
...
scriptlib.h
View file @
7be39515
...
...
@@ -405,6 +405,7 @@ public:
static
int32
duel_check_summon_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_usable_mzone_count
(
lua_State
*
L
);
static
int32
duel_get_linked_zone
(
lua_State
*
L
);
static
int32
duel_get_field_card
(
lua_State
*
L
);
static
int32
duel_check_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