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
c87a0776
Commit
c87a0776
authored
Dec 24, 2019
by
DailyShana
Committed by
GitHub
Dec 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EFFECT_PIERCE: support double battle damage (#259)
parent
0f5061d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
effect.h
effect.h
+2
-0
processor.cpp
processor.cpp
+24
-0
No files found.
effect.h
View file @
c87a0776
...
...
@@ -518,4 +518,6 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EVENT_REMOVE_COUNTER 0x20000
#define EVENT_CUSTOM 0x10000000
#define DOUBLE_DAMAGE 0x80000000
#define HALF_DAMAGE 0x80000001
#endif
/* EFFECT_H_ */
processor.cpp
View file @
c87a0776
...
...
@@ -3357,6 +3357,30 @@ void field::calculate_battle_damage(effect** pdamchange, card** preason_card, ui
if
(
dp
[
1
-
pd
]
&&
!
core
.
attacker
->
is_affected_by_effect
(
EFFECT_AVOID_BATTLE_DAMAGE
,
core
.
attack_target
)
&&
!
is_player_affected_by_effect
(
1
-
pd
,
EFFECT_AVOID_BATTLE_DAMAGE
))
core
.
battle_damage
[
1
-
pd
]
=
a
-
d
;
bool
double_damage
=
false
;
//bool half_damage = false;
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
eset
[
i
]
->
get_value
()
==
DOUBLE_DAMAGE
)
double_damage
=
true
;
//if(eset[i]->get_value() == HALF_DAMAGE)
// half_damage = true;
}
//if(double_damage && half_damage) {
// double_damage = false;
// half_damage = false;
//}
if
(
double_damage
)
{
if
(
dp
[
0
])
core
.
battle_damage
[
0
]
*=
2
;
if
(
dp
[
1
])
core
.
battle_damage
[
1
]
*=
2
;
}
//if(half_damage) {
// if(dp[0])
// core.battle_damage[0] /= 2;
// if(dp[1])
// core.battle_damage[1] /= 2;
//}
reason_card
=
core
.
attacker
;
}
bd
[
1
]
=
TRUE
;
...
...
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