OSDN Git Service

アイテムの種類判定のコードを整理。
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 7 Dec 2003 17:23:21 +0000 (17:23 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 7 Dec 2003 17:23:21 +0000 (17:23 +0000)
- artifact_p等の *_p というマクロや、item_tester_hook_*, is_* 等の
  判定関数を、 object_is_*という名前に統一してobj_kind.c に集めた。
- TV_*_BEGIN <= && <= TV_*_END で判定していたコードを関数に変更。
- ★☆アーティファクトの判定をobject_is_artifact()一つでするように変更。

35 files changed:
src/artifact.c
src/autopick.c
src/bldg.c
src/cave.c
src/cmd1.c
src/cmd2.c
src/cmd3.c
src/cmd4.c
src/cmd6.c
src/defines.h
src/dungeon.c
src/effects.c
src/externs.h
src/files.c
src/flavor.c
src/floors.c
src/load.c
src/melee1.c
src/melee2.c
src/mspells1.c
src/mspells2.c
src/mutation.c
src/obj_kind.c
src/object1.c
src/object2.c
src/racial.c
src/spells1.c
src/spells2.c
src/spells3.c
src/store.c
src/types.h
src/wizard1.c
src/wizard2.c
src/xtra1.c
src/z-config.h

index b7c0d67..8defb0f 100644 (file)
@@ -207,7 +207,7 @@ static void curse_artifact(object_type * o_ptr)
 
 static void random_plus(object_type * o_ptr)
 {
-       int this_type = (o_ptr->tval <= TV_WEAPON_END ? 23 : 19);
+       int this_type = (object_is_weapon_ammo(o_ptr) ? 23 : 19);
 
        switch (artifact_bias)
        {
@@ -892,7 +892,7 @@ static void random_misc(object_type * o_ptr)
                case 24:
                case 25:
                case 26:
-                       if (TV_ARMOR_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_ARMOR_END)
+                       if (object_is_armour(o_ptr))
                                random_misc(o_ptr);
                        else
                        {
@@ -1633,7 +1633,7 @@ bool create_artifact(object_type *o_ptr, bool a_scroll)
        char    new_name[1024];
        int     has_pval = 0;
        int     powers = randint1(5) + 1;
-       int     max_type = (o_ptr->tval <= TV_WEAPON_END ? 7 : 5);
+       int     max_type = (object_is_weapon_ammo(o_ptr) ? 7 : 5);
        int     power_level;
        s32b    total_flags;
        bool    a_cursed = FALSE;
@@ -1734,7 +1734,7 @@ bool create_artifact(object_type *o_ptr, bool a_scroll)
 
        if (!a_scroll && one_in_(A_CURSED))
                a_cursed = TRUE;
-       if (((o_ptr->tval == TV_AMULET) || (o_ptr->tval == TV_RING)) && cursed_p(o_ptr))
+       if (((o_ptr->tval == TV_AMULET) || (o_ptr->tval == TV_RING)) && object_is_cursed(o_ptr))
                a_cursed = TRUE;
 
        while (one_in_(powers) || one_in_(7) || one_in_(10))
@@ -1755,7 +1755,7 @@ bool create_artifact(object_type *o_ptr, bool a_scroll)
                                has_pval = TRUE;
                                break;
                        case 3: case 4:
-                               if (one_in_(2) && (o_ptr->tval <= TV_WEAPON_END) && (o_ptr->tval != TV_BOW))
+                               if (one_in_(2) && object_is_weapon_ammo(o_ptr) && (o_ptr->tval != TV_BOW))
                                {
                                        if (a_cursed && !one_in_(13)) break;
                                        if (one_in_(13))
@@ -1812,9 +1812,9 @@ bool create_artifact(object_type *o_ptr, bool a_scroll)
        }
 
        /* give it some plusses... */
-       if (TV_ARMOR_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_ARMOR_END)
+       if (object_is_armour(o_ptr))
                o_ptr->to_a += randint1(o_ptr->to_a > 19 ? 1 : 20 - o_ptr->to_a);
-       else if (o_ptr->tval <= TV_SWORD)
+       else if (object_is_weapon_ammo(o_ptr))
        {
                o_ptr->to_h += randint1(o_ptr->to_h > 19 ? 1 : 20 - o_ptr->to_h);
                o_ptr->to_d += randint1(o_ptr->to_d > 19 ? 1 : 20 - o_ptr->to_d);
@@ -1833,14 +1833,13 @@ bool create_artifact(object_type *o_ptr, bool a_scroll)
        if (a_cursed) curse_artifact(o_ptr);
 
        if (!a_cursed &&
-           (randint1((o_ptr->tval >= TV_ARMOR_BEGIN)
-           ? ACTIVATION_CHANCE * 2 : ACTIVATION_CHANCE) == 1))
+           one_in_(object_is_armour(o_ptr) ? ACTIVATION_CHANCE * 2 : ACTIVATION_CHANCE))
        {
                o_ptr->xtra2 = 0;
                give_activation_power(o_ptr);
        }
 
-       if (TV_ARMOR_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_ARMOR_END)
+       if (object_is_armour(o_ptr))
        {
                while ((o_ptr->to_d+o_ptr->to_h) > 20)
                {
@@ -1882,7 +1881,7 @@ bool create_artifact(object_type *o_ptr, bool a_scroll)
                remove_flag(o_ptr->art_flags, TR_BRAND_COLD);
        }
 
-       if (o_ptr->tval >= TV_ARMOR_BEGIN)
+       if (!object_is_weapon_ammo(o_ptr))
        {
                /* For armors */
                if (a_cursed) power_level = 0;
@@ -1920,7 +1919,7 @@ bool create_artifact(object_type *o_ptr, bool a_scroll)
 #endif
 
                {
-                       get_random_name(new_name, (bool)(o_ptr->tval >= TV_ARMOR_BEGIN), power_level);
+                       get_random_name(new_name, object_is_armour(o_ptr), power_level);
                }
                else
                {
@@ -1945,7 +1944,7 @@ bool create_artifact(object_type *o_ptr, bool a_scroll)
        }
        else
        {
-               get_random_name(new_name, (bool)(o_ptr->tval >= TV_ARMOR_BEGIN), power_level);
+               get_random_name(new_name, object_is_armour(o_ptr), power_level);
        }
 
        if (cheat_xtra)
index b5d8d24..761f970 100644 (file)
@@ -436,134 +436,6 @@ static bool autopick_new_entry(autopick_type *entry, cptr str, bool allow_defaul
 
 
 /*
- * Favorite weapons
- */
-static bool is_favorite(object_type *o_ptr)
-{
-       /* Only melee weapons match */
-       if (!(o_ptr->tval == TV_POLEARM ||
-             o_ptr->tval == TV_SWORD ||
-             o_ptr->tval == TV_DIGGING ||
-             o_ptr->tval == TV_HAFTED))
-       {
-               return FALSE;
-       }
-
-       /* Favorite weapons are varied depend on the class */
-       switch (p_ptr->pclass)
-       {
-       case CLASS_PRIEST:
-       {
-               u32b flgs[TR_FLAG_SIZE];
-               object_flags_known(o_ptr, flgs);
-
-               if (!have_flag(flgs, TR_BLESSED) && 
-                   !(o_ptr->tval == TV_HAFTED))
-                       return FALSE;
-               break;
-       }
-
-       case CLASS_MONK:
-       case CLASS_FORCETRAINER:
-               /* Icky to wield? */
-               if (!(s_info[p_ptr->pclass].w_max[o_ptr->tval-TV_WEAPON_BEGIN][o_ptr->sval]))
-                       return FALSE;
-               break;
-
-       case CLASS_BEASTMASTER:
-       case CLASS_CAVALRY:
-       {
-               u32b flgs[TR_FLAG_SIZE];
-               object_flags_known(o_ptr, flgs);
-
-               /* Is it known to be suitable to using while riding? */
-               if (!(have_flag(flgs, TR_RIDING)))
-                       return FALSE;
-
-               break;
-       }
-
-       case CLASS_NINJA:
-               /* Icky to wield? */
-               if (s_info[p_ptr->pclass].w_max[o_ptr->tval-TV_WEAPON_BEGIN][o_ptr->sval] <= WEAPON_EXP_BEGINNER)
-                       return FALSE;
-               break;
-
-       default:
-               /* All weapons are okay for non-special classes */
-               return TRUE;
-       }
-
-       return TRUE;
-}
-
-
-/*
- * Rare weapons/aromors
- * including Blade of Chaos, Dragon armors, etc.
- */
-static bool is_rare(object_type *o_ptr)
-{
-       switch(o_ptr->tval)
-       {
-       case TV_HAFTED:
-               if (o_ptr->sval == SV_MACE_OF_DISRUPTION ||
-                   o_ptr->sval == SV_WIZSTAFF) return TRUE;
-               break;
-
-       case TV_POLEARM:
-               if (o_ptr->sval == SV_SCYTHE_OF_SLICING ||
-                   o_ptr->sval == SV_DEATH_SCYTHE) return TRUE;
-               break;
-
-       case TV_SWORD:
-               if (o_ptr->sval == SV_BLADE_OF_CHAOS ||
-                   o_ptr->sval == SV_DIAMOND_EDGE ||
-                   o_ptr->sval == SV_DOKUBARI ||
-                   o_ptr->sval == SV_HAYABUSA) return TRUE;
-               break;
-
-       case TV_SHIELD:
-               if (o_ptr->sval == SV_DRAGON_SHIELD ||
-                   o_ptr->sval == SV_MIRROR_SHIELD) return TRUE;
-               break;
-
-       case TV_HELM:
-               if (o_ptr->sval == SV_DRAGON_HELM) return TRUE;
-               break;
-
-       case TV_BOOTS:
-               if (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE) return TRUE;
-               break;
-
-       case TV_CLOAK:
-               if (o_ptr->sval == SV_ELVEN_CLOAK ||
-                   o_ptr->sval == SV_ETHEREAL_CLOAK ||
-                   o_ptr->sval == SV_SHADOW_CLOAK) return TRUE;
-               break;
-
-       case TV_GLOVES:
-               if (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES) return TRUE;
-               break;
-
-       case TV_SOFT_ARMOR:
-               if (o_ptr->sval == SV_KUROSHOUZOKU ||
-                   o_ptr->sval == SV_ABUNAI_MIZUGI) return TRUE;
-               break;
-
-       case TV_DRAG_ARMOR:
-               return TRUE;
-
-       default:
-               break;
-       }
-
-       /* Any others are not "rare" objects. */
-       return FALSE;
-}
-
-
-/*
  * Get auto-picker entry from o_ptr.
  */
 static void autopick_entry_from_object(autopick_type *entry, object_type *o_ptr)
@@ -590,14 +462,14 @@ static void autopick_entry_from_object(autopick_type *entry, object_type *o_ptr)
        entry->dice = 0;
 
        /* Unaware */
-       if (!object_aware_p(o_ptr))
+       if (!object_is_aware(o_ptr))
        {
                ADD_FLG(FLG_UNAWARE);
                bol_mark = TRUE;
        }
 
        /* Not really identified */
-       else if (!object_known_p(o_ptr))
+       else if (!object_is_known(o_ptr))
        {
                if (!(o_ptr->ident & IDENT_SENSE))
                {
@@ -647,11 +519,10 @@ static void autopick_entry_from_object(autopick_type *entry, object_type *o_ptr)
        else
        {
                /* Ego objects */
-               if (o_ptr->name2)
+               if (object_is_ego(o_ptr))
                    
                {
-                       if (TV_WEAPON_BEGIN <= o_ptr->tval &&
-                           o_ptr->tval <= TV_ARMOR_END)
+                       if (object_is_weapon_armour_ammo(o_ptr))
                        {
                                /*
                                 * Base name of ego weapons and armors
@@ -670,11 +541,10 @@ static void autopick_entry_from_object(autopick_type *entry, object_type *o_ptr)
                                /* Don't use the object description */
                                name = FALSE;
 
-                               if (TV_WEAPON_BEGIN <= o_ptr->tval &&
-                                   o_ptr->tval <= TV_ARMOR_END)
+                               if (object_is_weapon_armour_ammo(o_ptr))
                                {
                                        /* Restrict to 'common' equipments */
-                                       if (!is_rare(o_ptr)) ADD_FLG(FLG_COMMON);
+                                       if (!object_is_rare(o_ptr)) ADD_FLG(FLG_COMMON);
                                }
                        }
 
@@ -682,14 +552,14 @@ static void autopick_entry_from_object(autopick_type *entry, object_type *o_ptr)
                }
 
                /* Artifact */
-               else if (o_ptr->name1 || o_ptr->art_name)
+               else if (object_is_artifact(o_ptr))
                        ADD_FLG(FLG_ARTIFACT);
 
                /* Non-ego, non-artifact */
                else
                {
                        /* Wearable nameless object */
-                       if ((TV_EQUIP_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_EQUIP_END))
+                       if (object_is_equipment(o_ptr))
                                ADD_FLG(FLG_NAMELESS);
 
                        bol_mark = TRUE;
@@ -697,17 +567,17 @@ static void autopick_entry_from_object(autopick_type *entry, object_type *o_ptr)
 
        }
 
-
-       switch(o_ptr->tval)
+       /* Melee weapon with boosted dice */
+       if (object_is_melee_weapon(o_ptr))
        {
-               object_kind *k_ptr; 
-       case TV_HAFTED: case TV_POLEARM: case TV_SWORD: case TV_DIGGING:
-               k_ptr = &k_info[o_ptr->k_idx];
+               object_kind *k_ptr = &k_info[o_ptr->k_idx];
+
                if ((o_ptr->dd != k_ptr->dd) || (o_ptr->ds != k_ptr->ds))
                        ADD_FLG(FLG_BOOSTED);
        }
 
-       if (o_ptr->tval == TV_CORPSE && object_is_shoukinkubi(o_ptr))
+       /* Wanted monster's corpse */
+       if (object_is_shoukinkubi(o_ptr))
        {
                REM_FLG(FLG_WORTHLESS);
                ADD_FLG(FLG_WANTED);
@@ -756,8 +626,7 @@ static void autopick_entry_from_object(autopick_type *entry, object_type *o_ptr)
        if (o_ptr->tval >= TV_LIFE_BOOK && 3 == o_ptr->sval)
                ADD_FLG(FLG_FOURTH);
 
-       if (o_ptr->tval == TV_SHOT || o_ptr->tval == TV_BOLT
-                || o_ptr->tval == TV_ARROW)
+       if (object_is_ammo(o_ptr))
                ADD_FLG(FLG_MISSILES);
        else if (o_ptr->tval == TV_SCROLL || o_ptr->tval == TV_STAFF
                 || o_ptr->tval == TV_WAND || o_ptr->tval == TV_ROD)
@@ -1160,41 +1029,35 @@ static bool is_autopick_aux(object_type *o_ptr, autopick_type *entry, cptr o_nam
        cptr ptr = entry->name;
 
        /*** Unaware items ***/
-       if (IS_FLG(FLG_UNAWARE) && object_aware_p(o_ptr))
+       if (IS_FLG(FLG_UNAWARE) && object_is_aware(o_ptr))
                return FALSE;
 
        /*** Unidentified ***/
        if (IS_FLG(FLG_UNIDENTIFIED)
-           && (object_known_p(o_ptr) || (o_ptr->ident & IDENT_SENSE)))
+           && (object_is_known(o_ptr) || (o_ptr->ident & IDENT_SENSE)))
                return FALSE;
 
        /*** Identified ***/
-       if (IS_FLG(FLG_IDENTIFIED) && !object_known_p(o_ptr))
+       if (IS_FLG(FLG_IDENTIFIED) && !object_is_known(o_ptr))
                return FALSE;
 
        /*** *Identified* ***/
        if (IS_FLG(FLG_STAR_IDENTIFIED) &&
-           (!object_known_p(o_ptr) || !(o_ptr->ident & IDENT_MENTAL)))
+           (!object_is_known(o_ptr) || !(o_ptr->ident & IDENT_MENTAL)))
                return FALSE;
 
        /*** Dice boosted (weapon of slaying) ***/
        if (IS_FLG(FLG_BOOSTED))
        {
                object_kind *k_ptr = &k_info[o_ptr->k_idx];
-                       
-               switch( o_ptr->tval )
-               {
-               case TV_HAFTED:
-               case TV_POLEARM:
-               case TV_SWORD:
-               case TV_DIGGING:
-                       if ((o_ptr->dd != k_ptr->dd) || (o_ptr->ds != k_ptr->ds))
-                               break;
-                       else
-                               return FALSE;
-               default:
+
+               /* Require melee weapon */
+               if (!object_is_melee_weapon(o_ptr))
+                       return FALSE;
+
+               /* Require boosted dice */
+               if ((o_ptr->dd == k_ptr->dd) && (o_ptr->ds == k_ptr->ds))
                        return FALSE;
-               }
        }
 
        /*** Weapons which dd*ds is more than nn ***/
@@ -1207,7 +1070,7 @@ static bool is_autopick_aux(object_type *o_ptr, autopick_type *entry, cptr o_nam
        /*** Weapons whic dd*ds is more than nn ***/
        if (IS_FLG(FLG_MORE_BONUS))
        {
-               if (!object_known_p(o_ptr)) return FALSE;
+               if (!object_is_known(o_ptr)) return FALSE;
 
                if (o_ptr->pval)
                {
@@ -1230,7 +1093,7 @@ static bool is_autopick_aux(object_type *o_ptr, autopick_type *entry, cptr o_nam
        /*** Artifact object ***/
        if (IS_FLG(FLG_ARTIFACT))
        {
-               if (!object_known_p(o_ptr) || (!o_ptr->name1 && !o_ptr->art_name))
+               if (!object_is_known(o_ptr) || !object_is_artifact(o_ptr))
                        return FALSE;
        }
 
@@ -1238,10 +1101,10 @@ static bool is_autopick_aux(object_type *o_ptr, autopick_type *entry, cptr o_nam
        if (IS_FLG(FLG_EGO))
        {
                /* Need to be an ego item */
-               if (!o_ptr->name2) return FALSE;
+               if (!object_is_ego(o_ptr)) return FALSE;
 
                /* Need to be known to be an ego */
-               if (!object_known_p(o_ptr) &&
+               if (!object_is_known(o_ptr) &&
                    !((o_ptr->ident & IDENT_SENSE) && o_ptr->feeling == FEEL_EXCELLENT))
                        return FALSE;
        }
@@ -1249,14 +1112,13 @@ static bool is_autopick_aux(object_type *o_ptr, autopick_type *entry, cptr o_nam
        /*** Good ***/
        if (IS_FLG(FLG_GOOD))
        {
-               if (!(TV_EQUIP_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_EQUIP_END))
-                       return FALSE;
+               if (!object_is_equipment(o_ptr)) return FALSE;
 
                /* Identified */
-               if (object_known_p(o_ptr))
+               if (object_is_known(o_ptr))
                {
                        /* Artifacts and Ego objects are not okay */
-                       if (o_ptr->name1 || o_ptr->art_name || o_ptr->name2)
+                       if (!object_is_nameless(o_ptr))
                                return FALSE;
 
                        /* Average are not okay */
@@ -1290,14 +1152,13 @@ static bool is_autopick_aux(object_type *o_ptr, autopick_type *entry, cptr o_nam
        /*** Nameless ***/
        if (IS_FLG(FLG_NAMELESS))
        {
-               if (!(TV_EQUIP_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_EQUIP_END))
-                       return FALSE;
+               if (!object_is_equipment(o_ptr)) return FALSE;
 
                /* Identified */
-               if (object_known_p(o_ptr))
+               if (object_is_known(o_ptr))
                {
                        /* Artifacts and Ego objects are not okay */
-                       if (o_ptr->name1 || o_ptr->art_name || o_ptr->name2)
+                       if (!object_is_nameless(o_ptr))
                                return FALSE;
                }
 
@@ -1330,14 +1191,17 @@ static bool is_autopick_aux(object_type *o_ptr, autopick_type *entry, cptr o_nam
        /*** Average ***/
        if (IS_FLG(FLG_AVERAGE))
        {
-               if (!(TV_EQUIP_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_EQUIP_END))
-                       return FALSE;
+               if (!object_is_equipment(o_ptr)) return FALSE;
 
                /* Identified */
-               if (object_known_p(o_ptr))
+               if (object_is_known(o_ptr))
                {
                        /* Artifacts and Ego objects are not okay */
-                       if (o_ptr->name1 || o_ptr->art_name || o_ptr->name2)
+                       if (!object_is_nameless(o_ptr))
+                               return FALSE;
+
+                       /* Cursed or broken objects are not okay */
+                       if (object_is_cursed(o_ptr) || object_is_broken(o_ptr))
                                return FALSE;
 
                        /* Good are not okay */
@@ -1369,16 +1233,15 @@ static bool is_autopick_aux(object_type *o_ptr, autopick_type *entry, cptr o_nam
        }
 
        /*** Rere equpiments ***/
-       if (IS_FLG(FLG_RARE) && !is_rare(o_ptr))
+       if (IS_FLG(FLG_RARE) && !object_is_rare(o_ptr))
                return FALSE;
 
        /*** Common equpiments ***/
-       if (IS_FLG(FLG_COMMON) && is_rare(o_ptr))
+       if (IS_FLG(FLG_COMMON) && object_is_rare(o_ptr))
                return FALSE;
 
        /*** Wanted monster's corpse/skeletons ***/
-       if (IS_FLG(FLG_WANTED) &&
-           (o_ptr->tval != TV_CORPSE || !object_is_shoukinkubi(o_ptr)))
+       if (IS_FLG(FLG_WANTED) && !object_is_shoukinkubi(o_ptr))
                return FALSE;
 
        /*** Unique monster's corpse/skeletons/statues ***/
@@ -1436,27 +1299,22 @@ static bool is_autopick_aux(object_type *o_ptr, autopick_type *entry, cptr o_nam
        /*** Items ***/
        if (IS_FLG(FLG_WEAPONS))
        {
-               if (!(TV_WEAPON_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_WEAPON_END))
+               if (!object_is_weapon(o_ptr))
                        return FALSE;
        }
        else if (IS_FLG(FLG_FAVORITE_WEAPONS))
        {
-               if (!is_favorite(o_ptr))
+               if (!object_is_favorite(o_ptr))
                        return FALSE;
        }
        else if (IS_FLG(FLG_ARMORS))
        {
-               if (!(TV_ARMOR_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_ARMOR_END))
+               if (!object_is_armour(o_ptr))
                        return FALSE;
        }
        else if (IS_FLG(FLG_MISSILES))
        {
-               switch(o_ptr->tval)
-               {
-               case TV_SHOT: case TV_BOLT: case TV_ARROW:
-                       break;
-               default: return FALSE;
-               }
+               if (!object_is_ammo(o_ptr)) return FALSE;
        }
        else if (IS_FLG(FLG_DEVICES))
        {
@@ -1638,15 +1496,14 @@ static bool is_opt_confirm_destroy(object_type *o_ptr)
                if (object_value(o_ptr) > 0) return FALSE;
        
        if (leave_equip)
-               if ((o_ptr->tval >= TV_MISSILE_BEGIN) && (o_ptr->tval <= TV_ARMOR_END)) return FALSE;
+               if (!object_is_weapon_armour_ammo(o_ptr)) return FALSE;
        
        if (leave_chest)
                if ((o_ptr->tval == TV_CHEST) && o_ptr->pval) return FALSE;
        
        if (leave_wanted)
        {
-               if (o_ptr->tval == TV_CORPSE
-                   && object_is_shoukinkubi(o_ptr)) return FALSE;
+               if (object_is_shoukinkubi(o_ptr)) return FALSE;
        }
        
        if (leave_corpse)
@@ -2114,8 +1971,7 @@ bool autopick_autoregister(object_type *o_ptr)
        }
 
        /* Known to be an artifact? */
-       if ((object_known_p(o_ptr) &&
-            (artifact_p(o_ptr) || o_ptr->art_name)) ||
+       if ((object_is_known(o_ptr) && object_is_artifact(o_ptr)) ||
            ((o_ptr->ident & IDENT_SENSE) &&
             (o_ptr->feeling == FEEL_TERRIBLE || o_ptr->feeling == FEEL_SPECIAL)))
        {
index 6fcdfe2..bd60535 100644 (file)
@@ -3791,7 +3791,7 @@ s = "
         * the level of the item or the number of charges.
         */
        /* The item must be "known" */
-       if (!object_known_p(o_ptr))
+       if (!object_is_known(o_ptr))
        {
 #ifdef JP
 msg_format("½¼Å¶¤¹¤ëÁ°¤Ë´ÕÄꤵ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡ª");
@@ -4041,7 +4041,7 @@ static void building_recharge_all(void)
                if (o_ptr->tval < TV_STAFF || o_ptr->tval > TV_ROD) continue;
 
                /* need identified */
-               if (!object_known_p(o_ptr)) total_cost += 50;
+               if (!object_is_known(o_ptr)) total_cost += 50;
 
                /* Extract the object "level" */
                lev = k_info[o_ptr->k_idx].level;
@@ -4121,7 +4121,7 @@ static void building_recharge_all(void)
                if (o_ptr->tval < TV_STAFF || o_ptr->tval > TV_ROD) continue;
 
                /* Identify it */
-               if (!object_known_p(o_ptr))
+               if (!object_is_known(o_ptr))
                {
                        identify_item(o_ptr);
 
@@ -4654,11 +4654,11 @@ msg_print("
                paid = compare_weapons();
                break;
        case BACT_ENCHANT_WEAPON:
-               item_tester_hook = item_tester_hook_melee_weapon;
+               item_tester_hook = object_allow_enchant_melee_weapon;
                enchant_item(bcost, 1, 1, 0);
                break;
        case BACT_ENCHANT_ARMOR:
-               item_tester_hook = item_tester_hook_armour;
+               item_tester_hook = object_is_armour;
                enchant_item(bcost, 0, 0, 1);
                break;
        case BACT_RECHARGE:
index d080d0f..632ddc2 100644 (file)
@@ -561,7 +561,7 @@ bool cave_valid_bold(int y, int x)
                next_o_idx = o_ptr->next_o_idx;
 
                /* Forbid artifact grids */
-               if ((o_ptr->art_name) || artifact_p(o_ptr)) return (FALSE);
+               if (object_is_artifact(o_ptr)) return (FALSE);
        }
 
        /* Accept */
@@ -596,7 +596,7 @@ bool cave_valid_grid(cave_type *c_ptr)
                next_o_idx = o_ptr->next_o_idx;
 
                /* Forbid artifact grids */
-               if ((o_ptr->art_name) || artifact_p(o_ptr)) return (FALSE);
+               if (object_is_artifact(o_ptr)) return (FALSE);
        }
 
        /* Accept */
index 4bde246..3ae4818 100644 (file)
@@ -734,7 +734,7 @@ void search(void)
                                        if (!chest_traps[o_ptr->pval]) continue;
 
                                        /* Identify once */
-                                       if (!object_known_p(o_ptr))
+                                       if (!object_is_known(o_ptr))
                                        {
                                                /* Message */
 #ifdef JP
index 7ab2aa2..6544914 100644 (file)
@@ -1018,7 +1018,7 @@ static int count_chests(int *y, int *x, bool trapped)
                if (o_ptr->pval == 0) continue;
 
                /* No (known) traps here */
-               if (trapped && (!object_known_p(o_ptr) ||
+               if (trapped && (!object_is_known(o_ptr) ||
                        !chest_traps[o_ptr->pval])) continue;
 
                /* OK */
@@ -1908,7 +1908,7 @@ static bool do_cmd_disarm_chest(int y, int x, s16b o_idx)
        if (j < 2) j = 2;
 
        /* Must find the trap first. */
-       if (!object_known_p(o_ptr))
+       if (!object_is_known(o_ptr))
        {
 #ifdef JP
                msg_print("¥È¥é¥Ã¥×¤¬¸«¤¢¤¿¤é¤Ê¤¤¡£");
@@ -3666,7 +3666,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
                                else
                                {
                                        /* STICK TO */
-                                       if (q_ptr->name1)
+                                       if (object_is_fixed_artifact(q_ptr))
                                        {
                                                char m_name[80];
 
@@ -3733,7 +3733,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
 #else
                    msg_format("The %s have gone to somewhere.", o_name);
 #endif
-                   if (q_ptr->name1)
+                   if (object_is_fixed_artifact(q_ptr))
                      {
                        a_info[j_ptr->name1].cur_num = 0;
                      }
@@ -3936,7 +3936,7 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
 
 
        /* Item is cursed */
-       if (cursed_p(o_ptr) && (item >= INVEN_RARM))
+       if (object_is_cursed(o_ptr) && (item >= INVEN_RARM))
        {
                /* Oops */
 #ifdef JP
@@ -4277,14 +4277,14 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
                j = 100;
 
                if (!(summon_named_creature(0, y, x, q_ptr->pval,
-                                           !(cursed_p(q_ptr)) ? PM_FORCE_PET : 0L)))
+                                           !(object_is_cursed(q_ptr)) ? PM_FORCE_PET : 0L)))
 #ifdef JP
 msg_print("¿Í·Á¤ÏDZ¤¸¶Ê¤¬¤êºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
 #else
                        msg_print("The Figurine writhes and then shatters.");
 #endif
 
-               else if (cursed_p(q_ptr))
+               else if (object_is_cursed(q_ptr))
 #ifdef JP
 msg_print("¤³¤ì¤Ï¤¢¤Þ¤êÎɤ¯¤Ê¤¤µ¤¤¬¤¹¤ë¡£");
 #else
index 2c5e6f4..24b1b67 100644 (file)
@@ -276,7 +276,7 @@ void do_cmd_wield(void)
 #endif
 
                        if (!get_item(&slot, q, s, (USE_EQUIP))) return;
-                       if ((slot == INVEN_RARM) && !cursed_p(&inventory[INVEN_RARM]))
+                       if ((slot == INVEN_RARM) && !object_is_cursed(&inventory[INVEN_RARM]))
                        {
                                object_type *or_ptr = &inventory[INVEN_RARM];
                                object_type *ol_ptr = &inventory[INVEN_LARM];
@@ -357,7 +357,7 @@ void do_cmd_wield(void)
        }
 
        /* Prevent wielding into a cursed slot */
-       if (cursed_p(&inventory[slot]))
+       if (object_is_cursed(&inventory[slot]))
        {
                /* Describe it */
                object_desc(o_name, &inventory[slot], (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -375,8 +375,8 @@ void do_cmd_wield(void)
                return;
        }
 
-       if (cursed_p(o_ptr) && confirm_wear &&
-           (object_known_p(o_ptr) || (o_ptr->ident & IDENT_SENSE)))
+       if (object_is_cursed(o_ptr) && confirm_wear &&
+           (object_is_known(o_ptr) || (o_ptr->ident & IDENT_SENSE)))
        {
                char dummy[MAX_NLEN+80];
 
@@ -392,7 +392,7 @@ sprintf(dummy, "
                if (!get_check(dummy)) return;
        }
 
-       if ((o_ptr->name1 == ART_STONEMASK) && object_known_p(o_ptr) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
+       if ((o_ptr->name1 == ART_STONEMASK) && object_is_known(o_ptr) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
        {
                char dummy[MAX_NLEN+80];
 
@@ -541,7 +541,7 @@ msg_print("
 
 
        /* Cursed! */
-       if (cursed_p(o_ptr))
+       if (object_is_cursed(o_ptr))
        {
                /* Warn the player */
 #ifdef JP
@@ -683,7 +683,7 @@ void do_cmd_takeoff(void)
 
 
        /* Item is cursed */
-       if (cursed_p(o_ptr))
+       if (object_is_cursed(o_ptr))
        {
                if ((o_ptr->curse_flags & TRC_PERMA_CURSE) || (p_ptr->pclass != CLASS_BERSERKER))
                {
@@ -794,7 +794,7 @@ void do_cmd_drop(void)
 
 
        /* Hack -- Cannot remove cursed items */
-       if ((item >= INVEN_RARM) && cursed_p(o_ptr))
+       if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
        {
                /* Oops */
 #ifdef JP
index 9709a27..8b18cc7 100644 (file)
@@ -5628,20 +5628,20 @@ static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, by
        if (o_ptr->tval != tval) return;
 
        /* Identified items only */
-       if (!object_known_p(o_ptr)) return;
+       if (!object_is_known(o_ptr)) return;
 
        /*
         * HACK:Ring of Lordly protection and Dragon equipment
         * have random resistances.
         */
-       if (((TV_WEARABLE_BEGIN <= tval) && (tval <= TV_WEARABLE_END) && o_ptr->name2)
+       if ((object_is_wearable(o_ptr) && object_is_ego(o_ptr))
            || ((tval == TV_AMULET) && (o_ptr->sval == SV_AMULET_RESISTANCE))
            || ((tval == TV_RING) && (o_ptr->sval == SV_RING_LORDLY))
            || ((tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD))
            || ((tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM))
            || ((tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES))
            || ((tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE))
-           || o_ptr->art_name || o_ptr->name1)
+           || object_is_artifact(o_ptr))
        {
                int i = 0;
                object_desc(o_name, o_ptr, OD_NAME_ONLY);
@@ -6328,10 +6328,10 @@ static void do_cmd_knowledge_artifacts(void)
                                next_o_idx = o_ptr->next_o_idx;
 
                                /* Ignore non-artifacts */
-                               if (!artifact_p(o_ptr)) continue;
+                               if (!object_is_fixed_artifact(o_ptr)) continue;
 
                                /* Ignore known items */
-                               if (object_known_p(o_ptr)) continue;
+                               if (object_is_known(o_ptr)) continue;
 
                                /* Note the artifact */
                                okay[o_ptr->name1] = FALSE;
@@ -6348,10 +6348,10 @@ static void do_cmd_knowledge_artifacts(void)
                if (!o_ptr->k_idx) continue;
 
                /* Ignore non-artifacts */
-               if (!artifact_p(o_ptr)) continue;
+               if (!object_is_fixed_artifact(o_ptr)) continue;
 
                /* Ignore known items */
-               if (object_known_p(o_ptr)) continue;
+               if (object_is_known(o_ptr)) continue;
 
                /* Note the artifact */
                okay[o_ptr->name1] = FALSE;
index e31177f..b7af32b 100644 (file)
@@ -378,7 +378,7 @@ static void do_cmd_eat_food_aux(int item)
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       if (!(object_aware_p(o_ptr)))
+       if (!(object_is_aware(o_ptr)))
        {
                chg_virtue(V_KNOWLEDGE, -1);
                chg_virtue(V_PATIENCE, -1);
@@ -389,7 +389,7 @@ static void do_cmd_eat_food_aux(int item)
        if (o_ptr->tval == TV_FOOD) object_tried(o_ptr);
 
        /* The player is now aware of the object */
-       if (ident && !object_aware_p(o_ptr))
+       if (ident && !object_is_aware(o_ptr))
        {
                object_aware(o_ptr);
                gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
@@ -1433,7 +1433,7 @@ msg_print("
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       if (!(object_aware_p(o_ptr)))
+       if (!(object_is_aware(o_ptr)))
        {
                chg_virtue(V_PATIENCE, -1);
                chg_virtue(V_CHANCE, 1);
@@ -1444,7 +1444,7 @@ msg_print("
        object_tried(q_ptr);
 
        /* An identification was made */
-       if (ident && !object_aware_p(q_ptr))
+       if (ident && !object_is_aware(q_ptr))
        {
                object_aware(q_ptr);
                gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
@@ -2192,7 +2192,7 @@ msg_print("
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       if (!(object_aware_p(o_ptr)))
+       if (!(object_is_aware(o_ptr)))
        {
                chg_virtue(V_PATIENCE, -1);
                chg_virtue(V_CHANCE, 1);
@@ -2203,7 +2203,7 @@ msg_print("
        object_tried(o_ptr);
 
        /* An identification was made */
-       if (ident && !object_aware_p(o_ptr))
+       if (ident && !object_is_aware(o_ptr))
        {
                object_aware(o_ptr);
                gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
@@ -2322,7 +2322,7 @@ void do_cmd_read_scroll(void)
        }
 
        /* Read the scroll */
-       do_cmd_read_scroll_aux(item, object_aware_p(o_ptr));
+       do_cmd_read_scroll_aux(item, object_is_aware(o_ptr));
 }
 
 
@@ -2789,9 +2789,9 @@ static void do_cmd_use_staff_aux(int item)
        /* Sound */
        sound(SOUND_ZAP);
 
-       ident = staff_effect(o_ptr->sval, &use_charge, FALSE, object_aware_p(o_ptr));
+       ident = staff_effect(o_ptr->sval, &use_charge, FALSE, object_is_aware(o_ptr));
 
-       if (!(object_aware_p(o_ptr)))
+       if (!(object_is_aware(o_ptr)))
        {
                chg_virtue(V_PATIENCE, -1);
                chg_virtue(V_CHANCE, 1);
@@ -2805,7 +2805,7 @@ static void do_cmd_use_staff_aux(int item)
        object_tried(o_ptr);
 
        /* An identification was made */
-       if (ident && !object_aware_p(o_ptr))
+       if (ident && !object_is_aware(o_ptr))
        {
                object_aware(o_ptr);
                gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
@@ -3241,7 +3241,7 @@ static void do_cmd_aim_wand_aux(int item)
 
 
        /* Allow direction to be cancelled for free */
-       if (object_aware_p(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
+       if (object_is_aware(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
                                      || o_ptr->sval == SV_WAND_HASTE_MONSTER))
                        target_pet = TRUE;
        if (!get_aim_dir(&dir))
@@ -3327,7 +3327,7 @@ static void do_cmd_aim_wand_aux(int item)
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       if (!(object_aware_p(o_ptr)))
+       if (!(object_is_aware(o_ptr)))
        {
                chg_virtue(V_PATIENCE, -1);
                chg_virtue(V_CHANCE, 1);
@@ -3338,7 +3338,7 @@ static void do_cmd_aim_wand_aux(int item)
        object_tried(o_ptr);
 
        /* Apply identification */
-       if (ident && !object_aware_p(o_ptr))
+       if (ident && !object_is_aware(o_ptr))
        {
                object_aware(o_ptr);
                gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
@@ -3681,7 +3681,7 @@ static void do_cmd_zap_rod_aux(int item)
 
        /* Get a direction (unless KNOWN not to need it) */
        if (((o_ptr->sval >= SV_ROD_MIN_DIRECTION) && (o_ptr->sval != SV_ROD_HAVOC) && (o_ptr->sval != SV_ROD_AGGRAVATE) && (o_ptr->sval != SV_ROD_PESTICIDE)) ||
-            !object_aware_p(o_ptr))
+            !object_is_aware(o_ptr))
        {
                /* Get a direction, allow cancel */
                if (!get_aim_dir(&dir)) return;
@@ -3783,7 +3783,7 @@ msg_print("
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       if (!(object_aware_p(o_ptr)))
+       if (!(object_is_aware(o_ptr)))
        {
                chg_virtue(V_PATIENCE, -1);
                chg_virtue(V_CHANCE, 1);
@@ -3794,7 +3794,7 @@ msg_print("
        object_tried(o_ptr);
 
        /* Successfully determined the object function */
-       if (ident && !object_aware_p(o_ptr))
+       if (ident && !object_is_aware(o_ptr))
        {
                object_aware(o_ptr);
                gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
@@ -3842,7 +3842,7 @@ static bool item_tester_hook_activate(object_type *o_ptr)
        u32b flgs[TR_FLAG_SIZE];
 
        /* Not known */
-       if (!object_known_p(o_ptr)) return (FALSE);
+       if (!object_is_known(o_ptr)) return (FALSE);
 
        /* Extract the flags */
        object_flags(o_ptr, flgs);
@@ -3997,7 +3997,7 @@ static void do_cmd_activate_aux(int item)
        lev = k_info[o_ptr->k_idx].level;
 
        /* Hack -- use artifact level instead */
-       if (artifact_p(o_ptr)) lev = a_info[o_ptr->name1].level;
+       if (object_is_fixed_artifact(o_ptr)) lev = a_info[o_ptr->name1].level;
        else if (o_ptr->art_name)
        {
                switch (o_ptr->xtra2)
@@ -4186,7 +4186,7 @@ static void do_cmd_activate_aux(int item)
        }
 
        /* Artifacts */
-       else if (o_ptr->name1)
+       else if (object_is_fixed_artifact(o_ptr))
        {
                /* Choose effect */
                switch (o_ptr->name1)
@@ -5818,7 +5818,7 @@ msg_print("
                return;
        }
 
-       if (item_tester_hook_smith(o_ptr))
+       if (object_is_smith(o_ptr))
        {
                switch (o_ptr->xtra3-1)
                {
@@ -6138,7 +6138,7 @@ msg_print("
 
        else if (o_ptr->tval == TV_RING)
        {
-               if (o_ptr->name2)
+               if (object_is_ego(o_ptr))
                {
                        bool success = TRUE;
 
@@ -6313,7 +6313,7 @@ msg_print("
 
        else if (o_ptr->tval == TV_AMULET)
        {
-               if (o_ptr->name2)
+               if (object_is_ego(o_ptr))
                {
                        switch (o_ptr->name2)
                        {
@@ -6366,7 +6366,7 @@ msg_print("
        else if (o_ptr->tval == TV_WHISTLE)
        {
 #if 0
-               if (cursed_p(o_ptr))
+               if (object_is_cursed(o_ptr))
                {
 #ifdef JP
                        msg_print("¥«¥ó¹â¤¤²»¤¬¶Á¤­ÅϤä¿¡£");
@@ -6624,7 +6624,7 @@ static bool item_tester_hook_use(object_type *o_ptr)
                        int i;
 
                        /* Not known */
-                       if (!object_known_p(o_ptr)) return (FALSE);
+                       if (!object_is_known(o_ptr)) return (FALSE);
 
                        /* HACK - only items from the equipment can be activated */
                        for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
index eeed379..754a599 100644 (file)
 #define term_screen     (angband_term[0])
 
 
-#ifndef SCRIPT_OBJ_KIND
 /*
  * Determine if a given inventory item is "aware"
  */
-#define object_aware_p(T) \
+#define object_is_aware(T) \
     (k_info[(T)->k_idx].aware)
 
 /*
  * Determine if a given inventory item is "tried"
  */
-#define object_tried_p(T) \
+#define object_is_tried(T) \
     (k_info[(T)->k_idx].tried)
 
 
  * Test One -- Check for special "known" tag
  * Test Two -- Check for "Easy Know" + "Aware"
  */
-#define object_known_p(T) \
+#define object_is_known(T) \
     (((T)->ident & (IDENT_KNOWN)) || \
      (k_info[(T)->k_idx].easy_know && k_info[(T)->k_idx].aware))
 
         (k_info[(T)->k_idx].x_char))
 
 
-#else /* SCRIPT_OBJ_KIND */
-
-
-/*
- * Determine if a given inventory item is "aware"
- */
-#define object_aware_p(T) \
-    ((T)->aware)
-
-/*
- * Determine if a given inventory item is "tried"
- */
-#define object_tried_p(T) \
-    ((T)->tried)
-
-
-/*
- * Determine if a given inventory item is "known"
- * Test One -- Check for special "known" tag
- * Test Two -- Check for "Easy Know" + "Aware"
- */
-#define object_known_p(T) \
-    (((T)->ident & (IDENT_KNOWN)) || \
-     ((T)->easy_know && (T)->aware))
-
-
-/*
- * Return the "attr" for a given item.
- * Use "flavor" if available.
- * Default to user definitions.
- */
-#define object_attr(T) \
-       (((T)->flavor) ? \
-        (misc_to_attr[(T)->flavor]) : \
-        ((T)->x_attr))
-
-/*
- * Return the "char" for a given item.
- * Use "flavor" if available.
- * Default to user definitions.
- */
-#define object_char(T) \
-       (((T)->flavor) ? \
-        (misc_to_char[(T)->flavor]) : \
-        ((T)->x_char))
-
-#endif /* SCRIPT_OBJ_KIND */
-
-
-
-
 /*
  * Artifacts use the "name1" field
  */
-#define artifact_p(T) \
+#define object_is_fixed_artifact(T) \
        ((T)->name1 ? TRUE : FALSE)
 
 /*
  * Ego-Items use the "name2" field
  */
-#define ego_item_p(T) \
+#define object_is_ego(T) \
        ((T)->name2 ? TRUE : FALSE)
 
 
 /*
  * Broken items.
  */
-#define broken_p(T) \
+#define object_is_broken(T) \
        ((T)->ident & (IDENT_BROKEN))
 
 /*
  * Cursed items.
  */
-#define cursed_p(T) \
+#define object_is_cursed(T) \
        ((T)->curse_flags)
 
 
index 650194b..46591e9 100644 (file)
@@ -24,30 +24,30 @@ static int wild_regen = 20;
 static byte value_check_aux1(object_type *o_ptr)
 {
        /* Artifacts */
-       if (artifact_p(o_ptr) || o_ptr->art_name)
+       if (object_is_artifact(o_ptr))
        {
                /* Cursed/Broken */
-               if (cursed_p(o_ptr) || broken_p(o_ptr)) return FEEL_TERRIBLE;
+               if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) return FEEL_TERRIBLE;
 
                /* Normal */
                return FEEL_SPECIAL;
        }
 
        /* Ego-Items */
-       if (ego_item_p(o_ptr))
+       if (object_is_ego(o_ptr))
        {
                /* Cursed/Broken */
-               if (cursed_p(o_ptr) || broken_p(o_ptr)) return FEEL_WORTHLESS;
+               if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) return FEEL_WORTHLESS;
 
                /* Normal */
                return FEEL_EXCELLENT;
        }
 
        /* Cursed items */
-       if (cursed_p(o_ptr)) return FEEL_CURSED;
+       if (object_is_cursed(o_ptr)) return FEEL_CURSED;
 
        /* Broken items */
-       if (broken_p(o_ptr)) return FEEL_BROKEN;
+       if (object_is_broken(o_ptr)) return FEEL_BROKEN;
 
        if ((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) return FEEL_AVERAGE;
 
@@ -68,16 +68,16 @@ static byte value_check_aux1(object_type *o_ptr)
 static byte value_check_aux2(object_type *o_ptr)
 {
        /* Cursed items (all of them) */
-       if (cursed_p(o_ptr)) return FEEL_CURSED;
+       if (object_is_cursed(o_ptr)) return FEEL_CURSED;
 
        /* Broken items (all of them) */
-       if (broken_p(o_ptr)) return FEEL_BROKEN;
+       if (object_is_broken(o_ptr)) return FEEL_BROKEN;
 
        /* Artifacts -- except cursed/broken ones */
-       if (artifact_p(o_ptr) || o_ptr->art_name) return FEEL_UNCURSED;
+       if (object_is_artifact(o_ptr)) return FEEL_UNCURSED;
 
        /* Ego-Items -- except cursed/broken ones */
-       if (ego_item_p(o_ptr)) return FEEL_UNCURSED;
+       if (object_is_ego(o_ptr)) return FEEL_UNCURSED;
 
        /* Good armor bonus */
        if (o_ptr->to_a > 0) return FEEL_UNCURSED;
@@ -101,7 +101,7 @@ static void sense_inventory_aux(int slot, bool heavy)
        if (o_ptr->ident & (IDENT_SENSE))return;
 
        /* It is fully known, no information needed */
-       if (object_known_p(o_ptr)) return;
+       if (object_is_known(o_ptr)) return;
 
        /* Check for a feeling */
        feel = (heavy ? value_check_aux1(o_ptr) : value_check_aux2(o_ptr));
@@ -1581,7 +1581,7 @@ s = "Ĵ
        }
 
        /* It is fully known, no information needed */
-       if (object_known_p(o_ptr))
+       if (object_is_known(o_ptr))
        {
 #ifdef JP
 msg_print("²¿¤â¿·¤·¤¤¤³¤È¤ÏȽ¤é¤Ê¤«¤Ã¤¿¡£");
@@ -2632,7 +2632,7 @@ static void process_world_aux_light(void)
        if (o_ptr->tval == TV_LITE)
        {
                /* Hack -- Use some fuel (except on artifacts) */
-               if (!(artifact_p(o_ptr) || o_ptr->sval == SV_LITE_FEANOR) && (o_ptr->xtra4 > 0))
+               if (!(object_is_fixed_artifact(o_ptr) || o_ptr->sval == SV_LITE_FEANOR) && (o_ptr->xtra4 > 0))
                {
                        /* Decrease life-span */
                        if (o_ptr->name2 == EGO_LITE_LONG)
@@ -2922,7 +2922,7 @@ static void process_world_aux_mutation(void)
                if (o_ptr->tval == TV_LITE)
                {
                        /* Use some fuel (except on artifacts) */
-                       if (!artifact_p(o_ptr) && (o_ptr->xtra4 > 0))
+                       if (!object_is_fixed_artifact(o_ptr) && (o_ptr->xtra4 > 0))
                        {
                                /* Heal the player a bit */
                                hp_player(o_ptr->xtra4 / 20);
@@ -3266,7 +3266,7 @@ static void process_world_aux_mutation(void)
                                o_ptr = &inventory[INVEN_LARM];
                                slot = INVEN_LARM;
                        }
-                       if (!cursed_p(o_ptr))
+                       if (!object_is_cursed(o_ptr))
                        {
 #ifdef JP
                                msg_print("Éð´ï¤òÍ¤Æ¤·¤Þ¤Ã¤¿¡ª");
@@ -3539,13 +3539,13 @@ static void process_world_aux_curse(void)
                if (o_ptr->name1 == ART_JUDGE)
                {
 #ifdef JP
-                       if (object_known_p(o_ptr))
+                       if (object_is_known(o_ptr))
                                msg_print("¡Ø¿³È½¤ÎÊõÀС٤Ϥ¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª");
                        else
                                msg_print("¤Ê¤Ë¤«¤¬¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª");
                        take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "¿³È½¤ÎÊõÀÐ", -1);
 #else
-                       if (object_known_p(o_ptr))
+                       if (object_is_known(o_ptr))
                                msg_print("The Jewel of Judgement drains life from you!");
                        else
                                msg_print("Something drains life from you!");
index 3bc622a..773beee 100644 (file)
@@ -5433,12 +5433,12 @@ void calc_android_exp(void)
                q_ptr->discount = 0;
                q_ptr->curse_flags = 0L;
 
-               if (o_ptr->name1)
+               if (object_is_fixed_artifact(o_ptr))
                {
                        level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
                        level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
                }
-               else if (o_ptr->name2)
+               else if (object_is_ego(o_ptr))
                {
                        level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
                }
@@ -5447,7 +5447,7 @@ void calc_android_exp(void)
                        s32b total_flags = flag_cost(o_ptr, o_ptr->pval);
                        int fake_level;
 
-                       if (o_ptr->tval >= TV_ARMOR_BEGIN)
+                       if (!object_is_weapon_ammo(o_ptr))
                        {
                                /* For armors */
                                if (total_flags < 15000) fake_level = 10;
@@ -5472,7 +5472,7 @@ void calc_android_exp(void)
                if (value > 5000000L) value = 5000000L;
                if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
 
-               if (o_ptr->name1 || o_ptr->name2 || o_ptr->art_name ||
+               if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) ||
                    (o_ptr->tval == TV_DRAG_ARMOR) ||
                    ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
                    ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
index 3295d60..24bd2b2 100644 (file)
@@ -991,7 +991,6 @@ extern void reorder_pack(void);
 extern void display_koff(int k_idx);
 extern object_type *choose_warning_item(void);
 extern bool process_warning(int xx, int yy);
-extern bool item_tester_hook_smith(object_type *o_ptr);
 extern void do_cmd_kaji(bool only_browse);
 
 /* racial.c */
@@ -1150,9 +1149,6 @@ extern void identify_pack(void);
 extern bool remove_curse(void);
 extern bool remove_all_curse(void);
 extern bool alchemy(void);
-extern bool item_tester_hook_weapon(object_type *o_ptr);
-extern bool item_tester_hook_armour(object_type *o_ptr);
-extern bool item_tester_hook_weapon_armour(object_type *o_ptr);
 extern bool enchant(object_type *o_ptr, int n, int eflag);
 extern bool enchant_spell(int num_hit, int num_dam, int num_ac);
 extern bool artifact_scroll(void);
@@ -1561,6 +1557,23 @@ extern bool easy_floor;
 /* obj_kind.c */
 extern bool object_is_potion(object_type *o_ptr);
 extern bool object_is_shoukinkubi(object_type *o_ptr);
+extern bool object_is_favorite(object_type *o_ptr);
+extern bool object_is_rare(object_type *o_ptr);
+extern bool object_is_weapon(object_type *o_ptr);
+extern bool object_is_weapon_ammo(object_type *o_ptr);
+extern bool object_is_ammo(object_type *o_ptr);
+extern bool object_is_armour(object_type *o_ptr);
+extern bool object_is_weapon_armour_ammo(object_type *o_ptr);
+extern bool object_is_weapon_armour_ammo(object_type *o_ptr);
+extern bool object_is_melee_weapon(object_type *o_ptr);
+extern bool object_is_wearable(object_type *o_ptr);
+extern bool object_is_equipment(object_type *o_ptr);
+extern bool object_refuse_enchant_weapon(object_type *o_ptr);
+extern bool object_allow_enchant_weapon(object_type *o_ptr);
+extern bool object_allow_enchant_melee_weapon(object_type *o_ptr);
+extern bool object_is_smith(object_type *o_ptr);
+extern bool object_is_artifact(object_type *o_ptr);
+extern bool object_is_nameless(object_type *o_ptr);
 
 /* wild.c */
 extern void set_floor_and_wall(byte type);
index ba77c0a..f2bbf11 100644 (file)
@@ -1711,8 +1711,8 @@ static void display_player_middle(void)
                o_ptr = &inventory[INVEN_RARM];
 
                /* Hack -- add in weapon info if known */
-               if (object_known_p(o_ptr)) show_tohit += o_ptr->to_h;
-               if (object_known_p(o_ptr)) show_todam += o_ptr->to_d;
+               if (object_is_known(o_ptr)) show_tohit += o_ptr->to_h;
+               if (object_is_known(o_ptr)) show_todam += o_ptr->to_d;
 
                /* Melee attacks */
                sprintf(buf, "(%+d,%+d)", show_tohit, show_todam);
@@ -1736,8 +1736,8 @@ static void display_player_middle(void)
                o_ptr = &inventory[INVEN_LARM];
 
                /* Hack -- add in weapon info if known */
-               if (object_known_p(o_ptr)) show_tohit += o_ptr->to_h;
-               if (object_known_p(o_ptr)) show_todam += o_ptr->to_d;
+               if (object_is_known(o_ptr)) show_tohit += o_ptr->to_h;
+               if (object_is_known(o_ptr)) show_todam += o_ptr->to_d;
 
                /* Melee attacks */
                sprintf(buf, "(%+d,%+d)", show_tohit, show_todam);
@@ -1780,8 +1780,8 @@ static void display_player_middle(void)
        show_todam = 0;
 
        /* Apply weapon bonuses */
-       if (object_known_p(o_ptr)) show_tohit += o_ptr->to_h;
-       if (object_known_p(o_ptr)) show_todam += o_ptr->to_d;
+       if (object_is_known(o_ptr)) show_tohit += o_ptr->to_h;
+       if (object_is_known(o_ptr)) show_todam += o_ptr->to_d;
 
        if ((o_ptr->sval == SV_LIGHT_XBOW) || (o_ptr->sval == SV_HEAVY_XBOW))
                show_tohit += p_ptr->weapon_exp[0][o_ptr->sval] / 400;
@@ -2155,7 +2155,7 @@ static void display_player_various(void)
                        /* Average damage per round */
                        if (o_ptr->k_idx)
                        {
-                               if (object_known_p(o_ptr)) damage[i] += o_ptr->to_d * 100;
+                               if (object_is_known(o_ptr)) damage[i] += o_ptr->to_d * 100;
                                basedam = ((o_ptr->dd + p_ptr->to_dd[i]) * (o_ptr->ds + p_ptr->to_ds[i] + 1)) * 50;
                                object_flags_known(o_ptr, flgs);
                                if ((o_ptr->ident & IDENT_MENTAL) && ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)))
index 43d9174..916bf6b 100644 (file)
@@ -1414,7 +1414,7 @@ static char *get_ability_abbreviation(char *ptr, object_type *o_ptr, bool kanji,
                for (j = 0; j < TR_FLAG_SIZE; j++)
                        flgs[j] &= ~k_ptr->flags[j];
 
-               if (o_ptr->name1)
+               if (object_is_fixed_artifact(o_ptr))
                {
                        artifact_type *a_ptr = &a_info[o_ptr->name1];
                                        
@@ -1422,7 +1422,7 @@ static char *get_ability_abbreviation(char *ptr, object_type *o_ptr, bool kanji,
                                flgs[j] &= ~a_ptr->flags[j];
                }
 
-               if (o_ptr->name2)
+               if (object_is_ego(o_ptr))
                {
                        ego_item_type *e_ptr = &e_info[o_ptr->name2];
                                        
@@ -1695,10 +1695,10 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
        object_flags(o_ptr, flgs);
 
        /* See if the object is "aware" */
-       if (object_aware_p(o_ptr)) aware = TRUE;
+       if (object_is_aware(o_ptr)) aware = TRUE;
 
        /* See if the object is "known" */
-       if (object_known_p(o_ptr)) known = TRUE;
+       if (object_is_known(o_ptr)) known = TRUE;
 
        /* Allow flavors to be hidden when aware */
        if (aware && ((mode & OD_NO_FLAVOR) || plain_descriptions)) flavor = FALSE;
@@ -1858,7 +1858,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
                        /* Known artifacts */
                        if (aware)
                        {
-                               if (artifact_p(o_ptr)) break;
+                               if (object_is_fixed_artifact(o_ptr)) break;
                                if (k_ptr->gen_flags & TRG_INSTA_ART) break;
                        }
 
@@ -1884,7 +1884,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
                        /* Known artifacts */
                        if (aware)
                        {
-                               if (artifact_p(o_ptr)) break;
+                               if (object_is_fixed_artifact(o_ptr)) break;
                                if (k_ptr->gen_flags & TRG_INSTA_ART) break;
                        }
 
@@ -2247,7 +2247,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
         */
        if (known)
        {
-               if (artifact_p(o_ptr)) t = object_desc_str(t, "¡ú");
+               if (object_is_fixed_artifact(o_ptr)) t = object_desc_str(t, "¡ú");
                else if (o_ptr->art_name) t = object_desc_str(t, "¡ù");
        }
 
@@ -2279,7 +2279,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
                }
 
                /* Hack -- The only one of its kind */
-               else if (known && (artifact_p(o_ptr) || o_ptr->art_name))
+               else if (known && object_is_artifact(o_ptr))
                {
                        t = object_desc_str(t, "The ");
                }
@@ -2346,7 +2346,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
                }
 
                /* Hack -- The only one of its kind */
-               else if (known && (artifact_p(o_ptr) || o_ptr->art_name))
+               else if (known && object_is_artifact(o_ptr))
                {
                        t = object_desc_str(t, "The ");
                }
@@ -2363,7 +2363,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
        /* while (*s == '~') s++; */
 
 #ifdef JP
-       if (item_tester_hook_smith(o_ptr))
+       if (object_is_smith(o_ptr))
        {
                t = object_desc_str(t, format("ÃÃÌê»Õ%s¤Î", player_name));
        }
@@ -2397,7 +2397,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
                        }
                }
                /* Ì¾¤Î¤¢¤ë¥¢¥¤¥Æ¥à */
-               else if (o_ptr->name2)
+               else if (object_is_ego(o_ptr))
                {
                        ego_item_type *e_ptr = &e_info[o_ptr->name2];
                        t = object_desc_str(t, e_name + e_ptr->name);
@@ -2480,7 +2480,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
                                t = object_desc_str(t, "¡Ù");
                        }
                }
-               else if (o_ptr->name1)
+               else if (object_is_fixed_artifact(o_ptr))
                {
                        artifact_type *a_ptr = &a_info[o_ptr->name1];
                        if (strncmp(a_name + a_ptr->name, "¡Ø", 2) == 0)
@@ -2515,7 +2515,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
                }
        }
 #else
-       if (item_tester_hook_smith(o_ptr))
+       if (object_is_smith(o_ptr))
        {
                t = object_desc_str(t,format(" of %s the Smith",player_name));
        }
@@ -2531,7 +2531,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
                }
 
                /* Grab any artifact name */
-               else if (o_ptr->name1)
+               else if (object_is_fixed_artifact(o_ptr))
                {
                        artifact_type *a_ptr = &a_info[o_ptr->name1];
 
@@ -2542,7 +2542,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
                /* Grab any ego-item name */
                else
                {
-                       if (o_ptr->name2)
+                       if (object_is_ego(o_ptr))
                        {
                                ego_item_type *e_ptr = &e_info[o_ptr->name2];
 
@@ -2715,7 +2715,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
        if (have_flag(flgs, TR_SHOW_MODS)) show_weapon = TRUE;
 
        /* Display the item like a weapon */
-       if (item_tester_hook_smith(o_ptr) && (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE))
+       if (object_is_smith(o_ptr) && (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE))
                show_weapon = TRUE;
 
        /* Display the item like a weapon */
@@ -2813,7 +2813,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
                s16b energy_fire = bow_energy(bow_ptr->sval);
 
                /* See if the bow is "known" - then set damage bonus */
-               if (object_known_p(bow_ptr)) avgdam += (bow_ptr->to_d * 10);
+               if (object_is_known(bow_ptr)) avgdam += (bow_ptr->to_d * 10);
 
                /* Effect of ammo */
                if (known) avgdam += (o_ptr->to_d * 10);
@@ -3057,7 +3057,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
                }
 
                /* Hack -- Process Lanterns/Torches */
-               if ((o_ptr->tval == TV_LITE) && (!(artifact_p(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR))))
+               if ((o_ptr->tval == TV_LITE) && (!(object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR))))
                {
                        /* Hack -- Turns of light for normal lites */
 #ifdef JP
@@ -3138,7 +3138,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
        }
 
        /* Note "cursed" if the item is known to be cursed */
-       else if (cursed_p(o_ptr) && (known || (o_ptr->ident & IDENT_SENSE)))
+       else if (object_is_cursed(o_ptr) && (known || (o_ptr->ident & IDENT_SENSE)))
        {
 #ifdef JP
                strcpy(fake_insc_buf, "¼ö¤ï¤ì¤Æ¤¤¤ë");
@@ -3171,7 +3171,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
        }
 
        /* Note "tried" if the object has been tested unsuccessfully */
-       else if (!aware && object_tried_p(o_ptr))
+       else if (!aware && object_is_tried(o_ptr))
        {
 #ifdef JP
                strcpy(fake_insc_buf, "̤ȽÌÀ");
index d3494ea..4eb2e56 100644 (file)
@@ -647,7 +647,7 @@ static void update_unique_artifact(s16b cur_floor_id)
                if (!o_ptr->k_idx) continue;
 
                /* Memorize location of the artifact */
-               if (artifact_p(o_ptr))
+               if (object_is_fixed_artifact(o_ptr))
                {
                        a_info[o_ptr->name1].floor_id = cur_floor_id;
                }
@@ -912,7 +912,7 @@ void leave_floor(void)
                if (!o_ptr->k_idx) continue;
 
                /* Delete old memorized location of the artifact */
-               if (artifact_p(o_ptr))
+               if (object_is_fixed_artifact(o_ptr))
                {
                        a_info[o_ptr->name1].floor_id = 0;
                }
@@ -1241,7 +1241,7 @@ void change_floor(void)
                                if (!o_ptr->k_idx) continue;
 
                                /* Ignore non-artifact */
-                               if (!artifact_p(o_ptr)) continue;
+                               if (!object_is_fixed_artifact(o_ptr)) continue;
 
                                /* Appear at a different floor? */
                                if (a_info[o_ptr->name1].floor_id != new_floor_id)
index a330d33..3b119a8 100644 (file)
@@ -363,13 +363,13 @@ static void rd_item_old(object_type *o_ptr)
                        o_ptr->curse_flags |= TRC_CURSED;
                        if (o_ptr->art_flags[2] & 0x40000000L) o_ptr->curse_flags |= TRC_HEAVY_CURSE;
                        if (o_ptr->art_flags[2] & 0x80000000L) o_ptr->curse_flags |= TRC_PERMA_CURSE;
-                       if (o_ptr->name1)
+                       if (object_is_fixed_artifact(o_ptr))
                        {
                                artifact_type *a_ptr = &a_info[o_ptr->name1];
                                if (a_ptr->gen_flags & (TRG_HEAVY_CURSE)) o_ptr->curse_flags |= TRC_HEAVY_CURSE;
                                if (a_ptr->gen_flags & (TRG_PERMA_CURSE)) o_ptr->curse_flags |= TRC_PERMA_CURSE;
                        }
-                       else if (o_ptr->name2)
+                       else if (object_is_ego(o_ptr))
                        {
                                ego_item_type *e_ptr = &e_info[o_ptr->name2];
                                if (e_ptr->gen_flags & (TRG_HEAVY_CURSE)) o_ptr->curse_flags |= TRC_HEAVY_CURSE;
@@ -469,7 +469,7 @@ static void rd_item_old(object_type *o_ptr)
                rd_byte(&o_ptr->xtra3);
                if (h_older_than(1, 3, 0, 1))
                {
-                       if (item_tester_hook_smith(o_ptr) && o_ptr->xtra3 >= 1+96)
+                       if (object_is_smith(o_ptr) && o_ptr->xtra3 >= 1+96)
                                o_ptr->xtra3 += -96 + MIN_SPECIAL_ESSENCE;
                }
 
@@ -517,7 +517,7 @@ static void rd_item_old(object_type *o_ptr)
        }
 
        /* Paranoia */
-       if (o_ptr->name1)
+       if (object_is_fixed_artifact(o_ptr))
        {
                artifact_type *a_ptr;
 
@@ -529,7 +529,7 @@ static void rd_item_old(object_type *o_ptr)
        }
 
        /* Paranoia */
-       if (o_ptr->name2)
+       if (object_is_ego(o_ptr))
        {
                ego_item_type *e_ptr;
 
@@ -1088,16 +1088,16 @@ static void home_carry(store_type *st_ptr, object_type *o_ptr)
                if (o_ptr->tval < j_ptr->tval) continue;
 
                /* Can happen in the home */
-               if (!object_aware_p(o_ptr)) continue;
-               if (!object_aware_p(j_ptr)) break;
+               if (!object_is_aware(o_ptr)) continue;
+               if (!object_is_aware(j_ptr)) break;
 
                /* Objects sort by increasing sval */
                if (o_ptr->sval < j_ptr->sval) break;
                if (o_ptr->sval > j_ptr->sval) continue;
 
                /* Objects in the home can be unknown */
-               if (!object_known_p(o_ptr)) continue;
-               if (!object_known_p(j_ptr)) break;
+               if (!object_is_known(o_ptr)) continue;
+               if (!object_is_known(j_ptr)) break;
 
                /*
                 * Hack:  otherwise identical rods sort by
index 1949da5..09457b9 100644 (file)
@@ -992,7 +992,7 @@ bool make_attack_normal(int m_idx)
                                                if (!o_ptr->k_idx) continue;
 
                                                /* Skip artifacts */
-                                               if (artifact_p(o_ptr) || o_ptr->art_name) continue;
+                                               if (object_is_artifact(o_ptr)) continue;
 
                                                /* Get a description */
                                                object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
@@ -1130,7 +1130,7 @@ bool make_attack_normal(int m_idx)
                                        if (p_ptr->is_dead) break;
 
                                        /* Drain fuel */
-                                       if ((o_ptr->xtra4 > 0) && (!artifact_p(o_ptr)))
+                                       if ((o_ptr->xtra4 > 0) && (!object_is_fixed_artifact(o_ptr)))
                                        {
                                                /* Reduce fuel */
                                                o_ptr->xtra4 -= (250 + randint1(250));
index a7eac17..c47804b 100644 (file)
@@ -3394,8 +3394,7 @@ msg_format("%^s%s", m_name, monmessage);
                                        if (have_flag(flgs, TR_KILL_HUMAN))  flg2 |= (RF2_HUMAN);
 
                                        /* The object cannot be picked up by the monster */
-                                       if (artifact_p(o_ptr) || (r_ptr->flags3 & flg3) || (r_ptr->flags2 & flg2) ||
-                                               (o_ptr->art_name))
+                                       if (object_is_artifact(o_ptr) || (r_ptr->flags3 & flg3) || (r_ptr->flags2 & flg2))
                                        {
                                                /* Only give a message for "take_item" */
                                                if ((r_ptr->flags2 & (RF2_TAKE_ITEM)) && (r_ptr->flags2 & (RF2_STUPID)))
index 43f0904..5d0c9e2 100644 (file)
@@ -558,8 +558,8 @@ u32b get_curse(int power, object_type *o_ptr)
                {
                        if (new_curse & TRC_HEAVY_MASK) continue;
                }
-               if (((o_ptr->tval < TV_WEAPON_BEGIN) || (o_ptr->tval > TV_WEAPON_END)) && (new_curse == TRC_LOW_MELEE)) continue;
-               if (((o_ptr->tval < TV_ARMOR_BEGIN) || (o_ptr->tval > TV_ARMOR_END)) && (new_curse == TRC_LOW_AC)) continue;
+               if (new_curse == TRC_LOW_MELEE && !object_is_weapon(o_ptr)) continue;
+               if (new_curse == TRC_LOW_AC && !object_is_armour(o_ptr)) continue;
                break;
        }
        return new_curse;
@@ -597,7 +597,7 @@ msg_format("%s
        }
 
        if ((randint1(100) <= heavy_chance) &&
-               (o_ptr->name1 || o_ptr->name2 || o_ptr->art_name))
+           (object_is_artifact(o_ptr) || object_is_ego(o_ptr)))
        {
                if (!(o_ptr->curse_flags & TRC_HEAVY_CURSE))
                        changed = TRUE;
@@ -607,7 +607,7 @@ msg_format("%s
        }
        else
        {
-               if (!cursed_p(o_ptr))
+               if (!object_is_cursed(o_ptr))
                        changed = TRUE;
                o_ptr->curse_flags |= TRC_CURSED;
        }
@@ -3439,7 +3439,7 @@ msg_format("%^s
                                for (i=INVEN_RARM;i<INVEN_TOTAL;i++)
                                {
                                        o_ptr = &inventory[i];
-                                       if (!cursed_p(o_ptr))
+                                       if (!object_is_cursed(o_ptr))
                                        {
                                                object_flags(o_ptr, flgs);
 
index 9839f78..1cba83c 100644 (file)
@@ -3080,7 +3080,7 @@ bool monst_spell_monst(int m_idx)
                                u32b flgs[TR_FLAG_SIZE];
                                object_type *o_ptr = &inventory[i];
 
-                               if (cursed_p(o_ptr)) continue;
+                               if (object_is_cursed(o_ptr)) continue;
 
                                object_flags(o_ptr, flgs);
 
index a4bdc09..60c64d8 100644 (file)
@@ -3561,7 +3561,7 @@ bool mutation_power_aux(u32b power)
                                        object_type *o_ptr = &inventory[i];
 
                                        if (!o_ptr->k_idx) continue;
-                                       if (!cursed_p(o_ptr)) continue;
+                                       if (!object_is_cursed(o_ptr)) continue;
 
                                        o_ptr->feeling = FEEL_CURSED;
                                }
index c25e866..6312614 100644 (file)
@@ -12,13 +12,308 @@ bool object_is_potion(object_type *o_ptr)
 bool object_is_shoukinkubi(object_type *o_ptr)
 {
        int i;
+
+       /* Require corpse or skeleton */
+       if (o_ptr->tval != TV_CORPSE) return FALSE;
+
+       /* No wanted monsters in vanilla town */
        if (vanilla_town) return FALSE;
+
+       /* Today's wanted */
        if (p_ptr->today_mon > 0 && o_ptr->pval == p_ptr->today_mon) return TRUE;
+
+       /* Tsuchinoko */
        if (o_ptr->pval == MON_TSUCHINOKO) return TRUE;
+
+       /* Unique monster */
        for (i = 0; i < MAX_KUBI; i++)
                if (o_ptr->pval == kubi_r_idx[i]) break;
        if (i < MAX_KUBI) return TRUE;
+
+       /* Not wanted */
+       return FALSE;
+}
+
+
+/*
+ * Favorite weapons
+ */
+bool object_is_favorite(object_type *o_ptr)
+{
+       /* Only melee weapons match */
+       if (!(o_ptr->tval == TV_POLEARM ||
+             o_ptr->tval == TV_SWORD ||
+             o_ptr->tval == TV_DIGGING ||
+             o_ptr->tval == TV_HAFTED))
+       {
+               return FALSE;
+       }
+
+       /* Favorite weapons are varied depend on the class */
+       switch (p_ptr->pclass)
+       {
+       case CLASS_PRIEST:
+       {
+               u32b flgs[TR_FLAG_SIZE];
+               object_flags_known(o_ptr, flgs);
+
+               if (!have_flag(flgs, TR_BLESSED) && 
+                   !(o_ptr->tval == TV_HAFTED))
+                       return FALSE;
+               break;
+       }
+
+       case CLASS_MONK:
+       case CLASS_FORCETRAINER:
+               /* Icky to wield? */
+               if (!(s_info[p_ptr->pclass].w_max[o_ptr->tval-TV_WEAPON_BEGIN][o_ptr->sval]))
+                       return FALSE;
+               break;
+
+       case CLASS_BEASTMASTER:
+       case CLASS_CAVALRY:
+       {
+               u32b flgs[TR_FLAG_SIZE];
+               object_flags_known(o_ptr, flgs);
+
+               /* Is it known to be suitable to using while riding? */
+               if (!(have_flag(flgs, TR_RIDING)))
+                       return FALSE;
+
+               break;
+       }
+
+       case CLASS_NINJA:
+               /* Icky to wield? */
+               if (s_info[p_ptr->pclass].w_max[o_ptr->tval-TV_WEAPON_BEGIN][o_ptr->sval] <= WEAPON_EXP_BEGINNER)
+                       return FALSE;
+               break;
+
+       default:
+               /* All weapons are okay for non-special classes */
+               return TRUE;
+       }
+
+       return TRUE;
+}
+
+
+/*
+ * Rare weapons/aromors
+ * including Blade of Chaos, Dragon armors, etc.
+ */
+bool object_is_rare(object_type *o_ptr)
+{
+       switch(o_ptr->tval)
+       {
+       case TV_HAFTED:
+               if (o_ptr->sval == SV_MACE_OF_DISRUPTION ||
+                   o_ptr->sval == SV_WIZSTAFF) return TRUE;
+               break;
+
+       case TV_POLEARM:
+               if (o_ptr->sval == SV_SCYTHE_OF_SLICING ||
+                   o_ptr->sval == SV_DEATH_SCYTHE) return TRUE;
+               break;
+
+       case TV_SWORD:
+               if (o_ptr->sval == SV_BLADE_OF_CHAOS ||
+                   o_ptr->sval == SV_DIAMOND_EDGE ||
+                   o_ptr->sval == SV_DOKUBARI ||
+                   o_ptr->sval == SV_HAYABUSA) return TRUE;
+               break;
+
+       case TV_SHIELD:
+               if (o_ptr->sval == SV_DRAGON_SHIELD ||
+                   o_ptr->sval == SV_MIRROR_SHIELD) return TRUE;
+               break;
+
+       case TV_HELM:
+               if (o_ptr->sval == SV_DRAGON_HELM) return TRUE;
+               break;
+
+       case TV_BOOTS:
+               if (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE) return TRUE;
+               break;
+
+       case TV_CLOAK:
+               if (o_ptr->sval == SV_ELVEN_CLOAK ||
+                   o_ptr->sval == SV_ETHEREAL_CLOAK ||
+                   o_ptr->sval == SV_SHADOW_CLOAK) return TRUE;
+               break;
+
+       case TV_GLOVES:
+               if (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES) return TRUE;
+               break;
+
+       case TV_SOFT_ARMOR:
+               if (o_ptr->sval == SV_KUROSHOUZOKU ||
+                   o_ptr->sval == SV_ABUNAI_MIZUGI) return TRUE;
+               break;
+
+       case TV_DRAG_ARMOR:
+               return TRUE;
+
+       default:
+               break;
+       }
+
+       /* Any others are not "rare" objects. */
+       return FALSE;
+}
+
+
+/*
+ * Check if an object is weapon (including bows and ammo)
+ */
+bool object_is_weapon(object_type *o_ptr)
+{
+       if (TV_WEAPON_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_WEAPON_END) return TRUE;
+
+       return FALSE;
+}
+
+
+/*
+ * Check if an object is weapon (including bows and ammo)
+ */
+bool object_is_weapon_ammo(object_type *o_ptr)
+{
+       if (TV_MISSILE_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_WEAPON_END) return TRUE;
+
+       return FALSE;
+}
+
+
+/*
+ * Check if an object is ammo
+ */
+bool object_is_ammo(object_type *o_ptr)
+{
+       if (TV_MISSILE_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_MISSILE_END) return TRUE;
+
+       return FALSE;
+}
+
+
+/*
+ * Check if an object is armour
+ */
+bool object_is_armour(object_type *o_ptr)
+{
+       if (TV_ARMOR_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_ARMOR_END) return TRUE;
+
        return FALSE;
 }
 
 
+/*
+ * Check if an object is weapon, armour or ammo
+ */
+bool object_is_weapon_armour_ammo(object_type *o_ptr)
+{
+       if (object_is_weapon_ammo(o_ptr) || object_is_armour(o_ptr)) return TRUE;
+
+       return FALSE;
+}
+
+
+/*
+ * Melee weapons
+ */
+bool object_is_melee_weapon(object_type *o_ptr)
+{
+       if (TV_DIGGING <= o_ptr->tval && o_ptr->tval <= TV_SWORD) return TRUE;
+
+       return FALSE;
+}
+
+
+/*
+ * Wearable including all weapon, all armour, bow, light source, amulet, and ring
+ */
+bool object_is_wearable(object_type *o_ptr)
+{
+       if (TV_WEARABLE_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_WEARABLE_END) return TRUE;
+
+       return FALSE;
+}
+
+
+/*
+ * Equipment including all wearable objects and ammo
+ */
+bool object_is_equipment(object_type *o_ptr)
+{
+       if (TV_EQUIP_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_EQUIP_END) return TRUE;
+
+       return FALSE;
+}
+
+
+/*
+ * Poison needle can not be enchanted
+ */
+bool object_refuse_enchant_weapon(object_type *o_ptr)
+{
+       if (o_ptr->tval == TV_SWORD && o_ptr->sval == SV_DOKUBARI) return TRUE;
+
+       return FALSE;
+}
+
+
+/*
+ * Check if an object is weapon (including bows and ammo) and allows enchantment
+ */
+bool object_allow_enchant_weapon(object_type *o_ptr)
+{
+       if (object_is_weapon_ammo(o_ptr) && !object_refuse_enchant_weapon(o_ptr)) return TRUE;
+
+       return FALSE;
+}
+
+
+/*
+ * Check if an object is melee weapon and allows enchantment
+ */
+bool object_allow_enchant_melee_weapon(object_type *o_ptr)
+{
+       if (object_is_melee_weapon(o_ptr) && !object_refuse_enchant_weapon(o_ptr)) return TRUE;
+
+       return FALSE;
+}
+
+
+/*
+ * Check if an object is made by a smith's special ability
+ */
+bool object_is_smith(object_type *o_ptr)
+{
+       if (object_is_weapon_armour_ammo(o_ptr) && o_ptr->xtra3) return TRUE;
+
+       return FALSE;
+}
+
+
+/*
+ * Check if an object is artifact
+ */
+bool object_is_artifact(object_type *o_ptr)
+{
+       if (object_is_fixed_artifact(o_ptr) || o_ptr->art_name) return TRUE;
+
+       return FALSE;
+}
+
+
+/*
+ * Check if an object is neither artifact, ego, nor 'smith' object
+ */
+bool object_is_nameless(object_type *o_ptr)
+{
+       if (!object_is_artifact(o_ptr) && !object_is_ego(o_ptr) && !object_is_smith(o_ptr))
+               return TRUE;
+
+       return FALSE;
+}
+
index dd7b325..5ee3750 100644 (file)
@@ -112,7 +112,7 @@ void object_flags(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
                flgs[i] = k_ptr->flags[i];
 
        /* Artifact */
-       if (o_ptr->name1)
+       if (object_is_fixed_artifact(o_ptr))
        {
                artifact_type *a_ptr = &a_info[o_ptr->name1];
 
@@ -121,7 +121,7 @@ void object_flags(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
        }
 
        /* Ego-item */
-       if (o_ptr->name2)
+       if (object_is_ego(o_ptr))
        {
                ego_item_type *e_ptr = &e_info[o_ptr->name2];
 
@@ -147,7 +147,7 @@ void object_flags(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
        for (i = 0; i < TR_FLAG_SIZE; i++)
                flgs[i] |= o_ptr->art_flags[i];
 
-       if (item_tester_hook_smith(o_ptr))
+       if (object_is_smith(o_ptr))
        {
                int add = o_ptr->xtra3 - 1;
 
@@ -220,17 +220,17 @@ void object_flags_known(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
        for (i = 0; i < TR_FLAG_SIZE; i++)
                flgs[i] = 0;
 
-       if (!object_aware_p(o_ptr)) return;
+       if (!object_is_aware(o_ptr)) return;
 
        /* Base object */
        for (i = 0; i < TR_FLAG_SIZE; i++)
                flgs[i] = k_ptr->flags[i];
 
        /* Must be identified */
-       if (!object_known_p(o_ptr)) return;
+       if (!object_is_known(o_ptr)) return;
 
        /* Ego-item (known basic flags) */
-       if (o_ptr->name2)
+       if (object_is_ego(o_ptr))
        {
                ego_item_type *e_ptr = &e_info[o_ptr->name2];
 
@@ -255,19 +255,19 @@ void object_flags_known(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
 
 #ifdef SPOIL_ARTIFACTS
        /* Full knowledge for some artifacts */
-       if (artifact_p(o_ptr) || o_ptr->art_name) spoil = TRUE;
+       if (object_is_artifact(o_ptr)) spoil = TRUE;
 #endif /* SPOIL_ARTIFACTS */
 
 #ifdef SPOIL_EGO_ITEMS
        /* Full knowledge for some ego-items */
-       if (ego_item_p(o_ptr)) spoil = TRUE;
+       if (object_is_ego(o_ptr)) spoil = TRUE;
 #endif /* SPOIL_EGO_ITEMS */
 
        /* Need full knowledge or spoilers */
        if (spoil || (o_ptr->ident & IDENT_MENTAL))
        {
                /* Artifact */
-               if (o_ptr->name1)
+               if (object_is_fixed_artifact(o_ptr))
                {
                        artifact_type *a_ptr = &a_info[o_ptr->name1];
 
@@ -280,7 +280,7 @@ void object_flags_known(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
                        flgs[i] |= o_ptr->art_flags[i];
        }
 
-       if (item_tester_hook_smith(o_ptr))
+       if (object_is_smith(o_ptr))
        {
                int add = o_ptr->xtra3 - 1;
 
@@ -357,10 +357,10 @@ if (!(have_flag(flgs, TR_ACTIVATE))) return ("
         * for art_name
         */
 
-       if (!(o_ptr->name1) &&
-                !(o_ptr->name2) &&
-                !(o_ptr->xtra1) &&
-                 (o_ptr->xtra2))
+       if (!object_is_fixed_artifact(o_ptr) &&
+           !object_is_ego(o_ptr) &&
+           !(o_ptr->xtra1) &&
+           (o_ptr->xtra2))
        {
                switch (o_ptr->xtra2)
                {
@@ -1865,7 +1865,7 @@ return "
 
        }
 
-       if (item_tester_hook_smith(o_ptr))
+       if (object_is_smith(o_ptr))
        {
                switch (o_ptr->xtra3 - 1)
                {
@@ -1947,7 +1947,7 @@ return "
 
        if (o_ptr->tval == TV_RING)
        {
-               if (o_ptr->name2)
+               if (object_is_ego(o_ptr))
                {
                        switch (o_ptr->name2)
                        {
@@ -2118,7 +2118,7 @@ return "
 
        if (o_ptr->tval == TV_AMULET)
        {
-               if (o_ptr->name2)
+               if (object_is_ego(o_ptr))
                {
                        switch (o_ptr->name2)
                        {
@@ -2373,7 +2373,7 @@ bool screen_object(object_type *o_ptr, bool real)
                { info[i] = &temp[j]; i++;}
        }
 
-       if (TV_EQUIP_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_EQUIP_END)
+       if (object_is_equipment(o_ptr))
        {
                /* Descriptions of a basic equipment is just a flavor */
                trivial_info = i;
@@ -2543,7 +2543,7 @@ info[i++] = "
 #endif
                        }
                }
-               else if (artifact_p(o_ptr))
+               else if (object_is_fixed_artifact(o_ptr))
                {
 #ifdef JP
 info[i++] = "¤½¤ì¤Ï±Ê±ó¤Ê¤ëÌÀ¤«¤ê(Ⱦ·Â 3)¤ò¼ø¤±¤ë¡£";
@@ -3566,7 +3566,7 @@ info[i++] = "
 
        }
 
-       if (cursed_p(o_ptr))
+       if (object_is_cursed(o_ptr))
        {
                if (o_ptr->curse_flags & TRC_PERMA_CURSE)
                {
index e34bad1..aa8490b 100644 (file)
@@ -392,7 +392,7 @@ void compact_objects(int size)
                        chance = 90;
 
                        /* Hack -- only compact artifacts in emergencies */
-                       if ((artifact_p(o_ptr) || o_ptr->art_name) &&
+                       if ((object_is_fixed_artifact(o_ptr) || o_ptr->art_name) &&
                            (cnt < 1000)) chance = 100;
 
                        /* Apply the saving throw */
@@ -451,7 +451,7 @@ void wipe_o_list(void)
                if (!character_dungeon || preserve_mode)
                {
                        /* Hack -- Preserve unknown artifacts */
-                       if (artifact_p(o_ptr) && !object_known_p(o_ptr))
+                       if (object_is_fixed_artifact(o_ptr) && !object_is_known(o_ptr))
                        {
                                /* Mega-Hack -- Preserve the artifact */
                                a_info[o_ptr->name1].cur_num = 0;
@@ -764,15 +764,10 @@ void object_known(object_type *o_ptr)
  */
 void object_aware(object_type *o_ptr)
 {
-       bool mihanmei = !object_aware_p(o_ptr);
+       bool mihanmei = !object_is_aware(o_ptr);
 
-#ifndef SCRIPT_OBJ_KIND
        /* Fully aware of the effects */
        k_info[o_ptr->k_idx].aware = TRUE;
-#else /* SCRIPT_OBJ_KIND */
-       /* Fully aware of the effects */
-       o_ptr->aware = TRUE;
-#endif /* SCRIPT_OBJ_KIND */
 
        if(mihanmei && !(k_info[o_ptr->k_idx].gen_flags & TRG_INSTA_ART) && record_ident &&
           !p_ptr->is_dead && ((o_ptr->tval >= TV_AMULET && o_ptr->tval <= TV_POTION) || (o_ptr->tval == TV_FOOD)))
@@ -797,12 +792,8 @@ void object_aware(object_type *o_ptr)
  */
 void object_tried(object_type *o_ptr)
 {
-#ifndef SCRIPT_OBJ_KIND
        /* Mark it as tried (even if "aware") */
        k_info[o_ptr->k_idx].tried = TRUE;
-#else /* SCRIPT_OBJ_KIND */
-       o_ptr->tried = TRUE;
-#endif /* SCRIPT_OBJ_KIND */
 }
 
 
@@ -813,7 +804,7 @@ void object_tried(object_type *o_ptr)
 static s32b object_value_base(object_type *o_ptr)
 {
        /* Aware item -- use template cost */
-       if (object_aware_p(o_ptr)) return (k_info[o_ptr->k_idx].cost);
+       if (object_is_aware(o_ptr)) return (k_info[o_ptr->k_idx].cost);
 
        /* Analyze the type */
        switch (o_ptr->tval)
@@ -884,7 +875,7 @@ s32b flag_cost(object_type *o_ptr, int plusses)
                flgs[i] &= ~(k_ptr->flags[i]);
 
        /* Exclude fixed flags of the fixed artifact. */
-       if (o_ptr->name1)
+       if (object_is_fixed_artifact(o_ptr))
        {
                artifact_type *a_ptr = &a_info[o_ptr->name1];
 
@@ -893,7 +884,7 @@ s32b flag_cost(object_type *o_ptr, int plusses)
        }
 
        /* Exclude fixed flags of the ego-item. */
-       else if (o_ptr->name2)
+       else if (object_is_ego(o_ptr))
        {
                ego_item_type *e_ptr = &e_info[o_ptr->name2];
 
@@ -1029,7 +1020,7 @@ s32b flag_cost(object_type *o_ptr, int plusses)
        if (have_flag(flgs, TR_DRAIN_EXP)) total -= 12500;
        if (have_flag(flgs, TR_TELEPORT))
        {
-               if (cursed_p(o_ptr))
+               if (object_is_cursed(o_ptr))
                        total -= 7500;
                else
                        total += 250;
@@ -1165,7 +1156,7 @@ s32b object_value_real(object_type *o_ptr)
        object_flags(o_ptr, flgs);
 
        /* Artifact */
-       if (o_ptr->name1)
+       if (object_is_fixed_artifact(o_ptr))
        {
                artifact_type *a_ptr = &a_info[o_ptr->name1];
 
@@ -1181,7 +1172,7 @@ s32b object_value_real(object_type *o_ptr)
        }
 
        /* Ego-Item */
-       else if (o_ptr->name2)
+       else if (object_is_ego(o_ptr))
        {
                ego_item_type *e_ptr = &e_info[o_ptr->name2];
 
@@ -1411,13 +1402,13 @@ s32b object_value(object_type *o_ptr)
 
 
        /* Unknown items -- acquire a base value */
-       if (object_known_p(o_ptr))
+       if (object_is_known(o_ptr))
        {
                /* Broken items -- worthless */
-               if (broken_p(o_ptr)) return (0L);
+               if (object_is_broken(o_ptr)) return (0L);
 
                /* Cursed items -- worthless */
-               if (cursed_p(o_ptr)) return (0L);
+               if (object_is_cursed(o_ptr)) return (0L);
 
                /* Real value (see above) */
                value = object_value_real(o_ptr);
@@ -1427,10 +1418,10 @@ s32b object_value(object_type *o_ptr)
        else
        {
                /* Hack -- Felt broken items */
-               if ((o_ptr->ident & (IDENT_SENSE)) && broken_p(o_ptr)) return (0L);
+               if ((o_ptr->ident & (IDENT_SENSE)) && object_is_broken(o_ptr)) return (0L);
 
                /* Hack -- Felt cursed items */
-               if ((o_ptr->ident & (IDENT_SENSE)) && cursed_p(o_ptr)) return (0L);
+               if ((o_ptr->ident & (IDENT_SENSE)) && object_is_cursed(o_ptr)) return (0L);
 
                /* Base value (see above) */
                value = object_value_base(o_ptr);
@@ -1452,15 +1443,15 @@ s32b object_value(object_type *o_ptr)
 bool can_player_destroy_object(object_type *o_ptr)
 {
        /* Artifacts cannot be destroyed */
-       if (!artifact_p(o_ptr) && !o_ptr->art_name) return TRUE;
+       if (!object_is_artifact(o_ptr)) return TRUE;
 
        /* If object is unidentified, makes fake inscription */
-       if (!object_known_p(o_ptr))
+       if (!object_is_known(o_ptr))
        {
                byte feel = FEEL_SPECIAL;
 
                /* Hack -- Handle icky artifacts */
-               if (cursed_p(o_ptr) || broken_p(o_ptr)) feel = FEEL_TERRIBLE;
+               if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) feel = FEEL_TERRIBLE;
 
                /* Hack -- inscribe the artifact */
                o_ptr->feeling = feel;
@@ -1620,9 +1611,9 @@ static int object_similar_part(object_type *o_ptr, object_type *j_ptr)
                {
                        /* Require either knowledge or known empty for both staffs. */
                        if ((!(o_ptr->ident & (IDENT_EMPTY)) &&
-                               !object_known_p(o_ptr)) ||
+                               !object_is_known(o_ptr)) ||
                                (!(j_ptr->ident & (IDENT_EMPTY)) &&
-                               !object_known_p(j_ptr))) return 0;
+                               !object_is_known(j_ptr))) return 0;
 
                        /* Require identical charges, since staffs are bulky. */
                        if (o_ptr->pval != j_ptr->pval) return 0;
@@ -1636,9 +1627,9 @@ static int object_similar_part(object_type *o_ptr, object_type *j_ptr)
                {
                        /* Require either knowledge or known empty for both wands. */
                        if ((!(o_ptr->ident & (IDENT_EMPTY)) &&
-                               !object_known_p(o_ptr)) ||
+                               !object_is_known(o_ptr)) ||
                                (!(j_ptr->ident & (IDENT_EMPTY)) &&
-                               !object_known_p(j_ptr))) return 0;
+                               !object_is_known(j_ptr))) return 0;
 
                        /* Wand charges combine in O&ZAngband.  */
 
@@ -1679,7 +1670,7 @@ static int object_similar_part(object_type *o_ptr, object_type *j_ptr)
                case TV_WHISTLE:
                {
                        /* Require full knowledge of both items */
-                       if (!object_known_p(o_ptr) || !object_known_p(j_ptr)) return 0;
+                       if (!object_is_known(o_ptr) || !object_is_known(j_ptr)) return 0;
 
                        /* Fall through */
                }
@@ -1690,7 +1681,7 @@ static int object_similar_part(object_type *o_ptr, object_type *j_ptr)
                case TV_SHOT:
                {
                        /* Require identical knowledge of both items */
-                       if (object_known_p(o_ptr) != object_known_p(j_ptr)) return 0;
+                       if (object_is_known(o_ptr) != object_is_known(j_ptr)) return 0;
                        if (o_ptr->feeling != j_ptr->feeling) return 0;
 
                        /* Require identical "bonuses" */
@@ -1701,11 +1692,8 @@ static int object_similar_part(object_type *o_ptr, object_type *j_ptr)
                        /* Require identical "pval" code */
                        if (o_ptr->pval != j_ptr->pval) return 0;
 
-                       /* Require identical "artifact" names */
-                       if (o_ptr->name1 != j_ptr->name1) return 0;
-
-                       /* Random artifacts never stack */
-                       if (o_ptr->art_name || j_ptr->art_name) return 0;
+                       /* Artifacts never stack */
+                       if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return 0;
 
                        /* Require identical "ego-item" names */
                        if (o_ptr->name2 != j_ptr->name2) return 0;
@@ -1733,7 +1721,7 @@ static int object_similar_part(object_type *o_ptr, object_type *j_ptr)
                default:
                {
                        /* Require knowledge */
-                       if (!object_known_p(o_ptr) || !object_known_p(j_ptr)) return 0;
+                       if (!object_is_known(o_ptr) || !object_is_known(j_ptr)) return 0;
 
                        /* Probably okay */
                        break;
@@ -1805,7 +1793,7 @@ void object_absorb(object_type *o_ptr, object_type *j_ptr)
        o_ptr->number = (total > max_num) ? max_num : total;
 
        /* Hack -- blend "known" status */
-       if (object_known_p(j_ptr)) object_known(o_ptr);
+       if (object_is_known(j_ptr)) object_known(o_ptr);
 
        /* Hack -- clear "storebought" if only one has it */
        if (((o_ptr->ident & IDENT_STORE) || (j_ptr->ident & IDENT_STORE)) &&
@@ -2056,7 +2044,7 @@ static void object_mention(object_type *o_ptr)
        object_desc(o_name, o_ptr, (OD_NAME_ONLY | OD_STORE));
 
        /* Artifact */
-       if (artifact_p(o_ptr))
+       if (object_is_fixed_artifact(o_ptr))
        {
                /* Silly message */
 #ifdef JP
@@ -2079,7 +2067,7 @@ static void object_mention(object_type *o_ptr)
        }
 
        /* Ego-item */
-       else if (ego_item_p(o_ptr))
+       else if (object_is_ego(o_ptr))
        {
                /* Silly message */
 #ifdef JP
@@ -3331,7 +3319,7 @@ static void a_m_aux_3(object_type *o_ptr, int level, int power)
                                        break;
                                }
                        }
-                       if ((one_in_(400) && (power > 0) && !cursed_p(o_ptr) && (level > 79))
+                       if ((one_in_(400) && (power > 0) && !object_is_cursed(o_ptr) && (level > 79))
                            || (power > 2)) /* power > 2 is debug only */
                        {
                                o_ptr->pval = MIN(o_ptr->pval, 4);
@@ -3670,7 +3658,7 @@ static void a_m_aux_3(object_type *o_ptr, int level, int power)
                                        break;
                                }
                        }
-                       if ((one_in_(150) && (power > 0) && !cursed_p(o_ptr) && (level > 79))
+                       if ((one_in_(150) && (power > 0) && !object_is_cursed(o_ptr) && (level > 79))
                            || (power > 2)) /* power > 2 is debug only */
                        {
                                o_ptr->pval = MIN(o_ptr->pval, 4);
@@ -3999,7 +3987,7 @@ static void a_m_aux_4(object_type *o_ptr, int level, int power)
 #endif
 
                                                          r_name + r_ptr->name, check - 1,
-                                                         !cursed_p(o_ptr) ? "" : " {cursed}");
+                                                         !object_is_cursed(o_ptr) ? "" : " {cursed}");
                        }
 
                        break;
@@ -4256,7 +4244,7 @@ void apply_magic(object_type *o_ptr, int lev, u32b mode)
 
 
        /* Hack -- analyze artifacts */
-       if (o_ptr->name1)
+       if (object_is_fixed_artifact(o_ptr))
        {
                artifact_type *a_ptr = &a_info[o_ptr->name1];
 
@@ -4393,7 +4381,7 @@ void apply_magic(object_type *o_ptr, int lev, u32b mode)
        if (o_ptr->art_name) rating += 30;
 
        /* Hack -- analyze ego-items */
-       else if (o_ptr->name2)
+       else if (object_is_ego(o_ptr))
        {
                ego_item_type *e_ptr = &e_info[o_ptr->name2];
 
@@ -4417,7 +4405,7 @@ void apply_magic(object_type *o_ptr, int lev, u32b mode)
                if (e_ptr->gen_flags & (TRG_XTRA_RES)) one_resistance(o_ptr);
 
                /* Hack -- apply extra penalties if needed */
-               if (cursed_p(o_ptr) || broken_p(o_ptr))
+               if (object_is_cursed(o_ptr) || object_is_broken(o_ptr))
                {
                        /* Hack -- obtain bonuses */
                        if (e_ptr->max_to_h) o_ptr->to_h -= randint1(e_ptr->max_to_h);
@@ -4670,10 +4658,10 @@ bool make_object(object_type *j_ptr, u32b mode)
        }
 
        obj_level = k_info[j_ptr->k_idx].level;
-       if (artifact_p(j_ptr)) obj_level = a_info[j_ptr->name1].level;
+       if (object_is_fixed_artifact(j_ptr)) obj_level = a_info[j_ptr->name1].level;
 
        /* Notice "okay" out-of-depth objects */
-       if (!cursed_p(j_ptr) && !broken_p(j_ptr) &&
+       if (!object_is_cursed(j_ptr) && !object_is_broken(j_ptr) &&
            (obj_level > dun_level))
        {
                /* Rating increase */
@@ -4761,7 +4749,7 @@ void place_object(int y, int x, u32b mode)
        else
        {
                /* Hack -- Preserve artifacts */
-               if (q_ptr->name1)
+               if (object_is_fixed_artifact(q_ptr))
                {
                        a_info[q_ptr->name1].cur_num = 0;
                }
@@ -4926,7 +4914,7 @@ s16b drop_near(object_type *j_ptr, int chance, int y, int x)
 
 
        /* Handle normal "breakage" */
-       if (!(j_ptr->art_name || artifact_p(j_ptr)) && (randint0(100) < chance))
+       if (!object_is_artifact(j_ptr) && (randint0(100) < chance))
        {
                /* Message */
 #ifdef JP
@@ -5043,7 +5031,7 @@ s16b drop_near(object_type *j_ptr, int chance, int y, int x)
 
 
        /* Handle lack of space */
-       if (!flag && !(artifact_p(j_ptr) || j_ptr->art_name))
+       if (!flag && !object_is_artifact(j_ptr))
        {
                /* Message */
 #ifdef JP
@@ -5152,7 +5140,7 @@ s16b drop_near(object_type *j_ptr, int chance, int y, int x)
 
 
                /* Hack -- Preserve artifacts */
-               if (j_ptr->name1)
+               if (object_is_fixed_artifact(j_ptr))
                {
                        a_info[j_ptr->name1].cur_num = 0;
                }
@@ -5368,7 +5356,7 @@ void inven_item_charges(int item)
        if ((o_ptr->tval != TV_STAFF) && (o_ptr->tval != TV_WAND)) return;
 
        /* Require known item */
-       if (!object_known_p(o_ptr)) return;
+       if (!object_is_known(o_ptr)) return;
 
 #ifdef JP
        if (o_ptr->pval <= 0)
@@ -5556,7 +5544,7 @@ void floor_item_charges(int item)
        if ((o_ptr->tval != TV_STAFF) && (o_ptr->tval != TV_WAND)) return;
 
        /* Require known item */
-       if (!object_known_p(o_ptr)) return;
+       if (!object_is_known(o_ptr)) return;
 
 #ifdef JP
        if (o_ptr->pval <= 0)
@@ -5787,16 +5775,16 @@ s16b inven_carry(object_type *o_ptr)
                        if (o_ptr->tval < j_ptr->tval) continue;
 
                        /* Non-aware (flavored) items always come last */
-                       if (!object_aware_p(o_ptr)) continue;
-                       if (!object_aware_p(j_ptr)) break;
+                       if (!object_is_aware(o_ptr)) continue;
+                       if (!object_is_aware(j_ptr)) break;
 
                        /* Objects sort by increasing sval */
                        if (o_ptr->sval < j_ptr->sval) break;
                        if (o_ptr->sval > j_ptr->sval) continue;
 
                        /* Unidentified objects always come last */
-                       if (!object_known_p(o_ptr)) continue;
-                       if (!object_known_p(j_ptr)) break;
+                       if (!object_is_known(o_ptr)) continue;
+                       if (!object_is_known(j_ptr)) break;
 
                        /* Hack:  otherwise identical rods sort by
                        increasing recharge time --dsb */
@@ -6209,16 +6197,16 @@ void reorder_pack(void)
                        if (o_ptr->tval < j_ptr->tval) continue;
 
                        /* Non-aware (flavored) items always come last */
-                       if (!object_aware_p(o_ptr)) continue;
-                       if (!object_aware_p(j_ptr)) break;
+                       if (!object_is_aware(o_ptr)) continue;
+                       if (!object_is_aware(j_ptr)) break;
 
                        /* Objects sort by increasing sval */
                        if (o_ptr->sval < j_ptr->sval) break;
                        if (o_ptr->sval > j_ptr->sval) continue;
 
                        /* Unidentified objects always come last */
-                       if (!object_known_p(o_ptr)) continue;
-                       if (!object_known_p(j_ptr)) break;
+                       if (!object_is_known(o_ptr)) continue;
+                       if (!object_is_known(j_ptr)) break;
 
                        /* Hack:  otherwise identical rods sort by
                        increasing recharge time --dsb */
@@ -7361,7 +7349,7 @@ static void drain_essence(void)
        for (i = 0; i < sizeof(drain_value) / sizeof(int); i++)
                drain_value[i] = 0;
 
-       item_tester_hook = item_tester_hook_weapon_armour;
+       item_tester_hook = object_is_weapon_armour_ammo;
        item_tester_no_ryoute = TRUE;
 
        /* Get an item */
@@ -7387,7 +7375,8 @@ static void drain_essence(void)
                o_ptr = &o_list[0 - item];
        }
 
-       if (object_known_p(o_ptr) && (o_ptr->name1 || o_ptr->name2 || o_ptr->art_name || o_ptr->xtra3)) {
+       if (object_is_known(o_ptr) && !object_is_nameless(o_ptr))
+       {
                char o_name[MAX_NLEN];
                object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 #ifdef JP
@@ -7512,8 +7501,7 @@ static void drain_essence(void)
        {
                drain_value[TR_DEX] += 20;
        }
-       if ((TV_MISSILE_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_MISSILE_END) ||
-           (TV_WEAPON_BEGIN <=  o_ptr->tval && o_ptr->tval <= TV_WEAPON_END))
+       if (object_is_weapon_ammo(o_ptr))
        {
                if (old_ds > o_ptr->ds) drain_value[TR_ES_ATTACK] += (old_ds-o_ptr->ds)*10;
 
@@ -7994,11 +7982,11 @@ static void add_essence(int mode)
        else if (mode == 1 || mode == 5)
                item_tester_hook = item_tester_hook_melee_ammo;
        else if (es_ptr->add == ESSENCE_ATTACK)
-               item_tester_hook = item_tester_hook_weapon;
+               item_tester_hook = object_allow_enchant_weapon;
        else if (es_ptr->add == ESSENCE_AC)
-               item_tester_hook = item_tester_hook_armour;
+               item_tester_hook = object_is_armour;
        else
-               item_tester_hook = item_tester_hook_weapon_armour;
+               item_tester_hook = object_is_weapon_armour_ammo;
        item_tester_no_ryoute = TRUE;
 
        /* Get an item */
@@ -8024,7 +8012,7 @@ static void add_essence(int mode)
                o_ptr = &o_list[0 - item];
        }
 
-       if ((mode != 10) && (o_ptr->name1 || o_ptr->art_name || o_ptr->xtra3))
+       if ((mode != 10) && (object_is_artifact(o_ptr) || object_is_smith(o_ptr)))
        {
 #ifdef JP
                msg_print("¤½¤Î¥¢¥¤¥Æ¥à¤Ï¤³¤ì°Ê¾å²þÎɤǤ­¤Ê¤¤¡£");
@@ -8296,36 +8284,6 @@ static void add_essence(int mode)
 }
 
 
-bool item_tester_hook_smith(object_type *o_ptr)
-{
-       switch (o_ptr->tval)
-       {
-               case TV_SWORD:
-               case TV_HAFTED:
-               case TV_POLEARM:
-               case TV_DIGGING:
-               case TV_BOW:
-               case TV_BOLT:
-               case TV_ARROW:
-               case TV_SHOT:
-               case TV_DRAG_ARMOR:
-               case TV_HARD_ARMOR:
-               case TV_SOFT_ARMOR:
-               case TV_SHIELD:
-               case TV_CLOAK:
-               case TV_CROWN:
-               case TV_HELM:
-               case TV_BOOTS:
-               case TV_GLOVES:
-               {
-                       if (o_ptr->xtra3) return (TRUE);
-               }
-       }
-
-       return (FALSE);
-}
-
-
 static void erase_essence(void)
 {
        int item;
@@ -8334,7 +8292,7 @@ static void erase_essence(void)
        char o_name[MAX_NLEN];
        u32b flgs[TR_FLAG_SIZE];
 
-       item_tester_hook = item_tester_hook_smith;
+       item_tester_hook = object_is_smith;
 
        /* Get an item */
 #ifdef JP
index 2ee5a18..02c42f4 100644 (file)
@@ -339,7 +339,7 @@ s = "
        }
 
 
-       if (!object_known_p(o_ptr))
+       if (!object_is_known(o_ptr))
        {
 #ifdef JP
                msg_print("´ÕÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¼è¤ê¹þ¤á¤Ê¤¤¡£");
index 8f5d712..6ed4b0e 100644 (file)
@@ -1228,7 +1228,7 @@ static bool project_o(int who, int r, int y, int x, int dam, int typ)
                object_flags(o_ptr, flgs);
 
                /* Check for artifact */
-               if ((artifact_p(o_ptr) || o_ptr->art_name)) is_art = TRUE;
+               if (object_is_artifact(o_ptr)) is_art = TRUE;
 
                /* Analyze the type */
                switch (typ)
@@ -1423,7 +1423,7 @@ note_kill = "
                        case GF_HOLY_FIRE:
                        case GF_HELL_FIRE:
                        {
-                               if (cursed_p(o_ptr))
+                               if (object_is_cursed(o_ptr))
                                {
                                        do_kill = TRUE;
 #ifdef JP
index e786125..18b5e49 100644 (file)
@@ -3828,9 +3828,8 @@ bool detect_objects_magic(int range)
                tv = o_ptr->tval;
 
                /* Artifacts, misc magic items, or enchanted wearables */
-               if (artifact_p(o_ptr) ||
-                       ego_item_p(o_ptr) ||
-                       o_ptr->art_name ||
+               if (object_is_artifact(o_ptr) ||
+                       object_is_ego(o_ptr) ||
                    (tv == TV_WHISTLE) ||
                    (tv == TV_AMULET) ||
                        (tv == TV_RING) ||
@@ -5324,7 +5323,7 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
                                        next_o_idx = o_ptr->next_o_idx;
 
                                        /* Hack -- Preserve unknown artifacts */
-                                       if (artifact_p(o_ptr) && (!object_known_p(o_ptr) || in_generate))
+                                       if (object_is_fixed_artifact(o_ptr) && (!object_is_known(o_ptr) || in_generate))
                                        {
                                                /* Mega-Hack -- Preserve the artifact */
                                                a_info[o_ptr->name1].cur_num = 0;
index 193b5b8..ad1d394 100644 (file)
@@ -939,7 +939,7 @@ bool apply_disenchant(int mode)
        if (!o_ptr->k_idx) return (FALSE);
 
        /* Disenchant equipments only -- No disenchant on monster ball */
-       if (o_ptr->tval < TV_EQUIP_BEGIN || TV_EQUIP_END < o_ptr->tval)
+       if (!object_is_weapon_armour_ammo(o_ptr))
                return FALSE;
 
        /* Nothing to disenchant */
@@ -955,7 +955,7 @@ bool apply_disenchant(int mode)
 
 
        /* Artifacts have 71% chance to resist */
-       if ((artifact_p(o_ptr) || o_ptr->art_name) && (randint0(100) < 71))
+       if (object_is_artifact(o_ptr) && (randint0(100) < 71))
        {
                /* Message */
 #ifdef JP
@@ -1186,25 +1186,6 @@ msg_print("
 }
 
 
-static bool item_tester_hook_weapon_nobow(object_type *o_ptr)
-{
-       switch (o_ptr->tval)
-       {
-               case TV_HAFTED:
-               case TV_POLEARM:
-               case TV_DIGGING:
-               {
-                       return (TRUE);
-               }
-               case TV_SWORD:
-               {
-                       if (o_ptr->sval != SV_DOKUBARI) return (TRUE);
-               }
-       }
-
-       return (FALSE);
-}
-
 /*
  * Brand the current weapon
  */
@@ -1216,7 +1197,7 @@ void brand_weapon(int brand_type)
 
 
        /* Assume enchant weapon */
-       item_tester_hook = item_tester_hook_weapon_nobow;
+       item_tester_hook = object_allow_enchant_melee_weapon;
        item_tester_no_ryoute = TRUE;
 
        /* Get an item */
@@ -1246,8 +1227,8 @@ s = "
        /* you can never modify artifacts / ego-items */
        /* you can never modify cursed items */
        /* TY: You _can_ modify broken items (if you're silly enough) */
-       if (o_ptr->k_idx && !artifact_p(o_ptr) && !ego_item_p(o_ptr) &&
-           !o_ptr->art_name && !cursed_p(o_ptr) &&
+       if (o_ptr->k_idx && !object_is_artifact(o_ptr) && !object_is_ego(o_ptr) &&
+           !object_is_cursed(o_ptr) &&
            !((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) &&
            !((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE)) &&
            !((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
@@ -2051,7 +2032,7 @@ static int remove_curse_aux(int all)
                if (!o_ptr->k_idx) continue;
 
                /* Uncursed already */
-               if (!cursed_p(o_ptr)) continue;
+               if (!object_is_cursed(o_ptr)) continue;
 
                /* Heavily Cursed Items need a special spell */
                if (!all && (o_ptr->curse_flags & TRC_HEAVY_CURSE)) continue;
@@ -2249,153 +2230,12 @@ msg_format("%s
 }
 
 
-
-/*
- * Hook to specify "weapon"
- */
-bool item_tester_hook_weapon(object_type *o_ptr)
-{
-       switch (o_ptr->tval)
-       {
-               case TV_HAFTED:
-               case TV_POLEARM:
-               case TV_DIGGING:
-               case TV_BOW:
-               case TV_BOLT:
-               case TV_ARROW:
-               case TV_SHOT:
-               {
-                       return (TRUE);
-               }
-               case TV_SWORD:
-               {
-                       if (o_ptr->sval != SV_DOKUBARI) return (TRUE);
-               }
-       }
-
-       return (FALSE);
-}
-
-static bool item_tester_hook_weapon2(object_type *o_ptr)
-{
-       switch (o_ptr->tval)
-       {
-               case TV_SWORD:
-               case TV_HAFTED:
-               case TV_POLEARM:
-               case TV_DIGGING:
-               case TV_BOW:
-               case TV_BOLT:
-               case TV_ARROW:
-               case TV_SHOT:
-               {
-                       return (TRUE);
-               }
-       }
-
-       return (FALSE);
-}
-
-
-/*
- * Hook to specify "armour"
- */
-bool item_tester_hook_armour(object_type *o_ptr)
-{
-       switch (o_ptr->tval)
-       {
-               case TV_DRAG_ARMOR:
-               case TV_HARD_ARMOR:
-               case TV_SOFT_ARMOR:
-               case TV_SHIELD:
-               case TV_CLOAK:
-               case TV_CROWN:
-               case TV_HELM:
-               case TV_BOOTS:
-               case TV_GLOVES:
-               {
-                       return (TRUE);
-               }
-       }
-
-       return (FALSE);
-}
-
-
-/*
- * Check if an object is weapon or armour (but not arrow, bolt, or shot)
- */
-bool item_tester_hook_weapon_armour(object_type *o_ptr)
-{
-       switch (o_ptr->tval)
-       {
-               case TV_SWORD:
-               case TV_HAFTED:
-               case TV_POLEARM:
-               case TV_DIGGING:
-               case TV_BOW:
-               case TV_BOLT:
-               case TV_ARROW:
-               case TV_SHOT:
-               case TV_DRAG_ARMOR:
-               case TV_HARD_ARMOR:
-               case TV_SOFT_ARMOR:
-               case TV_SHIELD:
-               case TV_CLOAK:
-               case TV_CROWN:
-               case TV_HELM:
-               case TV_BOOTS:
-               case TV_GLOVES:
-               {
-                       return (TRUE);
-               }
-       }
-
-       return (FALSE);
-}
-
-
-/*
- * Check if an object is nameless weapon or armour
- */
-static bool item_tester_hook_nameless_weapon_armour(object_type *o_ptr)
-{
-       switch (o_ptr->tval)
-       {
-               case TV_SWORD:
-               case TV_HAFTED:
-               case TV_POLEARM:
-               case TV_DIGGING:
-               case TV_BOW:
-               case TV_BOLT:
-               case TV_ARROW:
-               case TV_SHOT:
-               case TV_DRAG_ARMOR:
-               case TV_HARD_ARMOR:
-               case TV_SOFT_ARMOR:
-               case TV_SHIELD:
-               case TV_CLOAK:
-               case TV_CROWN:
-               case TV_HELM:
-               case TV_BOOTS:
-               case TV_GLOVES:
-                       if (o_ptr->name1 || o_ptr->art_name || o_ptr->name2 || o_ptr->xtra3)
-                       {
-                               if (object_known_p(o_ptr)) return FALSE;
-                       }
-                       return TRUE;
-       }
-
-       return FALSE;
-}
-
-
 /*
  * Break the curse of an item
  */
 static void break_curse(object_type *o_ptr)
 {
-       if (cursed_p(o_ptr) && !(o_ptr->curse_flags & TRC_PERMA_CURSE) && !(o_ptr->curse_flags & TRC_HEAVY_CURSE) && (randint0(100) < 25))
+       if (object_is_cursed(o_ptr) && !(o_ptr->curse_flags & TRC_PERMA_CURSE) && !(o_ptr->curse_flags & TRC_HEAVY_CURSE) && (randint0(100) < 25))
        {
 #ifdef JP
 msg_print("¤«¤±¤é¤ì¤Æ¤¤¤¿¼ö¤¤¤¬ÂǤÁÇˤé¤ì¤¿¡ª");
@@ -2431,7 +2271,7 @@ bool enchant(object_type *o_ptr, int n, int eflag)
 {
        int     i, chance, prob;
        bool    res = FALSE;
-       bool    a = (artifact_p(o_ptr) || o_ptr->art_name);
+       bool    a = object_is_artifact(o_ptr);
        bool    force = (eflag & ENCH_FORCE);
 
 
@@ -2542,11 +2382,11 @@ bool enchant_spell(int num_hit, int num_dam, int num_ac)
 
 
        /* Assume enchant weapon */
-       item_tester_hook = item_tester_hook_weapon;
+       item_tester_hook = object_allow_enchant_weapon;
        item_tester_no_ryoute = TRUE;
 
        /* Enchant armor if requested */
-       if (num_ac) item_tester_hook = item_tester_hook_armour;
+       if (num_ac) item_tester_hook = object_is_armour;
 
        /* Get an item */
 #ifdef JP
@@ -2616,6 +2456,22 @@ msg_print("
 }
 
 
+/*
+ * Check if an object is nameless weapon or armour
+ */
+static bool item_tester_hook_nameless_weapon_armour(object_type *o_ptr)
+{
+       /* Require weapon or armour */
+       if (!object_is_weapon_armour_ammo(o_ptr)) return FALSE;
+       
+       /* Require nameless object if the object is well known */
+       if (object_is_known(o_ptr) && !object_is_nameless(o_ptr))
+               return FALSE;
+
+       return TRUE;
+}
+
+
 bool artifact_scroll(void)
 {
        int             item;
@@ -2626,6 +2482,7 @@ bool artifact_scroll(void)
 
 
        item_tester_no_ryoute = TRUE;
+
        /* Enchant weapon/armour */
        item_tester_hook = item_tester_hook_nameless_weapon_armour;
 
@@ -2665,7 +2522,7 @@ bool artifact_scroll(void)
                  ((o_ptr->number > 1) ? "" : "s"));
 #endif
 
-       if (o_ptr->name1 || o_ptr->art_name)
+       if (object_is_artifact(o_ptr))
        {
 #ifdef JP
                msg_format("%s¤Ï´û¤ËÅÁÀâ¤Î¥¢¥¤¥Æ¥à¤Ç¤¹¡ª", o_name  );
@@ -2678,7 +2535,7 @@ bool artifact_scroll(void)
                okay = FALSE;
        }
 
-       else if (o_ptr->name2)
+       else if (object_is_ego(o_ptr))
        {
 #ifdef JP
                msg_format("%s¤Ï´û¤Ë̾¤Î¤¢¤ë¥¢¥¤¥Æ¥à¤Ç¤¹¡ª", o_name );
@@ -2767,7 +2624,7 @@ bool identify_item(object_type *o_ptr)
 
        if (!(o_ptr->ident & (IDENT_MENTAL)))
        {
-               if ((o_ptr->art_name) || (artifact_p(o_ptr)) || one_in_(5))
+               if (object_is_artifact(o_ptr) || one_in_(5))
                        chg_virtue(V_KNOWLEDGE, 1);
        }
 
@@ -2790,7 +2647,7 @@ bool identify_item(object_type *o_ptr)
        /* Description */
        object_desc(o_name, o_ptr, OD_NAME_ONLY);
 
-       if(record_fix_art && !old_known && artifact_p(o_ptr))
+       if(record_fix_art && !old_known && object_is_fixed_artifact(o_ptr))
                do_cmd_write_nikki(NIKKI_ART, 0, o_name);
        if(record_rand_art && !old_known && o_ptr->art_name)
                do_cmd_write_nikki(NIKKI_ART, 0, o_name);
@@ -2801,14 +2658,14 @@ bool identify_item(object_type *o_ptr)
 
 static bool item_tester_hook_identify(object_type *o_ptr)
 {
-       return (bool)!object_known_p(o_ptr);
+       return (bool)!object_is_known(o_ptr);
 }
 
 static bool item_tester_hook_identify_weapon_armour(object_type *o_ptr)
 {
-       if (object_known_p(o_ptr))
+       if (object_is_known(o_ptr))
                return FALSE;
-       return item_tester_hook_weapon_armour(o_ptr);
+       return object_is_weapon_armour_ammo(o_ptr);
 }
 
 /*
@@ -2835,7 +2692,7 @@ bool ident_spell(bool only_equip)
        {
                if (only_equip)
                {
-                       item_tester_hook = item_tester_hook_weapon_armour;
+                       item_tester_hook = object_is_weapon_armour_ammo;
                }
                else
                {
@@ -2917,7 +2774,7 @@ bool mundane_spell(bool only_equip)
        object_type     *o_ptr;
        cptr            q, s;
 
-       if (only_equip) item_tester_hook = item_tester_hook_weapon_armour;
+       if (only_equip) item_tester_hook = object_is_weapon_armour_ammo;
        item_tester_no_ryoute = TRUE;
 
        /* Get an item */
@@ -2977,14 +2834,14 @@ s = "
 
 static bool item_tester_hook_identify_fully(object_type *o_ptr)
 {
-       return (bool)(!object_known_p(o_ptr) || !(o_ptr->ident & IDENT_MENTAL));
+       return (bool)(!object_is_known(o_ptr) || !(o_ptr->ident & IDENT_MENTAL));
 }
 
 static bool item_tester_hook_identify_fully_weapon_armour(object_type *o_ptr)
 {
        if (!item_tester_hook_identify_fully(o_ptr))
                return FALSE;
-       return item_tester_hook_weapon_armour(o_ptr);
+       return object_is_weapon_armour_ammo(o_ptr);
 }
 
 /*
@@ -3008,7 +2865,7 @@ bool identify_fully(bool only_equip)
        if (!can_get_item())
        {
                if (only_equip)
-                       item_tester_hook = item_tester_hook_weapon_armour;
+                       item_tester_hook = object_is_weapon_armour_ammo;
                else
                        item_tester_hook = NULL;
        }
@@ -3266,7 +3123,7 @@ s = "
        if (fail)
        {
                /* Artifacts are never destroyed. */
-               if (artifact_p(o_ptr))
+               if (object_is_fixed_artifact(o_ptr))
                {
                        object_desc(o_name, o_ptr, OD_NAME_ONLY);
 #ifdef JP
@@ -3465,8 +3322,9 @@ bool bless_weapon(void)
        cptr            q, s;
 
        item_tester_no_ryoute = TRUE;
-       /* Assume enchant weapon */
-       item_tester_hook = item_tester_hook_weapon2;
+
+       /* Bless only weapons */
+       item_tester_hook = object_is_weapon;
 
        /* Get an item */
 #ifdef JP
@@ -3499,7 +3357,7 @@ s = "
        /* Extract the flags */
        object_flags(o_ptr, flgs);
 
-       if (cursed_p(o_ptr))
+       if (object_is_cursed(o_ptr))
        {
                if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && (randint1(100) < 33)) ||
                    (o_ptr->curse_flags & TRC_PERMA_CURSE))
@@ -3562,7 +3420,7 @@ msg_format("%s 
                return TRUE;
        }
 
-       if (!(o_ptr->art_name || o_ptr->name1 || o_ptr->name2) || one_in_(3))
+       if (!(object_is_artifact(o_ptr) || object_is_ego(o_ptr)) || one_in_(3))
        {
                /* Describe */
 #ifdef JP
@@ -3693,8 +3551,8 @@ s = "
        /* Extract the flags */
        object_flags(o_ptr, flgs);
 
-       if (o_ptr->k_idx && !artifact_p(o_ptr) && !ego_item_p(o_ptr) &&
-           !o_ptr->art_name && !cursed_p(o_ptr) && (o_ptr->sval != SV_MIRROR_SHIELD))
+       if (o_ptr->k_idx && !object_is_artifact(o_ptr) && !object_is_ego(o_ptr) &&
+           !object_is_cursed(o_ptr) && (o_ptr->sval != SV_MIRROR_SHIELD))
        {
 #ifdef JP
 msg_format("%s¤Ïµ±¤¤¤¿¡ª", o_name);
@@ -5125,7 +4983,7 @@ int inven_damage(inven_func typ, int perc)
                if (!o_ptr->k_idx) continue;
 
                /* Hack -- for now, skip artifacts */
-               if (artifact_p(o_ptr) || o_ptr->art_name) continue;
+               if (object_is_artifact(o_ptr)) continue;
 
                /* Give this item slot a shot at death */
                if ((*typ)(o_ptr))
@@ -5220,7 +5078,7 @@ static int minus_ac(void)
        /* Nothing to damage */
        if (!o_ptr->k_idx) return (FALSE);
 
-       if (o_ptr->tval <= TV_WEAPON_END) return (FALSE);
+       if (!object_is_armour(o_ptr)) return (FALSE);
 
        /* No damage left to be done */
        if (o_ptr->ac + o_ptr->to_a <= 0) return (FALSE);
@@ -5438,7 +5296,7 @@ bool rustproof(void)
 
        item_tester_no_ryoute = TRUE;
        /* Select a piece of armour */
-       item_tester_hook = item_tester_hook_armour;
+       item_tester_hook = object_is_armour;
 
        /* Get an item */
 #ifdef JP
@@ -5469,7 +5327,7 @@ s = "
 
        add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
 
-       if ((o_ptr->to_a < 0) && !cursed_p(o_ptr))
+       if ((o_ptr->to_a < 0) && !object_is_cursed(o_ptr))
        {
 #ifdef JP
 msg_format("%s¤Ï¿·ÉÊƱÍͤˤʤä¿¡ª",o_name);
@@ -5519,7 +5377,7 @@ bool curse_armor(void)
        object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
 
        /* Attempt a saving throw for artifacts */
-       if ((o_ptr->art_name || artifact_p(o_ptr)) && (randint0(100) < 50))
+       if (object_is_artifact(o_ptr) && (randint0(100) < 50))
        {
                /* Cool */
 #ifdef JP
@@ -5600,7 +5458,7 @@ bool curse_weapon(bool force, int slot)
        object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
 
        /* Attempt a saving throw */
-       if ((artifact_p(o_ptr) || o_ptr->art_name) && (randint0(100) < 50) && !force)
+       if (object_is_artifact(o_ptr) && (randint0(100) < 50) && !force)
        {
                /* Cool */
 #ifdef JP
@@ -5676,11 +5534,11 @@ bool brand_bolts(void)
                if (o_ptr->tval != TV_BOLT) continue;
 
                /* Skip artifacts and ego-items */
-               if (o_ptr->art_name || artifact_p(o_ptr) || ego_item_p(o_ptr))
+               if (object_is_artifact(o_ptr) || object_is_ego(o_ptr))
                        continue;
 
                /* Skip cursed/broken items */
-               if (cursed_p(o_ptr) || broken_p(o_ptr)) continue;
+               if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) continue;
 
                /* Randomize */
                if (randint0(100) < 75) continue;
@@ -6033,7 +5891,7 @@ msg_print("
        if (fail)
        {
                /* Artifacts are never destroyed. */
-               if (artifact_p(o_ptr))
+               if (object_is_fixed_artifact(o_ptr))
                {
                        object_desc(o_name, o_ptr, OD_NAME_ONLY);
 #ifdef JP
index 430bf2d..0587a54 100644 (file)
@@ -1041,8 +1041,8 @@ static void mass_produce(object_type *o_ptr)
                case TV_DIGGING:
                case TV_BOW:
                {
-                       if (o_ptr->art_name) break;
-                       if (o_ptr->name2) break;
+                       if (object_is_artifact(o_ptr)) break;
+                       if (object_is_ego(o_ptr)) break;
                        if (cost <= 10L) size += damroll(3, 5);
                        if (cost <= 100L) size += damroll(3, 5);
                        break;
@@ -1168,14 +1168,11 @@ static bool store_object_similar(object_type *o_ptr, object_type *j_ptr)
        if (o_ptr->to_d != j_ptr->to_d) return (0);
        if (o_ptr->to_a != j_ptr->to_a) return (0);
 
-       /* Require identical "artifact" names */
-       if (o_ptr->name1 != j_ptr->name1) return (0);
-
        /* Require identical "ego-item" names */
        if (o_ptr->name2 != j_ptr->name2) return (0);
 
-       /* Random artifacts don't stack !*/
-       if (o_ptr->art_name || j_ptr->art_name) return (0);
+       /* Artifacts don't stack! */
+       if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0);
 
        /* Hack -- Identical art_flags! */
        for (i = 0; i < TR_FLAG_SIZE; i++)
@@ -1597,16 +1594,16 @@ static int home_carry(object_type *o_ptr)
                if (o_ptr->tval < j_ptr->tval) continue;
 
                /* Can happen in the home */
-               if (!object_aware_p(o_ptr)) continue;
-               if (!object_aware_p(j_ptr)) break;
+               if (!object_is_aware(o_ptr)) continue;
+               if (!object_is_aware(j_ptr)) break;
 
                /* Objects sort by increasing sval */
                if (o_ptr->sval < j_ptr->sval) break;
                if (o_ptr->sval > j_ptr->sval) continue;
 
                /* Objects in the home can be unknown */
-               if (!object_known_p(o_ptr)) continue;
-               if (!object_known_p(j_ptr)) break;
+               if (!object_is_known(o_ptr)) continue;
+               if (!object_is_known(j_ptr)) break;
 
                /*
                 * Hack:  otherwise identical rods sort by
@@ -1816,7 +1813,7 @@ static bool black_market_crap(object_type *o_ptr)
        int     i, j;
 
        /* Ego items are never crap */
-       if (o_ptr->name2) return (FALSE);
+       if (object_is_ego(o_ptr)) return (FALSE);
 
        /* Good items are never crap */
        if (o_ptr->to_a > 0) return (FALSE);
@@ -3702,7 +3699,7 @@ static void store_sell(void)
 
 
        /* Hack -- Cannot remove cursed items */
-       if ((item >= INVEN_RARM) && cursed_p(o_ptr))
+       if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
        {
                /* Oops */
 #ifdef JP
@@ -4922,7 +4919,7 @@ void store_shuffle(int which)
                /* Get the item */
                o_ptr = &st_ptr->stock[i];
 
-               if (!(artifact_p(o_ptr) || o_ptr->art_name))
+               if (!object_is_artifact(o_ptr))
                {
                        /* Hack -- Sell all non-artifact old items for "half price" */
                        o_ptr->discount = 50;
index 7347189..f35a1fd 100644 (file)
@@ -555,27 +555,6 @@ struct object_type
        s16b next_o_idx;        /* Next object in stack (if any) */
 
        s16b held_m_idx;        /* Monster holding us (if any) */
-
-#ifdef SCRIPT_OBJ_KIND
-       char *name;
-
-       byte d_attr;            /* Default object attribute */
-       byte d_char;            /* Default object character */
-
-
-       byte x_attr;            /* Desired object attribute */
-       byte x_char;            /* Desired object character */
-
-
-       byte flavor;                    /* Special object flavor (or zero) */
-
-       bool easy_know;         /* This object is always known (if aware) */
-
-
-       bool aware;                     /* The player is "aware" of the item's effects */
-
-       bool tried;                     /* The player has "tried" one of the items */
-#endif /* SCRIPT_OBJ_KIND */
 };
 
 
index a408e7b..25547fe 100644 (file)
@@ -1201,7 +1201,7 @@ static void analyze_misc_magic(object_type *o_ptr, cptr *misc_list)
        /*
         * Artifact lights -- large radius light.
         */
-       if ((o_ptr->tval == TV_LITE) && artifact_p(o_ptr))
+       if ((o_ptr->tval == TV_LITE) && object_is_fixed_artifact(o_ptr))
        {
 #ifdef JP
                *misc_list++ = "±Êµ×¸÷¸»(Ⱦ·Â3)";
@@ -1228,7 +1228,7 @@ static void analyze_misc_magic(object_type *o_ptr, cptr *misc_list)
         * being "lightly cursed".
         */
 
-/*     if (cursed_p(o_ptr)) */
+/*     if (object_is_cursed(o_ptr)) */
        {
                if (have_flag(flgs, TR_TY_CURSE))
                {
@@ -2552,7 +2552,7 @@ static void spoil_random_artifact_aux(object_type *o_ptr, int i)
 {
        obj_desc_list artifact;
 
-       if (!object_known_p(o_ptr) || !o_ptr->art_name
+       if (!object_is_known(o_ptr) || !o_ptr->art_name
                || o_ptr->tval != group_artifact[i].tval)
                return;
 
index 4d4ceeb..1fb2806 100644 (file)
@@ -815,7 +815,7 @@ static void wiz_tweak_item(object_type *o_ptr)
 
 
        /* Hack -- leave artifacts alone */
-       if (artifact_p(o_ptr) || o_ptr->art_name) return;
+       if (object_is_artifact(o_ptr)) return;
 
        p = "Enter new 'pval' setting: ";
        sprintf(tmp_val, "%d", o_ptr->pval);
@@ -857,7 +857,7 @@ static void wiz_reroll_item(object_type *o_ptr)
 
 
        /* Hack -- leave artifacts alone */
-       if (artifact_p(o_ptr) || o_ptr->art_name) return;
+       if (object_is_artifact(o_ptr)) return;
 
 
        /* Get local object */
@@ -877,7 +877,7 @@ static void wiz_reroll_item(object_type *o_ptr)
                if (!get_com("[a]ccept, [w]orthless, [c]ursed, [n]ormal, [g]ood, [e]xcellent, [s]pecial? ", &ch, FALSE))
                {
                        /* Preserve wizard-generated artifacts */
-                       if (artifact_p(q_ptr))
+                       if (object_is_fixed_artifact(q_ptr))
                        {
                                a_info[q_ptr->name1].cur_num = 0;
                                q_ptr->name1 = 0;
@@ -895,7 +895,7 @@ static void wiz_reroll_item(object_type *o_ptr)
                }
 
                /* Preserve wizard-generated artifacts */
-               if (artifact_p(q_ptr))
+               if (object_is_fixed_artifact(q_ptr))
                {
                        a_info[q_ptr->name1].cur_num = 0;
                        q_ptr->name1 = 0;
@@ -945,7 +945,7 @@ static void wiz_reroll_item(object_type *o_ptr)
                                apply_magic(q_ptr, dun_level, AM_GOOD | AM_GREAT | AM_SPECIAL);
 
                                /* Failed to create artifact; make a random one */
-                               if (!artifact_p(q_ptr) && !q_ptr->art_name) create_artifact(q_ptr, FALSE);
+                               if (!object_is_artifact(q_ptr)) create_artifact(q_ptr, FALSE);
                                break;
                        }
                }
@@ -1005,7 +1005,7 @@ static void wiz_statistics(object_type *o_ptr)
 
 
        /* XXX XXX XXX Mega-Hack -- allow multiple artifacts */
-       if (artifact_p(o_ptr)) a_info[o_ptr->name1].cur_num = 0;
+       if (object_is_fixed_artifact(o_ptr)) a_info[o_ptr->name1].cur_num = 0;
 
 
        /* Interact */
@@ -1087,7 +1087,7 @@ static void wiz_statistics(object_type *o_ptr)
 
 
                        /* XXX XXX XXX Mega-Hack -- allow multiple artifacts */
-                       if (artifact_p(q_ptr)) a_info[q_ptr->name1].cur_num = 0;
+                       if (object_is_fixed_artifact(q_ptr)) a_info[q_ptr->name1].cur_num = 0;
 
 
                        /* Test for the same tval and sval. */
@@ -1139,7 +1139,7 @@ static void wiz_statistics(object_type *o_ptr)
 
 
        /* Hack -- Normally only make a single artifact */
-       if (artifact_p(o_ptr)) a_info[o_ptr->name1].cur_num = 1;
+       if (object_is_fixed_artifact(o_ptr)) a_info[o_ptr->name1].cur_num = 1;
 }
 
 
@@ -1154,7 +1154,7 @@ static void wiz_quantity_item(object_type *o_ptr)
 
 
        /* Never duplicate artifacts */
-       if (artifact_p(o_ptr) || o_ptr->art_name) return;
+       if (object_is_artifact(o_ptr)) return;
 
        /* Store old quantity. -LM- */
        tmp_qnt = o_ptr->number;
index 7dc8220..9815510 100644 (file)
@@ -2834,7 +2834,7 @@ static void calc_torch(void)
                        }
 
                        /* Artifact Lites provide permanent, bright, lite */
-                       else if (artifact_p(o_ptr))
+                       else if (object_is_fixed_artifact(o_ptr))
                        {
                                p_ptr->cur_lite += 3;
                        }
@@ -3877,7 +3877,7 @@ void calc_bonuses(void)
 
                if (have_flag(flgs, TR_TELEPORT))
                {
-                       if (cursed_p(o_ptr)) p_ptr->cursed |= TRC_TELEPORT;
+                       if (object_is_cursed(o_ptr)) p_ptr->cursed |= TRC_TELEPORT;
                        else
                        {
                                cptr insc = quark_str(o_ptr->inscription);
@@ -3967,7 +3967,7 @@ void calc_bonuses(void)
                p_ptr->to_a += o_ptr->to_a;
 
                /* Apply the mental bonuses to armor class, if known */
-               if (object_known_p(o_ptr)) p_ptr->dis_to_a += o_ptr->to_a;
+               if (object_is_known(o_ptr)) p_ptr->dis_to_a += o_ptr->to_a;
 
                if (o_ptr->curse_flags & TRC_LOW_MELEE)
                {
@@ -4038,7 +4038,7 @@ void calc_bonuses(void)
                p_ptr->to_d_m += bonus_to_d;
 
                /* Apply the mental bonuses tp hit/damage, if known */
-               if (object_known_p(o_ptr)) p_ptr->dis_to_h_b += bonus_to_h;
+               if (object_is_known(o_ptr)) p_ptr->dis_to_h_b += bonus_to_h;
 
                /* To Melee */
                if ((i == INVEN_LEFT || i == INVEN_RIGHT) && !p_ptr->ryoute)
@@ -4048,7 +4048,7 @@ void calc_bonuses(void)
                        p_ptr->to_d[i-INVEN_RIGHT] += bonus_to_d;
 
                        /* Apply the mental bonuses tp hit/damage, if known */
-                       if (object_known_p(o_ptr))
+                       if (object_is_known(o_ptr))
                        {
                                p_ptr->dis_to_h[i-INVEN_RIGHT] += bonus_to_h;
                                p_ptr->dis_to_d[i-INVEN_RIGHT] += bonus_to_d;
@@ -4063,7 +4063,7 @@ void calc_bonuses(void)
                        p_ptr->to_d[1] += (bonus_to_d > 0) ? bonus_to_d/2 : bonus_to_d;
 
                        /* Apply the mental bonuses tp hit/damage, if known */
-                       if (object_known_p(o_ptr))
+                       if (object_is_known(o_ptr))
                        {
                                p_ptr->dis_to_h[0] += (bonus_to_h > 0) ? (bonus_to_h+1)/2 : bonus_to_h;
                                p_ptr->dis_to_h[1] += (bonus_to_h > 0) ? bonus_to_h/2 : bonus_to_h;
@@ -4078,7 +4078,7 @@ void calc_bonuses(void)
                        p_ptr->to_d[0] += bonus_to_d;
 
                        /* Apply the mental bonuses to hit/damage, if known */
-                       if (object_known_p(o_ptr))
+                       if (object_is_known(o_ptr))
                        {
                                p_ptr->dis_to_h[0] += bonus_to_h;
                                p_ptr->dis_to_d[0] += bonus_to_d;
index 0ea8828..7aedc6a 100644 (file)
  */
 #define SORT_R_INFO
 
-/*
- * Use a scripting language
- */
-/* #define USE_SCRIPT */
-
-#ifdef USE_SCRIPT
-/*
- * Python is statically linked into ZAngband
- */
-# define STATIC_PYTHON
-/* # define SCRIPT_OBJ_KIND */
-#endif /* USE_SCRIPT */
 
 #ifndef HAVE_CONFIG_H
+
 #ifndef MSDOS
+/*
+ * Use world score server
+ */
 #define WORLD_SCORE
 #endif
+
 #endif /* HAVE_CONFIG_H */