]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/g_subs.qh
Fix whitespace for #include
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_subs.qh
1 #ifndef G_SUBS_H
2 #define G_SUBS_H
3
4 void SUB_NullThink(void);
5
6 void()  SUB_CalcMoveDone;
7 void() SUB_CalcAngleMoveDone;
8 //void() SUB_UseTargets;
9 void() SUB_Remove;
10
11 void spawnfunc_info_null (void);
12
13 void setanim(entity e, vector anim, float looping, float override, float restart);
14
15 void updateanim(entity e);
16
17 /*
18 ==================
19 SUB_Remove
20
21 Remove self
22 ==================
23 */
24 void SUB_Remove (void);
25
26 /*
27 ==================
28 SUB_Friction
29
30 Applies some friction to self
31 ==================
32 */
33 .float friction;
34 void SUB_Friction (void);
35
36 /*
37 ==================
38 SUB_VanishOrRemove
39
40 Makes client invisible or removes non-client
41 ==================
42 */
43 void SUB_VanishOrRemove (entity ent);
44
45 void SUB_SetFade_Think (void);
46
47 /*
48 ==================
49 SUB_SetFade
50
51 Fade 'ent' out when time >= 'when'
52 ==================
53 */
54 void SUB_SetFade (entity ent, float when, float fadetime);
55
56 /*
57 =============
58 SUB_CalcMove
59
60 calculate self.velocity and self.nextthink to reach dest from
61 self.origin traveling at speed
62 ===============
63 */
64 void SUB_CalcMoveDone (void);
65
66 .float platmovetype_turn;
67 void SUB_CalcMove_controller_think (void);
68
69 void SUB_CalcMove_controller_setbezier (entity controller, vector org, vector control, vector dest);
70
71 void SUB_CalcMove_controller_setlinear (entity controller, vector org, vector dest);
72
73 float TSPEED_TIME = -1;
74 float TSPEED_LINEAR = 0;
75 float TSPEED_START = 1;
76 float TSPEED_END = 2;
77 // TODO average too?
78
79 void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeedtype, float tspeed, void() func);
80
81 void SUB_CalcMove (vector tdest, float tspeedtype, float tspeed, void() func);
82
83 void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed, void() func);
84
85 /*
86 =============
87 SUB_CalcAngleMove
88
89 calculate self.avelocity and self.nextthink to reach destangle from
90 self.angles rotating
91
92 The calling function should make sure self.think is valid
93 ===============
94 */
95 void SUB_CalcAngleMoveDone (void);
96
97 // FIXME: I fixed this function only for rotation around the main axes
98 void SUB_CalcAngleMove (vector destangle, float tspeedtype, float tspeed, void() func);
99
100 void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeedtype, float tspeed, void() func);
101
102 /*
103 ==================
104 main
105
106 unused but required by the engine
107 ==================
108 */
109 void main (void);
110
111 // Misc
112
113 /*
114 ==================
115 traceline_antilag
116
117 A version of traceline that must be used by SOLID_SLIDEBOX things that want to hit SOLID_CORPSE things with a trace attack
118 Additionally it moves players back into the past before the trace and restores them afterward.
119 ==================
120 */
121 void tracebox_antilag_force_wz (entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag, float wz);
122 void traceline_antilag_force (entity source, vector v1, vector v2, float nomonst, entity forent, float lag);
123 void traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag);
124 void tracebox_antilag (entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag);
125 void WarpZone_traceline_antilag_force (entity source, vector v1, vector v2, float nomonst, entity forent, float lag);
126 void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag);
127 void WarpZone_tracebox_antilag (entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag);
128
129 float tracebox_inverted (vector v1, vector mi, vector ma, vector v2, float nomonsters, entity forent, float stopatentity, entity ignorestopatentity); // returns the number of traces done, for benchmarking
130
131 void traceline_inverted (vector v1, vector v2, float nomonsters, entity forent, float stopatentity, entity ignorestopatentity);
132
133 /*
134 ==================
135 findbetterlocation
136
137 Returns a point at least 12 units away from walls
138 (useful for explosion animations, although the blast is performed where it really happened)
139 Ripped from DPMod
140 ==================
141 */
142 vector findbetterlocation (vector org, float mindist);
143
144 /*
145 ==================
146 crandom
147
148 Returns a random number between -1.0 and 1.0
149 ==================
150 */
151 float crandom (void);
152
153 /*
154 ==================
155 Angc used for animations
156 ==================
157 */
158
159
160 float angc (float a1, float a2);
161
162 .string lodtarget1;
163 .string lodtarget2;
164 .string lodmodel1;
165 .string lodmodel2;
166 .float lodmodelindex0;
167 .float lodmodelindex1;
168 .float lodmodelindex2;
169 .float loddistance1;
170 .float loddistance2;
171
172 float LOD_customize();
173
174 void LOD_uncustomize();
175
176 void LODmodel_attach();
177
178 void ApplyMinMaxScaleAngles(entity e);
179
180 void SetBrushEntityModel();
181
182 void SetBrushEntityModelNoLOD();
183
184 /*
185 ================
186 InitTrigger
187 ================
188 */
189
190 void SetMovedir();
191
192 void InitTrigger();
193
194 void InitSolidBSPTrigger();
195
196 float InitMovingBrushTrigger();
197 #endif