*/
#include "angband.h"
+#include "util.h"
+
+#include "floor.h"
#include "cmd-spell.h"
#include "cmd-quaff.h"
+#include "object-flavor.h"
#include "object-hook.h"
#include "object-curse.h"
+#include "spells-status.h"
+#include "spells.h"
+#include "player-status.h"
+#include "player-effects.h"
+#include "player-skill.h"
+#include "realm-hex.h"
+#include "grid.h"
+#include "monsterrace.h"
+#include "targeting.h"
+#include "realm-song.h"
+#include "view-mainwindow.h"
#define MAX_KEEP 4 /*!<呪術の最大詠唱数 */
if (p_ptr->spell_exp[spell] < SPELL_EXP_BEGINNER)
p_ptr->spell_exp[spell] += 5;
else if(p_ptr->spell_exp[spell] < SPELL_EXP_SKILLED)
- { if (one_in_(2) && (dun_level > 4) && ((dun_level + 10) > p_ptr->lev)) p_ptr->spell_exp[spell] += 1; }
+ { if (one_in_(2) && (current_floor_ptr->dun_level > 4) && ((current_floor_ptr->dun_level + 10) > p_ptr->lev)) p_ptr->spell_exp[spell] += 1; }
else if(p_ptr->spell_exp[spell] < SPELL_EXP_EXPERT)
- { if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
+ { if (one_in_(5) && ((current_floor_ptr->dun_level + 5) > p_ptr->lev) && ((current_floor_ptr->dun_level + 5) > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
else if(p_ptr->spell_exp[spell] < SPELL_EXP_MASTER)
- { if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
+ { if (one_in_(5) && ((current_floor_ptr->dun_level + 5) > p_ptr->lev) && (current_floor_ptr->dun_level > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
}
/* Do any effects of continual spells */
*/
bool teleport_barrier(MONSTER_IDX m_idx)
{
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (!hex_spelling(HEX_ANTI_TELE)) return FALSE;
*/
bool magic_barrier(MONSTER_IDX m_idx)
{
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (!hex_spelling(HEX_ANTI_MAGIC)) return FALSE;
*/
bool multiply_barrier(MONSTER_IDX m_idx)
{
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (!hex_spelling(HEX_ANTI_MULTI)) return FALSE;
* @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST / SPELL_CONT / SPELL_STOP)
* @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST / SPELL_CONT / SPELL_STOP 時はNULL文字列を返す。
*/
-cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
+concptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
{
bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
if (cast)
{
OBJECT_IDX item;
- cptr q, s;
+ concptr q, s;
GAME_TEXT o_name[MAX_NLEN];
object_type *o_ptr;
u32b f[TR_FLAG_SIZE];
q = _("どれを呪いますか?", "Which weapon do you curse?");
s = _("武器を装備していない。", "You wield no weapons.");
- if (!get_item(&item, q, s, (USE_EQUIP))) return FALSE;
+ o_ptr = choose_object(&item, q, s, (USE_EQUIP));
+ if (!o_ptr) return FALSE;
- o_ptr = &inventory[item];
object_desc(o_name, o_ptr, OD_NAME_ONLY);
object_flags(o_ptr, f);
if (cast)
{
OBJECT_IDX item;
- cptr q, s;
+ concptr q, s;
GAME_TEXT o_name[MAX_NLEN];
object_type *o_ptr;
u32b f[TR_FLAG_SIZE];
q = _("どれを呪いますか?", "Which piece of armour do you curse?");
s = _("防具を装備していない。", "You wield no piece of armours.");
- if (!get_item(&item, q, s, (USE_EQUIP))) return FALSE;
+ o_ptr = choose_object(&item, q, s, (USE_EQUIP));
+ if (!o_ptr) return FALSE;
- o_ptr = &inventory[item];
+ o_ptr = &p_ptr->inventory_list[item];
object_desc(o_name, o_ptr, OD_NAME_ONLY);
object_flags(o_ptr, f);
if (desc) return _("影のオーラを身にまとい、敵に影のダメージを与える。", "Gives aura of shadow.");
if (cast)
{
- object_type *o_ptr = &inventory[INVEN_OUTER];
+ object_type *o_ptr = &p_ptr->inventory_list[INVEN_OUTER];
if (!o_ptr->k_idx)
{
}
if (cont)
{
- object_type *o_ptr = &inventory[INVEN_OUTER];
+ object_type *o_ptr = &p_ptr->inventory_list[INVEN_OUTER];
if ((!o_ptr->k_idx) || (!object_is_cursed(o_ptr)))
{
flag = TRUE;
}
- for (i = A_STR; i < 6; i++)
+ for (i = A_STR; i < A_MAX; i++)
{
if (p_ptr->stat_cur[i] < p_ptr->stat_max[i])
{
if (cast)
{
OBJECT_IDX item;
- cptr s, q;
+ concptr s, q;
u32b f[TR_FLAG_SIZE];
object_type *o_ptr;
q = _("どの装備品から吸収しますか?", "Which cursed equipment do you drain mana from?");
s = _("呪われたアイテムを装備していない。", "You have no cursed equipment.");
- if (!get_item(&item, q, s, (USE_EQUIP))) return FALSE;
+ o_ptr = choose_object(&item, q, s, (USE_EQUIP));
+ if (!o_ptr) return FALSE;
- o_ptr = &inventory[item];
object_flags(o_ptr, f);
p_ptr->csp += (p_ptr->lev / 5) + randint1(p_ptr->lev / 5);
int dy = y + ddy_ddd[dir];
int dx = x + ddx_ddd[dir];
if (dir == 5) continue;
- if (cave[dy][dx].m_idx) flag = TRUE;
+ if (current_floor_ptr->grid_array[dy][dx].m_idx) flag = TRUE;
}
- if (!cave_empty_bold(y, x) || (cave[y][x].info & CAVE_ICKY) ||
+ if (!cave_empty_bold(y, x) || (current_floor_ptr->grid_array[y][x].info & CAVE_ICKY) ||
(distance(y, x, p_ptr->y, p_ptr->x) > plev + 2))
{
msg_print(_("そこには移動できない。", "Can not teleport to there."));