3 entity turret_projectile(entity actor, Sound _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim);
4 void turret_projectile_explode(entity this);
5 float turret_validate_target(entity e_turret, entity e_target, float validate_flags);
6 bool turret_firecheck(entity this);
7 entity turret_select_target(entity this);
10 .float ticrate; // interal ai think rate
11 .vector aim_idle; // where to aim while idle
12 .entity tur_head; // top part of the turret
13 .entity tur_defend; // defend this entity
14 .vector tur_shotorg; // shot origin
15 .vector tur_aimpos; // aiming location
16 .float tur_impacttime; // predicted projectile impact time
17 .entity tur_impactent; // entity the projectile hit
18 .float tur_dist_enemy; // distance to enemy
19 .float tur_dist_aimpos; // distance to aim location
20 .float tur_dist_impact_to_aimpos; // distance impact<->aim
21 .float volly_counter; // decrement counter from .shot_volly to 0
23 .float shot_refire; // attack refire
24 .float shot_speed; // projectile speed
25 .float shot_spread; // inaccuracy
26 .float shot_dmg; // core damage of projectile
27 .float shot_radius; // projectile damage radius
28 .float shot_force; // projectile damage force
29 .float shot_volly; // smaller than 1 = shoot # times at target
30 .float shot_volly_refire; // refire after completed volly
33 .float target_range_min;
34 .float target_range_optimal;
36 .float target_select_rangebias;
37 .float target_select_samebias;
38 .float target_select_anglebias;
39 .float target_select_missilebias;
40 .float target_select_playerbias;
41 .float target_select_time; // last time turret had a valid target
42 .float target_validate_time; // throttle re-validation of current target
44 .float aim_firetolerance_dist;
49 .float ammo; // current ammo
50 .float ammo_recharge; // recharge rate
51 .float ammo_max; // maximum ammo
55 /// Map time control over pain inflicted
56 .float turret_scale_damage;
57 /// Map time control targetting range
58 .float turret_scale_range;
59 /// Map time control refire
60 .float turret_scale_refire;
61 /// Map time control ammo held and recharged
62 .float turret_scale_ammo;
63 /// Map time control aim speed
64 .float turret_scale_aim;
65 /// Map time control health
66 .float turret_scale_health;
67 /// Map time control respawn time
68 .float turret_scale_respawn;
72 const float TFL_TRACKTYPE_STEPMOTOR = 1; // hard angle increments, ugly for fast turning with best accuracy
73 const float TFL_TRACKTYPE_FLUIDPRECISE = 2; // smooth absolute movement, looks OK with fair accuracy
74 const float TFL_TRACKTYPE_FLUIDINERTIA = 3; // simulated inertia ("wobbly" mode), worst accuracy, depends on below flags
75 .float track_accel_pitch;
76 .float track_accel_rotate;
77 .float track_blendrate;
79 void turret_respawn(entity this);
81 /// updates aim org, shot org, shot dir and enemy org for selected turret
82 void turret_do_updates(entity e_turret);
83 .vector tur_shotdir_updated;
85 .float(entity this) turret_firecheckfunc; // TODO: deprecate!
87 void turrets_setframe(entity this, float _frame, float client_only);
89 bool turret_initialize(entity this, Turret tur);
91 /// Function to use for target evaluation. usualy turret_targetscore_generic
92 .float(entity _turret, entity _target) turret_score_target;
94 .bool(entity this, entity e_target,entity e_sender) turret_addtarget;
101 // Uncomment below to enable various debug output.
102 //#define TURRET_DEBUG
103 //#define TURRET_DEBUG_TARGETVALIDATE
104 //#define TURRET_DEBUG_TARGETSELECT
106 .float tur_debug_dmg_t_h; // total damage that hit something (can be more than tur_debug_dmg_t_f since it should count radius damage)
107 .float tur_debug_dmg_t_f; // total damage
108 .float tur_debug_start; // turret initialization time
109 .float tur_debug_tmr1; // random timer
110 .float tur_debug_tmr2; // random timer
111 .float tur_debug_tmr3; // random timer
112 .vector tur_debug_rvec; // random vector
116 vector tvt_thadv; // turret head angle diff vector, updated by a successful call to turret_validate_target
117 vector tvt_tadv; // turret angle diff vector, updated by a successful call to turret_validate_target
118 float tvt_thadf; // turret head angle diff float, updated by a successful call to turret_validate_target
119 float tvt_tadf; // turret angle diff float, updated by a successful call to turret_validate_target
120 float tvt_dist; // turret distance, updated by a successful call to turret_validate_target