27 #define WP_LASER 0 // PLEASE NOTE that this flag specifies ballistic primaries as well - Goober5000
38 #define MAX_WEAPON_FLAGS 18 // Maximum number of different bit flags legal to specify in a single weapons.tbl Flags line
40 #define WIF_DEFAULT_VALUE 0
41 #define WIF2_DEFAULT_VALUE 0
42 #define WIF3_DEFAULT_VALUE 0
44 #define WIF_HOMING_HEAT (1 << 0) // if set, this weapon homes via seeking heat
45 #define WIF_HOMING_ASPECT (1 << 1) // if set, this weapon homes via chasing aspect
46 #define WIF_ELECTRONICS (1 << 2) // Takes out electronics systems.
47 #define WIF_SPAWN (1 << 3) // Spawns projectiles on detonation.
48 #define WIF_REMOTE (1 << 4) // Can be remotely detonated by parent.
49 #define WIF_PUNCTURE (1 << 5) // Punctures armor, damaging subsystems.
50 #define WIF_SUPERCAP (1 << 6) // This is a weapon which does supercap class damage (meaning, it applies real damage to supercap ships)
51 #define WIF_CMEASURE (1 << 7) // Weapon acts as a countermeasure
55 #define WIF_HOMING_JAVELIN (1 << 8) // WC Saga Javelin HS style heatseeker, locks only on target's engines
56 #define WIF_TURNS (1 << 9) // Set this if the weapon ever changes heading. If you
59 #define WIF_SWARM (1 << 10) // Missile "swarms".. ie changes heading and twists on way to target
60 #define WIF_TRAIL (1 << 11) // Has a trail
61 #define WIF_BIG_ONLY (1 << 12) // Only big ships (cruiser, capital, etc.) can arm this weapon
62 #define WIF_CHILD (1 << 13) // No ship can have this weapon. It gets created by weapon detonations.
63 #define WIF_BOMB (1 << 14) // Bomb-type missile, can be targeted
64 #define WIF_HUGE (1 << 15) // Huge damage (generally 500+), probably only fired at huge ships.
65 #define WIF_NO_DUMBFIRE (1 << 16) // Missile cannot be fired dumbfire (ie requires aspect lock)
66 #define WIF_THRUSTER (1 << 17) // Has thruster cone and/or glow
67 #define WIF_IN_TECH_DATABASE (1 << 18)
68 #define WIF_PLAYER_ALLOWED (1 << 19) // allowed to be on starting wing ships/in weaponry pool
69 #define WIF_BOMBER_PLUS (1 << 20) // Fire this missile only at a bomber or big ship. But not a fighter.
71 #define WIF_CORKSCREW (1 << 21) // corkscrew style missile
72 #define WIF_PARTICLE_SPEW (1 << 22) // spews particles as it travels
73 #define WIF_EMP (1 << 23) // weapon explodes with a serious EMP effect
74 #define WIF_ENERGY_SUCK (1 << 24) // energy suck primary (impact effect)
75 #define WIF_FLAK (1 << 25) // use for big-ship turrets - flak gun
76 #define WIF_BEAM (1 << 26) // if this is a beam weapon : NOTE - VERY SPECIAL CASE
77 #define WIF_TAG (1 << 27) // this weapon has a tag effect when it hits
78 #define WIF_SHUDDER (1 << 28) // causes the weapon to shudder. shudder is proportional to the mass and damage of the weapon
79 #define WIF_LOCKARM (1 << 29) // if the missile was fired without a lock, it does significanlty less damage on impact
80 #define WIF_STREAM (1 << 30) // handled by "trigger down/trigger up" instead of "fire - wait - fire - wait"
84 #define WIF2_BALLISTIC (1 << 0) // ballistic primaries - Goober5000
85 #define WIF2_PIERCE_SHIELDS (1 << 1) // shield pierceing -Bobboau
86 #define WIF2_DEFAULT_IN_TECH_DATABASE (1 << 2) // default in tech database - Goober5000
87 #define WIF2_LOCAL_SSM (1 << 3) // localized ssm. ship that fires ssm is in mission. ssms also warp back in during mission
88 #define WIF2_TAGGED_ONLY (1 << 4) // can only fire if target is tagged
89 #define WIF2_CYCLE (1 << 5) // will only fire from (shots (defalts to 1)) points at a time
90 #define WIF2_SMALL_ONLY (1 << 6) // can only be used against small ships like fighters or bombers
91 #define WIF2_SAME_TURRET_COOLDOWN (1 << 7) // the weapon has the same cooldown time on turrets
92 #define WIF2_MR_NO_LIGHTING (1 << 8) // don't render with lighting, regardless of user options
93 #define WIF2_TRANSPARENT (1 << 9) // render as transparent
94 #define WIF2_TRAINING (1 << 10) // Weapon does shield/hull damage, but doesn't hurt subsystems, whack you, or put marks on your ship.
95 #define WIF2_SMART_SPAWN (1 << 11) // Spawn weapon that is fired via turrets like normal weapons
96 #define WIF2_INHERIT_PARENT_TARGET (1 << 12) // child weapons home in on the target their parent is homing on.
97 #define WIF2_NO_EMP_KILL (1 << 13) // though weapon has hitpoints it can not be disabled by EMP
98 #define WIF2_VARIABLE_LEAD_HOMING (1 << 14) // allows user defined scaler to be added to lead (to enable, lead, pure or lag pursuit for missiles)
99 #define WIF2_UNTARGETED_HEAT_SEEKER (1 << 15) // forces heat seeker to lose target immeadiately (and acquire a random new one)
100 #define WIF2_HARD_TARGET_BOMB (1 << 16) // removes the radius doubling effect bombs have for collisions
101 #define WIF2_NON_SUBSYS_HOMING (1 << 17) // spreads fired missiles around the target ships hull
102 #define WIF2_NO_LIFE_LOST_IF_MISSED (1 << 18) // prevents game from shortening the lifeleft of the missed but still homing missiles
103 #define WIF2_CUSTOM_SEEKER_STR (1 << 19) // sets the game to use custom seeker strengths instead of default values
104 #define WIF2_CAN_BE_TARGETED (1 << 20) // allows non-bomb weapons to be targeted
105 #define WIF2_SHOWN_ON_RADAR (1 << 21) // allows non-bombs be visible on radar
106 #define WIF2_SHOW_FRIENDLY (1 << 22) // allows friendly weapon radar dots be drawn
107 #define WIF2_CAPITAL_PLUS (1 << 23) // AI will not use this weapon on fighters or bombers
108 #define WIF2_EXTERNAL_WEAPON_FP (1 << 24) // will try to use external models FPs if possible
109 #define WIF2_EXTERNAL_WEAPON_LNCH (1 << 25) // render external secondary as a launcher
110 #define WIF2_TAKES_BLAST_DAMAGE (1 << 26) // This weapon can take blast damage
111 #define WIF2_TAKES_SHOCKWAVE_DAMAGE (1 << 27) // This weapon can take shockwave damage
112 #define WIF2_DONT_SHOW_ON_RADAR (1 << 28) // Force a weapon to not show on radar
113 #define WIF2_RENDER_FLAK (1 << 29) // Even though this is a flak weapon, render the shell
114 #define WIF2_CIWS (1 << 30) // This weapons' burst and shockwave damage can damage bombs (Basically, a reverse for TAKES_BLAST/SHOCKWAVE_DAMAGE
115 #define WIF2_ANTISUBSYSBEAM (1 << 31) // This beam can target subsystems as per normal
117 #define WIF3_NOLINK (1 << 0) // This weapon can not be linked with others
118 #define WIF3_USE_EMP_TIME_FOR_CAPSHIP_TURRETS (1 << 1) // override MAX_TURRET_DISRUPT_TIME in emp.cpp - Goober5000
119 #define WIF3_NO_LINKED_PENALTY (1 << 2) // This weapon does not count into linked firing penalty
120 #define WIF3_NO_HOMING_SPEED_RAMP (1 << 3) // Disables the 1s long speed ramping when firing locked-on secondaries
121 #define WIF3_CMEASURE_ASPECT_HOME_ON (1 << 4) // This countermeasure flag makes aspect seekers home on the countermeasure instead of going into dumbfire mode
122 #define WIF3_TURRET_INTERCEPTABLE (1 << 5) // These two flags mark a weapon as being interceptable by the AI
123 #define WIF3_FIGHTER_INTERCEPTABLE (1 << 6) // (like WIF_BOMB), without forcing it to be tagetable -MageKing17
124 #define WIF3_AOE_ELECTRONICS (1 << 7) // Apply electronics effect across the weapon's entire area of effect instead of just on the impacted ship -MageKing17
125 #define WIF3_APPLY_RECOIL (1 << 8) // Apply recoil using weapon and ship info
126 #define WIF3_DONT_SPAWN_IF_SHOT (1 << 9) // Prevent shot down parent weapons from spawning children (DahBlount)
127 #define WIF3_DIE_ON_LOST_LOCK (1 << 10) // WIF_LOCKED_HOMING missiles will die if they lose their lock
129 #define WIF_HOMING (WIF_HOMING_HEAT | WIF_HOMING_ASPECT | WIF_HOMING_JAVELIN)
130 #define WIF_LOCKED_HOMING (WIF_HOMING_ASPECT | WIF_HOMING_JAVELIN)
131 #define WIF_HURTS_BIG_SHIPS (WIF_BOMB | WIF_BEAM | WIF_HUGE | WIF_BIG_ONLY)
133 #define WEAPON_EXHAUST_DELTA_TIME 75 // Delay in milliseconds between exhaust blobs
135 #define WF_LOCK_WARNING_PLAYED (1<<0) // set when a lock warning sound is played for the player
137 #define WF_ALREADY_APPLIED_STATS (1<<1) // for use in ship_apply_local and ship_apply_global damage functions
139 #define WF_PLAYED_FLYBY_SOUND (1<<2) // flyby sound has been played for this weapon
140 #define WF_CONSIDER_FOR_FLYBY_SOUND (1<<3) // consider for flyby
141 #define WF_DEAD_IN_WATER (1<<4) // a missiles engines have died
142 #define WF_LOCKED_WHEN_FIRED (1<<5) // fired with a lock
143 #define WF_DESTROYED_BY_WEAPON (1<<6) // destroyed by damage from other weapon
144 #define WF_SPAWNED (1<<7) //Spawned from a spawning type weapon
145 #define WF_HOMING_UPDATE_NEEDED (1<<8) // this is a newly spawned homing weapon which needs to update client machines
146 #define WF_NO_HOMING (1<<9) // this weapon should ignore any homing behavior it'd usually have
149 #define WBF_FAST_FIRING (1<<0) // burst is to use only the firewait to determine firing delays
150 #define WBF_RANDOM_LENGTH (1<<1) // burst is to fire random length bursts
153 #define PSPEW_NONE -1 //used to disable a spew, useful for xmts
154 #define PSPEW_DEFAULT 0 //std fs2 pspew
155 #define PSPEW_HELIX 1 //q2 style railgun trail
156 #define PSPEW_SPARKLER 2 //random particles in every direction, can be sperical or ovoid
157 #define PSPEW_RING 3 //outward expanding ring
158 #define PSPEW_PLUME 4 //spewers arrayed within a radius for thruster style effects, may converge or scatter
160 #define MAX_PARTICLE_SPEWERS 4 //i figure 4 spewers should be enough for now -nuke
161 #define MAX_WEP_DAMAGE_SLOTS 32 //Maximum number of ships which can be counted as killer or assits on destroying this weapon
302 #define MAX_SPAWN_TYPES_PER_WEAPON 5
305 #define BEAM_FAR_LENGTH 30000.0f
310 #define WEAPON_TITLE_LEN 48
319 #define MAX_SUBSTITUTION_PATTERNS 10
566 #define MAX_WEAPON_EXPL_LOD 4
575 : bitmap_id( -1 ), num_frames( 0 ), fps( 0 )
612 #define WEAPON_INDEX(wp) (wp-Weapons)
613 #define WEAPON_INFO_INDEX(wip) (wip-Weapon_info)
637 #define WEAPON_MAX_GROUP_IDS 256
648 void weapon_hit(
object * weapon_obj,
object * other_obj,
vec3d * hitpos,
int quadrant = -1 );
657 float *blast,
float *damage,
float limit);
char tech_model[MAX_FILENAME_LEN]
weapon Weapons[MAX_WEAPONS]
float cm_aspect_effectiveness
void missile_obj_list_rebuild()
float particle_spew_scale
void weapon_process_pre(object *obj, float frame_time)
size_t num_substitution_patterns
float laser_glow_bitmap_frame
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)
int total_children_spawned
weapon_info Weapon_info[MAX_WEAPON_TYPES]
float thruster_glow_noise
generic_anim laser_bitmap
int First_secondary_index
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)
char weapon_substitution_pattern_names[MAX_SUBSTITUTION_PATTERNS][NAME_LENGTH]
int pick_big_attack_point_timestamp
int weapon_info_lookup(const char *name=NULL)
float piercing_impact_particle_life
InFlightSoundType in_flight_play_type
int Player_weapon_precedence[MAX_WEAPON_TYPES]
char anim_filename[MAX_FILENAME_LEN]
float untargeted_flak_range_penalty
float piercing_impact_particle_variance
char external_model_name[MAX_FILENAME_LEN]
void weapon_unpause_sounds()
void weapon_render(object *obj, draw_list *scene)
int GetAnim(int weapon_expl_index, vec3d *pos, float size)
float thruster_glow_factor
struct weapon_expl_lod weapon_expl_lod
void weapon_mark_as_used(int weapon_id)
ship_subsys * homing_subsys
#define MAX_WEP_DAMAGE_SLOTS
float piercing_impact_particle_back_velocity
int num_spawn_weapons_defined
void find_homing_object_cmeasures()
float weapon_get_damage_scale(weapon_info *wip, object *wep, object *target)
struct spawn_weapon_info spawn_weapon_info
float particle_spew_z_scale
int piercing_impact_weapon_expl_index
float beam_iff_miss_factor[MAX_IFFS][NUM_SKILL_LEVELS]
int Load(char *filename=NULL, int specified_lods=MAX_WEAPON_EXPL_LOD)
int weapon_substitution_pattern[MAX_SUBSTITUTION_PATTERNS]
void weapon_maybe_spew_particle(object *obj)
int damage_ship_id[MAX_WEP_DAMAGE_SLOTS]
float beam_particle_radius
int flash_impact_weapon_expl_index
#define MAX_WEAPON_EXPL_LOD
void weapon_delete(object *obj)
void weapon_set_tracking_info(int weapon_objnum, int parent_objnum, int target_objnum, int target_is_locked=0, ship_subsys *target_subsys=NULL)
ship_subsys * turret_subsys
SCP_vector< int > * cmeasure_ignore_list
float beam_particle_angle
struct beam_weapon_info beam_weapon_info
char hud_filename[MAX_FILENAME_LEN]
missile_obj * missile_obj_return_address(int index)
char filename[MAX_FILENAME_LEN]
particle_spew_info particle_spewers[MAX_PARTICLE_SPEWERS]
int pre_launch_snd_min_interval
float flash_impact_explosion_radius
generic_anim beam_particle_ani
generic_anim thruster_glow
void weapon_hit(object *weapon_obj, object *other_obj, vec3d *hitpos, int quadrant=-1)
int dinky_impact_weapon_expl_index
#define MAX_SPAWN_TYPES_PER_WEAPON
float shield_impact_explosion_radius
char tech_anim_filename[MAX_FILENAME_LEN]
beam_weapon_section_info sections[MAX_BEAM_SECTIONS]
float weapon_submodel_rotate_accell
#define MAX_BEAM_SECTIONS
struct beam_weapon_section_info beam_weapon_section_info
void weapon_process_post(object *obj, float frame_time)
int detail_distance[MAX_MODEL_DETAIL_LEVELS]
char tech_title[NAME_LENGTH]
#define MAX_SUBSTITUTION_PATTERNS
vec3d particle_spew_offset
float piercing_impact_explosion_radius
char * Weapon_subtype_names[]
generic_anim laser_glow_bitmap
void ship_do_weapon_thruster_frame(weapon *weaponp, object *objp, float frametime)
float piercing_impact_particle_velocity
int num_targeting_priorities
struct missile_obj missile_obj
int catchup_pixels_per_sec
char icon_filename[MAX_FILENAME_LEN]
float total_damage_received
int piercing_impact_particle_count
void weapon_get_laser_color(color *c, object *objp)
int catchup_pixel_penalty
GLuint const GLchar * name
struct weapon_info weapon_info
bool weapon_armed(weapon *wp, bool hit_target)
vec3d particle_spew_velocity
shockwave_create_info dinky_shockwave
float particle_spew_rotation_rate
int hud_in_flight_snd_sig
void weapon_do_electronics_effect(object *ship_objp, vec3d *blast_pos, int wi_index)
void weapon_hit_do_sound(object *hit_obj, weapon_info *wip, vec3d *hitpos, bool is_armed)
float particle_spew_radius
float flak_detonation_accuracy
void validate_SSM_entries()
float cm_heat_effectiveness
float thruster_glow_frame
spawn_weapon_info spawn_info[MAX_SPAWN_TYPES_PER_WEAPON]
#define MAX_MODEL_DETAIL_LEVELS
void shield_impact_explosion(vec3d *hitpos, object *objp, float radius, int idx)
GLsizei GLsizei GLuint * obj
void weapon_render_DEPRECATED(object *obj)
int particle_spew_time[MAX_PARTICLE_SPEWERS]
int cmeasure_name_lookup(char *name)
void spawn_child_weapons(object *objp)
float impact_explosion_radius
char pofbitmap_name[MAX_FILENAME_LEN]
void weapon_area_apply_blast(vec3d *force_apply_pos, object *ship_objp, vec3d *blast_pos, float blast, int make_shockwave)
weapon_explosions Weapon_explosions
float dinky_impact_explosion_radius
float particle_spew_lifetime
char alt_name[NAME_LENGTH]
#define MAX_PARTICLE_SPEWERS
missile_obj Missile_obj_list
shockwave_create_info shockwave
struct particle_spew_info particle_spew_info
float flak_targeting_accuracy
float damage_ship[MAX_WEP_DAMAGE_SLOTS]
int targeting_priorities[32]
void weapon_pause_sounds()
int weapon_create_group_id()
int impact_weapon_expl_index
char title[WEAPON_TITLE_LEN]
void weapon_detonate(object *objp)
float weapon_submodel_rotate_vel
struct weapon_expl_info weapon_expl_info
generic_anim thruster_flame
int Num_player_weapon_precedence
generic_anim particle_spew_anim
int Default_cmeasure_index