# HG changeset patch # User Thibaut Girka # Date 1329008956 -3600 # Node ID b6c068c8f7f2d9549403317406bce1cc5f00a201 # Parent dbb1a86c02353fa9416ccacebb11468dcdb35ffa Fix ECL time flow. Spellcard do not stop time. Instruction 0xc does. diff --git a/pytouhou/formats/ecl.py b/pytouhou/formats/ecl.py --- a/pytouhou/formats/ecl.py +++ b/pytouhou/formats/ecl.py @@ -160,7 +160,7 @@ class ECL(object): 8: ('', None), 9: ('', None), 10: ('II', None), - 12: ('', None)} + 12: ('', 'stop_time')} def __init__(self): diff --git a/pytouhou/vm/eclrunner.py b/pytouhou/vm/eclrunner.py --- a/pytouhou/vm/eclrunner.py +++ b/pytouhou/vm/eclrunner.py @@ -26,12 +26,14 @@ logger = get_logger(__name__) class ECLMainRunner(object): __metaclass__ = MetaRegistry __slots__ = ('_ecl', '_game', 'processes', 'frame', - 'instruction_pointer') + 'instruction_pointer', + 'time_stopped') def __init__(self, ecl, game): self._ecl = ecl self._game = game self.frame = 0 + self.time_stopped = False self.processes = [] @@ -61,7 +63,10 @@ class ECLMainRunner(object): self.processes[:] = (process for process in self.processes if process.run_iteration()) - if not self._game.spellcard: + if not self._game.boss: + self.time_stopped = False + + if not self.time_stopped: self.frame += 1 @@ -89,6 +94,11 @@ class ECLMainRunner(object): self._pop_enemy(sub, instr_type, x, y, z, life, bonus_dropped, die_score) + @instruction(12) + def stop_time(self, sub, instr_type): + self.time_stopped = True + + class ECLRunner(object):