package com.pixelized.shared.lwa.model.characterSheet

data class CharacterSheet(
    val id: String,
    val name: String,
    val job: String,
    val portrait: String?,
    val thumbnail: String?,
    val externalLink: String?,
    val level: Int,
    val shouldLevelUp: Boolean,
    // characteristics
    val strength: Int,
    val dexterity: Int,
    val constitution: Int,
    val height: Int,
    val intelligence: Int,
    val power: Int,
    val charisma: Int,
    // alterations
    val damage: Int, // damage taken on the hp pool
    val fatigue: Int, // damage taken on the pp pool
    val diminished: Int,
    val alterations: List<String>,
    // skills
    val commonSkills: List<Skill>,
    val specialSkills: List<Skill>,
    val magicSkills: List<Skill>,
    // actions
    val actions: List<Roll>,
    // tags
    val tags: List<String>,
) {
    fun skill(id: String?): Skill? = commonSkills.firstOrNull { it.id == id }
        ?: specialSkills.firstOrNull { it.id == id }
        ?: magicSkills.firstOrNull { it.id == id }

    data class Skill(
        val id: String,
        val label: String,
        val description: String?,
        val base: String,
        val bonus: String?,
        val level: Int,
        val occupation: Boolean,
        val used: Boolean,
    )

    data class Roll(
        val id: String,
        val label: String,
        val description: String?,
        val canBeCritical: Boolean,
        val default: String,
        val special: String?,
        val critical: String?,
    )

    object StatusId {
        const val DIMINISHED = "DIMINISHED"
    }

    object CharacteristicId {
        const val PORTRAIT = "PORTRAIT"
        const val THUMBNAIL = "THUMBNAIL"
        const val LVL = "LEVEL"
        const val STR = "STR"
        const val DEX = "DEX"
        const val CON = "CON"
        const val HEI = "HEI"
        const val INT = "INT"
        const val POW = "POW"
        const val CHA = "CHA"
        const val MOV = "MOV"
        const val HP = "HP"
        const val PP = "PP"
        const val DMG = "DMG"
        const val ARMOR = "ARMOR"
        const val REFLEX = "REFLEX"
        const val INITIATIVE = "INITIATIVE"
        const val LB = "LEARNING"
        const val GHP = "HP_GROW"
    }

    object CommonSkillId {
        const val COMBAT_ID = "COMBAT"
        const val DODGE_ID = "DODGE"
        const val GRAB_ID = "GRAB"
        const val THROW_ID = "THROW"
        const val ATHLETICS_ID = "ATHLETICS"
        const val ACROBATICS_ID = "ACROBATICS"
        const val PERCEPTION_ID = "PERCEPTION"
        const val SEARCH_ID = "SEARCH"
        const val EMPATHY_ID = "EMPATHY"
        const val PERSUASION_ID = "PERSUASION"
        const val INTIMIDATION_ID = "INTIMIDATION"
        const val SPIEL_ID = "SPIEL"
        const val BARGAIN_ID = "BARGAIN"
        const val DISCRETION_ID = "DISCRETION"
        const val SLEIGHT_OF_HAND_ID = "SLEIGHT_OF_HAND"
        const val AID_ID = "AID"
    }
}