1 |
/* |
2 |
* This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 |
* |
4 |
* Copyright (©) 2017,2018 Marc Alexander Lehmann / the Deliantra team |
5 |
* Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
6 |
* Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
7 |
* Copyright (©) 1992 Frank Tore Johansen |
8 |
* |
9 |
* Deliantra is free software: you can redistribute it and/or modify it under |
10 |
* the terms of the Affero GNU General Public License as published by the |
11 |
* Free Software Foundation, either version 3 of the License, or (at your |
12 |
* option) any later version. |
13 |
* |
14 |
* This program is distributed in the hope that it will be useful, |
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 |
* GNU General Public License for more details. |
18 |
* |
19 |
* You should have received a copy of the Affero GNU General Public License |
20 |
* and the GNU General Public License along with this program. If not, see |
21 |
* <http://www.gnu.org/licenses/>. |
22 |
* |
23 |
* The authors can be reached via e-mail to <support@deliantra.net> |
24 |
*/ |
25 |
|
26 |
#ifndef ATTACK_H |
27 |
#define ATTACK_H |
28 |
|
29 |
/* |
30 |
* Attacktypes: |
31 |
* ATNR_... is the attack number that is indexed into the |
32 |
* the resist array in the object structure. |
33 |
*/ |
34 |
|
35 |
#define NROFATTACKMESS 20 |
36 |
#define MAXATTACKMESS 20 |
37 |
|
38 |
/* attack message numbers must be less than NROFATTACKMESS */ |
39 |
|
40 |
#define ATM_ARROW 0 |
41 |
#define ATM_DRAIN 1 |
42 |
#define ATM_ELEC 2 |
43 |
#define ATM_COLD 3 |
44 |
#define ATM_FIRE 4 |
45 |
#define ATM_BASIC 5 |
46 |
#define ATM_KARATE 6 |
47 |
#define ATM_CLAW 7 |
48 |
#define ATM_PUNCH 8 |
49 |
#define ATM_SLASH 9 |
50 |
#define ATM_PIERCE 10 |
51 |
#define ATM_CLEAVE 11 |
52 |
#define ATM_SLICE 12 |
53 |
#define ATM_STAB 13 |
54 |
#define ATM_WHIP 14 |
55 |
#define ATM_CRUSH 15 |
56 |
#define ATM_BLUD 16 |
57 |
#define ATM_DOOR 17 |
58 |
#define ATM_SUFFER 18 |
59 |
|
60 |
/* attack messages structure */ |
61 |
typedef struct attackmess { |
62 |
int level; |
63 |
char *buf1; |
64 |
char *buf2; |
65 |
char *buf3; |
66 |
} attackmess_t; |
67 |
|
68 |
EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]; |
69 |
|
70 |
enum |
71 |
{ |
72 |
# define def(uc, lc, name, plus, change) ATNR_ ## uc, |
73 |
# include "attackinc.h" |
74 |
# undef def |
75 |
NROFATTACKS |
76 |
}; |
77 |
|
78 |
enum |
79 |
{ |
80 |
# define def(uc, lc, name, plus, change) AT_ ## uc = 1UL << ATNR_ ## uc, |
81 |
# include "attackinc.h" |
82 |
# undef def |
83 |
}; |
84 |
|
85 |
/* lowercase attacktype identifiers */ |
86 |
extern const char* const attacktype_name[NROFATTACKS]; |
87 |
|
88 |
/* short description of names of the attacktypes */ |
89 |
extern const char* const attacktype_desc[NROFATTACKS]; |
90 |
|
91 |
/* Note that internal should not ever be referenced in the last two |
92 |
* tables. however, other resisttypes may be added, and if through some |
93 |
* bug these do get used somehow, might as well make it more easier to notice |
94 |
* and not have mystery values appear. |
95 |
*/ |
96 |
|
97 |
/* This is the array that is what the player sees. */ |
98 |
extern const char* const resist_plus[NROFATTACKS]; |
99 |
|
100 |
/* These are the descriptions of the resistances displayed when a |
101 |
* player puts on/takes off an item. See change_abil() in living.c. |
102 |
*/ |
103 |
extern const char* const change_resist_msg[NROFATTACKS]; |
104 |
|
105 |
/* If you want to weight things so certain resistances show up more often than |
106 |
* others, just add more entries in the table for the protections you want to |
107 |
* show up. |
108 |
*/ |
109 |
extern int resist_table[NROFATTACKS]; |
110 |
|
111 |
#define num_resist_table 19 |
112 |
|
113 |
#endif |
114 |
|