• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: コミット

変愚蛮怒のメインリポジトリです


コミットメタ情報

リビジョンe89222886abd9b8f52ad04621b96fb785b4323b2 (tree)
日時2014-02-19 16:29:45
作者dis- <dis.rogue@gmai...>
コミッターdis-

ログメッセージ

refactor: integrate monst_breath_monst() into breath

変更サマリ

差分

--- a/src/externs.h
+++ b/src/externs.h
@@ -1524,19 +1524,6 @@ extern int riding_exp_level(int riding_exp);
15241524 extern int spell_exp_level(int spell_exp);
15251525 extern void display_rumor(bool ex);
15261526
1527-/* mspells1.c */
1528-extern bool clean_shot(int y1, int x1, int y2, int x2, bool is_friend);
1529-extern bool summon_possible(int y1, int x1);
1530-extern bool raise_possible(monster_type *m_ptr);
1531-extern bool dispel_check(int m_idx);
1532-extern bool spell_is_inate(u16b spell);
1533-extern bool make_attack_spell(int m_idx);
1534-extern void beam(int m_idx, int typ, int dam_hp, int monspell);
1535-
1536-/* mspells2.c */
1537-extern void get_project_point(int sy, int sx, int *ty, int *tx, int flg);
1538-extern bool monst_spell_monst(int m_idx);
1539-
15401527 /* artifact.c */
15411528 extern void one_sustain(object_type *o_ptr);
15421529 extern void one_high_resistance(object_type *o_ptr);
@@ -1574,11 +1561,21 @@ extern void do_cmd_mind_browse(void);
15741561
15751562 /* mane.c */
15761563 extern bool do_cmd_mane(bool baigaesi);
1564+
1565+/* mspells1.c */
1566+extern bool clean_shot(int y1, int x1, int y2, int x2, bool is_friend);
1567+extern bool summon_possible(int y1, int x1);
1568+extern bool raise_possible(monster_type *m_ptr);
1569+extern bool dispel_check(int m_idx);
1570+extern bool spell_is_inate(u16b spell);
1571+extern bool make_attack_spell(int m_idx);
1572+extern void beam(int m_idx, int typ, int dam_hp, int monspell);
15771573 extern void bolt(int m_idx, int typ, int dam_hp, int monspell);
1578-extern void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath, int monspell);
1574+extern void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath, int monspell, int spell_type);
15791575
15801576 /* mspells2.c */
1581-extern void monst_breath_monst(int m_idx, int y, int x, int typ, int dam_hp, int rad, bool breath, int monspell);
1577+extern void get_project_point(int sy, int sx, int *ty, int *tx, int flg);
1578+extern bool monst_spell_monst(int m_idx);
15821579
15831580 /* mspells3.c */
15841581 extern bool do_cmd_cast_learned(void);
--- a/src/mspells1.c
+++ b/src/mspells1.c
@@ -547,15 +547,25 @@ void beam(int m_idx, int typ, int dam_hp, int monspell)
547547 * @param rad 半径
548548 * @param breath TRUEならばブレス処理、FALSEならばボール処理
549549 * @param monspell モンスター魔法のID
550+ * @param spell_type モンスターからモンスターへ撃つならSPELL_MON_TO_MON、モンスターからプレイヤーならSPELL_MON_TO_PLAYER
550551 * @return なし
551552 */
552-void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath, int monspell)
553+void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath, int monspell, int spell_type)
553554 {
554- int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_PLAYER;
555-
556- monster_type *m_ptr = &m_list[m_idx];
557- monster_race *r_ptr = &r_info[m_ptr->r_idx];
555+ monster_type *m_ptr = &m_list[m_idx];
556+ monster_race *r_ptr = &r_info[m_ptr->r_idx];
558557 bool learnable = spell_learnable(m_idx);
558+ int flg;
559+
560+ switch (spell_type)
561+ {
562+ case SPELL_MON_TO_MON:
563+ flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
564+ break;
565+ case SPELL_MON_TO_PLAYER:
566+ flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_PLAYER;
567+ break;
568+ }
559569
560570 /* Determine the radius of the blast */
561571 if ((rad < 1) && breath) rad = (r_ptr->flags2 & (RF2_POWERFUL)) ? 3 : 2;
--- a/src/mspells2.c
+++ b/src/mspells2.c
@@ -13,58 +13,6 @@
1313
1414 #include "angband.h"
1515
16-
17-/*!
18- * @brief モンスターが敵対モンスターにブレス/ボール型特殊技能を放つ処理 /
19- * Monster casts a breath (or ball) attack at another monster.
20- * @param m_idx 特殊技能を使うモンスターの参照ID
21- * @param y 目標のY座標
22- * @param x 目標のX座標
23- * @param typ 効果属性のID
24- * @param dam_hp 威力
25- * @param rad 半径
26- * @param breath TRUEならばブレス / FALSEならばボール
27- * @param monspell 特殊攻撃のID
28- * @return なし
29- * @details
30- * Pass over any monsters that may be in the way
31- * Affect grids, objects, monsters, and the player
32- */
33-void monst_breath_monst(int m_idx, int y, int x, int typ, int dam_hp, int rad, bool breath, int monspell)
34-{
35- int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
36- bool learnable = spell_learnable(m_idx);
37-
38- monster_type *m_ptr = &m_list[m_idx];
39- monster_race *r_ptr = &r_info[m_ptr->r_idx];
40-
41- /* Determine the radius of the blast */
42- if (rad < 1 && breath) rad = (r_ptr->flags2 & RF2_POWERFUL) ? 3 : 2;
43-
44- /* Handle breath attacks */
45- if (breath) rad = 0 - rad;
46-
47- switch (typ)
48- {
49- case GF_ROCKET:
50- flg |= PROJECT_STOP;
51- break;
52- case GF_DRAIN_MANA:
53- case GF_MIND_BLAST:
54- case GF_BRAIN_SMASH:
55- case GF_CAUSE_1:
56- case GF_CAUSE_2:
57- case GF_CAUSE_3:
58- case GF_CAUSE_4:
59- case GF_HAND_DOOM:
60- flg |= (PROJECT_HIDE | PROJECT_AIMED);
61- break;
62- }
63-
64- (void)project(m_idx, rad, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
65-}
66-
67-
6816 /*!
6917 * @brief モンスターが敵対モンスターにボルト型特殊技能を放つ処理 /
7018 * Monster casts a bolt at another monster
@@ -906,8 +854,7 @@ bool monst_spell_monst(int m_idx)
906854 }
907855
908856 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
909- monst_breath_monst(m_idx, y, x, GF_ACID,
910- dam,0, TRUE, MS_BR_ACID);
857+ breath(y, x, m_idx,GF_ACID,dam, 0, TRUE, MS_BR_ACID, SPELL_MON_TO_MON);
911858
912859 break;
913860
@@ -937,8 +884,7 @@ bool monst_spell_monst(int m_idx)
937884 }
938885
939886 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
940- monst_breath_monst(m_idx, y, x, GF_ELEC,
941- dam,0, TRUE, MS_BR_ELEC);
887+ breath(y, x, m_idx,GF_ELEC, dam, 0, TRUE, MS_BR_ELEC, SPELL_MON_TO_MON);
942888
943889 break;
944890
@@ -968,8 +914,7 @@ bool monst_spell_monst(int m_idx)
968914 }
969915
970916 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
971- monst_breath_monst(m_idx, y, x, GF_FIRE,
972- dam,0, TRUE, MS_BR_FIRE);
917+ breath(y, x, m_idx,GF_FIRE, dam, 0, TRUE, MS_BR_FIRE, SPELL_MON_TO_MON);
973918
974919 break;
975920
@@ -999,8 +944,7 @@ bool monst_spell_monst(int m_idx)
999944 }
1000945
1001946 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1002- monst_breath_monst(m_idx, y, x, GF_COLD,
1003- dam,0, TRUE, MS_BR_COLD);
947+ breath(y, x, m_idx,GF_COLD, dam, 0, TRUE, MS_BR_COLD, SPELL_MON_TO_MON);
1004948 break;
1005949
1006950 /* RF4_BR_POIS */
@@ -1029,8 +973,7 @@ bool monst_spell_monst(int m_idx)
1029973 }
1030974
1031975 dam = ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3));
1032- monst_breath_monst(m_idx, y, x, GF_POIS,
1033- dam,0, TRUE, MS_BR_POIS);
976+ breath(y, x, m_idx,GF_POIS, dam, 0, TRUE, MS_BR_POIS, SPELL_MON_TO_MON);
1034977
1035978 break;
1036979
@@ -1060,8 +1003,7 @@ bool monst_spell_monst(int m_idx)
10601003 }
10611004
10621005 dam = ((m_ptr->hp / 6) > 550 ? 550 : (m_ptr->hp / 6));
1063- monst_breath_monst(m_idx, y, x, GF_NETHER,
1064- dam,0, TRUE, MS_BR_NETHER);
1006+ breath(y, x, m_idx,GF_NETHER, dam, 0, TRUE, MS_BR_NETHER, SPELL_MON_TO_MON);
10651007
10661008 break;
10671009
@@ -1091,8 +1033,7 @@ bool monst_spell_monst(int m_idx)
10911033 }
10921034
10931035 dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6));
1094- monst_breath_monst(m_idx, y, x, GF_LITE,
1095- dam,0, TRUE, MS_BR_LITE);
1036+ breath(y, x, m_idx,GF_LITE, dam, 0, TRUE, MS_BR_LITE, SPELL_MON_TO_MON);
10961037
10971038 break;
10981039
@@ -1122,8 +1063,7 @@ bool monst_spell_monst(int m_idx)
11221063 }
11231064
11241065 dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6));
1125- monst_breath_monst(m_idx, y, x, GF_DARK,
1126- dam,0, TRUE, MS_BR_DARK);
1066+ breath(y, x, m_idx,GF_DARK, dam, 0, TRUE, MS_BR_DARK, SPELL_MON_TO_MON);
11271067
11281068 break;
11291069
@@ -1153,8 +1093,7 @@ bool monst_spell_monst(int m_idx)
11531093 }
11541094
11551095 dam = ((m_ptr->hp / 6) > 450 ? 450 : (m_ptr->hp / 6));
1156- monst_breath_monst(m_idx, y, x, GF_CONFUSION,
1157- dam,0, TRUE, MS_BR_CONF);
1096+ breath(y, x, m_idx,GF_CONFUSION, dam, 0, TRUE, MS_BR_CONF, SPELL_MON_TO_MON);
11581097
11591098 break;
11601099
@@ -1188,8 +1127,7 @@ bool monst_spell_monst(int m_idx)
11881127 }
11891128
11901129 dam = ((m_ptr->hp / 6) > 450 ? 450 : (m_ptr->hp / 6));
1191- monst_breath_monst(m_idx, y, x, GF_SOUND,
1192- dam,0, TRUE, MS_BR_SOUND);
1130+ breath(y, x, m_idx,GF_SOUND, dam, 0, TRUE, MS_BR_SOUND, SPELL_MON_TO_MON);
11931131
11941132 break;
11951133
@@ -1219,8 +1157,7 @@ bool monst_spell_monst(int m_idx)
12191157 }
12201158
12211159 dam = ((m_ptr->hp / 6) > 600 ? 600 : (m_ptr->hp / 6));
1222- monst_breath_monst(m_idx, y, x, GF_CHAOS,
1223- dam,0, TRUE, MS_BR_CHAOS);
1160+ breath(y, x, m_idx, GF_CHAOS, dam, 0, TRUE, MS_BR_CHAOS, SPELL_MON_TO_MON);
12241161
12251162 break;
12261163
@@ -1250,8 +1187,7 @@ bool monst_spell_monst(int m_idx)
12501187 }
12511188
12521189 dam = ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6));
1253- monst_breath_monst(m_idx, y, x, GF_DISENCHANT,
1254- dam,0, TRUE, MS_BR_DISEN);
1190+ breath(y, x, m_idx, GF_DISENCHANT, dam, 0, TRUE, MS_BR_DISEN, SPELL_MON_TO_MON);
12551191
12561192 break;
12571193
@@ -1281,8 +1217,7 @@ bool monst_spell_monst(int m_idx)
12811217 }
12821218
12831219 dam = ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3));
1284- monst_breath_monst(m_idx, y, x, GF_NEXUS,
1285- dam,0, TRUE, MS_BR_NEXUS);
1220+ breath(y, x, m_idx, GF_NEXUS, dam, 0, TRUE, MS_BR_NEXUS, SPELL_MON_TO_MON);
12861221
12871222 break;
12881223
@@ -1312,8 +1247,7 @@ bool monst_spell_monst(int m_idx)
13121247 }
13131248
13141249 dam = ((m_ptr->hp / 3) > 150 ? 150 : (m_ptr->hp / 3));
1315- monst_breath_monst(m_idx, y, x, GF_TIME,
1316- dam,0, TRUE, MS_BR_TIME);
1250+ breath(y, x, m_idx, GF_TIME, dam, 0, TRUE, MS_BR_TIME, SPELL_MON_TO_MON);
13171251
13181252 break;
13191253
@@ -1343,8 +1277,7 @@ bool monst_spell_monst(int m_idx)
13431277 }
13441278
13451279 dam = ((m_ptr->hp / 6) > 200 ? 200 : (m_ptr->hp / 6));
1346- monst_breath_monst(m_idx, y, x, GF_INERTIA,
1347- dam,0, TRUE, MS_BR_INERTIA);
1280+ breath(y, x, m_idx, GF_INERTIA, dam, 0, TRUE, MS_BR_INERTIA, SPELL_MON_TO_MON);
13481281
13491282 break;
13501283
@@ -1374,8 +1307,7 @@ bool monst_spell_monst(int m_idx)
13741307 }
13751308
13761309 dam = ((m_ptr->hp / 3) > 200 ? 200 : (m_ptr->hp / 3));
1377- monst_breath_monst(m_idx, y, x, GF_GRAVITY,
1378- dam,0, TRUE, MS_BR_GRAVITY);
1310+ breath(y, x, m_idx, GF_GRAVITY, dam, 0, TRUE, MS_BR_GRAVITY, SPELL_MON_TO_MON);
13791311
13801312 break;
13811313
@@ -1409,8 +1341,7 @@ bool monst_spell_monst(int m_idx)
14091341 }
14101342
14111343 dam = ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6));
1412- monst_breath_monst(m_idx, y, x, GF_SHARDS,
1413- dam,0, TRUE, MS_BR_SHARDS);
1344+ breath(y, x, m_idx, GF_SHARDS, dam, 0, TRUE, MS_BR_SHARDS, SPELL_MON_TO_MON);
14141345
14151346 break;
14161347
@@ -1440,8 +1371,7 @@ bool monst_spell_monst(int m_idx)
14401371 }
14411372
14421373 dam = ((m_ptr->hp / 6) > 150 ? 150 : (m_ptr->hp / 6));
1443- monst_breath_monst(m_idx, y, x, GF_PLASMA,
1444- dam,0, TRUE, MS_BR_PLASMA);
1374+ breath(y, x, m_idx,GF_PLASMA, dam, 0, TRUE, MS_BR_PLASMA, SPELL_MON_TO_MON);
14451375
14461376 break;
14471377
@@ -1471,8 +1401,7 @@ bool monst_spell_monst(int m_idx)
14711401 }
14721402
14731403 dam = ((m_ptr->hp / 6) > 200 ? 200 : (m_ptr->hp / 6));
1474- monst_breath_monst(m_idx, y, x, GF_FORCE,
1475- dam,0, TRUE, MS_BR_FORCE);
1404+ breath(y, x, m_idx,GF_FORCE, dam, 0, TRUE, MS_BR_FORCE, SPELL_MON_TO_MON);
14761405 break;
14771406
14781407 /* RF4_BR_MANA */
@@ -1501,8 +1430,7 @@ bool monst_spell_monst(int m_idx)
15011430 }
15021431
15031432 dam = ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3));
1504- monst_breath_monst(m_idx, y, x, GF_MANA,
1505- dam,0, TRUE, MS_BR_MANA);
1433+ breath(y, x, m_idx,GF_MANA, dam, 0, TRUE, MS_BR_MANA, SPELL_MON_TO_MON);
15061434
15071435 break;
15081436
@@ -1530,8 +1458,7 @@ bool monst_spell_monst(int m_idx)
15301458 }
15311459
15321460 dam = (rlev + damroll(10, 6));
1533- monst_breath_monst(m_idx, y, x, GF_NUKE,
1534- dam, 2, FALSE, MS_BALL_NUKE);
1461+ breath(y, x, m_idx,GF_NUKE, dam, 2, FALSE, MS_BALL_NUKE, SPELL_MON_TO_MON);
15351462
15361463 break;
15371464
@@ -1561,8 +1488,7 @@ bool monst_spell_monst(int m_idx)
15611488 }
15621489
15631490 dam = ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3));
1564- monst_breath_monst(m_idx, y, x, GF_NUKE,
1565- dam,0, TRUE, MS_BR_NUKE);
1491+ breath(y, x, m_idx,GF_NUKE, dam, 0, TRUE, MS_BR_NUKE, SPELL_MON_TO_MON);
15661492 break;
15671493
15681494 /* RF4_BA_CHAO */
@@ -1589,8 +1515,7 @@ bool monst_spell_monst(int m_idx)
15891515 }
15901516
15911517 dam = (rlev * 2) + damroll(10, 10);
1592- monst_breath_monst(m_idx, y, x, GF_CHAOS,
1593- dam, 4, FALSE, MS_BALL_CHAOS);
1518+ breath(y, x, m_idx,GF_CHAOS, dam, 4, FALSE, MS_BALL_CHAOS, SPELL_MON_TO_MON);
15941519
15951520 break;
15961521
@@ -1620,8 +1545,7 @@ bool monst_spell_monst(int m_idx)
16201545 }
16211546
16221547 dam = ((m_ptr->hp / 6) > 150 ? 150 : (m_ptr->hp / 6));
1623- monst_breath_monst(m_idx, y, x, GF_DISINTEGRATE,
1624- dam,0, TRUE, MS_BR_DISI);
1548+ breath(y, x, m_idx,GF_DISINTEGRATE, dam, 0, TRUE, MS_BR_DISI, SPELL_MON_TO_MON);
16251549 break;
16261550
16271551 /* RF5_BA_ACID */
@@ -1658,7 +1582,7 @@ bool monst_spell_monst(int m_idx)
16581582 rad = 2;
16591583 dam = (randint1(rlev * 3) + 15);
16601584 }
1661- monst_breath_monst(m_idx, y, x, GF_ACID, dam, rad, FALSE, MS_BALL_ACID);
1585+ breath(y, x, m_idx,GF_ACID, dam, rad, FALSE, MS_BALL_ACID, SPELL_MON_TO_MON);
16621586 break;
16631587
16641588 /* RF5_BA_ELEC */
@@ -1694,7 +1618,7 @@ bool monst_spell_monst(int m_idx)
16941618 rad = 2;
16951619 dam = (randint1(rlev * 3 / 2) + 8);
16961620 }
1697- monst_breath_monst(m_idx, y, x, GF_ELEC, dam, rad, FALSE, MS_BALL_ELEC);
1621+ breath(y, x, m_idx,GF_ELEC, dam, rad, FALSE, MS_BALL_ELEC, SPELL_MON_TO_MON);
16981622 break;
16991623
17001624 /* RF5_BA_FIRE */
@@ -1741,7 +1665,7 @@ bool monst_spell_monst(int m_idx)
17411665 rad = 2;
17421666 dam = (randint1(rlev * 7 / 2) + 10);
17431667 }
1744- monst_breath_monst(m_idx, y, x, GF_FIRE, dam, rad, FALSE, MS_BALL_FIRE);
1668+ breath(y, x, m_idx,GF_FIRE, dam, rad, FALSE, MS_BALL_FIRE, SPELL_MON_TO_MON);
17451669 break;
17461670
17471671 /* RF5_BA_COLD */
@@ -1778,7 +1702,7 @@ bool monst_spell_monst(int m_idx)
17781702 rad = 2;
17791703 dam = (randint1(rlev * 3 / 2) + 10);
17801704 }
1781- monst_breath_monst(m_idx, y, x, GF_COLD, dam, rad, FALSE, MS_BALL_COLD);
1705+ breath(y, x, m_idx,GF_COLD, dam, rad, FALSE, MS_BALL_COLD, SPELL_MON_TO_MON);
17821706 break;
17831707
17841708 /* RF5_BA_POIS */
@@ -1806,7 +1730,7 @@ bool monst_spell_monst(int m_idx)
18061730 }
18071731
18081732 dam = damroll(12, 2) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
1809- monst_breath_monst(m_idx, y, x, GF_POIS, dam, 2, FALSE, MS_BALL_POIS);
1733+ breath(y, x, m_idx,GF_POIS, dam, 2, FALSE, MS_BALL_POIS, SPELL_MON_TO_MON);
18101734
18111735 break;
18121736
@@ -1834,7 +1758,7 @@ bool monst_spell_monst(int m_idx)
18341758 }
18351759
18361760 dam = 50 + damroll(10, 10) + (rlev * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1));
1837- monst_breath_monst(m_idx, y, x, GF_NETHER, dam, 2, FALSE, MS_BALL_NETHER);
1761+ breath(y, x, m_idx,GF_NETHER, dam, 2, FALSE, MS_BALL_NETHER, SPELL_MON_TO_MON);
18381762
18391763 break;
18401764
@@ -1864,7 +1788,7 @@ bool monst_spell_monst(int m_idx)
18641788 }
18651789
18661790 dam = ((r_ptr->flags2 & RF2_POWERFUL) ? randint1(rlev * 3) : randint1(rlev * 2)) + 50;
1867- monst_breath_monst(m_idx, y, x, GF_WATER, dam, 4, FALSE, MS_BALL_WATER);
1791+ breath(y, x, m_idx,GF_WATER, dam, 4, FALSE, MS_BALL_WATER, SPELL_MON_TO_MON);
18681792
18691793 break;
18701794
@@ -1892,7 +1816,7 @@ bool monst_spell_monst(int m_idx)
18921816 }
18931817
18941818 dam = (rlev * 4) + 50 + damroll(10, 10);
1895- monst_breath_monst(m_idx, y, x, GF_MANA, dam, 4, FALSE, MS_BALL_MANA);
1819+ breath(y, x, m_idx,GF_MANA, dam, 4, FALSE, MS_BALL_MANA, SPELL_MON_TO_MON);
18961820
18971821 break;
18981822
@@ -1920,7 +1844,7 @@ bool monst_spell_monst(int m_idx)
19201844 }
19211845
19221846 dam = (rlev * 4) + 50 + damroll(10, 10);
1923- monst_breath_monst(m_idx, y, x, GF_DARK, dam, 4, FALSE, MS_BALL_DARK);
1847+ breath(y, x, m_idx,GF_DARK, dam, 4, FALSE, MS_BALL_DARK, SPELL_MON_TO_MON);
19241848
19251849 break;
19261850
@@ -1933,7 +1857,7 @@ bool monst_spell_monst(int m_idx)
19331857 }
19341858
19351859 dam = ((randint1(rlev) / 2) + 1);
1936- monst_breath_monst(m_idx, y, x, GF_DRAIN_MANA, dam, 0, FALSE, MS_DRAIN_MANA);
1860+ breath(y, x, m_idx,GF_DRAIN_MANA, dam, 0, FALSE, MS_DRAIN_MANA, SPELL_MON_TO_MON);
19371861
19381862 break;
19391863
@@ -1945,7 +1869,7 @@ bool monst_spell_monst(int m_idx)
19451869 }
19461870
19471871 dam = damroll(7, 7);
1948- monst_breath_monst(m_idx, y, x, GF_MIND_BLAST, dam, 0, FALSE, MS_MIND_BLAST);
1872+ breath(y, x, m_idx,GF_MIND_BLAST, dam, 0, FALSE, MS_MIND_BLAST, SPELL_MON_TO_MON);
19491873
19501874 break;
19511875
@@ -1957,7 +1881,7 @@ bool monst_spell_monst(int m_idx)
19571881 }
19581882
19591883 dam = damroll(12, 12);
1960- monst_breath_monst(m_idx, y, x, GF_BRAIN_SMASH, dam, 0, FALSE, MS_BRAIN_SMASH);
1884+ breath(y, x, m_idx,GF_BRAIN_SMASH, dam, 0, FALSE, MS_BRAIN_SMASH, SPELL_MON_TO_MON);
19611885
19621886 break;
19631887
@@ -1976,7 +1900,7 @@ bool monst_spell_monst(int m_idx)
19761900 }
19771901
19781902 dam = damroll(3, 8);
1979- monst_breath_monst(m_idx, y, x, GF_CAUSE_1, dam, 0, FALSE, MS_CAUSE_1);
1903+ breath(y, x, m_idx,GF_CAUSE_1, dam, 0, FALSE, MS_CAUSE_1, SPELL_MON_TO_MON);
19801904
19811905 break;
19821906
@@ -1996,7 +1920,7 @@ bool monst_spell_monst(int m_idx)
19961920 }
19971921
19981922 dam = damroll(8, 8);
1999- monst_breath_monst(m_idx, y, x, GF_CAUSE_2, dam, 0, FALSE, MS_CAUSE_2);
1923+ breath(y, x, m_idx,GF_CAUSE_2, dam, 0, FALSE, MS_CAUSE_2, SPELL_MON_TO_MON);
20001924
20011925 break;
20021926
@@ -2016,7 +1940,7 @@ bool monst_spell_monst(int m_idx)
20161940 }
20171941
20181942 dam = damroll(10, 15);
2019- monst_breath_monst(m_idx, y, x, GF_CAUSE_3, dam, 0, FALSE, MS_CAUSE_3);
1943+ breath(y, x, m_idx,GF_CAUSE_3, dam, 0, FALSE, MS_CAUSE_3, SPELL_MON_TO_MON);
20201944
20211945 break;
20221946
@@ -2036,7 +1960,7 @@ bool monst_spell_monst(int m_idx)
20361960 }
20371961
20381962 dam = damroll(15, 15);
2039- monst_breath_monst(m_idx, y, x, GF_CAUSE_4, dam, 0, FALSE, MS_CAUSE_4);
1963+ breath(y, x, m_idx,GF_CAUSE_4, dam, 0, FALSE, MS_CAUSE_4, SPELL_MON_TO_MON);
20401964
20411965 break;
20421966
@@ -2141,7 +2065,7 @@ bool monst_spell_monst(int m_idx)
21412065 }
21422066
21432067 dam = (rlev * 4) + 50 + damroll(10, 10);
2144- monst_breath_monst(m_idx, y, x, GF_LITE, dam, 4, FALSE, MS_STARBURST);
2068+ breath(y, x, m_idx,GF_LITE, dam, 4, FALSE, MS_STARBURST, SPELL_MON_TO_MON);
21452069
21462070 break;
21472071
@@ -2484,7 +2408,7 @@ bool monst_spell_monst(int m_idx)
24842408 }
24852409
24862410 dam = 20; /* Dummy power */
2487- monst_breath_monst(m_idx, y, x, GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM);
2411+ breath(y, x, m_idx,GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM, SPELL_MON_TO_MON);
24882412
24892413 break;
24902414
--- a/src/mspells4.c
+++ b/src/mspells4.c
@@ -53,15 +53,11 @@ int spell_core(int SPELL_NUM, int hp, int y, int x, int m_idx, int SPELL_TYPE)
5353 {
5454 case RF4_ROCKET:
5555 dam = (hp / 4) > 800 ? 800 : (hp / 4);
56+ breath(y, x, m_idx, GF_ROCKET, dam, 2, FALSE, MS_ROCKET, SPELL_TYPE);
5657 if (SPELL_TYPE == SPELL_MON_TO_PLAYER)
5758 {
58- breath(y, x, m_idx, GF_ROCKET, dam, 2, FALSE, MS_ROCKET);
5959 update_smart_learn(m_idx, DRS_SHARD);
6060 }
61- else if (SPELL_TYPE == SPELL_MON_TO_MON)
62- {
63- monst_breath_monst(m_idx, y, x, GF_ROCKET, dam, 2, FALSE, MS_ROCKET);
64- }
6561 break;
6662 }
6763 return dam;
@@ -367,7 +363,7 @@ int spell_RF4_BREATH(int GF_TYPE, int y, int x, int m_idx)
367363 msg_format(_("%^sが%^sのブレスを吐いた。", "%^s breathes %^s."), m_name, type_s);
368364 }
369365
370- breath(y, x, m_idx, GF_TYPE, dam, 0, TRUE, ms_type);
366+ breath(y, x, m_idx, GF_TYPE, dam, 0, TRUE, ms_type, SPELL_MON_TO_PLAYER);
371367 if (smart_learn) update_smart_learn(m_idx, drs_type);
372368 return dam;
373369 }
@@ -390,7 +386,7 @@ int spell_RF4_BA_CHAO(int y, int x, int m_idx)
390386
391387 dam = ((r_ptr->flags2 & RF2_POWERFUL) ? (rlev * 3) : (rlev * 2)) + damroll(10, 10);
392388
393- breath(y, x, m_idx, GF_CHAOS, dam, 4, FALSE, MS_BALL_CHAOS);
389+ breath(y, x, m_idx, GF_CHAOS, dam, 4, FALSE, MS_BALL_CHAOS, SPELL_MON_TO_PLAYER);
394390 update_smart_learn(m_idx, DRS_CHAOS);
395391 return dam;
396392 }
@@ -412,7 +408,7 @@ int spell_RF4_BA_NUKE(int y, int x, int m_idx)
412408
413409 dam = (rlev + damroll(10, 6)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
414410
415- breath(y, x, m_idx, GF_NUKE, dam, 2, FALSE, MS_BALL_NUKE);
411+ breath(y, x, m_idx, GF_NUKE, dam, 2, FALSE, MS_BALL_NUKE, SPELL_MON_TO_PLAYER);
416412 update_smart_learn(m_idx, DRS_POIS);
417413 return dam;
418414 }
@@ -442,7 +438,7 @@ int spell_RF5_BA_ACID(int y, int x, int m_idx)
442438 rad = 2;
443439 dam = (randint1(rlev * 3) + 15);
444440 }
445- breath(y, x, m_idx, GF_ACID, dam, rad, FALSE, MS_BALL_ACID);
441+ breath(y, x, m_idx, GF_ACID, dam, rad, FALSE, MS_BALL_ACID, SPELL_MON_TO_PLAYER);
446442 update_smart_learn(m_idx, DRS_ACID);
447443 return dam;
448444 }
@@ -472,7 +468,7 @@ int spell_RF5_BA_ELEC(int y, int x, int m_idx)
472468 rad = 2;
473469 dam = (randint1(rlev * 3 / 2) + 8);
474470 }
475- breath(y, x, m_idx, GF_ELEC, dam, rad, FALSE, MS_BALL_ELEC);
471+ breath(y, x, m_idx, GF_ELEC, dam, rad, FALSE, MS_BALL_ELEC, SPELL_MON_TO_PLAYER);
476472 update_smart_learn(m_idx, DRS_ELEC);
477473 return dam;
478474 }
@@ -512,7 +508,7 @@ int spell_RF5_BA_FIRE(int y, int x, int m_idx)
512508 rad = 2;
513509 dam = (randint1(rlev * 7 / 2) + 10);
514510 }
515- breath(y, x, m_idx, GF_FIRE, dam, rad, FALSE, MS_BALL_FIRE);
511+ breath(y, x, m_idx, GF_FIRE, dam, rad, FALSE, MS_BALL_FIRE, SPELL_MON_TO_PLAYER);
516512 update_smart_learn(m_idx, DRS_FIRE);
517513 return dam;
518514 }
@@ -542,7 +538,7 @@ int spell_RF5_BA_COLD(int y, int x, int m_idx)
542538 rad = 2;
543539 dam = (randint1(rlev * 3 / 2) + 10);
544540 }
545- breath(y, x, m_idx, GF_COLD, dam, rad, FALSE, MS_BALL_COLD);
541+ breath(y, x, m_idx, GF_COLD, dam, rad, FALSE, MS_BALL_COLD, SPELL_MON_TO_PLAYER);
546542 update_smart_learn(m_idx, DRS_COLD);
547543 return dam;
548544 }
@@ -563,7 +559,7 @@ int spell_RF5_BA_POIS(int y, int x, int m_idx)
563559 msg_format(_("%^sが悪臭雲の呪文を唱えた。", "%^s casts a stinking cloud."), m_name);
564560
565561 dam = damroll(12, 2) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
566- breath(y, x, m_idx, GF_POIS, dam, 2, FALSE, MS_BALL_POIS);
562+ breath(y, x, m_idx, GF_POIS, dam, 2, FALSE, MS_BALL_POIS, SPELL_MON_TO_PLAYER);
567563 update_smart_learn(m_idx, DRS_POIS);
568564 return dam;
569565 }
@@ -583,7 +579,7 @@ int spell_RF5_BA_NETH(int y, int x, int m_idx)
583579 msg_format(_("%^sが地獄球の呪文を唱えた。", "%^s casts a nether ball."), m_name);
584580
585581 dam = 50 + damroll(10, 10) + (rlev * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1));
586- breath(y, x, m_idx, GF_NETHER, dam, 2, FALSE, MS_BALL_NETHER);
582+ breath(y, x, m_idx, GF_NETHER, dam, 2, FALSE, MS_BALL_NETHER, SPELL_MON_TO_PLAYER);
587583 update_smart_learn(m_idx, DRS_NETH);
588584 return dam;
589585 }
@@ -606,7 +602,7 @@ int spell_RF5_BA_WATE(int y, int x, int m_idx)
606602 msg_print(_("あなたは渦巻きに飲み込まれた。", "You are engulfed in a whirlpool."));
607603
608604 dam = ((r_ptr->flags2 & RF2_POWERFUL) ? randint1(rlev * 3) : randint1(rlev * 2)) + 50;
609- breath(y, x, m_idx, GF_WATER, dam, 4, FALSE, MS_BALL_WATER);
605+ breath(y, x, m_idx, GF_WATER, dam, 4, FALSE, MS_BALL_WATER, SPELL_MON_TO_PLAYER);
610606 return dam;
611607 }
612608
@@ -624,7 +620,7 @@ int spell_RF5_BA_MANA(int y, int x, int m_idx)
624620 msg_format(_("%^sが魔力の嵐の呪文を念じた。", "%^s invokes a mana storm."), m_name);
625621
626622 dam = (rlev * 4) + 50 + damroll(10, 10);
627- breath(y, x, m_idx, GF_MANA, dam, 4, FALSE, MS_BALL_MANA);
623+ breath(y, x, m_idx, GF_MANA, dam, 4, FALSE, MS_BALL_MANA, SPELL_MON_TO_PLAYER);
628624 return dam;
629625 }
630626
@@ -643,7 +639,7 @@ int spell_RF5_BA_DARK(int y, int x, int m_idx)
643639 msg_format(_("%^sが暗黒の嵐の呪文を念じた。", "%^s invokes a darkness storm."), m_name);
644640
645641 dam = (rlev * 4) + 50 + damroll(10, 10);
646- breath(y, x, m_idx, GF_DARK, dam, 4, FALSE, MS_BALL_DARK);
642+ breath(y, x, m_idx, GF_DARK, dam, 4, FALSE, MS_BALL_DARK, SPELL_MON_TO_PLAYER);
647643 update_smart_learn(m_idx, DRS_DARK);
648644 return dam;
649645 }
@@ -656,7 +652,7 @@ int spell_RF5_DRAIN_MANA(int y, int x, int m_idx)
656652 disturb(1, 1);
657653
658654 dam = (randint1(rlev) / 2) + 1;
659- breath(y, x, m_idx, GF_DRAIN_MANA, dam, 0, FALSE, MS_DRAIN_MANA);
655+ breath(y, x, m_idx, GF_DRAIN_MANA, dam, 0, FALSE, MS_DRAIN_MANA, SPELL_MON_TO_PLAYER);
660656 update_smart_learn(m_idx, DRS_MANA);
661657 return dam;
662658 }
@@ -675,7 +671,7 @@ int spell_RF5_MIND_BLAST(int y, int x, int m_idx)
675671 msg_format(_("%^sがあなたの瞳をじっとにらんでいる。", "%^s gazes deep into your eyes."), m_name);
676672
677673 dam = damroll(7, 7);
678- breath(y, x, m_idx, GF_MIND_BLAST, dam, 0, FALSE, MS_MIND_BLAST);
674+ breath(y, x, m_idx, GF_MIND_BLAST, dam, 0, FALSE, MS_MIND_BLAST, SPELL_MON_TO_PLAYER);
679675 return dam;
680676 }
681677
@@ -693,7 +689,7 @@ int spell_RF5_BRAIN_SMASH(int y, int x, int m_idx)
693689 msg_format(_("%^sがあなたの瞳をじっと見ている。", "%^s looks deep into your eyes."), m_name);
694690
695691 dam = damroll(12, 12);
696- breath(y, x, m_idx, GF_BRAIN_SMASH, dam, 0, FALSE, MS_BRAIN_SMASH);
692+ breath(y, x, m_idx, GF_BRAIN_SMASH, dam, 0, FALSE, MS_BRAIN_SMASH, SPELL_MON_TO_PLAYER);
697693 return dam;
698694 }
699695
@@ -710,7 +706,7 @@ int spell_RF5_CAUSE_1(int y, int x, int m_idx)
710706 msg_format(_("%^sがあなたを指さして呪った。", "%^s points at you and curses."), m_name);
711707
712708 dam = damroll(3, 8);
713- breath(y, x, m_idx, GF_CAUSE_1, dam, 0, FALSE, MS_CAUSE_1);
709+ breath(y, x, m_idx, GF_CAUSE_1, dam, 0, FALSE, MS_CAUSE_1, SPELL_MON_TO_PLAYER);
714710 return dam;
715711 }
716712
@@ -727,7 +723,7 @@ int spell_RF5_CAUSE_2(int y, int x, int m_idx)
727723 msg_format(_("%^sがあなたを指さして恐ろしげに呪った。", "%^s points at you and curses horribly."), m_name);
728724
729725 dam = damroll(8, 8);
730- breath(y, x, m_idx, GF_CAUSE_2, dam, 0, FALSE, MS_CAUSE_2);
726+ breath(y, x, m_idx, GF_CAUSE_2, dam, 0, FALSE, MS_CAUSE_2, SPELL_MON_TO_PLAYER);
731727 return dam;
732728 }
733729
@@ -744,7 +740,7 @@ int spell_RF5_CAUSE_3(int y, int x, int m_idx)
744740 msg_format(_("%^sがあなたを指さして恐ろしげに呪文を唱えた!", "%^s points at you, incanting terribly!"), m_name);
745741
746742 dam = damroll(10, 15);
747- breath(y, x, m_idx, GF_CAUSE_3, dam, 0, FALSE, MS_CAUSE_3);
743+ breath(y, x, m_idx, GF_CAUSE_3, dam, 0, FALSE, MS_CAUSE_3, SPELL_MON_TO_PLAYER);
748744 return dam;
749745 }
750746
@@ -762,7 +758,7 @@ int spell_RF5_CAUSE_4(int y, int x, int m_idx)
762758 "%^s points at you, screaming the word DIE!"), m_name);
763759
764760 dam = damroll(15, 15);
765- breath(y, x, m_idx, GF_CAUSE_4, dam, 0, FALSE, MS_CAUSE_4);
761+ breath(y, x, m_idx, GF_CAUSE_4, dam, 0, FALSE, MS_CAUSE_4, SPELL_MON_TO_PLAYER);
766762 return dam;
767763 }
768764
@@ -868,7 +864,7 @@ int spell_RF5_BA_LITE(int y, int x, int m_idx)
868864 msg_format(_("%^sがスターバーストの呪文を念じた。", "%^s invokes a starburst."), m_name);
869865
870866 dam = (rlev * 4) + 50 + damroll(10, 10);
871- breath(y, x, m_idx, GF_LITE, dam, 4, FALSE, MS_STARBURST);
867+ breath(y, x, m_idx, GF_LITE, dam, 4, FALSE, MS_STARBURST, SPELL_MON_TO_PLAYER);
872868 update_smart_learn(m_idx, DRS_LITE);
873869 return dam;
874870 }
@@ -1163,7 +1159,7 @@ int spell_RF6_HAND_DOOM(int y, int x, int m_idx)
11631159 disturb(1, 1);
11641160 msg_format(_("%^sが<破滅の手>を放った!", "%^s invokes the Hand of Doom!"), m_name);
11651161 dam = (((s32b)((40 + randint1(20)) * (p_ptr->chp))) / 100);
1166- breath(y, x, m_idx, GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM);
1162+ breath(y, x, m_idx, GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM, SPELL_MON_TO_PLAYER);
11671163 return dam;
11681164 }
11691165
旧リポジトリブラウザで表示