from core.tuning.skill import SkillTuning
from siege import game


class Stun(object):
    NAME = "Stun"
    ICON = SkillTuning.STUN.ICON

    def __init__(self, owner, level, duration):
        owner.animation.play("idle")
        velocity = owner.physics.getVelocity()
        velocity.x = 0
        owner.physics.setVelocity(velocity)

    def onRemove(self, owner):
        #TODO: Enable use of spells
        pass

    def isPositive(self):
        return False

    @staticmethod
    def register():
        game.effects.register(Stun.NAME, Stun)
