Open source remastering of the Freespace 2 engine
ship.h File Reference
#include "ai/ai.h"
#include "fireball/fireballs.h"
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
#include "graphics/2d.h"
#include "hud/hud.h"
#include "hud/hudparse.h"
#include "model/model.h"
#include "model/modelanim.h"
#include "network/multi_obj.h"
#include "palman/palman.h"
#include "radar/radarsetup.h"
#include "render/3d.h"
#include "species_defs/species_defs.h"
#include "weapon/shockwave.h"
#include "weapon/trails.h"
#include <string>

Go to the source code of this file.


struct  reinforcements
struct  ship_weapon
struct  ArmorDamageType
class  ArmorType
struct  DamageTypeStruct
struct  cockpit_display
struct  cockpit_display_info
class  ship_subsys
struct  ship_subsys_info
struct  ship_flag_name
struct  ship_spark
class  ship
struct  ai_target_priority
struct  exited_ship
struct  thruster_particles
struct  particle_effect
struct  ship_type_info
struct  man_thruster_renderer
struct  man_thruster
struct  ship_collision_physics
struct  path_metadata
class  ship_info
struct  ship_obj
struct  engine_wash_info
struct  wing
struct  ship_counts
struct  ship_effect


#define PDS_NONE   1
#define PDS_DIED   2
#define PDS_EJECTED   3
#define HP_SCALE   1.2
#define MAX_SHIP_HITS   8
#define BANK_1   0
#define BANK_2   1
#define BANK_3   2
#define BANK_4   3
#define BANK_5   4
#define BANK_6   5
#define BANK_7   6
#define BANK_8   7
#define BANK_9   8
#define RF_IS_AVAILABLE   (1<<0)
#define SW_FLAG_BEAM_FREE   (1<<0)
#define SW_FLAG_TURRET_LOCK   (1<<1)
#define SW_FLAG_TAGGED_ONLY   (1<<2)
#define AT_CONSTANT_BAD_VAL   -2
#define AT_CONSTANT_PI   -7
#define SAF_IGNORE_SS_ARMOR   (1 << 0)
#define SLT_NONE   0
#define SLT_DEFAULT   1
#define SSF_CARGO_REVEALED   (1 << 0)
#define SSF_UNTARGETABLE   (1 << 1)
#define SSF_NO_SS_TARGETING   (1 << 2)
#define SSF_HAS_FIRED   (1 << 3)
#define SSF_FOV_REQUIRED   (1 << 4)
#define SSF_FOV_EDGE_CHECK   (1 << 5)
#define SSF_NO_REPLACE   (1 << 6)
#define SSF_NO_LIVE_DEBRIS   (1 << 7)
#define SSF_VANISHED   (1 << 8)
#define SSF_MISSILES_IGNORE_IF_DEAD   (1 << 9)
#define SSF_ROTATES   (1 << 10)
#define SSF_DAMAGE_AS_HULL   (1 << 11)
#define SSF_NO_AGGREGATE   (1 << 12)
#define SSF_PLAY_SOUND_FOR_PLAYER   ( 1 << 13)
#define SSF_NO_DISAPPEAR   ( 1 << 14)
#define SSF_AUTOREPAIR_IF_DISABLED   (1 << 15)
#define SSSF_ALIVE   (1 << 0)
#define SSSF_DEAD   (1 << 1)
#define SSSF_ROTATE   (1 << 2)
#define SSSF_TURRET_ROTATION   (1 << 3)
#define MAX_SHIP_FLAG_NAMES   19
#define SF_IGNORE_COUNT   (1 << 0)
#define SF_REINFORCEMENT   (1 << 1)
#define SF_ESCORT   (1 << 2)
#define SF_NO_ARRIVAL_MUSIC   (1 << 3)
#define SF_NO_ARRIVAL_WARP   (1 << 4)
#define SF_NO_DEPARTURE_WARP   (1 << 5)
#define SF_KILL_BEFORE_MISSION   (1 << 31)
#define SF_DYING   (1 << 30)
#define SF_DISABLED   (1 << 29)
#define SF_DEPART_WARP   (1 << 28)
#define SF_DEPART_DOCKBAY   (1 << 27)
#define SF_ARRIVING_STAGE_1   (1 << 26)
#define SF_ARRIVING_STAGE_2   (1 << 25)
#define SF_ENGINES_ON   (1 << 24)
#define SF_DOCK_LEADER   (1 << 23)
#define SF_CARGO_REVEALED   (1 << 22)
#define SF_FROM_PLAYER_WING   (1 << 21)
#define SF_PRIMARY_LINKED   (1 << 20)
#define SF_SECONDARY_DUAL_FIRE   (1 << 19)
#define SF_WARP_BROKEN   (1 << 18)
#define SF_WARP_NEVER   (1 << 17)
#define SF_TRIGGER_DOWN   (1 << 16)
#define SF_AMMO_COUNT_RECORDED   (1 << 15)
#define SF_HIDDEN_FROM_SENSORS   (1 << 14)
#define SF_SCANNABLE   (1 << 13)
#define SF_WARPED_SUPPORT   (1 << 12)
#define SF_EXPLODED   (1 << 11)
#define SF_SHIP_HAS_SCREAMED   (1 << 10)
#define SF_RED_ALERT_STORE_STATUS   (1 << 9)
#define SF_VAPORIZE   (1<<8)
#define SF_DEPARTURE_ORDERED   (1<<7)
#define SF2_PRIMITIVE_SENSORS   (1<<0)
#define SF2_STEALTH   (1<<2)
#define SF2_DONT_COLLIDE_INVIS   (1<<3)
#define SF2_NO_SUBSPACE_DRIVE   (1<<4)
#define SF2_NAVPOINT_CARRY   (1<<5)
#define SF2_AFFECTED_BY_GRAVITY   (1<<6)
#define SF2_NO_BUILTIN_MESSAGES   (1<<8)
#define SF2_PRIMARIES_LOCKED   (1<<9)
#define SF2_SECONDARIES_LOCKED   (1<<10)
#define SF2_GLOWMAPS_DISABLED   (1<<11)
#define SF2_NO_DEATH_SCREAM   (1<<12)
#define SF2_ALWAYS_DEATH_SCREAM   (1<<13)
#define SF2_NAVPOINT_NEEDSLINK   (1<<14)
#define SF2_HIDE_SHIP_NAME   (1<<15)
#define SF2_AFTERBURNER_LOCKED   (1<<16)
#define SF2_SET_CLASS_DYNAMICALLY   (1<<18)
#define SF2_FORCE_SHIELDS_ON   (1<<20)
#define SF2_NO_ETS   (1<<21)
#define SF2_CLOAKED   (1<<22)
#define SF2_NO_THRUSTERS   (1<<23)
#define SF2_SHIP_LOCKED   (1<<24)
#define SF2_WEAPONS_LOCKED   (1<<25)
#define SF2_SHIP_SELECTIVE_LINKING   (1<<26)
#define SF2_SCRAMBLE_MESSAGES   (1<<27)
#define SF2_NO_SECONDARY_LOCKON   (1<<28)
#define MAX_DAMAGE_SLOTS   32
#define MAX_SHIP_ARCS   2
#define MAX_MAN_THRUSTERS   128
#define AWACS_WARN_NONE   (1 << 0)
#define AWACS_WARN_25   (1 << 1)
#define AWACS_WARN_75   (1 << 2)
#define SEF_DESTROYED   (1<<0)
#define SEF_DEPARTED   (1<<1)
#define SEF_CARGO_KNOWN   (1<<2)
#define SEF_PLAYER_DELETED   (1<<3)
#define SEF_BEEN_TAGGED   (1<<4)
#define SEF_RED_ALERT_CARRY   (1<<5)
#define SIF_NO_COLLIDE   (1 << 0)
#define SIF_PLAYER_SHIP   (1 << 1)
#define SIF_DEFAULT_PLAYER_SHIP   (1 << 2)
#define SIF_PATH_FIXUP   (1 << 3)
#define SIF_SUPPORT   (1 << 4)
#define SIF_AFTERBURNER   (1 << 5)
#define SIF_BALLISTIC_PRIMARIES   (1 << 6)
#define SIF_CARGO   (1 << 7)
#define SIF_FIGHTER   (1 << 8)
#define SIF_BOMBER   (1 << 9)
#define SIF_CRUISER   (1 << 10)
#define SIF_FREIGHTER   (1 << 11)
#define SIF_CAPITAL   (1 << 12)
#define SIF_TRANSPORT   (1 << 13)
#define SIF_NAVBUOY   (1 << 14)
#define SIF_SENTRYGUN   (1 << 15)
#define SIF_ESCAPEPOD   (1 << 16)
#define SIF_NO_SHIP_TYPE   (1 << 17)
#define SIF_SHIP_COPY   (1 << 18)
#define SIF_IN_TECH_DATABASE   (1 << 19)
#define SIF_IN_TECH_DATABASE_M   (1 << 20)
#define SIF_STEALTH   (1 << 21)
#define SIF_SUPERCAP   (1 << 22)
#define SIF_DRYDOCK   (1 << 23)
#define SIF_BIG_DAMAGE   (1 << 25)
#define SIF_HAS_AWACS   (1 << 26)
#define SIF_CORVETTE   (1 << 27)
#define SIF_GAS_MINER   (1 << 28)
#define SIF_AWACS   (1 << 29)
#define SIF_KNOSSOS_DEVICE   (1 << 30)
#define SIF_NO_FRED   (1 << 31)
#define SIF2_DEFAULT_IN_TECH_DATABASE   (1 << 0)
#define SIF2_DEFAULT_IN_TECH_DATABASE_M   (1 << 1)
#define SIF2_FLASH   (1 << 2)
#define SIF2_SHOW_SHIP_MODEL   (1 << 3)
#define SIF2_SURFACE_SHIELDS   (1 << 4)
#define SIF2_GENERATE_HUD_ICON   (1 << 5)
#define SIF2_GUN_CONVERGENCE   (1 << 7)
#define SIF2_NO_THRUSTER_GEO_NOISE   (1 << 8)
#define SIF2_INTRINSIC_NO_SHIELDS   (1 << 9)
#define SIF2_NO_PRIMARY_LINKING   (1 << 10)
#define SIF2_NO_PAIN_FLASH   (1 << 11)
#define SIF2_ALLOW_LANDINGS   (1 << 12)
#define SIF2_NO_ETS   (1 << 13)
#define SIF2_NO_LIGHTING   (1 << 14)
#define SIF2_DYN_PRIMARY_LINKING   (1 << 15)
#define SIF2_AUTO_SPREAD_SHIELDS   (1 << 16)
#define SIF2_DRAW_WEAPON_MODELS   (1 << 17)
#define SIF2_MODEL_POINT_SHIELDS   (1 << 18)
#define SIF2_DEFAULT_VALUE   0
#define REGULAR_WEAPON   (1<<0)
#define DOGFIGHT_WEAPON   (1<<1)
#define AIM_FLAG_AUTOAIM   (1 << 0)
#define AIM_FLAG_AUTO_CONVERGENCE   (1 << 1)
#define AIM_FLAG_STD_CONVERGENCE   (1 << 2)
#define STI_MSG_COUNTS_FOR_ALONE   (1<<0)
#define STI_HUD_HOTKEY_ON_LIST   (1<<0)
#define STI_HUD_TARGET_AS_THREAT   (1<<1)
#define STI_HUD_NO_CLASS_DISPLAY   (1<<3)
#define STI_SHIP_SCANNABLE   (1<<0)
#define STI_SHIP_WARP_PUSHES   (1<<1)
#define STI_SHIP_WARP_PUSHABLE   (1<<2)
#define STI_TURRET_TGT_SHIP_TGT   (1<<3)
#define STI_WEAP_BEAMS_EASILY_HIT   (1<<0)
#define STI_WEAP_NO_HUGE_IMPACT_EFF   (1<<1)
#define STI_AI_AUTO_ATTACKS   (1<<1)
#define STI_AI_GUARDS_ATTACK   (1<<3)
#define STI_AI_TURRETS_ATTACK   (1<<4)
#define STI_AI_CAN_FORM_WING   (1<<5)
#define MT_BANK_RIGHT   (1<<0)
#define MT_BANK_LEFT   (1<<1)
#define MT_PITCH_UP   (1<<2)
#define MT_PITCH_DOWN   (1<<3)
#define MT_ROLL_RIGHT   (1<<4)
#define MT_ROLL_LEFT   (1<<5)
#define MT_SLIDE_RIGHT   (1<<6)
#define MT_SLIDE_LEFT   (1<<7)
#define MT_SLIDE_UP   (1<<8)
#define MT_SLIDE_DOWN   (1<<9)
#define MT_FORWARD   (1<<10)
#define MT_REVERSE   (1<<11)
#define WT_DEFAULT   0
#define WT_KNOSSOS   1
#define WT_IN_PLACE_ANIM   3
#define WT_SWEEPER   4
#define WT_HYPERSPACE   5
#define MAX_WING_FLAGS   8
#define WF_WING_GONE   (1<<0)
#define WF_WING_DEPARTING   (1<<1)
#define WF_IGNORE_COUNT   (1<<2)
#define WF_REINFORCEMENT   (1<<3)
#define WF_NO_ARRIVAL_MUSIC   (1<<5)
#define WF_EXPANDED   (1<<6)
#define WF_NO_ARRIVAL_MESSAGE   (1<<7)
#define WF_NO_ARRIVAL_WARP   (1<<8)
#define WF_NO_DEPARTURE_WARP   (1<<9)
#define WF_NO_DYNAMIC   (1<<10)
#define WF_DEPARTURE_ORDERED   (1<<11)
#define WF_NAV_CARRY   (1<<12)
#define WING_INDEX(wingp)   (wingp-Wings)
#define SHIP_INDEX(shipp)   (shipp-Ships)
#define SHIP_VANISHED   (1<<0)
#define SHIP_DESTROYED   (1<<1)
#define SHIP_DEPARTED_WARP   (1<<2)
#define SHIP_DEPARTED_BAY   (1<<3)
#define SHIP_GET_ANY_SHIP   0


