Moved food items into their own loot tables.

This commit is contained in:
Sam 2021-04-01 14:48:36 -04:00
parent 31e69021cb
commit cb638180f8
15 changed files with 51 additions and 65 deletions

View File

@ -10,7 +10,6 @@ loot_tables: [
(0.05,"common.loot_tables.crafting"), (0.05,"common.loot_tables.crafting"),
(0.005,"common.loot_tables.cultists"), (0.005,"common.loot_tables.cultists"),
(1,"common.loot_tables.fish"), (1,"common.loot_tables.fish"),
(1,"common.loot_tables.food"),
(0.1,"common.loot_tables.humanoids"), (0.1,"common.loot_tables.humanoids"),
(1,"common.loot_tables.maneater"), (1,"common.loot_tables.maneater"),
(0.0001,"common.loot_tables.mindflayer"), (0.0001,"common.loot_tables.mindflayer"),

View File

@ -1,8 +1,7 @@
[ [
// Misc // Misc
(0.25, Item("common.items.armor.misc.neck.plain_1")), (0.25, Item("common.items.armor.misc.neck.plain_1")),
(2.0, Item("common.items.crafting_ing.cloth_scraps")), (3.0, LootTable("common.loot_tables.materials.common")),
(1.0, Item("common.items.crafting_ing.empty_vial")),
(0.1, Item("common.items.glider.glider_blue")), (0.1, Item("common.items.glider.glider_blue")),
(0.05, Item("common.items.glider.glider_morpho")), (0.05, Item("common.items.glider.glider_morpho")),
(0.05, Item("common.items.glider.glider_monarch")), (0.05, Item("common.items.glider.glider_monarch")),

View File

@ -1,8 +1,5 @@
[ [
// crafting ingredients // 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.amethyst")),
(0.5, Item("common.items.crafting_ing.topaz")), (0.5, Item("common.items.crafting_ing.topaz")),
(0.4, Item("common.items.crafting_ing.sapphire")), (0.4, Item("common.items.crafting_ing.sapphire")),

View File

@ -1,13 +1,7 @@
[ [
(3.0, Item("common.items.food.cheese")), (4.0, LootTable("common.loot_tables.materials.common")),
(3.0, Item("common.items.food.apple")), (3.0, LootTable("common.loot_tables.food.wild_ingredients")),
(3.0, Item("common.items.food.mushroom")), (2.0, LootTable("common.loot_tables.food.prepared")),
(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")),
(0.25, Item("common.items.armor.misc.neck.plain_1")), (0.25, Item("common.items.armor.misc.neck.plain_1")),
(0.1, Item("common.items.glider.glider_blue")), (0.1, Item("common.items.glider.glider_blue")),
(0.5, Item("common.items.utility.firework_purple")), (0.5, Item("common.items.utility.firework_purple")),

View File

@ -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")),
]

View File

@ -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")),
]

View File

@ -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")),
]

View File

@ -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")),
]

View File

@ -1,8 +1,6 @@
[ [
// Crafting Ingredients // Crafting Ingredients
(2.0, Item("common.items.crafting_ing.empty_vial")), (5.0, LootTable("common.loot_tables.materials.common")),
(0.1, Item("common.items.crafting_ing.diamond")),
(4.0, Item("common.items.crafting_ing.cloth_scraps")),
// Consumables // Consumables
(0.2, Item("common.items.consumable.potion_minor")), (0.2, Item("common.items.consumable.potion_minor")),
// Ring // Ring
@ -10,10 +8,8 @@
// Utility // Utility
(0.05, Item("common.items.utility.collar")), (0.05, Item("common.items.utility.collar")),
// Food // Food
(1.0, Item("common.items.food.coconut")), (1.0, LootTable("common.loot_tables.food.wild_ingredients")),
(0.05, Item("common.items.food.apple_mushroom_curry")), (0.25, LootTable("common.loot_tables.food.prepared")),
(0.1, Item("common.items.food.apple_stick")),
(0.1, Item("common.items.food.mushroom_stick")),
// Weapons // Weapons
(0.5, LootTable("common.loot_tables.sword.wood")), (0.5, LootTable("common.loot_tables.sword.wood")),
(0.5, LootTable("common.loot_tables.hammer.stone")), (0.5, LootTable("common.loot_tables.hammer.stone")),

View File

@ -1,5 +1,5 @@
[ [
(1.0, Item("common.items.flowers.red")), (1.0, Item("common.items.flowers.red")),
(1.0, Item("common.items.crafting_ing.twigs")), (1.0, Item("common.items.crafting_ing.twigs")),
(0.5, Item("common.items.food.coconut")), (1.0, LootTable("common.loot_tables.food.wild_ingredients")),
] ]

View File

@ -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")),
]

View File

@ -1,8 +1,5 @@
[ [
(2.0, Item("common.items.crafting_ing.empty_vial")), (7.0, LootTable("common.loot_tables.materials.common")),
(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")),
// Consumables // Consumables
(0.5, Item("common.items.consumable.potion_minor")), (0.5, Item("common.items.consumable.potion_minor")),
// Ring // Ring
@ -12,8 +9,6 @@
// Bag // Bag
(0.1, Item("common.items.armor.misc.bag.liana_kit")), (0.1, Item("common.items.armor.misc.bag.liana_kit")),
// Food // Food
(2.0, Item("common.items.food.coconut")), (2.0, LootTable("common.loot_tables.food.wild_ingredients")),
(0.3, Item("common.items.food.apple_mushroom_curry")), (1.5, LootTable("common.loot_tables.food.prepared")),
(0.6, Item("common.items.food.apple_stick")),
(0.8, Item("common.items.food.mushroom_stick")),
] ]

View File

@ -1,9 +1,6 @@
[ [
// Crafting Ingredients // Crafting Ingredients
(2.0, Item("common.items.crafting_ing.bowl")), (4.0, LootTable("common.loot_tables.materials.common")),
(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")),
// Consumables // Consumables
(0.2, Item("common.items.consumable.potion_minor")), (0.2, Item("common.items.consumable.potion_minor")),
// Armour // Armour
@ -11,13 +8,8 @@
// Utility // Utility
(0.05, Item("common.items.utility.collar")), (0.05, Item("common.items.utility.collar")),
// Food // Food
(0.5, Item("common.items.food.coconut")), (2.0, LootTable("common.loot_tables.food.farm_ingredients")),
(0.5, Item("common.items.food.lettuce")), (0.25, LootTable("common.loot_tables.food.prepared")),
(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")),
// Weapons // Weapons
(0.5, LootTable("common.loot_tables.sword.wood")), (0.5, LootTable("common.loot_tables.sword.wood")),
(0.5, LootTable("common.loot_tables.hammer.stone")), (0.5, LootTable("common.loot_tables.hammer.stone")),

View File

@ -635,7 +635,7 @@ impl Item {
SpriteKind::Crate => { SpriteKind::Crate => {
chosen = Lottery::<LootSpec>::load_expect(match rng.gen_range(0..4) { chosen = Lottery::<LootSpec>::load_expect(match rng.gen_range(0..4) {
0 => "common.loot_tables.crafting", 0 => "common.loot_tables.crafting",
_ => "common.loot_tables.food", _ => "common.loot_tables.food.prepared",
}) })
.read(); .read();
return Some(chosen.choose().to_item(None)); return Some(chosen.choose().to_item(None));

View File

@ -356,31 +356,31 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc
_ => "common.loot_tables.rocks", _ => "common.loot_tables.rocks",
}, },
_ => match rng.gen_range(0..4) { _ => match rng.gen_range(0..4) {
0 => "common.loot_tables.food", 0 => "common.loot_tables.food.wild_ingredients",
2 => "common.loot_tables.wild_animal", 2 => "common.loot_tables.wild_animal",
_ => "common.loot_tables.wild_animal", _ => "common.loot_tables.wild_animal",
}, },
} }
}, },
Some(common::comp::Body::QuadrupedMedium(_)) => match rng.gen_range(0..4) { 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", _ => "common.loot_tables.wild_animal",
}, },
Some(common::comp::Body::BirdMedium(_)) => match rng.gen_range(0..3) { 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", _ => "common.loot_tables.fallback",
}, },
Some(common::comp::Body::FishMedium(_)) => "common.loot_tables.fish", Some(common::comp::Body::FishMedium(_)) => "common.loot_tables.fish",
Some(common::comp::Body::FishSmall(_)) => "common.loot_tables.fish", Some(common::comp::Body::FishSmall(_)) => "common.loot_tables.fish",
Some(common::comp::Body::BipedLarge(biped_large)) => match biped_large.species { Some(common::comp::Body::BipedLarge(biped_large)) => match biped_large.species {
biped_large::Species::Wendigo => match rng.gen_range(0..7) { 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", 1 => "common.loot_tables.wild_animal",
2 => "common.loot_tables.weapons.tier-2", 2 => "common.loot_tables.weapons.tier-2",
_ => "common.loot_tables.cave_large", _ => "common.loot_tables.cave_large",
}, },
biped_large::Species::Troll => match rng.gen_range(0..8) { 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", 1 => "common.loot_tables.cave_large",
2 => "common.loot_tables.weapons.tier-2", 2 => "common.loot_tables.weapons.tier-2",
_ => "common.loot_tables.wild_animal", _ => "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::Mightysaurok
| biped_large::Species::Slysaurok => "common.loot_tables.saurok", | biped_large::Species::Slysaurok => "common.loot_tables.saurok",
_ => match rng.gen_range(0..3) { _ => match rng.gen_range(0..3) {
0 => "common.loot_tables.food", 0 => "common.loot_tables.food.prepared",
_ => "common.loot_tables.cave_large", _ => "common.loot_tables.cave_large",
}, },
}, },
Some(common::comp::Body::Golem(_)) => match rng.gen_range(0..5) { 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", 1 => "common.loot_tables.armor.steel",
2 => "common.loot_tables.weapons.tier-1", 2 => "common.loot_tables.weapons.tier-1",
3 => "common.loot_tables.weapons.tier-2", 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 { match quadruped_low.species {
quadruped_low::Species::Maneater => "common.loot_tables.maneater", quadruped_low::Species::Maneater => "common.loot_tables.maneater",
_ => match rng.gen_range(0..3) { _ => match rng.gen_range(0..3) {
0 => "common.loot_tables.food", 0 => "common.loot_tables.food.wild_ingredients",
1 => "common.loot_tables.wild_animal", 1 => "common.loot_tables.wild_animal",
_ => "common.loot_tables.fallback", _ => "common.loot_tables.fallback",
}, },