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
46496801
Commit
46496801
authored
May 21, 2022
by
ImmuState
Committed by
Melledy
May 22, 2022
Browse files
Fix traveller not being able to gain energy.
parent
28323fed
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/avatar/Avatar.java
View file @
46496801
...
@@ -497,7 +497,7 @@ public class Avatar {
...
@@ -497,7 +497,7 @@ public class Avatar {
float
hpPercent
=
this
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_MAX_HP
)
<=
0
?
1
f
:
this
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_CUR_HP
)
/
this
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_MAX_HP
);
float
hpPercent
=
this
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_MAX_HP
)
<=
0
?
1
f
:
this
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_CUR_HP
)
/
this
.
getFightProperty
(
FightProperty
.
FIGHT_PROP_MAX_HP
);
// Store current energy value for later
// Store current energy value for later
float
currentEnergy
=
(
data
.
getSkillDepot
()
!=
null
)
?
this
.
getFightProperty
(
data
.
getSkillDepot
().
getElementType
().
getCurEnergyProp
())
:
0
f
;
float
currentEnergy
=
(
this
.
getSkillDepot
()
!=
null
)
?
this
.
getFightProperty
(
this
.
getSkillDepot
().
getElementType
().
getCurEnergyProp
())
:
0
f
;
// Clear properties
// Clear properties
this
.
getFightProperties
().
clear
();
this
.
getFightProperties
().
clear
();
...
@@ -517,15 +517,15 @@ public class Avatar {
...
@@ -517,15 +517,15 @@ public class Avatar {
}
}
// Set energy usage
// Set energy usage
if
(
data
.
getSkillDepot
()
!=
null
&&
data
.
getSkillDepot
().
getEnergySkillData
()
!=
null
)
{
if
(
this
.
getSkillDepot
()
!=
null
&&
this
.
getSkillDepot
().
getEnergySkillData
()
!=
null
)
{
ElementType
element
=
data
.
getSkillDepot
().
getElementType
();
ElementType
element
=
this
.
getSkillDepot
().
getElementType
();
this
.
setFightProperty
(
element
.
getMaxEnergyProp
(),
data
.
getSkillDepot
().
getEnergySkillData
().
getCostElemVal
());
this
.
setFightProperty
(
element
.
getMaxEnergyProp
(),
this
.
getSkillDepot
().
getEnergySkillData
().
getCostElemVal
());
if
(
GAME_OPTIONS
.
energyUsage
)
{
if
(
GAME_OPTIONS
.
energyUsage
)
{
this
.
setFightProperty
(
element
.
getCurEnergyProp
(),
currentEnergy
);
this
.
setFightProperty
(
element
.
getCurEnergyProp
(),
currentEnergy
);
}
}
else
{
else
{
this
.
setFightProperty
(
element
.
getCurEnergyProp
(),
data
.
getSkillDepot
().
getEnergySkillData
().
getCostElemVal
());
this
.
setFightProperty
(
element
.
getCurEnergyProp
(),
this
.
getSkillDepot
().
getEnergySkillData
().
getCostElemVal
());
}
}
}
}
...
...
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