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.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"),

View File

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

View File

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

View File

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

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
(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")),

View File

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

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

View File

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

View File

@ -635,7 +635,7 @@ impl Item {
SpriteKind::Crate => {
chosen = Lottery::<LootSpec>::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));

View File

@ -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",
},