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