[Decompilation] [th01] Sariel: Pattern 5/16

The one with the 2-rings firing from the two orbs on the left and right
side of the playfield.

4th pattern, and it took 4 pushes in this series to get there… Looks
like it's going to get easier from here on, though.

Part of P0177, funded by Yanga.
This commit is contained in:
nmlgc 2022-01-03 00:36:31 +01:00
parent 5d557a2437
commit 630e8a9017
2 changed files with 47 additions and 70 deletions

View File

@ -69,6 +69,11 @@ static const screen_y_t WAND_EMIT_TOP = 64;
static const pixel_t WAND_W = 128;
static const pixel_t WAND_H = 96;
// BOSS6_A2.GRP
static const screen_x_t A2_ORBS_L_CENTER_X = 64;
static const screen_x_t A2_ORBS_R_CENTER_X = 568;
static const screen_y_t A2_ORBS_CENTER_Y = 160;
// -----------
enum sariel_colors_t {
@ -1432,3 +1437,39 @@ void near pattern_detonating_snowflake(void)
#undef left
#undef state
}
void near pattern_2_rings_from_a2_orbs(void)
{
#define angle pattern4_angle
#define interval pattern4_interval
extern unsigned char angle;
extern int interval;
if(boss_phase_frame < 5) {
angle = 0x00;
select_for_rank(interval, 18, 12, 10, 8);
}
if((boss_phase_frame % interval) == 0) {
Pellets.spawn_with_cloud = true;
Pellets.add_single(
A2_ORBS_R_CENTER_X, A2_ORBS_CENTER_Y, (0x00 - angle), to_sp(3.5f)
);
Pellets.add_single(
A2_ORBS_R_CENTER_X, A2_ORBS_CENTER_Y, (0x80 - angle), to_sp(3.5f)
);
Pellets.add_single(
A2_ORBS_L_CENTER_X, A2_ORBS_CENTER_Y, (0x00 + angle), to_sp(3.5f)
);
Pellets.add_single(
A2_ORBS_L_CENTER_X, A2_ORBS_CENTER_Y, (0x80 + angle), to_sp(3.5f)
);
angle += interval;
}
if(boss_phase_frame > 479) {
boss_phase_frame = 0;
}
#undef interval
#undef angle
}

View File

@ -22441,6 +22441,7 @@ main_36_TEXT segment byte public 'CODE' use16
@PARTICLES2X2_VERTICAL_UNPUT_UPDA$QI procdesc pascal near \
from_bottom:word
@pattern_detonating_snowflake$qv procdesc near
@pattern_2_rings_from_a2_orbs$qv procdesc near
main_36_TEXT ends
main_36__TEXT segment byte public 'CODE' use16
@ -22452,73 +22453,6 @@ include th01/main/boss/anim.inc
sariel_shield equ <boss_entity_0>
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_2A2ED proc near
push bp
mov bp, sp
cmp _boss_phase_frame, 5
jge short loc_2A313
mov angle_3AF44, 0
call @sariel_select_for_rank$qmiiiii c, offset word_3AF45, ds, large 18 or (12 shl 16), large 10 or (8 shl 16)
loc_2A313:
mov ax, _boss_phase_frame
cwd
idiv word_3AF45
or dx, dx
jnz loc_2A3AA
mov _Pellets.PELLET_spawn_with_cloud, 1
pushd 0 or (0 shl 16)
pushd PM_NORMAL or (0 shl 16)
push (3 shl 4) + 8
mov al, 0
sub al, angle_3AF44
push ax
push 568 or (160 shl 16)
push ds
push offset _Pellets
call @CPellets@add_single$qiiuci15pellet_motion_tiii
pushd 0 or (0 shl 16)
pushd PM_NORMAL or (0 shl 16)
push (3 shl 4) + 8
mov al, 80h
sub al, angle_3AF44
push ax
push 568 or (160 shl 16)
push ds
push offset _Pellets
call @CPellets@add_single$qiiuci15pellet_motion_tiii
add sp, 28h
call @CPellets@add_single$qiiuci15pellet_motion_tiii stdcall, offset _Pellets, ds, large 64 or (160 shl 16), word ptr angle_3AF44, (3 shl 4) + 8, large PM_NORMAL or (0 shl 16), large 0 or (0 shl 16)
pushd 0 or (0 shl 16)
pushd PM_NORMAL or (0 shl 16)
push (3 shl 4) + 8
mov al, angle_3AF44
add al, 80h
push ax
push 64 or (160 shl 16)
push ds
push offset _Pellets
call @CPellets@add_single$qiiuci15pellet_motion_tiii
add sp, 28h
mov al, angle_3AF44
add al, byte ptr word_3AF45
mov angle_3AF44, al
loc_2A3AA:
cmp _boss_phase_frame, 479
jle short loc_2A3B8
mov _boss_phase_frame, 0
loc_2A3B8:
pop bp
retn
sub_2A2ED endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
@ -25760,7 +25694,7 @@ loc_2C502:
call sub_2A3BA
loc_2C50C:
call sub_2A2ED
call @pattern_2_rings_from_a2_orbs$qv
jmp short loc_2C51E
; ---------------------------------------------------------------------------
@ -27691,8 +27625,10 @@ _pattern3_radius_outer_1 dw ?
_pattern3_radius_outer_2 dw ?
_pattern3_radius_inner dw ?
angle_3AF44 db ?
word_3AF45 dw ?
public _pattern4_angle, _pattern4_interval
_pattern4_angle db ?
_pattern4_interval dw ?
db 240 dup(?)
point_3B037 Point <?>
y_3B03B dw ?