#ifdef JP
sprintf(target_buf, "ペットのターゲットを指定 (現在:%s)",
- (pet_t_m_idx ? (p_ptr->image ? "何か奇妙な物" : (r_name + r_info[current_floor_ptr->m_list[pet_t_m_idx].ap_r_idx].name)) : "指定なし"));
+ (p_ptr->pet_t_m_idx ? (p_ptr->image ? "何か奇妙な物" : (r_name + r_info[current_floor_ptr->m_list[p_ptr->pet_t_m_idx].ap_r_idx].name)) : "指定なし"));
#else
sprintf(target_buf, "specify a target of pet (now:%s)",
- (pet_t_m_idx ? (p_ptr->image ? "something strange" : (r_name + r_info[current_floor_ptr->m_list[pet_t_m_idx].ap_r_idx].name)) : "nothing"));
+ (p_ptr->pet_t_m_idx ? (p_ptr->image ? "something strange" : (r_name + r_info[current_floor_ptr->m_list[p_ptr->pet_t_m_idx].ap_r_idx].name)) : "nothing"));
#endif
power_desc[num] = target_buf;
powers[num++] = PET_TARGET;
case PET_TARGET:
{
project_length = -1;
- if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
+ if (!target_set(TARGET_KILL)) p_ptr->pet_t_m_idx = 0;
else
{
grid_type *g_ptr = ¤t_floor_ptr->grid_array[target_row][target_col];
if (g_ptr->m_idx && (current_floor_ptr->m_list[g_ptr->m_idx].ml))
{
- pet_t_m_idx = current_floor_ptr->grid_array[target_row][target_col].m_idx;
+ p_ptr->pet_t_m_idx = current_floor_ptr->grid_array[target_row][target_col].m_idx;
p_ptr->pet_follow_distance = PET_DESTROY_DIST;
}
- else pet_t_m_idx = 0;
+ else p_ptr->pet_t_m_idx = 0;
}
project_length = 0;
case PET_STAY_CLOSE:
{
p_ptr->pet_follow_distance = PET_CLOSE_DIST;
- pet_t_m_idx = 0;
+ p_ptr->pet_t_m_idx = 0;
break;
}
/* "Follow Me" */
case PET_FOLLOW_ME:
{
p_ptr->pet_follow_distance = PET_FOLLOW_DIST;
- pet_t_m_idx = 0;
+ p_ptr->pet_t_m_idx = 0;
break;
}
/* "Seek and destoy" */
/* Cancel the target */
target_who = 0;
- pet_t_m_idx = 0;
- riding_t_m_idx = 0;
+ p_ptr->pet_t_m_idx = 0;
+ p_ptr->riding_t_m_idx = 0;
p_ptr->ambush_flag = FALSE;
/* Cancel the health bar */
extern player_type *p_ptr;
-
-extern MONSTER_IDX pet_t_m_idx;
-extern MONSTER_IDX riding_t_m_idx;
}
}
- riding_t_m_idx = g_ptr->m_idx;
+ p_ptr->riding_t_m_idx = g_ptr->m_idx;
if (p_ptr->migite) py_attack_aux(y, x, &fear, &mdeath, 0, mode);
if (p_ptr->hidarite && !mdeath) py_attack_aux(y, x, &fear, &mdeath, 1, mode);
monster_race *r_ptr = &r_info[m_ptr->r_idx];
monster_type *t_ptr;
- if (riding_t_m_idx && player_bold(m_ptr->fy, m_ptr->fx))
+ if (p_ptr->riding_t_m_idx && player_bold(m_ptr->fy, m_ptr->fx))
{
- y = current_floor_ptr->m_list[riding_t_m_idx].fy;
- x = current_floor_ptr->m_list[riding_t_m_idx].fx;
+ y = current_floor_ptr->m_list[p_ptr->riding_t_m_idx].fy;
+ x = current_floor_ptr->m_list[p_ptr->riding_t_m_idx].fx;
}
- else if (is_pet(m_ptr) && pet_t_m_idx)
+ else if (is_pet(m_ptr) && p_ptr->pet_t_m_idx)
{
- y = current_floor_ptr->m_list[pet_t_m_idx].fy;
- x = current_floor_ptr->m_list[pet_t_m_idx].fx;
+ y = current_floor_ptr->m_list[p_ptr->pet_t_m_idx].fy;
+ x = current_floor_ptr->m_list[p_ptr->pet_t_m_idx].fx;
}
else
{
/* Hack -- remove tracked monster */
if (i == p_ptr->health_who) health_track(0);
- if (pet_t_m_idx == i ) pet_t_m_idx = 0;
- if (riding_t_m_idx == i) riding_t_m_idx = 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 == i) p_ptr->riding = 0;
/* Monster is gone */
if (target_who == i1) target_who = i2;
/* Hack -- Update the target */
- if (pet_t_m_idx == i1) pet_t_m_idx = i2;
- if (riding_t_m_idx == i1) riding_t_m_idx = i2;
+ if (p_ptr->pet_t_m_idx == i1) p_ptr->pet_t_m_idx = i2;
+ if (p_ptr->riding_t_m_idx == i1) p_ptr->riding_t_m_idx = i2;
/* Hack -- Update the riding */
if (p_ptr->riding == i1) p_ptr->riding = i2;
/* Hack -- no more target */
target_who = 0;
- pet_t_m_idx = 0;
- riding_t_m_idx = 0;
+ p_ptr->pet_t_m_idx = 0;
+ p_ptr->riding_t_m_idx = 0;
/* Hack -- no more tracking */
health_track(0);
f6 = r_ptr->a_ability_flags2;
/* Target is given for pet? */
- if (pet_t_m_idx && pet)
+ if (p_ptr->pet_t_m_idx && pet)
{
- target_idx = pet_t_m_idx;
+ target_idx = p_ptr->pet_t_m_idx;
t_ptr = ¤t_floor_ptr->m_list[target_idx];
/* Cancel if not projectable (for now) */
/* Cancel if neither enemy nor a given target */
if ((m_idx == target_idx) ||
- ((target_idx != pet_t_m_idx) && !are_enemies(m_ptr, t_ptr)))
+ ((target_idx != p_ptr->pet_t_m_idx) && !are_enemies(m_ptr, t_ptr)))
{
target_idx = 0;
}
POSITION run_px;
DIRECTION fishing_dir;
+ MONSTER_IDX pet_t_m_idx;
+ MONSTER_IDX riding_t_m_idx;
/*** Extracted fields ***/
player_type *p_ptr = &p_body;
-MONSTER_IDX pet_t_m_idx;
-MONSTER_IDX riding_t_m_idx;
-