Made item prices sane.

This commit is contained in:
Sam 2021-04-01 20:06:28 -04:00
parent 7eb1eefa13
commit c8b8cd436e
4 changed files with 19 additions and 20 deletions

View File

@ -25,21 +25,21 @@ loot_tables: [
(0.125, "common.loot_tables.armor.cultist"), (0.125, "common.loot_tables.armor.cultist"),
// Materials // Materials
(7.5, "common.loot_tables.materials.common"), (7.5, "common.loot_tables.materials.common"),
(2.0, "common.loot_tables.materials.underground"), (5.0, "common.loot_tables.materials.underground"),
// Food // Food
(6.0, "common.loot_tables.food.farm_ingredients"), (0.5, "common.loot_tables.food.farm_ingredients"),
(2.5, "common.loot_tables.food.wild_ingredients"), (0.25, "common.loot_tables.food.wild_ingredients"),
(0.8, "common.loot_tables.food.prepared"), (0.1, "common.loot_tables.food.prepared"),
// TODO: Change consumables when they are split up later // 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 // 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) // so basically this table balances the goods against each other (higher=less valuable)
good_scaling: [ good_scaling: [
(Potions, 0.5), // common.items.consumable.potion_minor (Potions, 0.001), // common.items.consumable.potion_minor
(Food, 3.0), // common.items.food.mushroom (Food, 2.0), // common.items.food.mushroom
(Coin, 1.0), // common.items.utility.coins (Coin, 10.0), // common.items.utility.coins
(Armor, 0.3), // common.items.armor.misc.pants.worker_blue (Armor, 0.2), // common.items.armor.misc.pants.worker_blue
(Tools, 1.0), // common.items.weapons.staff.starter_staff (Tools, 0.1), // common.items.weapons.staff.starter_staff
(Ingredients, 5.0), // common.items.crafting_ing.leather_scraps (Ingredients, 1.0), // common.items.crafting_ing.leather_scraps
]) ])

View File

@ -6,7 +6,7 @@ ItemDef(
hands: Two, hands: Two,
stats: Direct(( stats: Direct((
equip_time_secs: 0.3, equip_time_secs: 0.3,
power: 0.5, power: 1.5,
poise_strength: 1.0, poise_strength: 1.0,
speed: 0.8, speed: 0.8,
crit_chance: 0.2638889, crit_chance: 0.2638889,

View File

@ -1,8 +1,8 @@
[ [
// potions // potions
(1.0, Item("common.items.consumable.potion_minor")), (1.0, Item("common.items.consumable.potion_minor")),
(0.1, Item("common.items.consumable.potion_med")), (0.5, Item("common.items.consumable.potion_med")),
(0.01, Item("common.items.consumable.potion_big")), (0.2, Item("common.items.consumable.potion_big")),
// bombs // bombs
(0.6, Item("common.items.utility.bomb")), (0.6, Item("common.items.utility.bomb")),
(0.2, Item("common.items.utility.bomb_pile")), (0.2, Item("common.items.utility.bomb_pile")),

View File

@ -341,13 +341,12 @@ impl TradePricing {
pub fn get_material(item: &str) -> (Good, f32) { pub fn get_material(item: &str) -> (Good, f32) {
if item == TradePricing::COIN_ITEM { if item == TradePricing::COIN_ITEM {
(Good::Coin, 1.0 / TRADE_PRICING.coin_scale) (Good::Coin, 1.0)
} else { } else {
TRADE_PRICING TRADE_PRICING.material_cache.get(item).cloned().map_or(
.material_cache (Good::Terrain(crate::terrain::BiomeKind::Void), 0.0),
.get(item) |(a, b)| (a, b * TRADE_PRICING.coin_scale),
.cloned() )
.unwrap_or((Good::Terrain(crate::terrain::BiomeKind::Void), 0.0))
} }
} }