23typedef enum WeaponStatus_ {
24 WEAPON_STATUS_LOCKING,
26 WEAPON_STATUS_UNJAMMED,
28 WEAPON_STATUS_JAMMED_SLOWED,
32#define WEAPON_FLAG_DESTROYED ( 1 << 0 )
33#define WEAPON_FLAG_HITTABLE ( 1 << 1 )
34#define WEAPON_FLAG_ONLYHITTARGET \
36#define WEAPON_FLAG_AIM \
39#define weapon_isFlag( w, f ) ( ( w )->flags & ( f ) )
40#define weapon_setFlag( w, f ) ( ( w )->flags |= ( f ) )
41#define weapon_rmFlag( w, f ) ( ( w )->flags &= ~( f ) )
48typedef struct Weapon_ {
88 void ( *
think )(
struct Weapon_ *, double );
99 const Target *target,
double time,
int aim );
103 const vec2 *pos,
const vec2 *vel,
double dir,
double time );
109 const Target *target,
int aim );
114const IntList *weapon_collideQuery(
int x1,
int y1,
int x2,
int y2 );
115void weapon_collideQueryIL(
IntList *il,
int x1,
int y1,
int x2,
int y2 );
A ship outfit, depends radically on the type.
Stores an outfit the pilot has.
The representation of an in-game pilot.
Represents a solid in the game.
Represents a weapon target.
A trail generated by a ship or an ammo.
In-game representation of a weapon.
void(* think)(struct Weapon_ *, double)
void weapons_update(double dt)
Updates all the weapons.
double weapon_targetFlyTime(const Outfit *o, const Pilot *p, const Target *t)
Gets the fly time for a weapon target.
unsigned int beam_start(PilotOutfitSlot *po, double dir, const vec2 *pos, const vec2 *vel, const Pilot *parent, const Target *target, int aim)
Starts a beam weapon.
Weapon * weapon_add(PilotOutfitSlot *po, const Outfit *ref, double dir, const vec2 *pos, const vec2 *vel, const Pilot *parent, const Target *target, double time, int aim)
Creates a new weapon.
Weapon * weapon_getID(unsigned int id)
Gets a weapon by ID.
void weapons_updatePurge(void)
Purges unnecessary weapons.
void weapon_clear(void)
Clears all the weapons, does NOT free the layers.
void weapons_updateCollide(double dt)
Handles weapon collisions.
void weapon_hitAI(Pilot *p, const Pilot *shooter, double dmg)
Informs the AI if needed that it's been hit.
int weapon_inArc(const Outfit *o, const Pilot *parent, const Target *target, const vec2 *pos, const vec2 *vel, double dir, double time)
Gets the aim position of a turret weapon.
Weapon * weapon_getStack(void)
Gets the weapon stack. Do not manipulate directly.
void weapon_exit(void)
Destroys all the weapons and frees it all.
void weapons_render(const WeaponLayer layer, double dt)
Renders all the weapons in a layer.
void weapon_init(void)
Initializes the weapon stuff.
void weapon_newSystem(void)
Sets up collision stuff for a new system.
void beam_end(unsigned int beam)
Ends a beam weapon.