#!/usr/bin/python # # GemUO # # (c) 2005-2010 Max Kellermann <*****@*****.**> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # from gemuo.simple import simple_run from gemuo.engine.messages import PrintMessages from gemuo.engine.guards import Guards def run(client): Guards(client) return PrintMessages(client) simple_run(run)
def main(client): global screen screen = curses.initscr() curses.noecho() curses.cbreak() curses.start_color() curses.init_pair(COLOR_TREE, curses.COLOR_WHITE, curses.COLOR_GREEN) curses.init_pair(COLOR_WALL, curses.COLOR_BLACK, curses.COLOR_WHITE) curses.init_pair(COLOR_INNOCENT, curses.COLOR_BLACK, curses.COLOR_CYAN) curses.init_pair(COLOR_CRIMINAL, curses.COLOR_BLACK, curses.COLOR_WHITE) curses.init_pair(COLOR_MURDERER, curses.COLOR_BLACK, curses.COLOR_RED) curses.init_pair(COLOR_ALLY, curses.COLOR_BLACK, curses.COLOR_GREEN) curses.init_pair(COLOR_ENEMY, curses.COLOR_BLACK, curses.COLOR_MAGENTA) curses.init_pair(COLOR_INVULNERABLE, curses.COLOR_BLACK, curses.COLOR_YELLOW) curses.init_pair(COLOR_WATER, curses.COLOR_BLUE, curses.COLOR_WHITE) map_window = GameWindow(screen, client.world) return update(screen, map_window, client) if __name__ == '__main__': try: simple_run(main) restorescreen() except: restorescreen() traceback.print_exc()
# # (c) 2005-2010 Max Kellermann <*****@*****.**> # Kai Sassmannshausen <*****@*****.**> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # import uo.packets as p import gemuo.config from gemuo.simple import simple_run from gemuo.data import TileCache from gemuo.map import BridgeMap, WorldMap, CacheMap from gemuo.engine.death import AutoResurrect def run(client): tc = TileCache(gemuo.config.require_data_path()) m = CacheMap(WorldMap(BridgeMap(tc.get_map(0)), client.world)) return AutoResurrect(client, m) simple_run(run)
map_window.draw(client.world.player) screen.refresh() return simple_later(0.5, update, screen, map_window, client) def main(client): global screen screen = curses.initscr() curses.noecho() curses.cbreak() curses.start_color() curses.init_pair(COLOR_TREE, curses.COLOR_WHITE, curses.COLOR_GREEN) curses.init_pair(COLOR_WALL, curses.COLOR_BLACK, curses.COLOR_WHITE) curses.init_pair(COLOR_INNOCENT, curses.COLOR_BLACK, curses.COLOR_CYAN) curses.init_pair(COLOR_CRIMINAL, curses.COLOR_BLACK, curses.COLOR_WHITE) curses.init_pair(COLOR_MURDERER, curses.COLOR_BLACK, curses.COLOR_RED) curses.init_pair(COLOR_ALLY, curses.COLOR_BLACK, curses.COLOR_GREEN) curses.init_pair(COLOR_ENEMY, curses.COLOR_BLACK, curses.COLOR_MAGENTA) curses.init_pair(COLOR_INVULNERABLE, curses.COLOR_BLACK, curses.COLOR_YELLOW) curses.init_pair(COLOR_WATER, curses.COLOR_BLUE, curses.COLOR_WHITE) map_window = GameWindow(screen, client.world) return update(screen, map_window, client) if __name__ == '__main__': try: simple_run(main) restorescreen() except: restorescreen() traceback.print_exc()