4
(c) Richard Thrippleton
5
Licensing terms are in the 'LICENSE' file
6
If that file is not included with this source then permission is not given to use this source in any way whatsoever.
12
class frag //A frag object, like phaser fire, torpedo, debris
15
enum {ENERGY=1,HOMER=2,DEBRIS=3}; //Frag types
16
enum {FIRE=1}; //Index of burning fire graphic
17
static const int ISIZE=512; //Capacity of frag index
19
frag(cord loc,int typ,short spr,short col,ship* trg,ship* own,vect mov,short rot,short pow,short trck,short rng); //Constructor to create a new frag from scratch
23
static void init(); //Initialise the frag system datastructures
24
static void purgeall(); //Clean out the frag system after use
25
static void simulateall(); //Simulate all the frags and physics
26
static void notifydelete(ship* tshp); //Notify the frags of the deletion of a ship, to resolve dangling target and owner references
27
static void saveall(); //Save all frags to the database
28
static void loadall(); //Load all frags from database
29
static frag* get(int indx); //Return the frag of given index
31
void netout(int typ,unsigned char* buf); //Get type of data from frag into a network buffer
33
int self; //Self index in the database
35
int typ; //Type (see the top enum)
36
ship* trg; //Target ship index
37
ship* own; //Owner ship index
40
frag(int self); //Constructor, give it its index value and it will load from the database
42
void physics(); //Move the frag, do collisions
43
void home(); //Sub-function of physics, handles homing
44
void save(); //Save frag to a database
45
void load(); //Load frag from a database
47
static frag* frags[ISIZE]; //The frag index
49
int spr; //Associated sprite index
50
int col; //Colour if relevant (makes it a beam weapon)
51
long ox,oy; //Old co-ordinates, for purposes of clientside interpolation
52
vect mov; //Velocity vector
53
int rot; //Rotation frame to use
54
int pow; //Power/damage
55
long trck; //Tracking power