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
95cbbcb5
Commit
95cbbcb5
authored
Nov 30, 2017
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua53
parent
60774f6e
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
574 additions
and
563 deletions
+574
-563
.travis.yml
.travis.yml
+8
-2
appveyor.yml
appveyor.yml
+3
-3
gframe/premake4.lua
gframe/premake4.lua
+1
-1
ocgcore/common.h
ocgcore/common.h
+1
-0
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
ocgcore/premake4.lua
ocgcore/premake4.lua
+1
-1
premake4.lua
premake4.lua
+2
-0
premake5.lua
premake5.lua
+2
-0
No files found.
.travis.yml
View file @
95cbbcb5
...
@@ -9,12 +9,18 @@ addons:
...
@@ -9,12 +9,18 @@ addons:
packages
:
packages
:
-
libevent-dev
-
libevent-dev
-
libsqlite3-dev
-
libsqlite3-dev
-
liblua5.2-dev
before_install
:
before_install
:
-
git submodule update --init --recursive
-
git submodule update --init --recursive
-
wget 'http://www.lua.org/ftp/lua-5.3.4.tar.gz'
-
tar zxf lua-5.3.4.tar.gz
-
cd lua-5.3.4
-
make linux test
-
sudo make install
-
cd ..
-
wget -O - https://github.com/premake/premake-core/releases/download/v5.0.0-alpha10/premake-5.0.0-alpha10-linux.tar.gz | tar zfx -
-
wget -O - https://github.com/premake/premake-core/releases/download/v5.0.0-alpha10/premake-5.0.0-alpha10-linux.tar.gz | tar zfx -
script
:
script
:
-
./premake5 gmake
-
./premake5 gmake
-
cd build
-
cd build
-
sed -i 's/-llua/-llua5.2/g' ygopro.make
-
make config=release
-
make config=release
appveyor.yml
View file @
95cbbcb5
...
@@ -13,8 +13,8 @@ install:
...
@@ -13,8 +13,8 @@ install:
-
xcopy /E event\WIN32-Code event\include
-
xcopy /E event\WIN32-Code event\include
-
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.lua.org/ftp/lua-5.2.4.tar.gz ; exit 0"
-
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.lua.org/ftp/lua-5.2.4.tar.gz ; exit 0"
-
tar xf lua-5.
2
.4.tar.gz
-
tar xf lua-5.
3
.4.tar.gz
-
move lua-5.
2
.4\src lua
-
move lua-5.
3
.4\src lua
-
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.sqlite.org/2016/sqlite-amalgamation-3150200.zip ; exit 0"
-
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.sqlite.org/2016/sqlite-amalgamation-3150200.zip ; exit 0"
-
7z x sqlite-amalgamation-3150200.zip
-
7z x sqlite-amalgamation-3150200.zip
...
@@ -112,7 +112,7 @@ cache:
...
@@ -112,7 +112,7 @@ cache:
-
libevent-2.0.22-stable.tar.gz
-
libevent-2.0.22-stable.tar.gz
-
freetype-2.8.tar.bz2
-
freetype-2.8.tar.bz2
-
irrlicht-1.8.4.zip
-
irrlicht-1.8.4.zip
-
lua-5.
2
.4.tar.gz
-
lua-5.
3
.4.tar.gz
-
sqlite-amalgamation-3200100.zip
-
sqlite-amalgamation-3200100.zip
-
irrKlang-32bit-1.5.0.zip
-
irrKlang-32bit-1.5.0.zip
-
irrKlang-pro-1.5.0.zip
-
irrKlang-pro-1.5.0.zip
...
...
gframe/premake4.lua
View file @
95cbbcb5
...
@@ -24,5 +24,5 @@ project "ygopro"
...
@@ -24,5 +24,5 @@ project "ygopro"
configuration
"not vs*"
configuration
"not vs*"
buildoptions
{
"-std=gnu++0x"
,
"-fno-rtti"
}
buildoptions
{
"-std=gnu++0x"
,
"-fno-rtti"
}
configuration
"not windows"
configuration
"not windows"
includedirs
{
"/usr/include/lua"
,
"/usr/include/lua5.
2"
,
"/usr/include/lua/5.2
"
}
includedirs
{
"/usr/include/lua"
,
"/usr/include/lua5.
3"
,
"/usr/include/lua/5.3
"
}
links
{
"event_pthreads"
,
"dl"
,
"pthread"
}
links
{
"event_pthreads"
,
"dl"
,
"pthread"
}
ocgcore/common.h
View file @
95cbbcb5
...
@@ -43,3 +43,4 @@ struct card_sort {
...
@@ -43,3 +43,4 @@ struct card_sort {
};
};
#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 @
95cbbcb5
...
@@ -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 @
95cbbcb5
This diff is collapsed.
Click to expand it.
ocgcore/libdebug.cpp
View file @
95cbbcb5
...
@@ -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 @
95cbbcb5
This diff is collapsed.
Click to expand it.
ocgcore/libeffect.cpp
View file @
95cbbcb5
...
@@ -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 @
95cbbcb5
...
@@ -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
)
{
...
...
ocgcore/premake4.lua
View file @
95cbbcb5
...
@@ -7,4 +7,4 @@ project "ocgcore"
...
@@ -7,4 +7,4 @@ project "ocgcore"
configuration
"not vs*"
configuration
"not vs*"
buildoptions
{
"-std=gnu++0x"
}
buildoptions
{
"-std=gnu++0x"
}
configuration
"not windows"
configuration
"not windows"
includedirs
{
"/usr/include/lua"
,
"/usr/include/lua5.
2"
,
"/usr/include/lua/5.2
"
}
includedirs
{
"/usr/include/lua"
,
"/usr/include/lua5.
3"
,
"/usr/include/lua/5.3
"
}
premake4.lua
View file @
95cbbcb5
...
@@ -2,8 +2,10 @@ solution "ygo"
...
@@ -2,8 +2,10 @@ solution "ygo"
location
"build"
location
"build"
language
"C++"
language
"C++"
objdir
"obj"
objdir
"obj"
startproject
"ygopro"
configurations
{
"Debug"
,
"Release"
}
configurations
{
"Debug"
,
"Release"
}
defines
{
"LUA_COMPAT_5_2"
}
configuration
"windows"
configuration
"windows"
defines
{
"WIN32"
,
"_WIN32"
}
defines
{
"WIN32"
,
"_WIN32"
}
...
...
premake5.lua
View file @
95cbbcb5
...
@@ -2,8 +2,10 @@ solution "ygo"
...
@@ -2,8 +2,10 @@ solution "ygo"
location
"build"
location
"build"
language
"C++"
language
"C++"
objdir
"obj"
objdir
"obj"
startproject
"ygopro"
configurations
{
"Debug"
,
"Release"
}
configurations
{
"Debug"
,
"Release"
}
defines
{
"LUA_COMPAT_5_2"
}
configuration
"windows"
configuration
"windows"
defines
{
"WIN32"
,
"_WIN32"
}
defines
{
"WIN32"
,
"_WIN32"
}
...
...
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