typedef struct ship_weapon ship_weapon
typedef struct DamageTypeStruct DamageTypeStruct
typedef struct cockpit_display cockpit_display
typedef struct cockpit_display_info cockpit_display_info
typedef struct ship_subsys_info ship_subsys_info
typedef struct ship_flag_name ship_flag_name
typedef struct ship_spark ship_spark
typedef struct exited_ship exited_ship
typedef struct thruster_particles thruster_particles
typedef struct particle_effect particle_effect
typedef struct ship_type_info ship_type_info
typedef struct man_thruster man_thruster
typedef struct ship_collision_physics ship_collision_physics
typedef struct path_metadata path_metadata
typedef struct ship_obj ship_obj
typedef struct engine_wash_info engine_wash_info
typedef struct wing wing
typedef struct ship_counts ship_counts
typedef struct ship_effect ship_effect


int damage_type_add (char *name)
void parse_ai_target_priorities ()
void parse_weapon_targeting_priorities ()
ai_target_priority init_ai_target_priorities ()
void ship_add_exited_ship (ship *shipp, int reason)
int ship_find_exited_ship_by_name (char *name)
int ship_find_exited_ship_by_signature (int signature)
void ship_init ()
void ship_level_init ()
int ship_create (matrix *orient, vec3d *pos, int ship_type, char *ship_name=NULL)
void change_ship_type (int n, int ship_type, int by_sexp=0)
void ship_model_change (int n, int ship_type)
void ship_process_pre (object *objp, float frametime)
void ship_process_post (object *objp, float frametime)
void ship_render_DEPRECATED (object *objp)
void ship_render (object *obj, draw_list *scene)
void ship_render_cockpit (object *objp)
void ship_render_show_ship_cockpit (object *objp)
void ship_delete (object *objp)
int ship_check_collision_fast (object *obj, object *other_obj, vec3d *hitpos)
int ship_get_num_ships ()
void ship_cleanup (int shipnum, int cleanup_mode)
void ship_destroy_instantly (object *ship_obj, int shipnum)
void ship_actually_depart (int shipnum, int method=SHIP_DEPARTED_WARP)
int ship_fire_primary_debug (object *objp)
int ship_stop_fire_primary (object *obj)
int ship_fire_primary (object *objp, int stream_weapons, int force=0)
int ship_fire_secondary (object *objp, int allow_swarm=0)
int ship_launch_countermeasure (object *objp, int rand_val=-1)
void ship_start_targeting_laser (ship *shipp)
void ship_stop_targeting_laser (ship *shipp)
void ship_process_targeting_lasers ()
int ship_select_next_primary (object *objp, int direction)
int ship_select_next_secondary (object *objp)
int get_available_primary_weapons (object *objp, int *outlist, int *outbanklist)
int get_available_secondary_weapons (object *objp, int *outlist, int *outbanklist)
void ship_recalc_subsys_strength (ship *shipp)
int subsys_set (int objnum, int ignore_subsys_info=0)
void physics_ship_init (object *objp)
int get_subsystem_pos (vec3d *pos, object *objp, ship_subsys *subsysp)
int parse_ship_values (ship_info *sip, const bool is_template, const bool first_time, const bool replace)
int ship_template_lookup (const char *name=NULL)
void parse_ship_particle_effect (ship_info *sip, particle_effect *pe, char *id_string)
int ship_info_lookup (const char *name=NULL)
int ship_name_lookup (const char *name, int inc_players=0)
int ship_type_name_lookup (const char *name)
int wing_lookup (const char *name)
int wing_has_conflicting_teams (int wing_index)
int wing_name_lookup (const char *name, int ignore_count=0)
void wing_bash_ship_name (char *ship_name, const char *wing_name, int index)
void create_shield_explosion (int objnum, int model_num, matrix *orient, vec3d *centerp, vec3d *tcp, int tr0)
void shield_hit_init ()
void create_shield_explosion_all (object *objp)
void shield_frame_init ()
void add_shield_point (int objnum, int tri_num, vec3d *hit_pos)
void add_shield_point_multi (int objnum, int tri_num, vec3d *hit_pos)
void shield_point_multi_setup ()
void shield_hit_close ()
void ship_draw_shield (object *objp)
float apply_damage_to_shield (object *objp, int quadrant, float damage)
float compute_shield_strength (object *objp)
int ship_is_shield_up (object *obj, int quadrant)
void ship_model_start (object *objp)
void ship_model_stop (object *objp)
void ship_model_update_instance (object *objp)
int ship_find_num_crewpoints (object *objp)
int ship_find_num_turrets (object *objp)
void compute_slew_matrix (matrix *orient, angles *a)
void ship_set_eye (object *obj, int eye_index)
void ship_get_eye (vec3d *eye_pos, matrix *eye_orient, object *obj, bool do_slew=true, bool from_origin=false)
ship_subsysship_get_indexed_subsys (ship *sp, int index, vec3d *attacker_pos=NULL)
int ship_get_index_from_subsys (ship_subsys *ssp, int objnum, int error_bypass=0)
int ship_get_subsys_index (ship *sp, char *ss_name, int error_bypass=0)
float ship_get_subsystem_strength (ship *shipp, int type)
ship_subsysship_get_subsys (ship *shipp, char *subsys_name)
int ship_get_num_subsys (ship *shipp)
ship_subsysship_get_closest_subsys_in_sight (ship *sp, int subsys_type, vec3d *attacker_pos)
char * ship_subsys_get_name (ship_subsys *ss)
bool ship_subsys_has_instance_name (ship_subsys *ss)
void ship_subsys_set_name (ship_subsys *ss, char *n_name)
int ship_subsys_disrupted (ship_subsys *ss)
int ship_subsys_disrupted (ship *sp, int type)
void ship_subsys_set_disrupted (ship_subsys *ss, int time)
int ship_do_rearm_frame (object *objp, float frametime)
float ship_calculate_rearm_duration (object *objp)
void ship_wing_cleanup (int shipnum, wing *wingp)
int ship_find_repair_ship (object *requester_obj, object **ship_we_found=NULL)
void ship_close ()
void ship_assign_sound_all ()
void ship_assign_sound (ship *sp)
void ship_clear_ship_type_counts ()
void ship_add_ship_type_count (int ship_info_index, int num)
void ship_add_ship_type_kill_count (int ship_info_index)
int ship_get_type (char *output, ship_info *sip)
int ship_get_default_orders_accepted (ship_info *sip)
int ship_query_general_type (int ship)
int ship_class_query_general_type (int ship_class)
int ship_query_general_type (ship *shipp)
int ship_docking_valid (int docker, int dockee)
int get_quadrant (vec3d *hit_pnt, object *shipobjp=NULL)
void ship_obj_list_rebuild ()
int ship_query_state (char *name)
int ship_primary_bank_has_ammo (int shipnum)
int ship_secondary_bank_has_ammo (int shipnum)
int ship_engine_ok_to_warp (ship *sp)
int ship_navigation_ok_to_warp (ship *sp)
int ship_return_subsys_path_normal (ship *sp, ship_subsys *ss, vec3d *gsubpos, vec3d *norm)
int ship_subsystem_in_sight (object *objp, ship_subsys *subsys, vec3d *eye_pos, vec3d *subsys_pos, int do_facing_check=1, float *dot_out=NULL, vec3d *vec_out=NULL)
ship_subsysship_return_next_subsys (ship *shipp, int type, vec3d *attacker_pos)
int ship_get_random_team_ship (int team_mask, int flags=SHIP_GET_ANY_SHIP, float max_dist=0.0f)
int ship_get_random_player_wing_ship (int flags=SHIP_GET_ANY_SHIP, float max_dist=0.0f, int persona_index=-1, int get_first=0, int multi_team=-1)
int ship_get_random_ship_in_wing (int wingnum, int flags=SHIP_GET_ANY_SHIP, float max_dist=0.0f, int get_first=0)
int ship_get_random_targetable_ship ()
int ship_get_by_signature (int signature)
void ship_subsystem_delete (ship *shipp)
void ship_set_default_weapons (ship *shipp, ship_info *sip)
float ship_quadrant_shield_strength (object *hit_objp, vec3d *hitpos)
int ship_dumbfire_threat (ship *sp)
int ship_lock_threat (ship *sp)
int bitmask_2_bitnum (int num)
char * ship_return_orders (char *outbuf, ship *sp)
char * ship_return_time_to_goal (char *outbuf, ship *sp)
void ship_maybe_warn_player (ship *enemy_sp, float dist)
void ship_maybe_praise_player (ship *deader_sp)
void ship_maybe_praise_self (ship *deader_sp, ship *killer_sp)
void ship_maybe_ask_for_help (ship *sp)
void ship_scream (ship *sp)
void ship_maybe_scream (ship *sp)
void ship_maybe_tell_about_rearm (ship *sp)
void ship_maybe_tell_about_low_ammo (ship *sp)
void ship_maybe_lament ()
void ship_primary_changed (ship *sp)
void ship_secondary_changed (ship *sp)
int ship_get_SIF (ship *shipp)
int ship_get_SIF (int sh)
ship_type_infoship_get_type_info (object *objp)
void ship_do_cargo_revealed (ship *shipp, int from_network=0)
void ship_do_cargo_hidden (ship *shipp, int from_network=0)
void ship_do_cap_subsys_cargo_revealed (ship *shipp, ship_subsys *subsys, int from_network=0)
void ship_do_cap_subsys_cargo_hidden (ship *shipp, ship_subsys *subsys, int from_network=0)
float ship_get_secondary_weapon_range (ship *shipp)
int primary_out_of_ammo (ship_weapon *swp, int bank)
int get_max_ammo_count_for_primary_bank (int ship_class, int bank, int ammo_type)
int get_max_ammo_count_for_bank (int ship_class, int bank, int ammo_type)
int get_max_ammo_count_for_turret_bank (ship_weapon *swp, int bank, int ammo_type)
int is_support_allowed (object *objp, bool do_simple_check=false)
void ship_get_global_turret_gun_info (object *objp, ship_subsys *ssp, vec3d *gpos, vec3d *gvec, int use_angles, vec3d *targetp)
void ship_get_global_turret_info (object *objp, model_subsystem *tp, vec3d *gpos, vec3d *gvec)
int object_in_turret_fov (object *objp, ship_subsys *ss, vec3d *tvec, vec3d *tpos, float dist)
bool turret_std_fov_test (ship_subsys *ss, vec3d *gvec, vec3d *v2e, float size_mod=0)
bool turret_adv_fov_test (ship_subsys *ss, vec3d *gvec, vec3d *v2e, float size_mod=0)
bool turret_fov_test (ship_subsys *ss, vec3d *gvec, vec3d *v2e, float size_mod=0)
float get_adjusted_turret_rof (ship_subsys *ss)
void object_jettison_cargo (object *objp, object *cargo_objp)
float ship_get_exp_damage (object *objp)
int ship_get_exp_propagates (ship *sp)
float ship_get_exp_outer_rad (object *ship_objp)
int ship_explode_area_calc_damage (vec3d *pos1, vec3d *pos2, float inner_rad, float outer_rad, float max_damage, float max_blast, float *damage, float *blast)
int valid_cap_subsys_cargo_list (char *subsys_name)
int ship_get_turret_type (ship_subsys *subsys)
int ship_get_reinforcement_team (int r_index)
int ship_get_texture (int bitmap)
void ship_page_in ()
void ship_page_in_textures (int ship_index=-1)
void ship_page_out_textures (int ship_index, bool release=false)
void ship_update_artillery_lock ()
int check_world_pt_in_expanded_ship_bbox (vec3d *world_pt, object *objp, float delta_box)
int ship_is_tagged (object *objp)
float ship_get_max_speed (ship *shipp)
float ship_get_warpout_speed (object *objp)
int ship_is_beginning_warpout_speedup (object *objp)
float ship_class_get_length (ship_info *sip)
void ship_set_new_ai_class (int ship_num, int new_ai_class)
void ship_subsystem_set_new_ai_class (int ship_num, char *subsystem, int new_ai_class)
void wing_load_squad_bitmap (wing *w)
bool ship_has_dock_bay (int shipnum)
bool ship_useful_for_departure (int shipnum, int path_mask=0)
int ship_get_ship_for_departure (int team)
bool ship_subsys_is_fighterbay (ship_subsys *ss)
bool ship_fighterbays_all_destroyed (ship *shipp)
bool ship_subsys_takes_damage (ship_subsys *ss)
int ship_fire_tertiary (object *objp)
void ship_do_submodel_rotation (ship *shipp, model_subsystem *psub, ship_subsys *pss)
int ship_has_energy_weapons (ship *shipp)
int ship_has_engine_power (ship *shipp)
void ship_init_cockpit_displays (ship *shipp)
void ship_add_cockpit_display (cockpit_display_info *display, int cockpit_model_num)
void ship_set_hud_cockpit_targets ()
void ship_clear_cockpit_displays ()
int ship_start_render_cockpit_display (int cockpit_display_num)
void ship_end_render_cockpit_display (int cockpit_display_num)
int warptype_match (char *p)
int ship_starting_wing_lookup (const char *wing_name)
int ship_squadron_wing_lookup (const char *wing_name)
int ship_tvt_wing_lookup (const char *wing_name)
int ship_class_compare (int ship_class_1, int ship_class_2)
int armor_type_get_idx (char *name)
void armor_init ()
int thruster_glow_anim_load (generic_anim *ga)
void init_path_metadata (path_metadata &metadata)
int ship_get_sound (object *objp, GameSoundsIndex id)
 Returns a ship-specific sound index. More...
