from siege import game


class Invincible(object):
    NAME = "Invincible"
    ICON = "mods/core/effect/invincible.png"

    def __init__(self, owner, level, duration):
        owner.combat.setInvincible(True)

    def onRemove(self, owner):
        owner.combat.setInvincible(False)

    def isPositive(self):
        return True

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