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
ab1341f0
Commit
ab1341f0
authored
May 22, 2022
by
ImmuState
Committed by
Melledy
May 22, 2022
Browse files
Make sure offFieldPenalty does not go below 0.1
parent
88781fdd
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/managers/EnergyManager.java
View file @
ab1341f0
...
@@ -150,10 +150,16 @@ public class EnergyManager {
...
@@ -150,10 +150,16 @@ public class EnergyManager {
// On-field vs off-field multiplier.
// On-field vs off-field multiplier.
// The on-field character gets no penalty.
// The on-field character gets no penalty.
// Off-field characters get a penalty depending on the team size, as follows:
// Off-field characters get a penalty depending on the team size, as follows:
// - 4 character team: 0.6
// - 3 character team: 0.7
// - 2 character team: 0.8
// - 2 character team: 0.8
float
offFieldPenalty
=
(
this
.
player
.
getTeamManager
().
getCurrentCharacterIndex
()
==
i
)
?
1.0f
:
1.0f
-
this
.
player
.
getTeamManager
().
getActiveTeam
().
size
()
*
0.1f
;
// - 3 character team: 0.7
// - 4 character team: 0.6
// - etc.
// We set a lower bound of 0.1 here, to avoid gaining no or negative energy.
float
offFieldPenalty
=
(
this
.
player
.
getTeamManager
().
getCurrentCharacterIndex
()
==
i
)
?
1.0f
:
1.0f
-
this
.
player
.
getTeamManager
().
getActiveTeam
().
size
()
*
0.1f
;
offFieldPenalty
=
Math
.
max
(
offFieldPenalty
,
0.1f
);
// Same element/neutral bonus.
// Same element/neutral bonus.
// Same-element characters get a bonus of *3, while different-element characters get no bonus at all.
// Same-element characters get a bonus of *3, while different-element characters get no bonus at all.
...
...
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