def stay(self): """ При нахождении в локации. :return: """ if self._stay is not None: renpy.call(self._stay)
def on_enter(self): """ При заходе в локацию :return: """ self.entered = True if self._onEnter is not None: renpy.call(self._onEnter)
def on_exit(self): """ При выходе из локации. :return: """ if self._onExit is not None: renpy.call(self._onExit) self.entered = False
def call_interrupting_traveling_event_label( checking_event , previous_location , target_location , events_to_check, completed_events , interrupt_message ) : if checking_event.recurring_count < INFINITE : checking_event.recurring_count -= 1 if checking_event.recurring_count < 1 : completed_events.append( checking_event ) events_to_check.remove( checking_event ) renpy.call( checking_event.interrupting_label , previous_location , target_location , interrupt_message ) return
def make_locations_menu(self): menu_list = [] for location in self.locations: displayed = location.name menu_list.append((displayed, location)) diff = self.loc_max - len(self.locations) for i in range(diff): menu_list.append(('???', 'pass')) menu_list.append(('Do not go anywhere', 'done')) choice = renpy.display_menu(menu_list) if choice == 'done': return renpy.call('lbl_edge_manage') if choice == 'pass': return renpy.call('lbl_edge_missed_location') return self.go_to(choice)
def check_and_start(self, is_interrupting): if self.run_condition.check() == True: if not is_interrupting or self.interrupts: timestamp = time_control.time_control.get_timestamp() self.last_run_timestamp = timestamp if self.setup_function is not None: self.setup_function() if self.interrupting_label is not None: global running_event_history_entry global running_event if running_event is not None: running_event.conclude(was_successful = False, was_interrupted = False) running_event_history_entry = Event_History_Entry(self.identifier, timestamp, was_run = True) running_event = self renpy.call(self.interrupting_label) else: return True return False
def call_interrupting_scheduled_event_label( checking_event , previous_timestamp , target_timestamp , events_to_check, completed_events , interrupt_message ) : # Before calling the interrupting event, define when it occurs and call all non-interrupting events that should happen before that. if time_control.time_control.compare_times( checking_event.starts_at_timestamp , previous_timestamp ) <= 0 : target_timestamp = previous_timestamp else : target_timestamp = checking_event.starts_at_timestamp for index in range( len( events_to_check ) -1 , 0 , -1 ) : # Events are ordered with all non-interrupting events at the end. If an interrupting event is found, the search through the list can be stopped. if not events_to_check[ index ].interrupts : execute_non_interrupting_scheduled_event_function( checking_event , previous_timestamp , target_timestamp , events_to_check, completed_events ) else : break # Once all non-interrupting functions have beel called, time should be advanced to the interrupting event's starts_at_timestamp time. time_control.time_control.progress_calendar_to_timestamp( new_timestamp = target_timestamp , progress_can_be_interrupted = False , interrupted_message = "" ) if checking_event.recurring_count < INFINITE : checking_event.recurring_count -= 1 if checking_event.recurring_count < 1 : completed_events.append( checking_event ) events_to_check.remove( checking_event ) renpy.call( checking_event.interrupting_label , previous_timestamp , target_timestamp , interrupt_message ) return
def go_to(self): renpy.call(self.lbl_to_go, self)
def call_roll(self, n): renpy.call('roll_dices_action', self.roll_n, self.after_roll)
def launch(self): renpy.call(self.label)
def visit(self, world): renpy.call(self.label(), world=world)
def __call__(self): renpy.call(self.label) return True