2020-06-28 17:36:34 +00:00
|
|
|
#include "th01/sprites/pellet.h"
|
2020-07-03 20:19:17 +00:00
|
|
|
#include "th01/math/overlap.hpp"
|
2020-06-28 17:36:34 +00:00
|
|
|
|
2020-06-10 18:01:06 +00:00
|
|
|
static const int SHOT_COUNT = 8;
|
2020-08-21 18:13:08 +00:00
|
|
|
static const pixel_t SHOT_W = 16;
|
|
|
|
static const pixel_t SHOT_H = 16;
|
2020-06-10 18:01:06 +00:00
|
|
|
|
|
|
|
struct CShots {
|
2020-08-20 19:59:45 +00:00
|
|
|
screen_x_t left[SHOT_COUNT];
|
|
|
|
screen_y_t top[SHOT_COUNT];
|
2020-06-10 18:01:06 +00:00
|
|
|
int unknown[SHOT_COUNT];
|
|
|
|
|
|
|
|
// A shot slot can be considered "alive" if either of these are nonzero.
|
2020-12-11 20:40:40 +00:00
|
|
|
bool moving[SHOT_COUNT];
|
2020-06-10 18:01:06 +00:00
|
|
|
unsigned char decay_frame[SHOT_COUNT];
|
2020-06-10 20:45:56 +00:00
|
|
|
|
2020-08-20 19:59:45 +00:00
|
|
|
void add(screen_x_t new_left, screen_y_t new_top);
|
2021-10-25 20:04:38 +00:00
|
|
|
void unput_and_reset(void);
|
2020-06-12 16:36:26 +00:00
|
|
|
void unput_update_render(void);
|
|
|
|
|
2020-07-03 20:19:17 +00:00
|
|
|
bool16 is_moving(int i) {
|
|
|
|
return moving[i];
|
|
|
|
}
|
|
|
|
|
2020-06-12 16:36:26 +00:00
|
|
|
// Processes any collision between *the given* shot and the Orb, placed at
|
|
|
|
// the given position, and returns true if they did collide.
|
2020-08-20 19:59:45 +00:00
|
|
|
bool16 hittest_orb(int i, screen_x_t orb_left, screen_y_t orb_top);
|
2020-06-12 17:34:22 +00:00
|
|
|
|
|
|
|
// Processes any collision between *any* shot and a pellet, placed at the
|
|
|
|
// given position, and returns true if they did collide.
|
2020-08-20 19:59:45 +00:00
|
|
|
bool16 hittest_pellet(screen_x_t pellet_left, screen_y_t pellet_top);
|
2020-06-12 17:34:22 +00:00
|
|
|
|
|
|
|
// Processes any collision between *any* shot and a boss with the given
|
|
|
|
// hitbox, and returns true if they did collide.
|
|
|
|
bool16 hittest_boss(
|
2020-08-20 19:59:45 +00:00
|
|
|
screen_x_t hitbox_left,
|
|
|
|
screen_y_t hitbox_top,
|
2020-08-21 18:13:08 +00:00
|
|
|
pixel_t hitbox_w,
|
|
|
|
pixel_t hitbox_h
|
2020-06-12 17:34:22 +00:00
|
|
|
);
|
2020-06-10 18:01:06 +00:00
|
|
|
};
|
|
|
|
|
2021-05-18 11:01:37 +00:00
|
|
|
// Might even be related to pellets, and not to shots.
|
|
|
|
extern bool16 unused_boss_stage_flag;
|
|
|
|
|
2020-06-10 18:01:06 +00:00
|
|
|
extern CShots Shots;
|