1 /* GemRB - Infinity Engine Emulator
2 * Copyright (C) 2003 The GemRB Project
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 * Declares Effect class implementing spell and spell-like effects
36 //local variables in creatures are stored in fake opcodes
37 #define FAKE_VARIABLE_OPCODE 187
38 #define FAKE_VARIABLE_MARKER 1
40 // Effect target types
41 #define FX_TARGET_UNKNOWN 0
42 #define FX_TARGET_SELF 1
43 #define FX_TARGET_PRESET 2
44 #define FX_TARGET_PARTY 3
45 #define FX_TARGET_ALL 4
46 #define FX_TARGET_ALL_BUT_PARTY 5
47 #define FX_TARGET_OWN_SIDE 6
48 #define FX_TARGET_OTHER_SIDE 7
49 #define FX_TARGET_ALL_BUT_SELF 8
50 #define FX_TARGET_ORIGINAL 9
52 // Effect duration/timing types
53 #define FX_DURATION_INSTANT_LIMITED 0
54 #define FX_DURATION_INSTANT_PERMANENT 1
55 #define FX_DURATION_INSTANT_WHILE_EQUIPPED 2
56 #define FX_DURATION_DELAY_LIMITED 3 //this contains a relative onset time (delay) also used as duration, transforms to 6 when applied
57 #define FX_DURATION_DELAY_PERMANENT 4 //this transforms to 9 (i guess)
58 #define FX_DURATION_DELAY_UNSAVED 5 //this transforms to 8
59 #define FX_DURATION_DELAY_LIMITED_PENDING 6 //this contains an absolute onset time and a duration
60 #define FX_DURATION_AFTER_EXPIRES 7 //this is a delayed non permanent effect (resolves to JUST_EXPIRED)
61 #define FX_DURATION_PERMANENT_UNSAVED 8
62 #define FX_DURATION_INSTANT_PERMANENT_AFTER_BONUSES 9//this is a special permanent
63 #define FX_DURATION_JUST_EXPIRED 10
64 #define MAX_TIMING_MODE 11
65 #define FX_DURATION_ABSOLUTE 0x1000
67 // Effect resistance types
68 #define FX_NO_RESIST_NO_DISPEL 0
69 #define FX_CAN_RESIST_CAN_DISPEL 1
70 //#define FX_CAN_RESIST_NO_DISPEL 2 //same as 0 (not resistable, not dispellable)
71 #define FX_NO_RESIST_CAN_DISPEL 3
72 #define FX_CAN_DISPEL 1
73 #define FX_CAN_RESIST 3
77 * Structure holding information about single spell or spell-like effect.
80 // the same as ITMFeature and SPLFeature
87 ieWord TimingMode
; //0x1000 -- no need of conversion
93 //keep these four in one bunch, VariableName will
96 ieResRef Resource2
; //vvc in a lot of effects
101 ieDword SavingThrowType
;
102 ieDword SavingThrowBonus
;
104 ieWord IsSaveForHalfDamage
;
107 ieDword PrimaryType
; //school
111 ieDword SourceType
; //1-item, 2-spell
114 ieDword Projectile
; //9c
115 ieDwordSigned InventorySlot
; //a0
116 //Original engine had a VariableName here, but it is stored in the resource fields
117 ieDword CasterLevel
; //c4 in both
118 ieDword FirstApply
; //c8 in bg2, cc in iwd2
119 ieDword SecondaryType
;
120 ieDword SecondaryDelay
; //still not sure about this
121 ieDword CasterID
; //10c in bg2 (not saved?)
122 // These are not in the IE files, but are our precomputed values
123 ieDword random_value
;
125 //don't modify position in case it was already set
126 void SetPosition(const Point
&p
) {
127 if(PosX
==0xffffffff && PosY
==0xffffffff) {
134 // FIXME: what about area spells? They can have map & coordinates as target
135 //void AddEffect(Effect* fx, Actor* self, Actor* pretarget);