/**
 * Habit Manager Module
 * Dedicated module for habit tracking and management
 *
 * This module provides a cleaner API for the habit system, re-exporting
 * habit-related functionality from health_manager.ts and stats_manager.ts.
 *
 * Habit System Overview:
 * ----------------------
 * - Characters have both positive and negative habits
 * - Negative habits can be quit through a 30-week process
 * - Quitting habits costs +5 peak energy per quitting habit
 * - Habits are assigned based on age (fewer habits for younger characters)
 * - Conflicting positive/negative habits cannot coexist (e.g., tardiness vs punctuality)
 *
 * Ported from Python:
 * - ws/health/health_manager.py (HabitClass, setHabits, quitHabit, stopQuitHabit, handleHabitChanges)
 * - ws/stats/stats_manager.py (getPeakEnergy - habit energy cost calculation)
 */
import { Player } from '../../models/Player.js';
import { Person } from '../../models/Person.js';
/**
 * Type of habit - positive habits help the character, negative habits hinder
 */
export type HabitType = 'positive' | 'negative';
/**
 * Current status of a habit
 * - 'active': Habit is currently affecting the character
 * - 'quitting': Character is in the process of quitting (30-week countdown)
 */
export type HabitStatus = 'active' | 'quitting';
/**
 * Habit interface representing a character's behavioral pattern
 */
export interface Habit {
    /** Internal name identifier (e.g., 'smoking', 'regular_exercise') */
    name: string;
    /** User-facing description of the habit */
    description: string;
    /** Type discriminator, always 'habit' */
    type: 'habit';
    /** Whether this is a positive or negative habit */
    habitType: HabitType;
    /** Current status of the habit */
    status: HabitStatus;
    /** Progress toward quitting (0-30 weeks) */
    quitProgress: number;
}
/**
 * Result of a habit operation (quit, stop quit, etc.)
 */
export interface HabitOperationResult {
    success: boolean;
    message: string;
    habit?: Habit;
}
/**
 * Create a new habit instance
 *
 * @param name - Internal identifier for the habit
 * @param description - User-facing description
 * @param habitType - 'positive' or 'negative' (defaults to 'negative')
 * @returns A new Habit object
 */
export declare function createHabit(name: string, description: string, habitType?: HabitType): Habit;
/**
 * All negative habits that can afflict a character
 * These habits have negative effects on the character's life
 */
export declare const negativeHabits: Record<string, Habit>;
/**
 * All positive habits a character can develop
 * These habits have beneficial effects on the character's life
 */
export declare const positiveHabits: Record<string, Habit>;
/**
 * Mapping of negative habits to their positive counterparts
 * Characters cannot have both a negative habit and its positive pair simultaneously
 */
export declare const habitPairs: Record<string, string>;
/**
 * Format a habit name for display (convert snake_case to Title Case)
 *
 * @param name - The habit name in snake_case
 * @returns Formatted display name
 */
export declare function formatHabitName(name: string): string;
/**
 * Get all habits for a person
 *
 * @param person - The person to get habits for
 * @returns Array of habits (empty if none)
 */
export declare function getHabits(person: Person): Habit[];
/**
 * Get only negative habits for a person
 *
 * @param person - The person to get habits for
 * @returns Array of negative habits
 */
export declare function getNegativeHabits(person: Person): Habit[];
/**
 * Get only positive habits for a person
 *
 * @param person - The person to get habits for
 * @returns Array of positive habits
 */
export declare function getPositiveHabits(person: Person): Habit[];
/**
 * Get habits that are currently being quit
 *
 * @param person - The person to check
 * @returns Array of habits in 'quitting' status
 */
export declare function getQuittingHabits(person: Person): Habit[];
/**
 * Check if a person has a specific habit
 *
 * @param person - The person to check
 * @param habitName - Name of the habit to look for
 * @returns true if the person has the habit
 */
export declare function hasHabit(person: Person, habitName: string): boolean;
/**
 * Find a specific habit on a person
 *
 * @param person - The person to check
 * @param habitName - Name of the habit to find
 * @returns The habit if found, undefined otherwise
 */
export declare function findHabit(person: Person, habitName: string): Habit | undefined;
/**
 * Initialize habits for a person based on their age
 *
 * Habit assignment rules:
 * - Base habit count is 6 for adults (18+)
 * - Children get fewer habits: floor(age / 5)
 * - Random negative habits are assigned first
 * - Remaining slots filled with non-conflicting positive habits
 *
 * @param person - Person object to assign habits to
 * @returns The updated person object
 */
