mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-26 03:42:55 +00:00
Make energy usage configurable, and preserve current behavior as the default.
This commit is contained in:
parent
531683f370
commit
1d2fde40d5
@ -62,6 +62,8 @@ import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
|
||||
import static emu.grasscutter.Configuration.GAME_OPTIONS;
|
||||
|
||||
@Entity(value = "avatars", useDiscriminator = false)
|
||||
public class Avatar {
|
||||
@Id private ObjectId id;
|
||||
@ -517,8 +519,13 @@ public class Avatar {
|
||||
if (data.getSkillDepot() != null && data.getSkillDepot().getEnergySkillData() != null) {
|
||||
ElementType element = data.getSkillDepot().getElementType();
|
||||
this.setFightProperty(element.getMaxEnergyProp(), data.getSkillDepot().getEnergySkillData().getCostElemVal());
|
||||
this.setFightProperty(element.getCurEnergyProp(), currentEnergy);
|
||||
//this.setFightProperty((element.getMaxEnergyProp().getId() % 70) + 1000, data.getSkillDepot().getEnergySkillData().getCostElemVal());
|
||||
|
||||
if (GAME_OPTIONS.energyUsage) {
|
||||
this.setFightProperty(element.getCurEnergyProp(), currentEnergy);
|
||||
}
|
||||
else {
|
||||
this.setFightProperty(element.getCurEnergyProp(), data.getSkillDepot().getEnergySkillData().getCostElemVal());
|
||||
}
|
||||
}
|
||||
|
||||
// Artifacts
|
||||
|
@ -621,6 +621,10 @@ public class TeamManager {
|
||||
}
|
||||
|
||||
public void handleEvtDoSkillSuccNotify(GameSession session, int skillId, int casterId) {
|
||||
if (!GAME_OPTIONS.energyUsage) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine the entity that has cast the skill.
|
||||
Optional<EntityAvatar> caster = this.getActiveTeam().stream()
|
||||
.filter(character -> character.getId() == casterId)
|
||||
|
@ -176,6 +176,7 @@ public class ConfigContainer {
|
||||
public boolean watchGachaConfig = false;
|
||||
public boolean enableShopItems = true;
|
||||
public boolean staminaUsage = true;
|
||||
public boolean energyUsage = false;
|
||||
public Rates rates = new Rates();
|
||||
|
||||
public static class InventoryLimits {
|
||||
|
Loading…
Reference in New Issue
Block a user