def __init__(self, terrain): unit.Unit.__init__(self, terrain) self.active_listeners = manager.init_listener() self.active_listeners.update( [ (e.FLOWER_UP, self.action_up), (e.FLOWER_DOWN, self.action_down), (e.FLOWER_LEFT, self.action_left), (e.FLOWER_RIGHT, self.action_right), (e.FLOWER_SKIP, self.action_skip), ] ) self.growth = 5
def __init__(self, terrain, executor): unit.Unit.__init__(self, terrain) self.active_listeners = manager.init_listener() self.active_listeners.update( [ (e.FLOWER_SEED, self.action_seed), (e.FLOWER_THORN, self.action_thorns), (e.FLOWER_POISON, self.action_poison), (e.FLOWER_CANCEL, self.action_cancel), ] ) self.executor = executor manager.restore_default() manager.update_current(unit.Unit.active().active_listeners)
def __init__(self, terrain): unit.Unit.__init__(self, terrain) self.active_listeners = manager.init_listener() self.active_listeners.update([(e.AI_SKIP, self.action_skip)])