FS2_Open
Open source remastering of the Freespace 2 engine
|
#include "globalincs/globals.h"
#include "globalincs/systemvars.h"
#include "graphics/2d.h"
#include "graphics/generic.h"
#include "model/model.h"
#include "weapon/shockwave.h"
#include "weapon/trails.h"
Go to the source code of this file.
Classes | |
struct | weapon |
struct | beam_weapon_section_info |
struct | beam_weapon_info |
struct | particle_spew_info |
struct | spawn_weapon_info |
struct | weapon_info |
struct | missile_obj |
struct | weapon_expl_lod |
struct | weapon_expl_info |
class | weapon_explosions |
Typedefs | |
typedef struct weapon | weapon |
typedef struct beam_weapon_section_info | beam_weapon_section_info |
typedef struct beam_weapon_info | beam_weapon_info |
typedef struct particle_spew_info | particle_spew_info |
typedef struct spawn_weapon_info | spawn_weapon_info |
typedef struct weapon_info | weapon_info |
typedef struct missile_obj | missile_obj |
typedef struct weapon_expl_lod | weapon_expl_lod |
typedef struct weapon_expl_info | weapon_expl_info |
Enumerations | |
enum | InFlightSoundType { TARGETED, UNTARGETED, ALWAYS } |
#define WEAPON_INFO_INDEX | ( | wip | ) | (wip-Weapon_info) |
#define WIF_HOMING (WIF_HOMING_HEAT | WIF_HOMING_ASPECT | WIF_HOMING_JAVELIN) |
#define WIF_HURTS_BIG_SHIPS (WIF_BOMB | WIF_BEAM | WIF_HUGE | WIF_BIG_ONLY) |
#define WIF_LOCKED_HOMING (WIF_HOMING_ASPECT | WIF_HOMING_JAVELIN) |
typedef struct beam_weapon_info beam_weapon_info |
typedef struct beam_weapon_section_info beam_weapon_section_info |
typedef struct missile_obj missile_obj |
typedef struct particle_spew_info particle_spew_info |
typedef struct spawn_weapon_info spawn_weapon_info |
typedef struct weapon_expl_info weapon_expl_info |
typedef struct weapon_expl_lod weapon_expl_lod |
typedef struct weapon_info weapon_info |
enum InFlightSoundType |
int cmeasure_name_lookup | ( | char * | name | ) |
void find_homing_object_cmeasures | ( | ) |
Someone launched countermeasures. For all heat-seeking homing objects, see if should favor tracking a countermeasure instead.
Definition at line 4170 of file weapons.cpp.
void missile_obj_list_rebuild | ( | ) |
Called by the save/restore code to rebuild Missile_obj_list
Definition at line 441 of file weapons.cpp.
missile_obj* missile_obj_return_address | ( | int | index | ) |
Called externally to generate an address from an index into the Missile_objs[] array
Definition at line 458 of file weapons.cpp.
Definition at line 7263 of file weapons.cpp.
Figure out which thruster bitmap will get rendered next time around.
ship_render needs to have shipp->thruster_bitmap set to a valid bitmap number, or -1 if we shouldn't render thrusters.
This does basically the same thing as ship_do_thruster_frame, except it operates on a weapon. This is in the ship code because it needs the same thruster animation info as the ship stuff, and I would rather extern this one function than all the thruster animation stuff.
Spawn child weapons from object *objp.
Definition at line 5676 of file weapons.cpp.
void validate_SSM_entries | ( | ) |
Definition at line 7461 of file weapons.cpp.
void weapon_area_apply_blast | ( | vec3d * | force_apply_pos, |
object * | ship_objp, | ||
vec3d * | blast_pos, | ||
float | blast, | ||
int | make_shockwave | ||
) |
Apply the blast effects of an explosion to a ship
force_apply_pos | World pos of where force is applied to object |
ship_objp | Object pointer of ship receiving the blast |
blast_pos | World pos of blast center |
blast | Force of blast |
make_shockwave | Boolean, whether to create a shockwave or not |
Definition at line 6080 of file weapons.cpp.
int weapon_area_calc_damage | ( | object * | objp, |
vec3d * | pos, | ||
float | inner_rad, | ||
float | outer_rad, | ||
float | max_blast, | ||
float | max_damage, | ||
float * | blast, | ||
float * | damage, | ||
float | limit | ||
) |
Calculate the damage for an object based on the location of an area-effect explosion.
objp | Object pointer ship receiving blast effect |
pos | World pos of blast center |
inner_rad | Smallest radius at which full damage is done |
outer_rad | Radius at which no damage is done |
max_blast | Maximum blast possible from explosion |
max_damage | Maximum damage possible from explosion |
blast | OUTPUT PARAMETER: receives blast value from explosion |
damage | OUTPUT PARAMETER: receives damage value from explosion |
limit | A limit on the area, needed for shockwave damage |
Definition at line 6025 of file weapons.cpp.
bool weapon_armed | ( | weapon * | wp, |
bool | hit_target | ||
) |
Definition at line 6208 of file weapons.cpp.
void weapon_close | ( | ) |
Call from game_shutdown() only!!
Definition at line 3545 of file weapons.cpp.
int weapon_create | ( | vec3d * | pos, |
matrix * | orient, | ||
int | weapon_type, | ||
int | parent_obj, | ||
int | group_id = -1 , |
||
int | is_locked = 0 , |
||
int | is_spawned = 0 , |
||
float | fof_cooldown = 0.0f , |
||
ship_subsys * | src_turret = NULL |
||
) |
Definition at line 5246 of file weapons.cpp.
int weapon_create_group_id | ( | ) |
Definition at line 6481 of file weapons.cpp.
Definition at line 3822 of file weapons.cpp.
Definition at line 6450 of file weapons.cpp.
Distrupt any subsystems that fall into damage sphere of this Electronics missile
ship_objp | Pointer to ship that holds subsystem |
blast_pos | World pos of weapon blast |
wi_index | Weapon info index of weapon causing blast |
Definition at line 5934 of file weapons.cpp.
float weapon_get_damage_scale | ( | weapon_info * | wip, |
object * | wep, | ||
object * | target | ||
) |
Return a scale factor for damage which should be applied for 2 collisions
Definition at line 7137 of file weapons.cpp.
Get the "color" of the laser at the given moment (since glowing lasers can cycle colors)
Definition at line 6707 of file weapons.cpp.
Called when a weapon hits something (or, in the case of missiles explodes for any particular reason)
Definition at line 6253 of file weapons.cpp.
void weapon_hit_do_sound | ( | object * | hit_obj, |
weapon_info * | wip, | ||
vec3d * | hitpos, | ||
bool | is_armed | ||
) |
Play a sound effect when a weapon hits a ship
To elimate the "stereo" effect of two lasers hitting at nearly the same time, and to reduce the number of sound channels used, only play one impact sound if IMPACT_SOUND_DELTA has elapsed
Definition at line 5834 of file weapons.cpp.
int weapon_info_lookup | ( | const char * | name | ) |
Return the index of Weapon_info[].name that is *name.
Definition at line 467 of file weapons.cpp.
void weapon_init | ( | ) |
This will get called once at game startup
Definition at line 3516 of file weapons.cpp.
void weapon_level_init | ( | ) |
This will get called at the start of each level.
Definition at line 3582 of file weapons.cpp.
Call before weapons_page_in to mark a weapon as used
Definition at line 6497 of file weapons.cpp.
For weapons flagged as particle spewers, spew particles. wheee
Definition at line 6767 of file weapons.cpp.
void weapon_pause_sounds | ( | ) |
Definition at line 7248 of file weapons.cpp.
Definition at line 4775 of file weapons.cpp.
Definition at line 4667 of file weapons.cpp.
Definition at line 7268 of file weapons.cpp.
Definition at line 3625 of file weapons.cpp.
void weapon_set_tracking_info | ( | int | weapon_objnum, |
int | parent_objnum, | ||
int | target_objnum, | ||
int | target_is_locked, | ||
ship_subsys * | target_subsys | ||
) |
Update weapon tracking information.
Definition at line 5093 of file weapons.cpp.
void weapon_unpause_sounds | ( | ) |
Definition at line 7257 of file weapons.cpp.
int Default_cmeasure_index |
Definition at line 117 of file weapons.cpp.
int First_secondary_index |
Definition at line 116 of file weapons.cpp.
missile_obj Missile_obj_list |
Definition at line 84 of file weapons.cpp.
int Num_player_weapon_precedence |
Definition at line 124 of file weapons.cpp.
int Num_weapon_subtypes |
Definition at line 92 of file weapons.cpp.
int Num_weapon_types |
Definition at line 105 of file weapons.cpp.
int Num_weapons |
Definition at line 107 of file weapons.cpp.
int Player_weapon_precedence[MAX_WEAPON_TYPES] |
Definition at line 125 of file weapons.cpp.
weapon_explosions Weapon_explosions |
Definition at line 101 of file weapons.cpp.
weapon_info Weapon_info[MAX_WEAPON_TYPES] |
Definition at line 79 of file weapons.cpp.
char* Weapon_subtype_names[] |
Definition at line 87 of file weapons.cpp.
weapon Weapons[MAX_WEAPONS] |
Definition at line 78 of file weapons.cpp.