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