1 #include "spell-kind/spells-curse-removal.h"
2 #include "core/window-redrawer.h"
3 #include "inventory/inventory-slot-types.h"
4 #include "object-enchant/item-feeling.h"
5 #include "object-enchant/special-object-flags.h"
6 #include "object-enchant/trc-types.h"
7 #include "system/item-entity.h"
8 #include "system/player-type-definition.h"
9 #include "system/redrawing-flags-updater.h"
10 #include "view/display-messages.h"
13 * @brief 装備の解呪処理 / Removes curses from items in inventory
14 * @param player_ptr プレイヤーへの参照ポインタ
15 * @param all 軽い呪いまでの解除ならば0
17 * @details 永遠の呪いは解呪できない
19 static int exe_curse_removal(PlayerType *player_ptr, int all)
22 auto &rfu = RedrawingFlagsUpdater::get_instance();
23 for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
24 auto *o_ptr = &player_ptr->inventory_list[i];
25 if (!o_ptr->is_valid() || !o_ptr->is_cursed()) {
29 if (!all && o_ptr->curse_flags.has(CurseTraitType::HEAVY_CURSE)) {
33 if (o_ptr->curse_flags.has(CurseTraitType::PERMA_CURSE)) {
34 o_ptr->curse_flags &= { CurseTraitType::CURSED, CurseTraitType::HEAVY_CURSE, CurseTraitType::PERMA_CURSE };
38 o_ptr->curse_flags.clear();
39 o_ptr->ident |= IDENT_SENSE;
40 o_ptr->feeling = FEEL_NONE;
41 rfu.set_flag(StatusRedrawingFlag::BONUS);
42 player_ptr->window_flags |= (PW_EQUIPMENT);
47 msg_print(_("誰かに見守られているような気がする。", "You feel as if someone is watching over you."));
54 * @brief 装備の軽い呪い解呪処理 /
56 * @param player_ptr プレイヤーへの参照ポインタ
59 int remove_curse(PlayerType *player_ptr)
61 return exe_curse_removal(player_ptr, false);
65 * @brief 装備の重い呪い解呪処理 /
69 int remove_all_curse(PlayerType *player_ptr)
71 return exe_curse_removal(player_ptr, true);