#!
import tools
import object
import monty

from __main__ import Bonez
#
#{
state = 0

iface1 = Bonez.get_data_from_object (object.ITEMS ["spell01"].out_pack.get_base_cs_obj ()).get_py_interface ()
iface = Bonez.get_data_from_object (object.ITEMS ["spell01"].in_pack.get_base_cs_obj ()).get_py_interface ()

def restrict_use (self1, name):
    tools.tell ("napoveda13", 1)
    iface1.remove_restriction ("use_cb")
    return False

def restrict_self_use (self1, name):
    tools.tell ("napoveda14", 1)
    iface.remove_restriction ("self_use_cb")
    self.set_env_var ("state", 1)
    return False

iface.set_restriction ("self_use_cb", restrict_self_use)
iface1.set_restriction ("use_cb", restrict_use)
#}!
#{
1, state
#}
