diff pytouhou/vm/eclrunner.py @ 182:20843875ad8f

(Hopefully) use difficulty as it should. The difficulty[0] (also called rank) varies from 0 to 32 and affects various parts of the game. The difficulty now impact those parts, but how it is modified during the gameplay is not clear. Such changes to the difficulty are not handled yet. [0] http://en.touhouwiki.net/wiki/Embodiment_of_Scarlet_Devil/Gameplay#Rank
author Thibaut Girka <thib@sitedethib.com>
date Tue, 25 Oct 2011 01:29:40 +0200
parents 184196480f59
children b6d7ce644f34
line wrap: on
line diff
--- a/pytouhou/vm/eclrunner.py
+++ b/pytouhou/vm/eclrunner.py
@@ -665,13 +665,12 @@ class ECLRunner(object):
 
     @instruction(76)
     def set_bullet_interval(self, value):
-        self._enemy.bullet_launch_interval = value
+        self._enemy.set_bullet_launch_interval(value)
 
 
     @instruction(77)
     def set_bullet_interval_ex(self, value):
-        self._enemy.bullet_launch_interval = value
-        self._enemy.bullet_launch_timer = int(self._game.prng.rand_double() * value) #TODO: check
+        self._enemy.set_bullet_launch_interval(value, self._game.prng.rand_double()) #TODO: check
 
 
     @instruction(78)
@@ -923,3 +922,8 @@ class ECLRunner(object):
     def set_remaining_lives(self, lives):
         self._enemy.remaining_lives = lives
 
+
+    @instruction(131)
+    def set_difficulty_coeffs(self, speed_a, speed_b, nb_a, nb_b, shots_a, shots_b):
+        self._enemy.difficulty_coeffs = (speed_a, speed_b, nb_a, nb_b, shots_a, shots_b)
+