105 lines
2.7 KiB
C
105 lines
2.7 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, /**< Invalid ship. */
|
|
/* Civilian. */
|
|
SHIP_CLASS_YACHT, /**< Small cheap ship. */
|
|
SHIP_CLASS_LUXURY_YACHT, /**< Small expensive ship. */
|
|
SHIP_CLASS_CRUISE_SHIP, /**< Medium Ship. */
|
|
/* Merchant. */
|
|
SHIP_CLASS_COURIER, /**< Small ship. */
|
|
SHIP_CLASS_FREIGHTER, /**< Medium ship. */
|
|
SHIP_CLASS_BULK_CARRIER, /**< Large ship. */
|
|
/* Military. */
|
|
SHIP_CLASS_SCOUT, /**< Small scouter. */
|
|
SHIP_CLASS_FIGHTER, /**< Small attack ship. */
|
|
SHIP_CLASS_BOMBER, /**< Small attack ship with many missiles. */
|
|
SHIP_CLASS_CORVETTE, /**< Very agile medium ship. */
|
|
SHIP_CLASS_DESTROYER, /**< Not so agile medium ship. */
|
|
SHIP_CLASS_CRUISER, /**< Large ship. */
|
|
SHIP_CLASS_CARRIER, /**< Large ship with fighter bays. */
|
|
/* Robotic. */
|
|
SHIP_CLASS_DRONE, /**< Unmanned small robotic ship. */
|
|
SHIP_CLASS_HEAVY_DRONE, /**< Unmannded medium robotic ship. */
|
|
SHIP_CLASS_MOTHERSHIP /**< Unmanned large robotic carrier. */
|
|
/* Hybrid. */
|
|
/** @todo hybrid ship classification. */
|
|
} 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;
|
|
glTexture* gfx_target;
|
|
glTexture* gfx_comm;
|
|
|
|
/* 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(unsigned int unused, char* shipname);
|
|
|