OpenMoHAA 0.82.1
Loading...
Searching...
No Matches
earthquake.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// earthquake.h: Earthquake trigger causes a localized earthquake when triggered.
24// The earthquake effect is visible to the user as the shaking of his screen.
25//
26
27#pragma once
28
29#include "g_local.h"
30#include "trigger.h"
31
32#define EARTHQUAKE_STRENGTH 50
33
34class ViewJitter : public Trigger
35{
36protected:
37 float m_fRadius;
38 float m_fEdgeEffect;
39 Vector m_vJitterStrength;
40 float m_fDuration;
41 Vector m_vTimeDecay;
42 qboolean m_bDoneDeath;
43 float m_fTimeRunning;
44
45public:
46 CLASS_PROTOTYPE(ViewJitter);
47
48 ViewJitter();
49 ViewJitter(
50 Vector vOrigin,
51 float fRadius,
52 float fEdgeEffect,
53 Vector vStrength,
54 float fDuration,
55 Vector vTimeDecay,
56 float fStartDecay
57 );
58
59 void EventActivateJitter(Event *ev);
60 void EventJitterThink(Event *ev);
61 void EventSetRadius(Event *ev);
62 void EventSetEdgeEffect(Event *ev);
63 void EventSetAmount(Event *ev);
64 void EventSetDuration(Event *ev);
65 void EventSetTimeDecay(Event *ev);
66 void EventSetDoneDeath(Event *ev);
67
68 void Archive(Archiver& arc) override;
69};
70
71inline void ViewJitter::Archive(Archiver& arc)
72{
73 Trigger::Archive(arc);
74
75 arc.ArchiveFloat(&m_fRadius);
76 arc.ArchiveFloat(&m_fEdgeEffect);
77 arc.ArchiveVector(&m_vJitterStrength);
78 arc.ArchiveFloat(&m_fDuration);
79 arc.ArchiveVector(&m_vTimeDecay);
80 arc.ArchiveBoolean(&m_bDoneDeath);
81 arc.ArchiveFloat(&m_fTimeRunning);
82}
Definition archive.h:86
Definition listener.h:246
Definition vector.h:61