"""Entity-related constants and helpers."""

from __future__ import annotations

from .screen_constants import FPS

# --- Player and buddy settings ---
HUMANOID_RADIUS = 6
PLAYER_RADIUS = HUMANOID_RADIUS
PLAYER_SPEED = 1.4
FOV_RADIUS = 124  # approximate legacy FOV (80) * 1.55 cap
BUDDY_RADIUS = HUMANOID_RADIUS
BUDDY_FOLLOW_SPEED = PLAYER_SPEED * 0.7
HUMANOID_WALL_BUMP_FRAMES = 7

# --- Jump settings ---
PLAYER_JUMP_RANGE = 15  # px (enough to clear one 50px tile)
SURVIVOR_JUMP_RANGE = int(PLAYER_JUMP_RANGE * 0.7)  # px
JUMP_DURATION_MS = 200
JUMP_SCALE_MAX = 0.15
JUMP_SHADOW_OFFSET = 5

# --- Survivor settings (Stage 4) ---
SURVIVOR_RADIUS = HUMANOID_RADIUS
SURVIVOR_APPROACH_RADIUS = 48
SURVIVOR_APPROACH_SPEED = PLAYER_SPEED * 0.35
SURVIVOR_MAX_SAFE_PASSENGERS = 5
SURVIVOR_MIN_SPEED_FACTOR = 0.35

# --- Flashlight settings ---
FLASHLIGHT_WIDTH = 12
FLASHLIGHT_HEIGHT = 10

# --- Shoes settings ---
SHOES_WIDTH = 14
SHOES_HEIGHT = 12

# --- Zombie settings ---
ZOMBIE_RADIUS = HUMANOID_RADIUS
ZOMBIE_SPEED = PLAYER_SPEED * 0.45
ZOMBIE_WANDER_INTERVAL_MS = 5000
ZOMBIE_SIGHT_RANGE = FOV_RADIUS * 1.2
ZOMBIE_TRACKER_SIGHT_RANGE = ZOMBIE_SIGHT_RANGE * 0.2
FAST_ZOMBIE_BASE_SPEED = PLAYER_SPEED * 0.77
ZOMBIE_SEPARATION_DISTANCE = ZOMBIE_RADIUS * 2.2
ZOMBIE_AGING_DURATION_FRAMES = FPS * 60 * 6  # ~6 minutes at target framerate
ZOMBIE_AGING_MIN_SPEED_RATIO = 0.3
ZOMBIE_TRACKER_SCENT_RADIUS = 70
ZOMBIE_TRACKER_FAR_SCENT_RADIUS = 140
ZOMBIE_TRACKER_NEWER_FOOTPRINT_MS = 5000
ZOMBIE_TRACKER_SCENT_TOP_K = 3
ZOMBIE_TRACKER_SCAN_INTERVAL_MS = int(1000 * 30 / FPS)
ZOMBIE_TRACKER_WANDER_INTERVAL_MS = 2500
ZOMBIE_TRACKER_CROWD_BAND_WIDTH = 50
ZOMBIE_TRACKER_CROWD_BAND_LENGTH = 50
ZOMBIE_TRACKER_CROWD_COUNT = 5
ZOMBIE_TRACKER_RELOCK_DELAY_MS = 3000
ZOMBIE_WALL_HUG_SENSOR_DISTANCE = 24
ZOMBIE_WALL_HUG_PROBE_ANGLE_DEG = 45
ZOMBIE_WALL_HUG_PROBE_STEP = 2.0
ZOMBIE_WALL_HUG_TARGET_GAP = 4.0
ZOMBIE_WALL_HUG_LOST_WALL_MS = 2500

# --- Car and fuel settings ---
CAR_WIDTH = 16
CAR_HEIGHT = 24
CAR_SPEED = 2
CAR_HEALTH = 20
CAR_WALL_DAMAGE = 1
FUEL_CAN_WIDTH = 12
FUEL_CAN_HEIGHT = 15

# --- Wall and beam settings ---
INTERNAL_WALL_HEALTH = 40 * 100
INTERNAL_WALL_BEVEL_DEPTH = 6
STEEL_BEAM_HEALTH = int(INTERNAL_WALL_HEALTH * 1.5)
PLAYER_WALL_DAMAGE = 100
BUDDY_WALL_DAMAGE = int(PLAYER_WALL_DAMAGE * 0.7)
ZOMBIE_WALL_DAMAGE = 1

__all__ = [
    "HUMANOID_RADIUS",
    "PLAYER_RADIUS",
    "PLAYER_SPEED",
    "FOV_RADIUS",
    "BUDDY_RADIUS",
    "BUDDY_FOLLOW_SPEED",
    "HUMANOID_WALL_BUMP_FRAMES",
    "SURVIVOR_RADIUS",
    "SURVIVOR_APPROACH_RADIUS",
    "SURVIVOR_APPROACH_SPEED",
    "SURVIVOR_MAX_SAFE_PASSENGERS",
    "SURVIVOR_MIN_SPEED_FACTOR",
    "FLASHLIGHT_WIDTH",
    "FLASHLIGHT_HEIGHT",
    "SHOES_WIDTH",
    "SHOES_HEIGHT",
    "ZOMBIE_RADIUS",
    "ZOMBIE_SPEED",
    "ZOMBIE_WANDER_INTERVAL_MS",
    "ZOMBIE_SIGHT_RANGE",
    "ZOMBIE_TRACKER_SIGHT_RANGE",
    "FAST_ZOMBIE_BASE_SPEED",
    "ZOMBIE_SEPARATION_DISTANCE",
    "ZOMBIE_AGING_DURATION_FRAMES",
    "ZOMBIE_AGING_MIN_SPEED_RATIO",
    "ZOMBIE_TRACKER_SCENT_RADIUS",
    "ZOMBIE_TRACKER_FAR_SCENT_RADIUS",
    "ZOMBIE_TRACKER_NEWER_FOOTPRINT_MS",
    "ZOMBIE_TRACKER_SCENT_TOP_K",
    "ZOMBIE_TRACKER_SCAN_INTERVAL_MS",
    "ZOMBIE_TRACKER_WANDER_INTERVAL_MS",
    "ZOMBIE_TRACKER_CROWD_BAND_WIDTH",
    "ZOMBIE_TRACKER_CROWD_BAND_LENGTH",
    "ZOMBIE_TRACKER_CROWD_COUNT",
    "ZOMBIE_TRACKER_RELOCK_DELAY_MS",
    "ZOMBIE_WALL_HUG_SENSOR_DISTANCE",
    "ZOMBIE_WALL_HUG_PROBE_ANGLE_DEG",
    "ZOMBIE_WALL_HUG_PROBE_STEP",
    "ZOMBIE_WALL_HUG_TARGET_GAP",
    "ZOMBIE_WALL_HUG_LOST_WALL_MS",
    "CAR_WIDTH",
    "CAR_HEIGHT",
    "CAR_SPEED",
    "CAR_HEALTH",
    "CAR_WALL_DAMAGE",
    "FUEL_CAN_WIDTH",
    "FUEL_CAN_HEIGHT",
    "INTERNAL_WALL_HEALTH",
    "INTERNAL_WALL_BEVEL_DEPTH",
    "STEEL_BEAM_HEALTH",
    "PLAYER_WALL_DAMAGE",
    "BUDDY_WALL_DAMAGE",
    "ZOMBIE_WALL_DAMAGE",
]
