Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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
nanahira
ygopro-core
Commits
504ff1fa
Commit
504ff1fa
authored
Apr 12, 2017
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
838f354c
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
61 additions
and
121 deletions
+61
-121
card.cpp
card.cpp
+3
-19
effect.cpp
effect.cpp
+4
-10
effect.h
effect.h
+1
-1
field.cpp
field.cpp
+24
-12
field.h
field.h
+3
-1
ocgapi.cpp
ocgapi.cpp
+1
-1
operations.cpp
operations.cpp
+4
-22
processor.cpp
processor.cpp
+21
-55
No files found.
card.cpp
View file @
504ff1fa
...
@@ -1154,25 +1154,9 @@ void card::get_linked_cards(card_set* cset) {
...
@@ -1154,25 +1154,9 @@ void card::get_linked_cards(card_set* cset) {
if
(
!
(
data
.
type
&
TYPE_LINK
)
||
current
.
location
!=
LOCATION_MZONE
)
if
(
!
(
data
.
type
&
TYPE_LINK
)
||
current
.
location
!=
LOCATION_MZONE
)
return
;
return
;
int32
p
=
current
.
controler
;
int32
p
=
current
.
controler
;
uint32
zones
=
get_linked_zone
();
uint32
linked_zone
=
get_linked_zone
();
uint32
icheck
=
0x1
;
pduel
->
game_field
->
get_cards_in_zone
(
cset
,
linked_zone
,
p
);
for
(
auto
it
=
pduel
->
game_field
->
player
[
p
].
list_mzone
.
begin
();
it
!=
pduel
->
game_field
->
player
[
p
].
list_mzone
.
end
();
++
it
)
{
pduel
->
game_field
->
get_cards_in_zone
(
cset
,
linked_zone
>>
16
,
1
-
p
);
if
(
zones
&
icheck
)
{
card
*
pcard
=
*
it
;
if
(
pcard
)
cset
->
insert
(
pcard
);
}
icheck
<<=
1
;
}
icheck
=
0x10000
;
for
(
auto
it
=
pduel
->
game_field
->
player
[
1
-
p
].
list_mzone
.
begin
();
it
!=
pduel
->
game_field
->
player
[
1
-
p
].
list_mzone
.
end
();
++
it
)
{
if
(
zones
&
icheck
)
{
card
*
pcard
=
*
it
;
if
(
pcard
)
cset
->
insert
(
pcard
);
}
icheck
<<=
1
;
}
}
}
uint32
card
::
get_mutual_linked_zone
()
{
uint32
card
::
get_mutual_linked_zone
()
{
if
(
!
(
data
.
type
&
TYPE_LINK
)
||
current
.
location
!=
LOCATION_MZONE
)
if
(
!
(
data
.
type
&
TYPE_LINK
)
||
current
.
location
!=
LOCATION_MZONE
)
...
...
effect.cpp
View file @
504ff1fa
...
@@ -679,19 +679,13 @@ uint8 effect::get_handler_player() {
...
@@ -679,19 +679,13 @@ uint8 effect::get_handler_player() {
return
effect_owner
;
return
effect_owner
;
return
get_handler
()
->
current
.
controler
;
return
get_handler
()
->
current
.
controler
;
}
}
int32
effect
::
in_range
(
int32
loc
,
int32
seq
)
{
int32
effect
::
in_range
(
card
*
pcard
)
{
if
(
type
&
EFFECT_TYPE_XMATERIAL
)
if
(
type
&
EFFECT_TYPE_XMATERIAL
)
return
handler
->
overlay_target
?
TRUE
:
FALSE
;
return
handler
->
overlay_target
?
TRUE
:
FALSE
;
if
(
loc
!=
LOCATION_SZONE
)
return
pcard
->
current
.
is_location
(
range
);
return
range
&
loc
;
if
(
seq
<
5
)
return
range
&
LOCATION_SZONE
;
if
(
seq
==
5
)
return
range
&
(
LOCATION_SZONE
|
LOCATION_FZONE
);
return
range
&
LOCATION_PZONE
;
}
}
int32
effect
::
in_range
(
c
ard
*
pcard
)
{
int32
effect
::
in_range
(
c
onst
chain
&
ch
)
{
if
(
type
&
EFFECT_TYPE_XMATERIAL
)
if
(
type
&
EFFECT_TYPE_XMATERIAL
)
return
handler
->
overlay_target
?
TRUE
:
FALSE
;
return
handler
->
overlay_target
?
TRUE
:
FALSE
;
return
pcard
->
current
.
is_location
(
range
)
;
return
range
&
ch
.
triggering_location
;
}
}
effect.h
View file @
504ff1fa
...
@@ -89,8 +89,8 @@ public:
...
@@ -89,8 +89,8 @@ public:
uint8
get_owner_player
();
uint8
get_owner_player
();
card
*
get_handler
()
const
;
card
*
get_handler
()
const
;
uint8
get_handler_player
();
uint8
get_handler_player
();
int32
in_range
(
int32
loc
,
int32
seq
);
int32
in_range
(
card
*
pcard
);
int32
in_range
(
card
*
pcard
);
int32
in_range
(
const
chain
&
ch
);
bool
is_flag
(
effect_flag
flag
)
const
{
bool
is_flag
(
effect_flag
flag
)
const
{
return
!!
(
this
->
flag
[
0
]
&
flag
);
return
!!
(
this
->
flag
[
0
]
&
flag
);
}
}
...
...
field.cpp
View file @
504ff1fa
...
@@ -20,6 +20,16 @@ int32 field::field_used_count[32] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3
...
@@ -20,6 +20,16 @@ int32 field::field_used_count[32] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3
bool
chain
::
chain_operation_sort
(
const
chain
&
c1
,
const
chain
&
c2
)
{
bool
chain
::
chain_operation_sort
(
const
chain
&
c1
,
const
chain
&
c2
)
{
return
c1
.
triggering_effect
->
id
<
c2
.
triggering_effect
->
id
;
return
c1
.
triggering_effect
->
id
<
c2
.
triggering_effect
->
id
;
}
}
void
chain
::
set_triggering_place
(
card
*
pcard
)
{
triggering_controler
=
pcard
->
current
.
controler
;
if
(
pcard
->
current
.
is_location
(
LOCATION_FZONE
))
triggering_location
=
LOCATION_SZONE
|
LOCATION_FZONE
;
else
if
(
pcard
->
current
.
is_location
(
LOCATION_PZONE
))
triggering_location
=
LOCATION_SZONE
|
LOCATION_PZONE
;
else
triggering_location
=
pcard
->
current
.
location
;
triggering_sequence
=
pcard
->
current
.
sequence
;
}
bool
tevent
::
operator
<
(
const
tevent
&
v
)
const
{
bool
tevent
::
operator
<
(
const
tevent
&
v
)
const
{
return
memcmp
(
this
,
&
v
,
sizeof
(
tevent
))
<
0
;
return
memcmp
(
this
,
&
v
,
sizeof
(
tevent
))
<
0
;
}
}
...
@@ -139,7 +149,7 @@ void field::reload_field_info() {
...
@@ -139,7 +149,7 @@ void field::reload_field_info() {
pduel
->
write_buffer32
(
peffect
->
get_handler
()
->
data
.
code
);
pduel
->
write_buffer32
(
peffect
->
get_handler
()
->
data
.
code
);
pduel
->
write_buffer32
(
peffect
->
get_handler
()
->
get_info_location
());
pduel
->
write_buffer32
(
peffect
->
get_handler
()
->
get_info_location
());
pduel
->
write_buffer8
(
chit
->
triggering_controler
);
pduel
->
write_buffer8
(
chit
->
triggering_controler
);
pduel
->
write_buffer8
(
chit
->
triggering_location
);
pduel
->
write_buffer8
(
(
uint8
)
chit
->
triggering_location
);
pduel
->
write_buffer8
(
chit
->
triggering_sequence
);
pduel
->
write_buffer8
(
chit
->
triggering_sequence
);
pduel
->
write_buffer32
(
peffect
->
description
);
pduel
->
write_buffer32
(
peffect
->
description
);
}
}
...
@@ -719,6 +729,17 @@ int32 field::check_extra_link(int32 playerid, card* pcard, int32 sequence) {
...
@@ -719,6 +729,17 @@ int32 field::check_extra_link(int32 playerid, card* pcard, int32 sequence) {
pcard
->
current
.
sequence
=
cur_sequence
;
pcard
->
current
.
sequence
=
cur_sequence
;
return
ret
;
return
ret
;
}
}
void
field
::
get_cards_in_zone
(
card_set
*
cset
,
uint32
zone
,
int32
playerid
)
{
uint32
icheck
=
0x1
;
for
(
auto
it
=
player
[
playerid
].
list_mzone
.
begin
();
it
!=
player
[
playerid
].
list_mzone
.
end
();
++
it
)
{
if
(
zone
&
icheck
)
{
card
*
pcard
=
*
it
;
if
(
pcard
)
cset
->
insert
(
pcard
);
}
icheck
<<=
1
;
}
}
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
;
...
@@ -2372,17 +2393,8 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
...
@@ -2372,17 +2393,8 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
int32
ct
=
get_useable_count
(
pcard
,
playerid
,
LOCATION_MZONE
,
playerid
,
LOCATION_REASON_TOFIELD
);
int32
ct
=
get_useable_count
(
pcard
,
playerid
,
LOCATION_MZONE
,
playerid
,
LOCATION_REASON_TOFIELD
);
card_set
linked_cards
;
card_set
linked_cards
;
if
(
ct
<=
0
)
{
if
(
ct
<=
0
)
{
uint32
linked_zone
=
get_linked_zone
(
playerid
);
uint32
linked_zone
=
core
.
duel_rule
>=
4
?
get_linked_zone
(
playerid
)
|
(
1u
<<
5
)
|
(
1u
<<
6
)
:
0x1f
;
linked_zone
|=
(
1u
<<
5
)
|
(
1u
<<
6
);
get_cards_in_zone
(
&
linked_cards
,
linked_zone
,
playerid
);
uint32
icheck
=
0x1
;
for
(
auto
it
=
player
[
playerid
].
list_mzone
.
begin
();
it
!=
player
[
playerid
].
list_mzone
.
end
();
++
it
)
{
if
(
linked_zone
&
icheck
)
{
card
*
pcard
=
*
it
;
if
(
pcard
)
linked_cards
.
insert
(
pcard
);
}
icheck
<<=
1
;
}
if
(
linked_cards
.
find
(
tuner
)
!=
linked_cards
.
end
())
if
(
linked_cards
.
find
(
tuner
)
!=
linked_cards
.
end
())
ct
++
;
ct
++
;
}
}
...
...
field.h
View file @
504ff1fa
...
@@ -49,7 +49,7 @@ struct chain {
...
@@ -49,7 +49,7 @@ struct chain {
uint8
chain_count
;
uint8
chain_count
;
uint8
triggering_player
;
uint8
triggering_player
;
uint8
triggering_controler
;
uint8
triggering_controler
;
uint
8
triggering_location
;
uint
16
triggering_location
;
uint8
triggering_sequence
;
uint8
triggering_sequence
;
effect
*
triggering_effect
;
effect
*
triggering_effect
;
group
*
target_cards
;
group
*
target_cards
;
...
@@ -62,6 +62,7 @@ struct chain {
...
@@ -62,6 +62,7 @@ struct chain {
opmap
opinfos
;
opmap
opinfos
;
uint32
flag
;
uint32
flag
;
static
bool
chain_operation_sort
(
const
chain
&
c1
,
const
chain
&
c2
);
static
bool
chain_operation_sort
(
const
chain
&
c1
,
const
chain
&
c2
);
void
set_triggering_place
(
card
*
pcard
);
};
};
struct
player_info
{
struct
player_info
{
...
@@ -347,6 +348,7 @@ public:
...
@@ -347,6 +348,7 @@ public:
uint32
get_linked_zone
(
int32
playerid
);
uint32
get_linked_zone
(
int32
playerid
);
int32
check_extra_link
(
int32
playerid
);
int32
check_extra_link
(
int32
playerid
);
int32
check_extra_link
(
int32
playerid
,
card
*
pcard
,
int32
sequence
);
int32
check_extra_link
(
int32
playerid
,
card
*
pcard
,
int32
sequence
);
void
get_cards_in_zone
(
card_set
*
cset
,
uint32
zone
,
int32
playerid
);
void
shuffle
(
uint8
playerid
,
uint8
location
);
void
shuffle
(
uint8
playerid
,
uint8
location
);
void
reset_sequence
(
uint8
playerid
,
uint8
location
);
void
reset_sequence
(
uint8
playerid
,
uint8
location
);
void
swap_deck_and_grave
(
uint8
playerid
);
void
swap_deck_and_grave
(
uint8
playerid
);
...
...
ocgapi.cpp
View file @
504ff1fa
...
@@ -335,7 +335,7 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
...
@@ -335,7 +335,7 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
*
((
int
*
)(
buf
))
=
peffect
->
get_handler
()
->
get_info_location
();
*
((
int
*
)(
buf
))
=
peffect
->
get_handler
()
->
get_info_location
();
buf
+=
4
;
buf
+=
4
;
*
buf
++
=
chit
->
triggering_controler
;
*
buf
++
=
chit
->
triggering_controler
;
*
buf
++
=
chit
->
triggering_location
;
*
buf
++
=
(
uint8
)
chit
->
triggering_location
;
*
buf
++
=
chit
->
triggering_sequence
;
*
buf
++
=
chit
->
triggering_sequence
;
*
((
int
*
)(
buf
))
=
peffect
->
description
;
*
((
int
*
)(
buf
))
=
peffect
->
description
;
buf
+=
4
;
buf
+=
4
;
...
...
operations.cpp
View file @
504ff1fa
...
@@ -4681,17 +4681,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -4681,17 +4681,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
int32
ct
=
get_useable_count
(
pcard
,
playerid
,
LOCATION_MZONE
,
playerid
,
LOCATION_REASON_TOFIELD
);
int32
ct
=
get_useable_count
(
pcard
,
playerid
,
LOCATION_MZONE
,
playerid
,
LOCATION_REASON_TOFIELD
);
if
(
ct
<=
0
)
{
if
(
ct
<=
0
)
{
card_set
linked_cards
;
card_set
linked_cards
;
uint32
linked_zone
=
get_linked_zone
(
playerid
);
uint32
linked_zone
=
core
.
duel_rule
>=
4
?
get_linked_zone
(
playerid
)
|
(
1u
<<
5
)
|
(
1u
<<
6
)
:
0x1f
;
linked_zone
|=
(
1u
<<
5
)
|
(
1u
<<
6
);
get_cards_in_zone
(
&
linked_cards
,
linked_zone
,
playerid
);
uint32
icheck
=
0x1
;
for
(
auto
it
=
player
[
playerid
].
list_mzone
.
begin
();
it
!=
player
[
playerid
].
list_mzone
.
end
();
++
it
)
{
if
(
linked_zone
&
icheck
)
{
card
*
pcard
=
*
it
;
if
(
pcard
)
linked_cards
.
insert
(
pcard
);
}
icheck
<<=
1
;
}
if
(
linked_cards
.
find
(
tuner
)
!=
linked_cards
.
end
())
if
(
linked_cards
.
find
(
tuner
)
!=
linked_cards
.
end
())
ct
++
;
ct
++
;
if
(
smat
)
{
if
(
smat
)
{
...
@@ -4707,17 +4698,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -4707,17 +4698,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
int32
lv
=
pcard
->
get_level
();
int32
lv
=
pcard
->
get_level
();
int32
playerid
=
pcard
->
current
.
controler
;
int32
playerid
=
pcard
->
current
.
controler
;
card_set
linked_cards
;
card_set
linked_cards
;
uint32
linked_zone
=
get_linked_zone
(
playerid
);
uint32
linked_zone
=
core
.
duel_rule
>=
4
?
get_linked_zone
(
playerid
)
|
(
1u
<<
5
)
|
(
1u
<<
6
)
:
0x1f
;
linked_zone
|=
(
1u
<<
5
)
|
(
1u
<<
6
);
get_cards_in_zone
(
&
linked_cards
,
linked_zone
,
playerid
);
uint32
icheck
=
0x1
;
for
(
auto
it
=
player
[
playerid
].
list_mzone
.
begin
();
it
!=
player
[
playerid
].
list_mzone
.
end
();
++
it
)
{
if
(
linked_zone
&
icheck
)
{
card
*
pcard
=
*
it
;
if
(
pcard
)
linked_cards
.
insert
(
pcard
);
}
icheck
<<=
1
;
}
card_vector
*
select_cards
=
new
card_vector
;
card_vector
*
select_cards
=
new
card_vector
;
select_cards
->
swap
(
core
.
select_cards
);
select_cards
->
swap
(
core
.
select_cards
);
card_vector
*
must_select_cards
=
new
card_vector
;
card_vector
*
must_select_cards
=
new
card_vector
;
...
...
processor.cpp
View file @
504ff1fa
This diff is collapsed.
Click to expand it.
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