]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/turrets/sv_turrets.qh
f89ef1581ba8f46866d15bbd8055a706440df33d
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / sv_turrets.qh
1 // turret fields
2 .float ticrate; // interal ai think rate
3 .vector aim_idle; // where to aim while idle
4 .entity tur_head; // top part of the turret
5 .entity tur_defend; // defend this entity
6 .vector tur_shotorg; // shot origin
7 .vector tur_aimpos; // aiming location
8 .float tur_impacttime; // predicted projectile impact time
9 .entity tur_impactent; // entity the projectile hit
10 .float tur_dist_enemy; // distance to enemy
11 .float tur_dist_aimpos; // distance to aim location
12 .float tur_dist_impact_to_aimpos; // distance impact<->aim
13 .float volly_counter; // decrement counter from .shot_volly to 0
14
15 .float shot_refire; // attack refire
16 .float shot_speed; // projectile speed
17 .float shot_spread; // inaccuracy
18 .float shot_dmg; // core damage of projectile
19 .float shot_radius; // projectile damage radius
20 .float shot_force; // projectile damage force
21 .float shot_volly; // smaller than 1 = shoot # times at target
22 .float shot_volly_refire; // refire after completed volly
23
24 .float target_range;
25 .float target_range_min;
26 .float target_range_optimal;
27
28 .float target_select_rangebias;
29 .float target_select_samebias;
30 .float target_select_anglebias;
31 .float target_select_missilebias;
32 .float target_select_playerbias;
33 .float target_select_time; // last time turret had a valid target
34 .float target_validate_time; // throttle re-validation of current target
35
36 .float aim_firetolerance_dist;
37 .float aim_speed;
38 .float aim_maxpitch;
39 .float aim_maxrotate;
40
41 .float ammo; // current ammo
42 .float ammo_recharge; // recharge rate
43 .float ammo_max; // maximum ammo
44
45 .vector idle_aim;
46
47 /// Map time control over pain inflicted
48 .float turret_scale_damage;
49 /// Map time control targetting range
50 .float turret_scale_range;
51 /// Map time control refire
52 .float turret_scale_refire;
53 /// Map time control ammo held and recharged
54 .float turret_scale_ammo;
55 /// Map time control aim speed
56 .float turret_scale_aim;
57 /// Map time control health
58 .float turret_scale_health;
59 /// Map time control respawn time
60 .float turret_scale_respawn;
61
62 // tracking type
63 .float track_type;
64 const float TFL_TRACKTYPE_STEPMOTOR = 1; // hard angle increments, ugly for fast turning with best accuracy
65 const float TFL_TRACKTYPE_FLUIDPRECISE = 2; // smooth absolute movement, looks OK with fair accuracy
66 const float TFL_TRACKTYPE_FLUIDINERTIA = 3; // simulated inertia ("wobbly" mode), worst accuracy, depends on below flags
67 .float track_accel_pitch;
68 .float track_accel_rotate;
69 .float track_blendrate;
70
71 /// updates aim org, shot org, shot dir and enemy org for selected turret
72 void turret_do_updates(entity e_turret);
73 .vector tur_shotdir_updated;
74
75 .float() turret_firecheckfunc; // TODO: deprecate!
76
77 /// Function to use for target evaluation. usualy turret_targetscore_generic
78 .float(entity _turret, entity _target) turret_score_target;
79
80 .float(entity e_target,entity e_sender) turret_addtarget;
81
82 .entity pathcurrent;
83
84 float turret_count;
85
86 // debugging
87 // Uncomment below to enable various debug output.
88 //#define TURRET_DEBUG
89 //#define TURRET_DEBUG_TARGETVALIDATE
90 //#define TURRET_DEBUG_TARGETSELECT
91 #ifdef TURRET_DEBUG
92 .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)
93 .float tur_debug_dmg_t_f; // total damage
94 .float tur_debug_start; // turret initialization time
95 .float tur_debug_tmr1; // random timer
96 .float tur_debug_tmr2; // random timer
97 .float tur_debug_tmr3; // random timer
98 .vector tur_debug_rvec; // random vector
99 #endif
100
101 // aiming
102 vector tvt_thadv; // turret head angle diff vector, updated by a successful call to turret_validate_target
103 vector tvt_tadv; // turret angle diff vector, updated by a successful call to turret_validate_target
104 float tvt_thadf; // turret head angle diff float, updated by a successful call to turret_validate_target
105 float tvt_tadf; // turret angle diff float, updated by a successful call to turret_validate_target
106 float tvt_dist; // turret distance, updated by a successful call to turret_validate_target