25#ifndef PEGASUS_ITEMS_ITEM_H
26#define PEGASUS_ITEMS_ITEM_H
28#include "common/endian.h"
30#include "pegasus/types.h"
31#include "pegasus/util.h"
37 class SeekableReadStream;
45 TimeValue infoLeftTime;
46 TimeValue infoRightStart;
47 TimeValue infoRightStop;
48 uint32 dragSpriteNormalID;
49 uint32 dragSpriteUsedID;
68static const short kLeftAreaExtra = 0;
69static const short kMiddleAreaExtra = 1;
70static const short kRightAreaExtra = 2;
88static const uint32 kItemInfoResType =
MKTAG(
'I',
't',
'e',
'm');
89static const uint32 kLeftAreaInfoResType =
MKTAG(
'L',
'e',
'f',
't');
90static const uint32 kMiddleAreaInfoResType =
MKTAG(
'M',
'i',
'd',
'l');
91static const uint32 kRightAreaInfoResType =
MKTAG(
'R',
'g',
'h',
't');
92static const uint32 kItemExtraInfoResType =
MKTAG(
'I',
'X',
't',
'r');
94static const uint16 kItemBaseResID = 128;
98static const ItemID kAirMask = 7;
99static const ItemID kAntidote = 8;
100static const ItemID kArgonCanister = 9;
101static const ItemID kCardBomb = 10;
102static const ItemID kCrowbar = 11;
103static const ItemID kGasCanister = 12;
104static const ItemID kHistoricalLog = 13;
105static const ItemID kJourneymanKey = 14;
106static const ItemID kKeyCard = 15;
107static const ItemID kMachineGun = 16;
108static const ItemID kMarsCard = 17;
109static const ItemID kNitrogenCanister = 18;
110static const ItemID kOrangeJuiceGlassFull = 19;
111static const ItemID kOrangeJuiceGlassEmpty = 20;
112static const ItemID kPoisonDart = 21;
113static const ItemID kSinclairKey = 22;
114static const ItemID kStunGun = 23;
115static const ItemID kArgonPickup = 24;
119static const ItemID kAIBiochip = 0;
120static const ItemID kArthurBiochip = 1;
121static const ItemID kInterfaceBiochip = 1;
122static const ItemID kMapBiochip = 2;
123static const ItemID kOpticalBiochip = 3;
124static const ItemID kPegasusBiochip = 4;
125static const ItemID kRetinalScanBiochip = 5;
126static const ItemID kShieldBiochip = 6;
128static const ItemID kNumItems = 25;
132static const ItemState kAI000 = 0;
133static const ItemState kAI005 = 1;
134static const ItemState kAI006 = 2;
135static const ItemState kAI010 = 3;
136static const ItemState kAI015 = 4;
137static const ItemState kAI016 = 5;
138static const ItemState kAI020 = 6;
139static const ItemState kAI024 = 7;
140static const ItemState kAI100 = 8;
141static const ItemState kAI101 = 9;
142static const ItemState kAI105 = 10;
143static const ItemState kAI106 = 11;
144static const ItemState kAI110 = 12;
145static const ItemState kAI111 = 13;
146static const ItemState kAI115 = 14;
147static const ItemState kAI116 = 15;
148static const ItemState kAI120 = 16;
149static const ItemState kAI121 = 17;
150static const ItemState kAI124 = 18;
151static const ItemState kAI125 = 19;
152static const ItemState kAI126 = 20;
153static const ItemState kAI200 = 21;
154static const ItemState kAI201 = 22;
155static const ItemState kAI202 = 23;
156static const ItemState kAI205 = 24;
157static const ItemState kAI206 = 25;
158static const ItemState kAI210 = 26;
159static const ItemState kAI211 = 27;
160static const ItemState kAI212 = 28;
161static const ItemState kAI215 = 29;
162static const ItemState kAI216 = 30;
163static const ItemState kAI220 = 31;
164static const ItemState kAI221 = 32;
165static const ItemState kAI222 = 33;
166static const ItemState kAI224 = 34;
167static const ItemState kAI225 = 35;
168static const ItemState kAI226 = 36;
169static const ItemState kAI300 = 37;
170static const ItemState kAI301 = 38;
171static const ItemState kAI302 = 39;
172static const ItemState kAI303 = 40;
173static const ItemState kAI305 = 41;
174static const ItemState kAI306 = 42;
175static const ItemState kAI310 = 43;
176static const ItemState kAI311 = 44;
177static const ItemState kAI312 = 45;
178static const ItemState kAI313 = 46;
179static const ItemState kAI315 = 47;
180static const ItemState kAI316 = 48;
181static const ItemState kAI320 = 49;
182static const ItemState kAI321 = 50;
183static const ItemState kAI322 = 51;
184static const ItemState kAI323 = 52;
185static const ItemState kAI324 = 53;
186static const ItemState kAI325 = 54;
187static const ItemState kAI326 = 55;
188static const ItemState kNormalItem = 56;
189static const ItemState kMapUnavailable = 57;
190static const ItemState kMapEngaged = 58;
191static const ItemState kOptical000 = 59;
192static const ItemState kOptical001 = 60;
193static const ItemState kOptical002 = 61;
194static const ItemState kOptical010 = 62;
195static const ItemState kOptical011 = 63;
196static const ItemState kOptical012 = 64;
197static const ItemState kOptical020 = 65;
198static const ItemState kOptical021 = 66;
199static const ItemState kOptical100 = 67;
200static const ItemState kOptical101 = 68;
201static const ItemState kOptical102 = 69;
202static const ItemState kOptical110 = 70;
203static const ItemState kOptical111 = 71;
204static const ItemState kOptical112 = 72;
205static const ItemState kOptical120 = 73;
206static const ItemState kOptical121 = 74;
207static const ItemState kOptical200 = 75;
208static const ItemState kOptical201 = 76;
209static const ItemState kOptical210 = 77;
210static const ItemState kOptical211 = 78;
211static const ItemState kPegasusTSA00 = 79;
212static const ItemState kPegasusTSA10 = 80;
213static const ItemState kPegasusPrehistoric00 = 81;
214static const ItemState kPegasusPrehistoric01 = 82;
215static const ItemState kPegasusPrehistoric10 = 83;
216static const ItemState kPegasusPrehistoric11 = 84;
217static const ItemState kPegasusMars00 = 85;
218static const ItemState kPegasusMars01 = 86;
219static const ItemState kPegasusMars10 = 87;
220static const ItemState kPegasusMars11 = 88;
221static const ItemState kPegasusNorad00 = 89;
222static const ItemState kPegasusNorad01 = 90;
223static const ItemState kPegasusNorad10 = 91;
224static const ItemState kPegasusNorad11 = 92;
225static const ItemState kPegasusWSC00 = 93;
226static const ItemState kPegasusWSC01 = 94;
227static const ItemState kPegasusWSC10 = 95;
228static const ItemState kPegasusWSC11 = 96;
229static const ItemState kPegasusCaldoria = 97;
230static const ItemState kRetinalSimulating = 98;
231static const ItemState kShieldNormal = 99;
232static const ItemState kShieldRadiation = 100;
233static const ItemState kShieldPlasma = 101;
234static const ItemState kShieldCardBomb = 102;
235static const ItemState kShieldDraining = 103;
236static const ItemState kAirMaskEmptyOff = 104;
237static const ItemState kAirMaskEmptyFilter = 105;
238static const ItemState kAirMaskLowOff = 106;
239static const ItemState kAirMaskLowFilter = 107;
240static const ItemState kAirMaskLowOn = 108;
241static const ItemState kAirMaskFullOff = 109;
242static const ItemState kAirMaskFullFilter = 110;
243static const ItemState kAirMaskFullOn = 111;
244static const ItemState kArgonEmpty = 112;
245static const ItemState kArgonFull = 113;
246static const ItemState kFlashlightOff = 114;
247static const ItemState kFlashlightOn = 115;
248static const ItemState kNitrogenEmpty = 116;
249static const ItemState kNitrogenFull = 117;
250static const ItemState kFullGlass = 118;
251static const ItemState kArthur000 = 119;
252static const ItemState kArthur002 = 120;
253static const ItemState kArthur010 = 121;
254static const ItemState kArthur012 = 122;
255static const ItemState kArthur100 = 123;
256static const ItemState kArthur102 = 124;
257static const ItemState kArthur110 = 125;
258static const ItemState kArthur112 = 126;
262static const uint32 kRetinalScanSearching = 0;
263static const uint32 kRetinalScanActivated = 1;
264static const uint32 kShieldIntro = 2;
265static const uint32 kRemoveAirMask = 3;
266static const uint32 kRemoveArgon = 4;
267static const uint32 kRemoveCrowbar = 5;
268static const uint32 kGasCanLoop = 6;
269static const uint32 kRemoveJourneymanKey = 7;
270static const uint32 kRemoveMarsCard = 8;
271static const uint32 kRemoveNitrogen = 9;
272static const uint32 kRemoveGlass = 10;
273static const uint32 kRemoveDart = 11;
274static const uint32 kRemoveSinclairKey = 12;
296 Item(
const ItemID
id,
const NeighborhoodID neighborhood,
const RoomID room,
const DirectionConstant direction);
304 virtual ActorID getItemOwner()
const;
305 virtual void setItemOwner(
const ActorID owner);
307 void getItemRoom(NeighborhoodID &neighborhood, RoomID &room, DirectionConstant &direction)
const;
308 void setItemRoom(
const NeighborhoodID neighborhood,
const RoomID room,
const DirectionConstant direction);
309 NeighborhoodID getItemNeighborhood()
const;
311 virtual WeightType getItemWeight();
313 virtual void setItemState(
const ItemState state);
314 virtual ItemState getItemState()
const;
316 virtual ItemType getItemType() = 0;
318 TimeValue getInfoLeftTime()
const;
319 void getInfoRightTimes(TimeValue &, TimeValue &)
const;
320 TimeValue getSharedAreaTime()
const;
322 Sprite *getDragSprite(
const DisplayElementID)
const;
332 virtual void select();
333 virtual void deselect();
334 virtual bool isSelected() {
return _isSelected; }
336 virtual void activate() { _isActive =
true; }
337 virtual bool isActive() {
return _isActive; }
338 virtual void pickedUp() {}
339 virtual void addedToInventory() {}
340 virtual void removedFromInventory() {}
341 virtual void dropped() {}
345 virtual void giveUpSharedArea() {}
346 virtual void takeSharedArea() {}
354 NeighborhoodID _itemNeighborhood;
356 DirectionConstant _itemDirection;
357 ActorID _itemOwnerID;
358 WeightType _itemWeight;
359 ItemState _itemState;
361 NeighborhoodID _originalNeighborhood;
362 RoomID _originalRoom;
363 DirectionConstant _originalDirection;
371 static void getItemStateEntry(
ItemStateInfo, uint32, ItemState &, TimeValue &);
372 static void findItemStateEntryByState(
ItemStateInfo, ItemState, TimeValue &);
Definition: elements.h:168
#define MKTAG(a0, a1, a2, a3)
Definition: endian.h:188
Definition: algorithm.h:29