1 #include "spell-kind/spells-curse-removal.h"
2 #include "inventory/inventory-slot-types.h"
3 #include "object-enchant/item-feeling.h"
4 #include "object-enchant/special-object-flags.h"
5 #include "object-enchant/trc-types.h"
6 #include "object-hook/hook-checker.h"
7 #include "system/object-type-definition.h"
8 #include "view/display-messages.h"
11 * @brief 装備の解呪処理 / Removes curses from items in inventory
12 * @param creature_ptr プレーヤーへの参照ポインタ
13 * @param all 軽い呪いまでの解除ならば0
15 * @details 永遠の呪いは解呪できない
17 static int exe_curse_removal(player_type *creature_ptr, int all)
20 for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) {
21 object_type *o_ptr = &creature_ptr->inventory_list[i];
24 if (!object_is_cursed(o_ptr))
26 if (!all && (o_ptr->curse_flags & TRC_HEAVY_CURSE))
28 if (o_ptr->curse_flags & TRC_PERMA_CURSE) {
29 o_ptr->curse_flags &= (TRC_CURSED | TRC_HEAVY_CURSE | TRC_PERMA_CURSE);
33 o_ptr->curse_flags = 0L;
34 o_ptr->ident |= IDENT_SENSE;
35 o_ptr->feeling = FEEL_NONE;
37 creature_ptr->update |= (PU_BONUS);
38 creature_ptr->window |= (PW_EQUIP);
43 msg_print(_("誰かに見守られているような気がする。", "You feel as if someone is watching over you."));
49 * @brief 装備の軽い呪い解呪処理 /
51 * @param caster_ptr プレーヤーへの参照ポインタ
54 int remove_curse(player_type *caster_ptr) { return exe_curse_removal(caster_ptr, FALSE); }
57 * @brief 装備の重い呪い解呪処理 /
61 int remove_all_curse(player_type *caster_ptr) { return exe_curse_removal(caster_ptr, TRUE); }