Lephisto/src/ship.h

71 lines
1.2 KiB
C

#pragma once
#include "lephisto.h"
#include "outfit.h"
#include "opengl.h"
// Target gfx dimensions.
#define SHIP_TARGET_W 128
#define SHIP_TARGET_H 96
typedef enum ShipClass_ {
SHIP_CLASS_NULL = 0,
SHIP_CLASS_CIV_LIGHT = 1,
SHIP_CLASS_CIV_MEDIUM = 2,
SHIP_CLASS_CIV_HEAVY = 3
} 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.
unsigned int price; // Price!
// Movement.
double thrust, turn, speed;
// Graphics.
glTexture* gfx_space, *gfx_target;
// GUI interface.
char* gui;
// Sound.
ALuint sound;
// Characteristics.
int crew;
int mass;
// 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);
char** ship_getAll(int* n);
// Load/quit.
int ships_load(void);
void ships_free(void);
// Toolkit.
void ship_view(char* shipname);