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
e689521c
Commit
e689521c
authored
Dec 25, 2017
by
Momobako
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of /root/7210
parents
74cb0126
f7febc12
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
229 additions
and
12 deletions
+229
-12
cards.cdb
cards.cdb
+0
-0
gframe/client_field.cpp
gframe/client_field.cpp
+15
-2
gframe/duelclient.cpp
gframe/duelclient.cpp
+65
-0
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+14
-0
gframe/single_duel.cpp
gframe/single_duel.cpp
+22
-0
gframe/single_mode.cpp
gframe/single_mode.cpp
+14
-0
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+26
-0
ocgcore/field.cpp
ocgcore/field.cpp
+17
-10
ocgcore/field.h
ocgcore/field.h
+2
-0
ocgcore/interpreter.cpp
ocgcore/interpreter.cpp
+3
-0
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+48
-0
ocgcore/scriptlib.h
ocgcore/scriptlib.h
+3
-0
No files found.
cards.cdb
View file @
e689521c
No preview for this file type
gframe/client_field.cpp
View file @
e689521c
...
...
@@ -203,8 +203,21 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
break
;
}
case
LOCATION_EXTRA
:
{
extra
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
extra
[
controler
].
size
()
-
1
;
if
(
extra_p_count
[
controler
]
==
0
||
(
pcard
->
position
&
POS_FACEUP
))
{
extra
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
extra
[
controler
].
size
()
-
1
;
}
else
{
extra
[
controler
].
push_back
(
0
);
int
p
=
extra
[
controler
].
size
()
-
extra_p_count
[
controler
]
-
1
;
for
(
int
i
=
extra
[
controler
].
size
()
-
1
;
i
>
p
;
--
i
)
{
extra
[
controler
][
i
]
=
extra
[
controler
][
i
-
1
];
extra
[
controler
][
i
]
->
sequence
++
;
extra
[
controler
][
i
]
->
curPos
+=
irr
::
core
::
vector3df
(
0
,
0
,
0.01
f
);
extra
[
controler
][
i
]
->
mTransform
.
setTranslation
(
extra
[
controler
][
i
]
->
curPos
);
}
extra
[
controler
][
p
]
=
pcard
;
pcard
->
sequence
=
p
;
}
if
(
pcard
->
position
&
POS_FACEUP
)
extra_p_count
[
controler
]
++
;
break
;
...
...
gframe/duelclient.cpp
View file @
e689521c
...
...
@@ -1804,6 +1804,44 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
return
true
;
}
case
MSG_CONFIRM_EXTRATOP
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
code
;
ClientCard
*
pcard
;
mainGame
->
dField
.
selectable_cards
.
clear
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
BufferIO
::
ReadInt32
(
pbuf
);
pbuf
+=
3
;
pcard
=
*
(
mainGame
->
dField
.
extra
[
player
].
rbegin
()
+
i
+
mainGame
->
dField
.
extra_p_count
[
player
]);
if
(
code
!=
0
)
pcard
->
SetCode
(
code
);
}
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
207
),
count
);
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
logParam
.
push_back
(
0
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
pcard
=
*
(
mainGame
->
dField
.
extra
[
player
].
rbegin
()
+
i
+
mainGame
->
dField
.
extra_p_count
[
player
]);
mainGame
->
gMutex
.
Lock
();
myswprintf
(
textBuffer
,
L"*[%ls]"
,
dataManager
.
GetName
(
pcard
->
code
));
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
logParam
.
push_back
(
pcard
->
code
);
mainGame
->
gMutex
.
Unlock
();
if
(
player
==
0
)
pcard
->
dPos
=
irr
::
core
::
vector3df
(
0
,
-
0.20
f
,
0
);
else
pcard
->
dPos
=
irr
::
core
::
vector3df
(
0.15
f
,
0
,
0
);
pcard
->
dRot
=
irr
::
core
::
vector3df
(
0
,
3.14159
f
/
5.0
f
,
0
);
pcard
->
is_moving
=
true
;
pcard
->
aniFrame
=
5
;
mainGame
->
WaitFrameSignal
(
45
);
mainGame
->
dField
.
MoveCard
(
pcard
,
5
);
mainGame
->
WaitFrameSignal
(
5
);
}
return
true
;
}
case
MSG_CONFIRM_CARDS
:
{
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
...
...
@@ -1982,6 +2020,33 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
return
true
;
}
case
MSG_SHUFFLE_EXTRA
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
/*int count = */
BufferIO
::
ReadInt8
(
pbuf
);
if
((
mainGame
->
dField
.
extra
[
player
].
size
()
-
mainGame
->
dField
.
extra_p_count
[
player
])
<
2
)
return
true
;
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
for
(
auto
cit
=
mainGame
->
dField
.
extra
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
extra
[
player
].
end
();
++
cit
)
{
if
(
!
((
*
cit
)
->
position
&
POS_FACEUP
))
{
(
*
cit
)
->
dPos
=
irr
::
core
::
vector3df
(
rand
()
*
0.4
f
/
RAND_MAX
-
0.2
f
,
0
,
0
);
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
(
*
cit
)
->
is_moving
=
true
;
(
*
cit
)
->
aniFrame
=
3
;
}
}
mainGame
->
WaitFrameSignal
(
3
);
for
(
auto
cit
=
mainGame
->
dField
.
extra
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
extra
[
player
].
end
();
++
cit
)
if
(
!
((
*
cit
)
->
position
&
POS_FACEUP
))
mainGame
->
dField
.
MoveCard
(
*
cit
,
3
);
mainGame
->
WaitFrameSignal
(
3
);
}
}
for
(
auto
cit
=
mainGame
->
dField
.
extra
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
extra
[
player
].
end
();
++
cit
)
if
(
!
((
*
cit
)
->
position
&
POS_FACEUP
))
(
*
cit
)
->
SetCode
(
BufferIO
::
ReadInt32
(
pbuf
));
return
true
;
}
case
MSG_REFRESH_DECK
:
{
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
return
true
;
...
...
gframe/replay_mode.cpp
View file @
e689521c
...
...
@@ -435,6 +435,13 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_CONFIRM_EXTRATOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
7
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_CONFIRM_CARDS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
...
...
@@ -455,6 +462,13 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_SHUFFLE_EXTRA
:
{
/*int oplayer = */
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_REFRESH_DECK
:
{
pbuf
++
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
...
...
gframe/single_duel.cpp
View file @
e689521c
...
...
@@ -953,6 +953,16 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
#endif
break
;
}
case
MSG_CONFIRM_EXTRATOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
7
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
NetServer
::
ReSendToPlayer
(
*
oit
);
break
;
}
case
MSG_CONFIRM_CARDS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
...
...
@@ -1000,6 +1010,18 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
RefreshHand
(
player
,
0x781fff
,
0
);
break
;
}
case
MSG_SHUFFLE_EXTRA
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
(
pbuf
-
offset
)
+
count
*
4
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
BufferIO
::
WriteInt32
(
pbuf
,
0
);
NetServer
::
SendBufferToPlayer
(
players
[
1
-
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
NetServer
::
ReSendToPlayer
(
*
oit
);
RefreshExtra
(
player
);
break
;
}
case
MSG_REFRESH_DECK
:
{
pbuf
++
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
gframe/single_mode.cpp
View file @
e689521c
...
...
@@ -355,6 +355,13 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_CONFIRM_EXTRATOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
7
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_CONFIRM_CARDS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
...
...
@@ -375,6 +382,13 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_SHUFFLE_EXTRA
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_REFRESH_DECK
:
{
pbuf
++
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
...
...
gframe/tag_duel.cpp
View file @
e689521c
...
...
@@ -873,6 +873,18 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
#endif
break
;
}
case
MSG_CONFIRM_EXTRATOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
7
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
NetServer
::
ReSendToPlayer
(
players
[
3
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
NetServer
::
ReSendToPlayer
(
*
oit
);
break
;
}
case
MSG_CONFIRM_CARDS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
...
...
@@ -926,6 +938,20 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
RefreshHand
(
player
,
0x781fff
,
0
);
break
;
}
case
MSG_SHUFFLE_EXTRA
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
(
pbuf
-
offset
)
+
count
*
4
);
NetServer
::
ReSendToPlayer
(
players
[
player
*
2
+
1
]);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
BufferIO
::
WriteInt32
(
pbuf
,
0
);
for
(
int
p
=
(
1
-
player
)
*
2
,
i
=
0
;
i
<
2
;
i
++
,
p
++
)
NetServer
::
SendBufferToPlayer
(
players
[
p
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
NetServer
::
ReSendToPlayer
(
*
oit
);
RefreshExtra
(
player
);
break
;
}
case
MSG_REFRESH_DECK
:
{
pbuf
++
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
ocgcore/field.cpp
View file @
e689521c
...
...
@@ -215,10 +215,13 @@ void field::add_card(uint8 playerid, card* pcard, uint8 location, uint8 sequence
break
;
}
case
LOCATION_EXTRA
:
{
player
[
playerid
].
list_extra
.
push_back
(
pcard
);
pcard
->
current
.
sequence
=
player
[
playerid
].
list_extra
.
size
()
-
1
;
if
(
player
[
playerid
].
extra_p_count
==
0
||
(
pcard
->
data
.
type
&
TYPE_PENDULUM
)
&&
(
pcard
->
sendto_param
.
position
&
POS_FACEUP
))
player
[
playerid
].
list_extra
.
push_back
(
pcard
);
else
player
[
playerid
].
list_extra
.
insert
(
player
[
playerid
].
list_extra
.
end
()
-
player
[
playerid
].
extra_p_count
,
pcard
);
if
((
pcard
->
data
.
type
&
TYPE_PENDULUM
)
&&
(
pcard
->
sendto_param
.
position
&
POS_FACEUP
))
++
player
[
playerid
].
extra_p_count
;
reset_sequence
(
playerid
,
LOCATION_EXTRA
);
break
;
}
}
...
...
@@ -825,9 +828,9 @@ void field::get_cards_in_zone(card_set* cset, uint32 zone, int32 playerid, int32
}
}
void
field
::
shuffle
(
uint8
playerid
,
uint8
location
)
{
if
(
!
(
location
&
(
LOCATION_HAND
|
LOCATION_DECK
)))
if
(
!
(
location
&
(
LOCATION_HAND
|
LOCATION_DECK
|
LOCATION_EXTRA
)))
return
;
card_vector
&
svector
=
(
location
==
LOCATION_HAND
)
?
player
[
playerid
].
list_hand
:
player
[
playerid
].
list_main
;
card_vector
&
svector
=
(
location
==
LOCATION_HAND
)
?
player
[
playerid
].
list_hand
:
(
location
==
LOCATION_DECK
)
?
player
[
playerid
].
list_main
:
player
[
playerid
].
list_extra
;
if
(
svector
.
size
()
==
0
)
return
;
if
(
location
==
LOCATION_HAND
)
{
...
...
@@ -841,8 +844,11 @@ void field::shuffle(uint8 playerid, uint8 location) {
}
}
if
(
location
==
LOCATION_HAND
||
!
(
core
.
duel_options
&
DUEL_PSEUDO_SHUFFLE
))
{
if
(
svector
.
size
()
>
1
)
{
uint32
i
=
0
,
s
=
svector
.
size
(),
r
;
uint32
s
=
svector
.
size
();
if
(
location
==
LOCATION_EXTRA
)
s
=
s
-
player
[
playerid
].
extra_p_count
;
if
(
s
>
1
)
{
uint32
i
=
0
,
r
;
for
(
i
=
0
;
i
<
s
-
1
;
++
i
)
{
r
=
pduel
->
get_next_integer
(
i
,
s
-
1
);
card
*
t
=
svector
[
i
];
...
...
@@ -852,13 +858,14 @@ void field::shuffle(uint8 playerid, uint8 location) {
reset_sequence
(
playerid
,
location
);
}
}
if
(
location
==
LOCATION_HAND
)
{
pduel
->
write_buffer8
(
MSG_SHUFFLE_HAND
);
if
(
location
==
LOCATION_HAND
||
location
==
LOCATION_EXTRA
)
{
pduel
->
write_buffer8
(
(
location
==
LOCATION_HAND
)
?
MSG_SHUFFLE_HAND
:
MSG_SHUFFLE_EXTRA
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
player
[
playerid
].
list_hand
.
size
());
pduel
->
write_buffer8
(
svector
.
size
());
for
(
auto
cit
=
svector
.
begin
();
cit
!=
svector
.
end
();
++
cit
)
pduel
->
write_buffer32
((
*
cit
)
->
data
.
code
);
core
.
shuffle_hand_check
[
playerid
]
=
FALSE
;
if
(
location
==
LOCATION_HAND
)
core
.
shuffle_hand_check
[
playerid
]
=
FALSE
;
}
else
{
pduel
->
write_buffer8
(
MSG_SHUFFLE_DECK
);
pduel
->
write_buffer8
(
playerid
);
...
...
ocgcore/field.h
View file @
e689521c
...
...
@@ -844,8 +844,10 @@ public:
#define MSG_SHUFFLE_SET_CARD 36
#define MSG_REVERSE_DECK 37
#define MSG_DECK_TOP 38
#define MSG_SHUFFLE_EXTRA 39
#define MSG_NEW_TURN 40
#define MSG_NEW_PHASE 41
#define MSG_CONFIRM_EXTRATOP 42
#define MSG_MOVE 50
#define MSG_POS_CHANGE 53
#define MSG_SET 54
...
...
ocgcore/interpreter.cpp
View file @
e689521c
...
...
@@ -421,6 +421,7 @@ static const struct luaL_Reg duellib[] = {
{
"SetChainLimitTillChainEnd"
,
scriptlib
::
duel_set_chain_limit_p
},
{
"GetChainMaterial"
,
scriptlib
::
duel_get_chain_material
},
{
"ConfirmDecktop"
,
scriptlib
::
duel_confirm_decktop
},
{
"ConfirmExtratop"
,
scriptlib
::
duel_confirm_extratop
},
{
"ConfirmCards"
,
scriptlib
::
duel_confirm_cards
},
{
"SortDecktop"
,
scriptlib
::
duel_sort_decktop
},
{
"CheckEvent"
,
scriptlib
::
duel_check_event
},
...
...
@@ -444,6 +445,7 @@ static const struct luaL_Reg duellib[] = {
{
"DiscardHand"
,
scriptlib
::
duel_discard_hand
},
{
"DisableShuffleCheck"
,
scriptlib
::
duel_disable_shuffle_check
},
{
"ShuffleDeck"
,
scriptlib
::
duel_shuffle_deck
},
{
"ShuffleExtra"
,
scriptlib
::
duel_shuffle_extra
},
{
"ShuffleHand"
,
scriptlib
::
duel_shuffle_hand
},
{
"ShuffleSetCard"
,
scriptlib
::
duel_shuffle_setcard
},
{
"ChangeAttacker"
,
scriptlib
::
duel_change_attacker
},
...
...
@@ -487,6 +489,7 @@ static const struct luaL_Reg duellib[] = {
{
"GetFieldGroup"
,
scriptlib
::
duel_get_field_group
},
{
"GetFieldGroupCount"
,
scriptlib
::
duel_get_field_group_count
},
{
"GetDecktopGroup"
,
scriptlib
::
duel_get_decktop_group
},
{
"GetExtraTopGroup"
,
scriptlib
::
duel_get_extratop_group
},
{
"GetMatchingGroup"
,
scriptlib
::
duel_get_matching_group
},
{
"GetMatchingGroupCount"
,
scriptlib
::
duel_get_matching_count
},
{
"GetFirstMatchingCard"
,
scriptlib
::
duel_get_first_matching_card
},
...
...
ocgcore/libduel.cpp
View file @
e689521c
...
...
@@ -945,6 +945,28 @@ int32 scriptlib::duel_confirm_decktop(lua_State *L) {
pduel
->
game_field
->
add_process
(
PROCESSOR_WAIT
,
0
,
0
,
0
,
0
,
0
);
return
lua_yield
(
L
,
0
);
}
int32
scriptlib
::
duel_confirm_extratop
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
int32
playerid
=
lua_tonumberint
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
uint32
count
=
lua_tonumberint
(
L
,
2
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
if
(
count
>=
pduel
->
game_field
->
player
[
playerid
].
list_extra
.
size
()
-
pduel
->
game_field
->
player
[
playerid
].
extra_p_count
)
count
=
pduel
->
game_field
->
player
[
playerid
].
list_extra
.
size
()
-
pduel
->
game_field
->
player
[
playerid
].
extra_p_count
;
auto
cit
=
pduel
->
game_field
->
player
[
playerid
].
list_extra
.
rbegin
()
+
pduel
->
game_field
->
player
[
playerid
].
extra_p_count
;
pduel
->
write_buffer8
(
MSG_CONFIRM_EXTRATOP
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
count
);
for
(
uint32
i
=
0
;
i
<
count
&&
cit
!=
pduel
->
game_field
->
player
[
playerid
].
list_extra
.
rend
();
++
i
,
++
cit
)
{
pduel
->
write_buffer32
((
*
cit
)
->
data
.
code
);
pduel
->
write_buffer8
((
*
cit
)
->
current
.
controler
);
pduel
->
write_buffer8
((
*
cit
)
->
current
.
location
);
pduel
->
write_buffer8
((
*
cit
)
->
current
.
sequence
);
}
pduel
->
game_field
->
add_process
(
PROCESSOR_WAIT
,
0
,
0
,
0
,
0
,
0
);
return
lua_yield
(
L
,
0
);
}
int32
scriptlib
::
duel_confirm_cards
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
int32
playerid
=
lua_tonumberint
(
L
,
1
);
...
...
@@ -1427,6 +1449,15 @@ int32 scriptlib::duel_shuffle_deck(lua_State *L) {
pduel
->
game_field
->
shuffle
(
playerid
,
LOCATION_DECK
);
return
0
;
}
int32
scriptlib
::
duel_shuffle_extra
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
uint32
playerid
=
lua_tonumberint
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
pduel
->
game_field
->
shuffle
(
playerid
,
LOCATION_EXTRA
);
return
0
;
}
int32
scriptlib
::
duel_shuffle_hand
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
uint32
playerid
=
lua_tonumberint
(
L
,
1
);
...
...
@@ -2187,6 +2218,23 @@ int32 scriptlib::duel_get_decktop_group(lua_State *L) {
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
}
/**
* \brief Duel.GetExtraTopGroup
* \param playerid, count
* \return Group
*/
int32
scriptlib
::
duel_get_extratop_group
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
uint32
playerid
=
lua_tonumberint
(
L
,
1
);
uint32
count
=
lua_tonumberint
(
L
,
2
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
group
*
pgroup
=
pduel
->
new_group
();
auto
cit
=
pduel
->
game_field
->
player
[
playerid
].
list_extra
.
rbegin
()
+
pduel
->
game_field
->
player
[
playerid
].
extra_p_count
;
for
(
uint32
i
=
0
;
i
<
count
&&
cit
!=
pduel
->
game_field
->
player
[
playerid
].
list_extra
.
rend
();
++
i
,
++
cit
)
pgroup
->
container
.
insert
(
*
cit
);
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
}
/**
* \brief Duel.GetMatchingGroup
* \param filter_func, self, location1, location2, exception card, (extraargs...)
...
...
ocgcore/scriptlib.h
View file @
e689521c
...
...
@@ -412,6 +412,7 @@ public:
static
int32
duel_set_chain_limit_p
(
lua_State
*
L
);
static
int32
duel_get_chain_material
(
lua_State
*
L
);
static
int32
duel_confirm_decktop
(
lua_State
*
L
);
static
int32
duel_confirm_extratop
(
lua_State
*
L
);
static
int32
duel_confirm_cards
(
lua_State
*
L
);
static
int32
duel_sort_decktop
(
lua_State
*
L
);
static
int32
duel_check_event
(
lua_State
*
L
);
...
...
@@ -436,6 +437,7 @@ public:
static
int32
duel_discard_hand
(
lua_State
*
L
);
static
int32
duel_disable_shuffle_check
(
lua_State
*
L
);
static
int32
duel_shuffle_deck
(
lua_State
*
L
);
static
int32
duel_shuffle_extra
(
lua_State
*
L
);
static
int32
duel_shuffle_hand
(
lua_State
*
L
);
static
int32
duel_shuffle_setcard
(
lua_State
*
L
);
static
int32
duel_change_attacker
(
lua_State
*
L
);
...
...
@@ -480,6 +482,7 @@ public:
static
int32
duel_get_field_group
(
lua_State
*
L
);
static
int32
duel_get_field_group_count
(
lua_State
*
L
);
static
int32
duel_get_decktop_group
(
lua_State
*
L
);
static
int32
duel_get_extratop_group
(
lua_State
*
L
);
static
int32
duel_get_matching_group
(
lua_State
*
L
);
static
int32
duel_get_matching_count
(
lua_State
*
L
);
static
int32
duel_get_first_matching_card
(
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