ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/preprocess
Revision: 1.11
Committed: Sun Jan 7 02:39:14 2007 UTC (17 years, 4 months ago) by root
Branch: MAIN
Changes since 1.10: +0 -1 lines
Log Message:
""

File Contents

# Content
1 #!/opt/bin/perl
2
3 my %ARG = @ARGV;
4
5 use List::Util;
6
7 # todo: gather dynamically
8 my @kw = qw(
9 no_pass
10 walk_on
11 walk_off
12 fly_on
13 fly_off
14 flying
15
16 ac
17 activate_on_push
18 activate_on_release
19 alive
20 anim_speed
21 animation
22 applied
23 arch
24 armour
25 attach
26 attack_movement
27 attacktype
28 auto_apply
29 been_applied
30 berserk
31 blocksview
32 body_range
33 body_arm
34 body_torso
35 body_head
36 body_neck
37 body_skill
38 body_finger
39 body_shoulder
40 body_foot
41 body_hand
42 body_wrist
43 body_waist
44 can_apply
45 can_cast_spell
46 can_roll
47 can_see_in_dark
48 can_use_armour
49 can_use_bow
50 can_use_horn
51 can_use_range
52 can_use_ring
53 can_use_rod
54 can_use_scroll
55 can_use_shield
56 can_use_skill
57 can_use_wand
58 can_use_weapon
59 carrying
60 casting_time
61 cha
62 changing
63 client_type
64 con
65 confused
66 connected
67 container
68 cursed
69 custom_name
70 dam
71 dam_modifier
72 damned
73 dex
74 direction
75 duration
76 duration_modifier
77 editable
78 editor_folder
79 elevation
80 end
81 endlore
82 endmsg
83 exp
84 expmul
85 face
86 food
87 friendly
88 gen_sp_armour
89 generator
90 glow_radius
91 grace
92 has_ready_bow
93 has_ready_horn
94 has_ready_rod
95 has_ready_scroll
96 has_ready_skill
97 has_ready_wand
98 has_ready_weapon
99 has_ready_range
100 hitback
101 hp
102 identified
103 immune
104 int
105 inv_locked
106 invisible
107 is_animated
108 is_blind
109 is_buildable
110 is_cauldron
111 is_dust
112 is_floor
113 is_hilly
114 is_lightable
115 is_thrown
116 is_turnable
117 is_used_up
118 is_water
119 is_wooded
120 item_power
121 known_cursed
122 known_magical
123 last_eat
124 last_grace
125 last_heal
126 last_sp
127 level
128 lifesave
129 lore
130 luck
131 magic
132 make_invisible
133 material
134 materialname
135 maxgrace
136 maxhp
137 maxsp
138 monster
139 more
140 move_allow
141 move_block
142 move_off
143 move_on
144 move_slow
145 move_slow_penalty
146 move_state
147 move_type
148 msg
149 name
150 name_pl
151 neutral
152 no_attack
153 no_damage
154 no_drop
155 no_fix_player
156 no_magic
157 no_pick
158 no_skill_ident
159 no_steal
160 no_strength
161 nrof
162 object
163 oid
164 one_hit
165 only_attack
166 other_arch
167 overlay_floor
168 path_attuned
169 path_denied
170 path_repelled
171 perm_exp
172 pick_up
173 player_sold
174 pow
175 protected
176 race
177 random_move
178 random_movement
179 randomitems
180 range
181 range_modifier
182 reflect_missile
183 reflect_spell
184 reflecting
185 resist_acid
186 resist_blind
187 resist_cancellation
188 resist_chaos
189 resist_cold
190 resist_confusion
191 resist_counterspell
192 resist_death
193 resist_deplete
194 resist_disease
195 resist_drain
196 resist_electricity
197 resist_fear
198 resist_fire
199 resist_ghosthit
200 resist_godpower
201 resist_holyword
202 resist_internal
203 resist_life_stealing
204 resist_magic
205 resist_paralyze
206 resist_physical
207 resist_poison
208 resist_slow
209 resist_turn_undead
210 resist_weaponmagic
211 run_away
212 scared
213 see_anywhere
214 see_invisible
215 skill
216 slaying
217 sleep
218 slow_move
219 smoothlevel
220 sp
221 speed
222 speed_left
223 splitting
224 stand_still
225 startequip
226 state
227 stealth
228 str
229 subtype
230 tear_down
231 title
232 tooltype
233 treasure
234 type
235 unaggressive
236 undead
237 unique
238 unpaid
239 use_content_on_gen
240 uuid
241 value
242 vulnerable
243 was_wiz
244 wc
245 weapontype
246 weight
247 will_apply
248 wis
249 wiz
250 x
251 xrays
252 y
253
254 Object
255 Str
256 Dex
257 Con
258 Wis
259 Cha
260 Int
261 Pow
262 More
263
264 maplore
265 endmaplore
266 enter_x
267 enter_y
268 width
269 height
270 reset_timeout
271 reset_time
272 swap_time
273 difficulty
274 darkness
275 fixed_resettime
276 per_player
277 per_party
278 region
279 shopitems
280 shopgreed
281 shopmin
282 shopmax
283 shoprace
284 outdoor
285 tile_path_1
286 tile_path_2
287 tile_path_3
288 tile_path_4
289
290 file_format_version
291
292 temp
293 pressure
294 humid
295 windspeed
296 winddir
297 sky
298
299 map
300 savebed_map
301 bed_x
302 bed_y
303 password
304 shoottype
305 bowtype
306 petmode
307 gen_hp
308 gen_sp
309 gen_grace
310 listening
311 peaceful
312 digestion
313 pickup
314 outputs_sync
315 outputs_count
316 usekeys
317 unapply
318 weapon_sp
319 lev_array
320 endplst
321 );
322
323 open GPERF, "|-", "exec $ARG{GPERF} -m50 >kw_hash.h"
324 or die "$ARGV{GPERF}: $!";
325
326 print GPERF <<EOF;
327 %language=C++
328 %enum
329 %define class-name kw_lex
330 %define lookup-function-name match
331 %struct-type
332 %compare-strncmp
333 %delimiters=,
334 struct keyword_idx { const char *name; enum keyword index; };
335 %%
336 EOF
337
338 for (@kw) {
339 printf GPERF "%s,%s\n", $_, "KW_$_";
340 }
341
342 print GPERF <<EOF;
343 %%
344 extern const char *const keyword_str [] = {
345 "<EOF>",
346 "<ERROR>",
347 EOF
348
349 for (@kw) {
350 printf GPERF " \"%s\",\n", $_;
351 }
352
353 print GPERF "};\n";
354
355 printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n",
356 join ", ", map length, @kw;
357
358 close GPERF
359 or die "$ARG{GPERF}: failed to run";
360
361 open KW, ">", "keyword.h";
362
363 print KW <<EOF;
364 #ifndef KW_H__
365 #define KW_H__
366
367 enum keyword {
368 KW_NULL = 0,
369 KW_EOF = 0,
370 KW_ERROR,
371 EOF
372
373 for (@kw) {
374 printf KW " %s,\n", "KW_$_",
375 }
376
377 print KW <<EOF;
378 NUM_KEYWORD,
379 };
380
381 extern const char *const keyword_str [];
382 extern const unsigned char keyword_len [];
383
384 EOF
385
386 printf KW "#define MAX_KEYWORD_LEN %d\n", List::Util::max map length, @kw;
387
388 print KW <<EOF;
389
390 #endif
391
392 EOF
393