changeset 681:1209e7f855a4

ecl_vm: added sibling function and a warning.
author Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
date Mon, 12 Aug 2019 21:10:38 +0200
parents ef2dbd676a91
children d6cc9086058c
files src/th06/ecl_vm.rs
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/th06/ecl_vm.rs
+++ b/src/th06/ecl_vm.rs
@@ -569,9 +569,11 @@ impl EclRunner {
 
             // 104
             SubInstruction::SetCollidable(collidable) => {
-                // TODO: me and my siblings(105, 107) are implemented as a single variable in the touhou 6
+                // TODO: me and my siblings(105, 107, 117) are implemented as a single variable in the touhou 6
                 // original engine. While our behaviour seems correct we might want to implement
                 // that as a single variable
+                // TODO[2]: THE BITFLAG MIGHT BE INCORRECT FOR OTHER SIBLING INSTRUCTIONS, the
+                // behavior was DEFINITELY incorrect in pytouhou for SetTouchable at the very least
                 let mut enemy = self.enemy.borrow_mut();
                 enemy.collidable = (collidable&1) != 0;
             }
@@ -596,6 +598,12 @@ impl EclRunner {
                 enemy.death_flags = death_flags;
             }
 
+            // 117
+            SubInstruction::SetTouchable(touchable) => {
+                let mut enemy = self.enemy.borrow_mut();
+                enemy.touchable = touchable != 0;
+            }
+
             _ => unimplemented!("{:?}", instruction)
         }
     }