Open source remastering of the Freespace 2 engine
shiphit.cpp File Reference
#include <algorithm>
#include "asteroid/asteroid.h"
#include "debris/debris.h"
#include "fireball/fireballs.h"
#include "freespace2/freespace.h"
#include "gamesequence/gamesequence.h"
#include "gamesnd/eventmusic.h"
#include "gamesnd/gamesnd.h"
#include "globalincs/linklist.h"
#include "hud/hud.h"
#include "hud/hudmessage.h"
#include "hud/hudtarget.h"
#include "iff_defs/iff_defs.h"
#include "io/joy_ff.h"
#include "io/timer.h"
#include "mission/missionlog.h"
#include "mod_table/mod_table.h"
#include "network/multi.h"
#include "network/multi_pmsg.h"
#include "network/multi_respawn.h"
#include "network/multimsgs.h"
#include "network/multiutil.h"
#include "object/object.h"
#include "object/objectdock.h"
#include "object/objectsnd.h"
#include "parse/parselo.h"
#include "parse/scripting.h"
#include "playerman/player.h"
#include "popup/popup.h"
#include "render/3d.h"
#include "ship/ship.h"
#include "ship/shipfx.h"
#include "ship/shiphit.h"
#include "weapon/beam.h"
#include "weapon/emp.h"
#include "weapon/shockwave.h"
#include "weapon/weapon.h"

Go to the source code of this file.


struct  spark_pair
struct  sublist


#define BIG_SHIP_MIN_RADIUS   80.0f
#define MAX_DEBRIS_SHARDS   16
#define MAX_SUBSYS_LIST   200


typedef struct spark_pair spark_pair


void ssm_create (object *target, vec3d *start, size_t ssm_index, ssm_firing_info *override, int team)
bool is_subsys_destroyed (ship *shipp, int submodel)
void do_subobj_destroyed_stuff (ship *ship_p, ship_subsys *subsys, vec3d *hitpos, bool no_explosion)
int shiphit_get_damage_weapon (object *damaging_objp)
float subsys_get_range (object *other_obj, ship_subsys *subsys)
void create_subsys_debris (object *ship_objp, vec3d *hitpos)
void create_vaporize_debris (object *ship_objp, vec3d *hitpos)
float do_subobj_hit_stuff (object *ship_objp, object *other_obj, vec3d *hitpos, int submodel_num, float damage, bool *hull_should_apply_armor)
void shiphit_record_player_killer (object *killer_objp, player *p)
void show_dead_message (object *ship_objp, object *other_obj)
void ship_hit_music (object *ship_objp, object *other_obj)
void ship_hit_sparks_no_rotate (object *ship_objp, vec3d *hitpos)
int get_max_sparks (object *ship_objp)
int spark_compare (const spark_pair &pair1, const spark_pair &pair2)
int choose_next_spark (object *ship_objp, vec3d *hitpos)
void ship_hit_create_sparks (object *ship_objp, vec3d *hitpos, int submodel_num)
void player_died_start (object *killer_objp)
void saturate_fabs (float *f, float max)
void ship_generic_kill_stuff (object *objp, float percent_killed)
void ship_vaporize (ship *shipp)
void ship_hit_kill (object *ship_objp, object *other_obj, float percent_killed, int self_destruct)
void ship_self_destruct (object *objp)
void ship_apply_whack (vec3d *force, vec3d *hit_pos, object *objp)
void shiphit_hit_after_death (object *ship_objp, float damage)
int maybe_shockwave_damage_adjust (object *ship_objp, object *other_obj, float *damage)
void ai_update_lethality (object *ship_objp, object *weapon_obj, float damage)
void ship_apply_tag (int ship_num, int tag_level, float tag_time, object *target, vec3d *start, int ssm_index, int ssm_team)
void ship_apply_local_damage (object *ship_objp, object *other_obj, vec3d *hitpos, float damage, int quadrant, bool create_spark, int submodel_num, vec3d *hit_normal)
void ship_apply_global_damage (object *ship_objp, object *other_obj, vec3d *force_center, float damage)
void ship_apply_wash_damage (object *ship_objp, object *other_obj, float damage)
void ship_hit_pain (float damage, int quadrant)


vec3d Dead_camera_pos
vec3d Original_vec_to_deader
int Homing_hits
int Homing_misses
int Cmdline_nohtl

Macro Definition Documentation

#define BIG_SHIP_MIN_RADIUS   80.0f

Definition at line 65 of file shiphit.cpp.


Definition at line 1356 of file shiphit.cpp.


Definition at line 1354 of file shiphit.cpp.


Definition at line 1355 of file shiphit.cpp.


Definition at line 1358 of file shiphit.cpp.


Definition at line 1357 of file shiphit.cpp.

#define MAX_DEBRIS_SHARDS   16

Definition at line 365 of file shiphit.cpp.


Definition at line 63 of file shiphit.cpp.

#define MAX_SUBSYS_LIST   200

Definition at line 405 of file shiphit.cpp.


Definition at line 1353 of file shiphit.cpp.

Typedef Documentation

typedef struct spark_pair spark_pair

Function Documentation

void ai_update_lethality ( object ship_objp,
object weapon_obj,
float  damage 

Definition at line 14881 of file aicode.cpp.

int choose_next_spark ( object ship_objp,
vec3d hitpos 

Definition at line 1100 of file shiphit.cpp.

void create_subsys_debris ( object ship_objp,
vec3d hitpos 

Definition at line 369 of file shiphit.cpp.

void create_vaporize_debris ( object ship_objp,
vec3d hitpos 

Definition at line 388 of file shiphit.cpp.

void do_subobj_destroyed_stuff ( ship ship_p,
ship_subsys subsys,
vec3d hitpos,
bool  no_explosion 

Definition at line 108 of file shiphit.cpp.

float do_subobj_hit_stuff ( object ship_objp,
object other_obj,
vec3d hitpos,
int  submodel_num,
float  damage,
bool *  hull_should_apply_armor 

Definition at line 447 of file shiphit.cpp.

int get_max_sparks ( object ship_objp)

Definition at line 1054 of file shiphit.cpp.

bool is_subsys_destroyed ( ship shipp,
int  submodel 

Definition at line 84 of file shiphit.cpp.

int maybe_shockwave_damage_adjust ( object ship_objp,
object other_obj,
float damage 

Definition at line 1840 of file shiphit.cpp.

void player_died_start ( object killer_objp)

Definition at line 1268 of file shiphit.cpp.

void saturate_fabs ( float f,
float  max 

Definition at line 1360 of file shiphit.cpp.

void ship_apply_global_damage ( object ship_objp,
object other_obj,
vec3d force_center,
float  damage 

Definition at line 2476 of file shiphit.cpp.

void ship_apply_local_damage ( object ship_objp,
object other_obj,
vec3d hitpos,
float  damage,
int  quadrant,
bool  create_spark,
int  submodel_num,
vec3d hit_normal 

Definition at line 2359 of file shiphit.cpp.

void ship_apply_tag ( int  ship_num,
int  tag_level,
float  tag_time,
object target,
vec3d start,
int  ssm_index,
int  ssm_team 

Definition at line 2324 of file shiphit.cpp.

void ship_apply_wash_damage ( object ship_objp,
object other_obj,
float  damage 

Definition at line 2532 of file shiphit.cpp.

void ship_apply_whack ( vec3d force,
vec3d hit_pos,
object objp 

Definition at line 1740 of file shiphit.cpp.

void ship_generic_kill_stuff ( object objp,
float  percent_killed 

Definition at line 1371 of file shiphit.cpp.

void ship_hit_create_sparks ( object ship_objp,
vec3d hitpos,
int  submodel_num 

Definition at line 1194 of file shiphit.cpp.

void ship_hit_kill ( object ship_objp,
object other_obj,
float  percent_killed,
int  self_destruct 

Definition at line 1542 of file shiphit.cpp.

void ship_hit_music ( object ship_objp,
object other_obj 

Definition at line 975 of file shiphit.cpp.

void ship_hit_pain ( float  damage,
int  quadrant 

Definition at line 2562 of file shiphit.cpp.

void ship_hit_sparks_no_rotate ( object ship_objp,
vec3d hitpos 

Definition at line 1030 of file shiphit.cpp.

void ship_self_destruct ( object objp)

Definition at line 1697 of file shiphit.cpp.

void ship_vaporize ( ship shipp)

Definition at line 1522 of file shiphit.cpp.

int shiphit_get_damage_weapon ( object damaging_objp)

Definition at line 320 of file shiphit.cpp.

void shiphit_hit_after_death ( object ship_objp,
float  damage 

Definition at line 1787 of file shiphit.cpp.

void shiphit_record_player_killer ( object killer_objp,
player p 

Definition at line 780 of file shiphit.cpp.

void show_dead_message ( object ship_objp,
object other_obj 

Definition at line 912 of file shiphit.cpp.

int spark_compare ( const spark_pair pair1,
const spark_pair pair2 

Definition at line 1091 of file shiphit.cpp.

void ssm_create ( object target,
vec3d start,
size_t  ssm_index,
ssm_firing_info override,
int  team 

Definition at line 251 of file hudartillery.cpp.

float subsys_get_range ( object other_obj,
ship_subsys subsys 

Definition at line 348 of file shiphit.cpp.

Variable Documentation

int Cmdline_nohtl

Definition at line 438 of file cmdline.cpp.

vec3d Dead_camera_pos

Definition at line 67 of file shiphit.cpp.

int Homing_hits

Definition at line 4709 of file weapons.cpp.

int Homing_misses

Definition at line 4709 of file weapons.cpp.

vec3d Original_vec_to_deader

Definition at line 68 of file shiphit.cpp.