diff --git a/assets/common/item_price_calculation.ron b/assets/common/item_price_calculation.ron index f55174991b..3a2deb1508 100644 --- a/assets/common/item_price_calculation.ron +++ b/assets/common/item_price_calculation.ron @@ -10,7 +10,6 @@ loot_tables: [ (0.05,"common.loot_tables.crafting"), (0.005,"common.loot_tables.cultists"), (1,"common.loot_tables.fish"), - (1,"common.loot_tables.food"), (0.1,"common.loot_tables.humanoids"), (1,"common.loot_tables.maneater"), (0.0001,"common.loot_tables.mindflayer"), diff --git a/assets/common/loot_tables/cave_large.ron b/assets/common/loot_tables/cave_large.ron index 0ac25c0511..7121ba23c1 100644 --- a/assets/common/loot_tables/cave_large.ron +++ b/assets/common/loot_tables/cave_large.ron @@ -1,8 +1,7 @@ [ // Misc (0.25, Item("common.items.armor.misc.neck.plain_1")), - (2.0, Item("common.items.crafting_ing.cloth_scraps")), - (1.0, Item("common.items.crafting_ing.empty_vial")), + (3.0, LootTable("common.loot_tables.materials.common")), (0.1, Item("common.items.glider.glider_blue")), (0.05, Item("common.items.glider.glider_morpho")), (0.05, Item("common.items.glider.glider_monarch")), diff --git a/assets/common/loot_tables/crafting.ron b/assets/common/loot_tables/crafting.ron index d66fb70e63..9824e55f52 100644 --- a/assets/common/loot_tables/crafting.ron +++ b/assets/common/loot_tables/crafting.ron @@ -1,8 +1,5 @@ [ // crafting ingredients - (2.0, Item("common.items.crafting_ing.leather_scraps")), - (4.0, Item("common.items.crafting_ing.cloth_scraps")), - (1.0, Item("common.items.crafting_ing.empty_vial")), (0.5, Item("common.items.crafting_ing.amethyst")), (0.5, Item("common.items.crafting_ing.topaz")), (0.4, Item("common.items.crafting_ing.sapphire")), diff --git a/assets/common/loot_tables/cultists.ron b/assets/common/loot_tables/cultists.ron index 024cd41bfd..48d7236a67 100644 --- a/assets/common/loot_tables/cultists.ron +++ b/assets/common/loot_tables/cultists.ron @@ -1,13 +1,7 @@ [ - (3.0, Item("common.items.food.cheese")), - (3.0, Item("common.items.food.apple")), - (3.0, Item("common.items.food.mushroom")), - (3.0, Item("common.items.food.coconut")), - (5.0, Item("common.items.crafting_ing.cloth_scraps")), - (0.5, Item("common.items.food.apple_mushroom_curry")), - (0.5, Item("common.items.food.apple_stick")), - (0.5, Item("common.items.food.mushroom_stick")), - (4.0, Item("common.items.crafting_ing.empty_vial")), + (4.0, LootTable("common.loot_tables.materials.common")), + (3.0, LootTable("common.loot_tables.food.wild_ingredients")), + (2.0, LootTable("common.loot_tables.food.prepared")), (0.25, Item("common.items.armor.misc.neck.plain_1")), (0.1, Item("common.items.glider.glider_blue")), (0.5, Item("common.items.utility.firework_purple")), diff --git a/assets/common/loot_tables/food.ron b/assets/common/loot_tables/food.ron deleted file mode 100644 index 1d631f5cef..0000000000 --- a/assets/common/loot_tables/food.ron +++ /dev/null @@ -1,14 +0,0 @@ -[ - // simple - (3.0, Item("common.items.food.cheese")), - (3.0, Item("common.items.food.apple")), - (3.0, Item("common.items.food.mushroom")), - (1.0, Item("common.items.food.coconut")), - (1.0, Item("common.items.food.lettuce")), - (1.0, Item("common.items.food.tomato")), - (2.0, Item("common.items.food.carrot")), - // crafted - (0.05, Item("common.items.food.apple_mushroom_curry")), - (0.1, Item("common.items.food.apple_stick")), - (0.1, Item("common.items.food.mushroom_stick")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/food/farm_ingredients.ron b/assets/common/loot_tables/food/farm_ingredients.ron new file mode 100644 index 0000000000..f5bef72a54 --- /dev/null +++ b/assets/common/loot_tables/food/farm_ingredients.ron @@ -0,0 +1,7 @@ +[ + (1.0, Item("common.items.food.apple")), + (1.0, Item("common.items.food.carrot")), + (1.0, Item("common.items.food.cheese")), + (1.0, Item("common.items.food.lettuce")), + (1.0, Item("common.items.food.tomato")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/food/prepared.ron b/assets/common/loot_tables/food/prepared.ron new file mode 100644 index 0000000000..49d72e39ed --- /dev/null +++ b/assets/common/loot_tables/food/prepared.ron @@ -0,0 +1,9 @@ +[ + (0.2, Item("common.items.food.apple_mushroom_curry")), + (1.0, Item("common.items.food.apple_stick")), + (2.0, Item("common.items.food.cheese")), + (1.0, Item("common.items.food.mushroom_stick")), + (1.0, Item("common.items.food.plainsalad")), + (1.0, Item("common.items.food.sunflower_icetea")), + (1.0, Item("common.items.food.tomatosalad")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/food/wild_ingredients.ron b/assets/common/loot_tables/food/wild_ingredients.ron new file mode 100644 index 0000000000..614e33bcf0 --- /dev/null +++ b/assets/common/loot_tables/food/wild_ingredients.ron @@ -0,0 +1,6 @@ +[ + (1.0, Item("common.items.food.apple")), + (1.0, Item("common.items.food.cheese")), + (1.0, Item("common.items.food.coconut")), + (1.0, Item("common.items.food.mushroom")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/humanoids.ron b/assets/common/loot_tables/humanoids.ron index 8e7cb1da97..cbdd57df82 100644 --- a/assets/common/loot_tables/humanoids.ron +++ b/assets/common/loot_tables/humanoids.ron @@ -1,8 +1,6 @@ [ // Crafting Ingredients - (2.0, Item("common.items.crafting_ing.empty_vial")), - (0.1, Item("common.items.crafting_ing.diamond")), - (4.0, Item("common.items.crafting_ing.cloth_scraps")), + (5.0, LootTable("common.loot_tables.materials.common")), // Consumables (0.2, Item("common.items.consumable.potion_minor")), // Ring @@ -10,10 +8,8 @@ // Utility (0.05, Item("common.items.utility.collar")), // Food - (1.0, Item("common.items.food.coconut")), - (0.05, Item("common.items.food.apple_mushroom_curry")), - (0.1, Item("common.items.food.apple_stick")), - (0.1, Item("common.items.food.mushroom_stick")), + (1.0, LootTable("common.loot_tables.food.wild_ingredients")), + (0.25, LootTable("common.loot_tables.food.prepared")), // Weapons (0.5, LootTable("common.loot_tables.sword.wood")), (0.5, LootTable("common.loot_tables.hammer.stone")), diff --git a/assets/common/loot_tables/maneater.ron b/assets/common/loot_tables/maneater.ron index 0e7d5ff5b0..f1ac20be7e 100644 --- a/assets/common/loot_tables/maneater.ron +++ b/assets/common/loot_tables/maneater.ron @@ -1,5 +1,5 @@ [ (1.0, Item("common.items.flowers.red")), (1.0, Item("common.items.crafting_ing.twigs")), - (0.5, Item("common.items.food.coconut")), + (1.0, LootTable("common.loot_tables.food.wild_ingredients")), ] \ No newline at end of file diff --git a/assets/common/loot_tables/materials/common.ron b/assets/common/loot_tables/materials/common.ron new file mode 100644 index 0000000000..ec557fe1b9 --- /dev/null +++ b/assets/common/loot_tables/materials/common.ron @@ -0,0 +1,6 @@ +[ + (1.0, Item("common.items.crafting_ing.bowl")), + (1.0, Item("common.items.crafting_ing.empty_vial")), + (2.0, Item("common.items.crafting_ing.cloth_scraps")), + (1.0, Item("common.items.crafting_ing.leather_scraps")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/saurok.ron b/assets/common/loot_tables/saurok.ron index d338fd6f9d..8dc9d108af 100644 --- a/assets/common/loot_tables/saurok.ron +++ b/assets/common/loot_tables/saurok.ron @@ -1,8 +1,5 @@ [ - (2.0, Item("common.items.crafting_ing.empty_vial")), - (0.01, Item("common.items.crafting_ing.diamond")), - (3.0, Item("common.items.crafting_ing.cloth_scraps")), - (2.0, Item("common.items.crafting_ing.leather_scraps")), + (7.0, LootTable("common.loot_tables.materials.common")), // Consumables (0.5, Item("common.items.consumable.potion_minor")), // Ring @@ -12,8 +9,6 @@ // Bag (0.1, Item("common.items.armor.misc.bag.liana_kit")), // Food - (2.0, Item("common.items.food.coconut")), - (0.3, Item("common.items.food.apple_mushroom_curry")), - (0.6, Item("common.items.food.apple_stick")), - (0.8, Item("common.items.food.mushroom_stick")), + (2.0, LootTable("common.loot_tables.food.wild_ingredients")), + (1.5, LootTable("common.loot_tables.food.prepared")), ] \ No newline at end of file diff --git a/assets/common/loot_tables/villager.ron b/assets/common/loot_tables/villager.ron index d6abc0c492..fb0006a182 100644 --- a/assets/common/loot_tables/villager.ron +++ b/assets/common/loot_tables/villager.ron @@ -1,9 +1,6 @@ [ // Crafting Ingredients - (2.0, Item("common.items.crafting_ing.bowl")), - (1.0, Item("common.items.crafting_ing.empty_vial")), - (0.1, Item("common.items.crafting_ing.diamond")), - (1.0, Item("common.items.crafting_ing.cloth_scraps")), + (4.0, LootTable("common.loot_tables.materials.common")), // Consumables (0.2, Item("common.items.consumable.potion_minor")), // Armour @@ -11,13 +8,8 @@ // Utility (0.05, Item("common.items.utility.collar")), // Food - (0.5, Item("common.items.food.coconut")), - (0.5, Item("common.items.food.lettuce")), - (0.75, Item("common.items.food.carrot")), - (0.75, Item("common.items.food.tomato")), - (0.05, Item("common.items.food.apple_mushroom_curry")), - (0.1, Item("common.items.food.apple_stick")), - (0.1, Item("common.items.food.mushroom_stick")), + (2.0, LootTable("common.loot_tables.food.farm_ingredients")), + (0.25, LootTable("common.loot_tables.food.prepared")), // Weapons (0.5, LootTable("common.loot_tables.sword.wood")), (0.5, LootTable("common.loot_tables.hammer.stone")), diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index 6523ce99f7..b936426ba1 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -635,7 +635,7 @@ impl Item { SpriteKind::Crate => { chosen = Lottery::::load_expect(match rng.gen_range(0..4) { 0 => "common.loot_tables.crafting", - _ => "common.loot_tables.food", + _ => "common.loot_tables.food.prepared", }) .read(); return Some(chosen.choose().to_item(None)); diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 729f572a9e..a96a240b9a 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -356,31 +356,31 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc _ => "common.loot_tables.rocks", }, _ => match rng.gen_range(0..4) { - 0 => "common.loot_tables.food", + 0 => "common.loot_tables.food.wild_ingredients", 2 => "common.loot_tables.wild_animal", _ => "common.loot_tables.wild_animal", }, } }, Some(common::comp::Body::QuadrupedMedium(_)) => match rng.gen_range(0..4) { - 0 => "common.loot_tables.food", + 0 => "common.loot_tables.food.wild_ingredients", _ => "common.loot_tables.wild_animal", }, Some(common::comp::Body::BirdMedium(_)) => match rng.gen_range(0..3) { - 0 => "common.loot_tables.food", + 0 => "common.loot_tables.food.wild_ingredients", _ => "common.loot_tables.fallback", }, Some(common::comp::Body::FishMedium(_)) => "common.loot_tables.fish", Some(common::comp::Body::FishSmall(_)) => "common.loot_tables.fish", Some(common::comp::Body::BipedLarge(biped_large)) => match biped_large.species { biped_large::Species::Wendigo => match rng.gen_range(0..7) { - 0 => "common.loot_tables.food", + 0 => "common.loot_tables.food.prepared", 1 => "common.loot_tables.wild_animal", 2 => "common.loot_tables.weapons.tier-2", _ => "common.loot_tables.cave_large", }, biped_large::Species::Troll => match rng.gen_range(0..8) { - 0 => "common.loot_tables.food", + 0 => "common.loot_tables.food.prepared", 1 => "common.loot_tables.cave_large", 2 => "common.loot_tables.weapons.tier-2", _ => "common.loot_tables.wild_animal", @@ -389,12 +389,12 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc | biped_large::Species::Mightysaurok | biped_large::Species::Slysaurok => "common.loot_tables.saurok", _ => match rng.gen_range(0..3) { - 0 => "common.loot_tables.food", + 0 => "common.loot_tables.food.prepared", _ => "common.loot_tables.cave_large", }, }, Some(common::comp::Body::Golem(_)) => match rng.gen_range(0..5) { - 0 => "common.loot_tables.food", + 0 => "common.loot_tables.food.prepared", 1 => "common.loot_tables.armor.steel", 2 => "common.loot_tables.weapons.tier-1", 3 => "common.loot_tables.weapons.tier-2", @@ -407,7 +407,7 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc match quadruped_low.species { quadruped_low::Species::Maneater => "common.loot_tables.maneater", _ => match rng.gen_range(0..3) { - 0 => "common.loot_tables.food", + 0 => "common.loot_tables.food.wild_ingredients", 1 => "common.loot_tables.wild_animal", _ => "common.loot_tables.fallback", },