comparison src/th06/ecl_vm.rs @ 733:770e5057f6bc

ecl_vm: time stop/random sakuya bullets impl
author Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
date Sun, 03 Nov 2019 03:04:41 +0100
parents 5f00b2e0c06a
children 7886a1a5d226
comparison
equal deleted inserted replaced
732:5f00b2e0c06a 733:770e5057f6bc
1005 let character = 0; 1005 let character = 0;
1006 for i in 1..=3 { 1006 for i in 1..=3 {
1007 self.frame.ints1[i] = knowledge[character][i]; 1007 self.frame.ints1[i] = knowledge[character][i];
1008 } 1008 }
1009 } 1009 }
1010 4 => { // Sakuya random daggers and time stop
1011 /*
1012 if arg < 2 {
1013 drop_particle(&PARTICLES_ARRAY,0xc,enemy->pos,1,0xffffffff);
1014 //TODO: is that the timestop?
1015 LEVEL.field_0x2c = arg;
1016 return;
1017 }
1018 // this changes the orientation of random bullets
1019 let mut max_bullets = 0xe;
1020 if (LEVEL.rank >= 2) {max_bullets = 0x34;}
1021 i = 0;
1022 for bullet in game.bullets {
1023 if bullet->state != 0 && bullet->state != 5 && 30. <= (bullet->sprites[0].additional_infos)->height && bullet->field_0x5ba != 5 && (uVar3 = prng16(&PRNG_STATE), (uVar3 & 3) == 0) {
1024 bullet->field_0x5ba = 5;
1025 new_effect(GAME_OBJECT,(sprite *)bullet, (int)bullet->sprites[0].sometimes_copy_of_UNK1 + (int)bullet->field_0x5ba);
1026 x = bullet->pos[0] - PLAYER.pos[0];
1027 y = bullet->pos[1] - PLAYER.pos[1];
1028 if sqrt(x*x+y*y) > 128. {
1029 if LEVEL.rank >= 2 {bullet->automatic_angle = prng_double() * 2*pi;}
1030 else{bullet->automatic_angle = (prng_double() * ((pi/8)*6) + pi/4);}
1031 else {
1032 // TODO: check player_get_angle, might be what ST0 is
1033 player_get_angle_to(&PLAYER,bullet->pos,local_38);
1034 bullet->automatic_angle = (extraout_ST0_00 + pi/2 + (prng_double() * pi*2));
1035 }
1036 bullet->dpos[0] = cos(bullet->automatic_angle) * bullet->speed;
1037 bullet->dpos[1] = sin(bullet->automatic_angle) * bullet->speed;
1038 max_bullets -= 1;
1039 if (max_bullets == 0) break;
1040 }
1041 }
1042 (enemy->ecl_frame).var_ints_1[2] = 0;*/
1043 }
1010 7 => { // Remilia's lazer maze 1044 7 => { // Remilia's lazer maze
1011 // so what this does is kinda complex: 2 rounds of 3 subrounds of 8 shots, either 1045 // so what this does is kinda complex: 2 rounds of 3 subrounds of 8 shots, either
1012 // laser or standard bullets depending on the argument passed. 1046 // laser or standard bullets depending on the argument passed.
1013 // it is done in 2 steps: first we precalculate coordinates of the 8 shots for the first subround 1047 // it is done in 2 steps: first we precalculate coordinates of the 8 shots for the first subround
1014 // set the shot properties depending on difficulties and current round and then 1048 // set the shot properties depending on difficulties and current round and then