Crossfire Server, Branches 1.12  R18729
attack.h
Go to the documentation of this file.
1 /*
2  * static char *rcsid_attack_h =
3  * "$Id: attack.h 11578 2009-02-23 22:02:27Z lalo $";
4  */
5 
6 /*
7  CrossFire, A Multiplayer game for X-windows
8 
9  Copyright (C) 2002 Mark Wedel & Crossfire Development Team
10  Copyright (C) 1992 Frank Tore Johansen
11 
12  This program is free software; you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation; either version 2 of the License, or
15  (at your option) any later version.
16 
17  This program is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with this program; if not, write to the Free Software
24  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 
26  The authors can be reached via e-mail at crossfire-devel@real-time.com
27 */
28 
34 #ifndef ATTACK_H
35 #define ATTACK_H
36 
45 #define NROFATTACKS 26
46 #define NROFATTACKMESS 21
47 #define MAXATTACKMESS 21
48 
49 /* attack message numbers must be less than NROFATTACKMESS */
50 
51 #define ATM_ARROW 0
52 #define ATM_DRAIN 1
53 #define ATM_ELEC 2
54 #define ATM_COLD 3
55 #define ATM_FIRE 4
56 #define ATM_BASIC 5
57 #define ATM_KARATE 6
58 #define ATM_CLAW 7
59 #define ATM_PUNCH 8
60 #define ATM_SLASH 9
61 #define ATM_PIERCE 10
62 #define ATM_CLEAVE 11
63 #define ATM_SLICE 12
64 #define ATM_STAB 13
65 #define ATM_WHIP 14
66 #define ATM_CRUSH 15
67 #define ATM_BLUD 16
68 #define ATM_DOOR 17
69 #define ATM_SUFFER 18
70 #define ATM_WRAITH_FEED 19
71 
72 /* Note that the last ATNR_ should be one less than NROFATTACKS above
73  * since the ATNR starts counting at zero.
74  * For compatible loading, these MUST correspond to the same value
75  * as the bitmasks below.
76  */
77 #define ATNR_PHYSICAL 0
78 #define ATNR_MAGIC 1
79 #define ATNR_FIRE 2
80 #define ATNR_ELECTRICITY 3
81 #define ATNR_COLD 4
82 #define ATNR_CONFUSION 5
83 #define ATNR_ACID 6
84 #define ATNR_DRAIN 7
85 #define ATNR_WEAPONMAGIC 8
86 #define ATNR_GHOSTHIT 9
87 #define ATNR_POISON 10
88 #define ATNR_SLOW 11
89 #define ATNR_PARALYZE 12
90 #define ATNR_TURN_UNDEAD 13
91 #define ATNR_FEAR 14
92 #define ATNR_CANCELLATION 15
93 #define ATNR_DEPLETE 16
94 #define ATNR_DEATH 17
95 #define ATNR_CHAOS 18
96 #define ATNR_COUNTERSPELL 19
97 #define ATNR_GODPOWER 20
98 #define ATNR_HOLYWORD 21
99 #define ATNR_BLIND 22
100 #define ATNR_INTERNAL 23
101 #define ATNR_LIFE_STEALING 24
102 #define ATNR_DISEASE 25
103 
104 #define AT_PHYSICAL 0x00000001 /* 1 */
105 #define AT_MAGIC 0x00000002 /* 2 */
106 #define AT_FIRE 0x00000004 /* 4 */
107 #define AT_ELECTRICITY 0x00000008 /* 8 */
108 #define AT_COLD 0x00000010 /* 16 */
109 #define AT_CONFUSION 0x00000020 /* 32 The spell will use this one */
110 #define AT_ACID 0x00000040 /* 64 Things might corrode when hit */
111 #define AT_DRAIN 0x00000080 /* 128 */
112 #define AT_WEAPONMAGIC 0x00000100 /* 256 Very special, use with care */
113 #define AT_GHOSTHIT 0x00000200 /* 512 Attacker dissolves */
114 #define AT_POISON 0x00000400 /* 1024 */
115 #define AT_SLOW 0x00000800 /* 2048 */
116 #define AT_PARALYZE 0x00001000 /* 4096 */
117 #define AT_TURN_UNDEAD 0x00002000 /* 8192 */
118 #define AT_FEAR 0x00004000 /* 16384 */
119 #define AT_CANCELLATION 0x00008000 /* 32768 ylitalo@student.docs.uu.se */
120 #define AT_DEPLETE 0x00010000 /* 65536 vick@bern.docs.uu.se */
121 #define AT_DEATH 0x00020000 /* 131072 peterm@soda.berkeley.edu */
122 #define AT_CHAOS 0x00040000 /* 262144 peterm@soda.berkeley.edu*/
123 #define AT_COUNTERSPELL 0x00080000 /* 524288 peterm@soda.berkeley.edu*/
124 #define AT_GODPOWER 0x00100000 /* 1048576 peterm@soda.berkeley.edu */
125 #define AT_HOLYWORD 0x00200000 /* 2097152 race selective attack thomas@astro.psu.edu */
126 #define AT_BLIND 0x00400000 /* 4194304 thomas@astro.psu.edu */
127 #define AT_INTERNAL 0x00800000 /* Only used for internal calculations */
128 #define AT_LIFE_STEALING \
129  0x01000000 /* 16777216 for hp drain */
130 #define AT_DISEASE 0x02000000 /* 33554432 disease attacktypes */
131 
133 /* attacktypes_load is suffixed to resist_ when saving objects.
134  * (so the line may be 'resist_fire' 20 for example). These are never
135  * seen by the player. loader.l uses the same names, but it doesn't look
136  * like you can use these values, so in that function they are hard coded.
137  */
138 
139 /* Note that internal should not ever be referanced in the last two
140  * tables. however, other resisttypes may be added, and if through some
141  * bug these do get used somehow, might as well make it more easier to notice
142  * and not have mystery values appear.
143  */
144 
146 typedef struct attackmess {
147  int level;
148  char *buf1;
149  char *buf2;
150  char *buf3;
151 } attackmess_t;
152 
153 typedef struct {
155  int face;
156 } Chaos_Attacks;
157 
159 
160 #ifndef INIT_C
164 EXTERN const char *const resist_plus[NROFATTACKS];
165 EXTERN const char *const attacktype_desc[NROFATTACKS];
166 EXTERN const char *const resist_save[NROFATTACKS];
167 
168 /* Beware, names require an _ if there is a space, else they will be read
169  * as for example: resist_life stealing 50!
170  */
171 #else
172 
173 EXTERN const char *const resist_save[NROFATTACKS] = {
174  "physical ", "magic ", "fire ", "electricity ", "cold ", "confusion ", "acid ",
175  "drain ", "weaponmagic ", "ghosthit ", "poison ", "slow ", "paralyze ",
176  "turn_undead ", "fear ", "cancellation ", "deplete ", "death ", "chaos ",
177  "counterspell ", "godpower ", "holyword ", "blind ", "internal ", "life_stealing ",
178  "disease "
179 };
180 
182 EXTERN const char *const attacktype_desc[NROFATTACKS] = {
183  "physical", "magic", "fire", "electricity", "cold", "confusion", "acid",
184  "drain", "weapon magic", "ghost hit", "poison", "slow", "paralyze",
185  "turn undead", "fear", "cancellation", "deplete", "death", "chaos",
186  "counterspell", "god power", "holy word", "blind", "internal", "life stealing",
187  "disease"
188 };
189 
191 EXTERN const char *const resist_plus[NROFATTACKS] = {
192  "armour", "resist magic", "resist fire", "resist electricity", "resist cold",
193  "resist confusion", "resist acid", "resist drain",
194  "resist weaponmagic", "resist ghosthit", "resist poison", "resist slow",
195  "resist paralyzation", "resist turn undead", "resist fear",
196  "resist cancellation", "resist depletion", "resist death", "resist chaos",
197  "resist counterspell", "resist god power", "resist holy word",
198  "resist blindness", "resist internal", "resist life stealing",
199  "resist diseases"
200 };
201 
206 EXTERN const char *const change_resist_msg[NROFATTACKS] = {
207  "physical", "magic", "fire", "electricity", "cold", "confusion", "acid",
208  "draining", "weapon magic", "ghosts", "poison", "slow", "paralyze",
209  "turn undead", "fear", "cancellation", "depletion", "death attacks", "chaos",
210  "counterspell", "god power", "holy word", "blinding attacks", "internal",
211  "life stealing", "disease"
212 };
213 
214 
220 EXTERN int resist_table[] = {
226 };
227 
228 
231  { AT_PHYSICAL, 0 },
232  { AT_PHYSICAL, 0 }, /*face = explosion*/
233  { AT_PHYSICAL, 0 },
234  { AT_MAGIC, 1 },
235  { AT_MAGIC, 1 }, /* face = last-burnout */
236  { AT_MAGIC, 1 },
237  { AT_FIRE, 2 },
238  { AT_FIRE, 2 }, /* face = fire.... */
239  { AT_FIRE, 2 },
240  { AT_ELECTRICITY, 3 },
241  { AT_ELECTRICITY, 3 }, /* ball_lightning */
242  { AT_ELECTRICITY, 3 },
243  { AT_COLD, 4 },
244  { AT_COLD, 4 }, /* face=icestorm*/
245  { AT_COLD, 4 },
246  { AT_CONFUSION, 5 },
247  { AT_POISON, 7 },
248  { AT_POISON, 7 }, /* face = acid sphere. generator */
249  { AT_POISON, 7 }, /* poisoncloud face */
250  { AT_SLOW, 8 },
251  { AT_PARALYZE, 9 },
252  { AT_FEAR, 10 }
253 };
254 
255 #endif /* ifdef init_c */
256 
257 #define num_resist_table 19
258 
259 #endif /* ATTACK_H */
#define AT_ELECTRICITY
Definition: attack.h:107
#define ATNR_TURN_UNDEAD
Definition: attack.h:90
int level
Definition: attack.h:147
char * buf1
Definition: attack.h:148
#define ATNR_DEPLETE
Definition: attack.h:93
#define ATNR_SLOW
Definition: attack.h:88
#define AT_COLD
Definition: attack.h:108
#define ATNR_CONFUSION
Definition: attack.h:82
#define ATNR_PARALYZE
Definition: attack.h:89
EXTERN Chaos_Attacks ATTACKS[22]
Definition: attack.h:161
#define ATNR_LIFE_STEALING
Definition: attack.h:101
#define ATNR_DEATH
Definition: attack.h:94
#define MAXATTACKMESS
Definition: attack.h:47
#define ATNR_BLIND
Definition: attack.h:99
#define ATNR_FEAR
Definition: attack.h:91
struct attackmess attackmess_t
EXTERN const char *const change_resist_msg[NROFATTACKS]
Definition: attack.h:163
#define ATNR_MAGIC
Definition: attack.h:78
EXTERN int resist_table[]
Definition: attack.h:162
#define AT_FIRE
Definition: attack.h:106
#define NROFATTACKMESS
Definition: attack.h:46
#define ATNR_HOLYWORD
Definition: attack.h:98
#define ATNR_PHYSICAL
Definition: attack.h:77
#define ATNR_ELECTRICITY
Definition: attack.h:80
#define ATNR_POISON
Definition: attack.h:87
#define AT_PHYSICAL
Definition: attack.h:104
EXTERN const char *const attacktype_desc[NROFATTACKS]
Definition: attack.h:165
#define ATNR_DRAIN
Definition: attack.h:84
#define ATNR_GHOSTHIT
Definition: attack.h:86
#define AT_POISON
Definition: attack.h:114
EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]
Definition: attack.h:158
#define EXTERN
Definition: init.c:34
#define AT_FEAR
Definition: attack.h:118
#define AT_SLOW
Definition: attack.h:115
#define NROFATTACKS
Definition: attack.h:45
EXTERN const char *const resist_plus[NROFATTACKS]
Definition: attack.h:164
#define AT_MAGIC
Definition: attack.h:105
EXTERN const char *const resist_save[NROFATTACKS]
Definition: attack.h:166
#define ATNR_COLD
Definition: attack.h:81
char * buf3
Definition: attack.h:150
char * buf2
Definition: attack.h:149
#define AT_CONFUSION
Definition: attack.h:109
#define ATNR_ACID
Definition: attack.h:83
#define AT_PARALYZE
Definition: attack.h:116
int attacktype
Definition: attack.h:154
#define ATNR_FIRE
Definition: attack.h:79
#define ATNR_DISEASE
Definition: attack.h:102