def on_turn(self): # Draw the game screen draw_map(self) draw_hud(self) libtcod.console_flush() # Need to handle window closing events globally... # if libtcod.console_is_window_closed(): # raise SetState('quit') # Handle keyboard input return on_turn(self)
def on_apply(self): #coords = (None, None) for coords in ask_choose_target(self.actor, 'Teleport to where?'): if coords: if self.actor.map.can_place_actor(coords[0], coords[1]): messages.Basic('You are teleported away.', self.actor, self.symbol) self.actor.move_to(coords[0], coords[1]) self.actor.inventory.add(ScrollDebugTeleport()) return True else: #self.actor.ask_hit_enter("You can't move there.", '?') messages.Basic("You can't move there.", '?') draw_hud(self.actor) else: break return False