4 * @brief アイテムに付加される可能性のある呪いを指定する。
6 * @param o_ptr 呪いをかけられる装備オブジェクトの構造体参照ポインタ
9 BIT_FLAGS get_curse(int power, object_type *o_ptr)
15 new_curse = (1 << (randint0(MAX_CURSE)+4));
18 if (!(new_curse & TRC_HEAVY_MASK)) continue;
22 if (new_curse & TRC_SPECIAL_MASK) continue;
26 if (new_curse & TRC_HEAVY_MASK) continue;
28 if (new_curse == TRC_LOW_MELEE && !object_is_weapon(o_ptr)) continue;
29 if (new_curse == TRC_LOW_AC && !object_is_armour(o_ptr)) continue;
36 * @brief 装備への呪い付加判定と付加処理
37 * @param chance 呪いの基本確率
38 * @param heavy_chance さらに重い呪いとなる確率
41 void curse_equipment(PERCENTAGE chance, PERCENTAGE heavy_chance)
46 BIT_FLAGS oflgs[TR_FLAG_SIZE];
47 object_type *o_ptr = &inventory[INVEN_RARM + randint0(12)];
48 GAME_TEXT o_name[MAX_NLEN];
50 if (randint1(100) > chance) return;
52 if (!o_ptr->k_idx) return;
54 object_flags(o_ptr, oflgs);
56 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
58 /* Extra, biased saving throw for blessed items */
59 if (have_flag(oflgs, TR_BLESSED))
62 msg_format("祝福された%sは呪いを跳ね返した!", o_name,
64 msg_format("Your blessed %s resist%s cursing!", o_name,
67 ((o_ptr->number > 1) ? "" : "s"));
68 /* Hmmm -- can we wear multiple items? If not, this is unnecessary */
72 if ((randint1(100) <= heavy_chance) &&
73 (object_is_artifact(o_ptr) || object_is_ego(o_ptr)))
75 if (!(o_ptr->curse_flags & TRC_HEAVY_CURSE))
77 o_ptr->curse_flags |= TRC_HEAVY_CURSE;
78 o_ptr->curse_flags |= TRC_CURSED;
83 if (!object_is_cursed(o_ptr))
85 o_ptr->curse_flags |= TRC_CURSED;
87 if (heavy_chance >= 50) curse_power++;
89 new_curse = get_curse(curse_power, o_ptr);
90 if (!(o_ptr->curse_flags & new_curse))
93 o_ptr->curse_flags |= new_curse;
98 msg_format(_("悪意に満ちた黒いオーラが%sをとりまいた...", "There is a malignant black aura surrounding %s..."), o_name);
99 o_ptr->feeling = FEEL_NONE;
101 p_ptr->update |= (PU_BONUS);