Mercurial > touhou
changeset 731:ca46b4312df1
ecl_vm: spellcard 9
author | Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com> |
---|---|
date | Sat, 02 Nov 2019 19:37:06 +0100 |
parents | f2c3848dabff |
children | 5f00b2e0c06a |
files | src/th06/ecl_vm.rs |
diffstat | 1 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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