ScummVM API documentation
spellio.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_SPELLIO_H
27 #define SAGA2_SPELLIO_H
28 
29 namespace Saga2 {
30 
31 class SpellTarget;
32 class Effectron;
33 
34 class EffectDisplayPrototype;
35 class EffectDisplayPrototypeList;
36 
37 class SpellDisplayPrototype;
38 class SpellDisplayPrototypeList;
39 
40 class SpellStuff;
41 
42 class SpellInstance;
43 class SpellDisplayList;
44 
45 struct ResourceSpellItem ;
46 struct ResourceSpellEffect;
47 struct ResourceItemEffect;
48 
49 struct StorageSpellTarget;
50 struct StorageSpellInstance;
51 struct StorageEffectron;
52 
53 //-------------------------------------------------------------------
54 // ResourceSpellItem
55 // Spell configuration info is loaded from the resfile in these
56 
58  int16 spell; // Spell ID
59  int16 effect; // Effect ID
60  int16 effectronElasticity; // Effectron elasticity
61  int16 cm1; // effectron count
62  int16 maxAge; // max age
63  int16 implAge; // implementation age
64  int16 baseSprite; // sprite ID
65  int16 spriteCount; // sprite count
66  int16 baseSprite2; // sprite ID
67  int16 spriteCount2; // sprite count
68  int16 cm0; // color map b0
69  int16 soundID; // color map b1
70  int16 targs; // targeting bits
71  int16 applys; // apply bits
72  int16 manaType; // mana ID
73  int16 manaAmount; // mana count
74 };
75 
76 //-------------------------------------------------------------------
77 // ResourceSpellEffect
78 // Since spells can have multiple effects, they are stored
79 // separately
80 
82  int16 spell; // spell ID
83  int16 effectGroup; // effect group
84  int16 effectType; // effect ID
85  int16 targeting; // targeting
86  int16 baseDice; // base dice
87  int16 skillDice; // skill dice
88  int16 attribModifier; // attrib change
89  int16 flagSet; // Set/clear
90  int16 enchTimeLo; // min enchant
91  int16 enchTimeHi; // max enchant
92  int16 diceSides;
93 };
94 
95 //-------------------------------------------------------------------
96 // Similar struct for weapon effects
97 
99  int16 item; // spell ID
100  int16 effectGroup; // effect group
101  int16 effectType; // effect ID
102  int16 targeting; // targeting
103  int16 baseDice; // base dice
104  int16 skillDice; // skill dice
105  int16 baseDamage; // attrib change
106  int16 skillDamage; // attrib change
107  int16 reserved0; // min enchant
108  int16 reserved1; // min enchant
109  int16 diceSides;
110 };
111 
112 //-------------------------------------------------------------------
113 // Serialized spell target
114 
116  int16 type;
117 
118  TilePoint loc;
119  ObjectID obj;
120  ActiveItemID tag;
121 
124 
125  void read(Common::InSaveFile *in);
126  void write(Common::MemoryWriteStreamDynamic *out);
127 };
128 
129 //-------------------------------------------------------------------
130 // Serialized spell instance
131 
133  int32 implementAge; // age at which to implement the spell effects
134  uint16 effect; // effect prototype of the current effect
135  SpellID dProto; // effect prototype of the current effect
136  ObjectID caster;
137 
138  StorageSpellTarget target;
139  ObjectID world;
140  int32 age;
141  SpellID spell;
142  int32 maxAge;
143  int16 effSeq; // which effect in a sequence is being played
144  int16 eListSize;
145 
148 
149  void read(Common::InSaveFile *in);
150  void write(Common::MemoryWriteStreamDynamic *out);
151 };
152 
153 //-------------------------------------------------------------------
154 // Serialized spell sprite
155 
157  uint32 flags;
158  Extent16 size;
159  Rect16 hitBox; // hitbox for clicking this item
160 
161  int16 partno; // Which effectron in a group this represents
162  Point16 screenCoords; // screen coordinates last drawn at
163 
164  TilePoint start, // travelling from
165  finish, // travelling to
166  current, // current position
167  velocity, // current velocity
168  acceleration; // current acceleration
169  uint16 totalSteps, // discrete jumps in the path
170  stepNo; // current jump
171 
172  int16 hgt; // collision detection stuff
173  int16 brd;
174 
175  int32 pos; // These three are part of an old way of
176  int32 spr; // updating effectrons
177  int32 age;
178 
181 
182  void read(Common::InSaveFile *in);
183  void write(Common::MemoryWriteStreamDynamic *out);
184 };
185 
186 } // end of namespace Saga2
187 
188 #endif
Definition: speldefs.h:277
Definition: spellio.h:57
Definition: spellio.h:81
Definition: actor.h:32
Definition: idtypes.h:124
Definition: memstream.h:194
Definition: tcoords.h:127
Definition: stream.h:745
Definition: rect.h:42
Definition: spelshow.h:292
Definition: spellio.h:132
Definition: spellio.h:156
Definition: speldefs.h:139
Definition: spellio.h:98
Definition: rect.h:290
Definition: spellio.h:115