Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-2pick
Commits
380b5992
Commit
380b5992
authored
Feb 29, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
6e3fab5e
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
83 additions
and
24 deletions
+83
-24
gframe/duelclient.cpp
gframe/duelclient.cpp
+2
-1
ocgcore/field.cpp
ocgcore/field.cpp
+10
-4
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+1
-2
ocgcore/operations.cpp
ocgcore/operations.cpp
+53
-1
ocgcore/processor.cpp
ocgcore/processor.cpp
+14
-14
script/c10248192.lua
script/c10248192.lua
+1
-0
script/c89258906.lua
script/c89258906.lua
+1
-1
system.conf
system.conf
+1
-1
No files found.
gframe/duelclient.cpp
View file @
380b5992
...
@@ -1957,6 +1957,7 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
...
@@ -1957,6 +1957,7 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
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
);
if
(
code
||
!
mainGame
->
dField
.
deck_reversed
)
pcard
->
SetCode
(
code
);
pcard
->
SetCode
(
code
);
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
);
...
...
ocgcore/field.cpp
View file @
380b5992
...
@@ -428,6 +428,12 @@ void field::shuffle(uint8 playerid, uint8 location) {
...
@@ -428,6 +428,12 @@ void field::shuffle(uint8 playerid, uint8 location) {
pduel
->
write_buffer8
(
MSG_SHUFFLE_DECK
);
pduel
->
write_buffer8
(
MSG_SHUFFLE_DECK
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
playerid
);
core
.
shuffle_deck_check
[
playerid
]
=
FALSE
;
core
.
shuffle_deck_check
[
playerid
]
=
FALSE
;
if
(
core
.
deck_reversed
)
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer32
((
*
player
[
playerid
].
list_main
.
rbegin
())
->
data
.
code
);
}
}
}
}
}
void
field
::
reset_sequence
(
uint8
playerid
,
uint8
location
)
{
void
field
::
reset_sequence
(
uint8
playerid
,
uint8
location
)
{
...
@@ -502,6 +508,8 @@ void field::reverse_deck(uint8 playerid) {
...
@@ -502,6 +508,8 @@ void field::reverse_deck(uint8 playerid) {
return
;
return
;
for
(
int
i
=
0
;
i
<
count
/
2
;
++
i
)
{
for
(
int
i
=
0
;
i
<
count
/
2
;
++
i
)
{
card
*
tmp
=
player
[
playerid
].
list_main
[
i
];
card
*
tmp
=
player
[
playerid
].
list_main
[
i
];
tmp
->
current
.
sequence
=
count
-
1
-
i
;
player
[
playerid
].
list_main
[
count
-
1
-
i
]
->
current
.
sequence
=
i
;
player
[
playerid
].
list_main
[
i
]
=
player
[
playerid
].
list_main
[
count
-
1
-
i
];
player
[
playerid
].
list_main
[
i
]
=
player
[
playerid
].
list_main
[
count
-
1
-
i
];
player
[
playerid
].
list_main
[
count
-
1
-
i
]
=
tmp
;
player
[
playerid
].
list_main
[
count
-
1
-
i
]
=
tmp
;
}
}
...
@@ -714,11 +722,9 @@ void field::filter_affected_cards(effect* peffect, card_set* cset) {
...
@@ -714,11 +722,9 @@ void field::filter_affected_cards(effect* peffect, card_set* cset) {
}
}
}
}
void
field
::
filter_player_effect
(
uint8
playerid
,
uint32
code
,
effect_set
*
eset
,
uint8
sort
)
{
void
field
::
filter_player_effect
(
uint8
playerid
,
uint32
code
,
effect_set
*
eset
,
uint8
sort
)
{
effect
*
peffect
;
auto
rg
=
effects
.
aura_effect
.
equal_range
(
code
);
pair
<
effect_container
::
iterator
,
effect_container
::
iterator
>
rg
;
rg
=
effects
.
aura_effect
.
equal_range
(
code
);
for
(;
rg
.
first
!=
rg
.
second
;
++
rg
.
first
)
{
for
(;
rg
.
first
!=
rg
.
second
;
++
rg
.
first
)
{
peffect
=
rg
.
first
->
second
;
effect
*
peffect
=
rg
.
first
->
second
;
if
(
peffect
->
is_target_player
(
playerid
)
&&
peffect
->
is_available
())
if
(
peffect
->
is_target_player
(
playerid
)
&&
peffect
->
is_available
())
eset
->
add_item
(
peffect
);
eset
->
add_item
(
peffect
);
}
}
...
...
ocgcore/libduel.cpp
View file @
380b5992
...
@@ -624,8 +624,7 @@ int32 scriptlib::duel_confirm_cards(lua_State *L) {
...
@@ -624,8 +624,7 @@ int32 scriptlib::duel_confirm_cards(lua_State *L) {
pduel
->
write_buffer8
(
pcard
->
current
.
sequence
);
pduel
->
write_buffer8
(
pcard
->
current
.
sequence
);
}
else
{
}
else
{
pduel
->
write_buffer8
(
pgroup
->
container
.
size
());
pduel
->
write_buffer8
(
pgroup
->
container
.
size
());
field
::
card_set
::
iterator
cit
;
for
(
auto
cit
=
pgroup
->
container
.
begin
();
cit
!=
pgroup
->
container
.
end
();
++
cit
)
{
for
(
cit
=
pgroup
->
container
.
begin
();
cit
!=
pgroup
->
container
.
end
();
++
cit
)
{
pduel
->
write_buffer32
((
*
cit
)
->
data
.
code
);
pduel
->
write_buffer32
((
*
cit
)
->
data
.
code
);
pduel
->
write_buffer8
((
*
cit
)
->
current
.
controler
);
pduel
->
write_buffer8
((
*
cit
)
->
current
.
controler
);
pduel
->
write_buffer8
((
*
cit
)
->
current
.
location
);
pduel
->
write_buffer8
((
*
cit
)
->
current
.
location
);
...
...
ocgcore/operations.cpp
View file @
380b5992
...
@@ -302,6 +302,7 @@ int32 field::draw(uint16 step, effect* reason_effect, uint32 reason, uint8 reaso
...
@@ -302,6 +302,7 @@ int32 field::draw(uint16 step, effect* reason_effect, uint32 reason, uint8 reaso
card_set
cset
;
card_set
cset
;
card_vector
cv
;
card_vector
cv
;
uint32
drawed
=
0
;
uint32
drawed
=
0
;
uint32
public_count
=
0
;
if
(
!
(
reason
&
REASON_RULE
)
&&
!
is_player_can_draw
(
playerid
))
{
if
(
!
(
reason
&
REASON_RULE
)
&&
!
is_player_can_draw
(
playerid
))
{
returns
.
ivalue
[
0
]
=
0
;
returns
.
ivalue
[
0
]
=
0
;
return
TRUE
;
return
TRUE
;
...
@@ -328,6 +329,10 @@ int32 field::draw(uint16 step, effect* reason_effect, uint32 reason, uint8 reaso
...
@@ -328,6 +329,10 @@ int32 field::draw(uint16 step, effect* reason_effect, uint32 reason, uint8 reaso
pcard
->
current
.
location
=
0
;
pcard
->
current
.
location
=
0
;
add_card
(
playerid
,
pcard
,
LOCATION_HAND
,
0
);
add_card
(
playerid
,
pcard
,
LOCATION_HAND
,
0
);
pcard
->
enable_field_effect
(
TRUE
);
pcard
->
enable_field_effect
(
TRUE
);
if
(
pcard
->
is_affected_by_effect
(
EFFECT_PUBLIC
))
{
pcard
->
set_status
(
STATUS_IS_PUBLIC
,
TRUE
);
public_count
++
;
}
cv
.
push_back
(
pcard
);
cv
.
push_back
(
pcard
);
cset
.
insert
(
pcard
);
cset
.
insert
(
pcard
);
}
}
...
@@ -347,7 +352,19 @@ int32 field::draw(uint16 step, effect* reason_effect, uint32 reason, uint8 reaso
...
@@ -347,7 +352,19 @@ int32 field::draw(uint16 step, effect* reason_effect, uint32 reason, uint8 reaso
for
(
uint32
i
=
0
;
i
<
drawed
;
++
i
)
for
(
uint32
i
=
0
;
i
<
drawed
;
++
i
)
pduel
->
write_buffer32
(
cv
[
i
]
->
data
.
code
);
pduel
->
write_buffer32
(
cv
[
i
]
->
data
.
code
);
}
}
if
(
cset
.
size
())
{
if
(
core
.
deck_reversed
&&
(
drawed
>
0
)
&&
(
public_count
<
drawed
))
{
pduel
->
write_buffer8
(
MSG_CONFIRM_CARDS
);
pduel
->
write_buffer8
(
1
-
playerid
);
pduel
->
write_buffer8
(
cset
.
size
());
for
(
auto
cit
=
cset
.
begin
();
cit
!=
cset
.
end
();
++
cit
)
{
pduel
->
write_buffer32
((
*
cit
)
->
data
.
code
);
pduel
->
write_buffer8
((
*
cit
)
->
current
.
controler
);
pduel
->
write_buffer8
((
*
cit
)
->
current
.
location
);
pduel
->
write_buffer8
((
*
cit
)
->
current
.
sequence
);
}
shuffle
(
playerid
,
LOCATION_HAND
);
}
if
(
drawed
)
{
for
(
auto
cit
=
cset
.
begin
();
cit
!=
cset
.
end
();
++
cit
)
for
(
auto
cit
=
cset
.
begin
();
cit
!=
cset
.
end
();
++
cit
)
raise_single_event
((
*
cit
),
0
,
EVENT_TO_HAND
,
reason_effect
,
reason
,
reason_player
,
playerid
,
0
);
raise_single_event
((
*
cit
),
0
,
EVENT_TO_HAND
,
reason_effect
,
reason
,
reason_player
,
playerid
,
0
);
process_single_event
();
process_single_event
();
...
@@ -2242,6 +2259,31 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -2242,6 +2259,31 @@ 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
d1
=
player
[
1
].
list_main
.
size
()
-
1
,
s1
=
d1
;
for
(
int
i
=
0
;
i
<
cv
.
size
();
++
i
)
{
card
*
pcard
=
cv
[
i
];
if
(
pcard
->
current
.
location
!=
LOCATION_DECK
)
continue
;
if
((
pcard
->
current
.
controler
==
0
)
&&
(
pcard
->
current
.
sequence
==
s0
))
s0
--
;
if
((
pcard
->
current
.
controler
==
1
)
&&
(
pcard
->
current
.
sequence
==
s1
))
s1
--
;
}
if
((
s0
!=
d0
)
&&
(
s0
>
0
))
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer8
(
d0
-
s0
);
pduel
->
write_buffer32
(
player
[
0
].
list_main
[
s0
]
->
data
.
code
);
}
if
((
s1
!=
d1
)
&&
(
s1
>
0
))
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
1
);
pduel
->
write_buffer8
(
d1
-
s1
);
pduel
->
write_buffer32
(
player
[
1
].
list_main
[
s1
]
->
data
.
code
);
}
}
for
(
auto
cvit
=
cv
.
begin
();
cvit
!=
cv
.
end
();
++
cvit
)
{
for
(
auto
cvit
=
cv
.
begin
();
cvit
!=
cv
.
end
();
++
cvit
)
{
card
*
pcard
=
*
cvit
;
card
*
pcard
=
*
cvit
;
oloc
=
pcard
->
current
.
location
;
oloc
=
pcard
->
current
.
location
;
...
@@ -2588,6 +2630,16 @@ int32 field::move_to_field(uint16 step, card * target, uint32 enable, uint32 ret
...
@@ -2588,6 +2630,16 @@ 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
))
{
int32
curp
=
target
->
current
.
controler
;
int32
curs
=
target
->
current
.
sequence
;
if
(
curs
>
0
&&
(
curs
==
player
[
curp
].
list_main
.
size
()
-
1
))
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
curp
);
pduel
->
write_buffer8
(
1
);
pduel
->
write_buffer32
(
player
[
curp
].
list_main
[
curs
-
1
]
->
data
.
code
);
}
}
pduel
->
write_buffer8
(
MSG_MOVE
);
pduel
->
write_buffer8
(
MSG_MOVE
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
if
(
target
->
overlay_target
)
{
if
(
target
->
overlay_target
)
{
...
...
ocgcore/processor.cpp
View file @
380b5992
...
@@ -4426,9 +4426,7 @@ int32 field::adjust_step(uint16 step) {
...
@@ -4426,9 +4426,7 @@ int32 field::adjust_step(uint16 step) {
reverse_deck
(
0
);
reverse_deck
(
0
);
reverse_deck
(
1
);
reverse_deck
(
1
);
pduel
->
write_buffer8
(
MSG_REVERSE_DECK
);
pduel
->
write_buffer8
(
MSG_REVERSE_DECK
);
}
if
(
rv
)
{
core
.
deck_reversed
=
rv
;
if
(
core
.
deck_reversed
)
{
if
(
player
[
0
].
list_main
.
size
())
{
if
(
player
[
0
].
list_main
.
size
())
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer8
(
0
);
...
@@ -4442,6 +4440,8 @@ int32 field::adjust_step(uint16 step) {
...
@@ -4442,6 +4440,8 @@ int32 field::adjust_step(uint16 step) {
pduel
->
write_buffer32
((
*
player
[
1
].
list_main
.
rbegin
())
->
data
.
code
);
pduel
->
write_buffer32
((
*
player
[
1
].
list_main
.
rbegin
())
->
data
.
code
);
}
}
}
}
}
core
.
deck_reversed
=
rv
;
return
FALSE
;
return
FALSE
;
}
}
case
13
:
{
case
13
:
{
...
...
script/c10248192.lua
View file @
380b5992
...
@@ -6,6 +6,7 @@ function c10248192.initial_effect(c)
...
@@ -6,6 +6,7 @@ function c10248192.initial_effect(c)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCost
(
c10248192
.
cost
)
e1
:
SetCost
(
c10248192
.
cost
)
e1
:
SetTarget
(
c10248192
.
target
)
e1
:
SetOperation
(
c10248192
.
activate
)
e1
:
SetOperation
(
c10248192
.
activate
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
...
...
script/c89258906.lua
View file @
380b5992
...
@@ -5,7 +5,7 @@ function c89258906.initial_effect(c)
...
@@ -5,7 +5,7 @@ function c89258906.initial_effect(c)
e1
:
SetDescription
(
aux
.
Stringid
(
89258906
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
89258906
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_MULTIACT_HAND
)
e1
:
SetProperty
(
EFFECT_FLAG_MULTIACT_HAND
+
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_TO_HAND
)
e1
:
SetCode
(
EVENT_TO_HAND
)
e1
:
SetCondition
(
c89258906
.
condition
)
e1
:
SetCondition
(
c89258906
.
condition
)
e1
:
SetTarget
(
c89258906
.
target
)
e1
:
SetTarget
(
c89258906
.
target
)
...
...
system.conf
View file @
380b5992
...
@@ -7,5 +7,5 @@ lastdeck = test
...
@@ -7,5 +7,5 @@ lastdeck = test
textfont
=
c
:/
windows
/
fonts
/
simsun
.
ttc
14
textfont
=
c
:/
windows
/
fonts
/
simsun
.
ttc
14
numfont
=
c
:/
windows
/
fonts
/
arialbd
.
ttf
numfont
=
c
:/
windows
/
fonts
/
arialbd
.
ttf
serverport
=
7911
serverport
=
7911
lastip
=
192
.
168
.
2
.
100
lastip
=
192
.
168
.
3
.
235
lastport
=
7911
lastport
=
7911
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