- Add HookSabotage system for survivors to disable hooks temporarily - Add GeneratorKick killer ability to regress generator progress - Add PlayerJumpListener to track survivor jump actions - Add BossBarManager for displaying game state and objectives - Update generator regression logic to support killer kick mechanic - Update KillerController to integrate generator kick ability - Update PlayerInteractListener to handle new interaction types - Refactor game phases to use BossBarManager for UI updates - Update .gitignore to exclude compiled bin/ directory - Simplify PLAN.md documentation for easier maintenance
50 lines
1.8 KiB
Java
50 lines
1.8 KiB
Java
package dev.loki.survivor;
|
|
|
|
import dev.loki.config.GameConfig;
|
|
import dev.loki.player.PlayerState;
|
|
import dev.loki.player.Survivor;
|
|
import org.bukkit.entity.Player;
|
|
|
|
import java.util.UUID;
|
|
|
|
public class SurvivorController {
|
|
private final Survivor survivor;
|
|
private final SurvivorMovement movement;
|
|
private final SurvivorHealing healing;
|
|
|
|
public SurvivorController(Survivor survivor, GameConfig config) {
|
|
this.survivor = survivor;
|
|
this.movement = new SurvivorMovement(this);
|
|
this.healing = new SurvivorHealing(this, config);
|
|
}
|
|
|
|
public void onSprintStart() { movement.onSprintStart(); }
|
|
public void onSprintEnd() { movement.onSprintEnd(); }
|
|
|
|
public void onHealAttempt(Player target) { healing.startHealing(target); }
|
|
public void onHealCancel() { healing.cancelHealing(); }
|
|
|
|
public void tick() {
|
|
movement.tick();
|
|
healing.tick();
|
|
updateSpeed();
|
|
}
|
|
|
|
private void updateSpeed() {
|
|
Player player = survivor.getPlayer();
|
|
if (player == null) return;
|
|
float speed = movement.getCurrentSpeed();
|
|
player.setWalkSpeed(speed);
|
|
}
|
|
|
|
public void onStateChange(PlayerState newState) { movement.onStateChange(newState); }
|
|
|
|
public UUID getUuid() { return survivor.getUuid(); }
|
|
public Survivor getSurvivor() { return survivor; }
|
|
public Player getPlayer() { return survivor.getPlayer(); }
|
|
public PlayerState getState() { return survivor.getState(); }
|
|
public boolean isDowned() { return survivor.getState() == PlayerState.DOWNED; }
|
|
public boolean isInjured() { return survivor.getState() == PlayerState.INJURED; }
|
|
public boolean isHealthy() { return survivor.getState() == PlayerState.HEALTHY; }
|
|
public SurvivorHealing getHealing() { return healing; }
|
|
}
|