ScummVM API documentation
magic.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 * aint32 with this program; if not, write to the Free Software
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_MAGIC_H
27#define SAGA2_MAGIC_H
28
29#include "saga2/spells.h"
30
31namespace Saga2 {
32
33class ActiveItem;
34class Location;
35class SkillProto;
36class GameObject;
37
38// ------------------------------------------------------------------
39// This is an include file for the spellcasting interface. This file
40// is meant to publish the main API functions for spell casting.
41// The internal workings of the spell stuff is defined elsewhere:
42// SPELLS.H has spell ID numbers
43// EFFECTS.H what spells are capable of doing to things
44// SPELSHOW.H is the portion of the interface needed by DISPNODE
45// SPELLBUK.H defines the global spell list
46//
47
48
49// ------------------------------------------------------------------
50// Prototypes for spell / skill use
51
52// see if the mouse pointer is pointing at a viable target for a
53// selected spell
54bool validTarget(GameObject *enactor,
55 GameObject *target,
56 ActiveItem *tag,
57 SkillProto *skill);
58
59// test for untargeted skill / spell that gets cast immediately
60bool nonTargeted(SkillProto *spell);
61
62// test for skill / spell that cannot be used
63bool nonUsable(SkillProto *spell);
64
65// This call looks up a spells object prototype. It can accept either
66// an object ID or a spell ID
67SkillProto *skillProtoFromID(int16 spellOrObjectID);
68
69// Initialization call to map the Spell Object prototypes
70// into the main spell database
71void initializeSkill(SkillProto *oNo, SpellID sNo);
72
73//
74// Cast: This call makes the actor do his spell casting dance. The
75// motion task calls the implement routine at the appropriate
76// time. If the caster is not an actor the implement routine is
77// chained directly.
78//
79// Implement: This call actually causes the spell to 'fire'. The
80// display effect is started, and the internal effects are
81// implemented.
82//
83
84// check for available mana
85bool canCast(GameObject *enactor, SkillProto *spell);
86
87// cast untargeted spell
88bool castUntargetedSpell(GameObject *enactor, SkillProto *spell);
89
90// global cast spell routines at assorted targets
91bool castSpell(GameObject *enactor, Location &target, SkillProto *spell);
92bool castSpell(GameObject *enactor, ActiveItem *target, SkillProto *spell);
93bool castSpell(GameObject *enactor, GameObject *target, SkillProto *spell);
94
95// global cast spell routines at assorted targets
96bool implementSpell(GameObject *enactor, Location &target, SkillProto *spell);
97bool implementSpell(GameObject *enactor, ActiveItem *target, SkillProto *spell);
98bool implementSpell(GameObject *enactor, GameObject *target, SkillProto *spell);
99
100// spell saving & loading
101void initSpellState();
102void saveSpellState(Common::OutSaveFile *outS);
103void loadSpellState(Common::InSaveFile *in);
104void cleanupSpellState();
105
106} // end of namespace Saga2
107
108#endif
Definition: savefile.h:54
Definition: stream.h:745