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
REIKAI
ygopro
Commits
6926fb01
Commit
6926fb01
authored
Aug 07, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
95c88fd8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
58 deletions
+104
-58
ocgcore/card.cpp
ocgcore/card.cpp
+10
-10
ocgcore/effect.cpp
ocgcore/effect.cpp
+1
-1
ocgcore/field.cpp
ocgcore/field.cpp
+13
-8
ocgcore/interpreter.cpp
ocgcore/interpreter.cpp
+2
-2
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+11
-5
ocgcore/operations.cpp
ocgcore/operations.cpp
+39
-18
ocgcore/processor.cpp
ocgcore/processor.cpp
+28
-14
No files found.
ocgcore/card.cpp
View file @
6926fb01
...
...
@@ -91,27 +91,27 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
if
(
query_flag
&
QUERY_BASE_DEFENCE
)
q_cache
.
base_defence
=
*
p
++
=
get_base_defence
();
if
(
query_flag
&
QUERY_REASON
)
q_cache
.
reason
=
*
p
++
=
current
.
reason
;
}
else
{
if
((
query_flag
&
QUERY_ALIAS
)
&&
((
tdata
=
get_code
())
!=
q_cache
.
alias
))
{
if
((
query_flag
&
QUERY_ALIAS
)
&&
((
uint32
)(
tdata
=
get_code
())
!=
q_cache
.
alias
))
{
q_cache
.
alias
=
tdata
;
*
p
++
=
tdata
;
}
else
query_flag
&=
~
QUERY_ALIAS
;
if
((
query_flag
&
QUERY_TYPE
)
&&
((
tdata
=
get_type
())
!=
q_cache
.
type
))
{
if
((
query_flag
&
QUERY_TYPE
)
&&
((
uint32
)(
tdata
=
get_type
())
!=
q_cache
.
type
))
{
q_cache
.
type
=
tdata
;
*
p
++
=
tdata
;
}
else
query_flag
&=
~
QUERY_TYPE
;
if
((
query_flag
&
QUERY_LEVEL
)
&&
((
tdata
=
get_level
())
!=
q_cache
.
level
))
{
if
((
query_flag
&
QUERY_LEVEL
)
&&
((
uint32
)(
tdata
=
get_level
())
!=
q_cache
.
level
))
{
q_cache
.
level
=
tdata
;
*
p
++
=
tdata
;
}
else
query_flag
&=
~
QUERY_LEVEL
;
if
((
query_flag
&
QUERY_RANK
)
&&
((
tdata
=
get_rank
())
!=
q_cache
.
rank
))
{
if
((
query_flag
&
QUERY_RANK
)
&&
((
uint32
)(
tdata
=
get_rank
())
!=
q_cache
.
rank
))
{
q_cache
.
rank
=
tdata
;
*
p
++
=
tdata
;
}
else
query_flag
&=
~
QUERY_RANK
;
if
((
query_flag
&
QUERY_ATTRIBUTE
)
&&
((
tdata
=
get_attribute
())
!=
q_cache
.
attribute
))
{
if
((
query_flag
&
QUERY_ATTRIBUTE
)
&&
((
uint32
)(
tdata
=
get_attribute
())
!=
q_cache
.
attribute
))
{
q_cache
.
attribute
=
tdata
;
*
p
++
=
tdata
;
}
else
query_flag
&=
~
QUERY_ATTRIBUTE
;
if
((
query_flag
&
QUERY_RACE
)
&&
((
tdata
=
get_race
())
!=
q_cache
.
race
))
{
if
((
query_flag
&
QUERY_RACE
)
&&
((
uint32
)(
tdata
=
get_race
())
!=
q_cache
.
race
))
{
q_cache
.
race
=
tdata
;
*
p
++
=
tdata
;
}
else
query_flag
&=
~
QUERY_RACE
;
...
...
@@ -131,7 +131,7 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
q_cache
.
base_defence
=
tdata
;
*
p
++
=
tdata
;
}
else
query_flag
&=
~
QUERY_BASE_DEFENCE
;
if
((
query_flag
&
QUERY_REASON
)
&&
((
tdata
=
current
.
reason
)
!=
q_cache
.
reason
))
{
if
((
query_flag
&
QUERY_REASON
)
&&
((
uint32
)(
tdata
=
current
.
reason
)
!=
q_cache
.
reason
))
{
q_cache
.
reason
=
tdata
;
*
p
++
=
tdata
;
}
else
query_flag
&=
~
QUERY_REASON
;
...
...
@@ -1253,7 +1253,7 @@ int32 card::filter_summon_procedure(uint8 playerid, effect_set* peset, uint8 ign
return
FALSE
;
if
(
min
==
0
)
return
TRUE
;
u
int32
m
=
pduel
->
game_field
->
get_summon_release_list
(
this
,
0
,
0
);
int32
m
=
pduel
->
game_field
->
get_summon_release_list
(
this
,
0
,
0
);
if
(
m
>=
min
)
return
TRUE
;
return
FALSE
;
...
...
@@ -1288,7 +1288,7 @@ int32 card::filter_set_procedure(uint8 playerid, effect_set* peset, uint8 ignore
return
FALSE
;
if
(
min
==
0
)
return
TRUE
;
u
int32
m
=
pduel
->
game_field
->
get_summon_release_list
(
this
,
0
,
0
);
int32
m
=
pduel
->
game_field
->
get_summon_release_list
(
this
,
0
,
0
);
if
(
m
>=
min
)
return
TRUE
;
return
FALSE
;
...
...
@@ -1771,7 +1771,7 @@ int32 card::is_releasable_by_nonsummon(uint8 playerid) {
return
FALSE
;
if
(
current
.
location
&
(
LOCATION_GRAVE
+
LOCATION_REMOVED
))
return
FALSE
;
if
((
current
.
location
==
LOCATION_HAND
)
&&
(
data
.
type
&
TYPE_SPELL
+
TYPE_TRAP
))
if
((
current
.
location
==
LOCATION_HAND
)
&&
(
data
.
type
&
(
TYPE_SPELL
|
TYPE_TRAP
)
))
return
FALSE
;
if
(
!
pduel
->
game_field
->
is_player_can_release
(
playerid
,
this
))
return
FALSE
;
...
...
ocgcore/effect.cpp
View file @
6926fb01
...
...
@@ -391,7 +391,7 @@ int32 effect::is_immuned(effect_set_v* effects) {
int32
effect
::
is_chainable
(
uint8
tp
)
{
if
(
!
(
type
&
EFFECT_TYPE_ACTIONS
))
return
FALSE
;
u
int32
sp
=
get_speed
();
int32
sp
=
get_speed
();
if
((
type
&
EFFECT_TYPE_ACTIVATE
)
&&
(
sp
<=
1
)
&&
!
(
flag
&
EFFECT_FLAG_COF
))
return
FALSE
;
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
...
...
ocgcore/field.cpp
View file @
6926fb01
...
...
@@ -148,6 +148,7 @@ void field::add_card(uint8 playerid, card* pcard, uint8 location, uint8 sequence
if
(
!
core
.
shuffle_check_disabled
)
core
.
shuffle_deck_check
[
playerid
]
=
TRUE
;
}
pcard
->
current
.
position
=
POS_FACEDOWN
;
break
;
case
LOCATION_HAND
:
player
[
playerid
].
list_hand
.
push_back
(
pcard
);
...
...
@@ -492,11 +493,15 @@ void field::shuffle(uint8 playerid, uint8 location) {
pduel
->
write_buffer8
(
MSG_SHUFFLE_DECK
);
pduel
->
write_buffer8
(
playerid
);
core
.
shuffle_deck_check
[
playerid
]
=
FALSE
;
if
(
core
.
deck_reversed
)
{
card
*
ptop
=
*
svector
.
rbegin
();
if
(
core
.
deck_reversed
||
(
ptop
->
current
.
position
==
POS_FACEUP_DEFENCE
))
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer32
((
*
svector
.
rbegin
())
->
data
.
code
);
if
(
ptop
->
current
.
position
!=
POS_FACEUP_DEFENCE
)
pduel
->
write_buffer32
(
ptop
->
data
.
code
);
else
pduel
->
write_buffer32
(
ptop
->
data
.
code
|
0x80000000
);
}
}
}
...
...
@@ -1041,7 +1046,7 @@ effect* field::is_player_affected_by_effect(uint8 playerid, uint32 code) {
int32
field
::
get_release_list
(
uint8
playerid
,
card_set
*
release_list
,
card_set
*
ex_list
,
int32
use_con
,
int32
use_hand
,
int32
fun
,
int32
exarg
,
card
*
exp
)
{
card
*
pcard
;
uint32
rcount
=
0
;
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
for
(
uint32
i
=
0
;
i
<
5
;
++
i
)
{
pcard
=
player
[
playerid
].
list_mzone
[
i
];
if
(
pcard
&&
pcard
!=
exp
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
...
...
@@ -1052,7 +1057,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
}
}
if
(
use_hand
)
{
for
(
int
i
=
0
;
i
<
player
[
playerid
].
list_hand
.
size
();
++
i
)
{
for
(
uint32
i
=
0
;
i
<
player
[
playerid
].
list_hand
.
size
();
++
i
)
{
pcard
=
player
[
playerid
].
list_hand
[
i
];
if
(
pcard
&&
pcard
!=
exp
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
...
...
@@ -1063,7 +1068,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
}
}
}
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
for
(
uint32
i
=
0
;
i
<
5
;
++
i
)
{
pcard
=
player
[
1
-
playerid
].
list_mzone
[
i
];
if
(
pcard
&&
pcard
!=
exp
&&
(
pcard
->
is_position
(
POS_FACEUP
)
||
!
use_con
)
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
...
...
@@ -1077,7 +1082,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
}
int32
field
::
check_release_list
(
uint8
playerid
,
int32
count
,
int32
use_con
,
int32
use_hand
,
int32
fun
,
int32
exarg
,
card
*
exp
)
{
card
*
pcard
;
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
for
(
uint32
i
=
0
;
i
<
5
;
++
i
)
{
pcard
=
player
[
playerid
].
list_mzone
[
i
];
if
(
pcard
&&
pcard
!=
exp
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
...
...
@@ -1087,7 +1092,7 @@ int32 field::check_release_list(uint8 playerid, int32 count, int32 use_con, int3
}
}
if
(
use_hand
)
{
for
(
int
i
=
0
;
i
<
player
[
playerid
].
list_hand
.
size
();
++
i
)
{
for
(
uint32
i
=
0
;
i
<
player
[
playerid
].
list_hand
.
size
();
++
i
)
{
pcard
=
player
[
playerid
].
list_hand
[
i
];
if
(
pcard
&&
pcard
!=
exp
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
...
...
@@ -1097,7 +1102,7 @@ int32 field::check_release_list(uint8 playerid, int32 count, int32 use_con, int3
}
}
}
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
for
(
uint32
i
=
0
;
i
<
5
;
++
i
)
{
pcard
=
player
[
1
-
playerid
].
list_mzone
[
i
];
if
(
pcard
&&
pcard
!=
exp
&&
(
!
use_con
||
pcard
->
is_position
(
POS_FACEUP
))
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
...
...
ocgcore/interpreter.cpp
View file @
6926fb01
...
...
@@ -853,7 +853,7 @@ int32 interpreter::check_matching(card* pcard, int32 findex, int32 extraargs) {
call_depth
++
;
lua_pushvalue
(
current_state
,
findex
);
interpreter
::
card2value
(
current_state
,
pcard
);
for
(
u
int32
i
=
0
;
i
<
extraargs
;
++
i
)
for
(
int32
i
=
0
;
i
<
extraargs
;
++
i
)
lua_pushvalue
(
current_state
,
(
int32
)(
-
extraargs
-
2
));
if
(
lua_pcall
(
current_state
,
1
+
extraargs
,
1
,
0
))
{
sprintf
(
pduel
->
strbuffer
,
lua_tostring
(
current_state
,
-
1
));
...
...
@@ -881,7 +881,7 @@ int32 interpreter::get_operation_value(card* pcard, int32 findex, int32 extraarg
call_depth
++
;
lua_pushvalue
(
current_state
,
findex
);
interpreter
::
card2value
(
current_state
,
pcard
);
for
(
u
int32
i
=
0
;
i
<
extraargs
;
++
i
)
for
(
int32
i
=
0
;
i
<
extraargs
;
++
i
)
lua_pushvalue
(
current_state
,
(
int32
)(
-
extraargs
-
2
));
if
(
lua_pcall
(
current_state
,
1
+
extraargs
,
1
,
0
))
{
sprintf
(
pduel
->
strbuffer
,
lua_tostring
(
current_state
,
-
1
));
...
...
ocgcore/libduel.cpp
View file @
6926fb01
...
...
@@ -603,11 +603,17 @@ int32 scriptlib::duel_confirm_decktop(lua_State *L) {
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
if
(
count
>=
pduel
->
game_field
->
player
[
playerid
].
list_main
.
size
())
count
=
pduel
->
game_field
->
player
[
playerid
].
list_main
.
size
();
else
if
(
pduel
->
game_field
->
core
.
deck_reversed
)
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
count
);
pduel
->
write_buffer32
((
*
(
pduel
->
game_field
->
player
[
playerid
].
list_main
.
rbegin
()
+
count
))
->
data
.
code
);
else
if
(
pduel
->
game_field
->
player
[
playerid
].
list_main
.
size
()
>
count
)
{
card
*
pcard
=
*
(
pduel
->
game_field
->
player
[
playerid
].
list_main
.
rbegin
()
+
count
);
if
(
pduel
->
game_field
->
core
.
deck_reversed
)
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
count
);
if
(
pcard
->
current
.
position
!=
POS_FACEUP_DEFENCE
)
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
else
pduel
->
write_buffer32
(
pcard
->
data
.
code
|
0x80000000
);
}
}
auto
cit
=
pduel
->
game_field
->
player
[
playerid
].
list_main
.
rbegin
();
pduel
->
write_buffer8
(
MSG_CONFIRM_DECKTOP
);
...
...
ocgcore/operations.cpp
View file @
6926fb01
...
...
@@ -332,9 +332,10 @@ int32 field::draw(uint16 step, effect* reason_effect, uint32 reason, uint8 reaso
pcard
->
current
.
location
=
0
;
add_card
(
playerid
,
pcard
,
LOCATION_HAND
,
0
);
pcard
->
enable_field_effect
(
TRUE
);
if
(
pcard
->
is_affected_by_effect
(
EFFECT_PUBLIC
))
{
pcard
->
set_status
(
STATUS_IS_PUBLIC
,
TRUE
);
if
((
pcard
->
current
.
position
==
POS_FACEUP_ATTACK
)
||
pcard
->
is_affected_by_effect
(
EFFECT_PUBLIC
))
{
public_count
++
;
if
(
pcard
->
current
.
position
!=
POS_FACEUP_ATTACK
)
pcard
->
set_status
(
STATUS_IS_PUBLIC
,
TRUE
);
}
cv
.
push_back
(
pcard
);
drawed_set
->
container
.
insert
(
pcard
);
...
...
@@ -343,11 +344,17 @@ int32 field::draw(uint16 step, effect* reason_effect, uint32 reason, uint8 reaso
adjust_instant
();
core
.
units
.
begin
()
->
arg2
=
(
core
.
units
.
begin
()
->
arg2
&
0xff000000
)
+
drawed
;
if
(
drawed
)
{
if
(
core
.
deck_reversed
&&
player
[
playerid
].
list_main
.
size
())
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
drawed
);
pduel
->
write_buffer32
((
*
player
[
playerid
].
list_main
.
rbegin
())
->
data
.
code
);
if
(
player
[
playerid
].
list_main
.
size
())
{
card
*
ptop
=
*
player
[
playerid
].
list_main
.
rbegin
();
if
(
core
.
deck_reversed
||
(
ptop
->
current
.
position
==
POS_FACEUP_DEFENCE
))
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
drawed
);
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_DRAW
);
pduel
->
write_buffer8
(
playerid
);
...
...
@@ -2514,7 +2521,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
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
)
{
for
(
uint32
i
=
0
;
i
<
cv
.
size
();
++
i
)
{
card
*
pcard
=
cv
[
i
];
if
(
pcard
->
current
.
location
!=
LOCATION_DECK
)
continue
;
...
...
@@ -2597,7 +2604,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
pduel
->
write_buffer8
(
pcard
->
current
.
sequence
);
pduel
->
write_buffer8
(
pcard
->
current
.
position
);
pduel
->
write_buffer32
(
pcard
->
current
.
reason
);
if
(
core
.
deck_reversed
&&
pcard
->
current
.
location
==
LOCATION_DECK
)
if
(
(
core
.
deck_reversed
&&
pcard
->
current
.
location
==
LOCATION_DECK
)
||
(
pcard
->
current
.
position
==
POS_FACEUP_DEFENCE
)
)
show_decktop
[
pcard
->
current
.
controler
]
=
true
;
pcard
->
set_status
(
STATUS_LEAVE_CONFIRMED
,
FALSE
);
if
(
pcard
->
status
&
(
STATUS_SUMMON_DISABLED
|
STATUS_ACTIVATE_DISABLED
))
{
...
...
@@ -2614,16 +2621,24 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
}
}
if
(
show_decktop
[
0
])
{
card
*
ptop
=
*
player
[
0
].
list_main
.
rbegin
();
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer32
((
*
player
[
0
].
list_main
.
rbegin
())
->
data
.
code
);
if
(
ptop
->
current
.
position
!=
POS_FACEUP_DEFENCE
)
pduel
->
write_buffer32
(
ptop
->
data
.
code
);
else
pduel
->
write_buffer32
(
ptop
->
data
.
code
|
0x80000000
);
}
if
(
show_decktop
[
1
])
{
card
*
ptop
=
*
player
[
1
].
list_main
.
rbegin
();
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
1
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer32
((
*
player
[
1
].
list_main
.
rbegin
())
->
data
.
code
);
if
(
ptop
->
current
.
position
!=
POS_FACEUP_DEFENCE
)
pduel
->
write_buffer32
(
ptop
->
data
.
code
);
else
pduel
->
write_buffer32
(
ptop
->
data
.
code
|
0x80000000
);
}
adjust_instant
();
process_single_event
();
...
...
@@ -2743,11 +2758,17 @@ int32 field::discard_deck(uint16 step, uint8 playerid, uint8 count, uint32 reaso
dest
=
redirect
;
}
}
if
(
core
.
deck_reversed
&&
player
[
playerid
].
list_main
.
size
()
>
count
)
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
count
);
pduel
->
write_buffer32
((
*
(
player
[
playerid
].
list_main
.
rbegin
()
+
count
))
->
data
.
code
);
if
(
player
[
playerid
].
list_main
.
size
()
>
count
)
{
card
*
ptop
=
*
(
player
[
playerid
].
list_main
.
rbegin
()
+
count
);
if
(
core
.
deck_reversed
||
(
ptop
->
current
.
position
==
POS_FACEUP_DEFENCE
))
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
count
);
if
(
ptop
->
current
.
position
!=
POS_FACEUP_DEFENCE
)
pduel
->
write_buffer32
(
ptop
->
data
.
code
);
else
pduel
->
write_buffer32
(
ptop
->
data
.
code
|
0x80000000
);
}
}
return
FALSE
;
}
...
...
@@ -2913,8 +2934,8 @@ int32 field::move_to_field(uint16 step, card * target, uint32 enable, uint32 ret
}
case
2
:
{
if
(
core
.
deck_reversed
&&
(
target
->
current
.
location
==
LOCATION_DECK
))
{
int32
curp
=
target
->
current
.
controler
;
int32
curs
=
target
->
current
.
sequence
;
u
int32
curp
=
target
->
current
.
controler
;
u
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
);
...
...
ocgcore/processor.cpp
View file @
6926fb01
...
...
@@ -957,11 +957,17 @@ int32 field::process() {
tc
[
count
-
i
-
1
]
->
current
.
sequence
=
player
[
target_player
].
list_main
.
size
()
-
1
;
}
}
if
(
count
>
0
&&
core
.
deck_reversed
)
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
target_player
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer32
((
*
player
[
target_player
].
list_main
.
rbegin
())
->
data
.
code
);
if
(
count
>
0
)
{
card
*
ptop
=
*
player
[
target_player
].
list_main
.
rbegin
();
if
(
core
.
deck_reversed
||
(
ptop
->
current
.
position
==
POS_FACEUP_DEFENCE
))
{
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
target_player
);
pduel
->
write_buffer8
(
0
);
if
(
ptop
->
current
.
position
!=
POS_FACEUP_DEFENCE
)
pduel
->
write_buffer32
(
ptop
->
data
.
code
);
else
pduel
->
write_buffer32
(
ptop
->
data
.
code
|
0x80000000
);
}
}
core
.
units
.
pop_front
();
}
...
...
@@ -2476,7 +2482,7 @@ int32 field::process_battle_command(uint16 step) {
core
.
chain_attack_target
=
0
;
core
.
attacker
=
0
;
core
.
attack_target
=
0
;
if
(
peffect
=
is_player_affected_by_effect
(
infos
.
turn_player
,
EFFECT_SKIP_BP
))
{
if
(
(
peffect
=
is_player_affected_by_effect
(
infos
.
turn_player
,
EFFECT_SKIP_BP
)
))
{
core
.
units
.
begin
()
->
step
=
39
;
core
.
units
.
begin
()
->
arg1
=
2
;
if
(
is_player_affected_by_effect
(
infos
.
turn_player
,
EFFECT_BP_TWICE
))
...
...
@@ -2768,7 +2774,7 @@ int32 field::process_battle_command(uint16 step) {
core
.
attacker
->
set_status
(
STATUS_ATTACK_CANCELED
,
TRUE
);
}
effect
*
peffect
;
if
(
peffect
=
is_player_affected_by_effect
(
infos
.
turn_player
,
EFFECT_SKIP_BP
))
{
if
(
(
peffect
=
is_player_affected_by_effect
(
infos
.
turn_player
,
EFFECT_SKIP_BP
)
))
{
core
.
units
.
begin
()
->
step
=
39
;
core
.
units
.
begin
()
->
arg1
=
2
;
if
(
is_player_affected_by_effect
(
infos
.
turn_player
,
EFFECT_BP_TWICE
))
...
...
@@ -2993,7 +2999,7 @@ int32 field::process_battle_command(uint16 step) {
return
FALSE
;
}
case
22
:
{
int32
r
=
core
.
temp_var
[
2
]
==
0
?
0
:
REASON_REPLACE
;
int32
r
=
core
.
temp_var
[
2
]
==
0
?
0
:
REASON_REPLACE
;
raise_single_event
(
core
.
attacker
,
0
,
EVENT_BATTLE_CONFIRM
,
0
,
r
,
0
,
0
,
0
);
if
(
core
.
attack_target
)
{
if
(
core
.
attack_target
->
temp
.
position
&
POS_FACEDOWN
)
...
...
@@ -4317,7 +4323,7 @@ int32 field::refresh_location_info(uint16 step) {
player
[
p
].
disabled_location
|=
(
value
>>
16
)
&
0x1f
;
if
(
field_used_count
[(
value
>>
16
)
&
0x1f
]
==
0
)
core
.
extraz_effects_e
.
add_item
(
eset
[
i
]);
else
if
(
field_used_count
[(
value
>>
16
)
&
0x1f
]
<
(
value
&
0xffff
))
else
if
(
(
uint32
)
field_used_count
[(
value
>>
16
)
&
0x1f
]
<
(
value
&
0xffff
))
core
.
extraz_effects
.
add_item
(
eset
[
i
]);
}
eset
.
clear
();
...
...
@@ -4328,7 +4334,7 @@ int32 field::refresh_location_info(uint16 step) {
player
[
p
].
disabled_location
|=
(
value
>>
8
)
&
0x1f00
;
if
(
field_used_count
[(
value
>>
16
)
&
0x1f
]
==
0
)
core
.
extraz_effects_e
.
add_item
(
eset
[
i
]);
else
if
(
field_used_count
[(
value
>>
16
)
&
0x1f
]
<
(
value
&
0xffff
))
else
if
(
(
uint32
)
field_used_count
[(
value
>>
16
)
&
0x1f
]
<
(
value
&
0xffff
))
core
.
extraz_effects
.
add_item
(
eset
[
i
]);
}
return
FALSE
;
...
...
@@ -4699,14 +4705,14 @@ int32 field::adjust_step(uint16 step) {
}
case
11
:
{
//shuffle check
for
(
int32
i
=
0
;
i
<
player
[
0
].
list_hand
.
size
();
++
i
)
{
for
(
u
int32
i
=
0
;
i
<
player
[
0
].
list_hand
.
size
();
++
i
)
{
card
*
pcard
=
player
[
0
].
list_hand
[
i
];
int32
pub
=
pcard
->
is_affected_by_effect
(
EFFECT_PUBLIC
)
?
TRUE
:
FALSE
;
if
(
!
pub
&&
(
pcard
->
status
&
STATUS_IS_PUBLIC
))
core
.
shuffle_hand_check
[
0
]
=
TRUE
;
pcard
->
set_status
(
STATUS_IS_PUBLIC
,
pub
);
}
for
(
int32
i
=
0
;
i
<
player
[
1
].
list_hand
.
size
();
++
i
)
{
for
(
u
int32
i
=
0
;
i
<
player
[
1
].
list_hand
.
size
();
++
i
)
{
card
*
pcard
=
player
[
1
].
list_hand
[
i
];
int32
pub
=
pcard
->
is_affected_by_effect
(
EFFECT_PUBLIC
)
?
TRUE
:
FALSE
;
if
(
!
pub
&&
(
pcard
->
status
&
STATUS_IS_PUBLIC
))
...
...
@@ -4730,16 +4736,24 @@ int32 field::adjust_step(uint16 step) {
pduel
->
write_buffer8
(
MSG_REVERSE_DECK
);
if
(
res
)
{
if
(
player
[
0
].
list_main
.
size
())
{
card
*
ptop
=
*
player
[
0
].
list_main
.
rbegin
();
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer32
((
*
player
[
0
].
list_main
.
rbegin
())
->
data
.
code
);
if
(
ptop
->
current
.
position
!=
POS_FACEUP_DEFENCE
)
pduel
->
write_buffer32
(
ptop
->
data
.
code
);
else
pduel
->
write_buffer32
(
ptop
->
data
.
code
|
0x80000000
);
}
if
(
player
[
1
].
list_main
.
size
())
{
card
*
ptop
=
*
player
[
1
].
list_main
.
rbegin
();
pduel
->
write_buffer8
(
MSG_DECK_TOP
);
pduel
->
write_buffer8
(
1
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer32
((
*
player
[
1
].
list_main
.
rbegin
())
->
data
.
code
);
if
(
ptop
->
current
.
position
!=
POS_FACEUP_DEFENCE
)
pduel
->
write_buffer32
(
ptop
->
data
.
code
);
else
pduel
->
write_buffer32
(
ptop
->
data
.
code
|
0x80000000
);
}
}
}
...
...
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