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
5519b682
Commit
5519b682
authored
Jun 27, 2015
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
ab57e18c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
55 deletions
+55
-55
ocgcore/card.cpp
ocgcore/card.cpp
+2
-0
ocgcore/field.cpp
ocgcore/field.cpp
+42
-3
ocgcore/field.h
ocgcore/field.h
+2
-0
ocgcore/operations.cpp
ocgcore/operations.cpp
+7
-30
ocgcore/processor.cpp
ocgcore/processor.cpp
+2
-22
No files found.
ocgcore/card.cpp
View file @
5519b682
...
@@ -861,6 +861,8 @@ void card::xyz_overlay(card_set* materials) {
...
@@ -861,6 +861,8 @@ void card::xyz_overlay(card_set* materials) {
}
}
if
(
des
.
size
())
if
(
des
.
size
())
pduel
->
game_field
->
destroy
(
&
des
,
0
,
REASON_LOST_TARGET
+
REASON_RULE
,
PLAYER_NONE
);
pduel
->
game_field
->
destroy
(
&
des
,
0
,
REASON_LOST_TARGET
+
REASON_RULE
,
PLAYER_NONE
);
else
pduel
->
game_field
->
adjust_instant
();
}
}
void
card
::
xyz_add
(
card
*
mat
,
card_set
*
des
)
{
void
card
::
xyz_add
(
card
*
mat
,
card_set
*
des
)
{
if
(
mat
->
overlay_target
==
this
)
if
(
mat
->
overlay_target
==
this
)
...
...
ocgcore/field.cpp
View file @
5519b682
...
@@ -1347,9 +1347,8 @@ int32 field::get_overlay_count(uint8 self, uint8 s, uint8 o) {
...
@@ -1347,9 +1347,8 @@ int32 field::get_overlay_count(uint8 self, uint8 s, uint8 o) {
}
}
void
field
::
update_disable_check_list
(
effect
*
peffect
)
{
void
field
::
update_disable_check_list
(
effect
*
peffect
)
{
card_set
cset
;
card_set
cset
;
card_set
::
iterator
it
;
filter_affected_cards
(
peffect
,
&
cset
);
filter_affected_cards
(
peffect
,
&
cset
);
for
(
it
=
cset
.
begin
();
it
!=
cset
.
end
();
++
it
)
for
(
auto
it
=
cset
.
begin
();
it
!=
cset
.
end
();
++
it
)
add_to_disable_check_list
(
*
it
);
add_to_disable_check_list
(
*
it
);
}
}
void
field
::
add_to_disable_check_list
(
card
*
pcard
)
{
void
field
::
add_to_disable_check_list
(
card
*
pcard
)
{
...
@@ -1391,7 +1390,47 @@ void field::adjust_disable_check_list() {
...
@@ -1391,7 +1390,47 @@ void field::adjust_disable_check_list() {
}
}
}
while
(
effects
.
disable_check_list
.
size
());
}
while
(
effects
.
disable_check_list
.
size
());
}
}
void
field
::
adjust_self_destroy_set
()
{
if
(
core
.
selfdes_disabled
)
return
;
card_set
cset
;
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
for
(
uint8
i
=
0
;
i
<
5
;
++
i
)
{
card
*
pcard
=
player
[
p
].
list_mzone
[
i
];
if
(
pcard
&&
pcard
->
is_position
(
POS_FACEUP
))
cset
.
insert
(
pcard
);
}
for
(
uint8
i
=
0
;
i
<
8
;
++
i
)
{
card
*
pcard
=
player
[
p
].
list_szone
[
i
];
if
(
pcard
&&
pcard
->
is_position
(
POS_FACEUP
))
cset
.
insert
(
pcard
);
}
}
core
.
self_destroy_set
.
clear
();
core
.
self_tograve_set
.
clear
();
effect
*
peffect
;
for
(
auto
cit
=
cset
.
begin
();
cit
!=
cset
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
if
((
!
pcard
->
is_status
(
STATUS_DISABLED
)
&&
(
peffect
=
check_unique_onfield
(
pcard
,
pcard
->
current
.
controler
)))
||
(
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_SELF_DESTROY
)))
{
core
.
self_destroy_set
.
insert
(
pcard
);
pcard
->
current
.
reason_effect
=
peffect
;
pcard
->
current
.
reason_player
=
peffect
->
get_handler_player
();
}
}
if
(
core
.
global_flag
&
GLOBALFLAG_SELF_TOGRAVE
)
{
for
(
auto
cit
=
cset
.
begin
();
cit
!=
cset
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
if
(
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_SELF_TOGRAVE
))
{
core
.
self_tograve_set
.
insert
(
pcard
);
pcard
->
current
.
reason_effect
=
peffect
;
pcard
->
current
.
reason_player
=
peffect
->
get_handler_player
();
}
}
}
if
(
!
core
.
self_destroy_set
.
empty
()
||
!
core
.
self_tograve_set
.
empty
())
add_process
(
PROCESSOR_SELF_DESTROY
,
0
,
0
,
0
,
0
,
0
);
}
void
field
::
add_unique_card
(
card
*
pcard
)
{
void
field
::
add_unique_card
(
card
*
pcard
)
{
uint8
con
=
pcard
->
current
.
controler
;
uint8
con
=
pcard
->
current
.
controler
;
if
(
pcard
->
unique_pos
[
0
])
if
(
pcard
->
unique_pos
[
0
])
...
...
ocgcore/field.h
View file @
5519b682
...
@@ -192,6 +192,7 @@ struct processor {
...
@@ -192,6 +192,7 @@ struct processor {
card_set
equiping_cards
;
card_set
equiping_cards
;
card_set
control_adjust_set
[
2
];
card_set
control_adjust_set
[
2
];
card_set
self_destroy_set
;
card_set
self_destroy_set
;
card_set
self_tograve_set
;
card_set
release_cards
;
card_set
release_cards
;
card_set
release_cards_ex
;
card_set
release_cards_ex
;
card_set
release_cards_ex_sum
;
card_set
release_cards_ex_sum
;
...
@@ -361,6 +362,7 @@ public:
...
@@ -361,6 +362,7 @@ public:
void
update_disable_check_list
(
effect
*
peffect
);
void
update_disable_check_list
(
effect
*
peffect
);
void
add_to_disable_check_list
(
card
*
pcard
);
void
add_to_disable_check_list
(
card
*
pcard
);
void
adjust_disable_check_list
();
void
adjust_disable_check_list
();
void
adjust_self_destroy_set
();
void
add_unique_card
(
card
*
pcard
);
void
add_unique_card
(
card
*
pcard
);
void
remove_unique_card
(
card
*
pcard
);
void
remove_unique_card
(
card
*
pcard
);
effect
*
check_unique_onfield
(
card
*
pcard
,
uint8
controler
);
effect
*
check_unique_onfield
(
card
*
pcard
,
uint8
controler
);
...
...
ocgcore/operations.cpp
View file @
5519b682
...
@@ -1031,47 +1031,24 @@ int32 field::control_adjust(uint16 step) {
...
@@ -1031,47 +1031,24 @@ int32 field::control_adjust(uint16 step) {
int32
field
::
self_destroy
(
uint16
step
)
{
int32
field
::
self_destroy
(
uint16
step
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
effect
*
peffect
;
if
(
!
core
.
self_destroy_set
.
empty
())
core
.
destroy_set
.
clear
();
destroy
(
&
core
.
self_destroy_set
,
0
,
REASON_EFFECT
,
5
);
for
(
auto
cit
=
core
.
self_destroy_set
.
begin
();
cit
!=
core
.
self_destroy_set
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
if
(
pcard
->
is_position
(
POS_FACEUP
)
&&
(
pcard
->
current
.
location
&
LOCATION_ONFIELD
)
&&
((
!
pcard
->
is_status
(
STATUS_DISABLED
)
&&
(
peffect
=
check_unique_onfield
(
pcard
,
pcard
->
current
.
controler
)))
||
(
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_SELF_DESTROY
))))
{
core
.
destroy_set
.
insert
(
pcard
);
pcard
->
current
.
reason_effect
=
peffect
;
pcard
->
current
.
reason_player
=
peffect
->
get_handler_player
();
}
}
if
(
core
.
destroy_set
.
size
())
destroy
(
&
core
.
destroy_set
,
0
,
REASON_EFFECT
,
5
);
else
else
returns
.
ivalue
[
0
]
=
0
;
returns
.
ivalue
[
0
]
=
0
;
return
FALSE
;
return
FALSE
;
}
}
case
1
:
{
case
1
:
{
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_SELF_TOGRAVE
))
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_SELF_TOGRAVE
))
return
TRU
E
;
return
FALS
E
;
core
.
units
.
begin
()
->
arg1
=
returns
.
ivalue
[
0
];
core
.
units
.
begin
()
->
arg1
=
returns
.
ivalue
[
0
];
effect
*
peffect
;
if
(
!
core
.
self_tograve_set
.
empty
())
card_set
tograve_set
;
send_to
(
&
core
.
self_tograve_set
,
0
,
REASON_EFFECT
,
PLAYER_NONE
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
POS_FACEUP
);
for
(
auto
cit
=
core
.
self_destroy_set
.
begin
();
cit
!=
core
.
self_destroy_set
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
if
(
pcard
->
is_position
(
POS_FACEUP
)
&&
(
pcard
->
current
.
location
&
LOCATION_ONFIELD
)
&&
(
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_SELF_TOGRAVE
)))
{
tograve_set
.
insert
(
pcard
);
pcard
->
current
.
reason_effect
=
peffect
;
pcard
->
current
.
reason_player
=
peffect
->
get_handler_player
();
}
}
if
(
tograve_set
.
size
())
send_to
(
&
tograve_set
,
0
,
REASON_EFFECT
,
PLAYER_NONE
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
POS_FACEUP
);
else
return
TRUE
;
return
FALSE
;
return
FALSE
;
}
}
case
2
:
{
case
2
:
{
returns
.
ivalue
[
0
]
+=
core
.
units
.
begin
()
->
arg1
;
returns
.
ivalue
[
0
]
+=
core
.
units
.
begin
()
->
arg1
;
if
(
returns
.
ivalue
[
0
])
adjust_instant
();
return
TRUE
;
return
TRUE
;
}
}
}
}
...
...
ocgcore/processor.cpp
View file @
5519b682
...
@@ -4665,9 +4665,6 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
...
@@ -4665,9 +4665,6 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
}
}
}
}
adjust_instant
();
adjust_instant
();
core
.
self_destroy_set
.
clear
();
core
.
self_destroy_set
.
insert
(
pcard
);
add_process
(
PROCESSOR_SELF_DESTROY
,
0
,
0
,
0
,
0
,
0
);
}
}
raise_event
((
card
*
)
0
,
EVENT_CHAIN_SOLVING
,
peffect
,
0
,
cait
->
triggering_player
,
cait
->
triggering_player
,
cait
->
chain_count
);
raise_event
((
card
*
)
0
,
EVENT_CHAIN_SOLVING
,
peffect
,
0
,
cait
->
triggering_player
,
cait
->
triggering_player
,
cait
->
chain_count
);
process_instant_event
();
process_instant_event
();
...
@@ -4898,6 +4895,7 @@ int32 field::break_effect() {
...
@@ -4898,6 +4895,7 @@ int32 field::break_effect() {
}
}
void
field
::
adjust_instant
()
{
void
field
::
adjust_instant
()
{
adjust_disable_check_list
();
adjust_disable_check_list
();
adjust_self_destroy_set
();
}
}
void
field
::
adjust_all
()
{
void
field
::
adjust_all
()
{
core
.
readjust_map
.
clear
();
core
.
readjust_map
.
clear
();
...
@@ -5259,28 +5257,10 @@ int32 field::adjust_step(uint16 step) {
...
@@ -5259,28 +5257,10 @@ int32 field::adjust_step(uint16 step) {
return
FALSE
;
return
FALSE
;
}
}
//self destroy
//self destroy
core
.
self_destroy_set
.
clear
();
adjust_self_destroy_set
();
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
for
(
uint8
i
=
0
;
i
<
5
;
++
i
)
{
card
*
pcard
=
player
[
p
].
list_mzone
[
i
];
if
(
pcard
)
core
.
self_destroy_set
.
insert
(
pcard
);
}
for
(
uint8
i
=
0
;
i
<
8
;
++
i
)
{
card
*
pcard
=
player
[
p
].
list_szone
[
i
];
if
(
pcard
)
core
.
self_destroy_set
.
insert
(
pcard
);
}
}
if
(
core
.
self_destroy_set
.
size
())
add_process
(
PROCESSOR_SELF_DESTROY
,
0
,
0
,
0
,
0
,
0
);
else
core
.
units
.
begin
()
->
step
=
9
;
return
FALSE
;
return
FALSE
;
}
}
case
9
:
{
case
9
:
{
if
(
returns
.
ivalue
[
0
]
>
0
)
core
.
re_adjust
=
TRUE
;
return
FALSE
;
return
FALSE
;
}
}
case
10
:
{
case
10
:
{
...
...
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