*/
#include "angband.h"
+#include "bldg.h"
+#include "core.h"
+#include "term.h"
+#include "util.h"
+#include "object-ego.h"
+
+#include "creature.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 "projection.h"
+#include "player-class.h"
+#include "player-damage.h"
#include "spells-summon.h"
#include "quest.h"
#include "artifact.h"
+#include "avatar.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 "player-personality.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 */
bool look = TRUE;
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ if (!monster_is_valid(m_ptr)) return (FALSE);
- /* Paranoia */
- if (!m_ptr->r_idx) return (FALSE);
-
- /* Save the old location */
oy = m_ptr->fy;
ox = m_ptr->fx;
/* No teleporting into vaults and such */
if (!(p_ptr->inside_quest || p_ptr->inside_arena))
- if (cave[ny][nx].info & CAVE_ICKY) continue;
+ if (current_floor_ptr->grid_array[ny][nx].info & CAVE_ICKY) continue;
/* This grid looks good */
look = FALSE;
sound(SOUND_TPOTHER);
/* Update the old location */
- cave[oy][ox].m_idx = 0;
+ current_floor_ptr->grid_array[oy][ox].m_idx = 0;
/* Update the new location */
- cave[ny][nx].m_idx = m_idx;
+ current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
/* Move the monster */
m_ptr->fy = ny;
int attempts = 500;
POSITION dis = 2;
bool look = TRUE;
- monster_type *m_ptr = &m_list[m_idx];
-
- /* Paranoia */
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
if(!m_ptr->r_idx) return;
/* "Skill" test */
ny = m_ptr->fy;
nx = m_ptr->fx;
-
- /* Save the old location */
oy = m_ptr->fy;
ox = m_ptr->fx;
if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue;
/* No teleporting into vaults and such */
- /* if (cave[ny][nx].info & (CAVE_ICKY)) continue; */
+ /* if (current_floor_ptr->grid_array[ny][nx].info & (CAVE_ICKY)) continue; */
/* This grid looks good */
look = FALSE;
sound(SOUND_TPOTHER);
/* Update the old location */
- cave[oy][ox].m_idx = 0;
+ current_floor_ptr->grid_array[oy][ox].m_idx = 0;
/* Update the new location */
- cave[ny][nx].m_idx = m_idx;
+ current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
/* Move the monster */
m_ptr->fy = ny;
int min, pick, i;
int left = MAX(1, p_ptr->x - dis);
- int right = MIN(cur_wid - 2, p_ptr->x + dis);
+ int right = MIN(current_floor_ptr->width - 2, p_ptr->x + dis);
int top = MAX(1, p_ptr->y - dis);
- int bottom = MIN(cur_hgt - 2, p_ptr->y + dis);
+ int bottom = MIN(current_floor_ptr->height - 2, p_ptr->y + dis);
if (p_ptr->wild_mode) return FALSE;
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
- /* Move the player */
(void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
-
return TRUE;
}
void teleport_player(POSITION dis, BIT_FLAGS mode)
{
POSITION yy, xx;
-
- /* Save the old location */
POSITION oy = p_ptr->y;
POSITION ox = p_ptr->x;
{
for (yy = -1; yy < 2; yy++)
{
- MONSTER_IDX tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
+ MONSTER_IDX tmp_m_idx = current_floor_ptr->grid_array[oy+yy][ox+xx].m_idx;
/* A monster except your mount may follow */
if (tmp_m_idx && (p_ptr->riding != tmp_m_idx))
{
- monster_type *m_ptr = &m_list[tmp_m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[tmp_m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/*
void teleport_player_away(MONSTER_IDX m_idx, POSITION dis)
{
POSITION yy, xx;
-
- /* Save the old location */
POSITION oy = p_ptr->y;
POSITION ox = p_ptr->x;
{
for (yy = -1; yy < 2; yy++)
{
- IDX tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
+ MONSTER_IDX tmp_m_idx = current_floor_ptr->grid_array[oy+yy][ox+xx].m_idx;
/* A monster except your mount or caster may follow */
if (tmp_m_idx && (p_ptr->riding != tmp_m_idx) && (m_idx != tmp_m_idx))
{
- monster_type *m_ptr = &m_list[tmp_m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[tmp_m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/*
}
/* Accept any grid when wizard mode */
- if (p_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!cave[y][x].m_idx || (cave[y][x].m_idx == p_ptr->riding))) break;
+ if (p_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!current_floor_ptr->grid_array[y][x].m_idx || (current_floor_ptr->grid_array[y][x].m_idx == p_ptr->riding))) break;
/* Accept teleportable floor grids */
if (cave_player_teleportable_bold(y, x, mode)) break;
}
sound(SOUND_TELEPORT);
-
- /* Move the player */
(void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
}
void teleport_away_followable(MONSTER_IDX m_idx)
{
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
POSITION oldfy = m_ptr->fy;
POSITION oldfx = m_ptr->fx;
bool old_ml = m_ptr->ml;
teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
- if (old_ml && (old_cdis <= MAX_SIGHT) && !world_monster && !p_ptr->inside_battle && los(p_ptr->y, p_ptr->x, oldfy, oldfx))
+ if (old_ml && (old_cdis <= MAX_SIGHT) && !current_world_ptr->timewalk_m_idx && !p_ptr->inside_battle && los(p_ptr->y, p_ptr->x, oldfy, oldfx))
{
bool follow = FALSE;
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);
}
+bool teleport_level_other(player_type *creature_ptr)
+{
+ MONSTER_IDX target_m_idx;
+ monster_type *m_ptr;
+ monster_race *r_ptr;
+ GAME_TEXT m_name[MAX_NLEN];
+
+ if (!target_set(TARGET_KILL)) return FALSE;
+ target_m_idx = current_floor_ptr->grid_array[target_row][target_col].m_idx;
+ if (!target_m_idx) return TRUE;
+ if (!player_has_los_bold(target_row, target_col)) return TRUE;
+ if (!projectable(creature_ptr->y, creature_ptr->x, target_row, target_col)) return TRUE;
+ m_ptr = ¤t_floor_ptr->m_list[target_m_idx];
+ r_ptr = &r_info[m_ptr->r_idx];
+ monster_desc(m_name, m_ptr, 0);
+ msg_format(_("%^sの足を指さした。", "You gesture at %^s's feet."), m_name);
+
+ if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) ||
+ (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > creature_ptr->lev + randint1(60)))
+ {
+ msg_format(_("しかし効果がなかった!", "%^s is unaffected!"), m_name);
+ }
+ else teleport_level(target_m_idx);
+ return TRUE;
+}
+
/*!
* @brief プレイヤー及びモンスターをレベルテレポートさせる /
* Teleport the player one level up or down (random when legal)
}
else /* To monster */
{
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
/* Get the monster name (or "it") */
monster_desc(m_name, m_ptr, 0);
}
/* Down only */
- if ((ironman_downward && (m_idx <= 0)) || (dun_level <= d_info[dungeon_type].mindepth))
+ if ((ironman_downward && (m_idx <= 0)) || (current_floor_ptr->dun_level <= d_info[p_ptr->dungeon_idx].mindepth))
{
#ifdef JP
if (see_m) msg_format("%^sは床を突き破って沈んでいく。", m_name);
#endif
if (m_idx <= 0) /* To player */
{
- if (!dun_level)
+ if (!current_floor_ptr->dun_level)
{
- dungeon_type = ironman_downward ? DUNGEON_ANGBAND : p_ptr->recall_dungeon;
+ p_ptr->dungeon_idx = ironman_downward ? DUNGEON_ANGBAND : p_ptr->recall_dungeon;
p_ptr->oldpy = p_ptr->y;
p_ptr->oldpx = p_ptr->x;
}
if (autosave_l) do_cmd_save_game(TRUE);
- if (!dun_level)
+ if (!current_floor_ptr->dun_level)
{
- dun_level = d_info[dungeon_type].mindepth;
+ current_floor_ptr->dun_level = d_info[p_ptr->dungeon_idx].mindepth;
prepare_change_floor_mode(CFM_RAND_PLACE);
}
else
{
prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
}
-
- /* Leaving */
p_ptr->leaving = TRUE;
}
}
/* Up only */
- else if (quest_number(dun_level) || (dun_level >= d_info[dungeon_type].maxdepth))
+ else if (quest_number(current_floor_ptr->dun_level) || (current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth))
{
#ifdef JP
if (see_m) msg_format("%^sは天井を突き破って宙へ浮いていく。", m_name);
prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_UP | CFM_RAND_PLACE | CFM_RAND_CONNECT);
leave_quest_check();
-
- /* Leaving */
p_ptr->inside_quest = 0;
p_ptr->leaving = TRUE;
}
if (autosave_l) do_cmd_save_game(TRUE);
prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_UP | CFM_RAND_PLACE | CFM_RAND_CONNECT);
-
- /* Leaving */
p_ptr->leaving = TRUE;
}
}
if (m_idx <= 0) /* To player */
{
/* Never reach this code on the surface */
- /* if (!dun_level) dungeon_type = p_ptr->recall_dungeon; */
-
+ /* if (!current_floor_ptr->dun_level) p_ptr->dungeon_idx = p_ptr->recall_dungeon; */
if (record_stair) do_cmd_write_nikki(NIKKI_TELE_LEV, 1, NULL);
-
if (autosave_l) do_cmd_save_game(TRUE);
prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
-
- /* Leaving */
p_ptr->leaving = TRUE;
}
}
/* Monster level teleportation is simple deleting now */
if (m_idx > 0)
{
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
- /* Check for quest completion */
check_quest_completion(m_ptr);
if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
}
/* Allocate the "dun" array */
- C_MAKE(dun, max_d_idx, s16b);
+ C_MAKE(dun, max_d_idx, DUNGEON_IDX);
screen_save();
for(i = 1; i < max_d_idx; i++)
if ((i == ESCAPE) || !num)
{
/* Free the "dun" array */
- C_KILL(dun, max_d_idx, s16b);
+ C_KILL(dun, max_d_idx, DUNGEON_IDX);
screen_load();
return 0;
screen_load();
/* Free the "dun" array */
- C_KILL(dun, max_d_idx, s16b);
+ C_KILL(dun, max_d_idx, DUNGEON_IDX);
return select_dungeon;
}
return TRUE;
}
- if (dun_level && (max_dlv[dungeon_type] > dun_level) && !creature_ptr->inside_quest && !creature_ptr->word_recall)
+ if (current_floor_ptr->dun_level && (max_dlv[p_ptr->dungeon_idx] > current_floor_ptr->dun_level) && !creature_ptr->inside_quest && !creature_ptr->word_recall)
{
if (get_check(_("ここは最深到達階より浅い階です。この階に戻って来ますか? ", "Reset recall depth? ")))
{
- max_dlv[dungeon_type] = dun_level;
+ max_dlv[p_ptr->dungeon_idx] = current_floor_ptr->dun_level;
if (record_maxdepth)
- do_cmd_write_nikki(NIKKI_TRUMP, dungeon_type, _("帰還のときに", "when recall from dungeon"));
+ do_cmd_write_nikki(NIKKI_TRUMP, p_ptr->dungeon_idx, _("帰還のときに", "when recall from dungeon"));
}
}
if (!creature_ptr->word_recall)
{
- if (!dun_level)
+ if (!current_floor_ptr->dun_level)
{
DUNGEON_IDX select_dungeon;
select_dungeon = choose_dungeon(_("に帰還", "recall"), 2, 14);
(int)d_info[select_dungeon].mindepth, (int)max_dlv[select_dungeon]);
/* Default */
- sprintf(tmp_val, "%d", (int)MAX(dun_level, 1));
+ sprintf(tmp_val, "%d", (int)MAX(current_floor_ptr->dun_level, 1));
/* Ask for a level */
if (get_string(ppp, tmp_val, 10))
{
/* Extract request */
dummy = atoi(tmp_val);
-
- /* Paranoia */
if (dummy < 1) dummy = 1;
-
- /* Paranoia */
if (dummy > max_dlv[select_dungeon]) dummy = max_dlv[select_dungeon];
if (dummy < d_info[select_dungeon].mindepth) dummy = d_info[select_dungeon].mindepth;
bool apply_disenchant(BIT_FLAGS mode)
{
int t = 0;
- object_type *o_ptr;
+ object_type *o_ptr;
GAME_TEXT o_name[MAX_NLEN];
int to_h, to_d, to_a, pval;
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);
return (TRUE);
}
-/*!
- * @brief プレイヤーの突然変異処理
- * @return なし
- */
-void mutate_player(void)
-{
- BASE_STATUS max1, cur1, max2, cur2;
- int ii, jj, i;
-
- /* Pick a pair of stats */
- ii = randint0(6);
- for (jj = ii; jj == ii; jj = randint0(6)) /* loop */;
-
- max1 = p_ptr->stat_max[ii];
- cur1 = p_ptr->stat_cur[ii];
- max2 = p_ptr->stat_max[jj];
- cur2 = p_ptr->stat_cur[jj];
-
- p_ptr->stat_max[ii] = max2;
- p_ptr->stat_cur[ii] = cur2;
- p_ptr->stat_max[jj] = max1;
- p_ptr->stat_cur[jj] = cur1;
-
- for (i=0;i<6;i++)
- {
- if(p_ptr->stat_max[i] > p_ptr->stat_max_max[i]) p_ptr->stat_max[i] = p_ptr->stat_max_max[i];
- if(p_ptr->stat_cur[i] > p_ptr->stat_max_max[i]) p_ptr->stat_cur[i] = p_ptr->stat_max_max[i];
- }
-
- p_ptr->update |= (PU_BONUS);
-}
-
-
-/*!
- * @brief プレイヤーの因果混乱処理 / Apply Nexus
- * @param m_ptr 因果混乱をプレイヤーに与えたモンスターの情報参照ポインタ
- * @return なし
- */
-void apply_nexus(monster_type *m_ptr)
-{
- switch (randint1(7))
- {
- case 1: case 2: case 3:
- {
- teleport_player(200, TELEPORT_PASSIVE);
- break;
- }
-
- case 4: case 5:
- {
- teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
- break;
- }
-
- case 6:
- {
- if (randint0(100) < p_ptr->skill_sav)
- {
- msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
- break;
- }
-
- /* Teleport Level */
- teleport_level(0);
- break;
- }
-
- case 7:
- {
- if (randint0(100) < p_ptr->skill_sav)
- {
- msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
- break;
- }
-
- msg_print(_("体がねじれ始めた...", "Your body starts to scramble..."));
- mutate_player();
- break;
- }
- }
-}
-
-
-/*!
- * @brief 寿命つき光源の燃素追加処理 /
- * Charge a lite (torch or latern)
- * @return なし
- */
-void phlogiston(void)
-{
- GAME_TURN max_flog = 0;
- object_type * o_ptr = &inventory[INVEN_LITE];
-
- /* It's a lamp */
- if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_LANTERN))
- {
- max_flog = FUEL_LAMP;
- }
-
- /* It's a torch */
- else if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_TORCH))
- {
- max_flog = FUEL_TORCH;
- }
-
- /* No torch to refill */
- else
- {
- msg_print(_("燃素を消費するアイテムを装備していません。", "You are not wielding anything which uses phlogiston."));
- return;
- }
-
- if (o_ptr->xtra4 >= max_flog)
- {
- msg_print(_("このアイテムにはこれ以上燃素を補充できません。", "No more phlogiston can be put in this item."));
- return;
- }
-
- /* Refuel */
- o_ptr->xtra4 += (XTRA16)(max_flog / 2);
-
- msg_print(_("照明用アイテムに燃素を補充した。", "You add phlogiston to your light item."));
-
- if (o_ptr->xtra4 >= max_flog)
- {
- o_ptr->xtra4 = (XTRA16)max_flog;
- msg_print(_("照明用アイテムは満タンになった。", "Your light item is full."));
- }
-
- /* Recalculate torch */
- p_ptr->update |= (PU_TORCH);
-}
-
/*!
* @brief 武器へのエゴ付加処理 /
{
OBJECT_IDX item;
object_type *o_ptr;
- concptr q, s;
-
+ concptr q, s;
/* Assume enchant weapon */
item_tester_hook = object_allow_enchant_melee_weapon;
act = _("は鋭さを増した!", "becomes very sharp!");
o_ptr->name2 = EGO_SHARPNESS;
- o_ptr->pval = (PARAMETER_VALUE)m_bonus(5, dun_level) + 1;
+ o_ptr->pval = (PARAMETER_VALUE)m_bonus(5, current_floor_ptr->dun_level) + 1;
if ((o_ptr->sval == SV_HAYABUSA) && (o_ptr->pval > 2))
o_ptr->pval = 2;
{
act = _("は破壊力を増した!", "seems very powerful.");
o_ptr->name2 = EGO_EARTHQUAKES;
- o_ptr->pval = (PARAMETER_VALUE)m_bonus(3, dun_level);
+ o_ptr->pval = (PARAMETER_VALUE)m_bonus(3, current_floor_ptr->dun_level);
}
break;
case 16:
static bool vanish_dungeon(void)
{
POSITION y, x;
- cave_type *c_ptr;
+ grid_type *g_ptr;
feature_type *f_ptr;
monster_type *m_ptr;
GAME_TEXT m_name[MAX_NLEN];
/* Prevent vasishing of quest levels and town */
- if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
+ if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !current_floor_ptr->dun_level)
{
return FALSE;
}
/* Scan all normal grids */
- for (y = 1; y < cur_hgt - 1; y++)
+ for (y = 1; y < current_floor_ptr->height - 1; y++)
{
- for (x = 1; x < cur_wid - 1; x++)
+ for (x = 1; x < current_floor_ptr->width - 1; x++)
{
- c_ptr = &cave[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Seeing true feature code (ignore mimic) */
- f_ptr = &f_info[c_ptr->feat];
+ f_ptr = &f_info[g_ptr->feat];
/* Lose room and vault */
- c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
+ g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
- m_ptr = &m_list[c_ptr->m_idx];
+ m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
/* Awake monster */
- if (c_ptr->m_idx && MON_CSLEEP(m_ptr))
+ if (g_ptr->m_idx && MON_CSLEEP(m_ptr))
{
- /* Reset sleep counter */
- (void)set_monster_csleep(c_ptr->m_idx, 0);
+ (void)set_monster_csleep(g_ptr->m_idx, 0);
/* Notice the "waking up" */
if (m_ptr->ml)
}
/* Special boundary walls -- Top and bottom */
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
- c_ptr = &cave[0][x];
- f_ptr = &f_info[c_ptr->mimic];
+ g_ptr = ¤t_floor_ptr->grid_array[0][x];
+ f_ptr = &f_info[g_ptr->mimic];
/* Lose room and vault */
- c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
+ g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
/* Set boundary mimic if needed */
- if (c_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
+ if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
{
- c_ptr->mimic = feat_state(c_ptr->mimic, FF_HURT_DISI);
+ g_ptr->mimic = feat_state(g_ptr->mimic, FF_HURT_DISI);
/* Check for change to boring grid */
- if (!have_flag(f_info[c_ptr->mimic].flags, FF_REMEMBER)) c_ptr->info &= ~(CAVE_MARK);
+ if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
}
- c_ptr = &cave[cur_hgt - 1][x];
- f_ptr = &f_info[c_ptr->mimic];
+ g_ptr = ¤t_floor_ptr->grid_array[current_floor_ptr->height - 1][x];
+ f_ptr = &f_info[g_ptr->mimic];
/* Lose room and vault */
- c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
+ g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
/* Set boundary mimic if needed */
- if (c_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
+ if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
{
- c_ptr->mimic = feat_state(c_ptr->mimic, FF_HURT_DISI);
+ g_ptr->mimic = feat_state(g_ptr->mimic, FF_HURT_DISI);
/* Check for change to boring grid */
- if (!have_flag(f_info[c_ptr->mimic].flags, FF_REMEMBER)) c_ptr->info &= ~(CAVE_MARK);
+ if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
}
}
/* Special boundary walls -- Left and right */
- for (y = 1; y < (cur_hgt - 1); y++)
+ for (y = 1; y < (current_floor_ptr->height - 1); y++)
{
- c_ptr = &cave[y][0];
- f_ptr = &f_info[c_ptr->mimic];
+ g_ptr = ¤t_floor_ptr->grid_array[y][0];
+ f_ptr = &f_info[g_ptr->mimic];
/* Lose room and vault */
- c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
+ g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
/* Set boundary mimic if needed */
- if (c_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
+ if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
{
- c_ptr->mimic = feat_state(c_ptr->mimic, FF_HURT_DISI);
+ g_ptr->mimic = feat_state(g_ptr->mimic, FF_HURT_DISI);
/* Check for change to boring grid */
- if (!have_flag(f_info[c_ptr->mimic].flags, FF_REMEMBER)) c_ptr->info &= ~(CAVE_MARK);
+ if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
}
- c_ptr = &cave[y][cur_wid - 1];
- f_ptr = &f_info[c_ptr->mimic];
+ g_ptr = ¤t_floor_ptr->grid_array[y][current_floor_ptr->width - 1];
+ f_ptr = &f_info[g_ptr->mimic];
/* Lose room and vault */
- c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
+ g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
/* Set boundary mimic if needed */
- if (c_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
+ if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
{
- c_ptr->mimic = feat_state(c_ptr->mimic, FF_HURT_DISI);
+ g_ptr->mimic = feat_state(g_ptr->mimic, FF_HURT_DISI);
/* Check for change to boring grid */
- if (!have_flag(f_info[c_ptr->mimic].flags, FF_REMEMBER)) c_ptr->info &= ~(CAVE_MARK);
+ if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
}
}
void call_the_(void)
{
int i;
- cave_type *c_ptr;
+ grid_type *g_ptr;
bool do_call = TRUE;
for (i = 0; i < 9; i++)
{
- c_ptr = &cave[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]];
+ g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]];
- if (!cave_have_flag_grid(c_ptr, FF_PROJECT))
+ if (!cave_have_flag_grid(g_ptr, FF_PROJECT))
{
- if (!c_ptr->mimic || !have_flag(f_info[c_ptr->mimic].flags, FF_PROJECT) ||
- !permanent_wall(&f_info[c_ptr->feat]))
+ if (!g_ptr->mimic || !have_flag(f_info[g_ptr->mimic].flags, FF_PROJECT) ||
+ !permanent_wall(&f_info[g_ptr->feat]))
{
do_call = FALSE;
break;
}
/* Prevent destruction of quest levels and town */
- else if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
+ else if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !current_floor_ptr->dun_level)
{
msg_print(_("地面が揺れた。", "The ground trembles."));
}
{
POSITION ty, tx;
OBJECT_IDX i;
- cave_type *c_ptr;
+ grid_type *g_ptr;
object_type *o_ptr;
GAME_TEXT o_name[MAX_NLEN];
/* Check to see if an object is already there */
- if (cave[p_ptr->y][p_ptr->x].o_idx)
+ if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx)
{
msg_print(_("自分の足の下にある物は取れません。", "You can't fetch when you're already standing on something."));
return;
return;
}
- c_ptr = &cave[ty][tx];
+ g_ptr = ¤t_floor_ptr->grid_array[ty][tx];
/* We need an item to fetch */
- if (!c_ptr->o_idx)
+ if (!g_ptr->o_idx)
{
msg_print(_("そこには何もありません。", "There is no object at this place."));
return;
}
/* No fetching from vault */
- if (c_ptr->info & CAVE_ICKY)
+ if (g_ptr->info & CAVE_ICKY)
{
msg_print(_("アイテムがコントロールを外れて落ちた。", "The item slips from your control."));
return;
{
ty += ddy[dir];
tx += ddx[dir];
- c_ptr = &cave[ty][tx];
+ g_ptr = ¤t_floor_ptr->grid_array[ty][tx];
if ((distance(p_ptr->y, p_ptr->x, ty, tx) > MAX_RANGE) ||
!cave_have_flag_bold(ty, tx, FF_PROJECT)) return;
}
- while (!c_ptr->o_idx);
+ while (!g_ptr->o_idx);
}
- o_ptr = &o_list[c_ptr->o_idx];
+ o_ptr = ¤t_floor_ptr->o_list[g_ptr->o_idx];
if (o_ptr->weight > wgt)
{
return;
}
- i = c_ptr->o_idx;
- c_ptr->o_idx = o_ptr->next_o_idx;
- cave[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */
+ i = g_ptr->o_idx;
+ g_ptr->o_idx = o_ptr->next_o_idx;
+ current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */
o_ptr->next_o_idx = 0;
o_ptr->iy = p_ptr->y;
return;
}
-
-/*!
- * @brief 守りのルーン設置処理 /
- * Leave a "glyph of warding" which prevents monster movement
- * @return 実際に設置が行われた場合TRUEを返す
- */
-bool warding_glyph(void)
-{
- if (!cave_clean_bold(p_ptr->y, p_ptr->x))
- {
- msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
- return FALSE;
- }
-
- /* Create a glyph */
- cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
- cave[p_ptr->y][p_ptr->x].mimic = feat_glyph;
-
- note_spot(p_ptr->y, p_ptr->x);
- lite_spot(p_ptr->y, p_ptr->x);
-
- return TRUE;
-}
-
-/*!
- * @brief 鏡設置処理
- * @return 実際に設置が行われた場合TRUEを返す
- */
-bool place_mirror(void)
-{
- if (!cave_clean_bold(p_ptr->y, p_ptr->x))
- {
- msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
- return FALSE;
- }
-
- /* Create a mirror */
- cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
- cave[p_ptr->y][p_ptr->x].mimic = feat_mirror;
-
- /* Turn on the light */
- cave[p_ptr->y][p_ptr->x].info |= CAVE_GLOW;
-
- note_spot(p_ptr->y, p_ptr->x);
- lite_spot(p_ptr->y, p_ptr->x);
- update_local_illumination(p_ptr->y, p_ptr->x);
-
- return TRUE;
-}
-
-
-/*!
- * @brief 爆発のルーン設置処理 /
- * Leave an "explosive rune" which prevents monster movement
- * @return 実際に設置が行われた場合TRUEを返す
- */
-bool explosive_rune(void)
-{
- if (!cave_clean_bold(p_ptr->y, p_ptr->x))
- {
- msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
- return FALSE;
- }
-
- /* Create a glyph */
- cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
- cave[p_ptr->y][p_ptr->x].mimic = feat_explosive_rune;
-
- note_spot(p_ptr->y, p_ptr->x);
- lite_spot(p_ptr->y, p_ptr->x);
-
- return TRUE;
-}
-
-
/*!
* @brief 全所持アイテム鑑定処理 /
* Identify everything being carried.
/* 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 */
/* Perma-Cursed Items can NEVER be uncursed */
if (o_ptr->curse_flags & TRC_PERMA_CURSE)
{
- /* Uncurse it */
o_ptr->curse_flags &= (TRC_CURSED | TRC_HEAVY_CURSE | TRC_PERMA_CURSE);
continue;
}
- /* Uncurse it */
o_ptr->curse_flags = 0L;
-
- /* Hack -- Assume felt */
o_ptr->ident |= (IDENT_SENSE);
-
o_ptr->feeling = FEEL_NONE;
p_ptr->update |= (PU_BONUS);
if (command_arg > 0) force = TRUE;
q = _("どのアイテムを金に変えますか?", "Turn which item to gold? ");
- s = _("金に変えられる物がありません。", "You have nothing to turn to gold.");
+ s = _("金に変えられる物がありません。", "You have nothing to current_world_ptr->game_turn to gold.");
o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
if (!o_ptr) return (FALSE);
/* See how many items */
if (o_ptr->number > 1)
{
- /* Get a quantity */
amt = get_quantity(NULL, o_ptr->number);
/* Allow user abort */
if (confirm_destroy || (object_value(o_ptr) > 0))
{
/* Make a verification */
- sprintf(out_val, _("本当に%sを金に変えますか?", "Really turn %s to gold? "), o_name);
+ sprintf(out_val, _("本当に%sを金に変えますか?", "Really current_world_ptr->game_turn %s to gold? "), o_name);
if (!get_check(out_val)) return FALSE;
}
}
/* Artifacts cannot be destroyed */
if (!can_player_destroy_object(o_ptr))
{
- msg_format(_("%sを金に変えることに失敗した。", "You fail to turn %s to gold!"), o_name);
+ msg_format(_("%sを金に変えることに失敗した。", "You fail to current_world_ptr->game_turn %s to gold!"), o_name);
return FALSE;
}
if (price <= 0)
{
- msg_format(_("%sをニセの金に変えた。", "You turn %s to fool's gold."), o_name);
+ msg_format(_("%sをニセの金に変えた。", "You current_world_ptr->game_turn %s to fool's gold."), o_name);
}
else
{
if (amt > 1) price *= amt;
if (price > 30000) price = 30000;
- msg_format(_("%sを$%d の金に変えた。", "You turn %s to %ld coins worth of gold."), o_name, price);
+ msg_format(_("%sを$%d の金に変えた。", "You current_world_ptr->game_turn %s to %ld coins worth of gold."), o_name, price);
p_ptr->au += price;
p_ptr->redraw |= (PR_GOLD);
/* Failure */
if (!res) return (FALSE);
-
- /* Combine / Reorder the pack (later) */
p_ptr->update |= (PU_BONUS | PU_COMBINE | PU_REORDER);
p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
/*!
* @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修正量
chg_virtue(V_KNOWLEDGE, 1);
}
- /* Identify it fully */
object_aware(o_ptr);
object_known(o_ptr);
-
- /* Player touches it */
o_ptr->marked |= OM_TOUCHED;
+
p_ptr->update |= (PU_BONUS | PU_COMBINE | PU_REORDER);
p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
strcpy(record_o_name, o_name);
- record_turn = turn;
+ record_turn = current_world_ptr->game_turn;
object_desc(o_name, o_ptr, OD_NAME_ONLY);
/*!
* @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
bool ident_spell(bool only_equip)
{
OBJECT_IDX item;
- object_type *o_ptr;
+ object_type *o_ptr;
GAME_TEXT o_name[MAX_NLEN];
concptr q, s;
bool old_known;
/*!
* @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>
bool mundane_spell(bool only_equip)
{
OBJECT_IDX item;
- object_type *o_ptr;
- concptr q, s;
+ object_type *o_ptr;
+ concptr q, s;
if (only_equip) item_tester_hook = object_is_weapon_armour_ammo;
/*!
* @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)
/* All staffs, unstacked wands. */
else recharge_strength = (100 + power - lev - (8 * o_ptr->pval)) / 15;
-
- /* Paranoia */
if (recharge_strength < 0) recharge_strength = 0;
/* Back-fire */
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);
}
}
}
-
- /* Combine / Reorder the pack (later) */
p_ptr->update |= (PU_COMBINE | PU_REORDER);
p_ptr->window |= (PW_INVEN);
/*!
- * @brief 武器の祝福処理 /
- * Bless a weapon
- * @return ターン消費を要する処理を行ったならばTRUEを返す
+ * @brief プレイヤーの全既知呪文を表示する /
+ * Hack -- Display all known spells in a window
+ * return なし
+ * @details
+ * Need to analyze size of the window.
+ * Need more color coding.
*/
-bool bless_weapon(void)
+void display_spell_list(void)
{
- OBJECT_IDX item;
- object_type *o_ptr;
- BIT_FLAGS flgs[TR_FLAG_SIZE];
- GAME_TEXT o_name[MAX_NLEN];
- concptr q, s;
-
- /* Bless only weapons */
- item_tester_hook = object_is_weapon;
-
- q = _("どのアイテムを祝福しますか?", "Bless which weapon? ");
- s = _("祝福できる武器がありません。", "You have weapon to bless.");
+ int i, j;
+ TERM_LEN y, x;
+ int m[9];
+ const magic_type *s_ptr;
+ GAME_TEXT name[MAX_NLEN];
+ char out_val[160];
- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
- if (!o_ptr) return FALSE;
+ clear_from(0);
- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
- object_flags(o_ptr, flgs);
+ /* They have too many spells to list */
+ if (p_ptr->pclass == CLASS_SORCERER) return;
+ if (p_ptr->pclass == CLASS_RED_MAGE) return;
- if (object_is_cursed(o_ptr))
+ if (p_ptr->pclass == CLASS_SNIPER)
{
- if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && (randint1(100) < 33)) ||
- have_flag(flgs, TR_ADD_L_CURSE) ||
- have_flag(flgs, TR_ADD_H_CURSE) ||
- (o_ptr->curse_flags & TRC_PERMA_CURSE))
- {
-#ifdef JP
- msg_format("%sを覆う黒いオーラは祝福を跳ね返した!", o_name);
-#else
- msg_format("The black aura on %s %s disrupts the blessing!", ((item >= 0) ? "your" : "the"), o_name);
-#endif
-
- return TRUE;
- }
-
-#ifdef JP
- msg_format("%s から邪悪なオーラが消えた。", o_name);
-#else
- msg_format("A malignant aura leaves %s %s.", ((item >= 0) ? "your" : "the"), o_name);
-#endif
-
-
- /* Uncurse it */
- o_ptr->curse_flags = 0L;
-
- /* Hack -- Assume felt */
- o_ptr->ident |= (IDENT_SENSE);
-
- o_ptr->feeling = FEEL_NONE;
-
- /* Recalculate the bonuses */
- p_ptr->update |= (PU_BONUS);
- p_ptr->window |= (PW_EQUIP);
+ display_snipe_list();
+ return;
}
- /*
- * Next, we try to bless it. Artifacts have a 1/3 chance of
- * being blessed, otherwise, the operation simply disenchants
- * them, godly power negating the magic. Ok, the explanation
- * is silly, but otherwise priests would always bless every
- * artifact weapon they find. Ego weapons and normal weapons
- * can be blessed automatically.
- */
- if (have_flag(flgs, TR_BLESSED))
+ /* mind.c type classes */
+ if ((p_ptr->pclass == CLASS_MINDCRAFTER) ||
+ (p_ptr->pclass == CLASS_BERSERKER) ||
+ (p_ptr->pclass == CLASS_NINJA) ||
+ (p_ptr->pclass == CLASS_MIRROR_MASTER) ||
+ (p_ptr->pclass == CLASS_FORCETRAINER))
{
-#ifdef JP
- msg_format("%s は既に祝福されている。", o_name);
-#else
- msg_format("%s %s %s blessed already.",
- ((item >= 0) ? "Your" : "The"), o_name,
- ((o_ptr->number > 1) ? "were" : "was"));
-#endif
-
- return TRUE;
- }
+ PERCENTAGE minfail = 0;
+ PLAYER_LEVEL plev = p_ptr->lev;
+ PERCENTAGE chance = 0;
+ mind_type spell;
+ char comment[80];
+ char psi_desc[80];
+ int use_mind;
+ bool use_hp = FALSE;
- if (!(object_is_artifact(o_ptr) || object_is_ego(o_ptr)) || one_in_(3))
- {
-#ifdef JP
- msg_format("%sは輝いた!", o_name);
-#else
- msg_format("%s %s shine%s!",
- ((item >= 0) ? "Your" : "The"), o_name,
- ((o_ptr->number > 1) ? "" : "s"));
-#endif
+ y = 1;
+ x = 1;
- add_flag(o_ptr->art_flags, TR_BLESSED);
- o_ptr->discount = 99;
- }
- else
- {
- bool dis_happened = FALSE;
- msg_print(_("その武器は祝福を嫌っている!", "The weapon resists your blessing!"));
+ /* Display a list of spells */
+ prt("", y, x);
+ put_str(_("名前", "Name"), y, x + 5);
+ put_str(_("Lv MP 失率 効果", "Lv Mana Fail Info"), y, x + 35);
- /* Disenchant tohit */
- if (o_ptr->to_h > 0)
+ switch(p_ptr->pclass)
{
- o_ptr->to_h--;
- dis_happened = TRUE;
+ case CLASS_MINDCRAFTER: use_mind = MIND_MINDCRAFTER;break;
+ case CLASS_FORCETRAINER: use_mind = MIND_KI;break;
+ case CLASS_BERSERKER: use_mind = MIND_BERSERKER; use_hp = TRUE; break;
+ case CLASS_MIRROR_MASTER: use_mind = MIND_MIRROR_MASTER; break;
+ case CLASS_NINJA: use_mind = MIND_NINJUTSU; use_hp = TRUE; break;
+ default: use_mind = 0;break;
}
- if ((o_ptr->to_h > 5) && (randint0(100) < 33)) o_ptr->to_h--;
-
- /* Disenchant todam */
- if (o_ptr->to_d > 0)
+ /* Dump the spells */
+ for (i = 0; i < MAX_MIND_POWERS; i++)
{
- o_ptr->to_d--;
- dis_happened = TRUE;
- }
-
- if ((o_ptr->to_d > 5) && (randint0(100) < 33)) o_ptr->to_d--;
-
- /* Disenchant toac */
- if (o_ptr->to_a > 0)
- {
- o_ptr->to_a--;
- dis_happened = TRUE;
- }
-
- if ((o_ptr->to_a > 5) && (randint0(100) < 33)) o_ptr->to_a--;
-
- if (dis_happened)
- {
- msg_print(_("周囲が凡庸な雰囲気で満ちた...", "There is a static feeling in the air..."));
-
-#ifdef JP
- msg_format("%s は劣化した!", o_name);
-#else
- msg_format("%s %s %s disenchanted!", ((item >= 0) ? "Your" : "The"), o_name,
- ((o_ptr->number > 1) ? "were" : "was"));
-#endif
-
- }
- }
-
- p_ptr->update |= (PU_BONUS);
- p_ptr->window |= (PW_EQUIP | PW_PLAYER);
- calc_android_exp();
-
- return TRUE;
-}
-
-
-/*!
- * @brief 盾磨き処理 /
- * pulish shield
- * @return ターン消費を要する処理を行ったならばTRUEを返す
- */
-bool pulish_shield(void)
-{
- OBJECT_IDX item;
- object_type *o_ptr;
- BIT_FLAGS flgs[TR_FLAG_SIZE];
- GAME_TEXT o_name[MAX_NLEN];
- concptr q, s;
-
- /* Assume enchant weapon */
- item_tester_tval = TV_SHIELD;
-
- q = _("どの盾を磨きますか?", "Pulish which weapon? ");
- s = _("磨く盾がありません。", "You have weapon to pulish.");
-
- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
- if (!o_ptr) return FALSE;
-
- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
- object_flags(o_ptr, flgs);
-
- if (o_ptr->k_idx && !object_is_artifact(o_ptr) && !object_is_ego(o_ptr) &&
- !object_is_cursed(o_ptr) && (o_ptr->sval != SV_MIRROR_SHIELD))
- {
-#ifdef JP
- msg_format("%sは輝いた!", o_name);
-#else
- msg_format("%s %s shine%s!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
-#endif
- o_ptr->name2 = EGO_REFLECTION;
- enchant(o_ptr, randint0(3) + 4, ENCH_TOAC);
-
- o_ptr->discount = 99;
- chg_virtue(V_ENCHANT, 2);
-
- return TRUE;
- }
- else
- {
- if (flush_failure) flush();
-
- msg_print(_("失敗した。", "Failed."));
- chg_virtue(V_ENCHANT, -2);
- }
- calc_android_exp();
-
- return FALSE;
-}
-
-
-/*!
- * @brief 薬の破損効果処理 /
- * Potions "smash open" and cause an area effect when
- * @param who 薬破損の主体ID(プレイヤー所持アイテムが壊れた場合0、床上のアイテムの場合モンスターID)
- * @param y 破壊時のY座標
- * @param x 破壊時のX座標
- * @param k_idx 破損した薬のアイテムID
- * @return 薬を浴びたモンスターが起こるならばTRUEを返す
- * @details
- * <pre>
- * (1) they are shattered while in the player's inventory,
- * due to cold (etc) attacks;
- * (2) they are thrown at a monster, or obstacle;
- * (3) they are shattered by a "cold ball" or other such spell
- * while lying on the floor.
- *
- * Arguments:
- * who --- who caused the potion to shatter (0=player)
- * potions that smash on the floor are assumed to
- * be caused by no-one (who = 1), as are those that
- * shatter inside the player inventory.
- * (Not anymore -- I changed this; TY)
- * y, x --- coordinates of the potion (or player if
- * the potion was in her inventory);
- * o_ptr --- pointer to the potion object.
- * </pre>
- */
-bool potion_smash_effect(MONSTER_IDX who, POSITION y, POSITION x, KIND_OBJECT_IDX k_idx)
-{
- int radius = 2;
- int dt = 0;
- int dam = 0;
- bool angry = FALSE;
-
- object_kind *k_ptr = &k_info[k_idx];
-
- switch (k_ptr->sval)
- {
- case SV_POTION_SALT_WATER:
- case SV_POTION_SLIME_MOLD:
- case SV_POTION_LOSE_MEMORIES:
- case SV_POTION_DEC_STR:
- case SV_POTION_DEC_INT:
- case SV_POTION_DEC_WIS:
- case SV_POTION_DEC_DEX:
- case SV_POTION_DEC_CON:
- case SV_POTION_DEC_CHR:
- case SV_POTION_WATER: /* perhaps a 'water' attack? */
- case SV_POTION_APPLE_JUICE:
- return TRUE;
-
- case SV_POTION_INFRAVISION:
- case SV_POTION_DETECT_INVIS:
- case SV_POTION_SLOW_POISON:
- case SV_POTION_CURE_POISON:
- case SV_POTION_BOLDNESS:
- case SV_POTION_RESIST_HEAT:
- case SV_POTION_RESIST_COLD:
- case SV_POTION_HEROISM:
- case SV_POTION_BESERK_STRENGTH:
- case SV_POTION_RES_STR:
- case SV_POTION_RES_INT:
- case SV_POTION_RES_WIS:
- case SV_POTION_RES_DEX:
- case SV_POTION_RES_CON:
- case SV_POTION_RES_CHR:
- case SV_POTION_INC_STR:
- case SV_POTION_INC_INT:
- case SV_POTION_INC_WIS:
- case SV_POTION_INC_DEX:
- case SV_POTION_INC_CON:
- case SV_POTION_INC_CHR:
- case SV_POTION_AUGMENTATION:
- case SV_POTION_ENLIGHTENMENT:
- case SV_POTION_STAR_ENLIGHTENMENT:
- case SV_POTION_SELF_KNOWLEDGE:
- case SV_POTION_EXPERIENCE:
- case SV_POTION_RESISTANCE:
- case SV_POTION_INVULNERABILITY:
- case SV_POTION_NEW_LIFE:
- /* All of the above potions have no effect when shattered */
- return FALSE;
- case SV_POTION_SLOWNESS:
- dt = GF_OLD_SLOW;
- dam = 5;
- angry = TRUE;
- break;
- case SV_POTION_POISON:
- dt = GF_POIS;
- dam = 3;
- angry = TRUE;
- break;
- case SV_POTION_BLINDNESS:
- dt = GF_DARK;
- angry = TRUE;
- break;
- case SV_POTION_BOOZE: /* Booze */
- dt = GF_OLD_CONF;
- angry = TRUE;
- break;
- case SV_POTION_SLEEP:
- dt = GF_OLD_SLEEP;
- angry = TRUE;
- break;
- case SV_POTION_RUINATION:
- case SV_POTION_DETONATIONS:
- dt = GF_SHARDS;
- dam = damroll(25, 25);
- angry = TRUE;
- break;
- case SV_POTION_DEATH:
- dt = GF_DEATH_RAY; /* !! */
- dam = k_ptr->level * 10;
- angry = TRUE;
- radius = 1;
- break;
- case SV_POTION_SPEED:
- dt = GF_OLD_SPEED;
- break;
- case SV_POTION_CURE_LIGHT:
- dt = GF_OLD_HEAL;
- dam = damroll(2, 3);
- break;
- case SV_POTION_CURE_SERIOUS:
- dt = GF_OLD_HEAL;
- dam = damroll(4, 3);
- break;
- case SV_POTION_CURE_CRITICAL:
- case SV_POTION_CURING:
- dt = GF_OLD_HEAL;
- dam = damroll(6, 3);
- break;
- case SV_POTION_HEALING:
- dt = GF_OLD_HEAL;
- dam = damroll(10, 10);
- break;
- case SV_POTION_RESTORE_EXP:
- dt = GF_STAR_HEAL;
- dam = 0;
- radius = 1;
- break;
- case SV_POTION_LIFE:
- dt = GF_STAR_HEAL;
- dam = damroll(50, 50);
- radius = 1;
- break;
- case SV_POTION_STAR_HEALING:
- dt = GF_OLD_HEAL;
- dam = damroll(50, 50);
- radius = 1;
- break;
- case SV_POTION_RESTORE_MANA: /* MANA */
- dt = GF_MANA;
- dam = damroll(10, 10);
- radius = 1;
- break;
- default:
- /* Do nothing */ ;
- }
-
- (void)project(who, radius, y, x, dam, dt, (PROJECT_JUMP | PROJECT_ITEM | PROJECT_KILL), -1);
-
- /* XXX those potions that explode need to become "known" */
- return angry;
-}
-
-
-/*!
- * @brief プレイヤーの全既知呪文を表示する /
- * Hack -- Display all known spells in a window
- * return なし
- * @details
- * Need to analyze size of the window.
- * Need more color coding.
- */
-void display_spell_list(void)
-{
- int i, j;
- TERM_LEN y, x;
- int m[9];
- const magic_type *s_ptr;
- GAME_TEXT name[MAX_NLEN];
- char out_val[160];
-
- clear_from(0);
-
- /* They have too many spells to list */
- if (p_ptr->pclass == CLASS_SORCERER) return;
- if (p_ptr->pclass == CLASS_RED_MAGE) return;
-
- if (p_ptr->pclass == CLASS_SNIPER)
- {
- display_snipe_list();
- return;
- }
-
- /* mind.c type classes */
- if ((p_ptr->pclass == CLASS_MINDCRAFTER) ||
- (p_ptr->pclass == CLASS_BERSERKER) ||
- (p_ptr->pclass == CLASS_NINJA) ||
- (p_ptr->pclass == CLASS_MIRROR_MASTER) ||
- (p_ptr->pclass == CLASS_FORCETRAINER))
- {
- int minfail = 0;
- PLAYER_LEVEL plev = p_ptr->lev;
- int chance = 0;
- mind_type spell;
- char comment[80];
- char psi_desc[80];
- int use_mind;
- bool use_hp = FALSE;
-
- y = 1;
- x = 1;
-
- /* Display a list of spells */
- prt("", y, x);
- put_str(_("名前", "Name"), y, x + 5);
- put_str(_("Lv MP 失率 効果", "Lv Mana Fail Info"), y, x + 35);
-
- switch(p_ptr->pclass)
- {
- case CLASS_MINDCRAFTER: use_mind = MIND_MINDCRAFTER;break;
- case CLASS_FORCETRAINER: use_mind = MIND_KI;break;
- case CLASS_BERSERKER: use_mind = MIND_BERSERKER; use_hp = TRUE; break;
- case CLASS_MIRROR_MASTER: use_mind = MIND_MIRROR_MASTER; break;
- case CLASS_NINJA: use_mind = MIND_NINJUTSU; use_hp = TRUE; break;
- default: use_mind = 0;break;
- }
-
- /* Dump the spells */
- for (i = 0; i < MAX_MIND_POWERS; i++)
- {
- byte a = TERM_WHITE;
+ byte a = TERM_WHITE;
/* Access the available spell */
spell = mind_powers[use_mind].info[i];
chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
if (p_ptr->riding)
- chance += (MAX(r_info[m_list[p_ptr->riding].r_idx].level - p_ptr->skill_exp[GINOU_RIDING] / 100 - 10, 0));
+ chance += (MAX(r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].level - p_ptr->skill_exp[GINOU_RIDING] / 100 - 10, 0));
/* Extract mana consumption rate */
need_mana = mod_need_mana(s_ptr->smana, spell, use_realm);
}
-/*!
- * @brief 魔法が利用可能かどうかを返す /
- * Determine if a spell is "okay" for the player to cast or study
- * The spell must be legible, not forgotten, and also, to cast,
- * it must be known, and to study, it must not be known.
- * @param spell 呪文ID
- * @param learned 使用可能な判定ならばTRUE、学習可能かどうかの判定ならばFALSE
- * @param study_pray 祈りの学習判定目的ならばTRUE
- * @param use_realm 魔法領域ID
- * @return 失敗率(%)
- */
-bool spell_okay(int spell, bool learned, bool study_pray, int use_realm)
-{
- const magic_type *s_ptr;
-
- /* Access the spell */
- if (!is_magic(use_realm))
- {
- s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
- }
- else
- {
- s_ptr = &mp_ptr->info[use_realm - 1][spell];
- }
-
- /* Spell is illegal */
- if (s_ptr->slevel > p_ptr->lev) return (FALSE);
-
- /* Spell is forgotten */
- if ((use_realm == p_ptr->realm2) ?
- (p_ptr->spell_forgotten2 & (1L << spell)) :
- (p_ptr->spell_forgotten1 & (1L << spell)))
- {
- /* Never okay */
- return (FALSE);
- }
-
- if (p_ptr->pclass == CLASS_SORCERER) return (TRUE);
- if (p_ptr->pclass == CLASS_RED_MAGE) return (TRUE);
-
- /* Spell is learned */
- if ((use_realm == p_ptr->realm2) ?
- (p_ptr->spell_learned2 & (1L << spell)) :
- (p_ptr->spell_learned1 & (1L << spell)))
- {
- /* Always true */
- return (!study_pray);
- }
-
- /* Okay to study, not to cast */
- return (!learned);
-}
-
-
/*!
* @brief 呪文情報の表示処理 /
prt("", y + i + 1, x);
}
-
-
-/*!
- * @brief 防具の錆止め防止処理
- * @return ターン消費を要する処理を行ったならばTRUEを返す
- */
-bool rustproof(void)
-{
- OBJECT_IDX item;
- object_type *o_ptr;
- GAME_TEXT o_name[MAX_NLEN];
- concptr q, s;
-
- /* Select a piece of armour */
- item_tester_hook = object_is_armour;
-
- q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? ");
- s = _("錆止めできるものがありません。", "You have nothing to rustproof.");
-
- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
- if (!o_ptr) return FALSE;
-
- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
-
- add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
-
- if ((o_ptr->to_a < 0) && !object_is_cursed(o_ptr))
- {
-#ifdef JP
- msg_format("%sは新品同様になった!",o_name);
-#else
- msg_format("%s %s look%s as good as new!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
-#endif
-
- o_ptr->to_a = 0;
- }
-
-#ifdef JP
- msg_format("%sは腐食しなくなった。", o_name);
-#else
- msg_format("%s %s %s now protected against corrosion.", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "are" : "is"));
-#endif
-
- calc_android_exp();
- return TRUE;
-}
-
-
-/*!
- * @brief 防具呪縛処理 /
- * Curse the players armor
- * @return 実際に呪縛されたらTRUEを返す
- */
-bool curse_armor(void)
-{
- int i;
- object_type *o_ptr;
-
- GAME_TEXT o_name[MAX_NLEN];
-
- /* Curse the body armor */
- o_ptr = &inventory[INVEN_BODY];
-
- /* Nothing to curse */
- if (!o_ptr->k_idx) return (FALSE);
-
- object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
-
- /* Attempt a saving throw for artifacts */
- if (object_is_artifact(o_ptr) && (randint0(100) < 50))
- {
- /* Cool */
-#ifdef JP
- msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
- "恐怖の暗黒オーラ", "防具", o_name);
-#else
- msg_format("A %s tries to %s, but your %s resists the effects!",
- "terrible black aura", "surround your armor", o_name);
-#endif
-
- }
-
- /* not artifact or failed save... */
- else
- {
- msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
- chg_virtue(V_ENCHANT, -5);
-
- /* Blast the armor */
- o_ptr->name1 = 0;
- o_ptr->name2 = EGO_BLASTED;
- o_ptr->to_a = 0 - randint1(5) - randint1(5);
- o_ptr->to_h = 0;
- o_ptr->to_d = 0;
- o_ptr->ac = 0;
- o_ptr->dd = 0;
- o_ptr->ds = 0;
-
- for (i = 0; i < TR_FLAG_SIZE; i++)
- o_ptr->art_flags[i] = 0;
-
- /* Curse it */
- o_ptr->curse_flags = TRC_CURSED;
-
- /* Break it */
- o_ptr->ident |= (IDENT_BROKEN);
- p_ptr->update |= (PU_BONUS | PU_MANA);
- p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
- }
-
- return (TRUE);
-}
-
-/*!
- * @brief 武器呪縛処理 /
- * Curse the players weapon
- * @param force 無条件に呪縛を行うならばTRUE
- * @param o_ptr 呪縛する武器のアイテム情報参照ポインタ
- * @return 実際に呪縛されたらTRUEを返す
- */
-bool curse_weapon_object(bool force, object_type *o_ptr)
-{
- int i;
- GAME_TEXT o_name[MAX_NLEN];
-
- /* Nothing to curse */
- if (!o_ptr->k_idx) return (FALSE);
- object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
-
- /* Attempt a saving throw */
- if (object_is_artifact(o_ptr) && (randint0(100) < 50) && !force)
- {
- /* Cool */
-#ifdef JP
- msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
- "恐怖の暗黒オーラ", "武器", o_name);
-#else
- msg_format("A %s tries to %s, but your %s resists the effects!",
- "terrible black aura", "surround your weapon", o_name);
-#endif
- }
-
- /* not artifact or failed save... */
- else
- {
- if (!force) msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
- chg_virtue(V_ENCHANT, -5);
-
- /* Shatter the weapon */
- o_ptr->name1 = 0;
- o_ptr->name2 = EGO_SHATTERED;
- o_ptr->to_h = 0 - randint1(5) - randint1(5);
- o_ptr->to_d = 0 - randint1(5) - randint1(5);
- o_ptr->to_a = 0;
- o_ptr->ac = 0;
- o_ptr->dd = 0;
- o_ptr->ds = 0;
-
- for (i = 0; i < TR_FLAG_SIZE; i++)
- o_ptr->art_flags[i] = 0;
-
- /* Curse it */
- o_ptr->curse_flags = TRC_CURSED;
-
- /* Break it */
- o_ptr->ident |= (IDENT_BROKEN);
- p_ptr->update |= (PU_BONUS | PU_MANA);
- p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
- }
-
- return (TRUE);
-}
-
-/*!
- * @brief 武器呪縛処理のメインルーチン /
- * Curse the players weapon
- * @param force 無条件に呪縛を行うならばTRUE
- * @param slot 呪縛する武器の装備スロット
- * @return 実際に呪縛されたらTRUEを返す
- */
-bool curse_weapon(bool force, int slot)
-{
- /* Curse the weapon */
- return curse_weapon_object(force, &inventory[slot]);
-}
-
-
-/*!
- * @brief ボルトのエゴ化処理(火炎エゴのみ) /
- * Enchant some bolts
- * @return 常にTRUEを返す
- */
-bool brand_bolts(void)
-{
- int i;
-
- /* Use the first acceptable bolts */
- for (i = 0; i < INVEN_PACK; i++)
- {
- object_type *o_ptr = &inventory[i];
-
- /* Skip non-bolts */
- if (o_ptr->tval != TV_BOLT) continue;
-
- /* Skip artifacts and ego-items */
- if (object_is_artifact(o_ptr) || object_is_ego(o_ptr))
- continue;
-
- /* Skip cursed/broken items */
- if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) continue;
-
- /* Randomize */
- if (randint0(100) < 75) continue;
-
- msg_print(_("クロスボウの矢が炎のオーラに包まれた!", "Your bolts are covered in a fiery aura!"));
-
- /* Ego-item */
- o_ptr->name2 = EGO_FLAME;
- enchant(o_ptr, randint0(3) + 4, ENCH_TOHIT | ENCH_TODAM);
- return (TRUE);
- }
-
- if (flush_failure) flush();
-
- /* Fail */
- msg_print(_("炎で強化するのに失敗した。", "The fiery enchantment failed."));
-
- return (TRUE);
-}
-
-
/*!
* @brief 変身処理向けにモンスターの近隣レベル帯モンスターを返す /
* Helper function -- return a "nearby" race for polymorphing
for (i = 0; i < 1000; i++)
{
/* Pick a new race, using a level calculation */
- r = get_mon_num((dun_level + r_ptr->level) / 2 + 5);
+ r = get_mon_num((current_floor_ptr->dun_level + r_ptr->level) / 2 + 5);
/* Handle failure */
if (!r) break;
*/
bool polymorph_monster(POSITION y, POSITION x)
{
- cave_type *c_ptr = &cave[y][x];
- monster_type *m_ptr = &m_list[c_ptr->m_idx];
+ grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
bool polymorphed = FALSE;
MONRACE_IDX new_r_idx;
MONRACE_IDX old_r_idx = m_ptr->r_idx;
- bool targeted = (target_who == c_ptr->m_idx) ? TRUE : FALSE;
- bool health_tracked = (p_ptr->health_who == c_ptr->m_idx) ? TRUE : FALSE;
+ bool targeted = (target_who == g_ptr->m_idx) ? TRUE : FALSE;
+ bool health_tracked = (p_ptr->health_who == g_ptr->m_idx) ? TRUE : FALSE;
monster_type back_m;
if (p_ptr->inside_arena || p_ptr->inside_battle) return (FALSE);
- if ((p_ptr->riding == c_ptr->m_idx) || (m_ptr->mflag2 & MFLAG2_KAGE)) return (FALSE);
+ if ((p_ptr->riding == g_ptr->m_idx) || (m_ptr->mflag2 & MFLAG2_KAGE)) return (FALSE);
/* Memorize the monster before polymorphing */
back_m = *m_ptr;
m_ptr->hold_o_idx = 0;
/* "Kill" the "old" monster */
- delete_monster_idx(c_ptr->m_idx);
+ delete_monster_idx(g_ptr->m_idx);
/* Create a new monster (no groups) */
if (place_monster_aux(0, y, x, new_r_idx, mode))
{
- m_list[hack_m_idx_ii].nickname = back_m.nickname;
- m_list[hack_m_idx_ii].parent_m_idx = back_m.parent_m_idx;
- m_list[hack_m_idx_ii].hold_o_idx = back_m.hold_o_idx;
+ current_floor_ptr->m_list[hack_m_idx_ii].nickname = back_m.nickname;
+ current_floor_ptr->m_list[hack_m_idx_ii].parent_m_idx = back_m.parent_m_idx;
+ current_floor_ptr->m_list[hack_m_idx_ii].hold_o_idx = back_m.hold_o_idx;
/* Success */
polymorphed = TRUE;
/* Placing the new monster failed */
if (place_monster_aux(0, y, x, old_r_idx, (mode | PM_NO_KAGE | PM_IGNORE_TERRAIN)))
{
- m_list[hack_m_idx_ii] = back_m;
+ current_floor_ptr->m_list[hack_m_idx_ii] = back_m;
/* Re-initialize monster process */
mproc_init();
{
for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- object_type *o_ptr = &o_list[this_o_idx];
-
- /* Acquire next object */
+ object_type *o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
/* Held by new monster */
{
for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- /* Acquire next object */
- next_o_idx = o_list[this_o_idx].next_o_idx;
+ next_o_idx = current_floor_ptr->o_list[this_o_idx].next_o_idx;
delete_object_idx(this_o_idx);
}
}
{
/* All staffs, wands. */
recharge_strength = (100 + power - lev) / 15;
-
- /* Paranoia */
if (recharge_strength < 0) recharge_strength = 0;
/* Back-fire */
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);
p_ptr->csp = p_ptr->msp;
}
- /* Redraw mana and hp */
p_ptr->redraw |= (PR_MANA);
-
p_ptr->update |= (PU_COMBINE | PU_REORDER);
p_ptr->window |= (PW_INVEN);
void massacre(void)
{
POSITION x, y;
- cave_type *c_ptr;
- monster_type *m_ptr;
+ grid_type *g_ptr;
+ monster_type *m_ptr;
DIRECTION dir;
for (dir = 0; dir < 8; dir++)
{
y = p_ptr->y + ddy_ddd[dir];
x = p_ptr->x + ddx_ddd[dir];
- c_ptr = &cave[y][x];
-
- /* Get the monster */
- m_ptr = &m_list[c_ptr->m_idx];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
/* Hack -- attack monsters */
- if (c_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
+ if (g_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
py_attack(y, x, 0);
}
}
bool eat_lock(void)
{
POSITION x, y;
- cave_type *c_ptr;
+ grid_type *g_ptr;
feature_type *f_ptr, *mimic_f_ptr;
DIRECTION dir;
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- c_ptr = &cave[y][x];
- f_ptr = &f_info[c_ptr->feat];
- mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ f_ptr = &f_info[g_ptr->feat];
+ mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)];
stop_mouth();
{
msg_format(_("いてっ!この%sはあなたの歯より硬い!", "Ouch! This %s is harder than your teeth!"), f_name + mimic_f_ptr->name);
}
- else if (c_ptr->m_idx)
+ else if (g_ptr->m_idx)
{
- monster_type *m_ptr = &m_list[c_ptr->m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
msg_print(_("何かが邪魔しています!", "There's something in the way!"));
if (!m_ptr->ml || !is_pet(m_ptr)) py_attack(y, x, 0);
/* Destroy the wall */
cave_alter_feat(y, x, FF_HURT_ROCK);
- /* Move the player */
(void)move_player_effect(y, x, MPE_DONT_PICKUP);
return TRUE;
}
x = p_ptr->x + ddx[dir];
dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
fire_beam(GF_MISSILE, dir, dam);
- if (cave[y][x].m_idx)
+ if (current_floor_ptr->grid_array[y][x].m_idx)
{
int i;
- int ty = y, tx = x;
- int oy = y, ox = x;
- MONSTER_IDX m_idx = cave[y][x].m_idx;
- monster_type *m_ptr = &m_list[m_idx];
+ POSITION ty = y, tx = x;
+ POSITION oy = y, ox = x;
+ MONSTER_IDX m_idx = current_floor_ptr->grid_array[y][x].m_idx;
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
GAME_TEXT m_name[MAX_NLEN];
if ((ty != oy) || (tx != ox))
{
msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name);
- cave[oy][ox].m_idx = 0;
- cave[ty][tx].m_idx = (s16b)m_idx;
- m_ptr->fy = (byte_hack)ty;
- m_ptr->fx = (byte_hack)tx;
+ current_floor_ptr->grid_array[oy][ox].m_idx = 0;
+ current_floor_ptr->grid_array[ty][tx].m_idx = m_idx;
+ m_ptr->fy = ty;
+ m_ptr->fx = tx;
update_monster(m_idx, TRUE);
lite_spot(oy, ox);
(void)set_stun(creature_ptr->stun + 75);
(void)set_cut(creature_ptr->cut + 5000);
return TRUE;
-}
\ No newline at end of file
+}
+
+void blood_curse_to_enemy(MONSTER_IDX m_idx)
+{
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ grid_type *g_ptr = ¤t_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx];
+ BIT_FLAGS curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
+ int count = 0;
+ do
+ {
+ switch (randint1(28))
+ {
+ case 1: case 2:
+ if (!count)
+ {
+ msg_print(_("地面が揺れた...", "The ground trembles..."));
+ earthquake(m_ptr->fy, m_ptr->fx, 4 + randint0(4));
+ if (!one_in_(6)) break;
+ }
+ case 3: case 4: case 5: case 6:
+ if (!count)
+ {
+ int extra_dam = damroll(10, 10);
+ msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
+
+ project(0, 8, m_ptr->fy, m_ptr->fx, extra_dam, GF_MANA, curse_flg, -1);
+ if (!one_in_(6)) break;
+ }
+ case 7: case 8:
+ if (!count)
+ {
+ msg_print(_("空間が歪んだ!", "Space warps about you!"));
+
+ if (m_ptr->r_idx) teleport_away(g_ptr->m_idx, damroll(10, 10), TELEPORT_PASSIVE);
+ if (one_in_(13)) count += activate_hi_summon(m_ptr->fy, m_ptr->fx, TRUE);
+ if (!one_in_(6)) break;
+ }
+ case 9: case 10: case 11:
+ msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!"));
+ project(0, 7, m_ptr->fy, m_ptr->fx, 50, GF_DISINTEGRATE, curse_flg, -1);
+ if (!one_in_(6)) break;
+ case 12: case 13: case 14: case 15: case 16:
+ aggravate_monsters(0);
+ if (!one_in_(6)) break;
+ case 17: case 18:
+ count += activate_hi_summon(m_ptr->fy, m_ptr->fx, TRUE);
+ if (!one_in_(6)) break;
+ case 19: case 20: case 21: case 22:
+ {
+ bool pet = !one_in_(3);
+ BIT_FLAGS mode = PM_ALLOW_GROUP;
+
+ 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);
+ if (!one_in_(6)) break;
+ }
+ case 23: case 24: case 25:
+ if (p_ptr->hold_exp && (randint0(100) < 75)) break;
+ msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
+
+ if (p_ptr->hold_exp) lose_exp(p_ptr->exp / 160);
+ else lose_exp(p_ptr->exp / 16);
+ if (!one_in_(6)) break;
+ case 26: case 27: case 28:
+ {
+ int i = 0;
+ if (one_in_(13))
+ {
+ while (i < A_MAX)
+ {
+ do
+ {
+ (void)do_dec_stat(i);
+ } while (one_in_(2));
+
+ i++;
+ }
+ }
+ else
+ {
+ (void)do_dec_stat(randint0(6));
+ }
+ break;
+ }
+ }
+ } while (one_in_(5));
+}
+
+
+bool fire_crimson(void)
+{
+ int num = 1;
+ int i;
+ BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
+ POSITION tx, ty;
+ DIRECTION dir;
+
+ if (!get_aim_dir(&dir)) return FALSE;
+
+ /* Use the given direction */
+ tx = p_ptr->x + 99 * ddx[dir];
+ ty = p_ptr->y + 99 * ddy[dir];
+
+ /* Hack -- Use an actual "target" */
+ if ((dir == 5) && target_okay())
+ {
+ tx = target_col;
+ ty = target_row;
+ }
+
+ if (p_ptr->pclass == CLASS_ARCHER)
+ {
+ /* Extra shot at level 10 */
+ if (p_ptr->lev >= 10) num++;
+
+ /* Extra shot at level 30 */
+ if (p_ptr->lev >= 30) num++;
+
+ /* Extra shot at level 45 */
+ if (p_ptr->lev >= 45) num++;
+ }
+
+ for (i = 0; i < num; i++)
+ project(0, p_ptr->lev / 20 + 1, ty, tx, p_ptr->lev*p_ptr->lev * 6 / 50, GF_ROCKET, flg, -1);
+
+ 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;
+}