#include "angband.h"
+#include "util.h"
+
#include "avatar.h"
+#include "spells.h"
#include "spells-status.h"
-
+#include "player-status.h"
+#include "player-effects.h"
+#include "player-class.h"
+#include "objectkind.h"
+#include "object-hook.h"
+#include "cmd-basic.h"
+#include "floor.h"
+#include "targeting.h"
+#include "view-mainwindow.h"
/*!
* @brief 魔法棒の効果を発動する
* Handle "unstacking" in a logical manner.
* For simplicity, you cannot use a stack of items from the
* ground. This would require too much nasty code.
-* There are no wands which can "destroy" themselves, in the inventory
+* There are no wands which can "destroy" themselves, in the p_ptr->inventory_list
* or on the ground, so we can ignore this possibility. Note that this
* required giving "wand of wonder" the ability to ignore destruction
* by electric balls.
/* Get the item (in the pack) */
if (item >= 0)
{
- o_ptr = &inventory[item];
+ o_ptr = &p_ptr->inventory_list[item];
}
/* Get the item (on the floor) */
else
{
- o_ptr = &o_list[0 - item];
+ o_ptr = ¤t_floor_ptr->o_list[0 - item];
}
/* Mega-Hack -- refuse to aim a pile from the ground */
}
target_pet = old_target_pet;
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);
/* Get the level */
lev = k_info[o_ptr->k_idx].level;
if (p_ptr->wild_mode) return;
if (cmd_limit_arena(p_ptr)) return;
-
- /* Restrict choices to wands */
- item_tester_tval = TV_WAND;
-
if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
{
set_action(ACTION_NONE);
q = _("どの魔法棒で狙いますか? ", "Aim which wand? ");
s = _("使える魔法棒がない。", "You have no wand to aim.");
- if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
+ if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), TV_WAND)) return;
do_cmd_aim_wand_aux(item);
}