ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/genkeywords
Revision: 1.11
Committed: Sun Nov 16 03:52:12 2008 UTC (15 years, 6 months ago) by root
Branch: MAIN
CVS Tags: rel-2_82, rel-2_81, rel-2_80, rel-2_72, rel-2_73, rel-2_76, rel-2_77, rel-2_74, rel-2_75, rel-2_79, rel-2_78
Changes since 1.10: +0 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.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 root 1.3 gender
17 root 1.10 hintmode
18 root 1.1 attack_skill
19     ranged_skill
20    
21     ac
22     activate_on_push
23     activate_on_release
24     alive
25     anim_speed
26     animation
27     applied
28     arch
29     armour
30     attach
31     attack_movement
32     attacktype
33     auto_apply
34     been_applied
35     berserk
36     blocksview
37     body_range
38     body_arm
39     body_torso
40     body_head
41     body_neck
42     body_skill
43     body_finger
44     body_shoulder
45     body_foot
46     body_hand
47     body_wrist
48     body_waist
49     body_shield
50     body_combat
51     can_apply
52     can_cast_spell
53     can_roll
54     can_see_in_dark
55     can_use_armour
56     can_use_bow
57     can_use_horn
58     can_use_range
59     can_use_ring
60     can_use_rod
61     can_use_scroll
62     can_use_shield
63     can_use_skill
64     can_use_wand
65     can_use_weapon
66     carrying
67     casting_time
68     cha
69     changing
70     client_type
71     con
72     confused
73     connected
74     container
75     cursed
76     custom_name
77     dam
78     dam_modifier
79     damned
80     destroy_on_death
81     dex
82     direction
83     duration
84     duration_modifier
85     editable
86     editor_folder
87     elevation
88     end
89     endlore
90     endmsg
91     exp
92     expmul
93     face
94     food
95     friendly
96     gen_sp_armour
97     generator
98     glow_radius
99     grace
100     has_ready_bow
101     has_ready_scroll
102     has_ready_skill
103     has_ready_weapon
104     has_ready_range
105     hitback
106     hp
107     identified
108     immune
109     inherit
110     int
111     inv_locked
112     invisible
113     is_animated
114     is_blind
115     is_buildable
116     is_cauldron
117     is_dust
118     is_floor
119     is_hilly
120     is_lightable
121     is_thrown
122     is_turnable
123     is_used_up
124     is_water
125     is_wooded
126     item_power
127     known_cursed
128     known_magical
129     last_eat
130     last_grace
131     last_heal
132     last_sp
133     level
134     lifesave
135     lore
136     luck
137     magic
138     make_invisible
139     material
140     materialname
141     maxgrace
142     maxhp
143     maxsp
144     monster
145     more
146     move_allow
147     move_block
148     move_off
149     move_on
150     move_slow
151     move_slow_penalty
152     move_state
153     move_type
154     msg
155     name
156     name_pl
157     neutral
158     no_attack
159     no_damage
160     no_drop
161     no_fix_player
162     no_magic
163     no_pick
164     no_skill_ident
165     no_steal
166     no_strength
167     nrof
168     obj_original
169     object
170     oid
171     one_hit
172     only_attack
173     other_arch
174     overlay_floor
175 root 1.8 owner
176 root 1.1 path_attuned
177     path_denied
178     path_repelled
179     perm_exp
180     pick_up
181     player_sold
182     pow
183     precious
184     protected
185     race
186     random_move
187     random_movement
188     randomitems
189     range
190     range_modifier
191     reflect_missile
192     reflect_spell
193     reflecting
194     resist_acid
195     resist_blind
196     resist_cancellation
197     resist_chaos
198     resist_cold
199     resist_confusion
200     resist_counterspell
201     resist_death
202     resist_deplete
203     resist_disease
204     resist_drain
205     resist_electricity
206     resist_fear
207     resist_fire
208     resist_ghosthit
209     resist_godpower
210     resist_holyword
211     resist_internal
212     resist_life_stealing
213     resist_magic
214     resist_paralyze
215     resist_physical
216     resist_poison
217     resist_slow
218     resist_turn_undead
219     resist_weaponmagic
220     run_away
221     scared
222     see_anywhere
223     see_invisible
224     skill
225     slaying
226     sleep
227     slow_move
228 root 1.5 sound
229 root 1.7 sound_destroy
230 root 1.1 smoothlevel
231     sp
232     speed
233     speed_left
234     splitting
235     stand_still
236     startequip
237     state
238     stealth
239     str
240     subtype
241 root 1.9 tag
242 root 1.1 tear_down
243     title
244     treasure_env
245     type
246     unaggressive
247     undead
248     unique
249     unpaid
250     use_content_on_gen
251     uuid
252     value
253     vulnerable
254     wc
255     weapontype
256     weight
257     will_apply
258     wis
259     x
260     xrays
261     y
262    
263     maplore
264     endmaplore
265     enter_x
266     enter_y
267     width
268     height
269     reset_timeout
270     reset_time
271     swap_time
272     difficulty
273     darkness
274     fixed_resettime
275     per_player
276     per_party
277 root 1.2 no_reset
278 root 1.1 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     bowtype
305     petmode
306     gen_hp
307     gen_sp
308     gen_grace
309     listening
310     peaceful
311     digestion
312     pickup
313     outputs_sync
314     outputs_count
315     usekeys
316     unapply
317     weapon_sp
318     weapon_sp_left
319     lev_array
320     endplst
321    
322     visibility
323     magicmap
324    
325     parent
326     longname
327     jail_map
328     jail_x
329     jail_y
330     portal_map
331     portal_x
332     portal_y
333     fallback
334     nomore
335    
336     chance
337     mods
338     diff
339     saves
340     description
341     density
342     damage
343    
344     anim
345     mina
346     facings
347     player
348    
349     allowed
350     keycode
351     trans
352     yield
353     ingred
354     cauldron
355    
356     Str
357     Dex
358     Con
359     Wis
360     Cha
361     Int
362     Pow
363    
364     treasure
365     treasureone
366     list
367     change_name
368     change_title
369     change_slaying
370     yes
371     no
372     );
373    
374     open GPERF, "|-", "exec $ARG{GPERF} -m50 >kw_hash.h"
375     or die "$ARGV{GPERF}: $!";
376    
377     print GPERF <<EOF;
378     %language=C++
379     %enum
380     %define class-name kw_lex
381     %define lookup-function-name match
382     %struct-type
383     %compare-strncmp
384     %delimiters=,
385     struct keyword_idx { const char *name; enum keyword index; };
386     %%
387     EOF
388    
389     for (@kw) {
390     printf GPERF "%s,%s\n", $_, "KW_$_";
391     }
392    
393     print GPERF <<EOF;
394     %%
395     extern const char *const keyword_str [] = {
396     "<EOF>",
397     "<ERROR>",
398     EOF
399    
400     for (@kw) {
401     printf GPERF " \"%s\",\n", $_;
402     }
403    
404     print GPERF "};\n";
405    
406     printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n",
407     join ", ", map length, @kw;
408    
409     close GPERF
410     or die "$ARG{GPERF}: failed to run";
411    
412     open KW, ">", "keyword.h";
413    
414     print KW <<EOF;
415     //
416     // AUTOGENERATED: this is a generated file
417     // edit include/genkeywords instead
418     //
419    
420     #ifndef KW_H__
421     #define KW_H__
422    
423     enum keyword {
424     KW_NULL = 0,
425     KW_EOF = 0,
426     KW_ERROR,
427     EOF
428    
429     for (@kw) {
430     printf KW " %s,\n", "KW_$_",
431     }
432    
433     print KW <<EOF;
434     NUM_KEYWORD,
435     };
436    
437     extern const char *const keyword_str [];
438     extern const unsigned char keyword_len [];
439    
440     EOF
441    
442     printf KW "#define MAX_KEYWORD_LEN %d\n", List::Util::max map length, @kw;
443    
444     print KW <<EOF;
445    
446     #endif
447    
448     EOF
449