package com.example.gameofmoon.model

/**
 * 简化的游戏数据模型
 * 包含游戏运行所需的基本数据结构
 */

// 简单的故事节点
data class SimpleStoryNode(
    val id: String,
    val title: String,
    val content: String,
    val choices: List<SimpleChoice> = emptyList(),
    val imageResource: String? = null,
    val musicTrack: String? = null
)

// 简单的选择项
data class SimpleChoice(
    val id: String,
    val text: String,
    val nextNodeId: String,
    val effects: List<SimpleEffect> = emptyList(),
    val requirements: List<SimpleRequirement> = emptyList()
)

// 简单的效果
data class SimpleEffect(
    val type: SimpleEffectType,
    val value: String,
    val description: String = ""
)

enum class SimpleEffectType {
    HEALTH_CHANGE,
    STAMINA_CHANGE,
    DAY_CHANGE,
    LOOP_CHANGE,
    SECRET_UNLOCK,
    LOCATION_DISCOVER
}

// 简单的需求
data class SimpleRequirement(
    val type: SimpleRequirementType,
    val value: String,
    val description: String = ""
)

enum class SimpleRequirementType {
    MIN_HEALTH,
    MIN_STAMINA,
    HAS_SECRET,
    VISITED_LOCATION,
    MIN_LOOP
}

// 游戏状态
data class GameState(
    val health: Int = 100,
    val maxHealth: Int = 100,
    val stamina: Int = 50,
    val maxStamina: Int = 50,
    val currentDay: Int = 1,
    val currentLoop: Int = 1,
    val currentNodeId: String = "first_awakening",
    val unlockedSecrets: Set<String> = emptySet(),
    val exploredLocations: Set<String> = emptySet(),
    val characterStatus: CharacterStatus = CharacterStatus.GOOD,
    val weather: WeatherType = WeatherType.CLEAR
)

// 角色状态
enum class CharacterStatus(val displayName: String, val description: String) {
    EXCELLENT("状态极佳", "身体和精神都处于最佳状态"),
    GOOD("状态良好", "健康状况良好，精神饱满"),
    TIRED("有些疲劳", "感到疲倦，需要休息"),
    WEAK("状态虚弱", "身体虚弱，行动困难"),
    CRITICAL("生命危急", "生命垂危，急需医疗救助")
}

// 天气类型
enum class WeatherType(
    val displayName: String,
    val description: String,
    val staminaPenalty: Int
) {
    CLEAR("晴朗", "天气晴朗，适合活动", 0),
    LIGHT_RAIN("小雨", "轻微降雨，稍有影响", -2),
    HEAVY_RAIN("大雨", "暴雨倾盆，行动困难", -5),
    ACID_RAIN("酸雨", "有毒酸雨，非常危险", -8),
    CYBER_STORM("网络风暴", "电磁干扰严重", -3),
    SOLAR_FLARE("太阳耀斑", "强烈辐射，极度危险", -10)
}

// 对话历史条目
data class DialogueEntry(
    val id: String,
    val nodeId: String,
    val content: String,
    val choice: String? = null,
    val dayNumber: Int,
    val timestamp: Long = System.currentTimeMillis(),
    val isPlayerChoice: Boolean = false
)

// 游戏保存数据
data class GameSave(
    val id: String,
    val name: String,
    val gameState: GameState,
    val dialogueHistory: List<DialogueEntry>,
    val timestamp: Long = System.currentTimeMillis(),
    val saveType: SaveType = SaveType.MANUAL
)

enum class SaveType {
    MANUAL,
    AUTO_SAVE,
    CHECKPOINT
}
