ScummVM API documentation
GameDamageArea.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * Copyright (C) 2006-2010 - Frictional Games
24  *
25  * This file is part of Penumbra Overture.
26  */
27 
28 #ifndef GAME_GAME_DAMAGE_AREA_H
29 #define GAME_GAME_DAMAGE_AREA_H
30 
31 #include "hpl1/engine/engine.h"
32 #include "hpl1/penumbra-overture/GameEntity.h"
33 
34 using namespace hpl;
35 
36 //------------------------------------------
37 
39  kSerializableClassInit(cGameDamageArea_SaveData);
40 
41 public:
42  cVector3f mvSize;
43 
44  float mfDamage;
45  float mfUpdatesPerSec;
46  int mlStrength;
47  bool mbDisableObjects;
48  bool mbDisableEnemies;
49 
50  iGameEntity *CreateEntity();
51 };
52 
53 //------------------------------------------
54 
55 class cGameDamageArea : public iGameEntity {
56  typedef iGameEntity super;
57  friend class cAreaLoader_GameDamageArea;
58 
59 public:
60  cGameDamageArea(cInit *apInit, const tString &asName);
61  ~cGameDamageArea(void);
62 
63  void OnPlayerPick();
64 
65  void Update(float afTimeStep);
66 
67  void SetDamage(float afX) { mfDamage = afX; }
68  void SetUpdatesPerSec(float afX) { mfUpdatesPerSec = afX; }
69  void SetStrength(int alX) { mlStrength = alX; }
70  void SetDisableObjects(bool abX) { mbDisableObjects = abX; }
71  void SetDisableEnemies(bool abX) { mbDisableEnemies = abX; }
72 
73  // SaveObject implementation
74  iGameEntity_SaveData *CreateSaveData();
75  void SaveToSaveData(iGameEntity_SaveData *apSaveData);
76  void LoadFromSaveData(iGameEntity_SaveData *apSaveData);
77  void SetupSaveData(iGameEntity_SaveData *apSaveData);
78 
79 private:
80  float mfDamage;
81  float mfUpdatesPerSec;
82  int mlStrength;
83  bool mbDisableObjects;
84  bool mbDisableEnemies;
85 
86  float mfUpdateCount;
87 };
88 
89 //------------------------------------------
90 
92 
93 public:
94  cAreaLoader_GameDamageArea(const tString &asName, cInit *apInit);
96 
97  iEntity3D *Load(const tString &asName, const cVector3f &avSize, const cMatrixf &a_mtxTransform, cWorld3D *apWorld);
98 
99 private:
100  cInit *mpInit;
101 };
102 
103 #endif // GAME_GAME_DAMAGE_AREA_H
Definition: AI.h:36
Definition: str.h:59
Definition: GameDamageArea.h:55
Definition: GameDamageArea.h:91
Definition: GameEntity.h:76
Definition: GameDamageArea.h:38
Definition: World3D.h:179
Definition: Entity3D.h:81
Definition: Resources.h:133
Definition: GameEntity.h:126
Definition: Init.h:70