2020-08-16 14:36:31 +00:00
|
|
|
// Bosses
|
|
|
|
// ------
|
2020-08-21 18:13:08 +00:00
|
|
|
static const pixel_t BOSS_W = 64;
|
|
|
|
static const pixel_t BOSS_H = 64;
|
2020-08-16 14:03:31 +00:00
|
|
|
|
2020-08-16 14:36:31 +00:00
|
|
|
typedef struct {
|
2021-06-30 14:30:06 +00:00
|
|
|
PlayfieldMotion pos;
|
2020-08-16 14:36:31 +00:00
|
|
|
int hp;
|
|
|
|
unsigned char sprite;
|
|
|
|
unsigned char phase;
|
|
|
|
int phase_frame;
|
|
|
|
unsigned char damage_this_frame;
|
|
|
|
unsigned char mode;
|
|
|
|
// Used for both movement and bullet angles.
|
|
|
|
unsigned char angle;
|
|
|
|
unsigned char mode_change;
|
|
|
|
int phase_end_hp;
|
|
|
|
} boss_stuff_t;
|
|
|
|
|
|
|
|
extern boss_stuff_t boss;
|
|
|
|
extern SPPoint boss_hitbox_radius;
|
|
|
|
|
|
|
|
// Callbacks
|
|
|
|
extern farfunc_t_near boss_update;
|
|
|
|
extern nearfunc_t_near boss_fg_render;
|
2021-06-15 03:51:45 +00:00
|
|
|
|
|
|
|
// Also responsible to set [bg_render_bombing_func] to the
|
|
|
|
// [boss_bg_render_func]!
|
2020-08-16 14:36:31 +00:00
|
|
|
extern farfunc_t_near boss_update_func;
|
2021-06-15 03:51:45 +00:00
|
|
|
|
2020-08-16 14:36:31 +00:00
|
|
|
extern nearfunc_t_near boss_backdrop_colorfill;
|
|
|
|
extern nearfunc_t_near boss_bg_render_func;
|
|
|
|
extern nearfunc_t_near boss_fg_render_func;
|
|
|
|
|
|
|
|
#define BOSS_DEC(name) \
|
|
|
|
void pascal far name##_update(void); \
|
|
|
|
void pascal near name##_bg_render(void); \
|
|
|
|
void pascal near name##_fg_render(void);
|
2021-06-19 13:15:24 +00:00
|
|
|
|
|
|
|
// Renders the boss battle background image at the given screen position,
|
|
|
|
// surrounded by the given background [col].
|
|
|
|
void pascal near boss_backdrop_render(
|
|
|
|
screen_x_t left, vram_y_t top, uint4_t col
|
|
|
|
);
|
2020-08-16 14:36:31 +00:00
|
|
|
// ------
|
|
|
|
|
2020-04-08 17:59:53 +00:00
|
|
|
/// Explosions
|
|
|
|
/// ----------
|
|
|
|
#define EXPLOSION_SMALL_COUNT 2
|
|
|
|
|
|
|
|
struct explosion_t {
|
|
|
|
char flag;
|
|
|
|
unsigned char age;
|
|
|
|
SPPoint center;
|
|
|
|
SPPoint radius_cur;
|
|
|
|
SPPoint radius_delta;
|
|
|
|
int8_t unused;
|
|
|
|
// Offset to add to the angle for the Y coordinate, turning the circle
|
|
|
|
// into a slanted ellipse. See https://www.desmos.com/calculator/faeefi6w1u
|
|
|
|
// for a plot of the effect.
|
|
|
|
unsigned char angle_offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum explode_type_t {
|
|
|
|
ET_NONE = -1,
|
|
|
|
ET_NW_SE = 1,
|
|
|
|
ET_SW_NE = 2,
|
|
|
|
ET_HORIZONTAL = 3,
|
|
|
|
ET_VERTICAL = 4,
|
|
|
|
};
|
|
|
|
|
|
|
|
extern explosion_t explosions_small[EXPLOSION_SMALL_COUNT];
|
|
|
|
extern explosion_t explosions_big;
|
|
|
|
|
|
|
|
void pascal near boss_explode_small(unsigned int type);
|
|
|
|
#if GAME == 4
|
|
|
|
void pascal near boss_explode_big(unsigned int type);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void pascal near explosions_small_update_and_render(void);
|
|
|
|
void pascal near explosions_big_update_and_render(void);
|
|
|
|
|
|
|
|
void pascal explosions_small_reset(void);
|
|
|
|
/// ----------
|
|
|
|
|
2020-04-06 17:09:36 +00:00
|
|
|
void near boss_items_drop();
|
2020-04-11 14:33:22 +00:00
|
|
|
void pascal near boss_phase_end(
|
|
|
|
explode_type_t explode_type, int next_phase_end_hp
|
|
|
|
);
|