1 /* $Id$ */
2 /* File: tables.c */
3 
4 /* Purpose: Angband Tables shared by both client and server.
5  * originally added for runecraft. - C. Blue */
6 
7 #include "angband.h"
8 
9 
10 
11 /* Spell failure rate calculations ----------------------------------------- */
12 
13 /*
14  * Stat Table (INT/WIS) -- Minimum failure rate (percentage)
15  */
16 byte adj_mag_fail[] =
17 {
18         99      /* 3 */,
19         99      /* 4 */,
20         99      /* 5 */,
21         99      /* 6 */,
22         99      /* 7 */,
23         50      /* 8 */,
24         30      /* 9 */,
25         20      /* 10 */,
26         15      /* 11 */,
27         12      /* 12 */,
28         11      /* 13 */,
29         10      /* 14 */,
30         9       /* 15 */,
31         8       /* 16 */,
32         7       /* 17 */,
33         6       /* 18/00-18/09 */,
34         6       /* 18/10-18/19 */,
35         5       /* 18/20-18/29 */,
36         5       /* 18/30-18/39 */,
37         5       /* 18/40-18/49 */,
38         4       /* 18/50-18/59 */,
39         4       /* 18/60-18/69 */,
40         4       /* 18/70-18/79 */,
41         4       /* 18/80-18/89 */,
42         3       /* 18/90-18/99 */,
43         3       /* 18/100-18/109 */,
44         2       /* 18/110-18/119 */,
45         2       /* 18/120-18/129 */,
46         2       /* 18/130-18/139 */,
47         2       /* 18/140-18/149 */,
48         1       /* 18/150-18/159 */,
49         1       /* 18/160-18/169 */,
50         1       /* 18/170-18/179 */,
51         1       /* 18/180-18/189 */,
52         1       /* 18/190-18/199 */,
53         0       /* 18/200-18/209 */,
54         0       /* 18/210-18/219 */,
55         0       /* 18/220+ */
56 };
57 
58 /*
59  * Stat Table (INT/WIS) -- Various things
60  */
61 byte adj_mag_stat[] =
62 {
63         0       /* 3 */,
64         0       /* 4 */,
65         0       /* 5 */,
66         0       /* 6 */,
67         0       /* 7 */,
68         1       /* 8 */,
69         1       /* 9 */,
70         1       /* 10 */,
71         1       /* 11 */,
72         1       /* 12 */,
73         1       /* 13 */,
74         1       /* 14 */,
75         2       /* 15 */,
76         2       /* 16 */,
77         2       /* 17 */,
78         3       /* 18/00-18/09 */,
79         3       /* 18/10-18/19 */,
80         3       /* 18/20-18/29 */,
81         3       /* 18/30-18/39 */,
82         3       /* 18/40-18/49 */,
83         4       /* 18/50-18/59 */,
84         4       /* 18/60-18/69 */,
85         5       /* 18/70-18/79 */,
86         6       /* 18/80-18/89 */,
87         7       /* 18/90-18/99 */,
88         8       /* 18/100-18/109 */,
89         9       /* 18/110-18/119 */,
90         10      /* 18/120-18/129 */,
91         11      /* 18/130-18/139 */,
92         12      /* 18/140-18/149 */,
93         13      /* 18/150-18/159 */,
94         14      /* 18/160-18/169 */,
95         15      /* 18/170-18/179 */,
96         16      /* 18/180-18/189 */,
97         17      /* 18/190-18/199 */,
98         18      /* 18/200-18/209 */,
99         19      /* 18/210-18/219 */,
100         20      /* 18/220+ */
101 };
102 
103 /*
104  * Stat Table (INT) for mimicry powers fail rate modifier (%)
105  */
106 byte adj_int_pow[] =
107 {
108         250     /* 3 */,
109         210     /* 4 */,
110         190     /* 5 */,
111         160     /* 6 */,
112         140     /* 7 */,
113         120     /* 8 */,
114         110     /* 9 */,
115         100     /* 10 */,
116         100     /* 11 */,
117         95      /* 12 */,
118         90      /* 13 */,
119         85      /* 14 */,
120         80      /* 15 */,
121         75      /* 16 */,
122         70      /* 17 */,
123         65      /* 18/00-18/09 */,
124         61      /* 18/10-18/19 */,
125         57      /* 18/20-18/29 */,
126         53      /* 18/30-18/39 */,
127         49      /* 18/40-18/49 */,
128         45      /* 18/50-18/59 */,
129         41      /* 18/60-18/69 */,
130         38      /* 18/70-18/79 */,
131         35      /* 18/80-18/89 */,
132         32      /* 18/90-18/99 */,
133         29      /* 18/100-18/109 */,
134         27      /* 18/110-18/119 */,
135         25      /* 18/120-18/129 */,
136         23      /* 18/130-18/139 */,
137         21      /* 18/140-18/149 */,
138         19      /* 18/150-18/159 */,
139         17      /* 18/160-18/169 */,
140         15      /* 18/170-18/179 */,
141         14      /* 18/180-18/189 */,
142         13      /* 18/190-18/199 */,
143         12      /* 18/200-18/209 */,
144         11      /* 18/210-18/219 */,
145         10      /* 18/220+ */
146 };
147 
148 
149 
150 /* Mimicry powers ---------------------------------------------------------- */
151 
152 /*
153  * Mimic 'spells' -- they should be integrated to the realm spells
154  * (slevel, smana, sfail, sexp, ftk)
155  */
156 magic_type innate_powers[96] =
157 {
158 /* 0, mana, fail, 0 */
159 // RF4_SHRIEK                   0x00000001      /* Shriek for help */
160   {0, 2, 0, 0, 0},
161 // RF4_UNMAGIC                  0x00000002      /* (?) */
162   {0, 0, 0, 0, 0},
163 // (S_ANIMAL) RF4_XXX3                  0x00000004      /* (?) */
164   {0, 0, 0, 0, 0},
165 // RF4_ROCKET                   0x00000008      /* (?) */
166   {0, 60, 70, 0, 2},
167 // RF4_ARROW_1                  0x00000010      /* Fire an arrow (light) */
168   {0, 2, 5, 0, 1},
169 // RF4_ARROW_2                  0x00000020      /* Fire an shot (heavy) */
170   {0, 2, 6, 0, 1},
171 // XXX (RF4_ARROW_3)                    0x00000040      /* Fire bolt (heavy) */
172   {0, 2, 7, 0, 1},
173 // XXX (RF4_ARROW_4)                    0x00000080      /* Fire missiles (heavy) */
174   {0, 3, 9, 0, 1},
175 // RF4_BR_ACID                  0x00000100      /* Breathe Acid */
176   {0, 10, 20, 0, 2},
177 // RF4_BR_ELEC                  0x00000200      /* Breathe Elec */
178   {0, 10, 20, 0, 2},
179 // RF4_BR_FIRE                  0x00000400      /* Breathe Fire */
180   {0, 10, 20, 0, 2},
181 // RF4_BR_COLD                  0x00000800      /* Breathe Cold */
182   {0, 10, 20, 0, 2},
183 // RF4_BR_POIS                  0x00001000      /* Breathe Poison */
184   {0, 13, 25, 0, 2},
185 // RF4_BR_NETH                  0x00002000      /* Breathe Nether */
186   {0, 22, 35, 0, 2},
187 // RF4_BR_LITE                  0x00004000      /* Breathe Lite */
188   {0, 10, 20, 0, 2},
189 // RF4_BR_DARK                  0x00008000      /* Breathe Dark */
190   {0, 10, 20, 0, 2},
191 // RF4_BR_CONF                  0x00010000      /* Breathe Confusion */
192   {0, 10, 25, 0, 2},
193 // RF4_BR_SOUN                  0x00020000      /* Breathe Sound */
194   {0, 14, 30, 0, 2},
195 // RF4_BR_CHAO                  0x00040000      /* Breathe Chaos */
196   {0, 25, 40, 0, 2},
197 // RF4_BR_DISE                  0x00080000      /* Breathe Disenchant */
198   {0, 28, 45, 0, 2},
199 // RF4_BR_NEXU                  0x00100000      /* Breathe Nexus */
200   {0, 20, 45, 0, 2},
201 // RF4_BR_TIME                  0x00200000      /* Breathe Time */
202   {0, 30, 50, 0, 2},
203 // RF4_BR_INER                  0x00400000      /* Breathe Inertia */
204   {0, 25, 35, 0, 2},
205 // RF4_BR_GRAV                  0x00800000      /* Breathe Gravity */
206   {0, 25, 35, 0, 2},
207 // RF4_BR_SHAR                  0x01000000      /* Breathe Shards */
208   {0, 15, 25, 0, 2},
209 // RF4_BR_PLAS                  0x02000000      /* Breathe Plasma */
210   {0, 25, 30, 0, 2},
211 // RF4_BR_WALL                  0x04000000      /* Breathe Force */
212   {0, 30, 40, 0, 2},
213 // RF4_BR_MANA                  0x08000000      /* Breathe Mana */
214   {0, 35, 45, 0, 2},
215 // RF4_BR_DISI                  0x10000000
216   {0, 50, 70, 0, 2},
217 // RF4_BR_NUKE                  0x20000000
218   {0, 27, 40, 0, 2},
219 // 0x40000000
220   {0, 0, 0, 0, 0},
221 // RF4_BOULDER
222   {0, 2, 15, 0, 1},
223 
224 /*
225  * New monster race bit flags
226  */
227 // RF5_BA_ACID                  0x00000001      /* Acid Ball */
228   {0, 8, 10, 0, 2},
229 // RF5_BA_ELEC                  0x00000002      /* Elec Ball */
230   {0, 8, 10, 0, 2},
231 // RF5_BA_FIRE                  0x00000004      /* Fire Ball */
232   {0, 8, 10, 0, 2},
233 // RF5_BA_COLD                  0x00000008      /* Cold Ball */
234   {0, 8, 10, 0, 2},
235 // RF5_BA_POIS                  0x00000010      /* Poison Ball */
236   {0, 11, 20, 0, 2},
237 // RF5_BA_NETH                  0x00000020      /* Nether Ball */
238   {0, 25, 40, 0, 2},
239 // RF5_BA_WATE                  0x00000040      /* Water Ball */
240   {0, 17, 30, 0, 2},
241 // RF5_BA_MANA                  0x00000080      /* Mana Storm */
242   {0, 45, 50, 0, 2},
243 // RF5_BA_DARK                  0x00000100      /* Darkness Storm */
244   {0, 20, 0, 0, 2},
245 // RF5_DRAIN_MANA               0x00000200      /* Drain Mana */
246   {0, 0, 0, 0, 0},
247 // RF5_MIND_BLAST               0x00000400      /* Blast Mind */
248   {0, 15, 13, 0, 2},
249 // RF5_BRAIN_SMASH              0x00000800      /* Smash Brain */
250   {0, 25, 15, 0, 2},
251 // RF5_CAUSE_1                  0x00001000      /* Cause Light Wound */
252   {0, 3, 15, 0, 1},
253 // RF5_CAUSE_2                  0x00002000      /* Cause Serious Wound */
254   {0, 6, 20, 0, 1},
255 // RF5_BA_NUKE                  0x00004000      /* Toxic Ball */
256   {0, 30, 30, 0, 2},
257 // RF5_BA_CHAO                  0x00008000      /* Chaos Ball */
258   {0, 45, 40, 0, 2},
259 // RF5_BO_ACID                  0x00010000      /* Acid Bolt */
260   {0, 4, 13, 0, 1},
261 // RF5_BO_ELEC                  0x00020000      /* Elec Bolt (unused) */
262   {0, 3, 13, 0, 1},
263 // RF5_BO_FIRE                  0x00040000      /* Fire Bolt */
264   {0, 4, 13, 0, 1},
265 // RF5_BO_COLD                  0x00080000      /* Cold Bolt */
266   {0, 3, 13, 0, 1},
267 // RF5_BO_POIS                  0x00100000      /* Poison Bolt (unused) */
268   {0, 5, 16, 0, 1},
269 // RF5_BO_NETH                  0x00200000      /* Nether Bolt */
270   {0, 15, 20, 0, 1},
271 // RF5_BO_WATE                  0x00400000      /* Water Bolt */
272   {0, 13, 18, 0, 1},
273 // RF5_BO_MANA                  0x00800000      /* Mana Bolt */
274   {0, 20, 25, 0, 1},
275 // RF5_BO_PLAS                  0x01000000      /* Plasma Bolt */
276   {0, 15, 18, 0, 1},
277 // RF5_BO_ICEE                  0x02000000      /* Ice Bolt */
278   {0, 10, 15, 0, 1},
279 // RF5_MISSILE                  0x04000000      /* Magic Missile */
280   {0, 2, 5, 0, 1},
281 // RF5_SCARE                    0x08000000      /* Frighten Player */
282   {0, 3, 8, 0, 2},
283 // RF5_BLIND                    0x10000000      /* Blind Player */
284   {0, 5, 8, 0, 2},
285 // RF5_CONF                     0x20000000      /* Confuse Player */
286   {0, 5, 8, 0, 2},
287 // RF5_SLOW                     0x40000000      /* Slow Player */
288   {0, 7, 10, 0, 2},
289 // RF5_HOLD                     0x80000000      /* Paralyze Player (translates into forced monsleep) */
290   {0, 5, 10, 0, 2},
291 
292 /*
293  * New monster race bit flags
294  */
295 // RF6_HASTE                    0x00000001      /* Speed self */
296   {0, 10, 20, 0, 0},
297 // RF6_HAND_DOOM                0x00000002      /* Speed a lot (?) */
298   {0, 100, 80, 0, 0},
299 // RF6_HEAL                     0x00000004      /* Heal self */
300   {0, 10, 20, 0, 0},
301 // RF6_XXX2                     0x00000008      /* Heal a lot (?) */
302   {0, 0, 0, 0, 0},
303 // RF6_BLINK                    0x00000010      /* Teleport Short */
304   {0, 5, 15, 0, 0},
305 // RF6_TPORT                    0x00000020      /* Teleport Long */
306   {0, 20, 30, 0, 0},
307 // RF6_XXX3                     0x00000040      /* Move to Player (?) */
308   {0, 0, 0, 0, 0},
309 // RF6_XXX4                     0x00000080      /* Move to Monster (?) */
310   {0, 0, 0, 0, 0},
311 // RF6_TELE_TO                  0x00000100      /* Move player to monster */
312   {0, 20, 30, 0, 0},
313 // RF6_TELE_AWAY                0x00000200      /* Move player far away */
314   {0, 25, 30, 0, 0},
315 // RF6_TELE_LEVEL               0x00000400      /* Move player vertically */
316   {0, 30, 60, 0, 0},
317 // RF6_XXX5                     0x00000800      /* Move player (?) */
318   {0, 0, 0, 0, 0},
319 // RF6_DARKNESS         0x00001000      /* Create Darkness */
320   {0, 6, 8, 0, 0},
321 // RF6_TRAPS                    0x00002000      /* Create Traps */
322   {0, 15, 25, 0, 0},
323 // RF6_FORGET                   0x00004000      /* Cause amnesia */
324   {0, 25, 35, 0, 2},
325 
326 };
327 
328 monster_spell_type monster_spells4[32] =
329 {
330   {"Shriek", FALSE},
331   {"Negate magic", FALSE},
332   {"XXX", TRUE},
333   {"Fire Rocket", TRUE},
334 
335   {"Arrow", TRUE},
336   {"Shot", TRUE},
337   {"Bolt", TRUE},
338   {"Missile", TRUE},
339 
340   {"Breathe Acid", TRUE},
341   {"Breathe Lightning", TRUE},
342   {"Breathe Fire", TRUE},
343   {"Breathe Cold", TRUE},
344 
345   {"Breathe Poison", TRUE},
346   {"Breathe Nether", TRUE},
347   {"Breathe Lite", TRUE},
348   {"Breathe Darkness", TRUE},
349 
350   {"Breathe Confusion", TRUE},
351   {"Breathe Sound", TRUE},
352   {"Breathe Chaos", TRUE},
353   {"Breathe Disenchantment", TRUE},
354 
355   {"Breathe Nexus", TRUE},
356   {"Breathe Time", TRUE},
357   {"Breathe Inertia", TRUE},
358   {"Breathe Gravity", TRUE},
359 
360   {"Breathe Shards", TRUE},
361   {"Breathe Plasma", TRUE},
362   {"Breathe Force", TRUE},
363   {"Breathe Mana", TRUE},
364 
365   {"Breathe Disintegration", TRUE},
366   {"Breathe Toxic Waste", TRUE},
367   {"Ghastly Moan", FALSE},
368   {"Throw Boulder", TRUE},      /* "XXX", */
369 };
370 
371 monster_spell_type monster_spells5[32] =
372 {
373   {"Acid Ball", TRUE},
374   {"Lightning Ball", TRUE},
375   {"Fire Ball", TRUE},
376   {"Cold Ball", TRUE},
377 
378   {"Poison Ball", TRUE},
379   {"Nether Ball", TRUE},
380   {"Water Ball", TRUE},
381   {"Mana Storm", TRUE},
382 
383   {"Darkness Storm", TRUE},
384   {"Drain Mana", TRUE},
385   {"Mind Blast", TRUE},
386   {"Brain Smash", TRUE},
387 
388   {"Cause Wounds", TRUE},
389   {"XXX", TRUE},
390   {"Ball Toxic Waste", TRUE},
391   {"Raw Chaos", TRUE},
392 
393   {"Acid Bolt", TRUE},
394   {"Lightning Bolt", TRUE},
395   {"Fire Bolt", TRUE},
396   {"Cold Bolt", TRUE},
397 
398   {"Poison Bolt", TRUE},
399   {"Nether Bolt", TRUE},
400   {"Water Bolt", TRUE},
401   {"Mana Bolt", TRUE},
402 
403   {"Plasma Bolt", TRUE},
404   {"Ice Bolt", TRUE},
405   {"Magic Missile", TRUE},
406   {"Scare", TRUE},
407 
408   {"Blind", TRUE},
409   {"Confusion", TRUE},
410   {"Slow", TRUE},
411   {"Paralyze", TRUE},
412 };
413 
414 monster_spell_type monster_spells6[32] =
415 {
416   {"Haste Self", FALSE},
417   {"Hand of Doom", TRUE},
418   {"Heal", FALSE},
419   {"XXX", TRUE},
420 
421   {"Blink", FALSE},
422   {"Teleport", FALSE},
423   {"XXX", TRUE},
424   {"XXX", TRUE},
425 
426   {"Teleport To", TRUE},
427   {"Teleport Away", TRUE},
428   {"Teleport Level", FALSE},
429   {"XXX", TRUE},
430 
431   {"Darkness", FALSE},
432   {"Trap Creation", FALSE},
433   {"Cause Amnesia", TRUE},
434   /* Summons follow, but players can't summon */
435   {"XXX", TRUE},
436 
437   {"XXX", TRUE},
438   {"XXX", TRUE},
439   {"XXX", TRUE},
440   {"XXX", TRUE},
441 
442   {"XXX", TRUE},
443   {"XXX", TRUE},
444   {"XXX", TRUE},
445   {"XXX", TRUE},
446 
447   {"XXX", TRUE},
448   {"XXX", TRUE},
449   {"XXX", TRUE},
450   {"XXX", TRUE},
451 
452   {"XXX", TRUE},
453   {"XXX", TRUE},
454   {"XXX", TRUE},
455   {"XXX", TRUE},
456 };
457 
458 
459 /* Runecraft --------------------------------------------------------------- */
460 
461 r_element r_elements[RCRAFT_MAX_ELEMENTS] =
462 {
463 { R_LITE, "Light", 	SKILL_R_LITE },
464 { R_DARK, "Darkness",	SKILL_R_DARK },
465 { R_NEXU, "Nexus", 	SKILL_R_NEXU },
466 { R_NETH, "Nether", 	SKILL_R_NETH },
467 { R_CHAO, "Chaos", 	SKILL_R_CHAO },
468 { R_MANA, "Mana", 	SKILL_R_MANA },
469 };
470 
471 r_imperative r_imperatives[RCRAFT_MAX_IMPERATIVES] =
472 {
473 { I_MINI, "minimized",	 0,  6, -10,  6, -1,  8, 10 },
474 { I_LENG, "lengthened",	 2,  8,  +5,  9,  0, 15, 10 },
475 { I_COMP, "compressed",	 3, 12,  -5, 13, -2,  8, 10 },
476 { I_MODE, "moderate",	 5, 10,   0, 10,  0, 10, 10 },
477 { I_EXPA, "expanded",	 7, 13,  +5, 11, +2, 13, 10 },
478 { I_BRIE, "brief",	 8,  9,  -5,  8,  0,  6,  5 },
479 { I_MAXI, "maximized",	10, 14, +10, 14, +1, 13, 10 },
480 { I_ENHA, "enhanced",	10, 15,   0, 10,  0, 10, 10 },
481 };
482 
483 r_type r_types[RCRAFT_MAX_TYPES] =
484 {
485 { T_BOLT, "bolt",	 1,  1, 15, 3,  4, 25, 41,  0,   0, 0, 0,  0,  0 },
486 //{ T_BEAM, "beam",	 5,  5, 25, 3,  9, 53, 46, 16, 256, 0, 0,  3,  7 },
487 { T_CLOU, "cloud",	 5,  3, 30, 0,  0,  0,  0,  9, 121, 1, 4,  6, 14 },
488 { T_BALL, "ball",	10,  5, 30, 0,  0,  0,  0, 25, 770, 2, 4,  0,  0 },
489 { T_SIGN, "sign",	15, 10, 20, 4,  5,  7, 10, 10, 100, 2, 4, 10, 35 },
490 { T_RUNE, "glyph",	20, 20, 30, 0,  0,  0,  0, 16, 625, 1, 2,  3,  7 },
491 { T_WAVE, "wave",	25, 40, 50, 0,  0,  0,  0, 25, 441, 0, 0,  6, 10 },
492 { T_ENCH, "sigil",	30, 30, 40, 0,  0,  0,  0, 10, 100, 0, 0,  0,  0 },
493 };
494 
495 r_projection r_projections[RCRAFT_MAX_PROJECTIONS] =
496 {
497 { R_LITE,		GF_LITE,	300,	"light", TR2_RES_LITE },
498 { R_DARK,		GF_DARK,	900,	"darkness", TR2_RES_DARK },
499 { R_NEXU,		GF_NEXUS,	400,	"nexus", TR2_RES_NEXUS },
500 { R_NETH,		GF_NETHER,	550,	"nether", TR2_RES_NETHER },
501 { R_CHAO,		GF_CHAOS,	600,	"chaos", TR2_RES_CHAOS },
502 { R_MANA,		GF_MANA,	550,	"mana", TR5_RES_MANA },
503 
504 { R_LITE | R_DARK,	GF_CONFUSION,	600,	"confusion", TR2_RES_CONF },
505 { R_LITE | R_NEXU,	GF_INERTIA,	350,	"inertia", TR5_RES_TELE },
506 { R_LITE | R_NETH,	GF_ELEC,	1200,	"lightning", TR2_RES_ELEC },
507 { R_LITE | R_CHAO,	GF_FIRE,	1200,	"fire", TR2_RES_FIRE },
508 { R_LITE | R_MANA,	GF_WAVE,	450,	"water", TR5_RES_WATER },
509 
510 { R_DARK | R_NEXU,	GF_GRAVITY,	350,	"gravity", TR3_FEATHER },
511 { R_DARK | R_NETH,	GF_COLD,	1200,	"frost", TR2_RES_COLD },
512 { R_DARK | R_CHAO,	GF_ACID,	1200,	"acid", TR2_RES_ACID },
513 { R_DARK | R_MANA,	GF_POIS,	800,	"poison", TR2_RES_POIS },
514 
515 { R_NEXU | R_NETH,	GF_TIME,	250,	"time", TR5_RES_TIME },
516 { R_NEXU | R_CHAO,	GF_SOUND,	500,	"sound", TR2_RES_SOUND },
517 { R_NEXU | R_MANA,	GF_SHARDS,	500,	"shards", TR2_RES_SHARDS },
518 
519 { R_NETH | R_CHAO,	GF_DISENCHANT,	600,	"disenchantment", TR2_RES_DISEN },
520 { R_NETH | R_MANA,	GF_FORCE,	300,	"force", TR2_RES_SOUND },
521 
522 { R_CHAO | R_MANA,	GF_PLASMA,	600,	"plasma", TR5_RES_PLASMA },
523 };
524 
525