def use(self, person, type): self._on_use(person) lbl = str(self.world).lower() + '_%s' % type + '_%s' % self.id print(lbl.encode('utf-8')) if renpy.has_label(lbl): renpy.call_in_new_context(lbl, person) self.locked = False
def add_action(self, action, single=True, special_values=None): action_ = Schedule._world + '_' + action if not renpy.has_label('shd_%s'%(action_)): action_ = Schedule._default_world + '_' + action if action_ in actions.keys(): act = ScheduledAction(self.owner, actions[action_][2], actions[action_][0], actions[action_][1], action_, single, special_values) if act.slot is not None: for a in self.actions: if a.slot == act.slot: self.remove_by_handle(a) self.actions.append(act) else: raise Exception("There is no %s action at current world(%s) or at core"%(action, self._world))
def can_intervene(self): return renpy.has_label(self._intervene_label())
def _call(label, *args, **kwargs): if renpy.has_label(label): return renpy.call_in_new_context(label, *args, **kwargs) else: return renpy.call_in_new_context("lb_missed", label=label)
def run(self, person): if renpy.has_label(self._run_label()): renpy.call_in_new_context(self._run_label(), motivation=self, person=person)
def call_on_remove(self): removal_label = self.lbl + '_' + 'remove' if renpy.has_label(removal_label): renpy.call_in_new_context(removal_label, self)
def interact(self, source, actor): lbl = 'lbl_interaction_%s' % self._id if renpy.has_label(lbl): return renpy.call_in_new_context(lbl, source=source, actor=actor)
def act(self, person): lbl = 'lbl_npc_action_%s_act' % self._id if renpy.has_label(lbl): return renpy.call_in_new_context(lbl, person=person, action=self)