mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Trading stock limits
This commit is contained in:
parent
250733a123
commit
cac9ac6807
@ -3,14 +3,14 @@ loot_tables: [
|
||||
// balance the loot tables against each other (higher= more common= smaller price)
|
||||
// Weapons
|
||||
(16.0, "common.loot_tables.weapons.starter"),
|
||||
(8.0, "common.loot_tables.weapons.tier-0"),
|
||||
(4.0, "common.loot_tables.weapons.tier-1"),
|
||||
(2.0, "common.loot_tables.weapons.tier-2"),
|
||||
(1.0, "common.loot_tables.weapons.tier-3"),
|
||||
(0.25, "common.loot_tables.weapons.tier-4"),
|
||||
(12.0, "common.loot_tables.weapons.tier-0"),
|
||||
(6.0, "common.loot_tables.weapons.tier-1"),
|
||||
(4.0, "common.loot_tables.weapons.tier-2"),
|
||||
(2.0, "common.loot_tables.weapons.tier-3"),
|
||||
//(0.25, "common.loot_tables.weapons.tier-4"),
|
||||
//(0.125, "common.loot_tables.weapons.tier-5"),
|
||||
//(0.05, "common.loot_tables.weapons.cultist"),
|
||||
(0.125, "common.loot_tables.weapons.cave"),
|
||||
//(0.125, "common.loot_tables.weapons.cave"),
|
||||
//(0.0625, "common.loot_tables.weapons.legendary"),
|
||||
// Armor
|
||||
(20.0, "common.loot_tables.armor.cloth"),
|
||||
|
@ -615,7 +615,7 @@ impl LoadoutBuilder {
|
||||
let mut item = Item::new_from_asset_expect(&item_id);
|
||||
// NOTE: Conversion to and from f32 works fine because we make sure the
|
||||
// number we're converting is ≤ 100.
|
||||
let max = amount.min(100.min(item.max_amount()) as f32) as u32;
|
||||
let max = amount.min(16.min(item.max_amount()) as f32) as u32;
|
||||
let n = rng.gen_range(1..max.max(2));
|
||||
*amount -= if item.set_amount(n).is_ok() {
|
||||
n as f32
|
||||
|
Loading…
Reference in New Issue
Block a user