Mercurial > touhou
changeset 162:959c8b312918
Add character choosing in CLI.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 16 Oct 2011 07:42:11 -0700 |
parents | 7e7368356445 |
children | ee0bbde02c48 |
files | eclviewer.py |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/eclviewer.py +++ b/eclviewer.py @@ -26,11 +26,11 @@ from pytouhou.game.games import EoSDGame from pytouhou.game.player import PlayerState -def main(path, stage_num, rank): +def main(path, stage_num, rank, character): resource_loader = Loader() resource_loader.scan_archives(os.path.join(path, name) for name in ('CM.DAT', 'ST.DAT')) - game = EoSDGame(resource_loader, [PlayerState()], stage_num, rank, 16) + game = EoSDGame(resource_loader, [PlayerState(character=character)], stage_num, rank, 16) # Load stage data stage = resource_loader.get_stage('stage%d.std' % stage_num) @@ -47,11 +47,12 @@ def main(path, stage_num, rank): try: - file_path, stage_num, rank = sys.argv[1:] + file_path, stage_num, rank, character = sys.argv[1:] stage_num = int(stage_num) rank = int(rank) + character = int(character) except ValueError: - print('Usage: %s game_dir_path stage_num rank' % sys.argv[0]) + print('Usage: %s game_dir_path stage_num rank character' % sys.argv[0]) else: - main(file_path, stage_num, rank) + main(file_path, stage_num, rank, character)