if (!have_flag(f_info[feat].flags, FF_MORE)) break;
/* Hack -- no trap doors on special levels */
- if (p_ptr->inside_arena || quest_number(current_floor_ptr->dun_level)) continue;
+ if (p_ptr->inside_arena || quest_number(p_ptr->current_floor_ptr->dun_level)) continue;
/* Hack -- no trap doors on the deepest level */
- if (current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth) continue;
+ if (p_ptr->current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth) continue;
break;
}
*/
void disclose_grid(POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (cave_have_flag_grid(g_ptr, FF_SECRET))
{
*/
void place_trap(POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Paranoia -- verify location */
- if (!in_bounds(y, x)) return;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return;
/* Require empty, clean, floor grid */
if (!cave_clean_bold(y, x)) return;
{
msg_print(_("小さなダーツが飛んできて刺さった!", "A small dart hits you!"));
take_hit(p_ptr, DAMAGE_ATTACK, damroll(1, 4), _("ダーツの罠", "a dart trap"), -1);
- if (!CHECK_MULTISHADOW()) hit = TRUE;
+ if (!CHECK_MULTISHADOW(p_ptr)) hit = TRUE;
}
else
{
* @param trap_message メッセージの補完文字列
* @param resist 状態異常に抵抗する判定が出たならTRUE
* @param set_status 状態異常を指定する関数ポインタ
-* @param current_world_ptr->game_turn 状態異常の追加ターン量
+* @param turn_aux 状態異常の追加ターン量
* @return なし
*/
static void hit_trap_set_abnormal_status(concptr trap_message, bool resist, bool(*set_status)(IDX), IDX turn_aux)
* @param break_trap 作動後のトラップ破壊が確定しているならばTRUE
* @return なし
*/
-void hit_trap(bool break_trap)
+void hit_trap(player_type *trapped_ptr, bool break_trap)
{
int i, num, dam;
- POSITION x = p_ptr->x, y = p_ptr->y;
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ POSITION x = trapped_ptr->x, y = trapped_ptr->y;
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
int trap_feat_type = have_flag(f_ptr->flags, FF_TRAP) ? f_ptr->subtype : NOT_TRAP;
concptr name = _("トラップ", "a trap");
- disturb(FALSE, TRUE);
+ disturb(trapped_ptr, FALSE, TRUE);
cave_alter_feat(y, x, FF_HIT_TRAP);
{
case TRAP_TRAPDOOR:
{
- if (p_ptr->levitation)
+ if (trapped_ptr->levitation)
{
msg_print(_("落とし戸を飛び越えた。", "You fly over a trap door."));
}
else
{
msg_print(_("落とし戸に落ちた!", "You have fallen through a trap door!"));
- if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (p_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
+ if ((trapped_ptr->pseikaku == SEIKAKU_COMBAT) || (trapped_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
msg_print(_("くっそ~!", ""));
- else if((p_ptr->pseikaku == SEIKAKU_CHARGEMAN))
+ else if((trapped_ptr->pseikaku == SEIKAKU_CHARGEMAN))
msg_print(_("ジュラル星人の仕業に違いない!", ""));
dam = damroll(2, 8);
name = _("落とし戸", "a trap door");
- take_hit(p_ptr, DAMAGE_NOESCAPE, dam, name, -1);
+ take_hit(trapped_ptr, DAMAGE_NOESCAPE, dam, name, -1);
/* Still alive and autosave enabled */
- if (autosave_l && (p_ptr->chp >= 0))
+ if (autosave_l && (trapped_ptr->chp >= 0))
do_cmd_save_game(TRUE);
- do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("落とし戸に落ちた", "You have fallen through a trap door!"));
+ exe_write_diary(trapped_ptr, NIKKI_BUNSHOU, 0, _("落とし戸に落ちた", "You have fallen through a trap door!"));
prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
- p_ptr->leaving = TRUE;
+ trapped_ptr->leaving = TRUE;
}
break;
}
num = 2 + randint1(3);
for (i = 0; i < num; i++)
{
- (void)summon_specific(0, y, x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+ (void)summon_specific(0, y, x, p_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
}
- if (current_floor_ptr->dun_level > randint1(100)) /* No nasty effect for low levels */
+ if (p_ptr->current_floor_ptr->dun_level > randint1(100)) /* No nasty effect for low levels */
{
bool stop_ty = FALSE;
int count = 0;
{
hit_trap_set_abnormal_status_p(
_("黒いガスに包み込まれた!", "A black gas surrounds you!"),
- p_ptr->resist_blind,
- set_blind, p_ptr->blind + (TIME_EFFECT)randint0(50) + 25);
+ trapped_ptr->resist_blind,
+ set_blind, trapped_ptr->blind + (TIME_EFFECT)randint0(50) + 25);
break;
}
{
hit_trap_set_abnormal_status_p(
_("きらめくガスに包み込まれた!", "A gas of scintillating colors surrounds you!"),
- p_ptr->resist_conf,
- set_confused, p_ptr->confused + (TIME_EFFECT)randint0(20) + 10);
+ trapped_ptr->resist_conf,
+ set_confused, trapped_ptr->confused + (TIME_EFFECT)randint0(20) + 10);
break;
}
{
hit_trap_set_abnormal_status_p(
_("刺激的な緑色のガスに包み込まれた!", "A pungent green gas surrounds you!"),
- p_ptr->resist_pois || IS_OPPOSE_POIS(),
- set_poisoned, p_ptr->poisoned + (TIME_EFFECT)randint0(20) + 10);
+ trapped_ptr->resist_pois || IS_OPPOSE_POIS(),
+ set_poisoned, trapped_ptr->poisoned + (TIME_EFFECT)randint0(20) + 10);
break;
}
case TRAP_SLEEP:
{
msg_print(_("奇妙な白い霧に包まれた!", "A strange white mist surrounds you!"));
- if (!p_ptr->free_act)
+ if (!trapped_ptr->free_act)
{
msg_print(_("あなたは眠りに就いた。", "You fall asleep."));
msg_print(_("身の毛もよだつ光景が頭に浮かんだ。", "A horrible vision enters your mind."));
/* Have some nightmares */
- sanity_blast(NULL, FALSE);
+ sanity_blast(trapped_ptr, NULL, FALSE);
}
- (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(10) + 5);
+ (void)set_paralyzed(trapped_ptr, trapped_ptr->paralyzed + randint0(10) + 5);
}
break;
}
msg_print(_("突然天界の戦争に巻き込まれた!", "Suddenly, you are surrounded by immotal beings!"));
/* Summon Demons and Angels */
- for (lev = current_floor_ptr->dun_level; lev >= 20; lev -= 1 + lev / 16)
+ for (lev = p_ptr->current_floor_ptr->dun_level; lev >= 20; lev -= 1 + lev / 16)
{
num = levs[MIN(lev / 10, 9)];
for (i = 0; i < num; i++)
POSITION x1 = rand_spread(x, 7);
POSITION y1 = rand_spread(y, 5);
- if (!in_bounds(y1, x1)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, y1, x1)) continue;
/* Require line of projection */
- if (!projectable(p_ptr->y, p_ptr->x, y1, x1)) continue;
+ if (!projectable(trapped_ptr->y, trapped_ptr->x, y1, x1)) continue;
if (summon_specific(0, y1, x1, lev, SUMMON_ARMAGE_EVIL, (PM_NO_PET)))
evil_idx = hack_m_idx_ii;
/* Let them fight each other */
if (evil_idx && good_idx)
{
- monster_type *evil_ptr = ¤t_floor_ptr->m_list[evil_idx];
- monster_type *good_ptr = ¤t_floor_ptr->m_list[good_idx];
+ monster_type *evil_ptr = &p_ptr->current_floor_ptr->m_list[evil_idx];
+ monster_type *good_ptr = &p_ptr->current_floor_ptr->m_list[good_idx];
evil_ptr->target_y = good_ptr->fy;
evil_ptr->target_x = good_ptr->fx;
good_ptr->target_y = evil_ptr->fy;
fire_ball_hide(GF_WATER_FLOW, 0, 1, 10);
/* Summon Piranhas */
- num = 1 + current_floor_ptr->dun_level / 20;
+ num = 1 + p_ptr->current_floor_ptr->dun_level / 20;
for (i = 0; i < num; i++)
{
- (void)summon_specific(0, y, x, current_floor_ptr->dun_level, SUMMON_PIRANHAS, (PM_ALLOW_GROUP | PM_NO_PET));
+ (void)summon_specific(0, y, x, p_ptr->current_floor_ptr->dun_level, SUMMON_PIRANHAS, (PM_ALLOW_GROUP | PM_NO_PET));
}
break;
}