HIT_POINT k;
int bonus, chance;
WEIGHT n_weight = 0;
- monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &attacker_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, 0);
/* Calculate the "attack quality" */
- bonus = p_ptr->to_h_m + (p_ptr->lev * 6 / 5);
- chance = (p_ptr->skill_thn + (bonus * BTH_PLUS_ADJ));
+ bonus = attacker_ptr->to_h_m + (attacker_ptr->lev * 6 / 5);
+ chance = (attacker_ptr->skill_thn + (bonus * BTH_PLUS_ADJ));
/* Test for hit */
if ((!(r_ptr->flags2 & RF2_QUANTUM) || !randint0(2)) && test_hit_norm(chance, r_ptr->ac, m_ptr->ml))
msg_format(_("%sを%sで攻撃した。", "You hit %s with your %s."), m_name, atk_desc);
k = damroll(dice_num, dice_side);
- k = critical_norm(p_ptr, n_weight, bonus, k, (s16b)bonus, 0);
+ k = critical_norm(attacker_ptr, n_weight, bonus, k, (s16b)bonus, 0);
/* Apply the player damage bonuses */
- k += p_ptr->to_d_m;
+ k += attacker_ptr->to_d_m;
/* No negative damage */
if (k < 0) k = 0;
switch (attack)
{
case MUT2_SCOR_TAIL:
- project(p_ptr, 0, 0, m_ptr->fy, m_ptr->fx, k, GF_POIS, PROJECT_KILL, -1);
+ project(attacker_ptr, 0, 0, m_ptr->fy, m_ptr->fx, k, GF_POIS, PROJECT_KILL, -1);
*mdeath = (m_ptr->r_idx == 0);
break;
case MUT2_HORNS:
*mdeath = mon_take_hit(attacker_ptr, m_idx, k, fear, NULL);
}
- touch_zap_player(m_ptr, p_ptr);
+ touch_zap_player(m_ptr, attacker_ptr);
}
/* Player misses */
else
*/
bool make_attack_normal(player_type *target_ptr, MONSTER_IDX m_idx)
{
- monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+ floor_type *floor_ptr = target_ptr->current_floor_ptr;
+ monster_type *m_ptr = &floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
int ap_cnt;
msg_format("%sour %s (%c) was stolen!", ((o_ptr->number > 1) ? "One of y" : "Y"), o_name, index_to_label(i));
#endif
chg_virtue(target_ptr, V_SACRIFICE, 1);
- o_idx = o_pop(target_ptr->current_floor_ptr);
+ o_idx = o_pop(floor_ptr);
/* Success */
if (o_idx)
{
object_type *j_ptr;
- j_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
+ j_ptr = &floor_ptr->o_list[o_idx];
object_copy(j_ptr, o_ptr);
/* Modify number */
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK);
}
- if (is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[target_ptr->y][target_ptr->x]))
+ if (is_mirror_grid(&floor_ptr->grid_array[target_ptr->y][target_ptr->x]))
{
teleport_player(target_ptr, 10, 0L);
}
if (target_ptr->riding && damage)
{
char m_steed_name[MAX_NLEN];
- monster_desc(m_steed_name, &p_ptr->current_floor_ptr->m_list[target_ptr->riding], 0);
+ monster_desc(m_steed_name, &floor_ptr->m_list[target_ptr->riding], 0);
if (rakuba(target_ptr, (damage > 200) ? 200 : damage, FALSE))
{
msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_steed_name);
}
}
-
/* Always notice cause of death */
- if (target_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !target_ptr->current_floor_ptr->inside_arena)
+ if (target_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !floor_ptr->inside_arena)
{
r_ptr->r_deaths++;
}
rd_s16b(&tmp16s);
floor_type *floor_ptr = creature_ptr->current_floor_ptr;
floor_ptr->dun_level = (DEPTH)tmp16s;
- if (z_older_than(10, 3, 8)) p_ptr->dungeon_idx = DUNGEON_ANGBAND;
+ if (z_older_than(10, 3, 8)) creature_ptr->dungeon_idx = DUNGEON_ANGBAND;
else
{
rd_byte(&tmp8u);
- p_ptr->dungeon_idx = (IDX)tmp8u;
+ creature_ptr->dungeon_idx = (IDX)tmp8u;
}
/* Set the base level for old versions */
rd_s16b(&tmp16s);
floor_ptr->num_repro = (MONSTER_NUMBER)tmp16s;
rd_s16b(&tmp16s);
- p_ptr->y = (POSITION)tmp16s;
+ creature_ptr->y = (POSITION)tmp16s;
rd_s16b(&tmp16s);
- p_ptr->x = (POSITION)tmp16s;
- if (z_older_than(10, 3, 13) && !floor_ptr->dun_level && !floor_ptr->inside_arena) {p_ptr->y = 33;p_ptr->x = 131;}
+ creature_ptr->x = (POSITION)tmp16s;
+ if (z_older_than(10, 3, 13) && !floor_ptr->dun_level && !floor_ptr->inside_arena) { creature_ptr->y = 33; creature_ptr->x = 131;}
rd_s16b(&tmp16s);
floor_ptr->height = (POSITION)tmp16s;
rd_s16b(&tmp16s);
saved_floor_type *cur_sf_ptr;
int i;
- forget_lite(p_ptr->current_floor_ptr);
- forget_view(p_ptr->current_floor_ptr);
- clear_mon_lite(p_ptr->current_floor_ptr);
+ forget_lite(player_ptr->current_floor_ptr);
+ forget_view(player_ptr->current_floor_ptr);
+ clear_mon_lite(player_ptr->current_floor_ptr);
/* Update lite/view */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
- p_ptr->update |= (PU_MONSTERS | PU_DISTANCE | PU_FLOW);
+ player_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
+ player_ptr->update |= (PU_MONSTERS | PU_DISTANCE | PU_FLOW);
/*** Meta info ***/
wr_s16b(max_floor_id);
/* Current dungeon type */
- wr_byte((byte_hack)p_ptr->dungeon_idx);
+ wr_byte((byte_hack)player_ptr->dungeon_idx);
/*** No saved floor (On the surface etc.) ***/
- if (!p_ptr->floor_id)
+ if (!player_ptr->floor_id)
{
/* No array elements */
wr_byte(0);
}
/* Extract pointer to current floor */
- cur_sf_ptr = get_sf_ptr(p_ptr->floor_id);
+ cur_sf_ptr = get_sf_ptr(player_ptr->floor_id);
/* Save current floor to temporary file */
if (!save_floor(cur_sf_ptr, (SLF_SECOND))) return FALSE;
concptr what = "generic";
current_world_ptr->game_turn = 0;
- p_ptr->is_dead = FALSE;
+ player_ptr->is_dead = FALSE;
/* Allow empty savefile name */