Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
37230d12
Commit
37230d12
authored
Jun 15, 2022
by
Paimon2022
Committed by
Melledy
Jun 15, 2022
Browse files
Fix issue: skill recovery value of a character should benefit from his/her own property,
not the character he/she treats.
parent
50c8f43d
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/ability/HealAbilityManager.java
View file @
37230d12
...
...
@@ -61,13 +61,14 @@ public class HealAbilityManager {
}
private
class
HealDataAvatar
{
public
static
int
MAX_NUM_HEAL_ABILITY
=
4
;
public
String
avatar
=
""
;
public
int
avatarId
=
0
;
public
String
avatar
Name
=
""
;
public
int
fightPropertyType
=
0
;
//0: maxHP, 1: curAttack, 2: curDefense
public
ArrayList
<
HealData
>
healDataList
;
public
HealDataAvatar
(
String
_avatar
,
int
_fightPropertyType
)
{
avatar
=
_avatar
;
public
HealDataAvatar
(
int
_avatarId
,
String
_avatarName
,
int
_fightPropertyType
)
{
avatarId
=
_avatarId
;
avatarName
=
_avatarName
;
fightPropertyType
=
_fightPropertyType
;
healDataList
=
new
ArrayList
();
}
...
...
@@ -91,15 +92,15 @@ public class HealAbilityManager {
public
HealAbilityManager
(
Player
player
)
{
this
.
player
=
player
;
healDataAvatarList
=
new
ArrayList
();
healDataAvatarList
.
add
(
new
HealDataAvatar
(
"Kokomi"
,
0
).
addHealData
(
"E"
,
"ElementalArt_Heal_MaxHP_Base_Percentage"
,
"ElementalArt_Heal_Base_Amount"
,
false
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
"Qin"
,
1
).
addHealData
(
"Q"
,
"Heal"
,
"BurstHealConst"
,
true
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
"Noel"
,
2
).
addHealData
(
"E"
,
"OnAttack_HealthRate"
,
0.452f
,
282
f
,
true
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
"Bennett"
,
0
).
addHealData
(
"Q"
,
"HealMaxHpRatio"
,
"HealConst"
,
false
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
"Diona"
,
0
).
addHealData
(
"Q"
,
"HealHPRatio"
,
"HealHP_Const"
,
false
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
"Sayu"
,
1
).
addHealData
(
"Q"
,
"Constellation_6_Damage"
,
"Heal_BaseAmount"
,
true
).
addHealData
(
"Q"
,
"Heal_AttackRatio"
,
"Constellation_6_Heal"
,
true
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
"Barbara"
,
0
).
addHealData
(
"E"
,
"HealHPOnAdded"
,
"HealHPOnAdded_Const"
,
true
).
addHealData
(
"E"
,
"HealHP_OnHittingOthers"
,
"HealHP_Const_OnHittingOthers"
,
true
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
"Shinobu"
,
0
).
addHealData
(
"E"
,
"ElementalArt_Heal_MaxHP_Percentage"
,
0.064f
,
795
f
,
false
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
"Qiqi"
,
1
).
addHealData
(
"E"
,
"HealHP_OnHittingOthers"
,
"HealHP_Const_OnHittingOthers"
,
true
).
addHealData
(
"E"
,
"ElementalArt_HealHp_Ratio"
,
"ElementalArt_HealHp_Const"
,
true
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
10000054
,
"Kokomi"
,
0
).
addHealData
(
"E"
,
"ElementalArt_Heal_MaxHP_Base_Percentage"
,
"ElementalArt_Heal_Base_Amount"
,
false
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
10000003
,
"Qin"
,
1
).
addHealData
(
"Q"
,
"Heal"
,
"BurstHealConst"
,
true
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
10000034
,
"Noel"
,
2
).
addHealData
(
"E"
,
"OnAttack_HealthRate"
,
0.452f
,
282
f
,
true
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
10000032
,
"Bennett"
,
0
).
addHealData
(
"Q"
,
"HealMaxHpRatio"
,
"HealConst"
,
false
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
10000039
,
"Diona"
,
0
).
addHealData
(
"Q"
,
"HealHPRatio"
,
"HealHP_Const"
,
false
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
10000053
,
"Sayu"
,
1
).
addHealData
(
"Q"
,
"Constellation_6_Damage"
,
"Heal_BaseAmount"
,
true
).
addHealData
(
"Q"
,
"Heal_AttackRatio"
,
"Constellation_6_Heal"
,
true
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
10000014
,
"Barbara"
,
0
).
addHealData
(
"E"
,
"HealHPOnAdded"
,
"HealHPOnAdded_Const"
,
true
).
addHealData
(
"E"
,
"HealHP_OnHittingOthers"
,
"HealHP_Const_OnHittingOthers"
,
true
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
10000065
,
"Shinobu"
,
0
).
addHealData
(
"E"
,
"ElementalArt_Heal_MaxHP_Percentage"
,
0.064f
,
795
f
,
false
));
healDataAvatarList
.
add
(
new
HealDataAvatar
(
10000035
,
"Qiqi"
,
1
).
addHealData
(
"E"
,
"HealHP_OnHittingOthers"
,
"HealHP_Const_OnHittingOthers"
,
true
).
addHealData
(
"E"
,
"ElementalArt_HealHp_Ratio"
,
"ElementalArt_HealHp_Const"
,
true
));
}
public
Player
getPlayer
()
{
...
...
@@ -129,9 +130,10 @@ public class HealAbilityManager {
float
ratio
=
0
,
base
=
0
;
float
maxHP
,
curAttack
,
curDefense
;
Map
<
String
,
Float
>
map
=
sourceEntity
.
getMetaOverrideMap
();
for
(
int
i
=
0
;
i
<
healDataAvatarList
.
size
()
;
i
++)
{
HealDataAvatar
healDataAvatar
=
healDataAvatarList
.
get
(
i
);
if
(
modifierString
.
contains
(
healDataAvatar
.
avatar
))
{
if
(
modifierString
.
contains
(
healDataAvatar
.
avatar
Name
))
{
fightPropertyType
=
healDataAvatar
.
fightPropertyType
;
ArrayList
<
HealData
>
healDataList
=
healDataAvatar
.
healDataList
;
...
...
@@ -159,9 +161,20 @@ public class HealAbilityManager {
needHealAvatars
.
add
(
currentAvatar
);
}
maxHP
=
currentAvatar
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_MAX_HP
);
curAttack
=
currentAvatar
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_CUR_ATTACK
);
curDefense
=
currentAvatar
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_CUR_DEFENSE
);
EntityAvatar
healActionAvatar
=
null
;
for
(
int
k
=
0
;
k
<
activeTeam
.
size
()
;
k
++)
{
EntityAvatar
avatar
=
activeTeam
.
get
(
k
);
int
avatarId
=
avatar
.
getAvatar
().
getAvatarId
();
if
(
avatarId
==
healDataAvatar
.
avatarId
)
{
healActionAvatar
=
avatar
;
break
;
}
}
if
(
healActionAvatar
!=
null
)
{
maxHP
=
healActionAvatar
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_MAX_HP
);
curAttack
=
healActionAvatar
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_CUR_ATTACK
);
curDefense
=
healActionAvatar
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_CUR_DEFENSE
);
switch
(
fightPropertyType
)
{
case
0
:
healAmount
=
ratio
*
maxHP
+
base
;
...
...
@@ -173,6 +186,8 @@ public class HealAbilityManager {
healAmount
=
ratio
*
curDefense
+
base
;
break
;
}
}
for
(
int
k
=
0
;
k
<
needHealAvatars
.
size
()
;
k
++)
{
EntityAvatar
avatar
=
needHealAvatars
.
get
(
k
);
avatar
.
heal
(
healAmount
);
...
...
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