Emergency 20 Dokumentation  4.2.0
MainEvent10.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 
16 //[-------------------------------------------------------]
17 //[ Namespace ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21 
22 
23  //[-------------------------------------------------------]
24  //[ Classes ]
25  //[-------------------------------------------------------]
30  class MainEvent10 : public MainEvent
31  {
32 
33 
34  //[-------------------------------------------------------]
35  //[ Friends ]
36  //[-------------------------------------------------------]
37  friend class MainEventMetaclasses; // CAMP export of editable values for Game Design
38 
39 
40  //[-------------------------------------------------------]
41  //[ Public definitions ]
42  //[-------------------------------------------------------]
43  public:
44  static const uint32 FREEPLAY_EVENT_ID;
45 
46 
47  //[-------------------------------------------------------]
48  //[ Public methods ]
49  //[-------------------------------------------------------]
50  public:
55  MainEvent10();
56 
61  virtual ~MainEvent10();
62 
63 
64  //[-------------------------------------------------------]
65  //[ Public virtual em5::FreeplayEvent methods ]
66  //[-------------------------------------------------------]
67  public:
68  //[-------------------------------------------------------]
69  //[ Life cycle ]
70  //[-------------------------------------------------------]
71  virtual bool onStartup() override;
72  virtual void onRun() override;
73  virtual bool onSuccess(EventResult& eventResult) override;
74  virtual bool onFailure(EventResult& eventResult) override;
75 
76  //[-------------------------------------------------------]
77  //[ Points evaluation ]
78  //[-------------------------------------------------------]
79  virtual uint32 calculatePointGain(EventResult& eventResult) override;
80 
81  //[-------------------------------------------------------]
82  //[ Callbacks from observers ]
83  //[-------------------------------------------------------]
84  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
85  virtual void hintCallback(Observer& hintObserver) override;
86 
87  //[-------------------------------------------------------]
88  //[ Miscellaneous ]
89  //[-------------------------------------------------------]
90  virtual const qsf::Entity* getFocusEntity() override;
91 
92 
93  //[-------------------------------------------------------]
94  //[ Protected virtual em5::MainEvent methods ]
95  //[-------------------------------------------------------]
96  protected:
97  virtual void onIntroFinished(const qsf::MessageParameters& parameters) override;
98  virtual void onUpdateMainEvent(const qsf::Time& timePassed) override;
99  virtual void onUpdateMusic(const qsf::Time& timePassed) override;
100  virtual uint32 getEventNumber() override;
101 
102 
103  //[-------------------------------------------------------]
104  //[ Private methods ]
105  //[-------------------------------------------------------]
106  private:
107  void gatherEventEntities();
108  void hurtPeopleIntro();
109 
110  void startObjectives();
111  void defineObjectives();
112  void startHintObservers();
113 
114  void onDebrisLifted(const qsf::MessageParameters& parameters);
115 
116  void startFinalCutscene(const std::string* cutscene);
117  void endFinalCutscene();
118 
119 
120  //[-------------------------------------------------------]
121  //[ Private data ]
122  //[-------------------------------------------------------]
123  private:
124  // Connected to CAMP
125 
126  std::vector<qsf::Entity*> mVictims; // Openly lying around and injured
127  std::vector<qsf::Entity*> mBlocks; // Blocks that may hide injured
128  std::vector<qsf::Entity*> mBuried; // Injured hiding under debris
129  std::vector<qsf::Entity*> mDrowning; // Drowning people
130  std::vector<qsf::Entity*> mBurningFromStart; // Fires to start at the beginning
131  std::vector<qsf::Entity*> mDestroyLight; // Entities to be destroyed lightly
132  std::vector<qsf::Entity*> mDestroyHeavy; // Entities to be destroyed heavily
133 
134  std::vector<std::string> mInjuriesOpenVictims; // Injuries of mVictims
135  std::vector<std::string> mInjuriesBuriedVictims; // Injuries of mBuried
136 
137  qsf::Entity* mFocusEntity;
138 
139  qsf::MessageProxy mHint02DebrisLiftedProxy;
140 
141  uint32 mAmountOfBuriedPeople;
142  uint32 mMaxDeadCivilPersons;
143  float mHint01LifeEnergy;
144  qsf::Time mHint02WaitTime;
145  float mHint03LifeEnergy;
146  float mHint05LifeEnergy;
147  qsf::Time mHint07WaitTime;
148  qsf::Time mHint08WaitTime;
149  qsf::Time mAchievementTime;
150 
151  bool mHint01Triggered;
152  bool mHint02Triggered;
153  bool mHint03Triggered;
154  bool mHint05Triggered;
155  bool mHint16Triggered;
156  bool mHint07Triggered;
157  bool mHint08Triggered;
158  bool mAchievementTimeOk;
159 
160 
161  //[-------------------------------------------------------]
162  //[ CAMP reflection system ]
163  //[-------------------------------------------------------]
164  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
165 
166 
167  };
168 
169 
170 //[-------------------------------------------------------]
171 //[ Namespace ]
172 //[-------------------------------------------------------]
173 } // em5
174 
175 
176 //[-------------------------------------------------------]
177 //[ CAMP reflection system ]
178 //[-------------------------------------------------------]
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 ...
Definition: ActionPriority.h:13
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...
EMERGENCY 5 observer base class.
Definition: Observer.h:41
Definition: FreeplayEvent.h:110
MainEvent10()
Default constructor.
Entity class.
Definition: Entity.h:46
Message parameters class.
Definition: MessageParameters.h:34
EMERGENCY 5 main event base class.
Definition: MainEvent.h:48
virtual uint32 calculatePointGain(EventResult &eventResult) override
Calculate the point gain for this event.
EMERGENCY 5 main event 10 "Plane Crash".
Definition: MainEvent10.h:30
virtual bool onStartup() override
React to startup of the freeplay event.
unsigned int uint32
Definition: PlatformTypes.h:181
virtual uint32 getEventNumber() override
Gets number of the main event (Is needed for the highscore management)
Message listener proxy class.
Definition: MessageProxy.h:47
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.
static const uint32 FREEPLAY_EVENT_ID
"em5::MainEvent10" unique freeplay event ID
Definition: MainEvent10.h:44
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
virtual bool onFailure(EventResult &eventResult) override
React to state change from running state to failed state.
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
virtual void onRun() override
React to state change from (initial) hidden state to running state.
virtual ~MainEvent10()
Destructor.
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.
virtual void onIntroFinished(const qsf::MessageParameters &parameters) override
React to the end of the intro; note that the prologue cutscene is played next.
Static CAMP main event plugin metaclass collection class.
Definition: MainEventMetaclasses.h:30
virtual void hintCallback(Observer &hintObserver) override
Handle the activation of a hint observer.
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32