comparison eosd @ 262:8fa660da5f0c

Automatically search data files using different names.
author Thibaut Girka <thib@sitedethib.com>
date Mon, 23 Jan 2012 00:58:03 +0100
parents c417bb6c98bf
children 0aab9b34299e
comparison
equal deleted inserted replaced
261:2876c267be00 262:8fa660da5f0c
39 prng = Random(replay.levels[stage_num-1].random_seed) 39 prng = Random(replay.levels[stage_num-1].random_seed)
40 else: 40 else:
41 prng = None 41 prng = None
42 42
43 resource_loader = Loader(path) 43 resource_loader = Loader(path)
44
44 resource_loader.scan_archives(data) 45 resource_loader.scan_archives(data)
45 game = EoSDGame(resource_loader, [PlayerState(character=character)], stage_num, rank, 16, 46 game = EoSDGame(resource_loader, [PlayerState(character=character)], stage_num, rank, 16,
46 prng=prng) 47 prng=prng)
47 48
48 # Load stage data 49 # Load stage data
54 # Main loop 55 # Main loop
55 runner = GameRunner(resource_loader, game, background, replay=replay) 56 runner = GameRunner(resource_loader, game, background, replay=replay)
56 runner.start() 57 runner.start()
57 58
58 59
60 default_data = ('CM.DAT:th06*_CM.DAT:*CM.DAT:*cm.dat',
61 'ST.DAT:th6*ST.DAT:*ST.DAT:*st.dat',
62 '102h.exe:102*.exe:東方紅魔郷.exe:*.exe')
63
64
59 parser = argparse.ArgumentParser(description='Libre reimplementation of the Touhou 6 engine.') 65 parser = argparse.ArgumentParser(description='Libre reimplementation of the Touhou 6 engine.')
60 66
61 parser.add_argument('data', metavar='DAT', default=('CM.DAT', 'ST.DAT'), nargs='*', help='Game’s .DAT data files') 67 parser.add_argument('data', metavar='DAT', default=default_data, nargs='*', help='Game’s data files')
62 parser.add_argument('-p', '--path', metavar='DIRECTORY', default='.', help='Game directory path.') 68 parser.add_argument('-p', '--path', metavar='DIRECTORY', default='.', help='Game directory path.')
63 parser.add_argument('-s', '--stage', metavar='STAGE', type=int, required=True, help='Stage, 1 to 7 (Extra).') 69 parser.add_argument('-s', '--stage', metavar='STAGE', type=int, required=True, help='Stage, 1 to 7 (Extra).')
64 parser.add_argument('-r', '--rank', metavar='RANK', type=int, default=0, help='Rank, from 0 (Easy, default) to 3 (Lunatic).') 70 parser.add_argument('-r', '--rank', metavar='RANK', type=int, default=0, help='Rank, from 0 (Easy, default) to 3 (Lunatic).')
65 parser.add_argument('-c', '--character', metavar='CHARACTER', type=int, default=0, help='Select the character to use, from 0 (ReimuA, default) to 3 (MarisaB).') 71 parser.add_argument('-c', '--character', metavar='CHARACTER', type=int, default=0, help='Select the character to use, from 0 (ReimuA, default) to 3 (MarisaB).')
66 parser.add_argument('--replay', metavar='REPLAY', help='Select a replay') 72 parser.add_argument('--replay', metavar='REPLAY', help='Select a replay')