Converted all armor in loot tables to reference armor set loot tables.

This commit is contained in:
Sam 2021-03-30 16:06:53 -04:00
parent 96b354c178
commit 833f1f3309
21 changed files with 149 additions and 209 deletions

View File

@ -3,11 +3,7 @@ loot_tables: [
// balance the loot tables against each other (higher= more common= smaller price)
// the fact that loot tables have an own probability not accessible outside of the lottery call doesn't help here
(4,"common.loot_tables.wild_animal"),
(1,"common.loot_tables.armor.armor_cloth"),
(0.01,"common.loot_tables.armor.armor_heavy"),
(0.1,"common.loot_tables.armor.armor_light"),
(0.1,"common.loot_tables.armor.armor_misc"),
(0.5,"common.loot_tables.armor.armor_nature"),
(1,"common.loot_tables.armor.cloth"),
(0.1,"common.loot_tables.cave_large"),
(0.1,"common.loot_tables.consumables"),
// loot_table_crafting is a rare roll on crate/mud sprite looting

View File

@ -0,0 +1,9 @@
[
(1.0, Item("common.items.armor.agile.back")),
(1.0, Item("common.items.armor.agile.belt")),
(1.0, Item("common.items.armor.agile.chest")),
(1.0, Item("common.items.armor.agile.foot")),
(1.0, Item("common.items.armor.agile.hand")),
(1.0, Item("common.items.armor.agile.pants")),
(1.0, Item("common.items.armor.agile.shoulder")),
]

View File

@ -1,38 +0,0 @@
[
// belts
(0.33, Item("common.items.armor.cloth_blue.belt")),
(0.33, Item("common.items.armor.cloth_green.belt")),
(0.33, Item("common.items.armor.cloth_purple.belt")),
// chests
(0.08, Item("common.items.armor.cloth_blue.chest")),
(0.08, Item("common.items.armor.cloth_green.chest")),
(0.08, Item("common.items.armor.cloth_purple.chest")),
(0.08, Item("common.items.armor.misc.chest.worker_green_0")),
(0.08, Item("common.items.armor.misc.chest.worker_green_1")),
(0.08, Item("common.items.armor.misc.chest.worker_orange_0")),
(0.08, Item("common.items.armor.misc.chest.worker_orange_1")),
(0.08, Item("common.items.armor.misc.chest.worker_purple_0")),
(0.08, Item("common.items.armor.misc.chest.worker_purple_1")),
(0.08, Item("common.items.armor.misc.chest.worker_red_0")),
(0.08, Item("common.items.armor.misc.chest.worker_red_1")),
(0.08, Item("common.items.armor.misc.chest.worker_yellow_0")),
(0.08, Item("common.items.armor.misc.chest.worker_yellow_1")),
// shoes
(0.33, Item("common.items.armor.cloth_blue.foot")),
(0.33, Item("common.items.armor.cloth_green.foot")),
(0.33, Item("common.items.armor.cloth_purple.foot")),
// pants
(0.25, Item("common.items.armor.cloth_blue.pants")),
(0.25, Item("common.items.armor.cloth_green.pants")),
(0.25, Item("common.items.armor.cloth_purple.pants")),
(0.25, Item("common.items.armor.misc.pants.worker_blue")),
// shoulders
(0.25, Item("common.items.armor.cloth_blue.shoulder_0")),
(0.25, Item("common.items.armor.cloth_blue.shoulder_1")),
(0.25, Item("common.items.armor.cloth_green.shoulder")),
(0.25, Item("common.items.armor.cloth_purple.shoulder")),
//gloves
(0.33, Item("common.items.armor.cloth_blue.hand")),
(0.33, Item("common.items.armor.cloth_green.hand")),
(0.33, Item("common.items.armor.cloth_purple.hand")),
]

View File

@ -1,21 +0,0 @@
[
// belts
(0.67, Item("common.items.armor.plate.belt")),
(0.33, Item("common.items.armor.steel.belt")),
// chests
(0.67, Item("common.items.armor.plate.chest")),
(0.33, Item("common.items.armor.steel.chest")),
// shoes
(0.67, Item("common.items.armor.plate.foot")),
(0.33, Item("common.items.armor.steel.foot")),
// pants
(0.67, Item("common.items.armor.plate.pants")),
(0.66, Item("common.items.armor.steel.pants")),
// shoulders
(0.4, Item("common.items.armor.plate.shoulder")),
(0.37, Item("common.items.armor.misc.shoulder.iron_spikes")),
(0.33, Item("common.items.armor.steel.shoulder")),
//gloves
(0.67, Item("common.items.armor.plate.hand")),
(0.33, Item("common.items.armor.steel.hand")),
]

View File

@ -1,27 +0,0 @@
[
// belts
(0.5, Item("common.items.armor.swift.belt")),
(0.5, Item("common.items.armor.agile.belt")),
// chests
(0.5, Item("common.items.armor.swift.chest")),
(0.5, Item("common.items.armor.agile.chest")),
// shoes
(0.5, Item("common.items.armor.swift.foot")),
(0.5, Item("common.items.armor.agile.foot")),
// pants
(0.33, Item("common.items.armor.swift.pants")),
(0.33, Item("common.items.armor.agile.pants")),
(0.33, Item("common.items.armor.misc.pants.hunting")),
// shoulders
(0.1, Item("common.items.armor.misc.shoulder.leather_strip")),
(0.2, Item("common.items.armor.swift.shoulder")),
(0.2, Item("common.items.armor.agile.shoulder")),
(0.2, Item("common.items.armor.agile.shoulder")),
(0.07, Item("common.items.armor.misc.shoulder.leather_iron_0")),
(0.07, Item("common.items.armor.misc.shoulder.leather_iron_1")),
(0.07, Item("common.items.armor.misc.shoulder.leather_iron_2")),
(0.07, Item("common.items.armor.misc.shoulder.leather_iron_3")),
//gloves
(0.5, Item("common.items.armor.swift.hand")),
(0.5, Item("common.items.armor.agile.hand")),
]

View File

@ -1,12 +0,0 @@
[
// rings
(0.15, Item("common.items.armor.misc.ring.scratched")),
(0.05, Item("common.items.armor.misc.ring.gold")),
// capes
(0.25, Item("common.items.armor.misc.back.short_0")),
(0.25, Item("common.items.armor.misc.back.short_1")),
// necks
(0.25, Item("common.items.armor.misc.neck.plain_0")),
// misc
(0.05, Item("common.items.glider.glider_blue")),
]

View File

@ -1,32 +0,0 @@
[
// belts
(0.4, Item("common.items.armor.druid.belt")),
(0.2, Item("common.items.armor.twigs.belt")),
(0.2, Item("common.items.armor.twigsflowers.belt")),
(0.2, Item("common.items.armor.twigsleaves.belt")),
// chests
(0.4, Item("common.items.armor.druid.chest")),
(0.2, Item("common.items.armor.twigs.chest")),
(0.2, Item("common.items.armor.twigsflowers.chest")),
(0.2, Item("common.items.armor.twigsleaves.chest")),
// shoes
(0.4, Item("common.items.armor.druid.foot")),
(0.2, Item("common.items.armor.twigs.foot")),
(0.2, Item("common.items.armor.twigsflowers.foot")),
(0.2, Item("common.items.armor.twigsleaves.foot")),
// pants
(0.4, Item("common.items.armor.druid.pants")),
(0.2, Item("common.items.armor.twigs.pants")),
(0.2, Item("common.items.armor.twigsflowers.pants")),
(0.2, Item("common.items.armor.twigsleaves.pants")),
// shoulders
(0.4, Item("common.items.armor.druid.shoulder")),
(0.2, Item("common.items.armor.twigs.shoulder")),
(0.2, Item("common.items.armor.twigsflowers.shoulder")),
(0.2, Item("common.items.armor.twigsleaves.shoulder")),
//gloves
(0.4, Item("common.items.armor.druid.hand")),
(0.2, Item("common.items.armor.twigs.hand")),
(0.2, Item("common.items.armor.twigsflowers.hand")),
(0.2, Item("common.items.armor.twigsleaves.hand")),
]

View File

@ -0,0 +1,34 @@
[
(1.0, Item("common.items.armor.cloth_purple.belt")),
(1.0, Item("common.items.armor.cloth_purple.chest")),
(1.0, Item("common.items.armor.cloth_purple.foot")),
(1.0, Item("common.items.armor.cloth_purple.hand")),
(1.0, Item("common.items.armor.cloth_purple.pants")),
(1.0, Item("common.items.armor.cloth_purple.shoulder")),
(1.0, Item("common.items.armor.cloth_green.belt")),
(1.0, Item("common.items.armor.cloth_green.chest")),
(1.0, Item("common.items.armor.cloth_green.foot")),
(1.0, Item("common.items.armor.cloth_green.hand")),
(1.0, Item("common.items.armor.cloth_green.pants")),
(1.0, Item("common.items.armor.cloth_green.shoulder")),
(1.0, Item("common.items.armor.cloth_blue.belt")),
(1.0, Item("common.items.armor.cloth_blue.chest")),
(1.0, Item("common.items.armor.cloth_blue.foot")),
(1.0, Item("common.items.armor.cloth_blue.hand")),
(1.0, Item("common.items.armor.cloth_blue.pants")),
(1.0, Item("common.items.armor.cloth_blue.shoulder_0")),
(1.0, Item("common.items.armor.cloth_blue.shoulder_1")),
(1.0, Item("common.items.armor.misc.chest.worker_green_0")),
(1.0, Item("common.items.armor.misc.chest.worker_green_1")),
(1.0, Item("common.items.armor.misc.chest.worker_orange_0")),
(1.0, Item("common.items.armor.misc.chest.worker_orange_1")),
(1.0, Item("common.items.armor.misc.chest.worker_purple_0")),
(1.0, Item("common.items.armor.misc.chest.worker_purple_1")),
(1.0, Item("common.items.armor.misc.chest.worker_purple_brown")),
(1.0, Item("common.items.armor.misc.chest.worker_red_0")),
(1.0, Item("common.items.armor.misc.chest.worker_red_1")),
(1.0, Item("common.items.armor.misc.chest.worker_yellow_0")),
(1.0, Item("common.items.armor.misc.chest.worker_yellow_1")),
(1.0, Item("common.items.armor.misc.pants.worker_blue")),
(1.0, Item("common.items.armor.misc.pants.worker_brown")),
]

View File

@ -0,0 +1,8 @@
[
(1.0, Item("common.items.armor.cultist.belt")),
(1.0, Item("common.items.armor.cultist.chest")),
(1.0, Item("common.items.armor.cultist.foot")),
(1.0, Item("common.items.armor.cultist.hand")),
(1.0, Item("common.items.armor.cultist.pants")),
(1.0, Item("common.items.armor.cultist.shoulder")),
]

View File

@ -0,0 +1,8 @@
[
(1.0, Item("common.items.armor.druid.belt")),
(1.0, Item("common.items.armor.druid.chest")),
(1.0, Item("common.items.armor.druid.foot")),
(1.0, Item("common.items.armor.druid.hand")),
(1.0, Item("common.items.armor.druid.pants")),
(1.0, Item("common.items.armor.druid.shoulder")),
]

View File

@ -0,0 +1,8 @@
[
(1.0, Item("common.items.armor.plate.belt")),
(1.0, Item("common.items.armor.plate.chest")),
(1.0, Item("common.items.armor.plate.foot")),
(1.0, Item("common.items.armor.plate.hand")),
(1.0, Item("common.items.armor.plate.pants")),
(1.0, Item("common.items.armor.plate.shoulder")),
]

View File

@ -0,0 +1,8 @@
[
(1.0, Item("common.items.armor.steel.belt")),
(1.0, Item("common.items.armor.steel.chest")),
(1.0, Item("common.items.armor.steel.foot")),
(1.0, Item("common.items.armor.steel.hand")),
(1.0, Item("common.items.armor.steel.pants")),
(1.0, Item("common.items.armor.steel.shoulder")),
]

View File

@ -0,0 +1,8 @@
[
(1.0, Item("common.items.armor.swift.belt")),
(1.0, Item("common.items.armor.swift.chest")),
(1.0, Item("common.items.armor.swift.foot")),
(1.0, Item("common.items.armor.swift.hand")),
(1.0, Item("common.items.armor.swift.pants")),
(1.0, Item("common.items.armor.swift.shoulder")),
]

View File

@ -0,0 +1,8 @@
[
(1.0, Item("common.items.armor.twigs.belt")),
(1.0, Item("common.items.armor.twigs.chest")),
(1.0, Item("common.items.armor.twigs.foot")),
(1.0, Item("common.items.armor.twigs.hand")),
(1.0, Item("common.items.armor.twigs.pants")),
(1.0, Item("common.items.armor.twigs.shoulder")),
]

View File

@ -0,0 +1,8 @@
[
(1.0, Item("common.items.armor.twigsflowers.belt")),
(1.0, Item("common.items.armor.twigsflowers.chest")),
(1.0, Item("common.items.armor.twigsflowers.foot")),
(1.0, Item("common.items.armor.twigsflowers.hand")),
(1.0, Item("common.items.armor.twigsflowers.pants")),
(1.0, Item("common.items.armor.twigsflowers.shoulder")),
]

View File

@ -0,0 +1,8 @@
[
(1.0, Item("common.items.armor.twigsleaves.belt")),
(1.0, Item("common.items.armor.twigsleaves.chest")),
(1.0, Item("common.items.armor.twigsleaves.foot")),
(1.0, Item("common.items.armor.twigsleaves.hand")),
(1.0, Item("common.items.armor.twigsleaves.pants")),
(1.0, Item("common.items.armor.twigsleaves.shoulder")),
]

View File

@ -14,37 +14,10 @@
(0.5, Item("common.items.utility.bomb")),
(0.5, Item("common.items.armor.misc.ring.gold")),
(0.25, Item("common.items.armor.misc.ring.skull")),
(0.5, Item("common.items.armor.plate.belt")),
(0.3, Item("common.items.armor.steel.belt")),
(0.5, Item("common.items.armor.plate.chest")),
(0.3, Item("common.items.armor.steel.chest")),
(0.5, Item("common.items.armor.plate.foot")),
(0.3, Item("common.items.armor.steel.foot")),
(0.5, Item("common.items.armor.plate.pants")),
(0.3, Item("common.items.armor.steel.pants")),
(0.4, Item("common.items.armor.plate.shoulder")),
(0.37, Item("common.items.armor.misc.shoulder.iron_spikes")),
(0.33, Item("common.items.armor.steel.shoulder")),
(0.67, Item("common.items.armor.plate.hand")),
(0.33, Item("common.items.armor.steel.hand")),
(0.5, Item("common.items.armor.swift.belt")),
(0.5, Item("common.items.armor.agile.belt")),
(0.5, Item("common.items.armor.swift.chest")),
(0.5, Item("common.items.armor.agile.chest")),
(0.5, Item("common.items.armor.swift.foot")),
(0.5, Item("common.items.armor.agile.foot")),
(0.33, Item("common.items.armor.swift.pants")),
(0.33, Item("common.items.armor.agile.pants")),
(0.33, Item("common.items.armor.misc.pants.hunting")),
(0.6, Item("common.items.armor.misc.shoulder.leather_strip")),
(0.4, Item("common.items.armor.swift.shoulder")),
(0.4, Item("common.items.armor.agile.shoulder")),
(0.3, Item("common.items.armor.misc.shoulder.leather_iron_0")),
(0.3, Item("common.items.armor.misc.shoulder.leather_iron_1")),
(0.3, Item("common.items.armor.misc.shoulder.leather_iron_2")),
(0.3, Item("common.items.armor.misc.shoulder.leather_iron_3")),
(0.5, Item("common.items.armor.swift.hand")),
(0.5, Item("common.items.armor.agile.hand")),
(2.0, LootTable("common.loot_tables.armor.swift")),
(2.0, LootTable("common.loot_tables.armor.agile")),
(3.0, LootTable("common.loot_tables.armor.plate")),
(2.0, LootTable("common.loot_tables.armor.steel")),
(0.001, Item("common.items.armor.misc.back.backpack")),
(0.1, Item("common.items.armor.misc.bag.heavy_seabag")),
(0.1, Item("common.items.weapons.sword.wood-0")),

View File

@ -1,11 +1,6 @@
[
// armor
(1.0, Item("common.items.armor.cultist.belt")),
(1.0, Item("common.items.armor.cultist.chest")),
(1.0, Item("common.items.armor.cultist.foot")),
(1.0, Item("common.items.armor.cultist.hand")),
(1.0, Item("common.items.armor.cultist.pants")),
(1.0, Item("common.items.armor.cultist.shoulder")),
(6.0, LootTable("common.loot_tables.armor.cultist")),
(1.0, Item("common.items.armor.misc.back.dungeon_purple")),
(1.0, Item("common.items.armor.misc.ring.skull")),
// weapons

View File

@ -604,10 +604,10 @@ impl Item {
chosen = Lottery::<LootSpec>::load_expect(match rng.gen_range(0..7) {
0 => "common.loot_tables.weapon_uncommon",
1 => "common.loot_tables.weapon_common",
2 => "common.loot_tables.armor.armor_light",
3 => "common.loot_tables.armor.armor_cloth",
4 => "common.loot_tables.armor.armor_heavy",
_ => "common.loot_tables.armor.armor_misc",
2 => "common.loot_tables.armor.swift",
3 => "common.loot_tables.armor.cloth",
4 => "common.loot_tables.armor.plate",
_ => "common.loot_tables.fallback",
})
.read();
return Some(chosen.choose().to_item(None));
@ -615,9 +615,9 @@ impl Item {
SpriteKind::ChestBurried => {
chosen = Lottery::<LootSpec>::load_expect(match rng.gen_range(0..7) {
1 => "common.loot_tables.weapon_common",
2 => "common.loot_tables.armor.armor_light",
3 => "common.loot_tables.armor.armor_cloth",
_ => "common.loot_tables.armor.armor_misc",
2 => "common.loot_tables.armor.swift",
3 => "common.loot_tables.armor.cloth",
_ => "common.loot_tables.fallback",
})
.read();
return Some(chosen.choose().to_item(None));
@ -626,7 +626,7 @@ impl Item {
chosen = Lottery::<LootSpec>::load_expect(match rng.gen_range(0..5) {
0 => "common.loot_tables.crafting",
1 => "common.loot_tables.weapon_common",
2 => "common.loot_tables.armor.armor_misc",
2 => "common.loot_tables.fallback",
_ => "common.loot_tables.rocks",
})
.read();

View File

@ -341,13 +341,13 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc
let mut rng = rand::thread_rng();
let mut lottery = || {
Lottery::<LootSpec>::load_expect(match old_body {
Some(common::comp::Body::Humanoid(_)) => match rng.gen_range(0..4) {
Some(common::comp::Body::Humanoid(_)) => match rng.gen_range(0..5) {
0 => "common.loot_tables.humanoids",
1 => "common.loot_tables.armor.armor_light",
2 => "common.loot_tables.armor.armor_cloth",
1 => "common.loot_tables.armor.swift",
2 => "common.loot_tables.armor.cloth",
3 => "common.loot_tables.weapon_common",
4 => "common.loots_tables.loot_table_armor_misc",
_ => "common.loot_tables.humanoids",
4 => "common.loot_tables.humanoids",
_ => "common.loots_tables.fallback",
},
Some(common::comp::Body::QuadrupedSmall(quadruped_small)) => {
match quadruped_small.species {
@ -388,19 +388,17 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc
biped_large::Species::Occultsaurok
| biped_large::Species::Mightysaurok
| biped_large::Species::Slysaurok => "common.loot_tables.saurok",
_ => match rng.gen_range(0..4) {
_ => match rng.gen_range(0..3) {
0 => "common.loot_tables.food",
1 => "common.loot_tables.armor.armor_nature",
_ => "common.loot_tables.cave_large",
},
},
Some(common::comp::Body::Golem(_)) => match rng.gen_range(0..9) {
Some(common::comp::Body::Golem(_)) => match rng.gen_range(0..5) {
0 => "common.loot_tables.food",
2 => "common.loot_tables.armor.armor_light",
3 => "common.loot_tables.armor.armor_heavy",
5 => "common.loot_tables.weapon_common",
6 => "common.loot_tables.weapon_uncommon",
7 => "common.loot_tables.weapon_rare",
1 => "common.loot_tables.armor.steel",
2 => "common.loot_tables.weapon_common",
3 => "common.loot_tables.weapon_uncommon",
4 => "common.loot_tables.weapon_rare",
_ => "common.loot_tables.fallback",
},
Some(common::comp::Body::Theropod(_)) => "common.loot_tables.wild_animal",

View File

@ -555,28 +555,28 @@ impl Floor {
0 => Lottery::<LootSpec>::load_expect(
match dynamic_rng.gen_range(0..4) {
0 => "common.loot_tables.humanoids",
1 => "common.loot_tables.armor.armor_cloth",
1 => "common.loot_tables.armor.cloth",
_ => "common.loot_tables.weapon_common",
},
),
1 => Lottery::<LootSpec>::load_expect(
match dynamic_rng.gen_range(0..4) {
0 => "common.loot_tables.humanoids",
1 => "common.loot_tables.armor.armor_light",
1 => "common.loot_tables.armor.swift",
_ => "common.loot_tables.weapon_uncommon",
},
),
2 => Lottery::<LootSpec>::load_expect(
match dynamic_rng.gen_range(0..4) {
0 => "common.loot_tables.humanoids",
1 => "common.loot_tables.armor.armor_heavy",
1 => "common.loot_tables.armor.plate",
_ => "common.loot_tables.weapon_rare",
},
),
3 => Lottery::<LootSpec>::load_expect(
match dynamic_rng.gen_range(0..10) {
0 => "common.loot_tables.humanoids",
1 => "common.loot_tables.armor.armor_heavy",
1 => "common.loot_tables.armor.steel",
2 => "common.loot_tables.weapon_rare",
_ => "common.loot_tables.cultists",
},
@ -584,7 +584,7 @@ impl Floor {
4 => Lottery::<LootSpec>::load_expect(
match dynamic_rng.gen_range(0..6) {
0 => "common.loot_tables.humanoids",
1 => "common.loot_tables.armor.armor_misc",
1 => "common.loot_tables.fallback",
2 => "common.loot_tables.weapon_rare",
_ => "common.loot_tables.cultists",
},
@ -592,14 +592,12 @@ impl Floor {
5 => Lottery::<LootSpec>::load_expect(
match dynamic_rng.gen_range(0..5) {
0 => "common.loot_tables.humanoids",
1 => "common.loot_tables.armor.armor_misc",
1 => "common.loot_tables.fallback",
2 => "common.loot_tables.weapon_rare",
_ => "common.loot_tables.cultists",
},
),
_ => Lottery::<LootSpec>::load_expect(
"common.loot_tables.armor.armor_misc",
),
_ => Lottery::<LootSpec>::load_expect("common.loot_tables.fallback"),
};
let chosen = chosen.read();
let chosen = chosen.choose();
@ -846,7 +844,10 @@ impl Floor {
"common.loot_tables.weapon_uncommon",
),
2 => Lottery::<LootSpec>::load_expect(
"common.loot_tables.armor.armor_heavy",
match dynamic_rng.gen_range(0..3) {
0 => "common.loot_tables.armor.steel",
_ => "common.loot_tables.armor.plate",
},
),
3 => Lottery::<LootSpec>::load_expect(
"common.loot_tables.weapon_rare",
@ -860,9 +861,9 @@ impl Floor {
_ => "common.loot_tables.miniboss",
},
),
_ => Lottery::<LootSpec>::load_expect(
"common.loot_tables.armor.armor_misc",
),
_ => {
Lottery::<LootSpec>::load_expect("common.loot_tables.fallback")
},
};
let chosen = chosen.read();
let chosen = chosen.choose();
@ -1014,9 +1015,9 @@ impl Floor {
"common.loot_tables.weapon_rare",
),
5 => Lottery::<LootSpec>::load_expect("common.loot_tables.husk"),
_ => Lottery::<LootSpec>::load_expect(
"common.loot_tables.armor.armor_misc",
),
_ => {
Lottery::<LootSpec>::load_expect("common.loot_tables.fallback")
},
};
let chosen = chosen.read();
let chosen = chosen.choose();