ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/genkeywords
Revision: 1.2
Committed: Thu Jun 7 19:12:22 2007 UTC (17 years ago) by root
Branch: MAIN
Changes since 1.1: +1 -0 lines
Log Message:
- new map header boolean "no_reset 1" to deny reset.
- allow reset of per-player maps, effectviely implementing
  player-private dungeons.
- re-enabled reset-on-load feature again.
- remove fail-safe mechanism that prevented per-player maps from
  being reset. keep your fingers crossed.
- fixed two bugs in archetype finding (archname vs. object name).
- singularities no longer crash the server but will log a backtrace
  now as they are really are fatal.

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