• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision10df01b6ebbe9bf80733a3cdbf41a9081f100a9a (tree)
Time2019-02-19 23:29:39
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #38972 project_m()内のRES_ALLの処理を整理。 / Refactor RES_ALL process in project_m().

Change Summary

Incremental Difference

--- a/src/spells1.c
+++ b/src/spells1.c
@@ -1269,2896 +1269,2384 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
12691269
12701270 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
12711271
1272- /* Analyze the damage type */
1273- switch (typ)
1272+ if (r_ptr->flagsr & RFR_RES_ALL &&
1273+ typ != GF_OLD_CLONE && typ != GF_STAR_HEAL && typ != GF_OLD_HEAL
1274+ && typ != GF_OLD_SPEED && typ != GF_CAPTURE && typ != GF_PHOTO)
12741275 {
1275- /* Magic Missile -- pure damage */
1276- case GF_MISSILE:
1276+ note = _("には完全な耐性がある!", " is immune.");
1277+ dam = 0;
1278+ if(is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1279+ if(typ == GF_LITE_WEAK || typ == GF_KILL_WALL) skipped = TRUE;
1280+ }
1281+ else
1282+ {
1283+ /* Analyze the damage type */
1284+ switch (typ)
12771285 {
1278- if (seen) obvious = TRUE;
1279-
1280- if (r_ptr->flagsr & RFR_RES_ALL)
1286+ /* Magic Missile -- pure damage */
1287+ case GF_MISSILE:
12811288 {
1282- note = _("には完全な耐性がある!", " is immune.");
1283- dam = 0;
1284- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1289+ if (seen) obvious = TRUE;
12851290 break;
12861291 }
1287- break;
1288- }
1289-
1290- /* Acid */
1291- case GF_ACID:
1292- {
1293- if (seen) obvious = TRUE;
12941292
1295- if (r_ptr->flagsr & RFR_RES_ALL)
1293+ /* Acid */
1294+ case GF_ACID:
12961295 {
1297- note = _("には完全な耐性がある!", " is immune.");
1298- dam = 0;
1299- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1296+ if (seen) obvious = TRUE;
1297+ if (r_ptr->flagsr & RFR_IM_ACID)
1298+ {
1299+ note = _("にはかなり耐性がある!", " resists a lot.");
1300+ dam /= 9;
1301+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1302+ }
13001303 break;
13011304 }
1302- if (r_ptr->flagsr & RFR_IM_ACID)
1303- {
1304- note = _("にはかなり耐性がある!", " resists a lot.");
1305- dam /= 9;
1306- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1307- }
1308- break;
1309- }
1310-
1311- /* Electricity */
1312- case GF_ELEC:
1313- {
1314- if (seen) obvious = TRUE;
13151305
1316- if (r_ptr->flagsr & RFR_RES_ALL)
1306+ /* Electricity */
1307+ case GF_ELEC:
13171308 {
1318- note = _("には完全な耐性がある!", " is immune.");
1319- dam = 0;
1320- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1309+ if (seen) obvious = TRUE;
1310+ if (r_ptr->flagsr & RFR_IM_ELEC)
1311+ {
1312+ note = _("にはかなり耐性がある!", " resists a lot.");
1313+ dam /= 9;
1314+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1315+ }
13211316 break;
13221317 }
1323- if (r_ptr->flagsr & RFR_IM_ELEC)
1324- {
1325- note = _("にはかなり耐性がある!", " resists a lot.");
1326- dam /= 9;
1327- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1328- }
1329- break;
1330- }
1331-
1332- /* Fire damage */
1333- case GF_FIRE:
1334- {
1335- if (seen) obvious = TRUE;
13361318
1337- if (r_ptr->flagsr & RFR_RES_ALL)
1319+ /* Fire damage */
1320+ case GF_FIRE:
13381321 {
1339- note = _("には完全な耐性がある!", " is immune.");
1340- dam = 0;
1341- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1322+ if (seen) obvious = TRUE;
1323+ if (r_ptr->flagsr & RFR_IM_FIRE)
1324+ {
1325+ note = _("にはかなり耐性がある!", " resists a lot.");
1326+ dam /= 9;
1327+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1328+ }
1329+ else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1330+ {
1331+ note = _("はひどい痛手をうけた。", " is hit hard.");
1332+ dam *= 2;
1333+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1334+ }
13421335 break;
13431336 }
1344- if (r_ptr->flagsr & RFR_IM_FIRE)
1345- {
1346- note = _("にはかなり耐性がある!", " resists a lot.");
1347- dam /= 9;
1348- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1349- }
1350- else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1351- {
1352- note = _("はひどい痛手をうけた。", " is hit hard.");
1353- dam *= 2;
1354- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1355- }
1356- break;
1357- }
13581337
1359- /* Cold */
1360- case GF_COLD:
1361- {
1362- if (seen) obvious = TRUE;
1363-
1364- if (r_ptr->flagsr & RFR_RES_ALL)
1338+ /* Cold */
1339+ case GF_COLD:
13651340 {
1366- note = _("には完全な耐性がある!", " is immune.");
1367- dam = 0;
1368- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1341+ if (seen) obvious = TRUE;
1342+ if (r_ptr->flagsr & RFR_IM_COLD)
1343+ {
1344+ note = _("にはかなり耐性がある!", " resists a lot.");
1345+ dam /= 9;
1346+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1347+ }
1348+ else if (r_ptr->flags3 & (RF3_HURT_COLD))
1349+ {
1350+ note = _("はひどい痛手をうけた。", " is hit hard.");
1351+ dam *= 2;
1352+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1353+ }
13691354 break;
13701355 }
1371- if (r_ptr->flagsr & RFR_IM_COLD)
1372- {
1373- note = _("にはかなり耐性がある!", " resists a lot.");
1374- dam /= 9;
1375- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1376- }
1377- else if (r_ptr->flags3 & (RF3_HURT_COLD))
1378- {
1379- note = _("はひどい痛手をうけた。", " is hit hard.");
1380- dam *= 2;
1381- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1382- }
1383- break;
1384- }
1385-
1386- /* Poison */
1387- case GF_POIS:
1388- {
1389- if (seen) obvious = TRUE;
13901356
1391- if (r_ptr->flagsr & RFR_RES_ALL)
1357+ /* Poison */
1358+ case GF_POIS:
13921359 {
1393- note = _("には完全な耐性がある!", " is immune.");
1394- dam = 0;
1395- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1360+ if (seen) obvious = TRUE;
1361+ if (r_ptr->flagsr & RFR_IM_POIS)
1362+ {
1363+ note = _("にはかなり耐性がある!", " resists a lot.");
1364+ dam /= 9;
1365+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1366+ }
13961367 break;
13971368 }
1398- if (r_ptr->flagsr & RFR_IM_POIS)
1399- {
1400- note = _("にはかなり耐性がある!", " resists a lot.");
1401- dam /= 9;
1402- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1403- }
1404- break;
1405- }
1406-
1407- /* Nuclear waste */
1408- case GF_NUKE:
1409- {
1410- if (seen) obvious = TRUE;
14111369
1412- if (r_ptr->flagsr & RFR_RES_ALL)
1370+ /* Nuclear waste */
1371+ case GF_NUKE:
14131372 {
1414- note = _("には完全な耐性がある!", " is immune.");
1415- dam = 0;
1416- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1373+ if (seen) obvious = TRUE;
1374+ if (r_ptr->flagsr & RFR_IM_POIS)
1375+ {
1376+ note = _("には耐性がある。", " resists.");
1377+ dam *= 3; dam /= randint1(6) + 6;
1378+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1379+ }
1380+ else if (one_in_(3)) do_poly = TRUE;
14171381 break;
14181382 }
1419- if (r_ptr->flagsr & RFR_IM_POIS)
1420- {
1421- note = _("には耐性がある。", " resists.");
1422- dam *= 3; dam /= randint1(6) + 6;
1423- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1424- }
1425- else if (one_in_(3)) do_poly = TRUE;
1426- break;
1427- }
1428-
1429- /* Hellfire -- hurts Evil */
1430- case GF_HELL_FIRE:
1431- {
1432- if (seen) obvious = TRUE;
14331383
1434- if (r_ptr->flagsr & RFR_RES_ALL)
1384+ /* Hellfire -- hurts Evil */
1385+ case GF_HELL_FIRE:
14351386 {
1436- note = _("には完全な耐性がある!", " is immune.");
1437- dam = 0;
1438- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1387+ if (seen) obvious = TRUE;
1388+ if (r_ptr->flags3 & RF3_GOOD)
1389+ {
1390+ note = _("はひどい痛手をうけた。", " is hit hard.");
1391+ dam *= 2;
1392+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1393+ }
14391394 break;
14401395 }
1441- if (r_ptr->flags3 & RF3_GOOD)
1442- {
1443- note = _("はひどい痛手をうけた。", " is hit hard.");
1444- dam *= 2;
1445- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1446- }
1447- break;
1448- }
1449-
1450- /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1451- case GF_HOLY_FIRE:
1452- {
1453- if (seen) obvious = TRUE;
14541396
1455- if (r_ptr->flagsr & RFR_RES_ALL)
1397+ /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1398+ case GF_HOLY_FIRE:
14561399 {
1457- note = _("には完全な耐性がある!", " is immune.");
1458- dam = 0;
1459- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1400+ if (seen) obvious = TRUE;
1401+ if (r_ptr->flags3 & RF3_EVIL)
1402+ {
1403+ dam *= 2;
1404+ note = _("はひどい痛手をうけた。", " is hit hard.");
1405+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
1406+ }
1407+ else
1408+ {
1409+ note = _("には耐性がある。", " resists.");
1410+ dam *= 3; dam /= randint1(6) + 6;
1411+ }
14601412 break;
14611413 }
1462- if (r_ptr->flags3 & RF3_GOOD)
1463- {
1464- note = _("には完全な耐性がある!", " is immune.");
1465- dam = 0;
1466- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
1467- }
1468- else if (r_ptr->flags3 & RF3_EVIL)
1469- {
1470- dam *= 2;
1471- note = _("はひどい痛手をうけた。", " is hit hard.");
1472- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
1473- }
1474- else
1475- {
1476- note = _("には耐性がある。", " resists.");
1477- dam *= 3; dam /= randint1(6) + 6;
1478- }
1479- break;
1480- }
1481-
1482- /* Arrow -- XXX no defense */
1483- case GF_ARROW:
1484- {
1485- if (seen) obvious = TRUE;
14861414
1487- if (r_ptr->flagsr & RFR_RES_ALL)
1415+ /* Arrow -- XXX no defense */
1416+ case GF_ARROW:
14881417 {
1489- note = _("には完全な耐性がある!", " is immune.");
1490- dam = 0;
1491- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1418+ if (seen) obvious = TRUE;
14921419 break;
14931420 }
1494- break;
1495- }
1496-
1497- /* Plasma -- XXX perhaps check ELEC or FIRE */
1498- case GF_PLASMA:
1499- {
1500- if (seen) obvious = TRUE;
15011421
1502- if (r_ptr->flagsr & RFR_RES_ALL)
1422+ /* Plasma -- XXX perhaps check ELEC or FIRE */
1423+ case GF_PLASMA:
15031424 {
1504- note = _("には完全な耐性がある!", " is immune.");
1505- dam = 0;
1506- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1425+ if (seen) obvious = TRUE;
1426+ if (r_ptr->flagsr & RFR_RES_PLAS)
1427+ {
1428+ note = _("には耐性がある。", " resists.");
1429+ dam *= 3; dam /= randint1(6) + 6;
1430+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
1431+ }
15071432 break;
15081433 }
1509- if (r_ptr->flagsr & RFR_RES_PLAS)
1434+
1435+ /* Nether -- see above */
1436+ case GF_NETHER:
15101437 {
1511- note = _("には耐性がある。", " resists.");
1512- dam *= 3; dam /= randint1(6) + 6;
1513- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
1438+ if (seen) obvious = TRUE;
1439+ if (r_ptr->flagsr & RFR_RES_NETH)
1440+ {
1441+ if (r_ptr->flags3 & RF3_UNDEAD)
1442+ {
1443+ note = _("には完全な耐性がある!", " is immune.");
1444+ dam = 0;
1445+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
1446+ }
1447+ else
1448+ {
1449+ note = _("には耐性がある。", " resists.");
1450+ dam *= 3; dam /= randint1(6) + 6;
1451+ }
1452+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
1453+ }
1454+ else if (r_ptr->flags3 & RF3_EVIL)
1455+ {
1456+ note = _("はいくらか耐性を示した。", " resists somewhat.");
1457+ dam /= 2;
1458+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
1459+ }
1460+ break;
15141461 }
1515- break;
1516- }
1517-
1518- /* Nether -- see above */
1519- case GF_NETHER:
1520- {
1521- if (seen) obvious = TRUE;
15221462
1523- if (r_ptr->flagsr & RFR_RES_ALL)
1463+ /* Water (acid) damage -- Water spirits/elementals are immune */
1464+ case GF_WATER:
15241465 {
1525- note = _("には完全な耐性がある!", " is immune.");
1526- dam = 0;
1527- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1466+ if (seen) obvious = TRUE;
1467+ if (r_ptr->flagsr & RFR_RES_WATE)
1468+ {
1469+ if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
1470+ {
1471+ note = _("には完全な耐性がある!", " is immune.");
1472+ dam = 0;
1473+ }
1474+ else
1475+ {
1476+ note = _("には耐性がある。", " resists.");
1477+ dam *= 3; dam /= randint1(6) + 6;
1478+ }
1479+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
1480+ }
15281481 break;
15291482 }
1530- if (r_ptr->flagsr & RFR_RES_NETH)
1483+
1484+ /* Chaos -- Chaos breathers resist */
1485+ case GF_CHAOS:
15311486 {
1532- if (r_ptr->flags3 & RF3_UNDEAD)
1487+ if (seen) obvious = TRUE;
1488+ if (r_ptr->flagsr & RFR_RES_CHAO)
15331489 {
1534- note = _("には完全な耐性がある!", " is immune.");
1535- dam = 0;
1536- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
1490+ note = _("には耐性がある。", " resists.");
1491+ dam *= 3; dam /= randint1(6) + 6;
1492+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
1493+ }
1494+ else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
1495+ {
1496+ note = _("はいくらか耐性を示した。", " resists somewhat.");
1497+ dam *= 3; dam /= randint1(6) + 6;
1498+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
15371499 }
15381500 else
15391501 {
1502+ do_poly = TRUE;
1503+ do_conf = (5 + randint1(11) + r) / (r + 1);
1504+ }
1505+ break;
1506+ }
1507+
1508+ /* Shards -- Shard breathers resist */
1509+ case GF_SHARDS:
1510+ {
1511+ if (seen) obvious = TRUE;
1512+ if (r_ptr->flagsr & RFR_RES_SHAR)
1513+ {
15401514 note = _("には耐性がある。", " resists.");
15411515 dam *= 3; dam /= randint1(6) + 6;
1516+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
15421517 }
1543- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
1518+ break;
15441519 }
1545- else if (r_ptr->flags3 & RF3_EVIL)
1520+
1521+ /* Rocket: Shard resistance helps */
1522+ case GF_ROCKET:
15461523 {
1547- note = _("はいくらか耐性を示した。", " resists somewhat.");
1548- dam /= 2;
1549- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
1524+ if (seen) obvious = TRUE;
1525+ if (r_ptr->flagsr & RFR_RES_SHAR)
1526+ {
1527+ note = _("はいくらか耐性を示した。", " resists somewhat.");
1528+ dam /= 2;
1529+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1530+ }
1531+ break;
15501532 }
1551- break;
1552- }
15531533
1554- /* Water (acid) damage -- Water spirits/elementals are immune */
1555- case GF_WATER:
1556- {
1557- if (seen) obvious = TRUE;
15581534
1559- if (r_ptr->flagsr & RFR_RES_ALL)
1535+ /* Sound -- Sound breathers resist */
1536+ case GF_SOUND:
15601537 {
1561- note = _("には完全な耐性がある!", " is immune.");
1562- dam = 0;
1563- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1538+ if (seen) obvious = TRUE;
1539+ if (r_ptr->flagsr & RFR_RES_SOUN)
1540+ {
1541+ note = _("には耐性がある。", " resists.");
1542+ dam *= 2; dam /= randint1(6) + 6;
1543+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
1544+ }
1545+ else do_stun = (10 + randint1(15) + r) / (r + 1);
15641546 break;
15651547 }
1566- if (r_ptr->flagsr & RFR_RES_WATE)
1548+
1549+ /* Confusion */
1550+ case GF_CONFUSION:
15671551 {
1568- if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
1569- {
1570- note = _("には完全な耐性がある!", " is immune.");
1571- dam = 0;
1572- }
1573- else
1552+ if (seen) obvious = TRUE;
1553+ if (r_ptr->flags3 & RF3_NO_CONF)
15741554 {
15751555 note = _("には耐性がある。", " resists.");
15761556 dam *= 3; dam /= randint1(6) + 6;
1557+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
15771558 }
1578- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
1559+ else do_conf = (10 + randint1(15) + r) / (r + 1);
1560+ break;
15791561 }
1580- break;
1581- }
1582-
1583- /* Chaos -- Chaos breathers resist */
1584- case GF_CHAOS:
1585- {
1586- if (seen) obvious = TRUE;
15871562
1588- if (r_ptr->flagsr & RFR_RES_ALL)
1563+ /* Disenchantment -- Breathers and Disenchanters resist */
1564+ case GF_DISENCHANT:
15891565 {
1590- note = _("には完全な耐性がある!", " is immune.");
1591- dam = 0;
1592- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1566+ if (seen) obvious = TRUE;
1567+ if (r_ptr->flagsr & RFR_RES_DISE)
1568+ {
1569+ note = _("には耐性がある。", " resists.");
1570+ dam *= 3; dam /= randint1(6) + 6;
1571+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
1572+ }
15931573 break;
15941574 }
1595- if (r_ptr->flagsr & RFR_RES_CHAO)
1575+
1576+ /* Nexus -- Breathers and Existers resist */
1577+ case GF_NEXUS:
15961578 {
1597- note = _("には耐性がある。", " resists.");
1598- dam *= 3; dam /= randint1(6) + 6;
1599- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
1579+ if (seen) obvious = TRUE;
1580+ if (r_ptr->flagsr & RFR_RES_NEXU)
1581+ {
1582+ note = _("には耐性がある。", " resists.");
1583+ dam *= 3; dam /= randint1(6) + 6;
1584+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
1585+ }
1586+ break;
16001587 }
1601- else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
1588+
1589+ /* Force */
1590+ case GF_FORCE:
16021591 {
1603- note = _("はいくらか耐性を示した。", " resists somewhat.");
1604- dam *= 3; dam /= randint1(6) + 6;
1605- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
1606- }
1607- else
1608- {
1609- do_poly = TRUE;
1610- do_conf = (5 + randint1(11) + r) / (r + 1);
1592+ if (seen) obvious = TRUE;
1593+ if (r_ptr->flagsr & RFR_RES_WALL)
1594+ {
1595+ note = _("には耐性がある。", " resists.");
1596+ dam *= 3; dam /= randint1(6) + 6;
1597+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
1598+ }
1599+ else do_stun = (randint1(15) + r) / (r + 1);
1600+ break;
16111601 }
1612- break;
1613- }
1614-
1615- /* Shards -- Shard breathers resist */
1616- case GF_SHARDS:
1617- {
1618- if (seen) obvious = TRUE;
16191602
1620- if (r_ptr->flagsr & RFR_RES_ALL)
1603+ /* Inertia -- breathers resist */
1604+ case GF_INERTIAL:
16211605 {
1622- note = _("には完全な耐性がある!", " is immune.");
1623- dam = 0;
1624- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1606+ if (seen) obvious = TRUE;
1607+ if (r_ptr->flagsr & RFR_RES_INER)
1608+ {
1609+ note = _("には耐性がある。", " resists.");
1610+ dam *= 3; dam /= randint1(6) + 6;
1611+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
1612+ }
1613+ else
1614+ {
1615+ /* Powerful monsters can resist */
1616+ if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1617+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1618+ {
1619+ obvious = FALSE;
1620+ }
1621+ /* Normal monsters slow down */
1622+ else
1623+ {
1624+ if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1625+ {
1626+ note = _("の動きが遅くなった。", " starts moving slower.");
1627+ }
1628+ }
1629+ }
16251630 break;
16261631 }
1627- if (r_ptr->flagsr & RFR_RES_SHAR)
1628- {
1629- note = _("には耐性がある。", " resists.");
1630- dam *= 3; dam /= randint1(6) + 6;
1631- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1632- }
1633- break;
1634- }
1635-
1636- /* Rocket: Shard resistance helps */
1637- case GF_ROCKET:
1638- {
1639- if (seen) obvious = TRUE;
16401632
1641- if (r_ptr->flagsr & RFR_RES_ALL)
1633+ /* Time -- breathers resist */
1634+ case GF_TIME:
16421635 {
1643- note = _("には完全な耐性がある!", " is immune.");
1644- dam = 0;
1645- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1636+ if (seen) obvious = TRUE;
1637+ if (r_ptr->flagsr & RFR_RES_TIME)
1638+ {
1639+ note = _("には耐性がある。", " resists.");
1640+ dam *= 3; dam /= randint1(6) + 6;
1641+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
1642+ }
1643+ else do_time = (dam + 1) / 2;
16461644 break;
16471645 }
1648- if (r_ptr->flagsr & RFR_RES_SHAR)
1646+
1647+ /* Gravity -- breathers resist */
1648+ case GF_GRAVITY:
16491649 {
1650- note = _("はいくらか耐性を示した。", " resists somewhat.");
1651- dam /= 2;
1652- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1653- }
1654- break;
1655- }
1650+ bool resist_tele = FALSE;
16561651
1652+ if (seen) obvious = TRUE;
1653+ if (r_ptr->flagsr & RFR_RES_TELE)
1654+ {
1655+ if (r_ptr->flags1 & (RF1_UNIQUE))
1656+ {
1657+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1658+ note = _("には効果がなかった。", " is unaffected!");
1659+ resist_tele = TRUE;
1660+ }
1661+ else if (r_ptr->level > randint1(100))
1662+ {
1663+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1664+ note = _("には耐性がある!", " resists!");
1665+ resist_tele = TRUE;
1666+ }
1667+ }
16571668
1658- /* Sound -- Sound breathers resist */
1659- case GF_SOUND:
1660- {
1661- if (seen) obvious = TRUE;
1669+ if (!resist_tele) do_dist = 10;
1670+ else do_dist = 0;
1671+ if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0;
16621672
1663- if (r_ptr->flagsr & RFR_RES_ALL)
1664- {
1665- note = _("には完全な耐性がある!", " is immune.");
1666- dam = 0;
1667- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1668- break;
1669- }
1670- if (r_ptr->flagsr & RFR_RES_SOUN)
1671- {
1672- note = _("には耐性がある。", " resists.");
1673- dam *= 2; dam /= randint1(6) + 6;
1674- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
1675- }
1676- else do_stun = (10 + randint1(15) + r) / (r + 1);
1677- break;
1678- }
1673+ if (r_ptr->flagsr & RFR_RES_GRAV)
1674+ {
1675+ note = _("には耐性がある!", " resists!");
1676+ dam *= 3; dam /= randint1(6) + 6;
1677+ do_dist = 0;
1678+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
1679+ }
1680+ else
1681+ {
1682+ /* 1. slowness */
1683+ /* Powerful monsters can resist */
1684+ if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1685+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1686+ {
1687+ obvious = FALSE;
1688+ }
1689+ /* Normal monsters slow down */
1690+ else
1691+ {
1692+ if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1693+ {
1694+ note = _("の動きが遅くなった。", " starts moving slower.");
1695+ }
1696+ }
16791697
1680- /* Confusion */
1681- case GF_CONFUSION:
1682- {
1683- if (seen) obvious = TRUE;
1698+ /* 2. stun */
1699+ do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
16841700
1685- if (r_ptr->flagsr & RFR_RES_ALL)
1686- {
1687- note = _("には完全な耐性がある!", " is immune.");
1688- dam = 0;
1689- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1701+ /* Attempt a saving throw */
1702+ if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1703+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1704+ {
1705+ /* Resist */
1706+ do_stun = 0;
1707+ /* No obvious effect */
1708+ note = _("には効果がなかった。", " is unaffected!");
1709+ obvious = FALSE;
1710+ }
1711+ }
16901712 break;
16911713 }
1692- if (r_ptr->flags3 & RF3_NO_CONF)
1693- {
1694- note = _("には耐性がある。", " resists.");
1695- dam *= 3; dam /= randint1(6) + 6;
1696- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1697- }
1698- else do_conf = (10 + randint1(15) + r) / (r + 1);
1699- break;
1700- }
1701-
1702- /* Disenchantment -- Breathers and Disenchanters resist */
1703- case GF_DISENCHANT:
1704- {
1705- if (seen) obvious = TRUE;
17061714
1707- if (r_ptr->flagsr & RFR_RES_ALL)
1715+ /* Pure damage */
1716+ case GF_MANA:
1717+ case GF_SEEKER:
1718+ case GF_SUPER_RAY:
17081719 {
1709- note = _("には完全な耐性がある!", " is immune.");
1710- dam = 0;
1711- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1720+ if (seen) obvious = TRUE;
17121721 break;
17131722 }
1714- if (r_ptr->flagsr & RFR_RES_DISE)
1715- {
1716- note = _("には耐性がある。", " resists.");
1717- dam *= 3; dam /= randint1(6) + 6;
1718- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
1719- }
1720- break;
1721- }
17221723
1723- /* Nexus -- Breathers and Existers resist */
1724- case GF_NEXUS:
1725- {
1726- if (seen) obvious = TRUE;
17271724
1728- if (r_ptr->flagsr & RFR_RES_ALL)
1725+ /* Pure damage */
1726+ case GF_DISINTEGRATE:
17291727 {
1730- note = _("には完全な耐性がある!", " is immune.");
1731- dam = 0;
1732- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1728+ if (seen) obvious = TRUE;
1729+ if (r_ptr->flags3 & RF3_HURT_ROCK)
1730+ {
1731+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
1732+ note = _("の皮膚がただれた!", " loses some skin!");
1733+ note_dies = _("は蒸発した!", " evaporates!");
1734+ dam *= 2;
1735+ }
17331736 break;
17341737 }
1735- if (r_ptr->flagsr & RFR_RES_NEXU)
1736- {
1737- note = _("には耐性がある。", " resists.");
1738- dam *= 3; dam /= randint1(6) + 6;
1739- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
1740- }
1741- break;
1742- }
1743-
1744- /* Force */
1745- case GF_FORCE:
1746- {
1747- if (seen) obvious = TRUE;
17481738
1749- if (r_ptr->flagsr & RFR_RES_ALL)
1750- {
1751- note = _("には完全な耐性がある!", " is immune.");
1752- dam = 0;
1753- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1754- break;
1755- }
1756- if (r_ptr->flagsr & RFR_RES_WALL)
1739+ case GF_PSI:
17571740 {
1758- note = _("には耐性がある。", " resists.");
1759- dam *= 3; dam /= randint1(6) + 6;
1760- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
1761- }
1762- else do_stun = (randint1(15) + r) / (r + 1);
1763- break;
1764- }
1765-
1766- /* Inertia -- breathers resist */
1767- case GF_INERTIAL:
1768- {
1769- if (seen) obvious = TRUE;
1741+ if (seen) obvious = TRUE;
17701742
1771- if (r_ptr->flagsr & RFR_RES_ALL)
1772- {
1773- note = _("には完全な耐性がある!", " is immune.");
1774- dam = 0;
1775- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1776- break;
1777- }
1778- if (r_ptr->flagsr & RFR_RES_INER)
1779- {
1780- note = _("には耐性がある。", " resists.");
1781- dam *= 3; dam /= randint1(6) + 6;
1782- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
1783- }
1784- else
1785- {
1786- /* Powerful monsters can resist */
1787- if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1788- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1743+ /* PSI only works if the monster can see you! -- RG */
1744+ if (!(los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)))
17891745 {
1790- obvious = FALSE;
1746+ if (seen_msg)
1747+ msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), m_name);
1748+ skipped = TRUE;
1749+ break;
17911750 }
1792- /* Normal monsters slow down */
1793- else
1751+ if (r_ptr->flags2 & RF2_EMPTY_MIND)
17941752 {
1795- if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1753+ dam = 0;
1754+ note = _("には完全な耐性がある!", " is immune.");
1755+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1756+
1757+ }
1758+ else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
1759+ (r_ptr->flags3 & RF3_ANIMAL) ||
1760+ (r_ptr->level > randint1(3 * dam)))
1761+ {
1762+ note = _("には耐性がある!", " resists!");
1763+ dam /= 3;
1764+
1765+ /*
1766+ * Powerful demons & undead can turn a mindcrafter's
1767+ * attacks back on them
1768+ */
1769+ if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1770+ (r_ptr->level > p_ptr->lev / 2) &&
1771+ one_in_(2))
17961772 {
1797- note = _("の動きが遅くなった。", " starts moving slower.");
1773+ note = NULL;
1774+ msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1775+ (seen ? "%^s's corrupted mind backlashes your attack!" :
1776+ "%^ss corrupted mind backlashes your attack!")), m_name);
1777+
1778+ /* Saving throw */
1779+ if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
1780+ {
1781+ msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1782+ }
1783+ else
1784+ {
1785+ /* Injure +/- confusion */
1786+ monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
1787+ take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1788+ if (one_in_(4) && !CHECK_MULTISHADOW())
1789+ {
1790+ switch (randint1(4))
1791+ {
1792+ case 1:
1793+ set_confused(p_ptr->confused + 3 + randint1(dam));
1794+ break;
1795+ case 2:
1796+ set_stun(p_ptr->stun + randint1(dam));
1797+ break;
1798+ case 3:
1799+ {
1800+ if (r_ptr->flags3 & RF3_NO_FEAR)
1801+ note = _("には効果がなかった。", " is unaffected.");
1802+ else
1803+ set_afraid(p_ptr->afraid + 3 + randint1(dam));
1804+ break;
1805+ }
1806+ default:
1807+ if (!p_ptr->free_act)
1808+ (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
1809+ break;
1810+ }
1811+ }
1812+ }
1813+ dam = 0;
17981814 }
17991815 }
1800- }
1801- break;
1802- }
18031816
1804- /* Time -- breathers resist */
1805- case GF_TIME:
1806- {
1807- if (seen) obvious = TRUE;
1817+ if ((dam > 0) && one_in_(4))
1818+ {
1819+ switch (randint1(4))
1820+ {
1821+ case 1:
1822+ do_conf = 3 + randint1(dam);
1823+ break;
1824+ case 2:
1825+ do_stun = 3 + randint1(dam);
1826+ break;
1827+ case 3:
1828+ do_fear = 3 + randint1(dam);
1829+ break;
1830+ default:
1831+ note = _("は眠り込んでしまった!", " falls asleep!");
1832+ do_sleep = 3 + randint1(dam);
1833+ break;
1834+ }
1835+ }
18081836
1809- if (r_ptr->flagsr & RFR_RES_ALL)
1810- {
1811- note = _("には完全な耐性がある!", " is immune.");
1812- dam = 0;
1813- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1837+ note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
18141838 break;
18151839 }
1816- if (r_ptr->flagsr & RFR_RES_TIME)
1817- {
1818- note = _("には耐性がある。", " resists.");
1819- dam *= 3; dam /= randint1(6) + 6;
1820- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
1821- }
1822- else do_time = (dam + 1) / 2;
1823- break;
1824- }
1825-
1826- /* Gravity -- breathers resist */
1827- case GF_GRAVITY:
1828- {
1829- bool resist_tele = FALSE;
18301840
1831- if (seen) obvious = TRUE;
1832-
1833- if (r_ptr->flagsr & RFR_RES_ALL)
1834- {
1835- note = _("には完全な耐性がある!", " is immune.");
1836- dam = 0;
1837- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1838- break;
1839- }
1840- if (r_ptr->flagsr & RFR_RES_TELE)
1841+ case GF_PSI_DRAIN:
18411842 {
1842- if (r_ptr->flags1 & (RF1_UNIQUE))
1843+ if (seen) obvious = TRUE;
1844+ if (r_ptr->flags2 & RF2_EMPTY_MIND)
18431845 {
1844- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1845- note = _("には効果がなかった。", " is unaffected!");
1846- resist_tele = TRUE;
1846+ dam = 0;
1847+ note = _("には完全な耐性がある!", " is immune.");
18471848 }
1848- else if (r_ptr->level > randint1(100))
1849+ else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
1850+ (r_ptr->flags3 & RF3_ANIMAL) ||
1851+ (r_ptr->level > randint1(3 * dam)))
18491852 {
1850- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
18511853 note = _("には耐性がある!", " resists!");
1852- resist_tele = TRUE;
1853- }
1854- }
1854+ dam /= 3;
18551855
1856- if (!resist_tele) do_dist = 10;
1857- else do_dist = 0;
1858- if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1856+ /*
1857+ * Powerful demons & undead can turn a mindcrafter's
1858+ * attacks back on them
1859+ */
1860+ if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1861+ (r_ptr->level > p_ptr->lev / 2) &&
1862+ (one_in_(2)))
1863+ {
1864+ note = NULL;
1865+ msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1866+ (seen ? "%^s's corrupted mind backlashes your attack!" :
1867+ "%^ss corrupted mind backlashes your attack!")), m_name);
1868+ /* Saving throw */
1869+ if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
1870+ {
1871+ msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
1872+ }
1873+ else
1874+ {
1875+ /* Injure + mana drain */
1876+ monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
1877+ if (!CHECK_MULTISHADOW())
1878+ {
1879+ msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
1880+ p_ptr->csp -= damroll(5, dam) / 2;
1881+ if (p_ptr->csp < 0) p_ptr->csp = 0;
1882+ p_ptr->redraw |= PR_MANA;
1883+ p_ptr->window |= (PW_SPELL);
1884+ }
1885+ take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1886+ }
1887+ dam = 0;
1888+ }
1889+ }
1890+ else if (dam > 0)
1891+ {
1892+ int b = damroll(5, dam) / 4;
1893+ concptr str = (p_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
1894+ concptr msg = _("あなたは%sの苦痛を%sに変換した!",
1895+ (seen ? "You convert %s's pain into %s!" :
1896+ "You convert %ss pain into %s!"));
1897+ msg_format(msg, m_name, str);
18591898
1860- if (r_ptr->flagsr & RFR_RES_GRAV)
1861- {
1862- note = _("には耐性がある!", " resists!");
1863- dam *= 3; dam /= randint1(6) + 6;
1864- do_dist = 0;
1865- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
1899+ b = MIN(p_ptr->msp, p_ptr->csp + b);
1900+ p_ptr->csp = b;
1901+ p_ptr->redraw |= PR_MANA;
1902+ p_ptr->window |= (PW_SPELL);
1903+ }
1904+ note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1905+ break;
18661906 }
1867- else
1907+
1908+ case GF_TELEKINESIS:
18681909 {
1869- /* 1. slowness */
1870- /* Powerful monsters can resist */
1871- if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1872- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1873- {
1874- obvious = FALSE;
1875- }
1876- /* Normal monsters slow down */
1877- else
1910+ if (seen) obvious = TRUE;
1911+ if (one_in_(4))
18781912 {
1879- if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1880- {
1881- note = _("の動きが遅くなった。", " starts moving slower.");
1882- }
1913+ if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1914+ else do_dist = 7;
18831915 }
18841916
1885- /* 2. stun */
1886- do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
1917+ /* 1. stun */
1918+ do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
18871919
18881920 /* Attempt a saving throw */
1889- if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1890- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1921+ if ((r_ptr->flags1 & RF1_UNIQUE) ||
1922+ (r_ptr->level > 5 + randint1(dam)))
18911923 {
18921924 /* Resist */
18931925 do_stun = 0;
18941926 /* No obvious effect */
1895- note = _("には効果がなかった。", " is unaffected!");
18961927 obvious = FALSE;
18971928 }
1929+ break;
18981930 }
1899- break;
1900- }
19011931
1902- /* Pure damage */
1903- case GF_MANA:
1904- case GF_SEEKER:
1905- case GF_SUPER_RAY:
1906- {
1907- if (seen) obvious = TRUE;
1908-
1909- if (r_ptr->flagsr & RFR_RES_ALL)
1932+ /* Psycho-spear -- powerful magic missile */
1933+ case GF_PSY_SPEAR:
19101934 {
1911- note = _("には完全な耐性がある!", " is immune.");
1912- dam = 0;
1913- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1914- break;
1915- }
1916- break;
1917- }
1918-
1919-
1920- /* Pure damage */
1921- case GF_DISINTEGRATE:
1922- {
1923- if (seen) obvious = TRUE;
1924-
1925- if (r_ptr->flagsr & RFR_RES_ALL)
1926- {
1927- note = _("には完全な耐性がある!", " is immune.");
1928- dam = 0;
1929- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1930- break;
1931- }
1932- if (r_ptr->flags3 & RF3_HURT_ROCK)
1933- {
1934- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
1935- note = _("の皮膚がただれた!", " loses some skin!");
1936- note_dies = _("は蒸発した!", " evaporates!");
1937- dam *= 2;
1938- }
1939- break;
1940- }
1941-
1942- case GF_PSI:
1943- {
1944- if (seen) obvious = TRUE;
1945-
1946- /* PSI only works if the monster can see you! -- RG */
1947- if (!(los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)))
1948- {
1949- if (seen_msg)
1950- msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), m_name);
1951- skipped = TRUE;
1935+ if (seen) obvious = TRUE;
19521936 break;
19531937 }
19541938
1955- if (r_ptr->flagsr & RFR_RES_ALL)
1939+ /* Meteor -- powerful magic missile */
1940+ case GF_METEOR:
19561941 {
1957- note = _("には完全な耐性がある!", " is immune.");
1958- dam = 0;
1959- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1942+ if (seen) obvious = TRUE;
19601943 break;
19611944 }
1962- if (r_ptr->flags2 & RF2_EMPTY_MIND)
1963- {
1964- dam = 0;
1965- note = _("には完全な耐性がある!", " is immune.");
1966- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
19671945
1968- }
1969- else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
1970- (r_ptr->flags3 & RF3_ANIMAL) ||
1971- (r_ptr->level > randint1(3 * dam)))
1946+ case GF_DOMINATION:
19721947 {
1973- note = _("には耐性がある!", " resists!");
1974- dam /= 3;
1975-
1976- /*
1977- * Powerful demons & undead can turn a mindcrafter's
1978- * attacks back on them
1979- */
1980- if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1981- (r_ptr->level > p_ptr->lev / 2) &&
1982- one_in_(2))
1948+ if (!is_hostile(m_ptr)) break;
1949+ if (seen) obvious = TRUE;
1950+ /* Attempt a saving throw */
1951+ if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
1952+ (r_ptr->flags3 & RF3_NO_CONF) ||
1953+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
19831954 {
1984- note = NULL;
1985- msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1986- (seen ? "%^s's corrupted mind backlashes your attack!" :
1987- "%^ss corrupted mind backlashes your attack!")), m_name);
1988-
1989- /* Saving throw */
1990- if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
1955+ /* Memorize a flag */
1956+ if (r_ptr->flags3 & RF3_NO_CONF)
19911957 {
1992- msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1958+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
19931959 }
1994- else
1960+
1961+ /* Resist */
1962+ do_conf = 0;
1963+
1964+ /*
1965+ * Powerful demons & undead can turn a mindcrafter's
1966+ * attacks back on them
1967+ */
1968+ if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1969+ (r_ptr->level > p_ptr->lev / 2) &&
1970+ (one_in_(2)))
19951971 {
1996- /* Injure +/- confusion */
1997- monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
1998- take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1999- if (one_in_(4) && !CHECK_MULTISHADOW())
1972+ note = NULL;
1973+ msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1974+ (seen ? "%^s's corrupted mind backlashes your attack!" :
1975+ "%^ss corrupted mind backlashes your attack!")), m_name);
1976+
1977+ /* Saving throw */
1978+ if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
1979+ {
1980+ msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1981+ }
1982+ else
20001983 {
1984+ /* Confuse, stun, terrify */
20011985 switch (randint1(4))
20021986 {
20031987 case 1:
2004- set_confused(p_ptr->confused + 3 + randint1(dam));
1988+ set_stun(p_ptr->stun + dam / 2);
20051989 break;
20061990 case 2:
2007- set_stun(p_ptr->stun + randint1(dam));
1991+ set_confused(p_ptr->confused + dam / 2);
20081992 break;
2009- case 3:
1993+ default:
20101994 {
20111995 if (r_ptr->flags3 & RF3_NO_FEAR)
20121996 note = _("には効果がなかった。", " is unaffected.");
20131997 else
2014- set_afraid(p_ptr->afraid + 3 + randint1(dam));
2015- break;
1998+ set_afraid(p_ptr->afraid + dam);
20161999 }
2017- default:
2018- if (!p_ptr->free_act)
2019- (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2020- break;
20212000 }
20222001 }
20232002 }
2024- dam = 0;
2025- }
2026- }
2027-
2028- if ((dam > 0) && one_in_(4))
2029- {
2030- switch (randint1(4))
2031- {
2032- case 1:
2033- do_conf = 3 + randint1(dam);
2034- break;
2035- case 2:
2036- do_stun = 3 + randint1(dam);
2037- break;
2038- case 3:
2039- do_fear = 3 + randint1(dam);
2040- break;
2041- default:
2042- note = _("は眠り込んでしまった!", " falls asleep!");
2043- do_sleep = 3 + randint1(dam);
2044- break;
2045- }
2046- }
2047-
2048- note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
2049- break;
2050- }
2051-
2052- case GF_PSI_DRAIN:
2053- {
2054- if (seen) obvious = TRUE;
2055-
2056- if (r_ptr->flagsr & RFR_RES_ALL)
2057- {
2058- note = _("には完全な耐性がある!", " is immune.");
2059- dam = 0;
2060- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2061- break;
2062- }
2063- if (r_ptr->flags2 & RF2_EMPTY_MIND)
2064- {
2065- dam = 0;
2066- note = _("には完全な耐性がある!", " is immune.");
2067- }
2068- else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2069- (r_ptr->flags3 & RF3_ANIMAL) ||
2070- (r_ptr->level > randint1(3 * dam)))
2071- {
2072- note = _("には耐性がある!", " resists!");
2073- dam /= 3;
2074-
2075- /*
2076- * Powerful demons & undead can turn a mindcrafter's
2077- * attacks back on them
2078- */
2079- if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2080- (r_ptr->level > p_ptr->lev / 2) &&
2081- (one_in_(2)))
2082- {
2083- note = NULL;
2084- msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2085- (seen ? "%^s's corrupted mind backlashes your attack!" :
2086- "%^ss corrupted mind backlashes your attack!")), m_name);
2087- /* Saving throw */
2088- if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
2089- {
2090- msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
2091- }
2092- else
2093- {
2094- /* Injure + mana drain */
2095- monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2096- if (!CHECK_MULTISHADOW())
2097- {
2098- msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
2099- p_ptr->csp -= damroll(5, dam) / 2;
2100- if (p_ptr->csp < 0) p_ptr->csp = 0;
2101- p_ptr->redraw |= PR_MANA;
2102- p_ptr->window |= (PW_SPELL);
2103- }
2104- take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2105- }
2106- dam = 0;
2107- }
2108- }
2109- else if (dam > 0)
2110- {
2111- int b = damroll(5, dam) / 4;
2112- concptr str = (p_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
2113- concptr msg = _("あなたは%sの苦痛を%sに変換した!",
2114- (seen ? "You convert %s's pain into %s!" :
2115- "You convert %ss pain into %s!"));
2116- msg_format(msg, m_name, str);
2117-
2118- b = MIN(p_ptr->msp, p_ptr->csp + b);
2119- p_ptr->csp = b;
2120- p_ptr->redraw |= PR_MANA;
2121- p_ptr->window |= (PW_SPELL);
2122- }
2123- note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
2124- break;
2125- }
2126-
2127- case GF_TELEKINESIS:
2128- {
2129- if (seen) obvious = TRUE;
2130-
2131- if (r_ptr->flagsr & RFR_RES_ALL)
2132- {
2133- note = _("には完全な耐性がある!", " is immune.");
2134- dam = 0;
2135- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2136- break;
2137- }
2138- if (one_in_(4))
2139- {
2140- if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2141- else do_dist = 7;
2142- }
2143-
2144- /* 1. stun */
2145- do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2146-
2147- /* Attempt a saving throw */
2148- if ((r_ptr->flags1 & RF1_UNIQUE) ||
2149- (r_ptr->level > 5 + randint1(dam)))
2150- {
2151- /* Resist */
2152- do_stun = 0;
2153- /* No obvious effect */
2154- obvious = FALSE;
2155- }
2156- break;
2157- }
2158-
2159- /* Psycho-spear -- powerful magic missile */
2160- case GF_PSY_SPEAR:
2161- {
2162- if (seen) obvious = TRUE;
2163-
2164- if (r_ptr->flagsr & RFR_RES_ALL)
2165- {
2166- note = _("には完全な耐性がある!", " is immune.");
2167- dam = 0;
2168- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2169- break;
2170- }
2171- break;
2172- }
2173-
2174- /* Meteor -- powerful magic missile */
2175- case GF_METEOR:
2176- {
2177- if (seen) obvious = TRUE;
2178-
2179- if (r_ptr->flagsr & RFR_RES_ALL)
2180- {
2181- note = _("には完全な耐性がある!", " is immune.");
2182- dam = 0;
2183- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2184- break;
2185- }
2186- break;
2187- }
2188-
2189- case GF_DOMINATION:
2190- {
2191- if (!is_hostile(m_ptr)) break;
2192-
2193- if (seen) obvious = TRUE;
2194-
2195- if (r_ptr->flagsr & RFR_RES_ALL)
2196- {
2197- note = _("には効果がなかった!", " is immune.");
2198- dam = 0;
2199- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2200- break;
2201- }
2202- /* Attempt a saving throw */
2203- if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
2204- (r_ptr->flags3 & RF3_NO_CONF) ||
2205- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2206- {
2207- /* Memorize a flag */
2208- if (r_ptr->flags3 & RF3_NO_CONF)
2209- {
2210- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2211- }
2212-
2213- /* Resist */
2214- do_conf = 0;
2215-
2216- /*
2217- * Powerful demons & undead can turn a mindcrafter's
2218- * attacks back on them
2219- */
2220- if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2221- (r_ptr->level > p_ptr->lev / 2) &&
2222- (one_in_(2)))
2223- {
2224- note = NULL;
2225- msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2226- (seen ? "%^s's corrupted mind backlashes your attack!" :
2227- "%^ss corrupted mind backlashes your attack!")), m_name);
2228-
2229- /* Saving throw */
2230- if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2231- {
2232- msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
2233- }
22342003 else
22352004 {
2236- /* Confuse, stun, terrify */
2237- switch (randint1(4))
2238- {
2239- case 1:
2240- set_stun(p_ptr->stun + dam / 2);
2241- break;
2242- case 2:
2243- set_confused(p_ptr->confused + dam / 2);
2244- break;
2245- default:
2246- {
2247- if (r_ptr->flags3 & RF3_NO_FEAR)
2248- note = _("には効果がなかった。", " is unaffected.");
2249- else
2250- set_afraid(p_ptr->afraid + dam);
2251- }
2252- }
2005+ /* No obvious effect */
2006+ note = _("には効果がなかった。", " is unaffected.");
2007+ obvious = FALSE;
22532008 }
22542009 }
22552010 else
22562011 {
2257- /* No obvious effect */
2258- note = _("には効果がなかった。", " is unaffected.");
2259- obvious = FALSE;
2260- }
2261- }
2262- else
2263- {
2264- if (!common_saving_throw_charm(p_ptr, dam, m_ptr))
2265- {
2266- note = _("があなたに隷属した。", " is in your thrall!");
2267- set_pet(m_ptr);
2268- }
2269- else
2270- {
2271- switch (randint1(4))
2012+ if (!common_saving_throw_charm(p_ptr, dam, m_ptr))
22722013 {
2273- case 1:
2274- do_stun = dam / 2;
2275- break;
2276- case 2:
2277- do_conf = dam / 2;
2278- break;
2279- default:
2280- do_fear = dam;
2014+ note = _("があなたに隷属した。", " is in your thrall!");
2015+ set_pet(m_ptr);
22812016 }
2282- }
2283- }
2284-
2285- /* No "real" damage */
2286- dam = 0;
2287- break;
2288- }
2289-
2290-
2291-
2292- /* Ice -- Cold + Cuts + Stun */
2293- case GF_ICE:
2294- {
2295- if (seen) obvious = TRUE;
2296-
2297- if (r_ptr->flagsr & RFR_RES_ALL)
2298- {
2299- note = _("には完全な耐性がある!", " is immune.");
2300- dam = 0;
2301- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2302- break;
2303- }
2304- do_stun = (randint1(15) + 1) / (r + 1);
2305- if (r_ptr->flagsr & RFR_IM_COLD)
2306- {
2307- note = _("にはかなり耐性がある!", " resists a lot.");
2308- dam /= 9;
2309- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
2310- }
2311- else if (r_ptr->flags3 & (RF3_HURT_COLD))
2312- {
2313- note = _("はひどい痛手をうけた。", " is hit hard.");
2314- dam *= 2;
2315- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
2316- }
2317- break;
2318- }
2319-
2320-
2321- /* Drain Life */
2322- case GF_HYPODYNAMIA:
2323- {
2324- if (seen) obvious = TRUE;
2325-
2326- if (r_ptr->flagsr & RFR_RES_ALL)
2327- {
2328- note = _("には完全な耐性がある!", " is immune.");
2329- dam = 0;
2330- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2331- break;
2332- }
2333- if (!monster_living(m_ptr->r_idx))
2334- {
2335- if (is_original_ap_and_seen(m_ptr))
2336- {
2337- if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2338- if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2339- if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2340- }
2341- note = _("には効果がなかった。", " is unaffected.");
2342- obvious = FALSE;
2343- dam = 0;
2344- }
2345- else do_time = (dam+7)/8;
2346-
2347- break;
2348- }
2349-
2350- /* Death Ray */
2351- case GF_DEATH_RAY:
2352- {
2353- if (seen) obvious = TRUE;
2354-
2355- if (r_ptr->flagsr & RFR_RES_ALL)
2356- {
2357- note = _("には完全な耐性がある!", " is immune.");
2358- dam = 0;
2359- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2360- break;
2361- }
2362- if (!monster_living(m_ptr->r_idx))
2363- {
2364- if (is_original_ap_and_seen(m_ptr))
2365- {
2366- if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2367- if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2368- if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2369- }
2370- note = _("には完全な耐性がある!", " is immune.");
2371- obvious = FALSE;
2372- dam = 0;
2373- }
2374- else if (((r_ptr->flags1 & RF1_UNIQUE) &&
2375- (randint1(888) != 666)) ||
2376- (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
2377- randint1(100) != 66))
2378- {
2379- note = _("には耐性がある!", " resists!");
2380- obvious = FALSE;
2381- dam = 0;
2382- }
2383-
2384- break;
2385- }
2386-
2387- /* Polymorph monster (Use "dam" as "power") */
2388- case GF_OLD_POLY:
2389- {
2390- if (seen) obvious = TRUE;
2391-
2392- if (r_ptr->flagsr & RFR_RES_ALL)
2393- {
2394- note = _("には効果がなかった。", " is unaffected.");
2395- dam = 0;
2396- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2397- break;
2398- }
2399- /* Attempt to polymorph (see below) */
2400- do_poly = TRUE;
2401-
2402- /* Powerful monsters can resist */
2403- if ((r_ptr->flags1 & RF1_UNIQUE) ||
2404- (r_ptr->flags1 & RF1_QUESTOR) ||
2405- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2406- {
2407- note = _("には効果がなかった。", " is unaffected.");
2408- do_poly = FALSE;
2409- obvious = FALSE;
2410- }
2411-
2412- /* No "real" damage */
2413- dam = 0;
2414-
2415- break;
2416- }
2417-
2418-
2419- /* Clone monsters (Ignore "dam") */
2420- case GF_OLD_CLONE:
2421- {
2422- if (seen) obvious = TRUE;
2423-
2424- if ((p_ptr->inside_arena) || is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
2425- {
2426- note = _("には効果がなかった。", " is unaffected.");
2427- }
2428- else
2429- {
2430- /* Heal fully */
2431- m_ptr->hp = m_ptr->maxhp;
2432-
2433- /* Attempt to clone. */
2434- if (multiply_monster(g_ptr->m_idx, TRUE, 0L))
2435- {
2436- note = _("が分裂した!", " spawns!");
2437- }
2438- }
2439-
2440- /* No "real" damage */
2441- dam = 0;
2442-
2443- break;
2444- }
2445-
2446-
2447- /* Heal Monster (use "dam" as amount of healing) */
2448- case GF_STAR_HEAL:
2449- {
2450- if (seen) obvious = TRUE;
2451-
2452- /* Wake up */
2453- (void)set_monster_csleep(g_ptr->m_idx, 0);
2454-
2455- if (m_ptr->maxhp < m_ptr->max_maxhp)
2456- {
2457- if (seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), m_name, m_poss);
2458- m_ptr->maxhp = m_ptr->max_maxhp;
2459- }
2460-
2461- if (!dam)
2462- {
2463- /* Redraw (later) if needed */
2464- if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2465- if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2466- break;
2467- }
2468-
2469- /* Fall through */
2470- }
2471- case GF_OLD_HEAL:
2472- {
2473- if (seen) obvious = TRUE;
2474-
2475- /* Wake up */
2476- (void)set_monster_csleep(g_ptr->m_idx, 0);
2477- if (MON_STUNNED(m_ptr))
2478- {
2479- if (seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), m_name);
2480- (void)set_monster_stunned(g_ptr->m_idx, 0);
2481- }
2482- if (MON_CONFUSED(m_ptr))
2483- {
2484- if (seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), m_name);
2485- (void)set_monster_confused(g_ptr->m_idx, 0);
2486- }
2487- if (MON_MONFEAR(m_ptr))
2488- {
2489- if (seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name);
2490- (void)set_monster_monfear(g_ptr->m_idx, 0);
2491- }
2492-
2493- /* Heal */
2494- if (m_ptr->hp < 30000) m_ptr->hp += dam;
2495-
2496- /* No overflow */
2497- if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2498-
2499- if (!who)
2500- {
2501- chg_virtue(V_VITALITY, 1);
2502-
2503- if (r_ptr->flags1 & RF1_UNIQUE)
2504- chg_virtue(V_INDIVIDUALISM, 1);
2505-
2506- if (is_friendly(m_ptr))
2507- chg_virtue(V_HONOUR, 1);
2508- else if (!(r_ptr->flags3 & RF3_EVIL))
2509- {
2510- if (r_ptr->flags3 & RF3_GOOD)
2511- chg_virtue(V_COMPASSION, 2);
25122017 else
2513- chg_virtue(V_COMPASSION, 1);
2514- }
2515-
2516- if (r_ptr->flags3 & RF3_ANIMAL)
2517- chg_virtue(V_NATURE, 1);
2518- }
2519-
2520- if (m_ptr->r_idx == MON_LEPER)
2521- {
2522- heal_leper = TRUE;
2523- if (!who) chg_virtue(V_COMPASSION, 5);
2524- }
2525-
2526- /* Redraw (later) if needed */
2527- if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2528- if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2529-
2530- note = _("は体力を回復したようだ。", " looks healthier.");
2531-
2532- /* No "real" damage */
2533- dam = 0;
2534- break;
2535- }
2536-
2537-
2538- /* Speed Monster (Ignore "dam") */
2539- case GF_OLD_SPEED:
2540- {
2541- if (seen) obvious = TRUE;
2542-
2543- /* Speed up */
2544- if (set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100))
2545- {
2546- note = _("の動きが速くなった。", " starts moving faster.");
2547- }
2548-
2549- if (!who)
2550- {
2551- if (r_ptr->flags1 & RF1_UNIQUE)
2552- chg_virtue(V_INDIVIDUALISM, 1);
2553- if (is_friendly(m_ptr))
2554- chg_virtue(V_HONOUR, 1);
2555- }
2556-
2557- /* No "real" damage */
2558- dam = 0;
2559- break;
2560- }
2561-
2562-
2563- /* Slow Monster (Use "dam" as "power") */
2564- case GF_OLD_SLOW:
2565- {
2566- if (seen) obvious = TRUE;
2567-
2568- if (r_ptr->flagsr & RFR_RES_ALL)
2569- {
2570- note = _("には効果がなかった。", " is unaffected.");
2571- dam = 0;
2572- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2573- break;
2574- }
2575- /* Powerful monsters can resist */
2576- if ((r_ptr->flags1 & RF1_UNIQUE) ||
2577- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2578- {
2579- note = _("には効果がなかった。", " is unaffected.");
2580- obvious = FALSE;
2581- }
2582-
2583- /* Normal monsters slow down */
2584- else
2585- {
2586- if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2587- {
2588- note = _("の動きが遅くなった。", " starts moving slower.");
2589- }
2590- }
2591-
2592- /* No "real" damage */
2593- dam = 0;
2594- break;
2595- }
2596-
2597-
2598- /* Sleep (Use "dam" as "power") */
2599- case GF_OLD_SLEEP:
2600- {
2601- if (seen) obvious = TRUE;
2602-
2603- if (r_ptr->flagsr & RFR_RES_ALL)
2604- {
2605- note = _("には効果がなかった。", " is unaffected.");
2606- dam = 0;
2607- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2608- break;
2609- }
2610- /* Attempt a saving throw */
2611- if ((r_ptr->flags1 & RF1_UNIQUE) ||
2612- (r_ptr->flags3 & RF3_NO_SLEEP) ||
2613- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2614- {
2615- /* Memorize a flag */
2616- if (r_ptr->flags3 & RF3_NO_SLEEP)
2617- {
2618- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
2619- }
2620- /* No obvious effect */
2621- note = _("には効果がなかった。", " is unaffected.");
2622- obvious = FALSE;
2623- }
2624- else
2625- {
2626- /* Go to sleep (much) later */
2627- note = _("は眠り込んでしまった!", " falls asleep!");
2628- do_sleep = 500;
2629- }
2630-
2631- /* No "real" damage */
2632- dam = 0;
2633- break;
2634- }
2635-
2636-
2637- /* Sleep (Use "dam" as "power") */
2638- case GF_STASIS_EVIL:
2639- {
2640- if (seen) obvious = TRUE;
2018+ {
2019+ switch (randint1(4))
2020+ {
2021+ case 1:
2022+ do_stun = dam / 2;
2023+ break;
2024+ case 2:
2025+ do_conf = dam / 2;
2026+ break;
2027+ default:
2028+ do_fear = dam;
2029+ }
2030+ }
2031+ }
26412032
2642- if (r_ptr->flagsr & RFR_RES_ALL)
2643- {
2644- note = _("には効果がなかった!", " is immune.");
2033+ /* No "real" damage */
26452034 dam = 0;
2646- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
26472035 break;
26482036 }
2649- /* Attempt a saving throw */
2650- if ((r_ptr->flags1 & RF1_UNIQUE) ||
2651- !(r_ptr->flags3 & RF3_EVIL) ||
2652- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2653- {
2654- note = _("には効果がなかった。", " is unaffected.");
2655- obvious = FALSE;
2656- }
2657- else
2658- {
2659- /* Go to sleep (much) later */
2660- note = _("は動けなくなった!", " is suspended!");
2661- do_sleep = 500;
2662- }
2663-
2664- /* No "real" damage */
2665- dam = 0;
2666- break;
2667- }
2668-
2669- /* Sleep (Use "dam" as "power") */
2670- case GF_STASIS:
2671- {
2672- if (seen) obvious = TRUE;
26732037
2674- if (r_ptr->flagsr & RFR_RES_ALL)
2038+ /* Ice -- Cold + Cuts + Stun */
2039+ case GF_ICE:
26752040 {
2676- note = _("には効果がなかった。", " is unaffected.");
2677- dam = 0;
2678- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2041+ if (seen) obvious = TRUE;
2042+ do_stun = (randint1(15) + 1) / (r + 1);
2043+ if (r_ptr->flagsr & RFR_IM_COLD)
2044+ {
2045+ note = _("にはかなり耐性がある!", " resists a lot.");
2046+ dam /= 9;
2047+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
2048+ }
2049+ else if (r_ptr->flags3 & (RF3_HURT_COLD))
2050+ {
2051+ note = _("はひどい痛手をうけた。", " is hit hard.");
2052+ dam *= 2;
2053+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
2054+ }
26792055 break;
26802056 }
2681- /* Attempt a saving throw */
2682- if ((r_ptr->flags1 & RF1_UNIQUE) ||
2683- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2684- {
2685- note = _("には効果がなかった。", " is unaffected.");
2686- obvious = FALSE;
2687- }
2688- else
2689- {
2690- /* Go to sleep (much) later */
2691- note = _("は動けなくなった!", " is suspended!");
2692- do_sleep = 500;
2693- }
26942057
2695- /* No "real" damage */
2696- dam = 0;
2697- break;
2698- }
26992058
2700- /* Charm monster */
2701- case GF_CHARM:
2702- {
2703- int vir;
2704- vir = virtue_number(V_HARMONY);
2705- if (vir)
2059+ /* Drain Life */
2060+ case GF_HYPODYNAMIA:
27062061 {
2707- dam += p_ptr->virtues[vir-1]/10;
2708- }
2062+ if (seen) obvious = TRUE;
2063+ if (!monster_living(m_ptr->r_idx))
2064+ {
2065+ if (is_original_ap_and_seen(m_ptr))
2066+ {
2067+ if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2068+ if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2069+ if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2070+ }
2071+ note = _("には効果がなかった。", " is unaffected.");
2072+ obvious = FALSE;
2073+ dam = 0;
2074+ }
2075+ else do_time = (dam+7)/8;
27092076
2710- vir = virtue_number(V_INDIVIDUALISM);
2711- if (vir)
2712- {
2713- dam -= p_ptr->virtues[vir-1]/20;
2077+ break;
27142078 }
27152079
2716- if (seen) obvious = TRUE;
2717-
2718- /* Attempt a saving throw */
2719- if (common_saving_throw_charm(p_ptr, dam, m_ptr))
2080+ /* Death Ray */
2081+ case GF_DEATH_RAY:
27202082 {
2083+ if (seen) obvious = TRUE;
2084+ if (!monster_living(m_ptr->r_idx))
2085+ {
2086+ if (is_original_ap_and_seen(m_ptr))
2087+ {
2088+ if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2089+ if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2090+ if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2091+ }
2092+ note = _("には完全な耐性がある!", " is immune.");
2093+ obvious = FALSE;
2094+ dam = 0;
2095+ }
2096+ else if (((r_ptr->flags1 & RF1_UNIQUE) &&
2097+ (randint1(888) != 666)) ||
2098+ (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
2099+ randint1(100) != 66))
2100+ {
2101+ note = _("には耐性がある!", " resists!");
2102+ obvious = FALSE;
2103+ dam = 0;
2104+ }
27212105
2722- /* Resist */
2723- /* No obvious effect */
2724- note = _("には効果がなかった。", " is unaffected.");
2725- obvious = FALSE;
2726-
2727- if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2728- }
2729- else if (p_ptr->cursed & TRC_AGGRAVATE)
2730- {
2731- note = _("はあなたに敵意を抱いている!", " hates you too much!");
2732- if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2106+ break;
27332107 }
2734- else
2735- {
2736- note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
2737- set_pet(m_ptr);
27382108
2739- chg_virtue(V_INDIVIDUALISM, -1);
2740- if (r_ptr->flags3 & RF3_ANIMAL)
2741- chg_virtue(V_NATURE, 1);
2742- }
2109+ /* Polymorph monster (Use "dam" as "power") */
2110+ case GF_OLD_POLY:
2111+ {
2112+ if (seen) obvious = TRUE;
2113+ /* Attempt to polymorph (see below) */
2114+ do_poly = TRUE;
27432115
2744- /* No "real" damage */
2745- dam = 0;
2746- break;
2747- }
2116+ /* Powerful monsters can resist */
2117+ if ((r_ptr->flags1 & RF1_UNIQUE) ||
2118+ (r_ptr->flags1 & RF1_QUESTOR) ||
2119+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2120+ {
2121+ note = _("には効果がなかった。", " is unaffected.");
2122+ do_poly = FALSE;
2123+ obvious = FALSE;
2124+ }
27482125
2749- /* Control undead */
2750- case GF_CONTROL_UNDEAD:
2751- {
2752- int vir;
2753- if (seen) obvious = TRUE;
2126+ /* No "real" damage */
2127+ dam = 0;
27542128
2755- vir = virtue_number(V_UNLIFE);
2756- if (vir)
2757- {
2758- dam += p_ptr->virtues[vir-1]/10;
2129+ break;
27592130 }
27602131
2761- vir = virtue_number(V_INDIVIDUALISM);
2762- if (vir)
2763- {
2764- dam -= p_ptr->virtues[vir-1]/20;
2765- }
27662132
2767- /* Attempt a saving throw */
2768- if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2769- !(r_ptr->flags3 & RF3_UNDEAD))
2770- {
2771- /* No obvious effect */
2772- note = _("には効果がなかった。", " is unaffected.");
2773- obvious = FALSE;
2774- if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2775- }
2776- else if (p_ptr->cursed & TRC_AGGRAVATE)
2133+ /* Clone monsters (Ignore "dam") */
2134+ case GF_OLD_CLONE:
27772135 {
2778- note = _("はあなたに敵意を抱いている!", " hates you too much!");
2779- if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2780- }
2781- else
2782- {
2783- note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2784- set_pet(m_ptr);
2785- }
2136+ if (seen) obvious = TRUE;
27862137
2787- /* No "real" damage */
2788- dam = 0;
2789- break;
2790- }
2138+ if ((p_ptr->inside_arena) || is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
2139+ {
2140+ note = _("には効果がなかった。", " is unaffected.");
2141+ }
2142+ else
2143+ {
2144+ /* Heal fully */
2145+ m_ptr->hp = m_ptr->maxhp;
27912146
2792- /* Control demon */
2793- case GF_CONTROL_DEMON:
2794- {
2795- int vir;
2796- if (seen) obvious = TRUE;
2147+ /* Attempt to clone. */
2148+ if (multiply_monster(g_ptr->m_idx, TRUE, 0L))
2149+ {
2150+ note = _("が分裂した!", " spawns!");
2151+ }
2152+ }
27972153
2798- vir = virtue_number(V_UNLIFE);
2799- if (vir)
2800- {
2801- dam += p_ptr->virtues[vir-1]/10;
2802- }
2154+ /* No "real" damage */
2155+ dam = 0;
28032156
2804- vir = virtue_number(V_INDIVIDUALISM);
2805- if (vir)
2806- {
2807- dam -= p_ptr->virtues[vir-1]/20;
2157+ break;
28082158 }
28092159
2810- /* Attempt a saving throw */
2811- if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2812- !(r_ptr->flags3 & RF3_DEMON))
2813- {
2814- /* No obvious effect */
2815- note = _("には効果がなかった。", " is unaffected.");
2816- obvious = FALSE;
2817- if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2818- }
2819- else if (p_ptr->cursed & TRC_AGGRAVATE)
2820- {
2821- note = _("はあなたに敵意を抱いている!", " hates you too much!");
2822- if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2823- }
2824- else
2825- {
2826- note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2827- set_pet(m_ptr);
2828- }
28292160
2830- /* No "real" damage */
2831- dam = 0;
2832- break;
2833- }
2161+ /* Heal Monster (use "dam" as amount of healing) */
2162+ case GF_STAR_HEAL:
2163+ {
2164+ if (seen) obvious = TRUE;
28342165
2835- /* Tame animal */
2836- case GF_CONTROL_ANIMAL:
2837- {
2838- int vir;
2839- if (seen) obvious = TRUE;
2166+ /* Wake up */
2167+ (void)set_monster_csleep(g_ptr->m_idx, 0);
28402168
2841- vir = virtue_number(V_NATURE);
2842- if (vir)
2843- {
2844- dam += p_ptr->virtues[vir-1]/10;
2845- }
2169+ if (m_ptr->maxhp < m_ptr->max_maxhp)
2170+ {
2171+ if (seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), m_name, m_poss);
2172+ m_ptr->maxhp = m_ptr->max_maxhp;
2173+ }
28462174
2847- vir = virtue_number(V_INDIVIDUALISM);
2848- if (vir)
2849- {
2850- dam -= p_ptr->virtues[vir-1]/20;
2851- }
2175+ if (!dam)
2176+ {
2177+ /* Redraw (later) if needed */
2178+ if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2179+ if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2180+ break;
2181+ }
28522182
2853- /* Attempt a saving throw */
2854- if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2855- !(r_ptr->flags3 & RF3_ANIMAL))
2856- {
2857- /* Resist */
2858- /* No obvious effect */
2859- note = _("には効果がなかった。", " is unaffected.");
2860- obvious = FALSE;
2861- if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2862- }
2863- else if (p_ptr->cursed & TRC_AGGRAVATE)
2864- {
2865- note = _("はあなたに敵意を抱いている!", " hates you too much!");
2866- if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2183+ /* Fall through */
28672184 }
2868- else
2185+ case GF_OLD_HEAL:
28692186 {
2870- note = _("はなついた。", " is tamed!");
2871- set_pet(m_ptr);
2872- if (r_ptr->flags3 & RF3_ANIMAL)
2873- chg_virtue(V_NATURE, 1);
2874- }
2187+ if (seen) obvious = TRUE;
28752188
2876- /* No "real" damage */
2877- dam = 0;
2878- break;
2879- }
2189+ /* Wake up */
2190+ (void)set_monster_csleep(g_ptr->m_idx, 0);
2191+ if (MON_STUNNED(m_ptr))
2192+ {
2193+ if (seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), m_name);
2194+ (void)set_monster_stunned(g_ptr->m_idx, 0);
2195+ }
2196+ if (MON_CONFUSED(m_ptr))
2197+ {
2198+ if (seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), m_name);
2199+ (void)set_monster_confused(g_ptr->m_idx, 0);
2200+ }
2201+ if (MON_MONFEAR(m_ptr))
2202+ {
2203+ if (seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name);
2204+ (void)set_monster_monfear(g_ptr->m_idx, 0);
2205+ }
28802206
2881- /* Tame animal */
2882- case GF_CHARM_LIVING:
2883- {
2884- int vir;
2207+ /* Heal */
2208+ if (m_ptr->hp < 30000) m_ptr->hp += dam;
28852209
2886- vir = virtue_number(V_UNLIFE);
2887- if (seen) obvious = TRUE;
2210+ /* No overflow */
2211+ if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
28882212
2889- vir = virtue_number(V_UNLIFE);
2890- if (vir)
2891- {
2892- dam -= p_ptr->virtues[vir-1]/10;
2893- }
2213+ if (!who)
2214+ {
2215+ chg_virtue(V_VITALITY, 1);
28942216
2895- vir = virtue_number(V_INDIVIDUALISM);
2896- if (vir)
2897- {
2898- dam -= p_ptr->virtues[vir-1]/20;
2899- }
2217+ if (r_ptr->flags1 & RF1_UNIQUE)
2218+ chg_virtue(V_INDIVIDUALISM, 1);
29002219
2901- msg_format(_("%sを見つめた。", "You stare into %s."), m_name);
2220+ if (is_friendly(m_ptr))
2221+ chg_virtue(V_HONOUR, 1);
2222+ else if (!(r_ptr->flags3 & RF3_EVIL))
2223+ {
2224+ if (r_ptr->flags3 & RF3_GOOD)
2225+ chg_virtue(V_COMPASSION, 2);
2226+ else
2227+ chg_virtue(V_COMPASSION, 1);
2228+ }
29022229
2903- /* Attempt a saving throw */
2904- if (common_saving_throw_charm(p_ptr, dam, m_ptr) ||
2905- !monster_living(m_ptr->r_idx))
2906- {
2907- /* Resist */
2908- /* No obvious effect */
2909- note = _("には効果がなかった。", " is unaffected.");
2910- obvious = FALSE;
2911- if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2912- }
2913- else if (p_ptr->cursed & TRC_AGGRAVATE)
2914- {
2915- note = _("はあなたに敵意を抱いている!", " hates you too much!");
2916- if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2917- }
2918- else
2919- {
2920- note = _("を支配した。", " is tamed!");
2921- set_pet(m_ptr);
2922- if (r_ptr->flags3 & RF3_ANIMAL)
2923- chg_virtue(V_NATURE, 1);
2924- }
2230+ if (r_ptr->flags3 & RF3_ANIMAL)
2231+ chg_virtue(V_NATURE, 1);
2232+ }
29252233
2926- /* No "real" damage */
2927- dam = 0;
2928- break;
2929- }
2234+ if (m_ptr->r_idx == MON_LEPER)
2235+ {
2236+ heal_leper = TRUE;
2237+ if (!who) chg_virtue(V_COMPASSION, 5);
2238+ }
29302239
2931- /* Confusion (Use "dam" as "power") */
2932- case GF_OLD_CONF:
2933- {
2934- if (seen) obvious = TRUE;
2240+ /* Redraw (later) if needed */
2241+ if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2242+ if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
29352243
2936- if (r_ptr->flagsr & RFR_RES_ALL)
2937- {
2938- note = _("には効果がなかった。", " is unaffected.");
2244+ note = _("は体力を回復したようだ。", " looks healthier.");
2245+
2246+ /* No "real" damage */
29392247 dam = 0;
2940- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
29412248 break;
29422249 }
2943- /* Get confused later */
2944- do_conf = damroll(3, (dam / 2)) + 1;
29452250
2946- /* Attempt a saving throw */
2947- if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2948- (r_ptr->flags3 & (RF3_NO_CONF)) ||
2949- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2251+
2252+ /* Speed Monster (Ignore "dam") */
2253+ case GF_OLD_SPEED:
29502254 {
2951- /* Memorize a flag */
2952- if (r_ptr->flags3 & (RF3_NO_CONF))
2255+ if (seen) obvious = TRUE;
2256+
2257+ /* Speed up */
2258+ if (set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100))
29532259 {
2954- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2260+ note = _("の動きが速くなった。", " starts moving faster.");
29552261 }
29562262
2957- /* Resist */
2958- do_conf = 0;
2263+ if (!who)
2264+ {
2265+ if (r_ptr->flags1 & RF1_UNIQUE)
2266+ chg_virtue(V_INDIVIDUALISM, 1);
2267+ if (is_friendly(m_ptr))
2268+ chg_virtue(V_HONOUR, 1);
2269+ }
29592270
2960- /* No obvious effect */
2961- note = _("には効果がなかった。", " is unaffected.");
2962- obvious = FALSE;
2271+ /* No "real" damage */
2272+ dam = 0;
2273+ break;
29632274 }
29642275
2965- /* No "real" damage */
2966- dam = 0;
2967- break;
2968- }
2969-
2970- case GF_STUN:
2971- {
2972- if (seen) obvious = TRUE;
29732276
2974- if (r_ptr->flagsr & RFR_RES_ALL)
2277+ /* Slow Monster (Use "dam" as "power") */
2278+ case GF_OLD_SLOW:
29752279 {
2976- note = _("には効果がなかった。", " is unaffected.");
2280+ if (seen) obvious = TRUE;
2281+
2282+ /* Powerful monsters can resist */
2283+ if ((r_ptr->flags1 & RF1_UNIQUE) ||
2284+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2285+ {
2286+ note = _("には効果がなかった。", " is unaffected.");
2287+ obvious = FALSE;
2288+ }
2289+
2290+ /* Normal monsters slow down */
2291+ else
2292+ {
2293+ if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2294+ {
2295+ note = _("の動きが遅くなった。", " starts moving slower.");
2296+ }
2297+ }
2298+
2299+ /* No "real" damage */
29772300 dam = 0;
2978- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
29792301 break;
29802302 }
2981- do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
29822303
2983- /* Attempt a saving throw */
2984- if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2985- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2304+
2305+ /* Sleep (Use "dam" as "power") */
2306+ case GF_OLD_SLEEP:
29862307 {
2987- /* Resist */
2988- do_stun = 0;
2308+ if (seen) obvious = TRUE;
29892309
2990- /* No obvious effect */
2991- note = _("には効果がなかった。", " is unaffected.");
2992- obvious = FALSE;
2310+ /* Attempt a saving throw */
2311+ if ((r_ptr->flags1 & RF1_UNIQUE) ||
2312+ (r_ptr->flags3 & RF3_NO_SLEEP) ||
2313+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2314+ {
2315+ /* Memorize a flag */
2316+ if (r_ptr->flags3 & RF3_NO_SLEEP)
2317+ {
2318+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
2319+ }
2320+ /* No obvious effect */
2321+ note = _("には効果がなかった。", " is unaffected.");
2322+ obvious = FALSE;
2323+ }
2324+ else
2325+ {
2326+ /* Go to sleep (much) later */
2327+ note = _("は眠り込んでしまった!", " falls asleep!");
2328+ do_sleep = 500;
2329+ }
2330+
2331+ /* No "real" damage */
2332+ dam = 0;
2333+ break;
29932334 }
29942335
2995- /* No "real" damage */
2996- dam = 0;
2997- break;
2998- }
2999-
30002336
2337+ /* Sleep (Use "dam" as "power") */
2338+ case GF_STASIS_EVIL:
2339+ {
2340+ if (seen) obvious = TRUE;
30012341
2342+ /* Attempt a saving throw */
2343+ if ((r_ptr->flags1 & RF1_UNIQUE) ||
2344+ !(r_ptr->flags3 & RF3_EVIL) ||
2345+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2346+ {
2347+ note = _("には効果がなかった。", " is unaffected.");
2348+ obvious = FALSE;
2349+ }
2350+ else
2351+ {
2352+ /* Go to sleep (much) later */
2353+ note = _("は動けなくなった!", " is suspended!");
2354+ do_sleep = 500;
2355+ }
30022356
3003- /* Lite, but only hurts susceptible creatures */
3004- case GF_LITE_WEAK:
3005- {
3006- if (!dam)
3007- {
3008- skipped = TRUE;
3009- break;
3010- }
3011- if (r_ptr->flagsr & RFR_RES_ALL)
3012- {
2357+ /* No "real" damage */
30132358 dam = 0;
30142359 break;
30152360 }
3016- /* Hurt by light */
3017- if (r_ptr->flags3 & (RF3_HURT_LITE))
2361+
2362+ /* Sleep (Use "dam" as "power") */
2363+ case GF_STASIS:
30182364 {
3019- /* Obvious effect */
30202365 if (seen) obvious = TRUE;
30212366
3022- /* Memorize the effects */
3023- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3024-
3025- /* Special effect */
3026- note = _("は光に身をすくめた!", " cringes from the light!");
3027- note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3028- }
2367+ /* Attempt a saving throw */
2368+ if ((r_ptr->flags1 & RF1_UNIQUE) ||
2369+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2370+ {
2371+ note = _("には効果がなかった。", " is unaffected.");
2372+ obvious = FALSE;
2373+ }
2374+ else
2375+ {
2376+ /* Go to sleep (much) later */
2377+ note = _("は動けなくなった!", " is suspended!");
2378+ do_sleep = 500;
2379+ }
30292380
3030- /* Normally no damage */
3031- else
3032- {
3033- /* No damage */
2381+ /* No "real" damage */
30342382 dam = 0;
2383+ break;
30352384 }
30362385
3037- break;
3038- }
2386+ /* Charm monster */
2387+ case GF_CHARM:
2388+ {
2389+ int vir;
2390+ vir = virtue_number(V_HARMONY);
2391+ if (vir)
2392+ {
2393+ dam += p_ptr->virtues[vir-1]/10;
2394+ }
30392395
2396+ vir = virtue_number(V_INDIVIDUALISM);
2397+ if (vir)
2398+ {
2399+ dam -= p_ptr->virtues[vir-1]/20;
2400+ }
30402401
2402+ if (seen) obvious = TRUE;
30412403
3042- /* Lite -- opposite of Dark */
3043- case GF_LITE:
3044- {
3045- if (seen) obvious = TRUE;
2404+ /* Attempt a saving throw */
2405+ if (common_saving_throw_charm(p_ptr, dam, m_ptr))
2406+ {
30462407
3047- if (r_ptr->flagsr & RFR_RES_ALL)
3048- {
3049- note = _("には完全な耐性がある!", " is immune.");
3050- dam = 0;
3051- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3052- break;
3053- }
3054- if (r_ptr->flagsr & RFR_RES_LITE)
3055- {
3056- note = _("には耐性がある!", " resists!");
3057- dam *= 2; dam /= (randint1(6)+6);
3058- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
3059- }
3060- else if (r_ptr->flags3 & (RF3_HURT_LITE))
3061- {
3062- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3063- note = _("は光に身をすくめた!", " cringes from the light!");
3064- note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3065- dam *= 2;
3066- }
3067- break;
3068- }
2408+ /* Resist */
2409+ /* No obvious effect */
2410+ note = _("には効果がなかった。", " is unaffected.");
2411+ obvious = FALSE;
30692412
2413+ if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2414+ }
2415+ else if (p_ptr->cursed & TRC_AGGRAVATE)
2416+ {
2417+ note = _("はあなたに敵意を抱いている!", " hates you too much!");
2418+ if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2419+ }
2420+ else
2421+ {
2422+ note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
2423+ set_pet(m_ptr);
30702424
3071- /* Dark -- opposite of Lite */
3072- case GF_DARK:
3073- {
3074- if (seen) obvious = TRUE;
2425+ chg_virtue(V_INDIVIDUALISM, -1);
2426+ if (r_ptr->flags3 & RF3_ANIMAL)
2427+ chg_virtue(V_NATURE, 1);
2428+ }
30752429
3076- if (r_ptr->flagsr & RFR_RES_ALL)
3077- {
3078- note = _("には完全な耐性がある!", " is immune.");
2430+ /* No "real" damage */
30792431 dam = 0;
3080- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
30812432 break;
30822433 }
3083- if (r_ptr->flagsr & RFR_RES_DARK)
2434+
2435+ /* Control undead */
2436+ case GF_CONTROL_UNDEAD:
30842437 {
3085- note = _("には耐性がある!", " resists!");
3086- dam *= 2; dam /= (randint1(6)+6);
3087- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
3088- }
3089- break;
3090- }
2438+ int vir;
2439+ if (seen) obvious = TRUE;
30912440
2441+ vir = virtue_number(V_UNLIFE);
2442+ if (vir)
2443+ {
2444+ dam += p_ptr->virtues[vir-1]/10;
2445+ }
30922446
3093- /* Stone to Mud */
3094- case GF_KILL_WALL:
3095- {
3096- if (r_ptr->flagsr & RFR_RES_ALL)
3097- {
2447+ vir = virtue_number(V_INDIVIDUALISM);
2448+ if (vir)
2449+ {
2450+ dam -= p_ptr->virtues[vir-1]/20;
2451+ }
2452+
2453+ /* Attempt a saving throw */
2454+ if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2455+ !(r_ptr->flags3 & RF3_UNDEAD))
2456+ {
2457+ /* No obvious effect */
2458+ note = _("には効果がなかった。", " is unaffected.");
2459+ obvious = FALSE;
2460+ if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2461+ }
2462+ else if (p_ptr->cursed & TRC_AGGRAVATE)
2463+ {
2464+ note = _("はあなたに敵意を抱いている!", " hates you too much!");
2465+ if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2466+ }
2467+ else
2468+ {
2469+ note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2470+ set_pet(m_ptr);
2471+ }
2472+
2473+ /* No "real" damage */
30982474 dam = 0;
30992475 break;
31002476 }
3101- /* Hurt by rock remover */
3102- if (r_ptr->flags3 & (RF3_HURT_ROCK))
2477+
2478+ /* Control demon */
2479+ case GF_CONTROL_DEMON:
31032480 {
3104- /* Notice effect */
2481+ int vir;
31052482 if (seen) obvious = TRUE;
31062483
3107- /* Memorize the effects */
3108- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2484+ vir = virtue_number(V_UNLIFE);
2485+ if (vir)
2486+ {
2487+ dam += p_ptr->virtues[vir-1]/10;
2488+ }
31092489
3110- /* Cute little message */
3111- note = _("の皮膚がただれた!", " loses some skin!");
3112- note_dies = _("はドロドロに溶けた!", " dissolves!");
3113- }
2490+ vir = virtue_number(V_INDIVIDUALISM);
2491+ if (vir)
2492+ {
2493+ dam -= p_ptr->virtues[vir-1]/20;
2494+ }
31142495
3115- /* Usually, ignore the effects */
3116- else
3117- {
3118- /* No damage */
2496+ /* Attempt a saving throw */
2497+ if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2498+ !(r_ptr->flags3 & RF3_DEMON))
2499+ {
2500+ /* No obvious effect */
2501+ note = _("には効果がなかった。", " is unaffected.");
2502+ obvious = FALSE;
2503+ if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2504+ }
2505+ else if (p_ptr->cursed & TRC_AGGRAVATE)
2506+ {
2507+ note = _("はあなたに敵意を抱いている!", " hates you too much!");
2508+ if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2509+ }
2510+ else
2511+ {
2512+ note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2513+ set_pet(m_ptr);
2514+ }
2515+
2516+ /* No "real" damage */
31192517 dam = 0;
2518+ break;
31202519 }
31212520
3122- break;
3123- }
3124-
3125-
3126- /* Teleport undead (Use "dam" as "power") */
3127- case GF_AWAY_UNDEAD:
3128- {
3129- /* Only affect undead */
3130- if (r_ptr->flags3 & (RF3_UNDEAD))
2521+ /* Tame animal */
2522+ case GF_CONTROL_ANIMAL:
31312523 {
3132- bool resists_tele = FALSE;
2524+ int vir;
2525+ if (seen) obvious = TRUE;
31332526
3134- if (r_ptr->flagsr & RFR_RES_TELE)
2527+ vir = virtue_number(V_NATURE);
2528+ if (vir)
31352529 {
3136- if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3137- {
3138- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3139- note = _("には効果がなかった。", " is unaffected.");
3140- resists_tele = TRUE;
3141- }
3142- else if (r_ptr->level > randint1(100))
3143- {
3144- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3145- note = _("には耐性がある!", " resists!");
3146- resists_tele = TRUE;
3147- }
2530+ dam += p_ptr->virtues[vir-1]/10;
31482531 }
31492532
3150- if (!resists_tele)
2533+ vir = virtue_number(V_INDIVIDUALISM);
2534+ if (vir)
31512535 {
3152- if (seen) obvious = TRUE;
3153- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3154- do_dist = dam;
2536+ dam -= p_ptr->virtues[vir-1]/20;
31552537 }
3156- }
3157-
3158- /* Others ignore */
3159- else
3160- {
3161- /* Irrelevant */
3162- skipped = TRUE;
3163- }
31642538
3165- /* No "real" damage */
3166- dam = 0;
3167- break;
3168- }
2539+ /* Attempt a saving throw */
2540+ if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2541+ !(r_ptr->flags3 & RF3_ANIMAL))
2542+ {
2543+ /* Resist */
2544+ /* No obvious effect */
2545+ note = _("には効果がなかった。", " is unaffected.");
2546+ obvious = FALSE;
2547+ if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2548+ }
2549+ else if (p_ptr->cursed & TRC_AGGRAVATE)
2550+ {
2551+ note = _("はあなたに敵意を抱いている!", " hates you too much!");
2552+ if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2553+ }
2554+ else
2555+ {
2556+ note = _("はなついた。", " is tamed!");
2557+ set_pet(m_ptr);
2558+ if (r_ptr->flags3 & RF3_ANIMAL)
2559+ chg_virtue(V_NATURE, 1);
2560+ }
31692561
2562+ /* No "real" damage */
2563+ dam = 0;
2564+ break;
2565+ }
31702566
3171- /* Teleport evil (Use "dam" as "power") */
3172- case GF_AWAY_EVIL:
3173- {
3174- /* Only affect evil */
3175- if (r_ptr->flags3 & (RF3_EVIL))
2567+ /* Tame animal */
2568+ case GF_CHARM_LIVING:
31762569 {
3177- bool resists_tele = FALSE;
2570+ int vir;
31782571
3179- if (r_ptr->flagsr & RFR_RES_TELE)
2572+ vir = virtue_number(V_UNLIFE);
2573+ if (seen) obvious = TRUE;
2574+
2575+ vir = virtue_number(V_UNLIFE);
2576+ if (vir)
31802577 {
3181- if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3182- {
3183- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3184- note = _("には効果がなかった。", " is unaffected.");
3185- resists_tele = TRUE;
3186- }
3187- else if (r_ptr->level > randint1(100))
3188- {
3189- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3190- note = _("には耐性がある!", " resists!");
3191- resists_tele = TRUE;
3192- }
2578+ dam -= p_ptr->virtues[vir-1]/10;
31932579 }
31942580
3195- if (!resists_tele)
2581+ vir = virtue_number(V_INDIVIDUALISM);
2582+ if (vir)
31962583 {
3197- if (seen) obvious = TRUE;
3198- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3199- do_dist = dam;
2584+ dam -= p_ptr->virtues[vir-1]/20;
32002585 }
3201- }
3202-
3203- /* Others ignore */
3204- else
3205- {
3206- /* Irrelevant */
3207- skipped = TRUE;
3208- }
3209-
3210- /* No "real" damage */
3211- dam = 0;
3212- break;
3213- }
32142586
2587+ msg_format(_("%sを見つめた。", "You stare into %s."), m_name);
32152588
3216- /* Teleport monster (Use "dam" as "power") */
3217- case GF_AWAY_ALL:
3218- {
3219- bool resists_tele = FALSE;
3220- if (r_ptr->flagsr & RFR_RES_TELE)
3221- {
3222- if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2589+ /* Attempt a saving throw */
2590+ if (common_saving_throw_charm(p_ptr, dam, m_ptr) ||
2591+ !monster_living(m_ptr->r_idx))
32232592 {
3224- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2593+ /* Resist */
2594+ /* No obvious effect */
32252595 note = _("には効果がなかった。", " is unaffected.");
3226- resists_tele = TRUE;
2596+ obvious = FALSE;
2597+ if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
32272598 }
3228- else if (r_ptr->level > randint1(100))
2599+ else if (p_ptr->cursed & TRC_AGGRAVATE)
32292600 {
3230- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3231- note = _("には耐性がある!", " resists!");
3232- resists_tele = TRUE;
2601+ note = _("はあなたに敵意を抱いている!", " hates you too much!");
2602+ if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
32332603 }
2604+ else
2605+ {
2606+ note = _("を支配した。", " is tamed!");
2607+ set_pet(m_ptr);
2608+ if (r_ptr->flags3 & RF3_ANIMAL)
2609+ chg_virtue(V_NATURE, 1);
2610+ }
2611+
2612+ /* No "real" damage */
2613+ dam = 0;
2614+ break;
32342615 }
32352616
3236- if (!resists_tele)
2617+ /* Confusion (Use "dam" as "power") */
2618+ case GF_OLD_CONF:
32372619 {
32382620 if (seen) obvious = TRUE;
32392621
3240- /* Prepare to teleport */
3241- do_dist = dam;
3242- }
2622+ /* Get confused later */
2623+ do_conf = damroll(3, (dam / 2)) + 1;
32432624
3244- /* No "real" damage */
3245- dam = 0;
3246- break;
3247- }
2625+ /* Attempt a saving throw */
2626+ if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2627+ (r_ptr->flags3 & (RF3_NO_CONF)) ||
2628+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2629+ {
2630+ /* Memorize a flag */
2631+ if (r_ptr->flags3 & (RF3_NO_CONF))
2632+ {
2633+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2634+ }
2635+
2636+ /* Resist */
2637+ do_conf = 0;
32482638
2639+ /* No obvious effect */
2640+ note = _("には効果がなかった。", " is unaffected.");
2641+ obvious = FALSE;
2642+ }
32492643
3250- /* Turn undead (Use "dam" as "power") */
3251- case GF_TURN_UNDEAD:
3252- {
3253- if (r_ptr->flagsr & RFR_RES_ALL)
3254- {
3255- skipped = TRUE;
2644+ /* No "real" damage */
2645+ dam = 0;
32562646 break;
32572647 }
3258- /* Only affect undead */
3259- if (r_ptr->flags3 & (RF3_UNDEAD))
2648+
2649+ case GF_STUN:
32602650 {
32612651 if (seen) obvious = TRUE;
32622652
3263- /* Learn about type */
3264- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3265-
3266- /* Apply some fear */
3267- do_fear = damroll(3, (dam / 2)) + 1;
2653+ do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
32682654
32692655 /* Attempt a saving throw */
3270- if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
2656+ if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2657+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
32712658 {
2659+ /* Resist */
2660+ do_stun = 0;
2661+
32722662 /* No obvious effect */
32732663 note = _("には効果がなかった。", " is unaffected.");
32742664 obvious = FALSE;
3275- do_fear = 0;
32762665 }
2666+
2667+ /* No "real" damage */
2668+ dam = 0;
2669+ break;
32772670 }
32782671
3279- /* Others ignore */
3280- else
2672+ /* Lite, but only hurts susceptible creatures */
2673+ case GF_LITE_WEAK:
32812674 {
3282- /* Irrelevant */
3283- skipped = TRUE;
3284- }
2675+ if (!dam)
2676+ {
2677+ skipped = TRUE;
2678+ break;
2679+ }
2680+ /* Hurt by light */
2681+ if (r_ptr->flags3 & (RF3_HURT_LITE))
2682+ {
2683+ /* Obvious effect */
2684+ if (seen) obvious = TRUE;
32852685
3286- /* No "real" damage */
3287- dam = 0;
3288- break;
3289- }
2686+ /* Memorize the effects */
2687+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
2688+
2689+ /* Special effect */
2690+ note = _("は光に身をすくめた!", " cringes from the light!");
2691+ note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
2692+ }
32902693
2694+ /* Normally no damage */
2695+ else
2696+ {
2697+ /* No damage */
2698+ dam = 0;
2699+ }
32912700
3292- /* Turn evil (Use "dam" as "power") */
3293- case GF_TURN_EVIL:
3294- {
3295- if (r_ptr->flagsr & RFR_RES_ALL)
3296- {
3297- skipped = TRUE;
32982701 break;
32992702 }
3300- /* Only affect evil */
3301- if (r_ptr->flags3 & (RF3_EVIL))
2703+
2704+
2705+
2706+ /* Lite -- opposite of Dark */
2707+ case GF_LITE:
33022708 {
33032709 if (seen) obvious = TRUE;
33042710
3305- /* Learn about type */
3306- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2711+ if (r_ptr->flagsr & RFR_RES_LITE)
2712+ {
2713+ note = _("には耐性がある!", " resists!");
2714+ dam *= 2; dam /= (randint1(6)+6);
2715+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
2716+ }
2717+ else if (r_ptr->flags3 & (RF3_HURT_LITE))
2718+ {
2719+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
2720+ note = _("は光に身をすくめた!", " cringes from the light!");
2721+ note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
2722+ dam *= 2;
2723+ }
2724+ break;
2725+ }
2726+
33072727
3308- /* Apply some fear */
3309- do_fear = damroll(3, (dam / 2)) + 1;
2728+ /* Dark -- opposite of Lite */
2729+ case GF_DARK:
2730+ {
2731+ if (seen) obvious = TRUE;
33102732
3311- /* Attempt a saving throw */
3312- if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
2733+ if (r_ptr->flagsr & RFR_RES_DARK)
33132734 {
3314- /* No obvious effect */
3315- note = _("には効果がなかった。", " is unaffected.");
3316- obvious = FALSE;
3317- do_fear = 0;
2735+ note = _("には耐性がある!", " resists!");
2736+ dam *= 2; dam /= (randint1(6)+6);
2737+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
33182738 }
2739+ break;
33192740 }
33202741
3321- /* Others ignore */
3322- else
2742+
2743+ /* Stone to Mud */
2744+ case GF_KILL_WALL:
33232745 {
3324- /* Irrelevant */
3325- skipped = TRUE;
3326- }
2746+ /* Hurt by rock remover */
2747+ if (r_ptr->flags3 & (RF3_HURT_ROCK))
2748+ {
2749+ /* Notice effect */
2750+ if (seen) obvious = TRUE;
33272751
3328- /* No "real" damage */
3329- dam = 0;
3330- break;
3331- }
2752+ /* Memorize the effects */
2753+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
33322754
2755+ /* Cute little message */
2756+ note = _("の皮膚がただれた!", " loses some skin!");
2757+ note_dies = _("はドロドロに溶けた!", " dissolves!");
2758+ }
2759+
2760+ /* Usually, ignore the effects */
2761+ else
2762+ {
2763+ /* No damage */
2764+ dam = 0;
2765+ }
33332766
3334- /* Turn monster (Use "dam" as "power") */
3335- case GF_TURN_ALL:
3336- {
3337- if (r_ptr->flagsr & RFR_RES_ALL)
3338- {
3339- skipped = TRUE;
33402767 break;
33412768 }
3342- if (seen) obvious = TRUE;
33432769
3344- /* Apply some fear */
3345- do_fear = damroll(3, (dam / 2)) + 1;
33462770
3347- /* Attempt a saving throw */
3348- if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3349- (r_ptr->flags3 & (RF3_NO_FEAR)) ||
3350- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2771+ /* Teleport undead (Use "dam" as "power") */
2772+ case GF_AWAY_UNDEAD:
33512773 {
3352- /* No obvious effect */
3353- note = _("には効果がなかった。", " is unaffected.");
3354- obvious = FALSE;
3355- do_fear = 0;
3356- }
2774+ /* Only affect undead */
2775+ if (r_ptr->flags3 & (RF3_UNDEAD))
2776+ {
2777+ bool resists_tele = FALSE;
33572778
3358- /* No "real" damage */
3359- dam = 0;
3360- break;
3361- }
2779+ if (r_ptr->flagsr & RFR_RES_TELE)
2780+ {
2781+ if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2782+ {
2783+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2784+ note = _("には効果がなかった。", " is unaffected.");
2785+ resists_tele = TRUE;
2786+ }
2787+ else if (r_ptr->level > randint1(100))
2788+ {
2789+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2790+ note = _("には耐性がある!", " resists!");
2791+ resists_tele = TRUE;
2792+ }
2793+ }
2794+
2795+ if (!resists_tele)
2796+ {
2797+ if (seen) obvious = TRUE;
2798+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2799+ do_dist = dam;
2800+ }
2801+ }
33622802
2803+ /* Others ignore */
2804+ else
2805+ {
2806+ /* Irrelevant */
2807+ skipped = TRUE;
2808+ }
33632809
3364- /* Dispel undead */
3365- case GF_DISP_UNDEAD:
3366- {
3367- if (r_ptr->flagsr & RFR_RES_ALL)
3368- {
3369- skipped = TRUE;
2810+ /* No "real" damage */
33702811 dam = 0;
33712812 break;
33722813 }
3373- /* Only affect undead */
3374- if (r_ptr->flags3 & (RF3_UNDEAD))
3375- {
3376- if (seen) obvious = TRUE;
33772814
3378- /* Learn about type */
3379- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3380-
3381- note = _("は身震いした。", " shudders.");
3382- note_dies = _("はドロドロに溶けた!", " dissolves!");
3383- }
33842815
3385- /* Others ignore */
3386- else
2816+ /* Teleport evil (Use "dam" as "power") */
2817+ case GF_AWAY_EVIL:
33872818 {
3388- /* Irrelevant */
3389- skipped = TRUE;
2819+ /* Only affect evil */
2820+ if (r_ptr->flags3 & (RF3_EVIL))
2821+ {
2822+ bool resists_tele = FALSE;
33902823
3391- /* No damage */
3392- dam = 0;
3393- }
2824+ if (r_ptr->flagsr & RFR_RES_TELE)
2825+ {
2826+ if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2827+ {
2828+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2829+ note = _("には効果がなかった。", " is unaffected.");
2830+ resists_tele = TRUE;
2831+ }
2832+ else if (r_ptr->level > randint1(100))
2833+ {
2834+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2835+ note = _("には耐性がある!", " resists!");
2836+ resists_tele = TRUE;
2837+ }
2838+ }
33942839
3395- break;
3396- }
2840+ if (!resists_tele)
2841+ {
2842+ if (seen) obvious = TRUE;
2843+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2844+ do_dist = dam;
2845+ }
2846+ }
33972847
2848+ /* Others ignore */
2849+ else
2850+ {
2851+ /* Irrelevant */
2852+ skipped = TRUE;
2853+ }
33982854
3399- /* Dispel evil */
3400- case GF_DISP_EVIL:
3401- {
3402- if (r_ptr->flagsr & RFR_RES_ALL)
3403- {
3404- skipped = TRUE;
2855+ /* No "real" damage */
34052856 dam = 0;
34062857 break;
34072858 }
3408- /* Only affect evil */
3409- if (r_ptr->flags3 & (RF3_EVIL))
3410- {
3411- if (seen) obvious = TRUE;
34122859
3413- /* Learn about type */
3414- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
34152860
3416- note = _("は身震いした。", " shudders.");
3417- note_dies = _("はドロドロに溶けた!", " dissolves!");
3418- }
3419-
3420- /* Others ignore */
3421- else
2861+ /* Teleport monster (Use "dam" as "power") */
2862+ case GF_AWAY_ALL:
34222863 {
3423- /* Irrelevant */
3424- skipped = TRUE;
2864+ bool resists_tele = FALSE;
2865+ if (r_ptr->flagsr & RFR_RES_TELE)
2866+ {
2867+ if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2868+ {
2869+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2870+ note = _("には効果がなかった。", " is unaffected.");
2871+ resists_tele = TRUE;
2872+ }
2873+ else if (r_ptr->level > randint1(100))
2874+ {
2875+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2876+ note = _("には耐性がある!", " resists!");
2877+ resists_tele = TRUE;
2878+ }
2879+ }
34252880
3426- /* No damage */
3427- dam = 0;
3428- }
2881+ if (!resists_tele)
2882+ {
2883+ if (seen) obvious = TRUE;
34292884
3430- break;
3431- }
2885+ /* Prepare to teleport */
2886+ do_dist = dam;
2887+ }
34322888
3433- /* Dispel good */
3434- case GF_DISP_GOOD:
3435- {
3436- if (r_ptr->flagsr & RFR_RES_ALL)
3437- {
3438- skipped = TRUE;
2889+ /* No "real" damage */
34392890 dam = 0;
34402891 break;
34412892 }
3442- /* Only affect good */
3443- if (r_ptr->flags3 & (RF3_GOOD))
3444- {
3445- if (seen) obvious = TRUE;
34462893
3447- /* Learn about type */
3448- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
3449-
3450- note = _("は身震いした。", " shudders.");
3451- note_dies = _("はドロドロに溶けた!", " dissolves!");
3452- }
34532894
3454- /* Others ignore */
3455- else
2895+ /* Turn undead (Use "dam" as "power") */
2896+ case GF_TURN_UNDEAD:
34562897 {
3457- /* Irrelevant */
3458- skipped = TRUE;
2898+ /* Only affect undead */
2899+ if (r_ptr->flags3 & (RF3_UNDEAD))
2900+ {
2901+ if (seen) obvious = TRUE;
34592902
3460- /* No damage */
3461- dam = 0;
3462- }
2903+ /* Learn about type */
2904+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
34632905
3464- break;
3465- }
2906+ /* Apply some fear */
2907+ do_fear = damroll(3, (dam / 2)) + 1;
34662908
3467- /* Dispel living */
3468- case GF_DISP_LIVING:
3469- {
3470- if (r_ptr->flagsr & RFR_RES_ALL)
3471- {
3472- skipped = TRUE;
2909+ /* Attempt a saving throw */
2910+ if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
2911+ {
2912+ /* No obvious effect */
2913+ note = _("には効果がなかった。", " is unaffected.");
2914+ obvious = FALSE;
2915+ do_fear = 0;
2916+ }
2917+ }
2918+
2919+ /* Others ignore */
2920+ else
2921+ {
2922+ /* Irrelevant */
2923+ skipped = TRUE;
2924+ }
2925+
2926+ /* No "real" damage */
34732927 dam = 0;
34742928 break;
34752929 }
3476- /* Only affect non-undead */
3477- if (monster_living(m_ptr->r_idx))
3478- {
3479- if (seen) obvious = TRUE;
34802930
3481- note = _("は身震いした。", " shudders.");
3482- note_dies = _("はドロドロに溶けた!", " dissolves!");
3483- }
34842931
3485- /* Others ignore */
3486- else
2932+ /* Turn evil (Use "dam" as "power") */
2933+ case GF_TURN_EVIL:
34872934 {
3488- /* Irrelevant */
3489- skipped = TRUE;
2935+ /* Only affect evil */
2936+ if (r_ptr->flags3 & (RF3_EVIL))
2937+ {
2938+ if (seen) obvious = TRUE;
34902939
3491- /* No damage */
3492- dam = 0;
3493- }
2940+ /* Learn about type */
2941+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
34942942
3495- break;
3496- }
2943+ /* Apply some fear */
2944+ do_fear = damroll(3, (dam / 2)) + 1;
34972945
3498- /* Dispel demons */
3499- case GF_DISP_DEMON:
3500- {
3501- if (r_ptr->flagsr & RFR_RES_ALL)
3502- {
3503- skipped = TRUE;
2946+ /* Attempt a saving throw */
2947+ if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
2948+ {
2949+ /* No obvious effect */
2950+ note = _("には効果がなかった。", " is unaffected.");
2951+ obvious = FALSE;
2952+ do_fear = 0;
2953+ }
2954+ }
2955+
2956+ /* Others ignore */
2957+ else
2958+ {
2959+ /* Irrelevant */
2960+ skipped = TRUE;
2961+ }
2962+
2963+ /* No "real" damage */
35042964 dam = 0;
35052965 break;
35062966 }
3507- /* Only affect demons */
3508- if (r_ptr->flags3 & (RF3_DEMON))
3509- {
3510- if (seen) obvious = TRUE;
3511-
3512- /* Learn about type */
3513- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
35142967
3515- note = _("は身震いした。", " shudders.");
3516- note_dies = _("はドロドロに溶けた!", " dissolves!");
3517- }
35182968
3519- /* Others ignore */
3520- else
2969+ /* Turn monster (Use "dam" as "power") */
2970+ case GF_TURN_ALL:
35212971 {
3522- /* Irrelevant */
3523- skipped = TRUE;
2972+ if (seen) obvious = TRUE;
35242973
3525- /* No damage */
3526- dam = 0;
3527- }
2974+ /* Apply some fear */
2975+ do_fear = damroll(3, (dam / 2)) + 1;
35282976
3529- break;
3530- }
2977+ /* Attempt a saving throw */
2978+ if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2979+ (r_ptr->flags3 & (RF3_NO_FEAR)) ||
2980+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2981+ {
2982+ /* No obvious effect */
2983+ note = _("には効果がなかった。", " is unaffected.");
2984+ obvious = FALSE;
2985+ do_fear = 0;
2986+ }
35312987
3532- /* Dispel monster */
3533- case GF_DISP_ALL:
3534- {
3535- if (r_ptr->flagsr & RFR_RES_ALL)
3536- {
3537- skipped = TRUE;
2988+ /* No "real" damage */
35382989 dam = 0;
35392990 break;
35402991 }
3541- if (seen) obvious = TRUE;
3542-
3543- note = _("は身震いした。", " shudders.");
3544- note_dies = _("はドロドロに溶けた!", " dissolves!");
3545- break;
3546- }
35472992
3548- /* Drain mana */
3549- case GF_DRAIN_MANA:
3550- {
3551- if (seen) obvious = TRUE;
35522993
3553- if (r_ptr->flagsr & RFR_RES_ALL)
2994+ /* Dispel undead */
2995+ case GF_DISP_UNDEAD:
35542996 {
3555- note = _("には完全な耐性がある!", " is immune.");
3556- skipped = TRUE;
3557- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2997+ /* Only affect undead */
2998+ if (r_ptr->flags3 & (RF3_UNDEAD))
2999+ {
3000+ if (seen) obvious = TRUE;
3001+
3002+ /* Learn about type */
3003+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3004+
3005+ note = _("は身震いした。", " shudders.");
3006+ note_dies = _("はドロドロに溶けた!", " dissolves!");
3007+ }
3008+
3009+ /* Others ignore */
3010+ else
3011+ {
3012+ /* Irrelevant */
3013+ skipped = TRUE;
3014+
3015+ /* No damage */
3016+ dam = 0;
3017+ }
3018+
35583019 break;
35593020 }
35603021
3561- if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->a_ability_flags1 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->a_ability_flags2 & ~(RF6_NOMAGIC_MASK)))
3022+
3023+ /* Dispel evil */
3024+ case GF_DISP_EVIL:
35623025 {
3563- if (who > 0)
3026+ /* Only affect evil */
3027+ if (r_ptr->flags3 & (RF3_EVIL))
35643028 {
3565- /* Heal the monster */
3566- if (caster_ptr->hp < caster_ptr->maxhp)
3567- {
3568- /* Heal */
3569- caster_ptr->hp += dam;
3570- if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
3029+ if (seen) obvious = TRUE;
35713030
3572- /* Redraw (later) if needed */
3573- if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
3574- if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
3031+ /* Learn about type */
3032+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
35753033
3576- /* Special message */
3577- if (see_s_msg)
3578- {
3579- monster_desc(killer, caster_ptr, 0);
3580- msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), killer);
3581- }
3582- }
3034+ note = _("は身震いした。", " shudders.");
3035+ note_dies = _("はドロドロに溶けた!", " dissolves!");
35833036 }
3037+
3038+ /* Others ignore */
35843039 else
35853040 {
3586- msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), m_name);
3587- (void)hp_player(dam);
3588- }
3589- }
3590- else
3591- {
3592- if (see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3593- }
3594- dam = 0;
3595- break;
3596- }
3041+ /* Irrelevant */
3042+ skipped = TRUE;
35973043
3598- /* Mind blast */
3599- case GF_MIND_BLAST:
3600- {
3601- if (seen) obvious = TRUE;
3602- if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3044+ /* No damage */
3045+ dam = 0;
3046+ }
36033047
3604- if (r_ptr->flagsr & RFR_RES_ALL)
3605- {
3606- note = _("には完全な耐性がある!", " is immune.");
3607- skipped = TRUE;
3608- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
36093048 break;
36103049 }
36113050
3612- /* Attempt a saving throw */
3613- if ((r_ptr->flags1 & RF1_UNIQUE) ||
3614- (r_ptr->flags3 & RF3_NO_CONF) ||
3615- (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3051+ /* Dispel good */
3052+ case GF_DISP_GOOD:
36163053 {
3617- /* Memorize a flag */
3618- if (r_ptr->flags3 & (RF3_NO_CONF))
3054+ /* Only affect good */
3055+ if (r_ptr->flags3 & (RF3_GOOD))
36193056 {
3620- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3057+ if (seen) obvious = TRUE;
3058+
3059+ /* Learn about type */
3060+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
3061+
3062+ note = _("は身震いした。", " shudders.");
3063+ note_dies = _("はドロドロに溶けた!", " dissolves!");
36213064 }
3622- note = _("には効果がなかった。", " is unaffected.");
3623- dam = 0;
3624- }
3625- else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3626- {
3627- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3628- note = _("には完全な耐性がある!", " is immune.");
3629- dam = 0;
3630- }
3631- else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3632- {
3633- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3634- note = _("には耐性がある。", " resists.");
3635- dam /= 3;
3636- }
3637- else
3638- {
3639- note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3640- note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
36413065
3642- if (who > 0) do_conf = randint0(4) + 4;
3643- else do_conf = randint0(8) + 8;
3644- }
3645- break;
3646- }
3066+ /* Others ignore */
3067+ else
3068+ {
3069+ /* Irrelevant */
3070+ skipped = TRUE;
36473071
3648- /* Brain smash */
3649- case GF_BRAIN_SMASH:
3650- {
3651- if (seen) obvious = TRUE;
3652- if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3072+ /* No damage */
3073+ dam = 0;
3074+ }
36533075
3654- if (r_ptr->flagsr & RFR_RES_ALL)
3655- {
3656- note = _("には完全な耐性がある!", " is immune.");
3657- skipped = TRUE;
3658- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
36593076 break;
36603077 }
36613078
3662- /* Attempt a saving throw */
3663- if ((r_ptr->flags1 & RF1_UNIQUE) ||
3664- (r_ptr->flags3 & RF3_NO_CONF) ||
3665- (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3079+ /* Dispel living */
3080+ case GF_DISP_LIVING:
36663081 {
3667- /* Memorize a flag */
3668- if (r_ptr->flags3 & (RF3_NO_CONF))
3082+ /* Only affect non-undead */
3083+ if (monster_living(m_ptr->r_idx))
36693084 {
3670- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3671- }
3672- note = _("には効果がなかった。", " is unaffected.");
3673- dam = 0;
3674- }
3675- else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3676- {
3677- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3678- note = _("には完全な耐性がある!", " is immune.");
3679- dam = 0;
3680- }
3681- else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3682- {
3683- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3684- note = _("には耐性がある!", " resists!");
3685- dam /= 3;
3686- }
3687- else
3688- {
3689- note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3690- note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3085+ if (seen) obvious = TRUE;
36913086
3692- if (who > 0)
3693- {
3694- do_conf = randint0(4) + 4;
3695- do_stun = randint0(4) + 4;
3087+ note = _("は身震いした。", " shudders.");
3088+ note_dies = _("はドロドロに溶けた!", " dissolves!");
36963089 }
3090+
3091+ /* Others ignore */
36973092 else
36983093 {
3699- do_conf = randint0(8) + 8;
3700- do_stun = randint0(8) + 8;
3701- }
3702- (void)set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 10);
3703- }
3704- break;
3705- }
3094+ /* Irrelevant */
3095+ skipped = TRUE;
37063096
3707- /* CAUSE_1 */
3708- case GF_CAUSE_1:
3709- {
3710- if (seen) obvious = TRUE;
3711- if (!who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), m_name);
3097+ /* No damage */
3098+ dam = 0;
3099+ }
37123100
3713- if (r_ptr->flagsr & RFR_RES_ALL)
3714- {
3715- note = _("には完全な耐性がある!", " is immune.");
3716- skipped = TRUE;
3717- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
37183101 break;
37193102 }
37203103
3721- /* Attempt a saving throw */
3722- if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3104+ /* Dispel demons */
3105+ case GF_DISP_DEMON:
37233106 {
3724- note = _("には効果がなかった。", " is unaffected.");
3725- dam = 0;
3726- }
3727- break;
3728- }
3107+ /* Only affect demons */
3108+ if (r_ptr->flags3 & (RF3_DEMON))
3109+ {
3110+ if (seen) obvious = TRUE;
37293111
3730- /* CAUSE_2 */
3731- case GF_CAUSE_2:
3732- {
3733- if (seen) obvious = TRUE;
3734- if (!who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), m_name);
3112+ /* Learn about type */
3113+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
37353114
3736- if (r_ptr->flagsr & RFR_RES_ALL)
3737- {
3738- note = _("には完全な耐性がある!", " is immune.");
3739- skipped = TRUE;
3740- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3741- break;
3742- }
3115+ note = _("は身震いした。", " shudders.");
3116+ note_dies = _("はドロドロに溶けた!", " dissolves!");
3117+ }
37433118
3744- /* Attempt a saving throw */
3745- if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3746- {
3747- note = _("には効果がなかった。", " is unaffected.");
3748- dam = 0;
3749- }
3750- break;
3751- }
3119+ /* Others ignore */
3120+ else
3121+ {
3122+ /* Irrelevant */
3123+ skipped = TRUE;
37523124
3753- /* CAUSE_3 */
3754- case GF_CAUSE_3:
3755- {
3756- if (seen) obvious = TRUE;
3757- if (!who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), m_name);
3125+ /* No damage */
3126+ dam = 0;
3127+ }
3128+
3129+ break;
3130+ }
37583131
3759- if (r_ptr->flagsr & RFR_RES_ALL)
3132+ /* Dispel monster */
3133+ case GF_DISP_ALL:
37603134 {
3761- note = _("には完全な耐性がある!", " is immune.");
3762- skipped = TRUE;
3763- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3135+ if (seen) obvious = TRUE;
3136+ note = _("は身震いした。", " shudders.");
3137+ note_dies = _("はドロドロに溶けた!", " dissolves!");
37643138 break;
37653139 }
37663140
3767- /* Attempt a saving throw */
3768- if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3141+ /* Drain mana */
3142+ case GF_DRAIN_MANA:
37693143 {
3770- note = _("には効果がなかった。", " is unaffected.");
3144+ if (seen) obvious = TRUE;
3145+ if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->a_ability_flags1 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->a_ability_flags2 & ~(RF6_NOMAGIC_MASK)))
3146+ {
3147+ if (who > 0)
3148+ {
3149+ /* Heal the monster */
3150+ if (caster_ptr->hp < caster_ptr->maxhp)
3151+ {
3152+ /* Heal */
3153+ caster_ptr->hp += dam;
3154+ if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
3155+
3156+ /* Redraw (later) if needed */
3157+ if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
3158+ if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
3159+
3160+ /* Special message */
3161+ if (see_s_msg)
3162+ {
3163+ monster_desc(killer, caster_ptr, 0);
3164+ msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), killer);
3165+ }
3166+ }
3167+ }
3168+ else
3169+ {
3170+ msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), m_name);
3171+ (void)hp_player(dam);
3172+ }
3173+ }
3174+ else
3175+ {
3176+ if (see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3177+ }
37713178 dam = 0;
3179+ break;
37723180 }
3773- break;
3774- }
3775-
3776- /* CAUSE_4 */
3777- case GF_CAUSE_4:
3778- {
3779- if (seen) obvious = TRUE;
3780- if (!who)
3781- msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
3782- "You point at %s, screaming the word, 'DIE!'."), m_name);
37833181
3784- if (r_ptr->flagsr & RFR_RES_ALL)
3182+ /* Mind blast */
3183+ case GF_MIND_BLAST:
37853184 {
3786- note = _("には完全な耐性がある!", " is immune.");
3787- skipped = TRUE;
3788- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3185+ if (seen) obvious = TRUE;
3186+ if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3187+ /* Attempt a saving throw */
3188+ if ((r_ptr->flags1 & RF1_UNIQUE) ||
3189+ (r_ptr->flags3 & RF3_NO_CONF) ||
3190+ (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3191+ {
3192+ /* Memorize a flag */
3193+ if (r_ptr->flags3 & (RF3_NO_CONF))
3194+ {
3195+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3196+ }
3197+ note = _("には効果がなかった。", " is unaffected.");
3198+ dam = 0;
3199+ }
3200+ else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3201+ {
3202+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3203+ note = _("には完全な耐性がある!", " is immune.");
3204+ dam = 0;
3205+ }
3206+ else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3207+ {
3208+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3209+ note = _("には耐性がある。", " resists.");
3210+ dam /= 3;
3211+ }
3212+ else
3213+ {
3214+ note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3215+ note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3216+
3217+ if (who > 0) do_conf = randint0(4) + 4;
3218+ else do_conf = randint0(8) + 8;
3219+ }
37893220 break;
37903221 }
37913222
3792- /* Attempt a saving throw */
3793- if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
3223+ /* Brain smash */
3224+ case GF_BRAIN_SMASH:
37943225 {
3795- note = _("には効果がなかった。", " is unaffected.");
3796- dam = 0;
3797- }
3798- break;
3799- }
3226+ if (seen) obvious = TRUE;
3227+ if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
38003228
3801- /* HAND_DOOM */
3802- case GF_HAND_DOOM:
3803- {
3804- if (seen) obvious = TRUE;
3229+ /* Attempt a saving throw */
3230+ if ((r_ptr->flags1 & RF1_UNIQUE) ||
3231+ (r_ptr->flags3 & RF3_NO_CONF) ||
3232+ (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3233+ {
3234+ /* Memorize a flag */
3235+ if (r_ptr->flags3 & (RF3_NO_CONF))
3236+ {
3237+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3238+ }
3239+ note = _("には効果がなかった。", " is unaffected.");
3240+ dam = 0;
3241+ }
3242+ else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3243+ {
3244+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3245+ note = _("には完全な耐性がある!", " is immune.");
3246+ dam = 0;
3247+ }
3248+ else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3249+ {
3250+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3251+ note = _("には耐性がある!", " resists!");
3252+ dam /= 3;
3253+ }
3254+ else
3255+ {
3256+ note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3257+ note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
38053258
3806- if (r_ptr->flagsr & RFR_RES_ALL)
3807- {
3808- note = _("には完全な耐性がある!", " is immune.");
3809- skipped = TRUE;
3810- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3259+ if (who > 0)
3260+ {
3261+ do_conf = randint0(4) + 4;
3262+ do_stun = randint0(4) + 4;
3263+ }
3264+ else
3265+ {
3266+ do_conf = randint0(8) + 8;
3267+ do_stun = randint0(8) + 8;
3268+ }
3269+ (void)set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 10);
3270+ }
38113271 break;
38123272 }
38133273
3814- if (r_ptr->flags1 & RF1_UNIQUE)
3815- {
3816- note = _("には効果がなかった。", " is unaffected.");
3817- dam = 0;
3818- }
3819- else
3274+ /* CAUSE_1 */
3275+ case GF_CAUSE_1:
38203276 {
3821- if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
3822- (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
3277+ if (seen) obvious = TRUE;
3278+ if (!who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), m_name);
3279+ /* Attempt a saving throw */
3280+ if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
38233281 {
3824- dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
3825-
3826- if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
3282+ note = _("には効果がなかった。", " is unaffected.");
3283+ dam = 0;
38273284 }
3828- else
3285+ break;
3286+ }
3287+
3288+ /* CAUSE_2 */
3289+ case GF_CAUSE_2:
3290+ {
3291+ if (seen) obvious = TRUE;
3292+ if (!who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), m_name);
3293+ /* Attempt a saving throw */
3294+ if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
38293295 {
3830- note = _("は耐性を持っている!", "resists!");
3296+ note = _("には効果がなかった。", " is unaffected.");
38313297 dam = 0;
38323298 }
3299+ break;
38333300 }
3834- break;
3835- }
38363301
3837- /* Capture monster */
3838- case GF_CAPTURE:
3839- {
3840- int nokori_hp;
3841- if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
3842- (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_NAZGUL)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR) || m_ptr->parent_m_idx)
3302+ /* CAUSE_3 */
3303+ case GF_CAUSE_3:
38433304 {
3844- msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3845- skipped = TRUE;
3305+ if (seen) obvious = TRUE;
3306+ if (!who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), m_name);
3307+ /* Attempt a saving throw */
3308+ if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3309+ {
3310+ note = _("には効果がなかった。", " is unaffected.");
3311+ dam = 0;
3312+ }
38463313 break;
38473314 }
38483315
3849- if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
3850- else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(m_ptr->r_idx))
3851- nokori_hp = m_ptr->maxhp * 3 / 10;
3852- else
3853- nokori_hp = m_ptr->maxhp * 3 / 20;
3854-
3855- if (m_ptr->hp >= nokori_hp)
3316+ /* CAUSE_4 */
3317+ case GF_CAUSE_4:
38563318 {
3857- msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), m_name);
3858- skipped = TRUE;
3319+ if (seen) obvious = TRUE;
3320+ if (!who)
3321+ msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
3322+ "You point at %s, screaming the word, 'DIE!'."), m_name);
3323+ /* Attempt a saving throw */
3324+ if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
3325+ {
3326+ note = _("には効果がなかった。", " is unaffected.");
3327+ dam = 0;
3328+ }
3329+ break;
38593330 }
3860- else if (m_ptr->hp < randint0(nokori_hp))
3331+
3332+ /* HAND_DOOM */
3333+ case GF_HAND_DOOM:
38613334 {
3862- if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(g_ptr->m_idx, FALSE, MON_CHAMELEON);
3863- msg_format(_("%sを捕えた!", "You capture %^s!"), m_name);
3864- cap_mon = m_ptr->r_idx;
3865- cap_mspeed = m_ptr->mspeed;
3866- cap_hp = m_ptr->hp;
3867- cap_maxhp = m_ptr->max_maxhp;
3868- cap_nickname = m_ptr->nickname; /* Quark transfer */
3869- if (g_ptr->m_idx == p_ptr->riding)
3335+ if (seen) obvious = TRUE;
3336+ if (r_ptr->flags1 & RF1_UNIQUE)
3337+ {
3338+ note = _("には効果がなかった。", " is unaffected.");
3339+ dam = 0;
3340+ }
3341+ else
38703342 {
3871- if (rakuba(-1, FALSE))
3343+ if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
3344+ (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
3345+ {
3346+ dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
3347+
3348+ if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
3349+ }
3350+ else
38723351 {
3873- msg_format(_("地面に落とされた。", "You have fallen from %s."), m_name);
3352+ note = _("は耐性を持っている!", "resists!");
3353+ dam = 0;
38743354 }
38753355 }
3876-
3877- delete_monster_idx(g_ptr->m_idx);
3878-
3879- return (TRUE);
3356+ break;
38803357 }
3881- else
3358+
3359+ /* Capture monster */
3360+ case GF_CAPTURE:
38823361 {
3883- msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), m_name);
3884- skipped = TRUE;
3885- }
3886- break;
3887- }
3362+ int nokori_hp;
3363+ if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
3364+ (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_NAZGUL)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR) || m_ptr->parent_m_idx)
3365+ {
3366+ msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3367+ skipped = TRUE;
3368+ break;
3369+ }
38883370
3889- /* Attack (Use "dam" as attack type) */
3890- case GF_ATTACK:
3891- {
3892- /* Return this monster's death */
3893- return py_attack(y, x, dam);
3894- }
3371+ if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
3372+ else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(m_ptr->r_idx))
3373+ nokori_hp = m_ptr->maxhp * 3 / 10;
3374+ else
3375+ nokori_hp = m_ptr->maxhp * 3 / 20;
38953376
3896- /* Sleep (Use "dam" as "power") */
3897- case GF_ENGETSU:
3898- {
3899- int effect = 0;
3900- bool done = TRUE;
3377+ if (m_ptr->hp >= nokori_hp)
3378+ {
3379+ msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), m_name);
3380+ skipped = TRUE;
3381+ }
3382+ else if (m_ptr->hp < randint0(nokori_hp))
3383+ {
3384+ if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(g_ptr->m_idx, FALSE, MON_CHAMELEON);
3385+ msg_format(_("%sを捕えた!", "You capture %^s!"), m_name);
3386+ cap_mon = m_ptr->r_idx;
3387+ cap_mspeed = m_ptr->mspeed;
3388+ cap_hp = m_ptr->hp;
3389+ cap_maxhp = m_ptr->max_maxhp;
3390+ cap_nickname = m_ptr->nickname; /* Quark transfer */
3391+ if (g_ptr->m_idx == p_ptr->riding)
3392+ {
3393+ if (rakuba(-1, FALSE))
3394+ {
3395+ msg_format(_("地面に落とされた。", "You have fallen from %s."), m_name);
3396+ }
3397+ }
39013398
3902- if (seen) obvious = TRUE;
3399+ delete_monster_idx(g_ptr->m_idx);
39033400
3904- if (r_ptr->flagsr & RFR_RES_ALL)
3905- {
3906- note = _("には効果がなかった。", " is unaffected.");
3907- dam = 0;
3908- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3909- break;
3910- }
3911- if (r_ptr->flags2 & RF2_EMPTY_MIND)
3912- {
3913- note = _("には効果がなかった。", " is unaffected.");
3914- dam = 0;
3915- skipped = TRUE;
3916- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3401+ return (TRUE);
3402+ }
3403+ else
3404+ {
3405+ msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), m_name);
3406+ skipped = TRUE;
3407+ }
39173408 break;
39183409 }
3919- if (MON_CSLEEP(m_ptr))
3410+
3411+ /* Attack (Use "dam" as attack type) */
3412+ case GF_ATTACK:
39203413 {
3921- note = _("には効果がなかった。", " is unaffected.");
3922- dam = 0;
3923- skipped = TRUE;
3924- break;
3414+ /* Return this monster's death */
3415+ return py_attack(y, x, dam);
39253416 }
39263417
3927- if (one_in_(5)) effect = 1;
3928- else if (one_in_(4)) effect = 2;
3929- else if (one_in_(3)) effect = 3;
3930- else done = FALSE;
3931-
3932- if (effect == 1)
3418+ /* Sleep (Use "dam" as "power") */
3419+ case GF_ENGETSU:
39333420 {
3934- /* Powerful monsters can resist */
3935- if ((r_ptr->flags1 & RF1_UNIQUE) ||
3936- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3421+ int effect = 0;
3422+ bool done = TRUE;
3423+
3424+ if (seen) obvious = TRUE;
3425+ if (r_ptr->flags2 & RF2_EMPTY_MIND)
39373426 {
39383427 note = _("には効果がなかった。", " is unaffected.");
3939- obvious = FALSE;
3428+ dam = 0;
3429+ skipped = TRUE;
3430+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3431+ break;
3432+ }
3433+ if (MON_CSLEEP(m_ptr))
3434+ {
3435+ note = _("には効果がなかった。", " is unaffected.");
3436+ dam = 0;
3437+ skipped = TRUE;
3438+ break;
39403439 }
39413440
3942- /* Normal monsters slow down */
3943- else
3441+ if (one_in_(5)) effect = 1;
3442+ else if (one_in_(4)) effect = 2;
3443+ else if (one_in_(3)) effect = 3;
3444+ else done = FALSE;
3445+
3446+ if (effect == 1)
39443447 {
3945- if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
3448+ /* Powerful monsters can resist */
3449+ if ((r_ptr->flags1 & RF1_UNIQUE) ||
3450+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
39463451 {
3947- note = _("の動きが遅くなった。", " starts moving slower.");
3452+ note = _("には効果がなかった。", " is unaffected.");
3453+ obvious = FALSE;
39483454 }
3949- }
3950- }
39513455
3952- else if (effect == 2)
3953- {
3954- do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
3456+ /* Normal monsters slow down */
3457+ else
3458+ {
3459+ if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
3460+ {
3461+ note = _("の動きが遅くなった。", " starts moving slower.");
3462+ }
3463+ }
3464+ }
39553465
3956- /* Attempt a saving throw */
3957- if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3958- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3466+ else if (effect == 2)
39593467 {
3960- /* Resist */
3961- do_stun = 0;
3468+ do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
39623469
3963- /* No obvious effect */
3964- note = _("には効果がなかった。", " is unaffected.");
3965- obvious = FALSE;
3470+ /* Attempt a saving throw */
3471+ if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3472+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3473+ {
3474+ /* Resist */
3475+ do_stun = 0;
3476+
3477+ /* No obvious effect */
3478+ note = _("には効果がなかった。", " is unaffected.");
3479+ obvious = FALSE;
3480+ }
39663481 }
3967- }
39683482
3969- else if (effect == 3)
3970- {
3971- /* Attempt a saving throw */
3972- if ((r_ptr->flags1 & RF1_UNIQUE) ||
3973- (r_ptr->flags3 & RF3_NO_SLEEP) ||
3974- (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3483+ else if (effect == 3)
39753484 {
3976- /* Memorize a flag */
3977- if (r_ptr->flags3 & RF3_NO_SLEEP)
3485+ /* Attempt a saving throw */
3486+ if ((r_ptr->flags1 & RF1_UNIQUE) ||
3487+ (r_ptr->flags3 & RF3_NO_SLEEP) ||
3488+ (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
39783489 {
3979- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3980- }
3490+ /* Memorize a flag */
3491+ if (r_ptr->flags3 & RF3_NO_SLEEP)
3492+ {
3493+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3494+ }
39813495
3982- /* No obvious effect */
3983- note = _("には効果がなかった。", " is unaffected.");
3984- obvious = FALSE;
3496+ /* No obvious effect */
3497+ note = _("には効果がなかった。", " is unaffected.");
3498+ obvious = FALSE;
3499+ }
3500+ else
3501+ {
3502+ /* Go to sleep (much) later */
3503+ note = _("は眠り込んでしまった!", " falls asleep!");
3504+ do_sleep = 500;
3505+ }
39853506 }
3986- else
3507+
3508+ if (!done)
39873509 {
3988- /* Go to sleep (much) later */
3989- note = _("は眠り込んでしまった!", " falls asleep!");
3990- do_sleep = 500;
3510+ note = _("には効果がなかった。", " is unaffected.");
39913511 }
3992- }
39933512
3994- if (!done)
3995- {
3996- note = _("には効果がなかった。", " is unaffected.");
3513+ /* No "real" damage */
3514+ dam = 0;
3515+ break;
39973516 }
39983517
3999- /* No "real" damage */
4000- dam = 0;
4001- break;
4002- }
4003-
4004- /* GENOCIDE */
4005- case GF_GENOCIDE:
4006- {
4007- if (seen) obvious = TRUE;
4008-
4009- if (r_ptr->flagsr & RFR_RES_ALL)
3518+ /* GENOCIDE */
3519+ case GF_GENOCIDE:
40103520 {
4011- note = _("には効果がなかった。", " is unaffected.");
3521+ if (seen) obvious = TRUE;
3522+ if (genocide_aux(g_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
3523+ {
3524+ if (seen_msg) msg_format(_("%sは消滅した!", "%^s disappered!"), m_name);
3525+ chg_virtue(V_VITALITY, -1);
3526+ return TRUE;
3527+ }
3528+
40123529 skipped = TRUE;
4013- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
40143530 break;
40153531 }
40163532
4017- if (genocide_aux(g_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
3533+ case GF_PHOTO:
40183534 {
4019- if (seen_msg) msg_format(_("%sは消滅した!", "%^s disappered!"), m_name);
4020- chg_virtue(V_VITALITY, -1);
4021- return TRUE;
4022- }
3535+ if (!who) msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), m_name);
3536+ /* Hurt by light */
3537+ if (r_ptr->flags3 & (RF3_HURT_LITE))
3538+ {
3539+ /* Obvious effect */
3540+ if (seen) obvious = TRUE;
40233541
4024- skipped = TRUE;
4025- break;
4026- }
3542+ /* Memorize the effects */
3543+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
40273544
4028- case GF_PHOTO:
4029- {
4030- if (!who) msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), m_name);
4031- /* Hurt by light */
4032- if (r_ptr->flags3 & (RF3_HURT_LITE))
4033- {
4034- /* Obvious effect */
4035- if (seen) obvious = TRUE;
3545+ /* Special effect */
3546+ note = _("は光に身をすくめた!", " cringes from the light!");
3547+ note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3548+ }
40363549
4037- /* Memorize the effects */
4038- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3550+ /* Normally no damage */
3551+ else
3552+ {
3553+ /* No damage */
3554+ dam = 0;
3555+ }
40393556
4040- /* Special effect */
4041- note = _("は光に身をすくめた!", " cringes from the light!");
4042- note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
4043- }
3557+ photo = m_ptr->r_idx;
40443558
4045- /* Normally no damage */
4046- else
4047- {
4048- /* No damage */
4049- dam = 0;
3559+ break;
40503560 }
40513561
4052- photo = m_ptr->r_idx;
40533562
4054- break;
4055- }
4056-
4057-
4058- /* blood curse */
4059- case GF_BLOOD_CURSE:
4060- {
4061- if (seen) obvious = TRUE;
4062-
4063- if (r_ptr->flagsr & RFR_RES_ALL)
3563+ /* blood curse */
3564+ case GF_BLOOD_CURSE:
40643565 {
4065- note = _("には完全な耐性がある!", " is immune.");
4066- dam = 0;
4067- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3566+ if (seen) obvious = TRUE;
40683567 break;
40693568 }
4070- break;
4071- }
4072-
4073- case GF_CRUSADE:
4074- {
4075- bool success = FALSE;
4076- if (seen) obvious = TRUE;
40773569
4078- if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
3570+ case GF_CRUSADE:
40793571 {
4080- if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
4081- if (dam < 1) dam = 1;
3572+ bool success = FALSE;
3573+ if (seen) obvious = TRUE;
40823574
4083- /* No need to tame your pet */
4084- if (is_pet(m_ptr))
3575+ if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
40853576 {
4086- note = _("の動きが速くなった。", " starts moving faster.");
4087- (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100);
4088- success = TRUE;
3577+ if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
3578+ if (dam < 1) dam = 1;
3579+
3580+ /* No need to tame your pet */
3581+ if (is_pet(m_ptr))
3582+ {
3583+ note = _("の動きが速くなった。", " starts moving faster.");
3584+ (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100);
3585+ success = TRUE;
3586+ }
3587+
3588+ /* Attempt a saving throw */
3589+ else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3590+ (r_ptr->flags1 & (RF1_UNIQUE)) ||
3591+ (m_ptr->mflag2 & MFLAG2_NOPET) ||
3592+ (p_ptr->cursed & TRC_AGGRAVATE) ||
3593+ ((r_ptr->level+10) > randint1(dam)))
3594+ {
3595+ /* Resist */
3596+ if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3597+ }
3598+ else
3599+ {
3600+ note = _("を支配した。", " is tamed!");
3601+ set_pet(m_ptr);
3602+ (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100);
3603+
3604+ /* Learn about type */
3605+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
3606+ success = TRUE;
3607+ }
40893608 }
40903609
4091- /* Attempt a saving throw */
4092- else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4093- (r_ptr->flags1 & (RF1_UNIQUE)) ||
4094- (m_ptr->mflag2 & MFLAG2_NOPET) ||
4095- (p_ptr->cursed & TRC_AGGRAVATE) ||
4096- ((r_ptr->level+10) > randint1(dam)))
3610+ if (!success)
40973611 {
4098- /* Resist */
4099- if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3612+ if (!(r_ptr->flags3 & RF3_NO_FEAR))
3613+ {
3614+ do_fear = randint1(90)+10;
3615+ }
3616+ else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
41003617 }
4101- else
4102- {
4103- note = _("を支配した。", " is tamed!");
4104- set_pet(m_ptr);
4105- (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100);
41063618
4107- /* Learn about type */
4108- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4109- success = TRUE;
4110- }
3619+ /* No "real" damage */
3620+ dam = 0;
3621+ break;
41113622 }
41123623
4113- if (!success)
3624+ case GF_WOUNDS:
41143625 {
4115- if (!(r_ptr->flags3 & RF3_NO_FEAR))
3626+ if (seen) obvious = TRUE;
3627+ /* Attempt a saving throw */
3628+ if (randint0(100 + dam) < (r_ptr->level + 50))
41163629 {
4117- do_fear = randint1(90)+10;
3630+ note = _("には効果がなかった。", " is unaffected.");
3631+ dam = 0;
41183632 }
4119- else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
3633+ break;
41203634 }
41213635
4122- /* No "real" damage */
4123- dam = 0;
4124- break;
4125- }
4126-
4127- case GF_WOUNDS:
4128- {
4129- if (seen) obvious = TRUE;
4130-
4131- if (r_ptr->flagsr & RFR_RES_ALL)
3636+ /* Default */
3637+ default:
41323638 {
4133- note = _("には完全な耐性がある!", " is immune.");
3639+ /* Irrelevant */
41343640 skipped = TRUE;
4135- if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4136- break;
4137- }
41383641
4139- /* Attempt a saving throw */
4140- if (randint0(100 + dam) < (r_ptr->level + 50))
4141- {
4142- note = _("には効果がなかった。", " is unaffected.");
3642+ /* No damage */
41433643 dam = 0;
4144- }
4145- break;
4146- }
4147-
4148- /* Default */
4149- default:
4150- {
4151- /* Irrelevant */
4152- skipped = TRUE;
4153-
4154- /* No damage */
4155- dam = 0;
41563644
4157- break;
3645+ break;
3646+ }
41583647 }
41593648 }
41603649
4161-
41623650 /* Absolutely no effect */
41633651 if (skipped) return (FALSE);
41643652
Show on old repository browser