UnNetHack SVN版rev.766を適用した。
Autoexplore: Heuristically determine if player is done exploring or not
自動探索:探索が完了しているかどうかは発見的に決定する
@@ -1520,6 +1520,31 @@ | ||
1520 | 1520 | return couldsee(x, y); |
1521 | 1521 | } |
1522 | 1522 | |
1523 | +/** Returns if (x,y) could be explored. | |
1524 | + * Differs from unexplore() in that it is uses information not | |
1525 | + * available to the player. | |
1526 | + * It should only leak information about "obvious" coordinates, e.g. | |
1527 | + * unexplored rooms or big areas not reachable by the player. */ | |
1528 | +static boolean | |
1529 | +interesting_to_explore(x,y) { | |
1530 | + if (!goodpos(x, y, &youmonst, 0)) return FALSE; | |
1531 | + | |
1532 | + if (!unexplored(x, y)) return FALSE; | |
1533 | + | |
1534 | + /* don't leak information about secret locations */ | |
1535 | + if (levl[x][y].typ == SCORR || | |
1536 | + levl[y][y].typ == SDOOR) { | |
1537 | + return FALSE; | |
1538 | + } | |
1539 | + /* don't leak information about gold vaults */ | |
1540 | + if (*in_rooms(x,y,VAULT)) return FALSE; | |
1541 | + | |
1542 | + /* corridor are uninteresting */ | |
1543 | + if (levl[y][y].typ == CORR) return FALSE; | |
1544 | + | |
1545 | + return TRUE; | |
1546 | +} | |
1547 | + | |
1523 | 1548 | void |
1524 | 1549 | domove() |
1525 | 1550 | { |
@@ -1580,14 +1605,39 @@ | ||
1580 | 1605 | u.tx = u.ux; |
1581 | 1606 | u.ty = u.uy; |
1582 | 1607 | if (!findtravelpath(unexplored)) { |
1608 | + char msg[BUFSZ]; | |
1609 | + int unexplored_cnt=0, i, j; | |
1610 | + /* check if this level has been thoroughly explored */ | |
1611 | + for (i=1; i < COLNO; i++) { | |
1612 | + for (j=0; j < ROWNO; j++) { | |
1613 | + if (interesting_to_explore(i,j)) { | |
1614 | + unexplored_cnt++; | |
1615 | + } | |
1616 | + } | |
1617 | + } | |
1583 | 1618 | iflags.autoexplore = FALSE; |
1584 | 1619 | /* TODO: Check if really done (known closed doors, |
1585 | 1620 | * boulders blocking your way) and offer doing |
1586 | 1621 | * travel when done */ |
1622 | + if (unexplored_cnt > 0) { | |
1623 | + if (wizard) { | |
1587 | 1624 | /*JP |
1588 | - pline("Done exploring."); | |
1625 | + Sprintf(msg, "Partly explored, can't reach %d places.", unexplored_cnt); | |
1589 | 1626 | */ |
1590 | - pline("探索し終わった。"); | |
1627 | + Sprintf(msg, "ある程度探索したが、%d箇所行けない場所がある。", unexplored_cnt); | |
1628 | + } else { | |
1629 | +/*JP | |
1630 | + Strcpy(msg, "Partly explored, can't reach some places."); | |
1631 | +*/ | |
1632 | + Strcpy(msg, "ある程度探索したが、何箇所か行けない場所がある。"); | |
1633 | + } | |
1634 | + } else { | |
1635 | +/*JP | |
1636 | + Strcpy(msg, "Done exploring."); | |
1637 | +*/ | |
1638 | + Strcpy(msg, "探索し終わった。"); | |
1639 | + } | |
1640 | + pline("%s", msg); | |
1591 | 1641 | } |
1592 | 1642 | } else if (!findtravelpath(NULL)) { |
1593 | 1643 | (void) findtravelpath(couldsee_func); |