ScummVM API documentation
GameItemType.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_ITEM_TYPE_H
29 #define GAME_GAME_ITEM_TYPE_H
30 
31 #include "hpl1/engine/engine.h"
32 
33 using namespace hpl;
34 
35 #include "hpl1/penumbra-overture/GameTypes.h"
36 #include "hpl1/penumbra-overture/PlayerHelper.h"
37 
38 class cInit;
39 class cInventoryItem;
40 class iGameEntity;
41 class cGameItem;
42 
43 //----------------------------------------------
44 
46 public:
47  cGameItemType(cInit *apInit);
48  virtual ~cGameItemType();
49 
50  tWStringVec *GetActions(bool mbCanBeDropped) {
51  if (mbCanBeDropped)
52  return &mvActions;
53  else
54  return &mvNonDropActions;
55  }
56 
57  virtual bool OnPickUp(cInventoryItem *apItem, bool abInGame) { return true; }
58 
59  virtual bool OnAction(cInventoryItem *apItem, int alActionNum) { return true; }
60 
61  virtual void OnUse(cInventoryItem *apItem, iGameEntity *apEntity) {}
62 
63  virtual tString GetShortCutAction(cInventoryItem *apItem) { return ""; }
64 
65  virtual tWString GetString(cInventoryItem *apItem) { return _W(""); }
66 
67 protected:
68  cInit *mpInit;
69 
70  tWStringVec mvActions;
71  tWStringVec mvNonDropActions;
72 };
73 
74 //----------------------------------------------
75 // NORMAL
76 
78 public:
79  cGameItemType_Normal(cInit *apInit);
80 
81  bool OnAction(cInventoryItem *apItem, int alActionNum);
82 
83  void OnUse(cInventoryItem *apItem, iGameEntity *apEntity);
84 };
85 
86 //----------------------------------------------
87 // NOTEBOOK
88 
90 public:
92 
93  bool OnPickUp(cInventoryItem *apItem, bool abInGame);
94  bool OnAction(cInventoryItem *apItem, int alActionNum);
95 
96  tString GetShortCutAction(cInventoryItem *apItem) { return "NoteBook"; }
97 };
98 
99 //----------------------------------------------
100 // NOTE
101 
103 public:
104  cGameItemType_Note(cInit *apInit);
105 
106  bool OnPickUp(cInventoryItem *apItem, bool abInGame);
107 };
108 
109 //----------------------------------------------
110 
111 // BATTERY
112 
114 public:
115  cGameItemType_Battery(cInit *apInit);
116 
117  bool OnPickUp(cInventoryItem *apItem, bool abInGame);
118 };
119 //----------------------------------------------
120 
121 // FLASHLIGHT
122 
124 public:
126 
127  bool OnAction(cInventoryItem *apItem, int alActionNum);
128 
129  tWString GetString(cInventoryItem *apItem);
130 
131  tString GetShortCutAction(cInventoryItem *apItem) { return "Flashlight"; }
132 };
133 
134 //----------------------------------------------
135 
136 // WEAPON MELEE
137 
139 public:
141 
142  bool OnAction(cInventoryItem *apItem, int alActionNum);
143 };
144 
145 //----------------------------------------------
146 
147 // THROW
148 
150 public:
151  cGameItemType_Throw(cInit *apInit);
152 
153  bool OnAction(cInventoryItem *apItem, int alActionNum);
154 };
155 
156 //----------------------------------------------
157 
158 // GLOW STICK
159 
161 public:
163 
164  bool OnAction(cInventoryItem *apItem, int alActionNum);
165 
166  tWString GetString(cInventoryItem *apItem);
167 
168  tString GetShortCutAction(cInventoryItem *apItem) { return "GlowStick"; }
169 };
170 
171 //----------------------------------------------
172 
173 // FLARE
174 
176 public:
177  cGameItemType_Flare(cInit *apInit);
178 
179  bool OnAction(cInventoryItem *apItem, int alActionNum);
180 };
181 
182 //----------------------------------------------
183 
184 // PAINKILLERS
185 
187 public:
189 
190  bool OnAction(cInventoryItem *apItem, int alActionNum);
191 };
192 
193 //----------------------------------------------
194 
195 #endif // GAME_GAME_ITEM_TYPE_H
Definition: AI.h:36
Definition: str.h:59
Definition: GameItemType.h:77
Definition: GameItemType.h:89
Definition: GameItemType.h:186
Definition: GameItem.h:62
Definition: GameItemType.h:123
Definition: GameItemType.h:160
Definition: GameItemType.h:45
Definition: GameItemType.h:102
Definition: ustr.h:57
Definition: Inventory.h:123
Definition: GameItemType.h:113
Definition: GameItemType.h:138
Definition: GameItemType.h:149
Definition: GameEntity.h:126
Definition: Init.h:70
Definition: GameItemType.h:175