case ACT_LIGHT:
{
msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
- lite_area(damroll(2, 15), 3);
+ lite_area(user_ptr, damroll(2, 15), 3);
break;
}
{
msg_print(_("眩しく輝いた...", "It shines brightly..."));
map_area(user_ptr, DETECT_RAD_MAP);
- lite_area(damroll(2, 15), 3);
+ lite_area(user_ptr, damroll(2, 15), 3);
break;
}
case MS_DARKNESS:
msg_print(_("暗闇の中で手を振った。", "You gesture in shadow."));
- (void)unlite_area(10, 3);
+ (void)unlite_area(caster_ptr, 10, 3);
break;
case MS_MAKE_TRAP:
{
(void)set_blind(creature_ptr, creature_ptr->blind + 3 + randint1(5));
}
- if (unlite_area(10, 3)) ident = TRUE;
+ if (unlite_area(creature_ptr, 10, 3)) ident = TRUE;
break;
}
case SV_SCROLL_LIGHT:
{
- if (lite_area(damroll(2, 8), 2)) ident = TRUE;
+ if (lite_area(creature_ptr, damroll(2, 8), 2)) ident = TRUE;
break;
}
#include "view-mainwindow.h"
-
/*!
* @brief 杖の効果を発動する
* @param creature_ptr プレーヤーへの参照ポインタ
{
if (set_blind(creature_ptr, creature_ptr->blind + 3 + randint1(5))) ident = TRUE;
}
- if (unlite_area(10, (powerful ? 6 : 3))) ident = TRUE;
+ if (unlite_area(creature_ptr, 10, (powerful ? 6 : 3))) ident = TRUE;
break;
}
case SV_STAFF_LITE:
{
- if (lite_area(damroll(2, 8), (powerful ? 4 : 2))) ident = TRUE;
+ if (lite_area(creature_ptr, damroll(2, 8), (powerful ? 4 : 2))) ident = TRUE;
break;
}
return ident;
}
+
/*!
* @brief 杖を使うコマンドのサブルーチン /
* Use a staff. -RAK-
int ident, chance, lev;
object_type *o_ptr;
-
- /* Hack -- let staffs of identify get aborted */
+ /* Hack -- let staffs of identify get aborted */
bool use_charge = TRUE;
o_ptr = REF_ITEM(creature_ptr, creature_ptr->current_floor_ptr, item);
return;
}
-
- take_turn(creature_ptr, 100);
+ take_turn(creature_ptr, 100);
lev = k_info[o_ptr->k_idx].level;
if (lev > 50) lev = 50 + (lev - 50) / 2;
return;
}
-
sound(SOUND_ZAP);
ident = staff_effect(creature_ptr, o_ptr->sval, &use_charge, FALSE, FALSE, object_is_aware(o_ptr));
}
}
+
/*!
* @brief 杖を使うコマンドのメインルーチン /
* @return なし
case SV_ROD_ILLUMINATION:
{
- if (lite_area(damroll(2, 8), (powerful ? 4 : 2))) ident = TRUE;
+ if (lite_area(creature_ptr, damroll(2, 8), (powerful ? 4 : 2))) ident = TRUE;
break;
}
return ident;
}
+
/*!
* @brief ロッドを使うコマンドのサブルーチン /
* Activate (zap) a Rod
+* @param creature_ptr プレーヤーへの参照ポインタ
* @param item 使うオブジェクトの所持品ID
* @return なし
* @details
creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
}
+
/*!
* @brief ロッドを使うコマンドのメインルーチン /
+* @param creature_ptr プレーヤーへの参照ポインタ
* @return なし
*/
void do_cmd_zap_rod(player_type *creature_ptr)
* Unlite the area (radius 10) around player and
* do 50 points damage to every affected monster
*/
- unlite_area(50, 10);
+ unlite_area(creature_ptr, 50, 10);
}
if ((creature_ptr->muta2 & MUT2_ATT_ANIMAL) && !creature_ptr->anti_magic && one_in_(7000))
if (!player_ptr->playing || player_ptr->is_dead) break;
/* Process all of the monsters */
- process_monsters(player_ptr->current_floor_ptr);
+ process_monsters(player_ptr);
handle_stuff();
fire_ball(caster_ptr, GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5) + boost / 12, 4), 0);
break;
case 1:
- (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
+ (void)lite_area(caster_ptr, damroll(2, (plev / 2)), (plev / 10) + 1);
break;
case 2:
set_tim_levitation(caster_ptr, randint1(30) + 30 + boost / 5, FALSE);
default:
msg_print(_("なに?", "Zap?"));
}
+
P_PTR_KI = 0;
caster_ptr->update |= (PU_BONUS);
*/
static int number_of_mirrors(floor_type *floor_ptr)
{
- POSITION x, y;
int val = 0;
- for (x = 0; x < floor_ptr->width; x++) {
- for (y = 0; y < floor_ptr->height; y++) {
+ for (POSITION x = 0; x < floor_ptr->width; x++) {
+ for (POSITION y = 0; y < floor_ptr->height; y++) {
if (is_mirror_grid(&floor_ptr->grid_array[y][x])) val++;
}
}
+
return val;
}
+
/*!
* @brief 鏡魔法の発動 /
* do_cmd_cast calls this function if the player's class is 'Mirror magic'.
break;
/* mirror of light */
case 4:
- (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
+ (void)lite_area(caster_ptr, damroll(2, (plev / 2)), (plev / 10) + 1);
break;
/* mirror of wandering */
case 5:
switch (spell)
{
case 0:
- (void)unlite_area(0, 3);
+ (void)unlite_area(caster_ptr, 0, 3);
break;
case 1:
if (plev > 44)
/*!
- * @brief モンスター単体の1ターン行動処理メインルーチン /
+ * @brief モンスター単体の1ターン行動処理メインルーチン /
* Process a monster
+ * @param target_ptr プレーヤーへの参照ポインタ
* @param m_idx 行動モンスターの参照ID
* @return なし
* @details
*\n
* A "direction" of "5" means "pick a random direction".\n
*/
-void process_monster(MONSTER_IDX m_idx)
+void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
{
- monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
bool aware = TRUE;
bool fear, dead;
- bool is_riding_mon = (m_idx == p_ptr->riding);
+ bool is_riding_mon = (m_idx == target_ptr->riding);
bool see_m = is_seen(m_ptr);
if (is_riding_mon && !(r_ptr->flags7 & RF7_RIDING))
{
- if (rakuba(p_ptr, 0, TRUE))
+ if (rakuba(target_ptr, 0, TRUE))
{
#ifdef JP
msg_print("地面に落とされた。");
#else
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, &p_ptr->current_floor_ptr->m_list[p_ptr->riding], 0);
+ monster_desc(m_name, &target_ptr->current_floor_ptr->m_list[target_ptr->riding], 0);
msg_format("You have fallen from %s.", m_name);
#endif
}
}
/* Players hidden in shadow are almost imperceptable. -LM- */
- if (p_ptr->special_defense & NINJA_S_STEALTH)
+ if (target_ptr->special_defense & NINJA_S_STEALTH)
{
- int tmp = p_ptr->lev*6+(p_ptr->skill_stl+10)*4;
- if (p_ptr->monlite) tmp /= 3;
- if (p_ptr->cursed & TRC_AGGRAVATE) tmp /= 2;
- if (r_ptr->level > (p_ptr->lev * p_ptr->lev / 20 + 10)) tmp /= 3;
+ int tmp = target_ptr->lev*6+(target_ptr->skill_stl+10)*4;
+ if (target_ptr->monlite) tmp /= 3;
+ if (target_ptr->cursed & TRC_AGGRAVATE) tmp /= 2;
+ if (r_ptr->level > (target_ptr->lev * target_ptr->lev / 20 + 10)) tmp /= 3;
/* Low-level monsters will find it difficult to locate the player. */
if (randint0(tmp) > (r_ptr->level+20)) aware = FALSE;
}
/* Are there its parent? */
- if (m_ptr->parent_m_idx && !p_ptr->current_floor_ptr->m_list[m_ptr->parent_m_idx].r_idx)
+ if (m_ptr->parent_m_idx && !target_ptr->current_floor_ptr->m_list[m_ptr->parent_m_idx].r_idx)
{
/* Its parent have gone, it also goes away. */
{
GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
- exe_write_diary(p_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_LOSE_PARENT, m_name);
+ exe_write_diary(target_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_LOSE_PARENT, m_name);
}
delete_monster_idx(m_idx);
if(dead) return;
}
- if ((is_pet(m_ptr) || is_friendly(m_ptr)) && ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->phase_out)
+ if ((is_pet(m_ptr) || is_friendly(m_ptr)) && ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) && !target_ptr->phase_out)
{
static int riding_pinch = 0;
msg_format(_("%sは傷の痛さの余りあなたの束縛から逃れようとしている。",
"%^s seems to be in so much pain, and trying to escape from your restriction."), m_name);
riding_pinch++;
- disturb(p_ptr, TRUE, TRUE);
+ disturb(target_ptr, TRUE, TRUE);
}
else
{
if (is_riding_mon)
{
msg_format(_("%sはあなたの束縛から脱出した。", "%^s succeeded to escape from your restriction!"), m_name);
- if (rakuba(p_ptr, -1, FALSE))
+ if (rakuba(target_ptr, -1, FALSE))
{
msg_print(_("地面に落とされた。", "You have fallen from riding pet."));
}
if (see_m)
{
if ((r_ptr->flags2 & RF2_CAN_SPEAK) && (m_ptr->r_idx != MON_GRIP) && (m_ptr->r_idx != MON_WOLF) && (m_ptr->r_idx != MON_FANG) &&
- player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx) && projectable(p_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x))
+ player_has_los_bold(target_ptr, m_ptr->fy, m_ptr->fx) && projectable(target_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x))
{
msg_format(_("%^s「ピンチだ!退却させてもらう!」", "%^s says 'It is the pinch! I will retreat'."), m_name);
}
msg_format(_("%^sが消え去った。", "%^s disappears."), m_name);
}
- if (is_riding_mon && rakuba(p_ptr, -1, FALSE))
+ if (is_riding_mon && rakuba(target_ptr, -1, FALSE))
{
msg_print(_("地面に落とされた。", "You have fallen from riding pet."));
}
if (MON_CSLEEP(m_ptr))
{
/* Handle non-aggravation - Still sleeping */
- if (!(p_ptr->cursed & TRC_AGGRAVATE)) return;
+ if (!(target_ptr->cursed & TRC_AGGRAVATE)) return;
(void)set_monster_csleep(m_idx, 0);
if (is_riding_mon)
{
- p_ptr->update |= (PU_BONUS);
+ target_ptr->update |= (PU_BONUS);
}
/* No one wants to be your friend if you're aggravating */
- if (is_friendly(m_ptr) && (p_ptr->cursed & TRC_AGGRAVATE))
+ if (is_friendly(m_ptr) && (target_ptr->cursed & TRC_AGGRAVATE))
gets_angry = TRUE;
/* Paranoia... no pet uniques outside wizard mode -- TY */
gets_angry = TRUE;
}
- if (p_ptr->phase_out) gets_angry = FALSE;
+ if (target_ptr->phase_out) gets_angry = FALSE;
if (gets_angry)
{
ox = m_ptr->fx;
/* Attempt to "multiply" if able and allowed */
- if ((r_ptr->flags2 & RF2_MULTIPLY) && (p_ptr->current_floor_ptr->num_repro < MAX_REPRO))
+ if ((r_ptr->flags2 & RF2_MULTIPLY) && (target_ptr->current_floor_ptr->num_repro < MAX_REPRO))
{
int k;
POSITION y, x;
for (x = ox - 1; x <= ox + 1; x++)
{
/* Ignore locations off of edge */
- if (!in_bounds2(p_ptr->current_floor_ptr, y, x)) continue;
- if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx) k++;
+ if (!in_bounds2(target_ptr->current_floor_ptr, y, x)) continue;
+ if (target_ptr->current_floor_ptr->grid_array[y][x].m_idx) k++;
}
}
- if (multiply_barrier(p_ptr, m_idx)) k = 8;
+ if (multiply_barrier(target_ptr, m_idx)) k = 8;
/* Hack -- multiply slower in crowded areas */
if ((k < 4) && (!k || !randint0(k * MON_MULT_ADJ)))
if (multiply_monster(m_idx, FALSE, (is_pet(m_ptr) ? PM_FORCE_PET : 0)))
{
/* Take note if visible */
- if (p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].ml && is_original_ap_and_seen(m_ptr))
+ if (target_ptr->current_floor_ptr->m_list[hack_m_idx_ii].ml && is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags2 |= (RF2_MULTIPLY);
}
/* Hack -- Ohmu scatters molds! */
if (m_ptr->r_idx == MON_OHMU)
{
- if (!p_ptr->current_floor_ptr->inside_arena && !p_ptr->phase_out)
+ if (!target_ptr->current_floor_ptr->inside_arena && !target_ptr->phase_out)
{
if (r_ptr->freq_spell && (randint1(100) <= r_ptr->freq_spell))
{
{
if (summon_specific(m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_MOLD, (PM_ALLOW_GROUP | p_mode)))
{
- if (p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].ml) count++;
+ if (target_ptr->current_floor_ptr->m_list[hack_m_idx_ii].ml) count++;
}
}
}
}
- if (!p_ptr->phase_out)
+ if (!target_ptr->phase_out)
{
/* Hack! "Cyber" monster makes noise... */
if (m_ptr->ap_r_idx == MON_CYBER &&
one_in_(CYBERNOISE) &&
!m_ptr->ml && (m_ptr->cdis <= MAX_SIGHT))
{
- if (disturb_minor) disturb(p_ptr, FALSE, FALSE);
+ if (disturb_minor) disturb(target_ptr, FALSE, FALSE);
msg_print(_("重厚な足音が聞こえた。", "You hear heavy steps."));
}
/* Some monsters can speak */
if ((ap_r_ptr->flags2 & RF2_CAN_SPEAK) && aware &&
one_in_(SPEAK_CHANCE) &&
- player_has_los_bold(p_ptr, oy, ox) &&
- projectable(p_ptr->current_floor_ptr, oy, ox, p_ptr->y, p_ptr->x))
+ player_has_los_bold(target_ptr, oy, ox) &&
+ projectable(target_ptr->current_floor_ptr, oy, ox, target_ptr->y, target_ptr->x))
{
GAME_TEXT m_name[MAX_NLEN];
char monmessage[1024];
/* Give priority to counter attack? */
if (m_ptr->target_y)
{
- MONSTER_IDX t_m_idx = p_ptr->current_floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
+ MONSTER_IDX t_m_idx = target_ptr->current_floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
/* The monster must be an enemy, and projectable */
- if (t_m_idx && are_enemies(m_ptr, &p_ptr->current_floor_ptr->m_list[t_m_idx]) &&
- projectable(p_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x))
+ if (t_m_idx && are_enemies(m_ptr, &target_ptr->current_floor_ptr->m_list[t_m_idx]) &&
+ projectable(target_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x))
{
counterattack = TRUE;
}
if (!counterattack)
{
/* Attempt to cast a spell */
- if (aware && make_attack_spell(m_idx, p_ptr)) return;
+ if (aware && make_attack_spell(m_idx, target_ptr)) return;
/*
* Attempt to cast a spell at an enemy other than the player
* (may slow the game a smidgeon, but I haven't noticed.)
*/
- if (monst_spell_monst(m_idx)) return;
+ if (monst_spell_monst(target_ptr, m_idx)) return;
}
else
{
/* Attempt to do counter attack at first */
- if (monst_spell_monst(m_idx)) return;
+ if (monst_spell_monst(target_ptr, m_idx)) return;
- if (aware && make_attack_spell(m_idx, p_ptr)) return;
+ if (aware && make_attack_spell(m_idx, target_ptr)) return;
}
}
else if (is_pet(m_ptr))
{
/* Are we trying to avoid the player? */
- bool avoid = ((p_ptr->pet_follow_distance < 0) && (m_ptr->cdis <= (0 - p_ptr->pet_follow_distance)));
+ bool avoid = ((target_ptr->pet_follow_distance < 0) && (m_ptr->cdis <= (0 - target_ptr->pet_follow_distance)));
/* Do we want to find the player? */
- bool lonely = (!avoid && (m_ptr->cdis > p_ptr->pet_follow_distance));
+ bool lonely = (!avoid && (m_ptr->cdis > target_ptr->pet_follow_distance));
/* Should we find the player if we can't find a monster? */
bool distant = (m_ptr->cdis > PET_SEEK_DIST);
if (avoid || lonely || distant)
{
/* Remember the leash length */
- POSITION dis = p_ptr->pet_follow_distance;
+ POSITION dis = target_ptr->pet_follow_distance;
/* Hack -- adjust follow distance temporarily */
- if (p_ptr->pet_follow_distance > PET_SEEK_DIST)
+ if (target_ptr->pet_follow_distance > PET_SEEK_DIST)
{
- p_ptr->pet_follow_distance = PET_SEEK_DIST;
+ target_ptr->pet_follow_distance = PET_SEEK_DIST;
}
/* Find the player */
(void)get_moves(m_idx, mm);
/* Restore the leash */
- p_ptr->pet_follow_distance = (s16b)dis;
+ target_ptr->pet_follow_distance = (s16b)dis;
}
}
}
nx = ox + ddx[d];
/* Ignore locations off of edge */
- if (!in_bounds2(p_ptr->current_floor_ptr, ny, nx)) continue;
+ if (!in_bounds2(target_ptr->current_floor_ptr, ny, nx)) continue;
/* Access that grid */
- g_ptr = &p_ptr->current_floor_ptr->grid_array[ny][nx];
+ g_ptr = &target_ptr->current_floor_ptr->grid_array[ny][nx];
f_ptr = &f_info[g_ptr->feat];
can_cross = monster_can_cross_terrain(g_ptr->feat, r_ptr, is_riding_mon ? CEM_RIDING : 0);
/* Access that grid's contents */
- y_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
+ y_ptr = &target_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Hack -- player 'in' wall */
- if (player_bold(p_ptr, ny, nx))
+ if (player_bold(target_ptr, ny, nx))
{
do_move = TRUE;
}
do_move = TRUE;
/* Monster moves through walls (and doors) */
- if ((r_ptr->flags2 & RF2_PASS_WALL) && (!is_riding_mon || p_ptr->pass_wall) &&
+ if ((r_ptr->flags2 & RF2_PASS_WALL) && (!is_riding_mon || target_ptr->pass_wall) &&
have_flag(f_ptr->flags, FF_CAN_PASS))
{
/* Monster went through a wall */
/* Creature can open doors. */
if ((r_ptr->flags2 & RF2_OPEN_DOOR) && have_flag(f_ptr->flags, FF_OPEN) &&
- (!is_pet(m_ptr) || (p_ptr->pet_extra_flags & PF_OPEN_DOORS)))
+ (!is_pet(m_ptr) || (target_ptr->pet_extra_flags & PF_OPEN_DOORS)))
{
/* Closed doors */
if (!f_ptr->power)
/* Stuck doors -- attempt to bash them down if allowed */
if (may_bash && (r_ptr->flags2 & RF2_BASH_DOOR) && have_flag(f_ptr->flags, FF_BASH) &&
- (!is_pet(m_ptr) || (p_ptr->pet_extra_flags & PF_OPEN_DOORS)))
+ (!is_pet(m_ptr) || (target_ptr->pet_extra_flags & PF_OPEN_DOORS)))
{
/* Attempt to Bash */
if (check_hp_for_feat_destruction(f_ptr, m_ptr) && (randint0(m_ptr->hp / 10) > f_ptr->power))
msg_print(_("ドアを叩き開ける音がした!", "You hear a door burst open!"));
/* Disturb (sometimes) */
- if (disturb_minor) disturb(p_ptr, FALSE, FALSE);
+ if (disturb_minor) disturb(target_ptr, FALSE, FALSE);
/* The door was bashed open */
did_bash_door = TRUE;
if (!monster_is_valid(m_ptr)) /* Killed by shards of glass, etc. */
{
- p_ptr->update |= (PU_FLOW);
- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+ target_ptr->update |= (PU_FLOW);
+ target_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_BASH_DOOR);
return;
/* Hack -- check for Glyph of Warding */
if (do_move && is_glyph_grid(g_ptr) &&
- !((r_ptr->flags1 & RF1_NEVER_BLOW) && player_bold(p_ptr, ny, nx)))
+ !((r_ptr->flags1 & RF1_NEVER_BLOW) && player_bold(target_ptr, ny, nx)))
{
/* Assume no move allowed */
do_move = FALSE;
}
}
else if (do_move && is_explosive_rune_grid(g_ptr) &&
- !((r_ptr->flags1 & RF1_NEVER_BLOW) && player_bold(p_ptr, ny, nx)))
+ !((r_ptr->flags1 & RF1_NEVER_BLOW) && player_bold(target_ptr, ny, nx)))
{
/* Assume no move allowed */
do_move = FALSE;
if (g_ptr->info & CAVE_MARK)
{
msg_print(_("ルーンが爆発した!", "The rune explodes!"));
- project(p_ptr, 0, 2, ny, nx, 2 * (p_ptr->lev + damroll(7, 7)), GF_MANA, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
+ project(target_ptr, 0, 2, ny, nx, 2 * (target_ptr->lev + damroll(7, 7)), GF_MANA, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
}
}
else
}
/* The player is in the way */
- if (do_move && player_bold(p_ptr, ny, nx))
+ if (do_move && player_bold(target_ptr, ny, nx))
{
/* Some monsters never attack */
if (r_ptr->flags1 & RF1_NEVER_BLOW)
}
/* In anti-melee dungeon, stupid or confused monster takes useless turn */
- if (do_move && (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE))
+ if (do_move && (d_info[target_ptr->dungeon_idx].flags1 & DF1_NO_MELEE))
{
if (!MON_CONFUSED(m_ptr))
{
/* The player is in the way. Attack him. */
if (do_move)
{
- if (!p_ptr->riding || one_in_(2))
+ if (!target_ptr->riding || one_in_(2))
{
/* Do the attack */
- (void)make_attack_normal(p_ptr, m_idx);
+ (void)make_attack_normal(target_ptr, m_idx);
/* Do not move */
do_move = FALSE;
/* Attack 'enemies' */
if (((r_ptr->flags2 & RF2_KILL_BODY) && !(r_ptr->flags1 & RF1_NEVER_BLOW) &&
(r_ptr->mexp * r_ptr->level > z_ptr->mexp * z_ptr->level) &&
- can_cross && (g_ptr->m_idx != p_ptr->riding)) ||
+ can_cross && (g_ptr->m_idx != target_ptr->riding)) ||
are_enemies(m_ptr, y_ptr) || MON_CONFUSED(m_ptr))
{
if (!(r_ptr->flags1 & RF1_NEVER_BLOW))
/* attack */
if (y_ptr->r_idx && (y_ptr->hp >= 0))
{
- if (monst_attack_monst(p_ptr, m_idx, g_ptr->m_idx)) return;
+ if (monst_attack_monst(target_ptr, m_idx, g_ptr->m_idx)) return;
/* In anti-melee dungeon, stupid or confused monster takes useless turn */
- else if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
+ else if (d_info[target_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
{
if (MON_CONFUSED(m_ptr)) return;
else if (r_ptr->flags2 & RF2_STUPID)
/* Push past weaker monsters (unless leaving a wall) */
else if ((r_ptr->flags2 & RF2_MOVE_BODY) && !(r_ptr->flags1 & RF1_NEVER_MOVE) &&
(r_ptr->mexp > z_ptr->mexp) &&
- can_cross && (g_ptr->m_idx != p_ptr->riding) &&
- monster_can_cross_terrain(p_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].feat, z_ptr, 0))
+ can_cross && (g_ptr->m_idx != target_ptr->riding) &&
+ monster_can_cross_terrain(target_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].feat, z_ptr, 0))
{
/* Allow movement */
do_move = TRUE;
if (is_riding_mon)
{
- if (!p_ptr->riding_ryoute && !MON_MONFEAR(&p_ptr->current_floor_ptr->m_list[p_ptr->riding])) do_move = FALSE;
+ if (!target_ptr->riding_ryoute && !MON_MONFEAR(&target_ptr->current_floor_ptr->m_list[target_ptr->riding])) do_move = FALSE;
}
if (did_kill_wall && do_move)
if (!monster_is_valid(m_ptr)) /* Killed by shards of glass, etc. */
{
- p_ptr->update |= (PU_FLOW);
- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+ target_ptr->update |= (PU_FLOW);
+ target_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_KILL_WALL);
return;
if (!is_riding_mon)
{
/* Hack -- Update the old location */
- p_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = g_ptr->m_idx;
+ target_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = g_ptr->m_idx;
/* Mega-Hack -- move the old monster, if any */
if (g_ptr->m_idx)
y_ptr->fx = ox;
/* Update the old monster */
- update_monster(p_ptr, g_ptr->m_idx, TRUE);
+ update_monster(target_ptr, g_ptr->m_idx, TRUE);
}
/* Hack -- Update the new location */
/* Move the monster */
m_ptr->fy = ny;
m_ptr->fx = nx;
- update_monster(p_ptr, m_idx, TRUE);
+ update_monster(target_ptr, m_idx, TRUE);
lite_spot(oy, ox);
lite_spot(ny, nx);
else
{
/* sound(SOUND_WALK); */
- if (!move_player_effect(p_ptr, ny, nx, MPE_DONT_PICKUP)) break;
+ if (!move_player_effect(target_ptr, ny, nx, MPE_DONT_PICKUP)) break;
}
/* Possible disturb */
if (m_ptr->ml &&
(disturb_move ||
- (disturb_near && (m_ptr->mflag & MFLAG_VIEW) && projectable(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx)) ||
- (disturb_high && ap_r_ptr->r_tkills && ap_r_ptr->level >= p_ptr->lev)))
+ (disturb_near && (m_ptr->mflag & MFLAG_VIEW) && projectable(target_ptr->current_floor_ptr, target_ptr->y, target_ptr->x, m_ptr->fy, m_ptr->fx)) ||
+ (disturb_high && ap_r_ptr->r_tkills && ap_r_ptr->level >= target_ptr->lev)))
{
if (is_hostile(m_ptr))
- disturb(p_ptr, FALSE, TRUE);
+ disturb(target_ptr, FALSE, TRUE);
}
/* Take or Kill objects on the floor */
if (g_ptr->o_idx && (r_ptr->flags2 & (RF2_TAKE_ITEM | RF2_KILL_ITEM)) &&
- (!is_pet(m_ptr) || ((p_ptr->pet_extra_flags & PF_PICKUP_ITEMS) && (r_ptr->flags2 & RF2_TAKE_ITEM))))
+ (!is_pet(m_ptr) || ((target_ptr->pet_extra_flags & PF_PICKUP_ITEMS) && (r_ptr->flags2 & RF2_TAKE_ITEM))))
{
OBJECT_IDX this_o_idx, next_o_idx;
bool do_take = (r_ptr->flags2 & RF2_TAKE_ITEM) ? TRUE : FALSE;
{
BIT_FLAGS flgs[TR_FLAG_SIZE], flg2 = 0L, flg3 = 0L, flgr = 0L;
GAME_TEXT m_name[MAX_NLEN], o_name[MAX_NLEN];
- object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
+ object_type *o_ptr = &target_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
if (do_take)
did_take_item = TRUE;
/* Describe observable situations */
- if (m_ptr->ml && player_can_see_bold(p_ptr, ny, nx))
+ if (m_ptr->ml && player_can_see_bold(target_ptr, ny, nx))
{
msg_format(_("%^sは%sを拾おうとしたが、だめだった。", "%^s tries to pick up %s, but fails."), m_name, o_name);
}
did_take_item = TRUE;
/* Describe observable situations */
- if (player_can_see_bold(p_ptr, ny, nx))
+ if (player_can_see_bold(target_ptr, ny, nx))
{
msg_format(_("%^sが%sを拾った。", "%^s picks up %s."), m_name, o_name);
}
did_kill_item = TRUE;
/* Describe observable situations */
- if (player_has_los_bold(p_ptr, ny, nx))
+ if (player_has_los_bold(target_ptr, ny, nx))
{
msg_format(_("%^sが%sを破壊した。", "%^s destroys %s."), m_name, o_name);
}
* Forward movements failed, but now received LOS attack!
* Try to flow by smell.
*/
- if (p_ptr->no_flowed && i > 2 && m_ptr->target_y)
+ if (target_ptr->no_flowed && i > 2 && m_ptr->target_y)
m_ptr->mflag2 &= ~MFLAG2_NOFLOW;
/* If we haven't done anything, try casting a spell again */
/* Try to cast spell again */
if (r_ptr->freq_spell && randint1(100) <= r_ptr->freq_spell)
{
- if (make_attack_spell(m_idx, p_ptr)) return;
+ if (make_attack_spell(m_idx, target_ptr)) return;
}
}
/* Notice changes in view */
if (do_view)
{
- p_ptr->update |= (PU_FLOW);
- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+ target_ptr->update |= (PU_FLOW);
+ target_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
}
/* Notice changes in view */
if (do_move && ((r_ptr->flags7 & (RF7_SELF_LD_MASK | RF7_HAS_DARK_1 | RF7_HAS_DARK_2))
- || ((r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) && !p_ptr->phase_out)))
+ || ((r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) && !target_ptr->phase_out)))
{
- p_ptr->update |= (PU_MON_LITE);
+ target_ptr->update |= (PU_MON_LITE);
}
/* Learn things from observable monster */
msg_format(_("%^sは戦いを決意した!", "%^s turns to fight!"), m_name);
}
- if (m_ptr->ml) chg_virtue(p_ptr, V_COMPASSION, -1);
+ if (m_ptr->ml) chg_virtue(target_ptr, V_COMPASSION, -1);
/* Actually do something now (?) */
}
* changes (flags, attacks, spells), we induce a redraw of the monster\n
* recall window.\n
*/
-void process_monsters(floor_type *floor_ptr)
+void process_monsters(player_type *target_ptr)
{
MONSTER_IDX i;
POSITION fx, fy;
SPEED speed;
/* Clear monster fighting indicator */
+ floor_type *floor_ptr = target_ptr->current_floor_ptr;
floor_ptr->monster_noise = FALSE;
/* Memorize old race */
- old_monster_race_idx = p_ptr->monster_race_idx;
+ old_monster_race_idx = target_ptr->monster_race_idx;
/* Acquire knowledge */
- if (p_ptr->monster_race_idx)
+ if (target_ptr->monster_race_idx)
{
/* Acquire current monster */
- r_ptr = &r_info[p_ptr->monster_race_idx];
+ r_ptr = &r_info[target_ptr->monster_race_idx];
/* Memorize flags */
old_r_flags1 = r_ptr->r_flags1;
r_ptr = &r_info[m_ptr->r_idx];
/* Handle "leaving" */
- if (p_ptr->leaving) break;
+ if (target_ptr->leaving) break;
/* Ignore "dead" monsters */
if (!monster_is_valid(m_ptr)) continue;
- if (p_ptr->wild_mode) continue;
+ if (target_ptr->wild_mode) continue;
/* Handle "fresh" monsters */
fy = m_ptr->fy;
/* Flow by smell is allowed */
- if (!p_ptr->no_flowed)
+ if (!target_ptr->no_flowed)
{
m_ptr->mflag2 &= ~MFLAG2_NOFLOW;
}
}
/* Handle "sight" and "aggravation" */
- else if ((m_ptr->cdis <= MAX_SIGHT || p_ptr->phase_out) &&
- (player_has_los_bold(p_ptr, fy, fx) || (p_ptr->cursed & TRC_AGGRAVATE)))
+ else if ((m_ptr->cdis <= MAX_SIGHT || target_ptr->phase_out) &&
+ (player_has_los_bold(target_ptr, fy, fx) || (target_ptr->cursed & TRC_AGGRAVATE)))
{
/* We can "see" or "feel" the player */
test = TRUE;
}
-#if 0 /* (floor_ptr->grid_array[p_ptr->y][p_ptr->x].when == floor_ptr->grid_array[fy][fx].when) is always FALSE... */
+#if 0 /* (floor_ptr->grid_array[target_ptr->y][target_ptr->x].when == floor_ptr->grid_array[fy][fx].when) is always FALSE... */
/* Hack -- Monsters can "smell" the player from far away */
/* Note that most monsters have "aaf" of "20" or so */
else if (!(m_ptr->mflag2 & MFLAG2_NOFLOW) &&
- cave_have_flag_bold(p_ptr->y, p_ptr->x, FF_MOVE) &&
- (floor_ptr->grid_array[p_ptr->y][p_ptr->x].when == floor_ptr->grid_array[fy][fx].when) &&
+ cave_have_flag_bold(target_ptr->y, target_ptr->x, FF_MOVE) &&
+ (floor_ptr->grid_array[target_ptr->y][target_ptr->x].when == floor_ptr->grid_array[fy][fx].when) &&
(floor_ptr->grid_array[fy][fx].dist < MONSTER_FLOW_DEPTH) &&
(floor_ptr->grid_array[fy][fx].dist < r_ptr->aaf))
{
if (!test) continue;
- if (p_ptr->riding == i)
- speed = p_ptr->pspeed;
+ if (target_ptr->riding == i)
+ speed = target_ptr->pspeed;
else
{
speed = m_ptr->mspeed;
hack_m_idx = i;
/* Process the monster */
- process_monster(i);
+ process_monster(target_ptr, i);
reset_target(m_ptr);
/* Give up flow_by_smell when it might useless */
- if (p_ptr->no_flowed && one_in_(3))
+ if (target_ptr->no_flowed && one_in_(3))
m_ptr->mflag2 |= MFLAG2_NOFLOW;
/* Hack -- notice death or departure */
- if (!p_ptr->playing || p_ptr->is_dead) break;
+ if (!target_ptr->playing || target_ptr->is_dead) break;
/* Notice leaving */
- if (p_ptr->leaving) break;
+ if (target_ptr->leaving) break;
}
/* Reset global index */
/* Tracking a monster race (the same one we were before) */
- if (p_ptr->monster_race_idx && (p_ptr->monster_race_idx == old_monster_race_idx))
+ if (!target_ptr->monster_race_idx || (target_ptr->monster_race_idx != old_monster_race_idx))
+ return;
+
+ /* Acquire monster race */
+ r_ptr = &r_info[target_ptr->monster_race_idx];
+
+ /* Check for knowledge change */
+ if ((old_r_flags1 != r_ptr->r_flags1) ||
+ (old_r_flags2 != r_ptr->r_flags2) ||
+ (old_r_flags3 != r_ptr->r_flags3) ||
+ (old_r_flags4 != r_ptr->r_flags4) ||
+ (old_r_flags5 != r_ptr->r_flags5) ||
+ (old_r_flags6 != r_ptr->r_flags6) ||
+ (old_r_flagsr != r_ptr->r_flagsr) ||
+ (old_r_blows0 != r_ptr->r_blows[0]) ||
+ (old_r_blows1 != r_ptr->r_blows[1]) ||
+ (old_r_blows2 != r_ptr->r_blows[2]) ||
+ (old_r_blows3 != r_ptr->r_blows[3]) ||
+ (old_r_cast_spell != r_ptr->r_cast_spell))
{
- /* Acquire monster race */
- r_ptr = &r_info[p_ptr->monster_race_idx];
-
- /* Check for knowledge change */
- if ((old_r_flags1 != r_ptr->r_flags1) ||
- (old_r_flags2 != r_ptr->r_flags2) ||
- (old_r_flags3 != r_ptr->r_flags3) ||
- (old_r_flags4 != r_ptr->r_flags4) ||
- (old_r_flags5 != r_ptr->r_flags5) ||
- (old_r_flags6 != r_ptr->r_flags6) ||
- (old_r_flagsr != r_ptr->r_flagsr) ||
- (old_r_blows0 != r_ptr->r_blows[0]) ||
- (old_r_blows1 != r_ptr->r_blows[1]) ||
- (old_r_blows2 != r_ptr->r_blows[2]) ||
- (old_r_blows3 != r_ptr->r_blows[3]) ||
- (old_r_cast_spell != r_ptr->r_cast_spell))
- {
- p_ptr->window |= (PW_MONSTER);
- }
+ target_ptr->window |= (PW_MONSTER);
}
}
#pragma once
/* monster-process.c */
-extern void process_monsters(floor_type *floor_ptr);
-extern void process_monster(MONSTER_IDX m_idx);
+extern void process_monsters(player_type *target_ptr);
+extern void process_monster(player_type *target_ptr, MONSTER_IDX m_idx);
extern int get_mproc_idx(MONSTER_IDX m_idx, int mproc_type);
extern void mproc_init(void);
extern void process_monsters_mtimed(int mtimed_idx);
/* mspells2.c */
extern void get_project_point(floor_type *floor_ptr, POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg);
-extern bool monst_spell_monst(MONSTER_IDX m_idx);
+extern bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx);
/* mspells3.c */
extern bool do_cmd_cast_learned(void);
/* mspells4.c */
extern bool spell_learnable(MONSTER_IDX m_idx);
extern HIT_POINT monspell_to_player(int SPELL_NUM, player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx);
-extern HIT_POINT monspell_to_monster(int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx);
+extern HIT_POINT monspell_to_monster(player_type *target_ptr, int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx);
extern HIT_POINT monspell_damage(int SPELL_NUM, MONSTER_IDX m_idx, int TYPE);
extern HIT_POINT monspell_race_damage(int SPELL_NUM, MONRACE_IDX r_idx, int TYPE);
extern HIT_POINT monspell_bluemage_damage(int SPELL_NUM, PLAYER_LEVEL plev, int TYPE);
/*!
* @brief モンスターの時間停止処理
+* @param target_ptr プレーヤーへの参照ポインタ
* @param num 時間停止を行った敵が行動できる回数
* @param who 時間停止処理の主体ID
* @param vs_player TRUEならば時間停止開始処理を行う
* @return 時間停止が行われている状態ならばTRUEを返す
*/
-bool set_monster_timewalk(int num, MONSTER_IDX who, bool vs_player)
+bool set_monster_timewalk(player_type *target_ptr, int num, MONSTER_IDX who, bool vs_player)
{
- monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[hack_m_idx]; /* the world monster */
+ monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[hack_m_idx]; /* the world monster */
if (current_world_ptr->timewalk_m_idx) return (FALSE);
/* This monster cast spells */
current_world_ptr->timewalk_m_idx = hack_m_idx;
- if (vs_player) do_cmd_redraw(p_ptr);
+ if (vs_player) do_cmd_redraw(target_ptr);
while (num--)
{
if (!monster_is_valid(m_ptr)) break;
- process_monster(current_world_ptr->timewalk_m_idx);
+ process_monster(target_ptr, current_world_ptr->timewalk_m_idx);
reset_target(m_ptr);
handle_stuff();
if (vs_player) Term_xtra(TERM_XTRA_DELAY, 500);
}
- p_ptr->redraw |= (PR_MAP);
- p_ptr->update |= (PU_MONSTERS);
- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+ target_ptr->redraw |= (PR_MAP);
+ target_ptr->update |= (PU_MONSTERS);
+ target_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
current_world_ptr->timewalk_m_idx = 0;
- if (vs_player || (player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx) && projectable(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx)))
+ if (vs_player || (player_has_los_bold(target_ptr, m_ptr->fy, m_ptr->fx) && projectable(target_ptr->current_floor_ptr, target_ptr->y, target_ptr->x, m_ptr->fy, m_ptr->fx)))
{
msg_print(_("「時は動きだす…」", "You feel time flowing around you once more."));
msg_print(NULL);
extern bool set_monster_confused(MONSTER_IDX m_idx, int v);
extern bool set_monster_monfear(MONSTER_IDX m_idx, int v);
extern bool set_monster_invulner(MONSTER_IDX m_idx, int v, bool energy_need);
-extern bool set_monster_timewalk(int num, MONSTER_IDX who, bool vs_player);
+extern bool set_monster_timewalk(player_type *target_ptr, int num, MONSTER_IDX who, bool vs_player);
extern void dispel_monster_status(MONSTER_IDX m_idx);
extern void monster_gain_exp(MONSTER_IDX m_idx, MONRACE_IDX s_idx);
return TRUE;
}
+
/*!
* @brief モンスターが敵対モンスターに直接ブレスを当てることが可能かを判定する /
* Determine if a breath will hit the target.
}
/* Check the projection path */
- grid_n = project_path(p_ptr->current_floor_ptr, grid_g, MAX_RANGE, y1, x1, y2, x2, flg);
+ grid_n = project_path(master_ptr->current_floor_ptr, grid_g, MAX_RANGE, y1, x1, y2, x2, flg);
/* Project along the path */
for (i = 0; i < grid_n; ++i)
return TRUE;
}
+
/*!
* @brief モンスターが特殊能力の目標地点を決める処理 /
* Get the actual center point of ball spells (rad > 1) (originally from TOband)
}
}
+
/*!
* @brief モンスターが敵モンスターに魔力消去を使うかどうかを返す /
* Check should monster cast dispel spell at other monster.
return FALSE;
}
+
/*!
+ * todo モンスターからモンスターへの呪文なのにplayer_typeが引数になり得るのは間違っている……
* @brief モンスターが敵モンスターに特殊能力を使う処理のメインルーチン /
* Monster tries to 'cast a spell' (or breath, etc) at another monster.
+ * @param target_ptr プレーヤーへの参照ポインタ
* @param m_idx 術者のモンスターID
* @return 実際に特殊能力を使った場合TRUEを返す
* @details
* The player is only disturbed if able to be affected by the spell.
*/
-bool monst_spell_monst(MONSTER_IDX m_idx)
+bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx)
{
POSITION y = 0, x = 0;
int i, k;
char m_poss[160];
#endif
- 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_type *t_ptr = NULL;
monster_race *r_ptr = &r_info[m_ptr->r_idx];
u32b f4, f5, f6;
bool see_m = is_seen(m_ptr);
- bool maneable = player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx);
+ bool maneable = player_has_los_bold(target_ptr, m_ptr->fy, m_ptr->fx);
bool pet = is_pet(m_ptr);
- bool in_no_magic_dungeon = (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && p_ptr->current_floor_ptr->dun_level
- && (!p_ptr->current_floor_ptr->inside_quest || is_fixed_quest_idx(p_ptr->current_floor_ptr->inside_quest));
+ bool in_no_magic_dungeon = (d_info[target_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && floor_ptr->dun_level
+ && (!floor_ptr->inside_quest || is_fixed_quest_idx(floor_ptr->inside_quest));
bool can_use_lite_area = FALSE;
bool can_remember;
f6 = r_ptr->a_ability_flags2;
/* Target is given for pet? */
- if (p_ptr->pet_t_m_idx && pet)
+ if (target_ptr->pet_t_m_idx && pet)
{
- target_idx = p_ptr->pet_t_m_idx;
- t_ptr = &p_ptr->current_floor_ptr->m_list[target_idx];
+ target_idx = target_ptr->pet_t_m_idx;
+ t_ptr = &floor_ptr->m_list[target_idx];
/* Cancel if not projectable (for now) */
- if ((m_idx == target_idx) || !projectable(p_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
+ if ((m_idx == target_idx) || !projectable(floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
{
target_idx = 0;
}
/* Is there counter attack target? */
if (!target_idx && m_ptr->target_y)
{
- target_idx = p_ptr->current_floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
+ target_idx = floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
if (target_idx)
{
- t_ptr = &p_ptr->current_floor_ptr->m_list[target_idx];
+ t_ptr = &floor_ptr->m_list[target_idx];
/* Cancel if neither enemy nor a given target */
if ((m_idx == target_idx) ||
- ((target_idx != p_ptr->pet_t_m_idx) && !are_enemies(m_ptr, t_ptr)))
+ ((target_idx != target_ptr->pet_t_m_idx) && !are_enemies(m_ptr, t_ptr)))
{
target_idx = 0;
}
/* Allow only summoning etc.. if not projectable */
- else if (!projectable(p_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
+ else if (!projectable(floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
{
f4 &= (RF4_INDIRECT_MASK);
f5 &= (RF5_INDIRECT_MASK);
{
bool success = FALSE;
- if (p_ptr->phase_out)
+ if (target_ptr->phase_out)
{
- start = randint1(p_ptr->current_floor_ptr->m_max-1) + p_ptr->current_floor_ptr->m_max;
+ start = randint1(floor_ptr->m_max-1) + floor_ptr->m_max;
if (randint0(2)) plus = -1;
}
- else start = p_ptr->current_floor_ptr->m_max + 1;
+ else start = floor_ptr->m_max + 1;
/* Scan thru all monsters */
- for (i = start; ((i < start + p_ptr->current_floor_ptr->m_max) && (i > start - p_ptr->current_floor_ptr->m_max)); i += plus)
+ for (i = start; ((i < start + floor_ptr->m_max) && (i > start - floor_ptr->m_max)); i += plus)
{
- MONSTER_IDX dummy = (i % p_ptr->current_floor_ptr->m_max);
+ MONSTER_IDX dummy = (i % floor_ptr->m_max);
if (!dummy) continue;
target_idx = dummy;
- t_ptr = &p_ptr->current_floor_ptr->m_list[target_idx];
+ t_ptr = &floor_ptr->m_list[target_idx];
if (!monster_is_valid(t_ptr)) continue;
if ((m_idx == target_idx) || !are_enemies(m_ptr, t_ptr)) continue;
/* Monster must be projectable */
- if (!projectable(p_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
+ if (!projectable(floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
/* Get it */
success = TRUE;
/* No enemy found */
if (!success) return FALSE;
}
-
-
+
/* OK -- we've got a target */
y = t_ptr->fy;
x = t_ptr->fx;
if (f4 & RF4_BR_LITE)
{
- if (!los(p_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
+ if (!los(floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
f4 &= ~(RF4_BR_LITE);
}
if (f6 & RF6_DARKNESS)
{
- bool vs_ninja = (p_ptr->pclass == CLASS_NINJA) && !is_hostile(t_ptr);
+ bool vs_ninja = (target_ptr->pclass == CLASS_NINJA) && !is_hostile(t_ptr);
if (vs_ninja &&
!(r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) &&
if (!(r_ptr->flags2 & RF2_STUPID))
{
- if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) f6 &= ~(RF6_DARKNESS);
+ if (d_info[target_ptr->dungeon_idx].flags1 & DF1_DARKNESS) f6 &= ~(RF6_DARKNESS);
else if (vs_ninja && !can_use_lite_area) f6 &= ~(RF6_DARKNESS);
}
}
f6 &= (RF6_NOMAGIC_MASK);
}
- if (p_ptr->current_floor_ptr->inside_arena || p_ptr->phase_out)
+ if (floor_ptr->inside_arena || target_ptr->phase_out)
{
f4 &= ~(RF4_SUMMON_MASK);
f5 &= ~(RF5_SUMMON_MASK);
if (m_ptr->r_idx == MON_ROLENTO) f6 &= ~(RF6_SPECIAL);
}
- if (p_ptr->phase_out && !one_in_(3))
+ if (target_ptr->phase_out && !one_in_(3))
{
f6 &= ~(RF6_HEAL);
}
- if (m_idx == p_ptr->riding)
+ if (m_idx == target_ptr->riding)
{
f4 &= ~(RF4_RIDING_MASK);
f5 &= ~(RF5_RIDING_MASK);
f4 &= ~(RF4_SHRIEK);
f6 &= ~(RF6_DARKNESS | RF6_TRAPS);
- if (!(p_ptr->pet_extra_flags & PF_TELEPORT))
+ if (!(target_ptr->pet_extra_flags & PF_TELEPORT))
{
f6 &= ~(RF6_BLINK | RF6_TPORT | RF6_TELE_TO | RF6_TELE_AWAY | RF6_TELE_LEVEL);
}
- if (!(p_ptr->pet_extra_flags & PF_ATTACK_SPELL))
+ if (!(target_ptr->pet_extra_flags & PF_ATTACK_SPELL))
{
f4 &= ~(RF4_ATTACK_MASK);
f5 &= ~(RF5_ATTACK_MASK);
f6 &= ~(RF6_ATTACK_MASK);
}
- if (!(p_ptr->pet_extra_flags & PF_SUMMON_SPELL))
+ if (!(target_ptr->pet_extra_flags & PF_SUMMON_SPELL))
{
f4 &= ~(RF4_SUMMON_MASK);
f5 &= ~(RF5_SUMMON_MASK);
}
/* Prevent collateral damage */
- if (!(p_ptr->pet_extra_flags & PF_BALL_SPELL) && (m_idx != p_ptr->riding))
+ if (!(target_ptr->pet_extra_flags & PF_BALL_SPELL) && (m_idx != target_ptr->riding))
{
if ((f4 & (RF4_BALL_MASK & ~(RF4_ROCKET))) ||
(f5 & RF5_BALL_MASK) ||
POSITION real_y = y;
POSITION real_x = x;
- get_project_point(p_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, &real_y, &real_x, 0L);
+ get_project_point(floor_ptr, m_ptr->fy, m_ptr->fx, &real_y, &real_x, 0L);
- if (projectable(p_ptr->current_floor_ptr, real_y, real_x, p_ptr->y, p_ptr->x))
+ if (projectable(floor_ptr, real_y, real_x, target_ptr->y, target_ptr->x))
{
- int dist = distance(real_y, real_x, p_ptr->y, p_ptr->x);
+ int dist = distance(real_y, real_x, target_ptr->y, target_ptr->x);
if (dist <= 2)
{
}
else if (f5 & RF5_BA_LITE)
{
- if ((distance(real_y, real_x, p_ptr->y, p_ptr->x) <= 4) && los(p_ptr->current_floor_ptr, real_y, real_x, p_ptr->y, p_ptr->x))
+ if ((distance(real_y, real_x, target_ptr->y, target_ptr->x) <= 4) && los(floor_ptr, real_y, real_x, target_ptr->y, target_ptr->x))
f5 &= ~(RF5_BA_LITE);
}
}
POSITION real_y = y;
POSITION real_x = x;
- get_project_point(p_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, &real_y, &real_x, PROJECT_STOP);
- if (projectable(p_ptr->current_floor_ptr, real_y, real_x, p_ptr->y, p_ptr->x) && (distance(real_y, real_x, p_ptr->y, p_ptr->x) <= 2))
+ get_project_point(floor_ptr, m_ptr->fy, m_ptr->fx, &real_y, &real_x, PROJECT_STOP);
+ if (projectable(floor_ptr, real_y, real_x, target_ptr->y, target_ptr->x) && (distance(real_y, real_x, target_ptr->y, target_ptr->x) <= 2))
f4 &= ~(RF4_ROCKET);
}
/* Expected breath radius */
POSITION rad = (r_ptr->flags2 & RF2_POWERFUL) ? 3 : 2;
- if (!breath_direct(p_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, 0, TRUE))
+ if (!breath_direct(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, 0, TRUE))
{
f4 &= ~(RF4_BREATH_MASK);
f5 &= ~(RF5_BREATH_MASK);
f6 &= ~(RF6_BREATH_MASK);
}
else if ((f4 & RF4_BR_LITE) &&
- !breath_direct(p_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, GF_LITE, TRUE))
+ !breath_direct(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, GF_LITE, TRUE))
{
f4 &= ~(RF4_BR_LITE);
}
else if ((f4 & RF4_BR_DISI) &&
- !breath_direct(p_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, GF_DISINTEGRATE, TRUE))
+ !breath_direct(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, GF_DISINTEGRATE, TRUE))
{
f4 &= ~(RF4_BR_DISI);
}
{
if (m_ptr->r_idx == MON_ROLENTO)
{
- if ((p_ptr->pet_extra_flags & (PF_ATTACK_SPELL | PF_SUMMON_SPELL)) != (PF_ATTACK_SPELL | PF_SUMMON_SPELL))
+ if ((target_ptr->pet_extra_flags & (PF_ATTACK_SPELL | PF_SUMMON_SPELL)) != (PF_ATTACK_SPELL | PF_SUMMON_SPELL))
f6 &= ~(RF6_SPECIAL);
}
else if (r_ptr->d_char == 'B')
{
- if ((p_ptr->pet_extra_flags & (PF_ATTACK_SPELL | PF_TELEPORT)) != (PF_ATTACK_SPELL | PF_TELEPORT))
+ if ((target_ptr->pet_extra_flags & (PF_ATTACK_SPELL | PF_TELEPORT)) != (PF_ATTACK_SPELL | PF_TELEPORT))
f6 &= ~(RF6_SPECIAL);
}
else f6 &= ~(RF6_SPECIAL);
}
/* Hack -- decline "teleport level" in some case */
- if ((f6 & RF6_TELE_LEVEL) && TELE_LEVEL_IS_INEFF((target_idx == p_ptr->riding) ? 0 : target_idx))
+ if ((f6 & RF6_TELE_LEVEL) && TELE_LEVEL_IS_INEFF((target_idx == target_ptr->riding) ? 0 : target_idx))
{
f6 &= ~(RF6_TELE_LEVEL);
}
if (!num) return (FALSE);
/* Stop if player is dead or gone */
- if (!p_ptr->playing || p_ptr->is_dead) return (FALSE);
+ if (!target_ptr->playing || target_ptr->is_dead) return (FALSE);
/* Handle "leaving" */
- if (p_ptr->leaving) return (FALSE);
+ if (target_ptr->leaving) return (FALSE);
/* Get the monster name (or "it") */
monster_desc(m_name, m_ptr, 0x00);
/* Choose a spell to cast */
thrown_spell = spell[randint0(num)];
- if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(p_ptr, TRUE, TRUE);
+ if (target_ptr->riding && (m_idx == target_ptr->riding)) disturb(target_ptr, TRUE, TRUE);
/* Check for spell failure (inate attacks never fail) */
if (!spell_is_inate(thrown_spell) && (in_no_magic_dungeon || (MON_STUNNED(m_ptr) && one_in_(2))))
{
- disturb(p_ptr, TRUE, TRUE);
+ disturb(target_ptr, TRUE, TRUE);
if (see_m) msg_format(_("%^sは呪文を唱えようとしたが失敗した。",
"%^s tries to cast a spell, but fails."), m_name);
}
/* Hex: Anti Magic Barrier */
- if (!spell_is_inate(thrown_spell) && magic_barrier(p_ptr, m_idx))
+ if (!spell_is_inate(thrown_spell) && magic_barrier(target_ptr, m_idx))
{
if (see_m) msg_format(_("反魔法バリアが%^sの呪文をかき消した。",
"Anti magic barrier cancels the spell which %^s casts."), m_name);
can_remember = is_original_ap_and_seen(m_ptr);
- dam = monspell_to_monster(thrown_spell, y, x, m_idx, target_idx);
+ dam = monspell_to_monster(target_ptr, thrown_spell, y, x, m_idx, target_idx);
if (dam < 0) return FALSE;
- if (m_ptr->ml && maneable && !current_world_ptr->timewalk_m_idx && !p_ptr->blind && (p_ptr->pclass == CLASS_IMITATOR))
+ if (m_ptr->ml && maneable && !current_world_ptr->timewalk_m_idx && !target_ptr->blind && (target_ptr->pclass == CLASS_IMITATOR))
{
if (thrown_spell != 167) /* Not RF6_SPECIAL */
{
- if (p_ptr->mane_num == MAX_MANE)
+ if (target_ptr->mane_num == MAX_MANE)
{
- p_ptr->mane_num--;
- for (i = 0; i < p_ptr->mane_num - 1; i++)
+ target_ptr->mane_num--;
+ for (i = 0; i < target_ptr->mane_num - 1; i++)
{
- p_ptr->mane_spell[i] = p_ptr->mane_spell[i+1];
- p_ptr->mane_dam[i] = p_ptr->mane_dam[i+1];
+ target_ptr->mane_spell[i] = target_ptr->mane_spell[i+1];
+ target_ptr->mane_dam[i] = target_ptr->mane_dam[i+1];
}
}
- p_ptr->mane_spell[p_ptr->mane_num] = thrown_spell - RF4_SPELL_START;
- p_ptr->mane_dam[p_ptr->mane_num] = dam;
- p_ptr->mane_num++;
- p_ptr->new_mane = TRUE;
- p_ptr->redraw |= (PR_IMITATION);
+ target_ptr->mane_spell[target_ptr->mane_num] = thrown_spell - RF4_SPELL_START;
+ target_ptr->mane_dam[target_ptr->mane_num] = dam;
+ target_ptr->mane_num++;
+ target_ptr->new_mane = TRUE;
+
+ target_ptr->redraw |= (PR_IMITATION);
}
}
}
/* Always take note of monsters that kill you */
- if (p_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !p_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++; /* Ignore appearance difference */
}
if (!success || (randint1(50+plev) < plev/10)) u_mode = PM_ALLOW_UNIQUE;
/* spell code */
+ floor_type *floor_ptr = caster_ptr->current_floor_ptr;
switch (spell)
{
case MS_SHRIEK:
MONSTER_IDX m_idx;
if (!target_set(TARGET_KILL)) return FALSE;
- m_idx = caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
+ m_idx = floor_ptr->grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (!player_has_los_bold(caster_ptr, target_row, target_col)) break;
- if (!projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
+ if (!projectable(floor_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
dispel_monster_status(m_idx);
break;
}
GAME_TEXT m_name[MAX_NLEN];
if (!target_set(TARGET_KILL)) return FALSE;
- if (!caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx) break;
+ if (!floor_ptr->grid_array[target_row][target_col].m_idx) break;
if (!player_has_los_bold(caster_ptr, target_row, target_col)) break;
- if (!projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
- m_ptr = &caster_ptr->current_floor_ptr->m_list[caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx];
+ if (!projectable(floor_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
+ m_ptr = &floor_ptr->m_list[floor_ptr->grid_array[target_row][target_col].m_idx];
r_ptr = &r_info[m_ptr->r_idx];
monster_desc(m_name, m_ptr, 0);
if (r_ptr->flagsr & RFR_RES_TELE)
break;
}
}
+
msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
- teleport_monster_to(caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx, caster_ptr->y, caster_ptr->x, 100, TELEPORT_PASSIVE);
+ teleport_monster_to(floor_ptr->grid_array[target_row][target_col].m_idx, caster_ptr->y, caster_ptr->x, 100, TELEPORT_PASSIVE);
break;
}
case MS_TELE_AWAY:
case MS_DARKNESS:
msg_print(_("暗闇の中で手を振った。", "You gesture in shadow."));
- (void)unlite_area(10, 3);
+ (void)unlite_area(caster_ptr, 10, 3);
break;
case MS_MAKE_TRAP:
if (!target_set(TARGET_KILL)) return FALSE;
break;
case MS_S_KIN:
{
- int k;
-
msg_print(_("援軍を召喚した。", "You summon minions."));
- for (k = 0;k < 1; k++)
+ for (int k = 0;k < 1; k++)
{
if (summon_kin_player(summon_lev, caster_ptr->y, caster_ptr->x, (pet ? PM_FORCE_PET : 0L)))
{
no_trump = TRUE;
}
}
+
break;
}
case MS_S_CYBER:
{
- int k;
-
msg_print(_("サイバーデーモンを召喚した!", "You summon a Cyberdemon!"));
- for (k = 0 ;k < 1 ; k++)
+ for (int k = 0; k < 1; k++)
+ {
if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_CYBER, p_mode))
{
- if (!pet)
- msg_print(_("召喚されたサイバーデーモンは怒っている!", "The summoned Cyberdemon are angry!"));
+ if (!pet)
+ msg_print(_("召喚されたサイバーデーモンは怒っている!", "The summoned Cyberdemon are angry!"));
}
else
{
no_trump = TRUE;
}
+ }
break;
}
case MS_S_MONSTER:
{
- int k;
msg_print(_("仲間を召喚した。", "You summon help."));
- for (k = 0;k < 1; k++)
+ for (int k = 0; k < 1; k++)
+ {
if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, 0, p_mode))
{
- if (!pet)
- msg_print(_("召喚されたモンスターは怒っている!", "The summoned monster is angry!"));
+ if (!pet)
+ msg_print(_("召喚されたモンスターは怒っている!", "The summoned monster is angry!"));
}
else
{
no_trump = TRUE;
}
+ }
+
break;
}
case MS_S_MONSTERS:
{
- int k;
msg_print(_("モンスターを召喚した!", "You summon monsters!"));
- for (k = 0;k < plev / 15 + 2; k++)
- if(summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, 0, (p_mode | u_mode)))
+ for (int k = 0; k < plev / 15 + 2; k++)
+ {
+ if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, 0, (p_mode | u_mode)))
{
- if (!pet)
- msg_print(_("召喚されたモンスターは怒っている!", "The summoned monsters are angry!"));
+ if (!pet)
+ msg_print(_("召喚されたモンスターは怒っている!", "The summoned monsters are angry!"));
}
else
{
no_trump = TRUE;
}
+ }
+
break;
}
case MS_S_ANT:
{
- int k;
msg_print(_("アリを召喚した。", "You summon ants."));
- for (k = 0; k < 1; k++)
- if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_ANT, (PM_ALLOW_GROUP | p_mode)))
- {
- if (!pet)
- msg_print(_("召喚されたアリは怒っている!", "The summoned ants are angry!"));
- }
- else
- {
- no_trump = TRUE;
- }
+ if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_ANT, (PM_ALLOW_GROUP | p_mode)))
+ {
+ if (!pet)
+ msg_print(_("召喚されたアリは怒っている!", "The summoned ants are angry!"));
+ }
+ else
+ {
+ no_trump = TRUE;
+ }
break;
}
case MS_S_SPIDER:
{
- int k;
msg_print(_("蜘蛛を召喚した。", "You summon spiders."));
- for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_SPIDER, (PM_ALLOW_GROUP | p_mode)))
- {
- if (!pet)
- msg_print(_("召喚された蜘蛛は怒っている!", "Summoned spiders are angry!"));
- }
- else
- {
- no_trump = TRUE;
- }
+ if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_SPIDER, (PM_ALLOW_GROUP | p_mode)))
+ {
+ if (!pet)
+ msg_print(_("召喚された蜘蛛は怒っている!", "Summoned spiders are angry!"));
+ }
+ else
+ {
+ no_trump = TRUE;
+ }
+
break;
}
case MS_S_HOUND:
{
- int k;
msg_print(_("ハウンドを召喚した。", "You summon hounds."));
- for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HOUND, (PM_ALLOW_GROUP | p_mode)))
- {
- if (!pet)
- msg_print(_("召喚されたハウンドは怒っている!", "Summoned hounds are angry!"));
- }
- else
- {
- no_trump = TRUE;
- }
+ if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HOUND, (PM_ALLOW_GROUP | p_mode)))
+ {
+ if (!pet)
+ msg_print(_("召喚されたハウンドは怒っている!", "Summoned hounds are angry!"));
+ }
+ else
+ {
+ no_trump = TRUE;
+ }
+
break;
}
case MS_S_HYDRA:
{
- int k;
msg_print(_("ヒドラを召喚した。", "You summon a hydras."));
- for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HYDRA, (g_mode | p_mode)))
- {
- if (!pet)
- msg_print(_("召喚されたヒドラは怒っている!", "Summoned hydras are angry!"));
- }
- else
- {
- no_trump = TRUE;
- }
+ if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HYDRA, (g_mode | p_mode)))
+ {
+ if (!pet)
+ msg_print(_("召喚されたヒドラは怒っている!", "Summoned hydras are angry!"));
+ }
+ else
+ {
+ no_trump = TRUE;
+ }
+
break;
}
case MS_S_ANGEL:
{
- int k;
msg_print(_("天使を召喚した!", "You summon an angel!"));
- for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_ANGEL, (g_mode | p_mode)))
- {
- if (!pet)
- msg_print(_("召喚された天使は怒っている!", "Summoned angels are angry!"));
- }
- else
- {
- no_trump = TRUE;
- }
+ if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_ANGEL, (g_mode | p_mode)))
+ {
+ if (!pet)
+ msg_print(_("召喚された天使は怒っている!", "Summoned angels are angry!"));
+ }
+ else
+ {
+ no_trump = TRUE;
+ }
+
break;
}
case MS_S_DEMON:
{
- int k;
msg_print(_("混沌の宮廷から悪魔を召喚した!", "You summon a demon from the Courts of Chaos!"));
- for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_DEMON, (g_mode | p_mode)))
- {
- if (!pet)
- msg_print(_("召喚されたデーモンは怒っている!", "Summoned demons are angry!"));
- }
- else
- {
- no_trump = TRUE;
- }
+ if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_DEMON, (g_mode | p_mode)))
+ {
+ if (!pet)
+ msg_print(_("召喚されたデーモンは怒っている!", "Summoned demons are angry!"));
+ }
+ else
+ {
+ no_trump = TRUE;
+ }
+
break;
}
case MS_S_UNDEAD:
{
- int k;
msg_print(_("アンデッドの強敵を召喚した!", "You summon an undead adversary!"));
- for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_UNDEAD, (g_mode | p_mode)))
- {
- if (!pet)
- msg_print(_("召喚されたアンデッドは怒っている!", "Summoned undeads are angry!"));
- }
- else
- {
- no_trump = TRUE;
- }
+ if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_UNDEAD, (g_mode | p_mode)))
+ {
+ if (!pet)
+ msg_print(_("召喚されたアンデッドは怒っている!", "Summoned undeads are angry!"));
+ }
+ else
+ {
+ no_trump = TRUE;
+ }
+
break;
}
case MS_S_DRAGON:
{
- int k;
msg_print(_("ドラゴンを召喚した!", "You summon a dragon!"));
- for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_DRAGON, (g_mode | p_mode)))
- {
- if (!pet)
- msg_print(_("召喚されたドラゴンは怒っている!", "Summoned dragons are angry!"));
- }
- else
- {
- no_trump = TRUE;
- }
+ if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_DRAGON, (g_mode | p_mode)))
+ {
+ if (!pet)
+ msg_print(_("召喚されたドラゴンは怒っている!", "Summoned dragons are angry!"));
+ }
+ else
+ {
+ no_trump = TRUE;
+ }
+
break;
}
case MS_S_HI_UNDEAD:
{
- int k;
msg_print(_("強力なアンデッドを召喚した!", "You summon a greater undead!"));
- for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | u_mode)))
- {
- if (!pet)
- msg_print(_("召喚された上級アンデッドは怒っている!", "Summoned greater undeads are angry!"));
- }
- else
- {
- no_trump = TRUE;
- }
+ if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | u_mode)))
+ {
+ if (!pet)
+ msg_print(_("召喚された上級アンデッドは怒っている!", "Summoned greater undeads are angry!"));
+ }
+ else
+ {
+ no_trump = TRUE;
+ }
+
break;
}
case MS_S_HI_DRAGON:
{
- int k;
- msg_print(_("古代ドラゴンを召喚した!", "You summon an ancient dragon!"));
- for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_DRAGON, (g_mode | p_mode | u_mode)))
- {
- if (!pet)
- msg_print(_("召喚された古代ドラゴンは怒っている!", "Summoned ancient dragons are angry!"));
- }
- else
- {
- no_trump = TRUE;
- }
+ msg_print(_("古代ドラゴンを召喚した!", "You summon an ancient dragon!"));
+ if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_DRAGON, (g_mode | p_mode | u_mode)))
+ {
+ if (!pet)
+ msg_print(_("召喚された古代ドラゴンは怒っている!", "Summoned ancient dragons are angry!"));
+ }
+ else
+ {
+ no_trump = TRUE;
+ }
+
break;
}
case MS_S_AMBERITE:
{
- int k;
msg_print(_("アンバーの王族を召喚した!", "You summon a Lord of Amber!"));
- for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_AMBERITES, (g_mode | p_mode | u_mode)))
- {
- if (!pet)
- msg_print(_("召喚されたアンバーの王族は怒っている!", "Summoned Lords of Amber are angry!"));
- }
- else
- {
- no_trump = TRUE;
- }
+ if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_AMBERITES, (g_mode | p_mode | u_mode)))
+ {
+ if (!pet)
+ msg_print(_("召喚されたアンバーの王族は怒っている!", "Summoned Lords of Amber are angry!"));
+ }
+ else
+ {
+ no_trump = TRUE;
+ }
break;
}
case MS_S_UNIQUE:
{
int k, count = 0;
msg_print(_("特別な強敵を召喚した!", "You summon a special opponent!"));
- for (k = 0;k < 1; k++)
+ for (k = 0; k < 1; k++)
+ {
if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_UNIQUE, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
{
count++;
if (!pet)
msg_print(_("召喚されたユニーク・モンスターは怒っている!", "Summoned special opponents are angry!"));
}
- for (k = count;k < 1; k++)
+ }
+
+ for (k = count; k < 1; k++)
+ {
if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
{
count++;
if (!pet)
msg_print(_("召喚された上級アンデッドは怒っている!", "Summoned greater undeads are angry!"));
}
+ }
+
if (!count)
{
no_trump = TRUE;
}
+
break;
}
default:
msg_print("hoge?");
}
+
if (no_trump)
{
msg_print(_("何も現れなかった。", "No one have appeared."));
/*!
* @brief RF6_WORLDの処理。時を止める。 /
+* @param target_ptr プレーヤーへの参照ポインタ
* @param m_idx 呪文を唱えるモンスターID
*/
-HIT_POINT spell_RF6_WORLD(MONSTER_IDX m_idx)
+HIT_POINT spell_RF6_WORLD(player_type *target_ptr, MONSTER_IDX m_idx)
{
- monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
MONSTER_IDX who = 0;
GAME_TEXT m_name[MAX_NLEN];
monster_name(m_idx, m_name);
- disturb(p_ptr, TRUE, TRUE);
+ disturb(target_ptr, TRUE, TRUE);
if (m_ptr->r_idx == MON_DIO) who = 1;
else if (m_ptr->r_idx == MON_WONG) who = 3;
- if (!set_monster_timewalk(randint1(2) + 2, who, TRUE)) return (FALSE);
+ if (!set_monster_timewalk(target_ptr, randint1(2) + 2, who, TRUE)) return (FALSE);
return who;
}
/*!
* @brief RF6_DARKNESSの処理。暗闇or閃光。 /
+* @param target_type プレーヤーへの参照ポインタ
* @param y 対象の地点のy座標
* @param x 対象の地点のx座標
* @param m_idx 呪文を唱えるモンスターID
* @param t_idx 呪文を受けるモンスターID。プレイヤーの場合はdummyで0とする。
* @param TARGET_TYPE プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER
*/
-void spell_RF6_DARKNESS(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
+void spell_RF6_DARKNESS(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
- monster_type *t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
+ monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
+ monster_type *t_ptr = &target_ptr->current_floor_ptr->m_list[t_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
bool can_use_lite_area = FALSE;
bool monster_to_monster = TARGET_TYPE == MONSTER_TO_MONSTER;
GAME_TEXT t_name[MAX_NLEN];
monster_name(t_idx, t_name);
- if ((p_ptr->pclass == CLASS_NINJA) &&
+ if ((target_ptr->pclass == CLASS_NINJA) &&
!(r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) &&
!(r_ptr->flags7 & RF7_DARK_MASK))
can_use_lite_area = TRUE;
{
if (can_use_lite_area)
{
- (void)lite_area(0, 3);
+ (void)lite_area(target_ptr, 0, 3);
}
else
{
learn_spell(MS_DARKNESS);
- (void)unlite_area(0, 3);
+ (void)unlite_area(target_ptr, 0, 3);
}
+
+ return;
+ }
+
+ if (!monster_to_monster) return;
+
+ if (can_use_lite_area)
+ {
+ (void)project(target_ptr, m_idx, 3, y, x, 0, GF_LITE_WEAK, PROJECT_GRID | PROJECT_KILL, -1);
+ lite_room(target_ptr, y, x);
}
- else if(monster_to_monster)
+ else
{
- if (can_use_lite_area)
- {
- (void)project(p_ptr, m_idx, 3, y, x, 0, GF_LITE_WEAK, PROJECT_GRID | PROJECT_KILL, -1);
- lite_room(y, x);
- }
- else
- {
- (void)project(p_ptr, m_idx, 3, y, x, 0, GF_DARK_WEAK, PROJECT_GRID | PROJECT_KILL, MS_DARKNESS);
- unlite_room(y, x);
- }
+ (void)project(target_ptr, m_idx, 3, y, x, 0, GF_DARK_WEAK, PROJECT_GRID | PROJECT_KILL, MS_DARKNESS);
+ unlite_room(target_ptr, y, x);
}
}
case RF6_SPELL_START + 3: spell_RF6_INVULNER(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_INVULNER */
case RF6_SPELL_START + 4: spell_RF6_BLINK(m_idx, MONSTER_TO_PLAYER); break; /* RF6_BLINK */
case RF6_SPELL_START + 5: spell_RF6_TPORT(m_idx, MONSTER_TO_PLAYER); break; /* RF6_TPORT */
- case RF6_SPELL_START + 6: return spell_RF6_WORLD(m_idx); break; /* RF6_WORLD */
+ case RF6_SPELL_START + 6: return spell_RF6_WORLD(target_ptr, m_idx); break; /* RF6_WORLD */
case RF6_SPELL_START + 7: return spell_RF6_SPECIAL(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF6_SPECIAL */
case RF6_SPELL_START + 8: spell_RF6_TELE_TO(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_TELE_TO */
case RF6_SPELL_START + 9: spell_RF6_TELE_AWAY(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_TELE_AWAY */
case RF6_SPELL_START + 10: spell_RF6_TELE_LEVEL(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_TELE_LEVEL */
case RF6_SPELL_START + 11: spell_RF6_PSY_SPEAR(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_PSY_SPEAR */
- case RF6_SPELL_START + 12: spell_RF6_DARKNESS(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_DARKNESS */
+ case RF6_SPELL_START + 12: spell_RF6_DARKNESS(target_ptr, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_DARKNESS */
case RF6_SPELL_START + 13: spell_RF6_TRAPS(y, x, m_idx); break; /* RF6_TRAPS */
case RF6_SPELL_START + 14: spell_RF6_FORGET(m_idx); break; /* RF6_FORGET */
case RF6_SPELL_START + 15: spell_RF6_RAISE_DEAD(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_RAISE_DEAD */
}
/*!
+* todo モンスターからモンスターへの呪文なのにplayer_typeが引数になり得るのは間違っている……
* @brief モンスターからモンスターへの呪文の振り分け関数。 /
+* @param target_ptr プレーヤーへの参照ポインタ
* @param SPELL_NUM モンスター魔法ID
* @param y 対象の地点のy座標
* @param x 対象の地点のx座標
* @param t_idx 呪文を受けるモンスターID。プレイヤーの場合はdummyで0とする。
* @return 攻撃呪文のダメージ、または召喚したモンスターの数を返す。その他の場合0。以降の処理を中断するなら-1を返す。
*/
-HIT_POINT monspell_to_monster(int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx)
+HIT_POINT monspell_to_monster(player_type *target_ptr, int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx)
{
switch (SPELL_NUM)
{
case RF6_SPELL_START + 9: spell_RF6_TELE_AWAY(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_TELE_AWAY */
case RF6_SPELL_START + 10: spell_RF6_TELE_LEVEL(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_TELE_LEVEL */
case RF6_SPELL_START + 11: return spell_RF6_PSY_SPEAR(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_PSY_SPEAR */
- case RF6_SPELL_START + 12: spell_RF6_DARKNESS(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_DARKNESS */
+ case RF6_SPELL_START + 12: spell_RF6_DARKNESS(target_ptr, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_DARKNESS */
case RF6_SPELL_START + 13: return -1; /* RF6_TRAPS */
case RF6_SPELL_START + 14: return -1; /* RF6_FORGET */
case RF6_SPELL_START + 15: spell_RF6_RAISE_DEAD(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_RAISE_DEAD */
break;
case MUT1_ILLUMINE:
- (void)lite_area(damroll(2, (lvl / 2)), (lvl / 10) + 1);
+ (void)lite_area(creature_ptr, damroll(2, (lvl / 2)), (lvl / 10) + 1);
break;
case MUT1_DET_CURSE:
if (cast)
{
- lite_area(damroll(dice, sides), rad);
+ lite_area(caster_ptr, damroll(dice, sides), rad);
}
}
break;
/*!
* @brief カオス領域魔法の各処理を行う
+* @param caster_ptr プレーヤーへの参照ポインタ
* @param spell 魔法ID
* @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
* @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
if (cast)
{
- lite_area(damroll(dice, sides), rad);
+ lite_area(caster_ptr, damroll(dice, sides), rad);
}
}
break;
if (cast)
{
- lite_area(damroll(dice, sides), rad);
+ lite_area(caster_ptr, damroll(dice, sides), rad);
}
}
break;
if (cast)
{
- lite_area(damroll(dice, sides), rad);
+ lite_area(caster_ptr, damroll(dice, sides), rad);
if ((PRACE_IS_(caster_ptr, RACE_VAMPIRE) || (caster_ptr->mimic_form == MIMIC_VAMPIRE)) && !caster_ptr->resist_lite)
{
caster_ptr->redraw |= (PR_STATUS);
}
+
/*!
* @brief 歌の各処理を行う
* @param caster_ptr プレーヤーへの参照ポインタ
if (cast)
{
msg_print(_("光り輝く歌が辺りを照らした。", "Your uplifting song brings brightness to dark places..."));
- lite_area(damroll(dice, sides), rad);
+ lite_area(caster_ptr, damroll(dice, sides), rad);
}
}
break;
if (cast)
{
- lite_area(damroll(dice, sides), rad);
+ lite_area(caster_ptr, damroll(dice, sides), rad);
}
}
break;
chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
- wiz_lite(p_ptr, FALSE);
+ wiz_lite(caster_ptr, FALSE);
if (!caster_ptr->telepathy)
{
extern bool unleash_mana_storm(player_type *creature_ptr, bool powerful);
extern bool crusade(player_type *caster_ptr);
extern bool turn_undead(player_type *caster_ptr);
-extern void lite_room(POSITION y1, POSITION x1);
+extern void lite_room(player_type *caster_ptr, POSITION y1, POSITION x1);
extern bool starlight(bool magic);
-extern void unlite_room(POSITION y1, POSITION x1);
-extern bool lite_area(HIT_POINT dam, POSITION rad);
-extern bool unlite_area(HIT_POINT dam, POSITION rad);
+extern void unlite_room(player_type *caster_ptr, POSITION y1, POSITION x1);
+extern bool lite_area(player_type *caster_ptr, HIT_POINT dam, POSITION rad);
+extern bool unlite_area(player_type *caster_ptr, HIT_POINT dam, POSITION rad);
extern bool fire_ball(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad);
extern bool fire_breath(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad);
extern bool fire_rocket(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad);
/*!
+ * todo この辺、xとyが引数になっているが、caster_ptr->xとcaster_ptr->yで全て置き換えが効くはず……
* @brief 部屋全体を照らすサブルーチン
* @param caster_ptr プレーヤーへの参照ポインタ
* @return なし
* STUPID monsters wake up 1/10 the time when illuminated
* </pre>
*/
-static void cave_temp_room_lite(void)
+static void cave_temp_room_lite(player_type *caster_ptr)
{
int i;
POSITION y = tmp_pos.y[i];
POSITION x = tmp_pos.x[i];
- grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
/* No longer in the array */
g_ptr->info &= ~(CAVE_TEMP);
if (g_ptr->m_idx)
{
PERCENTAGE chance = 25;
- monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- update_monster(p_ptr, g_ptr->m_idx, FALSE);
+ update_monster(caster_ptr, g_ptr->m_idx, FALSE);
/* Stupid monsters rarely wake up */
if (r_ptr->flags2 & (RF2_STUPID)) chance = 10;
note_spot(y, x);
lite_spot(y, x);
- update_local_illumination(p_ptr, y, x);
+ update_local_illumination(caster_ptr, y, x);
}
- /* None left */
tmp_pos.n = 0;
}
/*!
+ * todo この辺、xとyが引数になっているが、caster_ptr->xとcaster_ptr->yで全て置き換えが効くはず……
* @brief 部屋全体を暗くするサブルーチン
* @param caster_ptr プレーヤーへの参照ポインタ
* @return なし
* Also, process all affected monsters
* </pre>
*/
-static void cave_temp_room_unlite(void)
+static void cave_temp_room_unlite(player_type *caster_ptr)
{
int i;
POSITION x = tmp_pos.x[i];
int j;
- grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
bool do_dark = !is_mirror_grid(g_ptr);
/* No longer in the array */
/* Darken the grid */
if (do_dark)
{
- if (p_ptr->current_floor_ptr->dun_level || !is_daytime())
+ if (caster_ptr->current_floor_ptr->dun_level || !is_daytime())
{
for (j = 0; j < 9; j++)
{
POSITION by = y + ddy_ddd[j];
POSITION bx = x + ddx_ddd[j];
- if (in_bounds2(p_ptr->current_floor_ptr, by, bx))
+ if (in_bounds2(caster_ptr->current_floor_ptr, by, bx))
{
- grid_type *cc_ptr = &p_ptr->current_floor_ptr->grid_array[by][bx];
+ grid_type *cc_ptr = &caster_ptr->current_floor_ptr->grid_array[by][bx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
/* Process affected monsters */
if (g_ptr->m_idx)
{
- update_monster(p_ptr, g_ptr->m_idx, FALSE);
+ update_monster(caster_ptr, g_ptr->m_idx, FALSE);
}
lite_spot(y, x);
- update_local_illumination(p_ptr, y, x);
+ update_local_illumination(caster_ptr, y, x);
}
}
- /* None left */
tmp_pos.n = 0;
}
* @param x1 指定X座標
* @return なし
*/
-void lite_room(POSITION y1, POSITION x1)
+void lite_room(player_type *caster_ptr, POSITION y1, POSITION x1)
{
int i;
POSITION x, y;
}
/* Now, lite them all up at once */
- cave_temp_room_lite();
+ cave_temp_room_lite(caster_ptr);
- if (p_ptr->special_defense & NINJA_S_STEALTH)
+ if (caster_ptr->special_defense & NINJA_S_STEALTH)
{
- if (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
+ if (caster_ptr->current_floor_ptr->grid_array[caster_ptr->y][caster_ptr->x].info & CAVE_GLOW) set_superstealth(caster_ptr, FALSE);
}
}
* @param x1 指定X座標
* @return なし
*/
-void unlite_room(POSITION y1, POSITION x1)
+void unlite_room(player_type *caster_ptr, POSITION y1, POSITION x1)
{
int i;
POSITION x, y;
}
/* Now, darken them all at once */
- cave_temp_room_unlite();
+ cave_temp_room_unlite(caster_ptr);
}
* @param rad 効果半径
* @return 作用が実際にあった場合TRUEを返す
*/
-bool lite_area(HIT_POINT dam, POSITION rad)
+bool lite_area(player_type *caster_ptr, HIT_POINT dam, POSITION rad)
{
BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
- if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
+ if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
{
msg_print(_("ダンジョンが光を吸収した。", "The darkness of this dungeon absorb your light."));
return FALSE;
}
- if (!p_ptr->blind)
+ if (!caster_ptr->blind)
{
msg_print(_("白い光が辺りを覆った。", "You are surrounded by a white light."));
}
/* Hook into the "project()" function */
- (void)project(p_ptr, 0, rad, p_ptr->y, p_ptr->x, dam, GF_LITE_WEAK, flg, -1);
+ (void)project(caster_ptr, 0, rad, caster_ptr->y, caster_ptr->x, dam, GF_LITE_WEAK, flg, -1);
- lite_room(p_ptr->y, p_ptr->x);
+ lite_room(caster_ptr, caster_ptr->y, caster_ptr->x);
/* Assume seen */
return (TRUE);
* @param rad 効果半径
* @return 作用が実際にあった場合TRUEを返す
*/
-bool unlite_area(HIT_POINT dam, POSITION rad)
+bool unlite_area(player_type *caster_ptr, HIT_POINT dam, POSITION rad)
{
BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
- if (!p_ptr->blind)
+ if (!caster_ptr->blind)
{
msg_print(_("暗闇が辺りを覆った。", "Darkness surrounds you."));
}
/* Hook into the "project()" function */
- (void)project(p_ptr, 0, rad, p_ptr->y, p_ptr->x, dam, GF_DARK_WEAK, flg, -1);
+ (void)project(caster_ptr, 0, rad, caster_ptr->y, caster_ptr->x, dam, GF_DARK_WEAK, flg, -1);
- unlite_room(p_ptr->y, p_ptr->x);
+ unlite_room(caster_ptr, caster_ptr->y, caster_ptr->x);
/* Assume seen */
return (TRUE);
case 9:
case 10:
case 11:
- unlite_area(10, 3);
+ unlite_area(caster_ptr, 10, 3);
break;
case 12:
case 13:
case 14:
- lite_area(damroll(2, 3), 2);
+ lite_area(caster_ptr, damroll(2, 3), 2);
break;
case 15:
destroy_doors_touch();
else if (die < 33)
{
msg_print(_("《月》だ。", "It's the Moon."));
- unlite_area(10, 3);
+ unlite_area(caster_ptr, 10, 3);
}
else if (die < 38)
{