comparison pytouhou/vm/eclrunner.py @ 274:f037bca24f2d

Partially implement lasers. “Launch animations”/“energy circles” are missing, aswell as collision and grazing.
author Thibaut Girka <thib@sitedethib.com>
date Sun, 05 Feb 2012 23:41:55 +0100
parents 595b227886b1
children 4b0570bf5847
comparison
equal deleted inserted replaced
273:595b227886b1 274:f037bca24f2d
721 @instruction(83) 721 @instruction(83)
722 def change_bullets_into_star_items(self): 722 def change_bullets_into_star_items(self):
723 self._game.change_bullets_into_star_items() 723 self._game.change_bullets_into_star_items()
724 724
725 725
726 @instruction(85)
727 def new_laser(self, laser_type, sprite_idx_offset, angle, speed,
728 start_offset, end_offset, max_length, width,
729 start_duration, duration, end_duration,
730 grazing_delay, grazing_extra_duration, unknown):
731 self._enemy.new_laser(85, laser_type, sprite_idx_offset, self._getval(angle), speed,
732 start_offset, end_offset, max_length, width,
733 start_duration, duration, end_duration,
734 grazing_delay, grazing_extra_duration, unknown)
735
736
737 @instruction(86)
738 def new_laser_towards_player(self, laser_type, sprite_idx_offset, angle, speed,
739 start_offset, end_offset, max_length, width,
740 start_duration, duration, end_duration,
741 grazing_delay, grazing_extra_duration, unknown):
742 self._enemy.new_laser(86, laser_type, sprite_idx_offset, self._getval(angle), speed,
743 start_offset, end_offset, max_length, width,
744 start_duration, duration, end_duration,
745 grazing_delay, grazing_extra_duration, unknown)
746
747
748 @instruction(87)
749 def set_upcoming_laser_id(self, laser_id):
750 self._enemy.current_laser_id = laser_id
751
752
753 @instruction(88)
754 def alter_laser_angle(self, laser_id, delta):
755 try:
756 laser = self._enemy.laser_by_id[laser_id]
757 except KeyError:
758 pass #TODO
759 else:
760 laser.angle += self._getval(delta)
761
762
763 @instruction(90)
764 def reposition_laser(self, laser_id, ox, oy, oz):
765 try:
766 laser = self._enemy.laser_by_id[laser_id]
767 except KeyError:
768 pass #TODO
769 else:
770 laser.x, laser.y = self._enemy.x + ox, self._enemy.y + oy
771
772
773 @instruction(92)
774 def cancel_laser(self, laser_id):
775 try:
776 laser = self._enemy.laser_by_id[laser_id]
777 except KeyError:
778 pass #TODO
779 else:
780 laser.cancel()
781
782
726 @instruction(93) 783 @instruction(93)
727 def set_spellcard(self, unknown, number, name): 784 def set_spellcard(self, unknown, number, name):
728 #TODO: display it on the game. 785 #TODO: display it on the game.
729 #TODO: make the enemies more resistants (and find how). 786 #TODO: make the enemies more resistants (and find how).
730 self._game.change_bullets_into_star_items() 787 self._game.change_bullets_into_star_items()