38#include "../corepp/script.h"
39#include "scriptmaster.h"
44class ScriptSlave :
public Mover
47 float attack_finished;
50 int dmg_means_of_death;
53 qboolean commandswaiting;
71 Vector m_vIdealPosition;
74 float m_fIdealDistance;
77 qboolean splineangles;
78 qboolean ignoreangles;
79 qboolean ignorevelocity;
80 float m_fFollowRelativeYaw;
84 void CheckNewOrders(
void);
87 CLASS_PROTOTYPE(ScriptSlave);
92 void BindEvent(Event *ev);
93 void EventUnbind(Event *ev);
94 void DoMove(Event *ev);
95 void WaitMove(Event *ev);
97 void ThreadMove(Event *ev);
98 void MoveEnd(Event *ev);
99 void SetAnglesEvent(Event *ev);
100 void SetAngleEvent(Event *ev);
101 void SetModelEvent(Event *ev);
102 void TriggerEvent(Event *ev)
override;
103 void GotoNextWaypoint(Event *ev);
104 void JumpTo(Event *ev);
105 void MoveToEvent(Event *ev);
106 void SetSpeed(Event *ev);
107 void SetTime(Event *ev);
108 void MoveUp(Event *ev);
109 void MoveDown(Event *ev);
110 void MoveNorth(Event *ev);
111 void MoveSouth(Event *ev);
112 void MoveEast(Event *ev);
113 void MoveWest(Event *ev);
114 void MoveForward(Event *ev);
115 void MoveBackward(Event *ev);
116 void MoveLeft(Event *ev);
117 void MoveRight(Event *ev);
118 void MoveOffset(Event *ev);
119 void RotateXdownto(Event *ev);
120 void RotateYdownto(Event *ev);
121 void RotateZdownto(Event *ev);
122 void RotateAxisdownto(Event *ev);
123 void RotateXupto(Event *ev);
124 void RotateYupto(Event *ev);
125 void RotateZupto(Event *ev);
126 void RotateAxisupto(Event *ev);
127 void Rotateupto(Event *ev);
128 void Rotatedownto(Event *ev);
129 void Rotateto(Event *ev);
130 void RotateXdown(Event *ev);
131 void RotateYdown(Event *ev);
132 void RotateZdown(Event *ev);
133 void RotateAxisdown(Event *ev);
134 void RotateXup(Event *ev);
135 void RotateYup(Event *ev);
136 void RotateZup(Event *ev);
137 void RotateAxisup(Event *ev);
138 void RotateX(Event *ev);
139 void RotateY(Event *ev);
140 void RotateZ(Event *ev);
141 void RotateAxis(Event *ev);
142 void TouchFunc(Event *ev);
143 void BlockFunc(Event *ev);
144 void TriggerFunc(Event *ev);
145 void UseFunc(Event *ev);
146 void DamageFunc(Event *ev);
147 void SetDamage(Event *ev);
148 void SetMeansOfDeath(Event *ev);
149 void FollowPath(Event *ev);
150 void FollowPathRelativeYaw(Event *ev);
151 void EndPath(Event *ev);
152 void FollowingPath(Event *ev);
153 void CreatePath(
SplinePath *path, splinetype_t type);
154 void Explode(Event *ev);
155 void NotShootable(Event *ev);
156 void OpenPortal(Event *ev);
157 void ClosePortal(Event *ev);
158 void PhysicsOn(Event *ev);
159 void PhysicsOff(Event *ev);
160 void PhysicsVelocity(Event *ev);
161 void EventFlyPath(Event *ev);
162 void EventModifyFlyPath(Event *ev);
163 void EventNormalAngles(Event *ev);
166 void Archive(
Archiver& arc)
override;
169inline void ScriptSlave::Archive(
Archiver& arc)
175 arc.ArchiveFloat(&attack_finished);
176 arc.ArchiveInteger(&dmg);
177 arc.ArchiveInteger(&dmg_means_of_death);
179 arc.ArchiveBoolean(&commandswaiting);
180 arc.ArchiveVector(&TotalRotation);
181 arc.ArchiveVector(&NewAngles);
182 arc.ArchiveVector(&NewPos);
183 arc.ArchiveVector(&ForwardDir);
184 arc.ArchiveFloat(&speed);
185 arc.ArchiveObjectPointer((Class **)&waypoint);
186 arc.ArchiveFloat(&traveltime);
191 tempInt = ARCHIVE_POINTER_VALID;
193 tempInt = ARCHIVE_POINTER_NULL;
195 arc.ArchiveInteger(&tempInt);
196 if (tempInt == ARCHIVE_POINTER_VALID) {
197 splinePath->Archive(arc);
200 arc.ArchiveInteger(&tempInt);
201 if (tempInt == ARCHIVE_POINTER_VALID) {
202 splinePath =
new BSpline;
203 splinePath->Archive(arc);
208 arc.ArchiveFloat(&splineTime);
209 arc.ArchiveBoolean(&splineangles);
210 arc.ArchiveBoolean(&ignoreangles);
211 arc.ArchiveBoolean(&ignorevelocity);
212 arc.ArchiveBoolean(&moving);
217 tempInt = ARCHIVE_POINTER_VALID;
219 tempInt = ARCHIVE_POINTER_NULL;
221 arc.ArchiveInteger(&tempInt);
222 if (tempInt == ARCHIVE_POINTER_VALID) {
223 m_pCurPath->Archive(arc);
226 arc.ArchiveInteger(&tempInt);
227 if (tempInt == ARCHIVE_POINTER_VALID) {
228 m_pCurPath =
new cSpline<4, 512>;
229 m_pCurPath->Archive(arc);
235 arc.ArchiveInteger(&m_iCurNode);
236 arc.ArchiveFloat(&m_fCurSpeed);
237 arc.ArchiveFloat(&m_fIdealSpeed);
238 arc.ArchiveVector(&m_vIdealPosition);
239 arc.ArchiveVector(&m_vIdealDir);
240 arc.ArchiveFloat(&m_fIdealAccel);
241 arc.ArchiveFloat(&m_fIdealDistance);
242 arc.ArchiveFloat(&m_fLookAhead);
243 arc.ArchiveFloat(&m_fFollowRelativeYaw);
246class ScriptModel :
public ScriptSlave
249 void GibEvent(Event *ev);
252 CLASS_PROTOTYPE(ScriptModel);
255 void SetAngleEvent(Event *ev);
256 void SetModelEvent(Event *ev);
257 void SetAnimEvent(Event *ev);
258 void AnimDoneEvent(Event *ev);
259 void MoveAnimEvent(Event *ev);
260 void MovingFromAnimEvent(Event *ev);
262 void Archive(
Archiver& arc)
override;
265inline void ScriptModel::Archive(
Archiver& arc)
267 ScriptSlave::Archive(arc);
270class ScriptModelRealDamage :
public ScriptModel
273 CLASS_PROTOTYPE(ScriptModelRealDamage);
275 ScriptModelRealDamage();
276 void EventDamage(Event *ev);
278 void Archive(
Archiver& arc)
override;
281inline void ScriptModelRealDamage::Archive(
Archiver& arc)
283 ScriptModel::Archive(arc);
286class ScriptOrigin :
public ScriptSlave
289 CLASS_PROTOTYPE(ScriptOrigin);
292 void SetAngleEvent(Event *ev);
293 void GetAngleEvent(Event *ev);
296class ScriptSkyOrigin :
public ScriptSlave
299 CLASS_PROTOTYPE(ScriptSkyOrigin);
303class ScriptSimpleStrafingGunfire :
public ScriptSlave
320 CLASS_PROTOTYPE(ScriptSimpleStrafingGunfire);
322 ScriptSimpleStrafingGunfire();
324 void Archive(
Archiver& arc)
override;
327 void GunFire(Event *ev);
330 void GunOn(Event *ev);
331 void GunOff(Event *ev);
332 void SetFireDelay(Event *ev);
333 void SetRange(Event *ev);
334 void SetSpread(Event *ev);
335 void SetDamage(Event *ev);
336 void SetKnockback(Event *ev);
337 void SetThroughWood(Event *ev);
338 void SetThroughMetal(Event *ev);
339 void SetBulletCount(Event *ev);
340 void SetTracerFreq(Event *ev);
341 void SetProjectileModel(Event *ev);
344inline void ScriptSimpleStrafingGunfire::SetFireDelay(Event *ev)
346 fireDelay = ev->GetFloat(1);
349inline void ScriptSimpleStrafingGunfire::SetRange(Event *ev)
351 range = ev->GetFloat(1);
354inline void ScriptSimpleStrafingGunfire::SetSpread(Event *ev)
356 spread.x = ev->GetFloat(1);
357 spread.y = ev->GetFloat(2);
360inline void ScriptSimpleStrafingGunfire::SetDamage(Event *ev)
362 damage = ev->GetFloat(1);
365inline void ScriptSimpleStrafingGunfire::SetKnockback(Event *ev)
367 knockback = ev->GetFloat(1);
370inline void ScriptSimpleStrafingGunfire::SetThroughWood(Event *ev)
372 throughWood = ev->GetFloat(1);
375inline void ScriptSimpleStrafingGunfire::SetThroughMetal(Event *ev)
377 throughMetal = ev->GetFloat(1);
380inline void ScriptSimpleStrafingGunfire::SetBulletCount(Event *ev)
382 bulletCount = ev->GetInteger(1);
385inline void ScriptSimpleStrafingGunfire::SetTracerFreq(Event *ev)
387 tracerFrequency = ev->GetInteger(1);
391inline void ScriptSimpleStrafingGunfire::SetProjectileModel(Event *ev)
393 projectileModel = ev->GetString(1);
396class ScriptAimedStrafingGunfire :
public ScriptSimpleStrafingGunfire
402 CLASS_PROTOTYPE(ScriptAimedStrafingGunfire);
404 ScriptAimedStrafingGunfire();
406 void Archive(
Archiver& arc)
override;
408 void GunFire(Event *ev);
409 void SetAimTarget(Event *ev);
412inline void ScriptAimedStrafingGunfire::SetAimTarget(Event *ev)
414 aimTarget = ev->GetEntity(1);
Definition simpleentity.h:42