• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisiona018507fe4e8226d860ab260205eb95204918d92 (tree)
Time2014-02-22 01:32:18
Authordis- <dis.rogue@gmai...>
Commiterdis-

Log Message

refactor: extract monst_spell_monst

Change Summary

Incremental Difference

--- a/src/externs.h
+++ b/src/externs.h
@@ -1573,6 +1573,17 @@ extern void beam(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int
15731573 extern void bolt(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type);
15741574 extern void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath, int monspell, int target_type);
15751575
1576+/* mspells1.c */
1577+extern bool clean_shot(int y1, int x1, int y2, int x2, bool is_friend);
1578+extern bool summon_possible(int y1, int x1);
1579+extern bool raise_possible(monster_type *m_ptr);
1580+extern bool dispel_check(int m_idx);
1581+extern bool spell_is_inate(u16b spell);
1582+extern bool make_attack_spell(int m_idx);
1583+extern void beam(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type);
1584+extern void bolt(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type);
1585+extern void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath, int monspell, int target_type);
1586+
15761587 /* mspells2.c */
15771588 extern void get_project_point(int sy, int sx, int *ty, int *tx, int flg);
15781589 extern bool monst_spell_monst(int m_idx);
@@ -1584,52 +1595,9 @@ extern void set_rf_masks(s32b *f4, s32b *f5, s32b *f6, int mode);
15841595
15851596 /* mspells4.c */
15861597 extern bool spell_learnable(int m_idx);
1587-extern void spell_RF4_SHRIEK(int m_idx, int t_idx, int TARGET_TYPE);;
1588-extern void spell_RF4_DISPEL(int m_idx, int t_idx, int TARGET_TYPE);
1589-extern int spell_RF4_ROCKET(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1590-extern int spell_RF4_SHOOT(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1591-extern int spell_RF4_BREATH(int GF_TYPE, int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1592-extern int spell_RF4_BA_NUKE(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1593-extern int spell_RF4_BA_CHAO(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1594-extern int spell_RF5_BA_ACID(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1595-extern int spell_RF5_BA_ELEC(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1596-extern int spell_RF5_BA_FIRE(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1597-extern int spell_RF5_BA_COLD(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1598-extern int spell_RF5_BA_POIS(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1599-extern int spell_RF5_BA_NETH(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1600-extern int spell_RF5_BA_WATE(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1601-extern int spell_RF5_BA_MANA(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1602-extern int spell_RF5_BA_DARK(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1603-extern int spell_RF5_DRAIN_MANA(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1604-extern int spell_RF5_MIND_BLAST(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1605-extern int spell_RF5_BRAIN_SMASH(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1606-extern int spell_RF5_CAUSE_1(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1607-extern int spell_RF5_CAUSE_2(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1608-extern int spell_RF5_CAUSE_3(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1609-extern int spell_RF5_CAUSE_4(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1610-extern int spell_RF5_BO_ACID(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1611-extern int spell_RF5_BO_ELEC(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1612-extern int spell_RF5_BO_FIRE(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1613-extern int spell_RF5_BO_COLD(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1614-extern int spell_RF5_BA_LITE(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1615-extern int spell_RF5_BO_NETH(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1616-extern int spell_RF5_BO_WATE(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1617-extern int spell_RF5_BO_MANA(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1618-extern int spell_RF5_BO_PLAS(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1619-extern int spell_RF5_BO_ICEE(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1620-extern int spell_RF5_MISSILE(int y, int x, int m_idx, int t_idx, int TARGET_TYPE);
1621-extern void spell_RF5_SCARE(int y, int x, int m_idx);
1622-extern void spell_RF5_BLIND(int y, int x, int m_idx);
1623-extern void spell_RF5_CONF(int y, int x, int m_idx);
1624-extern void spell_RF5_SLOW(int y, int x, int m_idx);
1625-extern void spell_RF5_HOLD(int y, int x, int m_idx);
1626-extern void spell_RF6_HASTE(int m_idx);
1627-extern int spell_RF6_HAND_DOOM(int y, int x, int m_idx);
1628-extern void spell_RF6_HEAL(int m_idx);
1629-extern void spell_RF6_INVULNER(int m_idx);
1630-extern void spell_RF6_BLINK(int m_idx);
1631-extern void spell_RF6_TPORT(int m_idx);
1632-extern int spell_RF6_WORLD(int m_idx);
1598+extern int monspell_to_player(int SPELL_NUM, int y, int x, int m_idx);
1599+extern int monspell_to_monster(int SPELL_NUM, int y, int x, int m_idx, int t_idx);
1600+
16331601 extern int spell_RF6_SPECIAL(int y, int x, int m_idx);
16341602 extern void spell_RF6_TELE_TO(int m_idx);
16351603 extern void spell_RF6_TELE_AWAY(int m_idx);
--- a/src/mspells1.c
+++ b/src/mspells1.c
@@ -507,7 +507,7 @@ bool clean_shot(int y1, int x1, int y2, int x2, bool is_friend)
507507 * @param typ 効果属性ID
508508 * @param dam_hp 威力
509509 * @param monspell モンスター魔法のID
510- * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER
510+ * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプ・Eぅ筺爾覆・ONSTER_TO_PLAYER
511511 * @return なし
512512 */
513513 void bolt(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type)
@@ -538,7 +538,7 @@ void bolt(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target
538538 * @param typ 効果属性ID
539539 * @param dam_hp 威力
540540 * @param monspell モンスター魔法のID
541- * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER
541+ * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプ・Eぅ筺爾覆・ONSTER_TO_PLAYER
542542 * @return なし
543543 */
544544 void beam(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type)
@@ -570,9 +570,9 @@ void beam(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target
570570 * @param typ 効果属性ID
571571 * @param dam_hp 威力
572572 * @param rad 半径
573- * @param breath TRUEならばブレス処理、FALSEならばボール処理
573+ * @param breath TRUEならばブ・E構萢・.ALSEならばボー・E萢
574574 * @param monspell モンスター魔法のID
575- * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER
575+ * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプ・Eぅ筺爾覆・ONSTER_TO_PLAYER
576576 * @return なし
577577 */
578578 void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath, int monspell, int target_type)
@@ -1871,112 +1871,9 @@ bool make_attack_spell(int m_idx)
18711871 }
18721872 }
18731873
1874- /* Cast the spell. */
1875- switch (thrown_spell)
1876- {
1877- case 96 + 0: spell_RF4_SHRIEK(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_SHRIEK */
1878- case 96 + 1: break; /* RF4_XXX1 */
1879- case 96 + 2: spell_RF4_DISPEL(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_DISPEL */
1880- case 96 + 3: dam = spell_RF4_ROCKET(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_ROCKET */
1881- case 96 + 4: dam = spell_RF4_SHOOT(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_SHOOT */
1882- case 96 + 5: break; /* RF4_XXX2 */
1883- case 96 + 6: break; /* RF4_XXX3 */
1884- case 96 + 7: break; /* RF4_XXX4 */
1885- case 96 + 8: dam = spell_RF4_BREATH(GF_ACID, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_ACID */
1886- case 96 + 9: dam = spell_RF4_BREATH(GF_ELEC, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_ELEC */
1887- case 96 + 10: dam = spell_RF4_BREATH(GF_FIRE, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_FIRE */
1888- case 96 + 11: dam = spell_RF4_BREATH(GF_COLD, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_COLD */
1889- case 96 + 12: dam = spell_RF4_BREATH(GF_POIS, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_POIS */
1890- case 96 + 13: dam = spell_RF4_BREATH(GF_NETHER, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_NETH */
1891- case 96 + 14: dam = spell_RF4_BREATH(GF_LITE, y_br_lite, x_br_lite, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_LITE */
1892- case 96 + 15: dam = spell_RF4_BREATH(GF_DARK, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_DARK */
1893- case 96 + 16: dam = spell_RF4_BREATH(GF_CONFUSION, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_CONF */
1894- case 96 + 17: dam = spell_RF4_BREATH(GF_SOUND, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_SOUN */
1895- case 96 + 18: dam = spell_RF4_BREATH(GF_CHAOS, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_CHAO */
1896- case 96 + 19: dam = spell_RF4_BREATH(GF_DISENCHANT, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_DISE */
1897- case 96 + 20: dam = spell_RF4_BREATH(GF_NEXUS, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_NEXU */
1898- case 96 + 21: dam = spell_RF4_BREATH(GF_TIME, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_TIME */
1899- case 96 + 22: dam = spell_RF4_BREATH(GF_INERTIA, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_INER */
1900- case 96 + 23: dam = spell_RF4_BREATH(GF_GRAVITY, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_GRAV */
1901- case 96 + 24: dam = spell_RF4_BREATH(GF_SHARDS, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_SHAR */
1902- case 96 + 25: dam = spell_RF4_BREATH(GF_PLASMA, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_PLAS */
1903- case 96 + 26: dam = spell_RF4_BREATH(GF_FORCE, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_WALL */
1904- case 96 + 27: dam = spell_RF4_BREATH(GF_MANA, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_MANA */
1905- case 96 + 28: dam = spell_RF4_BA_NUKE(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BA_NUKE */
1906- case 96 + 29: dam = spell_RF4_BREATH(GF_NUKE, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_NUKE */
1907- case 96 + 30: dam = spell_RF4_BA_CHAO(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BA_CHAO */
1908- case 96 + 31: dam = spell_RF4_BREATH(GF_DISINTEGRATE, y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_BR_DISI */
1909- case 128 + 0: dam = spell_RF5_BA_ACID(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BA_ACID */
1910- case 128 + 1: dam = spell_RF5_BA_ELEC(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BA_ELEC */
1911- case 128 + 2: dam = spell_RF5_BA_FIRE(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BA_FIRE */
1912- case 128 + 3: dam = spell_RF5_BA_COLD(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BA_COLD */
1913- case 128 + 4: dam = spell_RF5_BA_POIS(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BA_POIS */
1914- case 128 + 5: dam = spell_RF5_BA_NETH(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BA_NETH */
1915- case 128 + 6: dam = spell_RF5_BA_WATE(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BA_WATE */
1916- case 128 + 7: dam = spell_RF5_BA_MANA(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BA_MANA */
1917- case 128 + 8: dam = spell_RF5_BA_DARK(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BA_DARK */
1918- case 128 + 9: dam = spell_RF5_DRAIN_MANA(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_DRAIN_MANA */
1919- case 128 + 10: dam = spell_RF5_MIND_BLAST(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_MIND_BLAST */
1920- case 128 + 11: dam = spell_RF5_BRAIN_SMASH(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_MIND_BLAST */
1921- case 128 + 12: dam = spell_RF5_CAUSE_1(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_CAUSE_1 */
1922- case 128 + 13: dam = spell_RF5_CAUSE_2(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_CAUSE_2 */
1923- case 128 + 14: dam = spell_RF5_CAUSE_3(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_CAUSE_3 */
1924- case 128 + 15: dam = spell_RF5_CAUSE_4(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_CAUSE_4 */
1925- case 128 + 16: dam = spell_RF5_BO_ACID(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BO_ACID */
1926- case 128 + 17: dam = spell_RF5_BO_ELEC(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BO_ELEC */
1927- case 128 + 18: dam = spell_RF5_BO_FIRE(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BO_FIRE */
1928- case 128 + 19: dam = spell_RF5_BO_COLD(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BO_COLD */
1929- case 128 + 20: dam = spell_RF5_BA_LITE(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BA_LITE */
1930- case 128 + 21: dam = spell_RF5_BO_NETH(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BO_NETH */
1931- case 128 + 22: dam = spell_RF5_BO_WATE(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BO_WATE */
1932- case 128 + 23: dam = spell_RF5_BO_MANA(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BO_MANA */
1933- case 128 + 24: dam = spell_RF5_BO_PLAS(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BO_PLAS */
1934- case 128 + 25: dam = spell_RF5_BO_ICEE(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BO_ICEE */
1935- case 128 + 26: dam = spell_RF5_MISSILE(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_MISSILE */
1936- case 128 + 27: spell_RF5_SCARE(y, x, m_idx); break; /* RF5_SCARE */
1937- case 128 + 28: spell_RF5_BLIND(y, x, m_idx); break; /* RF5_BLIND */
1938- case 128 + 29: spell_RF5_CONF(y, x, m_idx); break; /* RF5_CONF */
1939- case 128 + 30: spell_RF5_SLOW(y, x, m_idx); break; /* RF5_SLOW */
1940- case 128 + 31: spell_RF5_HOLD(y, x, m_idx); break; /* RF5_HOLD */
1941- case 160 + 0: spell_RF6_HASTE(m_idx); break; /* RF6_HASTE */
1942- case 160 + 1: dam = spell_RF6_HAND_DOOM(y, x, m_idx); break; /* RF6_HAND_DOOM */
1943- case 160 + 2: spell_RF6_HEAL(m_idx); break; /* RF6_HEAL */
1944- case 160 + 3: spell_RF6_INVULNER(m_idx); break; /* RF6_INVULNER */
1945- case 160 + 4: spell_RF6_BLINK(m_idx); break; /* RF6_BLINK */
1946- case 160 + 5: spell_RF6_TPORT(m_idx); break; /* RF6_TPORT */
1947- case 160 + 6: dam = spell_RF6_WORLD(m_idx); break; /* RF6_WORLD */
1948-
1949- /* RF6_SPECIAL */
1950- case 160 + 7:
1951- dam = spell_RF6_SPECIAL(y, x, m_idx);
1952- if (dam < 0) return FALSE;
1953- break;
1954-
1955- case 160 + 8: spell_RF6_TELE_TO(m_idx); break; /* RF6_TELE_TO */
1956- case 160 + 9: spell_RF6_TELE_AWAY(m_idx); break; /* RF6_TELE_AWAY */
1957- case 160 + 10: spell_RF6_TELE_LEVEL(m_idx); break; /* RF6_TELE_LEVEL */
1958- case 160 + 11: spell_RF6_PSY_SPEAR(y, x, m_idx); break; /* RF6_PSY_SPEAR */
1959- case 160 + 12: spell_RF6_DARKNESS(m_idx); break; /* RF6_DARKNESS */
1960- case 160 + 13: spell_RF6_TRAPS(y, x, m_idx); break; /* RF6_TRAPS */
1961- case 160 + 14: spell_RF6_FORGET(m_idx); break; /* RF6_FORGET */
1962- case 160 + 15: spell_RF6_RAISE_DEAD(m_idx); break; /* RF6_RAISE_DEAD */
1963- case 160 + 16: spell_RF6_S_KIN(y, x, m_idx); break; /* RF6_S_KIN */
1964- case 160 + 17: spell_RF6_S_CYBER(y, x, m_idx); break; /* RF6_S_CYBER */
1965- case 160 + 18: spell_RF6_S_MONSTER(y, x, m_idx); break; /* RF6_S_MONSTER */
1966- case 160 + 19: spell_RF6_S_MONSTERS(y, x, m_idx); break; /* RF6_S_MONSTER */
1967- case 160 + 20: spell_RF6_S_ANT(y, x, m_idx); break; /* RF6_S_ANT */
1968- case 160 + 21: spell_RF6_S_SPIDER(y, x, m_idx); break; /* RF6_S_SPIDER */
1969- case 160 + 22: spell_RF6_S_HOUND(y, x, m_idx); break; /* RF6_S_HOUND */
1970- case 160 + 23: spell_RF6_S_HYDRA(y, x, m_idx); break; /* RF6_S_HYDRA */
1971- case 160 + 24: spell_RF6_S_ANGEL(y, x, m_idx); break; /* RF6_S_ANGEL */
1972- case 160 + 25: spell_RF6_S_DEMON(y, x, m_idx); break; /* RF6_S_DEMON */
1973- case 160 + 26: spell_RF6_S_UNDEAD(y, x, m_idx); break; /* RF6_S_UNDEAD */
1974- case 160 + 27: spell_RF6_S_DRAGON(y, x, m_idx); break; /* RF6_S_DRAGON */
1975- case 160 + 28: spell_RF6_S_HI_UNDEAD(y, x, m_idx); break; /* RF6_S_HI_UNDEAD */
1976- case 160 + 29: spell_RF6_S_HI_DRAGON(y, x, m_idx); break; /* RF6_S_HI_DRAGON */
1977- case 160 + 30: spell_RF6_S_AMBERITES(y, x, m_idx); break; /* RF6_S_AMBERITES */
1978- case 160 + 31: spell_RF6_S_UNIQUE(y, x, m_idx); break; /* RF6_S_UNIQUE */
1979- }
1874+ /* Cast the spell. */
1875+ dam = monspell_to_player(thrown_spell, y, x, m_idx);
1876+ if (dam < 0) return FALSE;
19801877
19811878 if ((p_ptr->action == ACTION_LEARN) && thrown_spell > 175)
19821879 {
--- a/src/mspells2.c
+++ b/src/mspells2.c
@@ -733,422 +733,11 @@ bool monst_spell_monst(int m_idx)
733733
734734 can_remember = is_original_ap_and_seen(m_ptr);
735735
736- switch (thrown_spell)
737- {
738- case 96 + 0: spell_RF4_SHRIEK(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_SHRIEK */
739- case 96 + 1: return FALSE; /* RF4_XXX1 */
740- case 96 + 2: spell_RF4_DISPEL(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_DISPEL */
741- case 96 + 3: dam = spell_RF4_ROCKET(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_ROCKET */
742- case 96 + 4: dam = spell_RF4_SHOOT(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_SHOOT */
743- case 96 + 5: return FALSE; /* RF4_XXX2 */
744- case 96 + 6: return FALSE; /* RF4_XXX3 */
745- case 96 + 7: return FALSE; /* RF4_XXX4 */
746- case 96 + 8: dam = spell_RF4_BREATH(GF_ACID, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_ACID */
747- case 96 + 9: dam = spell_RF4_BREATH(GF_ELEC, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_ELEC */
748- case 96 + 10: dam = spell_RF4_BREATH(GF_FIRE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_FIRE */
749- case 96 + 11: dam = spell_RF4_BREATH(GF_COLD, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_COLD */
750- case 96 + 12: dam = spell_RF4_BREATH(GF_POIS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_POIS */
751- case 96 + 13: dam = spell_RF4_BREATH(GF_NETHER, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_NETH */
752- case 96 + 14: dam = spell_RF4_BREATH(GF_LITE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_LITE */
753- case 96 + 15: dam = spell_RF4_BREATH(GF_DARK, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_DARK */
754- case 96 + 16: dam = spell_RF4_BREATH(GF_CONFUSION, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_CONF */
755- case 96 + 17: dam = spell_RF4_BREATH(GF_SOUND, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_SOUN */
756- case 96 + 18: dam = spell_RF4_BREATH(GF_CHAOS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_CHAO */
757- case 96 + 19: dam = spell_RF4_BREATH(GF_DISENCHANT, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_DISE */
758- case 96 + 20: dam = spell_RF4_BREATH(GF_NEXUS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_NEXU */
759- case 96 + 21: dam = spell_RF4_BREATH(GF_TIME, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_TIME */
760- case 96 + 22: dam = spell_RF4_BREATH(GF_INERTIA, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_INER */
761- case 96 + 23: dam = spell_RF4_BREATH(GF_GRAVITY, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_GRAV */
762- case 96 + 24: dam = spell_RF4_BREATH(GF_SHARDS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_SHAR */
763- case 96 + 25: dam = spell_RF4_BREATH(GF_PLASMA, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_PLAS */
764- case 96 + 26: dam = spell_RF4_BREATH(GF_FORCE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_WALL */
765- case 96 + 27: dam = spell_RF4_BREATH(GF_MANA, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_MANA */
766- case 96 + 28: dam = spell_RF4_BA_NUKE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BA_NUKE */
767- case 96 + 29: dam = spell_RF4_BREATH(GF_NUKE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_NUKE */
768- case 96 + 30: dam = spell_RF4_BA_CHAO(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BA_CHAO */
769- case 96 + 31: dam = spell_RF4_BREATH(GF_DISINTEGRATE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_DISI */
770- case 128 + 0: dam = spell_RF5_BA_ACID(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_ACID */
771- case 128 + 1: dam = spell_RF5_BA_ELEC(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_ELEC */
772- case 128 + 2: dam = spell_RF5_BA_FIRE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_FIRE */
773- case 128 + 3: dam = spell_RF5_BA_COLD(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_COLD */
774- case 128 + 4: dam = spell_RF5_BA_POIS(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_POIS */
775- case 128 + 5: dam = spell_RF5_BA_NETH(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_NETH */
776- case 128 + 6: dam = spell_RF5_BA_WATE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_WATE */
777- case 128 + 7: dam = spell_RF5_BA_MANA(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_MANA */
778- case 128 + 8: dam = spell_RF5_BA_DARK(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_DARK */
779- case 128 + 9: dam = spell_RF5_DRAIN_MANA(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_DRAIN_MANA */
780- case 128 + 10: dam = spell_RF5_MIND_BLAST(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_MIND_BLAST */
781- case 128 + 11: dam = spell_RF5_BRAIN_SMASH(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BRAIN_SMASH */
782- case 128 + 12: dam = spell_RF5_CAUSE_1(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_CAUSE_1 */
783- case 128 + 13: dam = spell_RF5_CAUSE_2(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_CAUSE_2 */
784- case 128 + 14: dam = spell_RF5_CAUSE_3(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_CAUSE_3 */
785- case 128 + 15: dam = spell_RF5_CAUSE_4(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_CAUSE_4 */
786- case 128 + 16: dam = spell_RF5_BO_ACID(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_ACID */
787- case 128 + 17: dam = spell_RF5_BO_ELEC(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_ELEC */
788- case 128 + 18: dam = spell_RF5_BO_FIRE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_FIRE */
789- case 128 + 19: dam = spell_RF5_BO_COLD(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_COLD */
790- case 128 + 20: dam = spell_RF5_BA_LITE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_LITE */
791- case 128 + 21: dam = spell_RF5_BO_NETH(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_NETH */
792- case 128 + 22: dam = spell_RF5_BO_WATE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_WATE */
793- case 128 + 23: dam = spell_RF5_BO_MANA(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_MANA */
794- case 128 + 24: dam = spell_RF5_BO_PLAS(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_PLAS */
795- case 128 + 25: dam = spell_RF5_BO_ICEE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_ICEE */
796- case 128 + 26: dam = spell_RF5_MISSILE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_MISSILE */
797-
798- /* RF5_SCARE */
799- case 128+27:
800- if (known)
801- {
802- if (see_either)
803- {
804- msg_format(_("%^sが恐ろしげな幻覚を作り出した。",
805- "%^s casts a fearful illusion in front of %s."), m_name, t_name);
806- }
807- else
808- {
809- mon_fight = TRUE;
810- }
811- }
812-
813- if (tr_ptr->flags3 & RF3_NO_FEAR)
814- {
815- if (see_t) msg_format(_("%^sは恐怖を感じない。",
816- "%^s refuses to be frightened."), t_name);
817-
818- }
819- else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
820- {
821- if (see_t) msg_format(_("%^sは恐怖を感じない。",
822- "%^s refuses to be frightened."), t_name);
823- }
824- else
825- {
826- if (set_monster_monfear(t_idx, MON_MONFEAR(t_ptr) + randint0(4) + 4)) fear = TRUE;
827- }
828-
829- wake_up = TRUE;
830-
831- break;
832-
833- /* RF5_BLIND */
834- case 128+28:
835- if (known)
836- {
837- if (see_either)
838- {
839- _(msg_format("%sは呪文を唱えて%sの目を焼き付かせた。", m_name, t_name),
840- msg_format("%^s casts a spell, burning %s%s eyes.", m_name, t_name,
841- (streq(t_name, "it") ? "s" : "'s")));
842-
843- }
844- else
845- {
846- mon_fight = TRUE;
847- }
848- }
849-
850- /* Simulate blindness with confusion */
851- if (tr_ptr->flags3 & RF3_NO_CONF)
852- {
853- if (see_t) msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), t_name);
854- }
855- else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
856- {
857- if (see_t) msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), t_name);
858- }
859- else
860- {
861- if (see_t) msg_format(_("%^sは目が見えなくなった! ", "%^s is blinded!"), t_name);
862-
863- (void)set_monster_confused(t_idx, MON_CONFUSED(t_ptr) + 12 + randint0(4));
864- }
865-
866- wake_up = TRUE;
867-
868- break;
869-
870- /* RF5_CONF */
871- case 128+29:
872- if (known)
873- {
874- if (see_either)
875- {
876- msg_format(_("%^sが%sの前に幻惑的な幻をつくり出した。",
877- "%^s casts a mesmerizing illusion in front of %s."), m_name, t_name);
878- }
879- else
880- {
881- mon_fight = TRUE;
882- }
883- }
884-
885- if (tr_ptr->flags3 & RF3_NO_CONF)
886- {
887- if (see_t) msg_format(_("%^sは惑わされなかった。",
888- "%^s disbelieves the feeble spell."), t_name);
889- }
890- else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
891- {
892- if (see_t) msg_format(_("%^sは惑わされなかった。",
893- "%^s disbelieves the feeble spell."), t_name);
894- }
895- else
896- {
897- if (see_t) msg_format(_("%^sは混乱したようだ。",
898- "%^s seems confused."), t_name);
899-
900- (void)set_monster_confused(t_idx, MON_CONFUSED(t_ptr) + 12 + randint0(4));
901- }
902-
903- wake_up = TRUE;
904-
905- break;
906-
907- /* RF5_SLOW */
908- case 128+30:
909- if (known)
910- {
911- if (see_either)
912- {
913- _(msg_format("%sが%sの筋肉から力を吸いとった。", m_name, t_name),
914- msg_format("%^s drains power from %s%s muscles.", m_name, t_name,
915- (streq(t_name, "it") ? "s" : "'s")));
916- }
917- else
918- {
919- mon_fight = TRUE;
920- }
921- }
922-
923- if (tr_ptr->flags1 & RF1_UNIQUE)
924- {
925- if (see_t) msg_format(_("%^sには効果がなかった。",
926- "%^s is unaffected."), t_name);
927- }
928- else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
929- {
930- if (see_t) msg_format(_("%^sには効果がなかった。",
931- "%^s is unaffected."), t_name);
932- }
933- else
934- {
935- if (set_monster_slow(t_idx, MON_SLOW(t_ptr) + 50))
936- {
937- if (see_t) msg_format(_("%sの動きが遅くなった。",
938- "%^s starts moving slower."), t_name);
939- }
940- }
941-
942- wake_up = TRUE;
943-
944- break;
945-
946- /* RF5_HOLD */
947- case 128+31:
948- if (known)
949- {
950- if (see_either)
951- {
952- msg_format(_("%^sは%sをじっと見つめた。", "%^s stares intently at %s."), m_name, t_name);
953- }
954- else
955- {
956- mon_fight = TRUE;
957- }
958- }
736+ dam = monspell_to_monster(thrown_spell, y, x, m_idx, t_idx);
737+ if (dam < 0)return FALSE;
959738
960- if ((tr_ptr->flags1 & RF1_UNIQUE) ||
961- (tr_ptr->flags3 & RF3_NO_STUN))
962- {
963- if (see_t) msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), t_name);
964- }
965- else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
966- {
967- if (see_t) msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), t_name);
968- }
969- else
970- {
971- if (see_t) msg_format(_("%^sは麻痺した!", "%^s is paralyzed!"), t_name);
972-
973- (void)set_monster_stunned(t_idx, MON_STUNNED(t_ptr) + randint1(4) + 4);
974- }
975-
976- wake_up = TRUE;
977-
978- break;
979-
980-
981- /* RF6_HASTE */
982- case 160+0:
983- if (known)
984- {
985- if (see_m)
986- {
987- msg_format(_("%^sが自分の体に念を送った。", "%^s concentrates on %s body."), m_name);
988- }
989- else
990- {
991- mon_fight = TRUE;
992- }
993- }
994-
995- /* Allow quick speed increases to base+10 */
996- if (set_monster_fast(m_idx, MON_FAST(m_ptr) + 100))
997- {
998- if (see_m) msg_format(_("%^sの動きが速くなった。", "%^s starts moving faster."), m_name);
999- }
1000- break;
1001-
1002- /* RF6_HAND_DOOM */
1003- case 160+1:
1004- if (known)
1005- {
1006- if (see_m)
1007- {
1008- msg_format(_("%^sが%sに<破滅の手>を放った!", "%^s invokes the Hand of Doom upon %s!"), m_name, t_name);
1009- }
1010- else
1011- {
1012- mon_fight = TRUE;
1013- }
1014- }
1015-
1016- dam = 20; /* Dummy power */
1017- breath(y, x, m_idx,GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM, MONSTER_TO_MONSTER);
1018-
1019- break;
1020-
1021- /* RF6_HEAL */
1022- case 160+2:
1023- if (known)
1024- {
1025- if (see_m)
1026- {
1027- msg_format(_("%^sは自分の傷に念を集中した。", "%^s concentrates on %s wounds."), m_name);
1028- }
1029- else
1030- {
1031- mon_fight = TRUE;
1032- }
1033- }
1034-
1035- /* Heal some */
1036- m_ptr->hp += (rlev * 6);
1037-
1038- /* Fully healed */
1039- if (m_ptr->hp >= m_ptr->maxhp)
1040- {
1041- /* Fully healed */
1042- m_ptr->hp = m_ptr->maxhp;
1043-
1044- if (known)
1045- {
1046- if (see_m)
1047- {
1048- msg_format(_("%^sは完全に治った!", "%^s looks completely healed!"), m_name);
1049- }
1050- else
1051- {
1052- mon_fight = TRUE;
1053- }
1054- }
1055- }
1056-
1057- /* Partially healed */
1058- else if (known)
1059- {
1060- if (see_m)
1061- {
1062- msg_format(_("%^sは体力を回復したようだ。", "%^s looks healthier."), m_name);
1063- }
1064- else
1065- {
1066- mon_fight = TRUE;
1067- }
1068- }
1069-
1070- /* Redraw (later) if needed */
1071- if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
1072- if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
1073-
1074- /* Cancel fear */
1075- if (MON_MONFEAR(m_ptr))
1076- {
1077- /* Cancel fear */
1078- (void)set_monster_monfear(m_idx, 0);
1079-
1080- /* Message */
1081- if (see_m) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name);
1082- }
1083-
1084- break;
1085-
1086- /* RF6_INVULNER */
1087- case 160+3:
1088- if (known)
1089- {
1090- if (see_m)
1091- {
1092- disturb(1, 1);
1093- msg_format(_("%sは無傷の球の呪文を唱えた。", "%^s casts a Globe of Invulnerability."), m_name);
1094- }
1095- else
1096- {
1097- mon_fight = TRUE;
1098- }
1099- }
1100-
1101- if (!MON_INVULNER(m_ptr)) (void)set_monster_invulner(m_idx, randint1(4) + 4, FALSE);
1102- break;
1103-
1104- /* RF6_BLINK */
1105- case 160+4:
1106- if (teleport_barrier(m_idx))
1107- {
1108- if (see_m)
1109- {
1110- msg_format(_("魔法のバリアが%^sのテレポートを邪魔した。", "Magic barrier obstructs teleporting of %^s."), m_name);
1111- }
1112- }
1113- else
1114- {
1115- if (see_m)
1116- {
1117- msg_format(_("%^sが瞬時に消えた。", "%^s blinks away."), m_name);
1118- }
1119- teleport_away(m_idx, 10, 0L);
1120- }
1121- break;
1122-
1123- /* RF6_TPORT */
1124- case 160+5:
1125- if (teleport_barrier(m_idx))
1126- {
1127- if (see_m)
1128- {
1129- msg_format(_("魔法のバリアが%^sのテレポートを邪魔した。", "Magic barrier obstructs teleporting of %^s."), m_name);
1130- }
1131- }
1132- else
1133- {
1134- if (see_m)
1135- {
1136- msg_format(_("%^sがテレポートした。", "%^s teleports away."), m_name);
1137- }
1138- teleport_away_followable(m_idx);
1139- }
1140- break;
1141-
1142- /* RF6_WORLD */
1143- case 160+6:
1144-#if 0
1145- int who = 0;
1146- if(m_ptr->r_idx = MON_DIO) who == 1;
1147- else if(m_ptr->r_idx = MON_WONG) who == 3;
1148- dam = who;
1149- if(!process_the_world(randint1(2)+2, who, player_has_los_bold(m_ptr->fy, m_ptr->fx))) return (FALSE);
1150-#endif
1151- return FALSE;
739+ switch (thrown_spell)
740+ {
1152741
1153742 /* RF6_SPECIAL */
1154743 case 160+7:
--- a/src/mspells4.c
+++ b/src/mspells4.c
@@ -47,7 +47,22 @@ bool monster_is_powerful(int m_idx)
4747 return (r_ptr->flags2 & RF2_POWERFUL);
4848 }
4949
50-void monspell_message(int m_idx, int t_idx, cptr msg1, cptr msg2, cptr msg3, int TARGET_TYPE)
50+void monster_wakeup(int t_idx)
51+{
52+ (void)set_monster_csleep(t_idx, 0);
53+}
54+
55+void monster_fear_message(int t_idx)
56+{
57+ char t_name[80];
58+ monster_name(t_idx, t_name);
59+ if (see_monster(t_idx))
60+ {
61+ msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), t_name);
62+ }
63+}
64+
65+void monspell_message_base(int m_idx, int t_idx, cptr msg1, cptr msg2, cptr msg3, cptr msg4, bool msg_flag, int TARGET_TYPE)
5166 {
5267 bool known = monster_near_player(m_idx, t_idx);
5368 bool see_either = see_monster(m_idx) || see_monster(t_idx);
@@ -57,24 +72,25 @@ void monspell_message(int m_idx, int t_idx, cptr msg1, cptr msg2, cptr msg3, int
5772 monster_name(m_idx, m_name);
5873 monster_name(t_idx, t_name);
5974
60-
6175 if (mon_to_player || (mon_to_mon && known && see_either))
6276 disturb(1, 1);
6377
64- if (p_ptr->blind)
78+ if (msg_flag)
6579 {
66- if (mon_to_player || (mon_to_mon && known && see_either))
80+ if (mon_to_player)
6781 msg_format(msg1, m_name);
82+ else if (mon_to_mon && known && see_either)
83+ msg_format(msg2, m_name);
6884 }
6985 else
7086 {
7187 if (mon_to_player)
7288 {
73- msg_format(msg2, m_name);
89+ msg_format(msg3, m_name);
7490 }
7591 else if (mon_to_mon && known && see_either)
7692 {
77- msg_format(msg3, m_name, t_name);
93+ msg_format(msg4, m_name, t_name);
7894 }
7995 }
8096
@@ -82,34 +98,30 @@ void monspell_message(int m_idx, int t_idx, cptr msg1, cptr msg2, cptr msg3, int
8298 mon_fight = TRUE;
8399 }
84100
101+void monspell_message(int m_idx, int t_idx, cptr msg1, cptr msg2, cptr msg3, int TARGET_TYPE)
102+{
103+ monspell_message_base(m_idx, t_idx, msg1, msg1, msg2, msg3, p_ptr->blind, TARGET_TYPE);
104+}
105+
106+void simple_monspell_message(int m_idx, int t_idx, cptr msg1, cptr msg2, int TARGET_TYPE)
107+{
108+ monspell_message_base(m_idx, t_idx, msg1, msg1, msg2, msg2, p_ptr->blind, TARGET_TYPE);
109+}
110+
85111 void spell_RF4_SHRIEK(int m_idx, int t_idx, int TARGET_TYPE)
86112 {
87- bool known = monster_near_player(m_idx, t_idx);
88- bool see_m = see_monster(m_idx);
89- char m_name[80], t_name[80];
90- monster_name(m_idx, m_name);
91- monster_name(t_idx, t_name);
113+ simple_monspell_message(m_idx, t_idx,
114+ _("%^sがかん高い金切り声をあげた。", "%^s makes a high pitched shriek."),
115+ _("%^sが%sに向かって叫んだ。", "%^s shrieks at %s."),
116+ TARGET_TYPE);
92117
93- if (TARGET_TYPE == MONSTER_TO_MONSTER)
118+ if (TARGET_TYPE == MONSTER_TO_PLAYER)
94119 {
95- if (known)
96- {
97- if (see_m)
98- {
99- msg_format(_("%^sが%sに向かって叫んだ。", "%^s shrieks at %s."), m_name, t_name);
100- }
101- else
102- {
103- mon_fight = TRUE;
104- }
105- }
106- (void)set_monster_csleep(t_idx, 0);
120+ aggravate_monsters(m_idx);
107121 }
108- else if (TARGET_TYPE == MONSTER_TO_PLAYER)
122+ else if (TARGET_TYPE == MONSTER_TO_MONSTER)
109123 {
110- disturb(1, 1);
111- msg_format(_("%^sがかん高い金切り声をあげた。", "%^s makes a high pitched shriek."), m_name);
112- aggravate_monsters(m_idx);
124+ monster_wakeup(t_idx);
113125 }
114126 }
115127
@@ -121,34 +133,14 @@ void spell_RF4_DISPEL(int m_idx, int t_idx, int TARGET_TYPE)
121133 monster_name(m_idx, m_name);
122134 monster_name(t_idx, t_name);
123135
136+ monspell_message(m_idx, t_idx,
137+ _("%^sが何かを力強くつぶやいた。", "%^s mumbles powerfully."),
138+ _("%^sが魔力消去の呪文を念じた。", "%^s invokes a dispel magic."),
139+ _("%^sが%sに対して魔力消去の呪文を念じた。", "%^s invokes a dispel magic at %s."),
140+ TARGET_TYPE);
124141
125- if (TARGET_TYPE == MONSTER_TO_MONSTER)
126- {
127- if (known)
128- {
129- if (see_m)
130- {
131- msg_format(_("%^sが%sに対して魔力消去の呪文を念じた。",
132- "%^s invokes a dispel magic at %s."), m_name, t_name);
133- }
134- else
135- {
136- mon_fight = TRUE;
137- }
138- }
139-
140- if (t_idx == p_ptr->riding) dispel_player();
141- dispel_monster_status(t_idx);
142- }
143- else if (TARGET_TYPE == MONSTER_TO_PLAYER)
142+ if (TARGET_TYPE == MONSTER_TO_PLAYER)
144143 {
145- disturb(1, 1);
146-
147- if (p_ptr->blind)
148- msg_format(_("%^sが何かを力強くつぶやいた。", "%^s mumbles powerfully."), m_name);
149- else
150- msg_format(_("%^sが魔力消去の呪文を念じた。", "%^s invokes a dispel magic."), m_name);
151-
152144 dispel_player();
153145 if (p_ptr->riding) dispel_monster_status(p_ptr->riding);
154146
@@ -157,6 +149,11 @@ void spell_RF4_DISPEL(int m_idx, int t_idx, int TARGET_TYPE)
157149
158150 learn_spell(MS_DISPEL);
159151 }
152+ else if (TARGET_TYPE == MONSTER_TO_MONSTER)
153+ {
154+ if (t_idx == p_ptr->riding) dispel_player();
155+ dispel_monster_status(t_idx);
156+ }
160157 }
161158
162159 int spell_RF4_ROCKET(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
@@ -757,7 +754,6 @@ void spell_RF5_CAUSE(int GF_TYPE, int dam, int y, int x, int m_idx, int t_idx, c
757754 monster_name(m_idx, m_name);
758755 monster_name(t_idx, t_name);
759756
760-
761757 if (TARGET_TYPE == MONSTER_TO_PLAYER)
762758 {
763759 disturb(1, 1);
@@ -1058,187 +1054,355 @@ int spell_RF5_MISSILE(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
10581054 return dam;
10591055 }
10601056
1061-void spell_RF5_SCARE(int y, int x, int m_idx)
1057+void spell_badstatus_message(int m_idx, int t_idx, cptr msg1, cptr msg2, cptr msg3, cptr msg4, bool resist, bool saving_throw, int TARGET_TYPE)
10621058 {
1063- int rlev = monster_level_idx(m_idx);
1064- char m_name[80];
1059+ bool see_either = see_monster(m_idx) || see_monster(t_idx);
1060+ bool see_t = see_monster(t_idx);
1061+ bool known = monster_near_player(m_idx, t_idx);
1062+ char m_name[80], t_name[80];
10651063 monster_name(m_idx, m_name);
1066- disturb(1, 1);
1067-
1068-
1069- if (p_ptr->blind)
1070- msg_format(_("%^sが何かをつぶやくと、恐ろしげな音が聞こえた。", "%^s mumbles, and you hear scary noises."), m_name);
1071- else
1072- msg_format(_("%^sが恐ろしげな幻覚を作り出した。", "%^s casts a fearful illusion."), m_name);
1064+ monster_name(t_idx, t_name);
10731065
1074- if (p_ptr->resist_fear)
1075- {
1076- msg_print(_("しかし恐怖に侵されなかった。", "You refuse to be frightened."));
1077- }
1078- else if (randint0(100 + rlev / 2) < p_ptr->skill_sav)
1066+ if (TARGET_TYPE == MONSTER_TO_PLAYER)
10791067 {
1080- msg_print(_("しかし恐怖に侵されなかった。", "You refuse to be frightened."));
1068+ disturb(1, 1);
1069+ if (p_ptr->blind)
1070+ msg_format(msg1, m_name);
1071+ else
1072+ msg_format(msg2, m_name);
1073+
1074+ if (resist)
1075+ {
1076+ msg_print(msg3);
1077+ }
1078+ else if (saving_throw)
1079+ {
1080+ msg_print(msg4);
1081+ }
10811082 }
1082- else
1083+ else if (TARGET_TYPE == MONSTER_TO_MONSTER)
10831084 {
1084- (void)set_afraid(p_ptr->afraid + randint0(4) + 4);
1085+ if (known)
1086+ {
1087+ if (see_either)
1088+ {
1089+ msg_format(msg1, m_name, t_name);
1090+ }
1091+ else
1092+ {
1093+ mon_fight = TRUE;
1094+ }
1095+ }
1096+
1097+ if (resist)
1098+ {
1099+ if (see_t) msg_format(msg2, t_name);
1100+ }
1101+ else if (saving_throw)
1102+ {
1103+ if (see_t) msg_format(msg3, t_name);
1104+ }
1105+ else
1106+ {
1107+ if (see_t) msg_format(msg4, t_name);
1108+ }
1109+ monster_wakeup(t_idx);
10851110 }
1086- learn_spell(MS_SCARE);
1087- update_smart_learn(m_idx, DRS_FEAR);
10881111 }
10891112
1090-void spell_RF5_BLIND(int y, int x, int m_idx)
1113+void spell_RF5_SCARE(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
10911114 {
1115+ monster_type *t_ptr = &m_list[t_idx];
1116+ monster_race *tr_ptr = &r_info[t_ptr->r_idx];
10921117 int rlev = monster_level_idx(m_idx);
1093- char m_name[80];
1094- monster_name(m_idx, m_name);
1095-
1096- disturb(1, 1);
1097-
1098- if (p_ptr->blind)
1099- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
1100- else
1101- msg_format(_("%^sが呪文を唱えてあなたの目をくらました!",
1102- "%^s casts a spell, burning your eyes!"), m_name);
1118+ bool resist, saving_throw;
11031119
1104- if (p_ptr->resist_blind)
1105- {
1106- msg_print(_("しかし効果がなかった!", "You are unaffected!"));
1107- }
1108- else if (randint0(100 + rlev / 2) < p_ptr->skill_sav)
1120+ if (TARGET_TYPE == MONSTER_TO_PLAYER)
11091121 {
1110- msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1122+ resist = p_ptr->resist_fear;
1123+ saving_throw = (randint0(100 + rlev / 2) < p_ptr->skill_sav);
1124+ spell_badstatus_message(m_idx, t_idx,
1125+ _("%^sが何かをつぶやくと、恐ろしげな音が聞こえた。", "%^s mumbles, and you hear scary noises."),
1126+ _("%^sが恐ろしげな幻覚を作り出した。", "%^s casts a fearful illusion."),
1127+ _("しかし恐怖に侵されなかった。", "You refuse to be frightened."),
1128+ _("しかし恐怖に侵されなかった。", "You refuse to be frightened."),
1129+ resist, saving_throw, TARGET_TYPE);
1130+
1131+ if (!resist && !saving_throw)
1132+ {
1133+ (void)set_afraid(p_ptr->afraid + randint0(4) + 4);
1134+ }
1135+ learn_spell(MS_SCARE);
1136+ update_smart_learn(m_idx, DRS_FEAR);
11111137 }
1112- else
1138+ else if (TARGET_TYPE == MONSTER_TO_MONSTER)
11131139 {
1114- (void)set_blind(12 + randint0(4));
1140+ resist = tr_ptr->flags3 & RF3_NO_FEAR;
1141+ saving_throw = (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10);
1142+
1143+ spell_badstatus_message(m_idx, t_idx,
1144+ _("%^sが恐ろしげな幻覚を作り出した。", "%^s casts a fearful illusion in front of %s."),
1145+ _("%^sは恐怖を感じない。", "%^s refuses to be frightened."),
1146+ _("%^sは恐怖を感じない。", "%^s refuses to be frightened."),
1147+ _("%^sは恐怖して逃げ出した!", "%^s flees in terror!"),
1148+ resist, saving_throw, TARGET_TYPE);
1149+
1150+ if (!resist && !saving_throw)
1151+ {
1152+ set_monster_monfear(t_idx, MON_MONFEAR(t_ptr) + randint0(4) + 4);
1153+ }
11151154 }
1116- learn_spell(MS_BLIND);
1117- update_smart_learn(m_idx, DRS_BLIND);
11181155 }
11191156
1120-void spell_RF5_CONF(int y, int x, int m_idx)
1157+void spell_RF5_BLIND(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
11211158 {
1159+ monster_type *t_ptr = &m_list[t_idx];
1160+ monster_race *tr_ptr = &r_info[t_ptr->r_idx];
11221161 int rlev = monster_level_idx(m_idx);
1123- char m_name[80];
1124- monster_name(m_idx, m_name);
1125-
1126- disturb(1, 1);
1127-
1128- if (p_ptr->blind)
1129- msg_format(_("%^sが何かをつぶやくと、頭を悩ます音がした。",
1130- "%^s mumbles, and you hear puzzling noises."), m_name);
1131- else
1132- msg_format(_("%^sが誘惑的な幻覚を作り出した。",
1133- "%^s creates a mesmerising illusion."), m_name);
1162+ bool resist, saving_throw;
11341163
1135- if (p_ptr->resist_conf)
1136- {
1137- msg_print(_("しかし幻覚にはだまされなかった。", "You disbelieve the feeble spell."));
1138- }
1139- else if (randint0(100 + rlev / 2) < p_ptr->skill_sav)
1164+ if (TARGET_TYPE == MONSTER_TO_PLAYER)
11401165 {
1141- msg_print(_("しかし幻覚にはだまされなかった。", "You disbelieve the feeble spell."));
1166+ resist = p_ptr->resist_blind;
1167+ saving_throw = (randint0(100 + rlev / 2) < p_ptr->skill_sav);
1168+ spell_badstatus_message(m_idx, t_idx,
1169+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
1170+ _("%^sが呪文を唱えてあなたの目をくらました!", "%^s casts a spell, burning your eyes!"),
1171+ _("しかし効果がなかった!", "You are unaffected!"),
1172+ _("しかし効力を跳ね返した!", "You resist the effects!"),
1173+ resist, saving_throw, TARGET_TYPE);
1174+
1175+ if (!resist && !saving_throw)
1176+ {
1177+ (void)set_blind(12 + randint0(4));
1178+ }
1179+ learn_spell(MS_BLIND);
1180+ update_smart_learn(m_idx, DRS_BLIND);
11421181 }
1143- else
1182+ else if (TARGET_TYPE == MONSTER_TO_MONSTER)
11441183 {
1145- (void)set_confused(p_ptr->confused + randint0(4) + 4);
1184+ cptr msg1;
1185+ char t_name[80];
1186+ monster_name(t_idx, t_name);
1187+
1188+ if (streq(t_name, "it"))
1189+ {
1190+ msg1 = _("%sは呪文を唱えて%sの目を焼き付かせた。", "%^s casts a spell, burning %ss eyes.");
1191+ }
1192+ else
1193+ {
1194+ msg1 = _("%sは呪文を唱えて%sの目を焼き付かせた。", "%^s casts a spell, burning %s's eyes.");
1195+ }
1196+
1197+ resist = tr_ptr->flags3 & RF3_NO_CONF;
1198+ saving_throw = (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10);
1199+
1200+ spell_badstatus_message(m_idx, t_idx,
1201+ msg1,
1202+ _("%^sには効果がなかった。", "%^s is unaffected."),
1203+ _("%^sには効果がなかった。", "%^s is unaffected."),
1204+ _("%^sは目が見えなくなった! ", "%^s is blinded!"),
1205+ resist, saving_throw, TARGET_TYPE);
1206+
1207+ if (!resist && !saving_throw)
1208+ {
1209+ (void)set_monster_confused(t_idx, MON_CONFUSED(t_ptr) + 12 + randint0(4));
1210+ }
11461211 }
1147- learn_spell(MS_CONF);
1148- update_smart_learn(m_idx, DRS_CONF);
11491212 }
11501213
1151-void spell_RF5_SLOW(int y, int x, int m_idx)
1214+void spell_RF5_CONF(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
11521215 {
1216+ monster_type *t_ptr = &m_list[t_idx];
1217+ monster_race *tr_ptr = &r_info[t_ptr->r_idx];
11531218 int rlev = monster_level_idx(m_idx);
1154- char m_name[80];
1155- monster_name(m_idx, m_name);
1219+ bool resist, saving_throw;
11561220
1157- disturb(1, 1);
1158-
1159- msg_format(_("%^sがあなたの筋力を吸い取ろうとした!",
1160- "%^s drains power from your muscles!"), m_name);
1161-
1162- if (p_ptr->free_act)
1163- {
1164- msg_print(_("しかし効果がなかった!", "You are unaffected!"));
1165- }
1166- else if (randint0(100 + rlev / 2) < p_ptr->skill_sav)
1221+ if (TARGET_TYPE == MONSTER_TO_PLAYER)
11671222 {
1168- msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1223+ resist = p_ptr->resist_conf;
1224+ saving_throw = (randint0(100 + rlev / 2) < p_ptr->skill_sav);
1225+ spell_badstatus_message(m_idx, t_idx,
1226+ _("%^sが何かをつぶやくと、頭を悩ます音がした。", "%^s mumbles, and you hear puzzling noises."),
1227+ _("%^sが誘惑的な幻覚を作り出した。", "%^s creates a mesmerising illusion."),
1228+ _("しかし幻覚にはだまされなかった。", "You disbelieve the feeble spell."),
1229+ _("しかし幻覚にはだまされなかった。", "You disbelieve the feeble spell."),
1230+ resist, saving_throw, TARGET_TYPE);
1231+
1232+ if (!resist && !saving_throw)
1233+ {
1234+ (void)set_confused(p_ptr->confused + randint0(4) + 4);
1235+ }
1236+ learn_spell(MS_CONF);
1237+ update_smart_learn(m_idx, DRS_CONF);
11691238 }
1170- else
1239+ else if (TARGET_TYPE == MONSTER_TO_MONSTER)
11711240 {
1172- (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
1241+ resist = tr_ptr->flags3 & RF3_NO_CONF;
1242+ saving_throw = (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10);
1243+
1244+ spell_badstatus_message(m_idx, t_idx,
1245+ _("%^sが%sの前に幻惑的な幻をつくり出した。", "%^s casts a mesmerizing illusion in front of %s."),
1246+ _("%^sは惑わされなかった。", "%^s disbelieves the feeble spell."),
1247+ _("%^sは惑わされなかった。", "%^s disbelieves the feeble spell."),
1248+ _("%^sは混乱したようだ。", "%^s seems confused."),
1249+ resist, saving_throw, TARGET_TYPE);
1250+
1251+ if (!resist && !saving_throw)
1252+ {
1253+ (void)set_monster_confused(t_idx, MON_CONFUSED(t_ptr) + 12 + randint0(4));
1254+ }
11731255 }
1174- learn_spell(MS_SLOW);
1175- update_smart_learn(m_idx, DRS_FREE);
11761256 }
11771257
1178-void spell_RF5_HOLD(int y, int x, int m_idx)
1258+
1259+void spell_RF5_SLOW(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
11791260 {
1261+ monster_type *t_ptr = &m_list[t_idx];
1262+ monster_race *tr_ptr = &r_info[t_ptr->r_idx];
11801263 int rlev = monster_level_idx(m_idx);
1181- char m_name[80];
1182- monster_name(m_idx, m_name);
1183- disturb(1, 1);
1264+ bool resist, saving_throw;
11841265
1185- if (p_ptr->blind)
1186- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
1187- else
1188- msg_format(_("%^sがあなたの目をじっと見つめた!", "%^s stares deep into your eyes!"), m_name);
1266+ if (TARGET_TYPE == MONSTER_TO_PLAYER)
1267+ {
1268+ resist = p_ptr->resist_conf;
1269+ saving_throw = (randint0(100 + rlev / 2) < p_ptr->skill_sav);
1270+ spell_badstatus_message(m_idx, t_idx,
1271+ _("%^sがあなたの筋力を吸い取ろうとした!", "%^s drains power from your muscles!"),
1272+ _("%^sがあなたの筋力を吸い取ろうとした!", "%^s drains power from your muscles!"),
1273+ _("しかし効果がなかった!", "You are unaffected!"),
1274+ _("しかし効力を跳ね返した!", "You resist the effects!"),
1275+ resist, saving_throw, TARGET_TYPE);
11891276
1190- if (p_ptr->free_act)
1277+ if (!resist && !saving_throw)
1278+ {
1279+ (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
1280+ }
1281+ learn_spell(MS_SLOW);
1282+ update_smart_learn(m_idx, DRS_FREE);
1283+ }
1284+ else if (TARGET_TYPE == MONSTER_TO_MONSTER)
11911285 {
1192- msg_print(_("しかし効果がなかった!", "You are unaffected!"));
1286+ cptr msg1;
1287+ char t_name[80];
1288+ monster_name(t_idx, t_name);
1289+
1290+ if (streq(t_name, "it"))
1291+ {
1292+ msg1 = _("%sが%sの筋肉から力を吸いとった。", "%^s drains power from %ss muscles.");
1293+ }
1294+ else
1295+ {
1296+ msg1 = _("%sが%sの筋肉から力を吸いとった。", "%^s drains power from %s's muscles.");
1297+ }
1298+
1299+ resist = tr_ptr->flags1 & RF1_UNIQUE;
1300+ saving_throw = (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10);
1301+
1302+ spell_badstatus_message(m_idx, t_idx,
1303+ msg1,
1304+ _("%^sには効果がなかった。", "%^s is unaffected."),
1305+ _("%^sには効果がなかった。", "%^s is unaffected."),
1306+ _("%sの動きが遅くなった。", "%^s starts moving slower."),
1307+ resist, saving_throw, TARGET_TYPE);
1308+
1309+ if (!resist && !saving_throw)
1310+ {
1311+ set_monster_slow(t_idx, MON_SLOW(t_ptr) + 50);
1312+ }
11931313 }
1194- else if (randint0(100 + rlev / 2) < p_ptr->skill_sav)
1314+}
1315+
1316+void spell_RF5_HOLD(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
1317+{
1318+ monster_type *t_ptr = &m_list[t_idx];
1319+ monster_race *tr_ptr = &r_info[t_ptr->r_idx];
1320+ int rlev = monster_level_idx(m_idx);
1321+ bool resist, saving_throw;
1322+
1323+ if (TARGET_TYPE == MONSTER_TO_PLAYER)
11951324 {
1196- msg_format(_("しかし効力を跳ね返した!", "You resist the effects!"));
1325+ resist = p_ptr->free_act;
1326+ saving_throw = (randint0(100 + rlev / 2) < p_ptr->skill_sav);
1327+ spell_badstatus_message(m_idx, t_idx,
1328+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
1329+ _("%^sがあなたの目をじっと見つめた!", "%^s stares deep into your eyes!"),
1330+ _("しかし効果がなかった!", "You are unaffected!"),
1331+ _("しかし効力を跳ね返した!", "You resist the effects!"),
1332+ resist, saving_throw, TARGET_TYPE);
1333+
1334+ if (!resist && !saving_throw)
1335+ {
1336+ (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
1337+ }
1338+ learn_spell(MS_SLEEP);
1339+ update_smart_learn(m_idx, DRS_FREE);
11971340 }
1198- else
1341+ else if (TARGET_TYPE == MONSTER_TO_MONSTER)
11991342 {
1200- (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
1343+ resist = (tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flags3 & RF3_NO_STUN);
1344+ saving_throw = (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10);
1345+
1346+ spell_badstatus_message(m_idx, t_idx,
1347+ _("%^sは%sをじっと見つめた。", "%^s stares intently at %s."),
1348+ _("%^sには効果がなかった。", "%^s is unaffected."),
1349+ _("%^sには効果がなかった。", "%^s is unaffected."),
1350+ _("%^sは麻痺した!", "%^s is paralyzed!"),
1351+ resist, saving_throw, TARGET_TYPE);
1352+
1353+ if (!resist && !saving_throw)
1354+ {
1355+ (void)set_monster_stunned(t_idx, MON_STUNNED(t_ptr) + randint1(4) + 4);
1356+ }
12011357 }
1202- learn_spell(MS_SLEEP);
1203- update_smart_learn(m_idx, DRS_FREE);
12041358 }
12051359
1206-void spell_RF6_HASTE(int m_idx)
1360+void spell_RF6_HASTE(int m_idx, int t_idx, int TARGET_TYPE)
12071361 {
1362+ bool see_m = see_monster(m_idx);
12081363 monster_type *m_ptr = &m_list[m_idx];
12091364 char m_name[80];
12101365 monster_name(m_idx, m_name);
1211- disturb(1, 1);
1212- if (p_ptr->blind)
1213- {
1214- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
1215- }
1216- else
1217- {
1218- msg_format(_("%^sが自分の体に念を送った。", "%^s concentrates on %s body."), m_name);
1219- }
1366+
1367+ monspell_message_base(m_idx, t_idx,
1368+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
1369+ _("%^sが自分の体に念を送った。", "%^s concentrates on %s body."),
1370+ _("%^sが自分の体に念を送った。", "%^s concentrates on %s body."),
1371+ _("%^sが自分の体に念を送った。", "%^s concentrates on %s body."),
1372+ p_ptr->blind, TARGET_TYPE);
12201373
12211374 /* Allow quick speed increases to base+10 */
12221375 if (set_monster_fast(m_idx, MON_FAST(m_ptr) + 100))
12231376 {
1224- msg_format(_("%^sの動きが速くなった。", "%^s starts moving faster."), m_name);
1377+ if (TARGET_TYPE == MONSTER_TO_PLAYER ||
1378+ (TARGET_TYPE == MONSTER_TO_MONSTER && see_m))
1379+ msg_format(_("%^sの動きが速くなった。", "%^s starts moving faster."), m_name);
12251380 }
12261381 }
12271382
1228-int spell_RF6_HAND_DOOM(int y, int x, int m_idx)
1383+int spell_RF6_HAND_DOOM(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
12291384 {
1230- monster_type *m_ptr = &m_list[m_idx];
12311385 int dam;
1232- char m_name[80];
1233- monster_name(m_idx, m_name);
1234- disturb(1, 1);
1235- msg_format(_("%^sが<破滅の手>を放った!", "%^s invokes the Hand of Doom!"), m_name);
1236- dam = (((s32b)((40 + randint1(20)) * (p_ptr->chp))) / 100);
1237- breath(y, x, m_idx, GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM, MONSTER_TO_PLAYER);
1386+
1387+ simple_monspell_message(m_idx, t_idx,
1388+ _("%^sが<破滅の手>を放った!", "%^s invokes the Hand of Doom!"),
1389+ _("%^sが%sに<破滅の手>を放った!", "%^s invokes the Hand of Doom upon %s!"),
1390+ TARGET_TYPE);
1391+
1392+ if (TARGET_TYPE == MONSTER_TO_PLAYER)
1393+ {
1394+ dam = (((s32b)((40 + randint1(20)) * (p_ptr->chp))) / 100);
1395+ breath(y, x, m_idx, GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM, MONSTER_TO_PLAYER);
1396+ }
1397+ else if (TARGET_TYPE == MONSTER_TO_MONSTER)
1398+ {
1399+ dam = 20; /* Dummy power */
1400+ breath(y, x, m_idx, GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM, MONSTER_TO_MONSTER);
1401+ }
12381402 return dam;
12391403 }
12401404
1241-void spell_RF6_HEAL(int m_idx)
1405+void spell_RF6_HEAL(int m_idx, int t_idx, int TARGET_TYPE)
12421406 {
12431407 monster_type *m_ptr = &m_list[m_idx];
12441408 int rlev = monster_level_idx(m_idx);
@@ -1249,10 +1413,12 @@ void spell_RF6_HEAL(int m_idx)
12491413 disturb(1, 1);
12501414
12511415 /* Message */
1252- if (p_ptr->blind)
1253- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
1254- else
1255- msg_format(_("%^sが自分の傷に集中した。", "%^s concentrates on %s wounds."), m_name);
1416+ monspell_message_base(m_idx, t_idx,
1417+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
1418+ _("%^sは自分の傷に念を集中した。", "%^s concentrates on %s wounds."),
1419+ _("%^sが自分の傷に集中した。", "%^s concentrates on %s wounds."),
1420+ _("%^sは自分の傷に念を集中した。", "%^s concentrates on %s wounds."),
1421+ p_ptr->blind, TARGET_TYPE);
12561422
12571423 /* Heal some */
12581424 m_ptr->hp += (rlev * 6);
@@ -1264,20 +1430,24 @@ void spell_RF6_HEAL(int m_idx)
12641430 m_ptr->hp = m_ptr->maxhp;
12651431
12661432 /* Message */
1267- if (seen)
1268- msg_format(_("%^sは完全に治った!", "%^s looks completely healed!"), m_name);
1269- else
1270- msg_format(_("%^sは完全に治ったようだ!", "%^s sounds completely healed!"), m_name);
1433+ monspell_message_base(m_idx, t_idx,
1434+ _("%^sは完全に治ったようだ!", "%^s sounds completely healed!"),
1435+ _("%^sは完全に治ったようだ!", "%^s sounds completely healed!"),
1436+ _("%^sは完全に治った!", "%^s looks completely healed!"),
1437+ _("%^sは完全に治った!", "%^s looks completely healed!"),
1438+ !seen, TARGET_TYPE);
12711439 }
12721440
12731441 /* Partially healed */
12741442 else
12751443 {
12761444 /* Message */
1277- if (seen)
1278- msg_format(_("%^sは体力を回復したようだ。", "%^s looks healthier."), m_name);
1279- else
1280- msg_format(_("%^sは体力を回復したようだ。", "%^s sounds healthier."), m_name);
1445+ monspell_message_base(m_idx, t_idx,
1446+ _("%^sは体力を回復したようだ。", "%^s sounds healthier."),
1447+ _("%^sは体力を回復したようだ。", "%^s sounds healthier."),
1448+ _("%^sは体力を回復したようだ。", "%^s looks healthier."),
1449+ _("%^sは体力を回復したようだ。", "%^s looks healthier."),
1450+ !seen, TARGET_TYPE);
12811451 }
12821452
12831453 /* Redraw (later) if needed */
@@ -1291,59 +1461,70 @@ void spell_RF6_HEAL(int m_idx)
12911461 (void)set_monster_monfear(m_idx, 0);
12921462
12931463 /* Message */
1294- msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name);
1464+ if (see_monster(m_idx))
1465+ msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name);
12951466 }
12961467 }
1297-void spell_RF6_INVULNER(int m_idx)
1468+void spell_RF6_INVULNER(int m_idx, int t_idx, int TARGET_TYPE)
12981469 {
12991470 monster_type *m_ptr = &m_list[m_idx];
13001471 bool seen = (!p_ptr->blind && m_ptr->ml);
1301- char m_name[80];
1302- monster_name(m_idx, m_name);
1303- disturb(1, 1);
13041472
13051473 /* Message */
1306- if (!seen)
1307- msg_format(_("%^sが何かを力強くつぶやいた。", "%^s mumbles powerfully."), m_name);
1308- else
1309- msg_format(_("%sは無傷の球の呪文を唱えた。", "%^s casts a Globe of Invulnerability."), m_name);
1474+ monspell_message_base(m_idx, t_idx,
1475+ _("%^sが何かを力強くつぶやいた。", "%^s mumbles powerfully."),
1476+ _("%^sが何かを力強くつぶやいた。", "%^s mumbles powerfully."),
1477+ _("%sは無傷の球の呪文を唱えた。", "%^s casts a Globe of Invulnerability."),
1478+ _("%sは無傷の球の呪文を唱えた。", "%^s casts a Globe of Invulnerability."),
1479+ !seen, TARGET_TYPE);
13101480
13111481 if (!MON_INVULNER(m_ptr)) (void)set_monster_invulner(m_idx, randint1(4) + 4, FALSE);
13121482 }
13131483
1314-void spell_RF6_BLINK(int m_idx)
1484+void spell_RF6_BLINK(int m_idx, int TARGET_TYPE)
13151485 {
13161486 char m_name[80];
13171487 monster_name(m_idx, m_name);
1488+
1489+ if (TARGET_TYPE==MONSTER_TO_PLAYER)
1490+ disturb(1, 1);
13181491
1319- disturb(1, 1);
13201492 if (teleport_barrier(m_idx))
13211493 {
1322- msg_format(_("魔法のバリアが%^sのテレポートを邪魔した。",
1323- "Magic barrier obstructs teleporting of %^s."), m_name);
1494+ if(see_monster(m_idx))
1495+ msg_format(_("魔法のバリアが%^sのテレポートを邪魔した。",
1496+ "Magic barrier obstructs teleporting of %^s."), m_name);
13241497 }
13251498 else
13261499 {
1327- msg_format(_("%^sが瞬時に消えた。", "%^s blinks away."), m_name);
1500+ if(see_monster(m_idx))
1501+ msg_format(_("%^sが瞬時に消えた。", "%^s blinks away."), m_name);
1502+
13281503 teleport_away(m_idx, 10, 0L);
1329- p_ptr->update |= (PU_MONSTERS);
1504+
1505+ if (TARGET_TYPE==MONSTER_TO_PLAYER)
1506+ p_ptr->update |= (PU_MONSTERS);
13301507 }
13311508 }
13321509
1333-void spell_RF6_TPORT(int m_idx)
1510+void spell_RF6_TPORT(int m_idx, int TARGET_TYPE)
13341511 {
13351512 char m_name[80];
13361513 monster_name(m_idx, m_name);
1337-
1338- disturb(1, 1);
1514+
1515+ if (TARGET_TYPE==MONSTER_TO_PLAYER)
1516+ disturb(1, 1);
13391517 if (teleport_barrier(m_idx))
13401518 {
1341- msg_format(_("魔法のバリアが%^sのテレポートを邪魔した。",
1342- "Magic barrier obstructs teleporting of %^s."), m_name);
1519+ if(see_monster(m_idx))
1520+ msg_format(_("魔法のバリアが%^sのテレポートを邪魔した。",
1521+ "Magic barrier obstructs teleporting of %^s."), m_name);
13431522 }
13441523 else
13451524 {
1346- msg_format(_("%^sがテレポートした。", "%^s teleports away."), m_name);
1525+ if(see_monster(m_idx))
1526+ msg_format(_("%^sがテレポートした。", "%^s teleports away."), m_name);
1527+
13471528 teleport_away_followable(m_idx);
13481529 }
13491530 }
@@ -2216,3 +2397,186 @@ void spell_RF6_S_UNIQUE(int y, int x, int m_idx)
22162397 }
22172398 }
22182399
2400+
2401+int monspell_to_player(int SPELL_NUM, int y, int x, int m_idx)
2402+{
2403+ switch (SPELL_NUM)
2404+ {
2405+ case 96 + 0: spell_RF4_SHRIEK(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_SHRIEK */
2406+ case 96 + 1: break; /* RF4_XXX1 */
2407+ case 96 + 2: spell_RF4_DISPEL(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF4_DISPEL */
2408+ case 96 + 3: return spell_RF4_ROCKET(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_ROCKET */
2409+ case 96 + 4: return spell_RF4_SHOOT(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_SHOOT */
2410+ case 96 + 5: break; /* RF4_XXX2 */
2411+ case 96 + 6: break; /* RF4_XXX3 */
2412+ case 96 + 7: break; /* RF4_XXX4 */
2413+ case 96 + 8: return spell_RF4_BREATH(GF_ACID, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_ACID */
2414+ case 96 + 9: return spell_RF4_BREATH(GF_ELEC, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_ELEC */
2415+ case 96 + 10: return spell_RF4_BREATH(GF_FIRE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_FIRE */
2416+ case 96 + 11: return spell_RF4_BREATH(GF_COLD, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_COLD */
2417+ case 96 + 12: return spell_RF4_BREATH(GF_POIS, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_POIS */
2418+ case 96 + 13: return spell_RF4_BREATH(GF_NETHER, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_NETH */
2419+ case 96 + 14: return spell_RF4_BREATH(GF_LITE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_LITE */
2420+ case 96 + 15: return spell_RF4_BREATH(GF_DARK, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_DARK */
2421+ case 96 + 16: return spell_RF4_BREATH(GF_CONFUSION, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_CONF */
2422+ case 96 + 17: return spell_RF4_BREATH(GF_SOUND, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_SOUN */
2423+ case 96 + 18: return spell_RF4_BREATH(GF_CHAOS, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_CHAO */
2424+ case 96 + 19: return spell_RF4_BREATH(GF_DISENCHANT, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_DISE */
2425+ case 96 + 20: return spell_RF4_BREATH(GF_NEXUS, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_NEXU */
2426+ case 96 + 21: return spell_RF4_BREATH(GF_TIME, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_TIME */
2427+ case 96 + 22: return spell_RF4_BREATH(GF_INERTIA, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_INER */
2428+ case 96 + 23: return spell_RF4_BREATH(GF_GRAVITY, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_GRAV */
2429+ case 96 + 24: return spell_RF4_BREATH(GF_SHARDS, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_SHAR */
2430+ case 96 + 25: return spell_RF4_BREATH(GF_PLASMA, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_PLAS */
2431+ case 96 + 26: return spell_RF4_BREATH(GF_FORCE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_WALL */
2432+ case 96 + 27: return spell_RF4_BREATH(GF_MANA, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_MANA */
2433+ case 96 + 28: return spell_RF4_BA_NUKE(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BA_NUKE */
2434+ case 96 + 29: return spell_RF4_BREATH(GF_NUKE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_NUKE */
2435+ case 96 + 30: return spell_RF4_BA_CHAO(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BA_CHAO */
2436+ case 96 + 31: return spell_RF4_BREATH(GF_DISINTEGRATE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_DISI */
2437+ case 128 + 0: return spell_RF5_BA_ACID(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BA_ACID */
2438+ case 128 + 1: return spell_RF5_BA_ELEC(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BA_ELEC */
2439+ case 128 + 2: return spell_RF5_BA_FIRE(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BA_FIRE */
2440+ case 128 + 3: return spell_RF5_BA_COLD(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BA_COLD */
2441+ case 128 + 4: return spell_RF5_BA_POIS(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BA_POIS */
2442+ case 128 + 5: return spell_RF5_BA_NETH(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BA_NETH */
2443+ case 128 + 6: return spell_RF5_BA_WATE(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BA_WATE */
2444+ case 128 + 7: return spell_RF5_BA_MANA(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BA_MANA */
2445+ case 128 + 8: return spell_RF5_BA_DARK(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BA_DARK */
2446+ case 128 + 9: return spell_RF5_DRAIN_MANA(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_DRAIN_MANA */
2447+ case 128 + 10: return spell_RF5_MIND_BLAST(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_MIND_BLAST */
2448+ case 128 + 11: return spell_RF5_BRAIN_SMASH(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_MIND_BLAST */
2449+ case 128 + 12: return spell_RF5_CAUSE_1(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_CAUSE_1 */
2450+ case 128 + 13: return spell_RF5_CAUSE_2(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_CAUSE_2 */
2451+ case 128 + 14: return spell_RF5_CAUSE_3(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_CAUSE_3 */
2452+ case 128 + 15: return spell_RF5_CAUSE_4(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_CAUSE_4 */
2453+ case 128 + 16: return spell_RF5_BO_ACID(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BO_ACID */
2454+ case 128 + 17: return spell_RF5_BO_ELEC(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BO_ELEC */
2455+ case 128 + 18: return spell_RF5_BO_FIRE(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BO_FIRE */
2456+ case 128 + 19: return spell_RF5_BO_COLD(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BO_COLD */
2457+ case 128 + 20: return spell_RF5_BA_LITE(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BA_LITE */
2458+ case 128 + 21: return spell_RF5_BO_NETH(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BO_NETH */
2459+ case 128 + 22: return spell_RF5_BO_WATE(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BO_WATE */
2460+ case 128 + 23: return spell_RF5_BO_MANA(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BO_MANA */
2461+ case 128 + 24: return spell_RF5_BO_PLAS(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BO_PLAS */
2462+ case 128 + 25: return spell_RF5_BO_ICEE(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BO_ICEE */
2463+ case 128 + 26: return spell_RF5_MISSILE(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_MISSILE */
2464+ case 128 + 27: spell_RF5_SCARE(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_SCARE */
2465+ case 128 + 28: spell_RF5_BLIND(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_BLIND */
2466+ case 128 + 29: spell_RF5_CONF(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_CONF */
2467+ case 128 + 30: spell_RF5_SLOW(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_SLOW */
2468+ case 128 + 31: spell_RF5_HOLD(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF5_HOLD */
2469+ case 160 + 0: spell_RF6_HASTE(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_HASTE */
2470+ case 160 + 1: return spell_RF6_HAND_DOOM(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF6_HAND_DOOM */
2471+ case 160 + 2: spell_RF6_HEAL(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_HEAL */
2472+ case 160 + 3: spell_RF6_INVULNER(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_INVULNER */
2473+ case 160 + 4: spell_RF6_BLINK(m_idx, MONSTER_TO_PLAYER); break; /* RF6_BLINK */
2474+ case 160 + 5: spell_RF6_TPORT(m_idx, MONSTER_TO_PLAYER); break; /* RF6_TPORT */
2475+ case 160 + 6: return spell_RF6_WORLD(m_idx); break; /* RF6_WORLD */
2476+ case 160 + 7: return spell_RF6_SPECIAL(y, x, m_idx); /* RF6_SPECIAL */
2477+ case 160 + 8: spell_RF6_TELE_TO(m_idx); break; /* RF6_TELE_TO */
2478+ case 160 + 9: spell_RF6_TELE_AWAY(m_idx); break; /* RF6_TELE_AWAY */
2479+ case 160 + 10: spell_RF6_TELE_LEVEL(m_idx); break; /* RF6_TELE_LEVEL */
2480+ case 160 + 11: spell_RF6_PSY_SPEAR(y, x, m_idx); break; /* RF6_PSY_SPEAR */
2481+ case 160 + 12: spell_RF6_DARKNESS(m_idx); break; /* RF6_DARKNESS */
2482+ case 160 + 13: spell_RF6_TRAPS(y, x, m_idx); break; /* RF6_TRAPS */
2483+ case 160 + 14: spell_RF6_FORGET(m_idx); break; /* RF6_FORGET */
2484+ case 160 + 15: spell_RF6_RAISE_DEAD(m_idx); break; /* RF6_RAISE_DEAD */
2485+ case 160 + 16: spell_RF6_S_KIN(y, x, m_idx); break; /* RF6_S_KIN */
2486+ case 160 + 17: spell_RF6_S_CYBER(y, x, m_idx); break; /* RF6_S_CYBER */
2487+ case 160 + 18: spell_RF6_S_MONSTER(y, x, m_idx); break; /* RF6_S_MONSTER */
2488+ case 160 + 19: spell_RF6_S_MONSTERS(y, x, m_idx); break; /* RF6_S_MONSTER */
2489+ case 160 + 20: spell_RF6_S_ANT(y, x, m_idx); break; /* RF6_S_ANT */
2490+ case 160 + 21: spell_RF6_S_SPIDER(y, x, m_idx); break; /* RF6_S_SPIDER */
2491+ case 160 + 22: spell_RF6_S_HOUND(y, x, m_idx); break; /* RF6_S_HOUND */
2492+ case 160 + 23: spell_RF6_S_HYDRA(y, x, m_idx); break; /* RF6_S_HYDRA */
2493+ case 160 + 24: spell_RF6_S_ANGEL(y, x, m_idx); break; /* RF6_S_ANGEL */
2494+ case 160 + 25: spell_RF6_S_DEMON(y, x, m_idx); break; /* RF6_S_DEMON */
2495+ case 160 + 26: spell_RF6_S_UNDEAD(y, x, m_idx); break; /* RF6_S_UNDEAD */
2496+ case 160 + 27: spell_RF6_S_DRAGON(y, x, m_idx); break; /* RF6_S_DRAGON */
2497+ case 160 + 28: spell_RF6_S_HI_UNDEAD(y, x, m_idx); break; /* RF6_S_HI_UNDEAD */
2498+ case 160 + 29: spell_RF6_S_HI_DRAGON(y, x, m_idx); break; /* RF6_S_HI_DRAGON */
2499+ case 160 + 30: spell_RF6_S_AMBERITES(y, x, m_idx); break; /* RF6_S_AMBERITES */
2500+ case 160 + 31: spell_RF6_S_UNIQUE(y, x, m_idx); break; /* RF6_S_UNIQUE */
2501+ }
2502+ return 0;
2503+}
2504+
2505+int monspell_to_monster(int SPELL_NUM, int y, int x, int m_idx, int t_idx)
2506+{
2507+ switch (SPELL_NUM)
2508+ {
2509+ case 96 + 0: spell_RF4_SHRIEK(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_SHRIEK */
2510+ case 96 + 1: return -1; /* RF4_XXX1 */
2511+ case 96 + 2: spell_RF4_DISPEL(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_DISPEL */
2512+ case 96 + 3: return spell_RF4_ROCKET(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_ROCKET */
2513+ case 96 + 4: return spell_RF4_SHOOT(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_SHOOT */
2514+ case 96 + 5: return -1; /* RF4_XXX2 */
2515+ case 96 + 6: return -1; /* RF4_XXX3 */
2516+ case 96 + 7: return -1; /* RF4_XXX4 */
2517+ case 96 + 8: return spell_RF4_BREATH(GF_ACID, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_ACID */
2518+ case 96 + 9: return spell_RF4_BREATH(GF_ELEC, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_ELEC */
2519+ case 96 + 10: return spell_RF4_BREATH(GF_FIRE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_FIRE */
2520+ case 96 + 11: return spell_RF4_BREATH(GF_COLD, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_COLD */
2521+ case 96 + 12: return spell_RF4_BREATH(GF_POIS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_POIS */
2522+ case 96 + 13: return spell_RF4_BREATH(GF_NETHER, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_NETH */
2523+ case 96 + 14: return spell_RF4_BREATH(GF_LITE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_LITE */
2524+ case 96 + 15: return spell_RF4_BREATH(GF_DARK, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_DARK */
2525+ case 96 + 16: return spell_RF4_BREATH(GF_CONFUSION, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_CONF */
2526+ case 96 + 17: return spell_RF4_BREATH(GF_SOUND, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_SOUN */
2527+ case 96 + 18: return spell_RF4_BREATH(GF_CHAOS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_CHAO */
2528+ case 96 + 19: return spell_RF4_BREATH(GF_DISENCHANT, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_DISE */
2529+ case 96 + 20: return spell_RF4_BREATH(GF_NEXUS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_NEXU */
2530+ case 96 + 21: return spell_RF4_BREATH(GF_TIME, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_TIME */
2531+ case 96 + 22: return spell_RF4_BREATH(GF_INERTIA, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_INER */
2532+ case 96 + 23: return spell_RF4_BREATH(GF_GRAVITY, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_GRAV */
2533+ case 96 + 24: return spell_RF4_BREATH(GF_SHARDS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_SHAR */
2534+ case 96 + 25: return spell_RF4_BREATH(GF_PLASMA, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_PLAS */
2535+ case 96 + 26: return spell_RF4_BREATH(GF_FORCE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_WALL */
2536+ case 96 + 27: return spell_RF4_BREATH(GF_MANA, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_MANA */
2537+ case 96 + 28: return spell_RF4_BA_NUKE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BA_NUKE */
2538+ case 96 + 29: return spell_RF4_BREATH(GF_NUKE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_NUKE */
2539+ case 96 + 30: return spell_RF4_BA_CHAO(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BA_CHAO */
2540+ case 96 + 31: return spell_RF4_BREATH(GF_DISINTEGRATE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_DISI */
2541+ case 128 + 0: return spell_RF5_BA_ACID(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BA_ACID */
2542+ case 128 + 1: return spell_RF5_BA_ELEC(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BA_ELEC */
2543+ case 128 + 2: return spell_RF5_BA_FIRE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BA_FIRE */
2544+ case 128 + 3: return spell_RF5_BA_COLD(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BA_COLD */
2545+ case 128 + 4: return spell_RF5_BA_POIS(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BA_POIS */
2546+ case 128 + 5: return spell_RF5_BA_NETH(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BA_NETH */
2547+ case 128 + 6: return spell_RF5_BA_WATE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BA_WATE */
2548+ case 128 + 7: return spell_RF5_BA_MANA(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BA_MANA */
2549+ case 128 + 8: return spell_RF5_BA_DARK(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BA_DARK */
2550+ case 128 + 9: return spell_RF5_DRAIN_MANA(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_DRAIN_MANA */
2551+ case 128 + 10: return spell_RF5_MIND_BLAST(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_MIND_BLAST */
2552+ case 128 + 11: return spell_RF5_BRAIN_SMASH(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BRAIN_SMASH */
2553+ case 128 + 12: return spell_RF5_CAUSE_1(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_CAUSE_1 */
2554+ case 128 + 13: return spell_RF5_CAUSE_2(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_CAUSE_2 */
2555+ case 128 + 14: return spell_RF5_CAUSE_3(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_CAUSE_3 */
2556+ case 128 + 15: return spell_RF5_CAUSE_4(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_CAUSE_4 */
2557+ case 128 + 16: return spell_RF5_BO_ACID(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BO_ACID */
2558+ case 128 + 17: return spell_RF5_BO_ELEC(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BO_ELEC */
2559+ case 128 + 18: return spell_RF5_BO_FIRE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BO_FIRE */
2560+ case 128 + 19: return spell_RF5_BO_COLD(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BO_COLD */
2561+ case 128 + 20: return spell_RF5_BA_LITE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BA_LITE */
2562+ case 128 + 21: return spell_RF5_BO_NETH(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BO_NETH */
2563+ case 128 + 22: return spell_RF5_BO_WATE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BO_WATE */
2564+ case 128 + 23: return spell_RF5_BO_MANA(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BO_MANA */
2565+ case 128 + 24: return spell_RF5_BO_PLAS(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BO_PLAS */
2566+ case 128 + 25: return spell_RF5_BO_ICEE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BO_ICEE */
2567+ case 128 + 26: return spell_RF5_MISSILE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_MISSILE */
2568+ case 128 + 27: spell_RF5_SCARE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_SCARE */
2569+ case 128 + 28: spell_RF5_BLIND(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BLIND */
2570+ case 128 + 29: spell_RF5_CONF(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_CONF */
2571+ case 128 + 30: spell_RF5_SLOW(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_SLOW */
2572+ case 128 + 31: spell_RF5_HOLD(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_HOLD */
2573+ case 160 + 0: spell_RF6_HASTE(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_HASTE */
2574+ case 160 + 1: return spell_RF6_HAND_DOOM(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF6_HAND_DOOM */
2575+ case 160 + 2: spell_RF6_HEAL(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_HEAL */
2576+ case 160 + 3: spell_RF6_INVULNER(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_INVULNER */
2577+ case 160 + 4: spell_RF6_BLINK(m_idx, MONSTER_TO_MONSTER); break; /* RF6_BLINK */
2578+ case 160 + 5: spell_RF6_TPORT(m_idx, MONSTER_TO_MONSTER); break; /* RF6_TPORT */
2579+ case 160 + 6: return -1; break; /* RF6_WORLD */
2580+ }
2581+ return 0;
2582+}
\ No newline at end of file
Show on old repository browser