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): actor = self.actor messages.Basic('Your mind expands to fill the world around you.', actor, self.symbol) #for (x, y) in self.actor.map.floodfill(self.actor.x, self.actor.y, 1000, True): # self.actor.memory.update(x, y, scry_color_filter) for i, points in enumerate(actor.map.iter_floodfill(actor.x, actor.y, 20, True)): for (x, y) in points: actor.memory.update(x, y, scry_color_filter) draw_map(actor) for (x, y) in points: libtcod.console_set_back(0, x, y, libtcod.violet) libtcod.console_set_fore(0, x, y, libtcod.light_violet) libtcod.console_flush() libtcod.sys_sleep_milli(50) return True