*/
#include "angband.h"
+#include "bldg.h"
+#include "util.h"
+
+#include "dungeon.h"
#include "floor.h"
+#include "floor-town.h"
#include "object-boost.h"
#include "object-flavor.h"
#include "object-hook.h"
#include "melee.h"
#include "player-move.h"
#include "player-status.h"
+#include "player-class.h"
#include "spells-summon.h"
#include "quest.h"
#include "artifact.h"
#include "spells.h"
#include "spells-floor.h"
#include "grid.h"
+#include "monster-process.h"
#include "monster-status.h"
#include "monster-spell.h"
#include "cmd-spell.h"
+#include "cmd-dump.h"
#include "snipe.h"
+#include "floor-save.h"
+#include "files.h"
+#include "player-effects.h"
+#include "player-skill.h"
+#include "view-mainwindow.h"
+#include "mind.h"
+#include "wild.h"
+#include "world.h"
+#include "objectkind.h"
+#include "autopick.h"
+#include "targeting.h"
/*! テレポート先探索の試行数 / Maximum number of tries for teleporting */
sound(SOUND_TELEPORT);
#ifdef JP
- if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
+ if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (p_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
msg_format("『こっちだぁ、%s』", p_ptr->name);
#endif
for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
- o_ptr = &inventory[i];
+ o_ptr = &p_ptr->inventory_list[i];
if (o_ptr->k_idx && !object_is_cursed(o_ptr))
{
object_flags(o_ptr, flgs);
case 8: t = INVEN_FEET; break;
}
- o_ptr = &inventory[t];
+ o_ptr = &p_ptr->inventory_list[t];
/* No item, nothing happens */
if (!o_ptr->k_idx) return (FALSE);
/* Simply identify and know every item */
for (i = 0; i < INVEN_TOTAL; i++)
{
- object_type *o_ptr = &inventory[i];
-
- /* Skip non-objects */
+ object_type *o_ptr = &p_ptr->inventory_list[i];
if (!o_ptr->k_idx) continue;
identify_item(o_ptr);
/*!
* @brief 装備の解呪処理 /
- * Removes curses from items in inventory
+ * Removes curses from items in p_ptr->inventory_list
* @param all 軽い呪いまでの解除ならば0
* @return 解呪されたアイテムの数
* @details
/* Attempt to uncurse items being worn */
for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
- object_type *o_ptr = &inventory[i];
-
- /* Skip non-objects */
+ object_type *o_ptr = &p_ptr->inventory_list[i];
if (!o_ptr->k_idx) continue;
/* Uncursed already */
/*!
* @brief 装備修正強化処理のメインルーチン /
- * Enchant an item (in the inventory or on the floor)
+ * Enchant an item (in the p_ptr->inventory_list or on the floor)
* @param num_hit 命中修正量
* @param num_dam ダメージ修正量
* @param num_ac AC修正量
/*!
* @brief アイテム鑑定のメインルーチン処理 /
- * Identify an object in the inventory (or on the floor)
+ * Identify an object in the p_ptr->inventory_list (or on the floor)
* @param only_equip 装備品のみを対象とするならばTRUEを返す
* @return 実際に鑑定を行ったならばTRUEを返す
* @details
/*!
* @brief アイテム凡庸化のメインルーチン処理 /
- * Identify an object in the inventory (or on the floor)
+ * Identify an object in the p_ptr->inventory_list (or on the floor)
* @param only_equip 装備品のみを対象とするならばTRUEを返す
* @return 実際に凡庸化をを行ったならばTRUEを返す
* @details
* <pre>
- * Mundanify an object in the inventory (or on the floor)
+ * Mundanify an object in the p_ptr->inventory_list (or on the floor)
* This routine does *not* automatically combine objects.
* Returns TRUE if something was mundanified, else FALSE.
* </pre>
/*!
* @brief アイテム*鑑定*のメインルーチン処理 /
- * Identify an object in the inventory (or on the floor)
+ * Identify an object in the p_ptr->inventory_list (or on the floor)
* @param only_equip 装備品のみを対象とするならばTRUEを返す
* @return 実際に鑑定を行ったならばTRUEを返す
* @details
- * Fully "identify" an object in the inventory -BEN-
+ * Fully "identify" an object in the p_ptr->inventory_list -BEN-
* This routine returns TRUE if an item was identified.
*/
bool identify_fully(bool only_equip)
if (o_ptr->tval == TV_ROD) o_ptr->timeout = (o_ptr->number - 1) * k_ptr->pval;
if (o_ptr->tval == TV_WAND) o_ptr->pval = 0;
- /* Reduce and describe inventory */
+ /* Reduce and describe p_ptr->inventory_list */
if (item >= 0)
{
inven_item_increase(item, -1);
else
msg_format(_("乱暴な魔法のために%sが壊れた!", "Wild magic consumes your %s!"), o_name);
- /* Reduce and describe inventory */
+ /* Reduce and describe p_ptr->inventory_list */
if (item >= 0)
{
inven_item_increase(item, -999);
msg_format(_("乱暴な魔法のために%sが何本か壊れた!", "Wild magic consumes your %s!"), o_name);
}
- /* Reduce and describe inventory */
+ /* Reduce and describe p_ptr->inventory_list */
if (item >= 0)
{
inven_item_increase(item, -1);
else
msg_format(_("乱暴な魔法のために%sが壊れた!", "Wild magic consumes your %s!"), o_name);
- /* Reduce and describe inventory */
+ /* Reduce and describe p_ptr->inventory_list */
if (item >= 0)
{
inven_item_increase(item, -999);
if (pet) mode |= PM_FORCE_PET;
else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
- count += summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : current_floor_ptr->dun_level), 0, mode, '\0');
+ count += summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : current_floor_ptr->dun_level), 0, mode);
if (!one_in_(6)) break;
}
case 23: case 24: case 25:
return TRUE;
}
+
+/*!
+ * @brief 町間のテレポートを行うメインルーチン。
+ * @return テレポート処理を決定したか否か
+ */
+bool tele_town(void)
+{
+ int i;
+ POSITION x, y;
+ int num = 0;
+
+ if (current_floor_ptr->dun_level)
+ {
+ msg_print(_("この魔法は地上でしか使えない!", "This spell can only be used on the surface!"));
+ return FALSE;
+ }
+
+ if (p_ptr->inside_arena || p_ptr->inside_battle)
+ {
+ msg_print(_("この魔法は外でしか使えない!", "This spell can only be used outside!"));
+ return FALSE;
+ }
+
+ screen_save();
+ clear_bldg(4, 10);
+
+ for (i = 1; i < max_towns; i++)
+ {
+ char buf[80];
+
+ if ((i == NO_TOWN) || (i == SECRET_TOWN) || (i == p_ptr->town_num) || !(p_ptr->visit & (1L << (i - 1)))) continue;
+
+ sprintf(buf, "%c) %-20s", I2A(i - 1), town_info[i].name);
+ prt(buf, 5 + i, 5);
+ num++;
+ }
+
+ if (!num)
+ {
+ msg_print(_("まだ行けるところがない。", "You have not yet visited any town."));
+ msg_print(NULL);
+ screen_load();
+ return FALSE;
+ }
+
+ prt(_("どこに行きますか:", "Which town you go: "), 0, 0);
+ while (1)
+ {
+ i = inkey();
+
+ if (i == ESCAPE)
+ {
+ screen_load();
+ return FALSE;
+ }
+ else if ((i < 'a') || (i > ('a' + max_towns - 2))) continue;
+ else if (((i - 'a' + 1) == p_ptr->town_num) || ((i - 'a' + 1) == NO_TOWN) || ((i - 'a' + 1) == SECRET_TOWN) || !(p_ptr->visit & (1L << (i - 'a')))) continue;
+ break;
+ }
+
+ for (y = 0; y < current_world_ptr->max_wild_y; y++)
+ {
+ for (x = 0; x < current_world_ptr->max_wild_x; x++)
+ {
+ if (wilderness[y][x].town == (i - 'a' + 1))
+ {
+ p_ptr->wilderness_y = y;
+ p_ptr->wilderness_x = x;
+ }
+ }
+ }
+
+ p_ptr->leaving = TRUE;
+ p_ptr->leave_bldg = TRUE;
+ p_ptr->teleport_town = TRUE;
+ screen_load();
+ return TRUE;
+}