if (!resists_tele)
{
msg_format(_("%^sは消えた!", "%^s disappears!"), m_name);
- teleport_away(g_ptr->m_idx, 50, TELEPORT_PASSIVE);
+ teleport_away(attacker_ptr, g_ptr->m_idx, 50, TELEPORT_PASSIVE);
num = num_blow + 1; /* Can't hit it anymore! */
*mdeath = TRUE;
}
else
{
msg_print(_("泥棒は笑って逃げた!", "The thief flees laughing!"));
- teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
+ teleport_away(target_ptr, m_idx, MAX_SIGHT * 2 + 5, 0L);
}
}
subject_ptr->current_floor_ptr->monster_noise = TRUE;
}
- teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
+ teleport_away(subject_ptr, m_idx, MAX_SIGHT * 2 + 5, 0L);
}
}
if(see_monster(m_idx))
msg_format(_("%^sが瞬時に消えた。", "%^s blinks away."), m_name);
- teleport_away(m_idx, 10, 0L);
+ teleport_away(p_ptr, m_idx, 10, 0L);
if (TARGET_TYPE==MONSTER_TO_PLAYER)
p_ptr->update |= (PU_MONSTERS);
_("%^sは突然急上昇して視界から消えた!", "%^s suddenly go out of your sight!"),
TARGET_TYPE);
- teleport_away(m_idx, 10, TELEPORT_NONMAGICAL);
+ teleport_away(p_ptr, m_idx, 10, TELEPORT_NONMAGICAL);
p_ptr->update |= (PU_MONSTERS);
}
else
if (t_idx == p_ptr->riding)
teleport_player_away(m_idx, MAX_SIGHT * 2 + 5);
else
- teleport_away(t_idx, MAX_SIGHT * 2 + 5, TELEPORT_PASSIVE);
+ teleport_away(p_ptr, t_idx, MAX_SIGHT * 2 + 5, TELEPORT_PASSIVE);
}
set_monster_csleep(t_idx, 0);
m_ptr->hp = m_ptr->maxhp;
/* Try to teleport away quest monsters */
- if (!teleport_away(g_ptr->m_idx, (r * 2) + 1, TELEPORT_DEC_VALOUR)) continue;
+ if (!teleport_away(p_ptr, g_ptr->m_idx, (r * 2) + 1, TELEPORT_DEC_VALOUR)) continue;
}
else
{
#define TELEPORT_DEC_VALOUR 0x00000004
/* spells3.c */
-extern bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode);
+extern bool teleport_away(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode);
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(POSITION dis, BIT_FLAGS mode);
if (!who) chg_virtue(p_ptr, V_VALOUR, -1);
/* Teleport */
- teleport_away(g_ptr->m_idx, do_dist,
+ teleport_away(p_ptr, g_ptr->m_idx, do_dist,
(!who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
/* Hack -- get new location */
* Attempt to move the monster at least "dis/2" grids away.
* But allow variation to prevent infinite loops.
*/
-bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
+bool teleport_away(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
{
POSITION oy, ox, d, i, min;
int tries = 0;
bool look = TRUE;
- monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
if (!monster_is_valid(m_ptr)) return (FALSE);
oy = m_ptr->fy;
min = dis / 2;
if ((mode & TELEPORT_DEC_VALOUR) &&
- (((p_ptr->chp * 10) / p_ptr->mhp) > 5) &&
- (4+randint1(5) < ((p_ptr->chp * 10) / p_ptr->mhp)))
+ (((caster_ptr->chp * 10) / caster_ptr->mhp) > 5) &&
+ (4+randint1(5) < ((caster_ptr->chp * 10) / caster_ptr->mhp)))
{
- chg_virtue(p_ptr, V_VALOUR, -1);
+ chg_virtue(caster_ptr, V_VALOUR, -1);
}
/* Look until done */
}
/* Ignore illegal locations */
- if (!in_bounds(p_ptr->current_floor_ptr, ny, nx)) continue;
+ if (!in_bounds(caster_ptr->current_floor_ptr, ny, nx)) continue;
if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue;
/* No teleporting into vaults and such */
- if (!(p_ptr->inside_quest || p_ptr->inside_arena))
- if (p_ptr->current_floor_ptr->grid_array[ny][nx].info & CAVE_ICKY) continue;
+ if (!(caster_ptr->inside_quest || caster_ptr->inside_arena))
+ if (caster_ptr->current_floor_ptr->grid_array[ny][nx].info & CAVE_ICKY) continue;
/* This grid looks good */
look = FALSE;
sound(SOUND_TPOTHER);
/* Update the old location */
- p_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
+ caster_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
/* Update the new location */
- p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
+ caster_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
/* Move the monster */
m_ptr->fy = ny;
lite_spot(ny, nx);
if (r_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
- p_ptr->update |= (PU_MON_LITE);
+ caster_ptr->update |= (PU_MON_LITE);
return (TRUE);
}
bool old_ml = m_ptr->ml;
POSITION old_cdis = m_ptr->cdis;
- teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
+ teleport_away(p_ptr, m_idx, MAX_SIGHT * 2 + 5, 0L);
if (old_ml && (old_cdis <= MAX_SIGHT) && !current_world_ptr->timewalk_m_idx && !p_ptr->phase_out && los(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, oldfy, oldfx))
{
{
msg_print(_("空間が歪んだ!", "Space warps about you!"));
- if (m_ptr->r_idx) teleport_away(g_ptr->m_idx, damroll(10, 10), TELEPORT_PASSIVE);
+ if (m_ptr->r_idx) teleport_away(p_ptr, 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;
}