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-520DIY
ygopro
Commits
d8de33da
Commit
d8de33da
authored
Aug 08, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
c0d6f981
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
27 deletions
+56
-27
gframe/client_card.cpp
gframe/client_card.cpp
+1
-0
gframe/client_card.h
gframe/client_card.h
+1
-0
gframe/client_field.cpp
gframe/client_field.cpp
+3
-2
gframe/duelclient.cpp
gframe/duelclient.cpp
+7
-2
ocgcore/field.cpp
ocgcore/field.cpp
+7
-2
ocgcore/operations.cpp
ocgcore/operations.cpp
+37
-21
No files found.
gframe/client_card.cpp
View file @
d8de33da
...
@@ -17,6 +17,7 @@ ClientCard::ClientCard() {
...
@@ -17,6 +17,7 @@ ClientCard::ClientCard() {
is_showtarget
=
false
;
is_showtarget
=
false
;
is_highlighting
=
false
;
is_highlighting
=
false
;
is_disabled
=
false
;
is_disabled
=
false
;
is_reversed
=
false
;
cmdFlag
=
0
;
cmdFlag
=
0
;
code
=
0
;
code
=
0
;
type
=
0
;
type
=
0
;
...
...
gframe/client_card.h
View file @
d8de33da
...
@@ -58,6 +58,7 @@ public:
...
@@ -58,6 +58,7 @@ public:
bool
is_showequip
;
bool
is_showequip
;
bool
is_showtarget
;
bool
is_showtarget
;
bool
is_highlighting
;
bool
is_highlighting
;
bool
is_reversed
;
u32
code
;
u32
code
;
u32
alias
;
u32
alias
;
u32
type
;
u32
type
;
...
...
gframe/client_field.cpp
View file @
d8de33da
...
@@ -148,6 +148,7 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
...
@@ -148,6 +148,7 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
deck
[
controler
][
0
]
=
pcard
;
deck
[
controler
][
0
]
=
pcard
;
pcard
->
sequence
=
0
;
pcard
->
sequence
=
0
;
}
}
pcard
->
is_reversed
=
false
;
break
;
break
;
}
}
case
LOCATION_HAND
:
{
case
LOCATION_HAND
:
{
...
@@ -636,7 +637,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
...
@@ -636,7 +637,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
t
->
X
=
7.3
f
;
t
->
X
=
7.3
f
;
t
->
Y
=
3.0
f
;
t
->
Y
=
3.0
f
;
t
->
Z
=
0.01
f
+
0.01
f
*
sequence
;
t
->
Z
=
0.01
f
+
0.01
f
*
sequence
;
if
(
!
deck
_reversed
)
{
if
(
deck_reversed
==
pcard
->
is
_reversed
)
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Y
=
3.1415926
f
;
r
->
Y
=
3.1415926
f
;
r
->
Z
=
0.0
f
;
r
->
Z
=
0.0
f
;
...
@@ -649,7 +650,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
...
@@ -649,7 +650,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
t
->
X
=
0.6
f
;
t
->
X
=
0.6
f
;
t
->
Y
=
-
3.0
f
;
t
->
Y
=
-
3.0
f
;
t
->
Z
=
0.01
f
+
0.01
f
*
sequence
;
t
->
Z
=
0.01
f
+
0.01
f
*
sequence
;
if
(
!
deck
_reversed
)
{
if
(
deck_reversed
==
pcard
->
is
_reversed
)
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Y
=
3.1415926
f
;
r
->
Y
=
3.1415926
f
;
r
->
Z
=
3.1415926
f
;
r
->
Z
=
3.1415926
f
;
...
...
gframe/duelclient.cpp
View file @
d8de33da
...
@@ -1562,8 +1562,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1562,8 +1562,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
WaitFrameSignal
(
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
;
mainGame
->
dField
.
deck
[
player
][
i
]
->
is_reversed
=
false
;
}
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
for
(
auto
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
{
for
(
auto
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
{
...
@@ -1666,7 +1668,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1666,7 +1668,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
int
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
mainGame
->
dField
.
GetCard
(
player
,
LOCATION_DECK
,
mainGame
->
dField
.
deck
[
player
].
size
()
-
1
-
seq
)
->
SetCode
(
code
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
player
,
LOCATION_DECK
,
mainGame
->
dField
.
deck
[
player
].
size
()
-
1
-
seq
);
pcard
->
is_reversed
=
(
code
&
0x80000000
)
!=
0
;
pcard
->
SetCode
(
code
&
0x7fffff
);
mainGame
->
dField
.
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
,
true
);
return
true
;
return
true
;
}
}
case
MSG_SHUFFLE_SET_CARD
:
{
case
MSG_SHUFFLE_SET_CARD
:
{
...
...
ocgcore/field.cpp
View file @
d8de33da
...
@@ -139,16 +139,18 @@ void field::add_card(uint8 playerid, card* pcard, uint8 location, uint8 sequence
...
@@ -139,16 +139,18 @@ void field::add_card(uint8 playerid, card* pcard, uint8 location, uint8 sequence
if
(
sequence
==
0
)
{
//deck top
if
(
sequence
==
0
)
{
//deck top
player
[
playerid
].
list_main
.
push_back
(
pcard
);
player
[
playerid
].
list_main
.
push_back
(
pcard
);
pcard
->
current
.
sequence
=
player
[
playerid
].
list_main
.
size
()
-
1
;
pcard
->
current
.
sequence
=
player
[
playerid
].
list_main
.
size
()
-
1
;
pcard
->
current
.
position
=
POS_FACEUP_ATTACK
;
}
else
if
(
sequence
==
1
)
{
//deck button
}
else
if
(
sequence
==
1
)
{
//deck button
player
[
playerid
].
list_main
.
insert
(
player
[
playerid
].
list_main
.
begin
(),
pcard
);
player
[
playerid
].
list_main
.
insert
(
player
[
playerid
].
list_main
.
begin
(),
pcard
);
reset_sequence
(
playerid
,
LOCATION_DECK
);
reset_sequence
(
playerid
,
LOCATION_DECK
);
pcard
->
current
.
position
=
POS_FACEDOWN
;
}
else
{
//deck top & shuffle
}
else
{
//deck top & shuffle
player
[
playerid
].
list_main
.
push_back
(
pcard
);
player
[
playerid
].
list_main
.
push_back
(
pcard
);
pcard
->
current
.
sequence
=
player
[
playerid
].
list_main
.
size
()
-
1
;
pcard
->
current
.
sequence
=
player
[
playerid
].
list_main
.
size
()
-
1
;
if
(
!
core
.
shuffle_check_disabled
)
if
(
!
core
.
shuffle_check_disabled
)
core
.
shuffle_deck_check
[
playerid
]
=
TRUE
;
core
.
shuffle_deck_check
[
playerid
]
=
TRUE
;
pcard
->
current
.
position
=
POS_FACEDOWN
;
}
}
pcard
->
current
.
position
=
POS_FACEDOWN
;
break
;
break
;
case
LOCATION_HAND
:
case
LOCATION_HAND
:
player
[
playerid
].
list_hand
.
push_back
(
pcard
);
player
[
playerid
].
list_hand
.
push_back
(
pcard
);
...
@@ -455,7 +457,7 @@ int32 field::get_useable_count(uint8 playerid, uint8 location, uint8 uplayer, ui
...
@@ -455,7 +457,7 @@ int32 field::get_useable_count(uint8 playerid, uint8 location, uint8 uplayer, ui
}
}
}
}
void
field
::
shuffle
(
uint8
playerid
,
uint8
location
)
{
void
field
::
shuffle
(
uint8
playerid
,
uint8
location
)
{
if
(
!
(
location
&
(
LOCATION_HAND
+
LOCATION_DECK
)))
if
(
!
(
location
&
(
LOCATION_HAND
|
LOCATION_DECK
)))
return
;
return
;
card_vector
&
svector
=
(
location
==
LOCATION_HAND
)
?
player
[
playerid
].
list_hand
:
player
[
playerid
].
list_main
;
card_vector
&
svector
=
(
location
==
LOCATION_HAND
)
?
player
[
playerid
].
list_hand
:
player
[
playerid
].
list_main
;
if
(
svector
.
size
()
==
0
)
if
(
svector
.
size
()
==
0
)
...
@@ -469,6 +471,9 @@ void field::shuffle(uint8 playerid, uint8 location) {
...
@@ -469,6 +471,9 @@ void field::shuffle(uint8 playerid, uint8 location) {
core
.
shuffle_hand_check
[
playerid
]
=
FALSE
;
core
.
shuffle_hand_check
[
playerid
]
=
FALSE
;
return
;
return
;
}
}
}
else
{
for
(
auto
cit
=
svector
.
begin
();
cit
!=
svector
.
end
();
++
cit
)
(
*
cit
)
->
current
.
position
=
POS_FACEDOWN
;
}
}
if
(
location
==
LOCATION_HAND
||
!
(
core
.
duel_options
&
DUEL_PSEUDO_SHUFFLE
))
{
if
(
location
==
LOCATION_HAND
||
!
(
core
.
duel_options
&
DUEL_PSEUDO_SHUFFLE
))
{
if
(
svector
.
size
()
>
1
)
{
if
(
svector
.
size
()
>
1
)
{
...
...
ocgcore/operations.cpp
View file @
d8de33da
...
@@ -2518,29 +2518,39 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -2518,29 +2518,39 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
cv
.
push_back
(
*
cit
);
cv
.
push_back
(
*
cit
);
if
(
cv
.
size
()
>
1
)
if
(
cv
.
size
()
>
1
)
std
::
sort
(
cv
.
begin
(),
cv
.
end
(),
card
::
card_operation_sort
);
std
::
sort
(
cv
.
begin
(),
cv
.
end
(),
card
::
card_operation_sort
);
if
(
core
.
deck_reversed
)
{
int32
d0
=
player
[
0
].
list_main
.
size
()
-
1
,
s0
=
d0
;
int32
d0
=
player
[
0
].
list_main
.
size
()
-
1
,
s0
=
d0
;
int32
d1
=
player
[
1
].
list_main
.
size
()
-
1
,
s1
=
d1
;
int32
d1
=
player
[
1
].
list_main
.
size
()
-
1
,
s1
=
d1
;
for
(
uint32
i
=
0
;
i
<
cv
.
size
();
++
i
)
{
for
(
uint32
i
=
0
;
i
<
cv
.
size
();
++
i
)
{
card
*
pcard
=
cv
[
i
];
card
*
pcard
=
cv
[
i
];
if
(
pcard
->
current
.
location
!=
LOCATION_DECK
)
if
(
pcard
->
current
.
location
!=
LOCATION_DECK
)
continue
;
continue
;
if
((
pcard
->
current
.
controler
==
0
)
&&
(
pcard
->
current
.
sequence
==
s0
))
if
((
pcard
->
current
.
controler
==
0
)
&&
(
pcard
->
current
.
sequence
==
s0
))
s0
--
;
s0
--
;
if
((
pcard
->
current
.
controler
==
1
)
&&
(
pcard
->
current
.
sequence
==
s1
))
if
((
pcard
->
current
.
controler
==
1
)
&&
(
pcard
->
current
.
sequence
==
s1
))
s1
--
;
s1
--
;
}
}
if
((
s0
!=
d0
)
&&
(
s0
>
0
))
{
if
((
s0
!=
d0
)
&&
(
s0
>
0
))
{
card
*
ptop
=
player
[
0
].
list_main
[
s0
];
if
(
core
.
deck_reversed
||
(
ptop
->
current
.
position
==
POS_FACEUP_DEFENCE
))
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer8
(
d0
-
s0
);
pduel
->
write_buffer8
(
d0
-
s0
);
pduel
->
write_buffer32
(
player
[
0
].
list_main
[
s0
]
->
data
.
code
);
if
(
ptop
->
current
.
position
!=
POS_FACEUP_DEFENCE
)
pduel
->
write_buffer32
(
ptop
->
data
.
code
);
else
pduel
->
write_buffer32
(
ptop
->
data
.
code
|
0x80000000
);
}
}
if
((
s1
!=
d1
)
&&
(
s1
>
0
))
{
}
if
((
s1
!=
d1
)
&&
(
s1
>
0
))
{
card
*
ptop
=
player
[
0
].
list_main
[
s0
];
if
(
core
.
deck_reversed
||
(
ptop
->
current
.
position
==
POS_FACEUP_DEFENCE
))
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
1
);
pduel
->
write_buffer8
(
1
);
pduel
->
write_buffer8
(
d1
-
s1
);
pduel
->
write_buffer8
(
d1
-
s1
);
pduel
->
write_buffer32
(
player
[
1
].
list_main
[
s1
]
->
data
.
code
);
if
(
ptop
->
current
.
position
!=
POS_FACEUP_DEFENCE
)
pduel
->
write_buffer32
(
ptop
->
data
.
code
);
else
pduel
->
write_buffer32
(
ptop
->
data
.
code
|
0x80000000
);
}
}
}
}
for
(
auto
cvit
=
cv
.
begin
();
cvit
!=
cv
.
end
();
++
cvit
)
{
for
(
auto
cvit
=
cv
.
begin
();
cvit
!=
cv
.
end
();
++
cvit
)
{
...
@@ -2933,14 +2943,20 @@ int32 field::move_to_field(uint16 step, card * target, uint32 enable, uint32 ret
...
@@ -2933,14 +2943,20 @@ int32 field::move_to_field(uint16 step, card * target, uint32 enable, uint32 ret
return
FALSE
;
return
FALSE
;
}
}
case
2
:
{
case
2
:
{
if
(
core
.
deck_reversed
&&
(
target
->
current
.
location
==
LOCATION_DECK
)
)
{
if
(
target
->
current
.
location
==
LOCATION_DECK
)
{
uint32
curp
=
target
->
current
.
controler
;
uint32
curp
=
target
->
current
.
controler
;
uint32
curs
=
target
->
current
.
sequence
;
uint32
curs
=
target
->
current
.
sequence
;
if
(
curs
>
0
&&
(
curs
==
player
[
curp
].
list_main
.
size
()
-
1
))
{
if
(
curs
>
0
&&
(
curs
==
player
[
curp
].
list_main
.
size
()
-
1
))
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
card
*
ptop
=
player
[
curp
].
list_main
[
curs
-
1
];
pduel
->
write_buffer8
(
curp
);
if
(
core
.
deck_reversed
||
(
ptop
->
current
.
position
==
POS_FACEUP_DEFENCE
))
{
pduel
->
write_buffer8
(
1
);
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer32
(
player
[
curp
].
list_main
[
curs
-
1
]
->
data
.
code
);
pduel
->
write_buffer8
(
curp
);
pduel
->
write_buffer8
(
1
);
if
(
ptop
->
current
.
position
!=
POS_FACEUP_DEFENCE
)
pduel
->
write_buffer32
(
ptop
->
data
.
code
);
else
pduel
->
write_buffer32
(
ptop
->
data
.
code
|
0x80000000
);
}
}
}
}
}
pduel
->
write_buffer8
(
MSG_MOVE
);
pduel
->
write_buffer8
(
MSG_MOVE
);
...
...
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