Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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-2pick
Commits
411112ba
Commit
411112ba
authored
Nov 30, 2017
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua53
parent
f6fe0d0e
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
558 additions
and
557 deletions
+558
-557
ocgcore/common.h
ocgcore/common.h
+2
-1
ocgcore/interpreter.cpp
ocgcore/interpreter.cpp
+4
-4
ocgcore/libcard.cpp
ocgcore/libcard.cpp
+130
-130
ocgcore/libdebug.cpp
ocgcore/libdebug.cpp
+16
-16
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+382
-382
ocgcore/libeffect.cpp
ocgcore/libeffect.cpp
+5
-5
ocgcore/libgroup.cpp
ocgcore/libgroup.cpp
+19
-19
No files found.
ocgcore/common.h
View file @
411112ba
...
@@ -42,4 +42,5 @@ struct card_sort {
...
@@ -42,4 +42,5 @@ struct card_sort {
bool
operator
()(
void
*
const
&
c1
,
void
*
const
&
c2
)
const
;
bool
operator
()(
void
*
const
&
c1
,
void
*
const
&
c2
)
const
;
};
};
#endif
/* COMMON_H_ */
#endif
/* COMMON_H_ */
#define lua_tonumberint(L,i) (lua_Integer)(((lua_tonumberx(L, (i), NULL) > 0) ? 0.5 : -0.5) + lua_tonumberx(L, (i), NULL))
ocgcore/interpreter.cpp
View file @
411112ba
...
@@ -1010,7 +1010,7 @@ int32 interpreter::get_operation_value(card* pcard, int32 findex, int32 extraarg
...
@@ -1010,7 +1010,7 @@ int32 interpreter::get_operation_value(card* pcard, int32 findex, int32 extraarg
}
}
return
OPERATION_FAIL
;
return
OPERATION_FAIL
;
}
}
result
=
lua_to
integer
(
current_state
,
-
1
);
result
=
lua_to
numberint
(
current_state
,
-
1
);
lua_pop
(
current_state
,
1
);
lua_pop
(
current_state
,
1
);
no_action
--
;
no_action
--
;
call_depth
--
;
call_depth
--
;
...
@@ -1032,7 +1032,7 @@ int32 interpreter::get_function_value(int32 f, uint32 param_count) {
...
@@ -1032,7 +1032,7 @@ int32 interpreter::get_function_value(int32 f, uint32 param_count) {
if
(
lua_isboolean
(
current_state
,
-
1
))
if
(
lua_isboolean
(
current_state
,
-
1
))
result
=
lua_toboolean
(
current_state
,
-
1
);
result
=
lua_toboolean
(
current_state
,
-
1
);
else
else
result
=
lua_to
integer
(
current_state
,
-
1
);
result
=
lua_to
numberint
(
current_state
,
-
1
);
lua_pop
(
current_state
,
1
);
lua_pop
(
current_state
,
1
);
no_action
--
;
no_action
--
;
call_depth
--
;
call_depth
--
;
...
@@ -1066,7 +1066,7 @@ int32 interpreter::get_function_value(int32 f, uint32 param_count, std::vector<i
...
@@ -1066,7 +1066,7 @@ int32 interpreter::get_function_value(int32 f, uint32 param_count, std::vector<i
if
(
lua_isboolean
(
current_state
,
index
))
if
(
lua_isboolean
(
current_state
,
index
))
return_value
=
lua_toboolean
(
current_state
,
index
);
return_value
=
lua_toboolean
(
current_state
,
index
);
else
else
return_value
=
lua_to
integer
(
current_state
,
index
);
return_value
=
lua_to
numberint
(
current_state
,
index
);
result
->
push_back
(
return_value
);
result
->
push_back
(
return_value
);
}
}
lua_settop
(
current_state
,
stack_top
);
lua_settop
(
current_state
,
stack_top
);
...
@@ -1127,7 +1127,7 @@ int32 interpreter::call_coroutine(int32 f, uint32 param_count, uint32 * yield_va
...
@@ -1127,7 +1127,7 @@ int32 interpreter::call_coroutine(int32 f, uint32 param_count, uint32 * yield_va
if
(
result
==
0
)
{
if
(
result
==
0
)
{
coroutines
.
erase
(
f
);
coroutines
.
erase
(
f
);
if
(
yield_value
)
if
(
yield_value
)
*
yield_value
=
lua_isboolean
(
rthread
,
-
1
)
?
lua_toboolean
(
rthread
,
-
1
)
:
lua_to
integer
(
rthread
,
-
1
);
*
yield_value
=
lua_isboolean
(
rthread
,
-
1
)
?
lua_toboolean
(
rthread
,
-
1
)
:
lua_to
numberint
(
rthread
,
-
1
);
current_state
=
lua_state
;
current_state
=
lua_state
;
call_depth
--
;
call_depth
--
;
if
(
call_depth
==
0
)
{
if
(
call_depth
==
0
)
{
...
...
ocgcore/libcard.cpp
View file @
411112ba
This diff is collapsed.
Click to expand it.
ocgcore/libdebug.cpp
View file @
411112ba
...
@@ -25,12 +25,12 @@ int32 scriptlib::debug_message(lua_State *L) {
...
@@ -25,12 +25,12 @@ int32 scriptlib::debug_message(lua_State *L) {
int32
scriptlib
::
debug_add_card
(
lua_State
*
L
)
{
int32
scriptlib
::
debug_add_card
(
lua_State
*
L
)
{
check_param_count
(
L
,
6
);
check_param_count
(
L
,
6
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
int32
code
=
lua_to
integer
(
L
,
1
);
int32
code
=
lua_to
numberint
(
L
,
1
);
int32
owner
=
lua_to
integer
(
L
,
2
);
int32
owner
=
lua_to
numberint
(
L
,
2
);
int32
playerid
=
lua_to
integer
(
L
,
3
);
int32
playerid
=
lua_to
numberint
(
L
,
3
);
int32
location
=
lua_to
integer
(
L
,
4
);
int32
location
=
lua_to
numberint
(
L
,
4
);
int32
sequence
=
lua_to
integer
(
L
,
5
);
int32
sequence
=
lua_to
numberint
(
L
,
5
);
int32
position
=
lua_to
integer
(
L
,
6
);
int32
position
=
lua_to
numberint
(
L
,
6
);
int32
proc
=
lua_toboolean
(
L
,
7
);
int32
proc
=
lua_toboolean
(
L
,
7
);
if
(
owner
!=
0
&&
owner
!=
1
)
if
(
owner
!=
0
&&
owner
!=
1
)
return
0
;
return
0
;
...
@@ -77,10 +77,10 @@ int32 scriptlib::debug_add_card(lua_State *L) {
...
@@ -77,10 +77,10 @@ int32 scriptlib::debug_add_card(lua_State *L) {
int32
scriptlib
::
debug_set_player_info
(
lua_State
*
L
)
{
int32
scriptlib
::
debug_set_player_info
(
lua_State
*
L
)
{
check_param_count
(
L
,
4
);
check_param_count
(
L
,
4
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
uint32
playerid
=
lua_to
integer
(
L
,
1
);
uint32
playerid
=
lua_to
numberint
(
L
,
1
);
uint32
lp
=
lua_to
integer
(
L
,
2
);
uint32
lp
=
lua_to
numberint
(
L
,
2
);
uint32
startcount
=
lua_to
integer
(
L
,
3
);
uint32
startcount
=
lua_to
numberint
(
L
,
3
);
uint32
drawcount
=
lua_to
integer
(
L
,
4
);
uint32
drawcount
=
lua_to
numberint
(
L
,
4
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
pduel
->
game_field
->
player
[
playerid
].
lp
=
lp
;
pduel
->
game_field
->
player
[
playerid
].
lp
=
lp
;
...
@@ -92,10 +92,10 @@ int32 scriptlib::debug_pre_summon(lua_State *L) {
...
@@ -92,10 +92,10 @@ int32 scriptlib::debug_pre_summon(lua_State *L) {
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
summon_type
=
lua_to
integer
(
L
,
2
);
uint32
summon_type
=
lua_to
numberint
(
L
,
2
);
uint8
summon_location
=
0
;
uint8
summon_location
=
0
;
if
(
lua_gettop
(
L
)
>
2
)
if
(
lua_gettop
(
L
)
>
2
)
summon_location
=
lua_to
integer
(
L
,
3
);
summon_location
=
lua_to
numberint
(
L
,
3
);
pcard
->
summon_info
=
summon_type
|
(
summon_location
<<
16
);
pcard
->
summon_info
=
summon_type
|
(
summon_location
<<
16
);
return
0
;
return
0
;
}
}
...
@@ -130,8 +130,8 @@ int32 scriptlib::debug_pre_add_counter(lua_State *L) {
...
@@ -130,8 +130,8 @@ int32 scriptlib::debug_pre_add_counter(lua_State *L) {
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
countertype
=
lua_to
integer
(
L
,
2
);
uint32
countertype
=
lua_to
numberint
(
L
,
2
);
uint32
count
=
lua_to
integer
(
L
,
3
);
uint32
count
=
lua_to
numberint
(
L
,
3
);
uint16
cttype
=
countertype
&
~
COUNTER_NEED_ENABLE
;
uint16
cttype
=
countertype
&
~
COUNTER_NEED_ENABLE
;
auto
pr
=
pcard
->
counters
.
insert
(
std
::
make_pair
(
cttype
,
card
::
counter_map
::
mapped_type
()));
auto
pr
=
pcard
->
counters
.
insert
(
std
::
make_pair
(
cttype
,
card
::
counter_map
::
mapped_type
()));
auto
cmit
=
pr
.
first
;
auto
cmit
=
pr
.
first
;
...
@@ -148,8 +148,8 @@ int32 scriptlib::debug_pre_add_counter(lua_State *L) {
...
@@ -148,8 +148,8 @@ int32 scriptlib::debug_pre_add_counter(lua_State *L) {
int32
scriptlib
::
debug_reload_field_begin
(
lua_State
*
L
)
{
int32
scriptlib
::
debug_reload_field_begin
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
uint32
flag
=
lua_to
integer
(
L
,
1
);
uint32
flag
=
lua_to
numberint
(
L
,
1
);
int32
rule
=
lua_to
integer
(
L
,
2
);
int32
rule
=
lua_to
numberint
(
L
,
2
);
pduel
->
clear
();
pduel
->
clear
();
pduel
->
game_field
->
core
.
duel_options
=
flag
;
pduel
->
game_field
->
core
.
duel_options
=
flag
;
if
(
rule
)
if
(
rule
)
...
...
ocgcore/libduel.cpp
View file @
411112ba
This diff is collapsed.
Click to expand it.
ocgcore/libeffect.cpp
View file @
411112ba
...
@@ -256,7 +256,7 @@ int32 scriptlib::effect_set_value(lua_State *L) {
...
@@ -256,7 +256,7 @@ int32 scriptlib::effect_set_value(lua_State *L) {
if
(
lua_isboolean
(
L
,
2
))
if
(
lua_isboolean
(
L
,
2
))
peffect
->
value
=
lua_toboolean
(
L
,
2
);
peffect
->
value
=
lua_toboolean
(
L
,
2
);
else
else
peffect
->
value
=
lua_to
integer
(
L
,
2
);
peffect
->
value
=
lua_to
numberint
(
L
,
2
);
}
}
return
0
;
return
0
;
}
}
...
@@ -450,7 +450,7 @@ int32 scriptlib::effect_is_active_type(lua_State *L) {
...
@@ -450,7 +450,7 @@ int32 scriptlib::effect_is_active_type(lua_State *L) {
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
uint32
tpe
=
lua_to
integer
(
L
,
2
);
uint32
tpe
=
lua_to
numberint
(
L
,
2
);
uint32
atype
;
uint32
atype
;
if
(
peffect
->
type
&
0x7f0
)
{
if
(
peffect
->
type
&
0x7f0
)
{
if
(
peffect
->
active_type
)
if
(
peffect
->
active_type
)
...
@@ -480,7 +480,7 @@ int32 scriptlib::effect_is_has_category(lua_State *L) {
...
@@ -480,7 +480,7 @@ int32 scriptlib::effect_is_has_category(lua_State *L) {
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
uint32
tcate
=
lua_to
integer
(
L
,
2
);
uint32
tcate
=
lua_to
numberint
(
L
,
2
);
if
(
peffect
&&
(
peffect
->
category
&
tcate
))
if
(
peffect
&&
(
peffect
->
category
&
tcate
))
lua_pushboolean
(
L
,
1
);
lua_pushboolean
(
L
,
1
);
else
else
...
@@ -491,7 +491,7 @@ int32 scriptlib::effect_is_has_type(lua_State *L) {
...
@@ -491,7 +491,7 @@ int32 scriptlib::effect_is_has_type(lua_State *L) {
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
uint32
ttype
=
lua_to
integer
(
L
,
2
);
uint32
ttype
=
lua_to
numberint
(
L
,
2
);
if
(
peffect
&&
(
peffect
->
type
&
ttype
))
if
(
peffect
&&
(
peffect
->
type
&
ttype
))
lua_pushboolean
(
L
,
1
);
lua_pushboolean
(
L
,
1
);
else
else
...
@@ -501,7 +501,7 @@ int32 scriptlib::effect_is_has_type(lua_State *L) {
...
@@ -501,7 +501,7 @@ int32 scriptlib::effect_is_has_type(lua_State *L) {
int32
scriptlib
::
effect_is_activatable
(
lua_State
*
L
)
{
int32
scriptlib
::
effect_is_activatable
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
uint32
playerid
=
lua_to
integer
(
L
,
2
);
uint32
playerid
=
lua_to
numberint
(
L
,
2
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
uint32
neglect_loc
=
0
;
uint32
neglect_loc
=
0
;
if
(
lua_gettop
(
L
)
>
2
)
if
(
lua_gettop
(
L
)
>
2
)
...
...
ocgcore/libgroup.cpp
View file @
411112ba
...
@@ -206,11 +206,11 @@ int32 scriptlib::group_filter_select(lua_State *L) {
...
@@ -206,11 +206,11 @@ int32 scriptlib::group_filter_select(lua_State *L) {
cset
.
erase
(
*
cit
);
cset
.
erase
(
*
cit
);
}
}
duel
*
pduel
=
pgroup
->
pduel
;
duel
*
pduel
=
pgroup
->
pduel
;
uint32
playerid
=
lua_to
integer
(
L
,
2
);
uint32
playerid
=
lua_to
numberint
(
L
,
2
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
uint32
min
=
lua_to
integer
(
L
,
4
);
uint32
min
=
lua_to
numberint
(
L
,
4
);
uint32
max
=
lua_to
integer
(
L
,
5
);
uint32
max
=
lua_to
numberint
(
L
,
5
);
uint32
extraargs
=
lua_gettop
(
L
)
-
6
;
uint32
extraargs
=
lua_gettop
(
L
)
-
6
;
pduel
->
game_field
->
core
.
select_cards
.
clear
();
pduel
->
game_field
->
core
.
select_cards
.
clear
();
for
(
auto
it
=
cset
.
begin
();
it
!=
cset
.
end
();
++
it
)
{
for
(
auto
it
=
cset
.
begin
();
it
!=
cset
.
end
();
++
it
)
{
...
@@ -235,11 +235,11 @@ int32 scriptlib::group_select(lua_State *L) {
...
@@ -235,11 +235,11 @@ int32 scriptlib::group_select(lua_State *L) {
cset
.
erase
(
*
cit
);
cset
.
erase
(
*
cit
);
}
}
duel
*
pduel
=
pgroup
->
pduel
;
duel
*
pduel
=
pgroup
->
pduel
;
uint32
playerid
=
lua_to
integer
(
L
,
2
);
uint32
playerid
=
lua_to
numberint
(
L
,
2
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
uint32
min
=
lua_to
integer
(
L
,
3
);
uint32
min
=
lua_to
numberint
(
L
,
3
);
uint32
max
=
lua_to
integer
(
L
,
4
);
uint32
max
=
lua_to
numberint
(
L
,
4
);
pduel
->
game_field
->
core
.
select_cards
.
clear
();
pduel
->
game_field
->
core
.
select_cards
.
clear
();
for
(
auto
it
=
cset
.
begin
();
it
!=
cset
.
end
();
++
it
)
{
for
(
auto
it
=
cset
.
begin
();
it
!=
cset
.
end
();
++
it
)
{
pduel
->
game_field
->
core
.
select_cards
.
push_back
(
*
it
);
pduel
->
game_field
->
core
.
select_cards
.
push_back
(
*
it
);
...
@@ -251,8 +251,8 @@ int32 scriptlib::group_random_select(lua_State *L) {
...
@@ -251,8 +251,8 @@ int32 scriptlib::group_random_select(lua_State *L) {
check_param_count
(
L
,
3
);
check_param_count
(
L
,
3
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
1
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
1
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
int32
playerid
=
lua_to
integer
(
L
,
2
);
int32
playerid
=
lua_to
numberint
(
L
,
2
);
int32
count
=
lua_to
integer
(
L
,
3
);
int32
count
=
lua_to
numberint
(
L
,
3
);
pgroup
->
pduel
->
game_field
->
add_process
(
PROCESSOR_RANDOM_SELECT_S
,
0
,
0
,
pgroup
,
playerid
,
count
);
pgroup
->
pduel
->
game_field
->
add_process
(
PROCESSOR_RANDOM_SELECT_S
,
0
,
0
,
pgroup
,
playerid
,
count
);
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
...
@@ -271,7 +271,7 @@ int32 scriptlib::group_is_exists(lua_State *L) {
...
@@ -271,7 +271,7 @@ int32 scriptlib::group_is_exists(lua_State *L) {
cset
.
erase
(
*
cit
);
cset
.
erase
(
*
cit
);
}
}
duel
*
pduel
=
pgroup
->
pduel
;
duel
*
pduel
=
pgroup
->
pduel
;
uint32
count
=
lua_to
integer
(
L
,
3
);
uint32
count
=
lua_to
numberint
(
L
,
3
);
uint32
extraargs
=
lua_gettop
(
L
)
-
4
;
uint32
extraargs
=
lua_gettop
(
L
)
-
4
;
uint32
fcount
=
0
;
uint32
fcount
=
0
;
uint32
result
=
FALSE
;
uint32
result
=
FALSE
;
...
@@ -293,9 +293,9 @@ int32 scriptlib::group_check_with_sum_equal(lua_State *L) {
...
@@ -293,9 +293,9 @@ int32 scriptlib::group_check_with_sum_equal(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
2
);
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
2
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
duel
*
pduel
=
pgroup
->
pduel
;
duel
*
pduel
=
pgroup
->
pduel
;
int32
acc
=
lua_to
integer
(
L
,
3
);
int32
acc
=
lua_to
numberint
(
L
,
3
);
int32
min
=
lua_to
integer
(
L
,
4
);
int32
min
=
lua_to
numberint
(
L
,
4
);
int32
max
=
lua_to
integer
(
L
,
5
);
int32
max
=
lua_to
numberint
(
L
,
5
);
if
(
min
<
0
)
if
(
min
<
0
)
min
=
0
;
min
=
0
;
if
(
max
<
min
)
if
(
max
<
min
)
...
@@ -321,12 +321,12 @@ int32 scriptlib::group_select_with_sum_equal(lua_State *L) {
...
@@ -321,12 +321,12 @@ int32 scriptlib::group_select_with_sum_equal(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
duel
*
pduel
=
pgroup
->
pduel
;
duel
*
pduel
=
pgroup
->
pduel
;
int32
playerid
=
lua_to
integer
(
L
,
2
);
int32
playerid
=
lua_to
numberint
(
L
,
2
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
int32
acc
=
lua_to
integer
(
L
,
4
);
int32
acc
=
lua_to
numberint
(
L
,
4
);
int32
min
=
lua_to
integer
(
L
,
5
);
int32
min
=
lua_to
numberint
(
L
,
5
);
int32
max
=
lua_to
integer
(
L
,
6
);
int32
max
=
lua_to
numberint
(
L
,
6
);
if
(
min
<
0
)
if
(
min
<
0
)
min
=
0
;
min
=
0
;
if
(
max
<
min
)
if
(
max
<
min
)
...
@@ -357,7 +357,7 @@ int32 scriptlib::group_check_with_sum_greater(lua_State *L) {
...
@@ -357,7 +357,7 @@ int32 scriptlib::group_check_with_sum_greater(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
2
);
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
2
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
duel
*
pduel
=
pgroup
->
pduel
;
duel
*
pduel
=
pgroup
->
pduel
;
int32
acc
=
lua_to
integer
(
L
,
3
);
int32
acc
=
lua_to
numberint
(
L
,
3
);
int32
extraargs
=
lua_gettop
(
L
)
-
3
;
int32
extraargs
=
lua_gettop
(
L
)
-
3
;
field
::
card_vector
cv
(
pduel
->
game_field
->
core
.
must_select_cards
);
field
::
card_vector
cv
(
pduel
->
game_field
->
core
.
must_select_cards
);
int32
mcount
=
cv
.
size
();
int32
mcount
=
cv
.
size
();
...
@@ -379,10 +379,10 @@ int32 scriptlib::group_select_with_sum_greater(lua_State *L) {
...
@@ -379,10 +379,10 @@ int32 scriptlib::group_select_with_sum_greater(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
duel
*
pduel
=
pgroup
->
pduel
;
duel
*
pduel
=
pgroup
->
pduel
;
int32
playerid
=
lua_to
integer
(
L
,
2
);
int32
playerid
=
lua_to
numberint
(
L
,
2
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
int32
acc
=
lua_to
integer
(
L
,
4
);
int32
acc
=
lua_to
numberint
(
L
,
4
);
int32
extraargs
=
lua_gettop
(
L
)
-
4
;
int32
extraargs
=
lua_gettop
(
L
)
-
4
;
pduel
->
game_field
->
core
.
select_cards
.
assign
(
pgroup
->
container
.
begin
(),
pgroup
->
container
.
end
());
pduel
->
game_field
->
core
.
select_cards
.
assign
(
pgroup
->
container
.
begin
(),
pgroup
->
container
.
end
());
for
(
auto
cit
=
pduel
->
game_field
->
core
.
must_select_cards
.
begin
();
cit
!=
pduel
->
game_field
->
core
.
must_select_cards
.
end
();
++
cit
)
{
for
(
auto
cit
=
pduel
->
game_field
->
core
.
must_select_cards
.
begin
();
cit
!=
pduel
->
game_field
->
core
.
must_select_cards
.
end
();
++
cit
)
{
...
...
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