bool ship_has_sound (object *objp, GameSoundsIndex id)
 Specifies if a ship has a custom sound for the specified id. More...
int get_default_player_ship_index ()
 Returns the index of the default player ship. More...
int get_nearest_bbox_point (object *ship_obj, vec3d *start, vec3d *box_pt)


vec3d Original_vec_to_deader
SCP_vector< ArmorTypeArmor_types
SCP_vector< DamageTypeStructDamage_types
char * Turret_target_order_names [NUM_TURRET_ORDER_TYPES]
SCP_vector< cockpit_displayPlayer_displays
ship_flag_name Ship_flag_names []
SCP_vector< ai_target_priorityAi_tp_list
SCP_vector< exited_shipShips_exited
SCP_vector< ship_type_infoShip_types
SCP_vector< man_thruster_rendererMan_thrusters
int Num_wings
ship Ships [MAX_SHIPS]
ship_obj Ship_obj_list
SCP_vector< engine_wash_infoEngine_wash_info
wing Wings [MAX_WINGS]
int Starting_wings [MAX_STARTING_WINGS]
int Squadron_wings [MAX_SQUADRON_WINGS]
int TVT_wings [MAX_TVT_WINGS]
char Starting_wing_names [MAX_STARTING_WINGS][NAME_LENGTH]
char Squadron_wing_names [MAX_SQUADRON_WINGS][NAME_LENGTH]
char TVT_wing_names [MAX_TVT_WINGS][NAME_LENGTH]
int ai_paused
int Num_reinforcements
SCP_vector< ship_infoShip_info
reinforcements Reinforcements [MAX_REINFORCEMENTS]
SCP_vector< ship_countsShip_type_counts
int Player_ship_class
int Ai_render_debug_flag
int Show_shield_mesh
int Ship_auto_repair
SCP_vector< ship_effectShip_effects

Macro Definition Documentation


Definition at line 172 of file ship.h.


Definition at line 173 of file ship.h.


Definition at line 174 of file ship.h.


Definition at line 175 of file ship.h.

#define AIM_FLAG_AUTO_CONVERGENCE   (1 << 1)

Definition at line 962 of file ship.h.

#define AIM_FLAG_AUTOAIM   (1 << 0)

Definition at line 961 of file ship.h.


Definition at line 964 of file ship.h.


Definition at line 965 of file ship.h.

#define AIM_FLAG_STD_CONVERGENCE   (1 << 2)

Definition at line 963 of file ship.h.

#define AT_CONSTANT_BAD_VAL   -2

Definition at line 180 of file ship.h.


Definition at line 181 of file ship.h.


Definition at line 182 of file ship.h.


Definition at line 183 of file ship.h.


Definition at line 179 of file ship.h.

#define AT_CONSTANT_PI   -7

Definition at line 185 of file ship.h.


Definition at line 184 of file ship.h.

#define AWACS_WARN_25   (1 << 1)

Definition at line 530 of file ship.h.

#define AWACS_WARN_75   (1 << 2)

Definition at line 531 of file ship.h.

#define AWACS_WARN_NONE   (1 << 0)

Definition at line 529 of file ship.h.

#define BANK_1   0

Definition at line 65 of file ship.h.

#define BANK_2   1

Definition at line 66 of file ship.h.

#define BANK_3   2

Definition at line 67 of file ship.h.

#define BANK_4   3

Definition at line 68 of file ship.h.

#define BANK_5   4

Definition at line 69 of file ship.h.

#define BANK_6   5

Definition at line 70 of file ship.h.

#define BANK_7   6

Definition at line 71 of file ship.h.

#define BANK_8   7

Definition at line 72 of file ship.h.

#define BANK_9   8

Definition at line 73 of file ship.h.


Definition at line 62 of file ship.h.


Definition at line 63 of file ship.h.


Definition at line 479 of file ship.h.

#define DOGFIGHT_WEAPON   (1<<1)

Definition at line 959 of file ship.h.

#define HP_SCALE   1.2

Definition at line 55 of file ship.h.


Definition at line 49 of file ship.h.

#define MAX_DAMAGE_SLOTS   32

Definition at line 516 of file ship.h.

#define MAX_MAN_THRUSTERS   128

Definition at line 521 of file ship.h.


Definition at line 78 of file ship.h.


Definition at line 58 of file ship.h.

#define MAX_SHIP_ARCS   2

Definition at line 517 of file ship.h.


Definition at line 520 of file ship.h.


Definition at line 57 of file ship.h.

#define MAX_SHIP_FLAG_NAMES   19

Definition at line 429 of file ship.h.

#define MAX_SHIP_HITS   8

Definition at line 56 of file ship.h.

#define MAX_WING_FLAGS   8

Definition at line 1500 of file ship.h.

#define MT_BANK_LEFT   (1<<1)

Definition at line 1077 of file ship.h.

#define MT_BANK_RIGHT   (1<<0)

Definition at line 1076 of file ship.h.

#define MT_FORWARD   (1<<10)

Definition at line 1086 of file ship.h.

#define MT_PITCH_DOWN   (1<<3)

Definition at line 1079 of file ship.h.

#define MT_PITCH_UP   (1<<2)

Definition at line 1078 of file ship.h.

#define MT_REVERSE   (1<<11)

Definition at line 1087 of file ship.h.

#define MT_ROLL_LEFT   (1<<5)

Definition at line 1081 of file ship.h.

#define MT_ROLL_RIGHT   (1<<4)

Definition at line 1080 of file ship.h.

#define MT_SLIDE_DOWN   (1<<9)

Definition at line 1085 of file ship.h.

