• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision3be94aee9b82cf61ba500a11a8d290dd21944902 (tree)
Time2014-02-24 00:11:43
Authordis- <dis.rogue@gmai...>
Commiterdis-

Log Message

refactor: extract summoning functions in monst_spell_monst

Change Summary

Incremental Difference

--- a/src/externs.h
+++ b/src/externs.h
@@ -1598,28 +1598,6 @@ extern bool spell_learnable(int m_idx);
15981598 extern int monspell_to_player(int SPELL_NUM, int y, int x, int m_idx);
15991599 extern int monspell_to_monster(int SPELL_NUM, int y, int x, int m_idx, int t_idx);
16001600
1601-extern int spell_RF6_PSY_SPEAR(int y, int x, int m_idx);
1602-extern void spell_RF6_DARKNESS(int m_idx);
1603-extern void spell_RF6_TRAPS(int y, int x, int m_idx);
1604-extern void spell_RF6_FORGET(int m_idx);
1605-extern void spell_RF6_RAISE_DEAD(int m_idx);
1606-extern void spell_RF6_S_KIN(int y, int x, int m_idx);
1607-extern void spell_RF6_S_CYBER(int y, int x, int m_idx);
1608-extern void spell_RF6_S_MONSTER(int y, int x, int m_idx);
1609-extern void spell_RF6_S_MONSTERS(int y, int x, int m_idx);
1610-extern void spell_RF6_S_ANT(int y, int x, int m_idx);
1611-extern void spell_RF6_S_SPIDER(int y, int x, int m_idx);
1612-extern void spell_RF6_S_HOUND(int y, int x, int m_idx);
1613-extern void spell_RF6_S_HYDRA(int y, int x, int m_idx);
1614-extern void spell_RF6_S_ANGEL(int y, int x, int m_idx);
1615-extern void spell_RF6_S_DEMON(int y, int x, int m_idx);
1616-extern void spell_RF6_S_UNDEAD(int y, int x, int m_idx);
1617-extern void spell_RF6_S_DRAGON(int y, int x, int m_idx);
1618-extern void spell_RF6_S_HI_UNDEAD(int y, int x, int m_idx);
1619-extern void spell_RF6_S_HI_DRAGON(int y, int x, int m_idx);
1620-extern void spell_RF6_S_AMBERITES(int y, int x, int m_idx);
1621-extern void spell_RF6_S_UNIQUE(int y, int x, int m_idx);
1622-
16231601 /* hissatsu.c */
16241602 extern void hissatsu_info(char *p, int power);
16251603 extern void do_cmd_hissatsu(void);
--- a/src/mspells2.c
+++ b/src/mspells2.c
@@ -736,684 +736,6 @@ bool monst_spell_monst(int m_idx)
736736 dam = monspell_to_monster(thrown_spell, y, x, m_idx, t_idx);
737737 if (dam < 0)return FALSE;
738738
739- switch (thrown_spell)
740- {
741-
742- /* RF6_PSY_SPEAR */
743- case 160+11:
744- if (known)
745- {
746- if (see_either)
747- {
748- msg_format(_("%^sが%sに向かって光の剣を放った。", "%^s throw a Psycho-spear at %s."), m_name, t_name);
749- }
750- else
751- {
752- mon_fight = TRUE;
753- }
754- }
755-
756- dam = (r_ptr->flags2 & RF2_POWERFUL) ? (randint1(rlev * 2) + 180) : (randint1(rlev * 3 / 2) + 120);
757- beam(m_idx, y, x, GF_PSY_SPEAR, dam, MS_PSY_SPEAR, MONSTER_TO_MONSTER);
758- break;
759-
760- /* RF6_DARKNESS */
761- case 160+12:
762- if (known)
763- {
764- if (see_m)
765- {
766- if (can_use_lite_area)
767- {
768- msg_format(_("%^sが辺りを明るく照らした。", "%^s cast a spell to light up."), m_name);
769- }
770- else
771- {
772- msg_format(_("%^sが暗闇の中で手を振った。", "%^s gestures in shadow."), m_name);
773- }
774-
775- if (see_t)
776- {
777- if (can_use_lite_area)
778- {
779- msg_format(_("%^sは白い光に包まれた。", "%^s is surrounded by a white light."), t_name);
780- }
781- else
782- {
783- msg_format(_("%^sは暗闇に包まれた。", "%^s is surrounded by darkness."), t_name);
784- }
785- }
786- }
787- else
788- {
789- mon_fight = TRUE;
790- }
791- }
792-
793- if (can_use_lite_area)
794- {
795- (void)project(m_idx, 3, y, x, 0, GF_LITE_WEAK, PROJECT_GRID | PROJECT_KILL, -1);
796- lite_room(y, x);
797- }
798- else
799- {
800- (void)project(m_idx, 3, y, x, 0, GF_DARK_WEAK, PROJECT_GRID | PROJECT_KILL, MS_DARKNESS);
801- unlite_room(y, x);
802- }
803-
804- break;
805-
806- /* RF6_TRAPS */
807- case 160+13:
808-#if 0
809- if (known)
810- {
811- if (see_m)
812- {
813- msg_format(_("%^sが呪文を唱えて邪悪に微笑んだ。", "%^s casts a spell and cackles evilly."), m_name);
814- }
815- else
816- {
817- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
818- }
819- }
820-
821- trap_creation(y, x);
822-
823- break;
824-#else
825- /* Not implemented */
826- return FALSE;
827-#endif
828-
829- /* RF6_FORGET */
830- case 160+14:
831- /* Not implemented */
832- return FALSE;
833-
834- /* RF6_RAISE_DEAD */
835- case 160+15:
836- if (known)
837- {
838- if (see_either)
839- {
840- disturb(1, 1);
841- if (blind)
842- {
843- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
844- }
845- else
846- {
847- msg_format(_("%^sが死者復活の呪文を唱えた。", "%^s casts a spell to revive corpses."), m_name);
848- }
849- }
850- else
851- {
852- mon_fight = TRUE;
853- }
854- }
855- animate_dead(m_idx, m_ptr->fy, m_ptr->fx);
856- break;
857-
858- /* RF6_S_KIN */
859- case 160+16:
860- if (known)
861- {
862- if (see_either)
863- {
864- disturb(1, 1);
865-
866- if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT)
867- {
868- msg_format(_("%^sがダンジョンの主を召喚した。", "%^s magically summons guardians of dungeons."), m_name);
869- }
870- else
871- {
872- _(msg_format("%sが魔法で%sを召喚した。", m_name, ((r_ptr->flags1 & RF1_UNIQUE) ? "手下" : "仲間")),
873- msg_format("%^s magically summons %s %s.", m_name, m_poss, ((r_ptr->flags1 & RF1_UNIQUE) ? "minions" : "kin")));
874- }
875-
876- }
877- else
878- {
879- mon_fight = TRUE;
880- }
881- }
882-
883- switch (m_ptr->r_idx)
884- {
885- case MON_MENELDOR:
886- case MON_GWAIHIR:
887- case MON_THORONDOR:
888- {
889- int num = 4 + randint1(3);
890- for (k = 0; k < num; k++)
891- {
892- count += summon_specific(m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
893- }
894- }
895- break;
896-
897- case MON_BULLGATES:
898- {
899- int num = 2 + randint1(3);
900- for (k = 0; k < num; k++)
901- {
902- count += summon_named_creature(m_idx, y, x, MON_IE, 0);
903- }
904- }
905- break;
906-
907- case MON_SERPENT:
908- case MON_ZOMBI_SERPENT:
909- if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6))
910- {
911- if (known && see_t)
912- {
913- msg_print(_("地面から水が吹き出した!", "Water blew off from the ground!"));
914- }
915- project(t_idx, 8, y, x, 3, GF_WATER_FLOW, PROJECT_GRID | PROJECT_HIDE, -1);
916- }
917-
918- {
919- int num = 2 + randint1(3);
920- for (k = 0; k < num; k++)
921- {
922- count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
923- }
924- }
925- break;
926-
927- case MON_CALDARM:
928- {
929- int num = randint1(3);
930- for (k = 0; k < num; k++)
931- {
932- count += summon_named_creature(m_idx, y, x, MON_LOCKE_CLONE, 0);
933- }
934- }
935- break;
936-
937- case MON_LOUSY:
938- {
939- int num = 2 + randint1(3);
940- for (k = 0; k < num; k++)
941- {
942- count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, (PM_ALLOW_GROUP));
943- }
944- }
945- break;
946-
947- default:
948- summon_kin_type = r_ptr->d_char;
949-
950- for (k = 0; k < 4; k++)
951- {
952- count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, (PM_ALLOW_GROUP));
953- }
954- break;
955- }
956-
957- if (known && !see_t && count)
958- {
959- mon_fight = TRUE;
960- }
961-
962- break;
963-
964- /* RF6_S_CYBER */
965- case 160+17:
966- if (known)
967- {
968- if (see_either)
969- {
970- disturb(1, 1);
971-
972- msg_format(_("%^sがサイバーデーモンを召喚した!", "%^s magically summons Cyberdemons!"), m_name);
973- }
974- else
975- {
976- mon_fight = TRUE;
977- }
978- }
979-
980- if (is_friendly(m_ptr))
981- {
982- count += summon_specific(m_idx, y, x, rlev, SUMMON_CYBER, (PM_ALLOW_GROUP));
983- }
984- else
985- {
986- count += summon_cyber(m_idx, y, x);
987- }
988-
989- if (known && !see_t && count)
990- {
991- mon_fight = TRUE;
992- }
993-
994- break;
995-
996- /* RF6_S_MONSTER */
997- case 160+18:
998- if (known)
999- {
1000- if (see_either)
1001- {
1002- disturb(1, 1);
1003-
1004- msg_format(_("%^sが魔法で仲間を召喚した!", "%^s magically summons help!"), m_name);
1005- }
1006- else
1007- {
1008- mon_fight = TRUE;
1009- }
1010- }
1011-
1012- count += summon_specific(m_idx, y, x, rlev, 0, (u_mode));
1013-
1014- if (known && !see_t && count)
1015- {
1016- mon_fight = TRUE;
1017- }
1018-
1019- break;
1020-
1021- /* RF6_S_MONSTERS */
1022- case 160+19:
1023- if (known)
1024- {
1025- if (see_either)
1026- {
1027- disturb(1, 1);
1028-
1029- msg_format(_("%^sが魔法でモンスターを召喚した!", "%^s magically summons monsters!"), m_name);
1030- }
1031- else
1032- {
1033- mon_fight = TRUE;
1034- }
1035- }
1036-
1037- for (k = 0; k < s_num_6; k++)
1038- {
1039- count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | u_mode));
1040- }
1041-
1042- if (known && !see_t && count)
1043- {
1044- mon_fight = TRUE;
1045- }
1046-
1047- break;
1048-
1049- /* RF6_S_ANT */
1050- case 160+20:
1051- if (known)
1052- {
1053- if (see_either)
1054- {
1055- disturb(1, 1);
1056-
1057- msg_format(_("%^sが魔法でアリを召喚した。", "%^s magically summons ants."), m_name);
1058- }
1059- else
1060- {
1061- mon_fight = TRUE;
1062- }
1063- }
1064-
1065- for (k = 0; k < s_num_6; k++)
1066- {
1067- count += summon_specific(m_idx, y, x, rlev, SUMMON_ANT, (PM_ALLOW_GROUP));
1068- }
1069-
1070- if (known && !see_t && count)
1071- {
1072- mon_fight = TRUE;
1073- }
1074-
1075- break;
1076-
1077- /* RF6_S_SPIDER */
1078- case 160+21:
1079- if (known)
1080- {
1081- if (see_either)
1082- {
1083- disturb(1, 1);
1084-
1085- msg_format(_("%^sが魔法でクモを召喚した。", "%^s magically summons spiders."), m_name);
1086- }
1087- else
1088- {
1089- mon_fight = TRUE;
1090- }
1091- }
1092-
1093- for (k = 0; k < s_num_6; k++)
1094- {
1095- count += summon_specific(m_idx, y, x, rlev, SUMMON_SPIDER, (PM_ALLOW_GROUP));
1096- }
1097-
1098- if (known && !see_t && count)
1099- {
1100- mon_fight = TRUE;
1101- }
1102-
1103- break;
1104-
1105- /* RF6_S_HOUND */
1106- case 160+22:
1107- if (known)
1108- {
1109- if (see_either)
1110- {
1111- disturb(1, 1);
1112-
1113- msg_format(_("%^sが魔法でハウンドを召喚した。", "%^s magically summons hounds."), m_name);
1114- }
1115- else
1116- {
1117- mon_fight = TRUE;
1118- }
1119- }
1120-
1121- for (k = 0; k < s_num_4; k++)
1122- {
1123- count += summon_specific(m_idx, y, x, rlev, SUMMON_HOUND, (PM_ALLOW_GROUP));
1124- }
1125-
1126- if (known && !see_t && count)
1127- {
1128- mon_fight = TRUE;
1129- }
1130-
1131- break;
1132-
1133- /* RF6_S_HYDRA */
1134- case 160+23:
1135- if (known)
1136- {
1137- if (see_either)
1138- {
1139- disturb(1, 1);
1140-
1141- msg_format(_("%^sが魔法でヒドラを召喚した。", "%^s magically summons hydras."), m_name);
1142- }
1143- else
1144- {
1145- mon_fight = TRUE;
1146- }
1147- }
1148-
1149- for (k = 0; k < s_num_4; k++)
1150- {
1151- count += summon_specific(m_idx, y, x, rlev, SUMMON_HYDRA, (PM_ALLOW_GROUP));
1152- }
1153-
1154- if (known && !see_t && count)
1155- {
1156- mon_fight = TRUE;
1157- }
1158-
1159- break;
1160-
1161- /* RF6_S_ANGEL */
1162- case 160+24:
1163- if (known)
1164- {
1165- if (see_either)
1166- {
1167- disturb(1, 1);
1168-
1169- msg_format(_("%^sが魔法で天使を召喚した!", "%^s magically summons an angel!"), m_name);
1170- }
1171- else
1172- {
1173- mon_fight = TRUE;
1174- }
1175- }
1176-
1177- {
1178- int num = 1;
1179-
1180- if ((r_ptr->flags1 & RF1_UNIQUE) && !easy_band)
1181- {
1182- num += r_ptr->level/40;
1183- }
1184-
1185- for (k = 0; k < num; k++)
1186- {
1187- count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, (PM_ALLOW_GROUP));
1188- }
1189- }
1190-
1191- if (known && !see_t && count)
1192- {
1193- mon_fight = TRUE;
1194- }
1195-
1196- break;
1197-
1198- /* RF6_S_DEMON */
1199- case 160+25:
1200- if (known)
1201- {
1202- if (see_either)
1203- {
1204- disturb(1, 1);
1205-
1206- msg_format(_("%^sが魔法で混沌の宮廷からデーモンを召喚した!",
1207- "%^s magically summons a demon from the Courts of Chaos!"), m_name);
1208- }
1209- else
1210- {
1211- mon_fight = TRUE;
1212- }
1213- }
1214-
1215- for (k = 0; k < 1; k++)
1216- {
1217- count += summon_specific(m_idx, y, x, rlev, SUMMON_DEMON, (PM_ALLOW_GROUP));
1218- }
1219-
1220- if (known && !see_t && count)
1221- {
1222- mon_fight = TRUE;
1223- }
1224-
1225- break;
1226-
1227- /* RF6_S_UNDEAD */
1228- case 160+26:
1229- if (known)
1230- {
1231- if (see_either)
1232- {
1233- disturb(1, 1);
1234-
1235- msg_format(_("%sが魔法でアンデッドを召喚した。", "%^s magically summons undead."), m_name);
1236- }
1237- else
1238- {
1239- mon_fight = TRUE;
1240- }
1241- }
1242-
1243- for (k = 0; k < 1; k++)
1244- {
1245- count += summon_specific(m_idx, y, x, rlev, SUMMON_UNDEAD, (PM_ALLOW_GROUP));
1246- }
1247-
1248- if (known && !see_t && count)
1249- {
1250- mon_fight = TRUE;
1251- }
1252-
1253- break;
1254-
1255- /* RF6_S_DRAGON */
1256- case 160+27:
1257- if (known)
1258- {
1259- if (see_either)
1260- {
1261- disturb(1, 1);
1262-
1263- msg_format(_("%^sが魔法でドラゴンを召喚した!", "%^s magically summons a dragon!"), m_name);
1264- }
1265- else
1266- {
1267- mon_fight = TRUE;
1268- }
1269- }
1270-
1271- for (k = 0; k < 1; k++)
1272- {
1273- count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, (PM_ALLOW_GROUP));
1274- }
1275-
1276- if (known && !see_t && count)
1277- {
1278- mon_fight = TRUE;
1279- }
1280-
1281- break;
1282-
1283- /* RF6_S_HI_UNDEAD */
1284- case 160+28:
1285- if (known)
1286- {
1287- if (see_either)
1288- {
1289- disturb(1, 1);
1290-
1291- msg_format(_("%sが魔法でアンデッドを召喚した。", "%^s magically summons undead."), m_name);
1292- }
1293- else
1294- {
1295- mon_fight = TRUE;
1296- }
1297- }
1298-
1299- for (k = 0; k < s_num_6; k++)
1300- {
1301- count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | u_mode));
1302- }
1303-
1304- if (known && !see_t && count)
1305- {
1306- mon_fight = TRUE;
1307- }
1308-
1309- break;
1310-
1311- /* RF6_S_HI_DRAGON */
1312- case 160+29:
1313- if (known)
1314- {
1315- if (see_either)
1316- {
1317- disturb(1, 1);
1318-
1319- msg_format(_("%^sが魔法で古代ドラゴンを召喚した!", "%^s magically summons ancient dragons!"), m_name);
1320- }
1321- else
1322- {
1323- mon_fight = TRUE;
1324- }
1325- }
1326-
1327- for (k = 0; k < s_num_4; k++)
1328- {
1329- count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | u_mode));
1330- }
1331-
1332- if (known && !see_t && count)
1333- {
1334- mon_fight = TRUE;
1335- }
1336-
1337- break;
1338-
1339- /* RF6_S_AMBERITES */
1340- case 160+30:
1341- if (known)
1342- {
1343- if (see_either)
1344- {
1345- disturb(1, 1);
1346-
1347- msg_format(_("%^sがアンバーの王族を召喚した!", "%^s magically summons Lords of Amber!"), m_name);
1348- }
1349- else
1350- {
1351- mon_fight = TRUE;
1352- }
1353- }
1354-
1355- for (k = 0; k < s_num_4; k++)
1356- {
1357- count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
1358- }
1359-
1360- if (known && !see_t && count)
1361- {
1362- mon_fight = TRUE;
1363- }
1364-
1365- break;
1366-
1367- /* RF6_S_UNIQUE */
1368- case 160+31:
1369- if (known)
1370- {
1371- if (see_either)
1372- {
1373- disturb(1, 1);
1374-
1375- msg_format(_("%^sが魔法で特別な強敵を召喚した!", "%^s magically summons special opponents!"), m_name);
1376- }
1377- else
1378- {
1379- mon_fight = TRUE;
1380- }
1381- }
1382-
1383- for (k = 0; k < s_num_4; k++)
1384- {
1385- count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
1386- }
1387-
1388- {
1389- int non_unique_type = SUMMON_HI_UNDEAD;
1390-
1391- if ((m_ptr->sub_align & (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL)) == (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL))
1392- non_unique_type = 0;
1393- else if (m_ptr->sub_align & SUB_ALIGN_GOOD)
1394- non_unique_type = SUMMON_ANGEL;
1395-
1396- for (k = count; k < s_num_4; k++)
1397- {
1398- count += summon_specific(m_idx, y, x, rlev, non_unique_type, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
1399- }
1400- }
1401-
1402- if (known && !see_t && count)
1403- {
1404- mon_fight = TRUE;
1405- }
1406-
1407- break;
1408- }
1409-
1410- if (wake_up) (void)set_monster_csleep(t_idx, 0);
1411-
1412- if (fear && see_t)
1413- {
1414- msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), t_name);
1415- }
1416-
1417739 if (m_ptr->ml && maneable && !world_monster && !p_ptr->blind && (p_ptr->pclass == CLASS_IMITATOR))
1418740 {
1419741 if (thrown_spell != 167) /* Not RF6_SPECIAL */
--- a/src/mspells4.c
+++ b/src/mspells4.c
@@ -47,19 +47,18 @@ bool monster_is_powerful(int m_idx)
4747 return (r_ptr->flags2 & RF2_POWERFUL);
4848 }
4949
50-void monster_wakeup(int t_idx)
50+u32b monster_u_mode(int m_idx)
5151 {
52- (void)set_monster_csleep(t_idx, 0);
52+ u32b u_mode = 0L;
53+ monster_type *m_ptr = &m_list[m_idx];
54+ bool pet = is_pet(m_ptr);
55+ if (!pet) u_mode |= PM_ALLOW_UNIQUE;
56+ return u_mode;
5357 }
5458
55-void monster_fear_message(int t_idx)
59+void monster_wakeup(int t_idx)
5660 {
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- }
61+ (void)set_monster_csleep(t_idx, 0);
6362 }
6463
6564 void monspell_message_base(int m_idx, int t_idx, cptr msg1, cptr msg2, cptr msg3, cptr msg4, bool msg_flag, int TARGET_TYPE)
@@ -1906,56 +1905,94 @@ void spell_RF6_TELE_LEVEL(int m_idx, int t_idx, int TARGET_TYPE)
19061905 }
19071906 }
19081907
1909-int spell_RF6_PSY_SPEAR(int y, int x, int m_idx)
1908+int spell_RF6_PSY_SPEAR(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
19101909 {
1911- monster_type *m_ptr = &m_list[m_idx];
1912- monster_race *r_ptr = &r_info[m_ptr->r_idx];
1913- int rlev = monster_level_idx(m_idx);
19141910 int dam;
1915- char m_name[80];
1916- monster_name(m_idx, m_name);
1917-
1918- disturb(1, 1);
1919- if (p_ptr->blind)
1920- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
1921- else
1922- msg_format(_("%^sが光の剣を放った。", "%^s throw a Psycho-Spear."), m_name);
1911+ int rlev = monster_level_idx(m_idx);
19231912
1924- dam = (r_ptr->flags2 & RF2_POWERFUL) ? (randint1(rlev * 2) + 150) : (randint1(rlev * 3 / 2) + 100);
1913+ monspell_message(m_idx, t_idx,
1914+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
1915+ _("%^sが光の剣を放った。", "%^s throw a Psycho-Spear."),
1916+ _("%^sが%sに向かって光の剣を放った。", "%^s throw a Psycho-spear at %s."),
1917+ TARGET_TYPE);
1918+
1919+ dam = monster_is_powerful(m_idx) ? (randint1(rlev * 2) + 150) : (randint1(rlev * 3 / 2) + 100);
19251920 beam(m_idx, y, x, GF_PSY_SPEAR, dam, MS_PSY_SPEAR, MONSTER_TO_PLAYER);
19261921 return dam;
19271922 }
19281923
1929-void spell_RF6_DARKNESS(int m_idx)
1924+void spell_RF6_DARKNESS(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
19301925 {
19311926 monster_type *m_ptr = &m_list[m_idx];
1927+ monster_type *t_ptr = &m_list[t_idx];
19321928 monster_race *r_ptr = &r_info[m_ptr->r_idx];
19331929 bool can_use_lite_area = FALSE;
1934- char m_name[80];
1935- monster_name(m_idx, m_name);
1930+ bool monster_to_monster = TARGET_TYPE == MONSTER_TO_MONSTER;
1931+ bool monster_to_player = TARGET_TYPE == MONSTER_TO_PLAYER;
1932+ char t_name[80];
1933+ monster_name(t_idx, t_name);
19361934
19371935 if ((p_ptr->pclass == CLASS_NINJA) &&
19381936 !(r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) &&
19391937 !(r_ptr->flags7 & RF7_DARK_MASK))
19401938 can_use_lite_area = TRUE;
1941- disturb(1, 1);
19421939
1943- if (p_ptr->blind)
1944- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
1945- else if (can_use_lite_area)
1946- msg_format(_("%^sが辺りを明るく照らした。", "%^s cast a spell to light up."), m_name);
1947- else
1948- msg_format(_("%^sが暗闇の中で手を振った。", "%^s gestures in shadow."), m_name);
1940+ if(monster_to_monster && !is_hostile(t_ptr))
1941+ can_use_lite_area = FALSE;
19491942
1950- if (can_use_lite_area)
1951- {
1952- (void)lite_area(0, 3);
1953- }
1954- else
1955- {
1956- learn_spell(MS_DARKNESS);
1957- (void)unlite_area(0, 3);
1958- }
1943+
1944+ if (can_use_lite_area)
1945+ {
1946+ monspell_message(m_idx, t_idx,
1947+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
1948+ _("%^sが辺りを明るく照らした。", "%^s cast a spell to light up."),
1949+ _("%^sが辺りを明るく照らした。", "%^s cast a spell to light up."),
1950+ TARGET_TYPE);
1951+
1952+ if (see_monster(t_idx) && monster_to_monster)
1953+ {
1954+ msg_format(_("%^sは白い光に包まれた。", "%^s is surrounded by a white light."), t_name);
1955+ }
1956+ }
1957+ else
1958+ {
1959+ monspell_message(m_idx, t_idx,
1960+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
1961+ _("%^sが暗闇の中で手を振った。", "%^s gestures in shadow."),
1962+ _("%^sが暗闇の中で手を振った。", "%^s gestures in shadow."),
1963+ TARGET_TYPE);
1964+
1965+ if (see_monster(t_idx) && monster_to_monster)
1966+ {
1967+ msg_format(_("%^sは暗闇に包まれた。", "%^s is surrounded by darkness."), t_name);
1968+ }
1969+ }
1970+
1971+ if(monster_to_player)
1972+ {
1973+ if (can_use_lite_area)
1974+ {
1975+ (void)lite_area(0, 3);
1976+ }
1977+ else
1978+ {
1979+ learn_spell(MS_DARKNESS);
1980+ (void)unlite_area(0, 3);
1981+ }
1982+ }
1983+ else if(monster_to_monster)
1984+ {
1985+ if (can_use_lite_area)
1986+ {
1987+ (void)project(m_idx, 3, y, x, 0, GF_LITE_WEAK, PROJECT_GRID | PROJECT_KILL, -1);
1988+ lite_room(y, x);
1989+ }
1990+ else
1991+ {
1992+ (void)project(m_idx, 3, y, x, 0, GF_DARK_WEAK, PROJECT_GRID | PROJECT_KILL, MS_DARKNESS);
1993+ unlite_room(y, x);
1994+ }
1995+ }
19591996 }
19601997
19611998 void spell_RF6_TRAPS(int y, int x, int m_idx)
@@ -1997,58 +2034,150 @@ void spell_RF6_FORGET(int m_idx)
19972034 learn_spell(MS_FORGET);
19982035 }
19992036
2000-void spell_RF6_RAISE_DEAD(int m_idx)
2037+void spell_RF6_RAISE_DEAD(int m_idx, int t_idx, int TARGET_TYPE)
20012038 {
20022039 monster_type *m_ptr = &m_list[m_idx];
2003- char m_name[80];
2004- monster_name(m_idx, m_name);
2005-
2006- disturb(1, 1);
20072040
2008- if (p_ptr->blind)
2009- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2010- else
2011- msg_format(_("%^sが死者復活の呪文を唱えた。",
2012- "%^s casts a spell to revive corpses."), m_name);
2041+ monspell_message(m_idx, t_idx,
2042+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2043+ _("%^sが死者復活の呪文を唱えた。", "%^s casts a spell to revive corpses."),
2044+ _("%^sが死者復活の呪文を唱えた。", "%^s casts a spell to revive corpses."),
2045+ TARGET_TYPE);
20132046
20142047 animate_dead(m_idx, m_ptr->fy, m_ptr->fx);
20152048 }
20162049
2017-void spell_RF6_S_KIN(int y, int x, int m_idx)
2050+int summon_EAGLE(int y, int x, int rlev, int m_idx)
2051+{
2052+ int k, count = 0;
2053+ int num = 4 + randint1(3);
2054+ for (k = 0; k < num; k++)
2055+ {
2056+ count += summon_specific(m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2057+ }
2058+ return count;
2059+}
2060+
2061+int summon_IE(int y, int x, int rlev, int m_idx, int mode)
2062+{
2063+ int k, count = 0;
2064+ int num = 2 + randint1(3);
2065+ for (k = 0; k < num; k++)
2066+ {
2067+ count += summon_named_creature(m_idx, y, x, MON_IE, mode);
2068+ }
2069+ return count;
2070+}
2071+
2072+int summon_Guardian(int y, int x, int rlev, int m_idx, int t_idx, int TARGET_TYPE)
2073+{
2074+ int k, count = 0;
2075+ int num = 2 + randint1(3);
2076+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2077+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
2078+
2079+ if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6))
2080+ {
2081+ simple_monspell_message(m_idx, t_idx,
2082+ _("地面から水が吹き出した!", "Water blew off from the ground!"),
2083+ _("地面から水が吹き出した!", "Water blew off from the ground!"),
2084+ TARGET_TYPE);
2085+
2086+ if(mon_to_player)
2087+ fire_ball_hide(GF_WATER_FLOW, 0, 3, 8);
2088+ else if(mon_to_mon)
2089+ project(t_idx, 8, y, x, 3, GF_WATER_FLOW, PROJECT_GRID | PROJECT_HIDE, -1);
2090+ }
2091+
2092+ for (k = 0; k < num; k++)
2093+ {
2094+ count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2095+ }
2096+ return count;
2097+}
2098+
2099+int summon_LOCK_CLONE(int y, int x, int rlev, int m_idx, int mode)
2100+{
2101+ int k, count = 0;
2102+ int num = randint1(3);
2103+ for (k = 0; k < num; k++)
2104+ {
2105+ count += summon_named_creature(m_idx, y, x, MON_LOCKE_CLONE, mode);
2106+ }
2107+ return count;
2108+}
2109+
2110+int summon_LOUSE(int y, int x, int rlev, int m_idx)
2111+{
2112+ int k, count = 0;
2113+ int num = 2 + randint1(3);
2114+ for (k = 0; k < num; k++)
2115+ {
2116+ count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, PM_ALLOW_GROUP);
2117+ }
2118+ return count;
2119+}
2120+
2121+int summon_Kin(int y, int x, int rlev, int m_idx)
2122+{
2123+ int k, count = 0;
2124+ monster_type *m_ptr = &m_list[m_idx];
2125+ monster_race *r_ptr = &r_info[m_ptr->r_idx];
2126+ summon_kin_type = r_ptr->d_char; /* Big hack */
2127+
2128+ for (k = 0; k < 4; k++)
2129+ {
2130+ count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, PM_ALLOW_GROUP);
2131+ }
2132+ return count;
2133+}
2134+
2135+void spell_RF6_S_KIN(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
20182136 {
2137+ bool known = monster_near_player(m_idx, t_idx);
2138+ bool see_either = see_monster(m_idx) || see_monster(t_idx);
2139+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2140+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
20192141 monster_type *m_ptr = &m_list[m_idx];
20202142 monster_race *r_ptr = &r_info[m_ptr->r_idx];
20212143 int rlev = monster_level_idx(m_idx);
2022- int count = 0, k;
2144+ int count = 0;
20232145 u32b mode = 0L;
2024- char m_name[80];
2146+ char m_name[80], t_name[80], m_poss[80];
20252147 monster_name(m_idx, m_name);
2148+ monster_name(t_idx, t_name);
2149+ monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
20262150
20272151 disturb(1, 1);
20282152 if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT)
20292153 {
2030- if (p_ptr->blind)
2031- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2032- else
2033- msg_format(_("%^sがダンジョンの主を召喚した。",
2034- "%^s magically summons guardians of dungeons."), m_name);
2154+ monspell_message(m_idx, t_idx,
2155+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2156+ _("%^sがダンジョンの主を召喚した。", "%^s magically summons guardians of dungeons."),
2157+ _("%^sがダンジョンの主を召喚した。", "%^s magically summons guardians of dungeons."),
2158+ TARGET_TYPE);
20352159 }
20362160 else
20372161 {
2038- if (p_ptr->blind)
2039- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2040- else
2041-#ifdef JP
2042- msg_format("%^sは魔法で%sを召喚した。",
2043- m_name,
2044- ((r_ptr->flags1) & RF1_UNIQUE ?
2045- "手下" : "仲間"));
2046-#else
2047- msg_format("%^s magically summons %s %s.",
2048- m_name, m_poss,
2049- ((r_ptr->flags1) & RF1_UNIQUE ?
2050- "minions" : "kin"));
2051-#endif
2162+ if (mon_to_player || (mon_to_mon && known && see_either))
2163+ disturb(1, 1);
2164+
2165+ if (p_ptr->blind)
2166+ {
2167+ if (mon_to_player)
2168+ msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2169+ }
2170+ else
2171+ {
2172+ if (mon_to_player || (mon_to_mon && known && see_either))
2173+ {
2174+ _(msg_format("%sが魔法で%sを召喚した。", m_name, ((r_ptr->flags1 & RF1_UNIQUE) ? "手下" : "仲間")),
2175+ msg_format("%^s magically summons %s %s.", m_name, m_poss, ((r_ptr->flags1 & RF1_UNIQUE) ? "minions" : "kin")));
2176+ }
2177+ }
2178+
2179+ if (mon_to_mon && known && !see_either)
2180+ mon_fight = TRUE;
20522181 }
20532182
20542183 switch (m_ptr->r_idx)
@@ -2056,260 +2185,259 @@ void spell_RF6_S_KIN(int y, int x, int m_idx)
20562185 case MON_MENELDOR:
20572186 case MON_GWAIHIR:
20582187 case MON_THORONDOR:
2059- {
2060- int num = 4 + randint1(3);
2061- for (k = 0; k < num; k++)
2062- {
2063- count += summon_specific(m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2064- }
2065- }
2066- break;
2188+ count += summon_EAGLE(y, x, rlev, m_idx);
2189+ break;
20672190
20682191 case MON_BULLGATES:
2069- {
2070- int num = 2 + randint1(3);
2071- for (k = 0; k < num; k++)
2072- {
2073- count += summon_named_creature(m_idx, y, x, MON_IE, mode);
2074- }
2075- }
2076- break;
2192+ count += summon_IE(y, x, rlev, m_idx, mode);
2193+ break;
20772194
20782195 case MON_SERPENT:
20792196 case MON_ZOMBI_SERPENT:
2080- {
2081- int num = 2 + randint1(3);
2082-
2083- if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6))
2084- {
2085- msg_print(_("地面から水が吹き出した!", "Water blew off from the ground!"));
2086- fire_ball_hide(GF_WATER_FLOW, 0, 3, 8);
2087- }
2088-
2089- for (k = 0; k < num; k++)
2090- {
2091- count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2092- }
2093- }
2094- break;
2095-
2197+ count += summon_Guardian(y, x, rlev, m_idx, t_idx, TARGET_TYPE);
2198+ break;
2199+
20962200 case MON_CALDARM:
2097- {
2098- int num = randint1(3);
2099- for (k = 0; k < num; k++)
2100- {
2101- count += summon_named_creature(m_idx, y, x, MON_LOCKE_CLONE, mode);
2102- }
2103- }
2104- break;
2201+ count += summon_LOCK_CLONE(y, x, rlev, m_idx, mode);
2202+ break;
21052203
21062204 case MON_LOUSY:
2107- {
2108- int num = 2 + randint1(3);
2109- for (k = 0; k < num; k++)
2110- {
2111- count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, PM_ALLOW_GROUP);
2112- }
2113- }
2114- break;
2205+ count += summon_LOUSE(y, x, rlev, m_idx);
2206+ break;
21152207
21162208 default:
2117- summon_kin_type = r_ptr->d_char; /* Big hack */
2118-
2119- for (k = 0; k < 4; k++)
2120- {
2121- count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, PM_ALLOW_GROUP);
2122- }
2123- break;
2209+ count += summon_Kin(y, x, rlev, m_idx);
2210+ break;
21242211 }
21252212
2126- if (p_ptr->blind && count)
2213+ if (p_ptr->blind && count && mon_to_player)
21272214 msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
2215+
2216+ if (known && !see_monster(t_idx) && count && mon_to_mon)
2217+ mon_fight = TRUE;
21282218 }
21292219
2130-void spell_RF6_S_CYBER(int y, int x, int m_idx)
2220+void spell_RF6_S_CYBER(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
21312221 {
21322222 int count = 0;
2133- char m_name[80];
2134- monster_name(m_idx, m_name);
2135-
2136- disturb(1, 1);
2137-
2138- if (p_ptr->blind)
2139- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2140- else
2141- msg_format(_("%^sがサイバーデーモンを召喚した!",
2142- "%^s magically summons Cyberdemons!"), m_name);
2223+ monster_type *m_ptr = &m_list[m_idx];
2224+ int rlev = monster_level_idx(m_idx);
2225+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2226+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
2227+
2228+ monspell_message(m_idx, t_idx,
2229+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2230+ _("%^sがサイバーデーモンを召喚した!", "%^s magically summons Cyberdemons!"),
2231+ _("%^sがサイバーデーモンを召喚した!", "%^s magically summons Cyberdemons!"),
2232+ TARGET_TYPE);
21432233
2144- count = summon_cyber(m_idx, y, x);
2234+ if (is_friendly(m_ptr) && mon_to_mon)
2235+ {
2236+ count += summon_specific(m_idx, y, x, rlev, SUMMON_CYBER, (PM_ALLOW_GROUP));
2237+ }
2238+ else
2239+ {
2240+ count += summon_cyber(m_idx, y, x);
2241+ }
21452242
2146- if (p_ptr->blind && count)
2243+ if (p_ptr->blind && count && mon_to_player)
21472244 msg_print(_("重厚な足音が近くで聞こえる。", "You hear heavy steps nearby."));
2245+
2246+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2247+ mon_fight = TRUE;
21482248 }
21492249
2150-void spell_RF6_S_MONSTER(int y, int x, int m_idx)
2250+
2251+void spell_RF6_S_MONSTER(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
21512252 {
2253+ int count = 0, k;
2254+ monster_type *m_ptr = &m_list[m_idx];
21522255 int rlev = monster_level_idx(m_idx);
2153- int k, count = 0;
2154- char m_name[80];
2155- monster_name(m_idx, m_name);
2156-
2157- disturb(1, 1);
2158-
2159- if (p_ptr->blind)
2160- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2161- else
2162- msg_format(_("%^sが魔法で仲間を召喚した!", "%^s magically summons help!"), m_name);
2256+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2257+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
2258+
2259+ monspell_message(m_idx, t_idx,
2260+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2261+ _("%^sが魔法で仲間を召喚した!", "%^s magically summons help!"),
2262+ _("%^sが魔法で仲間を召喚した!", "%^s magically summons help!"),
2263+ TARGET_TYPE);
21632264
21642265 for (k = 0; k < 1; k++)
21652266 {
2166- count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2267+ if(mon_to_player)
2268+ count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2269+
2270+ if(mon_to_mon)
2271+ count += summon_specific(m_idx, y, x, rlev, 0, (monster_u_mode(m_idx)));
21672272 }
2168- if (p_ptr->blind && count)
2273+
2274+ if (p_ptr->blind && count && mon_to_player)
21692275 msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
2276+
2277+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2278+ mon_fight = TRUE;
21702279 }
21712280
2172-void spell_RF6_S_MONSTERS(int y, int x, int m_idx)
2281+void spell_RF6_S_MONSTERS(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
21732282 {
2283+ int count = 0, k;
2284+ monster_type *m_ptr = &m_list[m_idx];
21742285 int rlev = monster_level_idx(m_idx);
2175- int k, count = 0;
2176- char m_name[80];
2177- monster_name(m_idx, m_name);
2178-
2179- disturb(1, 1);
2180-
2181- if (p_ptr->blind)
2182- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2183- else
2184- msg_format(_("%^sが魔法でモンスターを召喚した!", "%^s magically summons monsters!"), m_name);
2185-
2286+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2287+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
2288+
2289+ monspell_message(m_idx, t_idx,
2290+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2291+ _("%^sが魔法でモンスターを召喚した!", "%^s magically summons monsters!"),
2292+ _("%^sが魔法でモンスターを召喚した!", "%^s magically summons monsters!"),
2293+ TARGET_TYPE);
2294+
21862295 for (k = 0; k < S_NUM_6; k++)
21872296 {
2188- count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2297+ if(mon_to_player)
2298+ count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2299+
2300+ if(mon_to_mon)
2301+ count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | monster_u_mode(m_idx)));
21892302 }
21902303
2191- if (p_ptr->blind && count)
2304+ if (p_ptr->blind && count && mon_to_player)
21922305 msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
2306+
2307+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2308+ mon_fight = TRUE;
21932309 }
21942310
2195-void spell_RF6_S_ANT(int y, int x, int m_idx)
2311+void spell_RF6_S_ANT(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
21962312 {
2313+ int count = 0, k;
2314+ monster_type *m_ptr = &m_list[m_idx];
21972315 int rlev = monster_level_idx(m_idx);
2198- int k, count = 0;
2199- char m_name[80];
2200- monster_name(m_idx, m_name);
2201-
2202- disturb(1, 1);
2203-
2204- if (p_ptr->blind)
2205- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2206- else
2207- msg_format(_("%^sが魔法でアリを召喚した。", "%^s magically summons ants."), m_name);
2208-
2316+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2317+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
2318+
2319+ monspell_message(m_idx, t_idx,
2320+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2321+ _("%^sが魔法でアリを召喚した。", "%^s magically summons ants."),
2322+ _("%^sが魔法でアリを召喚した。", "%^s magically summons ants."),
2323+ TARGET_TYPE);
2324+
22092325 for (k = 0; k < S_NUM_6; k++)
22102326 {
22112327 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANT, PM_ALLOW_GROUP);
22122328 }
22132329
2214- if (p_ptr->blind && count)
2330+ if (p_ptr->blind && count && mon_to_player)
22152331 msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
2332+
2333+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2334+ mon_fight = TRUE;
22162335 }
22172336
2218-void spell_RF6_S_SPIDER(int y, int x, int m_idx)
2337+void spell_RF6_S_SPIDER(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
22192338 {
2339+ int count = 0, k;
2340+ monster_type *m_ptr = &m_list[m_idx];
22202341 int rlev = monster_level_idx(m_idx);
2221- int k, count = 0;
2222- char m_name[80];
2223- monster_name(m_idx, m_name);
2224-
2225- disturb(1, 1);
2226-
2227- if (p_ptr->blind)
2228- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2229- else
2230- msg_format(_("%^sが魔法でクモを召喚した。", "%^s magically summons spiders."), m_name);
2231-
2342+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2343+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
2344+
2345+ monspell_message(m_idx, t_idx,
2346+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2347+ _("%^sが魔法でクモを召喚した。", "%^s magically summons spiders."),
2348+ _("%^sが魔法でクモを召喚した。", "%^s magically summons spiders."),
2349+ TARGET_TYPE);
2350+
22322351 for (k = 0; k < S_NUM_6; k++)
22332352 {
22342353 count += summon_specific(m_idx, y, x, rlev, SUMMON_SPIDER, PM_ALLOW_GROUP);
22352354 }
22362355
2237- if (p_ptr->blind && count)
2356+ if (p_ptr->blind && count && mon_to_player)
22382357 msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
2358+
2359+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2360+ mon_fight = TRUE;
22392361 }
22402362
2241-void spell_RF6_S_HOUND(int y, int x, int m_idx)
2363+void spell_RF6_S_HOUND(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
22422364 {
2365+ int count = 0, k;
2366+ monster_type *m_ptr = &m_list[m_idx];
22432367 int rlev = monster_level_idx(m_idx);
2244- int k, count = 0;
2245- char m_name[80];
2246- monster_name(m_idx, m_name);
2247-
2248- disturb(1, 1);
2249-
2250- if (p_ptr->blind)
2251- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2252- else
2253- msg_format(_("%^sが魔法でハウンドを召喚した。", "%^s magically summons hounds."), m_name);
2254-
2255- for (k = 0; k < S_NUM_4; k++)
2368+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2369+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
2370+
2371+ monspell_message(m_idx, t_idx,
2372+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2373+ _("%^sが魔法でハウンドを召喚した。", "%^s magically summons hounds."),
2374+ _("%^sが魔法でハウンドを召喚した。", "%^s magically summons hounds."),
2375+ TARGET_TYPE);
2376+
2377+ for (k = 0; k < S_NUM_4; k++)
22562378 {
22572379 count += summon_specific(m_idx, y, x, rlev, SUMMON_HOUND, PM_ALLOW_GROUP);
22582380 }
22592381
2260- if (p_ptr->blind && count)
2382+ if (p_ptr->blind && count && mon_to_player)
22612383 msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
2384+
2385+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2386+ mon_fight = TRUE;
22622387 }
22632388
2264-void spell_RF6_S_HYDRA(int y, int x, int m_idx)
2389+void spell_RF6_S_HYDRA(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
22652390 {
2391+ int count = 0, k;
2392+ monster_type *m_ptr = &m_list[m_idx];
22662393 int rlev = monster_level_idx(m_idx);
2267- int k, count = 0;
2268- char m_name[80];
2269- monster_name(m_idx, m_name);
2270-
2271- disturb(1, 1);
2272-
2273- if (p_ptr->blind)
2274- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2275- else
2276- msg_format(_("%^sが魔法でヒドラを召喚した。", "%^s magically summons hydras."), m_name);
2277-
2278- for (k = 0; k < S_NUM_4; k++)
2394+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2395+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
2396+
2397+ monspell_message(m_idx, t_idx,
2398+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2399+ _("%^sが魔法でヒドラを召喚した。", "%^s magically summons hydras."),
2400+ _("%^sが魔法でヒドラを召喚した。", "%^s magically summons hydras."),
2401+ TARGET_TYPE);
2402+
2403+ for (k = 0; k < S_NUM_4; k++)
22792404 {
22802405 count += summon_specific(m_idx, y, x, rlev, SUMMON_HYDRA, PM_ALLOW_GROUP);
22812406 }
2282- if (p_ptr->blind && count)
2407+
2408+ if (p_ptr->blind && count && mon_to_player)
22832409 msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
2410+
2411+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2412+ mon_fight = TRUE;
22842413 }
22852414
2286-void spell_RF6_S_ANGEL(int y, int x, int m_idx)
2415+void spell_RF6_S_ANGEL(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
22872416 {
2417+ int count = 0, k;
2418+ int num = 1;
22882419 monster_type *m_ptr = &m_list[m_idx];
22892420 monster_race *r_ptr = &r_info[m_ptr->r_idx];
22902421 int rlev = monster_level_idx(m_idx);
2291- int k, count = 0;
2292- int num = 1;
2293- char m_name[80];
2294- monster_name(m_idx, m_name);
2295-
2296- disturb(1, 1);
2297-
2298- if (p_ptr->blind)
2299- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2300- else
2301- msg_format(_("%^sが魔法で天使を召喚した!", "%^s magically summons an angel!"), m_name);
2302-
2422+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2423+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
2424+
2425+ monspell_message(m_idx, t_idx,
2426+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2427+ _("%^sが魔法で天使を召喚した!", "%^s magically summons an angel!"),
2428+ _("%^sが魔法で天使を召喚した!", "%^s magically summons an angel!"),
2429+ TARGET_TYPE);
2430+
23032431 if ((r_ptr->flags1 & RF1_UNIQUE) && !easy_band)
23042432 {
23052433 num += r_ptr->level / 40;
23062434 }
2307-
2308- for (k = 0; k < num; k++)
2309- {
2435+
2436+ for (k = 0; k < num; k++)
2437+ {
23102438 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, PM_ALLOW_GROUP);
2311- }
2312-
2439+ }
2440+
23132441 if (count < 2)
23142442 {
23152443 if (p_ptr->blind && count)
@@ -2320,220 +2448,266 @@ void spell_RF6_S_ANGEL(int y, int x, int m_idx)
23202448 if (p_ptr->blind)
23212449 msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
23222450 }
2451+
2452+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2453+ mon_fight = TRUE;
23232454 }
23242455
2325-void spell_RF6_S_DEMON(int y, int x, int m_idx)
2456+void spell_RF6_S_DEMON(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
23262457 {
2458+ int count = 0, k;
2459+ monster_type *m_ptr = &m_list[m_idx];
23272460 int rlev = monster_level_idx(m_idx);
2328- int k, count = 0;
2329- char m_name[80];
2330- monster_name(m_idx, m_name);
2331-
2332- disturb(1, 1);
2333-
2334- if (p_ptr->blind)
2335- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2336- else
2337- msg_format(_("%^sは魔法で混沌の宮廷から悪魔を召喚した!",
2338- "%^s magically summons a demon from the Courts of Chaos!"), m_name);
2339-
2340- for (k = 0; k < 1; k++)
2341- {
2461+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2462+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
2463+
2464+ monspell_message(m_idx, t_idx,
2465+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2466+ _("%^sは魔法で混沌の宮廷から悪魔を召喚した!", "%^s magically summons a demon from the Courts of Chaos!"),
2467+ _("%^sは魔法で混沌の宮廷から悪魔を召喚した!", "%^s magically summons a demon from the Courts of Chaos!"),
2468+ TARGET_TYPE);
2469+
2470+ for (k = 0; k < 1; k++)
2471+ {
23422472 count += summon_specific(m_idx, y, x, rlev, SUMMON_DEMON, PM_ALLOW_GROUP);
2343- }
2344-
2473+ }
2474+
23452475 if (p_ptr->blind && count)
23462476 msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
2477+
2478+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2479+ mon_fight = TRUE;
23472480 }
23482481
2349-void spell_RF6_S_UNDEAD(int y, int x, int m_idx)
2482+void spell_RF6_S_UNDEAD(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
23502483 {
2484+ int count = 0, k;
2485+ monster_type *m_ptr = &m_list[m_idx];
23512486 int rlev = monster_level_idx(m_idx);
2352- int k, count = 0;
2353- char m_name[80];
2354- monster_name(m_idx, m_name);
2355-
2356- disturb(1, 1);
2357-
2358- if (p_ptr->blind)
2359- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2360- else
2361- msg_format(_("%^sが魔法でアンデッドの強敵を召喚した!",
2362- "%^s magically summons an undead adversary!"), m_name);
2363-
2364- for (k = 0; k < 1; k++)
2365- {
2487+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2488+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
2489+
2490+ monspell_message(m_idx, t_idx,
2491+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2492+ _("%^sが魔法でアンデッドの強敵を召喚した!", "%^s magically summons an undead adversary!"),
2493+ _("%sが魔法でアンデッドを召喚した。", "%^s magically summons undead."),
2494+ TARGET_TYPE);
2495+
2496+ for (k = 0; k < 1; k++)
2497+ {
23662498 count += summon_specific(m_idx, y, x, rlev, SUMMON_UNDEAD, PM_ALLOW_GROUP);
2367- }
2368-
2499+ }
2500+
23692501 if (p_ptr->blind && count)
23702502 msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
2503+
2504+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2505+ mon_fight = TRUE;
23712506 }
23722507
2373-void spell_RF6_S_DRAGON(int y, int x, int m_idx)
2508+void spell_RF6_S_DRAGON(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
23742509 {
2510+ int count = 0, k;
2511+ monster_type *m_ptr = &m_list[m_idx];
23752512 int rlev = monster_level_idx(m_idx);
2376- int k, count = 0;
2513+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2514+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
2515+
2516+ monspell_message(m_idx, t_idx,
2517+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2518+ _("%^sが魔法でドラゴンを召喚した!", "%^s magically summons a dragon!"),
2519+ _("%^sが魔法でドラゴンを召喚した!", "%^s magically summons a dragon!"),
2520+ TARGET_TYPE);
2521+
2522+ for (k = 0; k < 1; k++)
2523+ {
2524+ count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, PM_ALLOW_GROUP);
2525+ }
2526+
2527+ if (p_ptr->blind && count)
2528+ msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
2529+
2530+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2531+ mon_fight = TRUE;
2532+}
2533+
2534+int summon_NAZGUL(int y, int x, int m_idx, int mode)
2535+{
2536+ int count = 0, k;
2537+ int cy = y;
2538+ int cx = x;
23772539 char m_name[80];
23782540 monster_name(m_idx, m_name);
23792541
2380- disturb(1, 1);
2381-
23822542 if (p_ptr->blind)
23832543 msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
23842544 else
2385- msg_format(_("%^sが魔法でドラゴンを召喚した!", "%^s magically summons a dragon!"), m_name);
2545+ msg_format(_("%^sが魔法で幽鬼戦隊を召喚した!", "%^s magically summons rangers of Nazgul!"), m_name);
23862546
2387- for (k = 0; k < 1; k++)
2547+ msg_print(NULL);
2548+
2549+ for (k = 0; k < 30; k++)
23882550 {
2389- count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, PM_ALLOW_GROUP);
2551+ if (!summon_possible(cy, cx) || !cave_empty_bold(cy, cx))
2552+ {
2553+ int j;
2554+ for (j = 100; j > 0; j--)
2555+ {
2556+ scatter(&cy, &cx, y, x, 2, 0);
2557+ if (cave_empty_bold(cy, cx)) break;
2558+ }
2559+ if (!j) break;
2560+ }
2561+ if (!cave_empty_bold(cy, cx)) continue;
2562+
2563+ if (summon_named_creature(m_idx, cy, cx, MON_NAZGUL, mode))
2564+ {
2565+ y = cy;
2566+ x = cx;
2567+ count++;
2568+ if (count == 1)
2569+ msg_format(_("「幽鬼戦隊%d号、ナズグル・ブラック!」",
2570+ "A Nazgul says 'Nazgul-Rangers Number %d, Nazgul-Black!'"), count);
2571+ else
2572+ msg_format(_("「同じく%d号、ナズグル・ブラック!」",
2573+ "Another one says 'Number %d, Nazgul-Black!'"), count);
2574+
2575+ msg_print(NULL);
2576+ }
23902577 }
2391- if (p_ptr->blind && count)
2392- msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
2578+ msg_format(_("「%d人そろって、リングレンジャー!」",
2579+ "They say 'The %d meets! We are the Ring-Ranger!'."), count);
2580+ msg_print(NULL);
2581+ return count;
23932582 }
23942583
2395-void spell_RF6_S_HI_UNDEAD(int y, int x, int m_idx)
2584+void spell_RF6_S_HI_UNDEAD(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
23962585 {
2397- char* m_name = monster_name(m_idx, "");
2586+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2587+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
23982588 monster_type *m_ptr = &m_list[m_idx];
23992589 monster_race *r_ptr = &r_info[m_ptr->r_idx];
24002590 int rlev = monster_level_idx(m_idx);
24012591 u32b mode = 0L;
24022592 int k, count = 0;
2593+ char m_name[80];
2594+ monster_name(m_idx, m_name);
2595+
24032596 disturb(1, 1);
24042597
2405- if (((m_ptr->r_idx == MON_MORGOTH) || (m_ptr->r_idx == MON_SAURON) || (m_ptr->r_idx == MON_ANGMAR)) && ((r_info[MON_NAZGUL].cur_num + 2) < r_info[MON_NAZGUL].max_num))
2598+ if (((m_ptr->r_idx == MON_MORGOTH) || (m_ptr->r_idx == MON_SAURON) || (m_ptr->r_idx == MON_ANGMAR)) &&
2599+ ((r_info[MON_NAZGUL].cur_num + 2) < r_info[MON_NAZGUL].max_num) &&
2600+ mon_to_player)
24062601 {
2407- int cy = y;
2408- int cx = x;
2409-
2410- if (p_ptr->blind)
2411- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2412- else
2413- msg_format(_("%^sが魔法で幽鬼戦隊を召喚した!", "%^s magically summons rangers of Nazgul!"), m_name);
2414-
2415- msg_print(NULL);
2416-
2417- for (k = 0; k < 30; k++)
2418- {
2419- if (!summon_possible(cy, cx) || !cave_empty_bold(cy, cx))
2420- {
2421- int j;
2422- for (j = 100; j > 0; j--)
2423- {
2424- scatter(&cy, &cx, y, x, 2, 0);
2425- if (cave_empty_bold(cy, cx)) break;
2426- }
2427- if (!j) break;
2428- }
2429- if (!cave_empty_bold(cy, cx)) continue;
2430-
2431- if (summon_named_creature(m_idx, cy, cx, MON_NAZGUL, mode))
2432- {
2433- y = cy;
2434- x = cx;
2435- count++;
2436- if (count == 1)
2437- msg_format(_("「幽鬼戦隊%d号、ナズグル・ブラック!」",
2438- "A Nazgul says 'Nazgul-Rangers Number %d, Nazgul-Black!'"), count);
2439- else
2440- msg_format(_("「同じく%d号、ナズグル・ブラック!」",
2441- "Another one says 'Number %d, Nazgul-Black!'"), count);
2442-
2443- msg_print(NULL);
2444- }
2445- }
2446- msg_format(_("「%d人そろって、リングレンジャー!」",
2447- "They say 'The %d meets! We are the Ring-Ranger!'."), count);
2448- msg_print(NULL);
2602+ count += summon_NAZGUL(y, x, m_idx, mode);
24492603 }
24502604 else
2451- {
2452- if (p_ptr->blind)
2453- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2454- else
2455- msg_format(_("%^sが魔法で強力なアンデッドを召喚した!",
2456- "%^s magically summons greater undead!"), m_name);
2605+ {
2606+ monspell_message(m_idx, t_idx,
2607+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2608+ _("%^sが魔法で強力なアンデッドを召喚した!", "%^s magically summons greater undead!"),
2609+ _("%sが魔法でアンデッドを召喚した。", "%^s magically summons undead."),
2610+ TARGET_TYPE);
24572611
24582612 for (k = 0; k < S_NUM_6; k++)
24592613 {
2460- count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2614+ if(mon_to_player)
2615+ count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2616+
2617+ if(mon_to_mon)
2618+ count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | monster_u_mode(m_idx)));
24612619 }
24622620 }
2463- if (p_ptr->blind && count)
2621+ if (p_ptr->blind && count && mon_to_player)
24642622 {
2465- msg_print(_("間近で何か多くのものが這い回る音が聞こえる。",
2466- "You hear many creepy things appear nearby."));
2623+ msg_print(_("間近で何か多くのものが這い回る音が聞こえる。", "You hear many creepy things appear nearby."));
24672624 }
2625+
2626+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2627+ mon_fight = TRUE;
24682628 }
24692629
2470-
2471-void spell_RF6_S_HI_DRAGON(int y, int x, int m_idx)
2630+void spell_RF6_S_HI_DRAGON(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
24722631 {
2473- char* m_name = monster_name(m_idx, "");
2632+ int count = 0, k;
2633+ monster_type *m_ptr = &m_list[m_idx];
24742634 int rlev = monster_level_idx(m_idx);
2475- int k, count = 0;
2476- disturb(1, 1);
2477-
2478- if (p_ptr->blind)
2479- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2480- else
2481- msg_format(_("%^sが魔法で古代ドラゴンを召喚した!", "%^s magically summons ancient dragons!"), m_name);
2482-
2635+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2636+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
2637+
2638+ monspell_message(m_idx, t_idx,
2639+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2640+ _("%^sが魔法で古代ドラゴンを召喚した!", "%^s magically summons ancient dragons!"),
2641+ _("%^sが魔法で古代ドラゴンを召喚した!", "%^s magically summons ancient dragons!"),
2642+ TARGET_TYPE);
2643+
24832644 for (k = 0; k < S_NUM_4; k++)
2484- {
2485- count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2645+ {
2646+ if(mon_to_player)
2647+ count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2648+
2649+ if(mon_to_mon)
2650+ count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | monster_u_mode(m_idx)));
24862651 }
2487- if (p_ptr->blind && count)
2652+
2653+ if (p_ptr->blind && count && mon_to_player)
24882654 {
2489- msg_print(_("多くの力強いものが間近に現れた音が聞こえる。",
2490- "You hear many powerful things appear nearby."));
2655+ msg_print(_("多くの力強いものが間近に現れた音が聞こえる。", "You hear many powerful things appear nearby."));
24912656 }
2657+
2658+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2659+ mon_fight = TRUE;
24922660 }
24932661
2494-void spell_RF6_S_AMBERITES(int y, int x, int m_idx)
2662+void spell_RF6_S_AMBERITES(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
24952663 {
2496- char* m_name = monster_name(m_idx, "");
2664+ int count = 0, k;
2665+ monster_type *m_ptr = &m_list[m_idx];
24972666 int rlev = monster_level_idx(m_idx);
2498- int k, count = 0;
2499- disturb(1, 1);
2500-
2501- if (p_ptr->blind)
2502- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2503- else
2504- msg_format(_("%^sがアンバーの王族を召喚した!", "%^s magically summons Lords of Amber!"), m_name);
2505-
2667+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2668+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
2669+
2670+ monspell_message(m_idx, t_idx,
2671+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2672+ _("%^sがアンバーの王族を召喚した!", "%^s magically summons Lords of Amber!"),
2673+ _("%^sがアンバーの王族を召喚した!", "%^s magically summons Lords of Amber!"),
2674+ TARGET_TYPE);
2675+
25062676 for (k = 0; k < S_NUM_4; k++)
2507- {
2508- count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2677+ {
2678+ count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
25092679 }
2510- if (p_ptr->blind && count)
2680+
2681+ if (p_ptr->blind && count && mon_to_player)
25112682 {
25122683 msg_print(_("不死の者が近くに現れるのが聞こえた。", "You hear immortal beings appear nearby."));
25132684 }
2685+
2686+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2687+ mon_fight = TRUE;
25142688 }
25152689
2516-void spell_RF6_S_UNIQUE(int y, int x, int m_idx)
2690+void spell_RF6_S_UNIQUE(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
25172691 {
2518- char* m_name = monster_name(m_idx, "");
2692+ int count = 0, k;
25192693 monster_type *m_ptr = &m_list[m_idx];
25202694 int rlev = monster_level_idx(m_idx);
2521- int k, count = 0;
2695+ bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
2696+ bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
25222697 bool uniques_are_summoned = FALSE;
25232698 int non_unique_type = SUMMON_HI_UNDEAD;
2524-
2525- disturb(1, 1);
2526-
2527- if (p_ptr->blind)
2528- msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
2529- else
2530- msg_format(_("%^sが魔法で特別な強敵を召喚した!", "%^s magically summons special opponents!"), m_name);
2531-
2699+
2700+ monspell_message(m_idx, t_idx,
2701+ _("%^sが何かをつぶやいた。", "%^s mumbles."),
2702+ _("%^sが魔法で特別な強敵を召喚した!", "%^s magically summons special opponents!"),
2703+ _("%^sが魔法で特別な強敵を召喚した!", "%^s magically summons special opponents!"),
2704+ TARGET_TYPE);
2705+
25322706 for (k = 0; k < S_NUM_4; k++)
2533- {
2707+ {
25342708 count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
25352709 }
2536-
2710+
25372711 if (count) uniques_are_summoned = TRUE;
25382712
25392713 if ((m_ptr->sub_align & (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL)) == (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL))
@@ -2546,14 +2720,16 @@ void spell_RF6_S_UNIQUE(int y, int x, int m_idx)
25462720 count += summon_specific(m_idx, y, x, rlev, non_unique_type, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
25472721 }
25482722
2549- if (p_ptr->blind && count)
2723+ if (p_ptr->blind && count && mon_to_player)
25502724 {
25512725 msg_format(_("多くの%sが間近に現れた音が聞こえる。", "You hear many %s appear nearby."),
25522726 uniques_are_summoned ? _("力強いもの", "powerful things") : _("もの", "things"));
25532727 }
2728+
2729+ if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2730+ mon_fight = TRUE;
25542731 }
25552732
2556-
25572733 int monspell_to_player(int SPELL_NUM, int y, int x, int m_idx)
25582734 {
25592735 switch (SPELL_NUM)
@@ -2633,27 +2809,27 @@ int monspell_to_player(int SPELL_NUM, int y, int x, int m_idx)
26332809 case 160 + 8: spell_RF6_TELE_TO(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_TELE_TO */
26342810 case 160 + 9: spell_RF6_TELE_AWAY(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_TELE_AWAY */
26352811 case 160 + 10: spell_RF6_TELE_LEVEL(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_TELE_LEVEL */
2636- case 160 + 11: spell_RF6_PSY_SPEAR(y, x, m_idx); break; /* RF6_PSY_SPEAR */
2637- case 160 + 12: spell_RF6_DARKNESS(m_idx); break; /* RF6_DARKNESS */
2812+ case 160 + 11: spell_RF6_PSY_SPEAR(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_PSY_SPEAR */
2813+ case 160 + 12: spell_RF6_DARKNESS(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_DARKNESS */
26382814 case 160 + 13: spell_RF6_TRAPS(y, x, m_idx); break; /* RF6_TRAPS */
26392815 case 160 + 14: spell_RF6_FORGET(m_idx); break; /* RF6_FORGET */
2640- case 160 + 15: spell_RF6_RAISE_DEAD(m_idx); break; /* RF6_RAISE_DEAD */
2641- case 160 + 16: spell_RF6_S_KIN(y, x, m_idx); break; /* RF6_S_KIN */
2642- case 160 + 17: spell_RF6_S_CYBER(y, x, m_idx); break; /* RF6_S_CYBER */
2643- case 160 + 18: spell_RF6_S_MONSTER(y, x, m_idx); break; /* RF6_S_MONSTER */
2644- case 160 + 19: spell_RF6_S_MONSTERS(y, x, m_idx); break; /* RF6_S_MONSTER */
2645- case 160 + 20: spell_RF6_S_ANT(y, x, m_idx); break; /* RF6_S_ANT */
2646- case 160 + 21: spell_RF6_S_SPIDER(y, x, m_idx); break; /* RF6_S_SPIDER */
2647- case 160 + 22: spell_RF6_S_HOUND(y, x, m_idx); break; /* RF6_S_HOUND */
2648- case 160 + 23: spell_RF6_S_HYDRA(y, x, m_idx); break; /* RF6_S_HYDRA */
2649- case 160 + 24: spell_RF6_S_ANGEL(y, x, m_idx); break; /* RF6_S_ANGEL */
2650- case 160 + 25: spell_RF6_S_DEMON(y, x, m_idx); break; /* RF6_S_DEMON */
2651- case 160 + 26: spell_RF6_S_UNDEAD(y, x, m_idx); break; /* RF6_S_UNDEAD */
2652- case 160 + 27: spell_RF6_S_DRAGON(y, x, m_idx); break; /* RF6_S_DRAGON */
2653- case 160 + 28: spell_RF6_S_HI_UNDEAD(y, x, m_idx); break; /* RF6_S_HI_UNDEAD */
2654- case 160 + 29: spell_RF6_S_HI_DRAGON(y, x, m_idx); break; /* RF6_S_HI_DRAGON */
2655- case 160 + 30: spell_RF6_S_AMBERITES(y, x, m_idx); break; /* RF6_S_AMBERITES */
2656- case 160 + 31: spell_RF6_S_UNIQUE(y, x, m_idx); break; /* RF6_S_UNIQUE */
2816+ case 160 + 15: spell_RF6_RAISE_DEAD(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_RAISE_DEAD */
2817+ case 160 + 16: spell_RF6_S_KIN(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_KIN */
2818+ case 160 + 17: spell_RF6_S_CYBER(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_CYBER */
2819+ case 160 + 18: spell_RF6_S_MONSTER(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_MONSTER */
2820+ case 160 + 19: spell_RF6_S_MONSTERS(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_MONSTER */
2821+ case 160 + 20: spell_RF6_S_ANT(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_ANT */
2822+ case 160 + 21: spell_RF6_S_SPIDER(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_SPIDER */
2823+ case 160 + 22: spell_RF6_S_HOUND(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_HOUND */
2824+ case 160 + 23: spell_RF6_S_HYDRA(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_HYDRA */
2825+ case 160 + 24: spell_RF6_S_ANGEL(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_ANGEL */
2826+ case 160 + 25: spell_RF6_S_DEMON(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_DEMON */
2827+ case 160 + 26: spell_RF6_S_UNDEAD(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_UNDEAD */
2828+ case 160 + 27: spell_RF6_S_DRAGON(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_DRAGON */
2829+ case 160 + 28: spell_RF6_S_HI_UNDEAD(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_HI_UNDEAD */
2830+ case 160 + 29: spell_RF6_S_HI_DRAGON(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_HI_DRAGON */
2831+ case 160 + 30: spell_RF6_S_AMBERITES(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_AMBERITES */
2832+ case 160 + 31: spell_RF6_S_UNIQUE(y, x, m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_S_UNIQUE */
26572833 }
26582834 return 0;
26592835 }
@@ -2736,7 +2912,28 @@ int monspell_to_monster(int SPELL_NUM, int y, int x, int m_idx, int t_idx)
27362912 case 160 + 7: return spell_RF6_SPECIAL(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF6_SPECIAL */
27372913 case 160 + 8: spell_RF6_TELE_TO(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_TELE_TO */
27382914 case 160 + 9: spell_RF6_TELE_AWAY(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_TELE_AWAY */
2739- case 160 + 10: spell_RF6_TELE_LEVEL(m_idx, t_idx, MONSTER_TO_PLAYER); break; /* RF6_TELE_LEVEL */
2915+ case 160 + 10: spell_RF6_TELE_LEVEL(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_TELE_LEVEL */
2916+ case 160 + 11: spell_RF6_PSY_SPEAR(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_PSY_SPEAR */
2917+ case 160 + 12: spell_RF6_DARKNESS(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_DARKNESS */
2918+ case 160 + 13: return -1; /* RF6_TRAPS */
2919+ case 160 + 14: return -1; /* RF6_FORGET */
2920+ case 160 + 15: spell_RF6_RAISE_DEAD(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_RAISE_DEAD */
2921+ case 160 + 16: spell_RF6_S_KIN(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_KIN */
2922+ case 160 + 17: spell_RF6_S_CYBER(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_CYBER */
2923+ case 160 + 18: spell_RF6_S_MONSTER(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_MONSTER */
2924+ case 160 + 19: spell_RF6_S_MONSTERS(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_MONSTER */
2925+ case 160 + 20: spell_RF6_S_ANT(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_ANT */
2926+ case 160 + 21: spell_RF6_S_SPIDER(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_SPIDER */
2927+ case 160 + 22: spell_RF6_S_HOUND(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_HOUND */
2928+ case 160 + 23: spell_RF6_S_HYDRA(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_HYDRA */
2929+ case 160 + 24: spell_RF6_S_ANGEL(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_ANGEL */
2930+ case 160 + 25: spell_RF6_S_DEMON(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_DEMON */
2931+ case 160 + 26: spell_RF6_S_UNDEAD(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_UNDEAD */
2932+ case 160 + 27: spell_RF6_S_DRAGON(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_DRAGON */
2933+ case 160 + 28: spell_RF6_S_HI_UNDEAD(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_HI_UNDEAD */
2934+ case 160 + 29: spell_RF6_S_HI_DRAGON(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_HI_DRAGON */
2935+ case 160 + 30: spell_RF6_S_AMBERITES(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_AMBERITES */
2936+ case 160 + 31: spell_RF6_S_UNIQUE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_S_UNIQUE */
27402937 }
27412938 return 0;
27422939 }
\ No newline at end of file
Show on old repository browser