Mercurial > touhou
comparison src/th06/ecl_vm.rs @ 728:414f8611f344
ecl: Add support for bullet sounds, instruction 84.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 30 Oct 2019 16:27:43 +0100 |
parents | fbf89cba04e2 |
children | ca46b4312df1 |
comparison
equal
deleted
inserted
replaced
727:eea03c9ca604 | 728:414f8611f344 |
---|---|
677 SubInstruction::ChangeBulletsIntoStarBonus() => { | 677 SubInstruction::ChangeBulletsIntoStarBonus() => { |
678 let mut game = self.game.borrow_mut(); | 678 let mut game = self.game.borrow_mut(); |
679 game.change_bullets_into_star_items(); | 679 game.change_bullets_into_star_items(); |
680 } | 680 } |
681 */ | 681 */ |
682 | |
682 // 84 | 683 // 84 |
683 // WARNING: dead code. If the parameter is < 0 it unsets a bullet_flag, otherwise it | 684 SubInstruction::SetBulletSound(sound) => { |
684 // sets it, never using the parameter ever | 685 let mut enemy = self.enemy.borrow_mut(); |
685 /* | 686 if sound < 0 { |
686 SubInstruction::UNK_ins84() => { | 687 enemy.bullet_attributes.sound = None; |
687 let mut enemy = self.enemy.borrow_mut(); | 688 } else { |
688 enemy.bullet_flag_something | 689 // This assert isn’t part of the original engine, but it would crash on high |
689 } | 690 // values anyway. |
690 */ | 691 assert!(sound <= 255); |
692 enemy.bullet_attributes.sound = Some(sound as u8); | |
693 } | |
694 } | |
691 | 695 |
692 // 85-86 ire newlaser functions | 696 // 85-86 ire newlaser functions |
693 | 697 |
694 // 87 | 698 // 87 |
695 SubInstruction::SetUpcomingLaserId(laser_id) => { | 699 SubInstruction::SetUpcomingLaserId(laser_id) => { |