ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/preprocess
Revision: 1.12
Committed: Sun Jan 7 23:10:43 2007 UTC (17 years, 4 months ago) by root
Branch: MAIN
Changes since 1.11: +1 -0 lines
Log Message:
- more improvements/fixes
- timestamp with millisecond accuracy, horrible code

File Contents

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