1 /*
2 This file is part of "Avanor, the Land of Mystery" roguelike game
3 Home page: http://www.avanor.com/
4 Copyright (C) 2000-2003 Vadim Gaidukevich
5 
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20 
21 #ifndef __EFFECT_H
22 #define __EFFECT_H
23 
24 #include "global.h"
25 #include "resist.h"
26 #include "mod_defs.h"
27 #include "defs.h"
28 
29 enum EFFECT_REQ
30 {
31 	ER_NONE		= 0,
32 	ER_TARGET	= 1,
33 	ER_DIRECTION= 3,
34 	ER_ITEM		= 4,
35 };
36 
37 enum EFFECT
38 {
39 	E_NONE						= -1,
40 	E_CURE_LIGHT_WOUNDS			= 0, //0
41 	E_CURE_SERIOUS_WOUNDS,
42 	E_CURE_CRITICAL_WOUNDS,
43 	E_CURE_MORTAL_WOUNDS,
44 	E_HEAL,
45 	E_ULTRAHEAL,
46 	E_POWER,
47 	E_ULTRAPOWER,
48 	E_RESTORATION,
49 	E_CURE_POISON,
50 	E_CURE_DISEASE,
51 
52 	E_BURNING_HANDS,
53 	E_ICE_TOUCH,
54 	E_DRAIN_LIFE,
55 
56 	E_MAGIC_ARROW,
57 	E_FIRE_BOLT,
58 	E_ICE_BOLT,
59 	E_LIGHTNING_BOLT,
60 	E_ACID_BOLT,
61 
62 	E_HEROISM,
63 	E_IDENTIFY,
64 	E_SUMMON_MONSTER,
65 	E_CREATE_ITEM,
66 	E_BLINK,
67 	E_TELEPORT,
68 	E_SELF_KNOWLEDGE,
69 	E_SEE_INVISIBLE,
70 	E_ACID_RESISTANCE,
71 	E_FIRE_RESISTANCE,
72 	E_COLD_RESISTANCE,
73 	E_POISON_RESISTANCE,
74 };
75 
76 class XCreature;
77 class XItem;
78 class XLocation;
79 
80 struct EFFECT_DATA
81 {
82 	EFFECT effect;
83 	XCreature * caller; //in much case effect makes caller, but some time it can be trap.
84 	XLocation * l; //for much visual effect this field must be filed
85 	int call_x, call_y; //starting pt of effect (for example for trap)
86 	XCreature * target; //target creature, usualy not required
87 	int target_x, target_y; //target position: we can make fire-bolt trap :)
88 	int power; //power == willpower)
89 	XItem * item; //some effect need an item...
90 };
91 
92 class XEffect
93 {
94 	static int Heal(XCreature * caster, int X, int Y, int Z);
95 	static int Cure(XCreature * caster, int X, int Y, int Z);
96 	static int Mana(XCreature * caster, int X, int Y, int Z);
97 	static int Touch(EFFECT_DATA * pData, int X, int Y, int Z, xColor col, RESISTANCE r, char * msg);
98 	static int Bolt(EFFECT_DATA * pData, int X, int Y, int Z, xColor col, RESISTANCE r, char * msg);
99 public:
100 	static int Make(EFFECT_DATA * pData);
101 	static RESULT Make(XCreature * caster, EFFECT effect, int power);
102 	static EFFECT_REQ GetReq(EFFECT effect);
103 	static int GetRange(EFFECT effect, int power);
104 };
105 
106 #endif
107