[Decompilation] [th05] Shinki: Pattern 8/11

The one where Shinki's white wings turn purple, and fire 16 purple
32×32 bullets after the color change.

For some reason, OMAKE.TXT says that these wings are black?!?

Part of P0190, funded by nrook.
This commit is contained in:
nmlgc 2022-04-16 04:20:12 +02:00
parent 55cd74326c
commit 8b79dd5371
3 changed files with 43 additions and 88 deletions

View File

@ -352,3 +352,32 @@ void near pattern_cheetos_within_spread_walls(void)
#undef unused
#undef interval
}
bool near pattern_wings_to_purple(void)
{
if(boss.phase_frame < 160) {
return false;
} else if(boss.phase_frame < 192) {
if(boss.phase_frame == 128) {
snd_se_play(8);
}
if(boss.phase_frame & 1) {
boss.pos.cur.y += 2.0f;
} else {
boss.pos.cur.y -= 2.0f;
}
} else if(boss.phase_frame == 192) {
b6ball_template.patnum_tiny = PAT_B6BALL_PURPLE;
for(int i = 0; i < 16; i++) {
b6ball_template.origin.x.v = shinki_wing_random_x();
b6ball_template.origin.y.v = shinki_wing_random_y();
b6ball_template.angle = randring2_next8_ge_lt(0x20, 0x60);
b6ball_template.speed.v = randring2_next8_and_ge_lt_sp(2.0f, 6.0f);
b6balls_add();
}
boss.sprite = PAT_SHINKI_WINGS_PURPLE;
snd_se_play(15);
playfield_shake_anim_time = 8;
}
return (boss.phase_frame == 200);
}

View File

@ -150,9 +150,20 @@ typedef enum {
PAT_SHINKI_WINGS_WHITE_HIT + bfnt_parts_x(SHINKI_WING_W) - 1
),
// --------
// st05.bb3
// --------
PAT_SHINKI_WINGS_PURPLE,
PAT_SHINKI_WINGS_PURPLE_last = (
PAT_SHINKI_WINGS_PURPLE + bfnt_parts_x(SHINKI_WING_W) - 1
),
PAT_SHINKI_WINGS_PURPLE_HIT,
PAT_SHINKI_WINGS_PURPLE_HIT_last = (
PAT_SHINKI_WINGS_PURPLE_HIT + bfnt_parts_x(SHINKI_WING_W) - 1
),
// --------
// st05.bb4
// --------
PAT_B6BALL_BLUE_1 = 200,
PAT_B6BALL_BLUE_1,
PAT_B6BALL_PURPLE,
PAT_B6BALL_BLUE_2,
PAT_B6BALL_BLUE_3,

View File

@ -19184,96 +19184,11 @@ BOSS_6_TEXT segment byte public 'CODE' use16
@pattern_wing_preparation$qv procdesc near
@pattern_random_rain_and_spreads_$qv procdesc near
@pattern_cheetos_within_spread_wa$qv procdesc near
@pattern_wings_to_purple$qv procdesc near
BOSS_6_TEXT ends
BOSS_X_TEXT segment byte public 'CODE' use16
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_1DB7B proc near
push bp
mov bp, sp
push si
cmp _boss_phase_frame, 160
jge short loc_1DB8C
mov al, 0
jmp loc_1DC2C
; ---------------------------------------------------------------------------
loc_1DB8C:
cmp _boss_phase_frame, 192
jge short loc_1DBB8
cmp _boss_phase_frame, 128
jnz short loc_1DBA3
call snd_se_play pascal, 8
loc_1DBA3:
test byte ptr _boss_phase_frame, 1
jz short loc_1DBB1
add _boss_pos.cur.y, (2 shl 4)
jmp short loc_1DC1D
; ---------------------------------------------------------------------------
loc_1DBB1:
sub _boss_pos.cur.y, (2 shl 4)
jmp short loc_1DC1D
; ---------------------------------------------------------------------------
loc_1DBB8:
cmp _boss_phase_frame, 192
jnz short loc_1DC1D
mov b6ball_template.B6B_patnum_tiny, PAT_B6BALL_PURPLE
xor si, si
jmp short loc_1DC06
; ---------------------------------------------------------------------------
loc_1DBCA:
push (256 shl 4)
call randring2_next16_mod
add ax, _boss_pos.cur.x
sub ax, (128 shl 4)
mov b6ball_template.pos.cur.x, ax
push (64 shl 4)
call randring2_next16_mod
mov dx, _boss_pos.cur.y
sub dx, ax
add dx, (16 shl 4)
mov b6ball_template.pos.cur.y, dx
call randring2_next16_mod pascal, 40h
add al, 20h
mov b6ball_template.B6B_angle, al
call randring2_next16_and pascal, 3Fh
add al, (2 shl 4)
mov b6ball_template.B6B_speed, al
call @b6balls_add$qv
inc si
loc_1DC06:
cmp si, 10h
jl short loc_1DBCA
mov _boss_sprite, 192
call snd_se_play pascal, 15
mov _playfield_shake_anim_time, 8
loc_1DC1D:
cmp _boss_phase_frame, 200
jnz short loc_1DC2A
mov ax, 1
jmp short loc_1DC2C
; ---------------------------------------------------------------------------
loc_1DC2A:
xor ax, ax
loc_1DC2C:
pop si
pop bp
retn
sub_1DB7B endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
@ -19996,7 +19911,7 @@ loc_1E3E2:
loc_1E3E7:
call @boss_hittest_shots$qv
call sub_1DB7B
call @pattern_wings_to_purple$qv
or al, al
jz loc_1E527
inc _boss_phase