<ClCompile Include="..\..\src\mind\racial-kutar.c" />\r
<ClCompile Include="..\..\src\mind\stances-table.c" />\r
<ClCompile Include="..\..\src\player\bad-status-setter.c" />\r
+ <ClCompile Include="..\..\src\spell-kind\spells-curse-removal.c" />\r
<ClCompile Include="..\..\src\spell-kind\spells-recall.c" />\r
<ClCompile Include="..\..\src\spell-realm\spells-chaos.c" />\r
<ClCompile Include="..\..\src\view\display-map.c" />\r
<ClInclude Include="..\..\src\mspell\mspells3.h" />\r
<ClInclude Include="..\..\src\player\bad-status-setter.h" />\r
<ClInclude Include="..\..\src\player\special-defense-types.h" />\r
+ <ClInclude Include="..\..\src\spell-kind\spells-curse-removal.h" />\r
<ClInclude Include="..\..\src\spell-kind\spells-recall.h" />\r
<ClInclude Include="..\..\src\spell-realm\spells-chaos.h" />\r
<ClInclude Include="..\..\src\system\alloc-entries.h" />\r
<ClCompile Include="..\..\src\spell-realm\spells-chaos.c">
<Filter>spell-realm</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\spell-kind\spells-curse-removal.c">
+ <Filter>spell-kind</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\cmd\cmd-basic.h">
<ClInclude Include="..\..\src\spell-realm\spells-chaos.h">
<Filter>spell-realm</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\spell-kind\spells-curse-removal.h">
+ <Filter>spell-kind</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
spell-kind/earthquake.c spell-kind/earthquake.h \
spell-kind/spells-beam.c spell-kind/spells-beam.h \
spell-kind/spells-charm.c spell-kind/spells-charm.h \
+ spell-kind/spells-curse-removal.c spell-kind/spells-curse-removal.h \
spell-kind/spells-detection.c spell-kind/spells-detection.h \
spell-kind/spells-floor.c spell-kind/spells-floor.h \
spell-kind/spells-genocide.c spell-kind/spells-genocide.h \
#include "spell-kind/earthquake.h"
#include "spell-kind/spells-beam.h"
#include "spell-kind/spells-charm.h"
+#include "spell-kind/spells-curse-removal.h"
#include "spell-kind/spells-detection.h"
#include "spell-kind/spells-floor.h"
#include "spell-kind/spells-genocide.h"
#include "player/player-effects.h"
#include "player/player-status.h"
#include "player/special-defense-types.h"
+#include "spell-kind/spells-curse-removal.h"
#include "spell-kind/spells-detection.h"
#include "spell-kind/spells-floor.h"
#include "spell-kind/spells-genocide.h"
#include "player/player-status.h"
#include "player/special-defense-types.h"
#include "spell-kind/earthquake.h"
+#include "spell-kind/spells-curse-removal.h"
#include "spell-kind/spells-detection.h"
#include "spell-kind/spells-floor.h"
#include "spell-kind/spells-genocide.h"
#include "player/player-effects.h"
#include "player/player-status.h"
#include "player/selfinfo.h"
+#include "spell-kind/spells-curse-removal.h"
#include "spell/range-calc.h"
#include "spell/spells-object.h"
#include "spell/spells-status.h"
#include "player/bad-status-setter.h"
#include "player/player-class.h"
#include "player/player-effects.h"
-#include "spell/process-effect.h"
#include "spell-kind/spells-beam.h"
+#include "spell-kind/spells-curse-removal.h"
#include "spell-kind/spells-detection.h"
-#include "spell/spells-diceroll.h"
#include "spell-kind/spells-floor.h"
#include "spell-kind/spells-launcher.h"
#include "spell-kind/spells-neighbor.h"
-#include "spell/spells-object.h"
#include "spell-kind/spells-sight.h"
-#include "spell/spells-status.h"
-#include "spell/spells-summon.h"
#include "spell-kind/spells-teleport.h"
-#include "spell/spell-types.h"
#include "spell-realm/spells-crusade.h"
+#include "spell/process-effect.h"
+#include "spell/spell-types.h"
+#include "spell/spells-diceroll.h"
+#include "spell/spells-object.h"
+#include "spell/spells-status.h"
+#include "spell/spells-summon.h"
#include "spell/spells3.h"
#include "view/display-messages.h"
#include "world/world.h"
#include "player/bad-status-setter.h"
#include "player/player-effects.h"
#include "player/player-status.h"
+#include "spell-kind/spells-curse-removal.h"
#include "spell-kind/spells-detection.h"
#include "spell-kind/spells-floor.h"
#include "spell-kind/spells-genocide.h"
--- /dev/null
+#include "spell-kind/spells-curse-removal.h"
+#include "object-enchant/item-feeling.h"
+#include "object-enchant/special-object-flags.h"
+#include "object-enchant/trc-types.h"
+#include "object/object-hook.h"
+#include "system/object-type-definition.h"
+#include "view/display-messages.h"
+
+/*!
+ * @brief 装備の解呪処理 / Removes curses from items in inventory
+ * @param creature_ptr プレーヤーへの参照ポインタ
+ * @param all 軽い呪いまでの解除ならば0
+ * @return 解呪されたアイテムの数
+ * @details 永遠の呪いは解呪できない
+ */
+static int exe_curse_removal(player_type *creature_ptr, int all)
+{
+ int cnt = 0;
+ for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) {
+ object_type *o_ptr = &creature_ptr->inventory_list[i];
+ if (!o_ptr->k_idx)
+ continue;
+ if (!object_is_cursed(o_ptr))
+ continue;
+ if (!all && (o_ptr->curse_flags & TRC_HEAVY_CURSE))
+ continue;
+ if (o_ptr->curse_flags & TRC_PERMA_CURSE) {
+ o_ptr->curse_flags &= (TRC_CURSED | TRC_HEAVY_CURSE | TRC_PERMA_CURSE);
+ continue;
+ }
+
+ o_ptr->curse_flags = 0L;
+ o_ptr->ident |= IDENT_SENSE;
+ o_ptr->feeling = FEEL_NONE;
+
+ creature_ptr->update |= (PU_BONUS);
+ creature_ptr->window |= (PW_EQUIP);
+ cnt++;
+ }
+
+ if (cnt)
+ msg_print(_("誰かに見守られているような気がする。", "You feel as if someone is watching over you."));
+
+ return cnt;
+}
+
+/*!
+ * @brief 装備の軽い呪い解呪処理 /
+ * Remove most curses
+ * @param caster_ptr プレーヤーへの参照ポインタ
+ * @return 解呪に成功した装備数
+ */
+int remove_curse(player_type *caster_ptr) { return exe_curse_removal(caster_ptr, FALSE); }
+
+/*!
+ * @brief 装備の重い呪い解呪処理 /
+ * Remove all curses
+ * @return 解呪に成功した装備数
+ */
+int remove_all_curse(player_type *caster_ptr) { return exe_curse_removal(caster_ptr, TRUE); }
--- /dev/null
+#pragma once
+
+#include "system/angband.h"
+
+int remove_curse(player_type *caster_ptr);
+int remove_all_curse(player_type *caster_ptr);
}
/*!
- * @brief 装備の解呪処理 /
- * Removes curses from items in inventory
- * @param creature_ptr プレーヤーへの参照ポインタ
- * @param all 軽い呪いまでの解除ならば0
- * @return 解呪されたアイテムの数
- * @details
- * <pre>
- * Note that Items which are "Perma-Cursed" (The One Ring,
- * The Crown of Morgoth) can NEVER be uncursed.
- *
- * Note that if "all" is FALSE, then Items which are
- * "Heavy-Cursed" (Mormegil, Calris, and Weapons of Morgul)
- * will not be uncursed.
- * </pre>
- */
-static int remove_curse_aux(player_type *creature_ptr, int all)
-{
- int cnt = 0;
- for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) {
- object_type *o_ptr = &creature_ptr->inventory_list[i];
- if (!o_ptr->k_idx)
- continue;
- if (!object_is_cursed(o_ptr))
- continue;
- if (!all && (o_ptr->curse_flags & TRC_HEAVY_CURSE))
- continue;
- if (o_ptr->curse_flags & TRC_PERMA_CURSE) {
- o_ptr->curse_flags &= (TRC_CURSED | TRC_HEAVY_CURSE | TRC_PERMA_CURSE);
- continue;
- }
-
- o_ptr->curse_flags = 0L;
- o_ptr->ident |= (IDENT_SENSE);
- o_ptr->feeling = FEEL_NONE;
-
- creature_ptr->update |= (PU_BONUS);
- creature_ptr->window |= (PW_EQUIP);
- cnt++;
- }
-
- if (cnt)
- msg_print(_("誰かに見守られているような気がする。", "You feel as if someone is watching over you."));
-
- return cnt;
-}
-
-/*!
- * @brief 装備の軽い呪い解呪処理 /
- * Remove most curses
- * @param caster_ptr プレーヤーへの参照ポインタ
- * @return 解呪に成功した装備数
- */
-int remove_curse(player_type *caster_ptr) { return remove_curse_aux(caster_ptr, FALSE); }
-
-/*!
- * @brief 装備の重い呪い解呪処理 /
- * Remove all curses
- * @return 解呪に成功した装備数
- */
-int remove_all_curse(player_type *caster_ptr) { return remove_curse_aux(caster_ptr, TRUE); }
-
-/*!
* @brief アイテムの価値に応じた錬金術処理 /
* Turns an object into gold, gain some of its value in a shop
* @param caster_ptr プレーヤーへの参照ポインタ
#include "system/angband.h"
bool eat_magic(player_type *caster_ptr, int power);
-
bool apply_disenchant(player_type* target_ptr, BIT_FLAGS mode);
void fetch(player_type* caster_ptr, DIRECTION dir, WEIGHT wgt, bool require_los);
void reserve_alter_reality(player_type* caster_ptr);
void identify_pack(player_type* target_ptr);
-int remove_curse(player_type* caster_ptr);
-int remove_all_curse(player_type* caster_ptr);
bool alchemy(player_type* caster_ptr);
-
bool artifact_scroll(player_type* caster_ptr);
bool ident_spell(player_type* caster_ptr, bool only_equip, tval_type item_tester_tval);
bool mundane_spell(player_type* ownner_ptr, bool only_equip);