… | |
… | |
27 | #include <global.h> |
27 | #include <global.h> |
28 | #include <object.h> |
28 | #include <object.h> |
29 | |
29 | |
30 | dynbuf_text msg_dynbuf (65536, 65536); |
30 | dynbuf_text msg_dynbuf (65536, 65536); |
31 | |
31 | |
|
|
32 | extern const char *const attacktype_name[NROFATTACKS] = { |
|
|
33 | # define def(uc, lc, desc, plus, change) # lc, |
|
|
34 | # include "attackinc.h" |
|
|
35 | # undef def |
|
|
36 | }; |
|
|
37 | |
32 | extern const char *const attacktype_desc[NROFATTACKS] = { |
38 | extern const char *const attacktype_desc[NROFATTACKS] = { |
33 | # define def(uc, lc, name, plus, change) # name, |
39 | # define def(uc, lc, desc, plus, change) # desc, |
34 | # include "attackinc.h" |
40 | # include "attackinc.h" |
35 | # undef def |
41 | # undef def |
36 | }; |
42 | }; |
37 | |
43 | |
38 | extern const char *const resist_plus[NROFATTACKS] = { |
44 | extern const char *const resist_plus[NROFATTACKS] = { |
39 | # define def(uc, lc, name, plus, change) # plus, |
45 | # define def(uc, lc, desc, plus, change) # plus, |
40 | # include "attackinc.h" |
46 | # include "attackinc.h" |
41 | # undef def |
47 | # undef def |
42 | }; |
48 | }; |
43 | |
49 | |
44 | extern const char *const change_resist_msg[NROFATTACKS] = { |
50 | extern const char *const change_resist_msg[NROFATTACKS] = { |
45 | # define def(uc, lc, name, plus, change) # change, |
51 | # define def(uc, lc, desc, plus, change) # change, |
46 | # include "attackinc.h" |
52 | # include "attackinc.h" |
47 | # undef def |
53 | # undef def |
48 | }; |
54 | }; |
49 | |
55 | |
50 | int resist_table[NROFATTACKS] = { |
56 | int resist_table[NROFATTACKS] = { |
51 | # define def(uc, lc, name, plus, change) ATNR_ ## uc, |
57 | # define def(uc, lc, desc, plus, change) ATNR_ ## uc, |
52 | # include "attackinc.h" |
58 | # include "attackinc.h" |
53 | # undef def |
59 | # undef def |
54 | }; |
60 | }; |
55 | |
61 | |
56 | /* You unforunately need to looking in include/global.h to see what these |
62 | /* You unforunately need to looking in include/global.h to see what these |
57 | * correspond to. |
63 | * correspond to. |
58 | */ |
64 | */ |
59 | struct Settings settings = { |
65 | struct Settings settings = { |
60 | LOGFILE, /* Logfile */ |
66 | LOGFILE, /* Logfile */ |
61 | CSPORT, /* Client/server port */ |
67 | llevTrace, /* Log level */ |
62 | |
|
|
63 | /* Debug level */ |
|
|
64 | #ifdef DEBUG |
|
|
65 | llevDebug, |
|
|
66 | #else |
|
|
67 | llevInfo, |
|
|
68 | #endif |
|
|
69 | |
|
|
70 | 0, NULL, 0, /* dumpvalues, dumparg, daemonmode */ |
|
|
71 | 0, /* argc */ |
68 | 0, /* argc */ |
72 | NULL, /* argv */ |
69 | NULL, /* argv */ |
73 | CONFDIR, |
70 | CONFDIR, |
74 | DATADIR, |
71 | DATADIR, |
75 | LOCALDIR, |
72 | LOCALDIR, |
76 | PLAYERDIR, MAPDIR, ARCHETYPES, REGIONS, TREASURES, |
73 | PLAYERDIR, |
|
|
74 | MAPDIR, |
|
|
75 | ARCHETYPES, |
|
|
76 | TREASURES, |
77 | UNIQUE_DIR, "", |
77 | UNIQUE_DIR, |
|
|
78 | "", |
78 | TMPDIR, |
79 | TMPDIR, |
79 | PK_LUCK_PENALTY, |
80 | PK_LUCK_PENALTY, |
80 | STAT_LOSS_ON_DEATH, |
81 | STAT_LOSS_ON_DEATH, |
81 | PERMANENT_EXPERIENCE_RATIO, |
82 | PERMANENT_EXPERIENCE_RATIO, |
82 | DEATH_PENALTY_RATIO, |
83 | DEATH_PENALTY_RATIO, |
… | |
… | |
88 | RESURRECTION, |
89 | RESURRECTION, |
89 | SEARCH_ITEMS, |
90 | SEARCH_ITEMS, |
90 | SPELL_ENCUMBRANCE, |
91 | SPELL_ENCUMBRANCE, |
91 | SPELL_FAILURE_EFFECTS, |
92 | SPELL_FAILURE_EFFECTS, |
92 | SET_FRIENDLY_FIRE, |
93 | SET_FRIENDLY_FIRE, |
93 | 0, |
|
|
94 | 0, |
|
|
95 | EXPLORE_MODE, |
|
|
96 | SPELLPOINT_LEVEL_DEPEND, |
94 | SPELLPOINT_LEVEL_DEPEND, |
97 | 0, |
95 | 0, |
98 | 1.0, |
96 | 1.25, |
99 | |
97 | |
100 | /* Armor enchantment stuff */ |
98 | /* Armor enchantment stuff */ |
101 | ARMOR_MAX_ENCHANT, |
99 | ARMOR_MAX_ENCHANT, |
102 | ARMOR_WEIGHT_REDUCTION, |
100 | ARMOR_WEIGHT_REDUCTION, |
103 | ARMOR_WEIGHT_LINEAR, |
101 | ARMOR_WEIGHT_LINEAR, |
… | |
… | |
149 | if (cp = getenv ("DELIANTRA_ARCHETYPES" )) settings.archetypes = cp; |
147 | if (cp = getenv ("DELIANTRA_ARCHETYPES" )) settings.archetypes = cp; |
150 | if (cp = getenv ("DELIANTRA_TREASURES" )) settings.treasures = cp; |
148 | if (cp = getenv ("DELIANTRA_TREASURES" )) settings.treasures = cp; |
151 | if (cp = getenv ("DELIANTRA_UNIQUEDIR" )) settings.uniquedir = cp; |
149 | if (cp = getenv ("DELIANTRA_UNIQUEDIR" )) settings.uniquedir = cp; |
152 | if (cp = getenv ("DELIANTRA_TEMPLATEDIR")) settings.templatedir = cp; |
150 | if (cp = getenv ("DELIANTRA_TEMPLATEDIR")) settings.templatedir = cp; |
153 | if (cp = getenv ("DELIANTRA_TMPDIR" )) settings.tmpdir = cp; |
151 | if (cp = getenv ("DELIANTRA_TMPDIR" )) settings.tmpdir = cp; |
154 | |
|
|
155 | if (cp = getenv ("DELIANTRA_LOGFILE" )) settings.logfilename = cp; |
152 | if (cp = getenv ("DELIANTRA_LOGFILE" )) settings.logfilename = cp; |
156 | } |
153 | } |
157 | |
154 | |
158 | /* |
155 | /* |
159 | * Initialises all global variables. |
156 | * Initialises all global variables. |
… | |
… | |
193 | //attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]; |
190 | //attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]; |
194 | |
191 | |
195 | void |
192 | void |
196 | init_attackmess () |
193 | init_attackmess () |
197 | { |
194 | { |
198 | char filename[MAX_BUF]; |
195 | object_thawer thawer (settings.datadir, "attackmess"); |
199 | |
|
|
200 | sprintf (filename, "%s/attackmess", settings.datadir); |
|
|
201 | LOG (llevDebug, "Reading attack messages from %s...\n", filename); |
|
|
202 | |
|
|
203 | object_thawer thawer (filename); |
|
|
204 | |
196 | |
205 | if (!thawer) |
197 | if (!thawer) |
206 | { |
198 | { |
207 | LOG (llevError, "Can't open %s.\n", filename); |
199 | LOG (llevError, "Can't open %s.\n", thawer.name); |
208 | return; |
200 | return; |
209 | } |
201 | } |
210 | |
202 | |
211 | int msgnum = -1; |
203 | int msgnum = -1; |
212 | int total = 0; |
204 | int total = 0; |