OSDN Git Service

[Refactor] #37353 IDENT_MENTAL を IDENT_FULL_KNOWN に改名。さらにマクロとして OBJECT_IS_FULL_KNOWN...
authordeskull <deskull@users.sourceforge.jp>
Sun, 16 Feb 2020 04:12:49 +0000 (13:12 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 16 Feb 2020 04:12:49 +0000 (13:12 +0900)
18 files changed:
src/artifact.c
src/autopick.c
src/cmd/cmd-dump.c
src/cmd/cmd-item.c
src/cmd/cmd-smith.c
src/files.c
src/object-flavor.c
src/object-hook.c
src/object-hook.h
src/object.h
src/object1.c
src/object2.c
src/player-effects.c
src/player-status.c
src/spells1.c
src/spells3.c
src/store.c
src/wizard1.c

index abca745..fa1428c 100644 (file)
@@ -1903,7 +1903,7 @@ bool become_random_artifact(player_type *player_ptr, object_type *o_ptr, bool a_
                object_known(o_ptr);
 
                /* Mark the item as fully known */
-               o_ptr->ident |= (IDENT_MENTAL);
+               o_ptr->ident |= (IDENT_FULL_KNOWN);
 
                /* For being treated as random artifact in screen_object() */
                o_ptr->art_name = quark_add("");
index b47cc5a..c45010d 100644 (file)
@@ -1383,7 +1383,7 @@ static bool is_autopick_aux(player_type *player_ptr, object_type *o_ptr, autopic
                return FALSE;
 
        if (IS_FLG(FLG_STAR_IDENTIFIED) &&
-               (!object_is_known(o_ptr) || !(o_ptr->ident & IDENT_MENTAL)))
+               (!object_is_known(o_ptr) || !OBJECT_IS_FULL_KNOWN(o_ptr)))
                return FALSE;
 
        if (IS_FLG(FLG_BOOSTED))
index e6a7be9..8933908 100644 (file)
@@ -3623,7 +3623,7 @@ static void do_cmd_knowledge_inven_aux(player_type *creature_ptr, FILE *fff, obj
 
        fprintf(fff, "%s %s", where, o_name);
 
-       if (!(o_ptr->ident & (IDENT_MENTAL)))
+       if (!OBJECT_IS_FULL_KNOWN(o_ptr))
        {
                fputs(_("-------不明--------------- -------不明---------\n",
                        "-------unknown------------ -------unknown------\n"), fff);
index 2bfd9e0..301f0e8 100644 (file)
@@ -807,7 +807,7 @@ void do_cmd_observe(player_type *creature_ptr)
        if (!o_ptr) return;
 
        /* Require full knowledge */
-       if (!(o_ptr->ident & IDENT_MENTAL))
+       if (!OBJECT_IS_FULL_KNOWN(o_ptr))
        {
                msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
                return;
index df94fb0..642709a 100644 (file)
@@ -608,7 +608,7 @@ static void drain_essence(player_type *creature_ptr)
        o_ptr->number = number;
        if (o_ptr->tval == TV_DRAG_ARMOR) o_ptr->timeout = old_timeout;
        if (item >= 0) creature_ptr->total_weight += (o_ptr->weight*o_ptr->number - weight * number);
-       o_ptr->ident |= (IDENT_MENTAL);
+       o_ptr->ident |= (IDENT_FULL_KNOWN);
        object_aware(creature_ptr, o_ptr);
        object_known(o_ptr);
 
index f7139ab..f6dd6d7 100644 (file)
@@ -1753,7 +1753,7 @@ static void display_player_various(player_type *creature_ptr)
                object_flags_known(o_ptr, flgs);
 
                basedam = calc_expect_crit(creature_ptr, o_ptr->weight, to_h[i], basedam, creature_ptr->dis_to_h[i], poison_needle);
-               if ((o_ptr->ident & IDENT_MENTAL) && ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)))
+               if (OBJECT_IS_FULL_KNOWN(o_ptr) && ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)))
                {
                        /* vorpal blade */
                        basedam *= 5;
index ca614cd..e6167f8 100644 (file)
@@ -1213,7 +1213,7 @@ static void get_inscription(char *buff, object_type *o_ptr)
        char *ptr = buff;
 
        /* Not fully identified */
-       if (!(o_ptr->ident & IDENT_MENTAL))
+       if (!OBJECT_IS_FULL_KNOWN(o_ptr))
        {
                /* Copy until end of line or '#' */
                while (*insc)
@@ -2733,7 +2733,7 @@ void object_desc(player_type *player_ptr, char *buf, object_type *o_ptr, BIT_FLA
        tmp_val2[0] = '\0';
 
        /* Auto abbreviation inscribe */
-       if ((abbrev_extra || abbrev_all) && (o_ptr->ident & IDENT_MENTAL))
+       if ((abbrev_extra || abbrev_all) && OBJECT_IS_FULL_KNOWN(o_ptr))
        {
                if (!o_ptr->inscription || !my_strchr(quark_str(o_ptr->inscription), '%'))
                {
index 53a10fb..2a0992d 100644 (file)
@@ -386,7 +386,7 @@ bool item_tester_hook_identify_weapon_armour(object_type *o_ptr)
 */
 bool item_tester_hook_identify_fully(object_type *o_ptr)
 {
-       return (bool)(!object_is_known(o_ptr) || !(o_ptr->ident & IDENT_MENTAL));
+       return (bool)(!object_is_known(o_ptr) || !OBJECT_IS_FULL_KNOWN(o_ptr));
 }
 
 /*!
index 61b5960..2258b40 100644 (file)
@@ -68,6 +68,8 @@ extern bool object_is_quest_target(object_type *o_ptr);
   */
 #define object_is_known(T) (((T)->ident & (IDENT_KNOWN)) || (k_info[(T)->k_idx].easy_know && k_info[(T)->k_idx].aware))
 
+#define OBJECT_IS_FULL_KNOWN(T) ((T)->ident & IDENT_FULL_KNOWN)
+
 #define OBJECT_IS_VALID(T) ((T)->k_idx != 0)
 
 #define OBJECT_IS_HELD_MONSTER(T) ((T)->held_m_idx != 0)
index f45b9b2..a7b1297 100644 (file)
@@ -320,7 +320,7 @@ struct object_type
 #define IDENT_EMPTY     0x04    /* Item charges are known */
 #define IDENT_KNOWN     0x08    /* Item abilities are known */
 #define IDENT_STORE     0x10    /* Item is storebought !!!! */
-#define IDENT_MENTAL    0x20    /* Item information is known */
+#define IDENT_FULL_KNOWN    0x20    /* Item information is known */
 #define IDENT_BROKEN    0x80    /* Item is permanently worthless */
        byte ident;                     /* Special flags  */
 
index 5b946d1..bff109c 100644 (file)
@@ -248,7 +248,7 @@ void object_flags_known(object_type *o_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
                }
        }
 
-       if (spoil || (o_ptr->ident & IDENT_MENTAL))
+       if (spoil || OBJECT_IS_FULL_KNOWN(o_ptr))
        {
                if (object_is_fixed_artifact(o_ptr))
                {
index d4f1326..9913bf9 100644 (file)
@@ -1196,7 +1196,7 @@ void object_absorb(object_type *o_ptr, object_type *j_ptr)
                if (o_ptr->ident & IDENT_STORE) o_ptr->ident &= 0xEF;
        }
 
-       if (j_ptr->ident & (IDENT_MENTAL)) o_ptr->ident |= (IDENT_MENTAL);
+       if (OBJECT_IS_FULL_KNOWN(j_ptr)) o_ptr->ident |= (IDENT_FULL_KNOWN);
        if (j_ptr->inscription) o_ptr->inscription = j_ptr->inscription;
        if (j_ptr->feeling) o_ptr->feeling = j_ptr->feeling;
        if (o_ptr->discount < j_ptr->discount) o_ptr->discount = j_ptr->discount;
@@ -1317,7 +1317,7 @@ static void object_mention(player_type *owner_ptr, object_type *o_ptr)
        object_aware(owner_ptr, o_ptr);
        object_known(o_ptr);
 
-       o_ptr->ident |= (IDENT_MENTAL);
+       o_ptr->ident |= (IDENT_FULL_KNOWN);
        GAME_TEXT o_name[MAX_NLEN];
        object_desc(owner_ptr, o_name, o_ptr, 0);
        msg_format_wizard(CHEAT_OBJECT, _("%sを生成しました。", "%s was generated."), o_name);
index 8816205..98af10f 100644 (file)
@@ -3206,7 +3206,7 @@ bool lose_all_info(player_type *creature_ptr)
        {
                object_type *o_ptr = &creature_ptr->inventory_list[i];
                if (!o_ptr->k_idx) continue;
-               if (o_ptr->ident & (IDENT_MENTAL)) continue;
+               if (OBJECT_IS_FULL_KNOWN(o_ptr)) continue;
 
                o_ptr->feeling = FEEL_NONE;
                o_ptr->ident &= ~(IDENT_EMPTY);
index 62fa10f..04160b6 100644 (file)
@@ -2334,12 +2334,12 @@ void calc_bonuses(player_type *creature_ptr)
                                if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
                                {
                                        creature_ptr->to_h[slot] -= 15;
-                                       if (o_ptr->ident & IDENT_MENTAL) creature_ptr->dis_to_h[slot] -= 15;
+                                       if (OBJECT_IS_FULL_KNOWN(o_ptr)) creature_ptr->dis_to_h[slot] -= 15;
                                }
                                else
                                {
                                        creature_ptr->to_h[slot] -= 5;
-                                       if (o_ptr->ident & IDENT_MENTAL) creature_ptr->dis_to_h[slot] -= 5;
+                                       if (OBJECT_IS_FULL_KNOWN(o_ptr)) creature_ptr->dis_to_h[slot] -= 5;
                                }
                        }
                        else
@@ -2347,12 +2347,12 @@ void calc_bonuses(player_type *creature_ptr)
                                if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
                                {
                                        creature_ptr->to_h_b -= 15;
-                                       if (o_ptr->ident & IDENT_MENTAL) creature_ptr->dis_to_h_b -= 15;
+                                       if (OBJECT_IS_FULL_KNOWN(o_ptr)) creature_ptr->dis_to_h_b -= 15;
                                }
                                else
                                {
                                        creature_ptr->to_h_b -= 5;
-                                       if (o_ptr->ident & IDENT_MENTAL) creature_ptr->dis_to_h_b -= 5;
+                                       if (OBJECT_IS_FULL_KNOWN(o_ptr)) creature_ptr->dis_to_h_b -= 5;
                                }
                        }
                }
@@ -2362,12 +2362,12 @@ void calc_bonuses(player_type *creature_ptr)
                        if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
                        {
                                creature_ptr->to_a -= 30;
-                               if (o_ptr->ident & IDENT_MENTAL) creature_ptr->dis_to_a -= 30;
+                               if (OBJECT_IS_FULL_KNOWN(o_ptr)) creature_ptr->dis_to_a -= 30;
                        }
                        else
                        {
                                creature_ptr->to_a -= 10;
-                               if (o_ptr->ident & IDENT_MENTAL) creature_ptr->dis_to_a -= 10;
+                               if (OBJECT_IS_FULL_KNOWN(o_ptr)) creature_ptr->dis_to_a -= 10;
                        }
                }
 
index 0272ab5..d4a0fd1 100644 (file)
@@ -3441,7 +3441,7 @@ static bool project_m(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                q_ptr = &forge;
                object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
                q_ptr->pval = photo;
-               q_ptr->ident |= (IDENT_MENTAL);
+               q_ptr->ident |= (IDENT_FULL_KNOWN);
                (void)drop_near(caster_ptr, q_ptr, -1, caster_ptr->y, caster_ptr->x);
        }
 
index 22cb4a7..920c9e2 100644 (file)
@@ -1490,7 +1490,7 @@ bool identify_item(player_type *owner_ptr, object_type *o_ptr)
        if (o_ptr->ident & IDENT_KNOWN)
                old_known = TRUE;
 
-       if (!(o_ptr->ident & (IDENT_MENTAL)))
+       if (!OBJECT_IS_FULL_KNOWN(o_ptr))
        {
                if (object_is_artifact(o_ptr) || one_in_(5))
                        chg_virtue(owner_ptr, V_KNOWLEDGE, 1);
@@ -1665,7 +1665,7 @@ bool identify_fully(player_type *caster_ptr, bool only_equip)
 
        bool old_known = identify_item(caster_ptr, o_ptr);
 
-       o_ptr->ident |= (IDENT_MENTAL);
+       o_ptr->ident |= (IDENT_FULL_KNOWN);
        handle_stuff(caster_ptr);
 
        GAME_TEXT o_name[MAX_NLEN];
index 3531ce4..7dc9d5a 100644 (file)
@@ -2951,7 +2951,7 @@ static int store_carry(object_type *o_ptr)
 {
        PRICE value = object_value(o_ptr);
        if (value <= 0) return -1;
-       o_ptr->ident |= IDENT_MENTAL;
+       o_ptr->ident |= IDENT_FULL_KNOWN;
        o_ptr->inscription = 0;
        o_ptr->feeling = FEEL_NONE;
        int slot;
@@ -4406,7 +4406,7 @@ static void store_sell(player_type *owner_ptr)
                if (!get_check(format(_("本当に%sを寄贈しますか?", "Really give %s to the Museum? "), o2_name))) return;
 
                identify_item(owner_ptr, q_ptr);
-               q_ptr->ident |= IDENT_MENTAL;
+               q_ptr->ident |= IDENT_FULL_KNOWN;
 
                distribute_charges(o_ptr, q_ptr, amt);
                msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
@@ -4474,7 +4474,7 @@ static void store_examine(player_type *player_ptr)
        item = item + store_top;
        object_type *o_ptr;
        o_ptr = &st_ptr->stock[item];
-       if (!(o_ptr->ident & IDENT_MENTAL))
+       if (!OBJECT_IS_FULL_KNOWN(o_ptr))
        {
                msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
                return;
index 5fabb60..21116a0 100644 (file)
@@ -2408,7 +2408,7 @@ static void spoiler_print_randart(object_type *o_ptr, obj_desc_list *art_ptr)
        fprintf(fff, "%s\n", art_ptr->description);
 
        /* unidentified */
-       if (!(o_ptr->ident & (IDENT_MENTAL)))
+       if (!OBJECT_IS_FULL_KNOWN(o_ptr))
        {
                fprintf(fff, _("%s不明\n", "%sUnknown\n"), INDENT1);
        }