OSDN Git Service

階の雰囲気計算で, 判明した薬や上位魔法書などが雰囲気に反映されないと
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 7 Aug 2004 03:03:58 +0000 (03:03 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 7 Aug 2004 03:03:58 +0000 (03:03 +0000)
いう問題があったため, アイテムに "プレイヤーが触った" という意味のフ
ラグOM_TOUCHEDを持たせ, これをチェックすることで上記の問題を修正.

フラグOM_FOUNDは以下のいずれかの時にそのアイテムに立てられる.
* プレイヤーがザックに入れた, または装備した.
* プレイヤーが鑑定した.

これを用い, ダンジョンのアイテムが鑑定されていても, OM_FOUNDがないア
イテムは計算するように修正. 武器等で鑑定されていないアイテムは1度プレ
イヤーがザックに入れてから床に置いても再び計算対象となる.

セーブデータをロードした直後のダンジョンでは鑑定済みのエゴアイテム等
で雰囲気が高く評価される場合があるが, そのダンジョンだけなので特に
セーブデータ変換は行わない.

src/cmd1.c
src/cmd2.c
src/cmd3.c
src/defines.h
src/dungeon.c
src/load.c
src/melee1.c
src/melee2.c
src/object2.c
src/spells3.c

index 16a64d7..0c43bcc 100644 (file)
@@ -2876,7 +2876,7 @@ static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int
 
                                        object_desc(o_name, q_ptr, OD_NAME_ONLY);
                                        q_ptr->held_m_idx = 0;
 
                                        object_desc(o_name, q_ptr, OD_NAME_ONLY);
                                        q_ptr->held_m_idx = 0;
-                                       q_ptr->marked = 0;
+                                       q_ptr->marked = OM_TOUCHED;
                                        m_ptr->hold_o_idx = q_ptr->next_o_idx;
                                        q_ptr->next_o_idx = 0;
 #ifdef JP
                                        m_ptr->hold_o_idx = q_ptr->next_o_idx;
                                        q_ptr->next_o_idx = 0;
 #ifdef JP
index c04707d..e7ae13b 100644 (file)
@@ -3746,7 +3746,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
                object_copy(o_ptr, q_ptr);
 
                /* Forget mark */
                object_copy(o_ptr, q_ptr);
 
                /* Forget mark */
-               o_ptr->marked = 0;
+               o_ptr->marked &= OM_TOUCHED;
 
                /* Forget location */
                o_ptr->iy = o_ptr->ix = 0;
 
                /* Forget location */
                o_ptr->iy = o_ptr->ix = 0;
index 42e7e3a..6317993 100644 (file)
@@ -530,6 +530,9 @@ msg_print("
        /* Wear the new stuff */
        object_copy(o_ptr, q_ptr);
 
        /* Wear the new stuff */
        object_copy(o_ptr, q_ptr);
 
+       /* Player touches it */
+       o_ptr->marked |= OM_TOUCHED;
+
        /* Increase the weight */
        p_ptr->total_weight += q_ptr->weight;
 
        /* Increase the weight */
        p_ptr->total_weight += q_ptr->weight;
 
index b04bffa..0aff7a9 100644 (file)
 #define OM_NOMSG        0x02    /* temporary flag to suppress messages */
 #define OM_NO_QUERY     0x04    /* Query for auto-pick was already answered as 'No' */
 #define OM_AUTODESTROY  0x08    /* Destroy later to avoid illegal inventry shift */
 #define OM_NOMSG        0x02    /* temporary flag to suppress messages */
 #define OM_NO_QUERY     0x04    /* Query for auto-pick was already answered as 'No' */
 #define OM_AUTODESTROY  0x08    /* Destroy later to avoid illegal inventry shift */
+#define OM_TOUCHED      0x10    /* Object was touched by player */
 
 
 /*
 
 
 /*
index ab694c8..46a54c5 100644 (file)
@@ -1277,6 +1277,9 @@ msg_format("%s
        /* "Inscribe" it */
        o_ptr->feeling = feel;
 
        /* "Inscribe" it */
        o_ptr->feeling = feel;
 
+       /* Player touches it */
+       o_ptr->marked |= OM_TOUCHED;
+
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
@@ -3524,7 +3527,11 @@ static byte get_dungeon_feeling(void)
                if (!o_ptr->k_idx) continue;
 
                /* Skip known objects */
                if (!o_ptr->k_idx) continue;
 
                /* Skip known objects */
-               if (object_is_known(o_ptr)) continue;
+               if (object_is_known(o_ptr))
+               {
+                       /* Touched? */
+                       if (o_ptr->marked & OM_TOUCHED) continue;
+               }
 
                /* Skip pseudo-known objects */
                if (o_ptr->ident & IDENT_SENSE) continue;
 
                /* Skip pseudo-known objects */
                if (o_ptr->ident & IDENT_SENSE) continue;
index 5618e13..b33d085 100644 (file)
@@ -2181,6 +2181,9 @@ static errr rd_inventory(void)
                /* Wield equipment */
                if (n >= INVEN_RARM)
                {
                /* Wield equipment */
                if (n >= INVEN_RARM)
                {
+                       /* Player touches it */
+                       q_ptr->marked |= OM_TOUCHED;
+
                        /* Copy object */
                        object_copy(&inventory[n], q_ptr);
 
                        /* Copy object */
                        object_copy(&inventory[n], q_ptr);
 
@@ -2212,6 +2215,9 @@ note("
                        /* Get a slot */
                        n = slot++;
 
                        /* Get a slot */
                        n = slot++;
 
+                       /* Player touches it */
+                       q_ptr->marked |= OM_TOUCHED;
+
                        /* Copy object */
                        object_copy(&inventory[n], q_ptr);
 
                        /* Copy object */
                        object_copy(&inventory[n], q_ptr);
 
index 87f0eb1..7f5feef 100644 (file)
@@ -1032,7 +1032,7 @@ bool make_attack_normal(int m_idx)
                                                        }
 
                                                        /* Forget mark */
                                                        }
 
                                                        /* Forget mark */
-                                                       j_ptr->marked = 0;
+                                                       j_ptr->marked = OM_TOUCHED;
 
                                                        /* Memorize monster */
                                                        j_ptr->held_m_idx = m_idx;
 
                                                        /* Memorize monster */
                                                        j_ptr->held_m_idx = m_idx;
index 8a0cb63..6dfbc19 100644 (file)
@@ -3440,7 +3440,7 @@ msg_format("%^s%s", m_name, monmessage);
                                                excise_object_idx(this_o_idx);
 
                                                /* Forget mark */
                                                excise_object_idx(this_o_idx);
 
                                                /* Forget mark */
-                                               o_ptr->marked = 0;
+                                               o_ptr->marked &= OM_TOUCHED;
 
                                                /* Forget location */
                                                o_ptr->iy = o_ptr->ix = 0;
 
                                                /* Forget location */
                                                o_ptr->iy = o_ptr->ix = 0;
index bb5d51d..2a4f121 100644 (file)
@@ -5892,8 +5892,8 @@ s16b inven_carry(object_type *o_ptr)
        /* Forget location */
        j_ptr->iy = j_ptr->ix = 0;
 
        /* Forget location */
        j_ptr->iy = j_ptr->ix = 0;
 
-       /* No longer marked */
-       j_ptr->marked = 0;
+       /* Player touches it, and no longer marked */
+       j_ptr->marked = OM_TOUCHED;
 
        /* Increase the weight */
        p_ptr->total_weight += (j_ptr->number * j_ptr->weight);
 
        /* Increase the weight */
        p_ptr->total_weight += (j_ptr->number * j_ptr->weight);
index 68264b9..c918dd3 100644 (file)
@@ -2782,6 +2782,9 @@ bool identify_item(object_type *o_ptr)
        object_aware(o_ptr);
        object_known(o_ptr);
 
        object_aware(o_ptr);
        object_known(o_ptr);
 
+       /* Player touches it */
+       o_ptr->marked |= OM_TOUCHED;
+
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);