#define MT_SLIDE_LEFT   (1<<7)

Definition at line 1083 of file ship.h.

#define MT_SLIDE_RIGHT   (1<<6)

Definition at line 1082 of file ship.h.

#define MT_SLIDE_UP   (1<<8)

Definition at line 1084 of file ship.h.


Definition at line 518 of file ship.h.


Definition at line 253 of file ship.h.

#define PDS_DIED   2

Definition at line 44 of file ship.h.

#define PDS_EJECTED   3

Definition at line 45 of file ship.h.

#define PDS_NONE   1

Definition at line 43 of file ship.h.

#define REGULAR_WEAPON   (1<<0)

Definition at line 958 of file ship.h.

#define RF_IS_AVAILABLE   (1<<0)

Definition at line 80 of file ship.h.


Definition at line 246 of file ship.h.


Definition at line 245 of file ship.h.


Definition at line 247 of file ship.h.

#define SAF_IGNORE_SS_ARMOR   (1 << 0)

Definition at line 243 of file ship.h.

#define SEF_BEEN_TAGGED   (1<<4)

Definition at line 850 of file ship.h.

#define SEF_CARGO_KNOWN   (1<<2)

Definition at line 848 of file ship.h.

#define SEF_DEPARTED   (1<<1)

Definition at line 847 of file ship.h.

#define SEF_DESTROYED   (1<<0)

Definition at line 846 of file ship.h.

#define SEF_PLAYER_DELETED   (1<<3)

Definition at line 849 of file ship.h.

#define SEF_RED_ALERT_CARRY   (1<<5)

Definition at line 851 of file ship.h.

#define SF2_AFFECTED_BY_GRAVITY   (1<<6)

Definition at line 489 of file ship.h.

#define SF2_AFTERBURNER_LOCKED   (1<<16)

Definition at line 499 of file ship.h.

#define SF2_ALWAYS_DEATH_SCREAM   (1<<13)

Definition at line 496 of file ship.h.

#define SF2_CLOAKED   (1<<22)

Definition at line 504 of file ship.h.

#define SF2_DONT_COLLIDE_INVIS   (1<<3)

Definition at line 486 of file ship.h.

#define SF2_FORCE_SHIELDS_ON   (1<<20)

Definition at line 502 of file ship.h.


Definition at line 484 of file ship.h.

#define SF2_GLOWMAPS_DISABLED   (1<<11)

Definition at line 494 of file ship.h.

#define SF2_HIDE_SHIP_NAME   (1<<15)

Definition at line 498 of file ship.h.


Definition at line 501 of file ship.h.

#define SF2_NAVPOINT_CARRY   (1<<5)

Definition at line 488 of file ship.h.

#define SF2_NAVPOINT_NEEDSLINK   (1<<14)

Definition at line 497 of file ship.h.

#define SF2_NO_BUILTIN_MESSAGES   (1<<8)

Definition at line 491 of file ship.h.

#define SF2_NO_DEATH_SCREAM   (1<<12)

Definition at line 495 of file ship.h.


Definition at line 511 of file ship.h.

#define SF2_NO_ETS   (1<<21)

Definition at line 503 of file ship.h.

#define SF2_NO_SECONDARY_LOCKON   (1<<28)

Definition at line 510 of file ship.h.

#define SF2_NO_SUBSPACE_DRIVE   (1<<4)

Definition at line 487 of file ship.h.

#define SF2_NO_THRUSTERS   (1<<23)

Definition at line 505 of file ship.h.

#define SF2_PRIMARIES_LOCKED   (1<<9)

Definition at line 492 of file ship.h.

#define SF2_PRIMITIVE_SENSORS   (1<<0)

Definition at line 483 of file ship.h.

#define SF2_SCRAMBLE_MESSAGES   (1<<27)

Definition at line 509 of file ship.h.

#define SF2_SECONDARIES_LOCKED   (1<<10)

Definition at line 493 of file ship.h.

#define SF2_SET_CLASS_DYNAMICALLY   (1<<18)

Definition at line 500 of file ship.h.

#define SF2_SHIP_LOCKED   (1<<24)

Definition at line 506 of file ship.h.

#define SF2_SHIP_SELECTIVE_LINKING   (1<<26)

Definition at line 508 of file ship.h.

#define SF2_STEALTH   (1<<2)

Definition at line 485 of file ship.h.


Definition at line 490 of file ship.h.

#define SF2_WEAPONS_LOCKED   (1<<25)

Definition at line 507 of file ship.h.

#define SF_AMMO_COUNT_RECORDED   (1 << 15)

Definition at line 463 of file ship.h.


Definition at line 453 of file ship.h.

#define SF_ARRIVING_STAGE_1   (1 << 26)

Definition at line 451 of file ship.h.

#define SF_ARRIVING_STAGE_2   (1 << 25)

Definition at line 452 of file ship.h.


Definition at line 476 of file ship.h.

#define SF_CARGO_REVEALED   (1 << 22)

Definition at line 456 of file ship.h.

#define SF_DEPART_DOCKBAY   (1 << 27)

Definition at line 450 of file ship.h.

#define SF_DEPART_WARP   (1 << 28)

Definition at line 449 of file ship.h.


Definition at line 475 of file ship.h.

#define SF_DEPARTURE_ORDERED   (1<<7)

Definition at line 471 of file ship.h.

#define SF_DISABLED   (1 << 29)

Definition at line 448 of file ship.h.

#define SF_DOCK_LEADER   (1 << 23)

Definition at line 455 of file ship.h.

#define SF_DYING   (1 << 30)

Definition at line 447 of file ship.h.

#define SF_ENGINES_ON   (1 << 24)

Definition at line 454 of file ship.h.

#define SF_ESCORT   (1 << 2)

Definition at line 438 of file ship.h.

#define SF_EXPLODED   (1 << 11)

Definition at line 467 of file ship.h.

#define SF_FROM_PLAYER_WING   (1 << 21)

Definition at line 457 of file ship.h.

#define SF_HIDDEN_FROM_SENSORS   (1 << 14)

Definition at line 464 of file ship.h.

#define SF_IGNORE_COUNT   (1 << 0)

Definition at line 436 of file ship.h.

#define SF_KILL_BEFORE_MISSION   (1 << 31)

Definition at line 446 of file ship.h.

#define SF_NO_ARRIVAL_MUSIC   (1 << 3)

Definition at line 439 of file ship.h.

#define SF_NO_ARRIVAL_WARP   (1 << 4)

Definition at line 440 of file ship.h.

#define SF_NO_DEPARTURE_WARP   (1 << 5)

Definition at line 441 of file ship.h.

#define SF_PRIMARY_LINKED   (1 << 20)

Definition at line 458 of file ship.h.

#define SF_RED_ALERT_STORE_STATUS   (1 << 9)

Definition at line 469 of file ship.h.

#define SF_REINFORCEMENT   (1 << 1)

Definition at line 437 of file ship.h.

#define SF_SCANNABLE   (1 << 13)

Definition at line 465 of file ship.h.

#define SF_SECONDARY_DUAL_FIRE   (1 << 19)

Definition at line 459 of file ship.h.

#define SF_SHIP_HAS_SCREAMED   (1 << 10)

Definition at line 468 of file ship.h.

#define SF_TRIGGER_DOWN   (1 << 16)

Definition at line 462 of file ship.h.

#define SF_VAPORIZE   (1<<8)

Definition at line 470 of file ship.h.

#define SF_WARP_BROKEN   (1 << 18)

Definition at line 460 of file ship.h.

#define SF_WARP_NEVER   (1 << 17)

Definition at line 461 of file ship.h.

#define SF_WARPED_SUPPORT   (1 << 12)

Definition at line 466 of file ship.h.


Definition at line 1626 of file ship.h.

#define SHIP_DEPARTED_BAY   (1<<3)

Definition at line 1625 of file ship.h.

#define SHIP_DEPARTED_WARP   (1<<2)

Definition at line 1624 of file ship.h.

#define SHIP_DESTROYED   (1<<1)

Definition at line 1623 of file ship.h.

#define SHIP_GET_ANY_SHIP   0

Definition at line 1786 of file ship.h.


Definition at line 1787 of file ship.h.


Definition at line 1788 of file ship.h.


Definition at line 1789 of file ship.h.


Definition at line 47 of file ship.h.

#define SHIP_INDEX (   shipp)    (shipp-Ships)

Definition at line 1602 of file ship.h.

#define SHIP_VANISHED   (1<<0)

Definition at line 1622 of file ship.h.

#define SIF2_ALLOW_LANDINGS   (1 << 12)

Definition at line 930 of file ship.h.

#define SIF2_AUTO_SPREAD_SHIELDS   (1 << 16)

Definition at line 934 of file ship.h.

#define SIF2_DEFAULT_IN_TECH_DATABASE   (1 << 0)

Definition at line 918 of file ship.h.

#define SIF2_DEFAULT_IN_TECH_DATABASE_M   (1 << 1)

Definition at line 919 of file ship.h.

#define SIF2_DEFAULT_VALUE   0

Definition at line 940 of file ship.h.


Definition at line 924 of file ship.h.

#define SIF2_DRAW_WEAPON_MODELS   (1 << 17)

Definition at line 935 of file ship.h.

#define SIF2_DYN_PRIMARY_LINKING   (1 << 15)

Definition at line 933 of file ship.h.

#define SIF2_FLASH   (1 << 2)

Definition at line 920 of file ship.h.

#define SIF2_GENERATE_HUD_ICON   (1 << 5)

Definition at line 923 of file ship.h.

#define SIF2_GUN_CONVERGENCE   (1 << 7)

Definition at line 925 of file ship.h.

#define SIF2_INTRINSIC_NO_SHIELDS   (1 << 9)

Definition at line 927 of file ship.h.


Definition at line 956 of file ship.h.

#define SIF2_MODEL_POINT_SHIELDS   (1 << 18)

Definition at line 936 of file ship.h.

#define SIF2_NO_ETS   (1 << 13)

Definition at line 931 of file ship.h.

#define SIF2_NO_LIGHTING   (1 << 14)

Definition at line 932 of file ship.h.

#define SIF2_NO_PAIN_FLASH   (1 << 11)

Definition at line 929 of file ship.h.

#define SIF2_NO_PRIMARY_LINKING   (1 << 10)

Definition at line 928 of file ship.h.

#define SIF2_NO_THRUSTER_GEO_NOISE   (1 << 8)

Definition at line 926 of file ship.h.

#define SIF2_SHOW_SHIP_MODEL   (1 << 3)

Definition at line 921 of file ship.h.


Definition at line 937 of file ship.h.

#define SIF2_SURFACE_SHIELDS   (1 << 4)

Definition at line 922 of file ship.h.

#define SIF_AFTERBURNER   (1 << 5)

Definition at line 879 of file ship.h.


Definition at line 952 of file ship.h.

#define SIF_AWACS   (1 << 29)

Definition at line 910 of file ship.h.

#define SIF_BALLISTIC_PRIMARIES   (1 << 6)

Definition at line 880 of file ship.h.

Definition at line 949 of file ship.h.

