ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/preprocess
Revision: 1.6
Committed: Wed Sep 13 02:05:19 2006 UTC (17 years, 8 months ago) by root
Branch: MAIN
Changes since 1.5: +1 -0 lines
Log Message:
preliminary uuid support

File Contents

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