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
76f9331c
Commit
76f9331c
authored
Jan 22, 2017
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Duel.CalculateDamage()
Now the attack target can be null. (for c93599951)
parent
b219de78
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
libduel.cpp
libduel.cpp
+7
-2
processor.cpp
processor.cpp
+11
-7
No files found.
libduel.cpp
View file @
76f9331c
...
@@ -1264,9 +1264,14 @@ int32 scriptlib::duel_calculate_damage(lua_State *L) {
...
@@ -1264,9 +1264,14 @@ int32 scriptlib::duel_calculate_damage(lua_State *L) {
check_action_permission
(
L
);
check_action_permission
(
L
);
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
card
*
attacker
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
attacker
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
attack_target
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
card
*
attack_target
;
if
(
lua_isnil
(
L
,
2
))
attack_target
=
NULL
;
else
{
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
attack_target
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
}
int32
new_attack
=
FALSE
;
int32
new_attack
=
FALSE
;
if
(
lua_gettop
(
L
)
>=
3
)
if
(
lua_gettop
(
L
)
>=
3
)
new_attack
=
lua_toboolean
(
L
,
3
);
new_attack
=
lua_toboolean
(
L
,
3
);
...
...
processor.cpp
View file @
76f9331c
...
@@ -3672,7 +3672,7 @@ int32 field::process_damage_step(uint16 step, uint32 new_attack) {
...
@@ -3672,7 +3672,7 @@ int32 field::process_damage_step(uint16 step, uint32 new_attack) {
core
.
attack_target
=
(
card
*
)
core
.
units
.
begin
()
->
ptarget
;
core
.
attack_target
=
(
card
*
)
core
.
units
.
begin
()
->
ptarget
;
core
.
units
.
begin
()
->
ptarget
=
(
group
*
)
tmp
;
core
.
units
.
begin
()
->
ptarget
=
(
group
*
)
tmp
;
core
.
units
.
begin
()
->
arg1
=
infos
.
phase
;
core
.
units
.
begin
()
->
arg1
=
infos
.
phase
;
if
(
core
.
attacker
->
current
.
location
!=
LOCATION_MZONE
||
core
.
attack_target
->
current
.
location
!=
LOCATION_MZONE
)
{
if
(
core
.
attacker
->
current
.
location
!=
LOCATION_MZONE
||
core
.
attack_target
&&
core
.
attack_target
->
current
.
location
!=
LOCATION_MZONE
)
{
core
.
units
.
begin
()
->
step
=
2
;
core
.
units
.
begin
()
->
step
=
2
;
return
FALSE
;
return
FALSE
;
}
}
...
@@ -3684,19 +3684,23 @@ int32 field::process_damage_step(uint16 step, uint32 new_attack) {
...
@@ -3684,19 +3684,23 @@ int32 field::process_damage_step(uint16 step, uint32 new_attack) {
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
());
pduel
->
write_buffer32
(
core
.
attack_target
->
get_info_location
());
if
(
core
.
attack_target
)
pduel
->
write_buffer32
(
core
.
attack_target
->
get_info_location
());
else
pduel
->
write_buffer32
(
0
);
infos
.
phase
=
PHASE_DAMAGE
;
infos
.
phase
=
PHASE_DAMAGE
;
pduel
->
write_buffer8
(
MSG_DAMAGE_STEP_START
);
pduel
->
write_buffer8
(
MSG_DAMAGE_STEP_START
);
core
.
pre_field
[
0
]
=
core
.
attacker
->
fieldid_r
;
core
.
pre_field
[
0
]
=
core
.
attacker
->
fieldid_r
;
core
.
attacker
->
attacked_count
++
;
core
.
attacker
->
attacked_count
++
;
if
(
core
.
attack_target
)
if
(
core
.
attack_target
)
{
core
.
pre_field
[
1
]
=
core
.
attack_target
->
fieldid_r
;
core
.
pre_field
[
1
]
=
core
.
attack_target
->
fieldid_r
;
if
(
core
.
attack_target
->
is_position
(
POS_FACEDOWN
))
{
change_position
(
core
.
attack_target
,
0
,
PLAYER_NONE
,
core
.
attack_target
->
current
.
position
>>
1
,
0
,
TRUE
);
adjust_all
();
}
}
else
else
core
.
pre_field
[
1
]
=
0
;
core
.
pre_field
[
1
]
=
0
;
if
(
core
.
attack_target
->
is_position
(
POS_FACEDOWN
))
{
change_position
(
core
.
attack_target
,
0
,
PLAYER_NONE
,
core
.
attack_target
->
current
.
position
>>
1
,
0
,
TRUE
);
adjust_all
();
}
return
FALSE
;
return
FALSE
;
}
}
case
1
:
{
case
1
:
{
...
...
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