26#ifndef SAGA2_SPELDEFS_H
27#define SAGA2_SPELDEFS_H
29#include "saga2/tile.h"
30#include "saga2/objects.h"
34struct StorageSpellTarget;
36struct StorageEffectron;
37class SpellDisplayPrototype;
38class EffectDisplayPrototype;
39struct ResourceSpellItem;
40struct StorageSpellInstance;
49#define continuouslyImplemented (-1)
58typedef uint16 EffectID;
63typedef uint16 SpellPoseID;
68typedef uint8 spellHeight;
73typedef uint8 spellBreadth;
78typedef int32 SpellAge;
85typedef int32 SpellPositionSeed;
88inline uint16 SpellPosition(SpellPositionSeed sps) {
93inline uint16 SpellDirection(SpellPositionSeed sps) {
94 return ((sps >> 16) & 0xFFFF);
100typedef int32 SpellSpritationSeed;
105typedef GameObject SpellCaster;
115inline 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);
124inline 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);
260enum EffectronFlagMasks {
262 kEffectronHidden = (1 << 0),
263 kEffectronDead = (1 << 1),
264 kEffectronBumped = (1 << 2)
267typedef uint32 EffectronFlags;
272typedef Extent16 EffectronSize;
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: spelshow.h:112
Definition: speldefs.h:277
Definition: objects.h:118
Definition: objects.h:768
Definition: spelshow.h:229
Definition: spelshow.h:292
Definition: speldefs.h:139
Definition: spellio.h:156
Definition: spellio.h:115
Definition: tcoords.h:127