package me.msoucy.ptures.model

sealed class Status {

    open fun onAdd(creature : Creature) {
        // Do nothing
    }

    open fun onTurnEnd(engine : Engine) {
        // Do nothing by default
    }
}

sealed class VisibleStatus(val label : String = "") : Status()

sealed class CountdownStatus(var turns : Int) : Status()
{
    override fun onTurnEnd(engine : Engine) {
        turns--
        if(turns == 0) {
            onCountdownReached(engine)
            engine.attacker.removeStatus(this)
        }
    }

    open fun onCountdownReached(engine : Engine) {
    }
}

object KnockedOut : VisibleStatus("ko")
object Burned : VisibleStatus("burned") {
    override fun onTurnEnd(engine : Engine) {
        // Deal a small amount of damage
    }
}
object Stunned : VisibleStatus("stunned")
object Poisoned : VisibleStatus("poisoned")
class Flying : CountdownStatus(1) {
    override fun onCountdownReached(engine: Engine) {
        super.onCountdownReached(engine)
    }
}
