Emergency 20 Dokumentation  4.2.0
HealthHelper.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 <boost/noncopyable.hpp>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23  class FreeplayEvent;
24 }
25 namespace qsf
26 {
27  class Entity;
28 }
29 
30 
31 //[-------------------------------------------------------]
32 //[ Namespace ]
33 //[-------------------------------------------------------]
34 namespace em5
35 {
36 
37 
38  //[-------------------------------------------------------]
39  //[ Classes ]
40  //[-------------------------------------------------------]
45  class EM5_API_EXPORT HealthHelper : public boost::noncopyable
46  {
47 
48 
49  //[-------------------------------------------------------]
50  //[ Public methods ]
51  //[-------------------------------------------------------]
52  public:
57  explicit HealthHelper(qsf::Entity& entity);
58  explicit HealthHelper(HealthComponent& healthComponent);
59 
64  inline ~HealthHelper();
65 
66  void drownPerson(FreeplayEvent* freeplayEvent);
67  bool injurePerson(uint32 injuryId, FreeplayEvent* freeplayEvent, bool playCollapseAnimation = true);
68 
69  bool canTreatedByDoctor();
70  bool isInjured();
71  bool isKneeingInjury();
72  bool isLyingInjury();
73  void setInvincible(bool invicible);
74  void setImmuneToInjurySources(bool injury, bool illness, bool contamination = true);
75  void linkToStretcher(const qsf::Entity& stretcherEntity);
76 
77  float getLifeEnergyPercentage();
78 
79  //[-------------------------------------------------------]
80  //[ Injure persons ]
81  //[-------------------------------------------------------]
86  bool injurePersonByEventById(uint32 injuryId, FreeplayEvent* freeplayEvent, bool playCollapseAnimation = true);
87 
92  bool injurePersonByInjuryAtStartup(FreeplayEvent* freeplayEvent, uint32 fallbackInjuryId = qsf::getUninitialized<uint32>(), bool playCollapseAnimation = true);
93 
98  bool injurePersonByFire(FreeplayEvent* freeplayEvent, bool playCollapseAnimation = true);
99 
104  bool injurePersonBySmoke(FreeplayEvent* freeplayEvent, bool playCollapseAnimation = true);
105 
110  bool injurePersonByDebris(FreeplayEvent* freeplayEvent);
111 
116  bool injurePersonByPlague(FreeplayEvent* freeplayEvent, bool playCollapseAnimation = true);
117 
122  bool injurePersonByContamination(FreeplayEvent* freeplayEvent, HealthComponent::ContaminationType contaminationType);
123 
128  bool injurePersonByHostageTaking(FreeplayEvent* freeplayEvent);
129 
134  bool injurePersonByShoot(FreeplayEvent* freeplayEvent);
135 
140  bool injurePersonByKnife(FreeplayEvent* freeplayEvent);
141 
146  bool injurePersonByBaseballBat(FreeplayEvent* freeplayEvent);
147 
152  bool injurePersonByStone(FreeplayEvent* freeplayEvent);
153 
158  bool injurePersonByBrawl(FreeplayEvent* freeplayEvent);
159 
164  bool injurePersonByElectricShock(FreeplayEvent* freeplayEvent);
165 
176  bool injurePersonBySender(qsf::Component* sender);
177 
178 
179  //[-------------------------------------------------------]
180  //[ Private data ]
181  //[-------------------------------------------------------]
182  private:
183  qsf::Entity& mEntity;
184  HealthComponent& mHealthComponent;
185 
186 
187  };
188 
189 
190 //[-------------------------------------------------------]
191 //[ Namespace ]
192 //[-------------------------------------------------------]
193 } // em5
194 
195 
196 //[-------------------------------------------------------]
197 //[ Implementation ]
198 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Abstract component class.
Definition: Component.h:105
Entity class.
Definition: Entity.h:46
unsigned int uint32
Definition: PlatformTypes.h:181
EMERGENCY 5 health helper class.
Definition: HealthHelper.h:45
#define EM5_API_EXPORT
Definition: Export.h:28
EMERGENCY 5 health component class.
Definition: HealthComponent.h:66
Definition: PickupPersonByParamedicAction.h:21
Definition: Injuries.h:26
ContaminationType
Definition: Injury.h:67
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66