26 #ifndef SAGA2_SPELDEFS_H 27 #define SAGA2_SPELDEFS_H 29 #include "saga2/tile.h" 30 #include "saga2/objects.h" 34 struct StorageSpellTarget;
36 struct StorageEffectron;
37 class SpellDisplayPrototype;
38 class EffectDisplayPrototype;
39 struct ResourceSpellItem;
40 struct StorageSpellInstance;
48 #define MAX_SPELLS 128 49 #define continuouslyImplemented (-1) 58 typedef uint16 EffectID;
63 typedef uint16 SpellPoseID;
68 typedef uint8 spellHeight;
73 typedef uint8 spellBreadth;
78 typedef int32 SpellAge;
85 typedef int32 SpellPositionSeed;
88 inline uint16 SpellPosition(SpellPositionSeed sps) {
93 inline uint16 SpellDirection(SpellPositionSeed sps) {
94 return ((sps >> 16) & 0xFFFF);
100 typedef int32 SpellSpritationSeed;
105 typedef GameObject SpellCaster;
115 inline TilePoint TAGPos(ActiveItem *ai) {
116 if (ai == NULL)
return Nowhere;
117 assert(ai->_data.itemType == kActiveTypeInstance);
119 ai->_data.instance.u << kTileUVShift,
120 ai->_data.instance.v << kTileUVShift,
121 ai->_data.instance.h);
124 inline TilePoint objPos(GameObject *go) {
125 if (go == NULL)
return Nowhere;
126 TilePoint t = go->getWorldLocation();
127 t.z += go->proto()->height / 2;
143 enum spellTargetType {
144 kSpellTargetNone = 0,
146 kSpellTargetObjectPoint,
152 spellTargetType _type;
162 _type = kSpellTargetNone;
173 _type = kSpellTargetObjectPoint;
174 _loc =
object.getWorldLocation();
175 _loc.z +=
object.proto()->height / 2;
183 _type = kSpellTargetObject;
189 _type = kSpellTargetPoint;
196 _type = kSpellTargetTAG;
228 case kSpellTargetPoint :
229 case kSpellTargetObjectPoint :
231 case kSpellTargetObject :
233 case kSpellTargetTAG :
235 case kSpellTargetNone :
241 spellTargetType getType() {
246 assert(_type == kSpellTargetObject);
251 assert(_type == kSpellTargetTAG);
260 enum EffectronFlagMasks {
262 kEffectronHidden = (1 << 0),
263 kEffectronDead = (1 << 1),
264 kEffectronBumped = (1 << 2)
267 typedef uint32 EffectronFlags;
280 EffectronFlags _flags;
302 SpellPositionSeed _pos;
303 SpellSpritationSeed _spr;
313 void updateEffect(int32 deltaTime);
318 inline int32 spriteID() {
323 _flags |= kEffectronHidden;
325 inline void unhide() {
326 _flags &= (~kEffectronHidden);
328 inline bool isHidden()
const {
329 return _flags & kEffectronHidden;
332 _flags |= kEffectronDead;
334 inline int isDead()
const {
335 return _flags & kEffectronDead;
338 inline int isBumped()
const {
339 return _flags & kEffectronBumped;
343 inline int16 getMapNum()
const;
345 inline EffectID spellID();
347 inline EffectID effectID();
349 inline EffectronFlags staCall();
351 inline SpellSpritationSeed sprCall();
352 inline spellHeight hgtCall();
353 inline spellBreadth brdCall();
354 inline void initCall(int16);
Definition: speldefs.h:277
Definition: tcoords.h:127
Definition: spelshow.h:229
Definition: spelshow.h:292
Definition: objects.h:768
Definition: objects.h:118
Definition: spellio.h:156
Definition: speldefs.h:139
Definition: spelshow.h:112
Definition: spellio.h:115