<ClCompile Include="..\..\src\mutation\mutation-investor-remover.c" />\r
<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-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\mutation\mutation-investor-remover.h" />\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-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-bolt-ball.c">
<Filter>object-activation</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\object-activation\activation-charm.c">
+ <Filter>object-activation</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\combat\shoot.h">
<ClInclude Include="..\..\src\object-activation\activation-bolt-ball.h">
<Filter>object-activation</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\object-activation\activation-charm.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-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-charm.h"
+#include "spell-kind/spells-charm.h"
+#include "spell-kind/spells-sight.h"
+#include "target/target-getter.h"
+
+bool activate_charm_animal(player_type *user_ptr)
+{
+ DIRECTION dir;
+ if (!get_aim_dir(user_ptr, &dir))
+ return FALSE;
+
+ (void)charm_animal(user_ptr, dir, user_ptr->lev);
+ return TRUE;
+}
+
+bool activate_charm_undead(player_type *user_ptr)
+{
+ DIRECTION dir;
+ if (!get_aim_dir(user_ptr, &dir))
+ return FALSE;
+
+ (void)control_one_undead(user_ptr, dir, user_ptr->lev);
+ return TRUE;
+}
+
+bool activate_charm_other(player_type *user_ptr)
+{
+ DIRECTION dir;
+ if (!get_aim_dir(user_ptr, &dir))
+ return FALSE;
+
+ (void)charm_monster(user_ptr, dir, user_ptr->lev * 2);
+ return TRUE;
+}
+
+bool activate_charm_animals(player_type *user_ptr)
+{
+ (void)charm_animals(user_ptr, user_ptr->lev * 2);
+ return TRUE;
+}
+
+bool activate_charm_others(player_type *user_ptr)
+{
+ (void)charm_monsters(user_ptr, user_ptr->lev * 2);
+ return TRUE;
+}
--- /dev/null
+#pragma once
+
+#include "system/angband.h"
+
+bool activate_charm_animal(player_type *user_ptr);
+bool activate_charm_undead(player_type *user_ptr);
+bool activate_charm_other(player_type *user_ptr);
+bool activate_charm_animals(player_type *user_ptr);
+bool activate_charm_others(player_type *user_ptr);
#include "monster/smart-learn-types.h"
#include "object-activation/activation-bolt-ball.h"
#include "object-activation/activation-breath.h"
+#include "object-activation/activation-charm.h"
#include "object-enchant/activation-info-table.h"
#include "object-enchant/dragon-breaths-table.h"
#include "object-enchant/object-ego.h"
case ACT_AGGRAVATE:
return activate_aggravation(user_ptr, o_ptr, name);
case ACT_CHARM_ANIMAL:
- if (!get_aim_dir(user_ptr, &dir))
- return FALSE;
-
- (void)charm_animal(user_ptr, dir, user_ptr->lev);
- return TRUE;
+ return activate_charm_animal(user_ptr);
case ACT_CHARM_UNDEAD:
- if (!get_aim_dir(user_ptr, &dir))
- return FALSE;
-
- (void)control_one_undead(user_ptr, dir, user_ptr->lev);
- return TRUE;
+ return activate_charm_undead(user_ptr);
case ACT_CHARM_OTHER:
- if (!get_aim_dir(user_ptr, &dir))
- return FALSE;
-
- (void)charm_monster(user_ptr, dir, user_ptr->lev * 2);
- return TRUE;
+ return activate_charm_other(user_ptr);
case ACT_CHARM_ANIMALS:
- (void)charm_animals(user_ptr, user_ptr->lev * 2);
- return TRUE;
+ return activate_charm_animals(user_ptr);
case ACT_CHARM_OTHERS:
- (void)charm_monsters(user_ptr, user_ptr->lev * 2);
- return TRUE;
+ return activate_charm_others(user_ptr);
case ACT_SUMMON_ANIMAL:
(void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->lev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET));
return TRUE;