# HG changeset patch # User Thibaut Girka # Date 1331720895 -3600 # Node ID 14c9aca8e2748d8db867eef310f7221616840625 # Parent 7a464291dd9d9625269d834502bcb7ea63ff3455 Implement Remilia's laser webs. diff --git a/pytouhou/game/enemy.py b/pytouhou/game/enemy.py --- a/pytouhou/game/enemy.py +++ b/pytouhou/game/enemy.py @@ -168,8 +168,9 @@ class Enemy(object): def new_laser(self, variant, laser_type, sprite_idx_offset, angle, speed, start_offset, end_offset, max_length, width, start_duration, duration, end_duration, - grazing_delay, grazing_extra_duration, unknown): - ox, oy = self.bullet_launch_offset + grazing_delay, grazing_extra_duration, unknown, + offset=None): + ox, oy = offset or self.bullet_launch_offset launch_pos = self.x + ox, self.y + oy if variant == 86: angle += self.get_player_angle(self.select_player(), launch_pos) diff --git a/pytouhou/game/laser.py b/pytouhou/game/laser.py --- a/pytouhou/game/laser.py +++ b/pytouhou/game/laser.py @@ -40,7 +40,7 @@ class LaserLaunchAnim(object): self.x = laser.base_pos[0] + offset * dx self.y = laser.base_pos[1] + offset * dy - scale = laser.width / 10. - (offset - laser.start_offset) + scale = laser.width / 10. - (offset - laser.start_offset) #TODO: check self.sprite.rescale = (scale, scale) self.sprite.changed = True diff --git a/pytouhou/vm/eclrunner.py b/pytouhou/vm/eclrunner.py --- a/pytouhou/vm/eclrunner.py +++ b/pytouhou/vm/eclrunner.py @@ -1019,6 +1019,47 @@ class ECLRunner(object): self._game.time_stop = True else: self._game.time_stop = False + elif function == 7: # Remilia’s laser webs + base_angle = self._game.prng.rand_double() * 2 * pi + for i in xrange(16): + delta = [+pi / 4., -pi / 4.][i % 2] + ox, oy = self._enemy.bullet_launch_offset + length = 32. #TODO: check + + # Inner circle + angle = base_angle + i * pi / 8. + ox, oy = ox + cos(angle) * length, oy + sin(angle) * length + length = 112. #TODO: check + if arg == 0: + self._enemy.new_laser(85, 1, 1, angle, 0., 0., length, length, 30., + 100, 80, 15, #TODO: check + 0, 0, 0, offset=(ox, oy)) + else: + self._enemy.fire(offset=(ox, oy)) + + # Middle circle + ox, oy = ox + cos(angle) * length, oy + sin(angle) * length + angle += delta + + if arg == 0: + self._enemy.new_laser(85, 1, 1, angle, 0., 0., length, length, 30., + 100, 80, 15, #TODO: check + 0, 0, 0, offset=(ox, oy)) + else: + self._enemy.fire(offset=(ox, oy)) + + # Outer circle + ox, oy = ox + cos(angle) * length, oy + sin(angle) * length + angle += delta + length = 400. #TODO: check + + if arg == 0: + self._enemy.new_laser(85, 1, 1, angle, 0., 0., length, length, 30., + 100, 80, 15, #TODO: check + 0, 0, 0, offset=(ox, oy)) + else: + self._enemy.fire(offset=(ox, oy)) + elif function == 8: # Remilia’s magic bullet_attributes = [70, 1, 1, 1, 1, 0., 0., 0., 0.7, 0] n = 0