if (m_ptr->ml)
{
if (!creature_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(g_ptr->m_idx);
+ health_track(creature_ptr, g_ptr->m_idx);
}
}
if (!all_pets)
{
/* Hack -- health bar for this monster */
- health_track(pet_ctr);
+ health_track(creature_ptr, pet_ctr);
handle_stuff(creature_ptr);
msg_format(_("%sを放しますか? [Yes/No/Unnamed (%d体)]", "Dismiss %s? [Yes/No/Unnamed (%d remain)]"), friend_name, max_pet - i);
creature_ptr->riding = g_ptr->m_idx;
/* Hack -- remove tracked monster */
- if (creature_ptr->riding == creature_ptr->health_who) health_track(0);
+ if (creature_ptr->riding == creature_ptr->health_who) health_track(creature_ptr, 0);
}
take_turn(creature_ptr, 100);
/* Auto-Recall if possible and visible */
if (!attacker_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(g_ptr->m_idx);
+ health_track(attacker_ptr, g_ptr->m_idx);
}
if ((r_ptr->flags1 & RF1_FEMALE) &&
if (m_ptr->ml)
{
if (!shooter_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(c_mon_ptr->m_idx);
+ health_track(shooter_ptr, c_mon_ptr->m_idx);
}
}
player_ptr->riding_t_m_idx = 0;
player_ptr->ambush_flag = FALSE;
- /* Cancel the health bar */
- health_track(0);
+ health_track(player_ptr, 0);
/* Check visual effects */
repair_monsters = TRUE;
/* Cancel the target */
target_who = 0;
- /* Cancel the health bar */
- health_track(0);
+ health_track(player_ptr, 0);
forget_lite(player_ptr->current_floor_ptr);
forget_view(player_ptr->current_floor_ptr);
{
/* Auto-Recall if possible and visible */
if (!caster_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(m_idx);
+ health_track(caster_ptr, m_idx);
}
break;
if (i == target_who) target_who = 0;
/* Hack -- remove tracked monster */
- if (i == p_ptr->health_who) health_track(0);
+ if (i == p_ptr->health_who) health_track(p_ptr, 0);
if (p_ptr->pet_t_m_idx == i ) p_ptr->pet_t_m_idx = 0;
if (p_ptr->riding_t_m_idx == i) p_ptr->riding_t_m_idx = 0;
if (p_ptr->riding == i1) p_ptr->riding = i2;
/* Hack -- Update the health bar */
- if (p_ptr->health_who == i1) health_track(i2);
+ if (p_ptr->health_who == i1) health_track(p_ptr, i2);
/* Hack -- Update parent index */
if (is_pet(m_ptr))
p_ptr->pet_t_m_idx = 0;
p_ptr->riding_t_m_idx = 0;
- /* Hack -- no more tracking */
- health_track(0);
+ health_track(p_ptr, 0);
}
{
/* Auto-Recall if possible and visible */
if (!creature_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(g_ptr->m_idx);
+ health_track(creature_ptr, g_ptr->m_idx);
}
/* displace? */
if (m_ptr->ml)
{
if (!caster_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(caster_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
+ health_track(caster_ptr, caster_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
}
}
}
if (m_ptr->ml)
{
if (!caster_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(caster_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
+ health_track(caster_ptr, caster_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
}
}
}
if (m_ptr->ml)
{
if (!caster_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(caster_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
+ health_track(caster_ptr, caster_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
}
}
}
}
}
-
/* Find the closest point in the blast */
if (breath)
{
effective_dist = dist;
}
-
/* There is the riding player on this monster */
if (caster_ptr->riding && player_bold(caster_ptr, y, x))
{
if (m_ptr->ml)
{
if (!caster_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(caster_ptr->current_floor_ptr->grid_array[y][x].m_idx);
+ health_track(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].m_idx);
}
}
}
}
-
/* Check player */
if (flg & (PROJECT_KILL))
{
}
if (targeted) target_who = hack_m_idx_ii;
- if (health_tracked) health_track(hack_m_idx_ii);
+ if (health_tracked) health_track(caster_ptr, hack_m_idx_ii);
return polymorphed;
}
monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
monster_race_track(m_ptr->ap_r_idx);
- health_track(g_ptr->m_idx);
+ health_track(subject_ptr, g_ptr->m_idx);
handle_stuff(subject_ptr);
/* Interact */
{
if (target_able(g_ptr->m_idx))
{
- health_track(g_ptr->m_idx);
+ health_track(creature_ptr, g_ptr->m_idx);
target_who = g_ptr->m_idx;
target_row = y;
target_col = x;
screen_load();
}
+
/*
* Track a new monster
+ * @param player_ptr プレーヤーへの参照ポインタ
+ * @param m_idx トラッキング対象のモンスターID。0の時キャンセル
+ * @param なし
*/
-void health_track(MONSTER_IDX m_idx)
+void health_track(player_type *player_ptr, MONSTER_IDX m_idx)
{
/* Mount monster is already tracked */
- if (m_idx && m_idx == p_ptr->riding) return;
+ if (m_idx && m_idx == player_ptr->riding) return;
/* Track a new guy */
- p_ptr->health_who = m_idx;
+ player_ptr->health_who = m_idx;
/* Redraw (later) */
- p_ptr->redraw |= (PR_HEALTH);
+ player_ptr->redraw |= (PR_HEALTH);
}
extern void map_info(POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp);
extern void do_cmd_view_map(player_type *player_ptr);
-extern void health_track(MONSTER_IDX m_idx);
+extern void health_track(player_type *player_ptr, MONSTER_IDX m_idx);
extern void print_time(void);
extern concptr map_name(player_type *creature_ptr);
extern void print_monster_list(floor_type *floor_ptr, TERM_LEN x, TERM_LEN y, TERM_LEN max_lines);