# HG changeset patch # User Gauvain "GovanifY" Roussel-Tarbouriech # Date 1572746681 -3600 # Node ID 770e5057f6bc2c5451b60c874f9ef62a2da0babc # Parent 5f00b2e0c06abf2d0850da05e0f509804cf49528 ecl_vm: time stop/random sakuya bullets impl 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 @@ -1007,6 +1007,40 @@ impl EclRunner { self.frame.ints1[i] = knowledge[character][i]; } } + 4 => { // Sakuya random daggers and time stop + /* + if arg < 2 { + drop_particle(&PARTICLES_ARRAY,0xc,enemy->pos,1,0xffffffff); + //TODO: is that the timestop? + LEVEL.field_0x2c = arg; + return; + } + // this changes the orientation of random bullets + let mut max_bullets = 0xe; + if (LEVEL.rank >= 2) {max_bullets = 0x34;} + i = 0; + for bullet in game.bullets { + 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) { + bullet->field_0x5ba = 5; + new_effect(GAME_OBJECT,(sprite *)bullet, (int)bullet->sprites[0].sometimes_copy_of_UNK1 + (int)bullet->field_0x5ba); + x = bullet->pos[0] - PLAYER.pos[0]; + y = bullet->pos[1] - PLAYER.pos[1]; + if sqrt(x*x+y*y) > 128. { + if LEVEL.rank >= 2 {bullet->automatic_angle = prng_double() * 2*pi;} + else{bullet->automatic_angle = (prng_double() * ((pi/8)*6) + pi/4);} + else { + // TODO: check player_get_angle, might be what ST0 is + player_get_angle_to(&PLAYER,bullet->pos,local_38); + bullet->automatic_angle = (extraout_ST0_00 + pi/2 + (prng_double() * pi*2)); + } + bullet->dpos[0] = cos(bullet->automatic_angle) * bullet->speed; + bullet->dpos[1] = sin(bullet->automatic_angle) * bullet->speed; + max_bullets -= 1; + if (max_bullets == 0) break; + } + } + (enemy->ecl_frame).var_ints_1[2] = 0;*/ + } 7 => { // Remilia's lazer maze // so what this does is kinda complex: 2 rounds of 3 subrounds of 8 shots, either // laser or standard bullets depending on the argument passed.