ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/genkeywords
Revision: 1.14
Committed: Sun Nov 29 09:41:28 2009 UTC (14 years, 5 months ago) by root
Branch: MAIN
CVS Tags: rel-2_92, rel-2_93
Changes since 1.13: +2 -7 lines
Log Message:
speed is positive inside the server

File Contents

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