Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
YGOPRO-520DIY
ygopro
Commits
996c4464
Commit
996c4464
authored
Jul 03, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
98b387fb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
16 deletions
+22
-16
ocgcore/interpreter.cpp
ocgcore/interpreter.cpp
+11
-5
ocgcore/interpreter.h
ocgcore/interpreter.h
+1
-1
script/c12694768.lua
script/c12694768.lua
+2
-2
script/c34109611.lua
script/c34109611.lua
+8
-8
No files found.
ocgcore/interpreter.cpp
View file @
996c4464
...
...
@@ -644,7 +644,7 @@ void interpreter::add_param(ptr param, int32 type, bool front) {
else
params
.
push_back
(
make_pair
((
void
*
)
param
,
type
));
}
void
interpreter
::
push_param
(
lua_State
*
L
)
{
void
interpreter
::
push_param
(
lua_State
*
L
,
bool
is_coroutine
)
{
uint32
type
;
int32
pushed
=
0
;
for
(
auto
it
=
params
.
begin
();
it
!=
params
.
end
();
++
it
)
{
...
...
@@ -688,9 +688,15 @@ void interpreter::push_param(lua_State* L) {
int32
index
=
(
int32
)(
ptr
)
it
->
first
;
if
(
index
>
0
)
lua_pushvalue
(
L
,
index
);
else
{
lua_pushnil
(
L
);
// lua_pushvalue(L, index - pushed);
else
if
(
is_coroutine
)
{
//copy value from current_state to new stack
lua_pushvalue
(
current_state
,
index
);
int32
ref
=
luaL_ref
(
current_state
,
LUA_REGISTRYINDEX
);
lua_rawgeti
(
L
,
LUA_REGISTRYINDEX
,
ref
);
luaL_unref
(
current_state
,
LUA_REGISTRYINDEX
,
ref
);
}
else
{
//the calling function is pushed before the params, so the actual index is: index - pushed -1
lua_pushvalue
(
L
,
index
-
pushed
-
1
);
}
break
;
}
...
...
@@ -956,8 +962,8 @@ int32 interpreter::call_coroutine(int32 f, uint32 param_count, uint32 * yield_va
return
OPERATION_FAIL
;
}
}
push_param
(
rthread
,
true
);
current_state
=
rthread
;
push_param
(
rthread
);
int32
result
=
lua_resume
(
rthread
,
0
,
param_count
);
if
(
result
==
0
)
{
coroutines
.
erase
(
f
);
...
...
ocgcore/interpreter.h
View file @
996c4464
...
...
@@ -55,7 +55,7 @@ public:
int32
load_card_script
(
uint32
code
);
void
add_param
(
void
*
param
,
int32
type
,
bool
front
=
false
);
void
add_param
(
ptr
param
,
int32
type
,
bool
front
=
false
);
void
push_param
(
lua_State
*
L
);
void
push_param
(
lua_State
*
L
,
bool
is_coroutine
=
false
);
int32
call_function
(
int32
f
,
uint32
param_count
,
uint32
ret_count
);
int32
call_card_function
(
card
*
pcard
,
char
*
f
,
uint32
param_count
,
uint32
ret_count
);
int32
call_code_function
(
uint32
code
,
char
*
f
,
uint32
param_count
,
uint32
ret_count
);
...
...
script/c12694768.lua
View file @
996c4464
...
...
@@ -19,6 +19,6 @@ function c12694768.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
PLAYER_ALL
,
500
)
end
function
c12694768
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Recover
(
tp
,
500
,
REASON_EFFECT
)
Duel
.
Recover
(
1
-
tp
,
500
,
REASON_EFFECT
)
Duel
.
Damage
(
tp
,
500
,
REASON_EFFECT
)
Duel
.
Damage
(
1
-
tp
,
500
,
REASON_EFFECT
)
end
script/c3
71069
11.lua
→
script/c3
41096
11.lua
View file @
996c4464
--ダイガスタ·ファルコス
function
c3
71069
11
.
initial_effect
(
c
)
function
c3
41096
11
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
nil
,
aux
.
NonTuner
(
Card
.
IsSetCard
,
0x10
),
1
)
c
:
EnableReviveLimit
()
--atkup
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
3
71069
11
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
3
41096
11
,
0
))
e1
:
SetCategory
(
CATEGORY_ATKCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
c3
71069
11
.
condition
)
e1
:
SetOperation
(
c3
71069
11
.
operation
)
e1
:
SetCondition
(
c3
41096
11
.
condition
)
e1
:
SetOperation
(
c3
41096
11
.
operation
)
c
:
RegisterEffect
(
e1
)
end
function
c3
71069
11
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c3
41096
11
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_SYNCHRO
end
function
c3
71069
11
.
filter
(
c
)
function
c3
41096
11
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x10
)
end
function
c3
71069
11
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c3
71069
11
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
function
c3
41096
11
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c3
41096
11
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
tc
=
g
:
GetFirst
()
while
tc
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
...
...
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