93 lines
1.8 KiB
C
93 lines
1.8 KiB
C
#pragma once
|
|
#include "opengl.h"
|
|
#include "outfit.h"
|
|
#include "sound.h"
|
|
|
|
/* Target gfx dimensions. */
|
|
#define SHIP_TARGET_W 128 /**< Ship target graphic width. */
|
|
#define SHIP_TARGET_H 96 /**< Ship target graphic height. */
|
|
|
|
/**
|
|
* @typedef ShipClass
|
|
*
|
|
* @breif Contains the different types of ships.
|
|
*/
|
|
typedef enum ShipClass_ {
|
|
SHIP_CLASS_NULL,
|
|
SHIP_CLASS_CIV_LIGHT,
|
|
SHIP_CLASS_CIV_MEDIUM,
|
|
SHIP_CLASS_CIV_HEAVY,
|
|
SHIP_CLASS_MIL_LIGHT,
|
|
SHIP_CLASS_MIL_MEDIUM,
|
|
SHIP_CLASS_MIL_HEAVY,
|
|
SHIP_CLASS_ROB_LIGHT,
|
|
SHIP_CLASS_ROB_MEDIUM,
|
|
SHIP_CLASS_ROB_HEAVY,
|
|
SHIP_CLASS_HYB_LIGHT,
|
|
SHIP_CLASS_HYB_MEDIUM,
|
|
SHIP_CLASS_HYB_HEAVY
|
|
} ShipClass;
|
|
|
|
/* Small wrapper for the outfits. */
|
|
typedef struct ShipOutfit_ {
|
|
struct ShipOutfit_* next; /* Linked list. */
|
|
Outfit* data; /* Data itself. */
|
|
int quantity;
|
|
} ShipOutfit;
|
|
|
|
|
|
/* Ship structure. */
|
|
typedef struct Ship_ {
|
|
char* name; /* Ship name. */
|
|
ShipClass class; /* Ship class. */
|
|
|
|
/* Store stuff. */
|
|
int price; /* Price! */
|
|
int tech;
|
|
char* fabricator; /* Manufacturer. */
|
|
char* description; /* Sales pitch. */
|
|
|
|
/* Movement. */
|
|
double thrust, turn, speed;
|
|
|
|
/* Graphics. */
|
|
glTexture* gfx_space, *gfx_target;
|
|
|
|
/* GUI interface. */
|
|
char* gui;
|
|
|
|
/* Sound. */
|
|
int sound;
|
|
|
|
/* Characteristics. */
|
|
int crew;
|
|
int mass;
|
|
int fuel; /* How many jumps by default. */
|
|
|
|
/* Health. */
|
|
double armour, armour_regen;
|
|
double shield, shield_regen;
|
|
double energy, energy_regen;
|
|
|
|
/* Capacity. */
|
|
int cap_cargo, cap_weapon;
|
|
|
|
/* Outfits */
|
|
ShipOutfit* outfit;
|
|
} Ship;
|
|
|
|
/* Get. */
|
|
Ship* ship_get(const char* name);
|
|
Ship** ship_getTech(int* n, const int* tech, const int techmax);
|
|
char* ship_class(Ship* p);
|
|
ShipClass ship_classFromString(char* str);
|
|
int ship_basePrice(Ship* s);
|
|
|
|
/* Load/quit. */
|
|
int ships_load(void);
|
|
void ships_free(void);
|
|
|
|
/* Toolkit. */
|
|
void ship_view(char* shipname);
|
|
|