naev 0.10.4
weapon.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
6#include "outfit.h"
7#include "physics.h"
8#include "pilot.h"
9
15typedef enum { WEAPON_LAYER_BG, WEAPON_LAYER_FG } WeaponLayer;
16
17/*
18 * Addition.
19 */
20void weapon_add( PilotOutfitSlot *po, const double T,
21 const double dir, const vec2* pos, const vec2* vel,
22 const Pilot *parent, const unsigned int target, double time, int aim );
23
24/*
25 * Beam weapons.
26 */
27unsigned int beam_start( PilotOutfitSlot *po,
28 const double dir, const vec2* pos, const vec2* vel,
29 const Pilot *parent, const unsigned int target, int aim );
30void beam_end( const unsigned int parent, unsigned int beam );
31
32/*
33 * Misc stuff.
34 */
35void weapon_explode( double x, double y, double radius,
36 int dtype, double damage,
37 const Pilot *parent, int mode );
38void weapon_hitAI( Pilot *p, const Pilot *shooter, double dmg );
39
40/*
41 * Update.
42 */
43void weapons_update( const double dt );
44void weapons_render( const WeaponLayer layer, const double dt );
45
46/*
47 * Clean.
48 */
49void weapon_init (void);
50void weapon_clear (void);
51void weapon_exit (void);
Stores an outfit the pilot has.
Definition: pilot.h:108
The representation of an in-game pilot.
Definition: pilot.h:210
Represents a 2d vector.
Definition: vec2.h:32
void weapon_add(PilotOutfitSlot *po, const double T, const double dir, const vec2 *pos, const vec2 *vel, const Pilot *parent, unsigned int target, double time, int aim)
Creates a new weapon.
Definition: weapon.c:1953
void beam_end(const unsigned int parent, unsigned int beam)
Ends a beam weapon.
Definition: weapon.c:2067
void weapons_render(const WeaponLayer layer, const double dt)
Renders all the weapons in a layer.
Definition: weapon.c:715
void weapon_clear(void)
Clears all the weapons, does NOT free the layers.
Definition: weapon.c:2161
void weapons_update(const double dt)
Updates all the weapon layers.
Definition: weapon.c:548
void weapon_explode(double x, double y, double radius, int dtype, double damage, const Pilot *parent, int mode)
Clears possible exploded weapons.
Definition: weapon.c:2199
void weapon_hitAI(Pilot *p, const Pilot *shooter, double dmg)
Informs the AI if needed that it's been hit.
Definition: weapon.c:1227
unsigned int beam_start(PilotOutfitSlot *po, const double dir, const vec2 *pos, const vec2 *vel, const Pilot *parent, const unsigned int target, int aim)
Starts a beam weapon.
Definition: weapon.c:2012
void weapon_exit(void)
Destroys all the weapons and frees it all.
Definition: weapon.c:2179
void weapon_init(void)
Initializes the weapon stuff.
Definition: weapon.c:157