comparison pytouhou/vm/msgrunner.py @ 331:1b4f04b08729

Add the story mode.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 30 Jun 2012 19:37:21 +0200
parents 61adb5453e46
children 72ef7e24b373
comparison
equal deleted inserted replaced
330:16ed1ab1e14b 331:1b4f04b08729
17 17
18 from pytouhou.vm.common import MetaRegistry, instruction 18 from pytouhou.vm.common import MetaRegistry, instruction
19 from pytouhou.game.face import Face 19 from pytouhou.game.face import Face
20 20
21 logger = get_logger(__name__) 21 logger = get_logger(__name__)
22
23
24 class NextStage(Exception):
25 pass
22 26
23 27
24 class MSGRunner(object): 28 class MSGRunner(object):
25 __metaclass__ = MetaRegistry 29 __metaclass__ = MetaRegistry
26 __slots__ = ('_msg', '_game', 'frame', 'sleep_time', 'allow_skip', 30 __slots__ = ('_msg', '_game', 'frame', 'sleep_time', 'allow_skip',
136 @instruction(10) 140 @instruction(10)
137 def freeze(self): 141 def freeze(self):
138 self.frozen = True 142 self.frozen = True
139 143
140 144
145 @instruction(11)
146 def next_stage(self):
147 raise NextStage
148
149
141 @instruction(13) 150 @instruction(13)
142 def set_allow_skip(self, boolean): 151 def set_allow_skip(self, boolean):
143 self.allow_skip = bool(boolean) 152 self.allow_skip = bool(boolean)