used for wand/scroll/spell of create monster */ returns TRUE iff you know monsters have been created */
| 1553 | /* used for wand/scroll/spell of create monster */ |
| 1554 | /* returns TRUE iff you know monsters have been created */ |
| 1555 | boolean |
| 1556 | create_critters( |
| 1557 | int cnt, |
| 1558 | struct permonst *mptr, /* usually null; used for confused reading */ |
| 1559 | boolean neverask) |
| 1560 | { |
| 1561 | coord c; |
| 1562 | coordxy x, y; |
| 1563 | struct monst *mon; |
| 1564 | boolean known = FALSE; |
| 1565 | boolean ask = (wizard && !neverask); |
| 1566 | |
| 1567 | while (cnt--) { |
| 1568 | if (ask) { |
| 1569 | if (create_particular()) { |
| 1570 | known = TRUE; |
| 1571 | continue; |
| 1572 | } else |
| 1573 | ask = FALSE; /* ESC will shut off prompting */ |
| 1574 | } |
| 1575 | x = u.ux, y = u.uy; |
| 1576 | /* if in water, try to encourage an aquatic monster |
| 1577 | by finding and then specifying another wet location */ |
| 1578 | if (!mptr && u.uinwater && enexto(&c, x, y, &mons[PM_GIANT_EEL])) |
| 1579 | x = c.x, y = c.y; |
| 1580 | |
| 1581 | if ((mon = makemon(mptr, x, y, NO_MM_FLAGS)) == 0) |
| 1582 | continue; /* try again [should probably stop instead] */ |
| 1583 | |
| 1584 | if ((canseemon(mon) && (M_AP_TYPE(mon) == M_AP_NOTHING |
| 1585 | || M_AP_TYPE(mon) == M_AP_MONSTER)) |
| 1586 | || sensemon(mon)) |
| 1587 | known = TRUE; |
| 1588 | } |
| 1589 | return known; |
| 1590 | } |
| 1591 | |
| 1592 | staticfn boolean |
| 1593 | uncommon(int mndx) |
no test coverage detected