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-07-03 20:19:17 +00:00
|
|
|
static const int SHOT_W = 16;
|
|
|
|
static const int SHOT_H = 16;
|
2020-06-10 18:01:06 +00:00
|
|
|
|
|
|
|
struct CShots {
|
|
|
|
int left[SHOT_COUNT];
|
|
|
|
int top[SHOT_COUNT];
|
|
|
|
int unknown[SHOT_COUNT];
|
|
|
|
|
|
|
|
// A shot slot can be considered "alive" if either of these are nonzero.
|
|
|
|
unsigned char moving[SHOT_COUNT];
|
|
|
|
unsigned char decay_frame[SHOT_COUNT];
|
2020-06-10 20:45:56 +00:00
|
|
|
|
|
|
|
void add(int new_left, int new_top);
|
2020-06-11 17:15:43 +00:00
|
|
|
void unput_and_reset_all(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.
|
|
|
|
bool16 hittest_orb(int i, int orb_left, int 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.
|
|
|
|
bool16 hittest_pellet(int pellet_left, int pellet_top);
|
|
|
|
|
|
|
|
// Processes any collision between *any* shot and a boss with the given
|
|
|
|
// hitbox, and returns true if they did collide.
|
|
|
|
bool16 hittest_boss(
|
|
|
|
int hitbox_left, int hitbox_top, int hitbox_w, int hitbox_h
|
|
|
|
);
|
2020-06-10 18:01:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern CShots Shots;
|