comparison src/th06/ecl_vm.rs @ 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 1d81a449c436
children d6cc9086058c
comparison
equal deleted inserted replaced
680:ef2dbd676a91 681:1209e7f855a4
567 enemy.set_hitbox(width, height); 567 enemy.set_hitbox(width, height);
568 } 568 }
569 569
570 // 104 570 // 104
571 SubInstruction::SetCollidable(collidable) => { 571 SubInstruction::SetCollidable(collidable) => {
572 // TODO: me and my siblings(105, 107) are implemented as a single variable in the touhou 6 572 // TODO: me and my siblings(105, 107, 117) are implemented as a single variable in the touhou 6
573 // original engine. While our behaviour seems correct we might want to implement 573 // original engine. While our behaviour seems correct we might want to implement
574 // that as a single variable 574 // that as a single variable
575 // TODO[2]: THE BITFLAG MIGHT BE INCORRECT FOR OTHER SIBLING INSTRUCTIONS, the
576 // behavior was DEFINITELY incorrect in pytouhou for SetTouchable at the very least
575 let mut enemy = self.enemy.borrow_mut(); 577 let mut enemy = self.enemy.borrow_mut();
576 enemy.collidable = (collidable&1) != 0; 578 enemy.collidable = (collidable&1) != 0;
577 } 579 }
578 580
579 // 105 581 // 105
594 SubInstruction::SetDeathFlags(death_flags) => { 596 SubInstruction::SetDeathFlags(death_flags) => {
595 let mut enemy = self.enemy.borrow_mut(); 597 let mut enemy = self.enemy.borrow_mut();
596 enemy.death_flags = death_flags; 598 enemy.death_flags = death_flags;
597 } 599 }
598 600
601 // 117
602 SubInstruction::SetTouchable(touchable) => {
603 let mut enemy = self.enemy.borrow_mut();
604 enemy.touchable = touchable != 0;
605 }
606
599 _ => unimplemented!("{:?}", instruction) 607 _ => unimplemented!("{:?}", instruction)
600 } 608 }
601 } 609 }
602 } 610 }