}
learn_spell(MS_TELE_AWAY);
- teleport_player_away(m_idx, 100);
+ teleport_player_away(m_idx, p_ptr, 100);
}
else if (TARGET_TYPE == MONSTER_TO_MONSTER)
{
if (!resists_tele)
{
if (t_idx == p_ptr->riding)
- teleport_player_away(m_idx, MAX_SIGHT * 2 + 5);
+ teleport_player_away(m_idx, p_ptr, MAX_SIGHT * 2 + 5);
else
teleport_away(p_ptr, t_idx, MAX_SIGHT * 2 + 5, TELEPORT_PASSIVE);
}
extern void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, BIT_FLAGS mode);
extern bool teleport_player_aux(player_type *creature_ptr, POSITION dis, BIT_FLAGS mode);
extern void teleport_player(player_type *creature_ptr, POSITION dis, BIT_FLAGS mode);
-extern void teleport_player_away(MONSTER_IDX m_idx, POSITION dis);
+extern void teleport_player_away(MONSTER_IDX m_idx, player_type *target_ptr, POSITION dis);
extern void teleport_player_to(player_type *creature_ptr, POSITION ny, POSITION nx, BIT_FLAGS mode);
extern void teleport_away_followable(player_type *creature_ptr, MONSTER_IDX m_idx);
extern bool teleport_level_other(player_type *caster_ptr);
* @param dis テレポート距離
* @return なし
*/
-void teleport_player_away(MONSTER_IDX m_idx, POSITION dis)
+void teleport_player_away(MONSTER_IDX m_idx, player_type *target_ptr, POSITION dis)
{
POSITION yy, xx;
- POSITION oy = p_ptr->y;
- POSITION ox = p_ptr->x;
+ POSITION oy = target_ptr->y;
+ POSITION ox = target_ptr->x;
- if (!teleport_player_aux(p_ptr, dis, TELEPORT_PASSIVE)) return;
+ if (!teleport_player_aux(target_ptr, dis, TELEPORT_PASSIVE)) return;
/* Monsters with teleport ability may follow the player */
for (xx = -1; xx < 2; xx++)
{
for (yy = -1; yy < 2; yy++)
{
- MONSTER_IDX tmp_m_idx = p_ptr->current_floor_ptr->grid_array[oy+yy][ox+xx].m_idx;
+ MONSTER_IDX tmp_m_idx = target_ptr->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))
+ if (tmp_m_idx && (target_ptr->riding != tmp_m_idx) && (m_idx != tmp_m_idx))
{
- monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[tmp_m_idx];
+ monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[tmp_m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/*
if ((r_ptr->a_ability_flags2 & RF6_TPORT) &&
!(r_ptr->flagsr & RFR_RES_TELE))
{
- if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, p_ptr->y, p_ptr->x, r_ptr->level, 0L);
+ if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, target_ptr->y, target_ptr->x, r_ptr->level, 0L);
}
}
}