Lephisto/src/outfit.h
Allanis 998a1bf68b [Add] Rudimentary shooting. This needs some work.
[Add] Layers should be working properly.
2013-02-05 16:50:56 +00:00

74 lines
1.7 KiB
C

#pragma once
#include "opengl.h"
#define OUTFIT_PROP_WEAP_PRIMARY (1<<0)
#define OUTFIT_PROP_WEAP_SECONDARY (1<<1)
// Outfit types.
typedef enum {
OUTFIT_TYPE_NULL = 0,
OUTFIT_TYPE_BOLT,
OUTFIT_TYPE_BEAM,
OUTFIT_TYPE_MISSILE_DUMB,
OUTFIT_TYPE_MISSILE_DUMB_AMMO,
OUTFIT_TYPE_MISSILE_SEEK,
OUTFIT_TYPE_MISSILE_SEEK_AMMO,
OUTFIT_TYPE_MISSILE_SEEK_SMART,
OUTFIT_TYPE_MISSILE_SEEK_SMART_AMMO,
OUTFIT_TYPE_MISSILE_SWARM,
OUTFIT_TYPE_MISSILE_SWARM_AMMO,
OUTFIT_TYPE_MISSILE_SWARM_SMART,
OUTFIT_TYPE_MISSILE_SWARM_SMART_AMMO
} OutfitType;
// An outfit depends a lot on the type.
typedef struct {
char* name;
// General specs.
int max;
int tech;
int mass;
gl_texture gfx_store; // Store graphic.
int properties; // Properties stored bitwise.
// Type dependant.
OutfitType type;
union {
struct { // Beam/Bolt.
unsigned int delay; // Delay between shots.
double speed; // Speed of shot. (not applicable to beam.
double range;
double accuracy; // Desviation accuracy.
double damage_armor, damage_shield; // Damage.
gl_texture* gfx_space;
};
struct { // Launcher.
//unsigned int delay; // Delay between shots.
};
struct { // Ammo.
//double speed; // Max speed.
//double turn; // Turn vel.
//double thrust; // Acceleration.
//double damage_armor, damage_shield;
//gl_texture* gfx_space;
};
};
} Outfit;
Outfit* outfit_get(const char* name);
// Outfit types.
int outfit_isWeapon(const Outfit* o);
int outfit_isLauncher(const Outfit* o);
int outfit_isAmmo(const Outfit* o);
const char* outfit_getType(const Outfit* o);
// Load/free outfit stack.
int outfit_load(void);
void outfit_free(void);