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
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-core
Commits
ee16ca74
Commit
ee16ca74
authored
Mar 30, 2017
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Duel.SwapSequence
parent
0f75b20e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
interpreter.cpp
interpreter.cpp
+1
-0
libduel.cpp
libduel.cpp
+26
-0
scriptlib.h
scriptlib.h
+1
-0
No files found.
interpreter.cpp
View file @
ee16ca74
...
@@ -360,6 +360,7 @@ static const struct luaL_Reg duellib[] = {
...
@@ -360,6 +360,7 @@ static const struct luaL_Reg duellib[] = {
{
"MoveToField"
,
scriptlib
::
duel_move_to_field
},
{
"MoveToField"
,
scriptlib
::
duel_move_to_field
},
{
"ReturnToField"
,
scriptlib
::
duel_return_to_field
},
{
"ReturnToField"
,
scriptlib
::
duel_return_to_field
},
{
"MoveSequence"
,
scriptlib
::
duel_move_sequence
},
{
"MoveSequence"
,
scriptlib
::
duel_move_sequence
},
{
"SwapSequence"
,
scriptlib
::
duel_swap_sequence
},
{
"SetChainLimit"
,
scriptlib
::
duel_set_chain_limit
},
{
"SetChainLimit"
,
scriptlib
::
duel_set_chain_limit
},
{
"SetChainLimitTillChainEnd"
,
scriptlib
::
duel_set_chain_limit_p
},
{
"SetChainLimitTillChainEnd"
,
scriptlib
::
duel_set_chain_limit_p
},
{
"GetChainMaterial"
,
scriptlib
::
duel_get_chain_material
},
{
"GetChainMaterial"
,
scriptlib
::
duel_get_chain_material
},
...
...
libduel.cpp
View file @
ee16ca74
...
@@ -660,6 +660,32 @@ int32 scriptlib::duel_move_sequence(lua_State *L) {
...
@@ -660,6 +660,32 @@ int32 scriptlib::duel_move_sequence(lua_State *L) {
pduel
->
game_field
->
move_card
(
pcard
->
current
.
controler
,
pcard
,
pcard
->
current
.
location
,
seq
);
pduel
->
game_field
->
move_card
(
pcard
->
current
.
controler
,
pcard
,
pcard
->
current
.
location
,
seq
);
return
0
;
return
0
;
}
}
int32
scriptlib
::
duel_swap_sequence
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
card
*
pcard1
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard2
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
uint8
player
=
pcard1
->
current
.
controler
;
uint8
location
=
pcard1
->
current
.
location
;
duel
*
pduel
=
pcard1
->
pduel
;
if
(
pcard2
->
current
.
controler
==
player
&&
location
==
LOCATION_MZONE
&&
pcard2
->
current
.
location
==
location
&&
pcard1
->
is_affect_by_effect
(
pduel
->
game_field
->
core
.
reason_effect
)
&&
pcard2
->
is_affect_by_effect
(
pduel
->
game_field
->
core
.
reason_effect
))
{
uint8
s1
=
pcard1
->
current
.
sequence
,
s2
=
pcard2
->
current
.
sequence
;
pduel
->
game_field
->
remove_card
(
pcard1
);
pduel
->
game_field
->
remove_card
(
pcard2
);
pduel
->
game_field
->
add_card
(
player
,
pcard1
,
location
,
s2
);
pduel
->
game_field
->
add_card
(
player
,
pcard2
,
location
,
s1
);
pduel
->
write_buffer8
(
MSG_SWAP
);
pduel
->
write_buffer32
(
pcard1
->
data
.
code
);
pduel
->
write_buffer32
(
pcard2
->
get_info_location
());
pduel
->
write_buffer32
(
pcard2
->
data
.
code
);
pduel
->
write_buffer32
(
pcard1
->
get_info_location
());
}
return
0
;
}
int32
scriptlib
::
duel_set_chain_limit
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_set_chain_limit
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
1
);
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
1
);
...
...
scriptlib.h
View file @
ee16ca74
...
@@ -356,6 +356,7 @@ public:
...
@@ -356,6 +356,7 @@ public:
static
int32
duel_move_to_field
(
lua_State
*
L
);
static
int32
duel_move_to_field
(
lua_State
*
L
);
static
int32
duel_return_to_field
(
lua_State
*
L
);
static
int32
duel_return_to_field
(
lua_State
*
L
);
static
int32
duel_move_sequence
(
lua_State
*
L
);
static
int32
duel_move_sequence
(
lua_State
*
L
);
static
int32
duel_swap_sequence
(
lua_State
*
L
);
static
int32
duel_set_chain_limit
(
lua_State
*
L
);
static
int32
duel_set_chain_limit
(
lua_State
*
L
);
static
int32
duel_set_chain_limit_p
(
lua_State
*
L
);
static
int32
duel_set_chain_limit_p
(
lua_State
*
L
);
static
int32
duel_get_chain_material
(
lua_State
*
L
);
static
int32
duel_get_chain_material
(
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