Crossfire Server, Trunk
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 struct attackmess_t {
119  int level;
120  char *buf1;
121  char *buf2;
122  char *buf3;
123 };
124 
127  int face;
128 };
129 
132 
135 EXTERN const char *const resist_plus[NROFATTACKS];
136 EXTERN const char *const resist_color[NROFATTACKS];
137 EXTERN const char *const attacktype_desc[NROFATTACKS];
138 EXTERN const char *const resist_save[NROFATTACKS];
139 
140 #endif /* ATTACK_H */
NROFATTACKMESS
#define NROFATTACKMESS
Definition: attack.h:18
Chaos_Attacks::attacktype
int attacktype
Definition: attack.h:126
attackmess_t::buf1
char * buf1
Definition: attack.h:120
NROFATTACKS
#define NROFATTACKS
Definition: attack.h:17
MAXATTACKMESS
#define MAXATTACKMESS
Definition: attack.h:19
resist_save
const EXTERN char *const resist_save[NROFATTACKS]
Definition: attack.h:138
ATTACKS
EXTERN Chaos_Attacks ATTACKS[22]
Definition: attack.h:133
attack_mess
EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]
Definition: attack.h:131
Chaos_Attacks::face
int face
Definition: attack.h:127
resist_plus
const EXTERN char *const resist_plus[NROFATTACKS]
Definition: attack.h:135
resist_color
const EXTERN char *const resist_color[NROFATTACKS]
Definition: attack.h:136
change_resist_msg
const EXTERN char *const change_resist_msg[NROFATTACKS]
Definition: attack.h:134
EXTERN
#define EXTERN
Definition: global.h:15
attackmess_t::buf2
char * buf2
Definition: attack.h:121
attacktype_desc
const EXTERN char *const attacktype_desc[NROFATTACKS]
Definition: attack.h:137
attackmess_t::level
int level
Definition: attack.h:119
Chaos_Attacks
Definition: attack.h:125
attackmess_t
Definition: attack.h:118
attackmess_t::buf3
char * buf3
Definition: attack.h:122