… | |
… | |
1426 | /* question: don't pick up known-poisonous stuff? */ |
1426 | /* question: don't pick up known-poisonous stuff? */ |
1427 | if (op->contr->mode & PU_FOOD) |
1427 | if (op->contr->mode & PU_FOOD) |
1428 | if (tmp->type == FOOD) |
1428 | if (tmp->type == FOOD) |
1429 | { |
1429 | { |
1430 | pick_up (op, tmp); |
1430 | pick_up (op, tmp); |
1431 | if (0) |
|
|
1432 | fprintf (stderr, "FOOD\n"); |
|
|
1433 | continue; |
1431 | continue; |
1434 | } |
1432 | } |
|
|
1433 | |
1435 | if (op->contr->mode & PU_DRINK) |
1434 | if (op->contr->mode & PU_DRINK) |
1436 | if (tmp->type == DRINK || (tmp->type == POISON && !QUERY_FLAG (tmp, FLAG_KNOWN_CURSED))) |
1435 | if (tmp->type == DRINK || (tmp->type == POISON && !QUERY_FLAG (tmp, FLAG_KNOWN_CURSED))) |
1437 | { |
1436 | { |
1438 | pick_up (op, tmp); |
1437 | pick_up (op, tmp); |
1439 | if (0) |
|
|
1440 | fprintf (stderr, "DRINK\n"); |
|
|
1441 | continue; |
1438 | continue; |
1442 | } |
1439 | } |
1443 | |
1440 | |
1444 | if (op->contr->mode & PU_POTION) |
1441 | if (op->contr->mode & PU_POTION) |
1445 | if (tmp->type == POTION) |
1442 | if (tmp->type == POTION) |
1446 | { |
1443 | { |
1447 | pick_up (op, tmp); |
1444 | pick_up (op, tmp); |
1448 | if (0) |
|
|
1449 | fprintf (stderr, "POTION\n"); |
|
|
1450 | continue; |
1445 | continue; |
1451 | } |
1446 | } |
1452 | |
1447 | |
1453 | /* spellbooks, skillscrolls and normal books/scrolls */ |
1448 | /* spellbooks, skillscrolls and normal books/scrolls */ |
1454 | if (op->contr->mode & PU_SPELLBOOK) |
1449 | if (op->contr->mode & PU_SPELLBOOK) |
1455 | if (tmp->type == SPELLBOOK) |
1450 | if (tmp->type == SPELLBOOK) |
1456 | { |
1451 | { |
1457 | pick_up (op, tmp); |
1452 | pick_up (op, tmp); |
1458 | if (0) |
|
|
1459 | fprintf (stderr, "SPELLBOOK\n"); |
|
|
1460 | continue; |
1453 | continue; |
1461 | } |
1454 | } |
|
|
1455 | |
1462 | if (op->contr->mode & PU_SKILLSCROLL) |
1456 | if (op->contr->mode & PU_SKILLSCROLL) |
1463 | if (tmp->type == SKILLSCROLL) |
1457 | if (tmp->type == SKILLSCROLL) |
1464 | { |
1458 | { |
1465 | pick_up (op, tmp); |
1459 | pick_up (op, tmp); |
1466 | if (0) |
|
|
1467 | fprintf (stderr, "SKILLSCROLL\n"); |
|
|
1468 | continue; |
1460 | continue; |
1469 | } |
1461 | } |
|
|
1462 | |
1470 | if (op->contr->mode & PU_READABLES) |
1463 | if (op->contr->mode & PU_READABLES) |
1471 | if (tmp->type == BOOK || tmp->type == SCROLL) |
1464 | if (tmp->type == BOOK || tmp->type == SCROLL) |
1472 | { |
1465 | { |
1473 | pick_up (op, tmp); |
1466 | pick_up (op, tmp); |
1474 | if (0) |
|
|
1475 | fprintf (stderr, "READABLES\n"); |
|
|
1476 | continue; |
1467 | continue; |
1477 | } |
1468 | } |
1478 | |
1469 | |
1479 | /* wands/staves/rods/horns */ |
1470 | /* wands/staves/rods/horns */ |
1480 | if (op->contr->mode & PU_MAGIC_DEVICE) |
1471 | if (op->contr->mode & PU_MAGIC_DEVICE) |
1481 | if (tmp->type == WAND || tmp->type == ROD || tmp->type == HORN) |
1472 | if (tmp->type == WAND || tmp->type == ROD || tmp->type == HORN) |
1482 | { |
1473 | { |
1483 | pick_up (op, tmp); |
1474 | pick_up (op, tmp); |
1484 | if (0) |
|
|
1485 | fprintf (stderr, "MAGIC_DEVICE\n"); |
|
|
1486 | continue; |
1475 | continue; |
1487 | } |
1476 | } |
1488 | |
1477 | |
1489 | /* pick up all magical items */ |
1478 | /* pick up all magical items */ |
1490 | if (op->contr->mode & PU_MAGICAL) |
1479 | if (op->contr->mode & PU_MAGICAL) |
1491 | if (QUERY_FLAG (tmp, FLAG_KNOWN_MAGICAL) && !QUERY_FLAG (tmp, FLAG_KNOWN_CURSED)) |
1480 | if (QUERY_FLAG (tmp, FLAG_KNOWN_MAGICAL) && !QUERY_FLAG (tmp, FLAG_KNOWN_CURSED)) |
1492 | { |
1481 | { |
1493 | pick_up (op, tmp); |
1482 | pick_up (op, tmp); |
1494 | if (0) |
|
|
1495 | fprintf (stderr, "MAGICAL\n"); |
|
|
1496 | continue; |
1483 | continue; |
1497 | } |
1484 | } |
1498 | |
1485 | |
1499 | if (op->contr->mode & PU_VALUABLES) |
1486 | if (op->contr->mode & PU_VALUABLES) |
1500 | { |
1487 | { |
1501 | if (tmp->type == MONEY || tmp->type == GEM) |
1488 | if (tmp->type == MONEY || tmp->type == GEM) |
1502 | { |
1489 | { |
1503 | pick_up (op, tmp); |
1490 | pick_up (op, tmp); |
1504 | if (0) |
|
|
1505 | fprintf (stderr, "MONEY/GEM\n"); |
|
|
1506 | continue; |
1491 | continue; |
1507 | } |
1492 | } |
1508 | } |
1493 | } |
1509 | |
1494 | |
1510 | /* rings & amulets - talismans seems to be typed AMULET */ |
1495 | /* rings & amulets - talismans seems to be typed AMULET */ |
1511 | if (op->contr->mode & PU_JEWELS) |
1496 | if (op->contr->mode & PU_JEWELS) |
1512 | if (tmp->type == RING || tmp->type == AMULET) |
1497 | if (tmp->type == RING || tmp->type == AMULET) |
1513 | { |
1498 | { |
1514 | pick_up (op, tmp); |
1499 | pick_up (op, tmp); |
|
|
1500 | continue; |
1515 | if (0) |
1501 | } |
1516 | fprintf (stderr, "JEWELS\n"); |
1502 | |
|
|
1503 | /* we don't forget dragon food */ |
|
|
1504 | if (op->contr->mode & PU_FLESH) |
|
|
1505 | if (tmp->type == FLESH) |
|
|
1506 | { |
|
|
1507 | pick_up (op, tmp); |
1517 | continue; |
1508 | continue; |
1518 | } |
1509 | } |
1519 | |
1510 | |
1520 | /* bows and arrows. Bows are good for selling! */ |
1511 | /* bows and arrows. Bows are good for selling! */ |
1521 | if (op->contr->mode & PU_BOW) |
1512 | if (op->contr->mode & PU_BOW) |
1522 | if (tmp->type == BOW) |
1513 | if (tmp->type == BOW) |
1523 | { |
1514 | { |
1524 | pick_up (op, tmp); |
1515 | pick_up (op, tmp); |
1525 | if (0) |
|
|
1526 | fprintf (stderr, "BOW\n"); |
|
|
1527 | continue; |
1516 | continue; |
1528 | } |
1517 | } |
|
|
1518 | |
1529 | if (op->contr->mode & PU_ARROW) |
1519 | if (op->contr->mode & PU_ARROW) |
1530 | if (tmp->type == ARROW) |
1520 | if (tmp->type == ARROW) |
1531 | { |
1521 | { |
1532 | pick_up (op, tmp); |
1522 | pick_up (op, tmp); |
1533 | if (0) |
|
|
1534 | fprintf (stderr, "ARROW\n"); |
|
|
1535 | continue; |
1523 | continue; |
1536 | } |
1524 | } |
1537 | |
1525 | |
1538 | /* all kinds of armor etc. */ |
1526 | /* all kinds of armor etc. */ |
1539 | if (op->contr->mode & PU_ARMOUR) |
1527 | if (op->contr->mode & PU_ARMOUR) |
1540 | if (tmp->type == ARMOUR) |
1528 | if (tmp->type == ARMOUR) |
1541 | { |
1529 | { |
1542 | pick_up (op, tmp); |
1530 | pick_up (op, tmp); |
1543 | if (0) |
|
|
1544 | fprintf (stderr, "ARMOUR\n"); |
|
|
1545 | continue; |
1531 | continue; |
1546 | } |
1532 | } |
|
|
1533 | |
1547 | if (op->contr->mode & PU_HELMET) |
1534 | if (op->contr->mode & PU_HELMET) |
1548 | if (tmp->type == HELMET) |
1535 | if (tmp->type == HELMET) |
1549 | { |
1536 | { |
1550 | pick_up (op, tmp); |
1537 | pick_up (op, tmp); |
1551 | if (0) |
|
|
1552 | fprintf (stderr, "HELMET\n"); |
|
|
1553 | continue; |
1538 | continue; |
1554 | } |
1539 | } |
|
|
1540 | |
1555 | if (op->contr->mode & PU_SHIELD) |
1541 | if (op->contr->mode & PU_SHIELD) |
1556 | if (tmp->type == SHIELD) |
1542 | if (tmp->type == SHIELD) |
1557 | { |
1543 | { |
1558 | pick_up (op, tmp); |
1544 | pick_up (op, tmp); |
1559 | if (0) |
|
|
1560 | fprintf (stderr, "SHIELD\n"); |
|
|
1561 | continue; |
1545 | continue; |
1562 | } |
1546 | } |
|
|
1547 | |
1563 | if (op->contr->mode & PU_BOOTS) |
1548 | if (op->contr->mode & PU_BOOTS) |
1564 | if (tmp->type == BOOTS) |
1549 | if (tmp->type == BOOTS) |
1565 | { |
1550 | { |
1566 | pick_up (op, tmp); |
1551 | pick_up (op, tmp); |
1567 | if (0) |
|
|
1568 | fprintf (stderr, "BOOTS\n"); |
|
|
1569 | continue; |
1552 | continue; |
1570 | } |
1553 | } |
|
|
1554 | |
1571 | if (op->contr->mode & PU_GLOVES) |
1555 | if (op->contr->mode & PU_GLOVES) |
1572 | if (tmp->type == GLOVES) |
1556 | if (tmp->type == GLOVES) |
1573 | { |
1557 | { |
1574 | pick_up (op, tmp); |
1558 | pick_up (op, tmp); |
1575 | if (0) |
|
|
1576 | fprintf (stderr, "GLOVES\n"); |
|
|
1577 | continue; |
1559 | continue; |
1578 | } |
1560 | } |
|
|
1561 | |
1579 | if (op->contr->mode & PU_CLOAK) |
1562 | if (op->contr->mode & PU_CLOAK) |
1580 | if (tmp->type == CLOAK) |
1563 | if (tmp->type == CLOAK) |
1581 | { |
1564 | { |
1582 | pick_up (op, tmp); |
1565 | pick_up (op, tmp); |
1583 | if (0) |
|
|
1584 | fprintf (stderr, "GLOVES\n"); |
|
|
1585 | continue; |
1566 | continue; |
1586 | } |
1567 | } |
1587 | |
1568 | |
1588 | /* hoping to catch throwing daggers here */ |
1569 | /* hoping to catch throwing daggers here */ |
1589 | if (op->contr->mode & PU_MISSILEWEAPON) |
1570 | if (op->contr->mode & PU_MISSILEWEAPON) |
1590 | if (tmp->type == WEAPON && QUERY_FLAG (tmp, FLAG_IS_THROWN)) |
1571 | if (tmp->type == WEAPON && QUERY_FLAG (tmp, FLAG_IS_THROWN)) |
1591 | { |
1572 | { |
1592 | pick_up (op, tmp); |
1573 | pick_up (op, tmp); |
1593 | if (0) |
|
|
1594 | fprintf (stderr, "MISSILEWEAPON\n"); |
|
|
1595 | continue; |
1574 | continue; |
1596 | } |
1575 | } |
1597 | |
1576 | |
1598 | /* careful: chairs and tables are weapons! */ |
1577 | /* careful: chairs and tables are weapons! */ |
1599 | if (op->contr->mode & PU_ALLWEAPON) |
1578 | if (op->contr->mode & PU_ALLWEAPON) |
… | |
… | |
1602 | { |
1581 | { |
1603 | if (strstr (tmp->name, "table") == NULL && strstr (tmp->arch->name, "table") == NULL && |
1582 | if (strstr (tmp->name, "table") == NULL && strstr (tmp->arch->name, "table") == NULL && |
1604 | strstr (tmp->name, "chair") && strstr (tmp->arch->name, "chair") == NULL) |
1583 | strstr (tmp->name, "chair") && strstr (tmp->arch->name, "chair") == NULL) |
1605 | { |
1584 | { |
1606 | pick_up (op, tmp); |
1585 | pick_up (op, tmp); |
1607 | if (0) |
|
|
1608 | fprintf (stderr, "WEAPON\n"); |
|
|
1609 | continue; |
1586 | continue; |
1610 | } |
1587 | } |
1611 | } |
1588 | } |
|
|
1589 | |
1612 | if (tmp->type == WEAPON && tmp->name == NULL) |
1590 | if (tmp->type == WEAPON && tmp->name == NULL) |
1613 | { |
1591 | { |
1614 | if (strstr (tmp->arch->name, "table") == NULL && strstr (tmp->arch->name, "chair") == NULL) |
1592 | if (strstr (tmp->arch->name, "table") == NULL && strstr (tmp->arch->name, "chair") == NULL) |
1615 | { |
1593 | { |
1616 | pick_up (op, tmp); |
1594 | pick_up (op, tmp); |
1617 | if (0) |
|
|
1618 | fprintf (stderr, "WEAPON\n"); |
|
|
1619 | continue; |
1595 | continue; |
1620 | } |
1596 | } |
1621 | } |
1597 | } |
1622 | } |
1598 | } |
1623 | |
1599 | |
1624 | /* misc stuff that's useful */ |
1600 | /* misc stuff that's useful */ |
1625 | if (op->contr->mode & PU_KEY) |
1601 | if (op->contr->mode & PU_KEY) |
1626 | if (tmp->type == KEY || tmp->type == SPECIAL_KEY) |
1602 | if (tmp->type == KEY || tmp->type == SPECIAL_KEY) |
1627 | { |
1603 | { |
1628 | pick_up (op, tmp); |
1604 | pick_up (op, tmp); |
1629 | if (0) |
|
|
1630 | fprintf (stderr, "KEY\n"); |
|
|
1631 | continue; |
1605 | continue; |
1632 | } |
1606 | } |
1633 | |
1607 | |
1634 | /* any of the last 4 bits set means we use the ratio for value |
1608 | /* any of the last 4 bits set means we use the ratio for value |
1635 | * pickups */ |
1609 | * pickups */ |
… | |
… | |
1657 | continue; |
1631 | continue; |
1658 | } |
1632 | } |
1659 | } |
1633 | } |
1660 | } /* the new pickup model */ |
1634 | } /* the new pickup model */ |
1661 | } |
1635 | } |
|
|
1636 | |
1662 | return !stop; |
1637 | return !stop; |
1663 | } |
1638 | } |
1664 | |
1639 | |
1665 | /* |
1640 | /* |
1666 | * Find an arrow in the inventory and after that |
1641 | * Find an arrow in the inventory and after that |