2020-12-13 19:57:49 +00:00
|
|
|
/// Generic state variables
|
|
|
|
/// -----------------------
|
|
|
|
/// Really just freely usable memory shared between all bosses.
|
|
|
|
|
2020-12-10 18:55:36 +00:00
|
|
|
extern int boss_hp;
|
2020-12-13 19:57:49 +00:00
|
|
|
extern int boss_phase_frame;
|
2021-05-24 15:06:28 +00:00
|
|
|
extern int8_t boss_phase;
|
2020-12-13 19:57:49 +00:00
|
|
|
/// -----------------------
|
2020-12-07 20:09:42 +00:00
|
|
|
|
|
|
|
// No-op function for callbacks.
|
2021-08-15 17:42:44 +00:00
|
|
|
void pascal boss_nop(void);
|
2020-12-17 20:28:17 +00:00
|
|
|
|
|
|
|
static const int BOSS_HIT_INVINCIBILITY_FRAMES = 40;
|
|
|
|
|
|
|
|
// Processes collisions between the Orb and a boss, and the resulting
|
|
|
|
// invincibility of the latter… yeah, that's about the best summary for this
|
|
|
|
// function that does way too many things:
|
|
|
|
// • It also handles collisions between *player shots* and the given hitbox,
|
|
|
|
// regardless of invincibility.
|
|
|
|
// • The hit testing against the Orb must be done before, with the result
|
|
|
|
// being passed in [colliding_with_orb]. That parameter is what mainly
|
|
|
|
// triggers the collision response of adding the [hit_score], decrementing
|
|
|
|
// [hp], bouncing off the Orb in the opposite direction, calling
|
|
|
|
// [hit_callback], and rendering the invincibility flashing effect.
|
|
|
|
// • The caller is still responsible to increment [invincibility_frame]. This
|
|
|
|
// function only reads from it or resets it to 0.
|
|
|
|
// • [is_invincible] is always updated from this function, though.
|
|
|
|
// • Therefore, it only indirectly returns whether the boss was hit this
|
|
|
|
// frame, via ([is_invincible] == true) && ([invincibility_frame] == 0).
|
|
|
|
// (That fact makes [is_invincible] not quite as redundant as it might seem.)
|
|
|
|
void boss_hit_update_and_render(
|
|
|
|
int &invincibility_frame,
|
|
|
|
bool16 &is_invincible,
|
|
|
|
int &hp,
|
2021-08-15 17:42:44 +00:00
|
|
|
const unsigned char invincibility_flash_colors[],
|
2020-12-17 20:28:17 +00:00
|
|
|
unsigned char invincibility_flash_colors_count,
|
|
|
|
int hit_score,
|
|
|
|
farfunc_t_far hit_callback,
|
|
|
|
bool colliding_with_orb,
|
|
|
|
screen_x_t hitbox_left,
|
|
|
|
screen_y_t hitbox_top,
|
|
|
|
pixel_t hitbox_w,
|
|
|
|
pixel_t hitbox_h
|
|
|
|
);
|
2021-05-16 22:07:03 +00:00
|
|
|
|
|
|
|
// Individual bosses
|
|
|
|
// -----------------
|
|
|
|
|
2021-08-18 18:27:18 +00:00
|
|
|
// Makai
|
2021-08-19 19:08:47 +00:00
|
|
|
void sariel_entrance(int8_t unused);
|
|
|
|
void sariel_load_and_init(void);
|
2021-08-18 18:27:18 +00:00
|
|
|
|
|
|
|
// Jigoku
|
2021-05-16 22:07:03 +00:00
|
|
|
void konngara_load_and_entrance(int8_t unused);
|
2021-05-24 15:18:30 +00:00
|
|
|
void konngara_init(void);
|
2021-08-16 20:18:59 +00:00
|
|
|
void konngara_main(void);
|
2021-05-24 15:22:45 +00:00
|
|
|
void konngara_free(void);
|
2021-05-16 22:07:03 +00:00
|
|
|
// -----------------
|