Merge branch 'loot-table-balance' into 'master'

Loot table balance

See merge request veloren/veloren!4373
This commit is contained in:
crabman 2024-03-18 21:11:49 +00:00
commit 6a76028472
75 changed files with 373 additions and 244 deletions

View File

@ -6,7 +6,7 @@
body_type: Female,
))),
alignment: Alignment(Enemy),
loot: LootTable("common.loot_tables.creature.quad_medium.ice"),
loot: LootTable("common.loot_tables.creature.quad_medium.roshwalr"),
inventory: (
loadout: FromBody,
),

View File

@ -3,7 +3,7 @@
name: Automatic,
body: RandomWith("tarasque"),
alignment: Alignment(Enemy),
loot: LootTable("common.loot_tables.creature.quad_medium.carapace"),
loot: LootTable("common.loot_tables.creature.quad_medium.tarasque"),
inventory: (
loadout: FromBody,
),

View File

@ -3,7 +3,7 @@
name: Automatic,
body: RandomWith("hirdrasil"),
alignment: Alignment(Wild),
loot: LootTable("common.loot_tables.creature.quad_medium.gentle"),
loot: LootTable("common.loot_tables.creature.quad_medium.hirdrasil"),
inventory: (
loadout: FromBody,
),

View File

@ -3,7 +3,7 @@
name: Automatic,
body: RandomWith("moose"),
alignment: Alignment(Wild),
loot: LootTable("common.loot_tables.creature.quad_medium.generic"),
loot: LootTable("common.loot_tables.creature.quad_medium.moose"),
inventory: (
loadout: FromBody,
),

View File

@ -5,5 +5,4 @@
(0.1, Item("common.items.lantern.geode_purp")),
// Weapons
(2.0, LootTable("common.loot_tables.weapons.components.tier-3")),
(0.05, LootTable("common.loot_tables.weapons.cave")),
]

View File

