]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/bot/default/aim.qh
Merge branch 'master' into Mario/wepent_experimental
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / aim.qh
1 #pragma once
2 /*
3  * Globals and Fields
4  */
5
6 entity tracetossent;
7 entity tracetossfaketarget;
8 vector findtrajectory_velocity;
9
10
11
12 vector shotorg;
13 vector shotdir;
14
15 // lag simulation
16 // upto 5 queued messages
17 .float lag1_time;
18 .float lag1_float1;
19 .float lag1_float2;
20 .entity lag1_entity1;
21 .vector lag1_vec1;
22 .vector lag1_vec2;
23 .vector lag1_vec3;
24 .vector lag1_vec4;
25
26 .float lag2_time;
27 .float lag2_float1;
28 .float lag2_float2;
29 .entity lag2_entity1;
30 .vector lag2_vec1;
31 .vector lag2_vec2;
32 .vector lag2_vec3;
33 .vector lag2_vec4;
34
35 .float lag3_time;
36 .float lag3_float1;
37 .float lag3_float2;
38 .entity lag3_entity1;
39 .vector lag3_vec1;
40 .vector lag3_vec2;
41 .vector lag3_vec3;
42 .vector lag3_vec4;
43
44 .float lag4_time;
45 .float lag4_float1;
46 .float lag4_float2;
47 .entity lag4_entity1;
48 .vector lag4_vec1;
49 .vector lag4_vec2;
50 .vector lag4_vec3;
51 .vector lag4_vec4;
52
53 .float lag5_time;
54 .float lag5_float1;
55 .float lag5_float2;
56 .entity lag5_entity1;
57 .vector lag5_vec1;
58 .vector lag5_vec2;
59 .vector lag5_vec3;
60 .vector lag5_vec4;
61
62 .float bot_badaimtime;
63 .float bot_aimthinktime;
64 .float bot_prevaimtime;
65 .float bot_firetimer;
66 .float bot_aimlatency;
67
68 .vector bot_mouseaim;
69 .vector bot_badaimoffset;
70 .vector bot_1st_order_aimfilter;
71 .vector bot_2nd_order_aimfilter;
72 .vector bot_3th_order_aimfilter;
73 .vector bot_4th_order_aimfilter;
74 .vector bot_5th_order_aimfilter;
75 .vector bot_olddesiredang;
76
77 //.vector bot_aimorigin;
78 //.vector bot_aimvelocity;
79 .vector bot_aimtargorigin;
80 .vector bot_aimtargvelocity;
81
82 .entity bot_aimtarg;
83
84 /*
85  * Functions
86  */
87
88 float lag_additem(entity this, float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4);
89 void lag_update(entity this);
90 void bot_lagfunc(entity this, float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4);
91
92 float bot_shouldattack(entity this, entity targ);
93 float bot_aimdir(entity this, vector v, float maxfiredeviation);
94 bool bot_aim(entity this, .entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, bool applygravity);
95 float findtrajectorywithleading(vector org, vector m1, vector m2, entity targ, float shotspeed, float shotspeedupward, float maxtime, float shotdelay, entity ignore);
96
97 vector bot_shotlead(vector targorigin, vector targvelocity, float shotspeed, float shotdelay);
98
99 .void(entity this, float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4) lag_func;