# HG changeset patch # User Gauvain "GovanifY" Roussel-Tarbouriech # Date 1572719826 -3600 # Node ID ca46b4312df19f89e2819f727fc62f2e90f26878 # Parent f2c3848dabff0f83c82150f19fa7d9bb13712d90 ecl_vm: spellcard 9 diff --git a/src/th06/ecl_vm.rs b/src/th06/ecl_vm.rs --- a/src/th06/ecl_vm.rs +++ b/src/th06/ecl_vm.rs @@ -1033,6 +1033,34 @@ impl EclRunner { self._setval(-10004, n) */ } + 9 => { + let mut rnd = self.get_prng().borrow_mut().get_f64(); + //TODO: the game does that + //drop_particle(&PARTICLES_ARRAY,0xc,enemy->pos,1,0xffffffff); + //self._game.new_effect((enemy.x, enemy.y), 17) + /* + for bullet in game.bullets { + if bullet._bullet_type.state != 0 && bullet._bullet_type.state != 5 && (30. <= (bullet.sprites[0].additional_infos)->height) && bullet.speed == 0. { + bullet.flags = bullet.flags | 0x10; + //TODO: reverse this field and effect + bullet->field_0x5ba = 2; + new_effect(GAME_OBJECT,(sprite *)bullet, (int)bullet->sprites[0].sometimes_copy_of_UNK1 + (int)bullet->field_0x5ba); + bullet.speed=0.01; + bullet.frame=0x78; + + let mut dx = bullet.x - enemy.x; + let mut distance = dx.hypot(bullet.y - enemy.y); + + if distance > 0.01 { + distance = sqrt(distance); + }else{distance = 0.;} + let mut angle = (distance * std::f64::consts::PI) / 256. + (rnd * (2*std::f64::consts::PI) - std::f64::consts::PI); + bullet->attributes[0] = cos(angle) * 0.01000000; + bullet->attributes[1] = sin(angle) * 0.01000000; + } + } + */ + } 11 => { self.get_prng().borrow_mut().get_f64(); //TODO: the game does that