* @brief
* 腕力、器用さに応じた攻撃回数テーブル /
* This table is used to help calculate the number of blows the player can
- * make in a single round of attacks (one player current_world_ptr->game_turn) with a normal weapon.
+ * make in a single round of attacks (one player turn) with a normal weapon.
* @details
* <pre>
* This number ranges from a single blow/round for weak players to up to six
/*!
* @brief 敵オーラによるプレイヤーのダメージ処理(メイン)
* @param m_ptr オーラを持つモンスターの構造体参照ポインタ
+* @param touched_ptr オーラを持つ相手に振れたクリーチャーの参照ポインタ
* @return なし
*/
-static void touch_zap_player(monster_type *m_ptr)
+static void touch_zap_player(monster_type *m_ptr, player_type *touched_ptr)
{
- touch_zap_player_aux(m_ptr, p_ptr->immune_fire, offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_FIRE,
+ touch_zap_player_aux(m_ptr, touched_ptr->immune_fire, offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_FIRE,
fire_dam, _("突然とても熱くなった!", "You are suddenly very hot!"));
- touch_zap_player_aux(m_ptr, p_ptr->immune_cold, offsetof(monster_race, flags3), offsetof(monster_race, r_flags3), RF3_AURA_COLD,
+ touch_zap_player_aux(m_ptr, touched_ptr->immune_cold, offsetof(monster_race, flags3), offsetof(monster_race, r_flags3), RF3_AURA_COLD,
cold_dam, _("突然とても寒くなった!", "You are suddenly very cold!"));
- touch_zap_player_aux(m_ptr, p_ptr->immune_elec, offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_ELEC,
+ touch_zap_player_aux(m_ptr, touched_ptr->immune_elec, offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_ELEC,
elec_dam, _("電撃をくらった!", "You get zapped!"));
}
HIT_POINT k;
int bonus, chance;
WEIGHT n_weight = 0;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
GAME_TEXT m_name[MAX_NLEN];
*mdeath = mon_take_hit(m_idx, k, fear, NULL);
}
- touch_zap_player(m_ptr);
+ touch_zap_player(m_ptr, p_ptr);
}
/* Player misses */
else
int num = 0, bonus, chance, vir;
HIT_POINT k;
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ floor_type *floor_ptr = attacker_ptr->current_floor_ptr;
+ grid_type *g_ptr = &floor_ptr->grid_array[y][x];
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &floor_ptr->m_list[g_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Access the weapon */
/* Anger the monster */
if (k > 0) anger_monster(m_ptr);
- touch_zap_player(m_ptr);
+ touch_zap_player(m_ptr, attacker_ptr);
/* Are we draining it? A little note: If the monster is
dead, the drain does not work... */
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;
}
if (!(r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) &&
!(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
{
- if (polymorph_monster(y, x))
+ if (polymorph_monster(attacker_ptr, y, x))
{
msg_format(_("%^sは変化した!", "%^s changes!"), m_name);
*fear = FALSE;
}
/* Hack -- Get new monster */
- m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ m_ptr = &floor_ptr->m_list[g_ptr->m_idx];
/* Oops, we need a different name... */
monster_desc(m_name, m_ptr, 0);
}
else if (o_ptr->name1 == ART_G_HAMMER)
{
- monster_type *target_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *target_ptr = &floor_ptr->m_list[g_ptr->m_idx];
if (target_ptr->hold_o_idx)
{
- object_type *q_ptr = ¤t_floor_ptr->o_list[target_ptr->hold_o_idx];
+ object_type *q_ptr = &floor_ptr->o_list[target_ptr->hold_o_idx];
GAME_TEXT o_name[MAX_NLEN];
object_desc(o_name, q_ptr, OD_NAME_ONLY);
/* Mega-Hack -- apply earthquake brand */
if (do_quake)
{
- earthquake(attacker_ptr->y, attacker_ptr->x, 10, 0);
- if (!current_floor_ptr->grid_array[y][x].m_idx) *mdeath = TRUE;
+ earthquake(attacker_ptr, attacker_ptr->y, attacker_ptr->x, 10, 0);
+ if (!floor_ptr->grid_array[y][x].m_idx) *mdeath = TRUE;
}
}
bool mdeath = FALSE;
bool stormbringer = FALSE;
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ grid_type *g_ptr = &attacker_ptr->current_floor_ptr->grid_array[y][x];
+ monster_type *m_ptr = &attacker_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
GAME_TEXT m_name[MAX_NLEN];
if (cur < max)
{
- DEPTH ridinglevel = r_info[current_floor_ptr->m_list[attacker_ptr->riding].r_idx].level;
+ DEPTH ridinglevel = r_info[attacker_ptr->current_floor_ptr->m_list[attacker_ptr->riding].r_idx].level;
DEPTH targetlevel = r_ptr->level;
int inc = 0;
*/
bool make_attack_normal(player_type *target_ptr, MONSTER_IDX m_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
int ap_cnt;
if (!target_ptr->resist_disen && !CHECK_MULTISHADOW(target_ptr))
{
/* Apply disenchantment */
- if (apply_disenchant(0))
+ if (apply_disenchant(target_ptr, 0))
{
/* Hack -- Update AC */
update_creature(target_ptr);
if (o_idx)
{
object_type *j_ptr;
- j_ptr = ¤t_floor_ptr->o_list[o_idx];
+ j_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
object_copy(j_ptr, o_ptr);
/* Modify number */
/* Radius 8 earthquake centered at the monster */
if (damage > 23 || explode)
{
- earthquake(m_ptr->fy, m_ptr->fx, 8, m_idx);
+ earthquake(target_ptr, m_ptr->fy, m_ptr->fx, 8, m_idx);
}
break;
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK);
}
- if (is_mirror_grid(¤t_floor_ptr->grid_array[target_ptr->y][target_ptr->x]))
+ if (is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[target_ptr->y][target_ptr->x]))
{
- teleport_player(10, 0L);
+ teleport_player(target_ptr, 10, 0L);
}
}
if (target_ptr->riding && damage)
{
char m_steed_name[MAX_NLEN];
- monster_desc(m_steed_name, ¤t_floor_ptr->m_list[target_ptr->riding], 0);
+ monster_desc(m_steed_name, &p_ptr->current_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);
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);
}
}
/* Always notice cause of death */
- if (target_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !target_ptr->inside_arena)
+ if (target_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !target_ptr->current_floor_ptr->inside_arena)
{
r_ptr->r_deaths++;
}
* @param t_idx 目標側モンスターの参照ID
* @return 実際に打撃処理が行われた場合TRUEを返す
*/
-bool monst_attack_monst(MONSTER_IDX m_idx, MONSTER_IDX t_idx)
+bool monst_attack_monst(player_type *subject_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
- monster_type *t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ monster_type *m_ptr = &subject_ptr->current_floor_ptr->m_list[m_idx];
+ monster_type *t_ptr = &subject_ptr->current_floor_ptr->m_list[t_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
monster_race *tr_ptr = &r_info[t_ptr->r_idx];
/* Can the player be aware of this attack? */
bool known = (m_ptr->cdis <= MAX_SIGHT) || (t_ptr->cdis <= MAX_SIGHT);
- bool do_silly_attack = (one_in_(2) && p_ptr->image);
+ bool do_silly_attack = (one_in_(2) && subject_ptr->image);
/* Cannot attack self */
if (m_idx == t_idx) return FALSE;
/* Not allowed to attack */
if (r_ptr->flags1 & RF1_NEVER_BLOW) return FALSE;
- if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE) return (FALSE);
+ if (d_info[subject_ptr->dungeon_idx].flags1 & DF1_NO_MELEE) return (FALSE);
/* Total armor */
ac = tr_ptr->ac;
if (!see_either && known)
{
- current_floor_ptr->monster_noise = TRUE;
+ subject_ptr->current_floor_ptr->monster_noise = TRUE;
}
- if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(p_ptr, TRUE, TRUE);
+ if (subject_ptr->riding && (m_idx == subject_ptr->riding)) disturb(subject_ptr, TRUE, TRUE);
/* Scan through all four blows */
for (ap_cnt = 0; ap_cnt < 4; ap_cnt++)
if (t_ptr->ml)
{
/* Redraw the health bar */
- if (p_ptr->health_who == t_idx) p_ptr->redraw |= (PR_HEALTH);
- if (p_ptr->riding == t_idx) p_ptr->redraw |= (PR_UHEALTH);
+ if (subject_ptr->health_who == t_idx) subject_ptr->redraw |= (PR_HEALTH);
+ if (subject_ptr->riding == t_idx) subject_ptr->redraw |= (PR_UHEALTH);
}
/* Describe the attack method */
case RBM_EXPLODE:
{
- if (see_either) disturb(p_ptr, TRUE, TRUE);
+ if (see_either) disturb(subject_ptr, TRUE, TRUE);
act = _("爆発した。", "explodes.");
explode = TRUE;
touched = FALSE;
case RBE_EAT_ITEM:
case RBE_EAT_GOLD:
- if ((p_ptr->riding != m_idx) && one_in_(2)) blinked = TRUE;
+ if ((subject_ptr->riding != m_idx) && one_in_(2)) blinked = TRUE;
break;
case RBE_EAT_FOOD:
case RBE_SHATTER:
damage -= (damage * ((ac < 150) ? ac : 150) / 250);
- if (damage > 23) earthquake(m_ptr->fy, m_ptr->fx, 8, m_idx);
+ if (damage > 23) earthquake(subject_ptr, m_ptr->fy, m_ptr->fx, 8, m_idx);
break;
case RBE_EXP_10:
if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
/* Redraw (later) if needed */
- if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
- if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
+ if (subject_ptr->health_who == m_idx) subject_ptr->redraw |= (PR_HEALTH);
+ if (subject_ptr->riding == m_idx) subject_ptr->redraw |= (PR_UHEALTH);
/* Special message */
if (see_m && did_heal)
}
else if (known)
{
- current_floor_ptr->monster_noise = TRUE;
+ subject_ptr->current_floor_ptr->monster_noise = TRUE;
}
}
else
}
else if (known)
{
- current_floor_ptr->monster_noise = TRUE;
+ 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);
}
}
*/
void mon_take_hit_mon(MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
GAME_TEXT m_name[160];
bool seen = is_seen(m_ptr);
/* Unseen death by normal attack */
if (!seen)
{
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/* Death by special attack */
else if (note)
if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr) && (who != m_idx))
{
- if (is_pet(¤t_floor_ptr->m_list[who]) && !player_bold(m_ptr->target_y, m_ptr->target_x))
+ if (is_pet(&p_ptr->current_floor_ptr->m_list[who]) && !player_bold(p_ptr, m_ptr->target_y, m_ptr->target_x))
{
- set_target(m_ptr, current_floor_ptr->m_list[who].fy, current_floor_ptr->m_list[who].fx);
+ set_target(m_ptr, p_ptr->current_floor_ptr->m_list[who].fy, p_ptr->current_floor_ptr->m_list[who].fx);
}
}