… | |
… | |
1566 | if (QUERY_FLAG (obj, FLAG_UNPAID)) |
1566 | if (QUERY_FLAG (obj, FLAG_UNPAID)) |
1567 | value = 0; |
1567 | value = 0; |
1568 | else if (obj->type == MONEY || obj->type == GEM) |
1568 | else if (obj->type == MONEY || obj->type == GEM) |
1569 | value /= 3; |
1569 | value /= 3; |
1570 | else |
1570 | else |
1571 | value = (value * 9) / 10; |
1571 | value = value * 9 / 10; |
1572 | |
|
|
1573 | value /= 4; // fix by GHJ, don't understand, pcg |
|
|
1574 | |
1572 | |
1575 | if (obj->value > 0 && rndm (0, 29)) |
1573 | if (obj->value > 0 && rndm (0, 29)) |
1576 | total_value += value; |
1574 | total_value += value; |
1577 | |
1575 | |
1578 | total_weight += obj->total_weight (); |
1576 | total_weight += obj->total_weight (); |
… | |
… | |
1611 | } |
1609 | } |
1612 | |
1610 | |
1613 | int |
1611 | int |
1614 | alchemy (object *op, object *caster, object *spell_ob) |
1612 | alchemy (object *op, object *caster, object *spell_ob) |
1615 | { |
1613 | { |
1616 | int weight = 0, mflags; |
|
|
1617 | maptile *mp; |
|
|
1618 | |
|
|
1619 | if (op->type != PLAYER) |
1614 | if (op->type != PLAYER) |
1620 | return 0; |
1615 | return 0; |
|
|
1616 | |
|
|
1617 | object *large = get_archetype ("largenugget"); |
|
|
1618 | object *small = get_archetype ("smallnugget"); |
1621 | |
1619 | |
1622 | /* Put a maximum weight of items that can be alchemised. Limits the power |
1620 | /* Put a maximum weight of items that can be alchemised. Limits the power |
1623 | * some, and also prevents people from alchemising every table/chair/clock |
1621 | * some, and also prevents people from alchemising every table/chair/clock |
1624 | * in sight |
1622 | * in sight |
1625 | */ |
1623 | */ |
1626 | int duration = spell_ob->duration + SP_level_duration_adjust (caster, spell_ob); |
1624 | int duration = spell_ob->duration + SP_level_duration_adjust (caster, spell_ob); |
1627 | int weight_max = duration * 1000; |
1625 | int weight_max = duration * 1000; |
1628 | uint64 value_max = duration * 1000; |
1626 | uint64 value_max = duration * 1000; |
1629 | |
1627 | |
1630 | object *large = get_archetype ("largenugget"); |
1628 | int weight = 0; |
1631 | object *small = get_archetype ("smallnugget"); |
|
|
1632 | |
1629 | |
1633 | for (int y = op->y - 1; y <= op->y + 1; y++) |
1630 | for (int y = op->y - 1; y <= op->y + 1; y++) |
1634 | { |
1631 | { |
1635 | for (int x = op->x - 1; x <= op->x + 1; x++) |
1632 | for (int x = op->x - 1; x <= op->x + 1; x++) |
1636 | { |
1633 | { |
1637 | uint64 value = 0; |
1634 | uint64 value = 0; |
1638 | |
1635 | |
1639 | sint16 nx = x; |
1636 | sint16 nx = x; |
1640 | sint16 ny = y; |
1637 | sint16 ny = y; |
1641 | |
1638 | |
1642 | mp = op->map; |
1639 | maptile *mp = op->map; |
1643 | |
1640 | |
1644 | mflags = get_map_flags (mp, &mp, nx, ny, &nx, &ny); |
1641 | int mflags = get_map_flags (mp, &mp, nx, ny, &nx, &ny); |
1645 | |
1642 | |
1646 | if (mflags & (P_OUT_OF_MAP | P_NO_MAGIC)) |
1643 | if (mflags & (P_OUT_OF_MAP | P_NO_MAGIC)) |
1647 | continue; |
1644 | continue; |
1648 | |
1645 | |
1649 | /* Treat alchemy a little differently - most spell effects |
1646 | /* Treat alchemy a little differently - most spell effects |