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
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
Commits
9b22d11c
Commit
9b22d11c
authored
Feb 28, 2015
by
salix5
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'shuffle' of
git://github.com/sidschingis/ygopro
into sidschingis-shuffle
parents
f074da20
80af10a2
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
54 additions
and
7 deletions
+54
-7
gframe/duelclient.cpp
gframe/duelclient.cpp
+6
-0
gframe/event_handler.cpp
gframe/event_handler.cpp
+25
-1
gframe/game.cpp
gframe/game.cpp
+1
-0
gframe/game.h
gframe/game.h
+3
-0
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+1
-1
gframe/single_duel.cpp
gframe/single_duel.cpp
+1
-1
gframe/single_mode.cpp
gframe/single_mode.cpp
+1
-1
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+1
-1
ocgcore/field.cpp
ocgcore/field.cpp
+1
-0
ocgcore/field.h
ocgcore/field.h
+1
-0
ocgcore/playerop.cpp
ocgcore/playerop.cpp
+7
-2
ocgcore/processor.cpp
ocgcore/processor.cpp
+6
-0
No files found.
gframe/duelclient.cpp
View file @
9b22d11c
...
...
@@ -1043,6 +1043,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
btnEP
->
setEnabled
(
true
);
mainGame
->
btnEP
->
setPressed
(
false
);
}
if
(
BufferIO
::
ReadInt8
(
pbuf
))
{
mainGame
->
canShuffle
=
true
;
}
else
{
mainGame
->
canShuffle
=
false
;
}
return
false
;
}
case
MSG_SELECT_EFFECTYN
:
{
...
...
gframe/event_handler.cpp
View file @
9b22d11c
...
...
@@ -250,6 +250,12 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
HideElement
(
mainGame
->
wANCard
,
true
);
break
;
}
case
BUTTON_CMD_SHUFFLE
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
DuelClient
::
SetResponseI
(
8
);
DuelClient
::
SendResponse
();
break
;
}
case
BUTTON_CMD_ACTIVATE
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
list_command
)
{
...
...
@@ -983,7 +989,19 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
ShowMenu
(
command_flag
,
x
,
y
);
break
;
}
case
LOCATION_HAND
:
case
LOCATION_HAND
:
{
if
(
!
clicked_card
)
break
;
int
command_flag
=
clicked_card
->
cmdFlag
;
if
(
clicked_card
->
overlayed
.
size
())
command_flag
|=
COMMAND_LIST
;
list_command
=
0
;
if
(
hovered_location
&
LOCATION_HAND
&&
mainGame
->
canShuffle
&&
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
command_flag
|=
COMMAND_SHUFFLE
;
ShowMenu
(
command_flag
,
x
,
y
);
break
;
}
case
LOCATION_MZONE
:
case
LOCATION_SZONE
:
{
if
(
!
clicked_card
)
...
...
@@ -1675,6 +1693,12 @@ void ClientField::ShowMenu(int flag, int x, int y) {
return
;
}
int
height
=
1
;
if
(
flag
&
COMMAND_SHUFFLE
)
{
mainGame
->
btnShuffle
->
setVisible
(
true
);
mainGame
->
btnShuffle
->
setRelativePosition
(
position2di
(
1
,
height
));
height
+=
21
;
}
else
mainGame
->
btnShuffle
->
setVisible
(
false
);
if
(
flag
&
COMMAND_ACTIVATE
)
{
mainGame
->
btnActivate
->
setVisible
(
true
);
mainGame
->
btnActivate
->
setRelativePosition
(
position2di
(
1
,
height
));
...
...
gframe/game.cpp
View file @
9b22d11c
...
...
@@ -355,6 +355,7 @@ bool Game::Initialize() {
btnRepos
=
env
->
addButton
(
rect
<
s32
>
(
1
,
106
,
99
,
126
),
wCmdMenu
,
BUTTON_CMD_REPOS
,
dataManager
.
GetSysString
(
1154
));
btnAttack
=
env
->
addButton
(
rect
<
s32
>
(
1
,
127
,
99
,
147
),
wCmdMenu
,
BUTTON_CMD_ATTACK
,
dataManager
.
GetSysString
(
1157
));
btnShowList
=
env
->
addButton
(
rect
<
s32
>
(
1
,
148
,
99
,
168
),
wCmdMenu
,
BUTTON_CMD_SHOWLIST
,
dataManager
.
GetSysString
(
1158
));
btnShuffle
=
env
->
addButton
(
rect
<
s32
>
(
1
,
169
,
99
,
189
),
wCmdMenu
,
BUTTON_CMD_SHUFFLE
,
dataManager
.
GetSysString
(
1307
));
//deck edit
wDeckEdit
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
309
,
8
,
605
,
130
),
true
,
false
,
0
,
-
1
,
true
);
wDeckEdit
->
setVisible
(
false
);
...
...
gframe/game.h
View file @
9b22d11c
...
...
@@ -112,6 +112,7 @@ public:
std
::
vector
<
int
>
logParam
;
std
::
wstring
chatMsg
[
8
];
bool
canShuffle
;
int
hideChatTimer
;
bool
hideChat
;
int
chatTiming
[
8
];
...
...
@@ -298,6 +299,7 @@ public:
irr
::
gui
::
IGUIButton
*
btnRepos
;
irr
::
gui
::
IGUIButton
*
btnAttack
;
irr
::
gui
::
IGUIButton
*
btnShowList
;
irr
::
gui
::
IGUIButton
*
btnShuffle
;
//chat window
irr
::
gui
::
IGUIWindow
*
wChat
;
irr
::
gui
::
IGUIListBox
*
lstChatLog
;
...
...
@@ -427,6 +429,7 @@ extern Game* mainGame;
#define BUTTON_CMD_REPOS 245
#define BUTTON_CMD_ATTACK 246
#define BUTTON_CMD_SHOWLIST 247
#define BUTTON_CMD_SHUFFLE 248
#define BUTTON_ANNUMBER_OK 250
#define BUTTON_ANCARD_OK 251
#define EDITBOX_ANCARD 252
...
...
gframe/replay_mode.cpp
View file @
9b22d11c
...
...
@@ -250,7 +250,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
11
+
2
;
pbuf
+=
count
*
11
+
3
;
ReplayRefresh
();
return
ReadReplayResponse
();
}
...
...
gframe/single_duel.cpp
View file @
9b22d11c
...
...
@@ -637,7 +637,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
11
+
2
;
pbuf
+=
count
*
11
+
3
;
RefreshMzone
(
0
);
RefreshMzone
(
1
);
RefreshSzone
(
0
);
...
...
gframe/single_mode.cpp
View file @
9b22d11c
...
...
@@ -161,7 +161,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
11
+
2
;
pbuf
+=
count
*
11
+
3
;
SinglePlayRefresh
();
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
...
...
gframe/tag_duel.cpp
View file @
9b22d11c
...
...
@@ -570,7 +570,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
11
+
2
;
pbuf
+=
count
*
11
+
3
;
RefreshMzone
(
0
);
RefreshMzone
(
1
);
RefreshSzone
(
0
);
...
...
ocgcore/field.cpp
View file @
9b22d11c
...
...
@@ -27,6 +27,7 @@ field::field(duel* pduel) {
this
->
pduel
=
pduel
;
infos
.
field_id
=
1
;
infos
.
copy_id
=
1
;
infos
.
shuffle_count
=
0
;
infos
.
turn_id
=
0
;
infos
.
card_id
=
1
;
infos
.
phase
=
0
;
...
...
ocgcore/field.h
View file @
9b22d11c
...
...
@@ -114,6 +114,7 @@ struct field_info {
uint8
phase
;
uint8
turn_player
;
uint8
priorities
[
2
];
uint8
shuffle_count
;
};
struct
lpcost
{
int32
count
;
...
...
ocgcore/playerop.cpp
View file @
9b22d11c
...
...
@@ -139,11 +139,15 @@ int32 field::select_idle_command(uint16 step, uint8 playerid) {
pduel
->
write_buffer8
(
1
);
else
pduel
->
write_buffer8
(
0
);
if
(
infos
.
shuffle_count
<
5
&&
player
[(
uint32
)
playerid
].
list_hand
.
size
()
>
1
)
pduel
->
write_buffer8
(
1
);
else
pduel
->
write_buffer8
(
0
);
return
FALSE
;
}
else
{
uint32
t
=
returns
.
ivalue
[
0
]
&
0xffff
;
uint32
s
=
returns
.
ivalue
[
0
]
>>
16
;
if
(
t
<
0
||
t
>
7
||
s
<
0
if
(
t
<
0
||
t
>
8
||
s
<
0
||
(
t
==
0
&&
s
>=
core
.
summonable_cards
.
size
())
||
(
t
==
1
&&
s
>=
core
.
spsummonable_cards
.
size
())
||
(
t
==
2
&&
s
>=
core
.
repositionable_cards
.
size
())
...
...
@@ -151,7 +155,8 @@ int32 field::select_idle_command(uint16 step, uint8 playerid) {
||
(
t
==
4
&&
s
>=
core
.
ssetable_cards
.
size
())
||
(
t
==
5
&&
s
>=
core
.
select_chains
.
size
())
||
(
t
==
6
&&
(
infos
.
phase
!=
PHASE_MAIN1
||
!
core
.
to_bp
))
||
(
t
==
7
&&
!
core
.
to_ep
))
{
||
(
t
==
7
&&
!
core
.
to_ep
)
||
(
t
==
8
&&
!
(
infos
.
shuffle_count
<
5
&&
player
[(
uint32
)
playerid
].
list_hand
.
size
()
>
1
)))
{
pduel
->
write_buffer8
(
MSG_RETRY
);
return
FALSE
;
}
...
...
ocgcore/processor.cpp
View file @
9b22d11c
...
...
@@ -2701,6 +2701,11 @@ int32 field::process_idle_command(uint16 step) {
}
else
if
(
ctype
==
4
)
{
core
.
units
.
begin
()
->
step
=
8
;
return
FALSE
;
}
else
if
(
ctype
==
8
)
{
core
.
units
.
begin
()
->
step
=
-
1
;
shuffle
(
infos
.
turn_player
,
LOCATION_HAND
);
infos
.
shuffle_count
++
;
return
FALSE
;
}
else
{
core
.
units
.
begin
()
->
step
=
9
;
pduel
->
write_buffer8
(
MSG_HINT
);
...
...
@@ -2789,6 +2794,7 @@ int32 field::process_idle_command(uint16 step) {
}
case
11
:
{
returns
.
ivalue
[
0
]
=
core
.
units
.
begin
()
->
arg1
;
infos
.
shuffle_count
=
0
;
return
TRUE
;
}
case
12
:
{
...
...
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