package com.tiedup.remake.entities.ai.kidnapper;

/**
 * Enum defining the behavioral states of a Kidnapper entity.
 *
 *
 * These states drive the kidnapper's AI decision-making and help
 * coordinate behavior between multiple kidnappers.
 */
public enum KidnapperState {
    /**
     * Idle state - Kidnapper has nothing to do.
     * Default state when no other action is available.
     */
    IDLE,

    /**
     * Patrol state - Kidnapper is walking between patrol markers
     * or randomly around their home area.
     */
    PATROL,

    /**
     * Guard state - Kidnapper is watching over occupied cells,
     * looking for escape attempts.
     */
    GUARD,

    /**
     * Alert state - Kidnapper is actively searching for an escapee.
     * Moves faster and broadcasts position to other kidnappers.
     */
    ALERT,

    /**
     * Punish state - Kidnapper is punishing a recaptured prisoner.
     * Tightens binds, adds gag/blindfold, resets struggle progress.
     */
    PUNISH,

    /**
     * Capture state - Kidnapper is actively capturing a target.
     * Binding and gagging in progress.
     */
    CAPTURE,

    /**
     * Transport state - Kidnapper is bringing a captive to prison/cell.
     */
    TRANSPORT,

    /**
     * Selling state - Kidnapper is waiting for a buyer for their captive.
     */
    SELLING,

    /**
     * Job Watch state - Kidnapper is supervising a prisoner doing a job.
     */
    JOB_WATCH,

    /**
     * Hunt state - Kidnapper patrols far from camp looking for prey.
     * Larger patrol radius (80-150 blocks), actively searches for vulnerable targets.
     * Returns to camp after capture or periodically.
     */
    HUNT;

    /**
     * Check if this state allows the kidnapper to detect escapes/struggles.
     * IDLE, GUARD, PATROL, HUNT, and JOB_WATCH states can detect prisoner struggles.
     */
    public boolean canDetectEscapes() {
        return (
            this == IDLE ||
            this == GUARD ||
            this == PATROL ||
            this == HUNT ||
            this == JOB_WATCH
        );
    }

    /**
     * Check if this state allows receiving alert broadcasts.
     */
    public boolean canReceiveAlerts() {
        return this != ALERT && this != CAPTURE && this != TRANSPORT;
    }

    /**
     * Check if this is an active pursuit state.
     */
    public boolean isPursuit() {
        return this == ALERT || this == CAPTURE;
    }
}
