#include "view-mainwindow.h"
#include "targeting.h"
+#include "world.h"
/*!
* @brief フロア脱出時に出戻りが不可能だった場合に警告を加える処理
*/
static bool confirm_leave_level(player_type *creature_ptr, bool down_stair)
{
- quest_type *q_ptr = &quest[creature_ptr->inside_quest];
+ quest_type *q_ptr = &quest[creature_ptr->current_floor_ptr->inside_quest];
/* Confirm leaving from once only quest */
- if (confirm_quest && creature_ptr->inside_quest &&
+ if (confirm_quest && creature_ptr->current_floor_ptr->inside_quest &&
(q_ptr->type == QUEST_TYPE_RANDOM ||
(q_ptr->flags & QUEST_FLAG_ONCE &&
q_ptr->status != QUEST_STATUS_COMPLETED) ||
*/
bool cmd_limit_cast(player_type *creature_ptr)
{
- if (current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC))
+ if (creature_ptr->current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC))
{
msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!"));
msg_print(NULL);
bool cmd_limit_arena(player_type *creature_ptr)
{
- if (creature_ptr->inside_arena)
+ if (creature_ptr->current_floor_ptr->inside_arena)
{
msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
msg_print(NULL);
msg_print(_("目が見えない。", "You can't see anything."));
return TRUE;
}
- if (no_lite())
+ if (no_lite(creature_ptr))
{
msg_print(_("明かりがないので見えない。", "You have no light."));
return TRUE;
bool go_up = FALSE;
/* Player grid */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
+ grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
feature_type *f_ptr = &f_info[g_ptr->feat];
int up_num = 0;
else
msg_print(_("上の階に登った。", "You enter the up staircase."));
- leave_quest_check();
+ leave_quest_check(creature_ptr);
- creature_ptr->inside_quest = g_ptr->special;
+ creature_ptr->current_floor_ptr->inside_quest = g_ptr->special;
/* Activate the quest */
- if (!quest[creature_ptr->inside_quest].status)
+ if (!quest[creature_ptr->current_floor_ptr->inside_quest].status)
{
- if (quest[creature_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
+ if (quest[creature_ptr->current_floor_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
{
init_flags = INIT_ASSIGN;
- process_dungeon_file("q_info.txt", 0, 0, 0, 0);
+ process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
}
- quest[creature_ptr->inside_quest].status = QUEST_STATUS_TAKEN;
+ quest[creature_ptr->current_floor_ptr->inside_quest].status = QUEST_STATUS_TAKEN;
}
/* Leaving a quest */
- if (!creature_ptr->inside_quest)
+ if (!creature_ptr->current_floor_ptr->inside_quest)
{
- current_floor_ptr->dun_level = 0;
+ creature_ptr->current_floor_ptr->dun_level = 0;
}
creature_ptr->leaving = TRUE;
return;
}
- if (!current_floor_ptr->dun_level)
+ if (!creature_ptr->current_floor_ptr->dun_level)
{
go_up = TRUE;
}
take_turn(creature_ptr, 100);
- if (autosave_l) do_cmd_save_game(TRUE);
+ if (autosave_l) do_cmd_save_game(creature_ptr, TRUE);
/* For a random quest */
- if (creature_ptr->inside_quest &&
- quest[creature_ptr->inside_quest].type == QUEST_TYPE_RANDOM)
+ if (creature_ptr->current_floor_ptr->inside_quest &&
+ quest[creature_ptr->current_floor_ptr->inside_quest].type == QUEST_TYPE_RANDOM)
{
- leave_quest_check();
+ leave_quest_check(creature_ptr);
- creature_ptr->inside_quest = 0;
+ creature_ptr->current_floor_ptr->inside_quest = 0;
}
/* For a fixed quest */
- if (creature_ptr->inside_quest &&
- quest[creature_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
+ if (creature_ptr->current_floor_ptr->inside_quest &&
+ quest[creature_ptr->current_floor_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
{
- leave_quest_check();
+ leave_quest_check(creature_ptr);
- creature_ptr->inside_quest = g_ptr->special;
- current_floor_ptr->dun_level = 0;
+ creature_ptr->current_floor_ptr->inside_quest = g_ptr->special;
+ creature_ptr->current_floor_ptr->dun_level = 0;
up_num = 0;
}
if (have_flag(f_ptr->flags, FF_SHAFT))
{
/* Create a way back */
- prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_UP | CFM_SHAFT);
+ prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_UP | CFM_SHAFT);
up_num = 2;
}
else
{
/* Create a way back */
- prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_UP);
+ prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_UP);
up_num = 1;
}
/* Get out from current dungeon */
- if (current_floor_ptr->dun_level - up_num < d_info[creature_ptr->dungeon_idx].mindepth)
- up_num = current_floor_ptr->dun_level;
+ if (creature_ptr->current_floor_ptr->dun_level - up_num < d_info[creature_ptr->dungeon_idx].mindepth)
+ up_num = creature_ptr->current_floor_ptr->dun_level;
}
if (record_stair) exe_write_diary(creature_ptr, NIKKI_STAIR, 0-up_num, _("階段を上った", "climbed up the stairs to"));
/* Success */
if ((creature_ptr->pseikaku == SEIKAKU_COMBAT) || (creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
msg_print(_("なんだこの階段は!", "What's this STAIRWAY!"));
- else if (up_num == current_floor_ptr->dun_level)
+ else if (up_num == creature_ptr->current_floor_ptr->dun_level)
msg_print(_("地上に戻った。", "You go back to the surface."));
else
msg_print(_("階段を上って新たなる迷宮へと足を踏み入れた。", "You enter a maze of up staircases."));
/*!
* @brief 階段を使って階層を降りる処理 / Go down one level
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @return なし
*/
void do_cmd_go_down(player_type *creature_ptr)
{
- /* Player grid */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
- feature_type *f_ptr = &f_info[g_ptr->feat];
-
bool fall_trap = FALSE;
int down_num = 0;
}
/* Verify stairs */
+ grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
+ feature_type *f_ptr = &f_info[g_ptr->feat];
if (!have_flag(f_ptr->flags, FF_MORE))
{
msg_print(_("ここには下り階段が見当たらない。", "I see no down staircase here."));
/* Quest entrance */
if (have_flag(f_ptr->flags, FF_QUEST_ENTER))
{
- do_cmd_quest();
+ do_cmd_quest(creature_ptr);
+ return;
}
/* Quest down stairs */
- else if (have_flag(f_ptr->flags, FF_QUEST))
+ if (have_flag(f_ptr->flags, FF_QUEST))
{
/* Confirm Leaving */
if(!confirm_leave_level(creature_ptr, TRUE)) return;
else
msg_print(_("下の階に降りた。", "You enter the down staircase."));
- leave_quest_check();
+ leave_quest_check(creature_ptr);
leave_tower_check();
- creature_ptr->inside_quest = g_ptr->special;
+ creature_ptr->current_floor_ptr->inside_quest = g_ptr->special;
/* Activate the quest */
- if (!quest[creature_ptr->inside_quest].status)
+ if (!quest[creature_ptr->current_floor_ptr->inside_quest].status)
{
- if (quest[creature_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
+ if (quest[creature_ptr->current_floor_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
{
init_flags = INIT_ASSIGN;
- process_dungeon_file("q_info.txt", 0, 0, 0, 0);
+ process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
}
- quest[creature_ptr->inside_quest].status = QUEST_STATUS_TAKEN;
+ quest[creature_ptr->current_floor_ptr->inside_quest].status = QUEST_STATUS_TAKEN;
}
/* Leaving a quest */
- if (!creature_ptr->inside_quest)
+ if (!creature_ptr->current_floor_ptr->inside_quest)
{
- current_floor_ptr->dun_level = 0;
+ creature_ptr->current_floor_ptr->dun_level = 0;
}
creature_ptr->leaving = TRUE;
creature_ptr->oldpx = 0;
creature_ptr->oldpy = 0;
take_turn(creature_ptr, 100);
+ return;
}
- else
+ DUNGEON_IDX target_dungeon = 0;
+
+ if (!creature_ptr->current_floor_ptr->dun_level)
{
- DUNGEON_IDX target_dungeon = 0;
+ target_dungeon = have_flag(f_ptr->flags, FF_ENTRANCE) ? g_ptr->special : DUNGEON_ANGBAND;
- if (!current_floor_ptr->dun_level)
+ if (ironman_downward && (target_dungeon != DUNGEON_ANGBAND))
{
- target_dungeon = have_flag(f_ptr->flags, FF_ENTRANCE) ? g_ptr->special : DUNGEON_ANGBAND;
-
- if (ironman_downward && (target_dungeon != DUNGEON_ANGBAND))
- {
- msg_print(_("ダンジョンの入口は塞がれている!", "The entrance of this dungeon is closed!"));
- return;
- }
- if (!max_dlv[target_dungeon])
- {
- msg_format(_("ここには%sの入り口(%d階相当)があります", "There is the entrance of %s (Danger level: %d)"),
- d_name+d_info[target_dungeon].name, d_info[target_dungeon].mindepth);
- if (!get_check(_("本当にこのダンジョンに入りますか?", "Do you really get in this dungeon? "))) return;
- }
+ msg_print(_("ダンジョンの入口は塞がれている!", "The entrance of this dungeon is closed!"));
+ return;
+ }
+ if (!max_dlv[target_dungeon])
+ {
+ msg_format(_("ここには%sの入り口(%d階相当)があります", "There is the entrance of %s (Danger level: %d)"),
+ d_name + d_info[target_dungeon].name, d_info[target_dungeon].mindepth);
+ if (!get_check(_("本当にこのダンジョンに入りますか?", "Do you really get in this dungeon? "))) return;
+ }
- /* Save old player position */
- creature_ptr->oldpx = creature_ptr->x;
- creature_ptr->oldpy = creature_ptr->y;
- creature_ptr->dungeon_idx = target_dungeon;
+ /* Save old player position */
+ creature_ptr->oldpx = creature_ptr->x;
+ creature_ptr->oldpy = creature_ptr->y;
+ creature_ptr->dungeon_idx = target_dungeon;
- /*
- * Clear all saved floors
- * and create a first saved floor
- */
- prepare_change_floor_mode(CFM_FIRST_FLOOR);
- }
+ /*
+ * Clear all saved floors
+ * and create a first saved floor
+ */
+ prepare_change_floor_mode(creature_ptr, CFM_FIRST_FLOOR);
+ }
- take_turn(creature_ptr, 100);
+ take_turn(creature_ptr, 100);
- if (autosave_l) do_cmd_save_game(TRUE);
+ if (autosave_l) do_cmd_save_game(creature_ptr, TRUE);
- /* Go down */
- if (have_flag(f_ptr->flags, FF_SHAFT)) down_num += 2;
- else down_num += 1;
+ /* Go down */
+ if (have_flag(f_ptr->flags, FF_SHAFT)) down_num += 2;
+ else down_num += 1;
- if (!current_floor_ptr->dun_level)
- {
- /* Enter the dungeon just now */
- creature_ptr->enter_dungeon = TRUE;
- down_num = d_info[creature_ptr->dungeon_idx].mindepth;
- }
+ if (!creature_ptr->current_floor_ptr->dun_level)
+ {
+ /* Enter the dungeon just now */
+ creature_ptr->enter_dungeon = TRUE;
+ down_num = d_info[creature_ptr->dungeon_idx].mindepth;
+ }
- if (record_stair)
- {
- if (fall_trap) exe_write_diary(creature_ptr, NIKKI_STAIR, down_num, _("落とし戸に落ちた", "fell through a trap door"));
- else exe_write_diary(creature_ptr, NIKKI_STAIR, down_num, _("階段を下りた", "climbed down the stairs to"));
- }
+ if (record_stair)
+ {
+ if (fall_trap) exe_write_diary(creature_ptr, NIKKI_STAIR, down_num, _("落とし戸に落ちた", "fell through a trap door"));
+ else exe_write_diary(creature_ptr, NIKKI_STAIR, down_num, _("階段を下りた", "climbed down the stairs to"));
+ }
- if (fall_trap)
+ if (fall_trap)
+ {
+ msg_print(_("わざと落とし戸に落ちた。", "You deliberately jump through the trap door."));
+ }
+ else
+ {
+ /* Success */
+ if (target_dungeon)
{
- msg_print(_("わざと落とし戸に落ちた。", "You deliberately jump through the trap door."));
+ msg_format(_("%sへ入った。", "You entered %s."), d_text + d_info[creature_ptr->dungeon_idx].text);
}
else
{
- /* Success */
- if (target_dungeon)
- {
- msg_format(_("%sへ入った。", "You entered %s."), d_text + d_info[creature_ptr->dungeon_idx].text);
- }
+ if ((creature_ptr->pseikaku == SEIKAKU_COMBAT) || (creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
+ msg_print(_("なんだこの階段は!", "What's this STAIRWAY!"));
else
- {
- if ((creature_ptr->pseikaku == SEIKAKU_COMBAT) || (creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
- msg_print(_("なんだこの階段は!", "What's this STAIRWAY!"));
- else
- msg_print(_("階段を下りて新たなる迷宮へと足を踏み入れた。", "You enter a maze of down staircases."));
- }
+ msg_print(_("階段を下りて新たなる迷宮へと足を踏み入れた。", "You enter a maze of down staircases."));
}
+ }
- creature_ptr->leaving = TRUE;
+ creature_ptr->leaving = TRUE;
- if (fall_trap)
- {
- prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
- }
- else
- {
- if (have_flag(f_ptr->flags, FF_SHAFT))
- {
- /* Create a way back */
- prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN | CFM_SHAFT);
- }
- else
- {
- /* Create a way back */
- prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN);
- }
- }
+ if (fall_trap)
+ {
+ prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
+ return;
+ }
+
+ /* Create a way back */
+ if (have_flag(f_ptr->flags, FF_SHAFT))
+ {
+ prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_DOWN | CFM_SHAFT);
+ }
+ else
+ {
+ prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_DOWN);
}
}
/*!
- * @brief 探索コマンドのメインルーチン / Simple command to "search" for one current_world_ptr->game_turn
+ * @brief 探索コマンドのメインルーチン / Simple command to "search" for one turn
* @return なし
*/
void do_cmd_search(player_type * creature_ptr)
/* Cancel the arg */
command_arg = 0;
}
- take_turn(creature_ptr, 100);
+ take_turn(creature_ptr, 100);
search(creature_ptr);
}
* @param trapped TRUEならばトラップが存在する箱のみ、FALSEならば空でない箱全てを対象にする
* @return 箱が存在する場合そのオブジェクトID、存在しない場合0を返す。
*/
-static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped)
+static OBJECT_IDX chest_check(floor_type *floor_ptr, POSITION y, POSITION x, bool trapped)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &floor_ptr->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Scan all objects in the grid */
{
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ o_ptr = &floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
/* Skip unknown chests XXX XXX */
return (this_o_idx);
}
}
- return (0);
+
+ return 0;
}
/*!
*/
static bool exe_open_chest(player_type *creature_ptr, POSITION y, POSITION x, OBJECT_IDX o_idx)
{
- int i, j;
bool flag = TRUE;
bool more = FALSE;
- object_type *o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ object_type *o_ptr = &creature_ptr->current_floor_ptr->o_list[o_idx];
take_turn(creature_ptr, 100);
flag = FALSE;
/* Get the "disarm" factor */
- i = creature_ptr->skill_dis;
+ int i = creature_ptr->skill_dis;
/* Penalize some conditions */
- if (creature_ptr->blind || no_lite()) i = i / 10;
+ if (creature_ptr->blind || no_lite(creature_ptr)) i = i / 10;
if (creature_ptr->confused || creature_ptr->image) i = i / 10;
/* Extract the difficulty */
- j = i - o_ptr->pval;
+ int j = i - o_ptr->pval;
/* Always have a small chance of success */
if (j < 2) j = 2;
if (flag)
{
/* Apply chest traps, if any */
- chest_trap(y, x, o_idx);
+ chest_trap(creature_ptr, y, x, o_idx);
/* Let the Chest drop items */
- chest_death(FALSE, y, x, o_idx);
+ chest_death(creature_ptr, FALSE, y, x, o_idx);
}
- return (more);
+
+ return more;
}
/*!
*/
static int count_dt(player_type *creature_ptr, POSITION *y, POSITION *x, bool (*test)(FEAT_IDX feat), bool under)
{
- DIRECTION d;
- int count;
- POSITION xx, yy;
-
- /* Count how many matches */
- count = 0;
-
/* Check around (and under) the character */
- for (d = 0; d < 9; d++)
+ int count = 0;
+ for (DIRECTION d = 0; d < 9; d++)
{
grid_type *g_ptr;
FEAT_IDX feat;
if ((d == 8) && !under) continue;
/* Extract adjacent (legal) location */
- yy = creature_ptr->y + ddy_ddd[d];
- xx = creature_ptr->x + ddx_ddd[d];
+ POSITION yy = creature_ptr->y + ddy_ddd[d];
+ POSITION xx = creature_ptr->x + ddx_ddd[d];
- /* Get the current_floor_ptr->grid_array */
- g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
+ /* Get the creature_ptr->current_floor_ptr->grid_array */
+ g_ptr = &creature_ptr->current_floor_ptr->grid_array[yy][xx];
/* Must have knowledge */
if (!(g_ptr->info & (CAVE_MARK))) continue;
*/
static int count_chests(player_type *creature_ptr, POSITION *y, POSITION *x, bool trapped)
{
- DIRECTION d;
- int count;
- OBJECT_IDX o_idx;
- object_type *o_ptr;
-
- /* Count how many matches */
- count = 0;
-
/* Check around (and under) the character */
- for (d = 0; d < 9; d++)
+ int count = 0;
+ for (DIRECTION d = 0; d < 9; d++)
{
/* Extract adjacent (legal) location */
POSITION yy = creature_ptr->y + ddy_ddd[d];
POSITION xx = creature_ptr->x + ddx_ddd[d];
/* No (visible) chest is there */
- if ((o_idx = chest_check(yy, xx, FALSE)) == 0) continue;
+ OBJECT_IDX o_idx = chest_check(creature_ptr->current_floor_ptr, yy, xx, FALSE);
+ if (!o_idx) continue;
/* Grab the object */
- o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ object_type *o_ptr;
+ o_ptr = &creature_ptr->current_floor_ptr->o_list[o_idx];
/* Already open */
if (o_ptr->pval == 0) continue;
*/
static bool exe_open(player_type *creature_ptr, POSITION y, POSITION x)
{
- int i, j;
-
/* Get requested grid */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
bool more = FALSE;
{
/* Stuck */
msg_format(_("%sはがっちりと閉じられているようだ。", "The %s appears to be stuck."), f_name + f_info[get_feat_mimic(g_ptr)].name);
+ return more;
}
- /* Locked door */
- else if (f_ptr->power)
+ if (!f_ptr->power)
{
- /* Disarm factor */
- i = creature_ptr->skill_dis;
-
- /* Penalize some conditions */
- if (creature_ptr->blind || no_lite()) i = i / 10;
- if (creature_ptr->confused || creature_ptr->image) i = i / 10;
-
- /* Extract the lock power */
- j = f_ptr->power;
-
- /* Extract the difficulty */
- j = i - (j * 4);
-
- /* Always have a small chance of success */
- if (j < 2) j = 2;
-
- /* Success */
- if (randint0(100) < j)
- {
- msg_print(_("鍵をはずした。", "You have picked the lock."));
+ cave_alter_feat(creature_ptr, y, x, FF_OPEN);
+ sound(SOUND_OPENDOOR);
+ return more;
+ }
+
+ /* Disarm factor */
+ int i = creature_ptr->skill_dis;
- /* Open the door */
- cave_alter_feat(y, x, FF_OPEN);
+ /* Penalize some conditions */
+ if (creature_ptr->blind || no_lite(creature_ptr)) i = i / 10;
+ if (creature_ptr->confused || creature_ptr->image) i = i / 10;
- sound(SOUND_OPENDOOR);
+ /* Extract the difficulty */
+ int j = f_ptr->power;
+ j = i - (j * 4);
- /* Experience */
- gain_exp(creature_ptr, 1);
- }
+ /* Always have a small chance of success */
+ if (j < 2) j = 2;
- /* Failure */
- else
- {
- /* Failure */
- if (flush_failure) flush();
+ if (randint0(100) >= j)
+ {
+ if (flush_failure) flush();
+ msg_print(_("鍵をはずせなかった。", "You failed to pick the lock."));
+ more = TRUE;
+ }
- msg_print(_("鍵をはずせなかった。", "You failed to pick the lock."));
+ msg_print(_("鍵をはずした。", "You have picked the lock."));
- /* We may keep trying */
- more = TRUE;
- }
- }
+ /* Open the door */
+ cave_alter_feat(creature_ptr, y, x, FF_OPEN);
- /* Closed door */
- else
- {
- /* Open the door */
- cave_alter_feat(y, x, FF_OPEN);
+ sound(SOUND_OPENDOOR);
- sound(SOUND_OPENDOOR);
- }
- return (more);
+ /* Experience */
+ gain_exp(creature_ptr, 1);
+ return more;
}
/*!
{
bool too_many = (num_doors && num_chests) || (num_doors > 1) ||
(num_chests > 1);
- if (!too_many) command_dir = coords_to_dir(y, x);
+ if (!too_many) command_dir = coords_to_dir(creature_ptr, y, x);
}
}
x = creature_ptr->x + ddx[dir];
/* Get requested grid */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
/* Check for chest */
- o_idx = chest_check(y, x, FALSE);
+ o_idx = chest_check(creature_ptr->current_floor_ptr, y, x, FALSE);
if (!have_flag(f_info[feat].flags, FF_OPEN) && !o_idx)
{
{
take_turn(creature_ptr, 100);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
- py_attack(y, x, 0);
+ py_attack(creature_ptr, y, x, 0);
}
else if (o_idx)
{
}
/* Cancel repeat unless we may continue */
- if (!more) disturb(p_ptr, FALSE, FALSE);
+ if (!more) disturb(creature_ptr, FALSE, FALSE);
}
-/*!
+/*
+ * todo 常にFALSEを返している
* @brief 「閉じる」動作コマンドのサブルーチン /
* Perform the basic "close" command
* @param y 対象を行うマスのY座標
*/
static bool exe_close(player_type *creature_ptr, POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
FEAT_IDX old_feat = g_ptr->feat;
bool more = FALSE;
/* Seeing true feature code (ignore mimic) */
/* Open door */
- if (have_flag(f_info[old_feat].flags, FF_CLOSE))
+ if (!have_flag(f_info[old_feat].flags, FF_CLOSE))
+ {
+ return more;
+ }
+
+ s16b closed_feat = feat_state(old_feat, FF_CLOSE);
+
+ /* Hack -- object in the way */
+ if ((g_ptr->o_idx || (g_ptr->info & CAVE_OBJECT)) &&
+ (closed_feat != old_feat) && !have_flag(f_info[closed_feat].flags, FF_DROP))
{
- s16b closed_feat = feat_state(old_feat, FF_CLOSE);
+ msg_print(_("何かがつっかえて閉まらない。", "There seems stuck."));
+ }
+ else
+ {
+ /* Close the door */
+ cave_alter_feat(creature_ptr, y, x, FF_CLOSE);
- /* Hack -- object in the way */
- if ((g_ptr->o_idx || (g_ptr->info & CAVE_OBJECT)) &&
- (closed_feat != old_feat) && !have_flag(f_info[closed_feat].flags, FF_DROP))
+ /* Broken door */
+ if (old_feat == g_ptr->feat)
{
- msg_print(_("何かがつっかえて閉まらない。", "There seems stuck."));
+ msg_print(_("ドアは壊れてしまっている。", "The door appears to be broken."));
}
else
{
- /* Close the door */
- cave_alter_feat(y, x, FF_CLOSE);
-
- /* Broken door */
- if (old_feat == g_ptr->feat)
- {
- msg_print(_("ドアは壊れてしまっている。", "The door appears to be broken."));
- }
- else
- {
- sound(SOUND_SHUTDOOR);
- }
+ sound(SOUND_SHUTDOOR);
}
}
- return (more);
+
+ return more;
}
/* Count open doors */
if (count_dt(creature_ptr, &y, &x, is_open, FALSE) == 1)
{
- command_dir = coords_to_dir(y, x);
+ command_dir = coords_to_dir(creature_ptr, y, x);
}
}
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
/* Attack */
- py_attack(y, x, 0);
+ py_attack(creature_ptr, y, x, 0);
}
/* Close the door */
}
/* Cancel repeat unless we may continue */
- if (!more) disturb(p_ptr, FALSE, FALSE);
+ if (!more) disturb(creature_ptr, FALSE, FALSE);
}
* @param x 対象を行うマスのX座標
* @return
*/
-static bool do_cmd_tunnel_test(POSITION y, POSITION x)
+static bool do_cmd_tunnel_test(floor_type *floor_ptr, POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &floor_ptr->grid_array[y][x];
/* Must have knowledge */
if (!(g_ptr->info & CAVE_MARK))
bool more = FALSE;
/* Verify legality */
- if (!do_cmd_tunnel_test(y, x)) return (FALSE);
+ if (!do_cmd_tunnel_test(creature_ptr->current_floor_ptr, y, x)) return (FALSE);
take_turn(creature_ptr, 100);
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
f_ptr = &f_info[g_ptr->feat];
power = f_ptr->power;
msg_format(_("%sをくずした。", "You have removed the %s."), name);
/* Remove the feature */
- cave_alter_feat(y, x, FF_TUNNEL);
+ cave_alter_feat(creature_ptr, y, x, FF_TUNNEL);
creature_ptr->update |= (PU_FLOW);
}
else
if (have_flag(f_ptr->flags, FF_GLASS)) sound(SOUND_GLASS);
/* Remove the feature */
- cave_alter_feat(y, x, FF_TUNNEL);
+ cave_alter_feat(creature_ptr, y, x, FF_TUNNEL);
chg_virtue(creature_ptr, V_DILIGENCE, 1);
chg_virtue(creature_ptr, V_NATURE, -1);
/* Occasional Search XXX XXX */
if (randint0(100) < 25) search(creature_ptr);
}
+
return more;
}
* @details
* <pre>
* Note that you must tunnel in order to hit invisible monsters
- * in walls, though moving into walls still takes a current_world_ptr->game_turn anyway.
+ * in walls, though moving into walls still takes a turn anyway.
*
* Digging is very difficult without a "digger" weapon, but can be
* accomplished by strong players using heavy weapons.
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
/* Attack */
- py_attack(y, x, 0);
+ py_attack(creature_ptr, y, x, 0);
}
/* Try digging */
}
/* Cancel repetition unless we can continue */
- if (!more) disturb(p_ptr, FALSE, FALSE);
+ if (!more) disturb(creature_ptr, FALSE, FALSE);
}
/*!
{
int i, j;
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
/* Must be a closed door */
i = creature_ptr->skill_dis;
/* Penalize some conditions */
- if (creature_ptr->blind || no_lite()) i = i / 10;
+ if (creature_ptr->blind || no_lite(creature_ptr)) i = i / 10;
if (creature_ptr->confused || creature_ptr->image) i = i / 10;
/* Extract the lock power */
msg_print(_("鍵をはずした。", "You have picked the lock."));
/* Open the door */
- cave_alter_feat(y, x, FF_OPEN);
+ cave_alter_feat(creature_ptr, y, x, FF_OPEN);
sound(SOUND_OPENDOOR);
else
{
/* Open the door */
- cave_alter_feat(y, x, FF_OPEN);
+ cave_alter_feat(creature_ptr, y, x, FF_OPEN);
sound(SOUND_OPENDOOR);
}
+
return (TRUE);
}
{
int i, j;
bool more = FALSE;
- object_type *o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ object_type *o_ptr = &creature_ptr->current_floor_ptr->o_list[o_idx];
take_turn(creature_ptr, 100);
i = creature_ptr->skill_dis;
/* Penalize some conditions */
- if (creature_ptr->blind || no_lite()) i = i / 10;
+ if (creature_ptr->blind || no_lite(creature_ptr)) i = i / 10;
if (creature_ptr->confused || creature_ptr->image) i = i / 10;
/* Extract the difficulty */
{
msg_print(_("トラップを作動させてしまった!", "You set off a trap!"));
sound(SOUND_FAIL);
- chest_trap(y, x, o_idx);
+ chest_trap(creature_ptr, y, x, o_idx);
}
+
return (more);
}
bool exe_disarm(player_type *creature_ptr, POSITION y, POSITION x, DIRECTION dir)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
/* Get feature */
feature_type *f_ptr = &f_info[g_ptr->feat];
take_turn(creature_ptr, 100);
/* Penalize some conditions */
- if (creature_ptr->blind || no_lite()) i = i / 10;
+ if (creature_ptr->blind || no_lite(creature_ptr)) i = i / 10;
if (creature_ptr->confused || creature_ptr->image) i = i / 10;
/* Extract the difficulty */
gain_exp(creature_ptr, power);
/* Remove the trap */
- cave_alter_feat(y, x, FF_DISARM);
+ cave_alter_feat(creature_ptr, y, x, FF_DISARM);
/* Move the player onto the trap */
move_player(creature_ptr, dir, easy_disarm, FALSE);
/* Move the player onto the trap */
move_player(creature_ptr, dir, easy_disarm, FALSE);
}
+
return (more);
}
if (num_traps || num_chests)
{
bool too_many = (num_traps && num_chests) || (num_traps > 1) || (num_chests > 1);
- if (!too_many) command_dir = coords_to_dir(y, x);
+ if (!too_many) command_dir = coords_to_dir(creature_ptr, y, x);
}
}
-
-
+
/* Allow repeated command */
if (command_arg)
{
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
/* Check for chests */
- o_idx = chest_check(y, x, TRUE);
+ o_idx = chest_check(creature_ptr->current_floor_ptr, y, x, TRUE);
/* Disarm a trap */
if (!is_trap(feat) && !o_idx)
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
/* Attack */
- py_attack(y, x, 0);
+ py_attack(creature_ptr, y, x, 0);
}
/* Disarm chest */
}
/* Cancel repeat unless told not to */
- if (!more) disturb(p_ptr, FALSE, FALSE);
+ if (!more) disturb(creature_ptr, FALSE, FALSE);
}
*/
static bool do_cmd_bash_aux(player_type *creature_ptr, POSITION y, POSITION x, DIRECTION dir)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
/* Get feature */
feature_type *f_ptr = &f_info[g_ptr->feat];
/* Break down the door */
if ((randint0(100) < 50) || (feat_state(g_ptr->feat, FF_OPEN) == g_ptr->feat) || have_flag(f_ptr->flags, FF_GLASS))
{
- cave_alter_feat(y, x, FF_BASH);
+ cave_alter_feat(creature_ptr, y, x, FF_BASH);
}
/* Open the door */
else
{
- cave_alter_feat(y, x, FF_OPEN);
+ cave_alter_feat(creature_ptr, y, x, FF_OPEN);
}
/* Hack -- Fall through the door */
/* Hack -- Lose balance ala paralysis */
(void)set_paralyzed(creature_ptr, creature_ptr->paralyzed + 2 + randint0(2));
}
+
return (more);
}
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
/* Attack */
- py_attack(y, x, 0);
+ py_attack(creature_ptr, y, x, 0);
}
/* Bash a closed door */
}
/* Unless valid action taken, cancel bash */
- if (!more) disturb(p_ptr, FALSE, FALSE);
+ if (!more) disturb(creature_ptr, FALSE, FALSE);
}
*
* Consider confusion
*
- * This command must always take a current_world_ptr->game_turn, to prevent free detection
+ * This command must always take a turn, to prevent free detection
* of invisible monsters.
* </pre>
*/
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
if (g_ptr->m_idx)
{
- py_attack(y, x, 0);
+ py_attack(creature_ptr, y, x, 0);
}
/* Locked doors */
}
/* Cancel repetition unless we can continue */
- if (!more) disturb(p_ptr, FALSE, FALSE);
+ if (!more) disturb(creature_ptr, FALSE, FALSE);
}
/*!
* @brief 「くさびを打つ」動作コマンドのメインルーチン /
* Jam a closed door with a spike
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @return なし
* @details
* <pre>
}
/* Get a "repeated" direction */
- if (get_rep_dir(&dir, FALSE))
- {
- POSITION y, x;
- INVENTORY_IDX item;
- grid_type *g_ptr;
- FEAT_IDX feat;
+ if (!get_rep_dir(&dir, FALSE)) return;
- y = creature_ptr->y + ddy[dir];
- x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ POSITION y = creature_ptr->y + ddy[dir];
+ POSITION x = creature_ptr->x + ddx[dir];
+ grid_type *g_ptr;
+ g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
- /* Feature code (applying "mimic" field) */
- feat = get_feat_mimic(g_ptr);
+ /* Feature code (applying "mimic" field) */
+ FEAT_IDX feat = get_feat_mimic(g_ptr);
- /* Require closed door */
- if (!have_flag(f_info[feat].flags, FF_SPIKE))
- {
- msg_print(_("そこにはくさびを打てるものが見当たらない。", "You see nothing there to spike."));
- }
+ /* Require closed door */
+ INVENTORY_IDX item;
+ if (!have_flag(f_info[feat].flags, FF_SPIKE))
+ {
+ msg_print(_("そこにはくさびを打てるものが見当たらない。", "You see nothing there to spike."));
+ }
- /* Get a spike */
- else if (!get_spike(creature_ptr, &item))
- {
- msg_print(_("くさびを持っていない!", "You have no spikes!"));
- }
+ /* Get a spike */
+ else if (!get_spike(creature_ptr, &item))
+ {
+ msg_print(_("くさびを持っていない!", "You have no spikes!"));
+ }
- /* Is a monster in the way? */
- else if (g_ptr->m_idx)
- {
- take_turn(creature_ptr, 100);
+ /* Is a monster in the way? */
+ else if (g_ptr->m_idx)
+ {
+ take_turn(creature_ptr, 100);
- msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
+ msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
- /* Attack */
- py_attack(y, x, 0);
- }
+ /* Attack */
+ py_attack(creature_ptr, y, x, 0);
+ }
- /* Go for it */
- else
- {
- take_turn(creature_ptr, 100);
+ /* Go for it */
+ else
+ {
+ take_turn(creature_ptr, 100);
- /* Successful jamming */
- msg_format(_("%sにくさびを打ち込んだ。", "You jam the %s with a spike."), f_name + f_info[feat].name);
- cave_alter_feat(y, x, FF_SPIKE);
+ /* Successful jamming */
+ msg_format(_("%sにくさびを打ち込んだ。", "You jam the %s with a spike."), f_name + f_info[feat].name);
+ cave_alter_feat(creature_ptr, y, x, FF_SPIKE);
- /* Use up, and describe, a single spike, from the bottom */
- inven_item_increase(item, -1);
- inven_item_describe(item);
- inven_item_optimize(item);
- }
+ vary_item(creature_ptr, item, -1);
}
}
-
/*!
* @brief 「歩く」動作コマンドのメインルーチン /
* Support code for the "Walk" and "Jump" commands
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @param pickup アイテムの自動拾いを行うならTRUE
* @return なし
*/
void do_cmd_walk(player_type *creature_ptr, bool pickup)
{
- DIRECTION dir;
-
- bool more = FALSE;
-
-
/* Allow repeated command */
if (command_arg)
{
}
/* Get a "repeated" direction */
+ bool more = FALSE;
+ DIRECTION dir;
if (get_rep_dir(&dir, FALSE))
{
take_turn(creature_ptr, 100);
}
/* Hack again -- Is there a special encounter ??? */
- if (creature_ptr->wild_mode && !cave_have_flag_bold(creature_ptr->y, creature_ptr->x, FF_TOWN))
+ if (creature_ptr->wild_mode && !cave_have_flag_bold(creature_ptr->current_floor_ptr, creature_ptr->y, creature_ptr->x, FF_TOWN))
{
int tmp = 120 + creature_ptr->lev*10 - wilderness[creature_ptr->y][creature_ptr->x].level + 5;
if (tmp < 1)
/* Go into large wilderness view */
creature_ptr->oldpy = randint1(MAX_HGT-2);
creature_ptr->oldpx = randint1(MAX_WID-2);
- change_wild_mode(TRUE);
+ change_wild_mode(creature_ptr, TRUE);
/* Give first move to monsters */
take_turn(creature_ptr, 100);
}
/* Cancel repeat unless we may continue */
- if (!more) disturb(p_ptr, FALSE, FALSE);
+ if (!more) disturb(creature_ptr, FALSE, FALSE);
}
/*!
* @brief 「走る」動作コマンドのメインルーチン /
* Start running.
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @return なし
*/
void do_cmd_run(player_type *creature_ptr)
* @brief 「留まる」動作コマンドのメインルーチン /
* Stay still. Search. Enter stores.
* Pick up treasure if "pickup" is true.
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @param pickup アイテムの自動拾いを行うならTRUE
* @return なし
*/
/*!
* @brief 「休む」動作コマンドのメインルーチン /
* Resting allows a player to safely restore his hp -RAK-
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @return なし
*/
void do_cmd_rest(player_type *creature_ptr)
{
-
set_action(creature_ptr, ACTION_NONE);
if ((creature_ptr->pclass == CLASS_BARD) && (SINGING_SONG_EFFECT(creature_ptr) || INTERUPTING_SONG_EFFECT(creature_ptr)))
stop_singing(creature_ptr);
}
- if (hex_spelling_any(creature_ptr)) stop_hex_spell_all();
+ if (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
/* Prompt for time if needed */
if (command_arg <= 0)
concptr p = _("休憩 (0-9999, '*' で HP/MP全快, '&' で必要なだけ): ",
"Rest (0-9999, '*' for HP/SP, '&' as needed): ");
-
- char out_val[80];
+char out_val[80];
/* Default */
strcpy(out_val, "&");
if (creature_ptr->special_defense & NINJA_S_STEALTH) set_superstealth(creature_ptr, FALSE);
- /* Take a current_world_ptr->game_turn (?) */
+ /* Take a turn (?) */
take_turn(creature_ptr, 100);
/* The sin of sloth */
update_creature(creature_ptr);
creature_ptr->redraw |= (PR_STATE);
- update_output();
+ update_output(creature_ptr);
Term_fresh();
}
-/*!
+/*
+ * todo Doxygenの加筆求む
* @brief 射撃処理のメインルーチン
+ * @param creature_ptr プレーヤーへの参照ポインタ
+ * @param snipe_type ???
* @return なし
*/
void do_cmd_fire(player_type *creature_ptr, SPELL_IDX snipe_type)
q = _("どれを撃ちますか? ", "Fire which item? ");
s = _("発射されるアイテムがありません。", "You have nothing to fire.");
- ammo_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), creature_ptr->tval_ammo);
+ ammo_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), creature_ptr->tval_ammo);
if (!ammo_ptr)
{
flush();
}
/* Fire the item */
- exe_fire(item, j_ptr, snipe_type);
+ exe_fire(creature_ptr, item, j_ptr, snipe_type);
if (!creature_ptr->is_fired || creature_ptr->pclass != CLASS_SNIPER) return;
/* Sniper actions after some shootings */
if (snipe_type == SP_AWAY)
{
- teleport_player(10 + (creature_ptr->concent * 2), 0L);
+ teleport_player(creature_ptr, 10 + (creature_ptr->concent * 2), 0L);
}
+
if (snipe_type == SP_FINAL)
{
msg_print(_("射撃の反動が体を襲った。", "A reactionary of shooting attacked you. "));
* @brief 投射処理メインルーチン /
* Throw an object from the pack or floor.
* @param mult 威力の倍率
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @param boomerang ブーメラン処理ならばTRUE
* @param shuriken 忍者の手裏剣処理ならばTRUE
* @return ターンを消費した場合TRUEを返す
item_tester_hook = item_tester_hook_boomerang;
q = _("どの武器を投げますか? ", "Throw which item? ");
s = _("投げる武器がない。", "You have nothing to throw.");
- o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP), 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP), 0);
if (!o_ptr)
{
flush();
{
q = _("どのアイテムを投げますか? ", "Throw which item? ");
s = _("投げるアイテムがない。", "You have nothing to throw.");
- o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR | USE_EQUIP), 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR | USE_EQUIP), 0);
if (!o_ptr)
{
flush();
return FALSE;
}
- if (creature_ptr->inside_arena && !boomerang)
+ if (creature_ptr->current_floor_ptr->inside_arena && !boomerang)
{
if (o_ptr->tval != TV_SPIKE)
{
return FALSE;
}
-
}
+
q_ptr = &forge;
object_copy(q_ptr, o_ptr);
(q_ptr->name1 == ART_AEGISFANG) || boomerang)
return_when_thrown = TRUE;
- /* Reduce and describe creature_ptr->inventory_list */
if (item >= 0)
{
- inven_item_increase(item, -1);
+ inven_item_increase(creature_ptr, item, -1);
if (!return_when_thrown)
- inven_item_describe(item);
- inven_item_optimize(item);
+ inven_item_describe(creature_ptr, item);
+ inven_item_optimize(creature_ptr, item);
}
-
- /* Reduce and describe floor item */
else
{
- floor_item_increase(0 - item, -1);
- floor_item_optimize(0 - item);
+ floor_item_increase(creature_ptr->current_floor_ptr, 0 - item, -1);
+ floor_item_optimize(creature_ptr->current_floor_ptr, 0 - item);
}
+
if (item >= INVEN_RARM)
{
equiped_item = TRUE;
y = creature_ptr->y;
x = creature_ptr->x;
- handle_stuff();
+ handle_stuff(creature_ptr);
if ((creature_ptr->pclass == CLASS_NINJA) && ((q_ptr->tval == TV_SPIKE) || ((have_flag(flgs, TR_THROW)) && (q_ptr->tval == TV_SWORD)))) shuriken = TRUE;
else shuriken = FALSE;
mmove2(&ny[cur_dis], &nx[cur_dis], creature_ptr->y, creature_ptr->x, ty, tx);
/* Stopped by walls/doors */
- if (!cave_have_flag_bold(ny[cur_dis], nx[cur_dis], FF_PROJECT))
+ if (!cave_have_flag_bold(creature_ptr->current_floor_ptr, ny[cur_dis], nx[cur_dis], FF_PROJECT))
{
hit_wall = TRUE;
- if ((q_ptr->tval == TV_FIGURINE) || object_is_potion(q_ptr) || !current_floor_ptr->grid_array[ny[cur_dis]][nx[cur_dis]].m_idx) break;
+ if ((q_ptr->tval == TV_FIGURINE) || object_is_potion(q_ptr) || !creature_ptr->current_floor_ptr->grid_array[ny[cur_dis]][nx[cur_dis]].m_idx) break;
}
/* The player can see the (on screen) missile */
- if (panel_contains(ny[cur_dis], nx[cur_dis]) && player_can_see_bold(ny[cur_dis], nx[cur_dis]))
+ if (panel_contains(ny[cur_dis], nx[cur_dis]) && player_can_see_bold(creature_ptr, ny[cur_dis], nx[cur_dis]))
{
SYMBOL_CODE c = object_char(q_ptr);
TERM_COLOR a = object_attr(q_ptr);
/* Draw, Hilite, Fresh, Pause, Erase */
- print_rel(c, a, ny[cur_dis], nx[cur_dis]);
+ print_rel(creature_ptr, c, a, ny[cur_dis], nx[cur_dis]);
move_cursor_relative(ny[cur_dis], nx[cur_dis]);
Term_fresh();
Term_xtra(TERM_XTRA_DELAY, msec);
cur_dis++;
/* Monster here, Try to hit it */
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (creature_ptr->current_floor_ptr->grid_array[y][x].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];
+ grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
+ monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
GAME_TEXT m_name[MAX_NLEN];
monster_name(g_ptr->m_idx, m_name);
hit_body = TRUE;
/* Did we hit it (penalize range) */
- if (test_hit_fire(chance - cur_dis, m_ptr, m_ptr->ml, o_name))
+ if (test_hit_fire(creature_ptr, chance - cur_dis, m_ptr, m_ptr->ml, o_name))
{
bool fear = FALSE;
torch_dice(q_ptr, &dd, &ds); /* throwing a torch */
tdam = damroll(dd, ds);
/* Apply special damage */
- tdam = tot_dam_aux(q_ptr, tdam, m_ptr, 0, TRUE);
- tdam = critical_shot(q_ptr->weight, q_ptr->to_h, 0, tdam);
+ tdam = tot_dam_aux(creature_ptr, q_ptr, tdam, m_ptr, 0, TRUE);
+ tdam = critical_shot(creature_ptr, q_ptr->weight, q_ptr->to_h, 0, tdam);
if (q_ptr->to_d > 0)
tdam += q_ptr->to_d;
else
j = (hit_body ? breakage_chance(q_ptr, creature_ptr->pclass == CLASS_ARCHER, 0) : 0);
/* Figurines transform */
- if ((q_ptr->tval == TV_FIGURINE) && !(creature_ptr->inside_arena))
+ if ((q_ptr->tval == TV_FIGURINE) && !(creature_ptr->current_floor_ptr->inside_arena))
{
j = 100;
if (potion_smash_effect(0, y, x, q_ptr->k_idx))
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
- if (current_floor_ptr->grid_array[y][x].m_idx && is_friendly(m_ptr) && !MON_INVULNER(m_ptr))
+ monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->current_floor_ptr->grid_array[y][x].m_idx];
+ if (creature_ptr->current_floor_ptr->grid_array[y][x].m_idx && is_friendly(m_ptr) && !MON_INVULNER(m_ptr))
{
GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, 0);
msg_format(_("%sは怒った!", "%^s gets angry!"), m_name);
- set_hostile(¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx]);
+ set_hostile(&creature_ptr->current_floor_ptr->m_list[creature_ptr->current_floor_ptr->grid_array[y][x].m_idx]);
}
}
do_drop = FALSE;
{
for (i = cur_dis - 1; i > 0; i--)
{
- if (panel_contains(ny[i], nx[i]) && player_can_see_bold(ny[i], nx[i]))
+ if (panel_contains(ny[i], nx[i]) && player_can_see_bold(creature_ptr, ny[i], nx[i]))
{
char c = object_char(q_ptr);
byte a = object_attr(q_ptr);
/* Draw, Hilite, Fresh, Pause, Erase */
- print_rel(c, a, ny[i], nx[i]);
+ print_rel(creature_ptr, c, a, ny[i], nx[i]);
move_cursor_relative(ny[i], nx[i]);
Term_fresh();
Term_xtra(TERM_XTRA_DELAY, msec);
{
if (item >= 0)
{
- msg_format(_("%sを受け損ねた!", "%s backs, but you can't catch!"), o2_name);
+ msg_format(_("%sを受け損ねた!", "%s comes backs, but you can't catch!"), o2_name);
}
else
{
}
else
{
- msg_format(_("%sが返ってこなかった!", "%s doesn't back!"), o2_name);
+ msg_format(_("%sが返ってこなかった!", "%s doesn't come back!"), o2_name);
}
}
}
else
{
- inven_carry(q_ptr);
+ inven_carry(creature_ptr, q_ptr);
}
do_drop = FALSE;
}
else if (equiped_item)
{
- verify_equip_slot(item);
+ verify_equip_slot(creature_ptr, item);
calc_android_exp(creature_ptr);
}
if (do_drop)
{
- if (cave_have_flag_bold(y, x, FF_PROJECT))
+ if (cave_have_flag_bold(creature_ptr->current_floor_ptr, y, x, FF_PROJECT))
{
- (void)drop_near(q_ptr, j, y, x);
+ (void)drop_near(creature_ptr, q_ptr, j, y, x);
}
else
{
- (void)drop_near(q_ptr, j, prev_y, prev_x);
+ (void)drop_near(creature_ptr, q_ptr, j, prev_y, prev_x);
}
}
flush();
/* Verify Retirement */
- if (creature_ptr->total_winner)
+ if (current_world_ptr->total_winner)
{
/* Verify */
if (!get_check_strict(_("引退しますか? ", "Do you want to retire? "), CHECK_NO_HISTORY)) return;
if (!get_check(_("本当に自殺しますか?", "Do you really want to commit suicide? "))) return;
}
-
- if (!creature_ptr->noscore)
+ if (!current_world_ptr->noscore)
{
/* Special Verification for suicide */
prt(_("確認のため '@' を押して下さい。", "Please verify SUICIDE by typing the '@' sign: "), 0, 0);
creature_ptr->last_message = NULL;
/* Hack -- Note *winning* message */
- if (creature_ptr->total_winner && last_words)
+ if (current_world_ptr->total_winner && last_words)
{
char buf[1024] = "";
play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_WINNER);
creature_ptr->is_dead = TRUE;
creature_ptr->leaving = TRUE;
- if (!creature_ptr->total_winner)
+ if (!current_world_ptr->total_winner)
{
exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 0, _("ダンジョンの探索に絶望して自殺した。", "give up all hope to commit suicide."));
exe_write_diary(creature_ptr, NIKKI_GAMESTART, 1, _("-------- ゲームオーバー --------", "-------- Game Over --------"));