Emergency 20 Dokumentation  4.2.0
MainEvent14.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
14 
15 #include <qsf/job/JobProxy.h>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23 
24 
25  //[-------------------------------------------------------]
26  //[ Classes ]
27  //[-------------------------------------------------------]
32  class MainEvent14 : public MainEvent
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Friends ]
38  //[-------------------------------------------------------]
39  friend class MainEventMetaclasses; // CAMP export of editable values for Game Design
40 
41 
42  //[-------------------------------------------------------]
43  //[ Public definitions ]
44  //[-------------------------------------------------------]
45  public:
46  static const uint32 FREEPLAY_EVENT_ID;
47 
48 
49  //[-------------------------------------------------------]
50  //[ Public methods ]
51  //[-------------------------------------------------------]
52  public:
57  MainEvent14();
58 
63  virtual ~MainEvent14();
64 
65 
66  //[-------------------------------------------------------]
67  //[ Public virtual em5::FreeplayEvent methods ]
68  //[-------------------------------------------------------]
69  public:
70  //[-------------------------------------------------------]
71  //[ Life cycle ]
72  //[-------------------------------------------------------]
73  virtual bool onStartup() override;
74  virtual void onRun() override;
75  virtual bool onSuccess(EventResult& eventResult) override;
76  virtual bool onFailure(EventResult& eventResult) override;
77 
78  //[-------------------------------------------------------]
79  //[ Points evaluation ]
80  //[-------------------------------------------------------]
81  virtual uint32 calculatePointGain(EventResult& eventResult) override;
82 
83  //[-------------------------------------------------------]
84  //[ Callbacks from observers ]
85  //[-------------------------------------------------------]
86  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
87  virtual void hintCallback(Observer& hintObserver) override;
88 
89  //[-------------------------------------------------------]
90  //[ Miscellaneous ]
91  //[-------------------------------------------------------]
92  virtual const qsf::Entity* getFocusEntity() override;
93 
94 
95  //[-------------------------------------------------------]
96  //[ Protected virtual em5::MainEvent methods ]
97  //[-------------------------------------------------------]
98  protected:
99  virtual void onIntroFinished(const qsf::MessageParameters& parameters) override;
100  virtual void onPrologueFinished(const qsf::MessageParameters& parameters) override;
101  virtual void onUpdateMusic(const qsf::Time& timePassed) override;
102  virtual uint32 getEventNumber() override;
103 
104 
105  //[-------------------------------------------------------]
106  //[ Private methods ]
107  //[-------------------------------------------------------]
108  private:
109  void gatherEventEntities();
110 
111  void updateBridgeWomanCountdown(const qsf::JobArguments& jobArguments);
112  void onBridgeWomanSaved();
113  void onBridgeWomanSavedPlacedFromDLK();
114  void onBarrelExtinguishStarted(const qsf::MessageParameters& parameters);
115  void onBarrelExtinguishFinished(const qsf::MessageParameters& parameters);
116  void onCivilianDied(const qsf::MessageParameters& parameters);
117 
118  void startObjectives();
119  void defineObjectives();
120  void startHintObservers();
121 
122  void startFinalCutscene(const std::string* cutscene);
123  void endFinalCutscene();
124 
125  bool isBarrelEntity(uint64 barrelEntityId) const;
126 
127 
128  //[-------------------------------------------------------]
129  //[ Private data ]
130  //[-------------------------------------------------------]
131  private:
132  qsf::JobProxy mBridgeWomanProxy;
133  qsf::MessageProxy mBridgeWomanSaveProxy;
134  qsf::Entity* mBridgeWoman;
135  qsf::Entity* mBridgeWomanJumpTarget;
136  bool mBridgeWomanSaved;
137  std::vector<qsf::Entity*> mCrashcarVictims;
138  std::vector<qsf::Entity*> mVictims;
139  std::vector<qsf::Entity*> mBurningAtStart;
140  std::vector<qsf::Entity*> mCrashcars;
141  std::vector<qsf::Entity*> mBarrels;
142 
143  qsf::MessageProxy mDecontaminatedProxy;
144  qsf::MessageProxy mBarrelExtinguishObserver;
145  qsf::MessageProxy mBarrelExtinguishFinishedObserver;
146  qsf::MessageProxy mCivilianDiedObserver;
147 
148  // Connected to CAMP
149 
150  uint32 mMaxDeadCivilians;
151  uint32 mMaxContaminatedCivils;
152  uint32 mMaxInjuredSquadUnits;
153  uint32 mMaxDeadSquadUnits;
154  qsf::Time mWomanFallCounter;
155  qsf::Time mWomanFallTime;
156 
157  float mHint01LifeEnergy;
158  float mHint02LifeEnergy;
159  float mHint17LifeEnergy;
160  float mHint04LifeEnergy;
161  qsf::Time mHint08WaitTime;
162 
163  bool mHint01Triggered;
164  bool mHint02Triggered;
165  bool mHint17Triggered;
166  bool mHint04Triggered;
167  bool mHint08Triggered;
168  bool mHint09Triggered;
169  bool mHint14Triggered;
170  bool mHint15Triggered;
171 
172 
173  //[-------------------------------------------------------]
174  //[ CAMP reflection system ]
175  //[-------------------------------------------------------]
176  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
177 
178 
179  };
180 
181 
182 //[-------------------------------------------------------]
183 //[ Namespace ]
184 //[-------------------------------------------------------]
185 } // em5
186 
187 
188 //[-------------------------------------------------------]
189 //[ CAMP reflection system ]
190 //[-------------------------------------------------------]
EMERGENCY 5 main event 14 "Earthquake".
Definition: MainEvent14.h:32
Definition: ActionPriority.h:13
EMERGENCY 5 observer base class.
Definition: Observer.h:41
Definition: FreeplayEvent.h:110
Job proxy class.
Definition: JobProxy.h:51
virtual bool onSuccess(EventResult &eventResult) override
React to state change from running state to success state.
virtual bool onStartup() override
React to startup of the freeplay event.
virtual uint32 getEventNumber() override
Gets number of the main event (Is needed for the highscore management)
Entity class.
Definition: Entity.h:46
MainEvent14()
Default constructor.
Message parameters class.
Definition: MessageParameters.h:34
virtual void onPrologueFinished(const qsf::MessageParameters &parameters) override
React to the end of the prologue.
EMERGENCY 5 main event base class.
Definition: MainEvent.h:48
unsigned int uint32
Definition: PlatformTypes.h:181
virtual void onIntroFinished(const qsf::MessageParameters &parameters) override
React to the end of the intro; note that the prologue cutscene is played next.
Message listener proxy class.
Definition: MessageProxy.h:47
Reason
Definition: EventSpreadReason.h:20
uint64_t uint64
Definition: PlatformTypes.h:184
virtual void onUpdateMusic(const qsf::Time &timePassed) override
Gets called when the main event gets an update call We use here a separate update method...
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
virtual uint32 calculatePointGain(EventResult &eventResult) override
Calculate the point gain for this event.
static const uint32 FREEPLAY_EVENT_ID
"em5::MainEvent14" unique freeplay event ID
Definition: MainEvent14.h:46
virtual bool addEntityToEvent(qsf::Entity &targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override
React to adding to an entity to this event, i.e. setting the event ID for the entity.
virtual void hintCallback(Observer &hintObserver) override
Handle the activation of a hint observer.
Static CAMP main event plugin metaclass collection class.
Definition: MainEventMetaclasses.h:30
virtual const qsf::Entity * getFocusEntity() override
Get an event entity that is currently crucial for this event This is the entity which gets the focus ...
virtual void onRun() override
React to state change from (initial) hidden state to running state.
virtual ~MainEvent14()
Destructor.
virtual bool onFailure(EventResult &eventResult) override
React to state change from running state to failed state.
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32