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
Commits
fbc256c3
Commit
fbc256c3
authored
Jul 20, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
d0007b49
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
597 additions
and
356 deletions
+597
-356
gframe/client_field.cpp
gframe/client_field.cpp
+30
-15
gframe/client_field.h
gframe/client_field.h
+2
-1
gframe/drawing.cpp
gframe/drawing.cpp
+12
-7
gframe/duelclient.cpp
gframe/duelclient.cpp
+494
-315
gframe/game.h
gframe/game.h
+1
-0
gframe/image_manager.cpp
gframe/image_manager.cpp
+1
-0
gframe/image_manager.h
gframe/image_manager.h
+1
-0
gframe/materials.cpp
gframe/materials.cpp
+4
-0
gframe/materials.h
gframe/materials.h
+1
-0
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+1
-1
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+21
-2
gframe/replay_mode.h
gframe/replay_mode.h
+2
-1
gframe/single_mode.cpp
gframe/single_mode.cpp
+1
-1
ocgcore/card.cpp
ocgcore/card.cpp
+3
-3
ocgcore/operations.cpp
ocgcore/operations.cpp
+1
-1
script/c61314842.lua
script/c61314842.lua
+16
-3
script/c96704018.lua
script/c96704018.lua
+1
-1
strings.conf
strings.conf
+5
-5
No files found.
gframe/client_field.cpp
View file @
fbc256c3
...
@@ -87,8 +87,10 @@ void ClientField::Initial(int player, int deckc, int extrac) {
...
@@ -87,8 +87,10 @@ void ClientField::Initial(int player, int deckc, int extrac) {
pcard
->
mTransform
.
setRotationRadians
(
pcard
->
curRot
);
pcard
->
mTransform
.
setRotationRadians
(
pcard
->
curRot
);
}
}
}
}
ClientCard
*
ClientField
::
GetCard
(
int
controler
,
int
location
,
int
sequence
)
{
ClientCard
*
ClientField
::
GetCard
(
int
controler
,
int
location
,
int
sequence
,
int
sub_seq
)
{
std
::
vector
<
ClientCard
*>*
lst
=
0
;
std
::
vector
<
ClientCard
*>*
lst
=
0
;
bool
is_xyz
=
(
location
&
0x80
);
location
&=
0x7f
;
switch
(
location
)
{
switch
(
location
)
{
case
LOCATION_DECK
:
case
LOCATION_DECK
:
lst
=
&
deck
[
controler
];
lst
=
&
deck
[
controler
];
...
@@ -114,9 +116,19 @@ ClientCard* ClientField::GetCard(int controler, int location, int sequence) {
...
@@ -114,9 +116,19 @@ ClientCard* ClientField::GetCard(int controler, int location, int sequence) {
}
}
if
(
!
lst
)
if
(
!
lst
)
return
0
;
return
0
;
if
(
sequence
>=
lst
->
size
())
if
(
is_xyz
)
{
return
0
;
if
(
sequence
>=
lst
->
size
())
return
(
*
lst
)[
sequence
];
return
0
;
ClientCard
*
scard
=
(
*
lst
)[
sequence
];
if
(
scard
&&
scard
->
overlayed
.
size
()
>
sub_seq
)
return
scard
->
overlayed
[
sub_seq
];
else
return
0
;
}
else
{
if
(
sequence
>=
lst
->
size
())
return
0
;
return
(
*
lst
)[
sequence
];
}
}
}
void
ClientField
::
AddCard
(
ClientCard
*
pcard
,
int
controler
,
int
location
,
int
sequence
)
{
void
ClientField
::
AddCard
(
ClientCard
*
pcard
,
int
controler
,
int
location
,
int
sequence
)
{
pcard
->
controler
=
controler
;
pcard
->
controler
=
controler
;
...
@@ -393,6 +405,20 @@ void ClientField::ReplaySwap() {
...
@@ -393,6 +405,20 @@ void ClientField::ReplaySwap() {
std
::
swap
(
grave
[
0
],
grave
[
1
]);
std
::
swap
(
grave
[
0
],
grave
[
1
]);
std
::
swap
(
remove
[
0
],
remove
[
1
]);
std
::
swap
(
remove
[
0
],
remove
[
1
]);
std
::
swap
(
extra
[
0
],
extra
[
1
]);
std
::
swap
(
extra
[
0
],
extra
[
1
]);
RefreshAllCards
();
mainGame
->
dInfo
.
isFirst
=
!
mainGame
->
dInfo
.
isFirst
;
std
::
swap
(
mainGame
->
dInfo
.
lp
[
0
],
mainGame
->
dInfo
.
lp
[
1
]);
for
(
int
i
=
0
;
i
<
16
;
++
i
)
std
::
swap
(
mainGame
->
dInfo
.
strLP
[
0
][
i
],
mainGame
->
dInfo
.
strLP
[
1
][
i
]);
for
(
int
i
=
0
;
i
<
20
;
++
i
)
std
::
swap
(
mainGame
->
dInfo
.
hostname
[
i
],
mainGame
->
dInfo
.
clientname
[
i
]);
for
(
auto
chit
=
chains
.
begin
();
chit
!=
chains
.
end
();
++
chit
)
{
chit
->
controler
=
1
-
chit
->
controler
;
GetChainLocation
(
chit
->
controler
,
chit
->
location
,
chit
->
sequence
,
&
chit
->
chain_pos
);
}
disabled_field
=
(
disabled_field
>>
16
)
|
(
disabled_field
<<
16
);
}
void
ClientField
::
RefreshAllCards
()
{
for
(
int
p
=
0
;
p
<
2
;
++
p
)
{
for
(
int
p
=
0
;
p
<
2
;
++
p
)
{
for
(
auto
cit
=
deck
[
p
].
begin
();
cit
!=
deck
[
p
].
end
();
++
cit
)
{
for
(
auto
cit
=
deck
[
p
].
begin
();
cit
!=
deck
[
p
].
end
();
++
cit
)
{
(
*
cit
)
->
controler
=
1
-
(
*
cit
)
->
controler
;
(
*
cit
)
->
controler
=
1
-
(
*
cit
)
->
controler
;
...
@@ -455,17 +481,6 @@ void ClientField::ReplaySwap() {
...
@@ -455,17 +481,6 @@ void ClientField::ReplaySwap() {
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
(
*
cit
)
->
is_moving
=
false
;
(
*
cit
)
->
is_moving
=
false
;
}
}
mainGame
->
dInfo
.
isFirst
=
!
mainGame
->
dInfo
.
isFirst
;
std
::
swap
(
mainGame
->
dInfo
.
lp
[
0
],
mainGame
->
dInfo
.
lp
[
1
]);
for
(
int
i
=
0
;
i
<
16
;
++
i
)
std
::
swap
(
mainGame
->
dInfo
.
strLP
[
0
][
i
],
mainGame
->
dInfo
.
strLP
[
1
][
i
]);
for
(
int
i
=
0
;
i
<
20
;
++
i
)
std
::
swap
(
mainGame
->
dInfo
.
hostname
[
i
],
mainGame
->
dInfo
.
clientname
[
i
]);
for
(
auto
chit
=
chains
.
begin
();
chit
!=
chains
.
end
();
++
chit
)
{
chit
->
controler
=
1
-
chit
->
controler
;
GetChainLocation
(
chit
->
controler
,
chit
->
location
,
chit
->
sequence
,
&
chit
->
chain_pos
);
}
disabled_field
=
(
disabled_field
>>
16
)
|
(
disabled_field
<<
16
);
}
}
void
ClientField
::
GetChainLocation
(
int
controler
,
int
location
,
int
sequence
,
irr
::
core
::
vector3df
*
t
)
{
void
ClientField
::
GetChainLocation
(
int
controler
,
int
location
,
int
sequence
,
irr
::
core
::
vector3df
*
t
)
{
t
->
X
=
0
;
t
->
X
=
0
;
...
...
gframe/client_field.h
View file @
fbc256c3
...
@@ -72,7 +72,7 @@ public:
...
@@ -72,7 +72,7 @@ public:
ClientField
();
ClientField
();
void
Clear
();
void
Clear
();
void
Initial
(
int
player
,
int
deckc
,
int
extrac
);
void
Initial
(
int
player
,
int
deckc
,
int
extrac
);
ClientCard
*
GetCard
(
int
controler
,
int
location
,
int
sequence
);
ClientCard
*
GetCard
(
int
controler
,
int
location
,
int
sequence
,
int
sub_seq
=
0
);
void
AddCard
(
ClientCard
*
pcard
,
int
controler
,
int
location
,
int
sequence
);
void
AddCard
(
ClientCard
*
pcard
,
int
controler
,
int
location
,
int
sequence
);
ClientCard
*
RemoveCard
(
int
controler
,
int
location
,
int
sequence
);
ClientCard
*
RemoveCard
(
int
controler
,
int
location
,
int
sequence
);
void
UpdateCard
(
int
controler
,
int
location
,
int
sequence
,
char
*
data
);
void
UpdateCard
(
int
controler
,
int
location
,
int
sequence
,
char
*
data
);
...
@@ -82,6 +82,7 @@ public:
...
@@ -82,6 +82,7 @@ public:
void
ClearChainSelect
();
void
ClearChainSelect
();
void
ShowSelectCard
(
bool
buttonok
=
false
);
void
ShowSelectCard
(
bool
buttonok
=
false
);
void
ReplaySwap
();
void
ReplaySwap
();
void
RefreshAllCards
();
void
GetChainLocation
(
int
controler
,
int
location
,
int
sequence
,
irr
::
core
::
vector3df
*
t
);
void
GetChainLocation
(
int
controler
,
int
location
,
int
sequence
,
irr
::
core
::
vector3df
*
t
);
void
GetCardLocation
(
ClientCard
*
pcard
,
irr
::
core
::
vector3df
*
t
,
irr
::
core
::
vector3df
*
r
,
bool
setTrans
=
false
);
void
GetCardLocation
(
ClientCard
*
pcard
,
irr
::
core
::
vector3df
*
t
,
irr
::
core
::
vector3df
*
r
,
bool
setTrans
=
false
);
...
...
gframe/drawing.cpp
View file @
fbc256c3
...
@@ -53,14 +53,19 @@ void Game::DrawBackGround() {
...
@@ -53,14 +53,19 @@ void Game::DrawBackGround() {
im
.
setTranslation
(
vector3df
(
0
,
0
,
-
0.01
));
im
.
setTranslation
(
vector3df
(
0
,
0
,
-
0.01
));
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
im
);
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
im
);
//dark shade
//dark shade
matManager
.
mSelField
.
AmbientColor
=
0xff000000
;
// matManager.mSelField.AmbientColor = 0xff000000;
matManager
.
mSelField
.
DiffuseColor
=
0xa0000000
;
// matManager.mSelField.DiffuseColor = 0xa0000000;
driver
->
setMaterial
(
matManager
.
mSelField
);
// driver->setMaterial(matManager.mSelField);
for
(
int
i
=
0
;
i
<
120
;
i
+=
4
)
// for(int i = 0; i < 120; i += 4)
driver
->
drawVertexPrimitiveList
(
&
matManager
.
vFields
[
i
],
4
,
matManager
.
iRectangle
,
2
);
// driver->drawVertexPrimitiveList(&matManager.vFields[i], 4, matManager.iRectangle, 2);
// driver->setTransform(irr::video::ETS_WORLD, irr::core::IdentityMatrix);
// driver->setMaterial(matManager.mBackLine);
// driver->drawVertexPrimitiveList(matManager.vBackLine, 76, matManager.iBackLine, 58, irr::video::EVT_STANDARD, irr::scene::EPT_LINES);
//draw field
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
irr
::
core
::
IdentityMatrix
);
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
irr
::
core
::
IdentityMatrix
);
driver
->
setMaterial
(
matManager
.
mBackLine
);
matManager
.
mTexture
.
setTexture
(
0
,
imageManager
.
tField
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vBackLine
,
76
,
matManager
.
iBackLine
,
58
,
irr
::
video
::
EVT_STANDARD
,
irr
::
scene
::
EPT_LINES
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vField
,
4
,
matManager
.
iRectangle
,
2
);
//select field
//select field
if
(
dInfo
.
curMsg
==
MSG_SELECT_PLACE
||
dInfo
.
curMsg
==
MSG_SELECT_DISFIELD
)
{
if
(
dInfo
.
curMsg
==
MSG_SELECT_PLACE
||
dInfo
.
curMsg
==
MSG_SELECT_DISFIELD
)
{
float
cv
[
4
]
=
{
0.0
f
,
0.0
f
,
1.0
f
,
1.0
f
};
float
cv
[
4
]
=
{
0.0
f
,
0.0
f
,
1.0
f
,
1.0
f
};
...
...
gframe/duelclient.cpp
View file @
fbc256c3
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#include "../ocgcore/duel.h"
#include "../ocgcore/duel.h"
#include "game.h"
#include "game.h"
#include "replay.h"
#include "replay.h"
#include "replay_mode.h"
namespace
ygo
{
namespace
ygo
{
...
@@ -714,6 +715,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -714,6 +715,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
type
=
BufferIO
::
ReadInt8
(
pbuf
);
int
type
=
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
BufferIO
::
ReadInt8
(
pbuf
);
int
data
=
BufferIO
::
ReadInt32
(
pbuf
);
int
data
=
BufferIO
::
ReadInt32
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
switch
(
type
)
{
switch
(
type
)
{
case
HINT_EVENT
:
{
case
HINT_EVENT
:
{
myswprintf
(
event_string
,
L"%ls"
,
dataManager
.
GetDesc
(
data
));
myswprintf
(
event_string
,
L"%ls"
,
dataManager
.
GetDesc
(
data
));
...
@@ -811,6 +814,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -811,6 +814,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
showcardp
=
0
;
mainGame
->
showcardp
=
0
;
mainGame
->
dInfo
.
vic_string
=
0
;
mainGame
->
dInfo
.
vic_string
=
0
;
wchar_t
vic_buf
[
256
];
wchar_t
vic_buf
[
256
];
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
mainGame
->
gMutex
.
Unlock
();
if
(
player
==
2
)
if
(
player
==
2
)
mainGame
->
showcardcode
=
3
;
mainGame
->
showcardcode
=
3
;
else
if
(
mainGame
->
LocalPlayer
(
player
)
==
0
)
{
else
if
(
mainGame
->
LocalPlayer
(
player
)
==
0
)
{
...
@@ -1418,9 +1423,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1418,9 +1423,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
code
;
int
code
;
ClientCard
*
pcard
;
ClientCard
*
pcard
;
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
207
),
count
);
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
logParam
.
push_back
(
0
);
mainGame
->
dField
.
selectable_cards
.
clear
();
mainGame
->
dField
.
selectable_cards
.
clear
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
BufferIO
::
ReadInt32
(
pbuf
);
code
=
BufferIO
::
ReadInt32
(
pbuf
);
...
@@ -1429,11 +1431,18 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1429,11 +1431,18 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if
(
code
!=
0
)
if
(
code
!=
0
)
pcard
->
SetCode
(
code
);
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
)
{
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
pcard
=
*
(
mainGame
->
dField
.
deck
[
player
].
rbegin
()
+
i
);
pcard
=
*
(
mainGame
->
dField
.
deck
[
player
].
rbegin
()
+
i
);
mainGame
->
gMutex
.
Lock
();
myswprintf
(
textBuffer
,
L"*[%ls]"
,
dataManager
.
GetName
(
pcard
->
code
));
myswprintf
(
textBuffer
,
L"*[%ls]"
,
dataManager
.
GetName
(
pcard
->
code
));
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
logParam
.
push_back
(
pcard
->
code
);
mainGame
->
logParam
.
push_back
(
pcard
->
code
);
mainGame
->
gMutex
.
Unlock
();
float
shift
=
-
0.15
f
;
float
shift
=
-
0.15
f
;
if
(
player
==
1
)
shift
=
0.15
f
;
if
(
player
==
1
)
shift
=
0.15
f
;
pcard
->
dPos
=
irr
::
core
::
vector3df
(
shift
,
0
,
0
);
pcard
->
dPos
=
irr
::
core
::
vector3df
(
shift
,
0
,
0
);
...
@@ -1455,6 +1464,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1455,6 +1464,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
std
::
vector
<
ClientCard
*>
field_confirm
;
std
::
vector
<
ClientCard
*>
field_confirm
;
std
::
vector
<
ClientCard
*>
panel_confirm
;
std
::
vector
<
ClientCard
*>
panel_confirm
;
ClientCard
*
pcard
;
ClientCard
*
pcard
;
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
pbuf
+=
count
*
7
;
return
true
;
}
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
208
),
count
);
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
208
),
count
);
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
logParam
.
push_back
(
0
);
mainGame
->
logParam
.
push_back
(
0
);
...
@@ -1466,9 +1479,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1466,9 +1479,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
code
!=
0
)
if
(
code
!=
0
)
pcard
->
SetCode
(
code
);
pcard
->
SetCode
(
code
);
mainGame
->
gMutex
.
Lock
();
myswprintf
(
textBuffer
,
L"*[%ls]"
,
dataManager
.
GetName
(
code
));
myswprintf
(
textBuffer
,
L"*[%ls]"
,
dataManager
.
GetName
(
code
));
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
logParam
.
push_back
(
code
);
mainGame
->
logParam
.
push_back
(
code
);
mainGame
->
gMutex
.
Unlock
();
if
(
l
&
0x41
)
{
if
(
l
&
0x41
)
{
if
(
count
==
1
)
{
if
(
count
==
1
)
{
float
shift
=
-
0.15
f
;
float
shift
=
-
0.15
f
;
...
@@ -1537,66 +1552,74 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1537,66 +1552,74 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case
MSG_SHUFFLE_DECK
:
{
case
MSG_SHUFFLE_DECK
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
bool
rev
=
mainGame
->
dField
.
deck_reversed
;
bool
rev
=
mainGame
->
dField
.
deck_reversed
;
mainGame
->
dField
.
deck_reversed
=
false
;
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
if
(
rev
)
{
mainGame
->
dField
.
deck_reversed
=
false
;
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
deck
[
player
].
size
();
++
i
)
if
(
rev
)
{
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
deck
[
player
][
i
],
10
);
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
deck
[
player
].
size
();
++
i
)
mainGame
->
WaitFrameSignal
(
10
);
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
deck
[
player
][
i
],
10
);
mainGame
->
WaitFrameSignal
(
10
);
}
}
}
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
deck
[
player
].
size
();
++
i
)
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
deck
[
player
].
size
();
++
i
)
mainGame
->
dField
.
deck
[
player
][
i
]
->
code
=
0
;
mainGame
->
dField
.
deck
[
player
][
i
]
->
code
=
0
;
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
for
(
auto
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
(
*
cit
)
->
dPos
=
irr
::
core
::
vector3df
(
rand
()
*
0.4
f
/
RAND_MAX
-
0.2
f
,
0
,
0
);
for
(
auto
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
{
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
(
*
cit
)
->
dPos
=
irr
::
core
::
vector3df
(
rand
()
*
0.4
f
/
RAND_MAX
-
0.2
f
,
0
,
0
);
(
*
cit
)
->
is_moving
=
true
;
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
(
*
cit
)
->
aniFrame
=
3
;
(
*
cit
)
->
is_moving
=
true
;
(
*
cit
)
->
aniFrame
=
3
;
}
mainGame
->
WaitFrameSignal
(
3
);
for
(
auto
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
mainGame
->
dField
.
MoveCard
(
*
cit
,
3
);
mainGame
->
WaitFrameSignal
(
3
);
}
mainGame
->
dField
.
deck_reversed
=
rev
;
if
(
rev
)
{
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
deck
[
player
].
size
();
++
i
)
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
deck
[
player
][
i
],
10
);
}
}
mainGame
->
WaitFrameSignal
(
3
);
for
(
auto
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
mainGame
->
dField
.
MoveCard
(
*
cit
,
3
);
mainGame
->
WaitFrameSignal
(
3
);
}
mainGame
->
dField
.
deck_reversed
=
rev
;
if
(
rev
)
{
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
deck
[
player
].
size
();
++
i
)
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
deck
[
player
][
i
],
10
);
}
}
return
true
;
return
true
;
}
}
case
MSG_SHUFFLE_HAND
:
{
case
MSG_SHUFFLE_HAND
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
WaitFrameSignal
(
5
);
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
if
(
player
==
1
&&
!
mainGame
->
dInfo
.
isReplay
&&
!
mainGame
->
dInfo
.
isSingleMode
)
{
mainGame
->
WaitFrameSignal
(
5
);
bool
flip
=
false
;
if
(
player
==
1
&&
!
mainGame
->
dInfo
.
isReplay
&&
!
mainGame
->
dInfo
.
isSingleMode
)
{
for
(
auto
cit
=
mainGame
->
dField
.
hand
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
hand
[
player
].
end
();
++
cit
)
bool
flip
=
false
;
if
((
*
cit
)
->
code
)
{
for
(
auto
cit
=
mainGame
->
dField
.
hand
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
hand
[
player
].
end
();
++
cit
)
(
*
cit
)
->
dPos
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
if
((
*
cit
)
->
code
)
{
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
1.322
f
/
5
,
3.1415926
f
/
5
,
0
);
(
*
cit
)
->
dPos
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
(
*
cit
)
->
is_moving
=
true
;
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
1.322
f
/
5
,
3.1415926
f
/
5
,
0
);
(
*
cit
)
->
is_hovered
=
false
;
(
*
cit
)
->
is_moving
=
true
;
(
*
cit
)
->
aniFrame
=
5
;
(
*
cit
)
->
is_hovered
=
false
;
flip
=
true
;
(
*
cit
)
->
aniFrame
=
5
;
}
flip
=
true
;
if
(
flip
)
}
mainGame
->
WaitFrameSignal
(
5
);
if
(
flip
)
}
mainGame
->
WaitFrameSignal
(
5
);
for
(
auto
cit
=
mainGame
->
dField
.
hand
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
hand
[
player
].
end
();
++
cit
)
{
}
(
*
cit
)
->
dPos
=
irr
::
core
::
vector3df
((
3.9
f
-
(
*
cit
)
->
curPos
.
X
)
/
5
,
0
,
0
);
for
(
auto
cit
=
mainGame
->
dField
.
hand
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
hand
[
player
].
end
();
++
cit
)
{
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
(
*
cit
)
->
dPos
=
irr
::
core
::
vector3df
((
3.9
f
-
(
*
cit
)
->
curPos
.
X
)
/
5
,
0
,
0
);
(
*
cit
)
->
is_moving
=
true
;
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
(
*
cit
)
->
is_hovered
=
false
;
(
*
cit
)
->
is_moving
=
true
;
(
*
cit
)
->
aniFrame
=
5
;
(
*
cit
)
->
is_hovered
=
false
;
(
*
cit
)
->
aniFrame
=
5
;
}
mainGame
->
WaitFrameSignal
(
11
);
}
}
mainGame
->
WaitFrameSignal
(
11
);
for
(
auto
cit
=
mainGame
->
dField
.
hand
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
hand
[
player
].
end
();
++
cit
)
for
(
auto
cit
=
mainGame
->
dField
.
hand
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
hand
[
player
].
end
();
++
cit
)
(
*
cit
)
->
SetCode
(
BufferIO
::
ReadInt32
(
pbuf
));
(
*
cit
)
->
SetCode
(
BufferIO
::
ReadInt32
(
pbuf
));
for
(
auto
cit
=
mainGame
->
dField
.
hand
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
hand
[
player
].
end
();
++
cit
)
{
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
(
*
cit
)
->
is_hovered
=
false
;
for
(
auto
cit
=
mainGame
->
dField
.
hand
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
hand
[
player
].
end
();
++
cit
)
{
mainGame
->
dField
.
MoveCard
(
*
cit
,
5
);
(
*
cit
)
->
is_hovered
=
false
;
mainGame
->
dField
.
MoveCard
(
*
cit
,
5
);
}
mainGame
->
WaitFrameSignal
(
5
);
}
}
mainGame
->
WaitFrameSignal
(
5
);
return
true
;
return
true
;
}
}
case
MSG_REFRESH_DECK
:
{
case
MSG_REFRESH_DECK
:
{
...
@@ -1605,27 +1628,36 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1605,27 +1628,36 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
case
MSG_SWAP_GRAVE_DECK
:
{
case
MSG_SWAP_GRAVE_DECK
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
std
::
vector
<
ClientCard
*>::
iterator
cit
;
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
gMutex
.
Lock
();
mainGame
->
dField
.
grave
[
player
].
swap
(
mainGame
->
dField
.
deck
[
player
]);
mainGame
->
dField
.
grave
[
player
].
swap
(
mainGame
->
dField
.
deck
[
player
]);
for
(
auto
cit
=
mainGame
->
dField
.
grave
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
grave
[
player
].
end
();
++
cit
)
for
(
cit
=
mainGame
->
dField
.
grave
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
grave
[
player
].
end
();
++
cit
)
{
(
*
cit
)
->
location
=
LOCATION_GRAVE
;
(
*
cit
)
->
location
=
LOCATION_GRAVE
;
for
(
auto
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
mainGame
->
dField
.
MoveCard
(
*
cit
,
10
);
(
*
cit
)
->
location
=
LOCATION_DECK
;
}
}
else
{
for
(
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
{
mainGame
->
gMutex
.
Lock
();
(
*
cit
)
->
location
=
LOCATION_DECK
;
mainGame
->
dField
.
grave
[
player
].
swap
(
mainGame
->
dField
.
deck
[
player
]);
mainGame
->
dField
.
MoveCard
(
*
cit
,
10
);
for
(
auto
cit
=
mainGame
->
dField
.
grave
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
grave
[
player
].
end
();
++
cit
)
{
(
*
cit
)
->
location
=
LOCATION_GRAVE
;
mainGame
->
dField
.
MoveCard
(
*
cit
,
10
);
}
for
(
auto
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
{
(
*
cit
)
->
location
=
LOCATION_DECK
;
mainGame
->
dField
.
MoveCard
(
*
cit
,
10
);
}
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
11
);
}
}
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
11
);
return
true
;
return
true
;
}
}
case
MSG_REVERSE_DECK
:
{
case
MSG_REVERSE_DECK
:
{
mainGame
->
dField
.
deck_reversed
=
!
mainGame
->
dField
.
deck_reversed
;
mainGame
->
dField
.
deck_reversed
=
!
mainGame
->
dField
.
deck_reversed
;
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
deck
[
0
].
size
();
++
i
)
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
deck
[
0
][
i
],
10
);
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
deck
[
0
].
size
();
++
i
)
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
deck
[
1
].
size
();
++
i
)
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
deck
[
0
][
i
],
10
);
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
deck
[
1
][
i
],
10
);
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
deck
[
1
].
size
();
++
i
)
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
deck
[
1
][
i
],
10
);
}
return
true
;
return
true
;
}
}
case
MSG_DECK_TOP
:
{
case
MSG_DECK_TOP
:
{
...
@@ -1648,12 +1680,15 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1648,12 +1680,15 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
mc
[
i
]
=
mainGame
->
dField
.
mzone
[
c
][
s
];
mc
[
i
]
=
mainGame
->
dField
.
mzone
[
c
][
s
];
mc
[
i
]
->
SetCode
(
0
);
mc
[
i
]
->
SetCode
(
0
);
mc
[
i
]
->
dPos
=
irr
::
core
::
vector3df
((
3.95
f
-
mc
[
i
]
->
curPos
.
X
)
/
10
,
0
,
0.05
f
);
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
mc
[
i
]
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
mc
[
i
]
->
dPos
=
irr
::
core
::
vector3df
((
3.95
f
-
mc
[
i
]
->
curPos
.
X
)
/
10
,
0
,
0.05
f
);
mc
[
i
]
->
is_moving
=
true
;
mc
[
i
]
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
mc
[
i
]
->
aniFrame
=
10
;
mc
[
i
]
->
is_moving
=
true
;
mc
[
i
]
->
aniFrame
=
10
;
}
}
}
mainGame
->
WaitFrameSignal
(
20
);
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
mainGame
->
WaitFrameSignal
(
20
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
l
=
BufferIO
::
ReadInt8
(
pbuf
);
l
=
BufferIO
::
ReadInt8
(
pbuf
);
...
@@ -1668,12 +1703,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1668,12 +1703,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
swp
->
sequence
=
ps
;
swp
->
sequence
=
ps
;
}
}
}
}
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dField
.
MoveCard
(
mc
[
i
],
10
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
for
(
cit
=
mc
[
i
]
->
overlayed
.
begin
();
cit
!=
mc
[
i
]
->
overlayed
.
end
();
++
cit
)
mainGame
->
dField
.
MoveCard
(
mc
[
i
],
10
);
mainGame
->
dField
.
MoveCard
(
*
cit
,
10
);
for
(
cit
=
mc
[
i
]
->
overlayed
.
begin
();
cit
!=
mc
[
i
]
->
overlayed
.
end
();
++
cit
)
mainGame
->
dField
.
MoveCard
(
*
cit
,
10
);
}
mainGame
->
WaitFrameSignal
(
11
);
}
}
mainGame
->
WaitFrameSignal
(
11
);
return
true
;
return
true
;
}
}
case
MSG_NEW_TURN
:
{
case
MSG_NEW_TURN
:
{
...
@@ -1689,25 +1726,25 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1689,25 +1726,25 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
else
else
mainGame
->
dInfo
.
tag_player
[
1
]
=
!
mainGame
->
dInfo
.
tag_player
[
1
];
mainGame
->
dInfo
.
tag_player
[
1
]
=
!
mainGame
->
dInfo
.
tag_player
[
1
];
}
}
myswprintf
(
mainGame
->
dInfo
.
strTurn
,
L"Turn:%d"
,
mainGame
->
dInfo
.
turn
);
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
showcardcode
=
10
;
myswprintf
(
mainGame
->
dInfo
.
strTurn
,
L"Turn:%d"
,
mainGame
->
dInfo
.
turn
);
mainGame
->
showcarddif
=
30
;
mainGame
->
showcardcode
=
10
;
mainGame
->
showcardp
=
0
;
mainGame
->
showcarddif
=
30
;
mainGame
->
showcard
=
101
;
mainGame
->
showcardp
=
0
;
mainGame
->
WaitFrameSignal
(
40
);
mainGame
->
showcard
=
101
;
mainGame
->
showcard
=
0
;
mainGame
->
WaitFrameSignal
(
40
);
mainGame
->
showcard
=
0
;
}
return
true
;
return
true
;
}
}
case
MSG_NEW_PHASE
:
{
case
MSG_NEW_PHASE
:
{
int
phase
=
(
unsigned
char
)
BufferIO
::
ReadInt8
(
pbuf
);
int
phase
=
(
unsigned
char
)
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
btnDP
->
setVisible
(
false
);
mainGame
->
btnDP
->
setVisible
(
false
);
mainGame
->
btnSP
->
setVisible
(
false
);
mainGame
->
btnSP
->
setVisible
(
false
);
mainGame
->
btnM1
->
setVisible
(
false
);
mainGame
->
btnM1
->
setVisible
(
false
);
mainGame
->
btnBP
->
setVisible
(
false
);
mainGame
->
btnBP
->
setVisible
(
false
);
mainGame
->
btnM2
->
setVisible
(
false
);
mainGame
->
btnM2
->
setVisible
(
false
);
mainGame
->
btnEP
->
setVisible
(
false
);
mainGame
->
btnEP
->
setVisible
(
false
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
showcarddif
=
30
;
mainGame
->
showcarddif
=
30
;
mainGame
->
showcardp
=
0
;
mainGame
->
showcardp
=
0
;
switch
(
phase
)
{
switch
(
phase
)
{
...
@@ -1742,9 +1779,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1742,9 +1779,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
showcardcode
=
9
;
mainGame
->
showcardcode
=
9
;
break
;
break
;
}
}
mainGame
->
showcard
=
101
;
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
WaitFrameSignal
(
40
);
mainGame
->
showcard
=
101
;
mainGame
->
showcard
=
0
;
mainGame
->
WaitFrameSignal
(
40
);
mainGame
->
showcard
=
0
;
}
return
true
;
return
true
;
}
}
case
MSG_MOVE
:
{
case
MSG_MOVE
:
{
...
@@ -1762,15 +1801,18 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1762,15 +1801,18 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
ClientCard
*
pcard
=
new
ClientCard
();
ClientCard
*
pcard
=
new
ClientCard
();
pcard
->
position
=
cp
;
pcard
->
position
=
cp
;
pcard
->
SetCode
(
code
);
pcard
->
SetCode
(
code
);
mainGame
->
gMutex
.
Lock
();
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dField
.
AddCard
(
pcard
,
cc
,
cl
,
cs
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Unlock
();
mainGame
->
dField
.
AddCard
(
pcard
,
cc
,
cl
,
cs
);
mainGame
->
dField
.
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
);
mainGame
->
gMutex
.
Unlock
();
pcard
->
mTransform
.
setTranslation
(
pcard
->
curPos
);
mainGame
->
dField
.
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
);
pcard
->
mTransform
.
setRotationRadians
(
pcard
->
curRot
);
pcard
->
mTransform
.
setTranslation
(
pcard
->
curPos
);
pcard
->
curAlpha
=
5
;
pcard
->
mTransform
.
setRotationRadians
(
pcard
->
curRot
);
mainGame
->
dField
.
FadeCard
(
pcard
,
255
,
20
);
pcard
->
curAlpha
=
5
;
mainGame
->
WaitFrameSignal
(
20
);
mainGame
->
dField
.
FadeCard
(
pcard
,
255
,
20
);
mainGame
->
WaitFrameSignal
(
20
);
}
else
mainGame
->
dField
.
AddCard
(
pcard
,
cc
,
cl
,
cs
);
}
else
if
(
cl
==
0
)
{
}
else
if
(
cl
==
0
)
{
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
pc
,
pl
,
ps
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
pc
,
pl
,
ps
);
if
(
code
!=
0
&&
pcard
->
code
!=
code
)
if
(
code
!=
0
&&
pcard
->
code
!=
code
)
...
@@ -1778,13 +1820,15 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1778,13 +1820,15 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard
->
ClearTarget
();
pcard
->
ClearTarget
();
for
(
auto
eqit
=
pcard
->
equipped
.
begin
();
eqit
!=
pcard
->
equipped
.
end
();
++
eqit
)
for
(
auto
eqit
=
pcard
->
equipped
.
begin
();
eqit
!=
pcard
->
equipped
.
end
();
++
eqit
)
(
*
eqit
)
->
equipTarget
=
0
;
(
*
eqit
)
->
equipTarget
=
0
;
mainGame
->
dField
.
FadeCard
(
pcard
,
5
,
20
);
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
WaitFrameSignal
(
20
);
mainGame
->
dField
.
FadeCard
(
pcard
,
5
,
20
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
WaitFrameSignal
(
20
);
mainGame
->
dField
.
RemoveCard
(
pc
,
pl
,
ps
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Unlock
();
mainGame
->
dField
.
RemoveCard
(
pc
,
pl
,
ps
);
if
(
pcard
==
mainGame
->
dField
.
hovered_card
)
mainGame
->
gMutex
.
Unlock
();
mainGame
->
dField
.
hovered_card
=
0
;
if
(
pcard
==
mainGame
->
dField
.
hovered_card
)
mainGame
->
dField
.
hovered_card
=
0
;
}
delete
pcard
;
delete
pcard
;
}
else
{
}
else
{
if
(
!
(
pl
&
0x80
)
&&
!
(
cl
&
0x80
))
{
if
(
!
(
pl
&
0x80
)
&&
!
(
cl
&
0x80
))
{
...
@@ -1805,42 +1849,48 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1805,42 +1849,48 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
pcard
->
is_showequip
=
false
;
pcard
->
is_showequip
=
false
;
pcard
->
is_showtarget
=
false
;
pcard
->
is_showtarget
=
false
;
mainGame
->
gMutex
.
Lock
();
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dField
.
RemoveCard
(
pc
,
pl
,
ps
);
mainGame
->
dField
.
RemoveCard
(
pc
,
pl
,
ps
);
pcard
->
position
=
cp
;
pcard
->
position
=
cp
;
mainGame
->
dField
.
AddCard
(
pcard
,
cc
,
cl
,
cs
);
mainGame
->
dField
.
AddCard
(
pcard
,
cc
,
cl
,
cs
);
mainGame
->
gMutex
.
Unlock
();
if
(
pl
==
cl
&&
pc
==
cc
&&
(
cl
&
0x71
))
{
pcard
->
dPos
=
irr
::
core
::
vector3df
(
-
0.3
f
,
0
,
0
);
pcard
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
if
(
pc
==
1
)
pcard
->
dPos
.
X
=
0.3
f
;
pcard
->
is_moving
=
true
;
pcard
->
aniFrame
=
5
;
mainGame
->
WaitFrameSignal
(
5
);
mainGame
->
dField
.
MoveCard
(
pcard
,
5
);
mainGame
->
WaitFrameSignal
(
5
);
}
else
{
}
else
{
if
(
cl
==
0x4
&&
pcard
->
overlayed
.
size
()
>
0
)
{
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
dField
.
RemoveCard
(
pc
,
pl
,
ps
);
for
(
int
i
=
0
;
i
<
pcard
->
overlayed
.
size
();
++
i
)
pcard
->
position
=
cp
;
mainGame
->
dField
.
MoveCard
(
pcard
->
overlayed
[
i
],
10
);
mainGame
->
dField
.
AddCard
(
pcard
,
cc
,
cl
,
cs
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
gMutex
.
Unlock
();
if
(
pl
==
cl
&&
pc
==
cc
&&
(
cl
&
0x71
))
{
pcard
->
dPos
=
irr
::
core
::
vector3df
(
-
0.3
f
,
0
,
0
);
pcard
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
if
(
pc
==
1
)
pcard
->
dPos
.
X
=
0.3
f
;
pcard
->
is_moving
=
true
;
pcard
->
aniFrame
=
5
;
mainGame
->
WaitFrameSignal
(
5
);
mainGame
->
dField
.
MoveCard
(
pcard
,
5
);
mainGame
->
WaitFrameSignal
(
5
);
mainGame
->
WaitFrameSignal
(
5
);
}
if
(
cl
==
0x2
)
{
mainGame
->
gMutex
.
Lock
();
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
hand
[
cc
].
size
();
++
i
)
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
hand
[
cc
][
i
],
10
);
mainGame
->
gMutex
.
Unlock
();
}
else
{
}
else
{
mainGame
->
gMutex
.
Lock
();
if
(
cl
==
0x4
&&
pcard
->
overlayed
.
size
()
>
0
)
{
mainGame
->
dField
.
MoveCard
(
pcard
,
10
);
mainGame
->
gMutex
.
Lock
();
if
(
pl
==
0x2
)
for
(
int
i
=
0
;
i
<
pcard
->
overlayed
.
size
();
++
i
)
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
hand
[
pc
].
size
();
++
i
)
mainGame
->
dField
.
MoveCard
(
pcard
->
overlayed
[
i
],
10
);
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
hand
[
pc
][
i
],
10
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
5
);
}
if
(
cl
==
0x2
)
{
mainGame
->
gMutex
.
Lock
();
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
hand
[
cc
].
size
();
++
i
)
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
hand
[
cc
][
i
],
10
);
mainGame
->
gMutex
.
Unlock
();
}
else
{
mainGame
->
gMutex
.
Lock
();
mainGame
->
dField
.
MoveCard
(
pcard
,
10
);
if
(
pl
==
0x2
)
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
hand
[
pc
].
size
();
++
i
)
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
hand
[
pc
][
i
],
10
);
mainGame
->
gMutex
.
Unlock
();
}
mainGame
->
WaitFrameSignal
(
5
);
}
}
mainGame
->
WaitFrameSignal
(
5
);
}
}
}
else
if
(
!
(
pl
&
0x80
))
{
}
else
if
(
!
(
pl
&
0x80
))
{
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
pc
,
pl
,
ps
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
pc
,
pl
,
ps
);
...
@@ -1849,59 +1899,89 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1849,59 +1899,89 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard
->
counters
.
clear
();
pcard
->
counters
.
clear
();
pcard
->
ClearTarget
();
pcard
->
ClearTarget
();
ClientCard
*
olcard
=
mainGame
->
dField
.
GetCard
(
cc
,
cl
&
0x7f
,
cs
);
ClientCard
*
olcard
=
mainGame
->
dField
.
GetCard
(
cc
,
cl
&
0x7f
,
cs
);
mainGame
->
gMutex
.
Lock
();
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dField
.
RemoveCard
(
pc
,
pl
,
ps
);
mainGame
->
dField
.
RemoveCard
(
pc
,
pl
,
ps
);
olcard
->
overlayed
.
push_back
(
pcard
);
olcard
->
overlayed
.
push_back
(
pcard
);
mainGame
->
dField
.
overlay_cards
.
insert
(
pcard
);
mainGame
->
dField
.
overlay_cards
.
insert
(
pcard
);
mainGame
->
gMutex
.
Unlock
();
pcard
->
overlayTarget
=
olcard
;
pcard
->
overlayTarget
=
olcard
;
pcard
->
location
=
0x80
;
pcard
->
location
=
0x80
;
pcard
->
sequence
=
olcard
->
overlayed
.
size
()
-
1
;
pcard
->
sequence
=
olcard
->
overlayed
.
size
()
-
1
;
}
else
{
if
(
olcard
->
location
==
0x4
)
{
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
dField
.
MoveCard
(
pcard
,
10
);
mainGame
->
dField
.
RemoveCard
(
pc
,
pl
,
ps
);
if
(
pl
==
0x2
)
olcard
->
overlayed
.
push_back
(
pcard
);
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
hand
[
pc
].
size
();
++
i
)
mainGame
->
dField
.
overlay_cards
.
insert
(
pcard
);
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
hand
[
pc
][
i
],
10
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
5
);
pcard
->
overlayTarget
=
olcard
;
pcard
->
location
=
0x80
;
pcard
->
sequence
=
olcard
->
overlayed
.
size
()
-
1
;
if
(
olcard
->
location
==
0x4
)
{
mainGame
->
gMutex
.
Lock
();
mainGame
->
dField
.
MoveCard
(
pcard
,
10
);
if
(
pl
==
0x2
)
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
hand
[
pc
].
size
();
++
i
)
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
hand
[
pc
][
i
],
10
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
5
);
}
}
}
}
else
if
(
!
(
cl
&
0x80
))
{
}
else
if
(
!
(
cl
&
0x80
))
{
ClientCard
*
olcard
=
mainGame
->
dField
.
GetCard
(
pc
,
pl
&
0x7f
,
ps
);
ClientCard
*
olcard
=
mainGame
->
dField
.
GetCard
(
pc
,
pl
&
0x7f
,
ps
);
ClientCard
*
pcard
=
olcard
->
overlayed
[
pp
];
ClientCard
*
pcard
=
olcard
->
overlayed
[
pp
];
mainGame
->
gMutex
.
Lock
();
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
olcard
->
overlayed
.
erase
(
olcard
->
overlayed
.
begin
()
+
pcard
->
sequence
);
olcard
->
overlayed
.
erase
(
olcard
->
overlayed
.
begin
()
+
pcard
->
sequence
);
pcard
->
overlayTarget
=
0
;
pcard
->
overlayTarget
=
0
;
pcard
->
position
=
cp
;
pcard
->
position
=
cp
;
mainGame
->
dField
.
AddCard
(
pcard
,
cc
,
cl
,
cs
);
mainGame
->
dField
.
AddCard
(
pcard
,
cc
,
cl
,
cs
);
mainGame
->
dField
.
overlay_cards
.
erase
(
pcard
);
mainGame
->
dField
.
overlay_cards
.
erase
(
pcard
);
for
(
int
i
=
0
;
i
<
olcard
->
overlayed
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
olcard
->
overlayed
.
size
();
++
i
)
olcard
->
overlayed
[
i
]
->
sequence
=
i
;
olcard
->
overlayed
[
i
]
->
sequence
=
i
;
mainGame
->
dField
.
MoveCard
(
olcard
->
overlayed
[
i
],
2
);
}
else
{
mainGame
->
gMutex
.
Lock
();
olcard
->
overlayed
.
erase
(
olcard
->
overlayed
.
begin
()
+
pcard
->
sequence
);
pcard
->
overlayTarget
=
0
;
pcard
->
position
=
cp
;
mainGame
->
dField
.
AddCard
(
pcard
,
cc
,
cl
,
cs
);
mainGame
->
dField
.
overlay_cards
.
erase
(
pcard
);
for
(
int
i
=
0
;
i
<
olcard
->
overlayed
.
size
();
++
i
)
{
olcard
->
overlayed
[
i
]
->
sequence
=
i
;
mainGame
->
dField
.
MoveCard
(
olcard
->
overlayed
[
i
],
2
);
}
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
5
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
dField
.
MoveCard
(
pcard
,
10
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
5
);
}
}
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
5
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
dField
.
MoveCard
(
pcard
,
10
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
5
);
}
else
{
}
else
{
ClientCard
*
olcard1
=
mainGame
->
dField
.
GetCard
(
pc
,
pl
&
0x7f
,
ps
);
ClientCard
*
olcard1
=
mainGame
->
dField
.
GetCard
(
pc
,
pl
&
0x7f
,
ps
);
ClientCard
*
pcard
=
olcard1
->
overlayed
[
pp
];
ClientCard
*
pcard
=
olcard1
->
overlayed
[
pp
];
ClientCard
*
olcard2
=
mainGame
->
dField
.
GetCard
(
cc
,
cl
&
0x7f
,
cs
);
ClientCard
*
olcard2
=
mainGame
->
dField
.
GetCard
(
cc
,
cl
&
0x7f
,
cs
);
mainGame
->
gMutex
.
Lock
();
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
olcard1
->
overlayed
.
erase
(
olcard1
->
overlayed
.
begin
()
+
pcard
->
sequence
);
olcard1
->
overlayed
.
erase
(
olcard1
->
overlayed
.
begin
()
+
pcard
->
sequence
);
olcard2
->
overlayed
.
push_back
(
pcard
);
olcard2
->
overlayed
.
push_back
(
pcard
);
pcard
->
sequence
=
olcard2
->
overlayed
.
size
()
-
1
;
pcard
->
sequence
=
olcard2
->
overlayed
.
size
()
-
1
;
pcard
->
location
=
0x80
;
pcard
->
location
=
0x80
;
pcard
->
overlayTarget
=
olcard2
;
pcard
->
overlayTarget
=
olcard2
;
for
(
int
i
=
0
;
i
<
olcard1
->
overlayed
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
olcard1
->
overlayed
.
size
();
++
i
)
{
olcard1
->
overlayed
[
i
]
->
sequence
=
i
;
olcard1
->
overlayed
[
i
]
->
sequence
=
i
;
mainGame
->
dField
.
MoveCard
(
olcard1
->
overlayed
[
i
],
2
);
}
}
else
{
mainGame
->
gMutex
.
Lock
();
olcard1
->
overlayed
.
erase
(
olcard1
->
overlayed
.
begin
()
+
pcard
->
sequence
);
olcard2
->
overlayed
.
push_back
(
pcard
);
pcard
->
sequence
=
olcard2
->
overlayed
.
size
()
-
1
;
pcard
->
location
=
0x80
;
pcard
->
overlayTarget
=
olcard2
;
for
(
int
i
=
0
;
i
<
olcard1
->
overlayed
.
size
();
++
i
)
{
olcard1
->
overlayed
[
i
]
->
sequence
=
i
;
mainGame
->
dField
.
MoveCard
(
olcard1
->
overlayed
[
i
],
2
);
}
mainGame
->
dField
.
MoveCard
(
pcard
,
10
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
5
);
}
}
mainGame
->
dField
.
MoveCard
(
pcard
,
10
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
5
);
}
}
}
}
return
true
;
return
true
;
...
@@ -1921,9 +2001,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1921,9 +2001,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if
(
code
!=
0
&&
pcard
->
code
!=
code
)
if
(
code
!=
0
&&
pcard
->
code
!=
code
)
pcard
->
SetCode
(
code
);
pcard
->
SetCode
(
code
);
pcard
->
position
=
cp
;
pcard
->
position
=
cp
;
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1600
));
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dField
.
MoveCard
(
pcard
,
10
);
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1600
));
mainGame
->
WaitFrameSignal
(
11
);
mainGame
->
dField
.
MoveCard
(
pcard
,
10
);
mainGame
->
WaitFrameSignal
(
11
);
}
return
true
;
return
true
;
}
}
case
MSG_SET
:
{
case
MSG_SET
:
{
...
@@ -1949,19 +2031,26 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1949,19 +2031,26 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1602
));
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1602
));
ClientCard
*
pc1
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
ClientCard
*
pc1
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
ClientCard
*
pc2
=
mainGame
->
dField
.
GetCard
(
c2
,
l2
,
s2
);
ClientCard
*
pc2
=
mainGame
->
dField
.
GetCard
(
c2
,
l2
,
s2
);
mainGame
->
gMutex
.
Lock
();
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dField
.
RemoveCard
(
c1
,
l1
,
s1
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
dField
.
RemoveCard
(
c2
,
l2
,
s2
);
mainGame
->
dField
.
RemoveCard
(
c1
,
l1
,
s1
);
mainGame
->
dField
.
AddCard
(
pc1
,
c2
,
l2
,
s2
);
mainGame
->
dField
.
RemoveCard
(
c2
,
l2
,
s2
);
mainGame
->
dField
.
AddCard
(
pc2
,
c1
,
l1
,
s1
);
mainGame
->
dField
.
AddCard
(
pc1
,
c2
,
l2
,
s2
);
mainGame
->
dField
.
MoveCard
(
pc1
,
10
);
mainGame
->
dField
.
AddCard
(
pc2
,
c1
,
l1
,
s1
);
mainGame
->
dField
.
MoveCard
(
pc2
,
10
);
mainGame
->
dField
.
MoveCard
(
pc1
,
10
);
for
(
int
i
=
0
;
i
<
pc1
->
overlayed
.
size
();
++
i
)
mainGame
->
dField
.
MoveCard
(
pc2
,
10
);
mainGame
->
dField
.
MoveCard
(
pc1
->
overlayed
[
i
],
10
);
for
(
int
i
=
0
;
i
<
pc1
->
overlayed
.
size
();
++
i
)
for
(
int
i
=
0
;
i
<
pc2
->
overlayed
.
size
();
++
i
)
mainGame
->
dField
.
MoveCard
(
pc1
->
overlayed
[
i
],
10
);
mainGame
->
dField
.
MoveCard
(
pc2
->
overlayed
[
i
],
10
);
for
(
int
i
=
0
;
i
<
pc2
->
overlayed
.
size
();
++
i
)
mainGame
->
gMutex
.
Unlock
();
mainGame
->
dField
.
MoveCard
(
pc2
->
overlayed
[
i
],
10
);
mainGame
->
WaitFrameSignal
(
11
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
11
);
}
else
{
mainGame
->
dField
.
RemoveCard
(
c1
,
l1
,
s1
);
mainGame
->
dField
.
RemoveCard
(
c2
,
l2
,
s2
);
mainGame
->
dField
.
AddCard
(
pc1
,
c2
,
l2
,
s2
);
mainGame
->
dField
.
AddCard
(
pc2
,
c1
,
l1
,
s1
);
}
return
true
;
return
true
;
}
}
case
MSG_FIELD_DISABLED
:
{
case
MSG_FIELD_DISABLED
:
{
...
@@ -1977,14 +2066,16 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1977,14 +2066,16 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
cl
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cl
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cp
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cp
=
BufferIO
::
ReadInt8
(
pbuf
);
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1603
),
dataManager
.
GetName
(
code
));
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
showcardcode
=
code
;
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1603
),
dataManager
.
GetName
(
code
));
mainGame
->
showcarddif
=
0
;
mainGame
->
showcardcode
=
code
;
mainGame
->
showcardp
=
0
;
mainGame
->
showcarddif
=
0
;
mainGame
->
showcard
=
7
;
mainGame
->
showcardp
=
0
;
mainGame
->
WaitFrameSignal
(
30
);
mainGame
->
showcard
=
7
;
mainGame
->
showcard
=
0
;
mainGame
->
WaitFrameSignal
(
30
);
mainGame
->
WaitFrameSignal
(
11
);
mainGame
->
showcard
=
0
;
mainGame
->
WaitFrameSignal
(
11
);
}
return
true
;
return
true
;
}
}
case
MSG_SUMMONED
:
{
case
MSG_SUMMONED
:
{
...
@@ -1997,13 +2088,15 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1997,13 +2088,15 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
cl
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cl
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cp
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cp
=
BufferIO
::
ReadInt8
(
pbuf
);
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1605
),
dataManager
.
GetName
(
code
));
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
showcardcode
=
code
;
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1605
),
dataManager
.
GetName
(
code
));
mainGame
->
showcarddif
=
1
;
mainGame
->
showcardcode
=
code
;
mainGame
->
showcard
=
5
;
mainGame
->
showcarddif
=
1
;
mainGame
->
WaitFrameSignal
(
30
);
mainGame
->
showcard
=
5
;
mainGame
->
showcard
=
0
;
mainGame
->
WaitFrameSignal
(
30
);
mainGame
->
WaitFrameSignal
(
11
);
mainGame
->
showcard
=
0
;
mainGame
->
WaitFrameSignal
(
11
);
}
return
true
;
return
true
;
}
}
case
MSG_SPSUMMONED
:
{
case
MSG_SPSUMMONED
:
{
...
@@ -2019,16 +2112,18 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2019,16 +2112,18 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
cc
,
cl
,
cs
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
cc
,
cl
,
cs
);
pcard
->
SetCode
(
code
);
pcard
->
SetCode
(
code
);
pcard
->
position
=
cp
;
pcard
->
position
=
cp
;
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1607
),
dataManager
.
GetName
(
code
));
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dField
.
MoveCard
(
pcard
,
10
);
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1607
),
dataManager
.
GetName
(
code
));
mainGame
->
WaitFrameSignal
(
11
);
mainGame
->
dField
.
MoveCard
(
pcard
,
10
);
mainGame
->
showcardcode
=
code
;
mainGame
->
WaitFrameSignal
(
11
);
mainGame
->
showcarddif
=
0
;
mainGame
->
showcardcode
=
code
;
mainGame
->
showcardp
=
0
;
mainGame
->
showcarddif
=
0
;
mainGame
->
showcard
=
7
;
mainGame
->
showcardp
=
0
;
mainGame
->
WaitFrameSignal
(
30
);
mainGame
->
showcard
=
7
;
mainGame
->
showcard
=
0
;
mainGame
->
WaitFrameSignal
(
30
);
mainGame
->
WaitFrameSignal
(
11
);
mainGame
->
showcard
=
0
;
mainGame
->
WaitFrameSignal
(
11
);
}
return
true
;
return
true
;
}
}
case
MSG_FLIPSUMMONED
:
{
case
MSG_FLIPSUMMONED
:
{
...
@@ -2040,13 +2135,15 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2040,13 +2135,15 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
pcc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
pcc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
pcl
=
BufferIO
::
ReadInt8
(
pbuf
);
int
pcl
=
BufferIO
::
ReadInt8
(
pbuf
);
int
pcs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
pcs
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
int
subs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
cl
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cl
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
int
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
int
ct
=
BufferIO
::
ReadInt8
(
pbuf
);
int
ct
=
BufferIO
::
ReadInt8
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
pcc
,
pcl
,
pcs
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
pcc
,
pcl
,
pcs
,
subs
);
mainGame
->
showcardcode
=
code
;
mainGame
->
showcardcode
=
code
;
mainGame
->
showcarddif
=
0
;
mainGame
->
showcarddif
=
0
;
mainGame
->
showcard
=
1
;
mainGame
->
showcard
=
1
;
...
@@ -2079,6 +2176,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2079,6 +2176,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
case
MSG_CHAINED
:
{
case
MSG_CHAINED
:
{
int
ct
=
BufferIO
::
ReadInt8
(
pbuf
);
int
ct
=
BufferIO
::
ReadInt8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1609
),
dataManager
.
GetName
(
mainGame
->
dField
.
current_chain
.
code
));
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1609
),
dataManager
.
GetName
(
mainGame
->
dField
.
current_chain
.
code
));
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
dField
.
chains
.
push_back
(
mainGame
->
dField
.
current_chain
);
mainGame
->
dField
.
chains
.
push_back
(
mainGame
->
dField
.
current_chain
);
...
@@ -2090,6 +2189,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2090,6 +2189,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
case
MSG_CHAIN_SOLVING
:
{
case
MSG_CHAIN_SOLVING
:
{
int
ct
=
BufferIO
::
ReadInt8
(
pbuf
);
int
ct
=
BufferIO
::
ReadInt8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
if
(
mainGame
->
dField
.
chains
.
size
()
>
1
)
{
if
(
mainGame
->
dField
.
chains
.
size
()
>
1
)
{
if
(
mainGame
->
dField
.
last_chain
)
if
(
mainGame
->
dField
.
last_chain
)
mainGame
->
WaitFrameSignal
(
11
);
mainGame
->
WaitFrameSignal
(
11
);
...
@@ -2114,11 +2215,13 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2114,11 +2215,13 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case
MSG_CHAIN_NEGATED
:
case
MSG_CHAIN_NEGATED
:
case
MSG_CHAIN_DISABLED
:
{
case
MSG_CHAIN_DISABLED
:
{
int
ct
=
BufferIO
::
ReadInt8
(
pbuf
);
int
ct
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
showcardcode
=
mainGame
->
dField
.
chains
[
ct
-
1
].
code
;
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
showcarddif
=
0
;
mainGame
->
showcardcode
=
mainGame
->
dField
.
chains
[
ct
-
1
].
code
;
mainGame
->
showcard
=
3
;
mainGame
->
showcarddif
=
0
;
mainGame
->
WaitFrameSignal
(
30
);
mainGame
->
showcard
=
3
;
mainGame
->
showcard
=
0
;
mainGame
->
WaitFrameSignal
(
30
);
mainGame
->
showcard
=
0
;
}
return
true
;
return
true
;
}
}
case
MSG_CARD_SELECTED
:
{
case
MSG_CARD_SELECTED
:
{
...
@@ -2127,6 +2230,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2127,6 +2230,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case
MSG_RANDOM_SELECTED
:
{
case
MSG_RANDOM_SELECTED
:
{
int
player
=
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
pbuf
+=
count
*
4
;
return
true
;
}
ClientCard
*
pcards
[
10
];
ClientCard
*
pcards
[
10
];
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
...
@@ -2146,6 +2253,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2146,6 +2253,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
case
MSG_BECOME_TARGET
:
{
case
MSG_BECOME_TARGET
:
{
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
pbuf
+=
count
*
4
;
return
true
;
}
ClientCard
*
pcard
;
ClientCard
*
pcard
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
...
@@ -2180,15 +2291,23 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2180,15 +2291,23 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if
(
!
mainGame
->
dField
.
deck_reversed
||
code
)
if
(
!
mainGame
->
dField
.
deck_reversed
||
code
)
pcard
->
SetCode
(
code
);
pcard
->
SetCode
(
code
);
}
}
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
gMutex
.
Lock
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
pcard
=
mainGame
->
dField
.
GetCard
(
player
,
LOCATION_DECK
,
mainGame
->
dField
.
deck
[
player
].
size
()
-
1
);
pcard
=
mainGame
->
dField
.
GetCard
(
player
,
LOCATION_DECK
,
mainGame
->
dField
.
deck
[
player
].
size
()
-
1
);
mainGame
->
dField
.
deck
[
player
].
erase
(
mainGame
->
dField
.
deck
[
player
].
end
()
-
1
);
mainGame
->
dField
.
deck
[
player
].
erase
(
mainGame
->
dField
.
deck
[
player
].
end
()
-
1
);
mainGame
->
dField
.
AddCard
(
pcard
,
player
,
LOCATION_HAND
,
0
);
mainGame
->
dField
.
AddCard
(
pcard
,
player
,
LOCATION_HAND
,
0
);
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
hand
[
player
].
size
();
++
i
)
}
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
hand
[
player
][
i
],
10
);
}
else
{
mainGame
->
gMutex
.
Unlock
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
mainGame
->
WaitFrameSignal
(
5
);
mainGame
->
gMutex
.
Lock
();
pcard
=
mainGame
->
dField
.
GetCard
(
player
,
LOCATION_DECK
,
mainGame
->
dField
.
deck
[
player
].
size
()
-
1
);
mainGame
->
dField
.
deck
[
player
].
erase
(
mainGame
->
dField
.
deck
[
player
].
end
()
-
1
);
mainGame
->
dField
.
AddCard
(
pcard
,
player
,
LOCATION_HAND
,
0
);
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
hand
[
player
].
size
();
++
i
)
mainGame
->
dField
.
MoveCard
(
mainGame
->
dField
.
hand
[
player
][
i
],
10
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
5
);
}
}
}
if
(
player
==
0
)
if
(
player
==
0
)
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1611
),
count
);
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1611
),
count
);
...
@@ -2201,6 +2320,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2201,6 +2320,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
final
=
mainGame
->
dInfo
.
lp
[
player
]
-
val
;
int
final
=
mainGame
->
dInfo
.
lp
[
player
]
-
val
;
if
(
final
<
0
)
if
(
final
<
0
)
final
=
0
;
final
=
0
;
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dInfo
.
lp
[
player
]
=
final
;
myswprintf
(
mainGame
->
dInfo
.
strLP
[
player
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
player
]);
return
true
;
}
mainGame
->
lpd
=
(
mainGame
->
dInfo
.
lp
[
player
]
-
final
)
/
10
;
mainGame
->
lpd
=
(
mainGame
->
dInfo
.
lp
[
player
]
-
final
)
/
10
;
if
(
player
==
0
)
if
(
player
==
0
)
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1613
),
val
);
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1613
),
val
);
...
@@ -2224,6 +2348,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2224,6 +2348,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
val
=
BufferIO
::
ReadInt32
(
pbuf
);
int
val
=
BufferIO
::
ReadInt32
(
pbuf
);
int
final
=
mainGame
->
dInfo
.
lp
[
player
]
+
val
;
int
final
=
mainGame
->
dInfo
.
lp
[
player
]
+
val
;
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dInfo
.
lp
[
player
]
=
final
;
myswprintf
(
mainGame
->
dInfo
.
strLP
[
player
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
player
]);
return
true
;
}
mainGame
->
lpd
=
(
mainGame
->
dInfo
.
lp
[
player
]
-
final
)
/
10
;
mainGame
->
lpd
=
(
mainGame
->
dInfo
.
lp
[
player
]
-
final
)
/
10
;
if
(
player
==
0
)
if
(
player
==
0
)
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1615
),
val
);
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1615
),
val
);
...
@@ -2254,19 +2383,29 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2254,19 +2383,29 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
ClientCard
*
pc1
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
ClientCard
*
pc1
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
ClientCard
*
pc2
=
mainGame
->
dField
.
GetCard
(
c2
,
l2
,
s2
);
ClientCard
*
pc2
=
mainGame
->
dField
.
GetCard
(
c2
,
l2
,
s2
);
mainGame
->
gMutex
.
Lock
();
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
pc1
->
equipTarget
=
pc2
;
pc1
->
equipTarget
=
pc2
;
pc2
->
equipped
.
insert
(
pc1
);
pc2
->
equipped
.
insert
(
pc1
);
if
(
mainGame
->
dField
.
hovered_card
==
pc1
)
}
else
{
pc2
->
is_showequip
=
true
;
mainGame
->
gMutex
.
Lock
();
else
if
(
mainGame
->
dField
.
hovered_card
==
pc2
)
pc1
->
equipTarget
=
pc2
;
pc1
->
is_showequip
=
true
;
pc2
->
equipped
.
insert
(
pc1
);
mainGame
->
gMutex
.
Unlock
();
if
(
mainGame
->
dField
.
hovered_card
==
pc1
)
pc2
->
is_showequip
=
true
;
else
if
(
mainGame
->
dField
.
hovered_card
==
pc2
)
pc1
->
is_showequip
=
true
;
mainGame
->
gMutex
.
Unlock
();
}
return
true
;
return
true
;
}
}
case
MSG_LPUPDATE
:
{
case
MSG_LPUPDATE
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
val
=
BufferIO
::
ReadInt32
(
pbuf
);
int
val
=
BufferIO
::
ReadInt32
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dInfo
.
lp
[
player
]
=
val
;
myswprintf
(
mainGame
->
dInfo
.
strLP
[
player
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
player
]);
return
true
;
}
mainGame
->
lpd
=
(
mainGame
->
dInfo
.
lp
[
player
]
-
val
)
/
10
;
mainGame
->
lpd
=
(
mainGame
->
dInfo
.
lp
[
player
]
-
val
)
/
10
;
mainGame
->
lpplayer
=
player
;
mainGame
->
lpplayer
=
player
;
mainGame
->
lpframe
=
10
;
mainGame
->
lpframe
=
10
;
...
@@ -2283,14 +2422,19 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2283,14 +2422,19 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
s1
=
BufferIO
::
ReadInt8
(
pbuf
);
int
s1
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
ClientCard
*
pc
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
ClientCard
*
pc
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
mainGame
->
gMutex
.
Lock
();
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
if
(
mainGame
->
dField
.
hovered_card
==
pc
)
pc
->
equipTarget
->
equipped
.
erase
(
pc
);
pc
->
equipTarget
->
is_showequip
=
false
;
pc
->
equipTarget
=
0
;
else
if
(
mainGame
->
dField
.
hovered_card
==
pc
->
equipTarget
)
}
else
{
pc
->
is_showequip
=
false
;
mainGame
->
gMutex
.
Lock
();
pc
->
equipTarget
->
equipped
.
erase
(
pc
);
if
(
mainGame
->
dField
.
hovered_card
==
pc
)
pc
->
equipTarget
=
0
;
pc
->
equipTarget
->
is_showequip
=
false
;
mainGame
->
gMutex
.
Unlock
();
else
if
(
mainGame
->
dField
.
hovered_card
==
pc
->
equipTarget
)
pc
->
is_showequip
=
false
;
pc
->
equipTarget
->
equipped
.
erase
(
pc
);
pc
->
equipTarget
=
0
;
mainGame
->
gMutex
.
Unlock
();
}
return
true
;
return
true
;
}
}
case
MSG_CARD_TARGET
:
{
case
MSG_CARD_TARGET
:
{
...
@@ -2304,14 +2448,19 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2304,14 +2448,19 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
ClientCard
*
pc1
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
ClientCard
*
pc1
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
ClientCard
*
pc2
=
mainGame
->
dField
.
GetCard
(
c2
,
l2
,
s2
);
ClientCard
*
pc2
=
mainGame
->
dField
.
GetCard
(
c2
,
l2
,
s2
);
mainGame
->
gMutex
.
Lock
();
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
pc1
->
cardTarget
.
insert
(
pc2
);
pc1
->
cardTarget
.
insert
(
pc2
);
pc2
->
ownerTarget
.
insert
(
pc1
);
pc2
->
ownerTarget
.
insert
(
pc1
);
if
(
mainGame
->
dField
.
hovered_card
==
pc1
)
}
else
{
pc2
->
is_showtarget
=
true
;
mainGame
->
gMutex
.
Lock
();
else
if
(
mainGame
->
dField
.
hovered_card
==
pc2
)
pc1
->
cardTarget
.
insert
(
pc2
);
pc1
->
is_showtarget
=
true
;
pc2
->
ownerTarget
.
insert
(
pc1
);
mainGame
->
gMutex
.
Unlock
();
if
(
mainGame
->
dField
.
hovered_card
==
pc1
)
pc2
->
is_showtarget
=
true
;
else
if
(
mainGame
->
dField
.
hovered_card
==
pc2
)
pc1
->
is_showtarget
=
true
;
mainGame
->
gMutex
.
Unlock
();
}
break
;
break
;
}
}
case
MSG_CANCEL_TARGET
:
{
case
MSG_CANCEL_TARGET
:
{
...
@@ -2325,14 +2474,19 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2325,14 +2474,19 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
ClientCard
*
pc1
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
ClientCard
*
pc1
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
ClientCard
*
pc2
=
mainGame
->
dField
.
GetCard
(
c2
,
l2
,
s2
);
ClientCard
*
pc2
=
mainGame
->
dField
.
GetCard
(
c2
,
l2
,
s2
);
mainGame
->
gMutex
.
Lock
();
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
pc1
->
cardTarget
.
erase
(
pc2
);
pc1
->
cardTarget
.
erase
(
pc2
);
pc2
->
ownerTarget
.
erase
(
pc1
);
pc2
->
ownerTarget
.
erase
(
pc1
);
if
(
mainGame
->
dField
.
hovered_card
==
pc1
)
}
else
{
pc2
->
is_showtarget
=
false
;
mainGame
->
gMutex
.
Lock
();
else
if
(
mainGame
->
dField
.
hovered_card
==
pc2
)
pc1
->
cardTarget
.
erase
(
pc2
);
pc1
->
is_showtarget
=
false
;
pc2
->
ownerTarget
.
erase
(
pc1
);
mainGame
->
gMutex
.
Unlock
();
if
(
mainGame
->
dField
.
hovered_card
==
pc1
)
pc2
->
is_showtarget
=
false
;
else
if
(
mainGame
->
dField
.
hovered_card
==
pc2
)
pc1
->
is_showtarget
=
false
;
mainGame
->
gMutex
.
Unlock
();
}
break
;
break
;
}
}
case
MSG_PAY_LPCOST
:
{
case
MSG_PAY_LPCOST
:
{
...
@@ -2341,6 +2495,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2341,6 +2495,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
final
=
mainGame
->
dInfo
.
lp
[
player
]
-
cost
;
int
final
=
mainGame
->
dInfo
.
lp
[
player
]
-
cost
;
if
(
final
<
0
)
if
(
final
<
0
)
final
=
0
;
final
=
0
;
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dInfo
.
lp
[
player
]
=
final
;
myswprintf
(
mainGame
->
dInfo
.
strLP
[
player
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
player
]);
return
true
;
}
mainGame
->
lpd
=
(
mainGame
->
dInfo
.
lp
[
player
]
-
final
)
/
10
;
mainGame
->
lpd
=
(
mainGame
->
dInfo
.
lp
[
player
]
-
final
)
/
10
;
mainGame
->
lpccolor
=
0xff0000ff
;
mainGame
->
lpccolor
=
0xff0000ff
;
mainGame
->
lpplayer
=
player
;
mainGame
->
lpplayer
=
player
;
...
@@ -2366,6 +2525,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2366,6 +2525,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if
(
pc
->
counters
.
count
(
type
))
if
(
pc
->
counters
.
count
(
type
))
pc
->
counters
[
type
]
+=
count
;
pc
->
counters
[
type
]
+=
count
;
else
pc
->
counters
[
type
]
=
count
;
else
pc
->
counters
[
type
]
=
count
;
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
1617
),
dataManager
.
GetName
(
pc
->
code
),
count
,
dataManager
.
GetCounterName
(
type
));
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
1617
),
dataManager
.
GetName
(
pc
->
code
),
count
,
dataManager
.
GetCounterName
(
type
));
pc
->
is_highlighting
=
true
;
pc
->
is_highlighting
=
true
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
...
@@ -2386,6 +2547,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2386,6 +2547,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pc
->
counters
[
type
]
-=
count
;
pc
->
counters
[
type
]
-=
count
;
if
(
pc
->
counters
[
type
]
<=
0
)
if
(
pc
->
counters
[
type
]
<=
0
)
pc
->
counters
.
erase
(
type
);
pc
->
counters
.
erase
(
type
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
1618
),
dataManager
.
GetName
(
pc
->
code
),
count
,
dataManager
.
GetCounterName
(
type
));
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
1618
),
dataManager
.
GetName
(
pc
->
code
),
count
,
dataManager
.
GetCounterName
(
type
));
pc
->
is_highlighting
=
true
;
pc
->
is_highlighting
=
true
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
...
@@ -2406,6 +2569,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2406,6 +2569,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
ld
=
BufferIO
::
ReadInt8
(
pbuf
);
int
ld
=
BufferIO
::
ReadInt8
(
pbuf
);
int
sd
=
BufferIO
::
ReadInt8
(
pbuf
);
int
sd
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
float
sy
;
float
sy
;
if
(
ld
!=
0
)
{
if
(
ld
!=
0
)
{
mainGame
->
dField
.
attack_target
=
mainGame
->
dField
.
GetCard
(
cd
,
ld
,
sd
);
mainGame
->
dField
.
attack_target
=
mainGame
->
dField
.
GetCard
(
cd
,
ld
,
sd
);
...
@@ -2458,6 +2623,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2458,6 +2623,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
datk
=
BufferIO
::
ReadInt32
(
pbuf
);
int
datk
=
BufferIO
::
ReadInt32
(
pbuf
);
int
ddef
=
BufferIO
::
ReadInt32
(
pbuf
);
int
ddef
=
BufferIO
::
ReadInt32
(
pbuf
);
int
dd
=
BufferIO
::
ReadInt8
(
pbuf
);
int
dd
=
BufferIO
::
ReadInt8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
ca
,
la
,
sa
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
ca
,
la
,
sa
);
if
(
aatk
!=
pcard
->
attack
)
{
if
(
aatk
!=
pcard
->
attack
)
{
...
@@ -2512,6 +2679,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2512,6 +2679,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
*
pwbuf
++
=
L']'
;
*
pwbuf
++
=
L']'
;
}
}
*
pwbuf
=
0
;
*
pwbuf
=
0
;
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
logParam
.
push_back
(
0
);
mainGame
->
logParam
.
push_back
(
0
);
...
@@ -2533,6 +2702,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2533,6 +2702,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
*
pwbuf
++
=
L']'
;
*
pwbuf
++
=
L']'
;
}
}
*
pwbuf
=
0
;
*
pwbuf
=
0
;
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
logParam
.
push_back
(
0
);
mainGame
->
logParam
.
push_back
(
0
);
...
@@ -2630,6 +2801,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2630,6 +2801,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if
(
chtype
==
CHINT_TURN
)
{
if
(
chtype
==
CHINT_TURN
)
{
if
(
value
==
0
)
if
(
value
==
0
)
return
true
;
return
true
;
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
if
(
pcard
->
location
&
LOCATION_ONFIELD
)
if
(
pcard
->
location
&
LOCATION_ONFIELD
)
pcard
->
is_highlighting
=
true
;
pcard
->
is_highlighting
=
true
;
mainGame
->
showcardcode
=
pcard
->
code
;
mainGame
->
showcardcode
=
pcard
->
code
;
...
@@ -2648,30 +2821,33 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2648,30 +2821,33 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
ecount
=
BufferIO
::
ReadInt8
(
pbuf
);
int
ecount
=
BufferIO
::
ReadInt8
(
pbuf
);
int
hcount
=
BufferIO
::
ReadInt8
(
pbuf
);
int
hcount
=
BufferIO
::
ReadInt8
(
pbuf
);
int
topcode
=
BufferIO
::
ReadInt32
(
pbuf
);
int
topcode
=
BufferIO
::
ReadInt32
(
pbuf
);
for
(
auto
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
{
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
if
(
player
==
0
)
(
*
cit
)
->
dPos
.
Y
=
0.4
f
;
for
(
auto
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
{
else
(
*
cit
)
->
dPos
.
Y
=
-
0.6
f
;
if
(
player
==
0
)
(
*
cit
)
->
dPos
.
Y
=
0.4
f
;
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
else
(
*
cit
)
->
dPos
.
Y
=
-
0.6
f
;
(
*
cit
)
->
is_moving
=
true
;
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
(
*
cit
)
->
aniFrame
=
5
;
(
*
cit
)
->
is_moving
=
true
;
}
(
*
cit
)
->
aniFrame
=
5
;
for
(
auto
cit
=
mainGame
->
dField
.
hand
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
hand
[
player
].
end
();
++
cit
)
{
}
if
(
player
==
0
)
(
*
cit
)
->
dPos
.
Y
=
0.4
f
;
for
(
auto
cit
=
mainGame
->
dField
.
hand
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
hand
[
player
].
end
();
++
cit
)
{
else
(
*
cit
)
->
dPos
.
Y
=
-
0.6
f
;
if
(
player
==
0
)
(
*
cit
)
->
dPos
.
Y
=
0.4
f
;
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
else
(
*
cit
)
->
dPos
.
Y
=
-
0.6
f
;
(
*
cit
)
->
is_moving
=
true
;
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
(
*
cit
)
->
aniFrame
=
5
;
(
*
cit
)
->
is_moving
=
true
;
}
(
*
cit
)
->
aniFrame
=
5
;
for
(
auto
cit
=
mainGame
->
dField
.
extra
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
extra
[
player
].
end
();
++
cit
)
{
}
if
(
player
==
0
)
(
*
cit
)
->
dPos
.
Y
=
0.4
f
;
for
(
auto
cit
=
mainGame
->
dField
.
extra
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
extra
[
player
].
end
();
++
cit
)
{
else
(
*
cit
)
->
dPos
.
Y
=
-
0.6
f
;
if
(
player
==
0
)
(
*
cit
)
->
dPos
.
Y
=
0.4
f
;
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
else
(
*
cit
)
->
dPos
.
Y
=
-
0.6
f
;
(
*
cit
)
->
is_moving
=
true
;
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
(
*
cit
)
->
aniFrame
=
5
;
(
*
cit
)
->
is_moving
=
true
;
}
(
*
cit
)
->
aniFrame
=
5
;
mainGame
->
WaitFrameSignal
(
5
);
}
mainGame
->
WaitFrameSignal
(
5
);
}
//
//
mainGame
->
gMutex
.
Lock
();
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
mainGame
->
gMutex
.
Lock
();
if
(
mainGame
->
dField
.
deck
[
player
].
size
()
>
mcount
)
{
if
(
mainGame
->
dField
.
deck
[
player
].
size
()
>
mcount
)
{
while
(
mainGame
->
dField
.
deck
[
player
].
size
()
>
mcount
)
{
while
(
mainGame
->
dField
.
deck
[
player
].
size
()
>
mcount
)
{
ClientCard
*
ccard
=
*
mainGame
->
dField
.
deck
[
player
].
rbegin
();
ClientCard
*
ccard
=
*
mainGame
->
dField
.
deck
[
player
].
rbegin
();
...
@@ -2717,34 +2893,37 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2717,34 +2893,37 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dField
.
extra
[
player
].
push_back
(
ccard
);
mainGame
->
dField
.
extra
[
player
].
push_back
(
ccard
);
}
}
}
}
mainGame
->
gMutex
.
Unlock
();
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
mainGame
->
gMutex
.
Unlock
();
//
//
for
(
auto
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
{
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
ClientCard
*
pcard
=
*
cit
;
for
(
auto
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
{
mainGame
->
dField
.
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
);
ClientCard
*
pcard
=
*
cit
;
if
(
player
==
0
)
pcard
->
curPos
.
Y
+=
2.0
f
;
mainGame
->
dField
.
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
);
else
pcard
->
curPos
.
Y
-=
3.0
f
;
if
(
player
==
0
)
pcard
->
curPos
.
Y
+=
2.0
f
;
mainGame
->
dField
.
MoveCard
(
*
cit
,
5
);
else
pcard
->
curPos
.
Y
-=
3.0
f
;
}
mainGame
->
dField
.
MoveCard
(
*
cit
,
5
);
if
(
mainGame
->
dField
.
deck
[
player
].
size
())
}
(
*
mainGame
->
dField
.
deck
[
player
].
rbegin
())
->
code
=
topcode
;
if
(
mainGame
->
dField
.
deck
[
player
].
size
())
for
(
auto
cit
=
mainGame
->
dField
.
hand
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
hand
[
player
].
end
();
++
cit
)
{
(
*
mainGame
->
dField
.
deck
[
player
].
rbegin
())
->
code
=
topcode
;
ClientCard
*
pcard
=
*
cit
;
for
(
auto
cit
=
mainGame
->
dField
.
hand
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
hand
[
player
].
end
();
++
cit
)
{
pcard
->
code
=
BufferIO
::
ReadInt32
(
pbuf
);
ClientCard
*
pcard
=
*
cit
;
mainGame
->
dField
.
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
);
pcard
->
code
=
BufferIO
::
ReadInt32
(
pbuf
);
if
(
player
==
0
)
pcard
->
curPos
.
Y
+=
2.0
f
;
mainGame
->
dField
.
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
);
else
pcard
->
curPos
.
Y
-=
3.0
f
;
if
(
player
==
0
)
pcard
->
curPos
.
Y
+=
2.0
f
;
mainGame
->
dField
.
MoveCard
(
*
cit
,
5
);
else
pcard
->
curPos
.
Y
-=
3.0
f
;
}
mainGame
->
dField
.
MoveCard
(
*
cit
,
5
);
for
(
auto
cit
=
mainGame
->
dField
.
extra
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
extra
[
player
].
end
();
++
cit
)
{
}
ClientCard
*
pcard
=
*
cit
;
for
(
auto
cit
=
mainGame
->
dField
.
extra
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
extra
[
player
].
end
();
++
cit
)
{
pcard
->
code
=
0
;
ClientCard
*
pcard
=
*
cit
;
mainGame
->
dField
.
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
);
pcard
->
code
=
0
;
if
(
player
==
0
)
pcard
->
curPos
.
Y
+=
2.0
f
;
mainGame
->
dField
.
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
);
else
pcard
->
curPos
.
Y
-=
3.0
f
;
if
(
player
==
0
)
pcard
->
curPos
.
Y
+=
2.0
f
;
mainGame
->
dField
.
MoveCard
(
*
cit
,
5
);
else
pcard
->
curPos
.
Y
-=
3.0
f
;
}
mainGame
->
dField
.
MoveCard
(
*
cit
,
5
);
mainGame
->
WaitFrameSignal
(
5
);
}
mainGame
->
WaitFrameSignal
(
5
);
}
break
;
break
;
}
}
case
MSG_RELOAD_FIELD
:
{
case
MSG_RELOAD_FIELD
:
{
...
...
gframe/game.h
View file @
fbc256c3
...
@@ -29,6 +29,7 @@ struct Config {
...
@@ -29,6 +29,7 @@ struct Config {
struct
DuelInfo
{
struct
DuelInfo
{
bool
isStarted
;
bool
isStarted
;
bool
isReplay
;
bool
isReplay
;
bool
isReplaySkiping
;
bool
isFirst
;
bool
isFirst
;
bool
isTag
;
bool
isTag
;
bool
isSingleMode
;
bool
isSingleMode
;
...
...
gframe/image_manager.cpp
View file @
fbc256c3
...
@@ -22,6 +22,7 @@ bool ImageManager::Initial() {
...
@@ -22,6 +22,7 @@ bool ImageManager::Initial() {
tHand
[
1
]
=
driver
->
getTexture
(
"textures/f2.jpg"
);
tHand
[
1
]
=
driver
->
getTexture
(
"textures/f2.jpg"
);
tHand
[
2
]
=
driver
->
getTexture
(
"textures/f3.jpg"
);
tHand
[
2
]
=
driver
->
getTexture
(
"textures/f3.jpg"
);
tBackGround
=
driver
->
getTexture
(
"textures/bg.jpg"
);
tBackGround
=
driver
->
getTexture
(
"textures/bg.jpg"
);
tField
=
driver
->
getTexture
(
"textures/field.png"
);
return
true
;
return
true
;
}
}
void
ImageManager
::
SetDevice
(
irr
::
IrrlichtDevice
*
dev
)
{
void
ImageManager
::
SetDevice
(
irr
::
IrrlichtDevice
*
dev
)
{
...
...
gframe/image_manager.h
View file @
fbc256c3
...
@@ -35,6 +35,7 @@ public:
...
@@ -35,6 +35,7 @@ public:
irr
::
video
::
ITexture
*
tLim
;
irr
::
video
::
ITexture
*
tLim
;
irr
::
video
::
ITexture
*
tHand
[
3
];
irr
::
video
::
ITexture
*
tHand
[
3
];
irr
::
video
::
ITexture
*
tBackGround
;
irr
::
video
::
ITexture
*
tBackGround
;
irr
::
video
::
ITexture
*
tField
;
};
};
extern
ImageManager
imageManager
;
extern
ImageManager
imageManager
;
...
...
gframe/materials.cpp
View file @
fbc256c3
...
@@ -37,6 +37,10 @@ Materials::Materials() {
...
@@ -37,6 +37,10 @@ Materials::Materials() {
vActivate
[
1
]
=
S3DVertex
(
vector3df
(
0.5
,
-
0.5
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
0
));
vActivate
[
1
]
=
S3DVertex
(
vector3df
(
0.5
,
-
0.5
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
0
));
vActivate
[
2
]
=
S3DVertex
(
vector3df
(
-
0.5
,
0.5
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
1
));
vActivate
[
2
]
=
S3DVertex
(
vector3df
(
-
0.5
,
0.5
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
1
));
vActivate
[
3
]
=
S3DVertex
(
vector3df
(
0.5
,
0.5
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
1
));
vActivate
[
3
]
=
S3DVertex
(
vector3df
(
0.5
,
0.5
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
1
));
vField
[
0
]
=
S3DVertex
(
vector3df
(
0.0
,
-
4.0
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
0
));
vField
[
1
]
=
S3DVertex
(
vector3df
(
8.0
,
-
4.0
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
0
));
vField
[
2
]
=
S3DVertex
(
vector3df
(
0.0
,
4.0
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
1
));
vField
[
3
]
=
S3DVertex
(
vector3df
(
8.0
,
4.0
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
1
));
//background grids
//background grids
for
(
int
i
=
0
;
i
<
6
;
++
i
)
{
for
(
int
i
=
0
;
i
<
6
;
++
i
)
{
vBackLine
[
i
*
6
+
0
]
=
S3DVertex
(
vector3df
(
1.2
f
+
i
*
1.1
f
,
0.5
f
,
-
0.01
f
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
0
));
vBackLine
[
i
*
6
+
0
]
=
S3DVertex
(
vector3df
(
1.2
f
+
i
*
1.1
f
,
0.5
f
,
-
0.01
f
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
0
));
...
...
gframe/materials.h
View file @
fbc256c3
...
@@ -15,6 +15,7 @@ public:
...
@@ -15,6 +15,7 @@ public:
S3DVertex
vNegate
[
4
];
S3DVertex
vNegate
[
4
];
S3DVertex
vChainNum
[
4
];
S3DVertex
vChainNum
[
4
];
S3DVertex
vActivate
[
4
];
S3DVertex
vActivate
[
4
];
S3DVertex
vField
[
4
];
S3DVertex
vBackLine
[
76
];
S3DVertex
vBackLine
[
76
];
S3DVertex
vFields
[
128
];
S3DVertex
vFields
[
128
];
S3DVertex
vArrow
[
40
];
S3DVertex
vArrow
[
40
];
...
...
gframe/menu_handler.cpp
View file @
fbc256c3
...
@@ -160,7 +160,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -160,7 +160,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
dField
.
Clear
();
mainGame
->
dField
.
Clear
();
mainGame
->
HideElement
(
mainGame
->
wReplay
);
mainGame
->
HideElement
(
mainGame
->
wReplay
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
dField
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
dField
);
ReplayMode
::
StartReplay
();
ReplayMode
::
StartReplay
(
0
);
break
;
break
;
}
}
case
BUTTON_CANCEL_REPLAY
:
{
case
BUTTON_CANCEL_REPLAY
:
{
...
...
gframe/replay_mode.cpp
View file @
fbc256c3
...
@@ -15,9 +15,11 @@ bool ReplayMode::is_pausing = false;
...
@@ -15,9 +15,11 @@ bool ReplayMode::is_pausing = false;
bool
ReplayMode
::
is_paused
=
false
;
bool
ReplayMode
::
is_paused
=
false
;
bool
ReplayMode
::
is_swaping
=
false
;
bool
ReplayMode
::
is_swaping
=
false
;
bool
ReplayMode
::
exit_pending
=
false
;
bool
ReplayMode
::
exit_pending
=
false
;
int
ReplayMode
::
skip_turn
=
0
;
wchar_t
ReplayMode
::
event_string
[
256
];
wchar_t
ReplayMode
::
event_string
[
256
];
bool
ReplayMode
::
StartReplay
()
{
bool
ReplayMode
::
StartReplay
(
int
skipturn
)
{
skip_turn
=
skipturn
;
Thread
::
NewThread
(
ReplayThread
,
0
);
Thread
::
NewThread
(
ReplayThread
,
0
);
return
true
;
return
true
;
}
}
...
@@ -134,6 +136,13 @@ int ReplayMode::ReplayThread(void* param) {
...
@@ -134,6 +136,13 @@ int ReplayMode::ReplayThread(void* param) {
char
engineBuffer
[
0x1000
];
char
engineBuffer
[
0x1000
];
is_continuing
=
true
;
is_continuing
=
true
;
exit_pending
=
false
;
exit_pending
=
false
;
if
(
skip_turn
<
0
)
skip_turn
=
0
;
if
(
skip_turn
)
{
mainGame
->
dInfo
.
isReplaySkiping
=
true
;
mainGame
->
gMutex
.
Lock
();
}
else
mainGame
->
dInfo
.
isReplaySkiping
=
false
;
int
len
=
0
,
flag
=
0
;
int
len
=
0
,
flag
=
0
;
while
(
is_continuing
&&
!
exit_pending
)
{
while
(
is_continuing
&&
!
exit_pending
)
{
int
result
=
process
(
pduel
);
int
result
=
process
(
pduel
);
...
@@ -183,6 +192,8 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
...
@@ -183,6 +192,8 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
mainGame
->
dInfo
.
curMsg
=
BufferIO
::
ReadUInt8
(
pbuf
);
mainGame
->
dInfo
.
curMsg
=
BufferIO
::
ReadUInt8
(
pbuf
);
switch
(
mainGame
->
dInfo
.
curMsg
)
{
switch
(
mainGame
->
dInfo
.
curMsg
)
{
case
MSG_RETRY
:
{
case
MSG_RETRY
:
{
if
(
mainGame
->
dInfo
.
isReplaySkiping
)
mainGame
->
gMutex
.
Unlock
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
stMessage
->
setText
(
L"Error occurs."
);
mainGame
->
stMessage
->
setText
(
L"Error occurs."
);
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
...
@@ -344,6 +355,14 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
...
@@ -344,6 +355,14 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
break
;
break
;
}
}
case
MSG_NEW_TURN
:
{
case
MSG_NEW_TURN
:
{
if
(
skip_turn
)
{
skip_turn
--
;
if
(
skip_turn
==
0
)
{
mainGame
->
dInfo
.
isReplaySkiping
=
false
;
mainGame
->
dField
.
RefreshAllCards
();
mainGame
->
gMutex
.
Unlock
();
}
}
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
...
@@ -365,7 +384,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
...
@@ -365,7 +384,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
int
cp
=
pbuf
[
11
];
int
cp
=
pbuf
[
11
];
pbuf
+=
16
;
pbuf
+=
16
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
if
(
pl
!=
cl
||
pc
!=
cc
)
if
(
cl
&&
!
(
cl
&
0x80
)
&&
(
pl
!=
cl
||
pc
!=
cc
)
)
ReplayRefreshSingle
(
cc
,
cl
,
cs
);
ReplayRefreshSingle
(
cc
,
cl
,
cs
);
break
;
break
;
}
}
...
...
gframe/replay_mode.h
View file @
fbc256c3
...
@@ -18,12 +18,13 @@ private:
...
@@ -18,12 +18,13 @@ private:
static
bool
is_paused
;
static
bool
is_paused
;
static
bool
is_swaping
;
static
bool
is_swaping
;
static
bool
exit_pending
;
static
bool
exit_pending
;
static
int
skip_turn
;
static
wchar_t
event_string
[
256
];
static
wchar_t
event_string
[
256
];
public:
public:
static
Replay
cur_replay
;
static
Replay
cur_replay
;
public:
public:
static
bool
StartReplay
();
static
bool
StartReplay
(
int
skipturn
);
static
void
StopReplay
(
bool
is_exiting
=
false
);
static
void
StopReplay
(
bool
is_exiting
=
false
);
static
void
SwapField
();
static
void
SwapField
();
static
void
Pause
(
bool
is_pause
,
bool
is_step
);
static
void
Pause
(
bool
is_pause
,
bool
is_step
);
...
...
gframe/single_mode.cpp
View file @
fbc256c3
...
@@ -341,7 +341,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
...
@@ -341,7 +341,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
int
cp
=
pbuf
[
11
];
int
cp
=
pbuf
[
11
];
pbuf
+=
16
;
pbuf
+=
16
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
if
(
pl
!=
cl
||
pc
!=
cc
)
if
(
cl
&&
!
(
cl
&
0x80
)
&&
(
pl
!=
cl
||
pc
!=
cc
)
)
SinglePlayRefreshSingle
(
cc
,
cl
,
cs
);
SinglePlayRefreshSingle
(
cc
,
cl
,
cs
);
break
;
break
;
}
}
...
...
ocgcore/card.cpp
View file @
fbc256c3
...
@@ -878,15 +878,15 @@ void card::reset(uint32 id, uint32 reset_type) {
...
@@ -878,15 +878,15 @@ void card::reset(uint32 id, uint32 reset_type) {
if
(
rrm
->
second
&
0xffff0000
&
id
)
if
(
rrm
->
second
&
0xffff0000
&
id
)
relations
.
erase
(
rrm
);
relations
.
erase
(
rrm
);
}
}
if
(
id
&
0x7c0000
)
if
(
id
&
0x
4
7c0000
)
relate_effect
.
clear
();
relate_effect
.
clear
();
if
(
id
&
0x
1
fc0000
)
{
if
(
id
&
0x
5
fc0000
)
{
announced_cards
.
clear
();
announced_cards
.
clear
();
attacked_cards
.
clear
();
attacked_cards
.
clear
();
announce_count
=
0
;
announce_count
=
0
;
attacked_count
=
0
;
attacked_count
=
0
;
}
}
if
(
id
&
0x
1
fe0000
)
{
if
(
id
&
0x
5
fe0000
)
{
battled_cards
.
clear
();
battled_cards
.
clear
();
reset_effect_count
();
reset_effect_count
();
auto
pr
=
field_effect
.
equal_range
(
EFFECT_DISABLE_FIELD
);
auto
pr
=
field_effect
.
equal_range
(
EFFECT_DISABLE_FIELD
);
...
...
ocgcore/operations.cpp
View file @
fbc256c3
...
@@ -2493,7 +2493,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -2493,7 +2493,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
pcard
->
current
.
reason
|=
REASON_REDIRECT
;
pcard
->
current
.
reason
|=
REASON_REDIRECT
;
pcard
->
operation_param
=
(
pcard
->
operation_param
&
0xffff0000
)
|
(
redirect
<<
8
)
|
redirect_seq
;
pcard
->
operation_param
=
(
pcard
->
operation_param
&
0xffff0000
)
|
(
redirect
<<
8
)
|
redirect_seq
;
}
}
if
((
pcard
->
current
.
location
==
LOCATION_MZONE
)
&&
pcard
->
is_status
(
STATUS_BATTLE_DESTROYED
)
&&
!
(
pcard
->
current
.
reason
&
REASON_DESTROY
))
{
if
((
pcard
->
current
.
location
==
LOCATION_MZONE
)
&&
pcard
->
is_status
(
STATUS_BATTLE_DESTROYED
)
&&
!
(
pcard
->
current
.
reason
&
(
REASON_DESTROY
|
REASON_EFFECT
)
))
{
pcard
->
current
.
reason
|=
REASON_DESTROY
|
REASON_BATTLE
;
pcard
->
current
.
reason
|=
REASON_DESTROY
|
REASON_BATTLE
;
raise_single_event
(
pcard
,
0
,
EVENT_DESTROY
,
pcard
->
current
.
reason_effect
,
pcard
->
current
.
reason
,
pcard
->
current
.
reason_player
,
0
,
0
);
raise_single_event
(
pcard
,
0
,
EVENT_DESTROY
,
pcard
->
current
.
reason_effect
,
pcard
->
current
.
reason
,
pcard
->
current
.
reason_player
,
0
,
0
);
destroying
.
insert
(
pcard
);
destroying
.
insert
(
pcard
);
...
...
script/c61314842.lua
View file @
fbc256c3
...
@@ -17,15 +17,27 @@ function c61314842.xyzfilter(c,mg)
...
@@ -17,15 +17,27 @@ function c61314842.xyzfilter(c,mg)
if
c
.
xyz_count
~=
2
then
return
false
end
if
c
.
xyz_count
~=
2
then
return
false
end
return
c
:
IsXyzSummonable
(
mg
)
return
c
:
IsXyzSummonable
(
mg
)
end
end
function
c61314842
.
mfilter1
(
c
,
exg
)
return
exg
:
IsExists
(
c61314842
.
mfilter2
,
1
,
nil
,
c
)
end
function
c61314842
.
mfilter2
(
c
,
mc
)
return
c
.
xyz_filter
(
mc
)
end
function
c61314842
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
c61314842
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
false
end
if
chkc
then
return
false
end
local
mg
=
Duel
.
GetMatchingGroup
(
c61314842
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
nil
,
e
,
tp
)
local
mg
=
Duel
.
GetMatchingGroup
(
c61314842
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
nil
,
e
,
tp
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
1
and
mg
:
GetCount
()
>
1
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
1
and
mg
:
GetCount
()
>
1
and
Duel
.
IsExistingMatchingCard
(
c61314842
.
xyzfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
mg
)
end
and
Duel
.
IsExistingMatchingCard
(
c61314842
.
xyzfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
mg
)
end
local
exg
=
Duel
.
GetMatchingGroup
(
c61314842
.
xyzfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
mg
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg1
=
mg
:
FilterSelect
(
tp
,
c61314842
.
mfilter1
,
1
,
1
,
nil
,
exg
)
local
tc1
=
sg1
:
GetFirst
()
local
exg2
=
exg
:
Filter
(
c61314842
.
mfilter2
,
nil
,
tc1
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
mg
:
Select
(
tp
,
2
,
2
,
nil
)
local
sg2
=
mg
:
FilterSelect
(
tp
,
c61314842
.
mfilter1
,
1
,
1
,
tc1
,
exg2
)
Duel
.
SetTargetCard
(
g
)
sg1
:
Merge
(
sg2
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
2
,
0
,
0
)
Duel
.
SetTargetCard
(
sg1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
sg1
,
2
,
0
,
0
)
end
end
function
c61314842
.
filter2
(
c
,
e
,
tp
)
function
c61314842
.
filter2
(
c
,
e
,
tp
)
return
c
:
IsRelateToEffect
(
e
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
return
c
:
IsRelateToEffect
(
e
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
...
@@ -37,6 +49,7 @@ function c61314842.activate(e,tp,eg,ep,ev,re,r,rp)
...
@@ -37,6 +49,7 @@ function c61314842.activate(e,tp,eg,ep,ev,re,r,rp)
local
xyzg
=
Duel
.
GetMatchingGroup
(
c61314842
.
xyzfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
g
)
local
xyzg
=
Duel
.
GetMatchingGroup
(
c61314842
.
xyzfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
g
)
if
xyzg
:
GetCount
()
>
0
then
if
xyzg
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
xyz
=
xyzg
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
local
xyz
=
xyzg
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
XyzSummon
(
tp
,
xyz
,
g
)
Duel
.
XyzSummon
(
tp
,
xyz
,
g
)
...
...
script/c96704018.lua
View file @
fbc256c3
...
@@ -3,7 +3,7 @@ function c96704018.initial_effect(c)
...
@@ -3,7 +3,7 @@ function c96704018.initial_effect(c)
--lv change
--lv change
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
96704018
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
96704018
,
0
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_
F
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_
O
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetOperation
(
c96704018
.
operation
)
e1
:
SetOperation
(
c96704018
.
operation
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
...
...
strings.conf
View file @
fbc256c3
...
@@ -362,11 +362,11 @@
...
@@ -362,11 +362,11 @@
!
victory
0
x2
没有卡可抽
!
victory
0
x2
没有卡可抽
!
victory
0
x3
超时
!
victory
0
x3
超时
!
victory
0
x4
失去连接
!
victory
0
x4
失去连接
!
victory
0
x10
封印されしエクゾディア
!
victory
0
x10
「被封印的艾克佐迪亚」效果胜利
!
victory
0
x11
終焉のカウントダウン
!
victory
0
x11
「终焉的倒计时」效果胜利
!
victory
0
x12
毒蛇神ヴェノミナーガ
!
victory
0
x12
「毒蛇神 维诺米纳迦」效果胜利
!
victory
0
x13
光の創造神 ホルアクティ
!
victory
0
x13
「光之创造神 哈拉克提」效果胜利
!
victory
0
x14
究極封印神エクゾディオス
!
victory
0
x14
「究极封印神 艾克佐迪奥斯」效果胜利
#counters
#counters
!
counter
0
x3001
魔力指示物
!
counter
0
x3001
魔力指示物
!
counter
0
x2
楔指示物
!
counter
0
x2
楔指示物
...
...
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