<ClCompile Include="..\..\src\object-activation\activation-bolt-ball.c" />\r
<ClCompile Include="..\..\src\object-activation\activation-breath.c" />\r
<ClCompile Include="..\..\src\object-activation\activation-charm.c" />\r
+ <ClCompile Include="..\..\src\object-activation\activation-resistance.c" />\r
<ClCompile Include="..\..\src\object-use\read-execution.c" />\r
<ClCompile Include="..\..\src\player\player-status-flags.c" />\r
<ClCompile Include="..\..\src\player\player-status-table.c" />\r
<ClInclude Include="..\..\src\object-activation\activation-bolt-ball.h" />\r
<ClInclude Include="..\..\src\object-activation\activation-breath.h" />\r
<ClInclude Include="..\..\src\object-activation\activation-charm.h" />\r
+ <ClInclude Include="..\..\src\object-activation\activation-resistance.h" />\r
<ClInclude Include="..\..\src\object-use\read-execution.h" />\r
<ClInclude Include="..\..\src\player\player-status-flags.h" />\r
<ClInclude Include="..\..\src\player\player-status-table.h" />\r
<ClCompile Include="..\..\src\object-activation\activation-charm.c">
<Filter>object-activation</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\object-activation\activation-resistance.c">
+ <Filter>object-activation</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\combat\shoot.h">
<ClInclude Include="..\..\src\object-activation\activation-charm.h">
<Filter>object-activation</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\object-activation\activation-resistance.h">
+ <Filter>object-activation</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
object-activation/activation-bolt-ball.c object-activation/activation-bolt-ball.h \
object-activation/activation-breath.c object-activation/activation-breath.h \
object-activation/activation-charm.c object-activation/activation-charm.h \
+ object-activation/activation-resistance.c object-activation/activation-resistance.h \
object-activation/activation-switcher.c object-activation/activation-switcher.h \
\
object-enchant/activation-info-table.c object-enchant/activation-info-table.h \
--- /dev/null
+#include "object-activation/activation-resistance.h"
+#include "spell-kind/spells-launcher.h"
+#include "spell/spell-types.h"
+#include "status/element-resistance.h"
+#include "sv-definition/sv-ring-types.h"
+#include "system/object-type-definition.h"
+#include "target/target-getter.h"
+#include "view/display-messages.h"
+
+bool activate_resistance_elements(player_type *user_ptr)
+{
+ msg_print(_("\97l\81X\82È\90F\82É\8bP\82¢\82Ä\82¢\82é...", "It glows many colours..."));
+ (void)set_oppose_acid(user_ptr, randint1(40) + 40, FALSE);
+ (void)set_oppose_elec(user_ptr, randint1(40) + 40, FALSE);
+ (void)set_oppose_fire(user_ptr, randint1(40) + 40, FALSE);
+ (void)set_oppose_cold(user_ptr, randint1(40) + 40, FALSE);
+ (void)set_oppose_pois(user_ptr, randint1(40) + 40, FALSE);
+ return TRUE;
+}
+
+/*!
+ * @brief \83A\83V\83b\83h\81E\83{\81[\83\8b\82ð\95ú\82¿\81A\8dX\82É\8e_\91Ï\90«\82ð\93¾\82é
+ * @param user_ptr \83v\83\8c\81[\83\84\81[\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param o_ptr \94\93®\91Î\8fÛ\83A\83C\83e\83\80\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param name \83A\83C\83e\83\80\96¼
+ * @return \83{\81[\83\8b\82ð\93\96\82Ä\82ç\82ê\82é\82È\82ç\82ÎTRUE
+ */
+bool activate_resistance_acid(player_type *user_ptr, object_type *o_ptr, concptr name)
+{
+ msg_format(_("%s\82ª\8d\95\82\8bP\82¢\82½...", "The %s grows black."), name);
+ if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_ACID))
+ return TRUE;
+
+ DIRECTION dir;
+ if (!get_aim_dir(user_ptr, &dir))
+ return FALSE;
+
+ (void)fire_ball(user_ptr, GF_ACID, dir, 100, 2);
+ (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
+ return TRUE;
+}
+
+/*!
+ * @brief \83T\83\93\83_\81[\81E\83{\81[\83\8b\82ð\95ú\82¿\81A\8dX\82É\93d\8c\82\91Ï\90«\82ð\93¾\82é
+ * @param user_ptr \83v\83\8c\81[\83\84\81[\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param o_ptr \94\93®\91Î\8fÛ\83A\83C\83e\83\80\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param name \83A\83C\83e\83\80\96¼
+ * @return \83{\81[\83\8b\82ð\93\96\82Ä\82ç\82ê\82é\82È\82ç\82ÎTRUE
+ */
+bool activate_resistance_elec(player_type *user_ptr, object_type *o_ptr, concptr name)
+{
+ msg_format(_("%s\82ª\90Â\82\8bP\82¢\82½...", "The %s grows blue."), name);
+ if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_ELEC))
+ return TRUE;
+
+ DIRECTION dir;
+ if (!get_aim_dir(user_ptr, &dir))
+ return FALSE;
+
+ (void)fire_ball(user_ptr, GF_ELEC, dir, 100, 2);
+ (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
+ return TRUE;
+}
+
+/*!
+ * @brief \83t\83@\83C\83A\81E\83{\81[\83\8b\82ð\95ú\82¿\81A\8dX\82É\89Î\89\8a\91Ï\90«\82ð\93¾\82é
+ * @param user_ptr \83v\83\8c\81[\83\84\81[\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param o_ptr \94\93®\91Î\8fÛ\83A\83C\83e\83\80\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param name \83A\83C\83e\83\80\96¼
+ * @return \83{\81[\83\8b\82ð\93\96\82Ä\82ç\82ê\82é\82È\82ç\82ÎTRUE
+ */
+bool activate_resistance_fire(player_type *user_ptr, object_type *o_ptr, concptr name)
+{
+ msg_format(_("%s\82ª\90Ô\82\8bP\82¢\82½...", "The %s grows red."), name);
+ if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_FLAMES))
+ return TRUE;
+
+ DIRECTION dir;
+ if (!get_aim_dir(user_ptr, &dir))
+ return FALSE;
+
+ (void)fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
+ (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
+ return TRUE;
+}
+
+/*!
+ * @brief \83A\83C\83X\81E\83{\81[\83\8b\82ð\95ú\82¿\81A\8dX\82É\97â\8bC\91Ï\90«\82ð\93¾\82é
+ * @param user_ptr \83v\83\8c\81[\83\84\81[\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param o_ptr \94\93®\91Î\8fÛ\83A\83C\83e\83\80\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param name \83A\83C\83e\83\80\96¼
+ * @return \83{\81[\83\8b\82ð\93\96\82Ä\82ç\82ê\82é\82È\82ç\82ÎTRUE
+ */
+bool activate_resistance_cold(player_type *user_ptr, object_type *o_ptr, concptr name)
+{
+ msg_format(_("%s\82ª\94\92\82\8bP\82¢\82½...", "The %s grows white."), name);
+ if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_ICE))
+ return TRUE;
+
+ DIRECTION dir;
+ if (!get_aim_dir(user_ptr, &dir))
+ return FALSE;
+
+ (void)fire_ball(user_ptr, GF_COLD, dir, 100, 2);
+ (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
+ return TRUE;
+}
+
+/*!
+ * todo \89½\82©\92Ç\89Á\8cø\89Ê\82ª\97~\82µ\82¢
+ * @brief \93Å\91Ï\90«\82ð\93¾\82é
+ * @param user_ptr \83v\83\8c\81[\83\84\81[\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param name \83A\83C\83e\83\80\96¼
+ * @return \8fí\82ÉTRUE
+ */
+bool activate_resistance_pois(player_type *user_ptr, concptr name)
+{
+ msg_format(_("%s\82ª\97Î\82É\8bP\82¢\82½...", "The %s grows green."), name);
+ (void)set_oppose_pois(user_ptr, randint1(20) + 20, FALSE);
+ return TRUE;
+}
--- /dev/null
+#pragma once
+
+#include "system/angband.h"
+
+bool activate_resistance_elements(player_type *user_ptr);
+bool activate_resistance_acid(player_type *user_ptr, object_type *o_ptr, concptr name);
+bool activate_resistance_elec(player_type *user_ptr, object_type *o_ptr, concptr name);
+bool activate_resistance_fire(player_type *user_ptr, object_type *o_ptr, concptr name);
+bool activate_resistance_cold(player_type *user_ptr, object_type *o_ptr, concptr name);
+bool activate_resistance_pois(player_type *user_ptr, concptr name);
#include "object-activation/activation-bolt-ball.h"
#include "object-activation/activation-breath.h"
#include "object-activation/activation-charm.h"
+#include "object-activation/activation-resistance.h"
#include "object-enchant/activation-info-table.h"
#include "object-enchant/dragon-breaths-table.h"
#include "object-enchant/object-ego.h"
(void)set_protevil(user_ptr, randint1(25) + user_ptr->lev * 3, FALSE);
return TRUE;
case ACT_RESIST_ALL:
- msg_print(_("様々な色に輝いている...", "It glows many colours..."));
- (void)set_oppose_acid(user_ptr, randint1(40) + 40, FALSE);
- (void)set_oppose_elec(user_ptr, randint1(40) + 40, FALSE);
- (void)set_oppose_fire(user_ptr, randint1(40) + 40, FALSE);
- (void)set_oppose_cold(user_ptr, randint1(40) + 40, FALSE);
- (void)set_oppose_pois(user_ptr, randint1(40) + 40, FALSE);
- return TRUE;
+ return activate_resistance_elements(user_ptr);
case ACT_SPEED:
msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
(void)set_fast(user_ptr, randint1(20) + 20, FALSE);
(void)heroism(user_ptr, 50);
return TRUE;
case ACT_RESIST_ACID:
- msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
- if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_ACID))
- return TRUE;
-
- if (!get_aim_dir(user_ptr, &dir))
- return FALSE;
-
- (void)fire_ball(user_ptr, GF_ACID, dir, 100, 2);
- (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
- return TRUE;
+ return activate_resistance_acid(user_ptr, o_ptr, name);
case ACT_RESIST_FIRE:
- msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
- if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_FLAMES))
- return TRUE;
-
- if (!get_aim_dir(user_ptr, &dir))
- return FALSE;
-
- (void)fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
- (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
- return TRUE;
+ return activate_resistance_fire(user_ptr, o_ptr, name);
case ACT_RESIST_COLD:
- msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
- if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_ICE))
- return TRUE;
-
- if (!get_aim_dir(user_ptr, &dir))
- return FALSE;
-
- (void)fire_ball(user_ptr, GF_COLD, dir, 100, 2);
- (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
- return TRUE;
+ return activate_resistance_cold(user_ptr, o_ptr, name);
case ACT_RESIST_ELEC:
- msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
- if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_ELEC))
- return TRUE;
-
- if (!get_aim_dir(user_ptr, &dir))
- return FALSE;
-
- (void)fire_ball(user_ptr, GF_ELEC, dir, 100, 2);
- (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
- return TRUE;
+ return activate_resistance_elec(user_ptr, o_ptr, name);
case ACT_RESIST_POIS:
- msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
- (void)set_oppose_pois(user_ptr, randint1(20) + 20, FALSE);
- return TRUE;
+ return activate_resistance_pois(user_ptr, name);
case ACT_LIGHT:
msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
lite_area(user_ptr, damroll(2, 15), 3);