OpenMoHAA 0.82.0
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 {
35protected:
36 float m_fRadius;
37 float m_fEdgeEffect;
38 Vector m_vJitterStrength;
39 float m_fDuration;
40 Vector m_vTimeDecay;
41 qboolean m_bDoneDeath;
42 float m_fTimeRunning;
43
44public:
45 CLASS_PROTOTYPE( ViewJitter );
46
47 ViewJitter();
48 ViewJitter( Vector vOrigin, float fRadius, float fEdgeEffect, Vector vStrength, float fDuration, Vector vTimeDecay, float fStartDecay );
49
50 void EventActivateJitter( Event *ev );
51 void EventJitterThink( Event *ev );
52 void EventSetRadius( Event *ev );
53 void EventSetEdgeEffect( Event *ev );
54 void EventSetAmount( Event *ev );
55 void EventSetDuration( Event *ev );
56 void EventSetTimeDecay( Event *ev );
57 void EventSetDoneDeath( Event *ev );
58
59 void Archive( Archiver& arc ) override;
60};
61
62inline void ViewJitter::Archive
63 (
64 Archiver &arc
65 )
66{
67 Trigger::Archive( arc );
68
69 arc.ArchiveFloat( &m_fRadius );
70 arc.ArchiveFloat( &m_fEdgeEffect );
71 arc.ArchiveVector( &m_vJitterStrength );
72 arc.ArchiveFloat( &m_fDuration );
73 arc.ArchiveVector( &m_vTimeDecay );
74 arc.ArchiveBoolean( &m_bDoneDeath );
75 arc.ArchiveFloat( &m_fTimeRunning );
76}
Definition archive.h:86
Definition listener.h:246
Definition vector.h:61