ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/preprocess
Revision: 1.25
Committed: Mon Apr 30 04:25:30 2007 UTC (17 years, 1 month ago) by root
Branch: MAIN
Changes since 1.24: +3 -1 lines
Log Message:
This is the first rough cut of the skill use system (use the STABLE tag).

Details will likely change, and combat skills do not work very well, but
it works quite well.

Players no longer have a shoottype or range slots, instead, each player
has these members:

   combat_skill/combat_ob  the currently selected skill (and weapon)
                           for direct attacks.
   ranged_skill/ranged_ob  the currently selected ranged skill (and
                           bow/spell/item)
   golem                   the currently-controlled golem, if any.

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