diff src/th06/ecl_vm.rs @ 723:420cec4005b5

ecl_vm: patchouli spellcard selector
author Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
date Tue, 29 Oct 2019 04:06:28 +0100
parents e71ea8214ee2
children 8acaf45b47d0
line wrap: on
line diff
--- a/src/th06/ecl_vm.rs
+++ b/src/th06/ecl_vm.rs
@@ -988,6 +988,21 @@ impl EclRunner {
                                    rand_y * range_y + enemy.pos.x as f64 - range_y / 2.];
                         enemy.bullet_attributes.fire();
                     }
+                    3 => { // Patchouli’s dual sign spellcard selector
+                        let mut enemy = self.enemy.borrow_mut();
+                        let mut knowledge: [[i32; 3]; 4] =
+                            [[0, 3, 1],
+                             [2, 3, 4],
+                             [1, 4, 0],
+                             [4, 2, 3]];
+
+                        //TODO: implement select_player and replace character by the correct one
+                        //let character = enemy.select_player().character;
+                        let character = 0;
+                        for i in 1..=3 {
+                            self.frame.ints1[i] = knowledge[character][i];
+                        }
+                    }
                     8 => { // Vampire Fantasy
                         /*
                         let mut n = 0: