ScummVM API documentation
spells.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 
22 #ifndef XEEN_SPELLS_H
23 #define XEEN_SPELLS_H
24 
25 #include "common/scummsys.h"
26 #include "common/str-array.h"
27 
28 namespace Xeen {
29 
30 class XeenEngine;
31 class Character;
32 
33 enum MagicSpell {
34  MS_AcidSpray = 0, MS_Awaken = 1, MS_BeastMaster = 2, MS_Bless = 3,
35  MS_Clairvoyance = 4, MS_ColdRay = 5, MS_CreateFood = 6,
36  MS_CureDisease = 7, MS_CureParalysis = 8, MS_CurePoison = 9,
37  MS_CureWounds = 10, MS_DancingSword = 11, MS_DayOfProtection = 12,
38  MS_DayOfSorcery = 13, MS_DeadlySwarm = 14, MS_DetectMonster = 15,
39  MS_DivineIntervention = 16, MS_DragonSleep = 17, MS_ElementalStorm = 18,
40  MS_EnchantItem = 19, MS_EnergyBlast = 20, MS_Etheralize = 21,
41  MS_FantasticFreeze = 22, MS_FieryFlail = 23, MS_FingerOfDeath = 24,
42  MS_Fireball = 25, MS_FirstAid = 26, MS_FlyingFist = 27,
43  MS_FrostBite = 28, MS_GolemStopper = 29, MS_Heroism = 30,
44  MS_HolyBonus = 31, MS_HolyWord = 32, MS_Hynotize = 33,
45  MS_IdentifyMonster = 34, MS_Implosion = 35, MS_Incinerate = 36,
46  MS_Inferno = 37, MS_InsectSpray = 38, MS_ItemToGold = 39,
47  MS_Jump = 40, MS_Levitate = 41, MS_Light = 42, MS_LightningBolt = 43,
48  MS_LloydsBeacon = 44, MS_MagicArrow = 45, MS_MassDistortion = 46,
49  MS_MegaVolts = 47, MS_MoonRay = 48, MS_NaturesCure = 49, MS_Pain = 50,
50  MS_PoisonVolley = 51, MS_PowerCure = 52, MS_PowerShield = 53,
51  MS_PrismaticLight = 54, MS_ProtFromElements = 55, MS_RaiseDead = 56,
52  MS_RechargeItem = 57, MS_Resurrection = 58, MS_Revitalize = 59,
53  MS_Shrapmetal = 60, MS_Sleep = 61, MS_Sparks = 62, MS_StarBurst = 63,
54  MS_StoneToFlesh = 64, MS_SunRay = 65, MS_SuperShelter = 66,
55  MS_SuppressDisease = 67, MS_SuppressPoison = 68, MS_Teleport = 69,
56  MS_TimeDistortion = 70, MS_TownPortal = 71, MS_ToxicCloud = 72,
57  MS_TurnUndead = 73, MS_WalkOnWater = 74, MS_WizardEye = 75,
58  NO_SPELL = 76, TOTAL_SPELLS = 76
59 };
60 
61 class Spells {
62 private:
63  XeenEngine *_vm;
64 
65  void load();
66 
67  void executeSpell(MagicSpell spellId);
68 
72  void spellFailed();
73 
74  // Spell list
75  void acidSpray();
76  void awaken();
77  void beastMaster();
78  void bless();
79  void clairvoyance();
80  void coldRay();
81  void createFood();
82  void cureDisease();
83  void cureParalysis();
84  void curePoison();
85  void cureWounds();
86  void dancingSword();
87  void dayOfProtection();
88  void dayOfSorcery();
89  void deadlySwarm();
90  void detectMonster();
91  void divineIntervention();
92  void dragonSleep();
93  void elementalStorm();
94  void enchantItem();
95  void energyBlast();
96  void etherialize();
97  void fantasticFreeze();
98  void fieryFlail();
99  void fingerOfDeath();
100  void fireball();
101  void firstAid();
102  void flyingFist();
103  void frostbite();
104  void golemStopper();
105  void heroism();
106  void holyBonus();
107  void holyWord();
108  void hypnotize();
109  void identifyMonster();
110  void implosion();
111  void incinerate();
112  void inferno();
113  void insectSpray();
114  void itemToGold();
115  void jump();
116  void levitate();
117  void light();
118  void lightningBolt();
119  void lloydsBeacon();
120  void magicArrow();
121  void massDistortion();
122  void megaVolts();
123  void moonRay();
124  void naturesCure();
125  void pain();
126  void poisonVolley();
127  void powerCure();
128  void powerShield();
129  void prismaticLight();
130  void protectionFromElements();
131  void raiseDead();
132  void rechargeItem();
133  void resurrection();
134  void revitalize();
135  void shrapMetal();
136  void sleep();
137  void sparks();
138  void starBurst();
139  void stoneToFlesh();
140  void sunRay();
141  void superShelter();
142  void suppressDisease();
143  void suppressPoison();
144  void teleport();
145  void timeDistortion();
146  void townPortal();
147  void toxicCloud();
148  void turnUndead();
149  void walkOnWater();
150  void wizardEye();
151 
152  void frostbite2();
153 public:
154  Common::StringArray _spellNames;
155  int _lastCaster;
156 public:
157  Spells(XeenEngine *vm);
158 
159  int calcSpellCost(int spellId, int expenseFactor) const;
160 
161  int calcSpellPoints(int spellId, int expenseFactor) const;
162 
166  void castItemSpell(int itemSpellId);
167 
171  int castSpell(Character *c, MagicSpell spellId);
172 
177  int subSpellCost(Character &c, int spellId);
178 
183  void addSpellCost(Character &c, int spellId);
184 };
185 
186 } // End of namespace Xeen
187 
188 #endif /* XEEN_SPELLS_H */
int castSpell(Character *c, MagicSpell spellId)
Definition: spells.h:61
int subSpellCost(Character &c, int spellId)
Definition: xeen.h:100
void addSpellCost(Character &c, int spellId)
Definition: character.h:101
void castItemSpell(int itemSpellId)
Definition: character.h:33