ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/preprocess
Revision: 1.24
Committed: Sat Apr 28 17:51:58 2007 UTC (17 years ago) by root
Branch: MAIN
CVS Tags: STABLE
Changes since 1.23: +2 -0 lines
Log Message:
implement two new flags and associated gadgets:

- FLAG_PRECIOUS: used to mark precious pet monsters. semantics
  are not fleshed out yet, but destroy_pets floors leave them be.
  ideas: save them to the player file, do not kill with killpets
  (but only with killpets all), try harder when following player on other
  maps.

- FLAG_TREASURE_ENV: put treasure into the environment instead of
  into the object, useful for terrain types on the worldmap.
  - bumped chance field in treasures to 16 bit (ideally float).

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 root 1.23 inherit
106 root 1.1 int
107     inv_locked
108     invisible
109     is_animated
110     is_blind
111     is_buildable
112     is_cauldron
113 root 1.7 is_dust
114 root 1.1 is_floor
115     is_hilly
116     is_lightable
117     is_thrown
118     is_turnable
119     is_used_up
120     is_water
121     is_wooded
122     item_power
123     known_cursed
124     known_magical
125     last_eat
126     last_grace
127     last_heal
128     last_sp
129     level
130     lifesave
131     lore
132     luck
133     magic
134     make_invisible
135     material
136     materialname
137     maxgrace
138     maxhp
139     maxsp
140     monster
141     more
142     move_allow
143     move_block
144     move_off
145     move_on
146     move_slow
147     move_slow_penalty
148     move_state
149     move_type
150     msg
151     name
152     name_pl
153     neutral
154     no_attack
155     no_damage
156     no_drop
157     no_fix_player
158     no_magic
159     no_pick
160     no_skill_ident
161     no_steal
162     no_strength
163     nrof
164 root 1.13 obj_original
165 root 1.1 object
166     oid
167     one_hit
168     only_attack
169     other_arch
170     overlay_floor
171     path_attuned
172     path_denied
173     path_repelled
174     perm_exp
175     pick_up
176 root 1.7 player_sold
177 root 1.1 pow
178 root 1.24 precious
179 root 1.1 protected
180     race
181     random_move
182     random_movement
183     randomitems
184     range
185     range_modifier
186     reflect_missile
187     reflect_spell
188     reflecting
189     resist_acid
190     resist_blind
191     resist_cancellation
192     resist_chaos
193     resist_cold
194     resist_confusion
195     resist_counterspell
196     resist_death
197     resist_deplete
198     resist_disease
199     resist_drain
200     resist_electricity
201     resist_fear
202     resist_fire
203     resist_ghosthit
204     resist_godpower
205     resist_holyword
206     resist_internal
207     resist_life_stealing
208     resist_magic
209     resist_paralyze
210     resist_physical
211     resist_poison
212     resist_slow
213     resist_turn_undead
214     resist_weaponmagic
215     run_away
216     scared
217     see_anywhere
218     see_invisible
219     skill
220     slaying
221     sleep
222     slow_move
223     smoothlevel
224     sp
225     speed
226     speed_left
227     splitting
228     stand_still
229     startequip
230     state
231     stealth
232     str
233     subtype
234     tear_down
235     title
236     tooltype
237 root 1.24 treasure_env
238 root 1.1 type
239     unaggressive
240     undead
241     unique
242     unpaid
243     use_content_on_gen
244 root 1.6 uuid
245 root 1.1 value
246     vulnerable
247     was_wiz
248     wc
249     weapontype
250     weight
251     will_apply
252     wis
253     wiz
254     x
255     xrays
256     y
257 root 1.5
258 root 1.9 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     region
273     shopitems
274     shopgreed
275     shopmin
276     shopmax
277     shoprace
278     outdoor
279     tile_path_1
280     tile_path_2
281     tile_path_3
282     tile_path_4
283    
284     file_format_version
285    
286     temp
287     pressure
288     humid
289     windspeed
290     winddir
291     sky
292 root 1.10
293     map
294     savebed_map
295     bed_x
296     bed_y
297     password
298     shoottype
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     lev_array
314     endplst
315 root 1.14
316     visibility
317     magicmap
318    
319 root 1.21 match
320 root 1.14 parent
321     longname
322 root 1.15 jail_map
323     jail_x
324     jail_y
325 root 1.14 fallback
326     nomore
327 root 1.16
328     chance
329     mods
330     diff
331     saves
332     description
333     density
334     damage
335 root 1.17
336     anim
337     mina
338     facings
339 root 1.18 player
340 root 1.19
341     allowed
342     keycode
343     trans
344     yield
345     ingred
346     cauldron
347    
348     Str
349     Dex
350     Con
351     Wis
352     Cha
353     Int
354     Pow
355 root 1.22
356     treasure
357     treasureone
358     list
359     change_name
360     change_title
361     change_slaying
362     yes
363     no
364 root 1.1 );
365    
366 root 1.8 open GPERF, "|-", "exec $ARG{GPERF} -m50 >kw_hash.h"
367     or die "$ARGV{GPERF}: $!";
368 root 1.1
369     print GPERF <<EOF;
370     %language=C++
371     %enum
372     %define class-name kw_lex
373     %define lookup-function-name match
374     %struct-type
375     %compare-strncmp
376     %delimiters=,
377 root 1.2 struct keyword_idx { const char *name; enum keyword index; };
378 root 1.1 %%
379     EOF
380    
381     for (@kw) {
382 root 1.3 printf GPERF "%s,%s\n", $_, "KW_$_";
383 root 1.1 }
384    
385     print GPERF <<EOF;
386     %%
387 root 1.3 extern const char *const keyword_str [] = {
388 root 1.1 "<EOF>",
389     "<ERROR>",
390     EOF
391    
392     for (@kw) {
393     printf GPERF " \"%s\",\n", $_;
394     }
395    
396 root 1.3 print GPERF "};\n";
397    
398     printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n",
399     join ", ", map length, @kw;
400 root 1.1
401 root 1.8 close GPERF
402     or die "$ARG{GPERF}: failed to run";
403    
404 root 1.1 open KW, ">", "keyword.h";
405    
406     print KW <<EOF;
407     #ifndef KW_H__
408     #define KW_H__
409    
410     enum keyword {
411 root 1.7 KW_NULL = 0,
412     KW_EOF = 0,
413     KW_ERROR,
414 root 1.1 EOF
415    
416     for (@kw) {
417 root 1.3 printf KW " %s,\n", "KW_$_",
418 root 1.1 }
419    
420     print KW <<EOF;
421     NUM_KEYWORD,
422     };
423    
424     extern const char *const keyword_str [];
425 root 1.3 extern const unsigned char keyword_len [];
426    
427     EOF
428    
429     printf KW "#define MAX_KEYWORD_LEN %d\n", List::Util::max map length, @kw;
430    
431     print KW <<EOF;
432 root 1.1
433     #endif
434    
435     EOF
436