ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/attack.h
(Generate patch)

Comparing deliantra/server/include/attack.h (file contents):
Revision 1.4 by root, Thu Aug 31 17:54:14 2006 UTC vs.
Revision 1.10 by root, Fri Dec 15 20:07:02 2006 UTC

16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 20
21 The authors can be reached via e-mail at crossfire-devel@real-time.com 21 The authors can be reached via e-mail at crossfire.de
22*/ 22*/
23
24 23
25#ifndef ATTACK_H 24#ifndef ATTACK_H
26#define ATTACK_H 25#define ATTACK_H
27
28/* These are default values for converting from simple protected/immune/vuln
29 * to thre partial resistances
30 */
31#define RESIST_IMMUNE 100
32#define RESIST_PROT 30
33#define RESIST_VULN -100
34 26
35/* 27/*
36 * Attacktypes: 28 * Attacktypes:
37 * ATNR_... is the attack number that is indexed into the 29 * ATNR_... is the attack number that is indexed into the
38 * the resist array in the object structure. 30 * the resist array in the object structure.
39 */ 31 */
40 32
41#define NROFATTACKS 26
42#define NROFATTACKMESS 20 33#define NROFATTACKMESS 20
43#define MAXATTACKMESS 20 34#define MAXATTACKMESS 20
44 35
45/* attack message numbers must be less than NROFATTACKMESS */ 36/* attack message numbers must be less than NROFATTACKMESS */
46 37
62#define ATM_CRUSH 15 53#define ATM_CRUSH 15
63#define ATM_BLUD 16 54#define ATM_BLUD 16
64#define ATM_DOOR 17 55#define ATM_DOOR 17
65#define ATM_SUFFER 18 56#define ATM_SUFFER 18
66 57
67/* Note that the last ATNR_ should be one less than NROFATTACKS above
68 * since the ATNR starts counting at zero.
69 * For compatible loading, these MUST correspond to the same value
70 * as the bitmasks below.
71 */
72#define ATNR_PHYSICAL 0
73#define ATNR_MAGIC 1
74#define ATNR_FIRE 2
75#define ATNR_ELECTRICITY 3
76#define ATNR_COLD 4
77#define ATNR_CONFUSION 5
78#define ATNR_ACID 6
79#define ATNR_DRAIN 7
80#define ATNR_WEAPONMAGIC 8
81#define ATNR_GHOSTHIT 9
82#define ATNR_POISON 10
83#define ATNR_SLOW 11
84#define ATNR_PARALYZE 12
85#define ATNR_TURN_UNDEAD 13
86#define ATNR_FEAR 14
87#define ATNR_CANCELLATION 15
88#define ATNR_DEPLETE 16
89#define ATNR_DEATH 17
90#define ATNR_CHAOS 18
91#define ATNR_COUNTERSPELL 19
92#define ATNR_GODPOWER 20
93#define ATNR_HOLYWORD 21
94#define ATNR_BLIND 22
95#define ATNR_INTERNAL 23
96#define ATNR_LIFE_STEALING 24
97#define ATNR_DISEASE 25
98
99#define AT_PHYSICAL 0x00000001 /* 1 */
100#define AT_MAGIC 0x00000002 /* 2 */
101#define AT_FIRE 0x00000004 /* 4 */
102#define AT_ELECTRICITY 0x00000008 /* 8 */
103#define AT_COLD 0x00000010 /* 16 */
104#define AT_CONFUSION 0x00000020 /* 32 The spell will use this one */
105#define AT_ACID 0x00000040 /* 64 Things might corrode when hit */
106#define AT_DRAIN 0x00000080 /* 128 */
107#define AT_WEAPONMAGIC 0x00000100 /* 256 Very special, use with care */
108#define AT_GHOSTHIT 0x00000200 /* 512 Attacker dissolves */
109#define AT_POISON 0x00000400 /* 1024 */
110#define AT_SLOW 0x00000800 /* 2048 */
111#define AT_PARALYZE 0x00001000 /* 4096 */
112#define AT_TURN_UNDEAD 0x00002000 /* 8192 */
113#define AT_FEAR 0x00004000 /* 16384 */
114#define AT_CANCELLATION 0x00008000 /* 32768 ylitalo@student.docs.uu.se */
115#define AT_DEPLETE 0x00010000 /* 65536 vick@bern.docs.uu.se */
116#define AT_DEATH 0x00020000 /* 131072 peterm@soda.berkeley.edu */
117#define AT_CHAOS 0x00040000 /* 262144 peterm@soda.berkeley.edu*/
118#define AT_COUNTERSPELL 0x00080000 /* 524288 peterm@soda.berkeley.edu*/
119#define AT_GODPOWER 0x00100000 /* 1048576 peterm@soda.berkeley.edu */
120#define AT_HOLYWORD 0x00200000 /* 2097152 race selective attack thomas@astro.psu.edu */
121#define AT_BLIND 0x00400000 /* 4194304 thomas@astro.psu.edu */
122#define AT_INTERNAL 0x00800000 /* Only used for internal calculations */
123#define AT_LIFE_STEALING \
124 0x01000000 /* 16777216 for hp drain */
125#define AT_DISEASE 0x02000000 /* 33554432 disease attacktypes */
126
127/* attacktypes_load is suffixed to resist_ when saving objects.
128 * (so the line may be 'resist_fire' 20 for example). These are never
129 * seen by the player. loader.l uses the same names, but it doesn't look
130 * like you can use these values, so in that function they are hard coded.
131 */
132
133/* Note that internal should not ever be referanced in the last two
134 * tables. however, other resisttypes may be added, and if through some
135 * bug these do get used somehow, might as well make it more easier to notice
136 * and not have mystery values appear.
137 */
138
139/* attack messages structure */ 58/* attack messages structure */
140typedef struct attackmess { 59typedef struct attackmess {
141 int level; 60 int level;
142 char *buf1; 61 char *buf1;
143 char *buf2; 62 char *buf2;
144 char *buf3; 63 char *buf3;
145} attackmess_t; 64} attackmess_t;
146 65
147EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]; 66EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS];
148 67
149#ifdef INIT_C 68enum {
150 69# define def(uc, lc, name, plus, change) ATNR_ ## uc,
151extern const keyword resist_save[NROFATTACKS] = { 70# include "attackinc.h"
152KW_resist_physical, KW_resist_magic, KW_resist_fire, KW_resist_electricity, KW_resist_cold, KW_resist_confusion, KW_resist_acid, 71# undef def
153KW_resist_drain, KW_resist_weaponmagic, KW_resist_ghosthit, KW_resist_poison, KW_resist_slow, KW_resist_paralyze, 72 NROFATTACKS
154KW_resist_turn_undead, KW_resist_fear, KW_resist_cancellation, KW_resist_deplete, KW_resist_death, KW_resist_chaos,
155KW_resist_counterspell, KW_resist_godpower, KW_resist_holyword, KW_resist_blind , KW_resist_internal, KW_resist_life_stealing,
156KW_resist_disease,
157}; 73};
158 74
159extern const char* const attacktype_desc[NROFATTACKS] = { 75enum {
160"physical", "magic", "fire", "electricity", "cold", "confusion", "acid", 76# define def(uc, lc, name, plus, change) AT_ ## uc = 1UL << ATNR_ ## uc,
161"drain", "weapon magic", "ghost hit", "poison", "slow", "paralyze", 77# include "attackinc.h"
162"turn undead", "fear", "cancellation", "deplete", "death", "chaos", 78# undef def
163"counterspell", "god power", "holy word", "blind" , "internal", "life stealing",
164"disease"
165}; 79};
166
167extern const char* const resist_plus[NROFATTACKS] = {
168"armour", "resist magic", "resist fire", "resist electricity", "resist cold",
169"resist confusion", "resist acid", "resist drain",
170"resist weaponmagic", "resist ghosthit", "resist poison", "resist slow",
171"resist paralyzation", "resist turn undead", "resist fear",
172"resist cancellation", "resist depletion", "resist death", "resist chaos",
173"resist counterspell", "resist god power", "resist holy word",
174"resist blindness" , "resist internal", "resist life stealing",
175"resist diseases"
176};
177
178extern const char* const change_resist_msg[NROFATTACKS] = {
179"physical", "magic", "fire", "electricity", "cold", "confusion", "acid",
180"draining", "weapon magic", "ghosts", "poison", "slow", "paralyze",
181"turn undead", "fear", "cancellation", "depletion", "death attacks", "chaos",
182"counterspell", "god power", "holy word", "blinding attacks", "internal",
183"life stealing", "disease"
184};
185
186extern int resist_table[NROFATTACKS] = {ATNR_PHYSICAL, ATNR_MAGIC, ATNR_FIRE,
187 ATNR_ELECTRICITY,ATNR_COLD, ATNR_CONFUSION, ATNR_ACID, ATNR_DRAIN,
188 ATNR_GHOSTHIT, ATNR_POISON, ATNR_SLOW, ATNR_PARALYZE, ATNR_TURN_UNDEAD,
189 ATNR_FEAR, ATNR_DEPLETE, ATNR_DEATH, ATNR_HOLYWORD, ATNR_BLIND,
190 ATNR_LIFE_STEALING, ATNR_DISEASE};
191
192#else
193
194extern const keyword resist_save[NROFATTACKS];
195 80
196/* Short description of names of the attacktypes */ 81/* Short description of names of the attacktypes */
197extern const char* const attacktype_desc[NROFATTACKS]; 82extern const char* const attacktype_desc[NROFATTACKS];
83
84/* Note that internal should not ever be referenced in the last two
85 * tables. however, other resisttypes may be added, and if through some
86 * bug these do get used somehow, might as well make it more easier to notice
87 * and not have mystery values appear.
88 */
198 89
199/* This is the array that is what the player sees. */ 90/* This is the array that is what the player sees. */
200extern const char* const resist_plus[NROFATTACKS]; 91extern const char* const resist_plus[NROFATTACKS];
201 92
202/* These are the descriptions of the resistances displayed when a 93/* These are the descriptions of the resistances displayed when a
208 * others, just add more entries in the table for the protections you want to 99 * others, just add more entries in the table for the protections you want to
209 * show up. 100 * show up.
210 */ 101 */
211extern int resist_table[NROFATTACKS]; 102extern int resist_table[NROFATTACKS];
212 103
213#endif
214
215#define num_resist_table 19 104#define num_resist_table 19
216 105
217#endif 106#endif
107

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines