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
1d2fde40
Commit
1d2fde40
authored
May 20, 2022
by
ImmuState
Committed by
Melledy
May 22, 2022
Browse files
Make energy usage configurable, and preserve current behavior as the default.
parent
531683f3
Changes
3
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/avatar/Avatar.java
View file @
1d2fde40
...
@@ -62,6 +62,8 @@ import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
...
@@ -62,6 +62,8 @@ import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
import
it.unimi.dsi.fastutil.ints.Int2ObjectMap
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectMap
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
;
import
static
emu
.
grasscutter
.
Configuration
.
GAME_OPTIONS
;
@Entity
(
value
=
"avatars"
,
useDiscriminator
=
false
)
@Entity
(
value
=
"avatars"
,
useDiscriminator
=
false
)
public
class
Avatar
{
public
class
Avatar
{
@Id
private
ObjectId
id
;
@Id
private
ObjectId
id
;
...
@@ -517,8 +519,13 @@ public class Avatar {
...
@@ -517,8 +519,13 @@ public class Avatar {
if
(
data
.
getSkillDepot
()
!=
null
&&
data
.
getSkillDepot
().
getEnergySkillData
()
!=
null
)
{
if
(
data
.
getSkillDepot
()
!=
null
&&
data
.
getSkillDepot
().
getEnergySkillData
()
!=
null
)
{
ElementType
element
=
data
.
getSkillDepot
().
getElementType
();
ElementType
element
=
data
.
getSkillDepot
().
getElementType
();
this
.
setFightProperty
(
element
.
getMaxEnergyProp
(),
data
.
getSkillDepot
().
getEnergySkillData
().
getCostElemVal
());
this
.
setFightProperty
(
element
.
getMaxEnergyProp
(),
data
.
getSkillDepot
().
getEnergySkillData
().
getCostElemVal
());
if
(
GAME_OPTIONS
.
energyUsage
)
{
this
.
setFightProperty
(
element
.
getCurEnergyProp
(),
currentEnergy
);
this
.
setFightProperty
(
element
.
getCurEnergyProp
(),
currentEnergy
);
//this.setFightProperty((element.getMaxEnergyProp().getId() % 70) + 1000, data.getSkillDepot().getEnergySkillData().getCostElemVal());
}
else
{
this
.
setFightProperty
(
element
.
getCurEnergyProp
(),
data
.
getSkillDepot
().
getEnergySkillData
().
getCostElemVal
());
}
}
}
// Artifacts
// Artifacts
...
...
src/main/java/emu/grasscutter/game/player/TeamManager.java
View file @
1d2fde40
...
@@ -621,6 +621,10 @@ public class TeamManager {
...
@@ -621,6 +621,10 @@ public class TeamManager {
}
}
public
void
handleEvtDoSkillSuccNotify
(
GameSession
session
,
int
skillId
,
int
casterId
)
{
public
void
handleEvtDoSkillSuccNotify
(
GameSession
session
,
int
skillId
,
int
casterId
)
{
if
(!
GAME_OPTIONS
.
energyUsage
)
{
return
;
}
// Determine the entity that has cast the skill.
// Determine the entity that has cast the skill.
Optional
<
EntityAvatar
>
caster
=
this
.
getActiveTeam
().
stream
()
Optional
<
EntityAvatar
>
caster
=
this
.
getActiveTeam
().
stream
()
.
filter
(
character
->
character
.
getId
()
==
casterId
)
.
filter
(
character
->
character
.
getId
()
==
casterId
)
...
...
src/main/java/emu/grasscutter/utils/ConfigContainer.java
View file @
1d2fde40
...
@@ -176,6 +176,7 @@ public class ConfigContainer {
...
@@ -176,6 +176,7 @@ public class ConfigContainer {
public
boolean
watchGachaConfig
=
false
;
public
boolean
watchGachaConfig
=
false
;
public
boolean
enableShopItems
=
true
;
public
boolean
enableShopItems
=
true
;
public
boolean
staminaUsage
=
true
;
public
boolean
staminaUsage
=
true
;
public
boolean
energyUsage
=
false
;
public
Rates
rates
=
new
Rates
();
public
Rates
rates
=
new
Rates
();
public
static
class
InventoryLimits
{
public
static
class
InventoryLimits
{
...
...
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