Debian Codegraph @

include/attack.h

raw symbols SCIP
1 /**
2 * @file
3 * Attack-related definitions.
4 */
5
6 #ifndef ATTACK_H
7 #define ATTACK_H
8
9 /**
10 * @defgroup Attacktypes Attack types
11 * - ATNR_xxx is the attack number that is indexed into the
12 * the resist array in the object structure.
13 * - ATM_xxx is the message number
14 * - AT_xxx is the bitmask in the obj::attacktype field.
15 */
16 /*@{*/
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 [email protected] */
92 #define AT_DEPLETE 0x00010000 /* 65536 [email protected] */
93 #define AT_DEATH 0x00020000 /* 131072 [email protected] */
94 #define AT_CHAOS 0x00040000 /* 262144 [email protected]*/
95 #define AT_COUNTERSPELL 0x00080000 /* 524288 [email protected]*/
96 #define AT_GODPOWER 0x00100000 /* 1048576 [email protected] */
97 #define AT_HOLYWORD 0x00200000 /* 2097152 race selective attack [email protected] */
98 #define AT_BLIND 0x00400000 /* 4194304 [email protected] */
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 /*@}*/
104
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
117 /** Attack messages structure. */
118 typedef struct attackmess {
119 int level;
120 char *buf1;
121 char *buf2;
122 char *buf3;
123 } attackmess_t;
124
125 typedef struct {
126 int attacktype;
127 int face;
128 } Chaos_Attacks;
129
130 /** Attack messages the player gets when hitting/getting hit. */
131 EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS];
132
133 #ifndef INIT_C
134 EXTERN Chaos_Attacks ATTACKS[22];
135 EXTERN const char *const change_resist_msg[NROFATTACKS];
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 /** Attack types. */
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
154 /** Short description of names of the attacktypes */
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
163 /** Attack types to show to the player. */
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
175 /** Colors to add to the resistances for media tags. */
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
181 /**
182 * These are the descriptions of the resistances displayed when a
183 * player puts on/takes off an item. See change_abil() in living.c.
184 */
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
194 /** Some local definitions for shuffle_attack(). */
195 EXTERN Chaos_Attacks ATTACKS[22] = {
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 */