Emergency 20 Dokumentation  4.2.0
MainEvent15.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 #include <qsf/base/WeakPtr.h>
17 
18 
19 //[-------------------------------------------------------]
20 //[ Namespace ]
21 //[-------------------------------------------------------]
22 namespace em5
23 {
24 
25 
26  //[-------------------------------------------------------]
27  //[ Classes ]
28  //[-------------------------------------------------------]
33  class MainEvent15 : public MainEvent
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Friends ]
39  //[-------------------------------------------------------]
40  friend class MainEventMetaclasses; // CAMP export of editable values for Game Design
41 
42 
43  //[-------------------------------------------------------]
44  //[ Public definitions ]
45  //[-------------------------------------------------------]
46  public:
47  static const uint32 FREEPLAY_EVENT_ID;
48 
49 
50  //[-------------------------------------------------------]
51  //[ Public methods ]
52  //[-------------------------------------------------------]
53  public:
58  MainEvent15();
59 
64  virtual ~MainEvent15();
65 
66  // Debug Function while the SEK Drone is not implemented
67  void debugGangsterFound();
68 
69 
70  //[-------------------------------------------------------]
71  //[ Public virtual em5::FreeplayEvent methods ]
72  //[-------------------------------------------------------]
73  public:
74  //[-------------------------------------------------------]
75  //[ Life cycle ]
76  //[-------------------------------------------------------]
77  virtual bool onStartup() override;
78  virtual void onShutdown() override;
79  virtual void onRun() override;
80  virtual bool onSuccess(EventResult& eventResult) override;
81  virtual bool onFailure(EventResult& eventResult) override;
82 
83  //[-------------------------------------------------------]
84  //[ Points evaluation ]
85  //[-------------------------------------------------------]
86  virtual uint32 calculatePointGain(EventResult& eventResult) override;
87 
88  //[-------------------------------------------------------]
89  //[ Callbacks from observers ]
90  //[-------------------------------------------------------]
91  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
92  virtual void hintCallback(Observer& hintObserver) override;
93  virtual void hintCallbackWithMessage(Observer& hintObserver, const qsf::MessageParameters& parameters) override;
94 
95  //[-------------------------------------------------------]
96  //[ Miscellaneous ]
97  //[-------------------------------------------------------]
98  virtual const qsf::Entity* getFocusEntity() override;
99 
100  //[-------------------------------------------------------]
101  //[ Serialize ]
102  //[-------------------------------------------------------]
103  virtual void serialize(qsf::BinarySerializer& serializer) override;
104 
105 
106  //[-------------------------------------------------------]
107  //[ Protected virtual em5::MainEvent methods ]
108  //[-------------------------------------------------------]
109  protected:
110  virtual void onIntroStart(const qsf::MessageParameters& parameters) override;
111  virtual void onIntroFinished(const qsf::MessageParameters& parameters) override;
112  virtual void onPrologueFinished(const qsf::MessageParameters& parameters) override;
113 
114  //[-------------------------------------------------------]
115  //[ Regular update ]
116  //[-------------------------------------------------------]
117  virtual void onUpdateMainEvent(const qsf::Time& timePassed) override;
118  virtual void onUpdateMusic(const qsf::Time& timePassed) override;
119 
120  virtual uint32 getEventNumber() override;
121 
122 
123  //[-------------------------------------------------------]
124  //[ Private methods ]
125  //[-------------------------------------------------------]
126  private:
127  void gatherEventEntities();
128 
129  void startObjectives();
130  void startHintObservers();
131 
132  void createAssassin();
133  void findGangster();
134 
135 
136  //[-------------------------------------------------------]
137  //[ Private data ]
138  //[-------------------------------------------------------]
139  private:
140  // Connected to CAMP
141  int mFail01Count;
142  qsf::Time mHint01WaitTime;
143  float mHint03LifeEnergy;
144  float mHint04LifeEnergy;
145  float mHint05LifeEnergy;
146  float mHint06LifeEnergy;
147  qsf::Time mHint08WaitTime;
148  qsf::Time mHint10WaitTime;
149  qsf::Time mAssassinEscapeTime;
150 
151  // Internal
152  qsf::Entity* mPresident;
153  std::vector<qsf::Entity*> mMIB;
154  qsf::Entity* mChancellor;
155  qsf::Entity* mChancellorBlock;
156  qsf::Entity* mCrashcar01;
157  qsf::Entity* mCrashcar02;
158  qsf::Entity* mCrashcar01Victim;
159  qsf::Entity* mCrashcar02Victim;
160  std::vector<qsf::Entity*> mStartFires;
161  std::vector<qsf::Entity*> mStartDestroyed;
162  std::vector<qsf::Entity*> mWindowPeople;
163  std::vector<qsf::Entity*> mGaper;
164  std::vector<qsf::Entity*> mHidingSpots;
165  qsf::Entity* mAssassinHidingSpot;
166  qsf::WeakPtr<qsf::Entity> mAssassin;
167  std::vector<qsf::Entity*> mBurnWarnings;
168  std::vector<qsf::Entity*> mBurnFails;
169 
170  bool mFoundAssassin;
171  bool mCutCarOpen;
172 
173  qsf::JobProxy mUpdateJobProxy;
174  qsf::Time mTimePassed;
175 
176  // Ending
177  bool mPlayingWinFadeOut;
178 
179 
180  //[-------------------------------------------------------]
181  //[ CAMP reflection system ]
182  //[-------------------------------------------------------]
183  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
184 
185 
186  };
187 
188 
189 //[-------------------------------------------------------]
190 //[ Namespace ]
191 //[-------------------------------------------------------]
192 } // em5
193 
194 
195 //[-------------------------------------------------------]
196 //[ CAMP reflection system ]
197 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 observer base class.
Definition: Observer.h:41
Definition: FreeplayEvent.h:110
Job proxy class.
Definition: JobProxy.h:51
Entity class.
Definition: Entity.h:46
Message parameters class.
Definition: MessageParameters.h:34
EMERGENCY 5 main event base class.
Definition: MainEvent.h:48
virtual void onPrologueFinished(const qsf::MessageParameters &parameters) override
React to the end of the prologue.
unsigned int uint32
Definition: PlatformTypes.h:181
virtual void onIntroStart(const qsf::MessageParameters &parameters) override
React to the activation of the black screen, which is the start of the intro cutscene.
static const uint32 FREEPLAY_EVENT_ID
"em5::MainEvent15" unique freeplay event ID
Definition: MainEvent15.h:47
virtual void hintCallback(Observer &hintObserver) override
Handle the activation of a hint observer.
virtual void onIntroFinished(const qsf::MessageParameters &parameters) override
React to the end of the intro; note that the prologue cutscene is played next.
void debugGangsterFound()
Reason
Definition: EventSpreadReason.h:20
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 uint32 calculatePointGain(EventResult &eventResult) override
Calculate the point gain for this event.
virtual bool onFailure(EventResult &eventResult) override
React to state change from running state to failed state.
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.
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
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...
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
virtual ~MainEvent15()
Destructor.
MainEvent15()
Default constructor.
virtual uint32 getEventNumber() override
Gets number of the main event (Is needed for the highscore management)
EMERGENCY 5 main event 15 "Assassination".
Definition: MainEvent15.h:33
virtual void onUpdateMainEvent(const qsf::Time &timePassed) override
Gets called when the main event gets an update call We use here a separate update method...
virtual bool onSuccess(EventResult &eventResult) override
React to state change from running state to success state.
Static CAMP main event plugin metaclass collection class.
Definition: MainEventMetaclasses.h:30
Binary serializer class.
Definition: BinarySerializer.h:35
virtual bool onStartup() override
React to startup of the freeplay event.
virtual void hintCallbackWithMessage(Observer &hintObserver, const qsf::MessageParameters &parameters) override
virtual void onShutdown() override
React to shutdown of the freeplay event.
virtual void serialize(qsf::BinarySerializer &serializer) override
Serialization using a binary serializer.
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32