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
1c9b1071
Commit
1c9b1071
authored
May 17, 2016
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attack all
parent
378c8aab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
19 deletions
+27
-19
field.cpp
field.cpp
+23
-18
processor.cpp
processor.cpp
+4
-1
No files found.
field.cpp
View file @
1c9b1071
...
...
@@ -1694,26 +1694,31 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack)
atype
=
4
;
pv
=
&
player
[
1
-
p
].
list_mzone
;
}
if
(
pcard
->
attack_all_target
&&
(
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_ATTACK_ALL
)))
{
if
(
pcard
->
battled_cards
.
size
())
{
for
(
auto
cit
=
pv
->
begin
();
cit
!=
pv
->
end
();
++
cit
)
{
atarget
=
*
cit
;
if
(
!
atarget
)
continue
;
pduel
->
lua
->
add_param
(
atarget
,
PARAM_TYPE_CARD
);
if
(
!
peffect
->
check_value_condition
(
1
))
continue
;
auto
it
=
pcard
->
battled_cards
.
find
(
atarget
->
fieldid_r
);
if
(
it
!=
pcard
->
battled_cards
.
end
())
{
if
(
it
->
second
.
second
>=
(
uint32
)
peffect
->
get_value
(
atarget
))
continue
;
}
if
(
atype
==
4
&&
!
atarget
->
is_capable_be_battle_target
(
pcard
))
continue
;
v
->
push_back
(
atarget
);
// The system only check the general case (never attacked player), and the script should check specific condition.
if
(
pcard
->
announced_cards
.
size
()
&&
(
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_ATTACK_ALL
))
&&
pcard
->
announced_cards
.
find
(
0
)
==
pcard
->
announced_cards
.
end
()
&&
pcard
->
battled_cards
.
find
(
0
)
==
pcard
->
battled_cards
.
end
())
{
for
(
auto
cit
=
pv
->
begin
();
cit
!=
pv
->
end
();
++
cit
)
{
atarget
=
*
cit
;
if
(
!
atarget
)
continue
;
// valid target
pduel
->
lua
->
add_param
(
atarget
,
PARAM_TYPE_CARD
);
if
(
!
peffect
->
check_value_condition
(
1
))
continue
;
// enough effect count
auto
it
=
pcard
->
announced_cards
.
find
(
atarget
->
fieldid_r
);
if
(
it
!=
pcard
->
announced_cards
.
end
()
&&
(
int32
)
it
->
second
.
second
>=
peffect
->
get_value
(
atarget
))
{
continue
;
}
return
atype
;
it
=
pcard
->
battled_cards
.
find
(
atarget
->
fieldid_r
);
if
(
it
!=
pcard
->
battled_cards
.
end
()
&&
(
int32
)
it
->
second
.
second
>=
peffect
->
get_value
(
atarget
))
{
continue
;
}
if
(
atype
==
4
&&
!
atarget
->
is_capable_be_battle_target
(
pcard
))
continue
;
v
->
push_back
(
atarget
);
}
return
atype
;
}
else
if
(
chain_attack
&&
core
.
chain_attack_target
)
{
if
(
std
::
find
(
pv
->
begin
(),
pv
->
end
(),
core
.
chain_attack_target
)
!=
pv
->
end
()
&&
(
atype
!=
4
||
core
.
chain_attack_target
->
is_capable_be_battle_target
(
pcard
))){
...
...
processor.cpp
View file @
1c9b1071
...
...
@@ -2807,7 +2807,10 @@ int32 field::process_battle_command(uint16 step) {
if
(
tmp
>
extrac
)
extrac
=
tmp
;
}
if
(
!
pcard
->
is_affected_by_effect
(
EFFECT_ATTACK_ALL
)
&&
!
chain_attack
&&
pcard
->
announce_count
>=
extrac
+
1
)
if
(
!
(
pcard
->
announced_cards
.
size
()
&&
pcard
->
is_affected_by_effect
(
EFFECT_ATTACK_ALL
)
&&
pcard
->
announced_cards
.
find
(
0
)
==
pcard
->
announced_cards
.
end
()
&&
pcard
->
battled_cards
.
find
(
0
)
==
pcard
->
battled_cards
.
end
())
&&
!
chain_attack
&&
pcard
->
announce_count
>=
extrac
+
1
)
continue
;
core
.
select_cards
.
clear
();
get_attack_target
(
pcard
,
&
core
.
select_cards
,
chain_attack
);
...
...
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