comparison src/th06/ecl_vm.rs @ 674:3e4cc64a254d

ecl_vm: more instructions.
author Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
date Mon, 12 Aug 2019 20:50:22 +0200
parents 81ad01910f4b
children 1d81a449c436
comparison
equal deleted inserted replaced
673:81ad01910f4b 674:3e4cc64a254d
550 enemy.death_anim = index; 550 enemy.death_anim = index;
551 } 551 }
552 552
553 // 103 553 // 103
554 SubInstruction::SetHitbox(width, height, depth) => { 554 SubInstruction::SetHitbox(width, height, depth) => {
555 assert_eq!(depth, 32.);
556 let mut enemy = self.enemy.borrow_mut(); 555 let mut enemy = self.enemy.borrow_mut();
557 enemy.set_hitbox(width, height); 556 enemy.set_hitbox(width, height);
558 } 557 }
559 558
559 // 104
560 SubInstruction::SetCollidable(collidable) => {
561 // TODO: me and my siblings(105, 107) are implemented as a single variable in the touhou 6
562 // original engine. While our behaviour seems correct we might want to implement
563 // that as a single variable
564 let mut enemy = self.enemy.borrow_mut();
565 enemy.collidable = (collidable&1) != 0;
566 }
567
568 // 105
569 SubInstruction::SetDamageable(damageable) => {
570 let mut enemy = self.enemy.borrow_mut();
571 enemy.damageable = (damageable&1) != 0;
572 }
573
574 // 106
575 /*
576 SubInstruction::PlaySound(index) => {
577 let mut enemy = self.enemy.borrow_mut();
578 enemy.play_sound(index);
579 }
580 */
581
582 // 107
583 SubInstruction::SetDeathFlags(death_flags) => {
584 let mut enemy = self.enemy.borrow_mut();
585 enemy.death_flags = death_flags;
586 }
587
560 _ => unimplemented!() 588 _ => unimplemented!()
561 } 589 }
562 } 590 }
563 } 591 }