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
40f63398
Commit
40f63398
authored
Sep 03, 2018
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak
parent
96b3763c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
24 deletions
+14
-24
interpreter.cpp
interpreter.cpp
+7
-7
interpreter.h
interpreter.h
+4
-4
ocgapi.h
ocgapi.h
+0
-1
processor.cpp
processor.cpp
+3
-12
No files found.
interpreter.cpp
View file @
40f63398
...
@@ -629,8 +629,8 @@ interpreter::interpreter(duel* pd): coroutines(256) {
...
@@ -629,8 +629,8 @@ interpreter::interpreter(duel* pd): coroutines(256) {
luaL_newlib
(
lua_state
,
debuglib
);
luaL_newlib
(
lua_state
,
debuglib
);
lua_setglobal
(
lua_state
,
"Debug"
);
lua_setglobal
(
lua_state
,
"Debug"
);
//extra scripts
//extra scripts
load_script
(
(
char
*
)
"./script/constant.lua"
);
load_script
(
"./script/constant.lua"
);
load_script
(
(
char
*
)
"./script/utility.lua"
);
load_script
(
"./script/utility.lua"
);
}
}
interpreter
::~
interpreter
()
{
interpreter
::~
interpreter
()
{
lua_close
(
lua_state
);
lua_close
(
lua_state
);
...
@@ -654,7 +654,7 @@ int32 interpreter::register_card(card *pcard) {
...
@@ -654,7 +654,7 @@ int32 interpreter::register_card(card *pcard) {
if
(
pcard
->
data
.
code
&&
(
!
(
pcard
->
data
.
type
&
TYPE_NORMAL
)
||
(
pcard
->
data
.
type
&
TYPE_PENDULUM
)))
{
if
(
pcard
->
data
.
code
&&
(
!
(
pcard
->
data
.
type
&
TYPE_NORMAL
)
||
(
pcard
->
data
.
type
&
TYPE_PENDULUM
)))
{
pcard
->
set_status
(
STATUS_INITIALIZING
,
TRUE
);
pcard
->
set_status
(
STATUS_INITIALIZING
,
TRUE
);
add_param
(
pcard
,
PARAM_TYPE_CARD
);
add_param
(
pcard
,
PARAM_TYPE_CARD
);
call_card_function
(
pcard
,
(
char
*
)
"initial_effect"
,
1
,
0
);
call_card_function
(
pcard
,
"initial_effect"
,
1
,
0
);
pcard
->
set_status
(
STATUS_INITIALIZING
,
FALSE
);
pcard
->
set_status
(
STATUS_INITIALIZING
,
FALSE
);
}
}
pcard
->
cardid
=
pduel
->
game_field
->
infos
.
card_id
++
;
pcard
->
cardid
=
pduel
->
game_field
->
infos
.
card_id
++
;
...
@@ -708,14 +708,14 @@ void interpreter::unregister_group(group *pgroup) {
...
@@ -708,14 +708,14 @@ void interpreter::unregister_group(group *pgroup) {
luaL_unref
(
lua_state
,
LUA_REGISTRYINDEX
,
pgroup
->
ref_handle
);
luaL_unref
(
lua_state
,
LUA_REGISTRYINDEX
,
pgroup
->
ref_handle
);
pgroup
->
ref_handle
=
0
;
pgroup
->
ref_handle
=
0
;
}
}
int32
interpreter
::
load_script
(
char
*
script_name
)
{
int32
interpreter
::
load_script
(
c
onst
c
har
*
script_name
)
{
int32
error
;
int32
error
;
int32
len
=
0
;
int32
len
=
0
;
byte
*
buffer
=
read_script
(
script_name
,
&
len
);
byte
*
buffer
=
read_script
(
script_name
,
&
len
);
if
(
!
buffer
)
if
(
!
buffer
)
return
OPERATION_FAIL
;
return
OPERATION_FAIL
;
no_action
++
;
no_action
++
;
error
=
luaL_loadbuffer
(
current_state
,
(
c
onst
char
*
)
buffer
,
len
,
(
const
char
*
)
script_name
)
||
lua_pcall
(
current_state
,
0
,
0
,
0
);
error
=
luaL_loadbuffer
(
current_state
,
(
c
har
*
)
buffer
,
len
,
script_name
)
||
lua_pcall
(
current_state
,
0
,
0
,
0
);
if
(
error
)
{
if
(
error
)
{
interpreter
::
strcpy
(
pduel
->
strbuffer
,
lua_tostring
(
current_state
,
-
1
));
interpreter
::
strcpy
(
pduel
->
strbuffer
,
lua_tostring
(
current_state
,
-
1
));
handle_message
(
pduel
,
1
);
handle_message
(
pduel
,
1
);
...
@@ -867,7 +867,7 @@ int32 interpreter::call_function(int32 f, uint32 param_count, int32 ret_count) {
...
@@ -867,7 +867,7 @@ int32 interpreter::call_function(int32 f, uint32 param_count, int32 ret_count) {
}
}
return
OPERATION_SUCCESS
;
return
OPERATION_SUCCESS
;
}
}
int32
interpreter
::
call_card_function
(
card
*
pcard
,
char
*
f
,
uint32
param_count
,
int32
ret_count
)
{
int32
interpreter
::
call_card_function
(
card
*
pcard
,
c
onst
c
har
*
f
,
uint32
param_count
,
int32
ret_count
)
{
if
(
param_count
!=
params
.
size
())
{
if
(
param_count
!=
params
.
size
())
{
sprintf
(
pduel
->
strbuffer
,
"
\"
CallCardFunction
\"
(c%d.%s): incorrect parameter count"
,
pcard
->
data
.
code
,
f
);
sprintf
(
pduel
->
strbuffer
,
"
\"
CallCardFunction
\"
(c%d.%s): incorrect parameter count"
,
pcard
->
data
.
code
,
f
);
handle_message
(
pduel
,
1
);
handle_message
(
pduel
,
1
);
...
@@ -907,7 +907,7 @@ int32 interpreter::call_card_function(card* pcard, char* f, uint32 param_count,
...
@@ -907,7 +907,7 @@ int32 interpreter::call_card_function(card* pcard, char* f, uint32 param_count,
}
}
return
OPERATION_SUCCESS
;
return
OPERATION_SUCCESS
;
}
}
int32
interpreter
::
call_code_function
(
uint32
code
,
char
*
f
,
uint32
param_count
,
int32
ret_count
)
{
int32
interpreter
::
call_code_function
(
uint32
code
,
c
onst
c
har
*
f
,
uint32
param_count
,
int32
ret_count
)
{
if
(
param_count
!=
params
.
size
())
{
if
(
param_count
!=
params
.
size
())
{
sprintf
(
pduel
->
strbuffer
,
"
\"
CallCodeFunction
\"
: incorrect parameter count"
);
sprintf
(
pduel
->
strbuffer
,
"
\"
CallCodeFunction
\"
: incorrect parameter count"
);
handle_message
(
pduel
,
1
);
handle_message
(
pduel
,
1
);
...
...
interpreter.h
View file @
40f63398
...
@@ -49,20 +49,20 @@ public:
...
@@ -49,20 +49,20 @@ public:
explicit
interpreter
(
duel
*
pd
);
explicit
interpreter
(
duel
*
pd
);
~
interpreter
();
~
interpreter
();
int32
register_card
(
card
*
pcard
);
int32
register_card
(
card
*
pcard
);
void
register_effect
(
effect
*
peffect
);
void
register_effect
(
effect
*
peffect
);
void
unregister_effect
(
effect
*
peffect
);
void
unregister_effect
(
effect
*
peffect
);
void
register_group
(
group
*
pgroup
);
void
register_group
(
group
*
pgroup
);
void
unregister_group
(
group
*
pgroup
);
void
unregister_group
(
group
*
pgroup
);
int32
load_script
(
c
har
*
buffer
);
int32
load_script
(
c
onst
char
*
script_name
);
int32
load_card_script
(
uint32
code
);
int32
load_card_script
(
uint32
code
);
void
add_param
(
void
*
param
,
int32
type
,
bool
front
=
false
);
void
add_param
(
void
*
param
,
int32
type
,
bool
front
=
false
);
void
add_param
(
ptr
param
,
int32
type
,
bool
front
=
false
);
void
add_param
(
ptr
param
,
int32
type
,
bool
front
=
false
);
void
push_param
(
lua_State
*
L
,
bool
is_coroutine
=
false
);
void
push_param
(
lua_State
*
L
,
bool
is_coroutine
=
false
);
int32
call_function
(
int32
f
,
uint32
param_count
,
int32
ret_count
);
int32
call_function
(
int32
f
,
uint32
param_count
,
int32
ret_count
);
int32
call_card_function
(
card
*
pcard
,
char
*
f
,
uint32
param_count
,
int32
ret_count
);
int32
call_card_function
(
card
*
pcard
,
const
char
*
f
,
uint32
param_count
,
int32
ret_count
);
int32
call_code_function
(
uint32
code
,
c
har
*
f
,
uint32
param_count
,
int32
ret_count
);
int32
call_code_function
(
uint32
code
,
c
onst
char
*
f
,
uint32
param_count
,
int32
ret_count
);
int32
check_condition
(
int32
f
,
uint32
param_count
);
int32
check_condition
(
int32
f
,
uint32
param_count
);
int32
check_matching
(
card
*
pcard
,
int32
findex
,
int32
extraargs
);
int32
check_matching
(
card
*
pcard
,
int32
findex
,
int32
extraargs
);
int32
get_operation_value
(
card
*
pcard
,
int32
findex
,
int32
extraargs
);
int32
get_operation_value
(
card
*
pcard
,
int32
findex
,
int32
extraargs
);
...
...
ocgapi.h
View file @
40f63398
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
#include "common.h"
#include "common.h"
#ifdef WIN32
#ifdef WIN32
#include <windows.h>
#define DECL_DLLEXPORT __declspec(dllexport)
#define DECL_DLLEXPORT __declspec(dllexport)
#else
#else
#define DECL_DLLEXPORT
#define DECL_DLLEXPORT
...
...
processor.cpp
View file @
40f63398
...
@@ -2034,13 +2034,9 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
...
@@ -2034,13 +2034,9 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
}
}
case
2
:
{
case
2
:
{
chain
newchain
;
chain
newchain
;
auto
evit
=
core
.
point_event
.
begin
();
for
(
auto
evit
=
core
.
point_event
.
begin
();
evit
!=
core
.
instant_event
.
begin
();
++
evit
)
{
bool
pev
=
true
;
if
(
evit
==
core
.
point_event
.
end
())
if
(
evit
==
core
.
point_event
.
end
())
{
evit
=
core
.
instant_event
.
begin
();
evit
=
core
.
instant_event
.
begin
();
pev
=
false
;
}
while
(
pev
||
(
evit
!=
core
.
instant_event
.
end
()))
{
auto
pr
=
effects
.
activate_effect
.
equal_range
(
evit
->
event_code
);
auto
pr
=
effects
.
activate_effect
.
equal_range
(
evit
->
event_code
);
for
(
auto
eit
=
pr
.
first
;
eit
!=
pr
.
second
;)
{
for
(
auto
eit
=
pr
.
first
;
eit
!=
pr
.
second
;)
{
effect
*
peffect
=
eit
->
second
;
effect
*
peffect
=
eit
->
second
;
...
@@ -2075,11 +2071,6 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
...
@@ -2075,11 +2071,6 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
core
.
delayed_quick_break
.
erase
(
std
::
make_pair
(
peffect
,
*
evit
));
core
.
delayed_quick_break
.
erase
(
std
::
make_pair
(
peffect
,
*
evit
));
}
}
}
}
++
evit
;
if
(
pev
&&
evit
==
core
.
point_event
.
end
())
{
evit
=
core
.
instant_event
.
begin
();
pev
=
false
;
}
}
}
for
(
auto
&
ch
:
core
.
new_ochain_h
)
{
for
(
auto
&
ch
:
core
.
new_ochain_h
)
{
effect
*
peffect
=
ch
.
triggering_effect
;
effect
*
peffect
=
ch
.
triggering_effect
;
...
...
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