OpenMoHAA 0.82.1
Loading...
Searching...
No Matches
specialfx.h
1/*
2===========================================================================
3Copyright (C) 2024 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23// specialfx.h: special effects
24//
25
26#pragma once
27
28#include "g_local.h"
29#include "scriptslave.h"
30
31class Fulcrum : public ScriptSlave
32{
33private:
34 float resetspeed;
35 float dampening;
36 float limit;
37 float speed;
38 qboolean touched;
39 Vector startangles;
40 str movesound;
41
42public:
43 CLASS_PROTOTYPE(Fulcrum);
44 Fulcrum();
45
46 void Setup(Event *ev);
47 void SetSpeed(Event *ev);
48 void SetResetSpeed(Event *ev);
49 void SetDampening(Event *ev);
50 void SetLimit(Event *ev);
51 void SetMoveSound(Event *ev);
52 void Reset(Event *ev);
53 void Touched(Event *ev);
54 void Adjust(Event *ev);
55 void Archive(Archiver& arc) override;
56};
57
58inline void Fulcrum::Archive(Archiver& arc)
59{
60 ScriptSlave::Archive(arc);
61
62 arc.ArchiveFloat(&resetspeed);
63 arc.ArchiveFloat(&dampening);
64 arc.ArchiveFloat(&limit);
65 arc.ArchiveFloat(&speed);
66 arc.ArchiveBoolean(&touched);
67 arc.ArchiveVector(&startangles);
68 arc.ArchiveString(&movesound);
69}
70
71class RunThrough : public Entity
72{
73private:
74 Vector offset;
75 float speed;
76 float chance;
77 float delay;
78 float lasttriggertime;
79 float lip;
80 str spawnmodel;
81
82 void SetSpeed(Event *ev);
83 void SetChance(Event *ev);
84 void SetDelay(Event *ev);
85 void SetLip(Event *ev);
86 void SetSpawnModel(Event *ev);
87 void SetOffset(Event *ev);
88 void Touched(Event *ev);
89
90public:
91 CLASS_PROTOTYPE(RunThrough);
92 RunThrough();
93
94 void Archive(Archiver& arc) override;
95};
96
97inline void RunThrough::Archive(Archiver& arc)
98{
99 Entity::Archive(arc);
100
101 arc.ArchiveVector(&offset);
102 arc.ArchiveFloat(&speed);
103 arc.ArchiveFloat(&chance);
104 arc.ArchiveFloat(&delay);
105 arc.ArchiveFloat(&lasttriggertime);
106 arc.ArchiveFloat(&lip);
107 arc.ArchiveString(&spawnmodel);
108}
109
110class SinkObject : public ScriptSlave
111{
112private:
113 float resetspeed;
114 float resetdelay;
115 float dampening;
116 float limit;
117 float speed;
118 float delay;
119 float time_touched;
120 float time_reset;
121 str sinksound;
122 str resetsound;
123 qboolean touched;
124 qboolean active;
125 Vector startpos;
126
127public:
128 CLASS_PROTOTYPE(SinkObject);
129 SinkObject();
130
131 void Setup(Event *ev);
132 void SetSpeed(Event *ev);
133 void SetDelay(Event *ev);
134 void SetResetSpeed(Event *ev);
135 void SetResetDelay(Event *ev);
136 void SetDampening(Event *ev);
137 void SetLimit(Event *ev);
138 void Reset(Event *ev);
139 void Touched(Event *ev);
140 void Adjust(Event *ev);
141 void Fall(Event *ev);
142 void SetResetSound(Event *ev);
143 void SetSinkSound(Event *ev);
144 void MakeActive(Event *ev);
145 void MakeNonActive(Event *ev);
146 void Archive(Archiver& arc) override;
147};
148
149inline void SinkObject::Archive(Archiver& arc)
150{
151 ScriptSlave::Archive(arc);
152
153 arc.ArchiveFloat(&resetspeed);
154 arc.ArchiveFloat(&resetdelay);
155 arc.ArchiveFloat(&dampening);
156 arc.ArchiveFloat(&limit);
157 arc.ArchiveFloat(&speed);
158 arc.ArchiveFloat(&delay);
159 arc.ArchiveFloat(&time_touched);
160 arc.ArchiveFloat(&time_reset);
161 arc.ArchiveString(&sinksound);
162 arc.ArchiveString(&resetsound);
163 arc.ArchiveBoolean(&touched);
164 arc.ArchiveBoolean(&active);
165 arc.ArchiveVector(&startpos);
166}
Definition archive.h:86
Definition listener.h:246
Definition vector.h:61
Definition str.h:77