Mercurial > touhou
comparison pytouhou/vm/eclrunner.py @ 309:14c9aca8e274
Implement Remilia's laser webs.
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Wed, 14 Mar 2012 11:28:15 +0100 |
parents | 7a464291dd9d |
children | 81c5b0b51093 |
comparison
equal
deleted
inserted
replaced
308:7a464291dd9d | 309:14c9aca8e274 |
---|---|
1017 elif function == 4: | 1017 elif function == 4: |
1018 if arg == 1: | 1018 if arg == 1: |
1019 self._game.time_stop = True | 1019 self._game.time_stop = True |
1020 else: | 1020 else: |
1021 self._game.time_stop = False | 1021 self._game.time_stop = False |
1022 elif function == 7: # Remilia’s laser webs | |
1023 base_angle = self._game.prng.rand_double() * 2 * pi | |
1024 for i in xrange(16): | |
1025 delta = [+pi / 4., -pi / 4.][i % 2] | |
1026 ox, oy = self._enemy.bullet_launch_offset | |
1027 length = 32. #TODO: check | |
1028 | |
1029 # Inner circle | |
1030 angle = base_angle + i * pi / 8. | |
1031 ox, oy = ox + cos(angle) * length, oy + sin(angle) * length | |
1032 length = 112. #TODO: check | |
1033 if arg == 0: | |
1034 self._enemy.new_laser(85, 1, 1, angle, 0., 0., length, length, 30., | |
1035 100, 80, 15, #TODO: check | |
1036 0, 0, 0, offset=(ox, oy)) | |
1037 else: | |
1038 self._enemy.fire(offset=(ox, oy)) | |
1039 | |
1040 # Middle circle | |
1041 ox, oy = ox + cos(angle) * length, oy + sin(angle) * length | |
1042 angle += delta | |
1043 | |
1044 if arg == 0: | |
1045 self._enemy.new_laser(85, 1, 1, angle, 0., 0., length, length, 30., | |
1046 100, 80, 15, #TODO: check | |
1047 0, 0, 0, offset=(ox, oy)) | |
1048 else: | |
1049 self._enemy.fire(offset=(ox, oy)) | |
1050 | |
1051 # Outer circle | |
1052 ox, oy = ox + cos(angle) * length, oy + sin(angle) * length | |
1053 angle += delta | |
1054 length = 400. #TODO: check | |
1055 | |
1056 if arg == 0: | |
1057 self._enemy.new_laser(85, 1, 1, angle, 0., 0., length, length, 30., | |
1058 100, 80, 15, #TODO: check | |
1059 0, 0, 0, offset=(ox, oy)) | |
1060 else: | |
1061 self._enemy.fire(offset=(ox, oy)) | |
1062 | |
1022 elif function == 8: # Remilia’s magic | 1063 elif function == 8: # Remilia’s magic |
1023 bullet_attributes = [70, 1, 1, 1, 1, 0., 0., 0., 0.7, 0] | 1064 bullet_attributes = [70, 1, 1, 1, 1, 0., 0., 0., 0.7, 0] |
1024 n = 0 | 1065 n = 0 |
1025 for bullet in self._game.bullets: | 1066 for bullet in self._game.bullets: |
1026 if bullet._bullet_type.anim_index < 5: | 1067 if bullet._bullet_type.anim_index < 5: |