changeset 299:e04e402e6380

Implemented Sakuya's time stop.
author Elias Boutaleb <kagekyio@gmail.com>
date Fri, 09 Mar 2012 21:43:33 +0100
parents 92a6fd2632f1
children da53bc29b94a
files pytouhou/game/game.py pytouhou/vm/eclrunner.py
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/game/game.py
+++ b/pytouhou/game/game.py
@@ -57,6 +57,7 @@ class Game(object):
         self.difficulty_max = 20 if rank == 0 else 32
         self.boss = None
         self.spellcard = None
+        self.time_stop = False
         self.msg_runner = None
         self.msg_wait = False
         self.bonus_list = [0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0,
@@ -195,6 +196,8 @@ class Game(object):
 
 
     def update_effect(self):
+        if self.time_stop:
+            return None
         if self.effect is not None:
             self.effect.update()
 
@@ -214,6 +217,8 @@ class Game(object):
 
 
     def update_players(self, keystate):
+        if self.time_stop:
+            return None
         for player in self.players:
             player.update(keystate) #TODO: differentiate keystates (multiplayer mode)
             if player.state.x < 8.:
@@ -235,6 +240,8 @@ class Game(object):
 
 
     def update_bullets(self):
+        if self.time_stop:
+            return None
         for bullet in self.cancelled_bullets:
             bullet.update()
 
--- a/pytouhou/vm/eclrunner.py
+++ b/pytouhou/vm/eclrunner.py
@@ -1021,6 +1021,11 @@ class ECLRunner(object):
                       [4, 2, 3]]
             character = self._enemy.select_player().state.character
             self.variables[1:4] = values[character]
+        elif function == 4:
+            if arg == 1:
+                self._game.time_stop = True
+            else:
+                self._game.time_stop = False
         elif function == 8: # Remilia’s magic
             bullet_attributes = [70, 1, 1, 1, 1, 0., 0., 0., 0.7, 0]
             n = 0