ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/attack.h
(Generate patch)

Comparing deliantra/server/include/attack.h (file contents):
Revision 1.5 by root, Sun Sep 3 00:18:41 2006 UTC vs.
Revision 1.6 by root, Thu Sep 7 13:34:57 2006 UTC

23 23
24 24
25#ifndef ATTACK_H 25#ifndef ATTACK_H
26#define ATTACK_H 26#define ATTACK_H
27 27
28/* These are default values for converting from simple protected/immune/vuln
29 * to thre partial resistances
30 */
31#define RESIST_IMMUNE 100
32#define RESIST_PROT 30
33#define RESIST_VULN -100
34
35/* 28/*
36 * Attacktypes: 29 * Attacktypes:
37 * ATNR_... is the attack number that is indexed into the 30 * ATNR_... is the attack number that is indexed into the
38 * the resist array in the object structure. 31 * the resist array in the object structure.
39 */ 32 */
40 33
41#define NROFATTACKS 26
42#define NROFATTACKMESS 20 34#define NROFATTACKMESS 20
43#define MAXATTACKMESS 20 35#define MAXATTACKMESS 20
44 36
45/* attack message numbers must be less than NROFATTACKMESS */ 37/* attack message numbers must be less than NROFATTACKMESS */
46 38
62#define ATM_CRUSH 15 54#define ATM_CRUSH 15
63#define ATM_BLUD 16 55#define ATM_BLUD 16
64#define ATM_DOOR 17 56#define ATM_DOOR 17
65#define ATM_SUFFER 18 57#define ATM_SUFFER 18
66 58
67/* Note that the last ATNR_ should be one less than NROFATTACKS above
68 * since the ATNR starts counting at zero.
69 * For compatible loading, these MUST correspond to the same value
70 * as the bitmasks below.
71 */
72#define ATNR_PHYSICAL 0
73#define ATNR_MAGIC 1
74#define ATNR_FIRE 2
75#define ATNR_ELECTRICITY 3
76#define ATNR_COLD 4
77#define ATNR_CONFUSION 5
78#define ATNR_ACID 6
79#define ATNR_DRAIN 7
80#define ATNR_WEAPONMAGIC 8
81#define ATNR_GHOSTHIT 9
82#define ATNR_POISON 10
83#define ATNR_SLOW 11
84#define ATNR_PARALYZE 12
85#define ATNR_TURN_UNDEAD 13
86#define ATNR_FEAR 14
87#define ATNR_CANCELLATION 15
88#define ATNR_DEPLETE 16
89#define ATNR_DEATH 17
90#define ATNR_CHAOS 18
91#define ATNR_COUNTERSPELL 19
92#define ATNR_GODPOWER 20
93#define ATNR_HOLYWORD 21
94#define ATNR_BLIND 22
95#define ATNR_INTERNAL 23
96#define ATNR_LIFE_STEALING 24
97#define ATNR_DISEASE 25
98
99#define AT_PHYSICAL 0x00000001 /* 1 */
100#define AT_MAGIC 0x00000002 /* 2 */
101#define AT_FIRE 0x00000004 /* 4 */
102#define AT_ELECTRICITY 0x00000008 /* 8 */
103#define AT_COLD 0x00000010 /* 16 */
104#define AT_CONFUSION 0x00000020 /* 32 The spell will use this one */
105#define AT_ACID 0x00000040 /* 64 Things might corrode when hit */
106#define AT_DRAIN 0x00000080 /* 128 */
107#define AT_WEAPONMAGIC 0x00000100 /* 256 Very special, use with care */
108#define AT_GHOSTHIT 0x00000200 /* 512 Attacker dissolves */
109#define AT_POISON 0x00000400 /* 1024 */
110#define AT_SLOW 0x00000800 /* 2048 */
111#define AT_PARALYZE 0x00001000 /* 4096 */
112#define AT_TURN_UNDEAD 0x00002000 /* 8192 */
113#define AT_FEAR 0x00004000 /* 16384 */
114#define AT_CANCELLATION 0x00008000 /* 32768 ylitalo@student.docs.uu.se */
115#define AT_DEPLETE 0x00010000 /* 65536 vick@bern.docs.uu.se */
116#define AT_DEATH 0x00020000 /* 131072 peterm@soda.berkeley.edu */
117#define AT_CHAOS 0x00040000 /* 262144 peterm@soda.berkeley.edu*/
118#define AT_COUNTERSPELL 0x00080000 /* 524288 peterm@soda.berkeley.edu*/
119#define AT_GODPOWER 0x00100000 /* 1048576 peterm@soda.berkeley.edu */
120#define AT_HOLYWORD 0x00200000 /* 2097152 race selective attack thomas@astro.psu.edu */
121#define AT_BLIND 0x00400000 /* 4194304 thomas@astro.psu.edu */
122#define AT_INTERNAL 0x00800000 /* Only used for internal calculations */
123#define AT_LIFE_STEALING \
124 0x01000000 /* 16777216 for hp drain */
125#define AT_DISEASE 0x02000000 /* 33554432 disease attacktypes */
126
127/* attacktypes_load is suffixed to resist_ when saving objects.
128 * (so the line may be 'resist_fire' 20 for example). These are never
129 * seen by the player. loader.l uses the same names, but it doesn't look
130 * like you can use these values, so in that function they are hard coded.
131 */
132
133/* Note that internal should not ever be referanced in the last two
134 * tables. however, other resisttypes may be added, and if through some
135 * bug these do get used somehow, might as well make it more easier to notice
136 * and not have mystery values appear.
137 */
138
139/* attack messages structure */ 59/* attack messages structure */
140typedef struct attackmess { 60typedef struct attackmess {
141 int level; 61 int level;
142 char *buf1; 62 char *buf1;
143 char *buf2; 63 char *buf2;
144 char *buf3; 64 char *buf3;
145} attackmess_t; 65} attackmess_t;
146 66
147EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]; 67EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS];
148 68
149#ifdef INIT_C 69enum {
150 70# define def(uc, name, lc, plus, change) ATNR_ ## uc,
151extern const keyword resist_save[NROFATTACKS] = { 71# include "attackinc.h"
152KW_resist_physical, KW_resist_magic, KW_resist_fire, KW_resist_electricity, KW_resist_cold, KW_resist_confusion, KW_resist_acid, 72# undef def
153KW_resist_drain, KW_resist_weaponmagic, KW_resist_ghosthit, KW_resist_poison, KW_resist_slow, KW_resist_paralyze, 73 NROFATTACKS
154KW_resist_turn_undead, KW_resist_fear, KW_resist_cancellation, KW_resist_deplete, KW_resist_death, KW_resist_chaos,
155KW_resist_counterspell, KW_resist_godpower, KW_resist_holyword, KW_resist_blind , KW_resist_internal, KW_resist_life_stealing,
156KW_resist_disease,
157}; 74};
158 75
159extern const char* const attacktype_desc[NROFATTACKS] = { 76enum {
160"physical", "magic", "fire", "electricity", "cold", "confusion", "acid", 77# define def(uc, name, lc, plus, change) AT_ ## uc = 1UL << ATNR_ ## uc,
161"drain", "weapon magic", "ghost hit", "poison", "slow", "paralyze", 78# include "attackinc.h"
162"turn undead", "fear", "cancellation", "deplete", "death", "chaos", 79# undef def
163"counterspell", "god power", "holy word", "blind" , "internal", "life stealing",
164"disease"
165}; 80};
166 81
167extern const char* const resist_plus[NROFATTACKS] = { 82/* Short description of names of the attacktypes */
168"armour", "resist magic", "resist fire", "resist electricity", "resist cold",
169"resist confusion", "resist acid", "resist drain",
170"resist weaponmagic", "resist ghosthit", "resist poison", "resist slow",
171"resist paralyzation", "resist turn undead", "resist fear",
172"resist cancellation", "resist depletion", "resist death", "resist chaos",
173"resist counterspell", "resist god power", "resist holy word",
174"resist blindness" , "resist internal", "resist life stealing",
175"resist diseases"
176};
177
178extern const char* const change_resist_msg[NROFATTACKS] = { 83extern const char* const attacktype_desc[NROFATTACKS];
179"physical", "magic", "fire", "electricity", "cold", "confusion", "acid",
180"draining", "weapon magic", "ghosts", "poison", "slow", "paralyze",
181"turn undead", "fear", "cancellation", "depletion", "death attacks", "chaos",
182"counterspell", "god power", "holy word", "blinding attacks", "internal",
183"life stealing", "disease"
184};
185
186int resist_table[NROFATTACKS] = {ATNR_PHYSICAL, ATNR_MAGIC, ATNR_FIRE,
187 ATNR_ELECTRICITY,ATNR_COLD, ATNR_CONFUSION, ATNR_ACID, ATNR_DRAIN,
188 ATNR_GHOSTHIT, ATNR_POISON, ATNR_SLOW, ATNR_PARALYZE, ATNR_TURN_UNDEAD,
189 ATNR_FEAR, ATNR_DEPLETE, ATNR_DEATH, ATNR_HOLYWORD, ATNR_BLIND,
190 ATNR_LIFE_STEALING, ATNR_DISEASE};
191
192#else
193 84
194extern const keyword resist_save[NROFATTACKS]; 85extern const keyword resist_save[NROFATTACKS];
195 86
196/* Short description of names of the attacktypes */ 87/* Note that internal should not ever be referenced in the last two
197extern const char* const attacktype_desc[NROFATTACKS]; 88 * tables. however, other resisttypes may be added, and if through some
89 * bug these do get used somehow, might as well make it more easier to notice
90 * and not have mystery values appear.
91 */
198 92
199/* This is the array that is what the player sees. */ 93/* This is the array that is what the player sees. */
200extern const char* const resist_plus[NROFATTACKS]; 94extern const char* const resist_plus[NROFATTACKS];
201 95
202/* These are the descriptions of the resistances displayed when a 96/* These are the descriptions of the resistances displayed when a
208 * others, just add more entries in the table for the protections you want to 102 * others, just add more entries in the table for the protections you want to
209 * show up. 103 * show up.
210 */ 104 */
211extern int resist_table[NROFATTACKS]; 105extern int resist_table[NROFATTACKS];
212 106
213#endif
214
215#define num_resist_table 19 107#define num_resist_table 19
216 108
217#endif 109#endif
110

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines