From c8b8cd436ebd49df78215e37910df3321a7f51ad Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 1 Apr 2021 20:06:28 -0400 Subject: [PATCH] Made item prices sane. --- assets/common/item_price_calculation.ron | 22 +++++++++---------- .../common/items/weapons/staff/orc_iron.ron | 2 +- assets/common/loot_tables/consumables.ron | 4 ++-- common/src/comp/inventory/trade_pricing.rs | 11 +++++----- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/assets/common/item_price_calculation.ron b/assets/common/item_price_calculation.ron index 2b6ae5b9e8..ad25988f70 100644 --- a/assets/common/item_price_calculation.ron +++ b/assets/common/item_price_calculation.ron @@ -25,21 +25,21 @@ loot_tables: [ (0.125, "common.loot_tables.armor.cultist"), // Materials (7.5, "common.loot_tables.materials.common"), - (2.0, "common.loot_tables.materials.underground"), + (5.0, "common.loot_tables.materials.underground"), // Food - (6.0, "common.loot_tables.food.farm_ingredients"), - (2.5, "common.loot_tables.food.wild_ingredients"), - (0.8, "common.loot_tables.food.prepared"), + (0.5, "common.loot_tables.food.farm_ingredients"), + (0.25, "common.loot_tables.food.wild_ingredients"), + (0.1, "common.loot_tables.food.prepared"), // TODO: Change consumables when they are split up later - (0.5, "common.loot_tables.consumables"), + (1.0, "common.loot_tables.consumables"), ], // this is the amount of that good the most common item represents // so basically this table balances the goods against each other (higher=less valuable) good_scaling: [ - (Potions, 0.5), // common.items.consumable.potion_minor - (Food, 3.0), // common.items.food.mushroom - (Coin, 1.0), // common.items.utility.coins - (Armor, 0.3), // common.items.armor.misc.pants.worker_blue - (Tools, 1.0), // common.items.weapons.staff.starter_staff - (Ingredients, 5.0), // common.items.crafting_ing.leather_scraps + (Potions, 0.001), // common.items.consumable.potion_minor + (Food, 2.0), // common.items.food.mushroom + (Coin, 10.0), // common.items.utility.coins + (Armor, 0.2), // common.items.armor.misc.pants.worker_blue + (Tools, 0.1), // common.items.weapons.staff.starter_staff + (Ingredients, 1.0), // common.items.crafting_ing.leather_scraps ]) diff --git a/assets/common/items/weapons/staff/orc_iron.ron b/assets/common/items/weapons/staff/orc_iron.ron index ff680c147e..8772d1be49 100644 --- a/assets/common/items/weapons/staff/orc_iron.ron +++ b/assets/common/items/weapons/staff/orc_iron.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 0.5, + power: 1.5, poise_strength: 1.0, speed: 0.8, crit_chance: 0.2638889, diff --git a/assets/common/loot_tables/consumables.ron b/assets/common/loot_tables/consumables.ron index e234582077..ca1bbe4833 100644 --- a/assets/common/loot_tables/consumables.ron +++ b/assets/common/loot_tables/consumables.ron @@ -1,8 +1,8 @@ [ // potions (1.0, Item("common.items.consumable.potion_minor")), - (0.1, Item("common.items.consumable.potion_med")), - (0.01, Item("common.items.consumable.potion_big")), + (0.5, Item("common.items.consumable.potion_med")), + (0.2, Item("common.items.consumable.potion_big")), // bombs (0.6, Item("common.items.utility.bomb")), (0.2, Item("common.items.utility.bomb_pile")), diff --git a/common/src/comp/inventory/trade_pricing.rs b/common/src/comp/inventory/trade_pricing.rs index 4d0237bc19..28a9f9fcaa 100644 --- a/common/src/comp/inventory/trade_pricing.rs +++ b/common/src/comp/inventory/trade_pricing.rs @@ -341,13 +341,12 @@ impl TradePricing { pub fn get_material(item: &str) -> (Good, f32) { if item == TradePricing::COIN_ITEM { - (Good::Coin, 1.0 / TRADE_PRICING.coin_scale) + (Good::Coin, 1.0) } else { - TRADE_PRICING - .material_cache - .get(item) - .cloned() - .unwrap_or((Good::Terrain(crate::terrain::BiomeKind::Void), 0.0)) + TRADE_PRICING.material_cache.get(item).cloned().map_or( + (Good::Terrain(crate::terrain::BiomeKind::Void), 0.0), + |(a, b)| (a, b * TRADE_PRICING.coin_scale), + ) } }