1 | /* |
1 | /* |
2 | * static char *rcsid_attack_h = |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * "$Id: attack.h,v 1.2 2006/08/13 17:16:02 elmex Exp $"; |
3 | * |
|
|
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
|
|
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
|
|
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
|
|
7 | * |
|
|
8 | * Deliantra is free software: you can redistribute it and/or modify |
|
|
9 | * it under the terms of the GNU General Public License as published by |
|
|
10 | * the Free Software Foundation, either version 3 of the License, or |
|
|
11 | * (at your option) any later version. |
|
|
12 | * |
|
|
13 | * This program is distributed in the hope that it will be useful, |
|
|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
16 | * GNU General Public License for more details. |
|
|
17 | * |
|
|
18 | * You should have received a copy of the GNU General Public License |
|
|
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
|
20 | * |
|
|
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
4 | */ |
22 | */ |
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 | |
|
|
29 | |
23 | |
30 | #ifndef ATTACK_H |
24 | #ifndef ATTACK_H |
31 | #define ATTACK_H |
25 | #define ATTACK_H |
32 | |
|
|
33 | /* These are default values for converting from simple protected/immune/vuln |
|
|
34 | * to thre partial resistances |
|
|
35 | */ |
|
|
36 | #define RESIST_IMMUNE 100 |
|
|
37 | #define RESIST_PROT 30 |
|
|
38 | #define RESIST_VULN -100 |
|
|
39 | |
26 | |
40 | /* |
27 | /* |
41 | * Attacktypes: |
28 | * Attacktypes: |
42 | * ATNR_... is the attack number that is indexed into the |
29 | * ATNR_... is the attack number that is indexed into the |
43 | * the resist array in the object structure. |
30 | * the resist array in the object structure. |
44 | */ |
31 | */ |
45 | |
32 | |
46 | #define NROFATTACKS 26 |
|
|
47 | #define NROFATTACKMESS 20 |
33 | #define NROFATTACKMESS 20 |
48 | #define MAXATTACKMESS 20 |
34 | #define MAXATTACKMESS 20 |
49 | |
35 | |
50 | /* attack message numbers must be less than NROFATTACKMESS */ |
36 | /* attack message numbers must be less than NROFATTACKMESS */ |
51 | |
37 | |
… | |
… | |
67 | #define ATM_CRUSH 15 |
53 | #define ATM_CRUSH 15 |
68 | #define ATM_BLUD 16 |
54 | #define ATM_BLUD 16 |
69 | #define ATM_DOOR 17 |
55 | #define ATM_DOOR 17 |
70 | #define ATM_SUFFER 18 |
56 | #define ATM_SUFFER 18 |
71 | |
57 | |
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 | |
|
|
132 | /* attacktypes_load is suffixed to resist_ when saving objects. |
|
|
133 | * (so the line may be 'resist_fire' 20 for example). These are never |
|
|
134 | * seen by the player. loader.l uses the same names, but it doesn't look |
|
|
135 | * like you can use these values, so in that function they are hard coded. |
|
|
136 | */ |
|
|
137 | |
|
|
138 | /* Note that internal should not ever be referanced in the last two |
|
|
139 | * tables. however, other resisttypes may be added, and if through some |
|
|
140 | * bug these do get used somehow, might as well make it more easier to notice |
|
|
141 | * and not have mystery values appear. |
|
|
142 | */ |
|
|
143 | |
|
|
144 | /* attack messages structure */ |
58 | /* attack messages structure */ |
145 | typedef struct attackmess { |
59 | typedef struct attackmess { |
146 | int level; |
60 | int level; |
147 | char *buf1; |
61 | char *buf1; |
148 | char *buf2; |
62 | char *buf2; |
149 | char *buf3; |
63 | char *buf3; |
150 | } attackmess_t; |
64 | } attackmess_t; |
151 | |
65 | |
152 | EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]; |
66 | EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]; |
153 | |
67 | |
154 | #ifndef INIT_C |
68 | enum { |
155 | EXTERN int resist_table[]; |
69 | # define def(uc, lc, name, plus, change) ATNR_ ## uc, |
156 | EXTERN char *change_resist_msg[NROFATTACKS]; |
70 | # include "attackinc.h" |
157 | EXTERN char *resist_plus[NROFATTACKS]; |
71 | # undef def |
158 | EXTERN char *attacktype_desc[NROFATTACKS]; |
72 | NROFATTACKS |
159 | EXTERN char *resist_save[NROFATTACKS]; |
73 | }; |
160 | |
74 | |
161 | /* Beware, names require an _ if there is a space, else they will be read |
75 | enum { |
162 | * as for example: resist_life stealing 50! |
76 | # define def(uc, lc, name, plus, change) AT_ ## uc = 1UL << ATNR_ ## uc, |
163 | */ |
77 | # include "attackinc.h" |
164 | #else |
78 | # undef def |
165 | EXTERN const char* resist_save[NROFATTACKS] = { |
|
|
166 | "physical ", "magic ", "fire ", "electricity ", "cold ", "confusion ", "acid ", |
|
|
167 | "drain ", "weaponmagic ", "ghosthit ", "poison ", "slow ", "paralyze ", |
|
|
168 | "turn_undead ", "fear ", "cancellation ", "deplete ", "death ", "chaos ", |
|
|
169 | "counterspell ", "godpower ", "holyword ", "blind " , "internal ", "life_stealing ", |
|
|
170 | "disease " |
|
|
171 | }; |
79 | }; |
172 | |
80 | |
173 | /* Short description of names of the attacktypes */ |
81 | /* Short description of names of the attacktypes */ |
174 | EXTERN const char* attacktype_desc[NROFATTACKS] = { |
82 | extern const char* const attacktype_desc[NROFATTACKS]; |
175 | "physical", "magic", "fire", "electricity", "cold", "confusion", "acid", |
83 | |
176 | "drain", "weapon magic", "ghost hit", "poison", "slow", "paralyze", |
84 | /* Note that internal should not ever be referenced in the last two |
177 | "turn undead", "fear", "cancellation", "deplete", "death", "chaos", |
85 | * tables. however, other resisttypes may be added, and if through some |
178 | "counterspell", "god power", "holy word", "blind" , "internal", "life stealing", |
86 | * bug these do get used somehow, might as well make it more easier to notice |
179 | "disease" |
87 | * and not have mystery values appear. |
180 | }; |
88 | */ |
181 | |
89 | |
182 | /* This is the array that is what the player sees. */ |
90 | /* This is the array that is what the player sees. */ |
183 | |
|
|
184 | EXTERN const char* resist_plus[NROFATTACKS] = { |
91 | extern const char* const resist_plus[NROFATTACKS]; |
185 | "armour", "resist magic", "resist fire", "resist electricity", "resist cold", |
|
|
186 | "resist confusion", "resist acid", "resist drain", |
|
|
187 | "resist weaponmagic", "resist ghosthit", "resist poison", "resist slow", |
|
|
188 | "resist paralyzation", "resist turn undead", "resist fear", |
|
|
189 | "resist cancellation", "resist depletion", "resist death", "resist chaos", |
|
|
190 | "resist counterspell", "resist god power", "resist holy word", |
|
|
191 | "resist blindness" , "resist internal", "resist life stealing", |
|
|
192 | "resist diseases" |
|
|
193 | }; |
|
|
194 | |
92 | |
195 | /* These are the descriptions of the resistances displayed when a |
93 | /* These are the descriptions of the resistances displayed when a |
196 | * player puts on/takes off an item. See change_abil() in living.c. |
94 | * player puts on/takes off an item. See change_abil() in living.c. |
197 | */ |
95 | */ |
198 | EXTERN const char* change_resist_msg[NROFATTACKS] = { |
96 | extern const char* const change_resist_msg[NROFATTACKS]; |
199 | "physical", "magic", "fire", "electricity", "cold", "confusion", "acid", |
|
|
200 | "draining", "weapon magic", "ghosts", "poison", "slow", "paralyze", |
|
|
201 | "turn undead", "fear", "cancellation", "depletion", "death attacks", "chaos", |
|
|
202 | "counterspell", "god power", "holy word", "blinding attacks", "internal", |
|
|
203 | "life stealing", "disease" |
|
|
204 | }; |
|
|
205 | |
|
|
206 | |
97 | |
207 | /* If you want to weight things so certain resistances show up more often than |
98 | /* If you want to weight things so certain resistances show up more often than |
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 | */ |
211 | EXTERN int resist_table[] = {ATNR_PHYSICAL, ATNR_MAGIC, ATNR_FIRE, |
102 | extern int resist_table[NROFATTACKS]; |
212 | ATNR_ELECTRICITY,ATNR_COLD, ATNR_CONFUSION, ATNR_ACID, ATNR_DRAIN, |
|
|
213 | ATNR_GHOSTHIT, ATNR_POISON, ATNR_SLOW, ATNR_PARALYZE, ATNR_TURN_UNDEAD, |
|
|
214 | ATNR_FEAR, ATNR_DEPLETE, ATNR_DEATH, ATNR_HOLYWORD, ATNR_BLIND, |
|
|
215 | ATNR_LIFE_STEALING, ATNR_DISEASE}; |
|
|
216 | |
|
|
217 | #endif |
|
|
218 | |
103 | |
219 | #define num_resist_table 19 |
104 | #define num_resist_table 19 |
220 | |
105 | |
221 | #endif |
106 | #endif |
|
|
107 | |