#define SIF_BIG_DAMAGE   (1 << 25)

Definition at line 905 of file ship.h.

Definition at line 944 of file ship.h.

#define SIF_BOMBER   (1 << 9)

Definition at line 886 of file ship.h.

#define SIF_CAPITAL   (1 << 12)

Definition at line 889 of file ship.h.

#define SIF_CARGO   (1 << 7)

Definition at line 884 of file ship.h.

#define SIF_CORVETTE   (1 << 27)

Definition at line 908 of file ship.h.

#define SIF_CRUISER   (1 << 10)

Definition at line 887 of file ship.h.

#define SIF_DEFAULT_PLAYER_SHIP   (1 << 2)

Definition at line 876 of file ship.h.


Definition at line 939 of file ship.h.

#define SIF_DRYDOCK   (1 << 23)

Definition at line 902 of file ship.h.

#define SIF_ESCAPEPOD   (1 << 16)

Definition at line 893 of file ship.h.

#define SIF_FIGHTER   (1 << 8)

Definition at line 885 of file ship.h.

#define SIF_FREIGHTER   (1 << 11)

Definition at line 888 of file ship.h.

#define SIF_GAS_MINER   (1 << 28)

Definition at line 909 of file ship.h.


Definition at line 947 of file ship.h.

#define SIF_HAS_AWACS   (1 << 26)

Definition at line 906 of file ship.h.


Definition at line 945 of file ship.h.

#define SIF_IN_TECH_DATABASE   (1 << 19)

Definition at line 897 of file ship.h.

#define SIF_IN_TECH_DATABASE_M   (1 << 20)

Definition at line 898 of file ship.h.

#define SIF_KNOSSOS_DEVICE   (1 << 30)

Definition at line 912 of file ship.h.


Definition at line 955 of file ship.h.

#define SIF_NAVBUOY   (1 << 14)

Definition at line 891 of file ship.h.

#define SIF_NO_COLLIDE   (1 << 0)

Definition at line 874 of file ship.h.

#define SIF_NO_FRED   (1 << 31)

Definition at line 914 of file ship.h.

#define SIF_NO_SHIP_TYPE   (1 << 17)

Definition at line 894 of file ship.h.


Definition at line 946 of file ship.h.

#define SIF_PATH_FIXUP   (1 << 3)

Definition at line 877 of file ship.h.

#define SIF_PLAYER_SHIP   (1 << 1)

Definition at line 875 of file ship.h.

#define SIF_SENTRYGUN   (1 << 15)

Definition at line 892 of file ship.h.


Definition at line 903 of file ship.h.

#define SIF_SHIP_COPY   (1 << 18)

Definition at line 896 of file ship.h.


Definition at line 943 of file ship.h.

#define SIF_STEALTH   (1 << 21)

Definition at line 900 of file ship.h.

#define SIF_SUPERCAP   (1 << 22)

Definition at line 901 of file ship.h.

#define SIF_SUPPORT   (1 << 4)

Definition at line 878 of file ship.h.

#define SIF_TRANSPORT   (1 << 13)

Definition at line 890 of file ship.h.

#define SLT_DEFAULT   1

Definition at line 251 of file ship.h.

#define SLT_NONE   0

Definition at line 250 of file ship.h.

#define SSF_AUTOREPAIR_IF_DISABLED   (1 << 15)

Definition at line 297 of file ship.h.

#define SSF_CARGO_REVEALED   (1 << 0)

Definition at line 279 of file ship.h.

#define SSF_DAMAGE_AS_HULL   (1 << 11)

Definition at line 293 of file ship.h.

#define SSF_FOV_EDGE_CHECK   (1 << 5)

Definition at line 286 of file ship.h.

#define SSF_FOV_REQUIRED   (1 << 4)

Definition at line 285 of file ship.h.

#define SSF_HAS_FIRED   (1 << 3)

Definition at line 284 of file ship.h.

#define SSF_MISSILES_IGNORE_IF_DEAD   (1 << 9)

Definition at line 291 of file ship.h.

#define SSF_NO_AGGREGATE   (1 << 12)

Definition at line 294 of file ship.h.


Definition at line 298 of file ship.h.

#define SSF_NO_DISAPPEAR   ( 1 << 14)

Definition at line 296 of file ship.h.

#define SSF_NO_LIVE_DEBRIS   (1 << 7)

Definition at line 289 of file ship.h.

#define SSF_NO_REPLACE   (1 << 6)

Definition at line 288 of file ship.h.

#define SSF_NO_SS_TARGETING   (1 << 2)

Definition at line 281 of file ship.h.

#define SSF_PLAY_SOUND_FOR_PLAYER   ( 1 << 13)

Definition at line 295 of file ship.h.

#define SSF_ROTATES   (1 << 10)

Definition at line 292 of file ship.h.

#define SSF_UNTARGETABLE   (1 << 1)

Definition at line 280 of file ship.h.

#define SSF_VANISHED   (1 << 8)

Definition at line 290 of file ship.h.

#define SSSF_ALIVE   (1 << 0)

Definition at line 302 of file ship.h.

#define SSSF_DEAD   (1 << 1)

Definition at line 303 of file ship.h.

#define SSSF_ROTATE   (1 << 2)

Definition at line 304 of file ship.h.

#define SSSF_TURRET_ROTATION   (1 << 3)

Definition at line 305 of file ship.h.


Definition at line 1004 of file ship.h.


Definition at line 1006 of file ship.h.

#define STI_AI_AUTO_ATTACKS   (1<<1)

Definition at line 1005 of file ship.h.

#define STI_AI_CAN_FORM_WING   (1<<5)

Definition at line 1009 of file ship.h.

#define STI_AI_GUARDS_ATTACK   (1<<3)

Definition at line 1007 of file ship.h.


Definition at line 1010 of file ship.h.

#define STI_AI_TURRETS_ATTACK   (1<<4)

Definition at line 1008 of file ship.h.

#define STI_HUD_HOTKEY_ON_LIST   (1<<0)

Definition at line 991 of file ship.h.

#define STI_HUD_NO_CLASS_DISPLAY   (1<<3)

Definition at line 994 of file ship.h.


Definition at line 993 of file ship.h.

#define STI_HUD_TARGET_AS_THREAT   (1<<1)

Definition at line 992 of file ship.h.

#define STI_MSG_COUNTS_FOR_ALONE   (1<<0)

Definition at line 988 of file ship.h.


Definition at line 989 of file ship.h.

#define STI_SHIP_SCANNABLE   (1<<0)

Definition at line 996 of file ship.h.

#define STI_SHIP_WARP_PUSHABLE   (1<<2)

Definition at line 998 of file ship.h.

#define STI_SHIP_WARP_PUSHES   (1<<1)

Definition at line 997 of file ship.h.

#define STI_TURRET_TGT_SHIP_TGT   (1<<3)

Definition at line 999 of file ship.h.

#define STI_WEAP_BEAMS_EASILY_HIT   (1<<0)

Definition at line 1001 of file ship.h.

#define STI_WEAP_NO_HUGE_IMPACT_EFF   (1<<1)

Definition at line 1002 of file ship.h.


Definition at line 53 of file ship.h.

#define SW_FLAG_BEAM_FREE   (1<<0)

Definition at line 94 of file ship.h.

#define SW_FLAG_TAGGED_ONLY   (1<<2)

Definition at line 96 of file ship.h.

#define SW_FLAG_TURRET_LOCK   (1<<1)

Definition at line 95 of file ship.h.


Definition at line 75 of file ship.h.


Definition at line 76 of file ship.h.


Definition at line 52 of file ship.h.

#define WF_DEPARTURE_ORDERED   (1<<11)

Definition at line 1512 of file ship.h.

#define WF_EXPANDED   (1<<6)

Definition at line 1507 of file ship.h.

#define WF_IGNORE_COUNT   (1<<2)

Definition at line 1503 of file ship.h.

#define WF_NAV_CARRY   (1<<12)

Definition at line 1513 of file ship.h.

#define WF_NO_ARRIVAL_MESSAGE   (1<<7)

Definition at line 1508 of file ship.h.

#define WF_NO_ARRIVAL_MUSIC   (1<<5)

Definition at line 1506 of file ship.h.

#define WF_NO_ARRIVAL_WARP   (1<<8)

Definition at line 1509 of file ship.h.

#define WF_NO_DEPARTURE_WARP   (1<<9)

Definition at line 1510 of file ship.h.

#define WF_NO_DYNAMIC   (1<<10)

Definition at line 1511 of file ship.h.

#define WF_REINFORCEMENT   (1<<3)

Definition at line 1504 of file ship.h.


Definition at line 1505 of file ship.h.

#define WF_WING_DEPARTING   (1<<1)

Definition at line 1502 of file ship.h.

#define WF_WING_GONE   (1<<0)

Definition at line 1501 of file ship.h.

#define WING_INDEX (   wingp)    (wingp-Wings)

Definition at line 1601 of file ship.h.

#define WT_DEFAULT   0

Definition at line 1106 of file ship.h.


Definition at line 1108 of file ship.h.

#define WT_HYPERSPACE   5

Definition at line 1111 of file ship.h.

#define WT_IN_PLACE_ANIM   3

Definition at line 1109 of file ship.h.

#define WT_KNOSSOS   1

Definition at line 1107 of file ship.h.

#define WT_SWEEPER   4

Definition at line 1110 of file ship.h.

Typedef Documentation

typedef struct exited_ship exited_ship
typedef struct man_thruster man_thruster
typedef struct path_metadata path_metadata
typedef struct ship_counts ship_counts
typedef struct ship_effect ship_effect
typedef struct ship_obj ship_obj
typedef struct ship_spark ship_spark
typedef struct ship_weapon ship_weapon
typedef struct wing wing

Function Documentation

