mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-27 08:36:38 +00:00
Make energy usage configurable, and preserve current behavior as the default.
This commit is contained in:
parent
76880a5bf7
commit
8aa0fde1cd
@ -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 {
|
|||||||
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());
|
||||||
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
|
// Artifacts
|
||||||
|
@ -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)
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user