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
5809f717
Commit
5809f717
authored
Jun 01, 2016
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attack_all_target_check()
check at EVENT_BE_BATTLE_TARGET and begining of damage calculation.
parent
c29187b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
15 deletions
+10
-15
field.cpp
field.cpp
+3
-2
libduel.cpp
libduel.cpp
+1
-0
processor.cpp
processor.cpp
+6
-13
No files found.
field.cpp
View file @
5809f717
...
@@ -1720,9 +1720,10 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack)
...
@@ -1720,9 +1720,10 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack)
dir
=
false
;
dir
=
false
;
else
{
else
{
// effects with target limit
// effects with target limit
// The system only check the general case (never attacked player)
, and the script should check specific condition.
// The system only check the general case (never attacked player)
and approximate solution
if
((
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_ATTACK_ALL
))
if
((
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
())
{
&&
pcard
->
announced_cards
.
find
(
0
)
==
pcard
->
announced_cards
.
end
()
&&
pcard
->
battled_cards
.
find
(
0
)
==
pcard
->
battled_cards
.
end
()
&&
pcard
->
attack_all_target
)
{
for
(
auto
cit
=
pv
->
begin
();
cit
!=
pv
->
end
();
++
cit
)
{
for
(
auto
cit
=
pv
->
begin
();
cit
!=
pv
->
end
();
++
cit
)
{
atarget
=
*
cit
;
atarget
=
*
cit
;
if
(
!
atarget
)
if
(
!
atarget
)
...
...
libduel.cpp
View file @
5809f717
...
@@ -1211,6 +1211,7 @@ int32 scriptlib::duel_change_attack_target(lua_State *L) {
...
@@ -1211,6 +1211,7 @@ int32 scriptlib::duel_change_attack_target(lua_State *L) {
pduel
->
game_field
->
core
.
opp_mzone
[
i
]
=
0
;
pduel
->
game_field
->
core
.
opp_mzone
[
i
]
=
0
;
}
}
pduel
->
game_field
->
check_card_counter
(
pduel
->
game_field
->
core
.
attacker
,
5
,
pduel
->
game_field
->
infos
.
turn_player
);
pduel
->
game_field
->
check_card_counter
(
pduel
->
game_field
->
core
.
attacker
,
5
,
pduel
->
game_field
->
infos
.
turn_player
);
pduel
->
game_field
->
attack_all_target_check
();
if
(
target
)
{
if
(
target
)
{
pduel
->
game_field
->
raise_single_event
(
target
,
0
,
EVENT_BE_BATTLE_TARGET
,
0
,
REASON_REPLACE
,
0
,
1
-
turnp
,
0
);
pduel
->
game_field
->
raise_single_event
(
target
,
0
,
EVENT_BE_BATTLE_TARGET
,
0
,
REASON_REPLACE
,
0
,
1
-
turnp
,
0
);
pduel
->
game_field
->
raise_event
(
target
,
EVENT_BE_BATTLE_TARGET
,
0
,
REASON_REPLACE
,
0
,
1
-
turnp
,
0
);
pduel
->
game_field
->
raise_event
(
target
,
EVENT_BE_BATTLE_TARGET
,
0
,
REASON_REPLACE
,
0
,
1
-
turnp
,
0
);
...
...
processor.cpp
View file @
5809f717
...
@@ -2999,6 +2999,7 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -2999,6 +2999,7 @@ int32 field::process_battle_command(uint16 step) {
case
7
:
{
case
7
:
{
bool
evt
=
false
;
bool
evt
=
false
;
check_card_counter
(
core
.
attacker
,
5
,
infos
.
turn_player
);
check_card_counter
(
core
.
attacker
,
5
,
infos
.
turn_player
);
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
());
if
(
core
.
attack_target
)
{
if
(
core
.
attack_target
)
{
...
@@ -3075,11 +3076,8 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3075,11 +3076,8 @@ int32 field::process_battle_command(uint16 step) {
else
else
core
.
units
.
begin
()
->
arg2
=
0
;
core
.
units
.
begin
()
->
arg2
=
0
;
reset_phase
(
PHASE_DAMAGE
);
reset_phase
(
PHASE_DAMAGE
);
if
(
core
.
attacker
->
fieldid_r
==
afid
)
{
if
(
core
.
attacker
->
fieldid_r
==
afid
&&
!
atk_disabled
)
{
if
(
!
atk_disabled
)
{
core
.
attacker
->
attacked_cards
.
addcard
(
core
.
attack_target
);
core
.
attacker
->
attacked_cards
.
addcard
(
core
.
attack_target
);
}
attack_all_target_check
();
}
}
if
(
!
peffect
->
value
)
{
if
(
!
peffect
->
value
)
{
infos
.
phase
=
PHASE_BATTLE
;
infos
.
phase
=
PHASE_BATTLE
;
...
@@ -3094,11 +3092,8 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3094,11 +3092,8 @@ int32 field::process_battle_command(uint16 step) {
if
(
atk_disabled
||
!
core
.
attacker
->
is_capable_attack
()
||
core
.
attacker
->
is_status
(
STATUS_ATTACK_CANCELED
)
if
(
atk_disabled
||
!
core
.
attacker
->
is_capable_attack
()
||
core
.
attacker
->
is_status
(
STATUS_ATTACK_CANCELED
)
||
core
.
attacker
->
current
.
controler
!=
acon
||
core
.
attacker
->
fieldid_r
!=
afid
)
{
||
core
.
attacker
->
current
.
controler
!=
acon
||
core
.
attacker
->
fieldid_r
!=
afid
)
{
core
.
chain_attack
=
FALSE
;
core
.
chain_attack
=
FALSE
;
if
(
core
.
attacker
->
fieldid_r
==
afid
)
{
if
(
core
.
attacker
->
fieldid_r
==
afid
&&
!
atk_disabled
)
{
attack_all_target_check
();
core
.
attacker
->
attacked_cards
.
addcard
(
core
.
attack_target
);
if
(
!
atk_disabled
)
{
core
.
attacker
->
attacked_cards
.
addcard
(
core
.
attack_target
);
}
}
}
core
.
units
.
begin
()
->
step
=
-
1
;
core
.
units
.
begin
()
->
step
=
-
1
;
reset_phase
(
PHASE_DAMAGE
);
reset_phase
(
PHASE_DAMAGE
);
...
@@ -3113,7 +3108,6 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3113,7 +3108,6 @@ int32 field::process_battle_command(uint16 step) {
rollback
=
true
;
rollback
=
true
;
// go to damage step
// go to damage step
if
(
!
rollback
)
{
if
(
!
rollback
)
{
attack_all_target_check
();
core
.
attacker
->
attacked_cards
.
addcard
(
core
.
attack_target
);
core
.
attacker
->
attacked_cards
.
addcard
(
core
.
attack_target
);
core
.
units
.
begin
()
->
step
=
19
;
core
.
units
.
begin
()
->
step
=
19
;
adjust_all
();
adjust_all
();
...
@@ -3122,7 +3116,6 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3122,7 +3116,6 @@ int32 field::process_battle_command(uint16 step) {
// attack canceled
// attack canceled
if
(
!
core
.
select_cards
.
size
()
&&
!
core
.
attacker
->
operation_param
)
{
if
(
!
core
.
select_cards
.
size
()
&&
!
core
.
attacker
->
operation_param
)
{
core
.
chain_attack
=
FALSE
;
core
.
chain_attack
=
FALSE
;
attack_all_target_check
();
core
.
units
.
begin
()
->
step
=
-
1
;
core
.
units
.
begin
()
->
step
=
-
1
;
reset_phase
(
PHASE_DAMAGE
);
reset_phase
(
PHASE_DAMAGE
);
adjust_all
();
adjust_all
();
...
@@ -3144,7 +3137,6 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3144,7 +3137,6 @@ int32 field::process_battle_command(uint16 step) {
return
FALSE
;
return
FALSE
;
}
}
core
.
chain_attack
=
FALSE
;
core
.
chain_attack
=
FALSE
;
attack_all_target_check
();
core
.
units
.
begin
()
->
step
=
-
1
;
core
.
units
.
begin
()
->
step
=
-
1
;
reset_phase
(
PHASE_DAMAGE
);
reset_phase
(
PHASE_DAMAGE
);
adjust_all
();
adjust_all
();
...
@@ -3627,6 +3619,7 @@ int32 field::process_damage_step(uint16 step) {
...
@@ -3627,6 +3619,7 @@ int32 field::process_damage_step(uint16 step) {
return
FALSE
;
return
FALSE
;
}
}
check_card_counter
(
core
.
attacker
,
5
,
infos
.
turn_player
);
check_card_counter
(
core
.
attacker
,
5
,
infos
.
turn_player
);
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
());
pduel
->
write_buffer32
(
core
.
attack_target
->
get_info_location
());
pduel
->
write_buffer32
(
core
.
attack_target
->
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