diff src/th06/ecl_vm.rs @ 688:1adecaddf442

ecl_vm: implement SetBulletInterval and SetBulletIntervalEx.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 17 Aug 2019 13:50:54 +0200
parents aefe5b5f481e
children eecb8626f472
line wrap: on
line diff
--- a/src/th06/ecl_vm.rs
+++ b/src/th06/ecl_vm.rs
@@ -607,7 +607,19 @@ impl EclRunner {
                                          flags);
             }
 
+            // 76
+            SubInstruction::SetBulletInterval(interval) => {
+                let mut enemy = self.enemy.borrow_mut();
+                enemy.set_bullet_launch_interval(0, interval);
+            }
 
+            // 77
+            SubInstruction::SetBulletIntervalEx(interval) => {
+                let rand_start = self.get_prng().borrow_mut().get_u32();
+
+                let mut enemy = self.enemy.borrow_mut();
+                enemy.set_bullet_launch_interval(rand_start, interval);
+            }
 
             // 78-79 are more interpolation flags 
             // 78