3 * @brief モンスター魔法の実装(対モンスター処理) / Monster spells (attack monster)
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
7 * This software may be copied and distributed for educational, research,\n
8 * and not for profit purposes provided that this copyright and statement\n
9 * are included in all such copies. Other copyrights may also apply.\n
10 * 2014 Deskull rearranged comment for Doxygen.\n
21 #include "realm-hex.h"
22 #include "player-move.h"
23 #include "player-class.h"
25 #include "monster-status.h"
26 #include "monster-spell.h"
30 #include "view-mainwindow.h"
33 * @brief モンスターが敵対モンスターにビームを当てること可能かを判定する /
34 * Determine if a beam spell will hit the target.
35 * @param target_ptr プレーヤーへの参照ポインタ
40 * @param m_ptr 使用するモンスターの構造体参照ポインタ
41 * @return ビームが到達可能ならばTRUEを返す
43 static bool direct_beam(player_type *target_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, monster_type *m_ptr)
45 /* Check the projection path */
46 floor_type *floor_ptr = target_ptr->current_floor_ptr;
48 int grid_n = project_path(target_ptr, grid_g, MAX_RANGE, y1, x1, y2, x2, PROJECT_THRU);
50 /* No grid is ever projectable from itself */
51 if (!grid_n) return FALSE;
55 bool is_friend = is_pet(m_ptr);
56 for (int i = 0; i < grid_n; i++)
58 y = GRID_Y(grid_g[i]);
59 x = GRID_X(grid_g[i]);
61 if (y == y2 && x == x2)
63 else if (is_friend && floor_ptr->grid_array[y][x].m_idx > 0 &&
64 !are_enemies(target_ptr, m_ptr, &floor_ptr->m_list[floor_ptr->grid_array[y][x].m_idx]))
66 /* Friends don't shoot friends */
70 if (is_friend && player_bold(target_ptr, y, x))
74 if (!hit2) return FALSE;
80 * @brief モンスターが敵対モンスターに直接ブレスを当てることが可能かを判定する /
81 * Determine if a breath will hit the target.
88 * @param is_friend TRUEならば、プレイヤーを巻き込む時にブレスの判定をFALSEにする。
89 * @return ブレスを直接当てられるならばTRUEを返す
91 static bool breath_direct(player_type *master_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, POSITION rad, EFFECT_ID typ, bool is_friend)
100 case GF_DISINTEGRATE:
108 /* Check the projection path */
110 int grid_n = project_path(master_ptr, grid_g, MAX_RANGE, y1, x1, y2, x2, flg);
112 /* Project along the path */
116 for (i = 0; i < grid_n; ++i)
118 int ny = GRID_Y(grid_g[i]);
119 int nx = GRID_X(grid_g[i]);
121 if (flg & PROJECT_DISI)
123 /* Hack -- Balls explode before reaching walls */
124 if (cave_stop_disintegration(master_ptr->current_floor_ptr, ny, nx)) break;
126 else if (flg & PROJECT_LOS)
128 /* Hack -- Balls explode before reaching walls */
129 if (!cave_los_bold(master_ptr->current_floor_ptr, ny, nx)) break;
133 /* Hack -- Balls explode before reaching walls */
134 if (!cave_have_flag_bold(master_ptr->current_floor_ptr, ny, nx, FF_PROJECT)) break;
137 /* Save the "blast epicenter" */
148 if (flg & PROJECT_DISI)
150 if (in_disintegration_range(master_ptr->current_floor_ptr, y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
151 if (in_disintegration_range(master_ptr->current_floor_ptr, y1, x1, master_ptr->y, master_ptr->x) && (distance(y1, x1, master_ptr->y, master_ptr->x) <= rad)) hityou = TRUE;
153 else if (flg & PROJECT_LOS)
155 if (los(master_ptr, y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
156 if (los(master_ptr, y1, x1, master_ptr->y, master_ptr->x) && (distance(y1, x1, master_ptr->y, master_ptr->x) <= rad)) hityou = TRUE;
160 if (projectable(master_ptr, y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
161 if (projectable(master_ptr, y1, x1, master_ptr->y, master_ptr->x) && (distance(y1, x1, master_ptr->y, master_ptr->x) <= rad)) hityou = TRUE;
167 POSITION gx[1024], gy[1024];
169 POSITION gm_rad = rad;
170 breath_shape(master_ptr, grid_g, grid_n, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, y, x, typ);
172 for (i = 0; i < grids; i++)
176 if ((y == y2) && (x == x2)) hit2 = TRUE;
177 if (player_bold(master_ptr, y, x)) hityou = TRUE;
181 if (!hit2) return FALSE;
182 if (is_friend && hityou) return FALSE;
189 * @brief モンスターが特殊能力の目標地点を決める処理 /
190 * Get the actual center point of ball spells (rad > 1) (originally from TOband)
191 * @param target_ptr プレーヤーへの参照ポインタ
194 * @param ty 目標Y座標を返す参照ポインタ
195 * @param tx 目標X座標を返す参照ポインタ
196 * @param flg 判定のフラグ配列
199 void get_project_point(player_type *target_ptr, POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg)
202 int path_n = project_path(target_ptr, path_g, MAX_RANGE, sy, sx, *ty, *tx, flg);
207 /* Project along the path */
208 for (int i = 0; i < path_n; i++)
210 sy = GRID_Y(path_g[i]);
211 sx = GRID_X(path_g[i]);
213 /* Hack -- Balls explode before reaching walls */
214 if (!cave_have_flag_bold(target_ptr->current_floor_ptr, sy, sx, FF_PROJECT)) break;
223 * @brief モンスターが敵モンスターに魔力消去を使うかどうかを返す /
224 * Check should monster cast dispel spell at other monster.
225 * @param target_ptr プレーヤーへの参照ポインタ
226 * @param m_idx 術者のモンスターID
227 * @param t_idx 目標のモンスターID
228 * @return 魔力消去を使うべきならばTRUEを変えす。
230 static bool dispel_check_monster(player_type *target_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx)
232 monster_type *t_ptr = &target_ptr->current_floor_ptr->m_list[t_idx];
233 if (MON_INVULNER(t_ptr)) return TRUE;
235 if ((t_ptr->mspeed < 135) && MON_FAST(t_ptr)) return TRUE;
238 if ((t_idx == target_ptr->riding) && dispel_check(target_ptr, m_idx)) return TRUE;
240 /* No need to cast dispel spell */
246 * todo モンスターからモンスターへの呪文なのにplayer_typeが引数になり得るのは間違っている……
247 * @brief モンスターが敵モンスターに特殊能力を使う処理のメインルーチン /
248 * Monster tries to 'cast a spell' (or breath, etc) at another monster.
249 * @param target_ptr プレーヤーへの参照ポインタ
250 * @param m_idx 術者のモンスターID
251 * @return 実際に特殊能力を使った場合TRUEを返す
253 * The player is only disturbed if able to be affected by the spell.
255 bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx)
257 POSITION y = 0, x = 0;
259 MONSTER_IDX target_idx = 0;
265 byte spell[96], num = 0;
267 GAME_TEXT m_name[160];
268 GAME_TEXT t_name[160];
276 floor_type *floor_ptr = target_ptr->current_floor_ptr;
277 monster_type *m_ptr = &floor_ptr->m_list[m_idx];
278 monster_type *t_ptr = NULL;
280 monster_race *r_ptr = &r_info[m_ptr->r_idx];
282 bool see_m = is_seen(m_ptr);
283 bool maneable = player_has_los_bold(target_ptr, m_ptr->fy, m_ptr->fx);
284 bool pet = is_pet(m_ptr);
286 bool in_no_magic_dungeon = (d_info[target_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && floor_ptr->dun_level
287 && (!floor_ptr->inside_quest || is_fixed_quest_idx(floor_ptr->inside_quest));
289 bool can_use_lite_area = FALSE;
292 /* Cannot cast spells when confused */
293 if (MON_CONFUSED(m_ptr)) return FALSE;
295 /* Extract the racial spell flags */
296 BIT_FLAGS f4 = r_ptr->flags4;
297 BIT_FLAGS f5 = r_ptr->a_ability_flags1;
298 BIT_FLAGS f6 = r_ptr->a_ability_flags2;
300 /* Target is given for pet? */
301 if (target_ptr->pet_t_m_idx && pet)
303 target_idx = target_ptr->pet_t_m_idx;
304 t_ptr = &floor_ptr->m_list[target_idx];
306 /* Cancel if not projectable (for now) */
307 if ((m_idx == target_idx) || !projectable(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
313 /* Is there counter attack target? */
314 if (!target_idx && m_ptr->target_y)
316 target_idx = floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
320 t_ptr = &floor_ptr->m_list[target_idx];
322 /* Cancel if neither enemy nor a given target */
323 if ((m_idx == target_idx) ||
324 ((target_idx != target_ptr->pet_t_m_idx) && !are_enemies(target_ptr, m_ptr, t_ptr)))
329 /* Allow only summoning etc.. if not projectable */
330 else if (!projectable(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
332 f4 &= (RF4_INDIRECT_MASK);
333 f5 &= (RF5_INDIRECT_MASK);
334 f6 &= (RF6_INDIRECT_MASK);
339 /* Look for enemies normally */
342 bool success = FALSE;
344 if (target_ptr->phase_out)
346 start = randint1(floor_ptr->m_max - 1) + floor_ptr->m_max;
347 if (randint0(2)) plus = -1;
349 else start = floor_ptr->m_max + 1;
351 /* Scan thru all monsters */
352 for (int i = start; ((i < start + floor_ptr->m_max) && (i > start - floor_ptr->m_max)); i += plus)
354 MONSTER_IDX dummy = (i % floor_ptr->m_max);
355 if (!dummy) continue;
358 t_ptr = &floor_ptr->m_list[target_idx];
360 if (!monster_is_valid(t_ptr)) continue;
362 /* Monster must be 'an enemy' */
363 if ((m_idx == target_idx) || !are_enemies(target_ptr, m_ptr, t_ptr)) continue;
365 /* Monster must be projectable */
366 if (!projectable(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
374 if (!success) return FALSE;
377 /* OK -- we've got a target */
381 /* Forget old counter attack target */
384 /* Remove unimplemented spells */
385 f6 &= ~(RF6_WORLD | RF6_TRAPS | RF6_FORGET);
387 if (f4 & RF4_BR_LITE)
389 if (!los(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
390 f4 &= ~(RF4_BR_LITE);
393 /* Remove unimplemented special moves */
394 if (f6 & RF6_SPECIAL)
396 if ((m_ptr->r_idx != MON_ROLENTO) && (r_ptr->d_char != 'B'))
397 f6 &= ~(RF6_SPECIAL);
400 if (f6 & RF6_DARKNESS)
402 bool vs_ninja = (target_ptr->pclass == CLASS_NINJA) && !is_hostile(t_ptr);
405 !(r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) &&
406 !(r_ptr->flags7 & RF7_DARK_MASK))
407 can_use_lite_area = TRUE;
409 if (!(r_ptr->flags2 & RF2_STUPID))
411 if (d_info[target_ptr->dungeon_idx].flags1 & DF1_DARKNESS) f6 &= ~(RF6_DARKNESS);
412 else if (vs_ninja && !can_use_lite_area) f6 &= ~(RF6_DARKNESS);
416 if (in_no_magic_dungeon && !(r_ptr->flags2 & RF2_STUPID))
418 f4 &= (RF4_NOMAGIC_MASK);
419 f5 &= (RF5_NOMAGIC_MASK);
420 f6 &= (RF6_NOMAGIC_MASK);
423 if (floor_ptr->inside_arena || target_ptr->phase_out)
425 f4 &= ~(RF4_SUMMON_MASK);
426 f5 &= ~(RF5_SUMMON_MASK);
427 f6 &= ~(RF6_SUMMON_MASK | RF6_TELE_LEVEL);
429 if (m_ptr->r_idx == MON_ROLENTO) f6 &= ~(RF6_SPECIAL);
432 if (target_ptr->phase_out && !one_in_(3))
437 if (m_idx == target_ptr->riding)
439 f4 &= ~(RF4_RIDING_MASK);
440 f5 &= ~(RF5_RIDING_MASK);
441 f6 &= ~(RF6_RIDING_MASK);
447 f6 &= ~(RF6_DARKNESS | RF6_TRAPS);
449 if (!(target_ptr->pet_extra_flags & PF_TELEPORT))
451 f6 &= ~(RF6_BLINK | RF6_TPORT | RF6_TELE_TO | RF6_TELE_AWAY | RF6_TELE_LEVEL);
454 if (!(target_ptr->pet_extra_flags & PF_ATTACK_SPELL))
456 f4 &= ~(RF4_ATTACK_MASK);
457 f5 &= ~(RF5_ATTACK_MASK);
458 f6 &= ~(RF6_ATTACK_MASK);
461 if (!(target_ptr->pet_extra_flags & PF_SUMMON_SPELL))
463 f4 &= ~(RF4_SUMMON_MASK);
464 f5 &= ~(RF5_SUMMON_MASK);
465 f6 &= ~(RF6_SUMMON_MASK);
468 /* Prevent collateral damage */
469 if (!(target_ptr->pet_extra_flags & PF_BALL_SPELL) && (m_idx != target_ptr->riding))
471 if ((f4 & (RF4_BALL_MASK & ~(RF4_ROCKET))) ||
472 (f5 & RF5_BALL_MASK) ||
473 (f6 & RF6_BALL_MASK))
478 get_project_point(target_ptr, m_ptr->fy, m_ptr->fx, &real_y, &real_x, 0L);
480 if (projectable(target_ptr, real_y, real_x, target_ptr->y, target_ptr->x))
482 int dist = distance(real_y, real_x, target_ptr->y, target_ptr->x);
486 f4 &= ~(RF4_BALL_MASK & ~(RF4_ROCKET));
487 f5 &= ~(RF5_BALL_MASK);
488 f6 &= ~(RF6_BALL_MASK);
492 f4 &= ~(RF4_BIG_BALL_MASK);
493 f5 &= ~(RF5_BIG_BALL_MASK);
494 f6 &= ~(RF6_BIG_BALL_MASK);
497 else if (f5 & RF5_BA_LITE)
499 if ((distance(real_y, real_x, target_ptr->y, target_ptr->x) <= 4) && los(target_ptr, real_y, real_x, target_ptr->y, target_ptr->x))
500 f5 &= ~(RF5_BA_LITE);
509 get_project_point(target_ptr, m_ptr->fy, m_ptr->fx, &real_y, &real_x, PROJECT_STOP);
510 if (projectable(target_ptr, real_y, real_x, target_ptr->y, target_ptr->x) && (distance(real_y, real_x, target_ptr->y, target_ptr->x) <= 2))
514 if (((f4 & RF4_BEAM_MASK) || (f5 & RF5_BEAM_MASK) || (f6 & RF6_BEAM_MASK)) &&
515 !direct_beam(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, m_ptr))
517 f4 &= ~(RF4_BEAM_MASK);
518 f5 &= ~(RF5_BEAM_MASK);
519 f6 &= ~(RF6_BEAM_MASK);
522 if ((f4 & RF4_BREATH_MASK) || (f5 & RF5_BREATH_MASK) || (f6 & RF6_BREATH_MASK))
524 /* Expected breath radius */
525 POSITION rad = (r_ptr->flags2 & RF2_POWERFUL) ? 3 : 2;
527 if (!breath_direct(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, 0, TRUE))
529 f4 &= ~(RF4_BREATH_MASK);
530 f5 &= ~(RF5_BREATH_MASK);
531 f6 &= ~(RF6_BREATH_MASK);
533 else if ((f4 & RF4_BR_LITE) &&
534 !breath_direct(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, GF_LITE, TRUE))
536 f4 &= ~(RF4_BR_LITE);
538 else if ((f4 & RF4_BR_DISI) &&
539 !breath_direct(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, GF_DISINTEGRATE, TRUE))
541 f4 &= ~(RF4_BR_DISI);
546 /* Special moves restriction */
547 if (f6 & RF6_SPECIAL)
549 if (m_ptr->r_idx == MON_ROLENTO)
551 if ((target_ptr->pet_extra_flags & (PF_ATTACK_SPELL | PF_SUMMON_SPELL)) != (PF_ATTACK_SPELL | PF_SUMMON_SPELL))
552 f6 &= ~(RF6_SPECIAL);
554 else if (r_ptr->d_char == 'B')
556 if ((target_ptr->pet_extra_flags & (PF_ATTACK_SPELL | PF_TELEPORT)) != (PF_ATTACK_SPELL | PF_TELEPORT))
557 f6 &= ~(RF6_SPECIAL);
559 else f6 &= ~(RF6_SPECIAL);
563 /* Remove some spells if necessary */
565 if (!(r_ptr->flags2 & RF2_STUPID))
567 /* Check for a clean bolt shot */
568 if (((f4 & RF4_BOLT_MASK) ||
569 (f5 & RF5_BOLT_MASK) ||
570 (f6 & RF6_BOLT_MASK)) &&
571 !clean_shot(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, pet))
573 f4 &= ~(RF4_BOLT_MASK);
574 f5 &= ~(RF5_BOLT_MASK);
575 f6 &= ~(RF6_BOLT_MASK);
578 /* Check for a possible summon */
579 if (((f4 & RF4_SUMMON_MASK) ||
580 (f5 & RF5_SUMMON_MASK) ||
581 (f6 & RF6_SUMMON_MASK)) &&
582 !(summon_possible(target_ptr, t_ptr->fy, t_ptr->fx)))
584 /* Remove summoning spells */
585 f4 &= ~(RF4_SUMMON_MASK);
586 f5 &= ~(RF5_SUMMON_MASK);
587 f6 &= ~(RF6_SUMMON_MASK);
591 if ((f4 & RF4_DISPEL) && !dispel_check_monster(target_ptr, m_idx, target_idx))
593 /* Remove dispel spell */
597 /* Check for a possible raise dead */
598 if ((f6 & RF6_RAISE_DEAD) && !raise_possible(target_ptr, m_ptr))
600 /* Remove raise dead spell */
601 f6 &= ~(RF6_RAISE_DEAD);
604 /* Special moves restriction */
605 if (f6 & RF6_SPECIAL)
607 if ((m_ptr->r_idx == MON_ROLENTO) && !summon_possible(target_ptr, t_ptr->fy, t_ptr->fx))
609 f6 &= ~(RF6_SPECIAL);
614 if (r_ptr->flags2 & RF2_SMART)
616 /* Hack -- allow "desperate" spells */
617 if ((m_ptr->hp < m_ptr->maxhp / 10) &&
618 (randint0(100) < 50))
620 /* Require intelligent spells */
621 f4 &= (RF4_INT_MASK);
622 f5 &= (RF5_INT_MASK);
623 f6 &= (RF6_INT_MASK);
626 /* Hack -- decline "teleport level" in some case */
627 if ((f6 & RF6_TELE_LEVEL) && is_teleport_level_ineffective(target_ptr, (target_idx == target_ptr->riding) ? 0 : target_idx))
629 f6 &= ~(RF6_TELE_LEVEL);
634 if (!f4 && !f5 && !f6) return FALSE;
636 /* Extract the "inate" spells */
637 for (k = 0; k < 32; k++)
639 if (f4 & (1L << k)) spell[num++] = k + RF4_SPELL_START;
642 /* Extract the "normal" spells */
643 for (k = 0; k < 32; k++)
645 if (f5 & (1L << k)) spell[num++] = k + RF5_SPELL_START;
648 /* Extract the "bizarre" spells */
649 for (k = 0; k < 32; k++)
651 if (f6 & (1L << k)) spell[num++] = k + RF6_SPELL_START;
655 if (!num) return FALSE;
657 /* Stop if player is dead or gone */
658 if (!target_ptr->playing || target_ptr->is_dead) return FALSE;
660 /* Handle "leaving" */
661 if (target_ptr->leaving) return FALSE;
663 /* Get the monster name (or "it") */
664 monster_desc(target_ptr, m_name, m_ptr, 0x00);
669 /* Get the monster possessive ("his"/"her"/"its") */
670 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
673 /* Get the target's name (or "it") */
674 monster_desc(target_ptr, t_name, t_ptr, 0x00);
676 /* Choose a spell to cast */
677 thrown_spell = spell[randint0(num)];
679 if (target_ptr->riding && (m_idx == target_ptr->riding)) disturb(target_ptr, TRUE, TRUE);
681 /* Check for spell failure (inate attacks never fail) */
682 if (!spell_is_inate(thrown_spell) && (in_no_magic_dungeon || (MON_STUNNED(m_ptr) && one_in_(2))))
684 disturb(target_ptr, TRUE, TRUE);
685 if (see_m) msg_format(_("%^sは呪文を唱えようとしたが失敗した。",
686 "%^s tries to cast a spell, but fails."), m_name);
691 /* Hex: Anti Magic Barrier */
692 if (!spell_is_inate(thrown_spell) && magic_barrier(target_ptr, m_idx))
694 if (see_m) msg_format(_("反魔法バリアが%^sの呪文をかき消した。",
695 "Anti magic barrier cancels the spell which %^s casts."), m_name);
699 can_remember = is_original_ap_and_seen(target_ptr, m_ptr);
701 dam = monspell_to_monster(target_ptr, thrown_spell, y, x, m_idx, target_idx);
702 if (dam < 0) return FALSE;
704 bool is_special_magic = m_ptr->ml;
705 is_special_magic &= maneable;
706 is_special_magic &= current_world_ptr->timewalk_m_idx == 0;
707 is_special_magic &= !target_ptr->blind;
708 is_special_magic &= target_ptr->pclass == CLASS_IMITATOR;
709 is_special_magic &= thrown_spell != 167; /* Not RF6_SPECIAL */
710 if (is_special_magic)
712 if (target_ptr->mane_num == MAX_MANE)
714 target_ptr->mane_num--;
715 for (int i = 0; i < target_ptr->mane_num - 1; i++)
717 target_ptr->mane_spell[i] = target_ptr->mane_spell[i + 1];
718 target_ptr->mane_dam[i] = target_ptr->mane_dam[i + 1];
722 target_ptr->mane_spell[target_ptr->mane_num] = thrown_spell - RF4_SPELL_START;
723 target_ptr->mane_dam[target_ptr->mane_num] = dam;
724 target_ptr->mane_num++;
725 target_ptr->new_mane = TRUE;
727 target_ptr->redraw |= PR_IMITATION;
730 /* Remember what the monster did, if we saw it */
734 if (thrown_spell < RF4_SPELL_START + RF4_SPELL_SIZE)
736 r_ptr->r_flags4 |= (1L << (thrown_spell - RF4_SPELL_START));
737 if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
741 else if (thrown_spell < RF5_SPELL_START + RF5_SPELL_SIZE)
743 r_ptr->r_flags5 |= (1L << (thrown_spell - RF5_SPELL_START));
744 if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
748 else if (thrown_spell < RF6_SPELL_START + RF6_SPELL_SIZE)
750 r_ptr->r_flags6 |= (1L << (thrown_spell - RF6_SPELL_START));
751 if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
755 /* Always take note of monsters that kill you */
756 if (target_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !floor_ptr->inside_arena)
758 r_ptr->r_deaths++; /* Ignore appearance difference */
761 /* A spell was cast */