Crossfire Server, Trunk  R20513
attack.h
Go to the documentation of this file.
1 
6 #ifndef ATTACK_H
7 #define ATTACK_H
8 
17 #define NROFATTACKS 26
18 #define NROFATTACKMESS 21
19 #define MAXATTACKMESS 21
20 
21 /* attack message numbers must be less than NROFATTACKMESS */
22 
23 #define ATM_ARROW 0
24 #define ATM_DRAIN 1
25 #define ATM_ELEC 2
26 #define ATM_COLD 3
27 #define ATM_FIRE 4
28 #define ATM_BASIC 5
29 #define ATM_KARATE 6
30 #define ATM_CLAW 7
31 #define ATM_PUNCH 8
32 #define ATM_SLASH 9
33 #define ATM_PIERCE 10
34 #define ATM_CLEAVE 11
35 #define ATM_SLICE 12
36 #define ATM_STAB 13
37 #define ATM_WHIP 14
38 #define ATM_CRUSH 15
39 #define ATM_BLUD 16
40 #define ATM_DOOR 17
41 #define ATM_SUFFER 18
42 #define ATM_WRAITH_FEED 19
43 
44 /* Note that the last ATNR_ should be one less than NROFATTACKS above
45  * since the ATNR starts counting at zero.
46  * For compatible loading, these MUST correspond to the same value
47  * as the bitmasks below.
48  */
49 #define ATNR_PHYSICAL 0
50 #define ATNR_MAGIC 1
51 #define ATNR_FIRE 2
52 #define ATNR_ELECTRICITY 3
53 #define ATNR_COLD 4
54 #define ATNR_CONFUSION 5
55 #define ATNR_ACID 6
56 #define ATNR_DRAIN 7
57 #define ATNR_WEAPONMAGIC 8
58 #define ATNR_GHOSTHIT 9
59 #define ATNR_POISON 10
60 #define ATNR_SLOW 11
61 #define ATNR_PARALYZE 12
62 #define ATNR_TURN_UNDEAD 13
63 #define ATNR_FEAR 14
64 #define ATNR_CANCELLATION 15
65 #define ATNR_DEPLETE 16
66 #define ATNR_DEATH 17
67 #define ATNR_CHAOS 18
68 #define ATNR_COUNTERSPELL 19
69 #define ATNR_GODPOWER 20
70 #define ATNR_HOLYWORD 21
71 #define ATNR_BLIND 22
72 #define ATNR_INTERNAL 23
73 #define ATNR_LIFE_STEALING 24
74 #define ATNR_DISEASE 25
75 
76 #define AT_PHYSICAL 0x00000001 /* 1 */
77 #define AT_MAGIC 0x00000002 /* 2 */
78 #define AT_FIRE 0x00000004 /* 4 */
79 #define AT_ELECTRICITY 0x00000008 /* 8 */
80 #define AT_COLD 0x00000010 /* 16 */
81 #define AT_CONFUSION 0x00000020 /* 32 The spell will use this one */
82 #define AT_ACID 0x00000040 /* 64 Things might corrode when hit */
83 #define AT_DRAIN 0x00000080 /* 128 */
84 #define AT_WEAPONMAGIC 0x00000100 /* 256 Very special, use with care */
85 #define AT_GHOSTHIT 0x00000200 /* 512 Attacker dissolves */
86 #define AT_POISON 0x00000400 /* 1024 */
87 #define AT_SLOW 0x00000800 /* 2048 */
88 #define AT_PARALYZE 0x00001000 /* 4096 */
89 #define AT_TURN_UNDEAD 0x00002000 /* 8192 */
90 #define AT_FEAR 0x00004000 /* 16384 */
91 #define AT_CANCELLATION 0x00008000 /* 32768 ylitalo@student.docs.uu.se */
92 #define AT_DEPLETE 0x00010000 /* 65536 vick@bern.docs.uu.se */
93 #define AT_DEATH 0x00020000 /* 131072 peterm@soda.berkeley.edu */
94 #define AT_CHAOS 0x00040000 /* 262144 peterm@soda.berkeley.edu*/
95 #define AT_COUNTERSPELL 0x00080000 /* 524288 peterm@soda.berkeley.edu*/
96 #define AT_GODPOWER 0x00100000 /* 1048576 peterm@soda.berkeley.edu */
97 #define AT_HOLYWORD 0x00200000 /* 2097152 race selective attack thomas@astro.psu.edu */
98 #define AT_BLIND 0x00400000 /* 4194304 thomas@astro.psu.edu */
99 #define AT_INTERNAL 0x00800000 /* Only used for internal calculations */
100 #define AT_LIFE_STEALING \
101  0x01000000 /* 16777216 for hp drain */
102 #define AT_DISEASE 0x02000000 /* 33554432 disease attacktypes */
103 
105 /* attacktypes_load is suffixed to resist_ when saving objects.
106  * (so the line may be 'resist_fire' 20 for example). These are never
107  * seen by the player. loader.l uses the same names, but it doesn't look
108  * like you can use these values, so in that function they are hard coded.
109  */
110 
111 /* Note that internal should not ever be referanced in the last two
112  * tables. however, other resisttypes may be added, and if through some
113  * bug these do get used somehow, might as well make it more easier to notice
114  * and not have mystery values appear.
115  */
116 
118 typedef struct attackmess {
119  int level;
120  char *buf1;
121  char *buf2;
122  char *buf3;
123 } attackmess_t;
124 
125 typedef struct {
127  int face;
128 } Chaos_Attacks;
129 
132 
133 #ifndef INIT_C
136 EXTERN const char *const resist_plus[NROFATTACKS];
137 EXTERN const char *const resist_color[NROFATTACKS];
138 EXTERN const char *const attacktype_desc[NROFATTACKS];
139 EXTERN const char *const resist_save[NROFATTACKS];
140 
141 /* Beware, names require an _ if there is a space, else they will be read
142  * as for example: resist_life stealing 50!
143  */
144 #else
145 
146 EXTERN const char *const resist_save[NROFATTACKS] = {
147  "physical ", "magic ", "fire ", "electricity ", "cold ", "confusion ", "acid ",
148  "drain ", "weaponmagic ", "ghosthit ", "poison ", "slow ", "paralyze ",
149  "turn_undead ", "fear ", "cancellation ", "deplete ", "death ", "chaos ",
150  "counterspell ", "godpower ", "holyword ", "blind ", "internal ", "life_stealing ",
151  "disease "
152 };
153 
155 EXTERN const char *const attacktype_desc[NROFATTACKS] = {
156  "physical", "magic", "fire", "electricity", "cold", "confusion", "acid",
157  "drain", "weapon magic", "ghost hit", "poison", "slow", "paralyze",
158  "turn undead", "fear", "cancellation", "deplete", "death", "chaos",
159  "counterspell", "god power", "holy word", "blind", "internal", "life stealing",
160  "disease"
161 };
162 
164 EXTERN const char *const resist_plus[NROFATTACKS] = {
165  "armour", "resist magic", "resist fire", "resist electricity", "resist cold",
166  "resist confusion", "resist acid", "resist drain",
167  "resist weaponmagic", "resist ghosthit", "resist poison", "resist slow",
168  "resist paralyzation", "resist turn undead", "resist fear",
169  "resist cancellation", "resist depletion", "resist death", "resist chaos",
170  "resist counterspell", "resist god power", "resist holy word",
171  "resist blindness", "resist internal", "resist life stealing",
172  "resist diseases"
173 };
174 
176 EXTERN const char *const resist_color[NROFATTACKS] = {
177  "#FF15CD", "#930C76", "red", "blue", "#2CFFFF", NULL, NULL, NULL, NULL, NULL, "green", NULL, NULL,
178  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
179 };
180 
185 EXTERN const char *const change_resist_msg[NROFATTACKS] = {
186  "physical", "magic", "fire", "electricity", "cold", "confusion", "acid",
187  "draining", "weapon magic", "ghosts", "poison", "slow", "paralyze",
188  "turn undead", "fear", "cancellation", "depletion", "death attacks", "chaos",
189  "counterspell", "god power", "holy word", "blinding attacks", "internal",
190  "life stealing", "disease"
191 };
192 
193 
196  { AT_PHYSICAL, 0 },
197  { AT_PHYSICAL, 0 }, /*face = explosion*/
198  { AT_PHYSICAL, 0 },
199  { AT_MAGIC, 1 },
200  { AT_MAGIC, 1 }, /* face = last-burnout */
201  { AT_MAGIC, 1 },
202  { AT_FIRE, 2 },
203  { AT_FIRE, 2 }, /* face = fire.... */
204  { AT_FIRE, 2 },
205  { AT_ELECTRICITY, 3 },
206  { AT_ELECTRICITY, 3 }, /* ball_lightning */
207  { AT_ELECTRICITY, 3 },
208  { AT_COLD, 4 },
209  { AT_COLD, 4 }, /* face=icestorm*/
210  { AT_COLD, 4 },
211  { AT_CONFUSION, 5 },
212  { AT_POISON, 7 },
213  { AT_POISON, 7 }, /* face = acid sphere. generator */
214  { AT_POISON, 7 }, /* poisoncloud face */
215  { AT_SLOW, 8 },
216  { AT_PARALYZE, 9 },
217  { AT_FEAR, 10 }
218 };
219 
220 #endif /* ifdef init_c */
221 
222 #endif /* ATTACK_H */
#define AT_ELECTRICITY
Definition: attack.h:79
int level
Definition: attack.h:119
char * buf1
Definition: attack.h:120
#define AT_COLD
Definition: attack.h:80
EXTERN Chaos_Attacks ATTACKS[22]
Definition: attack.h:134
#define MAXATTACKMESS
Definition: attack.h:19
struct attackmess attackmess_t
Attack messages structure.
EXTERN const char *const change_resist_msg[NROFATTACKS]
Definition: attack.h:135
Attack messages structure.
Definition: attack.h:118
#define AT_FIRE
Definition: attack.h:78
#define NROFATTACKMESS
Definition: attack.h:18
#define AT_PHYSICAL
Definition: attack.h:76
EXTERN const char *const attacktype_desc[NROFATTACKS]
Definition: attack.h:138
#define AT_POISON
Definition: attack.h:86
EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]
Attack messages the player gets when hitting/getting hit.
Definition: attack.h:131
#define EXTERN
Definition: init.c:19
#define AT_FEAR
Definition: attack.h:90
#define AT_SLOW
Definition: attack.h:87
#define NROFATTACKS
Definition: attack.h:17
EXTERN const char *const resist_plus[NROFATTACKS]
Definition: attack.h:136
#define AT_MAGIC
Definition: attack.h:77
EXTERN const char *const resist_save[NROFATTACKS]
Definition: attack.h:139
char * buf3
Definition: attack.h:122
char * buf2
Definition: attack.h:121
#define AT_CONFUSION
Definition: attack.h:81
EXTERN const char *const resist_color[NROFATTACKS]
Definition: attack.h:137
#define AT_PARALYZE
Definition: attack.h:88
int attacktype
Definition: attack.h:126