… | |
… | |
1569 | floor = 0; |
1569 | floor = 0; |
1570 | detect = NULL; |
1570 | detect = NULL; |
1571 | for (tmp = last; tmp; tmp = tmp->below) |
1571 | for (tmp = last; tmp; tmp = tmp->below) |
1572 | { |
1572 | { |
1573 | /* show invisible */ |
1573 | /* show invisible */ |
1574 | if (QUERY_FLAG (spell, FLAG_MAKE_INVIS) && |
1574 | if (QUERY_FLAG (spell, FLAG_MAKE_INVIS) |
1575 | /* Might there be other objects that we can make visible? */ |
1575 | /* Might there be other objects that we can make visible? */ |
1576 | (tmp->invisible && (QUERY_FLAG (tmp, FLAG_MONSTER) |
1576 | && (tmp->invisible && (QUERY_FLAG (tmp, FLAG_MONSTER) |
1577 | || (tmp->type == PLAYER && !QUERY_FLAG (tmp, FLAG_WIZ)) |
1577 | || (tmp->type == PLAYER && !QUERY_FLAG (tmp, FLAG_WIZ)) |
1578 | || tmp->type == T_HANDLE |
1578 | || tmp->type == T_HANDLE |
1579 | || tmp->type == TRAPDOOR |
1579 | || tmp->type == TRAPDOOR |
1580 | || tmp->type == EXIT |
1580 | || tmp->type == EXIT |
1581 | || tmp->type == HOLE |
1581 | || tmp->type == HOLE |
1582 | || tmp->type == BUTTON |
1582 | || tmp->type == BUTTON |
1583 | || tmp->type == TELEPORTER |
1583 | || tmp->type == TELEPORTER |
1584 | || tmp->type == GATE |
1584 | || tmp->type == GATE |
1585 | || tmp->type == LOCKED_DOOR |
1585 | || tmp->type == LOCKED_DOOR |
1586 | || tmp->type == WEAPON |
1586 | || tmp->type == WEAPON |
1587 | || tmp->type == ALTAR |
1587 | || tmp->type == ALTAR |
1588 | || tmp->type == SIGN |
1588 | || tmp->type == SIGN |
1589 | || tmp->type == TRIGGER_PEDESTAL |
1589 | || tmp->type == TRIGGER_PEDESTAL |
1590 | || tmp->type == SPECIAL_KEY |
1590 | || tmp->type == SPECIAL_KEY |
1591 | || tmp->type == TREASURE |
1591 | || tmp->type == TREASURE |
1592 | || tmp->type == BOOK |
1592 | || tmp->type == BOOK |
1593 | || tmp->type == HOLY_ALTAR |
1593 | || tmp->type == HOLY_ALTAR |
1594 | || tmp->type == CONTAINER))) |
1594 | || tmp->type == CONTAINER))) |
1595 | { |
1595 | { |
1596 | if (random_roll (0, skill->level - 1, op, PREFER_HIGH) > level / 4) |
1596 | if (random_roll (0, skill->level - 1, op, PREFER_HIGH) > level / 4) |
1597 | { |
1597 | { |
1598 | tmp->invisible = 0; |
1598 | tmp->invisible = 0; |
1599 | done_one = 1; |
1599 | done_one = 1; |
… | |
… | |
1621 | /* detect magic */ |
1621 | /* detect magic */ |
1622 | if (QUERY_FLAG (spell, FLAG_KNOWN_MAGICAL) && |
1622 | if (QUERY_FLAG (spell, FLAG_KNOWN_MAGICAL) && |
1623 | !QUERY_FLAG (tmp, FLAG_KNOWN_MAGICAL) && !QUERY_FLAG (tmp, FLAG_IDENTIFIED) && is_magical (tmp)) |
1623 | !QUERY_FLAG (tmp, FLAG_KNOWN_MAGICAL) && !QUERY_FLAG (tmp, FLAG_IDENTIFIED) && is_magical (tmp)) |
1624 | { |
1624 | { |
1625 | SET_FLAG (tmp, FLAG_KNOWN_MAGICAL); |
1625 | SET_FLAG (tmp, FLAG_KNOWN_MAGICAL); |
1626 | /* make runes more visibile */ |
1626 | /* make runes more visible */ |
1627 | if (tmp->type == RUNE && tmp->attacktype & AT_MAGIC) |
1627 | if (tmp->type == RUNE && tmp->attacktype & AT_MAGIC) |
1628 | tmp->stats.Cha /= 4; |
1628 | tmp->stats.Cha /= 4; |
1629 | |
1629 | |
1630 | done_one = 1; |
1630 | done_one = 1; |
1631 | } |
1631 | } |
… | |
… | |
1656 | if (QUERY_FLAG (spell, FLAG_KNOWN_CURSED) && !QUERY_FLAG (tmp, FLAG_KNOWN_CURSED) && |
1656 | if (QUERY_FLAG (spell, FLAG_KNOWN_CURSED) && !QUERY_FLAG (tmp, FLAG_KNOWN_CURSED) && |
1657 | (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED))) |
1657 | (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED))) |
1658 | { |
1658 | { |
1659 | SET_FLAG (tmp, FLAG_KNOWN_CURSED); |
1659 | SET_FLAG (tmp, FLAG_KNOWN_CURSED); |
1660 | done_one = 1; |
1660 | done_one = 1; |
|
|
1661 | } |
|
|
1662 | |
|
|
1663 | // Do mining detection spell: |
|
|
1664 | if (spell->last_sp == 1) // 1 - detect any vein |
|
|
1665 | { |
|
|
1666 | if (tmp->type == VEIN) |
|
|
1667 | { |
|
|
1668 | if (tmp->other_arch) |
|
|
1669 | { |
|
|
1670 | if (!detect) |
|
|
1671 | detect = tmp->other_arch; |
|
|
1672 | done_one = 2; |
|
|
1673 | } |
|
|
1674 | else |
|
|
1675 | done_one = 1; |
|
|
1676 | } |
1661 | } |
1677 | } |
1662 | } /* for stack of objects on this space */ |
1678 | } /* for stack of objects on this space */ |
1663 | |
1679 | |
1664 | /* Code here puts an effect of the spell on the space, so you can see |
1680 | /* Code here puts an effect of the spell on the space, so you can see |
1665 | * where the magic is. |
1681 | * where the magic is. |
… | |
… | |
1678 | /* by default, the detect_ob is already animated */ |
1694 | /* by default, the detect_ob is already animated */ |
1679 | if (!QUERY_FLAG (detect, FLAG_ANIMATE)) |
1695 | if (!QUERY_FLAG (detect, FLAG_ANIMATE)) |
1680 | CLEAR_FLAG (detect_ob, FLAG_ANIMATE); |
1696 | CLEAR_FLAG (detect_ob, FLAG_ANIMATE); |
1681 | } |
1697 | } |
1682 | |
1698 | |
1683 | m->insert (detect_ob, nx, ny, op); |
1699 | m->insert (detect_ob, nx, ny, op, INS_ON_TOP); |
1684 | } |
1700 | } |
1685 | } /* for processing the surrounding spaces */ |
1701 | } /* for processing the surrounding spaces */ |
1686 | |
1702 | |
1687 | |
1703 | |
1688 | /* Now process objects in the players inventory if detect curse or magic */ |
1704 | /* Now process objects in the players inventory if detect curse or magic */ |