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.1.1.2 by elmex, Wed Feb 22 18:01:57 2006 UTC vs.
Revision 1.27 by root, Sat Nov 17 23:40:00 2018 UTC

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.1.1.2 2006/02/22 18:01:57 elmex Exp $"; 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>
4 */ 24 */
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 25
30#ifndef ATTACK_H 26#ifndef ATTACK_H
31#define ATTACK_H 27#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 28
40/* 29/*
41 * Attacktypes: 30 * Attacktypes:
42 * ATNR_... is the attack number that is indexed into the 31 * ATNR_... is the attack number that is indexed into the
43 * the resist array in the object structure. 32 * the resist array in the object structure.
44 */ 33 */
45 34
46#define NROFATTACKS 26
47#define NROFATTACKMESS 20 35#define NROFATTACKMESS 20
48#define MAXATTACKMESS 20 36#define MAXATTACKMESS 20
49 37
50/* attack message numbers must be less than NROFATTACKMESS */ 38/* attack message numbers must be less than NROFATTACKMESS */
51 39
67#define ATM_CRUSH 15 55#define ATM_CRUSH 15
68#define ATM_BLUD 16 56#define ATM_BLUD 16
69#define ATM_DOOR 17 57#define ATM_DOOR 17
70#define ATM_SUFFER 18 58#define ATM_SUFFER 18
71 59
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 */ 60/* attack messages structure */
145typedef struct attackmess { 61typedef struct attackmess {
146 int level; 62 int level;
147 char *buf1; 63 char *buf1;
148 char *buf2; 64 char *buf2;
149 char *buf3; 65 char *buf3;
150} attackmess_t; 66} attackmess_t;
151 67
152EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]; 68EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS];
153 69
154#ifndef INIT_C 70enum
155EXTERN int resist_table[]; 71{
156EXTERN char *change_resist_msg[NROFATTACKS]; 72# define def(uc, lc, name, plus, change) ATNR_ ## uc,
157EXTERN char *resist_plus[NROFATTACKS]; 73# include "attackinc.h"
158EXTERN char *attacktype_desc[NROFATTACKS]; 74# undef def
159EXTERN char *resist_save[NROFATTACKS]; 75 NROFATTACKS
160
161/* Beware, names require an _ if there is a space, else they will be read
162 * as for example: resist_life stealing 50!
163 */
164#else
165EXTERN const char* const 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}; 76};
172 77
173/* Short description of names of the attacktypes */ 78enum
174EXTERN const char* const attacktype_desc[NROFATTACKS] = { 79{
175"physical", "magic", "fire", "electricity", "cold", "confusion", "acid", 80# define def(uc, lc, name, plus, change) AT_ ## uc = 1UL << ATNR_ ## uc,
176"drain", "weapon magic", "ghost hit", "poison", "slow", "paralyze", 81# include "attackinc.h"
177"turn undead", "fear", "cancellation", "deplete", "death", "chaos", 82# undef def
178"counterspell", "god power", "holy word", "blind" , "internal", "life stealing",
179"disease"
180}; 83};
181 84
85/* lowercase attacktype identifiers */
86extern const char* const attacktype_name[NROFATTACKS];
87
88/* short description of names of the attacktypes */
89extern 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
182/* This is the array that is what the player sees. */ 97/* This is the array that is what the player sees. */
183
184EXTERN const char* const resist_plus[NROFATTACKS] = { 98extern 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 99
195/* These are the descriptions of the resistances displayed when a 100/* These are the descriptions of the resistances displayed when a
196 * player puts on/takes off an item. See change_abil() in living.c. 101 * player puts on/takes off an item. See change_abil() in living.c.
197 */ 102 */
198EXTERN const char* const change_resist_msg[NROFATTACKS] = { 103extern 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 104
207/* If you want to weight things so certain resistances show up more often than 105/* 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 106 * others, just add more entries in the table for the protections you want to
209 * show up. 107 * show up.
210 */ 108 */
211EXTERN int resist_table[] = {ATNR_PHYSICAL, ATNR_MAGIC, ATNR_FIRE, 109extern 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 110
219#define num_resist_table 19 111#define num_resist_table 19
220 112
221#endif 113#endif
114

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines