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
xiaoye
ygopro-core
Commits
8cca9304
Commit
8cca9304
authored
Jan 23, 2020
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update control loop break
parent
8fe06c57
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
15 deletions
+21
-15
card.cpp
card.cpp
+5
-11
card.h
card.h
+2
-1
field.cpp
field.cpp
+1
-1
processor.cpp
processor.cpp
+13
-2
No files found.
card.cpp
View file @
8cca9304
...
@@ -1964,8 +1964,9 @@ void card::refresh_disable_status() {
...
@@ -1964,8 +1964,9 @@ void card::refresh_disable_status() {
if
(
pre_dis
!=
cur_dis
)
if
(
pre_dis
!=
cur_dis
)
filter_immune_effect
();
filter_immune_effect
();
}
}
uint8
card
::
refresh_control_status
()
{
std
::
tuple
<
uint8
,
effect
*>
card
::
refresh_control_status
()
{
uint8
final
=
owner
;
uint8
final
=
owner
;
effect
*
ceffect
=
nullptr
;
uint32
last_id
=
0
;
uint32
last_id
=
0
;
if
(
pduel
->
game_field
->
core
.
remove_brainwashing
&&
is_affected_by_effect
(
EFFECT_REMOVE_BRAINWASHING
))
if
(
pduel
->
game_field
->
core
.
remove_brainwashing
&&
is_affected_by_effect
(
EFFECT_REMOVE_BRAINWASHING
))
last_id
=
pduel
->
game_field
->
core
.
last_control_changed_id
;
last_id
=
pduel
->
game_field
->
core
.
last_control_changed_id
;
...
@@ -1974,18 +1975,11 @@ uint8 card::refresh_control_status() {
...
@@ -1974,18 +1975,11 @@ uint8 card::refresh_control_status() {
if
(
eset
.
size
())
{
if
(
eset
.
size
())
{
effect
*
peffect
=
eset
.
get_last
();
effect
*
peffect
=
eset
.
get_last
();
if
(
peffect
->
id
>=
last_id
)
{
if
(
peffect
->
id
>=
last_id
)
{
card
*
pcard
=
peffect
->
get_handler
();
final
=
(
uint8
)
peffect
->
get_value
(
this
);
uint8
val
=
(
uint8
)
peffect
->
get_value
(
this
);
ceffect
=
peffect
;
if
(
val
!=
current
.
controler
)
pduel
->
game_field
->
core
.
readjust_map
[
pcard
]
++
;
if
(
pduel
->
game_field
->
core
.
readjust_map
[
pcard
]
>
5
)
{
pduel
->
game_field
->
send_to
(
pcard
,
0
,
REASON_RULE
,
peffect
->
get_handler_player
(),
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
POS_FACEUP
);
return
final
;
}
final
=
val
;
}
}
}
}
return
final
;
return
{
final
,
ceffect
}
;
}
}
void
card
::
count_turn
(
uint16
ct
)
{
void
card
::
count_turn
(
uint16
ct
)
{
turn_counter
=
ct
;
turn_counter
=
ct
;
...
...
card.h
View file @
8cca9304
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include <map>
#include <map>
#include <unordered_set>
#include <unordered_set>
#include <unordered_map>
#include <unordered_map>
#include <tuple>
class
card
;
class
card
;
class
duel
;
class
duel
;
...
@@ -257,7 +258,7 @@ public:
...
@@ -257,7 +258,7 @@ public:
void
reset
(
uint32
id
,
uint32
reset_type
);
void
reset
(
uint32
id
,
uint32
reset_type
);
void
reset_effect_count
();
void
reset_effect_count
();
void
refresh_disable_status
();
void
refresh_disable_status
();
uint8
refresh_control_status
();
std
::
tuple
<
uint8
,
effect
*>
refresh_control_status
();
void
count_turn
(
uint16
ct
);
void
count_turn
(
uint16
ct
);
void
create_relation
(
card
*
target
,
uint32
reset
);
void
create_relation
(
card
*
target
,
uint32
reset
);
...
...
field.cpp
View file @
8cca9304
...
@@ -520,7 +520,7 @@ void field::swap_card(card* pcard1, card* pcard2) {
...
@@ -520,7 +520,7 @@ void field::swap_card(card* pcard1, card* pcard2) {
return
swap_card
(
pcard1
,
pcard2
,
pcard1
->
current
.
sequence
,
pcard2
->
current
.
sequence
);
return
swap_card
(
pcard1
,
pcard2
,
pcard1
->
current
.
sequence
,
pcard2
->
current
.
sequence
);
}
}
void
field
::
set_control
(
card
*
pcard
,
uint8
playerid
,
uint16
reset_phase
,
uint8
reset_count
)
{
void
field
::
set_control
(
card
*
pcard
,
uint8
playerid
,
uint16
reset_phase
,
uint8
reset_count
)
{
if
((
core
.
remove_brainwashing
&&
pcard
->
is_affected_by_effect
(
EFFECT_REMOVE_BRAINWASHING
))
||
pcard
->
refresh_control_status
(
)
==
playerid
)
if
((
core
.
remove_brainwashing
&&
pcard
->
is_affected_by_effect
(
EFFECT_REMOVE_BRAINWASHING
))
||
std
::
get
<
uint8
>
(
pcard
->
refresh_control_status
()
)
==
playerid
)
return
;
return
;
effect
*
peffect
=
pduel
->
new_effect
();
effect
*
peffect
=
pduel
->
new_effect
();
if
(
core
.
reason_effect
)
if
(
core
.
reason_effect
)
...
...
processor.cpp
View file @
8cca9304
...
@@ -4843,19 +4843,30 @@ int32 field::adjust_step(uint16 step) {
...
@@ -4843,19 +4843,30 @@ int32 field::adjust_step(uint16 step) {
//control
//control
core
.
control_adjust_set
[
0
].
clear
();
core
.
control_adjust_set
[
0
].
clear
();
core
.
control_adjust_set
[
1
].
clear
();
core
.
control_adjust_set
[
1
].
clear
();
card_set
reason_cards
;
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
for
(
auto
&
pcard
:
player
[
p
].
list_mzone
)
{
for
(
auto
&
pcard
:
player
[
p
].
list_mzone
)
{
if
(
!
pcard
)
continue
;
if
(
!
pcard
)
continue
;
uint8
cur
=
pcard
->
current
.
controler
;
uint8
cur
=
pcard
->
current
.
controler
;
uint8
ref
=
pcard
->
refresh_control_status
();
auto
res
=
pcard
->
refresh_control_status
();
if
(
cur
!=
ref
&&
pcard
->
is_capable_change_control
())
uint8
ref
=
std
::
get
<
uint8
>
(
res
);
effect
*
peffect
=
std
::
get
<
effect
*>
(
res
);
if
(
cur
!=
ref
&&
pcard
->
is_capable_change_control
())
{
core
.
control_adjust_set
[
p
].
insert
(
pcard
);
core
.
control_adjust_set
[
p
].
insert
(
pcard
);
if
(
peffect
&&
(
!
(
peffect
->
type
&
EFFECT_TYPE_SINGLE
)
||
peffect
->
condition
))
reason_cards
.
insert
(
peffect
->
get_handler
());
}
}
}
}
}
if
(
core
.
control_adjust_set
[
0
].
size
()
||
core
.
control_adjust_set
[
1
].
size
())
{
if
(
core
.
control_adjust_set
[
0
].
size
()
||
core
.
control_adjust_set
[
1
].
size
())
{
core
.
re_adjust
=
TRUE
;
core
.
re_adjust
=
TRUE
;
get_control
(
&
core
.
control_adjust_set
[
1
-
infos
.
turn_player
],
0
,
PLAYER_NONE
,
infos
.
turn_player
,
0
,
0
,
0xff
);
get_control
(
&
core
.
control_adjust_set
[
1
-
infos
.
turn_player
],
0
,
PLAYER_NONE
,
infos
.
turn_player
,
0
,
0
,
0xff
);
get_control
(
&
core
.
control_adjust_set
[
infos
.
turn_player
],
0
,
PLAYER_NONE
,
1
-
infos
.
turn_player
,
0
,
0
,
0xff
);
get_control
(
&
core
.
control_adjust_set
[
infos
.
turn_player
],
0
,
PLAYER_NONE
,
1
-
infos
.
turn_player
,
0
,
0
,
0xff
);
for
(
auto
&
rcard
:
reason_cards
)
{
core
.
readjust_map
[
rcard
]
++
;
if
(
core
.
readjust_map
[
rcard
]
>
3
)
destroy
(
rcard
,
0
,
REASON_RULE
,
PLAYER_NONE
);
}
}
}
core
.
last_control_changed_id
=
infos
.
field_id
;
core
.
last_control_changed_id
=
infos
.
field_id
;
return
FALSE
;
return
FALSE
;
...
...
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