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
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-core
Commits
f16a258d
Commit
f16a258d
authored
Aug 21, 2018
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update get_attack_target
parent
56ea6cf2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
28 deletions
+21
-28
field.cpp
field.cpp
+20
-28
processor.cpp
processor.cpp
+1
-0
No files found.
field.cpp
View file @
f16a258d
...
@@ -2306,20 +2306,10 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack,
...
@@ -2306,20 +2306,10 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack,
if
(
val
>
extra_count_m
)
if
(
val
>
extra_count_m
)
extra_count_m
=
val
;
extra_count_m
=
val
;
}
}
bool
dir
=
true
;
if
(
!
chain_attack
&&
pcard
->
announce_count
>
extra_count
if
(
pcard
->
announce_count
<
extra_count
+
1
)
&&
(
!
extra_count_m
||
pcard
->
announce_count
>
extra_count_m
||
pcard
->
announced_cards
.
findcard
(
0
)))
{
dir
=
true
;
else
if
(
chain_attack
&&
!
core
.
chain_attack_target
)
dir
=
true
;
else
if
(
extra_count_m
&&
pcard
->
announce_count
<
extra_count_m
+
1
&&
pcard
->
announced_cards
.
findcard
(
0
)
==
0
&&
pcard
->
battled_cards
.
findcard
(
0
)
==
0
)
dir
=
false
;
else
{
effect
*
peffect
;
effect
*
peffect
;
if
((
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_ATTACK_ALL
))
&&
pcard
->
attack_all_target
if
((
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_ATTACK_ALL
))
&&
pcard
->
attack_all_target
)
{
&&
pcard
->
announced_cards
.
findcard
(
0
)
==
0
&&
pcard
->
battled_cards
.
findcard
(
0
)
==
0
)
{
for
(
auto
cit
=
pv
->
begin
();
cit
!=
pv
->
end
();
++
cit
)
{
for
(
auto
cit
=
pv
->
begin
();
cit
!=
pv
->
end
();
++
cit
)
{
card
*
atarget
=
*
cit
;
card
*
atarget
=
*
cit
;
if
(
!
atarget
)
if
(
!
atarget
)
...
@@ -2329,33 +2319,31 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack,
...
@@ -2329,33 +2319,31 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack,
continue
;
continue
;
if
(
pcard
->
announced_cards
.
findcard
(
atarget
)
>=
(
uint32
)
peffect
->
get_value
(
atarget
))
if
(
pcard
->
announced_cards
.
findcard
(
atarget
)
>=
(
uint32
)
peffect
->
get_value
(
atarget
))
continue
;
continue
;
if
(
pcard
->
battled_cards
.
findcard
(
atarget
)
>=
(
uint32
)
peffect
->
get_value
(
atarget
))
if
(
atype
>=
2
&&
atarget
->
is_affected_by_effect
(
EFFECT_IGNORE_BATTLE_TARGET
))
continue
;
if
(
select_target
&&
atype
==
4
&&
!
atarget
->
is_capable_be_battle_target
(
pcard
))
continue
;
continue
;
if
(
select_target
&&
atype
==
4
)
{
if
(
atarget
->
is_affected_by_effect
(
EFFECT_CANNOT_BE_BATTLE_TARGET
,
pcard
))
continue
;
if
(
pcard
->
is_affected_by_effect
(
EFFECT_CANNOT_SELECT_BATTLE_TARGET
,
atarget
))
continue
;
}
v
->
push_back
(
atarget
);
v
->
push_back
(
atarget
);
}
}
}
}
if
(
chain_attack
&&
core
.
chain_attack_target
&&
std
::
find
(
pv
->
begin
(),
pv
->
end
(),
core
.
chain_attack_target
)
!=
pv
->
end
()
&&
(
!
select_target
||
atype
!=
4
||
core
.
chain_attack_target
->
is_capable_be_battle_target
(
pcard
)))
{
v
->
push_back
(
core
.
chain_attack_target
);
}
return
atype
;
}
if
(
atype
<=
3
)
{
*
v
=
*
pv
;
return
atype
;
return
atype
;
}
}
//chain attack or announce count check passed
uint32
mcount
=
0
;
uint32
mcount
=
0
;
for
(
auto
cit
=
pv
->
begin
();
cit
!=
pv
->
end
();
++
cit
)
{
for
(
auto
cit
=
pv
->
begin
();
cit
!=
pv
->
end
();
++
cit
)
{
card
*
atarget
=
*
cit
;
card
*
atarget
=
*
cit
;
if
(
!
atarget
)
if
(
!
atarget
)
continue
;
continue
;
if
(
atarget
->
is_affected_by_effect
(
EFFECT_IGNORE_BATTLE_TARGET
))
if
(
at
ype
>=
2
&&
at
arget
->
is_affected_by_effect
(
EFFECT_IGNORE_BATTLE_TARGET
))
continue
;
continue
;
mcount
++
;
mcount
++
;
if
(
select_target
)
{
if
(
chain_attack
&&
core
.
chain_attack_target
&&
atarget
!=
core
.
chain_attack_target
)
continue
;
if
(
select_target
&&
atype
==
4
)
{
if
(
atarget
->
is_affected_by_effect
(
EFFECT_CANNOT_BE_BATTLE_TARGET
,
pcard
))
if
(
atarget
->
is_affected_by_effect
(
EFFECT_CANNOT_BE_BATTLE_TARGET
,
pcard
))
continue
;
continue
;
if
(
pcard
->
is_affected_by_effect
(
EFFECT_CANNOT_SELECT_BATTLE_TARGET
,
atarget
))
if
(
pcard
->
is_affected_by_effect
(
EFFECT_CANNOT_SELECT_BATTLE_TARGET
,
atarget
))
...
@@ -2363,8 +2351,12 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack,
...
@@ -2363,8 +2351,12 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack,
}
}
v
->
push_back
(
atarget
);
v
->
push_back
(
atarget
);
}
}
if
(
atype
<=
3
)
return
atype
;
if
((
mcount
==
0
||
pcard
->
is_affected_by_effect
(
EFFECT_DIRECT_ATTACK
)
||
core
.
attack_player
)
if
((
mcount
==
0
||
pcard
->
is_affected_by_effect
(
EFFECT_DIRECT_ATTACK
)
||
core
.
attack_player
)
&&
!
pcard
->
is_affected_by_effect
(
EFFECT_CANNOT_DIRECT_ATTACK
)
&&
dir
)
&&
!
pcard
->
is_affected_by_effect
(
EFFECT_CANNOT_DIRECT_ATTACK
)
&&
!
(
extra_count_m
&&
pcard
->
announce_count
>
extra_count
)
&&
!
(
chain_attack
&&
core
.
chain_attack_target
))
pcard
->
direct_attackable
=
1
;
pcard
->
direct_attackable
=
1
;
return
atype
;
return
atype
;
}
}
...
...
processor.cpp
View file @
f16a258d
...
@@ -3680,6 +3680,7 @@ int32 field::process_damage_step(uint16 step, uint32 new_attack) {
...
@@ -3680,6 +3680,7 @@ int32 field::process_damage_step(uint16 step, uint32 new_attack) {
core
.
battled_count
[
infos
.
turn_player
]
++
;
core
.
battled_count
[
infos
.
turn_player
]
++
;
check_card_counter
(
core
.
attacker
,
5
,
infos
.
turn_player
);
check_card_counter
(
core
.
attacker
,
5
,
infos
.
turn_player
);
}
}
core
.
attacker
->
announced_cards
.
addcard
(
core
.
attack_target
);
attack_all_target_check
();
attack_all_target_check
();
pduel
->
write_buffer8
(
MSG_ATTACK
);
pduel
->
write_buffer8
(
MSG_ATTACK
);
pduel
->
write_buffer32
(
core
.
attacker
->
get_info_location
());
pduel
->
write_buffer32
(
core
.
attacker
->
get_info_location
());
...
...
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