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
bbbe1411
Commit
bbbe1411
authored
Jan 24, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Duel.MoveTurnCount
parent
23af4bb2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
12 deletions
+26
-12
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+15
-12
ocgcore/interpreter.cpp
ocgcore/interpreter.cpp
+1
-0
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+9
-0
ocgcore/scriptlib.h
ocgcore/scriptlib.h
+1
-0
No files found.
gframe/tag_duel.cpp
View file @
bbbe1411
...
...
@@ -1032,7 +1032,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_NEW_TURN
:
{
pbuf
++
;
int
r_player
=
BufferIO
::
ReadInt8
(
pbuf
)
;
time_limit
[
0
]
=
host_info
.
time_limit
;
time_limit
[
1
]
=
host_info
.
time_limit
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
@@ -1044,18 +1044,21 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
#ifdef YGOPRO_SERVER_MODE
NetServer
::
ReSendToPlayers
(
cache_recorder
,
replay_recorder
);
#endif
if
(
turn_count
>
0
)
{
if
(
turn_count
%
2
==
0
)
{
if
(
cur_player
[
0
]
==
players
[
0
])
cur_player
[
0
]
=
players
[
1
];
else
cur_player
[
0
]
=
players
[
0
];
}
else
{
if
(
cur_player
[
1
]
==
players
[
2
])
cur_player
[
1
]
=
players
[
3
];
else
cur_player
[
1
]
=
players
[
2
];
if
(
!
(
r_player
&
0x2
))
{
if
(
turn_count
>
0
)
{
if
(
turn_count
%
2
==
0
)
{
if
(
cur_player
[
0
]
==
players
[
0
])
cur_player
[
0
]
=
players
[
1
];
else
cur_player
[
0
]
=
players
[
0
];
}
else
{
if
(
cur_player
[
1
]
==
players
[
2
])
cur_player
[
1
]
=
players
[
3
];
else
cur_player
[
1
]
=
players
[
2
];
}
}
turn_count
++
;
}
turn_count
++
;
break
;
...
...
ocgcore/interpreter.cpp
View file @
bbbe1411
...
...
@@ -377,6 +377,7 @@ static const struct luaL_Reg duellib[] = {
{
"Exile"
,
scriptlib
::
duel_exile
},
{
"DisableActionCheck"
,
scriptlib
::
duel_disable_action_check
},
{
"SetMetatable"
,
scriptlib
::
duel_setmetatable
},
{
"MoveTurnCount"
,
scriptlib
::
duel_move_turn_count
},
{
"EnableGlobalFlag"
,
scriptlib
::
duel_enable_global_flag
},
{
"GetLP"
,
scriptlib
::
duel_get_lp
},
...
...
ocgcore/libduel.cpp
View file @
bbbe1411
...
...
@@ -144,6 +144,15 @@ int32 scriptlib::duel_setmetatable(lua_State *L) {
lua_setmetatable
(
L
,
1
);
return
0
;
}
int32
scriptlib
::
duel_move_turn_count
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
int32
turn_player
=
pduel
->
game_field
->
infos
.
turn_player
;
pduel
->
game_field
->
infos
.
turn_id
++
;
pduel
->
game_field
->
infos
.
turn_id_by_player
[
turn_player
]
++
;
pduel
->
write_buffer8
(
MSG_NEW_TURN
);
pduel
->
write_buffer8
(
turn_player
|
0x2
);
return
0
;
}
int32
scriptlib
::
duel_enable_global_flag
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
...
...
ocgcore/scriptlib.h
View file @
bbbe1411
...
...
@@ -32,6 +32,7 @@ public:
static
int32
duel_exile
(
lua_State
*
L
);
static
int32
duel_disable_action_check
(
lua_State
*
L
);
static
int32
duel_setmetatable
(
lua_State
*
L
);
static
int32
duel_move_turn_count
(
lua_State
*
L
);
//card lib
static
int32
card_get_code
(
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