package com.pixelized.shared.lwa.usecase

import com.pixelized.shared.lwa.utils.floor5
import kotlin.math.max

class SkillUseCase {

    fun combat(dexterity: Int): Int {
        return (dexterity * 2).floor5()
    }

    fun dodge(dexterity: Int): Int {
        return (dexterity * 2).floor5()
    }

    fun grab(strength: Int, height: Int): Int {
        return (strength + height).floor5()
    }

    fun shoot(strength: Int, dexterity: Int): Int {
        return (strength + dexterity).floor5()
    }

    fun athletics(strength: Int, constitution: Int): Int {
        return (strength + constitution * 2).floor5()
    }

    fun acrobatics(dexterity: Int, constitution: Int): Int {
        return (dexterity + constitution * 2).floor5()
    }

    fun perception(intelligence: Int): Int {
        return (10 + intelligence * 2).floor5()
    }

    fun search(intelligence: Int): Int {
        return (10 + intelligence * 2).floor5()
    }

    fun empathy(charisma: Int, intelligence: Int): Int {
        return (charisma + intelligence).floor5()
    }

    fun persuasion(charisma: Int): Int {
        return (charisma * 3).floor5()
    }

    fun intimidation(charisma: Int, height: Int, power: Int): Int {
        return (charisma + max(height, power) * 2).floor5()
    }

    fun spiel(charisma: Int, intelligence: Int): Int {
        return (charisma * 2 + intelligence).floor5()
    }

    fun bargain(charisma: Int): Int {
        return (charisma * 2).floor5()
    }

    fun discretion(charisma: Int, dexterity: Int, height: Int): Int {
        return (charisma + dexterity * 2 - height).floor5()
    }

    fun sleightOfHand(dexterity: Int): Int {
        return (dexterity * 2).floor5()
    }

    fun aid(intelligence: Int, dexterity: Int): Int {
        return (intelligence + dexterity).floor5()
    }
}