comparison src/th06/ecl_vm.rs @ 678:1d81a449c436

Implement ECL instructions DelayAttack and NoDelayAttack.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 15 Aug 2019 21:35:22 +0200
parents 3e4cc64a254d
children 1209e7f855a4
comparison
equal deleted inserted replaced
677:082c39d7d1c3 678:1d81a449c436
517 let angle = self.get_prng().borrow_mut().get_f64() as f32 * (max_angle - min_angle) + min_angle; 517 let angle = self.get_prng().borrow_mut().get_f64() as f32 * (max_angle - min_angle) + min_angle;
518 let mut enemy = self.enemy.borrow_mut(); 518 let mut enemy = self.enemy.borrow_mut();
519 enemy.angle = angle; 519 enemy.angle = angle;
520 } 520 }
521 521
522 // 78
523 SubInstruction::DelayAttack() => {
524 let mut enemy = self.enemy.borrow_mut();
525 enemy.delay_attack = true;
526 }
527 // 79
528 SubInstruction::NoDelayAttack() => {
529 let mut enemy = self.enemy.borrow_mut();
530 enemy.delay_attack = false;
531 }
532
522 // 83 -> star items >>> life items 533 // 83 -> star items >>> life items
523 534
524 // 97 535 // 97
525 SubInstruction::SetAnim(index) => { 536 SubInstruction::SetAnim(index) => {
526 // seems correct, game internally gets base_addr =(iVar13 + 0x1c934), pointer_addr = iVar14 * 4 537 // seems correct, game internally gets base_addr =(iVar13 + 0x1c934), pointer_addr = iVar14 * 4
583 SubInstruction::SetDeathFlags(death_flags) => { 594 SubInstruction::SetDeathFlags(death_flags) => {
584 let mut enemy = self.enemy.borrow_mut(); 595 let mut enemy = self.enemy.borrow_mut();
585 enemy.death_flags = death_flags; 596 enemy.death_flags = death_flags;
586 } 597 }
587 598
588 _ => unimplemented!() 599 _ => unimplemented!("{:?}", instruction)
589 } 600 }
590 } 601 }
591 } 602 }