void add_shield_point ( int  objnum,
int  tri_num,
vec3d hit_pos 

Add data for a shield hit.

Definition at line 779 of file shield.cpp.

void add_shield_point_multi ( int  objnum,
int  tri_num,
vec3d hit_pos 

Definition at line 802 of file shield.cpp.

float apply_damage_to_shield ( object objp,
int  quadrant,
float  damage 

Return absolute amount of damage not applied.

This is the version that works on a quadrant basis.

Definition at line 644 of file shield.cpp.

void armor_init ( )

Definition at line 18394 of file ship.cpp.

int armor_type_get_idx ( char *  name)

Definition at line 18332 of file ship.cpp.

int bitmask_2_bitnum ( int  num)

Definition at line 15178 of file ship.cpp.

void change_ship_type ( int  n,
int  ship_type,
int  by_sexp 

Change the ship class on a ship, and changing all required information for consistency (ie textures, subsystems, weapons, physics)

nindex of ship in Ships[] array
ship_typeship class (index into Ship_info vector)
by_sexpSEXP reference

Definition at line 9983 of file ship.cpp.

int check_world_pt_in_expanded_ship_bbox ( vec3d world_pt,
object objp,
float  delta_box 

Checks if a world point is inside the extended bounding box of a ship

May not work if delta box is large and negative (ie, adjusted box crosses over on itself - min > max)

Definition at line 17241 of file ship.cpp.

float compute_shield_strength ( object objp)
void compute_slew_matrix ( matrix orient,
angles a 

Modify the matrix orient by the slew angles a.

Definition at line 6546 of file ship.cpp.

void create_shield_explosion ( int  objnum,
int  model_num,
matrix orient,
vec3d centerp,
vec3d tcp,
int  tr0 

Definition at line 731 of file shield.cpp.

void create_shield_explosion_all ( object objp)

Create all the shield explosions that occurred on object *objp this frame.

Definition at line 838 of file shield.cpp.

int damage_type_add ( char *  name)

Either loads a new damage type, or returns the index of one with the same name as given

Definition at line 17749 of file ship.cpp.

float get_adjusted_turret_rof ( ship_subsys ss)

Definition at line 2884 of file aiturret.cpp.

int get_available_primary_weapons ( object objp,
int outlist,
int outbanklist 

Definition at line 12641 of file ship.cpp.

int get_available_secondary_weapons ( object objp,
int outlist,
int outbanklist 

Stuff list of weapon indices for object *objp in list *outlist.

number of weapons in list.

Definition at line 12667 of file ship.cpp.

int get_default_player_ship_index ( )

Returns the index of the default player ship.

An index into Ship_info[], location of the default player ship.

Definition at line 4862 of file ship.cpp.

int get_max_ammo_count_for_bank ( int  ship_class,
int  bank,
int  ammo_type 

Determine the number of secondary ammo units (missile/bomb) allowed max for a ship

Definition at line 16279 of file ship.cpp.

int get_max_ammo_count_for_primary_bank ( int  ship_class,
int  bank,
int  ammo_type 

Determine the number of primary ammo units allowed max for a ship

Definition at line 16262 of file ship.cpp.

int get_max_ammo_count_for_turret_bank ( ship_weapon swp,
int  bank,
int  ammo_type 

The same as above, but for a specific turret's bank.

Definition at line 16299 of file ship.cpp.

int get_nearest_bbox_point ( object ship_objp,
vec3d start,
vec3d box_pt 

Given a ship with bounding box and a point, find the closest point on the bbox

ship_objObject that has the bounding box (should be a ship)
startWorld position of the point being compared
box_ptOUTPUT PARAMETER: closest point on the bbox to start
point is inside bbox, TRUE/1
point is outside bbox, FALSE/0

Given a ship with bounding box and a point, find the closest point on the bbox

ship_objpObject that has the bounding box (should be a ship)
startWorld position of the point being compared
box_ptOUTPUT PARAMETER: closest point on the bbox to start
point is inside bbox, TRUE/1
point is outside bbox, FALSE/0

Definition at line 18664 of file ship.cpp.

int get_quadrant ( vec3d hit_pnt,
object shipobjp = NULL 

Definition at line 988 of file shield.cpp.

int get_subsystem_pos ( vec3d pos,
object objp,
ship_subsys subsysp 

Definition at line 12975 of file ship.cpp.

ai_target_priority init_ai_target_priorities ( )

Definition at line 18528 of file ship.cpp.

void init_path_metadata ( path_metadata metadata)

Definition at line 18607 of file ship.cpp.

int is_support_allowed ( object objp,
bool  do_simple_check = false 

Definition at line 16749 of file ship.cpp.

int object_in_turret_fov ( object objp,
ship_subsys ss,
vec3d tvec,
vec3d tpos,
float  dist 

Is object in turret field of view?

objpPointer to object to test
ssShip turret subsystem to test from
tvecTurret initial vector
tposTurret initial position
distDistance from turret to center point of object
1 if objp is in fov of the specified turret. Otherwise return 0.

Definition at line 101 of file aiturret.cpp.

void object_jettison_cargo ( object objp,
object cargo_objp 

Forcible jettison cargo from a ship

Definition at line 16911 of file ship.cpp.

void parse_ai_target_priorities ( )

Definition at line 18408 of file ship.cpp.

void parse_ship_particle_effect ( ship_info sip,
particle_effect pe,
char *  id_string 

Definition at line 1884 of file ship.cpp.

int parse_ship_values ( ship_info sip,
const bool  is_template,
const bool  first_time,
const bool  replace 

Puts values into a ship_info.

Definition at line 2148 of file ship.cpp.

void parse_weapon_targeting_priorities ( )

Definition at line 18548 of file ship.cpp.

void physics_ship_init ( object objp)

Definition at line 5366 of file ship.cpp.

int primary_out_of_ammo ( ship_weapon swp,
int  bank 

Definition at line 12291 of file ship.cpp.

void shield_frame_init ( )

Definition at line 173 of file shield.cpp.

void shield_hit_close ( )

De-initialize the shield hit system. Called from game_level_close().

We should probably not bother releasing the shield hit bitmaps every level.

Definition at line 168 of file shield.cpp.

void shield_hit_init ( )

Initialize shield hit system.

Called from game_level_init()

Definition at line 131 of file shield.cpp.

void shield_point_multi_setup ( )

Sets up the shield point hit information for multiplayer clients

Definition at line 817 of file shield.cpp.

void ship_actually_depart ( int  shipnum,
int  method 

Used to actually remove a ship, plus all the ships it's docked to, from the mission

Definition at line 7748 of file ship.cpp.

void ship_add_cockpit_display ( cockpit_display_info display,
int  cockpit_model_num 

Definition at line 7409 of file ship.cpp.

void ship_add_exited_ship ( ship sp,
int  reason 

Add a ship onto the exited ships list.

The reason parameter tells us why the ship left the mission (i.e. departed or destroyed)

Definition at line 5298 of file ship.cpp.

void ship_add_ship_type_count ( int  ship_info_index,
int  num 

Definition at line 14449 of file ship.cpp.

void ship_add_ship_type_kill_count ( int  ship_info_index)

Definition at line 14462 of file ship.cpp.

void ship_assign_sound ( ship sp)

Assign object-linked sound to a particular ship

Definition at line 14191 of file ship.cpp.

void ship_assign_sound_all ( )

Assign object-linked sounds to all ships currently in the obj_used_list

Definition at line 14263 of file ship.cpp.

float ship_calculate_rearm_duration ( object objp)

Calculates approximate time in seconds it would take to rearm and repair object.

Definition at line 13537 of file ship.cpp.

int ship_check_collision_fast ( object obj,
object other_obj,
vec3d hitpos 

Faster version of ship_check_collision that does not do checking at the polygon level. Just checks to see if a vector will intersect a sphere.

Definition at line 9521 of file ship.cpp.

int ship_class_compare ( int  ship_class_1,
int  ship_class_2 

Definition at line 17715 of file ship.cpp.

float ship_class_get_length ( ship_info sip)

Return the length of a ship

Definition at line 17354 of file ship.cpp.

int ship_class_query_general_type ( int  ship_class)

Definition at line 14485 of file ship.cpp.

void ship_cleanup ( int  shipnum,
int  cleanup_mode 

Merge ship_destroyed and ship_departed and ship_vanished

Definition at line 7786 of file ship.cpp.

void ship_clear_cockpit_displays ( )

Definition at line 7385 of file ship.cpp.

void ship_clear_ship_type_counts ( )

Definition at line 14436 of file ship.cpp.

void ship_close ( )

Definition at line 14146 of file ship.cpp.

int ship_create ( matrix orient,
vec3d pos,
int  ship_type,
char *  ship_name 

Returns object index of ship.

-1 means failed.

Definition at line 9690 of file ship.cpp.

void ship_delete ( object objp)

Definition at line 7585 of file ship.cpp.

void ship_destroy_instantly ( object ship_obj,
int  shipnum 

Definition at line 7761 of file ship.cpp.

void ship_do_cap_subsys_cargo_hidden ( ship shipp,
ship_subsys subsys,
int  from_network = 0 

Definition at line 16210 of file ship.cpp.

void ship_do_cap_subsys_cargo_revealed ( ship shipp,
ship_subsys subsys,
int  from_network = 0 

Definition at line 16161 of file ship.cpp.

void ship_do_cargo_hidden ( ship shipp,
int  from_network 

alled when the cargo of a ship is hidden by the sexp.

Need to send stuff to clients in multiplayer game.

Definition at line 16190 of file ship.cpp.

void ship_do_cargo_revealed ( ship shipp,
int  from_network 

Called when the cargo of a ship is revealed.

Happens at two different locations (at least when this function was written), one for the player, and one for AI ships. Need to send stuff to clients in multiplayer game.

Definition at line 16138 of file ship.cpp.

int ship_do_rearm_frame ( object objp,
float  frametime 

Definition at line 13664 of file ship.cpp.

void ship_do_submodel_rotation ( ship shipp,
model_subsystem psub,
ship_subsys pss 

Definition at line 17553 of file ship.cpp.

int ship_docking_valid ( int  docker,
int  dockee 

Returns true

Definition at line 14494 of file ship.cpp.

void ship_draw_shield ( object objp)

Draw the whole shield as a wireframe mesh, not looking at the current integrity.

Definition at line 879 of file shield.cpp.

int ship_dumbfire_threat ( ship sp)

Definition at line 15078 of file ship.cpp.

void ship_end_render_cockpit_display ( int  cockpit_display_num)

Definition at line 7539 of file ship.cpp.

int ship_engine_ok_to_warp ( ship sp)

Definition at line 14783 of file ship.cpp.

int ship_explode_area_calc_damage ( vec3d pos1,
vec3d pos2,
float  inner_rad,
float  outer_rad,
float  max_damage,
float  max_blast,
float damage,
float blast 

Calculates the blast and damage applied to a ship from another ship blowing up.

pos1ship explosion position
pos2other ship position
inner_raddistance from ship center for which full damage is applied
outer_raddistance from ship center for which no damage is applied
max_damagemaximum damage applied
max_blastmaximum impulse applied from blast
damagedamage applied
blastimpulse applied from blast

Definition at line 7895 of file ship.cpp.

bool ship_fighterbays_all_destroyed ( ship shipp)

Definition at line 17494 of file ship.cpp.

int ship_find_exited_ship_by_name ( char *  name)

Attempt to find information about an exited ship based on shipname

Definition at line 5338 of file ship.cpp.

int ship_find_exited_ship_by_signature ( int  signature)

Attempt to find information about an exited ship based on signature

Definition at line 5353 of file ship.cpp.

int ship_find_num_crewpoints ( object objp)

Finds the number of crew points in a ship

Definition at line 13128 of file ship.cpp.

int ship_find_num_turrets ( object objp)

Finds the number of turrets in a ship

Definition at line 13164 of file ship.cpp.

int ship_find_repair_ship ( object requester_obj,
object **  ship_we_found = NULL 

Definition at line 14008 of file ship.cpp.

int ship_fire_primary ( object objp,
int  stream_weapons,
int  force = 0 

Definition at line 10760 of file ship.cpp.

int ship_fire_primary_debug ( object objp)

Fire the debug laser

Definition at line 10386 of file ship.cpp.

int ship_fire_secondary ( object objp,
int  allow_swarm = 0 

Definition at line 11799 of file ship.cpp.

int ship_fire_tertiary ( object objp)
int ship_get_by_signature ( int  signature)

Definition at line 16106 of file ship.cpp.

ship_subsys* ship_get_closest_subsys_in_sight ( ship sp,
int  subsys_type,
vec3d attacker_pos 

Definition at line 14963 of file ship.cpp.

int ship_get_default_orders_accepted ( ship_info sip)

Set the orders allowed for a ship – based on ship type.

This value might get overridden by a value in the mission file.

Definition at line 5480 of file ship.cpp.

float ship_get_exp_damage ( object objp)

Definition at line 16949 of file ship.cpp.

float ship_get_exp_outer_rad ( object ship_objp)

Definition at line 16970 of file ship.cpp.

int ship_get_exp_propagates ( ship sp)

Definition at line 16965 of file ship.cpp.

void ship_get_eye ( vec3d eye_pos,
matrix eye_orient,
object obj,
bool  do_slew = true,
bool  from_origin = false 

Definition at line 13227 of file ship.cpp.

void ship_get_global_turret_gun_info ( object objp,
ship_subsys ssp,
vec3d gpos,
vec3d gvec,
int  use_angles,
vec3d targetp 

Given an object and a turret on that object, return the actual firing point of the gun and its normal.

This uses the current turret angles. We are keeping track of which gun to fire next in the ship specific info for this turret subobject. Use this info to determine which position to fire from next.
objpPointer to object
sspPointer to turret subsystem
gposAbsolute position of gun firing point
gvecVector from *gpos to *targetp
use_anglesUse current angles
targetpPointer to target object

Definition at line 1327 of file aiturret.cpp.

void ship_get_global_turret_info ( object objp,
model_subsystem tp,
vec3d gpos,
vec3d gvec 

Given an object and a turret on that object, return the global position and forward vector of the turret.

objpPointer to object
tpTurrent model system on that object
gpos[Output] Global absolute position of gun firing point
gvec[Output] Global vector
The gun normal is the unrotated gun normal, (the center of the FOV cone), not the actual gun normal given using the current turret heading. But it is rotated into the model's orientation in global space.

Definition at line 1303 of file aiturret.cpp.

int ship_get_index_from_subsys ( ship_subsys ssp,
int  objnum,
int  error_bypass 

Given a pointer to a subsystem and an associated object, return the index.

Definition at line 13390 of file ship.cpp.

ship_subsys* ship_get_indexed_subsys ( ship sp,
int  index,
vec3d attacker_pos = NULL 

Definition at line 13340 of file ship.cpp.

float ship_get_max_speed ( ship shipp)

Get maximum ship speed (when not warping in or out)

Definition at line 17279 of file ship.cpp.

int ship_get_num_ships ( )

Return number of ships in the game.

Definition at line 522 of file ship.cpp.

int ship_get_num_subsys ( ship shipp)

Definition at line 17046 of file ship.cpp.

int ship_get_random_player_wing_ship ( int  flags = SHIP_GET_ANY_SHIP,
float  max_dist = 0.0f,
int  persona_index = -1,
int  get_first = 0,
int  multi_team = -1 

Definition at line 14508 of file ship.cpp.

int ship_get_random_ship_in_wing ( int  wingnum,
int  flags = SHIP_GET_ANY_SHIP,
float  max_dist = 0.0f,
int  get_first = 0 

Definition at line 14623 of file ship.cpp.

int ship_get_random_targetable_ship ( )

Definition at line 16876 of file ship.cpp.

int ship_get_random_team_ship ( int  team_mask,
int  flags = SHIP_GET_ANY_SHIP,
float  max_dist = 0.0f 

Definition at line 14682 of file ship.cpp.

int ship_get_reinforcement_team ( int  r_index)

Get the team of a reinforcement item

Definition at line 17090 of file ship.cpp.

float ship_get_secondary_weapon_range ( ship shipp)

Return the range of the currently selected secondary weapon

NOTE: If there is no missiles left in the current bank, range returned is 0

shippPointer to ship from which currently selected secondary weapon will be ranged

Definition at line 16238 of file ship.cpp.

int ship_get_ship_for_departure ( int  team)

Definition at line 17477 of file ship.cpp.

int ship_get_SIF ( ship shipp)

Definition at line 16096 of file ship.cpp.

int ship_get_SIF ( int  sh)

Definition at line 16101 of file ship.cpp.

int ship_get_sound ( object objp,
GameSoundsIndex  id 

Returns a ship-specific sound index.

objpAn object pointer. Has to be of type OBJ_SHIP
idA sound id as defined in gamsesnd.h. If the given id is unknown then the game_snd with the id as index is returned.
An index into the Snds vector, if the specified index could not be found then the id itself will be returned

Definition at line 18614 of file ship.cpp.

ship_subsys* ship_get_subsys ( ship shipp,
char *  subsys_name 

Definition at line 17024 of file ship.cpp.

int ship_get_subsys_index ( ship sp,
char *  ss_name,
int  error_bypass 

Returns the index number of the ship_subsys parameter

Definition at line 13421 of file ship.cpp.

float ship_get_subsystem_strength ( ship shipp,
int  type 

Definition at line 13446 of file ship.cpp.

int ship_get_texture ( int  bitmap)

Determine if the given texture is used by a ship type. return ship info index, or -1 if not used by a ship

Definition at line 17125 of file ship.cpp.

int ship_get_turret_type ( ship_subsys subsys)

Determine turret status of a given subsystem

0 for no turret, 1 for "fixed turret", 2 for "rotating" turret

Definition at line 17008 of file ship.cpp.

int ship_get_type ( char *  output,
ship_info sip 

Get the type of the given ship as a string

Definition at line 5464 of file ship.cpp.

ship_type_info* ship_get_type_info ( object objp)

Definition at line 16121 of file ship.cpp.

float ship_get_warpout_speed ( object objp)

Determine warpout speed of ship

Definition at line 17306 of file ship.cpp.

bool ship_has_dock_bay ( int  shipnum)

Definition at line 17435 of file ship.cpp.

int ship_has_energy_weapons ( ship shipp)

Definition at line 17611 of file ship.cpp.

int ship_has_engine_power ( ship shipp)

Definition at line 17618 of file ship.cpp.

bool ship_has_sound ( object objp,
GameSoundsIndex  id 

Specifies if a ship has a custom sound for the specified id.

objpAn object pointer. Has to be of type OBJ_SHIP
idA sound id as defined in gamsesnd.h
True if this object has the specified sound, false otherwise

Definition at line 18636 of file ship.cpp.

int ship_info_lookup ( const char *  name = NULL)

Definition at line 12772 of file ship.cpp.

void ship_init ( )

Called once at the beginning of the game to parse ships.tbl and stuff the Ship_info vector

Definition at line 5086 of file ship.cpp.

void ship_init_cockpit_displays ( ship shipp)

Definition at line 7349 of file ship.cpp.

int ship_is_beginning_warpout_speedup ( object objp)

Returns true if ship is beginning to speed up in warpout

Definition at line 17334 of file ship.cpp.

int ship_is_shield_up ( object obj,
int  quadrant 

Returns true if the shield presents any opposition to something trying to force through it.

If quadrant is -1, looks at entire shield, otherwise just one quadrant

Definition at line 964 of file shield.cpp.

int ship_is_tagged ( object objp)

Returns true when objp is ship and is tagged

Definition at line 17263 of file ship.cpp.

int ship_launch_countermeasure ( object objp,
int  rand_val 

Launch countermeasures from object *objp.

objpobject from which to launch countermeasure
rand_valis used in multiplayer to ensure that all clients in the game fire countermeasure the same way

Definition at line 10421 of file ship.cpp.

void ship_level_init ( )

This will get called at the start of each level.

Definition at line 5226 of file ship.cpp.

int ship_lock_threat ( ship sp)

Definition at line 15163 of file ship.cpp.

void ship_maybe_ask_for_help ( ship sp)

Definition at line 15668 of file ship.cpp.

void ship_maybe_lament ( )

The player has just entered death roll, maybe have wingman mourn the loss of the player

Definition at line 15738 of file ship.cpp.

void ship_maybe_praise_player ( ship deader_sp)

Definition at line 15532 of file ship.cpp.

void ship_maybe_praise_self ( ship deader_sp,
ship killer_sp 

Definition at line 15572 of file ship.cpp.

void ship_maybe_scream ( ship sp)

Ship has just died, maybe play a scream.

Definition at line 15789 of file ship.cpp.

void ship_maybe_tell_about_low_ammo ( ship sp)

This function is only for notifying the player that the ship's ammo is low, without necessarily requesting support (e.g. if support is disallowed for this mission). It is not called if support was successfully requested in maybe_request_support.

Definition at line 15837 of file ship.cpp.

void ship_maybe_tell_about_rearm ( ship sp)

Tell player that we've requested a support ship

Definition at line 15913 of file ship.cpp.

void ship_maybe_warn_player ( ship enemy_sp,
float  dist 

Definition at line 15457 of file ship.cpp.

void ship_model_change ( int  n,
int  ship_type 

Change the ship model for a ship to that for ship class 'ship_type'

nindex of ship in Ships[] array
ship_typeship class (index into Ship_info vector)

Definition at line 9888 of file ship.cpp.

void ship_model_start ( object objp)

Definition at line 13012 of file ship.cpp.

void ship_model_stop ( object objp)

Clears all the instance specific stuff out of the model info

Definition at line 13059 of file ship.cpp.

void ship_model_update_instance ( object objp)

Like ship_model_start but fills submodel instances instead of the submodels themselves

Definition at line 13072 of file ship.cpp.

int ship_name_lookup ( const char *  name,
int  inc_players 

Return the ship index of the ship with name *name.

Definition at line 12900 of file ship.cpp.

int ship_navigation_ok_to_warp ( ship sp)

Definition at line 14809 of file ship.cpp.

void ship_obj_list_rebuild ( )

Called from the save/restore code to re-create the Ship_obj_list

Definition at line 500 of file ship.cpp.

void ship_page_in ( )

Page in bitmaps for all the ships in this level

Definition at line 16318 of file ship.cpp.

void ship_page_in_textures ( int  ship_index = -1)

Definition at line 16635 of file ship.cpp.

void ship_page_out_textures ( int  ship_index,
bool  release 

Unload all textures for a given ship

Definition at line 16711 of file ship.cpp.

int ship_primary_bank_has_ammo ( int  shipnum)

Definition at line 14764 of file ship.cpp.

void ship_primary_changed ( ship sp)

Definition at line 15996 of file ship.cpp.

void ship_process_post ( object obj,
float  frametime 

Player ship uses this code, but does a quick out after doing a few things.

When adding code to this function, decide whether or not a client in a multiplayer game needs to execute the code you are adding. Code which moves things, creates things, etc probably doesn't need to be called. If you don't know – find Allender!!!

Definition at line 9180 of file ship.cpp.

void ship_process_pre ( object objp,
float  frametime 

Definition at line 9128 of file ship.cpp.

void ship_process_targeting_lasers ( )

Definition at line 11611 of file ship.cpp.

float ship_quadrant_shield_strength ( object hit_objp,
vec3d hitpos 

Definition at line 15030 of file ship.cpp.

int ship_query_general_type ( int  ship)

Definition at line 14475 of file ship.cpp.

int ship_query_general_type ( ship shipp)

Definition at line 14480 of file ship.cpp.

int ship_query_state ( char *  name)

Definition at line 12945 of file ship.cpp.

void ship_recalc_subsys_strength ( ship shipp)

Recalculates the overall strength of subsystems.

Needed because several places in FreeSpace change subsystem strength and all this data needs to be kept up to date.

Definition at line 6020 of file ship.cpp.

void ship_render ( object obj,
draw_list scene 

Definition at line 19003 of file ship.cpp.

void ship_render_cockpit ( object objp)

Definition at line 7272 of file ship.cpp.

void ship_render_DEPRECATED ( object objp)

Definition at line 6733 of file ship.cpp.

void ship_render_show_ship_cockpit ( object objp)

Definition at line 7322 of file ship.cpp.

ship_subsys* ship_return_next_subsys ( ship shipp,
int  type,
vec3d attacker_pos 

Find a subsystem matching 'type' inside the ship, and that is not destroyed.

If cannot find one, return NULL.

Definition at line 14945 of file ship.cpp.

char* ship_return_orders ( char *  outbuf,
ship sp 

Definition at line 15201 of file ship.cpp.

int ship_return_subsys_path_normal ( ship sp,
ship_subsys ss,
vec3d gsubpos,
vec3d norm 

Definition at line 14837 of file ship.cpp.

char* ship_return_time_to_goal ( char *  outbuf,
ship sp 

Definition at line 15294 of file ship.cpp.

void ship_scream ( ship sp)

Play a death scream for a ship

Definition at line 15757 of file ship.cpp.

int ship_secondary_bank_has_ammo ( int  shipnum)

Definition at line 14741 of file ship.cpp.

void ship_secondary_changed ( ship sp)

Definition at line 16053 of file ship.cpp.

int ship_select_next_primary ( object objp,
int  direction 

Return true if a new index gets selected.

objppointer to object for ship cycling primary
directionforward == CYCLE_PRIMARY_NEXT, backward == CYCLE_PRIMARY_PREV

NOTE: This code can be called for any arbitrary ship. HUD messages and sounds are only used for the player ship.

Definition at line 12317 of file ship.cpp.

int ship_select_next_secondary ( object objp)

Definition at line 12550 of file ship.cpp.

void ship_set_default_weapons ( ship shipp,
ship_info sip 

Set the ship level weapons based on the information contained in the ship info.

Weapon assignments are checked against the model to ensure the models and the ship info weapon data are in synch.

Definition at line 9392 of file ship.cpp.

void ship_set_eye ( object obj,
int  eye_index 

Definition at line 13197 of file ship.cpp.

void ship_set_hud_cockpit_targets ( )

Definition at line 7479 of file ship.cpp.

void ship_set_new_ai_class ( int  ship_num,
int  new_ai_class 

Definition at line 17362 of file ship.cpp.

int ship_squadron_wing_lookup ( const char *  wing_name)

Definition at line 17636 of file ship.cpp.

int ship_start_render_cockpit_display ( int  cockpit_display_num)

Definition at line 7494 of file ship.cpp.

void ship_start_targeting_laser ( ship shipp)

Definition at line 11568 of file ship.cpp.

int ship_starting_wing_lookup ( const char *  wing_name)

Definition at line 17624 of file ship.cpp.

int ship_stop_fire_primary ( object obj)

Stuff to do when the ship has stoped fireing all primary weapons

Definition at line 10711 of file ship.cpp.

void ship_stop_targeting_laser ( ship shipp)

Definition at line 11605 of file ship.cpp.

int ship_subsys_disrupted ( ship_subsys ss)

Determine if a given subsystem is disrupted (ie inoperable)

sspointer to ship subsystem
1 if subsystem is disrupted, 0 if subsystem is not disrupted

Definition at line 9033 of file ship.cpp.

int ship_subsys_disrupted ( ship sp,
int  type 

Determine if a given type of subsystem is disrupted (i.e. inoperable)

sppointer to ship containing subsystem
typetype of subsystem (SUBSYSTEM_*)
1 if subsystem is disrupted, 0 if subsystem is not disrupted

Definition at line 9077 of file ship.cpp.

char* ship_subsys_get_name ( ship_subsys ss)

Definition at line 15001 of file ship.cpp.

bool ship_subsys_has_instance_name ( ship_subsys ss)

Definition at line 15009 of file ship.cpp.

bool ship_subsys_is_fighterbay ( ship_subsys ss)

Definition at line 17533 of file ship.cpp.

void ship_subsys_set_disrupted ( ship_subsys ss,
int  time 

Disrupt a subsystem (ie make it inoperable for a time)

sspointer to ship subsystem to be disrupted
timetime in ms that subsystem should be disrupted

Definition at line 9053 of file ship.cpp.

void ship_subsys_set_name ( ship_subsys ss,
char *  n_name 

Definition at line 15017 of file ship.cpp.

bool ship_subsys_takes_damage ( ship_subsys ss)

Definition at line 17545 of file ship.cpp.

void ship_subsystem_delete ( ship shipp)
int ship_subsystem_in_sight ( object objp,
ship_subsys subsys,
vec3d eye_pos,
vec3d subsys_pos,
int  do_facing_check = 1,
float dot_out = NULL,
vec3d vec_out = NULL 

Definition at line 14881 of file ship.cpp.

void ship_subsystem_set_new_ai_class ( int  ship_num,
char *  subsystem,
int  new_ai_class 

Definition at line 17380 of file ship.cpp.

int ship_template_lookup ( const char *  token)

Return the index of Ship_templates[].name that is *token.

Definition at line 12761 of file ship.cpp.

int ship_tvt_wing_lookup ( const char *  wing_name)

Definition at line 17660 of file ship.cpp.

int ship_type_name_lookup ( const char *  name)

Definition at line 12923 of file ship.cpp.

void ship_update_artillery_lock ( )

Definition at line 17146 of file ship.cpp.

bool ship_useful_for_departure ( int  shipnum,
int  path_mask = 0 

Definition at line 17448 of file ship.cpp.

void ship_wing_cleanup ( int  shipnum,
wing wingp 

Used by ship_cleanup which is called if the ship is in a wing.

This function updates the ship_index list (i.e. removes its entry in the list) and packs the array accordingly.

Definition at line 7640 of file ship.cpp.

int subsys_set ( int  objnum,
int  ignore_subsys_info 

Set subsystem

objnumObject number (used as index into Objects[])
ignore_subsys_infoDefault parameter with value of 0. This is only set to 1 by the save/restore code

Definition at line 6253 of file ship.cpp.

int thruster_glow_anim_load ( generic_anim ga)

Definition at line 8506 of file ship.cpp.

bool turret_adv_fov_test ( ship_subsys ss,
vec3d gvec,
vec3d v2e,
float  size_mod = 0 

Definition at line 2851 of file aiturret.cpp.

bool turret_fov_test ( ship_subsys ss,
vec3d gvec,
vec3d v2e,
float  size_mod = 0 

Definition at line 2873 of file aiturret.cpp.

bool turret_std_fov_test ( ship_subsys ss,
vec3d gvec,
vec3d v2e,
float  size_mod = 0 

Definition at line 2841 of file aiturret.cpp.

int valid_cap_subsys_cargo_list ( char *  subsys_name)

Definition at line 16984 of file ship.cpp.

int warptype_match ( char *  p)

Definition at line 629 of file ship.cpp.

void wing_bash_ship_name ( char *  ship_name,
const char *  wing_name,
int  index 

Definition at line 12686 of file ship.cpp.

int wing_has_conflicting_teams ( int  wing_index)

Definition at line 17054 of file ship.cpp.

void wing_load_squad_bitmap ( wing w)

Definition at line 17406 of file ship.cpp.

int wing_lookup ( const char *  name)

Needed in addition to wing_name_lookup because it does a straight lookup without caring about how many ships are in the wing, etc.

Definition at line 12736 of file ship.cpp.

int wing_name_lookup ( const char *  name,
int  ignore_count 

Return the object index of the ship with name *name.

Definition at line 12706 of file ship.cpp.

Variable Documentation

int ai_paused

Definition at line 677 of file object.cpp.

int Ai_render_debug_flag

Definition at line 113 of file ship.cpp.

Definition at line 396 of file ship.cpp.

SCP_vector<ArmorType> Armor_types

Definition at line 170 of file ship.cpp.


Called in game_shutdown() to free malloced memory

NOTE: do not call this function. It is only called from game_shutdown()

Definition at line 14145 of file ship.cpp.

Definition at line 171 of file ship.cpp.

SCP_vector<engine_wash_info> Engine_wash_info

Definition at line 143 of file ship.cpp.

Definition at line 6661 of file ship.cpp.

int Num_reinforcements

Definition at line 121 of file ship.cpp.

int Num_wings

Definition at line 120 of file ship.cpp.

vec3d Original_vec_to_deader

Definition at line 68 of file shiphit.cpp.

int* Player_cockpit_textures

Definition at line 125 of file ship.cpp.

SCP_vector<cockpit_display> Player_displays

Definition at line 126 of file ship.cpp.

ship* Player_ship

Definition at line 124 of file ship.cpp.

int Player_ship_class

Definition at line 157 of file ship.cpp.

Definition at line 165 of file ship.cpp.

int Ship_auto_repair

Definition at line 116 of file ship.cpp.

SCP_vector<ship_effect> Ship_effects

Definition at line 412 of file ship.cpp.

ship_flag_name Ship_flag_names[]

Definition at line 372 of file ship.cpp.

SCP_vector<ship_info> Ship_info

Definition at line 164 of file ship.cpp.

ship_obj Ship_obj_list

Definition at line 162 of file ship.cpp.

SCP_vector<ship_counts> Ship_type_counts

Definition at line 401 of file ship.cpp.

Definition at line 168 of file ship.cpp.

ship Ships[MAX_SHIPS]

Definition at line 122 of file ship.cpp.

SCP_vector<exited_ship> Ships_exited

Definition at line 152 of file ship.cpp.

int Show_shield_mesh

Definition at line 27 of file shield.cpp.

char Squadron_wing_names[MAX_SQUADRON_WINGS][NAME_LENGTH]

Definition at line 140 of file ship.cpp.

int Squadron_wings[MAX_SQUADRON_WINGS]

Definition at line 135 of file ship.cpp.

char Starting_wing_names[MAX_STARTING_WINGS][NAME_LENGTH]

Definition at line 139 of file ship.cpp.

int Starting_wings[MAX_STARTING_WINGS]

Definition at line 132 of file ship.cpp.


Definition at line 49 of file hudtarget.cpp.

char* Turret_target_order_names[NUM_TURRET_ORDER_TYPES]

Definition at line 50 of file aiturret.cpp.


Definition at line 141 of file ship.cpp.

int TVT_wings[MAX_TVT_WINGS]

Definition at line 136 of file ship.cpp.

wing Wings[MAX_WINGS]

Definition at line 128 of file ship.cpp.