# Health and Habits Management Module

This module contains all health and habits-related functionality extracted from `functions.py`.

## Files Created

- `health_manager.py` (382 lines) - Main module with all health and habits functions
- `__init__.py` - Package initialization file for clean imports

## Extracted Components

### Classes

1. **HabitClass** (line 222)
   - Represents positive or negative habits
   - Tracks habit status (active/quitting) and quit progress

2. **HealthCondition** (line 169)
   - Represents diseases and health conditions
   - Tracks duration, health impact, and cure status

### Functions

#### Weight Management
- `getWeightType(weight)` - Categorize weight (line 19)
- `handleWeight(person)` - Enforce weight boundaries (line 39)

#### Health Management
- `handleHealth(player, person)` - Update health based on conditions (line 56)
- `handleDeath(player)` - Handle player death event (line 87)
- `updateDeathChance(person)` - Calculate age-based death probability (line 98)

#### Hunger and Thirst
- `handleHunger(person)` - Enforce hunger/thirst boundaries (line 132)
- `mealEvent(player)` - Process meal consumption (line 149)

#### Health Conditions
- `getHealthConditions()` - Return list of all available conditions (line 192)

#### Habits System
- `setHabits(person)` - Initialize random habits for character (line 282)
- `quitHabit(player, habit)` - Start quitting a habit (line 327)
- `stopQuitHabit(player, habit)` - Stop quitting attempt (line 345)
- `handleHabitChanges(player, person)` - Process quit progress (line 364)

### Habit Definitions

- `negative_habits` - Dictionary of 16 negative habits
- `positive_habits` - Dictionary of 15 positive habits

## Usage

```python
# Import from the health package
from health import handleHealth, setHabits, getHealthConditions

# Or import the module directly
from health.health_manager import HabitClass, HealthCondition
```

## Notes

- All functions maintain their original implementation
- Dependencies on `getPeakEnergy()` from `functions.py` are preserved via import
- Comprehensive docstrings added for better documentation
- Original line numbers referenced for traceability

## Integration

To use this module in the main codebase, you'll need to:
1. Update imports in `functions.py` to reference this module
2. Ensure circular import issues are resolved (some functions import from `functions.py`)