@ -1,4 +1,7 @@
[
(1.5, MultiDrop(Item("common.items.crafting_ing.hide.carapace"), 2, 5)),
(1.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.strong_pincer"), 1, 2)),
(1, All([
MultiDrop(Item("common.items.crafting_ing.hide.carapace"), 5, 8),
MultiDrop(Item("common.items.crafting_ing.animal_misc.strong_pincer"), 1, 2),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(2.0, MultiDrop(Item("common.items.crafting_ing.sticky_thread"), 2, 5)),
(1.0, Item("common.items.crafting_ing.animal_misc.venom_sac")),
(1.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.strong_pincer"), 1, 2)),
(1, All([
MultiDrop(Item("common.items.crafting_ing.sticky_thread"), 3, 7),
MultiDrop(Item("common.items.crafting_ing.animal_misc.venom_sac"), 3, 5),
MultiDrop(Item("common.items.crafting_ing.animal_misc.strong_pincer"), 1, 2),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(1.0, MultiDrop(Item("common.items.crafting_ing.hide.carapace"), 1, 3)),
(1.0, Item("common.items.crafting_ing.animal_misc.strong_pincer")),
(1, All([
MultiDrop(Item("common.items.crafting_ing.hide.carapace"), 4, 8),
MultiDrop(Item("common.items.crafting_ing.animal_misc.strong_pincer"), 1, 2),
],
)),
]

View File

@ -1,6 +1,8 @@
[
(1.0, MultiDrop(Item("common.items.crafting_ing.sticky_thread"), 1, 3)),
(0.5, MultiDrop(Item("common.items.crafting_ing.animal_misc.viscous_ooze"), 1, 1)),
(1.0, Item("common.items.crafting_ing.living_embers")),
(1, All([
MultiDrop(Item("common.items.crafting_ing.sticky_thread"), 3, 5),
MultiDrop(Item("common.items.crafting_ing.animal_misc.viscous_ooze"), 0, 4),
MultiDrop(Item("common.items.crafting_ing.living_embers"), 2, 4),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(2.0, MultiDrop(Item("common.items.flowers.plant_fiber"), 1, 3)),
(1.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.viscous_ooze"), 1, 1)),
(1, All([
MultiDrop(Item("common.items.flowers.plant_fiber"), 2, 4),
MultiDrop(Item("common.items.crafting_ing.animal_misc.viscous_ooze"), 1, 3),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(1.0, MultiDrop(Item("common.items.flowers.plant_fiber"), 1, 3)),
(1.0, Item("common.items.crafting_ing.animal_misc.strong_pincer")),
(0.5, MultiDrop(Item("common.items.crafting_ing.animal_misc.viscous_ooze"), 1, 1)),
(1, All([
MultiDrop(Item("common.items.flowers.plant_fiber"), 2, 4),
MultiDrop(Item("common.items.crafting_ing.animal_misc.strong_pincer"), 0, 2),
MultiDrop(Item("common.items.crafting_ing.animal_misc.viscous_ooze"), 1, 3),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(1.0, MultiDrop(Item("common.items.crafting_ing.sticky_thread"), 1, 3)),
(0.5, MultiDrop(Item("common.items.crafting_ing.animal_misc.viscous_ooze"), 1, 1)),
(1, All([
MultiDrop(Item("common.items.crafting_ing.sticky_thread"), 3, 5),
MultiDrop(Item("common.items.crafting_ing.animal_misc.viscous_ooze"), 0, 4),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(1.0, MultiDrop(Item("common.items.crafting_ing.sticky_thread"), 2, 5)),
(1.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.strong_pincer"), 1, 2)),
(1, All([
MultiDrop(Item("common.items.crafting_ing.sticky_thread"), 3, 7),
MultiDrop(Item("common.items.crafting_ing.animal_misc.strong_pincer"), 1, 2),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(1.0, MultiDrop(Item("common.items.crafting_ing.sticky_thread"), 1, 3)),
(1.0, Item("common.items.crafting_ing.animal_misc.strong_pincer")),
(1, All([
MultiDrop(Item("common.items.crafting_ing.sticky_thread"), 2, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.strong_pincer"), 0, 2),
],
)),
]

View File

@ -1,5 +1,11 @@
[
(1.0, LootTable("common.loot_tables.food.prepared")),
(2.0, LootTable("common.loot_tables.cave_large")),
(0.4, Item("common.items.glider.morpho")),
(1, All([
MultiDrop(LootTable("common.loot_tables.food.prepared"), 1, 3),
MultiDrop(LootTable("common.loot_tables.cave_large"), 2, 3),
Lottery([
(0.2, Item("common.items.glider.morpho")),
(1.8, Nothing),
]),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(1.0, LootTable("common.loot_tables.food.prepared")),
(2.0, LootTable("common.loot_tables.cave_large")),
(1, All([
MultiDrop(LootTable("common.loot_tables.food.prepared"), 1, 3),
MultiDrop(LootTable("common.loot_tables.cave_large"), 2, 3),
],
)),
]

View File

@ -1,5 +1,11 @@
[
(1.0, LootTable("common.loot_tables.food.prepared")),
(2.0, LootTable("common.loot_tables.cave_large")),
(0.4, Item("common.items.glider.monarch")),
(1, All([
MultiDrop(LootTable("common.loot_tables.food.prepared"), 1, 3),
MultiDrop(LootTable("common.loot_tables.cave_large"), 2, 3),
Lottery([
(0.2, Item("common.items.glider.monarch")),
(1.8, Nothing),
]),
],
)),
]

View File

@ -1,6 +1,8 @@
[
(1.0, LootTable("common.loot_tables.food.prepared")),
(1.0, LootTable("common.loot_tables.cave_large")),
(1.0, LootTable("common.loot_tables.weapons.components.tier-2")),
(5.0, Item("common.items.crafting_ing.hide.leather_troll")),
(1, All([
MultiDrop(LootTable("common.loot_tables.food.prepared"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.hide.leather_troll"), 3, 5),
MultiDrop(LootTable("common.loot_tables.cave_large"), 2, 3),
],
)),
]

View File

@ -1,8 +1,8 @@
[
(1, All([
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 2, 4),
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 0, 2),
MultiDrop(Item("common.items.crafting_ing.animal_misc.long_tusk"), 0, 2),
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 3, 4),
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 3, 5),
MultiDrop(Item("common.items.crafting_ing.animal_misc.long_tusk"), 1, 2),
],
)),
]

View File

@ -1,6 +1,8 @@
[
(1.0, LootTable("common.loot_tables.food.prepared")),
(1.0, Item("common.items.crafting_ing.animal_misc.icy_fang")),
(1.0, LootTable("common.loot_tables.weapons.components.tier-2")),
(4.0, LootTable("common.loot_tables.cave_large")),
(1, All([
MultiDrop(LootTable("common.loot_tables.food.prepared"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.icy_fang"), 2, 4),
MultiDrop(LootTable("common.loot_tables.cave_large"), 2, 3),
],
)),
]

View File

@ -1,4 +1,4 @@
[
(2.0, Item("common.items.flowers.plant_fiber")),
(2.0, MultiDrop(Item("common.items.flowers.plant_fiber"), 1, 2)),
(1.0, Item("common.items.crafting_ing.sentient_seed")),
]

View File

@ -2,9 +2,9 @@
(1, All([
MultiDrop(Item("common.items.mineral.gem.topaz"), 1, 1),
MultiDrop(Item("common.items.mineral.gem.amethyst"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.elegant_crest"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.elegant_crest"), 4, 10),
MultiDrop(Item("common.items.crafting_ing.animal_misc.claw"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.hide.dragon_scale"), 2, 6),
MultiDrop(Item("common.items.crafting_ing.hide.dragon_scale"), 8, 12),
],
)),
]

View File

@ -1,6 +1,9 @@
[
(1.0, MultiDrop(Item("common.items.food.meat.bird_large_raw"), 1, 2)),
(1.0, MultiDrop(Item("common.items.food.meat.beast_large_raw"), 2, 2)),
(2.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.elegant_crest"), 1, 3)),
(1.0, MultiDrop(Item("common.items.crafting_ing.hide.scales"), 2, 6)),
(1, All([
MultiDrop(Item("common.items.food.meat.bird_large_raw"), 2, 4),
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.elegant_crest"), 5, 7),
MultiDrop(Item("common.items.crafting_ing.hide.scales"), 3, 7),
],
)),
]

View File

@ -4,7 +4,7 @@
MultiDrop(Item("common.items.mineral.gem.ruby"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.sharp_fang"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.hide.dragon_scale"), 2, 6),
MultiDrop(Item("common.items.crafting_ing.hide.dragon_scale"), 8, 12),
],
)),
]

View File

@ -4,7 +4,7 @@
MultiDrop(Item("common.items.mineral.gem.diamond"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.claw"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.hide.dragon_scale"), 2, 6),
MultiDrop(Item("common.items.crafting_ing.hide.dragon_scale"), 8, 12),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(1.0, MultiDrop(Item("common.items.food.meat.bird_large_raw"), 1, 2)),
(1.0, MultiDrop(Item("common.items.food.meat.beast_large_raw"), 2, 2)),
(2.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.elegant_crest"), 1, 3)),
(1, All([
MultiDrop(Item("common.items.food.meat.bird_large_raw"), 4, 8),
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 4, 8),
MultiDrop(Item("common.items.crafting_ing.animal_misc.elegant_crest"), 6, 12),
],
)),
]

View File

@ -4,7 +4,7 @@
MultiDrop(Item("common.items.mineral.gem.sapphire"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.sharp_fang"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.claw"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.hide.dragon_scale"), 2, 6),
MultiDrop(Item("common.items.crafting_ing.hide.dragon_scale"), 8, 12),
],
)),
]

View File

@ -2,9 +2,9 @@
(1, All([
MultiDrop(Item("common.items.mineral.gem.topaz"), 1, 1),
MultiDrop(Item("common.items.mineral.gem.emerald"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.elegant_crest"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.elegant_crest"), 3, 8),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.hide.dragon_scale"), 2, 6),
MultiDrop(Item("common.items.crafting_ing.hide.dragon_scale"), 8, 12),
],
)),
]

View File

@ -1,8 +1,8 @@
[
(1, All([
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 2, 4),
MultiDrop(Item("common.items.crafting_ing.hide.plate"), 1, 2),
Item("common.items.crafting_ing.animal_misc.grim_eyeball"),
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 5, 8),
MultiDrop(Item("common.items.crafting_ing.hide.plate"), 6, 10),
MultiDrop(Item("common.items.crafting_ing.animal_misc.grim_eyeball"), 2, 2),
],
)),
]

View File

@ -1,5 +1,7 @@
[
(1.0, Item("common.items.food.meat.tough_raw")),
(3.0, Item("common.items.crafting_ing.hide.carapace")),
(1, All([
MultiDrop(Item("common.items.food.meat.tough_raw"), 4, 8),
MultiDrop(Item("common.items.crafting_ing.hide.carapace"), 4, 8),
],
)),
]

View File

@ -1,7 +1,12 @@
[
(2.0, MultiDrop(Item("common.items.log.wood"), 1, 3)),
(1.0, Item("common.items.log.hardwood")),
(2.0, Item("common.items.flowers.plant_fiber")),
(2.0, Item("common.items.crafting_ing.resin")),
(1.0, Item("common.items.crafting_ing.animal_misc.grim_eyeball")),
(1, All([
MultiDrop(Item("common.items.crafting_ing.twigs"), 2, 3),
MultiDrop(Item("common.items.log.hardwood"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.grim_eyeball"), 0, 1),
Lottery([
(0.5, MultiDrop(Item("common.items.flowers.plant_fiber"), 3, 5)),
(0.5, MultiDrop(Item("common.items.crafting_ing.resin"), 0, 3)),
]),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(1.0, Item("common.items.crafting_ing.living_embers")),
(1.0, Item("common.items.crafting_ing.hide.animal_hide")),
]
(1, All([
MultiDrop(Item("common.items.crafting_ing.living_embers"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.hide.animal_hide"), 3, 5),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(1.0, Item("common.items.crafting_ing.hide.tough_hide")),
(1.0, Item("common.items.crafting_ing.animal_misc.viscous_ooze")),
(1.0, Item("common.items.food.meat.tough_raw")),
(1, All([
MultiDrop(Item("common.items.crafting_ing.hide.tough_hide"), 3, 5),
MultiDrop(Item("common.items.crafting_ing.animal_misc.viscous_ooze"), 2, 4),
MultiDrop(Item("common.items.food.meat.tough_raw"), 3, 5),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(4.0, LootTable("common.loot_tables.creature.quad_low.generic")),
(2.0, Item("common.items.crafting_ing.animal_misc.sharp_fang")),
(1, All([
MultiDrop(LootTable("common.loot_tables.creature.quad_low.generic"), 1, 1),
MultiDrop(Item("common.items.crafting_ing.animal_misc.sharp_fang"), 2, 4),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(1.0, Item("common.items.food.meat.tough_raw")),
(3.0, Item("common.items.crafting_ing.hide.scales")),
(1, All([
MultiDrop(Item("common.items.food.meat.tough_raw"), 4, 6),
MultiDrop(Item("common.items.crafting_ing.hide.scales"), 4, 8),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(1.0, Item("common.items.food.meat.tough_raw")),
(3.0, Item("common.items.crafting_ing.hide.carapace")),
(1.0, MultiDrop(Item("common.items.crafting_ing.living_embers"), 2, 4)),
(1, All([
MultiDrop(Item("common.items.food.meat.tough_raw"), 4, 8),
MultiDrop(Item("common.items.crafting_ing.hide.carapace"), 4, 8),
MultiDrop(Item("common.items.crafting_ing.living_embers"), 5, 10),
],
)),
]

View File

@ -1,6 +1,12 @@
[
(9.0, Item("common.items.crafting_ing.animal_misc.lively_vine")),
(9.0, LootTable("common.loot_tables.food.wild_ingredients")),
(1.0, Item("common.items.armor.misc.head.bamboo_twig")),
(5.0, MultiDrop(Item("common.items.crafting_ing.sentient_seed"), 1, 3)),
(1, All([
MultiDrop(Item("common.items.crafting_ing.animal_misc.lively_vine"), 6, 10),
MultiDrop(LootTable("common.loot_tables.food.wild_ingredients"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.sentient_seed"), 3, 6),
Lottery([
(0.5, Item("common.items.armor.misc.head.bamboo_twig")),
(9.5, Nothing),
]),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(1.0, Item("common.items.crafting_ing.resin")),
(1.0, Item("common.items.log.hardwood")),
(1.0, Item("common.items.flowers.plant_fiber")),
(1, All([
MultiDrop(Item("common.items.crafting_ing.resin"), 3, 6),
MultiDrop(Item("common.items.log.ironwood"), 5, 10),
MultiDrop(Item("common.items.flowers.plant_fiber"), 4, 5),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(2.0, Item("common.items.food.meat.tough_raw")),
(3.0, Item("common.items.crafting_ing.hide.carapace")),
(1.0, Item("common.items.crafting_ing.coral_branch")),
(1, All([
MultiDrop(Item("common.items.food.meat.tough_raw"), 4, 8),
MultiDrop(Item("common.items.crafting_ing.hide.carapace"), 4, 8),
MultiDrop(Item("common.items.crafting_ing.coral_branch"), 0, 3),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(2.0, Item("common.items.food.meat.tough_raw")),
(3.0, Item("common.items.crafting_ing.hide.carapace")),
(1.0, Item("common.items.crafting_ing.animal_misc.lively_vine")),
(1, All([
MultiDrop(Item("common.items.food.meat.tough_raw"), 4, 8),
MultiDrop(Item("common.items.crafting_ing.hide.carapace"), 4, 8),
MultiDrop(Item("common.items.crafting_ing.animal_misc.lively_vine"), 0, 3),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(1.0, Item("common.items.crafting_ing.hide.tough_hide")),
(1.0, Item("common.items.food.meat.tough_raw")),
(1.0, Item("common.items.crafting_ing.living_embers")),
(1, All([
MultiDrop(Item("common.items.crafting_ing.hide.tough_hide"), 3, 5),
MultiDrop(Item("common.items.crafting_ing.living_embers"), 2, 4),
MultiDrop(Item("common.items.food.meat.tough_raw"), 3, 5),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(4.0, LootTable("common.loot_tables.creature.quad_low.generic")),
(1.0, Item("common.items.crafting_ing.animal_misc.sharp_fang")),
(2.0, Item("common.items.crafting_ing.animal_misc.venom_sac")),
(1, All([
MultiDrop(LootTable("common.loot_tables.creature.quad_low.generic"), 1, 1),
MultiDrop(Item("common.items.crafting_ing.animal_misc.sharp_fang"), 1, 2),
MultiDrop(Item("common.items.crafting_ing.animal_misc.venom_sac"), 1, 2),
],
)),
]

View File

@ -1,6 +1,8 @@
[
(1.5, Item("common.items.food.meat.beast_small_raw")),
(0.5, Item("common.items.food.meat.beast_large_raw")),
(2.0, Item("common.items.crafting_ing.animal_misc.sharp_fang")),
(3.0, Item("common.items.crafting_ing.hide.carapace")),
(1, All([
MultiDrop(Item("common.items.food.meat.beast_small_raw"), 3, 5),
MultiDrop(Item("common.items.crafting_ing.animal_misc.sharp_fang"), 1, 4),
MultiDrop(Item("common.items.crafting_ing.hide.carapace"), 2, 4),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(1.5, Item("common.items.crafting_ing.animal_misc.grim_eyeball")),
(4.0, LootTable("common.loot_tables.creature.quad_medium.generic")),
(1.0, Item("common.items.crafting_ing.hide.rugged_hide")),
(1, All([
MultiDrop(Item("common.items.crafting_ing.animal_misc.grim_eyeball"), 0, 1),
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 2, 4),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(1.0, Item("common.items.food.meat.beast_large_raw")),
(1.0, Item("common.items.crafting_ing.hide.animal_hide")),
(1, All([
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 1, 4),
MultiDrop(Item("common.items.crafting_ing.hide.animal_hide"), 2, 4),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(4.0, LootTable("common.loot_tables.creature.quad_medium.generic")),
(2.0, Item("common.items.crafting_ing.animal_misc.claw")),
(1, All([
MultiDrop(LootTable("common.loot_tables.creature.quad_medium.generic"), 2, 4),
MultiDrop(Item("common.items.crafting_ing.animal_misc.claw"), 3, 4),
],
)),
]

View File

@ -1,8 +1,8 @@
[
(1, All([
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 2, 4),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 0, 2),
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 0, 3),
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 5, 8),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 1, 2),
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 5, 8),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(4.0, LootTable("common.loot_tables.creature.quad_medium.generic")),
(2.0, Item("common.items.crafting_ing.animal_misc.sharp_fang")),
(1, All([
MultiDrop(LootTable("common.loot_tables.creature.quad_medium.generic"), 3, 4),
MultiDrop(Item("common.items.crafting_ing.animal_misc.sharp_fang"), 2, 4),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(1.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.icy_fang"), 1, 2)),
(1.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.sharp_fang"), 1, 3)),
(1.0, Item("common.items.crafting_ing.hide.tough_hide")),
(1, All([
MultiDrop(Item("common.items.crafting_ing.animal_misc.icy_fang"), 1, 4),
MultiDrop(Item("common.items.crafting_ing.animal_misc.sharp_fang"), 2, 4),
MultiDrop(Item("common.items.crafting_ing.hide.tough_hide"), 3, 4),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(1.5, Item("common.items.food.meat.beast_small_raw")),
(0.5, Item("common.items.food.meat.beast_large_raw")),
(3.0, Item("common.items.crafting_ing.hide.animal_hide")),
(1, All([
MultiDrop(Item("common.items.food.meat.beast_small_raw"), 1, 4),
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 0, 3),
MultiDrop(Item("common.items.crafting_ing.hide.animal_hide"), 2, 4),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(1.0, Item("common.items.food.meat.beast_large_raw")),
(1.0, Item("common.items.crafting_ing.hide.animal_hide")),
(1.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.fur"), 1, 2)),
(1, All([
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 3, 5),
MultiDrop(Item("common.items.crafting_ing.hide.animal_hide"), 3, 5),
MultiDrop(Item("common.items.crafting_ing.animal_misc.fur"), 2, 6),
],
)),
]

View File

@ -0,0 +1,9 @@
[
(1, All([
MultiDrop(Item("common.items.food.meat.beast_small_raw"), 3, 5),
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 2, 4),
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 3, 6),
MultiDrop(Item("common.items.crafting_ing.animal_misc.lively_vine"), 3, 6),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(1.0, Item("common.items.crafting_ing.hide.animal_hide")),
(1.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.icy_fang"), 1, 2)),
(1, All([
MultiDrop(Item("common.items.crafting_ing.animal_misc.icy_fang"), 3, 6),
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 4, 6),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(1.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.icy_fang"), 1, 2)),
(1.0, MultiDrop(Item("common.items.food.meat.tough_raw"), 1, 2)),
(1.0, Item("common.items.crafting_ing.hide.carapace")),
(1, All([
MultiDrop(Item("common.items.food.meat.tough_raw"), 4, 8),
MultiDrop(Item("common.items.crafting_ing.hide.carapace"), 4, 8),
MultiDrop(Item("common.items.crafting_ing.animal_misc.icy_fang"), 5, 10),
],
)),
]

View File

@ -1,7 +1,8 @@
[
(1, All([
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 0, 1),
MultiDrop(Item("common.items.crafting_ing.animal_misc.long_tusk"), 0, 2),
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 4, 6),
MultiDrop(Item("common.items.crafting_ing.animal_misc.long_tusk"), 1, 2),
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 4, 6),
],
)),
]

View File

@ -0,0 +1,9 @@
[
(1, All([
MultiDrop(Item("common.items.food.meat.beast_small_raw"), 2, 4),
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.hide.tough_hide"), 3, 5),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 0, 2),
],
)),
]

View File

@ -1,7 +1,7 @@
[
(1, All([
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 0, 1),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 0, 2),
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 3, 5),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 0, 6),
MultiDrop(Item("common.items.crafting_ing.animal_misc.long_tusk"), 0, 2),
],
)),

View File

@ -1,8 +1,8 @@
[
(1, All([
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 0, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.icy_fang"), 0, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.long_tusk"), 0, 2),
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 4, 8),
MultiDrop(Item("common.items.crafting_ing.animal_misc.icy_fang"), 2, 6),
MultiDrop(Item("common.items.crafting_ing.animal_misc.long_tusk"), 1, 2),
],
)),
]

View File

@ -0,0 +1,9 @@
[
(1, All([
MultiDrop(Item("common.items.food.meat.tough_raw"), 2, 4),
MultiDrop(Item("common.items.crafting_ing.animal_misc.sharp_fang"), 0, 4),
MultiDrop(Item("common.items.crafting_ing.hide.carapace"), 3, 5),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 0, 2),
],
)),
]

View File

@ -1,4 +1,8 @@
[
(4.0, LootTable("common.loot_tables.creature.quad_medium.generic")),
(1.0, Item("common.items.crafting_ing.animal_misc.long_tusk")),
(1, All([
MultiDrop(LootTable("common.loot_tables.creature.quad_medium.generic"), 4, 5),
MultiDrop(Item("common.items.crafting_ing.animal_misc.long_tusk"), 1, 2),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 0, 2),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(1.0, Item("common.items.food.meat.beast_small_raw")),
(1.0, Item("common.items.crafting_ing.hide.tough_hide")),
(1.0, Item("common.items.crafting_ing.animal_misc.sharp_fang")),
(1, All([
MultiDrop(Item("common.items.food.meat.beast_small_raw"), 2, 5),
MultiDrop(Item("common.items.crafting_ing.hide.tough_hide"), 2, 5),
MultiDrop(Item("common.items.crafting_ing.animal_misc.sharp_fang"), 1, 4),
],
)),
]

View File

@ -1,6 +1,9 @@
[
(1.5, Item("common.items.food.meat.beast_small_raw")),
(0.5, Item("common.items.food.meat.beast_large_raw")),
(1.0, Item("common.items.crafting_ing.hide.animal_hide")),
(5.0, MultiDrop(Item("common.items.crafting_ing.cloth.wool"), 2, 5)),
(1, All([
MultiDrop(Item("common.items.food.meat.beast_small_raw"), 2, 4),
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.hide.animal_hide"), 3, 5),
MultiDrop(Item("common.items.crafting_ing.cloth.wool"), 3, 6),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(1.0, Item("common.items.food.meat.beast_large_raw")),
(1.0, Item("common.items.crafting_ing.hide.animal_hide")),
(1, All([
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 4, 6),
MultiDrop(Item("common.items.crafting_ing.hide.tough_hide"), 6, 8),
],
)),
]

View File

@ -1,6 +1,12 @@
[
(2.0, Item("common.items.log.wood")),
(2.0, Item("common.items.flowers.plant_fiber")),
(1.0, Item("common.items.crafting_ing.resin")),
(1.0, Item("common.items.crafting_ing.sentient_seed")),
(1, All([
MultiDrop(Item("common.items.log.wood"), 2, 4),
MultiDrop(Item("common.items.flowers.plant_fiber"), 1, 3),
Lottery([
(0.5, Item("common.items.crafting_ing.resin")),
(0.5, Item("common.items.crafting_ing.sentient_seed")),
(0.5, Nothing),
]),
],
)),
]

View File

@ -1,9 +1,9 @@
[
(1, All([
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 2, 5),
MultiDrop(Item("common.items.crafting_ing.hide.plate"), 1, 4),
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 5, 8),
MultiDrop(Item("common.items.crafting_ing.hide.plate"), 6, 10),
MultiDrop(Item("common.items.crafting_ing.animal_misc.claw"), 2, 4),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 0, 1),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 0, 2),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(4.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.elegant_crest"), 3, 6)),
(1.0, Item("common.items.crafting_ing.animal_misc.raptor_feather")),
(0.5, Item("common.items.food.meat.bird_large_raw")),
(1, All([
MultiDrop(Item("common.items.crafting_ing.animal_misc.elegant_crest"), 3, 6),
MultiDrop(Item("common.items.crafting_ing.animal_misc.raptor_feather"), 2, 3),
MultiDrop(Item("common.items.food.meat.bird_large_raw"), 1, 3),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(1.0, MultiDrop(LootTable("common.loot_tables.materials.underground"), 1, 2)),
(1.0, MultiDrop(Item("common.items.crafting_ing.stones"), 2, 6)),
(1, All([
MultiDrop(LootTable("common.loot_tables.materials.underground"), 1, 2),
MultiDrop(Item("common.items.crafting_ing.stones"), 2, 6),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(1.0, Item("common.items.crafting_ing.hide.rugged_hide")),
(1.0, Item("common.items.crafting_ing.animal_misc.large_horn")),
(1, All([
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 3, 5),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 0, 2),
],
)),
]

View File

@ -1,8 +1,8 @@
[
(1, All([
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 2, 4),
MultiDrop(Item("common.items.crafting_ing.hide.plate"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 0, 2),
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 5, 8),
MultiDrop(Item("common.items.crafting_ing.hide.plate"), 6, 10),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 0, 7),
],
)),
]

View File

@ -1,4 +1,9 @@
[
(1.0, Item("common.items.crafting_ing.hide.rugged_hide")),
(1.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.long_tusk"), 2, 2)),
(1, All([
MultiDrop(Item("common.items.food.meat.beast_large_raw"), 5, 8),
MultiDrop(Item("common.items.crafting_ing.hide.rugged_hide"), 6, 10),
MultiDrop(Item("common.items.crafting_ing.animal_misc.long_tusk"), 1, 2),
MultiDrop(Item("common.items.crafting_ing.animal_misc.large_horn"), 0, 3),
],
)),
]

View File

@ -1,5 +1,8 @@
[
(1.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.elegant_crest"), 1, 1)),
(2.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.raptor_feather"), 2, 6)),
(1.0, MultiDrop(Item("common.items.crafting_ing.hide.scales"), 1, 2)),
(1, All([
MultiDrop(Item("common.items.crafting_ing.animal_misc.elegant_crest"), 1, 4),
MultiDrop(Item("common.items.crafting_ing.animal_misc.raptor_feather"), 1, 3),
MultiDrop(Item("common.items.crafting_ing.hide.scales"), 3, 6),
],
)),
]

View File

@ -1,4 +1,7 @@
[
(1.0, MultiDrop(Item("common.items.crafting_ing.animal_misc.raptor_feather"), 1, 2)),
(2.0, MultiDrop(Item("common.items.crafting_ing.hide.scales"), 2, 6)),
(1, All([
MultiDrop(Item("common.items.crafting_ing.animal_misc.raptor_feather"), 2, 3),
MultiDrop(Item("common.items.crafting_ing.hide.scales"), 2, 6),
],
)),
]

View File

@ -1,5 +1,5 @@
[
(1.0, Item("common.items.mineral.ore.veloritefrag")),
(0.35, Item("common.items.mineral.ore.velorite")),
(1.0, MultiDrop(Item("common.items.mineral.ore.veloritefrag"), 3, 4)),
(0.35, MultiDrop(Item("common.items.mineral.ore.velorite"), 2, 3)),
(0.15, LootTable("common.loot_tables.materials.gems")),
]

View File

@ -250,9 +250,12 @@ lazy_static! {
}
#[derive(Clone)]
/// A collection of items with probabilty (normalized to one), created
/// A collection of items with probabilty, created
/// hierarchically from `LootSpec`s
/// (probability, item id, average amount)
///
/// This collection is NOT normalized (the sum of probabilities may not equal to
/// one, as maltiple items can drop in one roll)
pub struct ProbabilityFile {
pub content: Vec<(f32, ItemDefinitionIdOwned, f32)>,
}
@ -1148,11 +1151,7 @@ pub fn expand_loot_table(loot_table: &str) -> Vec<(f32, ItemDefinitionIdOwned, f
// cd common && cargo test trade_pricing -- --nocapture
#[cfg(test)]
mod tests {
use crate::{
comp::inventory::trade_pricing::{expand_loot_table, ProbabilityFile, TradePricing},
lottery::LootSpec,
trade::Good,
};
use crate::{comp::inventory::trade_pricing::TradePricing, trade::Good};
use tracing::{info, Level};
use tracing_subscriber::{filter::EnvFilter, FmtSubscriber};
@ -1164,26 +1163,6 @@ mod tests {
.unwrap_or(());
}
#[test]
fn test_loot_table() {
init();
info!("init");
let loot = expand_loot_table("common.loot_tables.creature.quad_medium.gentle");
let lootsum = loot.iter().fold(0.0, |s, i| s + i.0);
assert!((lootsum - 1.0).abs() < 1e-3);
// hierarchical
let loot2 = expand_loot_table("common.loot_tables.creature.quad_medium.catoblepas");
let lootsum2 = loot2.iter().fold(0.0, |s, i| s + i.0);
assert!((lootsum2 - 1.0).abs() < 1e-4);
// highly nested
let loot3 = expand_loot_table("common.loot_tables.creature.biped_large.wendigo");
let lootsum3 = loot3.iter().fold(0.0, |s, i| s + i.0);
//tracing::trace!("{:?} {}", loot3, lootsum3);
assert!((lootsum3 - 1.0).abs() < 1e-5);
}
#[test]
fn test_prices1() {
init();
@ -1212,43 +1191,4 @@ mod tests {
info!("Random item {:?}*{}", i.0, i.1);
}
}
fn normalized(probability: &ProbabilityFile) -> bool {
let sum = probability.content.iter().map(|(p, _, _)| p).sum::<f32>();
(dbg!(sum) - 1.0).abs() < 1e-3
}
#[test]
fn test_normalizing_table1() {
let item = |asset: &str| LootSpec::Item(asset.to_owned());
let loot_table = vec![(1.0, item("wow")), (1.0, item("nice"))];
let probability: ProbabilityFile = loot_table.into();
assert!(normalized(&probability));
}
#[test]
fn test_normalizing_table2() {
let table = |asset: &str| LootSpec::LootTable(asset.to_owned());
let loot_table = vec![(
1.0,
table("common.loot_tables.creature.quad_medium.catoblepas"),
)];
let probability: ProbabilityFile = loot_table.into();
assert!(normalized(&probability));
}
#[test]
fn test_normalizing_table3() {
let table = |asset: &str| LootSpec::LootTable(asset.to_owned());
let loot_table = vec![
(
1.0,
table("common.loot_tables.creature.quad_medium.catoblepas"),
),
(1.0, table("common.loot_tables.creature.quad_medium.gentle")),
];
let probability: ProbabilityFile = loot_table.into();
assert!(normalized(&probability));
}
}

View File

@ -543,7 +543,7 @@ pub fn apply_spots_to(canvas: &mut Canvas, _dynamic_rng: &mut impl Rng) {
Spot::Arch => SpotConfig {
base_structures: Some("spots.arch"),
entity_radius: 50.0,
entities: &[(2..3, "common.entity.wild.aggressive.ngoubou")],
entities: &[],
},
Spot::AirshipCrash => SpotConfig {
base_structures: Some("trees.airship_crash"),