]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mapobjects/subs.qh
Merge branch 'master' into Mario/stats_eloranking
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / subs.qh
1 #pragma once
2 #include "defs.qh"
3
4 .float friction;
5 void SUB_Friction(entity this);
6
7 void SUB_NullThink(entity this);
8
9 /*
10 ==================
11 SUB_VanishOrRemove
12
13 Makes client invisible or removes non-client
14 ==================
15 */
16 void SUB_VanishOrRemove(entity ent);
17
18 void SUB_SetFade_Think(entity this);
19
20 /*
21 ==================
22 SUB_SetFade
23
24 Fade 'ent' out when time >= 'when'
25 ==================
26 */
27 void SUB_SetFade(entity ent, float when, float fading_time);
28
29 .vector         finaldest, finalangle;          //plat.qc stuff
30 .void(entity this) think1;
31 .float state;
32 .float          t_length, t_width;
33
34 .vector destvec;
35 .vector destvec2;
36
37 .float  delay;
38 .float  wait;
39 .float  lip;
40 .float  speed;
41 .float  sounds;
42 .string  platmovetype;
43 .float platmovetype_start, platmovetype_end;
44
45 //entity activator;
46
47 .string killtarget;
48
49 .vector pos1, pos2;
50 .vector mangle;
51
52 .string target2;
53 .string target3;
54 .string target4;
55 .string curvetarget;
56 .float target_random;
57 .float trigger_reverse;
58
59 // Keys player is holding
60 .float itemkeys;
61 // message delay for func_door locked by keys and key locks
62 // this field is used on player entities
63 .float key_door_messagetime;
64
65 .vector dest1, dest2;
66
67 .entity move_controller;
68
69 const int TSPEED_TIME = -1;
70 const int TSPEED_LINEAR = 0;
71 const int TSPEED_START = 1;
72 const int TSPEED_END = 2;
73 // TODO average too?
74
75 #ifdef CSQC
76 // this stuff is defined in the server side engine VM, so we must define it separately here
77 .float takedamage;
78 const int DAMAGE_NO = 0;
79 const int DAMAGE_YES = 1;
80 const int DAMAGE_AIM = 2;
81
82 .string         noise, noise1, noise2, noise3;  // contains names of wavs to play
83
84 .float          max_health;             // players maximum health is stored here
85 #endif
86
87 #ifdef SVQC
88 spawnfunc(info_null);
89 #endif
90
91 /*
92 =============
93 SUB_CalcMove
94
95 calculate this.velocity and this.nextthink to reach dest from
96 this.origin traveling at speed
97 ===============
98 */
99 void SUB_CalcMoveDone(entity this);
100
101 .float platmovetype_turn;
102 void SUB_CalcMove_controller_think (entity this);
103
104 void SUB_CalcMove_controller_setbezier (entity controller, vector org, vector control, vector dest);
105
106 void SUB_CalcMove_controller_setlinear (entity controller, vector org, vector dest);
107
108 void SUB_CalcMove_Bezier (entity this, vector tcontrol, vector tdest, float tspeedtype, float tspeed, void(entity this) func);
109
110 void SUB_CalcMove (entity this, vector tdest, float tspeedtype, float tspeed, void(entity this) func);
111
112 void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed, void(entity this) func);
113
114 #ifdef SVQC
115 void ApplyMinMaxScaleAngles(entity e);
116
117 void SetBrushEntityModel(entity this);
118
119 void SetBrushEntityModelNoLOD(entity this);
120
121 int autocvar_loddebug;
122 .string lodtarget1;
123 .string lodtarget2;
124 .string lodmodel1;
125 .string lodmodel2;
126 .float lodmodelindex0;
127 .float lodmodelindex1;
128 .float lodmodelindex2;
129 .float loddistance1;
130 .float loddistance2;
131
132 bool LOD_customize(entity this, entity client);
133
134 void LOD_uncustomize(entity this);
135
136 void LODmodel_attach(entity this);
137 #endif
138
139 /*
140 =============
141 SUB_CalcAngleMove
142
143 calculate this.avelocity and this.nextthink to reach destangle from
144 this.angles rotating
145
146 The calling function should make sure this.think is valid
147 ===============
148 */
149 void SUB_CalcAngleMoveDone (entity this);
150
151 // FIXME: I fixed this function only for rotation around the main axes
152 void SUB_CalcAngleMove (entity this, vector destangle, float tspeedtype, float tspeed, void(entity this) func);
153
154 void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeedtype, float tspeed, void(entity this) func);
155
156 /*
157 ================
158 InitTrigger
159 ================
160 */
161
162 #ifdef SVQC
163 void SetMovedir(entity this);
164
165 void InitTrigger(entity this);
166
167 void InitSolidBSPTrigger(entity this);
168
169 bool InitMovingBrushTrigger(entity this);
170 #endif