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(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];
274 floor_type *floor_ptr = target_ptr->current_floor_ptr;
275 monster_type *m_ptr = &floor_ptr->m_list[m_idx];
276 monster_type *t_ptr = NULL;
278 monster_race *r_ptr = &r_info[m_ptr->r_idx];
280 bool see_m = is_seen(m_ptr);
281 bool maneable = player_has_los_bold(target_ptr, m_ptr->fy, m_ptr->fx);
282 bool pet = is_pet(m_ptr);
284 bool in_no_magic_dungeon = (d_info[target_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && floor_ptr->dun_level
285 && (!floor_ptr->inside_quest || is_fixed_quest_idx(floor_ptr->inside_quest));
287 bool can_use_lite_area = FALSE;
290 /* Cannot cast spells when confused */
291 if (MON_CONFUSED(m_ptr)) return FALSE;
293 /* Extract the racial spell flags */
294 BIT_FLAGS f4 = r_ptr->flags4;
295 BIT_FLAGS f5 = r_ptr->a_ability_flags1;
296 BIT_FLAGS f6 = r_ptr->a_ability_flags2;
298 /* Target is given for pet? */
299 if (target_ptr->pet_t_m_idx && pet)
301 target_idx = target_ptr->pet_t_m_idx;
302 t_ptr = &floor_ptr->m_list[target_idx];
304 /* Cancel if not projectable (for now) */
305 if ((m_idx == target_idx) || !projectable(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
311 /* Is there counter attack target? */
312 if (!target_idx && m_ptr->target_y)
314 target_idx = floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
318 t_ptr = &floor_ptr->m_list[target_idx];
320 /* Cancel if neither enemy nor a given target */
321 if ((m_idx == target_idx) ||
322 ((target_idx != target_ptr->pet_t_m_idx) && !are_enemies(m_ptr, t_ptr)))
327 /* Allow only summoning etc.. if not projectable */
328 else if (!projectable(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
330 f4 &= (RF4_INDIRECT_MASK);
331 f5 &= (RF5_INDIRECT_MASK);
332 f6 &= (RF6_INDIRECT_MASK);
337 /* Look for enemies normally */
340 bool success = FALSE;
342 if (target_ptr->phase_out)
344 start = randint1(floor_ptr->m_max-1) + floor_ptr->m_max;
345 if (randint0(2)) plus = -1;
347 else start = floor_ptr->m_max + 1;
349 /* Scan thru all monsters */
350 for (int i = start; ((i < start + floor_ptr->m_max) && (i > start - floor_ptr->m_max)); i += plus)
352 MONSTER_IDX dummy = (i % floor_ptr->m_max);
353 if (!dummy) continue;
356 t_ptr = &floor_ptr->m_list[target_idx];
358 if (!monster_is_valid(t_ptr)) continue;
360 /* Monster must be 'an enemy' */
361 if ((m_idx == target_idx) || !are_enemies(m_ptr, t_ptr)) continue;
363 /* Monster must be projectable */
364 if (!projectable(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
372 if (!success) return FALSE;
375 /* OK -- we've got a target */
379 /* Forget old counter attack target */
382 /* Remove unimplemented spells */
383 f6 &= ~(RF6_WORLD | RF6_TRAPS | RF6_FORGET);
385 if (f4 & RF4_BR_LITE)
387 if (!los(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
388 f4 &= ~(RF4_BR_LITE);
391 /* Remove unimplemented special moves */
392 if (f6 & RF6_SPECIAL)
394 if ((m_ptr->r_idx != MON_ROLENTO) && (r_ptr->d_char != 'B'))
395 f6 &= ~(RF6_SPECIAL);
398 if (f6 & RF6_DARKNESS)
400 bool vs_ninja = (target_ptr->pclass == CLASS_NINJA) && !is_hostile(t_ptr);
403 !(r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) &&
404 !(r_ptr->flags7 & RF7_DARK_MASK))
405 can_use_lite_area = TRUE;
407 if (!(r_ptr->flags2 & RF2_STUPID))
409 if (d_info[target_ptr->dungeon_idx].flags1 & DF1_DARKNESS) f6 &= ~(RF6_DARKNESS);
410 else if (vs_ninja && !can_use_lite_area) f6 &= ~(RF6_DARKNESS);
414 if (in_no_magic_dungeon && !(r_ptr->flags2 & RF2_STUPID))
416 f4 &= (RF4_NOMAGIC_MASK);
417 f5 &= (RF5_NOMAGIC_MASK);
418 f6 &= (RF6_NOMAGIC_MASK);
421 if (floor_ptr->inside_arena || target_ptr->phase_out)
423 f4 &= ~(RF4_SUMMON_MASK);
424 f5 &= ~(RF5_SUMMON_MASK);
425 f6 &= ~(RF6_SUMMON_MASK | RF6_TELE_LEVEL);
427 if (m_ptr->r_idx == MON_ROLENTO) f6 &= ~(RF6_SPECIAL);
430 if (target_ptr->phase_out && !one_in_(3))
435 if (m_idx == target_ptr->riding)
437 f4 &= ~(RF4_RIDING_MASK);
438 f5 &= ~(RF5_RIDING_MASK);
439 f6 &= ~(RF6_RIDING_MASK);
445 f6 &= ~(RF6_DARKNESS | RF6_TRAPS);
447 if (!(target_ptr->pet_extra_flags & PF_TELEPORT))
449 f6 &= ~(RF6_BLINK | RF6_TPORT | RF6_TELE_TO | RF6_TELE_AWAY | RF6_TELE_LEVEL);
452 if (!(target_ptr->pet_extra_flags & PF_ATTACK_SPELL))
454 f4 &= ~(RF4_ATTACK_MASK);
455 f5 &= ~(RF5_ATTACK_MASK);
456 f6 &= ~(RF6_ATTACK_MASK);
459 if (!(target_ptr->pet_extra_flags & PF_SUMMON_SPELL))
461 f4 &= ~(RF4_SUMMON_MASK);
462 f5 &= ~(RF5_SUMMON_MASK);
463 f6 &= ~(RF6_SUMMON_MASK);
466 /* Prevent collateral damage */
467 if (!(target_ptr->pet_extra_flags & PF_BALL_SPELL) && (m_idx != target_ptr->riding))
469 if ((f4 & (RF4_BALL_MASK & ~(RF4_ROCKET))) ||
470 (f5 & RF5_BALL_MASK) ||
471 (f6 & RF6_BALL_MASK))
476 get_project_point(target_ptr, m_ptr->fy, m_ptr->fx, &real_y, &real_x, 0L);
478 if (projectable(target_ptr, real_y, real_x, target_ptr->y, target_ptr->x))
480 int dist = distance(real_y, real_x, target_ptr->y, target_ptr->x);
484 f4 &= ~(RF4_BALL_MASK & ~(RF4_ROCKET));
485 f5 &= ~(RF5_BALL_MASK);
486 f6 &= ~(RF6_BALL_MASK);
490 f4 &= ~(RF4_BIG_BALL_MASK);
491 f5 &= ~(RF5_BIG_BALL_MASK);
492 f6 &= ~(RF6_BIG_BALL_MASK);
495 else if (f5 & RF5_BA_LITE)
497 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))
498 f5 &= ~(RF5_BA_LITE);
507 get_project_point(target_ptr, m_ptr->fy, m_ptr->fx, &real_y, &real_x, PROJECT_STOP);
508 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))
512 if (((f4 & RF4_BEAM_MASK) || (f5 & RF5_BEAM_MASK) || (f6 & RF6_BEAM_MASK)) &&
513 !direct_beam(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, m_ptr))
515 f4 &= ~(RF4_BEAM_MASK);
516 f5 &= ~(RF5_BEAM_MASK);
517 f6 &= ~(RF6_BEAM_MASK);
520 if ((f4 & RF4_BREATH_MASK) || (f5 & RF5_BREATH_MASK) || (f6 & RF6_BREATH_MASK))
522 /* Expected breath radius */
523 POSITION rad = (r_ptr->flags2 & RF2_POWERFUL) ? 3 : 2;
525 if (!breath_direct(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, 0, TRUE))
527 f4 &= ~(RF4_BREATH_MASK);
528 f5 &= ~(RF5_BREATH_MASK);
529 f6 &= ~(RF6_BREATH_MASK);
531 else if ((f4 & RF4_BR_LITE) &&
532 !breath_direct(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, GF_LITE, TRUE))
534 f4 &= ~(RF4_BR_LITE);
536 else if ((f4 & RF4_BR_DISI) &&
537 !breath_direct(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, GF_DISINTEGRATE, TRUE))
539 f4 &= ~(RF4_BR_DISI);
544 /* Special moves restriction */
545 if (f6 & RF6_SPECIAL)
547 if (m_ptr->r_idx == MON_ROLENTO)
549 if ((target_ptr->pet_extra_flags & (PF_ATTACK_SPELL | PF_SUMMON_SPELL)) != (PF_ATTACK_SPELL | PF_SUMMON_SPELL))
550 f6 &= ~(RF6_SPECIAL);
552 else if (r_ptr->d_char == 'B')
554 if ((target_ptr->pet_extra_flags & (PF_ATTACK_SPELL | PF_TELEPORT)) != (PF_ATTACK_SPELL | PF_TELEPORT))
555 f6 &= ~(RF6_SPECIAL);
557 else f6 &= ~(RF6_SPECIAL);
561 /* Remove some spells if necessary */
563 if (!(r_ptr->flags2 & RF2_STUPID))
565 /* Check for a clean bolt shot */
566 if (((f4 & RF4_BOLT_MASK) ||
567 (f5 & RF5_BOLT_MASK) ||
568 (f6 & RF6_BOLT_MASK)) &&
569 !clean_shot(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, pet))
571 f4 &= ~(RF4_BOLT_MASK);
572 f5 &= ~(RF5_BOLT_MASK);
573 f6 &= ~(RF6_BOLT_MASK);
576 /* Check for a possible summon */
577 if (((f4 & RF4_SUMMON_MASK) ||
578 (f5 & RF5_SUMMON_MASK) ||
579 (f6 & RF6_SUMMON_MASK)) &&
580 !(summon_possible(target_ptr, t_ptr->fy, t_ptr->fx)))
582 /* Remove summoning spells */
583 f4 &= ~(RF4_SUMMON_MASK);
584 f5 &= ~(RF5_SUMMON_MASK);
585 f6 &= ~(RF6_SUMMON_MASK);
589 if ((f4 & RF4_DISPEL) && !dispel_check_monster(target_ptr, m_idx, target_idx))
591 /* Remove dispel spell */
595 /* Check for a possible raise dead */
596 if ((f6 & RF6_RAISE_DEAD) && !raise_possible(target_ptr, m_ptr))
598 /* Remove raise dead spell */
599 f6 &= ~(RF6_RAISE_DEAD);
602 /* Special moves restriction */
603 if (f6 & RF6_SPECIAL)
605 if ((m_ptr->r_idx == MON_ROLENTO) && !summon_possible(target_ptr, t_ptr->fy, t_ptr->fx))
607 f6 &= ~(RF6_SPECIAL);
612 if (r_ptr->flags2 & RF2_SMART)
614 /* Hack -- allow "desperate" spells */
615 if ((m_ptr->hp < m_ptr->maxhp / 10) &&
616 (randint0(100) < 50))
618 /* Require intelligent spells */
619 f4 &= (RF4_INT_MASK);
620 f5 &= (RF5_INT_MASK);
621 f6 &= (RF6_INT_MASK);
624 /* Hack -- decline "teleport level" in some case */
625 if ((f6 & RF6_TELE_LEVEL) && is_teleport_level_ineffective(target_ptr, (target_idx == target_ptr->riding) ? 0 : target_idx))
627 f6 &= ~(RF6_TELE_LEVEL);
632 if (!f4 && !f5 && !f6) return FALSE;
634 /* Extract the "inate" spells */
635 for (k = 0; k < 32; k++)
637 if (f4 & (1L << k)) spell[num++] = k + RF4_SPELL_START;
640 /* Extract the "normal" spells */
641 for (k = 0; k < 32; k++)
643 if (f5 & (1L << k)) spell[num++] = k + RF5_SPELL_START;
646 /* Extract the "bizarre" spells */
647 for (k = 0; k < 32; k++)
649 if (f6 & (1L << k)) spell[num++] = k + RF6_SPELL_START;
653 if (!num) return FALSE;
655 /* Stop if player is dead or gone */
656 if (!target_ptr->playing || target_ptr->is_dead) return FALSE;
658 /* Handle "leaving" */
659 if (target_ptr->leaving) return FALSE;
661 /* Get the monster name (or "it") */
662 monster_desc(m_name, m_ptr, 0x00);
665 /* Get the monster possessive ("his"/"her"/"its") */
666 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
669 /* Get the target's name (or "it") */
670 monster_desc(t_name, t_ptr, 0x00);
672 /* Choose a spell to cast */
673 thrown_spell = spell[randint0(num)];
675 if (target_ptr->riding && (m_idx == target_ptr->riding)) disturb(target_ptr, TRUE, TRUE);
677 /* Check for spell failure (inate attacks never fail) */
678 if (!spell_is_inate(thrown_spell) && (in_no_magic_dungeon || (MON_STUNNED(m_ptr) && one_in_(2))))
680 disturb(target_ptr, TRUE, TRUE);
681 if (see_m) msg_format(_("%^sは呪文を唱えようとしたが失敗した。",
682 "%^s tries to cast a spell, but fails."), m_name);
687 /* Hex: Anti Magic Barrier */
688 if (!spell_is_inate(thrown_spell) && magic_barrier(target_ptr, m_idx))
690 if (see_m) msg_format(_("反魔法バリアが%^sの呪文をかき消した。",
691 "Anti magic barrier cancels the spell which %^s casts."), m_name);
695 can_remember = is_original_ap_and_seen(m_ptr);
697 dam = monspell_to_monster(target_ptr, thrown_spell, y, x, m_idx, target_idx);
698 if (dam < 0) return FALSE;
700 bool is_special_magic = m_ptr->ml;
701 is_special_magic &= maneable;
702 is_special_magic &= current_world_ptr->timewalk_m_idx == 0;
703 is_special_magic &= !target_ptr->blind;
704 is_special_magic &= target_ptr->pclass == CLASS_IMITATOR;
705 is_special_magic &= thrown_spell != 167; /* Not RF6_SPECIAL */
706 if (is_special_magic)
708 if (target_ptr->mane_num == MAX_MANE)
710 target_ptr->mane_num--;
711 for (int i = 0; i < target_ptr->mane_num - 1; i++)
713 target_ptr->mane_spell[i] = target_ptr->mane_spell[i + 1];
714 target_ptr->mane_dam[i] = target_ptr->mane_dam[i + 1];
718 target_ptr->mane_spell[target_ptr->mane_num] = thrown_spell - RF4_SPELL_START;
719 target_ptr->mane_dam[target_ptr->mane_num] = dam;
720 target_ptr->mane_num++;
721 target_ptr->new_mane = TRUE;
723 target_ptr->redraw |= PR_IMITATION;
726 /* Remember what the monster did, if we saw it */
730 if (thrown_spell < RF4_SPELL_START + RF4_SPELL_SIZE)
732 r_ptr->r_flags4 |= (1L << (thrown_spell - RF4_SPELL_START));
733 if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
737 else if (thrown_spell < RF5_SPELL_START + RF5_SPELL_SIZE)
739 r_ptr->r_flags5 |= (1L << (thrown_spell - RF5_SPELL_START));
740 if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
744 else if (thrown_spell < RF6_SPELL_START + RF6_SPELL_SIZE)
746 r_ptr->r_flags6 |= (1L << (thrown_spell - RF6_SPELL_START));
747 if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
751 /* Always take note of monsters that kill you */
752 if (target_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !floor_ptr->inside_arena)
754 r_ptr->r_deaths++; /* Ignore appearance difference */
757 /* A spell was cast */