export declare function setHabits(person: Person): Person;
/**
 * Start the process of quitting a habit
 *
 * When a character decides to quit a habit:
 * 1. The habit's status is set to 'quitting'
 * 2. A message is added to the player's message queue
 * 3. Peak energy is recalculated (+5 energy cost per quitting habit)
 *
 * The quitting process takes 30 weeks. Each week, quitProgress increments by 1.
 * After 30 weeks, the habit is removed via handleHabitChanges().
 *
 * @param player - Player object with character and message queue
 * @param habitName - Name of the habit to quit (e.g., 'smoking')
 * @returns Result object with success status and message
 */
export declare function quitHabit(player: Player, habitName: string): HabitOperationResult;
/**
 * Stop trying to quit a habit and reset progress
 *
 * When a character gives up on quitting:
 * 1. The habit's status is reverted to 'active'
 * 2. The quitProgress is reset to 0
 * 3. A message is added to the player's message queue
 * 4. Peak energy is recalculated (no longer paying +5 energy cost)
 *
 * @param player - Player object with character and message queue
 * @param habitName - Name of the habit to stop quitting
 * @returns Result object with success status and message
 */
export declare function stopQuitHabit(player: Player, habitName: string): HabitOperationResult;
/**
 * Process habit quitting progress (weekly tick)
 *
 * This function should be called once per in-game week.
 * For each habit with status 'quitting':
 * 1. Increment quitProgress by 1
 * 2. If quitProgress reaches 30, the habit is successfully quit:
 *    - Remove the habit from the person's habit list
 *    - Add success message to player's message queue
 *    - Recalculate peak energy
 *
 * Energy considerations:
 * - While quitting: +5 peak energy cost
 * - After successfully quitting: Energy cost is removed
 *
 * @param player - Player object for message queue
 * @param person - Person object with habits array
 * @returns Number of habits that were successfully quit this tick
 */
export declare function handleHabitChanges(player: Player, person: Person): number;
/**
 * Add a specific habit to a person
 *
 * @param person - Person to add the habit to
 * @param habitName - Name of the habit from positiveHabits or negativeHabits
 * @returns true if habit was added, false if already exists or not found
 */
export declare function addHabit(person: Person, habitName: string): boolean;
/**
 * Remove a specific habit from a person
 *
 * @param person - Person to remove the habit from
 * @param habitName - Name of the habit to remove
 * @returns true if habit was removed, false if not found
 */
export declare function removeHabit(person: Person, habitName: string): boolean;
/**
 * Calculate the total energy cost from quitting habits
 *
 * @param person - Person to calculate for
 * @returns Energy cost from quitting habits (+5 per quitting habit)
 */
export declare function getQuittingEnergyCost(person: Person): number;
/**
 * Get a summary of a person's habits
 *
 * @param person - Person to get summary for
 * @returns Summary object with habit counts and details
 */
export declare function getHabitSummary(person: Person): {
    totalHabits: number;
    positiveCount: number;
    negativeCount: number;
    quittingCount: number;
    quittingEnergyCost: number;
    habits: Habit[];
};
/**
 * Habit manager object with all habit-related functions
 */
export declare const habitManager: {
    negativeHabits: Record<string, Habit>;
    positiveHabits: Record<string, Habit>;
    habitPairs: Record<string, string>;
    createHabit: typeof createHabit;
    setHabits: typeof setHabits;
    getHabits: typeof getHabits;
    getNegativeHabits: typeof getNegativeHabits;
    getPositiveHabits: typeof getPositiveHabits;
    getQuittingHabits: typeof getQuittingHabits;
    hasHabit: typeof hasHabit;
    findHabit: typeof findHabit;
    getHabitSummary: typeof getHabitSummary;
    addHabit: typeof addHabit;
    removeHabit: typeof removeHabit;
    quitHabit: typeof quitHabit;
    stopQuitHabit: typeof stopQuitHabit;
    handleHabitChanges: typeof handleHabitChanges;
    getQuittingEnergyCost: typeof getQuittingEnergyCost;
    formatHabitName: typeof formatHabitName;
};
export default habitManager;
//# sourceMappingURL=habit_manager.d.ts.map