#!/opt/bin/perl use List::Util; # todo: gather dynamically my @kw = qw( no_pass walk_on walk_off fly_on fly_off flying ac activate_on_push activate_on_release alive anim_speed animation applied arch armour attach attack_movement attacktype auto_apply been_applied berserk blocksview body_range body_arm body_torso body_head body_neck body_skill body_finger body_shoulder body_foot body_hand body_wrist body_waist can_apply can_cast_spell can_roll can_see_in_dark can_use_armour can_use_bow can_use_horn can_use_range can_use_ring can_use_rod can_use_scroll can_use_shield can_use_skill can_use_wand can_use_weapon carrying casting_time cha changing client_type con confused connected container cursed custom_name dam dam_modifier damned dex direction duration duration_modifier editable editor_folder elevation end endlore endmsg exp expmul face food friendly gen_sp_armour generator glow_radius grace has_ready_bow has_ready_horn has_ready_rod has_ready_scroll has_ready_skill has_ready_wand has_ready_weapon hitback hp identified immune int inv_locked invisible is_animated is_blind is_buildable is_cauldron is_floor is_hilly is_lightable is_thrown is_turnable is_used_up is_water is_wooded item_power known_cursed known_magical last_eat last_grace last_heal last_sp level lifesave lore luck magic make_invisible material materialname maxgrace maxhp maxsp monster more move_allow move_block move_off move_on move_slow move_slow_penalty move_state move_type msg name name_pl neutral no_attack no_damage no_drop no_fix_player no_magic no_pick no_skill_ident no_steal no_strength nrof object oid one_hit only_attack other_arch overlay_floor path_attuned path_denied path_repelled perm_exp pick_up pow protected race random_move random_movement randomitems range range_modifier reflect_missile reflect_spell reflecting resist_acid resist_blind resist_cancellation resist_chaos resist_cold resist_confusion resist_counterspell resist_death resist_deplete resist_disease resist_drain resist_electricity resist_fear resist_fire resist_ghosthit resist_godpower resist_holyword resist_internal resist_life_stealing resist_magic resist_paralyze resist_physical resist_poison resist_slow resist_turn_undead resist_weaponmagic run_away scared see_anywhere see_invisible skill slaying sleep slow_move smoothlevel sp speed speed_left splitting stand_still startequip state stealth str subtype tear_down title tooltype treasure type unaggressive undead unique unpaid use_content_on_gen value vulnerable was_wiz wc weapontype weight will_apply wis wiz x xrays y ); open GPERF, "|-", "gperf -m50 >kw_hash.h" or die "gperf: $!"; print GPERF <", "", EOF for (@kw) { printf GPERF " \"%s\",\n", $_; } print GPERF "};\n"; printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n", join ", ", map length, @kw; open KW, ">", "keyword.h"; print KW <