ScummVM API documentation
objproto.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 * Based on the original sources
22 * Faery Tale II -- The Halls of the Dead
23 * (c) 1993-1996 The Wyrmkeep Entertainment Co.
24 */
25
26#ifndef SAGA2_OBJPROTO_H
27#define SAGA2_OBJPROTO_H
28
29#include "saga2/idtypes.h"
30#include "saga2/sprite.h"
31#include "saga2/spells.h"
32#include "saga2/effects.h"
33#include "saga2/tcoords.h"
34
35namespace Saga2 {
36
37class Actor;
38class gameObject;
39
40/* ===================================================================== *
41 Exports
42 * ===================================================================== */
43
44extern const int16 objectCount; // Number of elements in the object list
45extern int16 worldCount; // Number of elements in the world list
46
47#define Permanent ((uint8)255)
48
49/* ===================================================================== *
50 Object ID's
51 * ===================================================================== */
52
53// Various inline tests for object type
54
55inline bool isObject(ObjectID id) {
56 return (id < objectCount);
57}
58
59inline bool isActor(ObjectID id) {
60 return (id >= ActorBaseID && id < ActorBaseID + kActorCount);
61}
62
63inline bool isWorld(ObjectID id) {
64 return (id >= WorldBaseID && id < WorldBaseID + worldCount);
65}
66
67inline bool isActorOrWorld(ObjectID id) {
68 return (id >= ActorBaseID);
69}
70
71// Same as above but use object addresses instead of ID's
72
73class GameObject;
74class IntangibleContainerWindow;
75class ContainerWindow;
76class ActiveItem;
77class ObjectTarget;
78class Sector;
79class TimerList;
80class Timer;
81struct GameEvent;
82struct SenseInfo;
83class SensorList;
84class Sensor;
85struct ObjectSoundFXs;
86
87bool isObject(GameObject *);
88bool isActor(GameObject *);
89bool isWorld(GameObject *);
90
91/* ===================================================================== *
92 Location: Describes location of object within world or container
93 * ===================================================================== */
94
96 StaticTilePoint tile;
97 ObjectID context;
98
99 void set(TilePoint t, ObjectID con) {
100 tile.set(t.u, t.v, t.z);
101 context = con;
102 }
103};
104
105class Location : public TilePoint {
106public:
107 // context = the ObjectID of containing context
108 // (either a container or a world).
109 ObjectID _context;
110
111 /*
112 // Member functions to translate world coords into
113 // screen coords.
114 void screenPos( Point16 &screenCoords );
115 int16 screenDepth( void );
116
117 // returns true if it is within the view area of the current
118 // map.
119 bool visible( void );
120 */
121 // assign a position to a location without changing context
122 Location &operator=(TilePoint pos) {
123 u = pos.u;
124 v = pos.v;
125 z = pos.z;
126 return *this;
127 }
128
129 Location() : _context(0) {}
130
131 Location(int16 nu, int16 nv, int16 nz, ObjectID con) {
132 u = nu;
133 v = nv;
134 z = nz;
135 _context = con;
136 }
137
138 Location(TilePoint p, ObjectID con = 0) {
139 u = p.u;
140 v = p.v;
141 z = p.z;
142 _context = con;
143 }
144
146 u = l.tile.u;
147 v = l.tile.v;
148 z = l.tile.z;
149 _context = l.context;
150 }
151
152};
153
154/* ===================================================================== *
155 8-way facing directions
156 * ===================================================================== */
157
158inline bool isFlipped(Direction d) {
159 return (d > kDirDown);
160}
161
162/* ===================================================================== *
163 ProtoObj: Base class for all object prototypes.
164 * ===================================================================== */
165
166struct scriptCallFrame;
167
168// Since we want to be able to load prototypes from disk, but
169// still use virtual functions, we are going to divide the
170// prototype structure into two parts, one which has the data
171// and then a subclass which has all the functions.
172
174
175 // General behavior properties
176
177 int16 classType; // which C++ class to use.
178 uint16 script; // script to handle all objs of this type
179
180 // Appearance propertie
181
182 int16 nameIndex; // type name of object
183 uint16 iconSprite, // sprite # in inventory
184 groundSprite; // sprite # when on ground
185
186 uint8 colorMap[4]; // indirect color map
187
188 // Physical properties
189
190 uint8 mass, // how heavy it is
191 bulk, // how bulky it is
192 crossSection, // cross section width,
193 height, // height it extends above terrain
194 toughness, // how easily broken,
195 breakType; // what it breaks into
196
197 // Container properties
198
199 uint16 maxCapacity; // total space available
200 uint8 lockType; // type of key that opens
201 uint8 acceptableItems; // type of items that fit within
202
203 // Combat Properties (offensive)
204
205 uint8 weaponDamage,
206 weaponFireRate,
207 maximumRange,
208 missileType;
209
210 // Combat Properties (defensive)
211
212 uint8 whereWearable;
213 int8 damageAbsorbtion,
214 damageDivider,
215 defenseBonus;
216
217 // Magical / Energy properties
218
219 uint8 maxCharges, // max number of charges, or 0=infinity
220 chargeType; // charge type that can be used
221
222 // Packed flags
223
224 int16 flags;
225
226 // Flag definitions
227
228 enum protoFlags {
229 kObjPropMergeable = (1 << 0), // merge with similar objects
230 kObjPropRound = (1 << 1), // rolls easily down stairs
231 kObjPropFlammable = (1 << 2), // object can burn
232 kObjPropWeapon = (1 << 3), // can be wielded as weapon
233 kObjPropThrownWpn = (1 << 4), // it's a throwable weapon
234 kObjPropMissileWpn = (1 << 5), // it's a missile weapon
235 kObjPropCharges = (1 << 6), // it's a missile weapon
236 kObjPropEdible = (1 << 7), // can be eaten
237 kObjPropFlipped = (1 << 8), // flipped left/right on ground
238 kObjPropVisOpen = (1 << 9), // Object has separate "visible" sprite
239 kObjPropHidden = (1 << 10), // "How not to be seen".
240 kObjPropGhosted = (1 << 11), // Object permanently ghosted
241 kObjPropHardSurface = (1 << 12), // Object makes hard sound when struck
242 kObjPropNoSurface = (1 << 13) // Object makes no sound when struck (may grunt however)
243 };
244
245 int16 price; // object's price
246
247 union {
248 int16 heldSpriteBase; // sprite # when in hand
249 int16 appearanceType; // container appearance type
250 int16 ideaType; // idea stimulus type
251 };
252
253 int16 resistance; // resistance bits (see EFFECTS.H)
254 int16 immunity; // immunity bits (see EFFECTS.H)
255
256 uint8 soundFXClass; // index into sound effects table
257
258 uint8 reserved[7];
259
261 classType = 0;
262 script = 0;
263 nameIndex = 0;
264 iconSprite = 0;
265 groundSprite = 0;
266
267 for (int i = 0; i < 4; ++i)
268 colorMap[i] = 0;
269
270 mass = bulk = crossSection = height = toughness = breakType = 0;
271 maxCapacity = 0;
272 lockType = 0;
273 acceptableItems = 0;
274 weaponDamage = weaponFireRate = maximumRange = missileType = 0;
275 whereWearable = 0;
276 damageAbsorbtion = damageDivider = defenseBonus = 0;
277 maxCharges = chargeType = 0;
278 flags = 0;
279 price = 0;
280 heldSpriteBase = 0;
281 resistance = 0;
282 immunity = 0;
283 soundFXClass = 0;
284
285 for (int i = 0; i < 7; ++i)
286 reserved[i] = 0;
287 }
288
289 // Copy constructor
291 classType = proto.classType;
292 script = proto.script;
293 nameIndex = proto.nameIndex;
294 iconSprite = proto.iconSprite;
295 groundSprite = proto.groundSprite;
296
297 for (int i = 0; i < 4; ++i)
298 colorMap[i] = proto.colorMap[i];
299
300 mass = proto.mass;
301 bulk = proto.bulk;
302 crossSection = proto.crossSection;
303 height = proto.height;
304 toughness = proto.toughness;
305 breakType = proto.breakType;
306 maxCapacity = proto.maxCapacity;
307 lockType = proto.lockType;
308 acceptableItems = proto.acceptableItems;
309 weaponDamage = proto.weaponDamage;
310 weaponFireRate = proto.weaponFireRate;
311 maximumRange = proto.maximumRange;
312 missileType = proto.missileType;
313 whereWearable = proto.whereWearable;
314 damageAbsorbtion = proto.damageAbsorbtion;
315 damageDivider = proto.damageDivider;
316 defenseBonus = proto.defenseBonus;
317 maxCharges = proto.maxCharges;
318 chargeType = proto.chargeType;
319 flags = proto.flags;
320 price = proto.price;
321 heldSpriteBase = proto.heldSpriteBase;
322 resistance = proto.resistance;
323 immunity = proto.immunity;
324 soundFXClass = proto.soundFXClass;
325
326 for (int i = 0; i < 7; ++i)
327 reserved[i] = proto.reserved[i];
328 }
329
330 void load(Common::SeekableReadStream *stream) {
331 classType = stream->readSint16LE();
332 script = stream->readUint16LE();
333 nameIndex = stream->readSint16LE();
334 iconSprite = stream->readUint16LE();
335 groundSprite = stream->readUint16LE();
336
337 for (int i = 0; i < 4; ++i)
338 colorMap[i] = stream->readByte();
339
340 mass = stream->readByte();
341 bulk = stream->readByte();
342 crossSection = stream->readByte();
343 height = stream->readByte();
344 toughness = stream->readByte();
345 breakType = stream->readByte();
346 maxCapacity = stream->readUint16LE();
347 lockType = stream->readByte();
348 acceptableItems = stream->readByte();
349 weaponDamage = stream->readByte();
350 weaponFireRate = stream->readByte();
351 maximumRange = stream->readByte();
352 missileType = stream->readByte();
353 whereWearable = stream->readByte();
354 damageAbsorbtion = stream->readSByte();
355 damageDivider = stream->readSByte();
356 defenseBonus = stream->readSByte();
357 maxCharges = stream->readByte();
358 chargeType = stream->readByte();
359 flags = stream->readSint16LE();
360 price = stream->readSint16LE();
361 heldSpriteBase = stream->readSint16LE(); // union
362 resistance = stream->readSint16LE();
363 immunity = stream->readSint16LE();
364 soundFXClass = stream->readByte();
365
366 for (int i = 0; i < 7; ++i)
367 reserved[i] = stream->readByte();
368 }
369};
370
372
373 static uint8 *_nextAvailObj;
374
375
376 // container defines
377 // getable through virtual functions
378 // at appropriate subclasses
379private:
380 enum {
381 kViewableRows = 6,
382 kViewableCols = 4,
383 kMaxRows = 8,
384 kMaxCols = 4
385 };
386
387public:
388
389 enum containmentType {
390 kIsTangible = (1 << 0),
391 kIsContainer = (1 << 1),
392 kIsBottle = (1 << 2),
393 kIsFood = (1 << 3),
394 kIsWearable = (1 << 4),
395 kIsWeapon = (1 << 5),
396 kIsArmor = (1 << 6),
397 kIsDocument = (1 << 7),
398 kIsIntangible = (1 << 8),
399 kIsConcept = (1 << 9),
400 kIsPsych = (1 << 10),
401 kIsSpell = (1 << 11),
402 kIsSkill = (1 << 12),
403 kIsEnchantment = (1 << 13),
404 kIsTargetable = (1 << 14)
405 };
406
407// kludge: define earlier, incorrectly spelled names to correct spelling
408// REM: Later, do a global search and replace...
409#define isTangable kIsTangible
410#define isIntangable kIsIntangible
411
412 enum spriteTypes {
413 kObjOnGround = 0,
414 kObjInContainerView,
415 kObjAsMousePtr
416 };
417
418 // Member functions
419
420 // A constructor which takes the data loaded from the file
421 // and loads it into the various fields...
423 virtual ~ProtoObj() {}
424
425 // returns the containment type flags for this object
426 virtual uint16 containmentSet();
427
428 // returns true if this object can contain another object
429 virtual bool canContain(ObjectID dObj, ObjectID item);
430
431 // Determine if this object can contain another object at a specified
432 // slot
433 virtual bool canContainAt(
434 ObjectID dObj,
435 ObjectID item,
436 const TilePoint &where);
437
438 // Determine if this type of object is two handed
439 virtual bool isTwoHanded(ObjectID actor);
440
441 // Determine if this type of object is a missile
442 virtual bool isMissile();
443
444 virtual ObjectID placeObject();
445
446 // call the object's script
447 bool invokeScript(scriptCallFrame &);
448
449 // Handle object script in a standard fashion
450 int16 stdActionScript(int method,
451 ObjectID dObj,
452 ObjectID enactor,
453 ObjectID indirectObj);
454
455 int16 stdActionScript(int method,
456 ObjectID dObj,
457 ObjectID enactor,
458 ObjectID indirectObj,
459 int16 value);
460
461 // generic actions
462 // Use this object
463 bool use(ObjectID dObj, ObjectID enactor);
464 virtual bool setUseCursor(ObjectID dObj);
465 virtual bool useAction(ObjectID dObj, ObjectID enactor);
466
467 // Use this object on another object
468 bool useOn(ObjectID dObj, ObjectID enactor, ObjectID item);
469 virtual bool useOnAction(ObjectID dObj, ObjectID enactor, ObjectID item);
470
471 // Use this object on a tile activity instance
472 bool useOn(ObjectID dObj, ObjectID enactor, ActiveItem *item);
473 virtual bool useOnAction(ObjectID dObj, ObjectID enactor, ActiveItem *item);
474
475 // Use the object on a location
476 bool useOn(ObjectID dObj, ObjectID enactor, const Location &loc);
477 virtual bool useOnAction(ObjectID dObj, ObjectID enactor, const Location &loc);
478
479 // open this object
480 bool open(ObjectID dObj, ObjectID enactor);
481 virtual bool canOpen(ObjectID dObj, ObjectID enactor);
482 virtual bool openAction(ObjectID dObj, ObjectID enactor);
483
484 // close this object
485 bool close(ObjectID dObj, ObjectID enactor);
486 virtual bool closeAction(ObjectID dObj, ObjectID enactor);
487
488 // take this object
489 bool take(ObjectID dObj, ObjectID enactor, int16 num = 1);
490 virtual bool takeAction(ObjectID dObj, ObjectID enactor);
491 virtual bool takeAction(ObjectID dObj, ObjectID enactor, int16 num = 1);
492
493 // drop this object
494 bool drop(ObjectID dObj, ObjectID enactor, const Location &loc, int16 num = 1);
495 virtual bool canDropAt(
496 ObjectID dObj,
497 ObjectID enactor,
498 const Location &loc);
499 virtual bool dropAction(
500 ObjectID dObj,
501 ObjectID enactor,
502 const Location &loc,
503 int16 num = 1);
504
505 // drop this object onto another object and handle the result.
506 bool dropOn(ObjectID dObj, ObjectID enactor, ObjectID target, int16 num = 1);
507 virtual bool dropOnAction(
508 ObjectID dObj,
509 ObjectID enactor,
510 ObjectID target,
511 int count);
512
513 // drop this object onto a TAG
514 bool dropOn(
515 ObjectID dObj,
516 ObjectID enactor,
517 ActiveItem *target,
518 const Location &loc,
519 int16 num = 1);
520 virtual bool dropOnAction(
521 ObjectID dObj,
522 ObjectID enactor,
523 ActiveItem *target,
524 const Location &loc,
525 int16 num = 1);
526
527 // Strike another object with this object
528 bool strike(ObjectID dObj, ObjectID enactor, ObjectID item);
529 virtual bool strikeAction(
530 ObjectID dObj,
531 ObjectID enactor,
532 ObjectID item);
533
534 // Damage another object with this object
535 bool damage(ObjectID dObj, ObjectID enactor, ObjectID target);
536 virtual bool damageAction(
537 ObjectID dObj,
538 ObjectID enactor,
539 ObjectID target);
540
541 // Eat this object
542 bool eat(ObjectID dObj, ObjectID enactor);
543 virtual bool eatAction(ObjectID dObj, ObjectID enactor);
544
545 // Insert this object into another object
546 bool insert(ObjectID dObj, ObjectID enactor, ObjectID item);
547 virtual bool insertAction(ObjectID dObj, ObjectID enactor, ObjectID item);
548
549 // Remove this object from another object
550 bool remove(ObjectID dObj, ObjectID enactor);
551 virtual bool removeAction(ObjectID dObj, ObjectID enactor);
552
553 // Drop another object onto this one.
554 bool acceptDrop(ObjectID dObj, ObjectID enactor, ObjectID droppedObj, int count);
555 virtual bool acceptDropAction(
556 ObjectID dObj,
557 ObjectID enactor,
558 ObjectID droppedObj,
559 int count);
560
561 // Cause damage to this object directly
562 bool acceptDamage(
563 ObjectID dObj,
564 ObjectID enactor,
565 int8 absDamage,
566 effectDamageTypes dType = kDamageOther,
567 int8 dice = 0,
568 uint8 sides = 1,
569 int8 perDieMod = 0);
570 virtual bool acceptDamageAction(
571 ObjectID dObj,
572 ObjectID enactor,
573 int8 absDamage,
574 effectDamageTypes dType,
575 int8 dice,
576 uint8 sides,
577 int8 perDieMod);
578
579 bool acceptHealing(
580 ObjectID dObj,
581 ObjectID enactor,
582 int8 absHealing,
583 int8 dice = 0,
584 uint8 sides = 1,
585 int8 perDieMod = 0);
586 virtual bool acceptHealingAction(
587 ObjectID dObj,
588 ObjectID enactor,
589 int8 healing);
590
591 // Accept strike from another object (allows this object to cause
592 // damage to the striking object).
593 bool acceptStrike(
594 ObjectID dObj,
595 ObjectID enactor,
596 ObjectID strikingObj,
597 uint8 skillIndex);
598 virtual bool acceptStrikeAction(
599 ObjectID dObj,
600 ObjectID enactor,
601 ObjectID strikingObj,
602 uint8 skillIndex);
603
604 // Unlock or lock this object with a key.
605 bool acceptLockToggle(ObjectID dObj, ObjectID enactor, uint8 keyCode);
606 virtual bool canToggleLock(
607 ObjectID dObj,
608 ObjectID enactor,
609 uint8 keyCode);
610 virtual bool acceptLockToggleAction(ObjectID dObj, ObjectID enactor, uint8 keyCode);
611
612 // Mix this object with another.
613 bool acceptMix(ObjectID dObj, ObjectID enactor, ObjectID mixObj);
614 virtual bool acceptMixAction(
615 ObjectID dObj,
616 ObjectID enactor,
617 ObjectID mixObj);
618
619 // Insert another object into this object.
620 bool acceptInsertion(
621 ObjectID dObj,
622 ObjectID enactor,
623 ObjectID item,
624 int16 count);
625 virtual bool acceptInsertionAction(
626 ObjectID dObj,
627 ObjectID enactor,
628 ObjectID item,
629 int16 count);
630
631 // Insert another object into this object at a specified slot
632 bool acceptInsertionAt(
633 ObjectID dObj,
634 ObjectID enactor,
635 ObjectID item,
636 const TilePoint &where,
637 int16 num = 1);
638
639 virtual bool acceptInsertionAtAction(
640 ObjectID dObj,
641 ObjectID enactor,
642 ObjectID item,
643 const TilePoint &where,
644 int16 num = 1);
645
646 // Creates a color translation table for this object
647 virtual void getColorTranslation(ColorTable map);
648
649 // return the sprite data of amount 'count'
650 virtual ObjectSpriteInfo getSprite(GameObject *obj, spriteTypes spr, int16 count = -1);
651
652 // return the address of the sprite when held in hand
653 virtual Sprite *getOrientedSprite(GameObject *obj, int16 offset);
654
655 // Initiate an attack using this type of object
656 virtual void initiateAttack(ObjectID attacker, ObjectID target);
657
658 // Initiate a defense using this type of object
659 virtual void initiateDefense(
660 ObjectID defensiveObj,
661 ObjectID defender,
662 ObjectID attacker);
663
664 // Get a projectile from the missile weapon
665 virtual GameObject *getProjectile(ObjectID weapon, ObjectID enactor);
666
667 // Get a spell from a magic weapon
668 virtual GameObject *getSpell(ObjectID obj);
669
670 // Determine if this type of object can block an attack
671 virtual bool canBlock();
672
673 // Return a mask of bits indicating the directions relative to the
674 // wielders facing in which this object can defend
675 virtual uint8 defenseDirMask();
676
677 // Compute how much damage this defensive object will absorb
678 virtual uint8 adjustDamage(uint8 damage);
679
680 // Return the fight stance approriate to this weapon
681 virtual int16 fightStanceAction(ObjectID actor);
682
683 // Given an object sound effect record, which sound should be made
684 // when this object is damaged
685 virtual uint8 getDamageSound(const ObjectSoundFXs &soundFXs);
686
687 // Do the background processing, if needed, for this object.
688 // This will be called approximately once every 10 seconds
689 // (or whatever the background refresh period is).
690 virtual void doBackgroundUpdate(GameObject *obj);
691
692 virtual bool resists(effectResistTypes r) {
693 return resistance & (1 << r);
694 }
695 virtual bool isImmuneTo(effectImmuneTypes r) {
696 return immunity & (1 << r);
697 }
698
699 virtual bool makeSavingThrow() {
700 return false;
701 }
702
703 // Returns true if object in continuous use.
704 virtual bool isObjectBeingUsed(GameObject *obj);
705
706 // Determine if the specified object's 'use' slot is available within
707 // the specified actor
708 virtual bool useSlotAvailable(GameObject *obj, Actor *a);
709
710 // Get the value of the user's skill which applies to this
711 // object
712 virtual uint8 getSkillValue(ObjectID enactor);
713
714 // Cause the user's associated skill to grow
715 virtual void applySkillGrowth(ObjectID enactor, uint8 points = 1);
716
717 // this is to determine size of containers
718public:
719 virtual uint16 getViewableRows() {
720 return kViewableRows;
721 }
722 virtual uint16 getViewableCols() {
723 return kViewableCols;
724 }
725 virtual uint16 getMaxRows() {
726 return kMaxRows;
727 }
728 virtual uint16 getMaxCols() {
729 return kMaxCols;
730 }
731
732 // this returns the type of charge an item can have
733 int16 getChargeType() {
734 return chargeType;
735 }
736
737 virtual bool canFitBulkwise(GameObject *container, GameObject *obj);
738 virtual bool canFitMasswise(GameObject *container, GameObject *obj);
739
740 virtual uint16 massCapacity(GameObject *container);
741 virtual uint16 bulkCapacity(GameObject *container);
742};
743
744/* ======================================================================== *
745 InventoryProto: base class for all tangible object prototypes
746 * ======================================================================== */
747
748// hierarchy:
749// ProtoObj, InventoryProto
750
751class InventoryProto : public ProtoObj {
752public:
754 virtual ~InventoryProto() {}
755
756 virtual uint16 containmentSet();
757
758 virtual bool takeAction(ObjectID dObj, ObjectID enactor, int16 num = 1);
759
760 virtual bool canDropAt(
761 ObjectID dObj,
762 ObjectID enactor,
763 const Location &loc);
764 virtual bool dropAction(
765 ObjectID dObj,
766 ObjectID enactor,
767 const Location &loc,
768 int16 num = 1);
769
770 virtual bool dropOnAction(
771 ObjectID dObj,
772 ObjectID enactor,
773 ActiveItem *target,
774 const Location &loc,
775 int16 num = 1);
776
777 virtual bool acceptDropAction(
778 ObjectID dObj,
779 ObjectID enactor,
780 ObjectID droppedObj,
781 int count);
782
783 virtual bool acceptStrikeAction(
784 ObjectID dObj,
785 ObjectID enactor,
786 ObjectID strikingObj,
787 uint8 skillIndex);
788};
789
790/* ======================================================================== *
791 PhysicalContainerProto
792 * ======================================================================== */
793
794// hierarchy:
795// ProtoObj, InventoryProto, PhysicalContainerProto
796
797// Prototype class for physical object container
799private:
800 enum {
801 kViewableRows = 4,
802 kViewableCols = 4,
803 kMaxRows = 8,
804 kMaxCols = 4
805 };
806
807public:
809 virtual ~PhysicalContainerProto() {}
810
811 virtual uint16 containmentSet();
812
813 virtual bool canContain(ObjectID dObj, ObjectID item);
814 virtual bool canContainAt(
815 ObjectID dObj,
816 ObjectID item,
817 const TilePoint &where);
818
819 // Call open() if closed, or call close() if open.
820 virtual bool useAction(ObjectID dObj, ObjectID enactor);
821
822 // Open this object
823 virtual bool canOpen(ObjectID dObj, ObjectID enactor);
824 virtual bool openAction(ObjectID dObj, ObjectID enactor);
825
826 // Close this object
827 virtual bool closeAction(ObjectID dObj, ObjectID enactor);
828
829 // Unlock or lock object if keyCode == lockType
830 virtual bool canToggleLock(
831 ObjectID dObj,
832 ObjectID enactor,
833 uint8 keyCode);
834 virtual bool acceptLockToggleAction(ObjectID dObj, ObjectID enactor, uint8 keyCode);
835
836 // Insert another object into this object
837 bool acceptInsertionAction(
838 ObjectID dObj,
839 ObjectID enactor,
840 ObjectID item,
841 int16 num);
842
843 // Insert another object into this object at the specified slot
844 virtual bool acceptInsertionAtAction(
845 ObjectID dObj,
846 ObjectID enactor,
847 ObjectID item,
848 const TilePoint &where,
849 int16 num = 1);
850
851public:
852 virtual uint16 getViewableRows() {
853 return kViewableRows;
854 }
855 virtual uint16 getViewableCols() {
856 return kViewableCols;
857 }
858 virtual uint16 getMaxRows() {
859 return kMaxRows;
860 }
861 virtual uint16 getMaxCols() {
862 return kMaxCols;
863 }
864
865 virtual bool canFitBulkwise(GameObject *container, GameObject *obj);
866 virtual bool canFitMasswise(GameObject *container, GameObject *obj);
867
868 virtual uint16 massCapacity(GameObject *container);
869 virtual uint16 bulkCapacity(GameObject *container);
870};
871
872/* ======================================================================== *
873 KeyProto
874 * ======================================================================== */
875
876// hierarchy:
877// ProtoObj, InventoryProto, KeyProto
878
879// Prototype class for key objects
880class KeyProto : public InventoryProto {
881public:
883 virtual ~KeyProto() {}
884
885 // Set up targeting cursor
886 virtual bool setUseCursor(ObjectID dObj);
887
888 // Use key on lockable container
889 virtual bool useOnAction(ObjectID dObj, ObjectID enactor, ObjectID withObj);
890
891 // Use key on active terrain
892 virtual bool useOnAction(ObjectID dObj, ObjectID enactor, ActiveItem *withTAI);
893};
894
895/* ======================================================================== *
896 BottleProto
897 * ======================================================================== */
898
899// hierarchy:
900// ProtoObj, InventoryProto, BottleProto
901
903public:
905 virtual ~BottleProto() {}
906
907 virtual uint16 containmentSet();
908
909 // Drink From Bottle
910 virtual bool useAction(ObjectID dObj, ObjectID enactor);
911
912};
913
914/* ======================================================================== *
915 FoodProto
916 * ======================================================================== */
917
918// hierarchy:
919// ProtoObj, InventoryProto, FoodProto
920
921class FoodProto : public InventoryProto {
922public:
924 virtual ~FoodProto() {}
925
926 virtual uint16 containmentSet();
927
928 // Eat it
929 virtual bool useAction(ObjectID dObj, ObjectID enactor);
930
931};
932
933/* ======================================================================== *
934 WearableProto
935 * ======================================================================== */
936
937// hierarchy:
938// ProtoObj, InventoryProto, WearbleProto
939
941public:
943 virtual ~WearableProto() {}
944
945 virtual uint16 containmentSet();
946};
947
948/* ======================================================================== *
949 WeaponProto
950 * ======================================================================== */
951
952// hierarchy:
953// ProtoObj, InventoryProto, WeaponProto
954
956
957protected:
958 enum {
959 kInRangeRatingBonus = 4
960 };
961
962public:
964 virtual ~WeaponProto() {}
965
966 virtual uint16 containmentSet();
967
968 // return the address of the sprite when held in hand
969 virtual Sprite *getOrientedSprite(GameObject *obj, int16 offset);
970 weaponID getWeaponID();
971
972 // Returns true if object in continuous use.
973 bool isObjectBeingUsed(GameObject *obj);
974
975 // Rate this weapon's goodness for a specified attack situation
976 virtual uint8 weaponRating(
977 ObjectID weaponID,
978 ObjectID wielderID,
979 ObjectID targetID) = 0;
980};
981
982/* ======================================================================== *
983 MeleeWeaponProto
984 * ======================================================================== */
985
986// hierarchy:
987// ProtoObj, InventoryProto, WeaponProto, MeleeWeaponProto
988
990public:
992 virtual ~MeleeWeaponProto() {}
993
994 virtual bool useAction(ObjectID dObj, ObjectID enactor);
995 virtual bool useOnAction(ObjectID dObj, ObjectID enactor, ObjectID item);
996 virtual bool strikeAction(
997 ObjectID dObj,
998 ObjectID enactor,
999 ObjectID item);
1000 virtual bool damageAction(
1001 ObjectID dObj,
1002 ObjectID enactor,
1003 ObjectID target);
1004 virtual bool acceptDamageAction(
1005 ObjectID dObj,
1006 ObjectID enactor,
1007 int8 absDamage,
1008 effectDamageTypes dType,
1009 int8 dice,
1010 uint8 sides,
1011 int8 perDieMod);
1012
1013 // Determine if this type of weapon must be wielded with two hands
1014 // for the specified actor
1015 virtual bool isTwoHanded(ObjectID actor);
1016
1017 // Initiate a melee weapon attack motion
1018 virtual void initiateAttack(ObjectID attacker, ObjectID target);
1019 // Initiate a melee weapon parry motion
1020 virtual void initiateDefense(
1021 ObjectID defensiveObj,
1022 ObjectID defender,
1023 ObjectID attacker);
1024 // Melee weapons can block attacks
1025 virtual bool canBlock();
1026 // Return a mask of bits indicating the directions relative to the
1027 // wielders facing in which this object can defend
1028 virtual uint8 defenseDirMask();
1029
1030 // Determine if the specified object's 'use' slot is available within
1031 // the specified actor
1032 virtual bool useSlotAvailable(GameObject *obj, Actor *a);
1033
1034 // Rate this weapon's goodness for a specified attack situation
1035 virtual uint8 weaponRating(
1036 ObjectID weaponID,
1037 ObjectID wielderID,
1038 ObjectID targetID);
1039
1040 // Return the fight stance approriate to this weapon
1041 virtual int16 fightStanceAction(ObjectID actor);
1042
1043 // Given an object sound effect record, which sound should be made
1044 // when this object is damaged
1045 virtual uint8 getDamageSound(const ObjectSoundFXs &soundFXs);
1046};
1047
1048/* ======================================================================== *
1049 BludgeoningWeaponProto
1050 * ======================================================================== */
1051
1052// hierarchy:
1053// ProtoObj, InventoryProto, WeaponProto, MeleeWeaponProto,
1054// BludgeoningWeaponProto
1055
1057public:
1059 virtual ~BludgeoningWeaponProto() {}
1060
1061 // Get the value of the wielder's skill which applies to this
1062 // weapon
1063 virtual uint8 getSkillValue(ObjectID enactor);
1064
1065 // Cause the user's associated skill to grow
1066 virtual void applySkillGrowth(ObjectID enactor, uint8 points = 1);
1067};
1068
1069/* ======================================================================== *
1070 SlashingWeaponProto
1071 * ======================================================================== */
1072
1073// hierarchy:
1074// ProtoObj, InventoryProto, WeaponProto, MeleeWeaponProto,
1075// SlashingWeaponProto
1076
1078public:
1080 virtual ~SlashingWeaponProto() {}
1081
1082 // Get the value of the wielder's skill which applies to this
1083 // weapon
1084 virtual uint8 getSkillValue(ObjectID enactor);
1085
1086 // Cause the user's associated skill to grow
1087 virtual void applySkillGrowth(ObjectID enactor, uint8 points = 1);
1088};
1089
1090/* ======================================================================== *
1091 BowProto
1092 * ======================================================================== */
1093
1094// hierarchy:
1095// ProtoObj, InventoryProto, WeaponProto, BowProto
1096
1097class BowProto : public WeaponProto {
1098public:
1099 BowProto(ResourceObjectPrototype &proto) : WeaponProto(proto) {}
1100 virtual ~BowProto() {}
1101
1102 virtual bool useAction(ObjectID dObj, ObjectID enactor);
1103
1104 // Bows are two handed
1105 virtual bool isTwoHanded(ObjectID actor);
1106
1107 // Initiate a bow firing motion
1108 virtual void initiateAttack(ObjectID attacker, ObjectID target);
1109
1110 // Grab and arrow from the actor's inventory
1111 virtual GameObject *getProjectile(ObjectID weapon, ObjectID enactor);
1112
1113 // Determine if the specified object's 'use' slot is available within
1114 // the specified actor
1115 virtual bool useSlotAvailable(GameObject *obj, Actor *a);
1116
1117 // Rate this weapon's goodness for a specified attack situation
1118 virtual uint8 weaponRating(
1119 ObjectID weaponID,
1120 ObjectID wielderID,
1121 ObjectID targetID);
1122
1123 // Return the fight stance approriate to this weapon
1124 virtual int16 fightStanceAction(ObjectID actor);
1125};
1126
1127/* ======================================================================== *
1128 WeaponWandProto
1129 * ======================================================================== */
1130
1131// hierarchy:
1132// ProtoObj, InventoryProto, WeaponProto, WeaponWandProto
1133
1135public:
1137 virtual ~WeaponWandProto() {}
1138
1139 virtual bool useAction(ObjectID dObj, ObjectID enactor);
1140
1141 // Wands are two handed
1142 virtual bool isTwoHanded(ObjectID actor);
1143
1144 // Initiate a bow firing motion
1145 virtual void initiateAttack(ObjectID attacker, ObjectID target);
1146
1147 // Determine if the specified object's 'use' slot is available within
1148 // the specified actor
1149 virtual bool useSlotAvailable(GameObject *obj, Actor *a);
1150
1151 // Rate this weapon's goodness for a specified attack situation
1152 virtual uint8 weaponRating(
1153 ObjectID weaponID,
1154 ObjectID wielderID,
1155 ObjectID targetID);
1156
1157 // Return the fight stance approriate to this weapon
1158 virtual int16 fightStanceAction(ObjectID actor);
1159};
1160
1161/* ======================================================================== *
1162 ProjectileProto
1163 * ======================================================================== */
1164
1165// hierarchy:
1166// ProtoObj, InventoryProto, WeaponProto, ProjectileProto
1167
1169public:
1171 virtual ~ProjectileProto() {}
1172
1173 // return the address of the sprite when held in hand
1174 virtual Sprite *getOrientedSprite(GameObject *obj, int16 offset);
1175
1176 // Returns true if object in continuous use.
1177 bool isObjectBeingUsed(GameObject *obj);
1178
1179 // Projectiles are missiles
1180 virtual bool isMissile();
1181
1182 // Rate this weapon's goodness for a specified attack situation
1183 virtual uint8 weaponRating(
1184 ObjectID weaponID,
1185 ObjectID wielderID,
1186 ObjectID targetID);
1187};
1188
1189/* ======================================================================== *
1190 ArrowProto
1191 * ======================================================================== */
1192
1193// hierarchy:
1194// ProtoObj, InventoryProto, WeaponProto, ProjectileProto, ArrowProto
1195
1197public:
1199 virtual ~ArrowProto() {}
1200
1201 virtual bool useOnAction(ObjectID dObj, ObjectID enactor, ObjectID item);
1202 virtual bool strikeAction(
1203 ObjectID dObj,
1204 ObjectID enactor,
1205 ObjectID item);
1206 virtual bool damageAction(
1207 ObjectID dObj,
1208 ObjectID enactor,
1209 ObjectID target);
1210
1211 // Cause the user's associated skill to grow
1212 virtual void applySkillGrowth(ObjectID enactor, uint8 points = 1);
1213
1214};
1215
1216/* ======================================================================== *
1217 ArmorProto
1218 * ======================================================================== */
1219
1220// hierarchy:
1221// ProtoObj, InventoryProto, ArmorProto
1222
1224public:
1226 virtual ~ArmorProto() {}
1227
1228 virtual uint16 containmentSet();
1229
1230 virtual bool useAction(ObjectID dObj, ObjectID enactor);
1231
1232 // Compute how much damage this defensive object will absorb
1233 virtual uint8 adjustDamage(uint8 damage);
1234
1235 // Returns true if object in continuous use.
1236 bool isObjectBeingUsed(GameObject *obj);
1237
1238 // Determine if the specified object's 'use' slot is available within
1239 // the specified actor
1240 virtual bool useSlotAvailable(GameObject *obj, Actor *a);
1241};
1242
1243/* ======================================================================== *
1244 ShieldProto
1245 * ======================================================================== */
1246
1247// hierarchy:
1248// ProtoObj, InventoryProto, ShieldProto
1249
1251public:
1253 virtual ~ShieldProto() {}
1254
1255 virtual uint16 containmentSet();
1256
1257 virtual bool useAction(ObjectID dObj, ObjectID enactor);
1258
1259 virtual bool acceptDamageAction(
1260 ObjectID dObj,
1261 ObjectID enactor,
1262 int8 absDamage,
1263 effectDamageTypes dType,
1264 int8 dice,
1265 uint8 sides,
1266 int8 perDieMod);
1267
1268 // return the address of the sprite when held in hand
1269 virtual Sprite *getOrientedSprite(GameObject *obj, int16 offset);
1270
1271 virtual void initiateDefense(
1272 ObjectID defensiveObj,
1273 ObjectID defender,
1274 ObjectID attacker);
1275 virtual bool canBlock();
1276 // Return a mask of bits indicating the directions relative to the
1277 // wielders facing in which this object can defend
1278 virtual uint8 defenseDirMask();
1279
1280 // Returns true if object in continuous use.
1281 bool isObjectBeingUsed(GameObject *obj);
1282
1283 // Determine if the specified object's 'use' slot is available within
1284 // the specified actor
1285 virtual bool useSlotAvailable(GameObject *obj, Actor *a);
1286
1287 // Get the value of the user's skill which applies to this
1288 // object
1289 virtual uint8 getSkillValue(ObjectID enactor);
1290
1291 // Cause the user's associated skill to grow
1292 virtual void applySkillGrowth(ObjectID enactor, uint8 points = 1);
1293
1294 // Given an object sound effect record, which sound should be made
1295 // when this object is damaged
1296 virtual uint8 getDamageSound(const ObjectSoundFXs &soundFXs);
1297};
1298
1299/* ======================================================================== *
1300 ToolProto
1301 * ======================================================================== */
1302
1303// hierarchy:
1304// ProtoObj, InventoryProto, ToolProto
1305
1307public:
1309 virtual ~ToolProto() {}
1310
1311 // Set up targeting cursor
1312 virtual bool setUseCursor(ObjectID dObj);
1313
1314 // Use tool on object
1315 virtual bool useOnAction(ObjectID dObj, ObjectID enactor, ObjectID withObj);
1316};
1317
1318/* ======================================================================== *
1319 DocumentProto
1320 * ======================================================================== */
1321
1322// hierarchy:
1323// ProtoObj, InventoryProto, DocumentProto
1324
1326public:
1328 virtual ~DocumentProto() {}
1329
1330 virtual uint16 containmentSet();
1331
1332//BookDoc
1333//ScrollDoc
1334
1335// virtual bool use( ObjectID dObj, ObjectID enactor );
1336// Close Floating Window Used For Both Book And Scroll
1337// virtual bool close( ObjectID dObj, ObjectID enactor );
1338
1339};
1340
1341/* ======================================================================== *
1342 BookProto
1343 * ======================================================================== */
1344
1345// hierarchy:
1346// ProtoObj, InventoryProto, DocumentProto, BookProto
1347
1348class BookProto : public DocumentProto {
1349public:
1351 virtual ~BookProto() {}
1352 //Read It
1353 virtual bool useAction(ObjectID dObj, ObjectID enactor);
1354
1355};
1356
1357/* ======================================================================== *
1358 ScrollProto
1359 * ======================================================================== */
1360
1361// hierarchy:
1362// ProtoObj, InventoryProto, DocumentProto, ScrollProto
1363
1365public:
1367 virtual ~ScrollProto() {}
1368
1369 //Read It
1370 virtual bool useAction(ObjectID dObj, ObjectID enactor);
1371
1372};
1373
1374/* ======================================================================== *
1375 AutoMapProto
1376 * ======================================================================== */
1377
1378// hierarchy:
1379// ProtoObj, InventoryProto, AutoMapProto
1380
1382public:
1384 virtual ~AutoMapProto() {}
1385
1386 //Shows Auto Map Display
1387 virtual bool openAction(ObjectID dObj, ObjectID enactor);
1388
1389};
1390
1391/* ======================================================================== *
1392 IntagibleObjProto
1393 * ======================================================================== */
1394
1395// hierarchy:
1396// ProtoObj, IntangibleObjProto
1397
1399public:
1401 virtual ~IntangibleObjProto() {}
1402
1403 virtual bool useAction(ObjectID dObj, ObjectID enactor);
1404
1405 virtual bool takeAction(ObjectID dObj, ObjectID enactor, int16);
1406
1407 virtual bool canDropAt(
1408 ObjectID dObj,
1409 ObjectID enactor,
1410 const Location &loc);
1411 virtual bool dropAction(
1412 ObjectID dObj,
1413 ObjectID enactor,
1414 const Location &loc,
1415 int16);
1416
1417 virtual bool acceptDropAction(
1418 ObjectID dObj,
1419 ObjectID enactor,
1420 ObjectID droppedObj,
1421 int count);
1422
1423 virtual uint16 containmentSet();
1424 virtual ObjectID placeObject();
1425
1426 // Creates a color translation table for this object
1427 virtual void getColorTranslation(ColorTable map);
1428
1429 // return the sprite data
1430 virtual ObjectSpriteInfo getSprite(GameObject *obj, spriteTypes spr, int16);
1431};
1432
1433/* ======================================================================== *
1434 IdeaProto
1435 * ======================================================================== */
1436
1437// hierarchy:
1438// ProtoObj, IntangibleObjProto, IdeaProto
1439
1441public:
1443 virtual ~IdeaProto() {}
1444
1445 //Talk To A Person
1446 uint16 containmentSet();
1447
1448};
1449
1450/* ======================================================================== *
1451 MemoryProto
1452 * ======================================================================== */
1453
1454// hierarchy:
1455// ProtoObj, IntangibleObjProto, MemoryProto
1456
1458public:
1460 virtual ~MemoryProto() {}
1461
1462 //Get Info On Person Your Talking To
1463 uint16 containmentSet();
1464
1465};
1466
1467/* ======================================================================== *
1468 PsychProto
1469 * ======================================================================== */
1470
1471// hierarchy:
1472// ProtoObj, IntangibleObjProto, PsychProto
1473
1475public:
1477 virtual ~PsychProto() {}
1478
1479 //Get Explanation Of Icon
1480 uint16 containmentSet();
1481
1482};
1483
1484/* ======================================================================== *
1485 SkillProto
1486 * ======================================================================== */
1487
1488//typedef uint8 SpellID;
1489
1490// hierarchy:
1491// ProtoObj, IntagibleObjProto, SkillProto
1492
1494public:
1496 virtual ~SkillProto() {}
1497
1498 //Perform A Skill or Cast a spell
1499 virtual bool useAction(ObjectID dObj, ObjectID enactor);
1500 virtual bool useOnAction(ObjectID dObj, ObjectID enactor, ObjectID withObj);
1501 virtual bool useOnAction(ObjectID dObj, ObjectID enactor, ActiveItem *item);
1502 virtual bool useOnAction(ObjectID dObj, ObjectID enactor, const Location &loc);
1503
1504 virtual bool canDropAt(
1505 ObjectID dObj,
1506 ObjectID enactor,
1507 const Location &loc);
1508 virtual bool dropAction(
1509 ObjectID dObj,
1510 ObjectID enactor,
1511 const Location &loc,
1512 int16 num = 1);
1513 virtual bool dropOnAction(
1514 ObjectID dObj,
1515 ObjectID enactor,
1516 ObjectID target,
1517 int count);
1518 virtual bool dropOnAction(
1519 ObjectID dObj,
1520 ObjectID enactor,
1521 ActiveItem *target,
1522 const Location &loc,
1523 int16 num = 1);
1524
1525 virtual bool implementAction(SpellID dObj, ObjectID enactor, ObjectID withObj);
1526 virtual bool implementAction(SpellID dObj, ObjectID enactor, ActiveItem *item);
1527 virtual bool implementAction(SpellID dObj, ObjectID enactor, Location &loc);
1528 uint16 containmentSet();
1529 SpellID getSpellID() {
1530 return (SpellID) lockType;
1531 }
1532
1533};
1534
1535/* ======================================================================== *
1536 IntangibleContainerProto
1537 * ======================================================================== */
1538
1539// hierarchy:
1540// ProtoObj, IntangibleContainerProto
1541
1543public:
1545 virtual ~IntangibleContainerProto() {}
1546
1547 virtual bool canContain(ObjectID dObj, ObjectID item);
1548 virtual bool useAction(ObjectID dObj, ObjectID enactor);
1549 virtual bool canOpen(ObjectID dObj, ObjectID enactor);
1550 virtual bool openAction(ObjectID dObj, ObjectID enactor);
1551 virtual bool closeAction(ObjectID dObj, ObjectID enactor);
1552// virtual bool acceptLockToggle( ObjectID dObj, ObjectID enactor, uint8 keyCode );
1553
1554// virtual ContainerWindow *makeWindow( GameObject *Obj );
1555 virtual uint16 containmentSet();
1556};
1557
1558/* ======================================================================== *
1559 IdeaContainerProto
1560 * ======================================================================== */
1561
1562// hierarchy:
1563// ProtoObj, IntangibleContainerProto, IdeaContainerProto
1564
1566public:
1568 virtual ~IdeaContainerProto() {}
1569
1570 //Holding Idea Objects
1571// bool use( ObjectID dObj, ObjectID enactor );
1572
1573};
1574
1575/* ======================================================================== *
1576 MemoryContainerProto
1577 * ======================================================================== */
1578
1579// hierarchy:
1580// ProtoObj, IntangibleContainerProto, MemoryContainerProto
1581
1583public:
1585 virtual ~MemoryContainerProto() {}
1586
1587 //Holding Memories Of People You Met
1588// bool use( ObjectID dObj, ObjectID enactor );
1589
1590};
1591
1592/* ======================================================================== *
1593 PhychContainerProto
1594 * ======================================================================== */
1595
1596// hierarchy:
1597// ProtoObj, IntangibleContainerProto, PsychContainerProto
1598
1600public:
1602 virtual ~PsychContainerProto() {}
1603
1604 //Holding Psychological Objects
1605// bool use( ObjectID dObj, ObjectID enactor );
1606
1607};
1608
1609/* ======================================================================== *
1610 SkillContainerProto
1611 * ======================================================================== */
1612
1613// hierarchy:
1614// ProtoObj, IntangibleContainerProto, SkillContainerProto
1615
1617public:
1619 virtual ~SkillContainerProto() {}
1620
1621 //Holding Skills And Spells
1622// bool use( ObjectID dObj, ObjectID enactor );
1623
1624};
1625
1626/* ======================================================================== *
1627 MindContainerProto
1628 * ======================================================================== */
1629
1630// hierarchy:
1631// ProtoObj, IntangibleContainerProto, MindContainerProto
1632
1634public:
1636 virtual ~MindContainerProto() {}
1637
1638 //Contains Skill Psych Memory And Idea Containers
1639// virtual bool use( ObjectID dObj, ObjectID enactor );
1640
1641};
1642
1643/* ======================================================================== *
1644 EnchantmentProto
1645 * ======================================================================== */
1646
1647// hierarchy:
1648// ProtoObj, EnchantmentProto
1649
1651public:
1653 virtual ~EnchantmentProto() {}
1654
1655 // Do the background processing, if needed, for this object.
1656 void doBackgroundUpdate(GameObject *obj);
1657
1658 virtual uint16 containmentSet();
1659};
1660
1661/* ======================================================================== *
1662 GeneratorProto
1663 * ======================================================================== */
1664
1665// hierarchy:
1666// ProtoObj, GeneratorProto
1667
1668class GeneratorProto : public ProtoObj {
1669public:
1671 virtual ~GeneratorProto() {}
1672
1673 //Base class for monster, encounter, and mission generators
1674
1675 virtual uint16 containmentSet();
1676};
1677
1678/* ======================================================================== *
1679 MonsterGeneratorProto
1680 * ======================================================================== */
1681
1682// hierarchy:
1683// ProtoObj, GeneratorProto, MonsterGeneratorProto
1684
1686public:
1688 virtual ~MonsterGeneratorProto() {}
1689
1690 //Monster generators
1691 // REM: We don't want to generate monsters as a background activity, since
1692 // we may want more rapid generation that once every 10 seconds, and we only
1693 // want to do it while active anyway.
1694};
1695
1696/* ======================================================================== *
1697 EncounterGeneratorProto
1698 * ======================================================================== */
1699
1700// hierarchy:
1701// ProtoObj, GeneratorProto, EncounterGeneratorProto
1702
1704public:
1706 virtual ~EncounterGeneratorProto() {}
1707
1708 //Encounter generator
1709
1710 // Generate an encounter at approx. 10-second intervals
1711 void doBackgroundUpdate(GameObject *obj);
1712};
1713
1714/* ======================================================================== *
1715 MissionGeneratorProto
1716 * ======================================================================== */
1717
1718// hierarchy:
1719// ProtoObj, GeneratorProto, MissionGeneratorProto
1720
1722public:
1724 virtual ~MissionGeneratorProto() {}
1725
1726 // Check every 10 seconds to see if we want to generate a mission.
1727 void doBackgroundUpdate(GameObject *obj);
1728};
1729
1730/* Subclasses of "ProtoObj" which haven't been defined yet
1731
1732 InventoryObjectPrototype // can be dropped on ground
1733 ContainerPrototype // holds a list of items
1734 BottlePrototype // holds 1 liquid
1735 FoodPrototype // edible
1736 WearablePrototype // armor and jewelry
1737 WeaponPrototype // does damage efficiently
1738 DocumentPrototype // expands to document window
1739 IntangableObjectPrototype // Ideas and Magic
1740 ConceptObjectPrototype // Basic Ideas (Food, Friend...)
1741 MemoryObjectPrototype // Memories of game events
1742 PsychObjectPrototype // I am ... (Brave, Humble...)
1743 SpellObjectPrototype // Spells to cast
1744 EnchantmentObjectPrototype // Enchants object that holds it
1745 IntangableContainerPrototype // Containers for Ideas and Magic
1746 ConceptContainerPrototype // Containers for Basic Ideas (Food, Friend...)
1747 MemoryContainerPrototype // Containers for Memories of game events
1748 PsychContainerPrototype // Containers for I am ... (Brave, Humble...)
1749 SpellContainerPrototype // Containers for Spells to cast
1750// EnchantmentContainerPrototype // Enchants object that holds it
1751 ProjectilePrototype // a missile in flight
1752** ActorPrototype
1753*/
1754
1755} // end of namespace Saga2
1756
1757#endif
uint16 readUint16LE()
Definition: stream.h:459
FORCEINLINE int16 readSint16LE()
Definition: stream.h:543
FORCEINLINE int8 readSByte()
Definition: stream.h:447
byte readByte()
Definition: stream.h:434
Definition: stream.h:745
Definition: tile.h:388
Definition: actor.h:584
Definition: objproto.h:1223
Definition: objproto.h:1196
Definition: objproto.h:1381
Definition: objproto.h:1056
Definition: objproto.h:1348
Definition: objproto.h:902
Definition: objproto.h:1097
Definition: objproto.h:1325
Definition: objproto.h:1650
Definition: objproto.h:1703
Definition: objproto.h:921
Definition: objects.h:118
Definition: objproto.h:1668
Definition: objproto.h:1565
Definition: objproto.h:1440
Definition: objproto.h:1542
Definition: objproto.h:1398
Definition: objproto.h:751
Definition: objproto.h:880
Definition: objproto.h:105
Definition: objproto.h:989
Definition: objproto.h:1582
Definition: objproto.h:1457
Definition: objproto.h:1633
Definition: objproto.h:1721
Definition: objproto.h:1685
Definition: objproto.h:798
Definition: objproto.h:1168
Definition: objproto.h:371
Definition: objproto.h:1599
Definition: objproto.h:1474
Definition: objproto.h:1364
Definition: objproto.h:1250
Definition: objproto.h:1616
Definition: objproto.h:1493
Definition: objproto.h:1077
Definition: objproto.h:1306
Definition: objproto.h:955
Definition: objproto.h:1134
Definition: objproto.h:940
Definition: objects.h:1291
Definition: sprite.h:214
Definition: objproto.h:173
Definition: sprite.h:42
Definition: objproto.h:95
Definition: tcoords.h:48
Definition: tcoords.h:127
Definition: script.h:55