Mercurial > touhou
comparison src/th06/ecl_vm.rs @ 731:ca46b4312df1
ecl_vm: spellcard 9
author | Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com> |
---|---|
date | Sat, 02 Nov 2019 19:37:06 +0100 |
parents | 414f8611f344 |
children | 5f00b2e0c06a |
comparison
equal
deleted
inserted
replaced
730:f2c3848dabff | 731:ca46b4312df1 |
---|---|
1031 //TODO: this variable might not always be correct! it uses the argument in | 1031 //TODO: this variable might not always be correct! it uses the argument in |
1032 //th06: *(int *)(param_1 + 0x9b0) = local_60; | 1032 //th06: *(int *)(param_1 + 0x9b0) = local_60; |
1033 self._setval(-10004, n) | 1033 self._setval(-10004, n) |
1034 */ | 1034 */ |
1035 } | 1035 } |
1036 9 => { | |
1037 let mut rnd = self.get_prng().borrow_mut().get_f64(); | |
1038 //TODO: the game does that | |
1039 //drop_particle(&PARTICLES_ARRAY,0xc,enemy->pos,1,0xffffffff); | |
1040 //self._game.new_effect((enemy.x, enemy.y), 17) | |
1041 /* | |
1042 for bullet in game.bullets { | |
1043 if bullet._bullet_type.state != 0 && bullet._bullet_type.state != 5 && (30. <= (bullet.sprites[0].additional_infos)->height) && bullet.speed == 0. { | |
1044 bullet.flags = bullet.flags | 0x10; | |
1045 //TODO: reverse this field and effect | |
1046 bullet->field_0x5ba = 2; | |
1047 new_effect(GAME_OBJECT,(sprite *)bullet, (int)bullet->sprites[0].sometimes_copy_of_UNK1 + (int)bullet->field_0x5ba); | |
1048 bullet.speed=0.01; | |
1049 bullet.frame=0x78; | |
1050 | |
1051 let mut dx = bullet.x - enemy.x; | |
1052 let mut distance = dx.hypot(bullet.y - enemy.y); | |
1053 | |
1054 if distance > 0.01 { | |
1055 distance = sqrt(distance); | |
1056 }else{distance = 0.;} | |
1057 let mut angle = (distance * std::f64::consts::PI) / 256. + (rnd * (2*std::f64::consts::PI) - std::f64::consts::PI); | |
1058 bullet->attributes[0] = cos(angle) * 0.01000000; | |
1059 bullet->attributes[1] = sin(angle) * 0.01000000; | |
1060 } | |
1061 } | |
1062 */ | |
1063 } | |
1036 11 => { | 1064 11 => { |
1037 self.get_prng().borrow_mut().get_f64(); | 1065 self.get_prng().borrow_mut().get_f64(); |
1038 //TODO: the game does that | 1066 //TODO: the game does that |
1039 //drop_particle(&PARTICLES_ARRAY,0xc,enemy->pos,1,0xffffffff); | 1067 //drop_particle(&PARTICLES_ARRAY,0xc,enemy->pos,1,0xffffffff); |
1040 //self._game.new_effect((enemy.x, enemy.y), 17) | 1068 //self._game.new_effect((enemy.x, enemy.y), 17) |