#include "view-mainwindow.h"
#include "targeting.h"
+#include "world.h"
/*!
* @brief フロア脱出時に出戻りが不可能だった場合に警告を加える処理
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;
else
msg_print(_("上の階に登った。", "You enter the up staircase."));
- leave_quest_check();
+ leave_quest_check(creature_ptr);
creature_ptr->current_floor_ptr->inside_quest = g_ptr->special;
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->current_floor_ptr->inside_quest].status = QUEST_STATUS_TAKEN;
}
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->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->current_floor_ptr->inside_quest = 0;
}
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->current_floor_ptr->inside_quest = g_ptr->special;
creature_ptr->current_floor_ptr->dun_level = 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;
}
/*!
* @brief 階段を使って階層を降りる処理 / Go down one level
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @return なし
*/
void do_cmd_go_down(player_type *creature_ptr)
{
- /* Player grid */
- 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];
-
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->current_floor_ptr->inside_quest = g_ptr->special;
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->current_floor_ptr->inside_quest].status = QUEST_STATUS_TAKEN;
}
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 (!creature_ptr->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 (!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 (!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);
}
}
/* 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 = &p_ptr->current_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 = &p_ptr->current_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 = &creature_ptr->current_floor_ptr->o_list[o_idx];
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;
/* Let the Chest drop items */
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 creature_ptr->current_floor_ptr->grid_array */
g_ptr = &creature_ptr->current_floor_ptr->grid_array[yy][xx];
*/
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 */
+ object_type *o_ptr;
o_ptr = &creature_ptr->current_floor_ptr->o_list[o_idx];
/* Already open */
*/
static bool exe_open(player_type *creature_ptr, POSITION y, POSITION x)
{
- int i, j;
-
/* Get requested grid */
grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
{
/* 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;
}
/*!
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)
{
-/*!
+/*
+ * todo 常にFALSEを返している
* @brief 「閉じる」動作コマンドのサブルーチン /
* Perform the basic "close" command
* @param y 対象を行うマスのY座標
/* 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;
}
* @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 = &p_ptr->current_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);
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;
}
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);
}
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 */
sound(SOUND_FAIL);
chest_trap(creature_ptr, y, x, o_idx);
}
+
return (more);
}
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 (!too_many) command_dir = coords_to_dir(creature_ptr, y, x);
}
}
-
-
+
/* Allow repeated command */
if (command_arg)
{
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)
/* 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);
}
/*!
* @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 = &creature_ptr->current_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(creature_ptr, 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);
- vary_item(item, -1);
- }
+ 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);
/*!
* @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)))
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, "&");
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)
{
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を返す
return FALSE;
}
-
}
+
q_ptr = &forge;
object_copy(q_ptr, o_ptr);
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);
}
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;
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);
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;
}
{
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 --------"));