Commit ba5635bf authored by gentlespoon's avatar gentlespoon Committed by Melledy
Browse files

Update StaminaManager

1. Update function signatures to prepare for vehicle stamina.
3. Remove hard-coded skills.
2. Wind resonance -15% stamina cost.
4. Climb talent cost reduction.
5. Swim talent cost reduction.
6. Diluc will now consume stamina at full price if talent not activated.
7. Sayu's windwheel no longer consumes stamina.
parent e5a85f81
...@@ -4,6 +4,7 @@ import java.io.*; ...@@ -4,6 +4,7 @@ import java.io.*;
import java.util.Calendar; import java.util.Calendar;
import emu.grasscutter.command.CommandMap; import emu.grasscutter.command.CommandMap;
import emu.grasscutter.game.managers.StaminaManager.StaminaManager;
import emu.grasscutter.plugin.PluginManager; import emu.grasscutter.plugin.PluginManager;
import emu.grasscutter.plugin.api.ServerHook; import emu.grasscutter.plugin.api.ServerHook;
import emu.grasscutter.scripts.ScriptLoader; import emu.grasscutter.scripts.ScriptLoader;
...@@ -110,6 +111,9 @@ public final class Grasscutter { ...@@ -110,6 +111,9 @@ public final class Grasscutter {
new ServerHook(gameServer, dispatchServer); new ServerHook(gameServer, dispatchServer);
// Create plugin manager instance. // Create plugin manager instance.
pluginManager = new PluginManager(); pluginManager = new PluginManager();
// TODO: find a better place?
StaminaManager.initialize();
// Start servers. // Start servers.
var runMode = SERVER.runMode; var runMode = SERVER.runMode;
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.entity.GameEntity;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.VehicleStaminaNotifyOuterClass.VehicleStaminaNotify;
public class PacketVehicleStaminaNotify extends BasePacket {
public PacketVehicleStaminaNotify(GameEntity entity, int newStamina) {
super(PacketOpcodes.VehicleStaminaNotify);
VehicleStaminaNotify.Builder proto = VehicleStaminaNotify.newBuilder();
proto.setEntityId(entity.getId());
proto.setCurStamina(newStamina);
this.setData(proto.build());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment