From 247004d180bc1ad36bb7cf95a5fa0d450aa37f79 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 28 Mar 2021 17:41:14 -0400 Subject: [PATCH 01/17] Loot tables can now recursively specify loot tables. Mercahnts broken. --- assets/common/item_price_calculation.ron | 52 ++-- assets/common/loot_tables/animal_ice.ron | 4 + assets/common/loot_tables/animal_parts.ron | 3 + assets/common/loot_tables/armor_cloth.ron | 38 +++ assets/common/loot_tables/armor_heavy.ron | 21 ++ assets/common/loot_tables/armor_light.ron | 27 +++ assets/common/loot_tables/armor_misc.ron | 12 + assets/common/loot_tables/armor_nature.ron | 32 +++ assets/common/loot_tables/cave_large.ron | 89 +++++++ assets/common/loot_tables/consumables.ron | 14 ++ assets/common/loot_tables/crafting.ron | 12 + assets/common/loot_tables/cultists.ron | 188 +++++++++++++++ assets/common/loot_tables/fallback.ron | 4 + assets/common/loot_tables/fish.ron | 3 + assets/common/loot_tables/food.ron | 14 ++ assets/common/loot_tables/humanoids.ron | 31 +++ assets/common/loot_tables/husk.ron | 3 + assets/common/loot_tables/loot_table.ron | 4 - .../loot_tables/loot_table_animal_ice.ron | 4 - .../loot_tables/loot_table_animal_parts.ron | 3 - .../loot_tables/loot_table_armor_cloth.ron | 38 --- .../loot_tables/loot_table_armor_heavy.ron | 21 -- .../loot_tables/loot_table_armor_light.ron | 27 --- .../loot_tables/loot_table_armor_misc.ron | 12 - .../loot_tables/loot_table_armor_nature.ron | 32 --- .../loot_tables/loot_table_cave_large.ron | 91 ------- .../loot_tables/loot_table_consumables.ron | 14 -- .../loot_tables/loot_table_crafting.ron | 13 - .../loot_tables/loot_table_cultists.ron | 227 ------------------ assets/common/loot_tables/loot_table_fish.ron | 3 - assets/common/loot_tables/loot_table_food.ron | 14 -- .../loot_tables/loot_table_humanoids.ron | 31 --- assets/common/loot_tables/loot_table_husk.ron | 3 - .../loot_tables/loot_table_maneater.ron | 5 - .../loot_tables/loot_table_miniboss.ron | 15 -- .../common/loot_tables/loot_table_raptor.ron | 4 - .../common/loot_tables/loot_table_rocks.ron | 6 - .../common/loot_tables/loot_table_saurok.ron | 19 -- .../common/loot_tables/loot_table_troll.ron | 4 - .../loot_tables/loot_table_villager.ron | 45 ---- .../loot_tables/loot_table_weapon_common.ron | 45 ---- .../loot_tables/loot_table_weapon_rare.ron | 42 ---- .../loot_table_weapon_uncommon.ron | 91 ------- .../common/loot_tables/loot_table_wendigo.ron | 3 - assets/common/loot_tables/maneater.ron | 5 + assets/common/loot_tables/mindflayer.ron | 23 +- assets/common/loot_tables/miniboss.ron | 15 ++ assets/common/loot_tables/raptor.ron | 4 + assets/common/loot_tables/rocks.ron | 6 + assets/common/loot_tables/saurok.ron | 19 ++ assets/common/loot_tables/troll.ron | 4 + assets/common/loot_tables/villager.ron | 45 ++++ assets/common/loot_tables/weapon_common.ron | 45 ++++ assets/common/loot_tables/weapon_rare.ron | 42 ++++ assets/common/loot_tables/weapon_uncommon.ron | 91 +++++++ assets/common/loot_tables/wendigo.ron | 3 + common/src/bin/csv_export/main.rs | 13 +- common/src/bin/csv_import/main.rs | 24 +- common/src/comp/inventory/item/mod.rs | 50 ++-- common/src/comp/inventory/loadout_builder.rs | 53 ++-- common/src/comp/inventory/trade_pricing.rs | 60 ++--- common/src/lottery.rs | 29 ++- server/src/events/entity_manipulation.rs | 100 ++++---- world/src/site/dungeon/mod.rs | 160 ++++++------ 64 files changed, 1072 insertions(+), 1082 deletions(-) create mode 100644 assets/common/loot_tables/animal_ice.ron create mode 100644 assets/common/loot_tables/animal_parts.ron create mode 100644 assets/common/loot_tables/armor_cloth.ron create mode 100644 assets/common/loot_tables/armor_heavy.ron create mode 100644 assets/common/loot_tables/armor_light.ron create mode 100644 assets/common/loot_tables/armor_misc.ron create mode 100644 assets/common/loot_tables/armor_nature.ron create mode 100644 assets/common/loot_tables/cave_large.ron create mode 100644 assets/common/loot_tables/consumables.ron create mode 100644 assets/common/loot_tables/crafting.ron create mode 100644 assets/common/loot_tables/cultists.ron create mode 100644 assets/common/loot_tables/fallback.ron create mode 100644 assets/common/loot_tables/fish.ron create mode 100644 assets/common/loot_tables/food.ron create mode 100644 assets/common/loot_tables/humanoids.ron create mode 100644 assets/common/loot_tables/husk.ron delete mode 100644 assets/common/loot_tables/loot_table.ron delete mode 100644 assets/common/loot_tables/loot_table_animal_ice.ron delete mode 100644 assets/common/loot_tables/loot_table_animal_parts.ron delete mode 100644 assets/common/loot_tables/loot_table_armor_cloth.ron delete mode 100644 assets/common/loot_tables/loot_table_armor_heavy.ron delete mode 100644 assets/common/loot_tables/loot_table_armor_light.ron delete mode 100644 assets/common/loot_tables/loot_table_armor_misc.ron delete mode 100644 assets/common/loot_tables/loot_table_armor_nature.ron delete mode 100644 assets/common/loot_tables/loot_table_cave_large.ron delete mode 100644 assets/common/loot_tables/loot_table_consumables.ron delete mode 100644 assets/common/loot_tables/loot_table_crafting.ron delete mode 100644 assets/common/loot_tables/loot_table_cultists.ron delete mode 100644 assets/common/loot_tables/loot_table_fish.ron delete mode 100644 assets/common/loot_tables/loot_table_food.ron delete mode 100644 assets/common/loot_tables/loot_table_humanoids.ron delete mode 100644 assets/common/loot_tables/loot_table_husk.ron delete mode 100644 assets/common/loot_tables/loot_table_maneater.ron delete mode 100644 assets/common/loot_tables/loot_table_miniboss.ron delete mode 100644 assets/common/loot_tables/loot_table_raptor.ron delete mode 100644 assets/common/loot_tables/loot_table_rocks.ron delete mode 100644 assets/common/loot_tables/loot_table_saurok.ron delete mode 100644 assets/common/loot_tables/loot_table_troll.ron delete mode 100644 assets/common/loot_tables/loot_table_villager.ron delete mode 100644 assets/common/loot_tables/loot_table_weapon_common.ron delete mode 100644 assets/common/loot_tables/loot_table_weapon_rare.ron delete mode 100644 assets/common/loot_tables/loot_table_weapon_uncommon.ron delete mode 100644 assets/common/loot_tables/loot_table_wendigo.ron create mode 100644 assets/common/loot_tables/maneater.ron create mode 100644 assets/common/loot_tables/miniboss.ron create mode 100644 assets/common/loot_tables/raptor.ron create mode 100644 assets/common/loot_tables/rocks.ron create mode 100644 assets/common/loot_tables/saurok.ron create mode 100644 assets/common/loot_tables/troll.ron create mode 100644 assets/common/loot_tables/villager.ron create mode 100644 assets/common/loot_tables/weapon_common.ron create mode 100644 assets/common/loot_tables/weapon_rare.ron create mode 100644 assets/common/loot_tables/weapon_uncommon.ron create mode 100644 assets/common/loot_tables/wendigo.ron diff --git a/assets/common/item_price_calculation.ron b/assets/common/item_price_calculation.ron index f3efc8bb03..0cb4c3be87 100644 --- a/assets/common/item_price_calculation.ron +++ b/assets/common/item_price_calculation.ron @@ -2,35 +2,35 @@ 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 - (0.5,"common.loot_tables.loot_table_animal_ice"), - (4,"common.loot_tables.loot_table_animal_parts"), - (1,"common.loot_tables.loot_table_armor_cloth"), - (0.01,"common.loot_tables.loot_table_armor_heavy"), - (0.1,"common.loot_tables.loot_table_armor_light"), - (0.1,"common.loot_tables.loot_table_armor_misc"), - (0.5,"common.loot_tables.loot_table_armor_nature"), - (0.1,"common.loot_tables.loot_table_cave_large"), - (0.1,"common.loot_tables.loot_table_consumables"), + (0.5,"common.loot_tables.animal_ice"), + (4,"common.loot_tables.animal_parts"), + (1,"common.loot_tables.armor_cloth"), + (0.01,"common.loot_tables.armor_heavy"), + (0.1,"common.loot_tables.armor_light"), + (0.1,"common.loot_tables.armor_misc"), + (0.5,"common.loot_tables.armor_nature"), + (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 - (0.05,"common.loot_tables.loot_table_crafting"), - (0.005,"common.loot_tables.loot_table_cultists"), - (1,"common.loot_tables.loot_table_fish"), - (1,"common.loot_tables.loot_table_food"), - (0.1,"common.loot_tables.loot_table_humanoids"), - (1,"common.loot_tables.loot_table_maneater"), + (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"), - (0.001,"common.loot_tables.loot_table_miniboss"), - (0.05,"common.loot_tables.loot_table_raptor"), + (0.001,"common.loot_tables.miniboss"), + (0.05,"common.loot_tables.raptor"), // loot_table_rocks is dropped by rock monsters, but is also the only source of stones to econsim until cave_scatter information is turned into a loot table - (0.2,"common.loot_tables.loot_table_rocks"), - (1,"common.loot_tables.loot_table"), - (0.04,"common.loot_tables.loot_table_saurok"), - (0.02,"common.loot_tables.loot_table_troll"), - (0.05,"common.loot_tables.loot_table_villager"), - (1,"common.loot_tables.loot_table_weapon_common"), - (0.008,"common.loot_tables.loot_table_weapon_rare"), - (0.01,"common.loot_tables.loot_table_weapon_uncommon"), - (0.01,"common.loot_tables.loot_table_wendigo"), + (0.2,"common.loot_tables.rocks"), + (1,"common.loot_tables.fallback"), + (0.04,"common.loot_tables.saurok"), + (0.02,"common.loot_tables.troll"), + (0.05,"common.loot_tables.villager"), + (1,"common.loot_tables.weapon_common"), + (0.008,"common.loot_tables.weapon_rare"), + (0.01,"common.loot_tables.weapon_uncommon"), + (0.01,"common.loot_tables.wendigo"), // we probably want to include all the scattered scatter information //(0.5,"common.cave_scatter"), ], diff --git a/assets/common/loot_tables/animal_ice.ron b/assets/common/loot_tables/animal_ice.ron new file mode 100644 index 0000000000..e9ac2d3b94 --- /dev/null +++ b/assets/common/loot_tables/animal_ice.ron @@ -0,0 +1,4 @@ +[ + (2.0, Item("common.items.crafting_ing.icy_fang")), + (1.0, Item("common.items.crafting_ing.leather_scraps")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/animal_parts.ron b/assets/common/loot_tables/animal_parts.ron new file mode 100644 index 0000000000..38b242b969 --- /dev/null +++ b/assets/common/loot_tables/animal_parts.ron @@ -0,0 +1,3 @@ +[ + (2.0, Item("common.items.crafting_ing.leather_scraps")), +] diff --git a/assets/common/loot_tables/armor_cloth.ron b/assets/common/loot_tables/armor_cloth.ron new file mode 100644 index 0000000000..dce00687c7 --- /dev/null +++ b/assets/common/loot_tables/armor_cloth.ron @@ -0,0 +1,38 @@ +[ + // 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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/armor_heavy.ron b/assets/common/loot_tables/armor_heavy.ron new file mode 100644 index 0000000000..20b8d601f4 --- /dev/null +++ b/assets/common/loot_tables/armor_heavy.ron @@ -0,0 +1,21 @@ +[ + // 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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/armor_light.ron b/assets/common/loot_tables/armor_light.ron new file mode 100644 index 0000000000..77f29476b8 --- /dev/null +++ b/assets/common/loot_tables/armor_light.ron @@ -0,0 +1,27 @@ +[ + // 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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/armor_misc.ron b/assets/common/loot_tables/armor_misc.ron new file mode 100644 index 0000000000..95d602e405 --- /dev/null +++ b/assets/common/loot_tables/armor_misc.ron @@ -0,0 +1,12 @@ +[ + // 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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/armor_nature.ron b/assets/common/loot_tables/armor_nature.ron new file mode 100644 index 0000000000..f95a29302a --- /dev/null +++ b/assets/common/loot_tables/armor_nature.ron @@ -0,0 +1,32 @@ +[ + // 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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/cave_large.ron b/assets/common/loot_tables/cave_large.ron new file mode 100644 index 0000000000..9b2d880b93 --- /dev/null +++ b/assets/common/loot_tables/cave_large.ron @@ -0,0 +1,89 @@ +[ + // 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")), + (0.1, Item("common.items.glider.glider_blue")), + (0.05, Item("common.items.glider.glider_morpho")), + (0.05, Item("common.items.glider.glider_monarch")), + (0.05, Item("common.items.glider.glider_moth")), + (0.05, Item("common.items.armor.misc.ring.gold")), + (0.1, Item("common.items.lantern.geode_purp")), + // swords + (0.03, Item("common.items.weapons.sword.steel-0")), + (0.03, Item("common.items.weapons.sword.steel-1")), + (0.03, Item("common.items.weapons.sword.steel-2")), + (0.03, Item("common.items.weapons.sword.steel-3")), + (0.03, Item("common.items.weapons.sword.steel-4")), + (0.03, Item("common.items.weapons.sword.steel-5")), + (0.03, Item("common.items.weapons.sword.steel-6")), + (0.03, Item("common.items.weapons.sword.steel-7")), + (0.03, Item("common.items.weapons.sword.steel-8")), + (0.02, Item("common.items.weapons.sword.cobalt-0")), + (0.02, Item("common.items.weapons.sword.cobalt-1")), + (0.02, Item("common.items.weapons.sword.cobalt-2")), + (0.02, Item("common.items.weapons.sword.cobalt-3")), + (0.01, Item("common.items.weapons.sword.bloodsteel-0")), + (0.01, Item("common.items.weapons.sword.bloodsteel-1")), + (0.01, Item("common.items.weapons.sword.bloodsteel-2")), + // axes + (0.02, Item("common.items.weapons.axe.bloodsteel_axe-0")), + (0.02, Item("common.items.weapons.axe.bloodsteel_axe-1")), + (0.02, Item("common.items.weapons.axe.bloodsteel_axe-2")), + (0.01, Item("common.items.weapons.axe.cobalt_axe-0")), + (0.01, Item("common.items.weapons.axe.cobalt_axe-1")), + (0.001, Item("common.items.weapons.axe.malachite_axe-0")), + (0.04, Item("common.items.weapons.axe.iron_axe-7")), + (0.04, Item("common.items.weapons.axe.iron_axe-8")), + (0.04, Item("common.items.weapons.axe.iron_axe-9")), + (0.04, Item("common.items.weapons.axe.steel_axe-0")), + (0.04, Item("common.items.weapons.axe.steel_axe-1")), + (0.04, Item("common.items.weapons.axe.steel_axe-2")), + (0.04, Item("common.items.weapons.axe.steel_axe-3")), + (0.04, Item("common.items.weapons.axe.steel_axe-4")), + (0.04, Item("common.items.weapons.axe.steel_axe-5")), + (0.04, Item("common.items.weapons.axe.steel_axe-6")), + // healing sceptre + (0.2, Item("common.items.weapons.sceptre.staff_nature")), + (0.1, Item("common.items.weapons.sceptre.fork0")), + (0.1, Item("common.items.weapons.sceptre.emerald")), + (0.1, Item("common.items.weapons.sceptre.coralline_cane")), + (0.001, Item("common.items.weapons.sceptre.sceptre_velorite_0")), + // staves + (0.2, Item("common.items.weapons.staff.bone_staff")), + (0.2, Item("common.items.weapons.staff.ley_seeker")), + (0.10, Item("common.items.weapons.staff.fiery_wishing_rod")), + (0.10, Item("common.items.weapons.staff.heated_arm")), + (0.10, Item("common.items.weapons.staff.golden_khakkara")), + (0.10, Item("common.items.weapons.staff.crimson_eye")), + (0.10, Item("common.items.weapons.staff.solar")), + (0.05, Item("common.items.weapons.staff.lava_rod")), + (0.05, Item("common.items.weapons.staff.dragon_tongue")), + (0.01, Item("common.items.weapons.staff.orc_iron")), + // hammers + (0.3, Item("common.items.weapons.hammer.cobalt_hammer-0")), + (0.3, Item("common.items.weapons.hammer.cobalt_hammer-1")), + (0.15, Item("common.items.weapons.hammer.runic_hammer")), + (0.15, Item("common.items.weapons.hammer.ramshead_hammer")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-7")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-8")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-0")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-1")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-2")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-3")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-4")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-5")), + // bows + (0.03, Item("common.items.weapons.bow.metal-0")), + (0.03, Item("common.items.weapons.bow.metal-1")), + (0.03, Item("common.items.weapons.bow.metal-2")), + (0.03, Item("common.items.weapons.bow.metal-3")), + (0.03, Item("common.items.weapons.bow.metal-4")), + (0.02, Item("common.items.weapons.bow.frostwood-0")), + (0.02, Item("common.items.weapons.bow.frostwood-1")), + (0.02, Item("common.items.weapons.bow.frostwood-2")), + (0.01, Item("common.items.weapons.bow.eldwood-0")), + (0.01, Item("common.items.weapons.bow.eldwood-1")), + (0.01, Item("common.items.weapons.bow.eldwood-2")), + (0.001, Item("common.items.weapons.bow.velorite")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/consumables.ron b/assets/common/loot_tables/consumables.ron new file mode 100644 index 0000000000..e234582077 --- /dev/null +++ b/assets/common/loot_tables/consumables.ron @@ -0,0 +1,14 @@ +[ + // potions + (1.0, Item("common.items.consumable.potion_minor")), + (0.1, Item("common.items.consumable.potion_med")), + (0.01, Item("common.items.consumable.potion_big")), + // bombs + (0.6, Item("common.items.utility.bomb")), + (0.2, Item("common.items.utility.bomb_pile")), + // velorite + (1.0, Item("common.items.ore.veloritefrag")), + (0.5, Item("common.items.ore.velorite")), + // misc + (0.1, Item("common.items.utility.collar")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/crafting.ron b/assets/common/loot_tables/crafting.ron new file mode 100644 index 0000000000..d66fb70e63 --- /dev/null +++ b/assets/common/loot_tables/crafting.ron @@ -0,0 +1,12 @@ +[ + // 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")), + (0.35, Item("common.items.crafting_ing.emerald")), + (0.25, Item("common.items.crafting_ing.ruby")), + (0.1, Item("common.items.crafting_ing.diamond")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/cultists.ron b/assets/common/loot_tables/cultists.ron new file mode 100644 index 0000000000..fe76e4b3d3 --- /dev/null +++ b/assets/common/loot_tables/cultists.ron @@ -0,0 +1,188 @@ +[ + (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")), + (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")), + (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")), + (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")), + (0.1, Item("common.items.weapons.sword.wood-1")), + (0.1, Item("common.items.weapons.sword.wood-2")), + (0.1, Item("common.items.weapons.sword.stone-0")), + (0.1, Item("common.items.weapons.sword.stone-1")), + (0.1, Item("common.items.weapons.sword.stone-2")), + (0.05, Item("common.items.weapons.sword.bronze-0")), + (0.05, Item("common.items.weapons.sword.bronze-1")), + (0.05, Item("common.items.weapons.sword.bronze-2")), + (0.2, Item("common.items.weapons.axe.orc_axe-0")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-0")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-1")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-2")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-3")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-4")), + (0.25, Item("common.items.weapons.sceptre.staff_nature")), + (0.15, Item("common.items.weapons.hammer.flimsy_hammer")), + (0.1, Item("common.items.weapons.hammer.wood_hammer-0")), + (0.1, Item("common.items.weapons.hammer.stone_hammer-0")), + (0.1, Item("common.items.weapons.hammer.stone_hammer-1")), + (0.1, Item("common.items.weapons.hammer.stone_hammer-2")), + (0.1, Item("common.items.weapons.hammer.stone_hammer-3")), + (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-0")), + (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-1")), + (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-2")), + (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-3")), + (0.2, Item("common.items.weapons.bow.rawwood-0")), + (0.2, Item("common.items.weapons.bow.rawwood-1")), + (0.1, Item("common.items.weapons.bow.wood-0")), + (0.1, Item("common.items.weapons.bow.wood-1")), + (0.1, Item("common.items.weapons.bow.wood-2")), + (0.1, Item("common.items.weapons.bow.wood-3")), + (0.1, Item("common.items.weapons.bow.wood-4")), + (0.05, Item("common.items.weapons.bow.bone-0")), + (0.05, Item("common.items.weapons.bow.bone-1")), + (0.05, Item("common.items.weapons.bow.bone-2")), + (0.05, Item("common.items.weapons.bow.bone-3")), + (0.04, Item("common.items.weapons.sword.iron-0")), + (0.04, Item("common.items.weapons.sword.iron-1")), + (0.04, Item("common.items.weapons.sword.iron-2")), + (0.04, Item("common.items.weapons.sword.iron-3")), + (0.04, Item("common.items.weapons.sword.iron-4")), + (0.04, Item("common.items.weapons.sword.iron-5")), + (0.04, Item("common.items.weapons.sword.iron-6")), + (0.04, Item("common.items.weapons.sword.iron-7")), + (0.04, Item("common.items.weapons.sword.iron-8")), + (0.04, Item("common.items.weapons.sword.iron-9")), + (0.04, Item("common.items.weapons.sword.iron-10")), + (0.03, Item("common.items.weapons.sword.steel-0")), + (0.03, Item("common.items.weapons.sword.steel-1")), + (0.03, Item("common.items.weapons.sword.steel-2")), + (0.03, Item("common.items.weapons.sword.steel-3")), + (0.03, Item("common.items.weapons.sword.steel-4")), + (0.03, Item("common.items.weapons.sword.steel-5")), + (0.03, Item("common.items.weapons.sword.steel-6")), + (0.03, Item("common.items.weapons.sword.steel-7")), + (0.03, Item("common.items.weapons.sword.steel-8")), + (0.15, Item("common.items.weapons.axe.bronze_axe-0")), + (0.15, Item("common.items.weapons.axe.bronze_axe-1")), + (0.15, Item("common.items.weapons.axe.bronze_axe-2")), + (0.04, Item("common.items.weapons.axe.iron_axe-0")), + (0.04, Item("common.items.weapons.axe.iron_axe-1")), + (0.04, Item("common.items.weapons.axe.iron_axe-2")), + (0.04, Item("common.items.weapons.axe.iron_axe-3")), + (0.04, Item("common.items.weapons.axe.iron_axe-4")), + (0.04, Item("common.items.weapons.axe.iron_axe-5")), + (0.04, Item("common.items.weapons.axe.iron_axe-6")), + (0.04, Item("common.items.weapons.axe.iron_axe-7")), + (0.04, Item("common.items.weapons.axe.iron_axe-8")), + (0.04, Item("common.items.weapons.axe.iron_axe-9")), + (0.04, Item("common.items.weapons.axe.steel_axe-0")), + (0.04, Item("common.items.weapons.axe.steel_axe-1")), + (0.04, Item("common.items.weapons.axe.steel_axe-2")), + (0.04, Item("common.items.weapons.axe.steel_axe-3")), + (0.04, Item("common.items.weapons.axe.steel_axe-4")), + (0.04, Item("common.items.weapons.axe.steel_axe-5")), + (0.04, Item("common.items.weapons.axe.steel_axe-6")), + (0.5, Item("common.items.weapons.sceptre.staff_nature")), + (0.4, Item("common.items.weapons.staff.bone_staff")), + (0.40, Item("common.items.weapons.staff.crimson_eye")), + (0.2, Item("common.items.weapons.staff.aurora")), + (0.20, Item("common.items.weapons.staff.frostwood_torch")), + (0.15, Item("common.items.weapons.hammer.bronze_hammer-0")), + (0.15, Item("common.items.weapons.hammer.bronze_hammer-1")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-0")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-1")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-2")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-3")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-4")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-5")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-6")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-7")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-8")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-0")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-1")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-2")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-3")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-4")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-5")), + (0.04, Item("common.items.weapons.bow.hardwood-0")), + (0.04, Item("common.items.weapons.bow.hardwood-1")), + (0.04, Item("common.items.weapons.bow.hardwood-2")), + (0.04, Item("common.items.weapons.bow.hardwood-3")), + (0.04, Item("common.items.weapons.bow.hardwood-4")), + (0.04, Item("common.items.weapons.bow.hardwood-5")), + (0.03, Item("common.items.weapons.bow.metal-0")), + (0.03, Item("common.items.weapons.bow.metal-1")), + (0.03, Item("common.items.weapons.bow.metal-2")), + (0.03, Item("common.items.weapons.bow.metal-3")), + (0.03, Item("common.items.weapons.bow.metal-4")), + (0.2, Item("common.items.weapons.sword.cobalt-0")), + (0.2, Item("common.items.weapons.sword.cobalt-1")), + (0.2, Item("common.items.weapons.sword.cobalt-2")), + (0.2, Item("common.items.weapons.sword.cobalt-3")), + (0.1, Item("common.items.weapons.sword.bloodsteel-0")), + (0.1, Item("common.items.weapons.sword.bloodsteel-1")), + (0.1, Item("common.items.weapons.sword.bloodsteel-2")), + (0.2, Item("common.items.weapons.axe.bloodsteel_axe-0")), + (0.2, Item("common.items.weapons.axe.bloodsteel_axe-1")), + (0.2, Item("common.items.weapons.axe.bloodsteel_axe-2")), + (0.25, Item("common.items.weapons.sceptre.staff_nature")), + (0.2, Item("common.items.weapons.staff.infused_tower")), + (0.10, Item("common.items.weapons.staff.lava_rod")), + (0.10, Item("common.items.weapons.staff.dragon_tongue")), + (0.1, Item("common.items.weapons.staff.flamethrower_0")), + (0.04, Item("common.items.weapons.staff.bent_fuse")), + (0.04, Item("common.items.weapons.sceptre.emerald")), + (0.04, Item("common.items.weapons.staff.orc_iron")), + (0.01, Item("common.items.weapons.hammer.cobalt_hammer-0")), + (0.01, Item("common.items.weapons.hammer.cobalt_hammer-1")), + (0.01, Item("common.items.weapons.hammer.runic_hammer")), + (0.1, Item("common.items.weapons.hammer.ramshead_hammer")), + (0.2, Item("common.items.weapons.bow.frostwood-0")), + (0.2, Item("common.items.weapons.bow.frostwood-1")), + (0.2, Item("common.items.weapons.bow.frostwood-2")), + (0.1, Item("common.items.weapons.bow.eldwood-0")), + (0.1, Item("common.items.weapons.bow.eldwood-1")), + (0.1, Item("common.items.weapons.bow.eldwood-2")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/fallback.ron b/assets/common/loot_tables/fallback.ron new file mode 100644 index 0000000000..781d5d2999 --- /dev/null +++ b/assets/common/loot_tables/fallback.ron @@ -0,0 +1,4 @@ +[ + // Fallback loot table + (1.0, Item("common.items.food.cheese")), +] diff --git a/assets/common/loot_tables/fish.ron b/assets/common/loot_tables/fish.ron new file mode 100644 index 0000000000..edfafbbe43 --- /dev/null +++ b/assets/common/loot_tables/fish.ron @@ -0,0 +1,3 @@ +[ + (1.0, Item("common.items.food.fish")), +] diff --git a/assets/common/loot_tables/food.ron b/assets/common/loot_tables/food.ron new file mode 100644 index 0000000000..1d631f5cef --- /dev/null +++ b/assets/common/loot_tables/food.ron @@ -0,0 +1,14 @@ +[ + // 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/humanoids.ron b/assets/common/loot_tables/humanoids.ron new file mode 100644 index 0000000000..baf4a1ed6b --- /dev/null +++ b/assets/common/loot_tables/humanoids.ron @@ -0,0 +1,31 @@ +[ + // 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")), + // Consumables + (0.2, Item("common.items.consumable.potion_minor")), + // Ring + (0.02, Item("common.items.armor.misc.ring.gold")), + // 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")), + // Weapons + (0.1, Item("common.items.weapons.sword.wood-0")), + (0.1, Item("common.items.weapons.sword.wood-1")), + (0.1, Item("common.items.weapons.sword.wood-2")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-0")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-1")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-2")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-3")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-4")), + (0.25, Item("common.items.weapons.sceptre.staff_nature")), + (0.15, Item("common.items.weapons.hammer.flimsy_hammer")), + (0.1, Item("common.items.weapons.hammer.wood_hammer-0")), + (0.15, Item("common.items.weapons.bow.rawwood-0")), + (0.15, Item("common.items.weapons.bow.rawwood-1")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/husk.ron b/assets/common/loot_tables/husk.ron new file mode 100644 index 0000000000..be0a0aeef5 --- /dev/null +++ b/assets/common/loot_tables/husk.ron @@ -0,0 +1,3 @@ +[ + (1.0, Item("common.items.crafting_ing.stones")), +] diff --git a/assets/common/loot_tables/loot_table.ron b/assets/common/loot_tables/loot_table.ron deleted file mode 100644 index 9504a3ce9d..0000000000 --- a/assets/common/loot_tables/loot_table.ron +++ /dev/null @@ -1,4 +0,0 @@ -[ - // Fallback loot table - (1, "common.items.food.mushroom"), -] diff --git a/assets/common/loot_tables/loot_table_animal_ice.ron b/assets/common/loot_tables/loot_table_animal_ice.ron deleted file mode 100644 index a1ca41a531..0000000000 --- a/assets/common/loot_tables/loot_table_animal_ice.ron +++ /dev/null @@ -1,4 +0,0 @@ -[ - (2, "common.items.crafting_ing.icy_fang"), - (1, "common.items.crafting_ing.leather_scraps"), -] diff --git a/assets/common/loot_tables/loot_table_animal_parts.ron b/assets/common/loot_tables/loot_table_animal_parts.ron deleted file mode 100644 index 6358ba4cbe..0000000000 --- a/assets/common/loot_tables/loot_table_animal_parts.ron +++ /dev/null @@ -1,3 +0,0 @@ -[ - (2, "common.items.crafting_ing.leather_scraps"), -] diff --git a/assets/common/loot_tables/loot_table_armor_cloth.ron b/assets/common/loot_tables/loot_table_armor_cloth.ron deleted file mode 100644 index e05ff8303a..0000000000 --- a/assets/common/loot_tables/loot_table_armor_cloth.ron +++ /dev/null @@ -1,38 +0,0 @@ -[ - // belts - (0.33, "common.items.armor.cloth_blue.belt"), - (0.33, "common.items.armor.cloth_green.belt"), - (0.33, "common.items.armor.cloth_purple.belt"), - // chests - (0.08, "common.items.armor.cloth_blue.chest"), - (0.08, "common.items.armor.cloth_green.chest"), - (0.08, "common.items.armor.cloth_purple.chest"), - (0.08, "common.items.armor.misc.chest.worker_green_0"), - (0.08, "common.items.armor.misc.chest.worker_green_1"), - (0.08, "common.items.armor.misc.chest.worker_orange_0"), - (0.08, "common.items.armor.misc.chest.worker_orange_1"), - (0.08, "common.items.armor.misc.chest.worker_purple_0"), - (0.08, "common.items.armor.misc.chest.worker_purple_1"), - (0.08, "common.items.armor.misc.chest.worker_red_0"), - (0.08, "common.items.armor.misc.chest.worker_red_1"), - (0.08, "common.items.armor.misc.chest.worker_yellow_0"), - (0.08, "common.items.armor.misc.chest.worker_yellow_1"), - // shoes - (0.33, "common.items.armor.cloth_blue.foot"), - (0.33, "common.items.armor.cloth_green.foot"), - (0.33, "common.items.armor.cloth_purple.foot"), - // pants - (0.25, "common.items.armor.cloth_blue.pants"), - (0.25, "common.items.armor.cloth_green.pants"), - (0.25, "common.items.armor.cloth_purple.pants"), - (0.25, "common.items.armor.misc.pants.worker_blue"), - // shoulders - (0.25, "common.items.armor.cloth_blue.shoulder_0"), - (0.25, "common.items.armor.cloth_blue.shoulder_1"), - (0.25, "common.items.armor.cloth_green.shoulder"), - (0.25, "common.items.armor.cloth_purple.shoulder"), - //gloves - (0.33, "common.items.armor.cloth_blue.hand"), - (0.33, "common.items.armor.cloth_green.hand"), - (0.33, "common.items.armor.cloth_purple.hand"), -] diff --git a/assets/common/loot_tables/loot_table_armor_heavy.ron b/assets/common/loot_tables/loot_table_armor_heavy.ron deleted file mode 100644 index d855f91675..0000000000 --- a/assets/common/loot_tables/loot_table_armor_heavy.ron +++ /dev/null @@ -1,21 +0,0 @@ -[ - // belts - (0.67, "common.items.armor.plate.belt"), - (0.33, "common.items.armor.steel.belt"), - // chests - (0.67, "common.items.armor.plate.chest"), - (0.33, "common.items.armor.steel.chest"), - // shoes - (0.67, "common.items.armor.plate.foot"), - (0.33, "common.items.armor.steel.foot"), - // pants - (0.67, "common.items.armor.plate.pants"), - (0.66, "common.items.armor.steel.pants"), - // shoulders - (0.40, "common.items.armor.plate.shoulder"), - (0.37, "common.items.armor.misc.shoulder.iron_spikes"), - (0.33, "common.items.armor.steel.shoulder"), - //gloves - (0.67, "common.items.armor.plate.hand"), - (0.33, "common.items.armor.steel.hand"), -] \ No newline at end of file diff --git a/assets/common/loot_tables/loot_table_armor_light.ron b/assets/common/loot_tables/loot_table_armor_light.ron deleted file mode 100644 index a782d48a51..0000000000 --- a/assets/common/loot_tables/loot_table_armor_light.ron +++ /dev/null @@ -1,27 +0,0 @@ -[ - // belts - (0.50, "common.items.armor.swift.belt"), - (0.50, "common.items.armor.agile.belt"), - // chests - (0.50, "common.items.armor.swift.chest"), - (0.50, "common.items.armor.agile.chest"), - // shoes - (0.50, "common.items.armor.swift.foot"), - (0.50, "common.items.armor.agile.foot"), - // pants - (0.33, "common.items.armor.swift.pants"), - (0.33, "common.items.armor.agile.pants"), - (0.33, "common.items.armor.misc.pants.hunting"), - // shoulders - (0.10, "common.items.armor.misc.shoulder.leather_strip"), - (0.20, "common.items.armor.swift.shoulder"), - (0.20, "common.items.armor.agile.shoulder"), - (0.20, "common.items.armor.agile.shoulder"), - (0.07, "common.items.armor.misc.shoulder.leather_iron_0"), - (0.07, "common.items.armor.misc.shoulder.leather_iron_1"), - (0.07, "common.items.armor.misc.shoulder.leather_iron_2"), - (0.07, "common.items.armor.misc.shoulder.leather_iron_3"), - //gloves - (0.50, "common.items.armor.swift.hand"), - (0.50, "common.items.armor.agile.hand"), -] \ No newline at end of file diff --git a/assets/common/loot_tables/loot_table_armor_misc.ron b/assets/common/loot_tables/loot_table_armor_misc.ron deleted file mode 100644 index beba2e7b11..0000000000 --- a/assets/common/loot_tables/loot_table_armor_misc.ron +++ /dev/null @@ -1,12 +0,0 @@ -[ - // rings - (0.15, "common.items.armor.misc.ring.scratched"), - (0.05, "common.items.armor.misc.ring.gold"), - // capes - (0.25, "common.items.armor.misc.back.short_0"), - (0.25, "common.items.armor.misc.back.short_1"), - // necks - (0.25, "common.items.armor.misc.neck.plain_0"), - // misc - (0.05, "common.items.glider.glider_blue"), -] \ No newline at end of file diff --git a/assets/common/loot_tables/loot_table_armor_nature.ron b/assets/common/loot_tables/loot_table_armor_nature.ron deleted file mode 100644 index 1bb0bb6531..0000000000 --- a/assets/common/loot_tables/loot_table_armor_nature.ron +++ /dev/null @@ -1,32 +0,0 @@ -[ - // belts - (0.40, "common.items.armor.druid.belt"), - (0.20, "common.items.armor.twigs.belt"), - (0.20, "common.items.armor.twigsflowers.belt"), - (0.20, "common.items.armor.twigsleaves.belt"), - // chests - (0.40, "common.items.armor.druid.chest"), - (0.20, "common.items.armor.twigs.chest"), - (0.20, "common.items.armor.twigsflowers.chest"), - (0.20, "common.items.armor.twigsleaves.chest"), - // shoes - (0.40, "common.items.armor.druid.foot"), - (0.20, "common.items.armor.twigs.foot"), - (0.20, "common.items.armor.twigsflowers.foot"), - (0.20, "common.items.armor.twigsleaves.foot"), - // pants - (0.40, "common.items.armor.druid.pants"), - (0.20, "common.items.armor.twigs.pants"), - (0.20, "common.items.armor.twigsflowers.pants"), - (0.20, "common.items.armor.twigsleaves.pants"), - // shoulders - (0.40, "common.items.armor.druid.shoulder"), - (0.20, "common.items.armor.twigs.shoulder"), - (0.20, "common.items.armor.twigsflowers.shoulder"), - (0.20, "common.items.armor.twigsleaves.shoulder"), - //gloves - (0.40, "common.items.armor.druid.hand"), - (0.20, "common.items.armor.twigs.hand"), - (0.20, "common.items.armor.twigsflowers.hand"), - (0.20, "common.items.armor.twigsleaves.hand"), -] \ No newline at end of file diff --git a/assets/common/loot_tables/loot_table_cave_large.ron b/assets/common/loot_tables/loot_table_cave_large.ron deleted file mode 100644 index 2a8142e807..0000000000 --- a/assets/common/loot_tables/loot_table_cave_large.ron +++ /dev/null @@ -1,91 +0,0 @@ -[ - // Misc - (0.25, "common.items.armor.misc.neck.plain_1"), - (2.0, "common.items.crafting_ing.cloth_scraps"), - (1.0, "common.items.crafting_ing.empty_vial"), - (0.1, "common.items.glider.glider_blue"), - (0.05, "common.items.glider.glider_morpho"), - (0.05, "common.items.glider.glider_monarch"), - (0.05, "common.items.glider.glider_moth"), - (0.05, "common.items.armor.misc.ring.gold"), - (0.1, "common.items.lantern.geode_purp"), - // swords - (0.03, "common.items.weapons.sword.steel-0"), - (0.03, "common.items.weapons.sword.steel-1"), - (0.03, "common.items.weapons.sword.steel-2"), - (0.03, "common.items.weapons.sword.steel-3"), - (0.03, "common.items.weapons.sword.steel-4"), - (0.03, "common.items.weapons.sword.steel-5"), - (0.03, "common.items.weapons.sword.steel-6"), - (0.03, "common.items.weapons.sword.steel-7"), - (0.03, "common.items.weapons.sword.steel-8"), - (0.02, "common.items.weapons.sword.cobalt-0"), - (0.02, "common.items.weapons.sword.cobalt-1"), - (0.02, "common.items.weapons.sword.cobalt-2"), - (0.02, "common.items.weapons.sword.cobalt-3"), - (0.01, "common.items.weapons.sword.bloodsteel-0"), - (0.01, "common.items.weapons.sword.bloodsteel-1"), - (0.01, "common.items.weapons.sword.bloodsteel-2"), - // axes - (0.02, "common.items.weapons.axe.bloodsteel_axe-0"), - (0.02, "common.items.weapons.axe.bloodsteel_axe-1"), - (0.02, "common.items.weapons.axe.bloodsteel_axe-2"), - (0.01, "common.items.weapons.axe.cobalt_axe-0"), - (0.01, "common.items.weapons.axe.cobalt_axe-1"), - (0.001, "common.items.weapons.axe.malachite_axe-0"), - (0.04, "common.items.weapons.axe.iron_axe-7"), - (0.04, "common.items.weapons.axe.iron_axe-8"), - (0.04, "common.items.weapons.axe.iron_axe-9"), - (0.04, "common.items.weapons.axe.steel_axe-0"), - (0.04, "common.items.weapons.axe.steel_axe-1"), - (0.04, "common.items.weapons.axe.steel_axe-2"), - (0.04, "common.items.weapons.axe.steel_axe-3"), - (0.04, "common.items.weapons.axe.steel_axe-4"), - (0.04, "common.items.weapons.axe.steel_axe-5"), - (0.04, "common.items.weapons.axe.steel_axe-6"), - // healing staff - (0.2, "common.items.weapons.sceptre.staff_nature"), - (0.1, "common.items.weapons.sceptre.fork0"), - (0.1, "common.items.weapons.sceptre.emerald"), - (0.1, "common.items.weapons.sceptre.coralline_cane"), - (0.001, "common.items.weapons.sceptre.sceptre_velorite_0"), - // staves - (0.20, "common.items.weapons.staff.bone_staff"), - (0.20, "common.items.weapons.staff.ley_seeker"), - (0.10, "common.items.weapons.staff.fiery_wishing_rod"), - (0.10, "common.items.weapons.staff.heated_arm"), - (0.10, "common.items.weapons.staff.golden_khakkara"), - (0.10, "common.items.weapons.staff.crimson_eye"), - (0.10, "common.items.weapons.staff.solar"), - (0.05, "common.items.weapons.staff.lava_rod"), - (0.05, "common.items.weapons.staff.dragon_tongue"), - (0.01, "common.items.weapons.staff.orc_iron"), - // hammers - (0.30, "common.items.weapons.hammer.cobalt_hammer-0"), - (0.30, "common.items.weapons.hammer.cobalt_hammer-1"), - (0.15, "common.items.weapons.hammer.runic_hammer"), - (0.15, "common.items.weapons.hammer.ramshead_hammer"), - (0.04, "common.items.weapons.hammer.iron_hammer-7"), - (0.04, "common.items.weapons.hammer.iron_hammer-8"), - (0.05, "common.items.weapons.hammer.steel_hammer-0"), - (0.05, "common.items.weapons.hammer.steel_hammer-1"), - (0.05, "common.items.weapons.hammer.steel_hammer-2"), - (0.05, "common.items.weapons.hammer.steel_hammer-3"), - (0.05, "common.items.weapons.hammer.steel_hammer-4"), - (0.05, "common.items.weapons.hammer.steel_hammer-5"), - // bows - (0.03, "common.items.weapons.bow.metal-0"), - (0.03, "common.items.weapons.bow.metal-1"), - (0.03, "common.items.weapons.bow.metal-2"), - (0.03, "common.items.weapons.bow.metal-3"), - (0.03, "common.items.weapons.bow.metal-4"), - (0.02, "common.items.weapons.bow.frostwood-0"), - (0.02, "common.items.weapons.bow.frostwood-1"), - (0.02, "common.items.weapons.bow.frostwood-2"), - (0.01, "common.items.weapons.bow.eldwood-0"), - (0.01, "common.items.weapons.bow.eldwood-1"), - (0.01, "common.items.weapons.bow.eldwood-2"), - (0.001, "common.items.weapons.bow.velorite"), - - -] diff --git a/assets/common/loot_tables/loot_table_consumables.ron b/assets/common/loot_tables/loot_table_consumables.ron deleted file mode 100644 index f4dfab8089..0000000000 --- a/assets/common/loot_tables/loot_table_consumables.ron +++ /dev/null @@ -1,14 +0,0 @@ -[ - // potions - (1, "common.items.consumable.potion_minor"), - (0.1, "common.items.consumable.potion_med"), - (0.01, "common.items.consumable.potion_big"), - // bombs - (0.6, "common.items.utility.bomb"), - (0.2, "common.items.utility.bomb_pile"), - // velorite - (1, "common.items.ore.veloritefrag"), - (0.5, "common.items.ore.velorite"), - // misc - (0.1, "common.items.utility.collar"), -] \ No newline at end of file diff --git a/assets/common/loot_tables/loot_table_crafting.ron b/assets/common/loot_tables/loot_table_crafting.ron deleted file mode 100644 index a4eb6e81aa..0000000000 --- a/assets/common/loot_tables/loot_table_crafting.ron +++ /dev/null @@ -1,13 +0,0 @@ -[ - // crafting ingredients - (2, "common.items.crafting_ing.leather_scraps"), - (4, "common.items.crafting_ing.cloth_scraps"), - (1, "common.items.crafting_ing.empty_vial"), - (0.5, "common.items.crafting_ing.amethyst"), - (0.5, "common.items.crafting_ing.topaz"), - (0.4, "common.items.crafting_ing.sapphire"), - (0.35, "common.items.crafting_ing.emerald"), - (0.25, "common.items.crafting_ing.ruby"), - (0.10, "common.items.crafting_ing.diamond"), - -] diff --git a/assets/common/loot_tables/loot_table_cultists.ron b/assets/common/loot_tables/loot_table_cultists.ron deleted file mode 100644 index b2357169b9..0000000000 --- a/assets/common/loot_tables/loot_table_cultists.ron +++ /dev/null @@ -1,227 +0,0 @@ -[ - // Food - // simple - (3, "common.items.food.cheese"), - (3, "common.items.food.apple"), - (3, "common.items.food.mushroom"), - (3, "common.items.food.coconut"), - (5, "common.items.crafting_ing.cloth_scraps"), - // crafted - (0.5, "common.items.food.apple_mushroom_curry"), - (0.5, "common.items.food.apple_stick"), - (0.5, "common.items.food.mushroom_stick"), - // Misc - (4, "common.items.crafting_ing.empty_vial"), - (0.25, "common.items.armor.misc.neck.plain_1"), - (0.1, "common.items.glider.glider_blue"), - (0.5, "common.items.utility.firework_purple"), - (0.5, "common.items.utility.bomb"), - (0.5, "common.items.armor.misc.ring.gold"), - (0.25, "common.items.armor.misc.ring.skull"), - // Heavy Armour - // belts - (0.5, "common.items.armor.plate.belt"), - (0.3, "common.items.armor.steel.belt"), - // chests - (0.5, "common.items.armor.plate.chest"), - (0.3, "common.items.armor.steel.chest"), - // shoes - (0.5, "common.items.armor.plate.foot"), - (0.3, "common.items.armor.steel.foot"), - // pants - (0.5, "common.items.armor.plate.pants"), - (0.3, "common.items.armor.steel.pants"), - // shoulders - (0.40, "common.items.armor.plate.shoulder"), - (0.37, "common.items.armor.misc.shoulder.iron_spikes"), - (0.33, "common.items.armor.steel.shoulder"), - //gloves - (0.67, "common.items.armor.plate.hand"), - (0.33, "common.items.armor.steel.hand"), - //Light Armour - // belts - (0.50, "common.items.armor.swift.belt"), - (0.50, "common.items.armor.agile.belt"), - // chests - (0.50, "common.items.armor.swift.chest"), - (0.50, "common.items.armor.agile.chest"), - // shoes - (0.50, "common.items.armor.swift.foot"), - (0.50, "common.items.armor.agile.foot"), - // pants - (0.33, "common.items.armor.swift.pants"), - (0.33, "common.items.armor.agile.pants"), - (0.33, "common.items.armor.misc.pants.hunting"), - // shoulders - (0.6, "common.items.armor.misc.shoulder.leather_strip"), - (0.4, "common.items.armor.swift.shoulder"), - (0.4, "common.items.armor.agile.shoulder"), - (0.3, "common.items.armor.misc.shoulder.leather_iron_0"), - (0.3, "common.items.armor.misc.shoulder.leather_iron_1"), - (0.3, "common.items.armor.misc.shoulder.leather_iron_2"), - (0.3, "common.items.armor.misc.shoulder.leather_iron_3"), - //gloves - (0.50, "common.items.armor.swift.hand"), - (0.50, "common.items.armor.agile.hand"), - //backpack - (0.001, "common.items.armor.misc.back.backpack"), - (0.1, "common.items.armor.misc.bag.heavy_seabag"), - // Common Weapons - // swords - (0.10, "common.items.weapons.sword.wood-0"), - (0.10, "common.items.weapons.sword.wood-1"), - (0.10, "common.items.weapons.sword.wood-2"), - (0.10, "common.items.weapons.sword.stone-0"), - (0.10, "common.items.weapons.sword.stone-1"), - (0.10, "common.items.weapons.sword.stone-2"), - (0.05, "common.items.weapons.sword.bronze-0"), - (0.05, "common.items.weapons.sword.bronze-1"), - (0.05, "common.items.weapons.sword.bronze-2"), - // axes - (0.20, "common.items.weapons.axe.orc_axe-0"), - (0.10, "common.items.weapons.axe.worn_iron_axe-0"), - (0.10, "common.items.weapons.axe.worn_iron_axe-1"), - (0.10, "common.items.weapons.axe.worn_iron_axe-2"), - (0.10, "common.items.weapons.axe.worn_iron_axe-3"), - (0.10, "common.items.weapons.axe.worn_iron_axe-4"), - // healing staff - (0.25, "common.items.weapons.sceptre.staff_nature"), - // hammers - (0.15, "common.items.weapons.hammer.flimsy_hammer"), - (0.10, "common.items.weapons.hammer.wood_hammer-0"), - (0.10, "common.items.weapons.hammer.stone_hammer-0"), - (0.10, "common.items.weapons.hammer.stone_hammer-1"), - (0.10, "common.items.weapons.hammer.stone_hammer-2"), - (0.10, "common.items.weapons.hammer.stone_hammer-3"), - (0.05, "common.items.weapons.hammer.worn_iron_hammer-0"), - (0.05, "common.items.weapons.hammer.worn_iron_hammer-1"), - (0.05, "common.items.weapons.hammer.worn_iron_hammer-2"), - (0.05, "common.items.weapons.hammer.worn_iron_hammer-3"), - // bows - (0.20, "common.items.weapons.bow.rawwood-0"), - (0.20, "common.items.weapons.bow.rawwood-1"), - (0.10, "common.items.weapons.bow.wood-0"), - (0.10, "common.items.weapons.bow.wood-1"), - (0.10, "common.items.weapons.bow.wood-2"), - (0.10, "common.items.weapons.bow.wood-3"), - (0.10, "common.items.weapons.bow.wood-4"), - (0.05, "common.items.weapons.bow.bone-0"), - (0.05, "common.items.weapons.bow.bone-1"), - (0.05, "common.items.weapons.bow.bone-2"), - (0.05, "common.items.weapons.bow.bone-3"), - // Uncommon Weapons - // swords - (0.04, "common.items.weapons.sword.iron-0"), - (0.04, "common.items.weapons.sword.iron-1"), - (0.04, "common.items.weapons.sword.iron-2"), - (0.04, "common.items.weapons.sword.iron-3"), - (0.04, "common.items.weapons.sword.iron-4"), - (0.04, "common.items.weapons.sword.iron-5"), - (0.04, "common.items.weapons.sword.iron-6"), - (0.04, "common.items.weapons.sword.iron-7"), - (0.04, "common.items.weapons.sword.iron-8"), - (0.04, "common.items.weapons.sword.iron-9"), - (0.04, "common.items.weapons.sword.iron-10"), - (0.03, "common.items.weapons.sword.steel-0"), - (0.03, "common.items.weapons.sword.steel-1"), - (0.03, "common.items.weapons.sword.steel-2"), - (0.03, "common.items.weapons.sword.steel-3"), - (0.03, "common.items.weapons.sword.steel-4"), - (0.03, "common.items.weapons.sword.steel-5"), - (0.03, "common.items.weapons.sword.steel-6"), - (0.03, "common.items.weapons.sword.steel-7"), - (0.03, "common.items.weapons.sword.steel-8"), - // axes - (0.15, "common.items.weapons.axe.bronze_axe-0"), - (0.15, "common.items.weapons.axe.bronze_axe-1"), - (0.15, "common.items.weapons.axe.bronze_axe-2"), - (0.04, "common.items.weapons.axe.iron_axe-0"), - (0.04, "common.items.weapons.axe.iron_axe-1"), - (0.04, "common.items.weapons.axe.iron_axe-2"), - (0.04, "common.items.weapons.axe.iron_axe-3"), - (0.04, "common.items.weapons.axe.iron_axe-4"), - (0.04, "common.items.weapons.axe.iron_axe-5"), - (0.04, "common.items.weapons.axe.iron_axe-6"), - (0.04, "common.items.weapons.axe.iron_axe-7"), - (0.04, "common.items.weapons.axe.iron_axe-8"), - (0.04, "common.items.weapons.axe.iron_axe-9"), - (0.04, "common.items.weapons.axe.steel_axe-0"), - (0.04, "common.items.weapons.axe.steel_axe-1"), - (0.04, "common.items.weapons.axe.steel_axe-2"), - (0.04, "common.items.weapons.axe.steel_axe-3"), - (0.04, "common.items.weapons.axe.steel_axe-4"), - (0.04, "common.items.weapons.axe.steel_axe-5"), - (0.04, "common.items.weapons.axe.steel_axe-6"), - // healing staff - (0.5, "common.items.weapons.sceptre.staff_nature"), - // staves - (0.40, "common.items.weapons.staff.bone_staff"), - (0.40, "common.items.weapons.staff.crimson_eye"), - (0.20, "common.items.weapons.staff.aurora"), - (0.20, "common.items.weapons.staff.frostwood_torch"), - // hammers - (0.15, "common.items.weapons.hammer.bronze_hammer-0"), - (0.15, "common.items.weapons.hammer.bronze_hammer-1"), - (0.04, "common.items.weapons.hammer.iron_hammer-0"), - (0.04, "common.items.weapons.hammer.iron_hammer-1"), - (0.04, "common.items.weapons.hammer.iron_hammer-2"), - (0.04, "common.items.weapons.hammer.iron_hammer-3"), - (0.04, "common.items.weapons.hammer.iron_hammer-4"), - (0.04, "common.items.weapons.hammer.iron_hammer-5"), - (0.04, "common.items.weapons.hammer.iron_hammer-6"), - (0.04, "common.items.weapons.hammer.iron_hammer-7"), - (0.04, "common.items.weapons.hammer.iron_hammer-8"), - (0.05, "common.items.weapons.hammer.steel_hammer-0"), - (0.05, "common.items.weapons.hammer.steel_hammer-1"), - (0.05, "common.items.weapons.hammer.steel_hammer-2"), - (0.05, "common.items.weapons.hammer.steel_hammer-3"), - (0.05, "common.items.weapons.hammer.steel_hammer-4"), - (0.05, "common.items.weapons.hammer.steel_hammer-5"), - // bows - (0.04, "common.items.weapons.bow.hardwood-0"), - (0.04, "common.items.weapons.bow.hardwood-1"), - (0.04, "common.items.weapons.bow.hardwood-2"), - (0.04, "common.items.weapons.bow.hardwood-3"), - (0.04, "common.items.weapons.bow.hardwood-4"), - (0.04, "common.items.weapons.bow.hardwood-5"), - (0.03, "common.items.weapons.bow.metal-0"), - (0.03, "common.items.weapons.bow.metal-1"), - (0.03, "common.items.weapons.bow.metal-2"), - (0.03, "common.items.weapons.bow.metal-3"), - (0.03, "common.items.weapons.bow.metal-4"), - // Rare Weapons - // swords - (0.20, "common.items.weapons.sword.cobalt-0"), - (0.20, "common.items.weapons.sword.cobalt-1"), - (0.20, "common.items.weapons.sword.cobalt-2"), - (0.20, "common.items.weapons.sword.cobalt-3"), - (0.10, "common.items.weapons.sword.bloodsteel-0"), - (0.10, "common.items.weapons.sword.bloodsteel-1"), - (0.10, "common.items.weapons.sword.bloodsteel-2"), - // axes - (0.20, "common.items.weapons.axe.bloodsteel_axe-0"), - (0.20, "common.items.weapons.axe.bloodsteel_axe-1"), - (0.20, "common.items.weapons.axe.bloodsteel_axe-2"), - // healing staff - (0.25, "common.items.weapons.sceptre.staff_nature"), - // staves - (0.2, "common.items.weapons.staff.infused_tower"), - (0.10, "common.items.weapons.staff.lava_rod"), - (0.10, "common.items.weapons.staff.dragon_tongue"), - (0.10, "common.items.weapons.staff.flamethrower_0"), - (0.04, "common.items.weapons.staff.bent_fuse"), - (0.04, "common.items.weapons.sceptre.emerald"), - (0.04, "common.items.weapons.staff.orc_iron"), - // hammers - (0.01, "common.items.weapons.hammer.cobalt_hammer-0"), - (0.01, "common.items.weapons.hammer.cobalt_hammer-1"), - (0.01, "common.items.weapons.hammer.runic_hammer"), - (0.1, "common.items.weapons.hammer.ramshead_hammer"), - // bows - (0.20, "common.items.weapons.bow.frostwood-0"), - (0.20, "common.items.weapons.bow.frostwood-1"), - (0.20, "common.items.weapons.bow.frostwood-2"), - (0.10, "common.items.weapons.bow.eldwood-0"), - (0.10, "common.items.weapons.bow.eldwood-1"), - (0.10, "common.items.weapons.bow.eldwood-2"), -] \ No newline at end of file diff --git a/assets/common/loot_tables/loot_table_fish.ron b/assets/common/loot_tables/loot_table_fish.ron deleted file mode 100644 index c7268289e5..0000000000 --- a/assets/common/loot_tables/loot_table_fish.ron +++ /dev/null @@ -1,3 +0,0 @@ -[ - (1, "common.items.food.fish"), -] diff --git a/assets/common/loot_tables/loot_table_food.ron b/assets/common/loot_tables/loot_table_food.ron deleted file mode 100644 index 85257308bb..0000000000 --- a/assets/common/loot_tables/loot_table_food.ron +++ /dev/null @@ -1,14 +0,0 @@ -[ - // simple - (3, "common.items.food.cheese"), - (3, "common.items.food.apple"), - (3, "common.items.food.mushroom"), - (1, "common.items.food.coconut"), - (1, "common.items.food.lettuce"), - (1, "common.items.food.tomato"), - (2, "common.items.food.carrot"), - // crafted - (0.05, "common.items.food.apple_mushroom_curry"), - (0.10, "common.items.food.apple_stick"), - (0.10, "common.items.food.mushroom_stick"), -] diff --git a/assets/common/loot_tables/loot_table_humanoids.ron b/assets/common/loot_tables/loot_table_humanoids.ron deleted file mode 100644 index cbaeadef71..0000000000 --- a/assets/common/loot_tables/loot_table_humanoids.ron +++ /dev/null @@ -1,31 +0,0 @@ -[ - // Crafting Ingredients - (2, "common.items.crafting_ing.empty_vial"), - (0.10, "common.items.crafting_ing.diamond"), - (4, "common.items.crafting_ing.cloth_scraps"), - // Consumables - (0.2, "common.items.consumable.potion_minor"), - // Ring - (0.02, "common.items.armor.misc.ring.gold"), - // Utility - (0.05, "common.items.utility.collar"), - // Food - (1, "common.items.food.coconut"), - (0.05, "common.items.food.apple_mushroom_curry"), - (0.10, "common.items.food.apple_stick"), - (0.10, "common.items.food.mushroom_stick"), - // Weapons - (0.10, "common.items.weapons.sword.wood-0"), - (0.10, "common.items.weapons.sword.wood-1"), - (0.10, "common.items.weapons.sword.wood-2"), - (0.10, "common.items.weapons.axe.worn_iron_axe-0"), - (0.10, "common.items.weapons.axe.worn_iron_axe-1"), - (0.10, "common.items.weapons.axe.worn_iron_axe-2"), - (0.10, "common.items.weapons.axe.worn_iron_axe-3"), - (0.10, "common.items.weapons.axe.worn_iron_axe-4"), - (0.25, "common.items.weapons.sceptre.staff_nature"), - (0.15, "common.items.weapons.hammer.flimsy_hammer"), - (0.10, "common.items.weapons.hammer.wood_hammer-0"), - (0.15, "common.items.weapons.bow.rawwood-0"), - (0.15, "common.items.weapons.bow.rawwood-1"), -] diff --git a/assets/common/loot_tables/loot_table_husk.ron b/assets/common/loot_tables/loot_table_husk.ron deleted file mode 100644 index eb55933d9a..0000000000 --- a/assets/common/loot_tables/loot_table_husk.ron +++ /dev/null @@ -1,3 +0,0 @@ -[ - (1, "common.items.crafting_ing.stones"), -] diff --git a/assets/common/loot_tables/loot_table_maneater.ron b/assets/common/loot_tables/loot_table_maneater.ron deleted file mode 100644 index 524a6b2030..0000000000 --- a/assets/common/loot_tables/loot_table_maneater.ron +++ /dev/null @@ -1,5 +0,0 @@ -[ - (1, "common.items.flowers.red"), - (1, "common.items.crafting_ing.twigs"), - (0.5, "common.items.food.coconut"), -] diff --git a/assets/common/loot_tables/loot_table_miniboss.ron b/assets/common/loot_tables/loot_table_miniboss.ron deleted file mode 100644 index 8c926aca5b..0000000000 --- a/assets/common/loot_tables/loot_table_miniboss.ron +++ /dev/null @@ -1,15 +0,0 @@ -[ - // armor - (1, "common.items.armor.cultist.belt"), - (1, "common.items.armor.cultist.chest"), - (1, "common.items.armor.cultist.foot"), - (1, "common.items.armor.cultist.hand"), - (1, "common.items.armor.cultist.pants"), - (1, "common.items.armor.cultist.shoulder"), - (1, "common.items.armor.misc.back.dungeon_purple"), - (1, "common.items.armor.misc.ring.skull"), - // weapons - (1, "common.items.weapons.staff.cultist_staff"), - (1, "common.items.weapons.hammer.cultist_purp_2h-0"), - (1, "common.items.weapons.sword.cultist"), -] diff --git a/assets/common/loot_tables/loot_table_raptor.ron b/assets/common/loot_tables/loot_table_raptor.ron deleted file mode 100644 index 2561842b99..0000000000 --- a/assets/common/loot_tables/loot_table_raptor.ron +++ /dev/null @@ -1,4 +0,0 @@ -[ - (2, "common.items.crafting_ing.raptor_feather"), - (1, "common.items.crafting_ing.leather_scraps"), -] diff --git a/assets/common/loot_tables/loot_table_rocks.ron b/assets/common/loot_tables/loot_table_rocks.ron deleted file mode 100644 index 83a5e7a33c..0000000000 --- a/assets/common/loot_tables/loot_table_rocks.ron +++ /dev/null @@ -1,6 +0,0 @@ -[ - (1, "common.items.crafting_ing.stones"), - (0.05, "common.items.crafting_ing.diamond"), - (0.10, "common.items.ore.velorite"), - (0.20, "common.items.ore.veloritefrag"), -] diff --git a/assets/common/loot_tables/loot_table_saurok.ron b/assets/common/loot_tables/loot_table_saurok.ron deleted file mode 100644 index 830f8dc884..0000000000 --- a/assets/common/loot_tables/loot_table_saurok.ron +++ /dev/null @@ -1,19 +0,0 @@ -[ - (2, "common.items.crafting_ing.empty_vial"), - (0.01, "common.items.crafting_ing.diamond"), - (3, "common.items.crafting_ing.cloth_scraps"), - (2, "common.items.crafting_ing.leather_scraps"), - // Consumables - (0.5, "common.items.consumable.potion_minor"), - // Ring - (0.2, "common.items.armor.misc.ring.gold"), - // Utility - (0.1, "common.items.utility.collar"), - // Bag - (0.1, "common.items.armor.misc.bag.liana_kit"), - // Food - (2.0, "common.items.food.coconut"), - (0.3, "common.items.food.apple_mushroom_curry"), - (0.6, "common.items.food.apple_stick"), - (0.8, "common.items.food.mushroom_stick"), -] \ No newline at end of file diff --git a/assets/common/loot_tables/loot_table_troll.ron b/assets/common/loot_tables/loot_table_troll.ron deleted file mode 100644 index 9c15f4cc66..0000000000 --- a/assets/common/loot_tables/loot_table_troll.ron +++ /dev/null @@ -1,4 +0,0 @@ -[ - (1, "common.items.crafting_ing.leather_troll"), - (0.25, "common.items.crafting_ing.leather_scraps"), -] \ No newline at end of file diff --git a/assets/common/loot_tables/loot_table_villager.ron b/assets/common/loot_tables/loot_table_villager.ron deleted file mode 100644 index 341a7f26d8..0000000000 --- a/assets/common/loot_tables/loot_table_villager.ron +++ /dev/null @@ -1,45 +0,0 @@ -[ - // Crafting Ingredients - (2, "common.items.crafting_ing.bowl"), - (1, "common.items.crafting_ing.empty_vial"), - (0.10, "common.items.crafting_ing.diamond"), - (1, "common.items.crafting_ing.cloth_scraps"), - // Consumables - (0.2, "common.items.consumable.potion_minor"), - // Armour - (1, "common.items.armor.misc.chest.worker_green_0"), - (1, "common.items.armor.misc.chest.worker_green_1"), - (1, "common.items.armor.misc.chest.worker_orange_0"), - (1, "common.items.armor.misc.chest.worker_orange_1"), - (1, "common.items.armor.misc.chest.worker_purple_0"), - (1, "common.items.armor.misc.chest.worker_purple_1"), - (1, "common.items.armor.misc.chest.worker_red_0"), - (1, "common.items.armor.misc.chest.worker_red_1"), - (1, "common.items.armor.misc.chest.worker_yellow_0"), - (1, "common.items.armor.misc.chest.worker_yellow_1"), - (1, "common.items.armor.misc.pants.worker_blue"), - // Utility - (0.05, "common.items.utility.collar"), - // Food - (0.5, "common.items.food.coconut"), - (0.5, "common.items.food.lettuce"), - (0.75, "common.items.food.carrot"), - (0.75, "common.items.food.tomato"), - (0.05, "common.items.food.apple_mushroom_curry"), - (0.10, "common.items.food.apple_stick"), - (0.10, "common.items.food.mushroom_stick"), - // Weapons - (0.15, "common.items.weapons.sword.wood-0"), - (0.15, "common.items.weapons.sword.wood-1"), - (0.15, "common.items.weapons.sword.wood-2"), - (0.10, "common.items.weapons.axe.worn_iron_axe-0"), - (0.10, "common.items.weapons.axe.worn_iron_axe-1"), - (0.10, "common.items.weapons.axe.worn_iron_axe-2"), - (0.10, "common.items.weapons.axe.worn_iron_axe-3"), - (0.10, "common.items.weapons.axe.worn_iron_axe-4"), - (0.25, "common.items.weapons.sceptre.staff_nature"), - (0.15, "common.items.weapons.hammer.flimsy_hammer"), - (0.10, "common.items.weapons.hammer.wood_hammer-0"), - (0.15, "common.items.weapons.bow.rawwood-0"), - (0.15, "common.items.weapons.bow.rawwood-1"), -] diff --git a/assets/common/loot_tables/loot_table_weapon_common.ron b/assets/common/loot_tables/loot_table_weapon_common.ron deleted file mode 100644 index afa2715550..0000000000 --- a/assets/common/loot_tables/loot_table_weapon_common.ron +++ /dev/null @@ -1,45 +0,0 @@ -[ - // swords - (0.15, "common.items.weapons.sword.starter"), - (0.10, "common.items.weapons.sword.wood-0"), - (0.10, "common.items.weapons.sword.wood-1"), - (0.10, "common.items.weapons.sword.wood-2"), - (0.05, "common.items.weapons.sword.stone-0"), - (0.05, "common.items.weapons.sword.stone-1"), - (0.05, "common.items.weapons.sword.stone-2"), - // axes - (0.30, "common.items.weapons.axe.starter_axe"), - (0.20, "common.items.weapons.axe.orc_axe-0"), - (0.10, "common.items.weapons.axe.worn_iron_axe-0"), - (0.10, "common.items.weapons.axe.worn_iron_axe-1"), - (0.10, "common.items.weapons.axe.worn_iron_axe-2"), - (0.10, "common.items.weapons.axe.worn_iron_axe-3"), - (0.10, "common.items.weapons.axe.worn_iron_axe-4"), - // healing staff - (0.30, "common.items.weapons.sceptre.starter_sceptre"), - (0.10, "common.items.weapons.sceptre.moon0"), - (0.10, "common.items.weapons.sceptre.druids_arbor"), - // staves - (1.00, "common.items.weapons.staff.starter_staff"), - // hammers - (0.15, "common.items.weapons.hammer.starter_hammer"), - (0.15, "common.items.weapons.hammer.flimsy_hammer"), - (0.10, "common.items.weapons.hammer.wood_hammer-0"), - (0.10, "common.items.weapons.hammer.stone_hammer-0"), - (0.10, "common.items.weapons.hammer.stone_hammer-1"), - (0.10, "common.items.weapons.hammer.stone_hammer-2"), - (0.10, "common.items.weapons.hammer.stone_hammer-3"), - (0.05, "common.items.weapons.hammer.worn_iron_hammer-0"), - (0.05, "common.items.weapons.hammer.worn_iron_hammer-1"), - (0.05, "common.items.weapons.hammer.worn_iron_hammer-2"), - (0.05, "common.items.weapons.hammer.worn_iron_hammer-3"), - // bows - (0.15, "common.items.weapons.bow.starter"), - (0.10, "common.items.weapons.bow.rawwood-0"), - (0.10, "common.items.weapons.bow.rawwood-1"), - (0.05, "common.items.weapons.bow.wood-0"), - (0.05, "common.items.weapons.bow.wood-1"), - (0.05, "common.items.weapons.bow.wood-2"), - (0.05, "common.items.weapons.bow.wood-3"), - (0.05, "common.items.weapons.bow.wood-4"), -] \ No newline at end of file diff --git a/assets/common/loot_tables/loot_table_weapon_rare.ron b/assets/common/loot_tables/loot_table_weapon_rare.ron deleted file mode 100644 index 28484be0bc..0000000000 --- a/assets/common/loot_tables/loot_table_weapon_rare.ron +++ /dev/null @@ -1,42 +0,0 @@ -[ - // swords - (0.20, "common.items.weapons.sword.cobalt-0"), - (0.20, "common.items.weapons.sword.cobalt-1"), - (0.20, "common.items.weapons.sword.cobalt-2"), - (0.20, "common.items.weapons.sword.cobalt-3"), - (0.10, "common.items.weapons.sword.bloodsteel-0"), - (0.10, "common.items.weapons.sword.bloodsteel-1"), - (0.10, "common.items.weapons.sword.bloodsteel-2"), - // axes - (0.20, "common.items.weapons.axe.bloodsteel_axe-0"), - (0.20, "common.items.weapons.axe.bloodsteel_axe-1"), - (0.20, "common.items.weapons.axe.bloodsteel_axe-2"), - (0.30, "common.items.weapons.axe.cobalt_axe-0"), - (0.30, "common.items.weapons.axe.cobalt_axe-1"), - (0.10, "common.items.weapons.axe.malachite_axe-0"), - // healing staff - (0.15, "common.items.weapons.sceptre.loops0"), - (0.10, "common.items.weapons.sceptre.fork0"), - (0.10, "common.items.weapons.sceptre.emerald"), - (0.10, "common.items.weapons.sceptre.coralline_cane"), - // staves - (1.00, "common.items.weapons.staff.crimson_eye"), - (0.7, "common.items.weapons.staff.aurora"), - (0.7, "common.items.weapons.staff.frostwood_torch"), - (0.5, "common.items.weapons.staff.lava_rod"), - (0.5, "common.items.weapons.staff.dragon_tongue"), - (0.75, "common.items.weapons.staff.infused_tower"), - (0.5, "common.items.weapons.staff.flamethrower_0"), - // hammers - (0.30, "common.items.weapons.hammer.cobalt_hammer-0"), - (0.30, "common.items.weapons.hammer.cobalt_hammer-1"), - (0.15, "common.items.weapons.hammer.runic_hammer"), - (0.15, "common.items.weapons.hammer.ramshead_hammer"), - // bows - (0.20, "common.items.weapons.bow.frostwood-0"), - (0.20, "common.items.weapons.bow.frostwood-1"), - (0.20, "common.items.weapons.bow.frostwood-2"), - (0.10, "common.items.weapons.bow.eldwood-0"), - (0.10, "common.items.weapons.bow.eldwood-1"), - (0.10, "common.items.weapons.bow.eldwood-2"), -] \ No newline at end of file diff --git a/assets/common/loot_tables/loot_table_weapon_uncommon.ron b/assets/common/loot_tables/loot_table_weapon_uncommon.ron deleted file mode 100644 index ec870786e0..0000000000 --- a/assets/common/loot_tables/loot_table_weapon_uncommon.ron +++ /dev/null @@ -1,91 +0,0 @@ -[ - // swords - (0.15, "common.items.weapons.sword.bronze-0"), - (0.15, "common.items.weapons.sword.bronze-1"), - (0.15, "common.items.weapons.sword.bronze-2"), - (0.04, "common.items.weapons.sword.iron-0"), - (0.04, "common.items.weapons.sword.iron-1"), - (0.04, "common.items.weapons.sword.iron-2"), - (0.04, "common.items.weapons.sword.iron-3"), - (0.04, "common.items.weapons.sword.iron-4"), - (0.04, "common.items.weapons.sword.iron-5"), - (0.04, "common.items.weapons.sword.iron-6"), - (0.04, "common.items.weapons.sword.iron-7"), - (0.04, "common.items.weapons.sword.iron-8"), - (0.04, "common.items.weapons.sword.iron-9"), - (0.04, "common.items.weapons.sword.iron-10"), - (0.03, "common.items.weapons.sword.steel-0"), - (0.03, "common.items.weapons.sword.steel-1"), - (0.03, "common.items.weapons.sword.steel-2"), - (0.03, "common.items.weapons.sword.steel-3"), - (0.03, "common.items.weapons.sword.steel-4"), - (0.03, "common.items.weapons.sword.steel-5"), - (0.03, "common.items.weapons.sword.steel-6"), - (0.03, "common.items.weapons.sword.steel-7"), - (0.03, "common.items.weapons.sword.steel-8"), - // axes - (0.15, "common.items.weapons.axe.bronze_axe-0"), - (0.15, "common.items.weapons.axe.bronze_axe-1"), - (0.15, "common.items.weapons.axe.bronze_axe-2"), - (0.04, "common.items.weapons.axe.iron_axe-0"), - (0.04, "common.items.weapons.axe.iron_axe-1"), - (0.04, "common.items.weapons.axe.iron_axe-2"), - (0.04, "common.items.weapons.axe.iron_axe-3"), - (0.04, "common.items.weapons.axe.iron_axe-4"), - (0.04, "common.items.weapons.axe.iron_axe-5"), - (0.04, "common.items.weapons.axe.iron_axe-6"), - (0.04, "common.items.weapons.axe.iron_axe-7"), - (0.04, "common.items.weapons.axe.iron_axe-8"), - (0.04, "common.items.weapons.axe.iron_axe-9"), - (0.04, "common.items.weapons.axe.steel_axe-0"), - (0.04, "common.items.weapons.axe.steel_axe-1"), - (0.04, "common.items.weapons.axe.steel_axe-2"), - (0.04, "common.items.weapons.axe.steel_axe-3"), - (0.04, "common.items.weapons.axe.steel_axe-4"), - (0.04, "common.items.weapons.axe.steel_axe-5"), - (0.04, "common.items.weapons.axe.steel_axe-6"), - // healing staff - (0.5, "common.items.weapons.sceptre.staff_nature"), - (0.15, "common.items.weapons.sceptre.root_green0"), - (0.25, "common.items.weapons.sceptre.totem_green"), - // staves - (1.00, "common.items.weapons.staff.bone_staff"), - (0.7, "common.items.weapons.staff.heated_arm"), - (0.7, "common.items.weapons.staff.golden_khakkara"), - (0.7, "common.items.weapons.staff.fiery_wishing_rod"), - (0.7, "common.items.weapons.staff.solar"), - // hammers - (0.15, "common.items.weapons.hammer.bronze_hammer-0"), - (0.15, "common.items.weapons.hammer.bronze_hammer-1"), - (0.04, "common.items.weapons.hammer.iron_hammer-0"), - (0.04, "common.items.weapons.hammer.iron_hammer-1"), - (0.04, "common.items.weapons.hammer.iron_hammer-2"), - (0.04, "common.items.weapons.hammer.iron_hammer-3"), - (0.04, "common.items.weapons.hammer.iron_hammer-4"), - (0.04, "common.items.weapons.hammer.iron_hammer-5"), - (0.04, "common.items.weapons.hammer.iron_hammer-6"), - (0.04, "common.items.weapons.hammer.iron_hammer-7"), - (0.04, "common.items.weapons.hammer.iron_hammer-8"), - (0.05, "common.items.weapons.hammer.steel_hammer-0"), - (0.05, "common.items.weapons.hammer.steel_hammer-1"), - (0.05, "common.items.weapons.hammer.steel_hammer-2"), - (0.05, "common.items.weapons.hammer.steel_hammer-3"), - (0.05, "common.items.weapons.hammer.steel_hammer-4"), - (0.05, "common.items.weapons.hammer.steel_hammer-5"), - // bows - (0.15, "common.items.weapons.bow.bone-0"), - (0.15, "common.items.weapons.bow.bone-1"), - (0.15, "common.items.weapons.bow.bone-2"), - (0.15, "common.items.weapons.bow.bone-3"), - (0.04, "common.items.weapons.bow.hardwood-0"), - (0.04, "common.items.weapons.bow.hardwood-1"), - (0.04, "common.items.weapons.bow.hardwood-2"), - (0.04, "common.items.weapons.bow.hardwood-3"), - (0.04, "common.items.weapons.bow.hardwood-4"), - (0.04, "common.items.weapons.bow.hardwood-5"), - (0.03, "common.items.weapons.bow.metal-0"), - (0.03, "common.items.weapons.bow.metal-1"), - (0.03, "common.items.weapons.bow.metal-2"), - (0.03, "common.items.weapons.bow.metal-3"), - (0.03, "common.items.weapons.bow.metal-4"), -] \ No newline at end of file diff --git a/assets/common/loot_tables/loot_table_wendigo.ron b/assets/common/loot_tables/loot_table_wendigo.ron deleted file mode 100644 index cb0ef91842..0000000000 --- a/assets/common/loot_tables/loot_table_wendigo.ron +++ /dev/null @@ -1,3 +0,0 @@ -[ - (1, "common.items.crafting_ing.icy_fang"), -] \ No newline at end of file diff --git a/assets/common/loot_tables/maneater.ron b/assets/common/loot_tables/maneater.ron new file mode 100644 index 0000000000..0e7d5ff5b0 --- /dev/null +++ b/assets/common/loot_tables/maneater.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.flowers.red")), + (1.0, Item("common.items.crafting_ing.twigs")), + (0.5, Item("common.items.food.coconut")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/mindflayer.ron b/assets/common/loot_tables/mindflayer.ron index d5fb91477d..d95c23599c 100644 --- a/assets/common/loot_tables/mindflayer.ron +++ b/assets/common/loot_tables/mindflayer.ron @@ -1,17 +1,16 @@ [ // Crafting material - (2.0, "common.items.crafting_ing.mindflayer_bag_damaged"), + (2.0, Item("common.items.crafting_ing.mindflayer_bag_damaged")), // Legendary weapons - (1.0, "common.items.weapons.sword.caladbolg"), - (1.0, "common.items.weapons.axe.parashu"), - (1.0, "common.items.weapons.hammer.mjolnir"), - (1.0, "common.items.weapons.bow.sagitta"), - (0.5, "common.items.weapons.staff.phoenix"), - (0.5, "common.items.weapons.staff.laevateinn"), - (0.5, "common.items.weapons.sceptre.root_evil"), - (0.5, "common.items.weapons.sceptre.caduceus"), - + (1.0, Item("common.items.weapons.sword.caladbolg")), + (1.0, Item("common.items.weapons.axe.parashu")), + (1.0, Item("common.items.weapons.hammer.mjolnir")), + (1.0, Item("common.items.weapons.bow.sagitta")), + (0.5, Item("common.items.weapons.staff.phoenix")), + (0.5, Item("common.items.weapons.staff.laevateinn")), + (0.5, Item("common.items.weapons.sceptre.root_evil")), + (0.5, Item("common.items.weapons.sceptre.caduceus")), // Rare misc items - (0.5, "common.items.boss_drops.lantern"), - (0.5, "common.items.glider.glider_purp"), + (0.5, Item("common.items.boss_drops.lantern")), + (0.5, Item("common.items.glider.glider_purp")), ] \ No newline at end of file diff --git a/assets/common/loot_tables/miniboss.ron b/assets/common/loot_tables/miniboss.ron new file mode 100644 index 0000000000..a4ab093eba --- /dev/null +++ b/assets/common/loot_tables/miniboss.ron @@ -0,0 +1,15 @@ +[ + // 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")), + (1.0, Item("common.items.armor.misc.back.dungeon_purple")), + (1.0, Item("common.items.armor.misc.ring.skull")), + // weapons + (1.0, Item("common.items.weapons.staff.cultist_staff")), + (1.0, Item("common.items.weapons.hammer.cultist_purp_2h-0")), + (1.0, Item("common.items.weapons.sword.cultist")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/raptor.ron b/assets/common/loot_tables/raptor.ron new file mode 100644 index 0000000000..5cb6de2720 --- /dev/null +++ b/assets/common/loot_tables/raptor.ron @@ -0,0 +1,4 @@ +[ + (2.0, Item("common.items.crafting_ing.raptor_feather")), + (1.0, Item("common.items.crafting_ing.leather_scraps")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/rocks.ron b/assets/common/loot_tables/rocks.ron new file mode 100644 index 0000000000..61321fafd1 --- /dev/null +++ b/assets/common/loot_tables/rocks.ron @@ -0,0 +1,6 @@ +[ + (1.0, Item("common.items.crafting_ing.stones")), + (0.05, Item("common.items.crafting_ing.diamond")), + (0.1, Item("common.items.ore.velorite")), + (0.2, Item("common.items.ore.veloritefrag")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/saurok.ron b/assets/common/loot_tables/saurok.ron new file mode 100644 index 0000000000..d338fd6f9d --- /dev/null +++ b/assets/common/loot_tables/saurok.ron @@ -0,0 +1,19 @@ +[ + (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")), + // Consumables + (0.5, Item("common.items.consumable.potion_minor")), + // Ring + (0.2, Item("common.items.armor.misc.ring.gold")), + // Utility + (0.1, Item("common.items.utility.collar")), + // 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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/troll.ron b/assets/common/loot_tables/troll.ron new file mode 100644 index 0000000000..6e758cd219 --- /dev/null +++ b/assets/common/loot_tables/troll.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.crafting_ing.leather_troll")), + (0.25, Item("common.items.crafting_ing.leather_scraps")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/villager.ron b/assets/common/loot_tables/villager.ron new file mode 100644 index 0000000000..b84678fe17 --- /dev/null +++ b/assets/common/loot_tables/villager.ron @@ -0,0 +1,45 @@ +[ + // 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")), + // Consumables + (0.2, Item("common.items.consumable.potion_minor")), + // Armour + (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_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")), + // 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")), + // Weapons + (0.15, Item("common.items.weapons.sword.wood-0")), + (0.15, Item("common.items.weapons.sword.wood-1")), + (0.15, Item("common.items.weapons.sword.wood-2")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-0")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-1")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-2")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-3")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-4")), + (0.25, Item("common.items.weapons.sceptre.staff_nature")), + (0.15, Item("common.items.weapons.hammer.flimsy_hammer")), + (0.1, Item("common.items.weapons.hammer.wood_hammer-0")), + (0.15, Item("common.items.weapons.bow.rawwood-0")), + (0.15, Item("common.items.weapons.bow.rawwood-1")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapon_common.ron b/assets/common/loot_tables/weapon_common.ron new file mode 100644 index 0000000000..c30fe31cf0 --- /dev/null +++ b/assets/common/loot_tables/weapon_common.ron @@ -0,0 +1,45 @@ +[ + // swords + (0.15, Item("common.items.weapons.sword.starter")), + (0.1, Item("common.items.weapons.sword.wood-0")), + (0.1, Item("common.items.weapons.sword.wood-1")), + (0.1, Item("common.items.weapons.sword.wood-2")), + (0.05, Item("common.items.weapons.sword.stone-0")), + (0.05, Item("common.items.weapons.sword.stone-1")), + (0.05, Item("common.items.weapons.sword.stone-2")), + // axes + (0.3, Item("common.items.weapons.axe.starter_axe")), + (0.2, Item("common.items.weapons.axe.orc_axe-0")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-0")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-1")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-2")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-3")), + (0.1, Item("common.items.weapons.axe.worn_iron_axe-4")), + // healing staff + (0.3, Item("common.items.weapons.sceptre.starter_sceptre")), + (0.10, Item("common.items.weapons.sceptre.moon0")), + (0.10, Item("common.items.weapons.sceptre.druids_arbor")), + // staves + (1.0, Item("common.items.weapons.staff.starter_staff")), + // hammers + (0.15, Item("common.items.weapons.hammer.starter_hammer")), + (0.15, Item("common.items.weapons.hammer.flimsy_hammer")), + (0.1, Item("common.items.weapons.hammer.wood_hammer-0")), + (0.1, Item("common.items.weapons.hammer.stone_hammer-0")), + (0.1, Item("common.items.weapons.hammer.stone_hammer-1")), + (0.1, Item("common.items.weapons.hammer.stone_hammer-2")), + (0.1, Item("common.items.weapons.hammer.stone_hammer-3")), + (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-0")), + (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-1")), + (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-2")), + (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-3")), + // bows + (0.15, Item("common.items.weapons.bow.starter")), + (0.1, Item("common.items.weapons.bow.rawwood-0")), + (0.1, Item("common.items.weapons.bow.rawwood-1")), + (0.05, Item("common.items.weapons.bow.wood-0")), + (0.05, Item("common.items.weapons.bow.wood-1")), + (0.05, Item("common.items.weapons.bow.wood-2")), + (0.05, Item("common.items.weapons.bow.wood-3")), + (0.05, Item("common.items.weapons.bow.wood-4")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapon_rare.ron b/assets/common/loot_tables/weapon_rare.ron new file mode 100644 index 0000000000..6850259597 --- /dev/null +++ b/assets/common/loot_tables/weapon_rare.ron @@ -0,0 +1,42 @@ +[ + // swords + (0.2, Item("common.items.weapons.sword.cobalt-0")), + (0.2, Item("common.items.weapons.sword.cobalt-1")), + (0.2, Item("common.items.weapons.sword.cobalt-2")), + (0.2, Item("common.items.weapons.sword.cobalt-3")), + (0.1, Item("common.items.weapons.sword.bloodsteel-0")), + (0.1, Item("common.items.weapons.sword.bloodsteel-1")), + (0.1, Item("common.items.weapons.sword.bloodsteel-2")), + // axes + (0.2, Item("common.items.weapons.axe.bloodsteel_axe-0")), + (0.2, Item("common.items.weapons.axe.bloodsteel_axe-1")), + (0.2, Item("common.items.weapons.axe.bloodsteel_axe-2")), + (0.3, Item("common.items.weapons.axe.cobalt_axe-0")), + (0.3, Item("common.items.weapons.axe.cobalt_axe-1")), + (0.1, Item("common.items.weapons.axe.malachite_axe-0")), + // healing sceptre + (0.15, Item("common.items.weapons.sceptre.loops0")), + (0.1, Item("common.items.weapons.sceptre.fork0")), + (0.10, Item("common.items.weapons.sceptre.emerald")), + (0.10, Item("common.items.weapons.sceptre.coralline_cane")), + // staves + (1.00, Item("common.items.weapons.staff.crimson_eye")), + (0.7, Item("common.items.weapons.staff.aurora")), + (0.7, Item("common.items.weapons.staff.frostwood_torch")), + (0.5, Item("common.items.weapons.staff.lava_rod")), + (0.5, Item("common.items.weapons.staff.dragon_tongue")), + (0.75, Item("common.items.weapons.staff.infused_tower")), + (0.5, Item("common.items.weapons.staff.flamethrower_0")), + // hammers + (0.3, Item("common.items.weapons.hammer.cobalt_hammer-0")), + (0.3, Item("common.items.weapons.hammer.cobalt_hammer-1")), + (0.15, Item("common.items.weapons.hammer.runic_hammer")), + (0.15, Item("common.items.weapons.hammer.ramshead_hammer")), + // bows + (0.2, Item("common.items.weapons.bow.frostwood-0")), + (0.2, Item("common.items.weapons.bow.frostwood-1")), + (0.2, Item("common.items.weapons.bow.frostwood-2")), + (0.1, Item("common.items.weapons.bow.eldwood-0")), + (0.1, Item("common.items.weapons.bow.eldwood-1")), + (0.1, Item("common.items.weapons.bow.eldwood-2")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapon_uncommon.ron b/assets/common/loot_tables/weapon_uncommon.ron new file mode 100644 index 0000000000..9a134d32e5 --- /dev/null +++ b/assets/common/loot_tables/weapon_uncommon.ron @@ -0,0 +1,91 @@ +[ + // swords + (0.15, Item("common.items.weapons.sword.bronze-0")), + (0.15, Item("common.items.weapons.sword.bronze-1")), + (0.15, Item("common.items.weapons.sword.bronze-2")), + (0.04, Item("common.items.weapons.sword.iron-0")), + (0.04, Item("common.items.weapons.sword.iron-1")), + (0.04, Item("common.items.weapons.sword.iron-2")), + (0.04, Item("common.items.weapons.sword.iron-3")), + (0.04, Item("common.items.weapons.sword.iron-4")), + (0.04, Item("common.items.weapons.sword.iron-5")), + (0.04, Item("common.items.weapons.sword.iron-6")), + (0.04, Item("common.items.weapons.sword.iron-7")), + (0.04, Item("common.items.weapons.sword.iron-8")), + (0.04, Item("common.items.weapons.sword.iron-9")), + (0.04, Item("common.items.weapons.sword.iron-10")), + (0.03, Item("common.items.weapons.sword.steel-0")), + (0.03, Item("common.items.weapons.sword.steel-1")), + (0.03, Item("common.items.weapons.sword.steel-2")), + (0.03, Item("common.items.weapons.sword.steel-3")), + (0.03, Item("common.items.weapons.sword.steel-4")), + (0.03, Item("common.items.weapons.sword.steel-5")), + (0.03, Item("common.items.weapons.sword.steel-6")), + (0.03, Item("common.items.weapons.sword.steel-7")), + (0.03, Item("common.items.weapons.sword.steel-8")), + // axes + (0.15, Item("common.items.weapons.axe.bronze_axe-0")), + (0.15, Item("common.items.weapons.axe.bronze_axe-1")), + (0.15, Item("common.items.weapons.axe.bronze_axe-2")), + (0.04, Item("common.items.weapons.axe.iron_axe-0")), + (0.04, Item("common.items.weapons.axe.iron_axe-1")), + (0.04, Item("common.items.weapons.axe.iron_axe-2")), + (0.04, Item("common.items.weapons.axe.iron_axe-3")), + (0.04, Item("common.items.weapons.axe.iron_axe-4")), + (0.04, Item("common.items.weapons.axe.iron_axe-5")), + (0.04, Item("common.items.weapons.axe.iron_axe-6")), + (0.04, Item("common.items.weapons.axe.iron_axe-7")), + (0.04, Item("common.items.weapons.axe.iron_axe-8")), + (0.04, Item("common.items.weapons.axe.iron_axe-9")), + (0.04, Item("common.items.weapons.axe.steel_axe-0")), + (0.04, Item("common.items.weapons.axe.steel_axe-1")), + (0.04, Item("common.items.weapons.axe.steel_axe-2")), + (0.04, Item("common.items.weapons.axe.steel_axe-3")), + (0.04, Item("common.items.weapons.axe.steel_axe-4")), + (0.04, Item("common.items.weapons.axe.steel_axe-5")), + (0.04, Item("common.items.weapons.axe.steel_axe-6")), + // healing sceptre + (0.5, Item("common.items.weapons.sceptre.staff_nature")), + (0.15, Item("common.items.weapons.sceptre.root_green0")), + (0.25, Item("common.items.weapons.sceptre.totem_green")), + // staves + (1.0, Item("common.items.weapons.staff.bone_staff")), + (0.7, Item("common.items.weapons.staff.heated_arm")), + (0.7, Item("common.items.weapons.staff.golden_khakkara")), + (0.7, Item("common.items.weapons.staff.fiery_wishing_rod")), + (0.7, Item("common.items.weapons.staff.solar")), + // hammers + (0.15, Item("common.items.weapons.hammer.bronze_hammer-0")), + (0.15, Item("common.items.weapons.hammer.bronze_hammer-1")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-0")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-1")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-2")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-3")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-4")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-5")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-6")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-7")), + (0.04, Item("common.items.weapons.hammer.iron_hammer-8")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-0")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-1")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-2")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-3")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-4")), + (0.05, Item("common.items.weapons.hammer.steel_hammer-5")), + // bows + (0.15, Item("common.items.weapons.bow.bone-0")), + (0.15, Item("common.items.weapons.bow.bone-1")), + (0.15, Item("common.items.weapons.bow.bone-2")), + (0.15, Item("common.items.weapons.bow.bone-3")), + (0.04, Item("common.items.weapons.bow.hardwood-0")), + (0.04, Item("common.items.weapons.bow.hardwood-1")), + (0.04, Item("common.items.weapons.bow.hardwood-2")), + (0.04, Item("common.items.weapons.bow.hardwood-3")), + (0.04, Item("common.items.weapons.bow.hardwood-4")), + (0.04, Item("common.items.weapons.bow.hardwood-5")), + (0.03, Item("common.items.weapons.bow.metal-0")), + (0.03, Item("common.items.weapons.bow.metal-1")), + (0.03, Item("common.items.weapons.bow.metal-2")), + (0.03, Item("common.items.weapons.bow.metal-3")), + (0.03, Item("common.items.weapons.bow.metal-4")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/wendigo.ron b/assets/common/loot_tables/wendigo.ron new file mode 100644 index 0000000000..6a47d4575b --- /dev/null +++ b/assets/common/loot_tables/wendigo.ron @@ -0,0 +1,3 @@ +[ + (1.0, Item("common.items.crafting_ing.icy_fang")), +] \ No newline at end of file diff --git a/common/src/bin/csv_export/main.rs b/common/src/bin/csv_export/main.rs index 4cccbc707d..ea3696b607 100644 --- a/common/src/bin/csv_export/main.rs +++ b/common/src/bin/csv_export/main.rs @@ -17,7 +17,7 @@ use veloren_common::{ ItemKind, }, }, - lottery::Lottery, + lottery::{Lottery, LootSpec}, }; #[derive(StructOpt)] @@ -219,11 +219,11 @@ fn all_items() -> Result<(), Box> { fn loot_table(loot_table: &str) -> Result<(), Box> { let mut wtr = csv::Writer::from_path("loot_table.csv")?; - wtr.write_record(&["Item", "Relative Chance"])?; + wtr.write_record(&["Kind", "Item", "Relative Chance"])?; let loot_table = "common.loot_tables.".to_owned() + loot_table; - let loot_table = Lottery::::load_expect(&loot_table).read(); + let loot_table = Lottery::::load_expect(&loot_table).read(); for (i, (chance, item)) in loot_table.iter().enumerate() { let chance = if let Some((next_chance, _)) = loot_table.iter().nth(i + 1) { @@ -236,7 +236,12 @@ fn loot_table(loot_table: &str) -> Result<(), Box> { .div(10_f32.powi(5)) .to_string(); - wtr.write_record(&[item, &chance])?; + let (kind, item) = match item { + LootSpec::Item(item) => ("Item", item), + LootSpec::LootTable(table) => ("LootTable", table), + }; + + wtr.write_record(&[kind, item, &chance])?; } wtr.flush()?; diff --git a/common/src/bin/csv_import/main.rs b/common/src/bin/csv_import/main.rs index ef6fd0c4da..14750b5062 100644 --- a/common/src/bin/csv_import/main.rs +++ b/common/src/bin/csv_import/main.rs @@ -6,11 +6,17 @@ use serde::Serialize; use std::{error::Error, fs::File, io::Write}; use structopt::StructOpt; -use comp::item::{ - armor::{ArmorKind, Protection}, - ItemDesc, ItemKind, ItemTag, Quality, +use veloren_common::{ + assets::ASSETS_PATH, + comp::{ + self, + item::{ + armor::{ArmorKind, Protection}, + ItemDesc, ItemKind, ItemTag, Quality, + }, + }, + lottery::LootSpec, }; -use veloren_common::{assets::ASSETS_PATH, comp}; #[derive(StructOpt)] struct Cli { @@ -372,17 +378,21 @@ fn loot_table(loot_table: &str) -> Result<(), Box> { .map(|(i, x)| (x.to_string(), i)) .collect(); - let mut items = Vec::<(f32, String)>::new(); + let mut items = Vec::<(f32, LootSpec)>::new(); for record in rdr.records() { if let Ok(ref record) = record { - let item = record.get(headers["Item"]).expect("No item"); + let item = match record.get(headers["Kind"]).expect("No loot specifier") { + "Item" => LootSpec::Item(record.get(headers["Item"]).expect("No item").to_string()), + "LootTable" => LootSpec::LootTable(record.get(headers["Item"]).expect("No loot table").to_string()), + _ => panic!("Loot specifier kind must be either \"Item\" or \"LootTable\""), + }; let chance: f32 = record .get(headers["Relative Chance"]) .expect("No chance for item in entry") .parse() .expect("Not an f32 for chance in entry"); - items.push((chance, item.to_string())); + items.push((chance, item)); } } diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index e86661dd85..ec49927469 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -13,7 +13,7 @@ use crate::{ CharacterAbility, }, effect::Effect, - lottery::Lottery, + lottery::{Lottery, LootSpec}, recipe::RecipeInput, terrain::{Block, SpriteKind}, }; @@ -601,44 +601,44 @@ impl Item { // Containers // IMPORTANT: Add any new container to `SpriteKind::is_container` SpriteKind::Chest => { - chosen = Lottery::::load_expect(match rng.gen_range(0..7) { - 0 => "common.loot_tables.loot_table_weapon_uncommon", - 1 => "common.loot_tables.loot_table_weapon_common", - 2 => "common.loot_tables.loot_table_armor_light", - 3 => "common.loot_tables.loot_table_armor_cloth", - 4 => "common.loot_tables.loot_table_armor_heavy", - _ => "common.loot_tables.loot_table_armor_misc", + chosen = Lottery::::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_light", + 3 => "common.loot_tables.armor_cloth", + 4 => "common.loot_tables.armor_heavy", + _ => "common.loot_tables.armor_misc", }) .read(); - chosen.choose() + return Some(chosen.choose().to_item()) }, SpriteKind::ChestBurried => { - chosen = Lottery::::load_expect(match rng.gen_range(0..7) { - 1 => "common.loot_tables.loot_table_weapon_common", - 2 => "common.loot_tables.loot_table_armor_light", - 3 => "common.loot_tables.loot_table_armor_cloth", - _ => "common.loot_tables.loot_table_armor_misc", + chosen = Lottery::::load_expect(match rng.gen_range(0..7) { + 1 => "common.loot_tables.weapon_common", + 2 => "common.loot_tables.armor_light", + 3 => "common.loot_tables.armor_cloth", + _ => "common.loot_tables.armor_misc", }) .read(); - chosen.choose() + return Some(chosen.choose().to_item()) }, SpriteKind::Mud => { - chosen = Lottery::::load_expect(match rng.gen_range(0..5) { - 0 => "common.loot_tables.loot_table_crafting", - 1 => "common.loot_tables.loot_table_weapon_common", - 2 => "common.loot_tables.loot_table_armor_misc", - _ => "common.loot_tables.loot_table_rocks", + chosen = Lottery::::load_expect(match rng.gen_range(0..5) { + 0 => "common.loot_tables.crafting", + 1 => "common.loot_tables.weapon_common", + 2 => "common.loot_tables.armor_misc", + _ => "common.loot_tables.rocks", }) .read(); - chosen.choose() + return Some(chosen.choose().to_item()) }, SpriteKind::Crate => { - chosen = Lottery::::load_expect(match rng.gen_range(0..4) { - 0 => "common.loot_tables.loot_table_crafting", - _ => "common.loot_tables.loot_table_food", + chosen = Lottery::::load_expect(match rng.gen_range(0..4) { + 0 => "common.loot_tables.crafting", + _ => "common.loot_tables.food", }) .read(); - chosen.choose() + return Some(chosen.choose().to_item()) }, SpriteKind::Beehive => "common.items.crafting_ing.honey", diff --git a/common/src/comp/inventory/loadout_builder.rs b/common/src/comp/inventory/loadout_builder.rs index 8986cf0aee..a928859bc2 100644 --- a/common/src/comp/inventory/loadout_builder.rs +++ b/common/src/comp/inventory/loadout_builder.rs @@ -568,18 +568,19 @@ impl LoadoutBuilder { .unwrap_or_default() / 10.0; for s in backpack.slots_mut() { - if coins > 0 { - let mut coin_item = - Item::new_from_asset_expect("common.items.utility.coins"); - coin_item - .set_amount(coins) - .expect("coins should be stackable"); - *s = Some(coin_item); - coins = 0; - } else if let Some(item_id) = TradePricing::random_item(Good::Armor, armor) - { - *s = Some(Item::new_from_asset_expect(&item_id)); - } + // TODO: Re-implement later + // if coins > 0 { + // let mut coin_item = + // Item::new_from_asset_expect("common.items.utility.coins"); + // coin_item + // .set_amount(coins) + // .expect("coins should be stackable"); + // *s = Some(coin_item); + // coins = 0; + // } else if let Some(item_id) = TradePricing::random_item(Good::Armor, armor) + // { + // *s = Some(Item::new_from_asset_expect(&item_id)); + // } } let mut bag1 = Item::new_from_asset_expect( "common.items.armor.misc.bag.reliable_backpack", @@ -591,9 +592,9 @@ impl LoadoutBuilder { .unwrap_or_default() / 10.0; for i in bag1.slots_mut() { - if let Some(item_id) = TradePricing::random_item(Good::Tools, weapon) { - *i = Some(Item::new_from_asset_expect(&item_id)); - } + // if let Some(item_id) = TradePricing::random_item(Good::Tools, weapon) { + // *i = Some(Item::new_from_asset_expect(&item_id)); + // } } let mut bag2 = Item::new_from_asset_expect( "common.items.armor.misc.bag.reliable_backpack", @@ -605,11 +606,11 @@ impl LoadoutBuilder { .unwrap_or_default() / 10.0; for i in bag2.slots_mut() { - if let Some(item_id) = - TradePricing::random_item(Good::Ingredients, ingredients) - { - *i = Some(Item::new_from_asset_expect(&item_id)); - } + // if let Some(item_id) = + // TradePricing::random_item(Good::Ingredients, ingredients) + // { + // *i = Some(Item::new_from_asset_expect(&item_id)); + // } } let mut bag3 = Item::new_from_asset_expect( "common.items.armor.misc.bag.reliable_backpack", @@ -621,9 +622,9 @@ impl LoadoutBuilder { .unwrap_or_default() / 10.0; for i in bag3.slots_mut() { - if let Some(item_id) = TradePricing::random_item(Good::Food, food) { - *i = Some(Item::new_from_asset_expect(&item_id)); - } + // if let Some(item_id) = TradePricing::random_item(Good::Food, food) { + // *i = Some(Item::new_from_asset_expect(&item_id)); + // } } let mut bag4 = Item::new_from_asset_expect( "common.items.armor.misc.bag.reliable_backpack", @@ -635,9 +636,9 @@ impl LoadoutBuilder { .unwrap_or_default() / 10.0; for i in bag4.slots_mut() { - if let Some(item_id) = TradePricing::random_item(Good::Potions, potions) { - *i = Some(Item::new_from_asset_expect(&item_id)); - } + // if let Some(item_id) = TradePricing::random_item(Good::Potions, potions) { + // *i = Some(Item::new_from_asset_expect(&item_id)); + // } } LoadoutBuilder::new() .active_item(active_item) diff --git a/common/src/comp/inventory/trade_pricing.rs b/common/src/comp/inventory/trade_pricing.rs index de4953a7cc..4797009630 100644 --- a/common/src/comp/inventory/trade_pricing.rs +++ b/common/src/comp/inventory/trade_pricing.rs @@ -184,15 +184,16 @@ impl TradePricing { let mut result = TradePricing::default(); let files = TradingPriceFile::load_expect("common.item_price_calculation"); let contents = files.read(); - for i in contents.loot_tables.iter() { - if PRICING_DEBUG { - info!(?i); - } - let loot = ProbabilityFile::load_expect(&i.1); - for j in loot.read().content.iter() { - add(&mut result.get_list_by_path_mut(&j.1), &j.1, i.0 * j.0); - } - } + // TODO: Re-enable this + // for i in contents.loot_tables.iter() { + // if PRICING_DEBUG { + // info!(?i); + // } + // let loot = ProbabilityFile::load_expect(&i.1); + // for j in loot.read().content.iter() { + // add(&mut result.get_list_by_path_mut(&j.1), &j.1, i.0 * j.0); + // } + // } // Apply recipe book let book = default_recipe_book().read(); @@ -289,27 +290,28 @@ impl TradePricing { result } - fn random_item_impl(&self, good: Good, amount: f32) -> Option { - if good == Good::Coin { - Some(TradePricing::COIN_ITEM.into()) - } else { - let table = self.get_list(good); - let upper = table.len(); - let lower = table - .iter() - .enumerate() - .find(|i| i.1.1 * amount >= 1.0) - .map(|i| i.0) - .unwrap_or(upper - 1); - let index = (rand::random::() * ((upper - lower) as f32)).floor() as usize + lower; - //.gen_range(lower..upper); - table.get(index).map(|i| i.0.clone()) - } - } + // TODO: Re-enable later + // fn random_item_impl(&self, good: Good, amount: f32) -> Option { + // if good == Good::Coin { + // Some(TradePricing::COIN_ITEM.into()) + // } else { + // let table = self.get_list(good); + // let upper = table.len(); + // let lower = table + // .iter() + // .enumerate() + // .find(|i| i.1.1 * amount >= 1.0) + // .map(|i| i.0) + // .unwrap_or(upper - 1); + // let index = (rand::random::() * ((upper - lower) as f32)).floor() as usize + lower; + // //.gen_range(lower..upper); + // table.get(index).map(|i| i.0.clone()) + // } + // } - pub fn random_item(good: Good, amount: f32) -> Option { - TRADE_PRICING.random_item_impl(good, amount) - } + // pub fn random_item(good: Good, amount: f32) -> Option { + // TRADE_PRICING.random_item_impl(good, amount) + // } pub fn get_material(item: &str) -> (Good, f32) { if item == TradePricing::COIN_ITEM { diff --git a/common/src/lottery.rs b/common/src/lottery.rs index 556008d112..3976d7a986 100644 --- a/common/src/lottery.rs +++ b/common/src/lottery.rs @@ -26,9 +26,9 @@ // Cheese drop rate = 3/X = 29.6% // Coconut drop rate = 1/X = 9.85% -use crate::assets; +use crate::{assets::{self, AssetExt}, comp::Item}; use rand::prelude::*; -use serde::{de::DeserializeOwned, Deserialize}; +use serde::{de::DeserializeOwned, Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Deserialize)] pub struct Lottery { @@ -72,6 +72,23 @@ impl Lottery { pub fn total(&self) -> f32 { self.total } } +#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] +pub enum LootSpec { + Item(String), + LootTable(String), +} + +impl LootSpec { + pub fn to_item(&self) -> Item { + match self { + Self::Item(item) => Item::new_from_asset_expect(&item), + Self::LootTable(table) => { + Lottery::::load_expect(&table).read().choose().to_item() + }, + } + } +} + #[cfg(test)] mod tests { use super::*; @@ -79,13 +96,13 @@ mod tests { #[test] fn test_loot_table() { - let test = Lottery::::load_expect("common.loot_tables.loot_table"); + let test = Lottery::::load_expect("common.loot_tables.fallback"); - for (_, item_asset_specifier) in test.read().iter() { + for (_, to_itemifier) in test.read().iter() { assert!( - Item::new_from_asset(item_asset_specifier).is_ok(), + Item::new_from_asset(to_itemifier).is_ok(), "Invalid loot table item '{}'", - item_asset_specifier + to_itemifier ); } } diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 1cbb08b29c..350bd3bdaa 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -15,10 +15,10 @@ use common::{ chat::{KillSource, KillType}, inventory::item::MaterialStatManifest, object, Alignment, Body, CharacterState, Energy, EnergyChange, Group, Health, HealthChange, - HealthSource, Inventory, Item, Player, Poise, PoiseChange, PoiseSource, Pos, Stats, + HealthSource, Inventory, Player, Poise, PoiseChange, PoiseSource, Pos, Stats, }, event::{EventBus, ServerEvent}, - lottery::Lottery, + lottery::{Lottery, LootSpec}, outcome::Outcome, resources::Time, rtsim::RtSimEntity, @@ -343,25 +343,25 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc let old_body = state.ecs().write_storage::().remove(entity); let mut rng = rand::thread_rng(); let mut lottery = || { - Lottery::::load_expect(match old_body { + Lottery::::load_expect(match old_body { Some(common::comp::Body::Humanoid(_)) => match rng.gen_range(0..4) { - 0 => "common.loot_tables.loot_table_humanoids", - 1 => "common.loot_tables.loot_table_armor_light", - 2 => "common.loot_tables.loot_table_armor_cloth", - 3 => "common.loot_tables.loot_table_weapon_common", + 0 => "common.loot_tables.humanoids", + 1 => "common.loot_tables.armor_light", + 2 => "common.loot_tables.armor_cloth", + 3 => "common.loot_tables.weapon_common", 4 => "common.loots_tables.loot_table_armor_misc", - _ => "common.loot_tables.loot_table_humanoids", + _ => "common.loot_tables.humanoids", }, Some(common::comp::Body::QuadrupedSmall(quadruped_small)) => { match quadruped_small.species { quadruped_small::Species::Dodarock => match rng.gen_range(0..6) { - 1 => "common.loot_tables.loot_table_rocks", - _ => "common.loot_tables.loot_table_rocks", + 1 => "common.loot_tables.rocks", + _ => "common.loot_tables.rocks", }, _ => match rng.gen_range(0..4) { - 0 => "common.loot_tables.loot_table_food", - 2 => "common.loot_tables.loot_table_animal_parts", - _ => "common.loot_tables.loot_table_animal_parts", + 0 => "common.loot_tables.food", + 2 => "common.loot_tables.animal_parts", + _ => "common.loot_tables.animal_parts", }, } }, @@ -369,82 +369,82 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc match quadruped_medium.species { quadruped_medium::Species::Frostfang | quadruped_medium::Species::Roshwalr => { - "common.loot_tables.loot_table_animal_ice" + "common.loot_tables.animal_ice" }, _ => match rng.gen_range(0..4) { - 0 => "common.loot_tables.loot_table_food", - 2 => "common.loot_tables.loot_table_animal_parts", - _ => "common.loot_tables.loot_table_animal_parts", + 0 => "common.loot_tables.food", + 2 => "common.loot_tables.animal_parts", + _ => "common.loot_tables.animal_parts", }, } }, Some(common::comp::Body::BirdMedium(_)) => match rng.gen_range(0..3) { - 0 => "common.loot_tables.loot_table_food", - _ => "common.loot_tables.loot_table", + 0 => "common.loot_tables.food", + _ => "common.loot_tables.fallback", }, - Some(common::comp::Body::FishMedium(_)) => "common.loot_tables.loot_table_fish", - Some(common::comp::Body::FishSmall(_)) => "common.loot_tables.loot_table_fish", + 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.loot_table_food", - 1 => "common.loot_tables.loot_table_wendigo", - 2 => "common.loot_tables.loot_table_weapon_uncommon", - _ => "common.loot_tables.loot_table_cave_large", + 0 => "common.loot_tables.food", + 1 => "common.loot_tables.wendigo", + 2 => "common.loot_tables.weapon_uncommon", + _ => "common.loot_tables.cave_large", }, biped_large::Species::Troll => match rng.gen_range(0..10) { - 0 => "common.loot_tables.loot_table_food", - 1 => "common.loot_tables.loot_table_cave_large", - 2 => "common.loot_tables.loot_table_weapon_uncommon", - _ => "common.loot_tables.loot_table_troll", + 0 => "common.loot_tables.food", + 1 => "common.loot_tables.cave_large", + 2 => "common.loot_tables.weapon_uncommon", + _ => "common.loot_tables.troll", }, biped_large::Species::Occultsaurok | biped_large::Species::Mightysaurok - | biped_large::Species::Slysaurok => "common.loot_tables.loot_table_saurok", + | biped_large::Species::Slysaurok => "common.loot_tables.saurok", _ => match rng.gen_range(0..4) { - 0 => "common.loot_tables.loot_table_food", - 1 => "common.loot_tables.loot_table_armor_nature", - _ => "common.loot_tables.loot_table_cave_large", + 0 => "common.loot_tables.food", + 1 => "common.loot_tables.armor_nature", + _ => "common.loot_tables.cave_large", }, }, Some(common::comp::Body::Golem(_)) => match rng.gen_range(0..9) { - 0 => "common.loot_tables.loot_table_food", - 2 => "common.loot_tables.loot_table_armor_light", - 3 => "common.loot_tables.loot_table_armor_heavy", - 5 => "common.loot_tables.loot_table_weapon_common", - 6 => "common.loot_tables.loot_table_weapon_uncommon", - 7 => "common.loot_tables.loot_table_weapon_rare", - _ => "common.loot_tables.loot_table", + 0 => "common.loot_tables.food", + 2 => "common.loot_tables.armor_light", + 3 => "common.loot_tables.armor_heavy", + 5 => "common.loot_tables.weapon_common", + 6 => "common.loot_tables.weapon_uncommon", + 7 => "common.loot_tables.weapon_rare", + _ => "common.loot_tables.fallback", }, Some(common::comp::Body::Theropod(theropod)) => match theropod.species { theropod::Species::Sandraptor | theropod::Species::Snowraptor | theropod::Species::Woodraptor => match rng.gen_range(0..3) { - 0 => "common.loot_tables.loot_table_raptor", - _ => "common.loot_tables.loot_table_animal_parts", + 0 => "common.loot_tables.raptor", + _ => "common.loot_tables.animal_parts", }, - _ => "common.loot_tables.loot_table_animal_parts", + _ => "common.loot_tables.animal_parts", }, - Some(common::comp::Body::Dragon(_)) => "common.loot_tables.loot_table_weapon_rare", + Some(common::comp::Body::Dragon(_)) => "common.loot_tables.weapon_rare", Some(common::comp::Body::QuadrupedLow(quadruped_low)) => { match quadruped_low.species { quadruped_low::Species::Maneater => { - "common.loot_tables.loot_table_maneater" + "common.loot_tables.maneater" }, _ => match rng.gen_range(0..3) { - 0 => "common.loot_tables.loot_table_food", - 1 => "common.loot_tables.loot_table_animal_parts", - _ => "common.loot_tables.loot_table", + 0 => "common.loot_tables.food", + 1 => "common.loot_tables.animal_parts", + _ => "common.loot_tables.fallback", }, } }, - _ => "common.loot_tables.loot_table", + _ => "common.loot_tables.fallback", }) }; let item = { let mut item_drops = state.ecs().write_storage::(); item_drops.remove(entity).map_or_else( - || Item::new_from_asset_expect(lottery().read().choose()), + || lottery().read().choose().to_item(), |item_drop| item_drop.0, ) }; diff --git a/world/src/site/dungeon/mod.rs b/world/src/site/dungeon/mod.rs index c05e5107d9..3c5c96ad91 100644 --- a/world/src/site/dungeon/mod.rs +++ b/world/src/site/dungeon/mod.rs @@ -16,7 +16,7 @@ use common::{ {self}, }, generation::{ChunkSupplement, EntityInfo}, - lottery::Lottery, + lottery::{LootSpec, Lottery}, store::{Id, Store}, terrain::{Block, BlockKind, SpriteKind, Structure, StructuresGroup, TerrainChunkSize}, vol::{BaseVol, ReadVol, RectSizedVol, RectVolSize, WriteVol}, @@ -553,52 +553,52 @@ impl Floor { // Bad let chosen = match room.difficulty { 0 => { - Lottery::::load_expect(match dynamic_rng.gen_range(0..4) { - 0 => "common.loot_tables.loot_table_humanoids", - 1 => "common.loot_tables.loot_table_armor_cloth", - _ => "common.loot_tables.loot_table_weapon_common", + Lottery::::load_expect(match dynamic_rng.gen_range(0..4) { + 0 => "common.loot_tables.humanoids", + 1 => "common.loot_tables.armor_cloth", + _ => "common.loot_tables.weapon_common", }) }, 1 => { - Lottery::::load_expect(match dynamic_rng.gen_range(0..4) { - 0 => "common.loot_tables.loot_table_humanoids", - 1 => "common.loot_tables.loot_table_armor_light", - _ => "common.loot_tables.loot_table_weapon_uncommon", + Lottery::::load_expect(match dynamic_rng.gen_range(0..4) { + 0 => "common.loot_tables.humanoids", + 1 => "common.loot_tables.armor_light", + _ => "common.loot_tables.weapon_uncommon", }) }, 2 => { - Lottery::::load_expect(match dynamic_rng.gen_range(0..4) { - 0 => "common.loot_tables.loot_table_humanoids", - 1 => "common.loot_tables.loot_table_armor_heavy", - _ => "common.loot_tables.loot_table_weapon_rare", + Lottery::::load_expect(match dynamic_rng.gen_range(0..4) { + 0 => "common.loot_tables.humanoids", + 1 => "common.loot_tables.armor_heavy", + _ => "common.loot_tables.weapon_rare", }) }, 3 => { - Lottery::::load_expect(match dynamic_rng.gen_range(0..10) { - 0 => "common.loot_tables.loot_table_humanoids", - 1 => "common.loot_tables.loot_table_armor_heavy", - 2 => "common.loot_tables.loot_table_weapon_rare", - _ => "common.loot_tables.loot_table_cultists", + Lottery::::load_expect(match dynamic_rng.gen_range(0..10) { + 0 => "common.loot_tables.humanoids", + 1 => "common.loot_tables.armor_heavy", + 2 => "common.loot_tables.weapon_rare", + _ => "common.loot_tables.cultists", }) }, 4 => { - Lottery::::load_expect(match dynamic_rng.gen_range(0..6) { - 0 => "common.loot_tables.loot_table_humanoids", - 1 => "common.loot_tables.loot_table_armor_misc", - 2 => "common.loot_tables.loot_table_weapon_rare", - _ => "common.loot_tables.loot_table_cultists", + Lottery::::load_expect(match dynamic_rng.gen_range(0..6) { + 0 => "common.loot_tables.humanoids", + 1 => "common.loot_tables.armor_misc", + 2 => "common.loot_tables.weapon_rare", + _ => "common.loot_tables.cultists", }) }, 5 => { - Lottery::::load_expect(match dynamic_rng.gen_range(0..5) { - 0 => "common.loot_tables.loot_table_humanoids", - 1 => "common.loot_tables.loot_table_armor_misc", - 2 => "common.loot_tables.loot_table_weapon_rare", - _ => "common.loot_tables.loot_table_cultists", + Lottery::::load_expect(match dynamic_rng.gen_range(0..5) { + 0 => "common.loot_tables.humanoids", + 1 => "common.loot_tables.armor_misc", + 2 => "common.loot_tables.weapon_rare", + _ => "common.loot_tables.cultists", }) }, - _ => Lottery::::load_expect( - "common.loot_tables.loot_table_armor_misc", + _ => Lottery::::load_expect( + "common.loot_tables.armor_misc", ), }; let chosen = chosen.read(); @@ -617,7 +617,7 @@ impl Floor { .with_alignment(comp::Alignment::Enemy) .with_loadout_config(loadout_builder::LoadoutConfig::CultistAcolyte) .with_skillset_config(common::skillset_builder::SkillSetConfig::CultistAcolyte) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)) + .with_loot_drop(chosen.to_item()) .with_level(dynamic_rng.gen_range((room.difficulty as f32).powf(1.25) + 3.0..(room.difficulty as f32).powf(1.5) + 4.0).round() as u16); let entity = match room.difficulty { 0 => entity @@ -632,7 +632,7 @@ impl Floor { .with_skillset_config( common::skillset_builder::SkillSetConfig::Gnarling, ) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)) + .with_loot_drop(chosen.to_item()) .with_main_tool(comp::Item::new_from_asset_expect( match dynamic_rng.gen_range(0..5) { 0 => { @@ -661,7 +661,7 @@ impl Floor { .with_skillset_config( common::skillset_builder::SkillSetConfig::Adlet, ) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)) + .with_loot_drop(chosen.to_item()) .with_main_tool(comp::Item::new_from_asset_expect( match dynamic_rng.gen_range(0..5) { 0 => "common.items.npc_weapons.biped_small.adlet.adlet_bow", @@ -686,7 +686,7 @@ impl Floor { .with_skillset_config( common::skillset_builder::SkillSetConfig::Sahagin, ) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)) + .with_loot_drop(chosen.to_item()) .with_main_tool(comp::Item::new_from_asset_expect( match dynamic_rng.gen_range(0..5) { 0 => { @@ -714,7 +714,7 @@ impl Floor { .with_skillset_config( common::skillset_builder::SkillSetConfig::Haniwa, ) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)) + .with_loot_drop(chosen.to_item()) .with_main_tool(comp::Item::new_from_asset_expect( match dynamic_rng.gen_range(0..5) { 0 => { @@ -742,7 +742,7 @@ impl Floor { .with_skillset_config( common::skillset_builder::SkillSetConfig::Myrmidon, ) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)) + .with_loot_drop(chosen.to_item()) .with_main_tool(comp::Item::new_from_asset_expect( match dynamic_rng.gen_range(0..5) { 0 => { @@ -767,7 +767,7 @@ impl Floor { .with_skillset_config( common::skillset_builder::SkillSetConfig::Warlock, ) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)) + .with_loot_drop(chosen.to_item()) .with_main_tool(comp::Item::new_from_asset_expect( "common.items.weapons.staff.cultist_staff", )), @@ -783,7 +783,7 @@ impl Floor { .with_skillset_config( common::skillset_builder::SkillSetConfig::Warlord, ) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)) + .with_loot_drop(chosen.to_item()) .with_main_tool(comp::Item::new_from_asset_expect( match dynamic_rng.gen_range(0..5) { 0 => "common.items.weapons.axe.malachite_axe-0", @@ -818,29 +818,29 @@ impl Floor { if tile_pos == boss_spawn_tile && tile_wcenter.xy() == wpos2d { let chosen = match room.difficulty { - 0 => Lottery::::load_expect( - "common.loot_tables.loot_table_weapon_uncommon", + 0 => Lottery::::load_expect( + "common.loot_tables.weapon_uncommon", ), - 1 => Lottery::::load_expect( - "common.loot_tables.loot_table_weapon_uncommon", + 1 => Lottery::::load_expect( + "common.loot_tables.weapon_uncommon", ), - 2 => Lottery::::load_expect( - "common.loot_tables.loot_table_armor_heavy", + 2 => Lottery::::load_expect( + "common.loot_tables.armor_heavy", ), - 3 => Lottery::::load_expect( - "common.loot_tables.loot_table_weapon_rare", + 3 => Lottery::::load_expect( + "common.loot_tables.weapon_rare", ), - 4 => Lottery::::load_expect( - "common.loot_tables.loot_table_miniboss", + 4 => Lottery::::load_expect( + "common.loot_tables.miniboss", ), - 5 => Lottery::::load_expect( + 5 => Lottery::::load_expect( match dynamic_rng.gen_range(0..3) { 0 => "common.loot_tables.mindflayer", - _ => "common.loot_tables.loot_table_miniboss", + _ => "common.loot_tables.miniboss", }, ), - _ => Lottery::::load_expect( - "common.loot_tables.loot_table_armor_misc", + _ => Lottery::::load_expect( + "common.loot_tables.armor_misc", ), }; let chosen = chosen.read(); @@ -855,7 +855,7 @@ impl Floor { ), )) .with_name("Harvester".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)), + .with_loot_drop(chosen.to_item()), ], 1 => vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) @@ -866,7 +866,7 @@ impl Floor { ), )) .with_name("Yeti".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)), + .with_loot_drop(chosen.to_item()), ], 2 => vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) @@ -877,7 +877,7 @@ impl Floor { ), )) .with_name("Tidal Warrior".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)), + .with_loot_drop(chosen.to_item()), ], 3 => vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) @@ -888,7 +888,7 @@ impl Floor { ), )) .with_name("Clay Golem".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)), + .with_loot_drop(chosen.to_item()), ], 4 => vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) @@ -899,7 +899,7 @@ impl Floor { ), )) .with_name("Minotaur".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)), + .with_loot_drop(chosen.to_item()), ], 5 => vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) @@ -910,7 +910,7 @@ impl Floor { ), )) .with_name("Mindflayer".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)) + .with_loot_drop(chosen.to_item()) .with_skillset_config( common::skillset_builder::SkillSetConfig::Mindflayer, ), @@ -961,26 +961,26 @@ impl Floor { if tile_pos == miniboss_spawn_tile && tile_wcenter.xy() == wpos2d { let chosen = match room.difficulty { - 0 => Lottery::::load_expect( - "common.loot_tables.loot_table_animal_parts", + 0 => Lottery::::load_expect( + "common.loot_tables.animal_parts", ), - 1 => Lottery::::load_expect( - "common.loot_tables.loot_table_animal_parts", + 1 => Lottery::::load_expect( + "common.loot_tables.animal_parts", ), - 2 => Lottery::::load_expect( - "common.loot_tables.loot_table_animal_parts", + 2 => Lottery::::load_expect( + "common.loot_tables.animal_parts", ), - 3 => Lottery::::load_expect( - "common.loot_tables.loot_table_weapon_rare", + 3 => Lottery::::load_expect( + "common.loot_tables.weapon_rare", ), - 4 => Lottery::::load_expect( - "common.loot_tables.loot_table_weapon_rare", + 4 => Lottery::::load_expect( + "common.loot_tables.weapon_rare", ), - 5 => Lottery::::load_expect( - "common.loot_tables.loot_table_husk", + 5 => Lottery::::load_expect( + "common.loot_tables.husk", ), - _ => Lottery::::load_expect( - "common.loot_tables.loot_table_armor_misc", + _ => Lottery::::load_expect( + "common.loot_tables.armor_misc", ), }; let chosen = chosen.read(); @@ -995,7 +995,7 @@ impl Floor { ), )) .with_name("Bonerattler".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)), + .with_loot_drop(chosen.to_item()), ], 1 => vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) @@ -1006,9 +1006,7 @@ impl Floor { ) )) .with_name("Bonerattler".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect( - chosen - )); + .with_loot_drop(chosen.to_item()); 3 ], 2 => { @@ -1022,7 +1020,7 @@ impl Floor { ), )) .with_name("Hakulaq".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)) + .with_loot_drop(chosen.to_item()) }); entities }, @@ -1032,7 +1030,7 @@ impl Floor { comp::humanoid::Body::random(), )) .with_name("Animal Trainer".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)) + .with_loot_drop(chosen.to_item()) .with_loadout_config(loadout_builder::LoadoutConfig::CultistAcolyte) .with_skillset_config( common::skillset_builder::SkillSetConfig::CultistAcolyte @@ -1056,7 +1054,7 @@ impl Floor { ), )) .with_name("Tamed Darkhound".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)), + .with_loot_drop(chosen.to_item()), EntityInfo::at(tile_wcenter.map(|e| e as f32)) .with_body(comp::Body::QuadrupedMedium( comp::quadruped_medium::Body::random_with( @@ -1065,7 +1063,7 @@ impl Floor { ), )) .with_name("Tamed Darkhound".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)), + .with_loot_drop(chosen.to_item()), ], 4 => vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) @@ -1076,7 +1074,7 @@ impl Floor { ), )) .with_name("Dullahan Guard".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect(chosen)), + .with_loot_drop(chosen.to_item()), ], 5 => { let mut entities = Vec::new(); From cbca2a66b64a3027b619e0f0ae8032d0fd052e94 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 28 Mar 2021 19:17:23 -0400 Subject: [PATCH 02/17] Support for creature specific materails and materials having a quantity. --- common/src/comp/body.rs | 7 + common/src/comp/inventory/item/mod.rs | 8 +- common/src/lottery.rs | 22 +- server/src/events/entity_manipulation.rs | 2 +- world/src/site/dungeon/mod.rs | 595 ++++++++++++----------- 5 files changed, 350 insertions(+), 284 deletions(-) diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index d1f124f184..f0ac684bef 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -16,6 +16,7 @@ pub mod theropod; use crate::{ assets::{self, Asset}, + comp::Item, make_case_elim, npc::NpcKind, }; @@ -582,6 +583,12 @@ impl Body { _ => Vec3::unit_z(), } } + + pub fn get_loot(&self) -> Item { + Item::new_from_asset_expect(match self { + _ => "common.items.food.cheese" + }) + } } impl Component for Body { diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index ec49927469..6dacdcd593 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -610,7 +610,7 @@ impl Item { _ => "common.loot_tables.armor_misc", }) .read(); - return Some(chosen.choose().to_item()) + return Some(chosen.choose().to_item(None)) }, SpriteKind::ChestBurried => { chosen = Lottery::::load_expect(match rng.gen_range(0..7) { @@ -620,7 +620,7 @@ impl Item { _ => "common.loot_tables.armor_misc", }) .read(); - return Some(chosen.choose().to_item()) + return Some(chosen.choose().to_item(None)) }, SpriteKind::Mud => { chosen = Lottery::::load_expect(match rng.gen_range(0..5) { @@ -630,7 +630,7 @@ impl Item { _ => "common.loot_tables.rocks", }) .read(); - return Some(chosen.choose().to_item()) + return Some(chosen.choose().to_item(None)) }, SpriteKind::Crate => { chosen = Lottery::::load_expect(match rng.gen_range(0..4) { @@ -638,7 +638,7 @@ impl Item { _ => "common.loot_tables.food", }) .read(); - return Some(chosen.choose().to_item()) + return Some(chosen.choose().to_item(None)) }, SpriteKind::Beehive => "common.items.crafting_ing.honey", diff --git a/common/src/lottery.rs b/common/src/lottery.rs index 3976d7a986..1e4851ae8e 100644 --- a/common/src/lottery.rs +++ b/common/src/lottery.rs @@ -26,7 +26,7 @@ // Cheese drop rate = 3/X = 29.6% // Coconut drop rate = 1/X = 9.85% -use crate::{assets::{self, AssetExt}, comp::Item}; +use crate::{assets::{self, AssetExt}, comp::{Body, Item}}; use rand::prelude::*; use serde::{de::DeserializeOwned, Deserialize, Serialize}; @@ -74,17 +74,31 @@ impl Lottery { #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] pub enum LootSpec { + /// Asset specifier Item(String), + /// Asset specifier, lower range, upper range + ItemQuantity(String, u32, u32), + /// Loot table LootTable(String), + /// Matches on species to provide a crafting material + CreatureMaterial, } impl LootSpec { - pub fn to_item(&self) -> Item { + pub fn to_item(&self, body: Option) -> Item { match self { Self::Item(item) => Item::new_from_asset_expect(&item), - Self::LootTable(table) => { - Lottery::::load_expect(&table).read().choose().to_item() + Self::ItemQuantity(item, lower, upper) => { + let range = *lower..=*upper; + let quantity = thread_rng().gen_range(range); + let mut item = Item::new_from_asset_expect(&item); + item.set_amount(quantity); + item }, + Self::LootTable(table) => { + Lottery::::load_expect(&table).read().choose().to_item(body) + }, + Self::CreatureMaterial => body.map_or(Item::new_from_asset_expect("common.items.food.cheese"), |b| b.get_loot()), } } } diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 350bd3bdaa..7b2fcf8bf5 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -444,7 +444,7 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc let item = { let mut item_drops = state.ecs().write_storage::(); item_drops.remove(entity).map_or_else( - || lottery().read().choose().to_item(), + || lottery().read().choose().to_item(old_body), |item_drop| item_drop.0, ) }; diff --git a/world/src/site/dungeon/mod.rs b/world/src/site/dungeon/mod.rs index 3c5c96ad91..9e7e85539c 100644 --- a/world/src/site/dungeon/mod.rs +++ b/world/src/site/dungeon/mod.rs @@ -617,160 +617,178 @@ impl Floor { .with_alignment(comp::Alignment::Enemy) .with_loadout_config(loadout_builder::LoadoutConfig::CultistAcolyte) .with_skillset_config(common::skillset_builder::SkillSetConfig::CultistAcolyte) - .with_loot_drop(chosen.to_item()) + .with_loot_drop(chosen.to_item(None)) .with_level(dynamic_rng.gen_range((room.difficulty as f32).powf(1.25) + 3.0..(room.difficulty as f32).powf(1.5) + 4.0).round() as u16); let entity = match room.difficulty { - 0 => entity - .with_body(comp::Body::BipedSmall( + 0 => { + let body = comp::Body::BipedSmall( comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Gnarling, ), - )) - .with_name("Gnarling") - .with_loadout_config(loadout_builder::LoadoutConfig::Gnarling) - .with_skillset_config( - common::skillset_builder::SkillSetConfig::Gnarling, - ) - .with_loot_drop(chosen.to_item()) - .with_main_tool(comp::Item::new_from_asset_expect( - match dynamic_rng.gen_range(0..5) { - 0 => { - "common.items.npc_weapons.biped_small.gnarling.\ - adlet_bow" + ); + entity + .with_body(body) + .with_name("Gnarling") + .with_loadout_config(loadout_builder::LoadoutConfig::Gnarling) + .with_skillset_config( + common::skillset_builder::SkillSetConfig::Gnarling, + ) + .with_loot_drop(chosen.to_item(Some(body))) + .with_main_tool(comp::Item::new_from_asset_expect( + match dynamic_rng.gen_range(0..5) { + 0 => { + "common.items.npc_weapons.biped_small.gnarling.\ + adlet_bow" + }, + 1 => { + "common.items.npc_weapons.biped_small.gnarling.\ + gnoll_staff" + }, + _ => { + "common.items.npc_weapons.biped_small.gnarling.\ + wooden_spear" + }, }, - 1 => { - "common.items.npc_weapons.biped_small.gnarling.\ - gnoll_staff" - }, - _ => { - "common.items.npc_weapons.biped_small.gnarling.\ - wooden_spear" - }, - }, - )), - 1 => entity - .with_body(comp::Body::BipedSmall( + )) + }, + 1 => { + let body = comp::Body::BipedSmall( comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Adlet, ), - )) - .with_name("Adlet") - .with_loadout_config(loadout_builder::LoadoutConfig::Adlet) - .with_skillset_config( - common::skillset_builder::SkillSetConfig::Adlet, - ) - .with_loot_drop(chosen.to_item()) - .with_main_tool(comp::Item::new_from_asset_expect( - match dynamic_rng.gen_range(0..5) { - 0 => "common.items.npc_weapons.biped_small.adlet.adlet_bow", - 1 => { - "common.items.npc_weapons.biped_small.adlet.gnoll_staff" + ); + entity + .with_body(body) + .with_name("Adlet") + .with_loadout_config(loadout_builder::LoadoutConfig::Adlet) + .with_skillset_config( + common::skillset_builder::SkillSetConfig::Adlet, + ) + .with_loot_drop(chosen.to_item(Some(body))) + .with_main_tool(comp::Item::new_from_asset_expect( + match dynamic_rng.gen_range(0..5) { + 0 => "common.items.npc_weapons.biped_small.adlet.adlet_bow", + 1 => { + "common.items.npc_weapons.biped_small.adlet.gnoll_staff" + }, + _ => { + "common.items.npc_weapons.biped_small.adlet.\ + wooden_spear" + }, }, - _ => { - "common.items.npc_weapons.biped_small.adlet.\ - wooden_spear" - }, - }, - )), - 2 => entity - .with_body(comp::Body::BipedSmall( + )) + }, + 2 => { + let body = comp::Body::BipedSmall( comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Sahagin, ), - )) - .with_name("Sahagin") - .with_loadout_config(loadout_builder::LoadoutConfig::Sahagin) - .with_skillset_config( - common::skillset_builder::SkillSetConfig::Sahagin, - ) - .with_loot_drop(chosen.to_item()) - .with_main_tool(comp::Item::new_from_asset_expect( - match dynamic_rng.gen_range(0..5) { - 0 => { - "common.items.npc_weapons.biped_small.sahagin.adlet_bow" + ); + entity + .with_body(body) + .with_name("Sahagin") + .with_loadout_config(loadout_builder::LoadoutConfig::Sahagin) + .with_skillset_config( + common::skillset_builder::SkillSetConfig::Sahagin, + ) + .with_loot_drop(chosen.to_item(Some(body))) + .with_main_tool(comp::Item::new_from_asset_expect( + match dynamic_rng.gen_range(0..5) { + 0 => { + "common.items.npc_weapons.biped_small.sahagin.adlet_bow" + }, + 1 => { + "common.items.npc_weapons.biped_small.sahagin.\ + gnoll_staff" + }, + _ => { + "common.items.npc_weapons.biped_small.sahagin.\ + wooden_spear" + }, }, - 1 => { - "common.items.npc_weapons.biped_small.sahagin.\ - gnoll_staff" - }, - _ => { - "common.items.npc_weapons.biped_small.sahagin.\ - wooden_spear" - }, - }, - )), - 3 => entity - .with_body(comp::Body::BipedSmall( + )) + }, + 3 => { + let body = comp::Body::BipedSmall( comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Haniwa, ), - )) - .with_name("Haniwa") - .with_loadout_config(loadout_builder::LoadoutConfig::Haniwa) - .with_skillset_config( - common::skillset_builder::SkillSetConfig::Haniwa, - ) - .with_loot_drop(chosen.to_item()) - .with_main_tool(comp::Item::new_from_asset_expect( - match dynamic_rng.gen_range(0..5) { - 0 => { - "common.items.npc_weapons.biped_small.haniwa.adlet_bow" + ); + entity + .with_body(body) + .with_name("Haniwa") + .with_loadout_config(loadout_builder::LoadoutConfig::Haniwa) + .with_skillset_config( + common::skillset_builder::SkillSetConfig::Haniwa, + ) + .with_loot_drop(chosen.to_item(Some(body))) + .with_main_tool(comp::Item::new_from_asset_expect( + match dynamic_rng.gen_range(0..5) { + 0 => { + "common.items.npc_weapons.biped_small.haniwa.adlet_bow" + }, + 1 => { + "common.items.npc_weapons.biped_small.haniwa.\ + gnoll_staff" + }, + _ => { + "common.items.npc_weapons.biped_small.haniwa.\ + wooden_spear" + }, }, - 1 => { - "common.items.npc_weapons.biped_small.haniwa.\ - gnoll_staff" - }, - _ => { - "common.items.npc_weapons.biped_small.haniwa.\ - wooden_spear" - }, - }, - )), - 4 => entity - .with_body(comp::Body::BipedSmall( + )) + }, + 4 => { + let body = comp::Body::BipedSmall( comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Myrmidon, ), - )) - .with_name("Myrmidon") - .with_loadout_config(loadout_builder::LoadoutConfig::Myrmidon) - .with_skillset_config( - common::skillset_builder::SkillSetConfig::Myrmidon, - ) - .with_loot_drop(chosen.to_item()) - .with_main_tool(comp::Item::new_from_asset_expect( - match dynamic_rng.gen_range(0..5) { - 0 => { - "common.items.npc_weapons.biped_small.myrmidon.\ - adlet_bow" - }, - 1 => { - "common.items.npc_weapons.biped_small.myrmidon.\ - gnoll_staff" - }, - _ => { - "common.items.npc_weapons.biped_small.myrmidon.\ - wooden_spear" - }, - }, - )), - 5 => match dynamic_rng.gen_range(0..6) { - 0 => entity - .with_body(comp::Body::Humanoid(comp::humanoid::Body::random())) - .with_name("Cultist Warlock") - .with_loadout_config(loadout_builder::LoadoutConfig::Warlock) + ); + entity + .with_body(body) + .with_name("Myrmidon") + .with_loadout_config(loadout_builder::LoadoutConfig::Myrmidon) .with_skillset_config( - common::skillset_builder::SkillSetConfig::Warlock, + common::skillset_builder::SkillSetConfig::Myrmidon, ) - .with_loot_drop(chosen.to_item()) + .with_loot_drop(chosen.to_item(Some(body))) .with_main_tool(comp::Item::new_from_asset_expect( - "common.items.weapons.staff.cultist_staff", - )), + match dynamic_rng.gen_range(0..5) { + 0 => { + "common.items.npc_weapons.biped_small.myrmidon.\ + adlet_bow" + }, + 1 => { + "common.items.npc_weapons.biped_small.myrmidon.\ + gnoll_staff" + }, + _ => { + "common.items.npc_weapons.biped_small.myrmidon.\ + wooden_spear" + }, + }, + )) + }, + 5 => match dynamic_rng.gen_range(0..6) { + 0 => { + let body = comp::Body::Humanoid(comp::humanoid::Body::random()); + entity + .with_body(body) + .with_name("Cultist Warlock") + .with_loadout_config(loadout_builder::LoadoutConfig::Warlock) + .with_skillset_config( + common::skillset_builder::SkillSetConfig::Warlock, + ) + .with_loot_drop(chosen.to_item(Some(body))) + .with_main_tool(comp::Item::new_from_asset_expect( + "common.items.weapons.staff.cultist_staff", + )) + }, 1 => entity .with_body(comp::Body::Object(comp::object::Body::Crossbow)) .with_name("Possessed Turret".to_string()) @@ -783,7 +801,7 @@ impl Floor { .with_skillset_config( common::skillset_builder::SkillSetConfig::Warlord, ) - .with_loot_drop(chosen.to_item()) + .with_loot_drop(chosen.to_item(None)) .with_main_tool(comp::Item::new_from_asset_expect( match dynamic_rng.gen_range(0..5) { 0 => "common.items.weapons.axe.malachite_axe-0", @@ -846,75 +864,93 @@ impl Floor { let chosen = chosen.read(); let chosen = chosen.choose(); let entity = match room.difficulty { - 0 => vec![ - EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::BipedLarge( - comp::biped_large::Body::random_with( - dynamic_rng, - &comp::biped_large::Species::Harvester, - ), - )) - .with_name("Harvester".to_string()) - .with_loot_drop(chosen.to_item()), - ], - 1 => vec![ - EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::BipedLarge( - comp::biped_large::Body::random_with( - dynamic_rng, - &comp::biped_large::Species::Yeti, - ), - )) - .with_name("Yeti".to_string()) - .with_loot_drop(chosen.to_item()), - ], - 2 => vec![ - EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::BipedLarge( - comp::biped_large::Body::random_with( - dynamic_rng, - &comp::biped_large::Species::Tidalwarrior, - ), - )) - .with_name("Tidal Warrior".to_string()) - .with_loot_drop(chosen.to_item()), - ], - 3 => vec![ - EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::Golem( - comp::golem::Body::random_with( - dynamic_rng, - &comp::golem::Species::ClayGolem, - ), - )) - .with_name("Clay Golem".to_string()) - .with_loot_drop(chosen.to_item()), - ], - 4 => vec![ - EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::BipedLarge( - comp::biped_large::Body::random_with( - dynamic_rng, - &comp::biped_large::Species::Minotaur, - ), - )) - .with_name("Minotaur".to_string()) - .with_loot_drop(chosen.to_item()), - ], - 5 => vec![ - EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::BipedLarge( - comp::biped_large::Body::random_with( - dynamic_rng, - &comp::biped_large::Species::Mindflayer, - ), - )) - .with_name("Mindflayer".to_string()) - .with_loot_drop(chosen.to_item()) - .with_skillset_config( - common::skillset_builder::SkillSetConfig::Mindflayer, + 0 => { + let body = comp::Body::BipedLarge( + comp::biped_large::Body::random_with( + dynamic_rng, + &comp::biped_large::Species::Harvester, ), - ], + ); + vec![ + EntityInfo::at(tile_wcenter.map(|e| e as f32)) + .with_body(body) + .with_name("Harvester".to_string()) + .with_loot_drop(chosen.to_item(Some(body))), + ] + }, + 1 => { + let body = comp::Body::BipedLarge( + comp::biped_large::Body::random_with( + dynamic_rng, + &comp::biped_large::Species::Yeti, + ), + ); + vec![ + EntityInfo::at(tile_wcenter.map(|e| e as f32)) + .with_body(body) + .with_name("Yeti".to_string()) + .with_loot_drop(chosen.to_item(Some(body))), + ] + }, + 2 => { + let body = comp::Body::BipedLarge( + comp::biped_large::Body::random_with( + dynamic_rng, + &comp::biped_large::Species::Tidalwarrior, + ), + ); + vec![ + EntityInfo::at(tile_wcenter.map(|e| e as f32)) + .with_body(body) + .with_name("Tidal Warrior".to_string()) + .with_loot_drop(chosen.to_item(Some(body))), + ] + }, + 3 => { + let body = comp::Body::Golem( + comp::golem::Body::random_with( + dynamic_rng, + &comp::golem::Species::ClayGolem, + ), + ); + vec![ + EntityInfo::at(tile_wcenter.map(|e| e as f32)) + .with_body(body) + .with_name("Clay Golem".to_string()) + .with_loot_drop(chosen.to_item(Some(body))), + ] + }, + 4 => { + let body = comp::Body::BipedLarge( + comp::biped_large::Body::random_with( + dynamic_rng, + &comp::biped_large::Species::Minotaur, + ), + ); + vec![ + EntityInfo::at(tile_wcenter.map(|e| e as f32)) + .with_body(body) + .with_name("Minotaur".to_string()) + .with_loot_drop(chosen.to_item(Some(body))), + ] + }, + 5 => { + let body = comp::Body::BipedLarge( + comp::biped_large::Body::random_with( + dynamic_rng, + &comp::biped_large::Species::Mindflayer, + ), + ); + vec![ + EntityInfo::at(tile_wcenter.map(|e| e as f32)) + .with_body(body) + .with_name("Mindflayer".to_string()) + .with_loot_drop(chosen.to_item(Some(body))) + .with_skillset_config( + common::skillset_builder::SkillSetConfig::Mindflayer, + ), + ] + }, _ => { vec![EntityInfo::at(tile_wcenter.map(|e| e as f32)).with_body( comp::Body::QuadrupedSmall( @@ -986,96 +1022,105 @@ impl Floor { let chosen = chosen.read(); let chosen = chosen.choose(); let entity = match room.difficulty { - 0 => vec![ - EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::QuadrupedMedium( - comp::quadruped_medium::Body::random_with( - dynamic_rng, - &comp::quadruped_medium::Species::Bonerattler, - ), - )) - .with_name("Bonerattler".to_string()) - .with_loot_drop(chosen.to_item()), - ], - 1 => vec![ - EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::QuadrupedMedium( - comp::quadruped_medium::Body::random_with( - dynamic_rng, - &comp::quadruped_medium::Species::Bonerattler, - ) - )) - .with_name("Bonerattler".to_string()) - .with_loot_drop(chosen.to_item()); - 3 - ], + 0 => { + let body = comp::Body::QuadrupedMedium( + comp::quadruped_medium::Body::random_with( + dynamic_rng, + &comp::quadruped_medium::Species::Bonerattler, + ), + ); + vec![ + EntityInfo::at(tile_wcenter.map(|e| e as f32)) + .with_body(body) + .with_name("Bonerattler".to_string()) + .with_loot_drop(chosen.to_item(Some(body))), + ] + }, + 1 => { + let body = comp::Body::QuadrupedMedium( + comp::quadruped_medium::Body::random_with( + dynamic_rng, + &comp::quadruped_medium::Species::Bonerattler, + ) + ); + vec![ + EntityInfo::at(tile_wcenter.map(|e| e as f32)) + .with_body(body) + .with_name("Bonerattler".to_string()) + .with_loot_drop(chosen.to_item(Some(body))); + 3 + ] + }, 2 => { let mut entities = Vec::new(); + let body = comp::Body::QuadrupedLow( + comp::quadruped_low::Body::random_with( + dynamic_rng, + &comp::quadruped_low::Species::Hakulaq, + ), + ); entities.resize_with(6, || { EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::QuadrupedLow( - comp::quadruped_low::Body::random_with( - dynamic_rng, - &comp::quadruped_low::Species::Hakulaq, - ), - )) + .with_body(body) .with_name("Hakulaq".to_string()) - .with_loot_drop(chosen.to_item()) + .with_loot_drop(chosen.to_item(Some(body))) }); entities }, - 3 => vec![ - EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::Humanoid( - comp::humanoid::Body::random(), - )) - .with_name("Animal Trainer".to_string()) - .with_loot_drop(chosen.to_item()) - .with_loadout_config(loadout_builder::LoadoutConfig::CultistAcolyte) - .with_skillset_config( - common::skillset_builder::SkillSetConfig::CultistAcolyte - ) - .with_main_tool(comp::Item::new_from_asset_expect( - match dynamic_rng.gen_range(0..6) { - 0 => "common.items.weapons.axe.malachite_axe-0", - 1..=2 => "common.items.weapons.sword.cultist", - 3 => { - "common.items.weapons.hammer.cultist_purp_2h-0" + 3 => { + let mut entities = Vec::new(); + let body = comp::Body::Humanoid( + comp::humanoid::Body::random(), + ); + entities.push( + EntityInfo::at(tile_wcenter.map(|e| e as f32)) + .with_body(body) + .with_name("Animal Trainer".to_string()) + .with_loot_drop(chosen.to_item(Some(body))) + .with_loadout_config(loadout_builder::LoadoutConfig::CultistAcolyte) + .with_skillset_config( + common::skillset_builder::SkillSetConfig::CultistAcolyte + ) + .with_main_tool(comp::Item::new_from_asset_expect( + match dynamic_rng.gen_range(0..6) { + 0 => "common.items.weapons.axe.malachite_axe-0", + 1..=2 => "common.items.weapons.sword.cultist", + 3 => { + "common.items.weapons.hammer.cultist_purp_2h-0" + }, + 4 => "common.items.weapons.staff.cultist_staff", + _ => "common.items.weapons.bow.bone-1", }, - 4 => "common.items.weapons.staff.cultist_staff", - _ => "common.items.weapons.bow.bone-1", - }, - )), - EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::QuadrupedMedium( - comp::quadruped_medium::Body::random_with( - dynamic_rng, - &comp::quadruped_medium::Species::Darkhound, - ), - )) - .with_name("Tamed Darkhound".to_string()) - .with_loot_drop(chosen.to_item()), - EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::QuadrupedMedium( - comp::quadruped_medium::Body::random_with( - dynamic_rng, - &comp::quadruped_medium::Species::Darkhound, - ), - )) - .with_name("Tamed Darkhound".to_string()) - .with_loot_drop(chosen.to_item()), - ], - 4 => vec![ - EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::BipedLarge( - comp::biped_large::Body::random_with( - dynamic_rng, - &comp::biped_large::Species::Dullahan, - ), - )) - .with_name("Dullahan Guard".to_string()) - .with_loot_drop(chosen.to_item()), - ], + )), + ); + let body = comp::Body::QuadrupedMedium( + comp::quadruped_medium::Body::random_with( + dynamic_rng, + &comp::quadruped_medium::Species::Darkhound, + ), + ); + entities.resize_with(entities.len() + 2, || { + EntityInfo::at(tile_wcenter.map(|e| e as f32)) + .with_body(body) + .with_name("Tamed Darkhound".to_string()) + .with_loot_drop(chosen.to_item(Some(body))) + }); + entities + }, + 4 => { + let body = comp::Body::BipedLarge( + comp::biped_large::Body::random_with( + dynamic_rng, + &comp::biped_large::Species::Dullahan, + ), + ); + vec![ + EntityInfo::at(tile_wcenter.map(|e| e as f32)) + .with_body(body) + .with_name("Dullahan Guard".to_string()) + .with_loot_drop(chosen.to_item(Some(body))), + ] + }, 5 => { let mut entities = Vec::new(); entities.resize_with(10, || { From bdbe6134f2cd1c559987caea61288646214bd33c Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 28 Mar 2021 23:48:51 -0400 Subject: [PATCH 03/17] Fixed csv tools --- common/src/bin/csv_export/main.rs | 14 +++++++------- common/src/bin/csv_import/main.rs | 7 ++++++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/common/src/bin/csv_export/main.rs b/common/src/bin/csv_export/main.rs index ea3696b607..6878a5a776 100644 --- a/common/src/bin/csv_export/main.rs +++ b/common/src/bin/csv_export/main.rs @@ -219,7 +219,7 @@ fn all_items() -> Result<(), Box> { fn loot_table(loot_table: &str) -> Result<(), Box> { let mut wtr = csv::Writer::from_path("loot_table.csv")?; - wtr.write_record(&["Kind", "Item", "Relative Chance"])?; + wtr.write_record(&["Relative Chance", "Kind", "Item", "Lower Amount", "Upper Amount"])?; let loot_table = "common.loot_tables.".to_owned() + loot_table; @@ -236,12 +236,12 @@ fn loot_table(loot_table: &str) -> Result<(), Box> { .div(10_f32.powi(5)) .to_string(); - let (kind, item) = match item { - LootSpec::Item(item) => ("Item", item), - LootSpec::LootTable(table) => ("LootTable", table), - }; - - wtr.write_record(&[kind, item, &chance])?; + match item { + LootSpec::Item(item) => wtr.write_record(&[&chance, "Item", item, "", ""])?, + LootSpec::ItemQuantity(item, lower, upper) => wtr.write_record(&[&chance, "Item", item, &lower.to_string(), &upper.to_string()])?, + LootSpec::LootTable(table) => wtr.write_record(&[&chance, "LootTable", table, "", ""])?, + LootSpec::CreatureMaterial => wtr.write_record(&[&chance, "CreatureMaterial", "", "", ""])?, + } } wtr.flush()?; diff --git a/common/src/bin/csv_import/main.rs b/common/src/bin/csv_import/main.rs index 14750b5062..255c9498ba 100644 --- a/common/src/bin/csv_import/main.rs +++ b/common/src/bin/csv_import/main.rs @@ -383,8 +383,13 @@ fn loot_table(loot_table: &str) -> Result<(), Box> { for record in rdr.records() { if let Ok(ref record) = record { let item = match record.get(headers["Kind"]).expect("No loot specifier") { - "Item" => LootSpec::Item(record.get(headers["Item"]).expect("No item").to_string()), + "Item" => if let (Some(Ok(lower)), Some(Ok(upper))) = (record.get(headers["Lower Amount"]).map(|a| a.parse()), record.get(headers["Upper Amount"]).map(|a| a.parse())) { + LootSpec::ItemQuantity(record.get(headers["Item"]).expect("No item").to_string(), lower, upper) + } else { + LootSpec::Item(record.get(headers["Item"]).expect("No item").to_string()) + }, "LootTable" => LootSpec::LootTable(record.get(headers["Item"]).expect("No loot table").to_string()), + "CreatureMaterial" => LootSpec::CreatureMaterial, _ => panic!("Loot specifier kind must be either \"Item\" or \"LootTable\""), }; let chance: f32 = record From ab2fca21cf836fc15c3cc205fda038a2f13b95f2 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 29 Mar 2021 00:12:11 -0400 Subject: [PATCH 04/17] Fixed trading --- common/src/bin/csv_export/main.rs | 26 ++- common/src/bin/csv_import/main.rs | 24 ++- common/src/comp/body.rs | 2 +- common/src/comp/inventory/item/mod.rs | 10 +- common/src/comp/inventory/loadout_builder.rs | 53 +++--- common/src/comp/inventory/trade_pricing.rs | 78 ++++---- common/src/lottery.rs | 18 +- server/src/events/entity_manipulation.rs | 10 +- world/src/site/dungeon/mod.rs | 177 +++++++++---------- 9 files changed, 220 insertions(+), 178 deletions(-) diff --git a/common/src/bin/csv_export/main.rs b/common/src/bin/csv_export/main.rs index 6878a5a776..60437b6716 100644 --- a/common/src/bin/csv_export/main.rs +++ b/common/src/bin/csv_export/main.rs @@ -17,7 +17,7 @@ use veloren_common::{ ItemKind, }, }, - lottery::{Lottery, LootSpec}, + lottery::{LootSpec, Lottery}, }; #[derive(StructOpt)] @@ -219,7 +219,13 @@ fn all_items() -> Result<(), Box> { fn loot_table(loot_table: &str) -> Result<(), Box> { let mut wtr = csv::Writer::from_path("loot_table.csv")?; - wtr.write_record(&["Relative Chance", "Kind", "Item", "Lower Amount", "Upper Amount"])?; + wtr.write_record(&[ + "Relative Chance", + "Kind", + "Item", + "Lower Amount", + "Upper Amount", + ])?; let loot_table = "common.loot_tables.".to_owned() + loot_table; @@ -238,9 +244,19 @@ fn loot_table(loot_table: &str) -> Result<(), Box> { match item { LootSpec::Item(item) => wtr.write_record(&[&chance, "Item", item, "", ""])?, - LootSpec::ItemQuantity(item, lower, upper) => wtr.write_record(&[&chance, "Item", item, &lower.to_string(), &upper.to_string()])?, - LootSpec::LootTable(table) => wtr.write_record(&[&chance, "LootTable", table, "", ""])?, - LootSpec::CreatureMaterial => wtr.write_record(&[&chance, "CreatureMaterial", "", "", ""])?, + LootSpec::ItemQuantity(item, lower, upper) => wtr.write_record(&[ + &chance, + "Item", + item, + &lower.to_string(), + &upper.to_string(), + ])?, + LootSpec::LootTable(table) => { + wtr.write_record(&[&chance, "LootTable", table, "", ""])? + }, + LootSpec::CreatureMaterial => { + wtr.write_record(&[&chance, "CreatureMaterial", "", "", ""])? + }, } } diff --git a/common/src/bin/csv_import/main.rs b/common/src/bin/csv_import/main.rs index 255c9498ba..8efd36c5d8 100644 --- a/common/src/bin/csv_import/main.rs +++ b/common/src/bin/csv_import/main.rs @@ -383,12 +383,26 @@ fn loot_table(loot_table: &str) -> Result<(), Box> { for record in rdr.records() { if let Ok(ref record) = record { let item = match record.get(headers["Kind"]).expect("No loot specifier") { - "Item" => if let (Some(Ok(lower)), Some(Ok(upper))) = (record.get(headers["Lower Amount"]).map(|a| a.parse()), record.get(headers["Upper Amount"]).map(|a| a.parse())) { - LootSpec::ItemQuantity(record.get(headers["Item"]).expect("No item").to_string(), lower, upper) - } else { - LootSpec::Item(record.get(headers["Item"]).expect("No item").to_string()) + "Item" => { + if let (Some(Ok(lower)), Some(Ok(upper))) = ( + record.get(headers["Lower Amount"]).map(|a| a.parse()), + record.get(headers["Upper Amount"]).map(|a| a.parse()), + ) { + LootSpec::ItemQuantity( + record.get(headers["Item"]).expect("No item").to_string(), + lower, + upper, + ) + } else { + LootSpec::Item(record.get(headers["Item"]).expect("No item").to_string()) + } }, - "LootTable" => LootSpec::LootTable(record.get(headers["Item"]).expect("No loot table").to_string()), + "LootTable" => LootSpec::LootTable( + record + .get(headers["Item"]) + .expect("No loot table") + .to_string(), + ), "CreatureMaterial" => LootSpec::CreatureMaterial, _ => panic!("Loot specifier kind must be either \"Item\" or \"LootTable\""), }; diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index f0ac684bef..9a4c6a00b5 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -586,7 +586,7 @@ impl Body { pub fn get_loot(&self) -> Item { Item::new_from_asset_expect(match self { - _ => "common.items.food.cheese" + _ => "common.items.food.cheese", }) } } diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index 6dacdcd593..da355662a5 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -13,7 +13,7 @@ use crate::{ CharacterAbility, }, effect::Effect, - lottery::{Lottery, LootSpec}, + lottery::{LootSpec, Lottery}, recipe::RecipeInput, terrain::{Block, SpriteKind}, }; @@ -610,7 +610,7 @@ impl Item { _ => "common.loot_tables.armor_misc", }) .read(); - return Some(chosen.choose().to_item(None)) + return Some(chosen.choose().to_item(None)); }, SpriteKind::ChestBurried => { chosen = Lottery::::load_expect(match rng.gen_range(0..7) { @@ -620,7 +620,7 @@ impl Item { _ => "common.loot_tables.armor_misc", }) .read(); - return Some(chosen.choose().to_item(None)) + return Some(chosen.choose().to_item(None)); }, SpriteKind::Mud => { chosen = Lottery::::load_expect(match rng.gen_range(0..5) { @@ -630,7 +630,7 @@ impl Item { _ => "common.loot_tables.rocks", }) .read(); - return Some(chosen.choose().to_item(None)) + return Some(chosen.choose().to_item(None)); }, SpriteKind::Crate => { chosen = Lottery::::load_expect(match rng.gen_range(0..4) { @@ -638,7 +638,7 @@ impl Item { _ => "common.loot_tables.food", }) .read(); - return Some(chosen.choose().to_item(None)) + return Some(chosen.choose().to_item(None)); }, SpriteKind::Beehive => "common.items.crafting_ing.honey", diff --git a/common/src/comp/inventory/loadout_builder.rs b/common/src/comp/inventory/loadout_builder.rs index a928859bc2..8986cf0aee 100644 --- a/common/src/comp/inventory/loadout_builder.rs +++ b/common/src/comp/inventory/loadout_builder.rs @@ -568,19 +568,18 @@ impl LoadoutBuilder { .unwrap_or_default() / 10.0; for s in backpack.slots_mut() { - // TODO: Re-implement later - // if coins > 0 { - // let mut coin_item = - // Item::new_from_asset_expect("common.items.utility.coins"); - // coin_item - // .set_amount(coins) - // .expect("coins should be stackable"); - // *s = Some(coin_item); - // coins = 0; - // } else if let Some(item_id) = TradePricing::random_item(Good::Armor, armor) - // { - // *s = Some(Item::new_from_asset_expect(&item_id)); - // } + if coins > 0 { + let mut coin_item = + Item::new_from_asset_expect("common.items.utility.coins"); + coin_item + .set_amount(coins) + .expect("coins should be stackable"); + *s = Some(coin_item); + coins = 0; + } else if let Some(item_id) = TradePricing::random_item(Good::Armor, armor) + { + *s = Some(Item::new_from_asset_expect(&item_id)); + } } let mut bag1 = Item::new_from_asset_expect( "common.items.armor.misc.bag.reliable_backpack", @@ -592,9 +591,9 @@ impl LoadoutBuilder { .unwrap_or_default() / 10.0; for i in bag1.slots_mut() { - // if let Some(item_id) = TradePricing::random_item(Good::Tools, weapon) { - // *i = Some(Item::new_from_asset_expect(&item_id)); - // } + if let Some(item_id) = TradePricing::random_item(Good::Tools, weapon) { + *i = Some(Item::new_from_asset_expect(&item_id)); + } } let mut bag2 = Item::new_from_asset_expect( "common.items.armor.misc.bag.reliable_backpack", @@ -606,11 +605,11 @@ impl LoadoutBuilder { .unwrap_or_default() / 10.0; for i in bag2.slots_mut() { - // if let Some(item_id) = - // TradePricing::random_item(Good::Ingredients, ingredients) - // { - // *i = Some(Item::new_from_asset_expect(&item_id)); - // } + if let Some(item_id) = + TradePricing::random_item(Good::Ingredients, ingredients) + { + *i = Some(Item::new_from_asset_expect(&item_id)); + } } let mut bag3 = Item::new_from_asset_expect( "common.items.armor.misc.bag.reliable_backpack", @@ -622,9 +621,9 @@ impl LoadoutBuilder { .unwrap_or_default() / 10.0; for i in bag3.slots_mut() { - // if let Some(item_id) = TradePricing::random_item(Good::Food, food) { - // *i = Some(Item::new_from_asset_expect(&item_id)); - // } + if let Some(item_id) = TradePricing::random_item(Good::Food, food) { + *i = Some(Item::new_from_asset_expect(&item_id)); + } } let mut bag4 = Item::new_from_asset_expect( "common.items.armor.misc.bag.reliable_backpack", @@ -636,9 +635,9 @@ impl LoadoutBuilder { .unwrap_or_default() / 10.0; for i in bag4.slots_mut() { - // if let Some(item_id) = TradePricing::random_item(Good::Potions, potions) { - // *i = Some(Item::new_from_asset_expect(&item_id)); - // } + if let Some(item_id) = TradePricing::random_item(Good::Potions, potions) { + *i = Some(Item::new_from_asset_expect(&item_id)); + } } LoadoutBuilder::new() .active_item(active_item) diff --git a/common/src/comp/inventory/trade_pricing.rs b/common/src/comp/inventory/trade_pricing.rs index 4797009630..4bb85b026c 100644 --- a/common/src/comp/inventory/trade_pricing.rs +++ b/common/src/comp/inventory/trade_pricing.rs @@ -1,5 +1,6 @@ use crate::{ assets::{self, AssetExt}, + lottery::LootSpec, recipe::{default_recipe_book, RecipeInput}, trade::Good, }; @@ -42,13 +43,24 @@ struct ProbabilityFile { } impl assets::Asset for ProbabilityFile { - type Loader = assets::LoadFrom, assets::RonLoader>; + type Loader = assets::LoadFrom, assets::RonLoader>; const EXTENSION: &'static str = "ron"; } -impl From> for ProbabilityFile { - fn from(content: Vec<(f32, String)>) -> ProbabilityFile { Self { content } } +impl From> for ProbabilityFile { + fn from(content: Vec<(f32, LootSpec)>) -> ProbabilityFile { + Self { + content: content + .into_iter() + .filter_map(|(a, b)| match b { + LootSpec::Item(c) => Some((a, c)), + LootSpec::ItemQuantity(c, d, e) => Some((a * (d + e) as f32 / 2.0, c)), + _ => None, + }) + .collect(), + } + } } #[derive(Debug, Deserialize)] @@ -184,16 +196,15 @@ impl TradePricing { let mut result = TradePricing::default(); let files = TradingPriceFile::load_expect("common.item_price_calculation"); let contents = files.read(); - // TODO: Re-enable this - // for i in contents.loot_tables.iter() { - // if PRICING_DEBUG { - // info!(?i); - // } - // let loot = ProbabilityFile::load_expect(&i.1); - // for j in loot.read().content.iter() { - // add(&mut result.get_list_by_path_mut(&j.1), &j.1, i.0 * j.0); - // } - // } + for i in contents.loot_tables.iter() { + if PRICING_DEBUG { + info!(?i); + } + let loot = ProbabilityFile::load_expect(&i.1); + for j in loot.read().content.iter() { + add(&mut result.get_list_by_path_mut(&j.1), &j.1, i.0 * j.0); + } + } // Apply recipe book let book = default_recipe_book().read(); @@ -290,28 +301,27 @@ impl TradePricing { result } - // TODO: Re-enable later - // fn random_item_impl(&self, good: Good, amount: f32) -> Option { - // if good == Good::Coin { - // Some(TradePricing::COIN_ITEM.into()) - // } else { - // let table = self.get_list(good); - // let upper = table.len(); - // let lower = table - // .iter() - // .enumerate() - // .find(|i| i.1.1 * amount >= 1.0) - // .map(|i| i.0) - // .unwrap_or(upper - 1); - // let index = (rand::random::() * ((upper - lower) as f32)).floor() as usize + lower; - // //.gen_range(lower..upper); - // table.get(index).map(|i| i.0.clone()) - // } - // } + fn random_item_impl(&self, good: Good, amount: f32) -> Option { + if good == Good::Coin { + Some(TradePricing::COIN_ITEM.into()) + } else { + let table = self.get_list(good); + let upper = table.len(); + let lower = table + .iter() + .enumerate() + .find(|i| i.1.1 * amount >= 1.0) + .map(|i| i.0) + .unwrap_or(upper - 1); + let index = (rand::random::() * ((upper - lower) as f32)).floor() as usize + lower; + //.gen_range(lower..upper); + table.get(index).map(|i| i.0.clone()) + } + } - // pub fn random_item(good: Good, amount: f32) -> Option { - // TRADE_PRICING.random_item_impl(good, amount) - // } + pub fn random_item(good: Good, amount: f32) -> Option { + TRADE_PRICING.random_item_impl(good, amount) + } pub fn get_material(item: &str) -> (Good, f32) { if item == TradePricing::COIN_ITEM { diff --git a/common/src/lottery.rs b/common/src/lottery.rs index 1e4851ae8e..83c9028c6f 100644 --- a/common/src/lottery.rs +++ b/common/src/lottery.rs @@ -26,7 +26,10 @@ // Cheese drop rate = 3/X = 29.6% // Coconut drop rate = 1/X = 9.85% -use crate::{assets::{self, AssetExt}, comp::{Body, Item}}; +use crate::{ + assets::{self, AssetExt}, + comp::{Body, Item}, +}; use rand::prelude::*; use serde::{de::DeserializeOwned, Deserialize, Serialize}; @@ -85,6 +88,7 @@ pub enum LootSpec { } impl LootSpec { + #[allow(unused_must_use)] pub fn to_item(&self, body: Option) -> Item { match self { Self::Item(item) => Item::new_from_asset_expect(&item), @@ -95,10 +99,14 @@ impl LootSpec { item.set_amount(quantity); item }, - Self::LootTable(table) => { - Lottery::::load_expect(&table).read().choose().to_item(body) - }, - Self::CreatureMaterial => body.map_or(Item::new_from_asset_expect("common.items.food.cheese"), |b| b.get_loot()), + Self::LootTable(table) => Lottery::::load_expect(&table) + .read() + .choose() + .to_item(body), + Self::CreatureMaterial => body.map_or( + Item::new_from_asset_expect("common.items.food.cheese"), + |b| b.get_loot(), + ), } } } diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 7b2fcf8bf5..f3a0c9a33e 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -18,7 +18,7 @@ use common::{ HealthSource, Inventory, Player, Poise, PoiseChange, PoiseSource, Pos, Stats, }, event::{EventBus, ServerEvent}, - lottery::{Lottery, LootSpec}, + lottery::{LootSpec, Lottery}, outcome::Outcome, resources::Time, rtsim::RtSimEntity, @@ -368,9 +368,7 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc Some(common::comp::Body::QuadrupedMedium(quadruped_medium)) => { match quadruped_medium.species { quadruped_medium::Species::Frostfang - | quadruped_medium::Species::Roshwalr => { - "common.loot_tables.animal_ice" - }, + | quadruped_medium::Species::Roshwalr => "common.loot_tables.animal_ice", _ => match rng.gen_range(0..4) { 0 => "common.loot_tables.food", 2 => "common.loot_tables.animal_parts", @@ -427,9 +425,7 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc Some(common::comp::Body::Dragon(_)) => "common.loot_tables.weapon_rare", Some(common::comp::Body::QuadrupedLow(quadruped_low)) => { 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) { 0 => "common.loot_tables.food", 1 => "common.loot_tables.animal_parts", diff --git a/world/src/site/dungeon/mod.rs b/world/src/site/dungeon/mod.rs index 9e7e85539c..1da4d165bc 100644 --- a/world/src/site/dungeon/mod.rs +++ b/world/src/site/dungeon/mod.rs @@ -552,54 +552,52 @@ impl Floor { { // Bad let chosen = match room.difficulty { - 0 => { - Lottery::::load_expect(match dynamic_rng.gen_range(0..4) { + 0 => Lottery::::load_expect( + match dynamic_rng.gen_range(0..4) { 0 => "common.loot_tables.humanoids", 1 => "common.loot_tables.armor_cloth", _ => "common.loot_tables.weapon_common", - }) - }, - 1 => { - Lottery::::load_expect(match dynamic_rng.gen_range(0..4) { + }, + ), + 1 => Lottery::::load_expect( + match dynamic_rng.gen_range(0..4) { 0 => "common.loot_tables.humanoids", 1 => "common.loot_tables.armor_light", _ => "common.loot_tables.weapon_uncommon", - }) - }, - 2 => { - Lottery::::load_expect(match dynamic_rng.gen_range(0..4) { + }, + ), + 2 => Lottery::::load_expect( + match dynamic_rng.gen_range(0..4) { 0 => "common.loot_tables.humanoids", 1 => "common.loot_tables.armor_heavy", _ => "common.loot_tables.weapon_rare", - }) - }, - 3 => { - Lottery::::load_expect(match dynamic_rng.gen_range(0..10) { + }, + ), + 3 => Lottery::::load_expect( + match dynamic_rng.gen_range(0..10) { 0 => "common.loot_tables.humanoids", 1 => "common.loot_tables.armor_heavy", 2 => "common.loot_tables.weapon_rare", _ => "common.loot_tables.cultists", - }) - }, - 4 => { - Lottery::::load_expect(match dynamic_rng.gen_range(0..6) { - 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.armor_misc", - 2 => "common.loot_tables.weapon_rare", - _ => "common.loot_tables.cultists", - }) - }, - 5 => { - Lottery::::load_expect(match dynamic_rng.gen_range(0..5) { - 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.armor_misc", - 2 => "common.loot_tables.weapon_rare", - _ => "common.loot_tables.cultists", - }) - }, - _ => Lottery::::load_expect( - "common.loot_tables.armor_misc", + }, ), + 4 => Lottery::::load_expect( + match dynamic_rng.gen_range(0..6) { + 0 => "common.loot_tables.humanoids", + 1 => "common.loot_tables.armor_misc", + 2 => "common.loot_tables.weapon_rare", + _ => "common.loot_tables.cultists", + }, + ), + 5 => Lottery::::load_expect( + match dynamic_rng.gen_range(0..5) { + 0 => "common.loot_tables.humanoids", + 1 => "common.loot_tables.armor_misc", + 2 => "common.loot_tables.weapon_rare", + _ => "common.loot_tables.cultists", + }, + ), + _ => Lottery::::load_expect("common.loot_tables.armor_misc"), }; let chosen = chosen.read(); let chosen = chosen.choose(); @@ -621,12 +619,11 @@ impl Floor { .with_level(dynamic_rng.gen_range((room.difficulty as f32).powf(1.25) + 3.0..(room.difficulty as f32).powf(1.5) + 4.0).round() as u16); let entity = match room.difficulty { 0 => { - let body = comp::Body::BipedSmall( - comp::biped_small::Body::random_with( + let body = + comp::Body::BipedSmall(comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Gnarling, - ), - ); + )); entity .with_body(body) .with_name("Gnarling") @@ -653,12 +650,11 @@ impl Floor { )) }, 1 => { - let body = comp::Body::BipedSmall( - comp::biped_small::Body::random_with( + let body = + comp::Body::BipedSmall(comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Adlet, - ), - ); + )); entity .with_body(body) .with_name("Adlet") @@ -669,9 +665,13 @@ impl Floor { .with_loot_drop(chosen.to_item(Some(body))) .with_main_tool(comp::Item::new_from_asset_expect( match dynamic_rng.gen_range(0..5) { - 0 => "common.items.npc_weapons.biped_small.adlet.adlet_bow", + 0 => { + "common.items.npc_weapons.biped_small.adlet.\ + adlet_bow" + }, 1 => { - "common.items.npc_weapons.biped_small.adlet.gnoll_staff" + "common.items.npc_weapons.biped_small.adlet.\ + gnoll_staff" }, _ => { "common.items.npc_weapons.biped_small.adlet.\ @@ -681,12 +681,11 @@ impl Floor { )) }, 2 => { - let body = comp::Body::BipedSmall( - comp::biped_small::Body::random_with( + let body = + comp::Body::BipedSmall(comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Sahagin, - ), - ); + )); entity .with_body(body) .with_name("Sahagin") @@ -698,7 +697,8 @@ impl Floor { .with_main_tool(comp::Item::new_from_asset_expect( match dynamic_rng.gen_range(0..5) { 0 => { - "common.items.npc_weapons.biped_small.sahagin.adlet_bow" + "common.items.npc_weapons.biped_small.sahagin.\ + adlet_bow" }, 1 => { "common.items.npc_weapons.biped_small.sahagin.\ @@ -712,12 +712,11 @@ impl Floor { )) }, 3 => { - let body = comp::Body::BipedSmall( - comp::biped_small::Body::random_with( + let body = + comp::Body::BipedSmall(comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Haniwa, - ), - ); + )); entity .with_body(body) .with_name("Haniwa") @@ -729,7 +728,8 @@ impl Floor { .with_main_tool(comp::Item::new_from_asset_expect( match dynamic_rng.gen_range(0..5) { 0 => { - "common.items.npc_weapons.biped_small.haniwa.adlet_bow" + "common.items.npc_weapons.biped_small.haniwa.\ + adlet_bow" }, 1 => { "common.items.npc_weapons.biped_small.haniwa.\ @@ -743,12 +743,11 @@ impl Floor { )) }, 4 => { - let body = comp::Body::BipedSmall( - comp::biped_small::Body::random_with( + let body = + comp::Body::BipedSmall(comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Myrmidon, - ), - ); + )); entity .with_body(body) .with_name("Myrmidon") @@ -780,7 +779,9 @@ impl Floor { entity .with_body(body) .with_name("Cultist Warlock") - .with_loadout_config(loadout_builder::LoadoutConfig::Warlock) + .with_loadout_config( + loadout_builder::LoadoutConfig::Warlock, + ) .with_skillset_config( common::skillset_builder::SkillSetConfig::Warlock, ) @@ -848,9 +849,9 @@ impl Floor { 3 => Lottery::::load_expect( "common.loot_tables.weapon_rare", ), - 4 => Lottery::::load_expect( - "common.loot_tables.miniboss", - ), + 4 => { + Lottery::::load_expect("common.loot_tables.miniboss") + }, 5 => Lottery::::load_expect( match dynamic_rng.gen_range(0..3) { 0 => "common.loot_tables.mindflayer", @@ -907,12 +908,10 @@ impl Floor { ] }, 3 => { - let body = comp::Body::Golem( - comp::golem::Body::random_with( - dynamic_rng, - &comp::golem::Species::ClayGolem, - ), - ); + let body = comp::Body::Golem(comp::golem::Body::random_with( + dynamic_rng, + &comp::golem::Species::ClayGolem, + )); vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) .with_body(body) @@ -1012,9 +1011,7 @@ impl Floor { 4 => Lottery::::load_expect( "common.loot_tables.weapon_rare", ), - 5 => Lottery::::load_expect( - "common.loot_tables.husk", - ), + 5 => Lottery::::load_expect("common.loot_tables.husk"), _ => Lottery::::load_expect( "common.loot_tables.armor_misc", ), @@ -1041,7 +1038,7 @@ impl Floor { comp::quadruped_medium::Body::random_with( dynamic_rng, &comp::quadruped_medium::Species::Bonerattler, - ) + ), ); vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) @@ -1060,18 +1057,16 @@ impl Floor { ), ); entities.resize_with(6, || { - EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(body) - .with_name("Hakulaq".to_string()) - .with_loot_drop(chosen.to_item(Some(body))) + EntityInfo::at(tile_wcenter.map(|e| e as f32)) + .with_body(body) + .with_name("Hakulaq".to_string()) + .with_loot_drop(chosen.to_item(Some(body))) }); entities }, 3 => { let mut entities = Vec::new(); - let body = comp::Body::Humanoid( - comp::humanoid::Body::random(), - ); + let body = comp::Body::Humanoid(comp::humanoid::Body::random()); entities.push( EntityInfo::at(tile_wcenter.map(|e| e as f32)) .with_body(body) @@ -1124,16 +1119,20 @@ impl Floor { 5 => { let mut entities = Vec::new(); entities.resize_with(10, || { - EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::BipedSmall( - comp::biped_small::Body::random_with( - dynamic_rng, - &comp::biped_small::Species::Husk, - ), - )) - .with_name("Cultist Husk".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect("common.items.crafting_ing.stones")) - .with_loadout_config(loadout_builder::LoadoutConfig::Husk) + EntityInfo::at(tile_wcenter.map(|e| e as f32)) + .with_body(comp::Body::BipedSmall( + comp::biped_small::Body::random_with( + dynamic_rng, + &comp::biped_small::Species::Husk, + ), + )) + .with_name("Cultist Husk".to_string()) + .with_loot_drop(comp::Item::new_from_asset_expect( + "common.items.crafting_ing.stones", + )) + .with_loadout_config( + loadout_builder::LoadoutConfig::Husk, + ) }); entities }, From 96b354c178027d1c3e91045f07dcb05da3e61f91 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 30 Mar 2021 11:10:17 -0400 Subject: [PATCH 05/17] Consolidated loot tables by switching to CreatureMaterial where possible --- assets/common/item_price_calculation.ron | 16 +++---- assets/common/loot_tables/animal_parts.ron | 3 -- .../loot_tables/{ => armor}/armor_cloth.ron | 0 .../loot_tables/{ => armor}/armor_heavy.ron | 0 .../loot_tables/{ => armor}/armor_light.ron | 0 .../loot_tables/{ => armor}/armor_misc.ron | 0 .../loot_tables/{ => armor}/armor_nature.ron | 0 assets/common/loot_tables/raptor.ron | 4 -- assets/common/loot_tables/troll.ron | 4 -- assets/common/loot_tables/wendigo.ron | 3 -- .../{animal_ice.ron => wild_animal.ron} | 6 +-- common/src/bin/csv_import/main.rs | 4 +- common/src/comp/body.rs | 20 +++++++- common/src/comp/inventory/item/mod.rs | 16 +++---- common/src/lottery.rs | 2 +- server/src/events/entity_manipulation.rs | 48 ++++++------------- world/src/site/dungeon/mod.rs | 28 ++++++----- 17 files changed, 70 insertions(+), 84 deletions(-) delete mode 100644 assets/common/loot_tables/animal_parts.ron rename assets/common/loot_tables/{ => armor}/armor_cloth.ron (100%) rename assets/common/loot_tables/{ => armor}/armor_heavy.ron (100%) rename assets/common/loot_tables/{ => armor}/armor_light.ron (100%) rename assets/common/loot_tables/{ => armor}/armor_misc.ron (100%) rename assets/common/loot_tables/{ => armor}/armor_nature.ron (100%) delete mode 100644 assets/common/loot_tables/raptor.ron delete mode 100644 assets/common/loot_tables/troll.ron delete mode 100644 assets/common/loot_tables/wendigo.ron rename assets/common/loot_tables/{animal_ice.ron => wild_animal.ron} (51%) diff --git a/assets/common/item_price_calculation.ron b/assets/common/item_price_calculation.ron index 0cb4c3be87..6f071e774d 100644 --- a/assets/common/item_price_calculation.ron +++ b/assets/common/item_price_calculation.ron @@ -2,13 +2,12 @@ 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 - (0.5,"common.loot_tables.animal_ice"), - (4,"common.loot_tables.animal_parts"), - (1,"common.loot_tables.armor_cloth"), - (0.01,"common.loot_tables.armor_heavy"), - (0.1,"common.loot_tables.armor_light"), - (0.1,"common.loot_tables.armor_misc"), - (0.5,"common.loot_tables.armor_nature"), + (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"), (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 @@ -20,17 +19,14 @@ loot_tables: [ (1,"common.loot_tables.maneater"), (0.0001,"common.loot_tables.mindflayer"), (0.001,"common.loot_tables.miniboss"), - (0.05,"common.loot_tables.raptor"), // loot_table_rocks is dropped by rock monsters, but is also the only source of stones to econsim until cave_scatter information is turned into a loot table (0.2,"common.loot_tables.rocks"), (1,"common.loot_tables.fallback"), (0.04,"common.loot_tables.saurok"), - (0.02,"common.loot_tables.troll"), (0.05,"common.loot_tables.villager"), (1,"common.loot_tables.weapon_common"), (0.008,"common.loot_tables.weapon_rare"), (0.01,"common.loot_tables.weapon_uncommon"), - (0.01,"common.loot_tables.wendigo"), // we probably want to include all the scattered scatter information //(0.5,"common.cave_scatter"), ], diff --git a/assets/common/loot_tables/animal_parts.ron b/assets/common/loot_tables/animal_parts.ron deleted file mode 100644 index 38b242b969..0000000000 --- a/assets/common/loot_tables/animal_parts.ron +++ /dev/null @@ -1,3 +0,0 @@ -[ - (2.0, Item("common.items.crafting_ing.leather_scraps")), -] diff --git a/assets/common/loot_tables/armor_cloth.ron b/assets/common/loot_tables/armor/armor_cloth.ron similarity index 100% rename from assets/common/loot_tables/armor_cloth.ron rename to assets/common/loot_tables/armor/armor_cloth.ron diff --git a/assets/common/loot_tables/armor_heavy.ron b/assets/common/loot_tables/armor/armor_heavy.ron similarity index 100% rename from assets/common/loot_tables/armor_heavy.ron rename to assets/common/loot_tables/armor/armor_heavy.ron diff --git a/assets/common/loot_tables/armor_light.ron b/assets/common/loot_tables/armor/armor_light.ron similarity index 100% rename from assets/common/loot_tables/armor_light.ron rename to assets/common/loot_tables/armor/armor_light.ron diff --git a/assets/common/loot_tables/armor_misc.ron b/assets/common/loot_tables/armor/armor_misc.ron similarity index 100% rename from assets/common/loot_tables/armor_misc.ron rename to assets/common/loot_tables/armor/armor_misc.ron diff --git a/assets/common/loot_tables/armor_nature.ron b/assets/common/loot_tables/armor/armor_nature.ron similarity index 100% rename from assets/common/loot_tables/armor_nature.ron rename to assets/common/loot_tables/armor/armor_nature.ron diff --git a/assets/common/loot_tables/raptor.ron b/assets/common/loot_tables/raptor.ron deleted file mode 100644 index 5cb6de2720..0000000000 --- a/assets/common/loot_tables/raptor.ron +++ /dev/null @@ -1,4 +0,0 @@ -[ - (2.0, Item("common.items.crafting_ing.raptor_feather")), - (1.0, Item("common.items.crafting_ing.leather_scraps")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/troll.ron b/assets/common/loot_tables/troll.ron deleted file mode 100644 index 6e758cd219..0000000000 --- a/assets/common/loot_tables/troll.ron +++ /dev/null @@ -1,4 +0,0 @@ -[ - (1.0, Item("common.items.crafting_ing.leather_troll")), - (0.25, Item("common.items.crafting_ing.leather_scraps")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/wendigo.ron b/assets/common/loot_tables/wendigo.ron deleted file mode 100644 index 6a47d4575b..0000000000 --- a/assets/common/loot_tables/wendigo.ron +++ /dev/null @@ -1,3 +0,0 @@ -[ - (1.0, Item("common.items.crafting_ing.icy_fang")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/animal_ice.ron b/assets/common/loot_tables/wild_animal.ron similarity index 51% rename from assets/common/loot_tables/animal_ice.ron rename to assets/common/loot_tables/wild_animal.ron index e9ac2d3b94..97b29abb2c 100644 --- a/assets/common/loot_tables/animal_ice.ron +++ b/assets/common/loot_tables/wild_animal.ron @@ -1,4 +1,4 @@ -[ - (2.0, Item("common.items.crafting_ing.icy_fang")), +[ (1.0, Item("common.items.crafting_ing.leather_scraps")), -] \ No newline at end of file + (1.0, CreatureMaterial), +] diff --git a/common/src/bin/csv_import/main.rs b/common/src/bin/csv_import/main.rs index 8efd36c5d8..d66e59cdb8 100644 --- a/common/src/bin/csv_import/main.rs +++ b/common/src/bin/csv_import/main.rs @@ -422,7 +422,9 @@ fn loot_table(loot_table: &str) -> Result<(), Box> { let mut path = ASSETS_PATH.clone(); path.push("common"); path.push("loot_tables"); - path.push(loot_table); + for part in loot_table.split(".") { + path.push(part); + } path.set_extension("ron"); let path_str = path.to_str().expect("File path not unicode?!"); diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index 9a4c6a00b5..5abf28e23d 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -584,8 +584,26 @@ impl Body { } } - pub fn get_loot(&self) -> Item { + pub fn get_material(&self) -> Item { Item::new_from_asset_expect(match self { + Body::QuadrupedSmall(_) => "common.items.crafting_ing.leather_scraps", + Body::QuadrupedMedium(b) => match b.species { + quadruped_medium::Species::Frostfang | quadruped_medium::Species::Roshwalr => { + "common.items.crafting_ing.icy_fang" + }, + _ => "common.items.crafting_ing.leather_scraps", + }, + Body::Theropod(b) => match b.species { + theropod::Species::Sandraptor + | theropod::Species::Snowraptor + | theropod::Species::Woodraptor => "common.items.crafting_ing.raptor_feather", + _ => "common.items.crafting_ing.leather_scraps", + }, + Body::BipedLarge(b) => match b.species { + biped_large::Species::Troll => "common.items.crafting_ing.leather_troll", + biped_large::Species::Wendigo => "common.items.crafting_ing.icy_fang", + _ => "common.items.food.cheese", + }, _ => "common.items.food.cheese", }) } diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index da355662a5..44ba29a281 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -604,10 +604,10 @@ impl Item { chosen = Lottery::::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_light", - 3 => "common.loot_tables.armor_cloth", - 4 => "common.loot_tables.armor_heavy", - _ => "common.loot_tables.armor_misc", + 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", }) .read(); return Some(chosen.choose().to_item(None)); @@ -615,9 +615,9 @@ impl Item { SpriteKind::ChestBurried => { chosen = Lottery::::load_expect(match rng.gen_range(0..7) { 1 => "common.loot_tables.weapon_common", - 2 => "common.loot_tables.armor_light", - 3 => "common.loot_tables.armor_cloth", - _ => "common.loot_tables.armor_misc", + 2 => "common.loot_tables.armor.armor_light", + 3 => "common.loot_tables.armor.armor_cloth", + _ => "common.loot_tables.armor.armor_misc", }) .read(); return Some(chosen.choose().to_item(None)); @@ -626,7 +626,7 @@ impl Item { chosen = Lottery::::load_expect(match rng.gen_range(0..5) { 0 => "common.loot_tables.crafting", 1 => "common.loot_tables.weapon_common", - 2 => "common.loot_tables.armor_misc", + 2 => "common.loot_tables.armor.armor_misc", _ => "common.loot_tables.rocks", }) .read(); diff --git a/common/src/lottery.rs b/common/src/lottery.rs index 83c9028c6f..ef82002bb4 100644 --- a/common/src/lottery.rs +++ b/common/src/lottery.rs @@ -105,7 +105,7 @@ impl LootSpec { .to_item(body), Self::CreatureMaterial => body.map_or( Item::new_from_asset_expect("common.items.food.cheese"), - |b| b.get_loot(), + |b| b.get_material(), ), } } diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index f3a0c9a33e..697a6db940 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -1,9 +1,6 @@ use crate::{ client::Client, - comp::{ - biped_large, quadruped_low, quadruped_medium, quadruped_small, skills::SkillGroupKind, - theropod, PhysicsState, - }, + comp::{biped_large, quadruped_low, quadruped_small, skills::SkillGroupKind, PhysicsState}, rtsim::RtSim, Server, SpawnPoint, StateExt, }; @@ -346,8 +343,8 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc Lottery::::load_expect(match old_body { Some(common::comp::Body::Humanoid(_)) => match rng.gen_range(0..4) { 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.armor_light", - 2 => "common.loot_tables.armor_cloth", + 1 => "common.loot_tables.armor.armor_light", + 2 => "common.loot_tables.armor.armor_cloth", 3 => "common.loot_tables.weapon_common", 4 => "common.loots_tables.loot_table_armor_misc", _ => "common.loot_tables.humanoids", @@ -360,21 +357,14 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc }, _ => match rng.gen_range(0..4) { 0 => "common.loot_tables.food", - 2 => "common.loot_tables.animal_parts", - _ => "common.loot_tables.animal_parts", + 2 => "common.loot_tables.wild_animal", + _ => "common.loot_tables.wild_animal", }, } }, - Some(common::comp::Body::QuadrupedMedium(quadruped_medium)) => { - match quadruped_medium.species { - quadruped_medium::Species::Frostfang - | quadruped_medium::Species::Roshwalr => "common.loot_tables.animal_ice", - _ => match rng.gen_range(0..4) { - 0 => "common.loot_tables.food", - 2 => "common.loot_tables.animal_parts", - _ => "common.loot_tables.animal_parts", - }, - } + Some(common::comp::Body::QuadrupedMedium(_)) => match rng.gen_range(0..4) { + 0 => "common.loot_tables.food", + _ => "common.loot_tables.wild_animal", }, Some(common::comp::Body::BirdMedium(_)) => match rng.gen_range(0..3) { 0 => "common.loot_tables.food", @@ -385,7 +375,7 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc 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", - 1 => "common.loot_tables.wendigo", + 1 => "common.loot_tables.wild_animal", 2 => "common.loot_tables.weapon_uncommon", _ => "common.loot_tables.cave_large", }, @@ -393,42 +383,34 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc 0 => "common.loot_tables.food", 1 => "common.loot_tables.cave_large", 2 => "common.loot_tables.weapon_uncommon", - _ => "common.loot_tables.troll", + _ => "common.loot_tables.wild_animal", }, biped_large::Species::Occultsaurok | biped_large::Species::Mightysaurok | biped_large::Species::Slysaurok => "common.loot_tables.saurok", _ => match rng.gen_range(0..4) { 0 => "common.loot_tables.food", - 1 => "common.loot_tables.armor_nature", + 1 => "common.loot_tables.armor.armor_nature", _ => "common.loot_tables.cave_large", }, }, Some(common::comp::Body::Golem(_)) => match rng.gen_range(0..9) { 0 => "common.loot_tables.food", - 2 => "common.loot_tables.armor_light", - 3 => "common.loot_tables.armor_heavy", + 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", _ => "common.loot_tables.fallback", }, - Some(common::comp::Body::Theropod(theropod)) => match theropod.species { - theropod::Species::Sandraptor - | theropod::Species::Snowraptor - | theropod::Species::Woodraptor => match rng.gen_range(0..3) { - 0 => "common.loot_tables.raptor", - _ => "common.loot_tables.animal_parts", - }, - _ => "common.loot_tables.animal_parts", - }, + Some(common::comp::Body::Theropod(_)) => "common.loot_tables.wild_animal", Some(common::comp::Body::Dragon(_)) => "common.loot_tables.weapon_rare", Some(common::comp::Body::QuadrupedLow(quadruped_low)) => { match quadruped_low.species { quadruped_low::Species::Maneater => "common.loot_tables.maneater", _ => match rng.gen_range(0..3) { 0 => "common.loot_tables.food", - 1 => "common.loot_tables.animal_parts", + 1 => "common.loot_tables.wild_animal", _ => "common.loot_tables.fallback", }, } diff --git a/world/src/site/dungeon/mod.rs b/world/src/site/dungeon/mod.rs index 1da4d165bc..6561f6e6d2 100644 --- a/world/src/site/dungeon/mod.rs +++ b/world/src/site/dungeon/mod.rs @@ -555,28 +555,28 @@ impl Floor { 0 => Lottery::::load_expect( match dynamic_rng.gen_range(0..4) { 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.armor_cloth", + 1 => "common.loot_tables.armor.armor_cloth", _ => "common.loot_tables.weapon_common", }, ), 1 => Lottery::::load_expect( match dynamic_rng.gen_range(0..4) { 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.armor_light", + 1 => "common.loot_tables.armor.armor_light", _ => "common.loot_tables.weapon_uncommon", }, ), 2 => Lottery::::load_expect( match dynamic_rng.gen_range(0..4) { 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.armor_heavy", + 1 => "common.loot_tables.armor.armor_heavy", _ => "common.loot_tables.weapon_rare", }, ), 3 => Lottery::::load_expect( match dynamic_rng.gen_range(0..10) { 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.armor_heavy", + 1 => "common.loot_tables.armor.armor_heavy", 2 => "common.loot_tables.weapon_rare", _ => "common.loot_tables.cultists", }, @@ -584,7 +584,7 @@ impl Floor { 4 => Lottery::::load_expect( match dynamic_rng.gen_range(0..6) { 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.armor_misc", + 1 => "common.loot_tables.armor.armor_misc", 2 => "common.loot_tables.weapon_rare", _ => "common.loot_tables.cultists", }, @@ -592,12 +592,14 @@ impl Floor { 5 => Lottery::::load_expect( match dynamic_rng.gen_range(0..5) { 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.armor_misc", + 1 => "common.loot_tables.armor.armor_misc", 2 => "common.loot_tables.weapon_rare", _ => "common.loot_tables.cultists", }, ), - _ => Lottery::::load_expect("common.loot_tables.armor_misc"), + _ => Lottery::::load_expect( + "common.loot_tables.armor.armor_misc", + ), }; let chosen = chosen.read(); let chosen = chosen.choose(); @@ -844,7 +846,7 @@ impl Floor { "common.loot_tables.weapon_uncommon", ), 2 => Lottery::::load_expect( - "common.loot_tables.armor_heavy", + "common.loot_tables.armor.armor_heavy", ), 3 => Lottery::::load_expect( "common.loot_tables.weapon_rare", @@ -859,7 +861,7 @@ impl Floor { }, ), _ => Lottery::::load_expect( - "common.loot_tables.armor_misc", + "common.loot_tables.armor.armor_misc", ), }; let chosen = chosen.read(); @@ -997,13 +999,13 @@ impl Floor { if tile_pos == miniboss_spawn_tile && tile_wcenter.xy() == wpos2d { let chosen = match room.difficulty { 0 => Lottery::::load_expect( - "common.loot_tables.animal_parts", + "common.loot_tables.wild_animal", ), 1 => Lottery::::load_expect( - "common.loot_tables.animal_parts", + "common.loot_tables.wild_animal", ), 2 => Lottery::::load_expect( - "common.loot_tables.animal_parts", + "common.loot_tables.wild_animal", ), 3 => Lottery::::load_expect( "common.loot_tables.weapon_rare", @@ -1013,7 +1015,7 @@ impl Floor { ), 5 => Lottery::::load_expect("common.loot_tables.husk"), _ => Lottery::::load_expect( - "common.loot_tables.armor_misc", + "common.loot_tables.armor.armor_misc", ), }; let chosen = chosen.read(); From 833f1f330952662880a70ea7603ebf36f1f814c1 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 30 Mar 2021 16:06:53 -0400 Subject: [PATCH 06/17] Converted all armor in loot tables to reference armor set loot tables. --- assets/common/item_price_calculation.ron | 6 +-- assets/common/loot_tables/armor/agile.ron | 9 +++++ .../common/loot_tables/armor/armor_cloth.ron | 38 ------------------- .../common/loot_tables/armor/armor_heavy.ron | 21 ---------- .../common/loot_tables/armor/armor_light.ron | 27 ------------- .../common/loot_tables/armor/armor_misc.ron | 12 ------ .../common/loot_tables/armor/armor_nature.ron | 32 ---------------- assets/common/loot_tables/armor/cloth.ron | 34 +++++++++++++++++ assets/common/loot_tables/armor/cultist.ron | 8 ++++ assets/common/loot_tables/armor/druid.ron | 8 ++++ assets/common/loot_tables/armor/plate.ron | 8 ++++ assets/common/loot_tables/armor/steel.ron | 8 ++++ assets/common/loot_tables/armor/swift.ron | 8 ++++ assets/common/loot_tables/armor/twigs.ron | 8 ++++ .../common/loot_tables/armor/twigsflowers.ron | 8 ++++ .../common/loot_tables/armor/twigsleaves.ron | 8 ++++ assets/common/loot_tables/cultists.ron | 35 ++--------------- assets/common/loot_tables/miniboss.ron | 7 +--- common/src/comp/inventory/item/mod.rs | 16 ++++---- server/src/events/entity_manipulation.rs | 24 ++++++------ world/src/site/dungeon/mod.rs | 33 ++++++++-------- 21 files changed, 149 insertions(+), 209 deletions(-) create mode 100644 assets/common/loot_tables/armor/agile.ron delete mode 100644 assets/common/loot_tables/armor/armor_cloth.ron delete mode 100644 assets/common/loot_tables/armor/armor_heavy.ron delete mode 100644 assets/common/loot_tables/armor/armor_light.ron delete mode 100644 assets/common/loot_tables/armor/armor_misc.ron delete mode 100644 assets/common/loot_tables/armor/armor_nature.ron create mode 100644 assets/common/loot_tables/armor/cloth.ron create mode 100644 assets/common/loot_tables/armor/cultist.ron create mode 100644 assets/common/loot_tables/armor/druid.ron create mode 100644 assets/common/loot_tables/armor/plate.ron create mode 100644 assets/common/loot_tables/armor/steel.ron create mode 100644 assets/common/loot_tables/armor/swift.ron create mode 100644 assets/common/loot_tables/armor/twigs.ron create mode 100644 assets/common/loot_tables/armor/twigsflowers.ron create mode 100644 assets/common/loot_tables/armor/twigsleaves.ron diff --git a/assets/common/item_price_calculation.ron b/assets/common/item_price_calculation.ron index 6f071e774d..d181a8d158 100644 --- a/assets/common/item_price_calculation.ron +++ b/assets/common/item_price_calculation.ron @@ -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 diff --git a/assets/common/loot_tables/armor/agile.ron b/assets/common/loot_tables/armor/agile.ron new file mode 100644 index 0000000000..1cd2150a6c --- /dev/null +++ b/assets/common/loot_tables/armor/agile.ron @@ -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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/armor/armor_cloth.ron b/assets/common/loot_tables/armor/armor_cloth.ron deleted file mode 100644 index dce00687c7..0000000000 --- a/assets/common/loot_tables/armor/armor_cloth.ron +++ /dev/null @@ -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")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/armor/armor_heavy.ron b/assets/common/loot_tables/armor/armor_heavy.ron deleted file mode 100644 index 20b8d601f4..0000000000 --- a/assets/common/loot_tables/armor/armor_heavy.ron +++ /dev/null @@ -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")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/armor/armor_light.ron b/assets/common/loot_tables/armor/armor_light.ron deleted file mode 100644 index 77f29476b8..0000000000 --- a/assets/common/loot_tables/armor/armor_light.ron +++ /dev/null @@ -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")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/armor/armor_misc.ron b/assets/common/loot_tables/armor/armor_misc.ron deleted file mode 100644 index 95d602e405..0000000000 --- a/assets/common/loot_tables/armor/armor_misc.ron +++ /dev/null @@ -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")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/armor/armor_nature.ron b/assets/common/loot_tables/armor/armor_nature.ron deleted file mode 100644 index f95a29302a..0000000000 --- a/assets/common/loot_tables/armor/armor_nature.ron +++ /dev/null @@ -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")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/armor/cloth.ron b/assets/common/loot_tables/armor/cloth.ron new file mode 100644 index 0000000000..76265a4eb1 --- /dev/null +++ b/assets/common/loot_tables/armor/cloth.ron @@ -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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/armor/cultist.ron b/assets/common/loot_tables/armor/cultist.ron new file mode 100644 index 0000000000..8b4cc7cb56 --- /dev/null +++ b/assets/common/loot_tables/armor/cultist.ron @@ -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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/armor/druid.ron b/assets/common/loot_tables/armor/druid.ron new file mode 100644 index 0000000000..13b73adcde --- /dev/null +++ b/assets/common/loot_tables/armor/druid.ron @@ -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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/armor/plate.ron b/assets/common/loot_tables/armor/plate.ron new file mode 100644 index 0000000000..e7ba66a81b --- /dev/null +++ b/assets/common/loot_tables/armor/plate.ron @@ -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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/armor/steel.ron b/assets/common/loot_tables/armor/steel.ron new file mode 100644 index 0000000000..b189ec8186 --- /dev/null +++ b/assets/common/loot_tables/armor/steel.ron @@ -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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/armor/swift.ron b/assets/common/loot_tables/armor/swift.ron new file mode 100644 index 0000000000..8d1bb0d7ea --- /dev/null +++ b/assets/common/loot_tables/armor/swift.ron @@ -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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/armor/twigs.ron b/assets/common/loot_tables/armor/twigs.ron new file mode 100644 index 0000000000..c8dc254ba2 --- /dev/null +++ b/assets/common/loot_tables/armor/twigs.ron @@ -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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/armor/twigsflowers.ron b/assets/common/loot_tables/armor/twigsflowers.ron new file mode 100644 index 0000000000..e62be86dfa --- /dev/null +++ b/assets/common/loot_tables/armor/twigsflowers.ron @@ -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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/armor/twigsleaves.ron b/assets/common/loot_tables/armor/twigsleaves.ron new file mode 100644 index 0000000000..0e109d00ba --- /dev/null +++ b/assets/common/loot_tables/armor/twigsleaves.ron @@ -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")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/cultists.ron b/assets/common/loot_tables/cultists.ron index fe76e4b3d3..521a6ffbda 100644 --- a/assets/common/loot_tables/cultists.ron +++ b/assets/common/loot_tables/cultists.ron @@ -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")), diff --git a/assets/common/loot_tables/miniboss.ron b/assets/common/loot_tables/miniboss.ron index a4ab093eba..14f6453f3c 100644 --- a/assets/common/loot_tables/miniboss.ron +++ b/assets/common/loot_tables/miniboss.ron @@ -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 diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index 44ba29a281..ed0739fdd7 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -604,10 +604,10 @@ impl Item { chosen = Lottery::::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::::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::::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(); diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 697a6db940..ffed52ea76 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -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::::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", diff --git a/world/src/site/dungeon/mod.rs b/world/src/site/dungeon/mod.rs index 6561f6e6d2..0b26e2a48e 100644 --- a/world/src/site/dungeon/mod.rs +++ b/world/src/site/dungeon/mod.rs @@ -555,28 +555,28 @@ impl Floor { 0 => Lottery::::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::::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::::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::::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::::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::::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::::load_expect( - "common.loot_tables.armor.armor_misc", - ), + _ => Lottery::::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::::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::::load_expect( "common.loot_tables.weapon_rare", @@ -860,9 +861,9 @@ impl Floor { _ => "common.loot_tables.miniboss", }, ), - _ => Lottery::::load_expect( - "common.loot_tables.armor.armor_misc", - ), + _ => { + Lottery::::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::::load_expect("common.loot_tables.husk"), - _ => Lottery::::load_expect( - "common.loot_tables.armor.armor_misc", - ), + _ => { + Lottery::::load_expect("common.loot_tables.fallback") + }, }; let chosen = chosen.read(); let chosen = chosen.choose(); From 2e37cefce56a008e10f4eb3470c4a8c2c9033931 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 31 Mar 2021 11:40:31 -0400 Subject: [PATCH 07/17] Created weapon loot tables. --- .../common/items/weapons/axe/bloodsteel_axe-0.ron | 2 +- .../common/items/weapons/axe/bloodsteel_axe-1.ron | 2 +- .../common/items/weapons/axe/bloodsteel_axe-2.ron | 2 +- assets/common/items/weapons/axe/cobalt_axe-0.ron | 2 +- assets/common/items/weapons/axe/cobalt_axe-1.ron | 2 +- .../common/loot_tables/weapons/axe/bloodsteel.ron | 5 +++++ assets/common/loot_tables/weapons/axe/bronze.ron | 5 +++++ assets/common/loot_tables/weapons/axe/cobalt.ron | 4 ++++ assets/common/loot_tables/weapons/axe/iron.ron | 12 ++++++++++++ assets/common/loot_tables/weapons/axe/steel.ron | 9 +++++++++ assets/common/loot_tables/weapons/axe/worn-iron.ron | 7 +++++++ assets/common/loot_tables/weapons/bow/bone.ron | 6 ++++++ assets/common/loot_tables/weapons/bow/eldwood.ron | 5 +++++ assets/common/loot_tables/weapons/bow/frostwood.ron | 5 +++++ assets/common/loot_tables/weapons/bow/hardwood.ron | 8 ++++++++ assets/common/loot_tables/weapons/bow/metal.ron | 7 +++++++ assets/common/loot_tables/weapons/bow/rawwood.ron | 4 ++++ assets/common/loot_tables/weapons/bow/wood.ron | 7 +++++++ assets/common/loot_tables/weapons/cultist.ron | 5 +++++ .../loot_tables/weapons/hammer/bloodsteel.ron | 4 ++++ assets/common/loot_tables/weapons/hammer/cobalt.ron | 4 ++++ assets/common/loot_tables/weapons/hammer/iron.ron | 11 +++++++++++ assets/common/loot_tables/weapons/hammer/steel.ron | 8 ++++++++ assets/common/loot_tables/weapons/hammer/stone.ron | 6 ++++++ assets/common/loot_tables/weapons/hammer/wood.ron | 3 +++ .../common/loot_tables/weapons/hammer/worn-iron.ron | 6 ++++++ assets/common/loot_tables/weapons/legendary.ron | 10 ++++++++++ assets/common/loot_tables/weapons/starter.ron | 8 ++++++++ .../common/loot_tables/weapons/sword/bloodsteel.ron | 5 +++++ assets/common/loot_tables/weapons/sword/bronze.ron | 5 +++++ assets/common/loot_tables/weapons/sword/cobalt.ron | 6 ++++++ assets/common/loot_tables/weapons/sword/iron.ron | 13 +++++++++++++ assets/common/loot_tables/weapons/sword/steel.ron | 11 +++++++++++ assets/common/loot_tables/weapons/sword/stone.ron | 5 +++++ assets/common/loot_tables/weapons/sword/wood.ron | 5 +++++ common/src/bin/csv_import/main.rs | 2 +- 36 files changed, 205 insertions(+), 6 deletions(-) create mode 100644 assets/common/loot_tables/weapons/axe/bloodsteel.ron create mode 100644 assets/common/loot_tables/weapons/axe/bronze.ron create mode 100644 assets/common/loot_tables/weapons/axe/cobalt.ron create mode 100644 assets/common/loot_tables/weapons/axe/iron.ron create mode 100644 assets/common/loot_tables/weapons/axe/steel.ron create mode 100644 assets/common/loot_tables/weapons/axe/worn-iron.ron create mode 100644 assets/common/loot_tables/weapons/bow/bone.ron create mode 100644 assets/common/loot_tables/weapons/bow/eldwood.ron create mode 100644 assets/common/loot_tables/weapons/bow/frostwood.ron create mode 100644 assets/common/loot_tables/weapons/bow/hardwood.ron create mode 100644 assets/common/loot_tables/weapons/bow/metal.ron create mode 100644 assets/common/loot_tables/weapons/bow/rawwood.ron create mode 100644 assets/common/loot_tables/weapons/bow/wood.ron create mode 100644 assets/common/loot_tables/weapons/cultist.ron create mode 100644 assets/common/loot_tables/weapons/hammer/bloodsteel.ron create mode 100644 assets/common/loot_tables/weapons/hammer/cobalt.ron create mode 100644 assets/common/loot_tables/weapons/hammer/iron.ron create mode 100644 assets/common/loot_tables/weapons/hammer/steel.ron create mode 100644 assets/common/loot_tables/weapons/hammer/stone.ron create mode 100644 assets/common/loot_tables/weapons/hammer/wood.ron create mode 100644 assets/common/loot_tables/weapons/hammer/worn-iron.ron create mode 100644 assets/common/loot_tables/weapons/legendary.ron create mode 100644 assets/common/loot_tables/weapons/starter.ron create mode 100644 assets/common/loot_tables/weapons/sword/bloodsteel.ron create mode 100644 assets/common/loot_tables/weapons/sword/bronze.ron create mode 100644 assets/common/loot_tables/weapons/sword/cobalt.ron create mode 100644 assets/common/loot_tables/weapons/sword/iron.ron create mode 100644 assets/common/loot_tables/weapons/sword/steel.ron create mode 100644 assets/common/loot_tables/weapons/sword/stone.ron create mode 100644 assets/common/loot_tables/weapons/sword/wood.ron diff --git a/assets/common/items/weapons/axe/bloodsteel_axe-0.ron b/assets/common/items/weapons/axe/bloodsteel_axe-0.ron index 3d2cfc1495..58a2c1dd22 100644 --- a/assets/common/items/weapons/axe/bloodsteel_axe-0.ron +++ b/assets/common/items/weapons/axe/bloodsteel_axe-0.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.4, - power: 1.6, + power: 1.8, poise_strength: 1.4, speed: 1.0, crit_chance: 0.1421875, diff --git a/assets/common/items/weapons/axe/bloodsteel_axe-1.ron b/assets/common/items/weapons/axe/bloodsteel_axe-1.ron index 8d84d6dc09..85fb57be60 100644 --- a/assets/common/items/weapons/axe/bloodsteel_axe-1.ron +++ b/assets/common/items/weapons/axe/bloodsteel_axe-1.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.4, - power: 1.6, + power: 1.8, poise_strength: 1.8, speed: 1.0, crit_chance: 0.1421875, diff --git a/assets/common/items/weapons/axe/bloodsteel_axe-2.ron b/assets/common/items/weapons/axe/bloodsteel_axe-2.ron index 87c781125a..51c859d64c 100644 --- a/assets/common/items/weapons/axe/bloodsteel_axe-2.ron +++ b/assets/common/items/weapons/axe/bloodsteel_axe-2.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.4, - power: 1.6, + power: 1.8, poise_strength: 1.8, speed: 1.0, crit_chance: 0.1421875, diff --git a/assets/common/items/weapons/axe/cobalt_axe-0.ron b/assets/common/items/weapons/axe/cobalt_axe-0.ron index 5eaa7087a0..56c5aeb820 100644 --- a/assets/common/items/weapons/axe/cobalt_axe-0.ron +++ b/assets/common/items/weapons/axe/cobalt_axe-0.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.4, - power: 1.8, + power: 1.6, poise_strength: 1.0, speed: 1.0, crit_chance: 0.13611111, diff --git a/assets/common/items/weapons/axe/cobalt_axe-1.ron b/assets/common/items/weapons/axe/cobalt_axe-1.ron index ea31b94aeb..6bb57664a5 100644 --- a/assets/common/items/weapons/axe/cobalt_axe-1.ron +++ b/assets/common/items/weapons/axe/cobalt_axe-1.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.4, - power: 1.8, + power: 1.6, poise_strength: 1.0, speed: 1.0, crit_chance: 0.13611111, diff --git a/assets/common/loot_tables/weapons/axe/bloodsteel.ron b/assets/common/loot_tables/weapons/axe/bloodsteel.ron new file mode 100644 index 0000000000..6bea84d63c --- /dev/null +++ b/assets/common/loot_tables/weapons/axe/bloodsteel.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.axe.bloodsteel_axe-0")), + (1.0, Item("common.items.weapons.axe.bloodsteel_axe-1")), + (1.0, Item("common.items.weapons.axe.bloodsteel_axe-2")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/axe/bronze.ron b/assets/common/loot_tables/weapons/axe/bronze.ron new file mode 100644 index 0000000000..9cfe1fd020 --- /dev/null +++ b/assets/common/loot_tables/weapons/axe/bronze.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.axe.bronze_axe-0")), + (1.0, Item("common.items.weapons.axe.bronze_axe-1")), + (1.0, Item("common.items.weapons.axe.bronze_axe-2")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/axe/cobalt.ron b/assets/common/loot_tables/weapons/axe/cobalt.ron new file mode 100644 index 0000000000..706962b998 --- /dev/null +++ b/assets/common/loot_tables/weapons/axe/cobalt.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.weapons.axe.cobalt_axe-0")), + (1.0, Item("common.items.weapons.axe.cobalt_axe-1")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/axe/iron.ron b/assets/common/loot_tables/weapons/axe/iron.ron new file mode 100644 index 0000000000..1acdbf400f --- /dev/null +++ b/assets/common/loot_tables/weapons/axe/iron.ron @@ -0,0 +1,12 @@ +[ + (1.0, Item("common.items.weapons.axe.iron_axe-0")), + (1.0, Item("common.items.weapons.axe.iron_axe-1")), + (1.0, Item("common.items.weapons.axe.iron_axe-2")), + (1.0, Item("common.items.weapons.axe.iron_axe-3")), + (1.0, Item("common.items.weapons.axe.iron_axe-4")), + (1.0, Item("common.items.weapons.axe.iron_axe-5")), + (1.0, Item("common.items.weapons.axe.iron_axe-6")), + (1.0, Item("common.items.weapons.axe.iron_axe-7")), + (1.0, Item("common.items.weapons.axe.iron_axe-8")), + (1.0, Item("common.items.weapons.axe.iron_axe-9")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/axe/steel.ron b/assets/common/loot_tables/weapons/axe/steel.ron new file mode 100644 index 0000000000..5288490d5a --- /dev/null +++ b/assets/common/loot_tables/weapons/axe/steel.ron @@ -0,0 +1,9 @@ +[ + (1.0, Item("common.items.weapons.axe.steel_axe-0")), + (1.0, Item("common.items.weapons.axe.steel_axe-1")), + (1.0, Item("common.items.weapons.axe.steel_axe-2")), + (1.0, Item("common.items.weapons.axe.steel_axe-3")), + (1.0, Item("common.items.weapons.axe.steel_axe-4")), + (1.0, Item("common.items.weapons.axe.steel_axe-5")), + (1.0, Item("common.items.weapons.axe.steel_axe-6")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/axe/worn-iron.ron b/assets/common/loot_tables/weapons/axe/worn-iron.ron new file mode 100644 index 0000000000..ca15454aac --- /dev/null +++ b/assets/common/loot_tables/weapons/axe/worn-iron.ron @@ -0,0 +1,7 @@ +[ + (1.0, Item("common.items.weapons.axe.worn_iron_axe-0")), + (1.0, Item("common.items.weapons.axe.worn_iron_axe-1")), + (1.0, Item("common.items.weapons.axe.worn_iron_axe-2")), + (1.0, Item("common.items.weapons.axe.worn_iron_axe-3")), + (1.0, Item("common.items.weapons.axe.worn_iron_axe-4")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/bow/bone.ron b/assets/common/loot_tables/weapons/bow/bone.ron new file mode 100644 index 0000000000..e12d53e09d --- /dev/null +++ b/assets/common/loot_tables/weapons/bow/bone.ron @@ -0,0 +1,6 @@ +[ + (1.0, Item("common.items.weapons.bow.bone-0")), + (1.0, Item("common.items.weapons.bow.bone-1")), + (1.0, Item("common.items.weapons.bow.bone-2")), + (1.0, Item("common.items.weapons.bow.bone-3")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/bow/eldwood.ron b/assets/common/loot_tables/weapons/bow/eldwood.ron new file mode 100644 index 0000000000..59e51a4f8c --- /dev/null +++ b/assets/common/loot_tables/weapons/bow/eldwood.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.bow.eldwood-0")), + (1.0, Item("common.items.weapons.bow.eldwood-1")), + (1.0, Item("common.items.weapons.bow.eldwood-2")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/bow/frostwood.ron b/assets/common/loot_tables/weapons/bow/frostwood.ron new file mode 100644 index 0000000000..a07c74d1d7 --- /dev/null +++ b/assets/common/loot_tables/weapons/bow/frostwood.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.bow.frostwood-0")), + (1.0, Item("common.items.weapons.bow.frostwood-1")), + (1.0, Item("common.items.weapons.bow.frostwood-2")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/bow/hardwood.ron b/assets/common/loot_tables/weapons/bow/hardwood.ron new file mode 100644 index 0000000000..803ddf75d5 --- /dev/null +++ b/assets/common/loot_tables/weapons/bow/hardwood.ron @@ -0,0 +1,8 @@ +[ + (1.0, Item("common.items.weapons.bow.hardwood-0")), + (1.0, Item("common.items.weapons.bow.hardwood-1")), + (1.0, Item("common.items.weapons.bow.hardwood-2")), + (1.0, Item("common.items.weapons.bow.hardwood-3")), + (1.0, Item("common.items.weapons.bow.hardwood-4")), + (1.0, Item("common.items.weapons.bow.hardwood-5")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/bow/metal.ron b/assets/common/loot_tables/weapons/bow/metal.ron new file mode 100644 index 0000000000..0bcd16b997 --- /dev/null +++ b/assets/common/loot_tables/weapons/bow/metal.ron @@ -0,0 +1,7 @@ +[ + (1.0, Item("common.items.weapons.bow.rawwood-0")), + (1.0, Item("common.items.weapons.bow.rawwood-1")), + (1.0, Item("common.items.weapons.bow.rawwood-2")), + (1.0, Item("common.items.weapons.bow.rawwood-3")), + (1.0, Item("common.items.weapons.bow.rawwood-4")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/bow/rawwood.ron b/assets/common/loot_tables/weapons/bow/rawwood.ron new file mode 100644 index 0000000000..cd03cc78e1 --- /dev/null +++ b/assets/common/loot_tables/weapons/bow/rawwood.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.weapons.bow.rawwood-0")), + (1.0, Item("common.items.weapons.bow.rawwood-1")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/bow/wood.ron b/assets/common/loot_tables/weapons/bow/wood.ron new file mode 100644 index 0000000000..e2629960ae --- /dev/null +++ b/assets/common/loot_tables/weapons/bow/wood.ron @@ -0,0 +1,7 @@ +[ + (1.0, Item("common.items.weapons.bow.wood-0")), + (1.0, Item("common.items.weapons.bow.wood-1")), + (1.0, Item("common.items.weapons.bow.wood-2")), + (1.0, Item("common.items.weapons.bow.wood-3")), + (1.0, Item("common.items.weapons.bow.wood-4")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/cultist.ron b/assets/common/loot_tables/weapons/cultist.ron new file mode 100644 index 0000000000..dbb9d9b2bd --- /dev/null +++ b/assets/common/loot_tables/weapons/cultist.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.sword.cultist")), + (1.0, Item("common.items.weapons.hammer.cultist_purp_2h-0")), + (1.0, Item("common.items.weapons.staff.cultist_staff")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/hammer/bloodsteel.ron b/assets/common/loot_tables/weapons/hammer/bloodsteel.ron new file mode 100644 index 0000000000..72d10c43b0 --- /dev/null +++ b/assets/common/loot_tables/weapons/hammer/bloodsteel.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.weapons.hammer.runic_hammer")), + (1.0, Item("common.items.weapons.hammer.ramshead_hammer")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/hammer/cobalt.ron b/assets/common/loot_tables/weapons/hammer/cobalt.ron new file mode 100644 index 0000000000..bdd436bf89 --- /dev/null +++ b/assets/common/loot_tables/weapons/hammer/cobalt.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.weapons.hammer.cobalt_hammer-0")), + (1.0, Item("common.items.weapons.hammer.cobalt_hammer-1")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/hammer/iron.ron b/assets/common/loot_tables/weapons/hammer/iron.ron new file mode 100644 index 0000000000..e2aba04a42 --- /dev/null +++ b/assets/common/loot_tables/weapons/hammer/iron.ron @@ -0,0 +1,11 @@ +[ + (1.0, Item("common.items.weapons.hammer.iron_hammer-0")), + (1.0, Item("common.items.weapons.hammer.iron_hammer-1")), + (1.0, Item("common.items.weapons.hammer.iron_hammer-2")), + (1.0, Item("common.items.weapons.hammer.iron_hammer-3")), + (1.0, Item("common.items.weapons.hammer.iron_hammer-4")), + (1.0, Item("common.items.weapons.hammer.iron_hammer-5")), + (1.0, Item("common.items.weapons.hammer.iron_hammer-6")), + (1.0, Item("common.items.weapons.hammer.iron_hammer-7")), + (1.0, Item("common.items.weapons.hammer.iron_hammer-8")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/hammer/steel.ron b/assets/common/loot_tables/weapons/hammer/steel.ron new file mode 100644 index 0000000000..c607bf58f5 --- /dev/null +++ b/assets/common/loot_tables/weapons/hammer/steel.ron @@ -0,0 +1,8 @@ +[ + (1.0, Item("common.items.weapons.hammer.steel_hammer-0")), + (1.0, Item("common.items.weapons.hammer.steel_hammer-1")), + (1.0, Item("common.items.weapons.hammer.steel_hammer-2")), + (1.0, Item("common.items.weapons.hammer.steel_hammer-3")), + (1.0, Item("common.items.weapons.hammer.steel_hammer-4")), + (1.0, Item("common.items.weapons.hammer.steel_hammer-5")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/hammer/stone.ron b/assets/common/loot_tables/weapons/hammer/stone.ron new file mode 100644 index 0000000000..f1f5d6df25 --- /dev/null +++ b/assets/common/loot_tables/weapons/hammer/stone.ron @@ -0,0 +1,6 @@ +[ + (1.0, Item("common.items.weapons.hammer.stone_hammer-0")), + (1.0, Item("common.items.weapons.hammer.stone_hammer-1")), + (1.0, Item("common.items.weapons.hammer.stone_hammer-2")), + (1.0, Item("common.items.weapons.hammer.stone_hammer-3")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/hammer/wood.ron b/assets/common/loot_tables/weapons/hammer/wood.ron new file mode 100644 index 0000000000..704cc84c85 --- /dev/null +++ b/assets/common/loot_tables/weapons/hammer/wood.ron @@ -0,0 +1,3 @@ +[ + (1.0, Item("common.items.weapons.hammer.wood_hammer-0")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/hammer/worn-iron.ron b/assets/common/loot_tables/weapons/hammer/worn-iron.ron new file mode 100644 index 0000000000..66e28f07ab --- /dev/null +++ b/assets/common/loot_tables/weapons/hammer/worn-iron.ron @@ -0,0 +1,6 @@ +[ + (1.0, Item("common.items.weapons.hammer.worn_iron_hammer-0")), + (1.0, Item("common.items.weapons.hammer.worn_iron_hammer-1")), + (1.0, Item("common.items.weapons.hammer.worn_iron_hammer-2")), + (1.0, Item("common.items.weapons.hammer.worn_iron_hammer-3")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/legendary.ron b/assets/common/loot_tables/weapons/legendary.ron new file mode 100644 index 0000000000..349bccf5c7 --- /dev/null +++ b/assets/common/loot_tables/weapons/legendary.ron @@ -0,0 +1,10 @@ +[ + (1.0, Item("common.items.weapons.sword.caladbolg")), + (1.0, Item("common.items.weapons.hammer.mjolnir")), + (1.0, Item("common.items.weapons.axe.parashu")), + (1.0, Item("common.items.weapons.bow.sagitta")), + (0.5, Item("common.items.weapons.staff.phoenix")), + (0.5, Item("common.items.weapons.staff.laevateinn")), + (0.5, Item("common.items.weapons.sceptre.root_evil")), + (0.5, Item("common.items.weapons.sceptre.caduceus")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/starter.ron b/assets/common/loot_tables/weapons/starter.ron new file mode 100644 index 0000000000..6cd133e0aa --- /dev/null +++ b/assets/common/loot_tables/weapons/starter.ron @@ -0,0 +1,8 @@ +[ + (1.0, Item("common.items.weapons.sword.starter")), + (1.0, Item("common.items.weapons.hammer.starter_hammer")), + (1.0, Item("common.items.weapons.bow.starter")), + (1.0, Item("common.items.weapons.axe.starter_axe")), + (1.0, Item("common.items.weapons.staff.starter_staff")), + (1.0, Item("common.items.weapons.sceptre.starter_sceptre")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/sword/bloodsteel.ron b/assets/common/loot_tables/weapons/sword/bloodsteel.ron new file mode 100644 index 0000000000..da08d3a973 --- /dev/null +++ b/assets/common/loot_tables/weapons/sword/bloodsteel.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.sword.bloodsteel-0")), + (1.0, Item("common.items.weapons.sword.bloodsteel-1")), + (1.0, Item("common.items.weapons.sword.bloodsteel-2")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/sword/bronze.ron b/assets/common/loot_tables/weapons/sword/bronze.ron new file mode 100644 index 0000000000..5ab30d738f --- /dev/null +++ b/assets/common/loot_tables/weapons/sword/bronze.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.sword.bronze-0")), + (1.0, Item("common.items.weapons.sword.bronze-1")), + (1.0, Item("common.items.weapons.sword.bronze-2")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/sword/cobalt.ron b/assets/common/loot_tables/weapons/sword/cobalt.ron new file mode 100644 index 0000000000..fe77f59554 --- /dev/null +++ b/assets/common/loot_tables/weapons/sword/cobalt.ron @@ -0,0 +1,6 @@ +[ + (1.0, Item("common.items.weapons.sword.cobalt-0")), + (1.0, Item("common.items.weapons.sword.cobalt-1")), + (1.0, Item("common.items.weapons.sword.cobalt-2")), + (1.0, Item("common.items.weapons.sword.cobalt-3")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/sword/iron.ron b/assets/common/loot_tables/weapons/sword/iron.ron new file mode 100644 index 0000000000..ae2b6b13c8 --- /dev/null +++ b/assets/common/loot_tables/weapons/sword/iron.ron @@ -0,0 +1,13 @@ +[ + (1.0, Item("common.items.weapons.sword.iron-0")), + (1.0, Item("common.items.weapons.sword.iron-1")), + (1.0, Item("common.items.weapons.sword.iron-2")), + (1.0, Item("common.items.weapons.sword.iron-3")), + (1.0, Item("common.items.weapons.sword.iron-4")), + (1.0, Item("common.items.weapons.sword.iron-5")), + (1.0, Item("common.items.weapons.sword.iron-6")), + (1.0, Item("common.items.weapons.sword.iron-7")), + (1.0, Item("common.items.weapons.sword.iron-8")), + (1.0, Item("common.items.weapons.sword.iron-9")), + (1.0, Item("common.items.weapons.sword.iron-10")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/sword/steel.ron b/assets/common/loot_tables/weapons/sword/steel.ron new file mode 100644 index 0000000000..c672fdf04f --- /dev/null +++ b/assets/common/loot_tables/weapons/sword/steel.ron @@ -0,0 +1,11 @@ +[ + (1.0, Item("common.items.weapons.sword.steel-0")), + (1.0, Item("common.items.weapons.sword.steel-1")), + (1.0, Item("common.items.weapons.sword.steel-2")), + (1.0, Item("common.items.weapons.sword.steel-3")), + (1.0, Item("common.items.weapons.sword.steel-4")), + (1.0, Item("common.items.weapons.sword.steel-5")), + (1.0, Item("common.items.weapons.sword.steel-6")), + (1.0, Item("common.items.weapons.sword.steel-7")), + (1.0, Item("common.items.weapons.sword.steel-8")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/sword/stone.ron b/assets/common/loot_tables/weapons/sword/stone.ron new file mode 100644 index 0000000000..95fcf3ec45 --- /dev/null +++ b/assets/common/loot_tables/weapons/sword/stone.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.sword.stone-0")), + (1.0, Item("common.items.weapons.sword.stone-1")), + (1.0, Item("common.items.weapons.sword.stone-2")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/sword/wood.ron b/assets/common/loot_tables/weapons/sword/wood.ron new file mode 100644 index 0000000000..d09908a5e8 --- /dev/null +++ b/assets/common/loot_tables/weapons/sword/wood.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.sword.wood-0")), + (1.0, Item("common.items.weapons.sword.wood-1")), + (1.0, Item("common.items.weapons.sword.wood-2")), +] \ No newline at end of file diff --git a/common/src/bin/csv_import/main.rs b/common/src/bin/csv_import/main.rs index d66e59cdb8..0eb3d12b1e 100644 --- a/common/src/bin/csv_import/main.rs +++ b/common/src/bin/csv_import/main.rs @@ -404,7 +404,7 @@ fn loot_table(loot_table: &str) -> Result<(), Box> { .to_string(), ), "CreatureMaterial" => LootSpec::CreatureMaterial, - _ => panic!("Loot specifier kind must be either \"Item\" or \"LootTable\""), + a => panic!("Loot specifier kind must be either \"Item\" or \"LootTable\"\n{}", a), }; let chance: f32 = record .get(headers["Relative Chance"]) From a2fc2abf83ff364a705854cf20161516595fff9d Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 31 Mar 2021 12:30:52 -0400 Subject: [PATCH 08/17] Made staff and sceptre balancing sane. Created loot tables for staffs and sceptres. --- assets/common/items/weapons/sceptre/fork0.ron | 2 +- assets/common/items/weapons/sceptre/loops0.ron | 2 +- assets/common/items/weapons/sceptre/moon0.ron | 4 ++-- assets/common/items/weapons/sceptre/root_green0.ron | 4 ++-- assets/common/items/weapons/sceptre/sceptre_velorite_0.ron | 4 ++-- assets/common/items/weapons/staff/aurora.ron | 4 ++-- assets/common/items/weapons/staff/bent_fuse.ron | 4 ++-- assets/common/items/weapons/staff/bone_staff.ron | 4 ++-- assets/common/items/weapons/staff/crimson_eye.ron | 4 ++-- assets/common/items/weapons/staff/fiery_wishing_rod.ron | 2 +- assets/common/items/weapons/staff/flamethrower_0.ron | 2 +- assets/common/items/weapons/staff/frostwood_torch.ron | 2 +- assets/common/items/weapons/staff/golden_khakkara.ron | 4 ++-- assets/common/items/weapons/staff/heated_arm.ron | 4 ++-- assets/common/items/weapons/staff/infused_tower.ron | 4 ++-- assets/common/items/weapons/staff/lava_rod.ron | 2 +- assets/common/items/weapons/staff/ley_seeker.ron | 4 ++-- assets/common/items/weapons/staff/orc_iron.ron | 4 ++-- assets/common/items/weapons/staff/ruby_rod.ron | 2 +- assets/common/items/weapons/staff/solar.ron | 4 ++-- assets/common/loot_tables/weapons/cave.ron | 5 +++++ assets/common/loot_tables/weapons/sceptre/bamboo.ron | 4 ++++ assets/common/loot_tables/weapons/sceptre/eldwood.ron | 3 +++ assets/common/loot_tables/weapons/sceptre/frostwood.ron | 4 ++++ assets/common/loot_tables/weapons/sceptre/hardwood.ron | 4 ++++ assets/common/loot_tables/weapons/sceptre/ironwood.ron | 5 +++++ assets/common/loot_tables/weapons/staff/bamboo.ron | 5 +++++ assets/common/loot_tables/weapons/staff/eldwood.ron | 5 +++++ assets/common/loot_tables/weapons/staff/frostwood.ron | 4 ++++ assets/common/loot_tables/weapons/staff/hardwood.ron | 5 +++++ assets/common/loot_tables/weapons/staff/ironwood.ron | 5 +++++ assets/common/loot_tables/weapons/staff/wood.ron | 4 ++++ 32 files changed, 86 insertions(+), 33 deletions(-) create mode 100644 assets/common/loot_tables/weapons/cave.ron create mode 100644 assets/common/loot_tables/weapons/sceptre/bamboo.ron create mode 100644 assets/common/loot_tables/weapons/sceptre/eldwood.ron create mode 100644 assets/common/loot_tables/weapons/sceptre/frostwood.ron create mode 100644 assets/common/loot_tables/weapons/sceptre/hardwood.ron create mode 100644 assets/common/loot_tables/weapons/sceptre/ironwood.ron create mode 100644 assets/common/loot_tables/weapons/staff/bamboo.ron create mode 100644 assets/common/loot_tables/weapons/staff/eldwood.ron create mode 100644 assets/common/loot_tables/weapons/staff/frostwood.ron create mode 100644 assets/common/loot_tables/weapons/staff/hardwood.ron create mode 100644 assets/common/loot_tables/weapons/staff/ironwood.ron create mode 100644 assets/common/loot_tables/weapons/staff/wood.ron diff --git a/assets/common/items/weapons/sceptre/fork0.ron b/assets/common/items/weapons/sceptre/fork0.ron index 48aaf66f89..91d4fa94c6 100644 --- a/assets/common/items/weapons/sceptre/fork0.ron +++ b/assets/common/items/weapons/sceptre/fork0.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.4, - power: 2.0, + power: 1.7, poise_strength: 1.5, speed: 0.8, crit_chance: 0.11666667, diff --git a/assets/common/items/weapons/sceptre/loops0.ron b/assets/common/items/weapons/sceptre/loops0.ron index ff708bd16f..ff0c26e0c6 100644 --- a/assets/common/items/weapons/sceptre/loops0.ron +++ b/assets/common/items/weapons/sceptre/loops0.ron @@ -8,7 +8,7 @@ ItemDef( equip_time_secs: 0.4, power: 1.2, poise_strength: 1.5, - speed: 1.5, + speed: 1.3, crit_chance: 0.1925, crit_mult: 1.4329004, )), diff --git a/assets/common/items/weapons/sceptre/moon0.ron b/assets/common/items/weapons/sceptre/moon0.ron index 9d4f3698f5..971b68103e 100644 --- a/assets/common/items/weapons/sceptre/moon0.ron +++ b/assets/common/items/weapons/sceptre/moon0.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.4, - power: 1.6, + power: 1.3, poise_strength: 1.5, - speed: 0.5, + speed: 0.9, crit_chance: 0.0609375, crit_mult: 1.7326007, )), diff --git a/assets/common/items/weapons/sceptre/root_green0.ron b/assets/common/items/weapons/sceptre/root_green0.ron index 317a90aa9d..b252876c11 100644 --- a/assets/common/items/weapons/sceptre/root_green0.ron +++ b/assets/common/items/weapons/sceptre/root_green0.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.4, - power: 3.5, + power: 0.7, poise_strength: 1.5, - speed: 0.4, + speed: 1.1, crit_chance: 0.055102043, crit_mult: 1.4444444, )), diff --git a/assets/common/items/weapons/sceptre/sceptre_velorite_0.ron b/assets/common/items/weapons/sceptre/sceptre_velorite_0.ron index c0bc0e4725..9dfbc9e842 100644 --- a/assets/common/items/weapons/sceptre/sceptre_velorite_0.ron +++ b/assets/common/items/weapons/sceptre/sceptre_velorite_0.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.4, - power: 1.2, + power: 1.8, poise_strength: 1.5, - speed: 1.6, + speed: 1.2, crit_chance: 0.21153846, crit_mult: 1.4502164, )), diff --git a/assets/common/items/weapons/staff/aurora.ron b/assets/common/items/weapons/staff/aurora.ron index 1d6be7db9f..4f67f8737f 100644 --- a/assets/common/items/weapons/staff/aurora.ron +++ b/assets/common/items/weapons/staff/aurora.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 0.8, + power: 0.6, poise_strength: 1.0, - speed: 2.0, + speed: 1.2, crit_chance: 0.2625, crit_mult: 1.4761904, )), diff --git a/assets/common/items/weapons/staff/bent_fuse.ron b/assets/common/items/weapons/staff/bent_fuse.ron index 5ea0391ccb..dbed28cf3b 100644 --- a/assets/common/items/weapons/staff/bent_fuse.ron +++ b/assets/common/items/weapons/staff/bent_fuse.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 1.5, + power: 1.1, poise_strength: 1.0, - speed: 1.2, + speed: 0.7, crit_chance: 0.17045455, crit_mult: 1.4469842, )), diff --git a/assets/common/items/weapons/staff/bone_staff.ron b/assets/common/items/weapons/staff/bone_staff.ron index 26a20cc4ad..2ae02e9855 100644 --- a/assets/common/items/weapons/staff/bone_staff.ron +++ b/assets/common/items/weapons/staff/bone_staff.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 1.0, + power: 0.5, poise_strength: 1.0, - speed: 1.0, + speed: 1.2, crit_chance: 0.1125, crit_mult: 1.6349206, )), diff --git a/assets/common/items/weapons/staff/crimson_eye.ron b/assets/common/items/weapons/staff/crimson_eye.ron index 46a26b28dd..f4f54e2323 100644 --- a/assets/common/items/weapons/staff/crimson_eye.ron +++ b/assets/common/items/weapons/staff/crimson_eye.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 1.3, + power: 0.5, poise_strength: 1.0, - speed: 1.0, + speed: 1.1, crit_chance: 0.125, crit_mult: 1.4571428, )), diff --git a/assets/common/items/weapons/staff/fiery_wishing_rod.ron b/assets/common/items/weapons/staff/fiery_wishing_rod.ron index f390f98f9e..5d9301cb01 100644 --- a/assets/common/items/weapons/staff/fiery_wishing_rod.ron +++ b/assets/common/items/weapons/staff/fiery_wishing_rod.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 1.5, + power: 0.95, poise_strength: 1.0, speed: 0.8, crit_chance: 0.11111111, diff --git a/assets/common/items/weapons/staff/flamethrower_0.ron b/assets/common/items/weapons/staff/flamethrower_0.ron index 77d92c2951..c558e2f005 100644 --- a/assets/common/items/weapons/staff/flamethrower_0.ron +++ b/assets/common/items/weapons/staff/flamethrower_0.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 2.2, + power: 1.5, poise_strength: 1.0, speed: 0.8, crit_chance: 0.113131315, diff --git a/assets/common/items/weapons/staff/frostwood_torch.ron b/assets/common/items/weapons/staff/frostwood_torch.ron index dedd5926a7..ca3280d0c7 100644 --- a/assets/common/items/weapons/staff/frostwood_torch.ron +++ b/assets/common/items/weapons/staff/frostwood_torch.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 1.6, + power: 1.3, poise_strength: 1.0, speed: 1.2, crit_chance: 0.134379086, diff --git a/assets/common/items/weapons/staff/golden_khakkara.ron b/assets/common/items/weapons/staff/golden_khakkara.ron index 7b67add944..677abccdc9 100644 --- a/assets/common/items/weapons/staff/golden_khakkara.ron +++ b/assets/common/items/weapons/staff/golden_khakkara.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 1.2, + power: 1.1, poise_strength: 1.0, - speed: 1.2, + speed: 1.1, crit_chance: 0.115, crit_mult: 1.4571428, )), diff --git a/assets/common/items/weapons/staff/heated_arm.ron b/assets/common/items/weapons/staff/heated_arm.ron index 21c061996b..d7bd74282e 100644 --- a/assets/common/items/weapons/staff/heated_arm.ron +++ b/assets/common/items/weapons/staff/heated_arm.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.1, - power: 1.2, + power: 1.0, poise_strength: 1.0, - speed: 1.2, + speed: 1.0, crit_chance: 0.15, crit_mult: 1.4761904, )), diff --git a/assets/common/items/weapons/staff/infused_tower.ron b/assets/common/items/weapons/staff/infused_tower.ron index 217ec3dfe5..193e78cbeb 100644 --- a/assets/common/items/weapons/staff/infused_tower.ron +++ b/assets/common/items/weapons/staff/infused_tower.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 1.2, + power: 1.1, poise_strength: 1.0, - speed: 1.4, + speed: 0.9, crit_chance: 0.18715277, crit_mult: 1.445269, )), diff --git a/assets/common/items/weapons/staff/lava_rod.ron b/assets/common/items/weapons/staff/lava_rod.ron index d84459eb79..dd396aacd1 100644 --- a/assets/common/items/weapons/staff/lava_rod.ron +++ b/assets/common/items/weapons/staff/lava_rod.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 2.125, + power: 0.7, poise_strength: 1.0, speed: 0.8, crit_chance: 0.114379086, diff --git a/assets/common/items/weapons/staff/ley_seeker.ron b/assets/common/items/weapons/staff/ley_seeker.ron index f77d1c4ede..f8a7d9a7fb 100644 --- a/assets/common/items/weapons/staff/ley_seeker.ron +++ b/assets/common/items/weapons/staff/ley_seeker.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 1.0, + power: 1.6, poise_strength: 1.0, - speed: 1.0, + speed: 0.9, crit_chance: 0.1125, crit_mult: 1.6349206, )), diff --git a/assets/common/items/weapons/staff/orc_iron.ron b/assets/common/items/weapons/staff/orc_iron.ron index 855908ae85..ff680c147e 100644 --- a/assets/common/items/weapons/staff/orc_iron.ron +++ b/assets/common/items/weapons/staff/orc_iron.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 0.9, + power: 0.5, poise_strength: 1.0, - speed: 2.0, + speed: 0.8, crit_chance: 0.2638889, crit_mult: 1.481203, )), diff --git a/assets/common/items/weapons/staff/ruby_rod.ron b/assets/common/items/weapons/staff/ruby_rod.ron index 9e0942dcbc..d83f85db9a 100644 --- a/assets/common/items/weapons/staff/ruby_rod.ron +++ b/assets/common/items/weapons/staff/ruby_rod.ron @@ -8,7 +8,7 @@ ItemDef( equip_time_secs: 0.3, power: 1.6, poise_strength: 1.0, - speed: 1.0, + speed: 1.1, crit_chance: 0.2625, crit_mult: 1.4761904, )), diff --git a/assets/common/items/weapons/staff/solar.ron b/assets/common/items/weapons/staff/solar.ron index 9aea3b7f1f..bb76c9a306 100644 --- a/assets/common/items/weapons/staff/solar.ron +++ b/assets/common/items/weapons/staff/solar.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 1.2, + power: 0.9, poise_strength: 1.0, - speed: 0.9, + speed: 1.1, crit_chance: 0.125, crit_mult: 1.4571428, )), diff --git a/assets/common/loot_tables/weapons/cave.ron b/assets/common/loot_tables/weapons/cave.ron new file mode 100644 index 0000000000..6270e72836 --- /dev/null +++ b/assets/common/loot_tables/weapons/cave.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.sceptre.sceptre_velorite_0")), + (1.0, Item("common.items.weapons.bow.velorite")), + (1.0, Item("common.items.weapons.axe.malachite_axe-0")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/sceptre/bamboo.ron b/assets/common/loot_tables/weapons/sceptre/bamboo.ron new file mode 100644 index 0000000000..73c42b180b --- /dev/null +++ b/assets/common/loot_tables/weapons/sceptre/bamboo.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.weapons.sceptre.divine_gohei")), + (1.0, Item("common.items.weapons.sceptre.root_green0")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/sceptre/eldwood.ron b/assets/common/loot_tables/weapons/sceptre/eldwood.ron new file mode 100644 index 0000000000..0166b47695 --- /dev/null +++ b/assets/common/loot_tables/weapons/sceptre/eldwood.ron @@ -0,0 +1,3 @@ +[ + (1.0, Item("common.items.weapons.sceptre.emerald")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/sceptre/frostwood.ron b/assets/common/loot_tables/weapons/sceptre/frostwood.ron new file mode 100644 index 0000000000..60faff5c1d --- /dev/null +++ b/assets/common/loot_tables/weapons/sceptre/frostwood.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.weapons.sceptre.fork0")), + (1.0, Item("common.items.weapons.sceptre.loops0")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/sceptre/hardwood.ron b/assets/common/loot_tables/weapons/sceptre/hardwood.ron new file mode 100644 index 0000000000..bc31a7cb01 --- /dev/null +++ b/assets/common/loot_tables/weapons/sceptre/hardwood.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.weapons.sceptre.druids_arbor")), + (1.0, Item("common.items.weapons.sceptre.staff_nature")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/sceptre/ironwood.ron b/assets/common/loot_tables/weapons/sceptre/ironwood.ron new file mode 100644 index 0000000000..d8f78f38be --- /dev/null +++ b/assets/common/loot_tables/weapons/sceptre/ironwood.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.sceptre.coralline_cane")), + (1.0, Item("common.items.weapons.sceptre.moon0")), + (1.0, Item("common.items.weapons.sceptre.totem_green")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/staff/bamboo.ron b/assets/common/loot_tables/weapons/staff/bamboo.ron new file mode 100644 index 0000000000..9c01806911 --- /dev/null +++ b/assets/common/loot_tables/weapons/staff/bamboo.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.staff.bent_fuse")), + (1.0, Item("common.items.weapons.staff.bone_staff")), + (1.0, Item("common.items.weapons.staff.fiery_wishing_rod")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/staff/eldwood.ron b/assets/common/loot_tables/weapons/staff/eldwood.ron new file mode 100644 index 0000000000..22dd7dabbd --- /dev/null +++ b/assets/common/loot_tables/weapons/staff/eldwood.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.staff.aurora")), + (1.0, Item("common.items.weapons.staff.dragon_tongue")), + (1.0, Item("common.items.weapons.staff.ruby_rod")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/staff/frostwood.ron b/assets/common/loot_tables/weapons/staff/frostwood.ron new file mode 100644 index 0000000000..abbb3c5aa5 --- /dev/null +++ b/assets/common/loot_tables/weapons/staff/frostwood.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.weapons.staff.frostwood_torch")), + (1.0, Item("common.items.weapons.staff.ley_seeker")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/staff/hardwood.ron b/assets/common/loot_tables/weapons/staff/hardwood.ron new file mode 100644 index 0000000000..08eff4323b --- /dev/null +++ b/assets/common/loot_tables/weapons/staff/hardwood.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.staff.heated_arm")), + (1.0, Item("common.items.weapons.staff.infused_tower")), + (1.0, Item("common.items.weapons.staff.solar")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/staff/ironwood.ron b/assets/common/loot_tables/weapons/staff/ironwood.ron new file mode 100644 index 0000000000..5d031c451c --- /dev/null +++ b/assets/common/loot_tables/weapons/staff/ironwood.ron @@ -0,0 +1,5 @@ +[ + (1.0, Item("common.items.weapons.staff.flamethrower_0")), + (1.0, Item("common.items.weapons.staff.golden_khakkara")), + (1.0, Item("common.items.weapons.staff.orc_iron")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/staff/wood.ron b/assets/common/loot_tables/weapons/staff/wood.ron new file mode 100644 index 0000000000..4f24808e16 --- /dev/null +++ b/assets/common/loot_tables/weapons/staff/wood.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.weapons.staff.crimson_eye")), + (1.0, Item("common.items.weapons.staff.lava_rod")), +] \ No newline at end of file From 67916b44a7d8ec7a4ec0b9bc95c6352de410bb44 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 31 Mar 2021 12:40:45 -0400 Subject: [PATCH 09/17] Staff weapon tiering shuffle. --- assets/common/items/weapons/staff/aurora.ron | 4 ++-- assets/common/items/weapons/staff/bent_fuse.ron | 2 +- assets/common/items/weapons/staff/lava_rod.ron | 2 +- assets/common/items/weapons/staff/ley_seeker.ron | 2 +- assets/common/loot_tables/weapons/staff/bamboo.ron | 2 +- assets/common/loot_tables/weapons/staff/eldwood.ron | 1 - assets/common/loot_tables/weapons/staff/frostwood.ron | 2 +- assets/common/loot_tables/weapons/staff/hardwood.ron | 1 + assets/common/loot_tables/weapons/staff/wood.ron | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/assets/common/items/weapons/staff/aurora.ron b/assets/common/items/weapons/staff/aurora.ron index 4f67f8737f..a8f82f2258 100644 --- a/assets/common/items/weapons/staff/aurora.ron +++ b/assets/common/items/weapons/staff/aurora.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 0.6, + power: 1.4, poise_strength: 1.0, - speed: 1.2, + speed: 1.1, crit_chance: 0.2625, crit_mult: 1.4761904, )), diff --git a/assets/common/items/weapons/staff/bent_fuse.ron b/assets/common/items/weapons/staff/bent_fuse.ron index dbed28cf3b..87431e46ab 100644 --- a/assets/common/items/weapons/staff/bent_fuse.ron +++ b/assets/common/items/weapons/staff/bent_fuse.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 1.1, + power: 0.8, poise_strength: 1.0, speed: 0.7, crit_chance: 0.17045455, diff --git a/assets/common/items/weapons/staff/lava_rod.ron b/assets/common/items/weapons/staff/lava_rod.ron index dd396aacd1..4fe56d893a 100644 --- a/assets/common/items/weapons/staff/lava_rod.ron +++ b/assets/common/items/weapons/staff/lava_rod.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 0.7, + power: 1.2, poise_strength: 1.0, speed: 0.8, crit_chance: 0.114379086, diff --git a/assets/common/items/weapons/staff/ley_seeker.ron b/assets/common/items/weapons/staff/ley_seeker.ron index f8a7d9a7fb..4e48bceace 100644 --- a/assets/common/items/weapons/staff/ley_seeker.ron +++ b/assets/common/items/weapons/staff/ley_seeker.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 1.6, + power: 0.8, poise_strength: 1.0, speed: 0.9, crit_chance: 0.1125, diff --git a/assets/common/loot_tables/weapons/staff/bamboo.ron b/assets/common/loot_tables/weapons/staff/bamboo.ron index 9c01806911..f3f72e222c 100644 --- a/assets/common/loot_tables/weapons/staff/bamboo.ron +++ b/assets/common/loot_tables/weapons/staff/bamboo.ron @@ -1,5 +1,5 @@ [ - (1.0, Item("common.items.weapons.staff.bent_fuse")), (1.0, Item("common.items.weapons.staff.bone_staff")), (1.0, Item("common.items.weapons.staff.fiery_wishing_rod")), + (1.0, Item("common.items.weapons.staff.ley_seeker")), ] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/staff/eldwood.ron b/assets/common/loot_tables/weapons/staff/eldwood.ron index 22dd7dabbd..3160289679 100644 --- a/assets/common/loot_tables/weapons/staff/eldwood.ron +++ b/assets/common/loot_tables/weapons/staff/eldwood.ron @@ -1,5 +1,4 @@ [ - (1.0, Item("common.items.weapons.staff.aurora")), (1.0, Item("common.items.weapons.staff.dragon_tongue")), (1.0, Item("common.items.weapons.staff.ruby_rod")), ] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/staff/frostwood.ron b/assets/common/loot_tables/weapons/staff/frostwood.ron index abbb3c5aa5..cd3b274b30 100644 --- a/assets/common/loot_tables/weapons/staff/frostwood.ron +++ b/assets/common/loot_tables/weapons/staff/frostwood.ron @@ -1,4 +1,4 @@ [ (1.0, Item("common.items.weapons.staff.frostwood_torch")), - (1.0, Item("common.items.weapons.staff.ley_seeker")), + (1.0, Item("common.items.weapons.staff.aurora")), ] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/staff/hardwood.ron b/assets/common/loot_tables/weapons/staff/hardwood.ron index 08eff4323b..a5619070ab 100644 --- a/assets/common/loot_tables/weapons/staff/hardwood.ron +++ b/assets/common/loot_tables/weapons/staff/hardwood.ron @@ -2,4 +2,5 @@ (1.0, Item("common.items.weapons.staff.heated_arm")), (1.0, Item("common.items.weapons.staff.infused_tower")), (1.0, Item("common.items.weapons.staff.solar")), + (1.0, Item("common.items.weapons.staff.lava_rod")), ] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/staff/wood.ron b/assets/common/loot_tables/weapons/staff/wood.ron index 4f24808e16..e85342e7e6 100644 --- a/assets/common/loot_tables/weapons/staff/wood.ron +++ b/assets/common/loot_tables/weapons/staff/wood.ron @@ -1,4 +1,4 @@ [ (1.0, Item("common.items.weapons.staff.crimson_eye")), - (1.0, Item("common.items.weapons.staff.lava_rod")), + (1.0, Item("common.items.weapons.staff.bent_fuse")), ] \ No newline at end of file From 31e69021cb98c99bc29b0f8fc85abfd6de047817 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 31 Mar 2021 17:49:08 -0400 Subject: [PATCH 10/17] Switched loot tables from declaring each weapon individually to just referencing a different loot table. --- assets/common/item_price_calculation.ron | 3 - .../items/weapons/hammer/stone_hammer-0.ron | 2 +- .../items/weapons/hammer/stone_hammer-1.ron | 4 +- .../items/weapons/hammer/stone_hammer-2.ron | 2 +- .../items/weapons/hammer/stone_hammer-3.ron | 2 +- .../weapons/hammer/worn_iron_hammer-0.ron | 2 +- .../weapons/hammer/worn_iron_hammer-1.ron | 4 +- .../weapons/hammer/worn_iron_hammer-2.ron | 4 +- .../weapons/hammer/worn_iron_hammer-3.ron | 2 +- assets/common/loot_tables/cave_large.ron | 81 +--------- assets/common/loot_tables/cultists.ron | 144 +----------------- assets/common/loot_tables/humanoids.ron | 17 +-- assets/common/loot_tables/mindflayer.ron | 11 +- assets/common/loot_tables/miniboss.ron | 4 +- assets/common/loot_tables/villager.ron | 29 +--- assets/common/loot_tables/weapon_common.ron | 45 ------ assets/common/loot_tables/weapon_rare.ron | 42 ----- assets/common/loot_tables/weapon_uncommon.ron | 91 ----------- .../loot_tables/weapons/hammer/wood.ron | 3 - assets/common/loot_tables/weapons/tier-0.ron | 7 + assets/common/loot_tables/weapons/tier-1.ron | 8 + assets/common/loot_tables/weapons/tier-2.ron | 8 + assets/common/loot_tables/weapons/tier-3.ron | 8 + assets/common/loot_tables/weapons/tier-4.ron | 8 + assets/common/loot_tables/weapons/tier-5.ron | 8 + common/src/bin/csv_import/main.rs | 5 +- common/src/comp/inventory/item/mod.rs | 8 +- server/src/events/entity_manipulation.rs | 16 +- world/src/site/dungeon/mod.rs | 33 ++-- 29 files changed, 111 insertions(+), 490 deletions(-) delete mode 100644 assets/common/loot_tables/weapon_common.ron delete mode 100644 assets/common/loot_tables/weapon_rare.ron delete mode 100644 assets/common/loot_tables/weapon_uncommon.ron delete mode 100644 assets/common/loot_tables/weapons/hammer/wood.ron create mode 100644 assets/common/loot_tables/weapons/tier-0.ron create mode 100644 assets/common/loot_tables/weapons/tier-1.ron create mode 100644 assets/common/loot_tables/weapons/tier-2.ron create mode 100644 assets/common/loot_tables/weapons/tier-3.ron create mode 100644 assets/common/loot_tables/weapons/tier-4.ron create mode 100644 assets/common/loot_tables/weapons/tier-5.ron diff --git a/assets/common/item_price_calculation.ron b/assets/common/item_price_calculation.ron index d181a8d158..f55174991b 100644 --- a/assets/common/item_price_calculation.ron +++ b/assets/common/item_price_calculation.ron @@ -20,9 +20,6 @@ loot_tables: [ (1,"common.loot_tables.fallback"), (0.04,"common.loot_tables.saurok"), (0.05,"common.loot_tables.villager"), - (1,"common.loot_tables.weapon_common"), - (0.008,"common.loot_tables.weapon_rare"), - (0.01,"common.loot_tables.weapon_uncommon"), // we probably want to include all the scattered scatter information //(0.5,"common.cave_scatter"), ], diff --git a/assets/common/items/weapons/hammer/stone_hammer-0.ron b/assets/common/items/weapons/hammer/stone_hammer-0.ron index 5dea51f3a9..8962c74407 100644 --- a/assets/common/items/weapons/hammer/stone_hammer-0.ron +++ b/assets/common/items/weapons/hammer/stone_hammer-0.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.5, - power: 0.7, + power: 0.6, poise_strength: 1.0, speed: 1.0, crit_chance: 0.07589286, diff --git a/assets/common/items/weapons/hammer/stone_hammer-1.ron b/assets/common/items/weapons/hammer/stone_hammer-1.ron index c211bde5b6..d30122ff3c 100644 --- a/assets/common/items/weapons/hammer/stone_hammer-1.ron +++ b/assets/common/items/weapons/hammer/stone_hammer-1.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.5, - power: 0.7, + power: 0.5, poise_strength: 1.0, - speed: 1.0, + speed: 1.1, crit_chance: 0.07589286, crit_mult: 2.0756302, )), diff --git a/assets/common/items/weapons/hammer/stone_hammer-2.ron b/assets/common/items/weapons/hammer/stone_hammer-2.ron index 8ef2f63300..9700086d48 100644 --- a/assets/common/items/weapons/hammer/stone_hammer-2.ron +++ b/assets/common/items/weapons/hammer/stone_hammer-2.ron @@ -8,7 +8,7 @@ ItemDef( equip_time_secs: 0.5, power: 0.7, poise_strength: 1.0, - speed: 1.0, + speed: 0.9, crit_chance: 0.07589286, crit_mult: 2.0756302, )), diff --git a/assets/common/items/weapons/hammer/stone_hammer-3.ron b/assets/common/items/weapons/hammer/stone_hammer-3.ron index 7912094cbe..85debbe94a 100644 --- a/assets/common/items/weapons/hammer/stone_hammer-3.ron +++ b/assets/common/items/weapons/hammer/stone_hammer-3.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.5, - power: 0.7, + power: 0.6, poise_strength: 1.0, speed: 1.0, crit_chance: 0.07589286, diff --git a/assets/common/items/weapons/hammer/worn_iron_hammer-0.ron b/assets/common/items/weapons/hammer/worn_iron_hammer-0.ron index 672fc057d6..4553141be5 100644 --- a/assets/common/items/weapons/hammer/worn_iron_hammer-0.ron +++ b/assets/common/items/weapons/hammer/worn_iron_hammer-0.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.5, - power: 0.85, + power: 0.8, poise_strength: 1.0, speed: 1.0, crit_chance: 0.12242647, diff --git a/assets/common/items/weapons/hammer/worn_iron_hammer-1.ron b/assets/common/items/weapons/hammer/worn_iron_hammer-1.ron index cfc7b28c55..5f35938485 100644 --- a/assets/common/items/weapons/hammer/worn_iron_hammer-1.ron +++ b/assets/common/items/weapons/hammer/worn_iron_hammer-1.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.5, - power: 0.85, + power: 0.9, poise_strength: 1.0, - speed: 1.0, + speed: 0.9, crit_chance: 0.12242647, crit_mult: 1.6864007, )), diff --git a/assets/common/items/weapons/hammer/worn_iron_hammer-2.ron b/assets/common/items/weapons/hammer/worn_iron_hammer-2.ron index 2b48d91009..2de0f6ee55 100644 --- a/assets/common/items/weapons/hammer/worn_iron_hammer-2.ron +++ b/assets/common/items/weapons/hammer/worn_iron_hammer-2.ron @@ -6,9 +6,9 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.5, - power: 0.85, + power: 0.7, poise_strength: 1.0, - speed: 1.0, + speed: 1.1, crit_chance: 0.12242647, crit_mult: 1.6864007, )), diff --git a/assets/common/items/weapons/hammer/worn_iron_hammer-3.ron b/assets/common/items/weapons/hammer/worn_iron_hammer-3.ron index 462348e406..7ca2bce88a 100644 --- a/assets/common/items/weapons/hammer/worn_iron_hammer-3.ron +++ b/assets/common/items/weapons/hammer/worn_iron_hammer-3.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.5, - power: 0.85, + power: 0.8, poise_strength: 1.0, speed: 1.0, crit_chance: 0.12242647, diff --git a/assets/common/loot_tables/cave_large.ron b/assets/common/loot_tables/cave_large.ron index 9b2d880b93..0ac25c0511 100644 --- a/assets/common/loot_tables/cave_large.ron +++ b/assets/common/loot_tables/cave_large.ron @@ -9,81 +9,8 @@ (0.05, Item("common.items.glider.glider_moth")), (0.05, Item("common.items.armor.misc.ring.gold")), (0.1, Item("common.items.lantern.geode_purp")), - // swords - (0.03, Item("common.items.weapons.sword.steel-0")), - (0.03, Item("common.items.weapons.sword.steel-1")), - (0.03, Item("common.items.weapons.sword.steel-2")), - (0.03, Item("common.items.weapons.sword.steel-3")), - (0.03, Item("common.items.weapons.sword.steel-4")), - (0.03, Item("common.items.weapons.sword.steel-5")), - (0.03, Item("common.items.weapons.sword.steel-6")), - (0.03, Item("common.items.weapons.sword.steel-7")), - (0.03, Item("common.items.weapons.sword.steel-8")), - (0.02, Item("common.items.weapons.sword.cobalt-0")), - (0.02, Item("common.items.weapons.sword.cobalt-1")), - (0.02, Item("common.items.weapons.sword.cobalt-2")), - (0.02, Item("common.items.weapons.sword.cobalt-3")), - (0.01, Item("common.items.weapons.sword.bloodsteel-0")), - (0.01, Item("common.items.weapons.sword.bloodsteel-1")), - (0.01, Item("common.items.weapons.sword.bloodsteel-2")), - // axes - (0.02, Item("common.items.weapons.axe.bloodsteel_axe-0")), - (0.02, Item("common.items.weapons.axe.bloodsteel_axe-1")), - (0.02, Item("common.items.weapons.axe.bloodsteel_axe-2")), - (0.01, Item("common.items.weapons.axe.cobalt_axe-0")), - (0.01, Item("common.items.weapons.axe.cobalt_axe-1")), - (0.001, Item("common.items.weapons.axe.malachite_axe-0")), - (0.04, Item("common.items.weapons.axe.iron_axe-7")), - (0.04, Item("common.items.weapons.axe.iron_axe-8")), - (0.04, Item("common.items.weapons.axe.iron_axe-9")), - (0.04, Item("common.items.weapons.axe.steel_axe-0")), - (0.04, Item("common.items.weapons.axe.steel_axe-1")), - (0.04, Item("common.items.weapons.axe.steel_axe-2")), - (0.04, Item("common.items.weapons.axe.steel_axe-3")), - (0.04, Item("common.items.weapons.axe.steel_axe-4")), - (0.04, Item("common.items.weapons.axe.steel_axe-5")), - (0.04, Item("common.items.weapons.axe.steel_axe-6")), - // healing sceptre - (0.2, Item("common.items.weapons.sceptre.staff_nature")), - (0.1, Item("common.items.weapons.sceptre.fork0")), - (0.1, Item("common.items.weapons.sceptre.emerald")), - (0.1, Item("common.items.weapons.sceptre.coralline_cane")), - (0.001, Item("common.items.weapons.sceptre.sceptre_velorite_0")), - // staves - (0.2, Item("common.items.weapons.staff.bone_staff")), - (0.2, Item("common.items.weapons.staff.ley_seeker")), - (0.10, Item("common.items.weapons.staff.fiery_wishing_rod")), - (0.10, Item("common.items.weapons.staff.heated_arm")), - (0.10, Item("common.items.weapons.staff.golden_khakkara")), - (0.10, Item("common.items.weapons.staff.crimson_eye")), - (0.10, Item("common.items.weapons.staff.solar")), - (0.05, Item("common.items.weapons.staff.lava_rod")), - (0.05, Item("common.items.weapons.staff.dragon_tongue")), - (0.01, Item("common.items.weapons.staff.orc_iron")), - // hammers - (0.3, Item("common.items.weapons.hammer.cobalt_hammer-0")), - (0.3, Item("common.items.weapons.hammer.cobalt_hammer-1")), - (0.15, Item("common.items.weapons.hammer.runic_hammer")), - (0.15, Item("common.items.weapons.hammer.ramshead_hammer")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-7")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-8")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-0")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-1")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-2")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-3")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-4")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-5")), - // bows - (0.03, Item("common.items.weapons.bow.metal-0")), - (0.03, Item("common.items.weapons.bow.metal-1")), - (0.03, Item("common.items.weapons.bow.metal-2")), - (0.03, Item("common.items.weapons.bow.metal-3")), - (0.03, Item("common.items.weapons.bow.metal-4")), - (0.02, Item("common.items.weapons.bow.frostwood-0")), - (0.02, Item("common.items.weapons.bow.frostwood-1")), - (0.02, Item("common.items.weapons.bow.frostwood-2")), - (0.01, Item("common.items.weapons.bow.eldwood-0")), - (0.01, Item("common.items.weapons.bow.eldwood-1")), - (0.01, Item("common.items.weapons.bow.eldwood-2")), - (0.001, Item("common.items.weapons.bow.velorite")), + (2.0, LootTable("common.loot_tables.weapons.tier-3")), + (1.5, LootTable("common.loot_tables.weapons.tier-4")), + (1.0, LootTable("common.loot_tables.weapons.tier-5")), + (0.05, LootTable("common.loot_tables.weapons.cave")), ] \ No newline at end of file diff --git a/assets/common/loot_tables/cultists.ron b/assets/common/loot_tables/cultists.ron index 521a6ffbda..024cd41bfd 100644 --- a/assets/common/loot_tables/cultists.ron +++ b/assets/common/loot_tables/cultists.ron @@ -20,142 +20,10 @@ (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")), - (0.1, Item("common.items.weapons.sword.wood-1")), - (0.1, Item("common.items.weapons.sword.wood-2")), - (0.1, Item("common.items.weapons.sword.stone-0")), - (0.1, Item("common.items.weapons.sword.stone-1")), - (0.1, Item("common.items.weapons.sword.stone-2")), - (0.05, Item("common.items.weapons.sword.bronze-0")), - (0.05, Item("common.items.weapons.sword.bronze-1")), - (0.05, Item("common.items.weapons.sword.bronze-2")), - (0.2, Item("common.items.weapons.axe.orc_axe-0")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-0")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-1")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-2")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-3")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-4")), - (0.25, Item("common.items.weapons.sceptre.staff_nature")), - (0.15, Item("common.items.weapons.hammer.flimsy_hammer")), - (0.1, Item("common.items.weapons.hammer.wood_hammer-0")), - (0.1, Item("common.items.weapons.hammer.stone_hammer-0")), - (0.1, Item("common.items.weapons.hammer.stone_hammer-1")), - (0.1, Item("common.items.weapons.hammer.stone_hammer-2")), - (0.1, Item("common.items.weapons.hammer.stone_hammer-3")), - (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-0")), - (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-1")), - (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-2")), - (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-3")), - (0.2, Item("common.items.weapons.bow.rawwood-0")), - (0.2, Item("common.items.weapons.bow.rawwood-1")), - (0.1, Item("common.items.weapons.bow.wood-0")), - (0.1, Item("common.items.weapons.bow.wood-1")), - (0.1, Item("common.items.weapons.bow.wood-2")), - (0.1, Item("common.items.weapons.bow.wood-3")), - (0.1, Item("common.items.weapons.bow.wood-4")), - (0.05, Item("common.items.weapons.bow.bone-0")), - (0.05, Item("common.items.weapons.bow.bone-1")), - (0.05, Item("common.items.weapons.bow.bone-2")), - (0.05, Item("common.items.weapons.bow.bone-3")), - (0.04, Item("common.items.weapons.sword.iron-0")), - (0.04, Item("common.items.weapons.sword.iron-1")), - (0.04, Item("common.items.weapons.sword.iron-2")), - (0.04, Item("common.items.weapons.sword.iron-3")), - (0.04, Item("common.items.weapons.sword.iron-4")), - (0.04, Item("common.items.weapons.sword.iron-5")), - (0.04, Item("common.items.weapons.sword.iron-6")), - (0.04, Item("common.items.weapons.sword.iron-7")), - (0.04, Item("common.items.weapons.sword.iron-8")), - (0.04, Item("common.items.weapons.sword.iron-9")), - (0.04, Item("common.items.weapons.sword.iron-10")), - (0.03, Item("common.items.weapons.sword.steel-0")), - (0.03, Item("common.items.weapons.sword.steel-1")), - (0.03, Item("common.items.weapons.sword.steel-2")), - (0.03, Item("common.items.weapons.sword.steel-3")), - (0.03, Item("common.items.weapons.sword.steel-4")), - (0.03, Item("common.items.weapons.sword.steel-5")), - (0.03, Item("common.items.weapons.sword.steel-6")), - (0.03, Item("common.items.weapons.sword.steel-7")), - (0.03, Item("common.items.weapons.sword.steel-8")), - (0.15, Item("common.items.weapons.axe.bronze_axe-0")), - (0.15, Item("common.items.weapons.axe.bronze_axe-1")), - (0.15, Item("common.items.weapons.axe.bronze_axe-2")), - (0.04, Item("common.items.weapons.axe.iron_axe-0")), - (0.04, Item("common.items.weapons.axe.iron_axe-1")), - (0.04, Item("common.items.weapons.axe.iron_axe-2")), - (0.04, Item("common.items.weapons.axe.iron_axe-3")), - (0.04, Item("common.items.weapons.axe.iron_axe-4")), - (0.04, Item("common.items.weapons.axe.iron_axe-5")), - (0.04, Item("common.items.weapons.axe.iron_axe-6")), - (0.04, Item("common.items.weapons.axe.iron_axe-7")), - (0.04, Item("common.items.weapons.axe.iron_axe-8")), - (0.04, Item("common.items.weapons.axe.iron_axe-9")), - (0.04, Item("common.items.weapons.axe.steel_axe-0")), - (0.04, Item("common.items.weapons.axe.steel_axe-1")), - (0.04, Item("common.items.weapons.axe.steel_axe-2")), - (0.04, Item("common.items.weapons.axe.steel_axe-3")), - (0.04, Item("common.items.weapons.axe.steel_axe-4")), - (0.04, Item("common.items.weapons.axe.steel_axe-5")), - (0.04, Item("common.items.weapons.axe.steel_axe-6")), - (0.5, Item("common.items.weapons.sceptre.staff_nature")), - (0.4, Item("common.items.weapons.staff.bone_staff")), - (0.40, Item("common.items.weapons.staff.crimson_eye")), - (0.2, Item("common.items.weapons.staff.aurora")), - (0.20, Item("common.items.weapons.staff.frostwood_torch")), - (0.15, Item("common.items.weapons.hammer.bronze_hammer-0")), - (0.15, Item("common.items.weapons.hammer.bronze_hammer-1")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-0")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-1")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-2")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-3")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-4")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-5")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-6")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-7")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-8")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-0")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-1")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-2")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-3")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-4")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-5")), - (0.04, Item("common.items.weapons.bow.hardwood-0")), - (0.04, Item("common.items.weapons.bow.hardwood-1")), - (0.04, Item("common.items.weapons.bow.hardwood-2")), - (0.04, Item("common.items.weapons.bow.hardwood-3")), - (0.04, Item("common.items.weapons.bow.hardwood-4")), - (0.04, Item("common.items.weapons.bow.hardwood-5")), - (0.03, Item("common.items.weapons.bow.metal-0")), - (0.03, Item("common.items.weapons.bow.metal-1")), - (0.03, Item("common.items.weapons.bow.metal-2")), - (0.03, Item("common.items.weapons.bow.metal-3")), - (0.03, Item("common.items.weapons.bow.metal-4")), - (0.2, Item("common.items.weapons.sword.cobalt-0")), - (0.2, Item("common.items.weapons.sword.cobalt-1")), - (0.2, Item("common.items.weapons.sword.cobalt-2")), - (0.2, Item("common.items.weapons.sword.cobalt-3")), - (0.1, Item("common.items.weapons.sword.bloodsteel-0")), - (0.1, Item("common.items.weapons.sword.bloodsteel-1")), - (0.1, Item("common.items.weapons.sword.bloodsteel-2")), - (0.2, Item("common.items.weapons.axe.bloodsteel_axe-0")), - (0.2, Item("common.items.weapons.axe.bloodsteel_axe-1")), - (0.2, Item("common.items.weapons.axe.bloodsteel_axe-2")), - (0.25, Item("common.items.weapons.sceptre.staff_nature")), - (0.2, Item("common.items.weapons.staff.infused_tower")), - (0.10, Item("common.items.weapons.staff.lava_rod")), - (0.10, Item("common.items.weapons.staff.dragon_tongue")), - (0.1, Item("common.items.weapons.staff.flamethrower_0")), - (0.04, Item("common.items.weapons.staff.bent_fuse")), - (0.04, Item("common.items.weapons.sceptre.emerald")), - (0.04, Item("common.items.weapons.staff.orc_iron")), - (0.01, Item("common.items.weapons.hammer.cobalt_hammer-0")), - (0.01, Item("common.items.weapons.hammer.cobalt_hammer-1")), - (0.01, Item("common.items.weapons.hammer.runic_hammer")), - (0.1, Item("common.items.weapons.hammer.ramshead_hammer")), - (0.2, Item("common.items.weapons.bow.frostwood-0")), - (0.2, Item("common.items.weapons.bow.frostwood-1")), - (0.2, Item("common.items.weapons.bow.frostwood-2")), - (0.1, Item("common.items.weapons.bow.eldwood-0")), - (0.1, Item("common.items.weapons.bow.eldwood-1")), - (0.1, Item("common.items.weapons.bow.eldwood-2")), + (1.0, LootTable("common.loot_tables.weapons.tier-0")), + (2.0, LootTable("common.loot_tables.weapons.tier-1")), + (3.0, LootTable("common.loot_tables.weapons.tier-2")), + (4.0, LootTable("common.loot_tables.weapons.tier-3")), + (4.0, LootTable("common.loot_tables.weapons.tier-4")), + (3.0, LootTable("common.loot_tables.weapons.tier-5")), ] \ No newline at end of file diff --git a/assets/common/loot_tables/humanoids.ron b/assets/common/loot_tables/humanoids.ron index baf4a1ed6b..8e7cb1da97 100644 --- a/assets/common/loot_tables/humanoids.ron +++ b/assets/common/loot_tables/humanoids.ron @@ -15,17 +15,8 @@ (0.1, Item("common.items.food.apple_stick")), (0.1, Item("common.items.food.mushroom_stick")), // Weapons - (0.1, Item("common.items.weapons.sword.wood-0")), - (0.1, Item("common.items.weapons.sword.wood-1")), - (0.1, Item("common.items.weapons.sword.wood-2")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-0")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-1")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-2")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-3")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-4")), - (0.25, Item("common.items.weapons.sceptre.staff_nature")), - (0.15, Item("common.items.weapons.hammer.flimsy_hammer")), - (0.1, Item("common.items.weapons.hammer.wood_hammer-0")), - (0.15, Item("common.items.weapons.bow.rawwood-0")), - (0.15, Item("common.items.weapons.bow.rawwood-1")), + (0.5, LootTable("common.loot_tables.sword.wood")), + (0.5, LootTable("common.loot_tables.hammer.stone")), + (0.5, LootTable("common.loot_tables.bow.rawwood")), + (0.5, LootTable("common.loot_tables.starter")), ] \ No newline at end of file diff --git a/assets/common/loot_tables/mindflayer.ron b/assets/common/loot_tables/mindflayer.ron index d95c23599c..41cce60a47 100644 --- a/assets/common/loot_tables/mindflayer.ron +++ b/assets/common/loot_tables/mindflayer.ron @@ -1,15 +1,8 @@ [ // Crafting material - (2.0, Item("common.items.crafting_ing.mindflayer_bag_damaged")), + (1.0, Item("common.items.crafting_ing.mindflayer_bag_damaged")), // Legendary weapons - (1.0, Item("common.items.weapons.sword.caladbolg")), - (1.0, Item("common.items.weapons.axe.parashu")), - (1.0, Item("common.items.weapons.hammer.mjolnir")), - (1.0, Item("common.items.weapons.bow.sagitta")), - (0.5, Item("common.items.weapons.staff.phoenix")), - (0.5, Item("common.items.weapons.staff.laevateinn")), - (0.5, Item("common.items.weapons.sceptre.root_evil")), - (0.5, Item("common.items.weapons.sceptre.caduceus")), + (4.0, LootTable("common.loot_tables.weapons.legendary")), // Rare misc items (0.5, Item("common.items.boss_drops.lantern")), (0.5, Item("common.items.glider.glider_purp")), diff --git a/assets/common/loot_tables/miniboss.ron b/assets/common/loot_tables/miniboss.ron index 14f6453f3c..6a272f201d 100644 --- a/assets/common/loot_tables/miniboss.ron +++ b/assets/common/loot_tables/miniboss.ron @@ -4,7 +4,5 @@ (1.0, Item("common.items.armor.misc.back.dungeon_purple")), (1.0, Item("common.items.armor.misc.ring.skull")), // weapons - (1.0, Item("common.items.weapons.staff.cultist_staff")), - (1.0, Item("common.items.weapons.hammer.cultist_purp_2h-0")), - (1.0, Item("common.items.weapons.sword.cultist")), + (3.0, LootTable("common.loot_tables.weapons.cultist")), ] \ No newline at end of file diff --git a/assets/common/loot_tables/villager.ron b/assets/common/loot_tables/villager.ron index b84678fe17..d6abc0c492 100644 --- a/assets/common/loot_tables/villager.ron +++ b/assets/common/loot_tables/villager.ron @@ -7,17 +7,7 @@ // Consumables (0.2, Item("common.items.consumable.potion_minor")), // Armour - (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_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")), + (10.0, LootTable("common.loot_tables.armor.cloth")), // Utility (0.05, Item("common.items.utility.collar")), // Food @@ -29,17 +19,8 @@ (0.1, Item("common.items.food.apple_stick")), (0.1, Item("common.items.food.mushroom_stick")), // Weapons - (0.15, Item("common.items.weapons.sword.wood-0")), - (0.15, Item("common.items.weapons.sword.wood-1")), - (0.15, Item("common.items.weapons.sword.wood-2")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-0")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-1")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-2")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-3")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-4")), - (0.25, Item("common.items.weapons.sceptre.staff_nature")), - (0.15, Item("common.items.weapons.hammer.flimsy_hammer")), - (0.1, Item("common.items.weapons.hammer.wood_hammer-0")), - (0.15, Item("common.items.weapons.bow.rawwood-0")), - (0.15, Item("common.items.weapons.bow.rawwood-1")), + (0.5, LootTable("common.loot_tables.sword.wood")), + (0.5, LootTable("common.loot_tables.hammer.stone")), + (0.5, LootTable("common.loot_tables.bow.rawwood")), + (0.5, LootTable("common.loot_tables.starter")), ] \ No newline at end of file diff --git a/assets/common/loot_tables/weapon_common.ron b/assets/common/loot_tables/weapon_common.ron deleted file mode 100644 index c30fe31cf0..0000000000 --- a/assets/common/loot_tables/weapon_common.ron +++ /dev/null @@ -1,45 +0,0 @@ -[ - // swords - (0.15, Item("common.items.weapons.sword.starter")), - (0.1, Item("common.items.weapons.sword.wood-0")), - (0.1, Item("common.items.weapons.sword.wood-1")), - (0.1, Item("common.items.weapons.sword.wood-2")), - (0.05, Item("common.items.weapons.sword.stone-0")), - (0.05, Item("common.items.weapons.sword.stone-1")), - (0.05, Item("common.items.weapons.sword.stone-2")), - // axes - (0.3, Item("common.items.weapons.axe.starter_axe")), - (0.2, Item("common.items.weapons.axe.orc_axe-0")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-0")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-1")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-2")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-3")), - (0.1, Item("common.items.weapons.axe.worn_iron_axe-4")), - // healing staff - (0.3, Item("common.items.weapons.sceptre.starter_sceptre")), - (0.10, Item("common.items.weapons.sceptre.moon0")), - (0.10, Item("common.items.weapons.sceptre.druids_arbor")), - // staves - (1.0, Item("common.items.weapons.staff.starter_staff")), - // hammers - (0.15, Item("common.items.weapons.hammer.starter_hammer")), - (0.15, Item("common.items.weapons.hammer.flimsy_hammer")), - (0.1, Item("common.items.weapons.hammer.wood_hammer-0")), - (0.1, Item("common.items.weapons.hammer.stone_hammer-0")), - (0.1, Item("common.items.weapons.hammer.stone_hammer-1")), - (0.1, Item("common.items.weapons.hammer.stone_hammer-2")), - (0.1, Item("common.items.weapons.hammer.stone_hammer-3")), - (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-0")), - (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-1")), - (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-2")), - (0.05, Item("common.items.weapons.hammer.worn_iron_hammer-3")), - // bows - (0.15, Item("common.items.weapons.bow.starter")), - (0.1, Item("common.items.weapons.bow.rawwood-0")), - (0.1, Item("common.items.weapons.bow.rawwood-1")), - (0.05, Item("common.items.weapons.bow.wood-0")), - (0.05, Item("common.items.weapons.bow.wood-1")), - (0.05, Item("common.items.weapons.bow.wood-2")), - (0.05, Item("common.items.weapons.bow.wood-3")), - (0.05, Item("common.items.weapons.bow.wood-4")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/weapon_rare.ron b/assets/common/loot_tables/weapon_rare.ron deleted file mode 100644 index 6850259597..0000000000 --- a/assets/common/loot_tables/weapon_rare.ron +++ /dev/null @@ -1,42 +0,0 @@ -[ - // swords - (0.2, Item("common.items.weapons.sword.cobalt-0")), - (0.2, Item("common.items.weapons.sword.cobalt-1")), - (0.2, Item("common.items.weapons.sword.cobalt-2")), - (0.2, Item("common.items.weapons.sword.cobalt-3")), - (0.1, Item("common.items.weapons.sword.bloodsteel-0")), - (0.1, Item("common.items.weapons.sword.bloodsteel-1")), - (0.1, Item("common.items.weapons.sword.bloodsteel-2")), - // axes - (0.2, Item("common.items.weapons.axe.bloodsteel_axe-0")), - (0.2, Item("common.items.weapons.axe.bloodsteel_axe-1")), - (0.2, Item("common.items.weapons.axe.bloodsteel_axe-2")), - (0.3, Item("common.items.weapons.axe.cobalt_axe-0")), - (0.3, Item("common.items.weapons.axe.cobalt_axe-1")), - (0.1, Item("common.items.weapons.axe.malachite_axe-0")), - // healing sceptre - (0.15, Item("common.items.weapons.sceptre.loops0")), - (0.1, Item("common.items.weapons.sceptre.fork0")), - (0.10, Item("common.items.weapons.sceptre.emerald")), - (0.10, Item("common.items.weapons.sceptre.coralline_cane")), - // staves - (1.00, Item("common.items.weapons.staff.crimson_eye")), - (0.7, Item("common.items.weapons.staff.aurora")), - (0.7, Item("common.items.weapons.staff.frostwood_torch")), - (0.5, Item("common.items.weapons.staff.lava_rod")), - (0.5, Item("common.items.weapons.staff.dragon_tongue")), - (0.75, Item("common.items.weapons.staff.infused_tower")), - (0.5, Item("common.items.weapons.staff.flamethrower_0")), - // hammers - (0.3, Item("common.items.weapons.hammer.cobalt_hammer-0")), - (0.3, Item("common.items.weapons.hammer.cobalt_hammer-1")), - (0.15, Item("common.items.weapons.hammer.runic_hammer")), - (0.15, Item("common.items.weapons.hammer.ramshead_hammer")), - // bows - (0.2, Item("common.items.weapons.bow.frostwood-0")), - (0.2, Item("common.items.weapons.bow.frostwood-1")), - (0.2, Item("common.items.weapons.bow.frostwood-2")), - (0.1, Item("common.items.weapons.bow.eldwood-0")), - (0.1, Item("common.items.weapons.bow.eldwood-1")), - (0.1, Item("common.items.weapons.bow.eldwood-2")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/weapon_uncommon.ron b/assets/common/loot_tables/weapon_uncommon.ron deleted file mode 100644 index 9a134d32e5..0000000000 --- a/assets/common/loot_tables/weapon_uncommon.ron +++ /dev/null @@ -1,91 +0,0 @@ -[ - // swords - (0.15, Item("common.items.weapons.sword.bronze-0")), - (0.15, Item("common.items.weapons.sword.bronze-1")), - (0.15, Item("common.items.weapons.sword.bronze-2")), - (0.04, Item("common.items.weapons.sword.iron-0")), - (0.04, Item("common.items.weapons.sword.iron-1")), - (0.04, Item("common.items.weapons.sword.iron-2")), - (0.04, Item("common.items.weapons.sword.iron-3")), - (0.04, Item("common.items.weapons.sword.iron-4")), - (0.04, Item("common.items.weapons.sword.iron-5")), - (0.04, Item("common.items.weapons.sword.iron-6")), - (0.04, Item("common.items.weapons.sword.iron-7")), - (0.04, Item("common.items.weapons.sword.iron-8")), - (0.04, Item("common.items.weapons.sword.iron-9")), - (0.04, Item("common.items.weapons.sword.iron-10")), - (0.03, Item("common.items.weapons.sword.steel-0")), - (0.03, Item("common.items.weapons.sword.steel-1")), - (0.03, Item("common.items.weapons.sword.steel-2")), - (0.03, Item("common.items.weapons.sword.steel-3")), - (0.03, Item("common.items.weapons.sword.steel-4")), - (0.03, Item("common.items.weapons.sword.steel-5")), - (0.03, Item("common.items.weapons.sword.steel-6")), - (0.03, Item("common.items.weapons.sword.steel-7")), - (0.03, Item("common.items.weapons.sword.steel-8")), - // axes - (0.15, Item("common.items.weapons.axe.bronze_axe-0")), - (0.15, Item("common.items.weapons.axe.bronze_axe-1")), - (0.15, Item("common.items.weapons.axe.bronze_axe-2")), - (0.04, Item("common.items.weapons.axe.iron_axe-0")), - (0.04, Item("common.items.weapons.axe.iron_axe-1")), - (0.04, Item("common.items.weapons.axe.iron_axe-2")), - (0.04, Item("common.items.weapons.axe.iron_axe-3")), - (0.04, Item("common.items.weapons.axe.iron_axe-4")), - (0.04, Item("common.items.weapons.axe.iron_axe-5")), - (0.04, Item("common.items.weapons.axe.iron_axe-6")), - (0.04, Item("common.items.weapons.axe.iron_axe-7")), - (0.04, Item("common.items.weapons.axe.iron_axe-8")), - (0.04, Item("common.items.weapons.axe.iron_axe-9")), - (0.04, Item("common.items.weapons.axe.steel_axe-0")), - (0.04, Item("common.items.weapons.axe.steel_axe-1")), - (0.04, Item("common.items.weapons.axe.steel_axe-2")), - (0.04, Item("common.items.weapons.axe.steel_axe-3")), - (0.04, Item("common.items.weapons.axe.steel_axe-4")), - (0.04, Item("common.items.weapons.axe.steel_axe-5")), - (0.04, Item("common.items.weapons.axe.steel_axe-6")), - // healing sceptre - (0.5, Item("common.items.weapons.sceptre.staff_nature")), - (0.15, Item("common.items.weapons.sceptre.root_green0")), - (0.25, Item("common.items.weapons.sceptre.totem_green")), - // staves - (1.0, Item("common.items.weapons.staff.bone_staff")), - (0.7, Item("common.items.weapons.staff.heated_arm")), - (0.7, Item("common.items.weapons.staff.golden_khakkara")), - (0.7, Item("common.items.weapons.staff.fiery_wishing_rod")), - (0.7, Item("common.items.weapons.staff.solar")), - // hammers - (0.15, Item("common.items.weapons.hammer.bronze_hammer-0")), - (0.15, Item("common.items.weapons.hammer.bronze_hammer-1")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-0")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-1")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-2")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-3")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-4")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-5")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-6")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-7")), - (0.04, Item("common.items.weapons.hammer.iron_hammer-8")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-0")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-1")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-2")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-3")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-4")), - (0.05, Item("common.items.weapons.hammer.steel_hammer-5")), - // bows - (0.15, Item("common.items.weapons.bow.bone-0")), - (0.15, Item("common.items.weapons.bow.bone-1")), - (0.15, Item("common.items.weapons.bow.bone-2")), - (0.15, Item("common.items.weapons.bow.bone-3")), - (0.04, Item("common.items.weapons.bow.hardwood-0")), - (0.04, Item("common.items.weapons.bow.hardwood-1")), - (0.04, Item("common.items.weapons.bow.hardwood-2")), - (0.04, Item("common.items.weapons.bow.hardwood-3")), - (0.04, Item("common.items.weapons.bow.hardwood-4")), - (0.04, Item("common.items.weapons.bow.hardwood-5")), - (0.03, Item("common.items.weapons.bow.metal-0")), - (0.03, Item("common.items.weapons.bow.metal-1")), - (0.03, Item("common.items.weapons.bow.metal-2")), - (0.03, Item("common.items.weapons.bow.metal-3")), - (0.03, Item("common.items.weapons.bow.metal-4")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/hammer/wood.ron b/assets/common/loot_tables/weapons/hammer/wood.ron deleted file mode 100644 index 704cc84c85..0000000000 --- a/assets/common/loot_tables/weapons/hammer/wood.ron +++ /dev/null @@ -1,3 +0,0 @@ -[ - (1.0, Item("common.items.weapons.hammer.wood_hammer-0")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/tier-0.ron b/assets/common/loot_tables/weapons/tier-0.ron new file mode 100644 index 0000000000..8e721ef96d --- /dev/null +++ b/assets/common/loot_tables/weapons/tier-0.ron @@ -0,0 +1,7 @@ +[ + (1.0, LootTable("common.loot_tables.weapons.sword.stone")), + (1.0, LootTable("common.loot_tables.weapons.axe.worn-iron")), + (1.0, LootTable("common.loot_tables.weapons.hammer.worn-iron")), + (1.0, LootTable("common.loot_tables.weapons.bow.wood")), + (1.0, LootTable("common.loot_tables.weapons.staff.wood")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/tier-1.ron b/assets/common/loot_tables/weapons/tier-1.ron new file mode 100644 index 0000000000..802c6b6d14 --- /dev/null +++ b/assets/common/loot_tables/weapons/tier-1.ron @@ -0,0 +1,8 @@ +[ + (1.0, LootTable("common.loot_tables.weapons.sword.bronze")), + (1.0, LootTable("common.loot_tables.weapons.axe.bronze")), + (1.0, LootTable("common.loot_tables.weapons.hammer.bronze")), + (1.0, LootTable("common.loot_tables.weapons.bow.bone")), + (1.0, LootTable("common.loot_tables.weapons.staff.bamboo")), + (1.0, LootTable("common.loot_tables.weapons.sceptre.bamboo")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/tier-2.ron b/assets/common/loot_tables/weapons/tier-2.ron new file mode 100644 index 0000000000..c9e45409c9 --- /dev/null +++ b/assets/common/loot_tables/weapons/tier-2.ron @@ -0,0 +1,8 @@ +[ + (1.0, LootTable("common.loot_tables.weapons.sword.iron")), + (1.0, LootTable("common.loot_tables.weapons.axe.iron")), + (1.0, LootTable("common.loot_tables.weapons.hammer.iron")), + (1.0, LootTable("common.loot_tables.weapons.bow.hardwood")), + (1.0, LootTable("common.loot_tables.weapons.staff.hardwood")), + (1.0, LootTable("common.loot_tables.weapons.sceptre.hardwood")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/tier-3.ron b/assets/common/loot_tables/weapons/tier-3.ron new file mode 100644 index 0000000000..a709edd68c --- /dev/null +++ b/assets/common/loot_tables/weapons/tier-3.ron @@ -0,0 +1,8 @@ +[ + (1.0, LootTable("common.loot_tables.weapons.sword.steel")), + (1.0, LootTable("common.loot_tables.weapons.axe.steel")), + (1.0, LootTable("common.loot_tables.weapons.hammer.steel")), + (1.0, LootTable("common.loot_tables.weapons.bow.metal")), + (1.0, LootTable("common.loot_tables.weapons.staff.ironwood")), + (1.0, LootTable("common.loot_tables.weapons.sceptre.ironwood")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/tier-4.ron b/assets/common/loot_tables/weapons/tier-4.ron new file mode 100644 index 0000000000..d8a69c8f72 --- /dev/null +++ b/assets/common/loot_tables/weapons/tier-4.ron @@ -0,0 +1,8 @@ +[ + (1.0, LootTable("common.loot_tables.weapons.sword.cobalt")), + (1.0, LootTable("common.loot_tables.weapons.axe.cobalt")), + (1.0, LootTable("common.loot_tables.weapons.hammer.cobalt")), + (1.0, LootTable("common.loot_tables.weapons.bow.frostwood")), + (1.0, LootTable("common.loot_tables.weapons.staff.frostwood")), + (1.0, LootTable("common.loot_tables.weapons.sceptre.frostwood")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/tier-5.ron b/assets/common/loot_tables/weapons/tier-5.ron new file mode 100644 index 0000000000..2c43153ade --- /dev/null +++ b/assets/common/loot_tables/weapons/tier-5.ron @@ -0,0 +1,8 @@ +[ + (1.0, LootTable("common.loot_tables.weapons.sword.bloodsteel")), + (1.0, LootTable("common.loot_tables.weapons.axe.bloodsteel")), + (1.0, LootTable("common.loot_tables.weapons.hammer.bloodsteel")), + (1.0, LootTable("common.loot_tables.weapons.bow.eldwood")), + (1.0, LootTable("common.loot_tables.weapons.staff.eldwood")), + (1.0, LootTable("common.loot_tables.weapons.sceptre.eldwood")), +] \ No newline at end of file diff --git a/common/src/bin/csv_import/main.rs b/common/src/bin/csv_import/main.rs index 0eb3d12b1e..ba11f9aab0 100644 --- a/common/src/bin/csv_import/main.rs +++ b/common/src/bin/csv_import/main.rs @@ -404,7 +404,10 @@ fn loot_table(loot_table: &str) -> Result<(), Box> { .to_string(), ), "CreatureMaterial" => LootSpec::CreatureMaterial, - a => panic!("Loot specifier kind must be either \"Item\" or \"LootTable\"\n{}", a), + a => panic!( + "Loot specifier kind must be either \"Item\" or \"LootTable\"\n{}", + a + ), }; let chance: f32 = record .get(headers["Relative Chance"]) diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index ed0739fdd7..6523ce99f7 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -602,8 +602,8 @@ impl Item { // IMPORTANT: Add any new container to `SpriteKind::is_container` SpriteKind::Chest => { chosen = Lottery::::load_expect(match rng.gen_range(0..7) { - 0 => "common.loot_tables.weapon_uncommon", - 1 => "common.loot_tables.weapon_common", + 0 => "common.loot_tables.weapons.tier-0", + 1 => "common.loot_tables.weapons.tier-1", 2 => "common.loot_tables.armor.swift", 3 => "common.loot_tables.armor.cloth", 4 => "common.loot_tables.armor.plate", @@ -614,7 +614,7 @@ impl Item { }, SpriteKind::ChestBurried => { chosen = Lottery::::load_expect(match rng.gen_range(0..7) { - 1 => "common.loot_tables.weapon_common", + 1 => "common.loot_tables.weapons.tier-1", 2 => "common.loot_tables.armor.swift", 3 => "common.loot_tables.armor.cloth", _ => "common.loot_tables.fallback", @@ -625,7 +625,7 @@ impl Item { SpriteKind::Mud => { chosen = Lottery::::load_expect(match rng.gen_range(0..5) { 0 => "common.loot_tables.crafting", - 1 => "common.loot_tables.weapon_common", + 1 => "common.loot_tables.weapons.tier-0", 2 => "common.loot_tables.fallback", _ => "common.loot_tables.rocks", }) diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index ffed52ea76..729f572a9e 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -345,7 +345,7 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc 0 => "common.loot_tables.humanoids", 1 => "common.loot_tables.armor.swift", 2 => "common.loot_tables.armor.cloth", - 3 => "common.loot_tables.weapon_common", + 3 => "common.loot_tables.weapons.starter", 4 => "common.loot_tables.humanoids", _ => "common.loots_tables.fallback", }, @@ -376,13 +376,13 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc biped_large::Species::Wendigo => match rng.gen_range(0..7) { 0 => "common.loot_tables.food", 1 => "common.loot_tables.wild_animal", - 2 => "common.loot_tables.weapon_uncommon", + 2 => "common.loot_tables.weapons.tier-2", _ => "common.loot_tables.cave_large", }, - biped_large::Species::Troll => match rng.gen_range(0..10) { + biped_large::Species::Troll => match rng.gen_range(0..8) { 0 => "common.loot_tables.food", 1 => "common.loot_tables.cave_large", - 2 => "common.loot_tables.weapon_uncommon", + 2 => "common.loot_tables.weapons.tier-2", _ => "common.loot_tables.wild_animal", }, biped_large::Species::Occultsaurok @@ -396,13 +396,13 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc Some(common::comp::Body::Golem(_)) => match rng.gen_range(0..5) { 0 => "common.loot_tables.food", 1 => "common.loot_tables.armor.steel", - 2 => "common.loot_tables.weapon_common", - 3 => "common.loot_tables.weapon_uncommon", - 4 => "common.loot_tables.weapon_rare", + 2 => "common.loot_tables.weapons.tier-1", + 3 => "common.loot_tables.weapons.tier-2", + 4 => "common.loot_tables.weapons.tier-3", _ => "common.loot_tables.fallback", }, Some(common::comp::Body::Theropod(_)) => "common.loot_tables.wild_animal", - Some(common::comp::Body::Dragon(_)) => "common.loot_tables.weapon_rare", + Some(common::comp::Body::Dragon(_)) => "common.loot_tables.weapons.tier-5", Some(common::comp::Body::QuadrupedLow(quadruped_low)) => { match quadruped_low.species { quadruped_low::Species::Maneater => "common.loot_tables.maneater", diff --git a/world/src/site/dungeon/mod.rs b/world/src/site/dungeon/mod.rs index 0b26e2a48e..198d9b901a 100644 --- a/world/src/site/dungeon/mod.rs +++ b/world/src/site/dungeon/mod.rs @@ -556,28 +556,28 @@ impl Floor { match dynamic_rng.gen_range(0..4) { 0 => "common.loot_tables.humanoids", 1 => "common.loot_tables.armor.cloth", - _ => "common.loot_tables.weapon_common", + _ => "common.loot_tables.weapons.tier-0", }, ), 1 => Lottery::::load_expect( match dynamic_rng.gen_range(0..4) { 0 => "common.loot_tables.humanoids", 1 => "common.loot_tables.armor.swift", - _ => "common.loot_tables.weapon_uncommon", + _ => "common.loot_tables.weapons.tier-1", }, ), 2 => Lottery::::load_expect( match dynamic_rng.gen_range(0..4) { 0 => "common.loot_tables.humanoids", 1 => "common.loot_tables.armor.plate", - _ => "common.loot_tables.weapon_rare", + _ => "common.loot_tables.weapons.tier-2", }, ), 3 => Lottery::::load_expect( match dynamic_rng.gen_range(0..10) { 0 => "common.loot_tables.humanoids", 1 => "common.loot_tables.armor.steel", - 2 => "common.loot_tables.weapon_rare", + 2 => "common.loot_tables.weapons.tier-3", _ => "common.loot_tables.cultists", }, ), @@ -585,7 +585,7 @@ impl Floor { match dynamic_rng.gen_range(0..6) { 0 => "common.loot_tables.humanoids", 1 => "common.loot_tables.fallback", - 2 => "common.loot_tables.weapon_rare", + 2 => "common.loot_tables.weapons.tier-4", _ => "common.loot_tables.cultists", }, ), @@ -593,7 +593,7 @@ impl Floor { match dynamic_rng.gen_range(0..5) { 0 => "common.loot_tables.humanoids", 1 => "common.loot_tables.fallback", - 2 => "common.loot_tables.weapon_rare", + 2 => "common.loot_tables.weapons.tier-5", _ => "common.loot_tables.cultists", }, ), @@ -838,23 +838,20 @@ impl Floor { if tile_pos == boss_spawn_tile && tile_wcenter.xy() == wpos2d { let chosen = match room.difficulty { 0 => Lottery::::load_expect( - "common.loot_tables.weapon_uncommon", + "common.loot_tables.weapons.tier-0", ), 1 => Lottery::::load_expect( - "common.loot_tables.weapon_uncommon", + "common.loot_tables.weapons.tier-1", ), 2 => Lottery::::load_expect( - match dynamic_rng.gen_range(0..3) { - 0 => "common.loot_tables.armor.steel", - _ => "common.loot_tables.armor.plate", - }, + "common.loot_tables.weapons.tier-2", ), 3 => Lottery::::load_expect( - "common.loot_tables.weapon_rare", + "common.loot_tables.weapons.tier-3", + ), + 4 => Lottery::::load_expect( + "common.loot_tables.weapons.tier-4", ), - 4 => { - Lottery::::load_expect("common.loot_tables.miniboss") - }, 5 => Lottery::::load_expect( match dynamic_rng.gen_range(0..3) { 0 => "common.loot_tables.mindflayer", @@ -1009,10 +1006,10 @@ impl Floor { "common.loot_tables.wild_animal", ), 3 => Lottery::::load_expect( - "common.loot_tables.weapon_rare", + "common.loot_tables.weapons.tier-3", ), 4 => Lottery::::load_expect( - "common.loot_tables.weapon_rare", + "common.loot_tables.weapons.tier-4", ), 5 => Lottery::::load_expect("common.loot_tables.husk"), _ => { From cb638180f8cf6eaac00db225cbe79c25cb5e078a Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 1 Apr 2021 14:48:36 -0400 Subject: [PATCH 11/17] Moved food items into their own loot tables. --- assets/common/item_price_calculation.ron | 1 - assets/common/loot_tables/cave_large.ron | 3 +-- assets/common/loot_tables/crafting.ron | 3 --- assets/common/loot_tables/cultists.ron | 12 +++--------- assets/common/loot_tables/food.ron | 14 -------------- .../common/loot_tables/food/farm_ingredients.ron | 7 +++++++ assets/common/loot_tables/food/prepared.ron | 9 +++++++++ .../common/loot_tables/food/wild_ingredients.ron | 6 ++++++ assets/common/loot_tables/humanoids.ron | 10 +++------- assets/common/loot_tables/maneater.ron | 2 +- assets/common/loot_tables/materials/common.ron | 6 ++++++ assets/common/loot_tables/saurok.ron | 11 +++-------- assets/common/loot_tables/villager.ron | 14 +++----------- common/src/comp/inventory/item/mod.rs | 2 +- server/src/events/entity_manipulation.rs | 16 ++++++++-------- 15 files changed, 51 insertions(+), 65 deletions(-) delete mode 100644 assets/common/loot_tables/food.ron create mode 100644 assets/common/loot_tables/food/farm_ingredients.ron create mode 100644 assets/common/loot_tables/food/prepared.ron create mode 100644 assets/common/loot_tables/food/wild_ingredients.ron create mode 100644 assets/common/loot_tables/materials/common.ron 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", }, From a2906168a6bc08d2418bfc019e239d49e9650439 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 1 Apr 2021 15:35:40 -0400 Subject: [PATCH 12/17] Moved materials into their own loot tables. --- assets/common/item_price_calculation.ron | 2 - assets/common/loot_tables/cave_large.ron | 3 +- assets/common/loot_tables/crafting.ron | 9 ---- assets/common/loot_tables/husk.ron | 3 -- assets/common/loot_tables/materials/gems.ron | 8 ++++ .../loot_tables/materials/underground.ron | 6 +++ assets/common/loot_tables/rocks.ron | 6 --- common/src/comp/inventory/item/mod.rs | 8 ++-- server/src/events/entity_manipulation.rs | 5 +-- world/src/site/dungeon/mod.rs | 45 +++++++++++-------- 10 files changed, 49 insertions(+), 46 deletions(-) delete mode 100644 assets/common/loot_tables/crafting.ron delete mode 100644 assets/common/loot_tables/husk.ron create mode 100644 assets/common/loot_tables/materials/gems.ron create mode 100644 assets/common/loot_tables/materials/underground.ron delete mode 100644 assets/common/loot_tables/rocks.ron diff --git a/assets/common/item_price_calculation.ron b/assets/common/item_price_calculation.ron index 3a2deb1508..634bab8563 100644 --- a/assets/common/item_price_calculation.ron +++ b/assets/common/item_price_calculation.ron @@ -7,7 +7,6 @@ loot_tables: [ (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 - (0.05,"common.loot_tables.crafting"), (0.005,"common.loot_tables.cultists"), (1,"common.loot_tables.fish"), (0.1,"common.loot_tables.humanoids"), @@ -15,7 +14,6 @@ loot_tables: [ (0.0001,"common.loot_tables.mindflayer"), (0.001,"common.loot_tables.miniboss"), // loot_table_rocks is dropped by rock monsters, but is also the only source of stones to econsim until cave_scatter information is turned into a loot table - (0.2,"common.loot_tables.rocks"), (1,"common.loot_tables.fallback"), (0.04,"common.loot_tables.saurok"), (0.05,"common.loot_tables.villager"), diff --git a/assets/common/loot_tables/cave_large.ron b/assets/common/loot_tables/cave_large.ron index 7121ba23c1..848f8a04ae 100644 --- a/assets/common/loot_tables/cave_large.ron +++ b/assets/common/loot_tables/cave_large.ron @@ -1,7 +1,8 @@ [ // Misc (0.25, Item("common.items.armor.misc.neck.plain_1")), - (3.0, LootTable("common.loot_tables.materials.common")), + (1.5, LootTable("common.loot_tables.materials.common")), + (3.5, LootTable("common.loot_tables.materials.underground")), (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 deleted file mode 100644 index 9824e55f52..0000000000 --- a/assets/common/loot_tables/crafting.ron +++ /dev/null @@ -1,9 +0,0 @@ -[ - // crafting ingredients - (0.5, Item("common.items.crafting_ing.amethyst")), - (0.5, Item("common.items.crafting_ing.topaz")), - (0.4, Item("common.items.crafting_ing.sapphire")), - (0.35, Item("common.items.crafting_ing.emerald")), - (0.25, Item("common.items.crafting_ing.ruby")), - (0.1, Item("common.items.crafting_ing.diamond")), -] \ No newline at end of file diff --git a/assets/common/loot_tables/husk.ron b/assets/common/loot_tables/husk.ron deleted file mode 100644 index be0a0aeef5..0000000000 --- a/assets/common/loot_tables/husk.ron +++ /dev/null @@ -1,3 +0,0 @@ -[ - (1.0, Item("common.items.crafting_ing.stones")), -] diff --git a/assets/common/loot_tables/materials/gems.ron b/assets/common/loot_tables/materials/gems.ron new file mode 100644 index 0000000000..ed6df318db --- /dev/null +++ b/assets/common/loot_tables/materials/gems.ron @@ -0,0 +1,8 @@ +[ + (3.0, Item("common.items.crafting_ing.topaz")), + (3.0, Item("common.items.crafting_ing.amethyst")), + (1.6, Item("common.items.crafting_ing.sapphire")), + (1.2, Item("common.items.crafting_ing.emerald")), + (0.8, Item("common.items.crafting_ing.ruby")), + (0.4, Item("common.items.crafting_ing.diamond")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/materials/underground.ron b/assets/common/loot_tables/materials/underground.ron new file mode 100644 index 0000000000..2ff78e7df9 --- /dev/null +++ b/assets/common/loot_tables/materials/underground.ron @@ -0,0 +1,6 @@ +[ + (2.0, Item("common.items.crafting_ing.stones")), + (0.5, Item("common.items.ore.veloritefrag")), + (0.25, Item("common.items.ore.velorite")), + (0.25, LootTable("common.loot_tables.materials.gems")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/rocks.ron b/assets/common/loot_tables/rocks.ron deleted file mode 100644 index 61321fafd1..0000000000 --- a/assets/common/loot_tables/rocks.ron +++ /dev/null @@ -1,6 +0,0 @@ -[ - (1.0, Item("common.items.crafting_ing.stones")), - (0.05, Item("common.items.crafting_ing.diamond")), - (0.1, Item("common.items.ore.velorite")), - (0.2, Item("common.items.ore.veloritefrag")), -] \ No newline at end of file diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index b936426ba1..d844ab0a20 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -624,17 +624,17 @@ impl Item { }, SpriteKind::Mud => { chosen = Lottery::::load_expect(match rng.gen_range(0..5) { - 0 => "common.loot_tables.crafting", + 0 => "common.loot_tables.materials.common", 1 => "common.loot_tables.weapons.tier-0", - 2 => "common.loot_tables.fallback", - _ => "common.loot_tables.rocks", + 2 => "common.loot_tables.materials.underground", + _ => "common.loot_tables.fallback", }) .read(); return Some(chosen.choose().to_item(None)); }, SpriteKind::Crate => { chosen = Lottery::::load_expect(match rng.gen_range(0..4) { - 0 => "common.loot_tables.crafting", + 0 => "common.loot_tables.materials.common", _ => "common.loot_tables.food.prepared", }) .read(); diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index a96a240b9a..6de97c9afd 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -351,9 +351,8 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc }, Some(common::comp::Body::QuadrupedSmall(quadruped_small)) => { match quadruped_small.species { - quadruped_small::Species::Dodarock => match rng.gen_range(0..6) { - 1 => "common.loot_tables.rocks", - _ => "common.loot_tables.rocks", + quadruped_small::Species::Dodarock => { + "common.loot_tables.materials.underground" }, _ => match rng.gen_range(0..4) { 0 => "common.loot_tables.food.wild_ingredients", diff --git a/world/src/site/dungeon/mod.rs b/world/src/site/dungeon/mod.rs index 198d9b901a..180e777c33 100644 --- a/world/src/site/dungeon/mod.rs +++ b/world/src/site/dungeon/mod.rs @@ -1011,13 +1011,11 @@ impl Floor { 4 => Lottery::::load_expect( "common.loot_tables.weapons.tier-4", ), - 5 => Lottery::::load_expect("common.loot_tables.husk"), + 5 => Lottery::::load_expect("common.loot_tables.cultist"), _ => { Lottery::::load_expect("common.loot_tables.fallback") }, }; - let chosen = chosen.read(); - let chosen = chosen.choose(); let entity = match room.difficulty { 0 => { let body = comp::Body::QuadrupedMedium( @@ -1030,7 +1028,9 @@ impl Floor { EntityInfo::at(tile_wcenter.map(|e| e as f32)) .with_body(body) .with_name("Bonerattler".to_string()) - .with_loot_drop(chosen.to_item(Some(body))), + .with_loot_drop( + chosen.read().choose().to_item(Some(body)), + ), ] }, 1 => { @@ -1044,7 +1044,9 @@ impl Floor { EntityInfo::at(tile_wcenter.map(|e| e as f32)) .with_body(body) .with_name("Bonerattler".to_string()) - .with_loot_drop(chosen.to_item(Some(body))); + .with_loot_drop( + chosen.read().choose().to_item(Some(body)) + ); 3 ] }, @@ -1060,7 +1062,9 @@ impl Floor { EntityInfo::at(tile_wcenter.map(|e| e as f32)) .with_body(body) .with_name("Hakulaq".to_string()) - .with_loot_drop(chosen.to_item(Some(body))) + .with_loot_drop( + chosen.read().choose().to_item(Some(body)), + ) }); entities }, @@ -1071,7 +1075,7 @@ impl Floor { EntityInfo::at(tile_wcenter.map(|e| e as f32)) .with_body(body) .with_name("Animal Trainer".to_string()) - .with_loot_drop(chosen.to_item(Some(body))) + .with_loot_drop(chosen.read().choose().to_item(Some(body))) .with_loadout_config(loadout_builder::LoadoutConfig::CultistAcolyte) .with_skillset_config( common::skillset_builder::SkillSetConfig::CultistAcolyte @@ -1098,7 +1102,9 @@ impl Floor { EntityInfo::at(tile_wcenter.map(|e| e as f32)) .with_body(body) .with_name("Tamed Darkhound".to_string()) - .with_loot_drop(chosen.to_item(Some(body))) + .with_loot_drop( + chosen.read().choose().to_item(Some(body)), + ) }); entities }, @@ -1113,23 +1119,26 @@ impl Floor { EntityInfo::at(tile_wcenter.map(|e| e as f32)) .with_body(body) .with_name("Dullahan Guard".to_string()) - .with_loot_drop(chosen.to_item(Some(body))), + .with_loot_drop( + chosen.read().choose().to_item(Some(body)), + ), ] }, 5 => { + let body = comp::Body::BipedSmall( + comp::biped_small::Body::random_with( + dynamic_rng, + &comp::biped_small::Species::Husk, + ), + ); let mut entities = Vec::new(); entities.resize_with(10, || { EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(comp::Body::BipedSmall( - comp::biped_small::Body::random_with( - dynamic_rng, - &comp::biped_small::Species::Husk, - ), - )) + .with_body(body) .with_name("Cultist Husk".to_string()) - .with_loot_drop(comp::Item::new_from_asset_expect( - "common.items.crafting_ing.stones", - )) + .with_loot_drop( + chosen.read().choose().to_item(Some(body)), + ) .with_loadout_config( loadout_builder::LoadoutConfig::Husk, ) From 7eb1eefa13973974bc003f81491c9e1604caf434 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 1 Apr 2021 18:41:09 -0400 Subject: [PATCH 13/17] Re-created item_price_calculation with new loot tables. --- assets/common/item_price_calculation.ron | 49 ++++++++++++------- .../common/loot_tables/weapons/bow/metal.ron | 10 ++-- .../loot_tables/weapons/hammer/bronze.ron | 4 ++ common/src/comp/inventory/trade_pricing.rs | 28 ++++++++--- 4 files changed, 62 insertions(+), 29 deletions(-) create mode 100644 assets/common/loot_tables/weapons/hammer/bronze.ron diff --git a/assets/common/item_price_calculation.ron b/assets/common/item_price_calculation.ron index 634bab8563..2b6ae5b9e8 100644 --- a/assets/common/item_price_calculation.ron +++ b/assets/common/item_price_calculation.ron @@ -1,24 +1,37 @@ ( 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.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 - (0.005,"common.loot_tables.cultists"), - (1,"common.loot_tables.fish"), - (0.1,"common.loot_tables.humanoids"), - (1,"common.loot_tables.maneater"), - (0.0001,"common.loot_tables.mindflayer"), - (0.001,"common.loot_tables.miniboss"), - // loot_table_rocks is dropped by rock monsters, but is also the only source of stones to econsim until cave_scatter information is turned into a loot table - (1,"common.loot_tables.fallback"), - (0.04,"common.loot_tables.saurok"), - (0.05,"common.loot_tables.villager"), - // we probably want to include all the scattered scatter information - //(0.5,"common.cave_scatter"), + // Weapons + (16.0, "common.loot_tables.weapons.starter"), + (8.0, "common.loot_tables.weapons.tier-0"), + (4.0, "common.loot_tables.weapons.tier-1"), + (2.0, "common.loot_tables.weapons.tier-2"), + (1.0, "common.loot_tables.weapons.tier-3"), + (0.5, "common.loot_tables.weapons.tier-4"), + (0.25, "common.loot_tables.weapons.tier-5"), + (0.125, "common.loot_tables.weapons.cultist"), + (0.125, "common.loot_tables.weapons.cave"), + (0.0625, "common.loot_tables.weapons.legendary"), + // Armor + (20.0, "common.loot_tables.armor.cloth"), + (6.0, "common.loot_tables.armor.agile"), + (3.0, "common.loot_tables.armor.swift"), + (6.0, "common.loot_tables.armor.druid"), + (2.0, "common.loot_tables.armor.twigs"), + (2.0, "common.loot_tables.armor.twigsflowers"), + (2.0, "common.loot_tables.armor.twigsleaves"), + (0.5, "common.loot_tables.armor.plate"), + (0.25, "common.loot_tables.armor.steel"), + (0.125, "common.loot_tables.armor.cultist"), + // Materials + (7.5, "common.loot_tables.materials.common"), + (2.0, "common.loot_tables.materials.underground"), + // Food + (6.0, "common.loot_tables.food.farm_ingredients"), + (2.5, "common.loot_tables.food.wild_ingredients"), + (0.8, "common.loot_tables.food.prepared"), + // TODO: Change consumables when they are split up later + (0.5, "common.loot_tables.consumables"), ], // this is the amount of that good the most common item represents // so basically this table balances the goods against each other (higher=less valuable) diff --git a/assets/common/loot_tables/weapons/bow/metal.ron b/assets/common/loot_tables/weapons/bow/metal.ron index 0bcd16b997..edfd8fc956 100644 --- a/assets/common/loot_tables/weapons/bow/metal.ron +++ b/assets/common/loot_tables/weapons/bow/metal.ron @@ -1,7 +1,7 @@ [ - (1.0, Item("common.items.weapons.bow.rawwood-0")), - (1.0, Item("common.items.weapons.bow.rawwood-1")), - (1.0, Item("common.items.weapons.bow.rawwood-2")), - (1.0, Item("common.items.weapons.bow.rawwood-3")), - (1.0, Item("common.items.weapons.bow.rawwood-4")), + (1.0, Item("common.items.weapons.bow.metal-0")), + (1.0, Item("common.items.weapons.bow.metal-1")), + (1.0, Item("common.items.weapons.bow.metal-2")), + (1.0, Item("common.items.weapons.bow.metal-3")), + (1.0, Item("common.items.weapons.bow.metal-4")), ] \ No newline at end of file diff --git a/assets/common/loot_tables/weapons/hammer/bronze.ron b/assets/common/loot_tables/weapons/hammer/bronze.ron new file mode 100644 index 0000000000..f5bd4c550e --- /dev/null +++ b/assets/common/loot_tables/weapons/hammer/bronze.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.weapons.hammer.bronze_hammer-0")), + (1.0, Item("common.items.weapons.hammer.bronze_hammer-1")), +] \ No newline at end of file diff --git a/common/src/comp/inventory/trade_pricing.rs b/common/src/comp/inventory/trade_pricing.rs index 4bb85b026c..4d0237bc19 100644 --- a/common/src/comp/inventory/trade_pricing.rs +++ b/common/src/comp/inventory/trade_pricing.rs @@ -1,6 +1,6 @@ use crate::{ assets::{self, AssetExt}, - lottery::LootSpec, + lottery::{LootSpec, Lottery}, recipe::{default_recipe_book, RecipeInput}, trade::Good, }; @@ -8,7 +8,7 @@ use assets_manager::AssetGuard; use hashbrown::HashMap; use lazy_static::lazy_static; use serde::Deserialize; -use tracing::info; +use tracing::{info, warn}; #[derive(Debug)] struct Entry { @@ -38,6 +38,7 @@ lazy_static! { static ref TRADE_PRICING: TradePricing = TradePricing::read(); } +#[derive(Clone)] struct ProbabilityFile { pub content: Vec<(f32, String)>, } @@ -53,10 +54,21 @@ impl From> for ProbabilityFile { Self { content: content .into_iter() - .filter_map(|(a, b)| match b { - LootSpec::Item(c) => Some((a, c)), - LootSpec::ItemQuantity(c, d, e) => Some((a * (d + e) as f32 / 2.0, c)), - _ => None, + .flat_map(|(a, b)| match b { + LootSpec::Item(c) => vec![(a, c)].into_iter(), + LootSpec::ItemQuantity(c, d, e) => { + vec![(a * (d + e) as f32 / 2.0, c)].into_iter() + }, + LootSpec::LootTable(c) => { + let total = Lottery::::load_expect(&c).read().total(); + ProbabilityFile::load_expect_cloned(&c) + .content + .into_iter() + .map(|(d, e)| (a * d / total, e)) + .collect::>() + .into_iter() + }, + LootSpec::CreatureMaterial => vec![].into_iter(), }) .collect(), } @@ -306,6 +318,10 @@ impl TradePricing { Some(TradePricing::COIN_ITEM.into()) } else { let table = self.get_list(good); + if table.is_empty() { + warn!("Good: {:?}, was unreachable.", good); + return None; + } let upper = table.len(); let lower = table .iter() From c8b8cd436ebd49df78215e37910df3321a7f51ad Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 1 Apr 2021 20:06:28 -0400 Subject: [PATCH 14/17] Made item prices sane. --- assets/common/item_price_calculation.ron | 22 +++++++++---------- .../common/items/weapons/staff/orc_iron.ron | 2 +- assets/common/loot_tables/consumables.ron | 4 ++-- common/src/comp/inventory/trade_pricing.rs | 11 +++++----- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/assets/common/item_price_calculation.ron b/assets/common/item_price_calculation.ron index 2b6ae5b9e8..ad25988f70 100644 --- a/assets/common/item_price_calculation.ron +++ b/assets/common/item_price_calculation.ron @@ -25,21 +25,21 @@ loot_tables: [ (0.125, "common.loot_tables.armor.cultist"), // Materials (7.5, "common.loot_tables.materials.common"), - (2.0, "common.loot_tables.materials.underground"), + (5.0, "common.loot_tables.materials.underground"), // Food - (6.0, "common.loot_tables.food.farm_ingredients"), - (2.5, "common.loot_tables.food.wild_ingredients"), - (0.8, "common.loot_tables.food.prepared"), + (0.5, "common.loot_tables.food.farm_ingredients"), + (0.25, "common.loot_tables.food.wild_ingredients"), + (0.1, "common.loot_tables.food.prepared"), // TODO: Change consumables when they are split up later - (0.5, "common.loot_tables.consumables"), + (1.0, "common.loot_tables.consumables"), ], // this is the amount of that good the most common item represents // so basically this table balances the goods against each other (higher=less valuable) good_scaling: [ - (Potions, 0.5), // common.items.consumable.potion_minor - (Food, 3.0), // common.items.food.mushroom - (Coin, 1.0), // common.items.utility.coins - (Armor, 0.3), // common.items.armor.misc.pants.worker_blue - (Tools, 1.0), // common.items.weapons.staff.starter_staff - (Ingredients, 5.0), // common.items.crafting_ing.leather_scraps + (Potions, 0.001), // common.items.consumable.potion_minor + (Food, 2.0), // common.items.food.mushroom + (Coin, 10.0), // common.items.utility.coins + (Armor, 0.2), // common.items.armor.misc.pants.worker_blue + (Tools, 0.1), // common.items.weapons.staff.starter_staff + (Ingredients, 1.0), // common.items.crafting_ing.leather_scraps ]) diff --git a/assets/common/items/weapons/staff/orc_iron.ron b/assets/common/items/weapons/staff/orc_iron.ron index ff680c147e..8772d1be49 100644 --- a/assets/common/items/weapons/staff/orc_iron.ron +++ b/assets/common/items/weapons/staff/orc_iron.ron @@ -6,7 +6,7 @@ ItemDef( hands: Two, stats: Direct(( equip_time_secs: 0.3, - power: 0.5, + power: 1.5, poise_strength: 1.0, speed: 0.8, crit_chance: 0.2638889, diff --git a/assets/common/loot_tables/consumables.ron b/assets/common/loot_tables/consumables.ron index e234582077..ca1bbe4833 100644 --- a/assets/common/loot_tables/consumables.ron +++ b/assets/common/loot_tables/consumables.ron @@ -1,8 +1,8 @@ [ // potions (1.0, Item("common.items.consumable.potion_minor")), - (0.1, Item("common.items.consumable.potion_med")), - (0.01, Item("common.items.consumable.potion_big")), + (0.5, Item("common.items.consumable.potion_med")), + (0.2, Item("common.items.consumable.potion_big")), // bombs (0.6, Item("common.items.utility.bomb")), (0.2, Item("common.items.utility.bomb_pile")), diff --git a/common/src/comp/inventory/trade_pricing.rs b/common/src/comp/inventory/trade_pricing.rs index 4d0237bc19..28a9f9fcaa 100644 --- a/common/src/comp/inventory/trade_pricing.rs +++ b/common/src/comp/inventory/trade_pricing.rs @@ -341,13 +341,12 @@ impl TradePricing { pub fn get_material(item: &str) -> (Good, f32) { if item == TradePricing::COIN_ITEM { - (Good::Coin, 1.0 / TRADE_PRICING.coin_scale) + (Good::Coin, 1.0) } else { - TRADE_PRICING - .material_cache - .get(item) - .cloned() - .unwrap_or((Good::Terrain(crate::terrain::BiomeKind::Void), 0.0)) + TRADE_PRICING.material_cache.get(item).cloned().map_or( + (Good::Terrain(crate::terrain::BiomeKind::Void), 0.0), + |(a, b)| (a, b * TRADE_PRICING.coin_scale), + ) } } From 7c8242b5b1b7ef328c7538164e1fdcd615496c4e Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 1 Apr 2021 21:02:36 -0400 Subject: [PATCH 15/17] Added unit test to validate contents of loot tables. --- assets/common/loot_tables/humanoids.ron | 8 ++-- assets/common/loot_tables/villager.ron | 8 ++-- common/src/lottery.rs | 55 ++++++++++++++++++++----- 3 files changed, 53 insertions(+), 18 deletions(-) diff --git a/assets/common/loot_tables/humanoids.ron b/assets/common/loot_tables/humanoids.ron index cbdd57df82..e82bc54c84 100644 --- a/assets/common/loot_tables/humanoids.ron +++ b/assets/common/loot_tables/humanoids.ron @@ -11,8 +11,8 @@ (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")), - (0.5, LootTable("common.loot_tables.bow.rawwood")), - (0.5, LootTable("common.loot_tables.starter")), + (0.5, LootTable("common.loot_tables.weapons.sword.wood")), + (0.5, LootTable("common.loot_tables.weapons.hammer.stone")), + (0.5, LootTable("common.loot_tables.weapons.bow.rawwood")), + (0.5, LootTable("common.loot_tables.weapons.starter")), ] \ No newline at end of file diff --git a/assets/common/loot_tables/villager.ron b/assets/common/loot_tables/villager.ron index fb0006a182..844c780773 100644 --- a/assets/common/loot_tables/villager.ron +++ b/assets/common/loot_tables/villager.ron @@ -11,8 +11,8 @@ (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")), - (0.5, LootTable("common.loot_tables.bow.rawwood")), - (0.5, LootTable("common.loot_tables.starter")), + (0.5, LootTable("common.loot_tables.weapons.sword.wood")), + (0.5, LootTable("common.loot_tables.weapons.hammer.stone")), + (0.5, LootTable("common.loot_tables.weapons.bow.rawwood")), + (0.5, LootTable("common.loot_tables.weapons.starter")), ] \ No newline at end of file diff --git a/common/src/lottery.rs b/common/src/lottery.rs index ef82002bb4..c15569272b 100644 --- a/common/src/lottery.rs +++ b/common/src/lottery.rs @@ -114,18 +114,53 @@ impl LootSpec { #[cfg(test)] mod tests { use super::*; - use crate::{assets::AssetExt, comp::Item}; - + use crate::{assets::{AssetExt, Error}, comp::Item}; + #[test] - fn test_loot_table() { - let test = Lottery::::load_expect("common.loot_tables.fallback"); + fn test_loot_tables() { + #[derive(Clone)] + struct LootTableList(Vec>); + impl assets::Compound for LootTableList { + fn load( + cache: &assets::AssetCache, + specifier: &str, + ) -> Result { + let list = cache + .load::(specifier)? + .read() + .iter() + .map(|spec| Lottery::::load_cloned(spec)) + .collect::>()?; + + Ok(LootTableList(list)) + } + } - for (_, to_itemifier) in test.read().iter() { - assert!( - Item::new_from_asset(to_itemifier).is_ok(), - "Invalid loot table item '{}'", - to_itemifier - ); + fn validate_table_contents(table: Lottery) { + for (_, item) in table.iter() { + match item { + LootSpec::Item(item) => { + Item::new_from_asset_expect(&item); + }, + LootSpec::ItemQuantity(item, lower, upper) => { + assert!(*lower > 0, "Lower quantity must be more than 0. It is {}.", lower); + assert!(upper >= lower, "Upper quantity must be at least the value of lower quantity. Upper value: {}, low value: {}.", upper, lower); + Item::new_from_asset_expect(&item); + }, + LootSpec::LootTable(loot_table) => { + let loot_table = Lottery::::load_expect_cloned(&loot_table); + validate_table_contents(loot_table); + }, + LootSpec::CreatureMaterial => { + item.to_item(None); + }, + } + } + } + + let loot_tables = LootTableList::load_expect_cloned("common.loot_tables.*").0; + for loot_table in loot_tables { + validate_table_contents(loot_table); } } } From 9ad5b0f6b7524aea134f76ac5c6393791718f7f7 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 1 Apr 2021 21:26:35 -0400 Subject: [PATCH 16/17] Changelog. Fixed a few qualities. --- CHANGELOG.md | 2 ++ assets/common/items/weapons/sceptre/moon0.ron | 2 +- .../items/weapons/sceptre/root_green0.ron | 2 +- .../common/items/weapons/staff/bent_fuse.ron | 2 +- .../common/items/weapons/staff/bone_staff.ron | 2 +- .../items/weapons/staff/crimson_eye.ron | 2 +- .../items/weapons/staff/fiery_wishing_rod.ron | 2 +- .../items/weapons/staff/flamethrower_0.ron | 2 +- .../items/weapons/staff/infused_tower.ron | 2 +- .../common/items/weapons/staff/lava_rod.ron | 2 +- .../common/items/weapons/staff/orc_iron.ron | 2 +- common/src/lottery.rs | 23 +++++++++++++++---- server/src/events/entity_manipulation.rs | 3 +-- 13 files changed, 31 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4fef7c43b..f428e5e2aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Overhauled clouds for more verticality and performance - New tooltip for items with stats comparison - Improved bow feedback, added arrow particles +- Retiered most sceptres and staves +- Loot tables can now recursively reference loot tables ### Removed diff --git a/assets/common/items/weapons/sceptre/moon0.ron b/assets/common/items/weapons/sceptre/moon0.ron index 971b68103e..d49039bf58 100644 --- a/assets/common/items/weapons/sceptre/moon0.ron +++ b/assets/common/items/weapons/sceptre/moon0.ron @@ -13,6 +13,6 @@ ItemDef( crit_mult: 1.7326007, )), )), - quality: Common, + quality: Moderate, tags: [], ) \ No newline at end of file diff --git a/assets/common/items/weapons/sceptre/root_green0.ron b/assets/common/items/weapons/sceptre/root_green0.ron index b252876c11..f8b8baf1f1 100644 --- a/assets/common/items/weapons/sceptre/root_green0.ron +++ b/assets/common/items/weapons/sceptre/root_green0.ron @@ -13,6 +13,6 @@ ItemDef( crit_mult: 1.4444444, )), )), - quality: Moderate, + quality: Low, tags: [], ) \ No newline at end of file diff --git a/assets/common/items/weapons/staff/bent_fuse.ron b/assets/common/items/weapons/staff/bent_fuse.ron index 87431e46ab..ab06866888 100644 --- a/assets/common/items/weapons/staff/bent_fuse.ron +++ b/assets/common/items/weapons/staff/bent_fuse.ron @@ -13,6 +13,6 @@ ItemDef( crit_mult: 1.4469842, )), )), - quality: Epic, + quality: Low, tags: [], ) \ No newline at end of file diff --git a/assets/common/items/weapons/staff/bone_staff.ron b/assets/common/items/weapons/staff/bone_staff.ron index 2ae02e9855..c3b786aff3 100644 --- a/assets/common/items/weapons/staff/bone_staff.ron +++ b/assets/common/items/weapons/staff/bone_staff.ron @@ -13,6 +13,6 @@ ItemDef( crit_mult: 1.6349206, )), )), - quality: Common, + quality: Low, tags: [], ) \ No newline at end of file diff --git a/assets/common/items/weapons/staff/crimson_eye.ron b/assets/common/items/weapons/staff/crimson_eye.ron index f4f54e2323..6039aa9ea2 100644 --- a/assets/common/items/weapons/staff/crimson_eye.ron +++ b/assets/common/items/weapons/staff/crimson_eye.ron @@ -13,6 +13,6 @@ ItemDef( crit_mult: 1.4571428, )), )), - quality: Moderate, + quality: Low, tags: [], ) \ No newline at end of file diff --git a/assets/common/items/weapons/staff/fiery_wishing_rod.ron b/assets/common/items/weapons/staff/fiery_wishing_rod.ron index 5d9301cb01..a9bc27341a 100644 --- a/assets/common/items/weapons/staff/fiery_wishing_rod.ron +++ b/assets/common/items/weapons/staff/fiery_wishing_rod.ron @@ -13,6 +13,6 @@ ItemDef( crit_mult: 1.5142857, )), )), - quality: Moderate, + quality: Common, tags: [], ) \ No newline at end of file diff --git a/assets/common/items/weapons/staff/flamethrower_0.ron b/assets/common/items/weapons/staff/flamethrower_0.ron index c558e2f005..3244bcbd08 100644 --- a/assets/common/items/weapons/staff/flamethrower_0.ron +++ b/assets/common/items/weapons/staff/flamethrower_0.ron @@ -13,6 +13,6 @@ ItemDef( crit_mult: 1.4017857, )), )), - quality: High, + quality: Moderate, tags: [], ) \ No newline at end of file diff --git a/assets/common/items/weapons/staff/infused_tower.ron b/assets/common/items/weapons/staff/infused_tower.ron index 193e78cbeb..e0cbe2c965 100644 --- a/assets/common/items/weapons/staff/infused_tower.ron +++ b/assets/common/items/weapons/staff/infused_tower.ron @@ -13,6 +13,6 @@ ItemDef( crit_mult: 1.445269, )), )), - quality: High, + quality: Moderate, tags: [], ) \ No newline at end of file diff --git a/assets/common/items/weapons/staff/lava_rod.ron b/assets/common/items/weapons/staff/lava_rod.ron index 4fe56d893a..fe8c3f4a25 100644 --- a/assets/common/items/weapons/staff/lava_rod.ron +++ b/assets/common/items/weapons/staff/lava_rod.ron @@ -13,6 +13,6 @@ ItemDef( crit_mult: 1.4114286, )), )), - quality: High, + quality: Moderate, tags: [], ) \ No newline at end of file diff --git a/assets/common/items/weapons/staff/orc_iron.ron b/assets/common/items/weapons/staff/orc_iron.ron index 8772d1be49..59e246157b 100644 --- a/assets/common/items/weapons/staff/orc_iron.ron +++ b/assets/common/items/weapons/staff/orc_iron.ron @@ -13,6 +13,6 @@ ItemDef( crit_mult: 1.481203, )), )), - quality: Epic, + quality: Moderate, tags: [], ) \ No newline at end of file diff --git a/common/src/lottery.rs b/common/src/lottery.rs index c15569272b..abe77d12b8 100644 --- a/common/src/lottery.rs +++ b/common/src/lottery.rs @@ -114,8 +114,11 @@ impl LootSpec { #[cfg(test)] mod tests { use super::*; - use crate::{assets::{AssetExt, Error}, comp::Item}; - + use crate::{ + assets::{AssetExt, Error}, + comp::Item, + }; + #[test] fn test_loot_tables() { #[derive(Clone)] @@ -131,7 +134,7 @@ mod tests { .iter() .map(|spec| Lottery::::load_cloned(spec)) .collect::>()?; - + Ok(LootTableList(list)) } } @@ -143,8 +146,18 @@ mod tests { Item::new_from_asset_expect(&item); }, LootSpec::ItemQuantity(item, lower, upper) => { - assert!(*lower > 0, "Lower quantity must be more than 0. It is {}.", lower); - assert!(upper >= lower, "Upper quantity must be at least the value of lower quantity. Upper value: {}, low value: {}.", upper, lower); + assert!( + *lower > 0, + "Lower quantity must be more than 0. It is {}.", + lower + ); + assert!( + upper >= lower, + "Upper quantity must be at least the value of lower quantity. Upper \ + value: {}, low value: {}.", + upper, + lower + ); Item::new_from_asset_expect(&item); }, LootSpec::LootTable(loot_table) => { diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 6de97c9afd..36109fb1bc 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -347,7 +347,7 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc 2 => "common.loot_tables.armor.cloth", 3 => "common.loot_tables.weapons.starter", 4 => "common.loot_tables.humanoids", - _ => "common.loots_tables.fallback", + _ => "common.loot_tables.fallback", }, Some(common::comp::Body::QuadrupedSmall(quadruped_small)) => { match quadruped_small.species { @@ -356,7 +356,6 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc }, _ => match rng.gen_range(0..4) { 0 => "common.loot_tables.food.wild_ingredients", - 2 => "common.loot_tables.wild_animal", _ => "common.loot_tables.wild_animal", }, } From 27f178286d273cf789a5dc4a9aeceab73c59279c Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 2 Apr 2021 23:03:59 -0400 Subject: [PATCH 17/17] Removed all rng matches in code to determine loot tables, and moved to loot tables specific for each sprite, creature, or dungeon. --- .../creature/biped_large/default.ron | 4 + .../{ => creature/biped_large}/mindflayer.ron | 0 .../{ => creature/biped_large}/saurok.ron | 0 .../creature/biped_large/troll.ron | 6 + .../creature/biped_large/wendigo.ron | 6 + .../loot_tables/creature/bird_medium.ron | 4 + assets/common/loot_tables/creature/dragon.ron | 3 + .../loot_tables/{ => creature}/fish.ron | 0 assets/common/loot_tables/creature/golem.ron | 7 + .../common/loot_tables/creature/humanoid.ron | 7 + .../loot_tables/creature/quad_low/default.ron | 5 + .../{ => creature/quad_low}/maneater.ron | 0 .../creature/quad_medium/default.ron | 4 + .../loot_tables/creature/quad_medium/ice.ron | 5 + .../creature/quad_small/default.ron | 4 + .../creature/quad_small/dodarock.ron | 3 + .../theropod/default.ron} | 5 +- .../loot_tables/creature/theropod/raptor.ron | 4 + .../loot_tables/dungeon/tier-0/enemy.ron | 5 + .../loot_tables/dungeon/tier-1/enemy.ron | 5 + .../loot_tables/dungeon/tier-2/enemy.ron | 5 + .../loot_tables/dungeon/tier-3/enemy.ron | 6 + .../loot_tables/dungeon/tier-4/enemy.ron | 5 + .../loot_tables/dungeon/tier-5/boss.ron | 4 + .../loot_tables/dungeon/tier-5/enemy.ron | 6 + .../loot_tables/sprite/chest-buried.ron | 6 + assets/common/loot_tables/sprite/chest.ron | 8 + assets/common/loot_tables/sprite/crate.ron | 4 + assets/common/loot_tables/sprite/mud.ron | 6 + assets/voxygen/voxel/sprite_manifest.ron | 2 +- common/src/bin/csv_export/main.rs | 3 - common/src/bin/csv_import/main.rs | 1 - common/src/comp/body.rs | 25 - common/src/comp/inventory/item/mod.rs | 45 +- common/src/comp/inventory/trade_pricing.rs | 1 - common/src/lottery.rs | 18 +- common/src/terrain/sprite.rs | 8 +- server/src/events/entity_manipulation.rs | 91 ++- world/src/layer/scatter.rs | 2 +- world/src/site/dungeon/mod.rs | 546 ++++++++---------- 40 files changed, 416 insertions(+), 453 deletions(-) create mode 100644 assets/common/loot_tables/creature/biped_large/default.ron rename assets/common/loot_tables/{ => creature/biped_large}/mindflayer.ron (100%) rename assets/common/loot_tables/{ => creature/biped_large}/saurok.ron (100%) create mode 100644 assets/common/loot_tables/creature/biped_large/troll.ron create mode 100644 assets/common/loot_tables/creature/biped_large/wendigo.ron create mode 100644 assets/common/loot_tables/creature/bird_medium.ron create mode 100644 assets/common/loot_tables/creature/dragon.ron rename assets/common/loot_tables/{ => creature}/fish.ron (100%) create mode 100644 assets/common/loot_tables/creature/golem.ron create mode 100644 assets/common/loot_tables/creature/humanoid.ron create mode 100644 assets/common/loot_tables/creature/quad_low/default.ron rename assets/common/loot_tables/{ => creature/quad_low}/maneater.ron (100%) create mode 100644 assets/common/loot_tables/creature/quad_medium/default.ron create mode 100644 assets/common/loot_tables/creature/quad_medium/ice.ron create mode 100644 assets/common/loot_tables/creature/quad_small/default.ron create mode 100644 assets/common/loot_tables/creature/quad_small/dodarock.ron rename assets/common/loot_tables/{wild_animal.ron => creature/theropod/default.ron} (61%) create mode 100644 assets/common/loot_tables/creature/theropod/raptor.ron create mode 100644 assets/common/loot_tables/dungeon/tier-0/enemy.ron create mode 100644 assets/common/loot_tables/dungeon/tier-1/enemy.ron create mode 100644 assets/common/loot_tables/dungeon/tier-2/enemy.ron create mode 100644 assets/common/loot_tables/dungeon/tier-3/enemy.ron create mode 100644 assets/common/loot_tables/dungeon/tier-4/enemy.ron create mode 100644 assets/common/loot_tables/dungeon/tier-5/boss.ron create mode 100644 assets/common/loot_tables/dungeon/tier-5/enemy.ron create mode 100644 assets/common/loot_tables/sprite/chest-buried.ron create mode 100644 assets/common/loot_tables/sprite/chest.ron create mode 100644 assets/common/loot_tables/sprite/crate.ron create mode 100644 assets/common/loot_tables/sprite/mud.ron diff --git a/assets/common/loot_tables/creature/biped_large/default.ron b/assets/common/loot_tables/creature/biped_large/default.ron new file mode 100644 index 0000000000..834b386b01 --- /dev/null +++ b/assets/common/loot_tables/creature/biped_large/default.ron @@ -0,0 +1,4 @@ +[ + (1.0, LootTable("common.loot_tables.food.prepared")), + (2.0, LootTable("common.loot_tables.cave_large")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/mindflayer.ron b/assets/common/loot_tables/creature/biped_large/mindflayer.ron similarity index 100% rename from assets/common/loot_tables/mindflayer.ron rename to assets/common/loot_tables/creature/biped_large/mindflayer.ron diff --git a/assets/common/loot_tables/saurok.ron b/assets/common/loot_tables/creature/biped_large/saurok.ron similarity index 100% rename from assets/common/loot_tables/saurok.ron rename to assets/common/loot_tables/creature/biped_large/saurok.ron diff --git a/assets/common/loot_tables/creature/biped_large/troll.ron b/assets/common/loot_tables/creature/biped_large/troll.ron new file mode 100644 index 0000000000..8d756a38c8 --- /dev/null +++ b/assets/common/loot_tables/creature/biped_large/troll.ron @@ -0,0 +1,6 @@ +[ + (1.0, LootTable("common.loot_tables.food.prepared")), + (1.0, LootTable("common.loot_tables.cave_large")), + (1.0, LootTable("common.loot_tables.weapons.tier-2")), + (5.0, Item("common.items.crafting_ing.leather_troll")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/creature/biped_large/wendigo.ron b/assets/common/loot_tables/creature/biped_large/wendigo.ron new file mode 100644 index 0000000000..bcb2acdda5 --- /dev/null +++ b/assets/common/loot_tables/creature/biped_large/wendigo.ron @@ -0,0 +1,6 @@ +[ + (1.0, LootTable("common.loot_tables.food.prepared")), + (1.0, Item("common.items.crafting_ing.icy_fang")), + (1.0, LootTable("common.loot_tables.weapons.tier-2")), + (4.0, LootTable("common.loot_tables.cave_large")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/creature/bird_medium.ron b/assets/common/loot_tables/creature/bird_medium.ron new file mode 100644 index 0000000000..0b7572577a --- /dev/null +++ b/assets/common/loot_tables/creature/bird_medium.ron @@ -0,0 +1,4 @@ +[ + (1.0, LootTable("common.loot_tables.food.wild_ingredients")), + (1.0, LootTable("common.loot_tables.fallback")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/creature/dragon.ron b/assets/common/loot_tables/creature/dragon.ron new file mode 100644 index 0000000000..674c7b3822 --- /dev/null +++ b/assets/common/loot_tables/creature/dragon.ron @@ -0,0 +1,3 @@ +[ + (1.0, LootTable("common.loot_tables.weapons.tier-5")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/fish.ron b/assets/common/loot_tables/creature/fish.ron similarity index 100% rename from assets/common/loot_tables/fish.ron rename to assets/common/loot_tables/creature/fish.ron diff --git a/assets/common/loot_tables/creature/golem.ron b/assets/common/loot_tables/creature/golem.ron new file mode 100644 index 0000000000..1caabc59f8 --- /dev/null +++ b/assets/common/loot_tables/creature/golem.ron @@ -0,0 +1,7 @@ +[ + (1.0, LootTable("common.loot_tables.food.prepared")), + (1.0, LootTable("common.loot_tables.armor.steel")), + (1.0, LootTable("common.loot_tables.weapons.tier-1")), + (1.0, LootTable("common.loot_tables.weapons.tier-2")), + (1.0, LootTable("common.loot_tables.weapons.tier-3")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/creature/humanoid.ron b/assets/common/loot_tables/creature/humanoid.ron new file mode 100644 index 0000000000..3547240baf --- /dev/null +++ b/assets/common/loot_tables/creature/humanoid.ron @@ -0,0 +1,7 @@ +[ + (1.0, LootTable("common.loot_tables.humanoids")), + (1.0, LootTable("common.loot_tables.armor.swift")), + (1.0, LootTable("common.loot_tables.armor.cloth")), + (1.0, LootTable("common.loot_tables.weapons.starter")), + (1.0, LootTable("common.loot_tables.fallback")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/creature/quad_low/default.ron b/assets/common/loot_tables/creature/quad_low/default.ron new file mode 100644 index 0000000000..0dd577cd0f --- /dev/null +++ b/assets/common/loot_tables/creature/quad_low/default.ron @@ -0,0 +1,5 @@ +[ + (1.0, LootTable("common.loot_tables.food.wild_ingredients")), + (1.0, Item("common.items.crafting_ing.leather_scraps")), + (1.0, LootTable("common.loot_tables.fallback")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/maneater.ron b/assets/common/loot_tables/creature/quad_low/maneater.ron similarity index 100% rename from assets/common/loot_tables/maneater.ron rename to assets/common/loot_tables/creature/quad_low/maneater.ron diff --git a/assets/common/loot_tables/creature/quad_medium/default.ron b/assets/common/loot_tables/creature/quad_medium/default.ron new file mode 100644 index 0000000000..c11cdc4259 --- /dev/null +++ b/assets/common/loot_tables/creature/quad_medium/default.ron @@ -0,0 +1,4 @@ +[ + (1.0, LootTable("common.loot_tables.food.wild_ingredients")), + (1.0, Item("common.items.crafting_ing.leather_scraps")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/creature/quad_medium/ice.ron b/assets/common/loot_tables/creature/quad_medium/ice.ron new file mode 100644 index 0000000000..ca7b5fde38 --- /dev/null +++ b/assets/common/loot_tables/creature/quad_medium/ice.ron @@ -0,0 +1,5 @@ +[ + (1.0, LootTable("common.loot_tables.food.wild_ingredients")), + (1.0, Item("common.items.crafting_ing.leather_scraps")), + (1.0, Item("common.items.crafting_ing.icy_fang")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/creature/quad_small/default.ron b/assets/common/loot_tables/creature/quad_small/default.ron new file mode 100644 index 0000000000..c11cdc4259 --- /dev/null +++ b/assets/common/loot_tables/creature/quad_small/default.ron @@ -0,0 +1,4 @@ +[ + (1.0, LootTable("common.loot_tables.food.wild_ingredients")), + (1.0, Item("common.items.crafting_ing.leather_scraps")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/creature/quad_small/dodarock.ron b/assets/common/loot_tables/creature/quad_small/dodarock.ron new file mode 100644 index 0000000000..f4b99bd7eb --- /dev/null +++ b/assets/common/loot_tables/creature/quad_small/dodarock.ron @@ -0,0 +1,3 @@ +[ + (1.0, LootTable("common.loot_tables.materials.underground")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/wild_animal.ron b/assets/common/loot_tables/creature/theropod/default.ron similarity index 61% rename from assets/common/loot_tables/wild_animal.ron rename to assets/common/loot_tables/creature/theropod/default.ron index 97b29abb2c..8b25c8a670 100644 --- a/assets/common/loot_tables/wild_animal.ron +++ b/assets/common/loot_tables/creature/theropod/default.ron @@ -1,4 +1,3 @@ -[ +[ (1.0, Item("common.items.crafting_ing.leather_scraps")), - (1.0, CreatureMaterial), -] +] \ No newline at end of file diff --git a/assets/common/loot_tables/creature/theropod/raptor.ron b/assets/common/loot_tables/creature/theropod/raptor.ron new file mode 100644 index 0000000000..0c4925c802 --- /dev/null +++ b/assets/common/loot_tables/creature/theropod/raptor.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.crafting_ing.leather_scraps")), + (1.0, Item("common.items.crafting_ing.raptor_feather")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/dungeon/tier-0/enemy.ron b/assets/common/loot_tables/dungeon/tier-0/enemy.ron new file mode 100644 index 0000000000..854138e052 --- /dev/null +++ b/assets/common/loot_tables/dungeon/tier-0/enemy.ron @@ -0,0 +1,5 @@ +[ + (1.0, LootTable("common.loot_tables.humanoids")), + (1.0, LootTable("common.loot_tables.armor.cloth")), + (2.0, LootTable("common.loot_tables.weapons.tier-0")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/dungeon/tier-1/enemy.ron b/assets/common/loot_tables/dungeon/tier-1/enemy.ron new file mode 100644 index 0000000000..7493b71f24 --- /dev/null +++ b/assets/common/loot_tables/dungeon/tier-1/enemy.ron @@ -0,0 +1,5 @@ +[ + (1.0, LootTable("common.loot_tables.humanoids")), + (1.0, LootTable("common.loot_tables.armor.swift")), + (2.0, LootTable("common.loot_tables.weapons.tier-1")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/dungeon/tier-2/enemy.ron b/assets/common/loot_tables/dungeon/tier-2/enemy.ron new file mode 100644 index 0000000000..1c45d01caf --- /dev/null +++ b/assets/common/loot_tables/dungeon/tier-2/enemy.ron @@ -0,0 +1,5 @@ +[ + (1.0, LootTable("common.loot_tables.humanoids")), + (1.0, LootTable("common.loot_tables.armor.plate")), + (2.0, LootTable("common.loot_tables.weapons.tier-2")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/dungeon/tier-3/enemy.ron b/assets/common/loot_tables/dungeon/tier-3/enemy.ron new file mode 100644 index 0000000000..e7c466dfa9 --- /dev/null +++ b/assets/common/loot_tables/dungeon/tier-3/enemy.ron @@ -0,0 +1,6 @@ +[ + (1.0, LootTable("common.loot_tables.humanoids")), + (1.0, LootTable("common.loot_tables.armor.steel")), + (1.0, LootTable("common.loot_tables.weapons.tier-3")), + (3.0, LootTable("common.loot_tables.cultists")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/dungeon/tier-4/enemy.ron b/assets/common/loot_tables/dungeon/tier-4/enemy.ron new file mode 100644 index 0000000000..95c6ccb8dd --- /dev/null +++ b/assets/common/loot_tables/dungeon/tier-4/enemy.ron @@ -0,0 +1,5 @@ +[ + (1.0, LootTable("common.loot_tables.humanoids")), + (1.0, LootTable("common.loot_tables.weapons.tier-4")), + (5.0, LootTable("common.loot_tables.cultists")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/dungeon/tier-5/boss.ron b/assets/common/loot_tables/dungeon/tier-5/boss.ron new file mode 100644 index 0000000000..98c2fcb547 --- /dev/null +++ b/assets/common/loot_tables/dungeon/tier-5/boss.ron @@ -0,0 +1,4 @@ +[ + (1.0, LootTable("common.loot_tables.creature.biped_large.mindflayer")), + (3.0, LootTable("common.loot_tables.miniboss")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/dungeon/tier-5/enemy.ron b/assets/common/loot_tables/dungeon/tier-5/enemy.ron new file mode 100644 index 0000000000..df769bd445 --- /dev/null +++ b/assets/common/loot_tables/dungeon/tier-5/enemy.ron @@ -0,0 +1,6 @@ +[ + (1.0, LootTable("common.loot_tables.humanoids")), + (1.0, LootTable("common.loot_tables.weapons.tier-5")), + (3.0, LootTable("common.loot_tables.cultists")), + (5.0, Item("common.items.food.cheese")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/sprite/chest-buried.ron b/assets/common/loot_tables/sprite/chest-buried.ron new file mode 100644 index 0000000000..1d6ae13b6f --- /dev/null +++ b/assets/common/loot_tables/sprite/chest-buried.ron @@ -0,0 +1,6 @@ +[ + (1.0, LootTable("common.loot_tables.weapons.tier-1")), + (1.0, LootTable("common.loot_tables.armor.cloth")), + (1.0, LootTable("common.loot_tables.armor.swift")), + (1.0, LootTable("common.loot_tables.fallback")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/sprite/chest.ron b/assets/common/loot_tables/sprite/chest.ron new file mode 100644 index 0000000000..98f99d2ec4 --- /dev/null +++ b/assets/common/loot_tables/sprite/chest.ron @@ -0,0 +1,8 @@ +[ + (1.0, LootTable("common.loot_tables.weapons.tier-0")), + (1.0, LootTable("common.loot_tables.weapons.tier-1")), + (1.0, LootTable("common.loot_tables.armor.cloth")), + (1.0, LootTable("common.loot_tables.armor.swift")), + (0.1, LootTable("common.loot_tables.armor.plate")), + (1.0, LootTable("common.loot_tables.fallback")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/sprite/crate.ron b/assets/common/loot_tables/sprite/crate.ron new file mode 100644 index 0000000000..a2b2cc9f74 --- /dev/null +++ b/assets/common/loot_tables/sprite/crate.ron @@ -0,0 +1,4 @@ +[ + (1.0, LootTable("common.loot_tables.materials.common")), + (2.0, LootTable("common.loot_tables.food.prepared")), +] \ No newline at end of file diff --git a/assets/common/loot_tables/sprite/mud.ron b/assets/common/loot_tables/sprite/mud.ron new file mode 100644 index 0000000000..74779a5e51 --- /dev/null +++ b/assets/common/loot_tables/sprite/mud.ron @@ -0,0 +1,6 @@ +[ + (1.0, LootTable("common.loot_tables.materials.common")), + (1.0, LootTable("common.loot_tables.weapons.tier-0")), + (1.0, LootTable("common.loot_tables.materials.underground")), + (1.0, LootTable("common.loot_tables.fallback")), +] \ No newline at end of file diff --git a/assets/voxygen/voxel/sprite_manifest.ron b/assets/voxygen/voxel/sprite_manifest.ron index 296dcefae6..1afc97ac66 100644 --- a/assets/voxygen/voxel/sprite_manifest.ron +++ b/assets/voxygen/voxel/sprite_manifest.ron @@ -2190,7 +2190,7 @@ GrassBlue: Some(( wind_sway: 1.0, )), // Underwater Chests -ChestBurried: Some(( +ChestBuried: Some(( variations: [ ( model: "voxygen.voxel.sprite.underwater_chests.chest_skull", diff --git a/common/src/bin/csv_export/main.rs b/common/src/bin/csv_export/main.rs index 60437b6716..8ed25823cf 100644 --- a/common/src/bin/csv_export/main.rs +++ b/common/src/bin/csv_export/main.rs @@ -254,9 +254,6 @@ fn loot_table(loot_table: &str) -> Result<(), Box> { LootSpec::LootTable(table) => { wtr.write_record(&[&chance, "LootTable", table, "", ""])? }, - LootSpec::CreatureMaterial => { - wtr.write_record(&[&chance, "CreatureMaterial", "", "", ""])? - }, } } diff --git a/common/src/bin/csv_import/main.rs b/common/src/bin/csv_import/main.rs index ba11f9aab0..7755dd2ed6 100644 --- a/common/src/bin/csv_import/main.rs +++ b/common/src/bin/csv_import/main.rs @@ -403,7 +403,6 @@ fn loot_table(loot_table: &str) -> Result<(), Box> { .expect("No loot table") .to_string(), ), - "CreatureMaterial" => LootSpec::CreatureMaterial, a => panic!( "Loot specifier kind must be either \"Item\" or \"LootTable\"\n{}", a diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index 5abf28e23d..d1f124f184 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -16,7 +16,6 @@ pub mod theropod; use crate::{ assets::{self, Asset}, - comp::Item, make_case_elim, npc::NpcKind, }; @@ -583,30 +582,6 @@ impl Body { _ => Vec3::unit_z(), } } - - pub fn get_material(&self) -> Item { - Item::new_from_asset_expect(match self { - Body::QuadrupedSmall(_) => "common.items.crafting_ing.leather_scraps", - Body::QuadrupedMedium(b) => match b.species { - quadruped_medium::Species::Frostfang | quadruped_medium::Species::Roshwalr => { - "common.items.crafting_ing.icy_fang" - }, - _ => "common.items.crafting_ing.leather_scraps", - }, - Body::Theropod(b) => match b.species { - theropod::Species::Sandraptor - | theropod::Species::Snowraptor - | theropod::Species::Woodraptor => "common.items.crafting_ing.raptor_feather", - _ => "common.items.crafting_ing.leather_scraps", - }, - Body::BipedLarge(b) => match b.species { - biped_large::Species::Troll => "common.items.crafting_ing.leather_troll", - biped_large::Species::Wendigo => "common.items.crafting_ing.icy_fang", - _ => "common.items.food.cheese", - }, - _ => "common.items.food.cheese", - }) - } } impl Component for Body { diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index d844ab0a20..9b9fea40f2 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -19,7 +19,6 @@ use crate::{ }; use core::mem; use crossbeam_utils::atomic::AtomicCell; -use rand::prelude::*; use serde::{Deserialize, Serialize}; use specs::{Component, DerefFlaggedStorage}; use specs_idvs::IdvStorage; @@ -579,7 +578,6 @@ impl Item { pub fn try_reclaim_from_block(block: Block) -> Option { let chosen; - let mut rng = rand::thread_rng(); Some(Item::new_from_asset_expect(match block.get_sprite()? { SpriteKind::Apple => "common.items.food.apple", SpriteKind::Mushroom => "common.items.food.mushroom", @@ -601,44 +599,21 @@ impl Item { // Containers // IMPORTANT: Add any new container to `SpriteKind::is_container` SpriteKind::Chest => { - chosen = Lottery::::load_expect(match rng.gen_range(0..7) { - 0 => "common.loot_tables.weapons.tier-0", - 1 => "common.loot_tables.weapons.tier-1", - 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)); + chosen = Lottery::::load_expect("common.loot_tables.sprite.chest").read(); + return Some(chosen.choose().to_item()); }, - SpriteKind::ChestBurried => { - chosen = Lottery::::load_expect(match rng.gen_range(0..7) { - 1 => "common.loot_tables.weapons.tier-1", - 2 => "common.loot_tables.armor.swift", - 3 => "common.loot_tables.armor.cloth", - _ => "common.loot_tables.fallback", - }) - .read(); - return Some(chosen.choose().to_item(None)); + SpriteKind::ChestBuried => { + chosen = Lottery::::load_expect("common.loot_tables.sprite.chest-buried") + .read(); + return Some(chosen.choose().to_item()); }, SpriteKind::Mud => { - chosen = Lottery::::load_expect(match rng.gen_range(0..5) { - 0 => "common.loot_tables.materials.common", - 1 => "common.loot_tables.weapons.tier-0", - 2 => "common.loot_tables.materials.underground", - _ => "common.loot_tables.fallback", - }) - .read(); - return Some(chosen.choose().to_item(None)); + chosen = Lottery::::load_expect("common.loot_tables.sprite.mud").read(); + return Some(chosen.choose().to_item()); }, SpriteKind::Crate => { - chosen = Lottery::::load_expect(match rng.gen_range(0..4) { - 0 => "common.loot_tables.materials.common", - _ => "common.loot_tables.food.prepared", - }) - .read(); - return Some(chosen.choose().to_item(None)); + chosen = Lottery::::load_expect("common.loot_tables.sprite.crate").read(); + return Some(chosen.choose().to_item()); }, SpriteKind::Beehive => "common.items.crafting_ing.honey", diff --git a/common/src/comp/inventory/trade_pricing.rs b/common/src/comp/inventory/trade_pricing.rs index 28a9f9fcaa..2d23d461d2 100644 --- a/common/src/comp/inventory/trade_pricing.rs +++ b/common/src/comp/inventory/trade_pricing.rs @@ -68,7 +68,6 @@ impl From> for ProbabilityFile { .collect::>() .into_iter() }, - LootSpec::CreatureMaterial => vec![].into_iter(), }) .collect(), } diff --git a/common/src/lottery.rs b/common/src/lottery.rs index abe77d12b8..1bfa155472 100644 --- a/common/src/lottery.rs +++ b/common/src/lottery.rs @@ -28,7 +28,7 @@ use crate::{ assets::{self, AssetExt}, - comp::{Body, Item}, + comp::Item, }; use rand::prelude::*; use serde::{de::DeserializeOwned, Deserialize, Serialize}; @@ -83,30 +83,23 @@ pub enum LootSpec { ItemQuantity(String, u32, u32), /// Loot table LootTable(String), - /// Matches on species to provide a crafting material - CreatureMaterial, } impl LootSpec { - #[allow(unused_must_use)] - pub fn to_item(&self, body: Option) -> Item { + pub fn to_item(&self) -> Item { match self { Self::Item(item) => Item::new_from_asset_expect(&item), Self::ItemQuantity(item, lower, upper) => { let range = *lower..=*upper; let quantity = thread_rng().gen_range(range); let mut item = Item::new_from_asset_expect(&item); - item.set_amount(quantity); + let _ = item.set_amount(quantity); item }, Self::LootTable(table) => Lottery::::load_expect(&table) .read() .choose() - .to_item(body), - Self::CreatureMaterial => body.map_or( - Item::new_from_asset_expect("common.items.food.cheese"), - |b| b.get_material(), - ), + .to_item(), } } } @@ -164,9 +157,6 @@ mod tests { let loot_table = Lottery::::load_expect_cloned(&loot_table); validate_table_contents(loot_table); }, - LootSpec::CreatureMaterial => { - item.to_item(None); - }, } } } diff --git a/common/src/terrain/sprite.rs b/common/src/terrain/sprite.rs index 14658221f2..4d3fdd77f7 100644 --- a/common/src/terrain/sprite.rs +++ b/common/src/terrain/sprite.rs @@ -105,7 +105,7 @@ make_case_elim!( VialEmpty = 0x4E, PotionMinor = 0x4F, GrassBlue = 0x50, - ChestBurried = 0x51, + ChestBuried = 0x51, Mud = 0x52, FireBowlGround = 0x53, CaveMushroom = 0x54, @@ -182,7 +182,7 @@ impl SpriteKind { SpriteKind::WardrobeDouble => 3.0, SpriteKind::Pot => 0.90, SpriteKind::Mud => 0.36, - SpriteKind::ChestBurried => 0.91, + SpriteKind::ChestBuried => 0.91, SpriteKind::StonyCoral => 1.4, // TODO: Find suitable heights. SpriteKind::BarrelCactus @@ -233,7 +233,7 @@ impl SpriteKind { SpriteKind::VialEmpty => true, SpriteKind::PotionMinor => true, SpriteKind::Bowl => true, - SpriteKind::ChestBurried => true, + SpriteKind::ChestBuried => true, SpriteKind::Mud => true, SpriteKind::Seashells => true, _ => false, @@ -244,7 +244,7 @@ impl SpriteKind { pub fn is_container(&self) -> bool { matches!( self, - SpriteKind::Chest | SpriteKind::ChestBurried | SpriteKind::Mud | SpriteKind::Crate, + SpriteKind::Chest | SpriteKind::ChestBuried | SpriteKind::Mud | SpriteKind::Crate, ) } diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 36109fb1bc..4269a6f08a 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -1,6 +1,9 @@ use crate::{ client::Client, - comp::{biped_large, quadruped_low, quadruped_small, skills::SkillGroupKind, PhysicsState}, + comp::{ + biped_large, quadruped_low, quadruped_medium, quadruped_small, skills::SkillGroupKind, + theropod, PhysicsState, + }, rtsim::RtSim, Server, SpawnPoint, StateExt, }; @@ -28,7 +31,6 @@ use common::{ use common_net::{msg::ServerGeneral, sync::WorldSyncExt}; use common_sys::state::BlockChange; use hashbrown::HashSet; -use rand::prelude::*; use specs::{join::Join, saveload::MarkerAllocator, Entity as EcsEntity, WorldExt}; use tracing::error; use vek::{Vec2, Vec3}; @@ -338,77 +340,56 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc // Decide for a loot drop before turning into a lootbag let old_body = state.ecs().write_storage::().remove(entity); - let mut rng = rand::thread_rng(); - let mut lottery = || { + let lottery = || { Lottery::::load_expect(match old_body { - Some(common::comp::Body::Humanoid(_)) => match rng.gen_range(0..5) { - 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.armor.swift", - 2 => "common.loot_tables.armor.cloth", - 3 => "common.loot_tables.weapons.starter", - 4 => "common.loot_tables.humanoids", - _ => "common.loot_tables.fallback", - }, + Some(common::comp::Body::Humanoid(_)) => "common.loot_tables.creature.humanoid", Some(common::comp::Body::QuadrupedSmall(quadruped_small)) => { match quadruped_small.species { quadruped_small::Species::Dodarock => { - "common.loot_tables.materials.underground" - }, - _ => match rng.gen_range(0..4) { - 0 => "common.loot_tables.food.wild_ingredients", - _ => "common.loot_tables.wild_animal", + "common.loot_tables.creature.quad_small.dodarock" }, + _ => "common.loot_tables.creature.quad_small.default", } }, - Some(common::comp::Body::QuadrupedMedium(_)) => match rng.gen_range(0..4) { - 0 => "common.loot_tables.food.wild_ingredients", - _ => "common.loot_tables.wild_animal", + Some(Body::QuadrupedMedium(quadruped_medium)) => match quadruped_medium.species { + quadruped_medium::Species::Frostfang | quadruped_medium::Species::Roshwalr => { + "common.loot_tables.creature.quad_medium.ice" + }, + _ => "common.loot_tables.creature.quad_medium.default", }, - Some(common::comp::Body::BirdMedium(_)) => match rng.gen_range(0..3) { - 0 => "common.loot_tables.food.wild_ingredients", - _ => "common.loot_tables.fallback", + Some(common::comp::Body::BirdMedium(_)) => { + "common.loot_tables.creature.bird_medium" }, - Some(common::comp::Body::FishMedium(_)) => "common.loot_tables.fish", - Some(common::comp::Body::FishSmall(_)) => "common.loot_tables.fish", + Some(common::comp::Body::FishMedium(_)) => "common.loot_tables.creature.fish", + Some(common::comp::Body::FishSmall(_)) => "common.loot_tables.creature.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.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.prepared", - 1 => "common.loot_tables.cave_large", - 2 => "common.loot_tables.weapons.tier-2", - _ => "common.loot_tables.wild_animal", + biped_large::Species::Wendigo => { + "common.loot_tables.creature.biped_large.wendigo" }, + biped_large::Species::Troll => "common.loot_tables.creature.biped_large.troll", biped_large::Species::Occultsaurok | biped_large::Species::Mightysaurok - | biped_large::Species::Slysaurok => "common.loot_tables.saurok", - _ => match rng.gen_range(0..3) { - 0 => "common.loot_tables.food.prepared", - _ => "common.loot_tables.cave_large", + | biped_large::Species::Slysaurok => { + "common.loot_tables.creature.biped_large.saurok" }, + _ => "common.loot_tables.creature.biped_large.default", }, - Some(common::comp::Body::Golem(_)) => match rng.gen_range(0..5) { - 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", - 4 => "common.loot_tables.weapons.tier-3", - _ => "common.loot_tables.fallback", + Some(common::comp::Body::Golem(_)) => "common.loot_tables.creature.golem", + Some(common::comp::Body::Theropod(theropod)) => match theropod.species { + theropod::Species::Sandraptor + | theropod::Species::Snowraptor + | theropod::Species::Woodraptor => { + "common.loot_tables.creature.theropod.raptor" + }, + _ => "common.loot_tables.creature.theropod.default", }, - Some(common::comp::Body::Theropod(_)) => "common.loot_tables.wild_animal", - Some(common::comp::Body::Dragon(_)) => "common.loot_tables.weapons.tier-5", + Some(common::comp::Body::Dragon(_)) => "common.loot_tables.creature.dragon", Some(common::comp::Body::QuadrupedLow(quadruped_low)) => { match quadruped_low.species { - quadruped_low::Species::Maneater => "common.loot_tables.maneater", - _ => match rng.gen_range(0..3) { - 0 => "common.loot_tables.food.wild_ingredients", - 1 => "common.loot_tables.wild_animal", - _ => "common.loot_tables.fallback", + quadruped_low::Species::Maneater => { + "common.loot_tables.creature.quad_low.maneater" }, + _ => "common.loot_tables.creature.quad_low.default", } }, _ => "common.loot_tables.fallback", @@ -418,7 +399,7 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc let item = { let mut item_drops = state.ecs().write_storage::(); item_drops.remove(entity).map_or_else( - || lottery().read().choose().to_item(old_body), + || lottery().read().choose().to_item(), |item_drop| item_drop.0, ) }; diff --git a/world/src/layer/scatter.rs b/world/src/layer/scatter.rs index 3c3d03ab1b..be3e34b2be 100644 --- a/world/src/layer/scatter.rs +++ b/world/src/layer/scatter.rs @@ -282,7 +282,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, rng: &mut impl Rng) { ) }), // Underwater chests - (ChestBurried, true, |_, col| { + (ChestBuried, true, |_, col| { ( MUSH_FACT * 1.0e-6 diff --git a/world/src/site/dungeon/mod.rs b/world/src/site/dungeon/mod.rs index 180e777c33..7ee5468d6b 100644 --- a/world/src/site/dungeon/mod.rs +++ b/world/src/site/dungeon/mod.rs @@ -553,54 +553,25 @@ impl Floor { // Bad let chosen = match room.difficulty { 0 => Lottery::::load_expect( - match dynamic_rng.gen_range(0..4) { - 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.armor.cloth", - _ => "common.loot_tables.weapons.tier-0", - }, + "common.loot_tables.dungeon.tier-0.enemy", ), 1 => Lottery::::load_expect( - match dynamic_rng.gen_range(0..4) { - 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.armor.swift", - _ => "common.loot_tables.weapons.tier-1", - }, + "common.loot_tables.dungeon.tier-1.enemy", ), 2 => Lottery::::load_expect( - match dynamic_rng.gen_range(0..4) { - 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.armor.plate", - _ => "common.loot_tables.weapons.tier-2", - }, + "common.loot_tables.dungeon.tier-2.enemy", ), 3 => Lottery::::load_expect( - match dynamic_rng.gen_range(0..10) { - 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.armor.steel", - 2 => "common.loot_tables.weapons.tier-3", - _ => "common.loot_tables.cultists", - }, + "common.loot_tables.dungeon.tier-3.enemy", ), 4 => Lottery::::load_expect( - match dynamic_rng.gen_range(0..6) { - 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.fallback", - 2 => "common.loot_tables.weapons.tier-4", - _ => "common.loot_tables.cultists", - }, + "common.loot_tables.dungeon.tier-4.enemy", ), 5 => Lottery::::load_expect( - match dynamic_rng.gen_range(0..5) { - 0 => "common.loot_tables.humanoids", - 1 => "common.loot_tables.fallback", - 2 => "common.loot_tables.weapons.tier-5", - _ => "common.loot_tables.cultists", - }, + "common.loot_tables.dungeon.tier-5.enemy", ), _ => Lottery::::load_expect("common.loot_tables.fallback"), }; - let chosen = chosen.read(); - let chosen = chosen.choose(); //let is_giant = // RandomField::new(room.seed.wrapping_add(1)).chance(Vec3::from(tile_pos), // 0.2) && !room.boss; @@ -615,181 +586,160 @@ impl Floor { .with_alignment(comp::Alignment::Enemy) .with_loadout_config(loadout_builder::LoadoutConfig::CultistAcolyte) .with_skillset_config(common::skillset_builder::SkillSetConfig::CultistAcolyte) - .with_loot_drop(chosen.to_item(None)) + .with_loot_drop(chosen.read().choose().to_item()) .with_level(dynamic_rng.gen_range((room.difficulty as f32).powf(1.25) + 3.0..(room.difficulty as f32).powf(1.5) + 4.0).round() as u16); let entity = match room.difficulty { - 0 => { - let body = - comp::Body::BipedSmall(comp::biped_small::Body::random_with( + 0 => entity + .with_body(comp::Body::BipedSmall( + comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Gnarling, - )); - entity - .with_body(body) - .with_name("Gnarling") - .with_loadout_config(loadout_builder::LoadoutConfig::Gnarling) - .with_skillset_config( - common::skillset_builder::SkillSetConfig::Gnarling, - ) - .with_loot_drop(chosen.to_item(Some(body))) - .with_main_tool(comp::Item::new_from_asset_expect( - match dynamic_rng.gen_range(0..5) { - 0 => { - "common.items.npc_weapons.biped_small.gnarling.\ - adlet_bow" - }, - 1 => { - "common.items.npc_weapons.biped_small.gnarling.\ - gnoll_staff" - }, - _ => { - "common.items.npc_weapons.biped_small.gnarling.\ - wooden_spear" - }, + ), + )) + .with_name("Gnarling") + .with_loadout_config(loadout_builder::LoadoutConfig::Gnarling) + .with_skillset_config( + common::skillset_builder::SkillSetConfig::Gnarling, + ) + .with_loot_drop(chosen.read().choose().to_item()) + .with_main_tool(comp::Item::new_from_asset_expect( + match dynamic_rng.gen_range(0..5) { + 0 => { + "common.items.npc_weapons.biped_small.gnarling.\ + adlet_bow" }, - )) - }, - 1 => { - let body = - comp::Body::BipedSmall(comp::biped_small::Body::random_with( + 1 => { + "common.items.npc_weapons.biped_small.gnarling.\ + gnoll_staff" + }, + _ => { + "common.items.npc_weapons.biped_small.gnarling.\ + wooden_spear" + }, + }, + )), + 1 => entity + .with_body(comp::Body::BipedSmall( + comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Adlet, - )); - entity - .with_body(body) - .with_name("Adlet") - .with_loadout_config(loadout_builder::LoadoutConfig::Adlet) - .with_skillset_config( - common::skillset_builder::SkillSetConfig::Adlet, - ) - .with_loot_drop(chosen.to_item(Some(body))) - .with_main_tool(comp::Item::new_from_asset_expect( - match dynamic_rng.gen_range(0..5) { - 0 => { - "common.items.npc_weapons.biped_small.adlet.\ - adlet_bow" - }, - 1 => { - "common.items.npc_weapons.biped_small.adlet.\ - gnoll_staff" - }, - _ => { - "common.items.npc_weapons.biped_small.adlet.\ - wooden_spear" - }, + ), + )) + .with_name("Adlet") + .with_loadout_config(loadout_builder::LoadoutConfig::Adlet) + .with_skillset_config( + common::skillset_builder::SkillSetConfig::Adlet, + ) + .with_loot_drop(chosen.read().choose().to_item()) + .with_main_tool(comp::Item::new_from_asset_expect( + match dynamic_rng.gen_range(0..5) { + 0 => "common.items.npc_weapons.biped_small.adlet.adlet_bow", + 1 => { + "common.items.npc_weapons.biped_small.adlet.gnoll_staff" }, - )) - }, - 2 => { - let body = - comp::Body::BipedSmall(comp::biped_small::Body::random_with( + _ => { + "common.items.npc_weapons.biped_small.adlet.\ + wooden_spear" + }, + }, + )), + 2 => entity + .with_body(comp::Body::BipedSmall( + comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Sahagin, - )); - entity - .with_body(body) - .with_name("Sahagin") - .with_loadout_config(loadout_builder::LoadoutConfig::Sahagin) - .with_skillset_config( - common::skillset_builder::SkillSetConfig::Sahagin, - ) - .with_loot_drop(chosen.to_item(Some(body))) - .with_main_tool(comp::Item::new_from_asset_expect( - match dynamic_rng.gen_range(0..5) { - 0 => { - "common.items.npc_weapons.biped_small.sahagin.\ - adlet_bow" - }, - 1 => { - "common.items.npc_weapons.biped_small.sahagin.\ - gnoll_staff" - }, - _ => { - "common.items.npc_weapons.biped_small.sahagin.\ - wooden_spear" - }, + ), + )) + .with_name("Sahagin") + .with_loadout_config(loadout_builder::LoadoutConfig::Sahagin) + .with_skillset_config( + common::skillset_builder::SkillSetConfig::Sahagin, + ) + .with_loot_drop(chosen.read().choose().to_item()) + .with_main_tool(comp::Item::new_from_asset_expect( + match dynamic_rng.gen_range(0..5) { + 0 => { + "common.items.npc_weapons.biped_small.sahagin.adlet_bow" }, - )) - }, - 3 => { - let body = - comp::Body::BipedSmall(comp::biped_small::Body::random_with( + 1 => { + "common.items.npc_weapons.biped_small.sahagin.\ + gnoll_staff" + }, + _ => { + "common.items.npc_weapons.biped_small.sahagin.\ + wooden_spear" + }, + }, + )), + 3 => entity + .with_body(comp::Body::BipedSmall( + comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Haniwa, - )); - entity - .with_body(body) - .with_name("Haniwa") - .with_loadout_config(loadout_builder::LoadoutConfig::Haniwa) - .with_skillset_config( - common::skillset_builder::SkillSetConfig::Haniwa, - ) - .with_loot_drop(chosen.to_item(Some(body))) - .with_main_tool(comp::Item::new_from_asset_expect( - match dynamic_rng.gen_range(0..5) { - 0 => { - "common.items.npc_weapons.biped_small.haniwa.\ - adlet_bow" - }, - 1 => { - "common.items.npc_weapons.biped_small.haniwa.\ - gnoll_staff" - }, - _ => { - "common.items.npc_weapons.biped_small.haniwa.\ - wooden_spear" - }, + ), + )) + .with_name("Haniwa") + .with_loadout_config(loadout_builder::LoadoutConfig::Haniwa) + .with_skillset_config( + common::skillset_builder::SkillSetConfig::Haniwa, + ) + .with_loot_drop(chosen.read().choose().to_item()) + .with_main_tool(comp::Item::new_from_asset_expect( + match dynamic_rng.gen_range(0..5) { + 0 => { + "common.items.npc_weapons.biped_small.haniwa.adlet_bow" }, - )) - }, - 4 => { - let body = - comp::Body::BipedSmall(comp::biped_small::Body::random_with( + 1 => { + "common.items.npc_weapons.biped_small.haniwa.\ + gnoll_staff" + }, + _ => { + "common.items.npc_weapons.biped_small.haniwa.\ + wooden_spear" + }, + }, + )), + 4 => entity + .with_body(comp::Body::BipedSmall( + comp::biped_small::Body::random_with( dynamic_rng, &comp::biped_small::Species::Myrmidon, - )); - entity - .with_body(body) - .with_name("Myrmidon") - .with_loadout_config(loadout_builder::LoadoutConfig::Myrmidon) - .with_skillset_config( - common::skillset_builder::SkillSetConfig::Myrmidon, - ) - .with_loot_drop(chosen.to_item(Some(body))) - .with_main_tool(comp::Item::new_from_asset_expect( - match dynamic_rng.gen_range(0..5) { - 0 => { - "common.items.npc_weapons.biped_small.myrmidon.\ - adlet_bow" - }, - 1 => { - "common.items.npc_weapons.biped_small.myrmidon.\ - gnoll_staff" - }, - _ => { - "common.items.npc_weapons.biped_small.myrmidon.\ - wooden_spear" - }, + ), + )) + .with_name("Myrmidon") + .with_loadout_config(loadout_builder::LoadoutConfig::Myrmidon) + .with_skillset_config( + common::skillset_builder::SkillSetConfig::Myrmidon, + ) + .with_loot_drop(chosen.read().choose().to_item()) + .with_main_tool(comp::Item::new_from_asset_expect( + match dynamic_rng.gen_range(0..5) { + 0 => { + "common.items.npc_weapons.biped_small.myrmidon.\ + adlet_bow" }, - )) - }, + 1 => { + "common.items.npc_weapons.biped_small.myrmidon.\ + gnoll_staff" + }, + _ => { + "common.items.npc_weapons.biped_small.myrmidon.\ + wooden_spear" + }, + }, + )), 5 => match dynamic_rng.gen_range(0..6) { - 0 => { - let body = comp::Body::Humanoid(comp::humanoid::Body::random()); - entity - .with_body(body) - .with_name("Cultist Warlock") - .with_loadout_config( - loadout_builder::LoadoutConfig::Warlock, - ) - .with_skillset_config( - common::skillset_builder::SkillSetConfig::Warlock, - ) - .with_loot_drop(chosen.to_item(Some(body))) - .with_main_tool(comp::Item::new_from_asset_expect( - "common.items.weapons.staff.cultist_staff", - )) - }, + 0 => entity + .with_body(comp::Body::Humanoid(comp::humanoid::Body::random())) + .with_name("Cultist Warlock") + .with_loadout_config(loadout_builder::LoadoutConfig::Warlock) + .with_skillset_config( + common::skillset_builder::SkillSetConfig::Warlock, + ) + .with_loot_drop(chosen.read().choose().to_item()) + .with_main_tool(comp::Item::new_from_asset_expect( + "common.items.weapons.staff.cultist_staff", + )), 1 => entity .with_body(comp::Body::Object(comp::object::Body::Crossbow)) .with_name("Possessed Turret".to_string()) @@ -802,7 +752,7 @@ impl Floor { .with_skillset_config( common::skillset_builder::SkillSetConfig::Warlord, ) - .with_loot_drop(chosen.to_item(None)) + .with_loot_drop(chosen.read().choose().to_item()) .with_main_tool(comp::Item::new_from_asset_expect( match dynamic_rng.gen_range(0..5) { 0 => "common.items.weapons.axe.malachite_axe-0", @@ -853,10 +803,7 @@ impl Floor { "common.loot_tables.weapons.tier-4", ), 5 => Lottery::::load_expect( - match dynamic_rng.gen_range(0..3) { - 0 => "common.loot_tables.mindflayer", - _ => "common.loot_tables.miniboss", - }, + "common.loot_tables.dungeon.tier-5.boss", ), _ => { Lottery::::load_expect("common.loot_tables.fallback") @@ -866,85 +813,81 @@ impl Floor { let chosen = chosen.choose(); let entity = match room.difficulty { 0 => { - let body = comp::Body::BipedLarge( - comp::biped_large::Body::random_with( - dynamic_rng, - &comp::biped_large::Species::Harvester, - ), - ); vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(body) + .with_body(comp::Body::BipedLarge( + comp::biped_large::Body::random_with( + dynamic_rng, + &comp::biped_large::Species::Harvester, + ), + )) .with_name("Harvester".to_string()) - .with_loot_drop(chosen.to_item(Some(body))), + .with_loot_drop(chosen.to_item()), ] }, 1 => { - let body = comp::Body::BipedLarge( - comp::biped_large::Body::random_with( - dynamic_rng, - &comp::biped_large::Species::Yeti, - ), - ); vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(body) + .with_body(comp::Body::BipedLarge( + comp::biped_large::Body::random_with( + dynamic_rng, + &comp::biped_large::Species::Yeti, + ), + )) .with_name("Yeti".to_string()) - .with_loot_drop(chosen.to_item(Some(body))), + .with_loot_drop(chosen.to_item()), ] }, 2 => { - let body = comp::Body::BipedLarge( - comp::biped_large::Body::random_with( - dynamic_rng, - &comp::biped_large::Species::Tidalwarrior, - ), - ); vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(body) + .with_body(comp::Body::BipedLarge( + comp::biped_large::Body::random_with( + dynamic_rng, + &comp::biped_large::Species::Tidalwarrior, + ), + )) .with_name("Tidal Warrior".to_string()) - .with_loot_drop(chosen.to_item(Some(body))), + .with_loot_drop(chosen.to_item()), ] }, 3 => { - let body = comp::Body::Golem(comp::golem::Body::random_with( - dynamic_rng, - &comp::golem::Species::ClayGolem, - )); vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(body) + .with_body(comp::Body::Golem( + comp::golem::Body::random_with( + dynamic_rng, + &comp::golem::Species::ClayGolem, + ), + )) .with_name("Clay Golem".to_string()) - .with_loot_drop(chosen.to_item(Some(body))), + .with_loot_drop(chosen.to_item()), ] }, 4 => { - let body = comp::Body::BipedLarge( - comp::biped_large::Body::random_with( - dynamic_rng, - &comp::biped_large::Species::Minotaur, - ), - ); vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(body) + .with_body(comp::Body::BipedLarge( + comp::biped_large::Body::random_with( + dynamic_rng, + &comp::biped_large::Species::Minotaur, + ), + )) .with_name("Minotaur".to_string()) - .with_loot_drop(chosen.to_item(Some(body))), + .with_loot_drop(chosen.to_item()), ] }, 5 => { - let body = comp::Body::BipedLarge( - comp::biped_large::Body::random_with( - dynamic_rng, - &comp::biped_large::Species::Mindflayer, - ), - ); vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(body) + .with_body(comp::Body::BipedLarge( + comp::biped_large::Body::random_with( + dynamic_rng, + &comp::biped_large::Species::Mindflayer, + ), + )) .with_name("Mindflayer".to_string()) - .with_loot_drop(chosen.to_item(Some(body))) + .with_loot_drop(chosen.to_item()) .with_skillset_config( common::skillset_builder::SkillSetConfig::Mindflayer, ), @@ -997,13 +940,13 @@ impl Floor { if tile_pos == miniboss_spawn_tile && tile_wcenter.xy() == wpos2d { let chosen = match room.difficulty { 0 => Lottery::::load_expect( - "common.loot_tables.wild_animal", + "common.loot_tables.weapons.tier-0", ), 1 => Lottery::::load_expect( - "common.loot_tables.wild_animal", + "common.loot_tables.weapons.tier-1", ), 2 => Lottery::::load_expect( - "common.loot_tables.wild_animal", + "common.loot_tables.weapons.tier-2", ), 3 => Lottery::::load_expect( "common.loot_tables.weapons.tier-3", @@ -1011,71 +954,63 @@ impl Floor { 4 => Lottery::::load_expect( "common.loot_tables.weapons.tier-4", ), - 5 => Lottery::::load_expect("common.loot_tables.cultist"), + 5 => { + Lottery::::load_expect("common.loot_tables.cultists") + }, _ => { Lottery::::load_expect("common.loot_tables.fallback") }, }; let entity = match room.difficulty { 0 => { - let body = comp::Body::QuadrupedMedium( - comp::quadruped_medium::Body::random_with( - dynamic_rng, - &comp::quadruped_medium::Species::Bonerattler, - ), - ); vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(body) + .with_body(comp::Body::QuadrupedMedium( + comp::quadruped_medium::Body::random_with( + dynamic_rng, + &comp::quadruped_medium::Species::Bonerattler, + ), + )) .with_name("Bonerattler".to_string()) - .with_loot_drop( - chosen.read().choose().to_item(Some(body)), - ), + .with_loot_drop(chosen.read().choose().to_item()), ] }, 1 => { - let body = comp::Body::QuadrupedMedium( - comp::quadruped_medium::Body::random_with( - dynamic_rng, - &comp::quadruped_medium::Species::Bonerattler, - ), - ); vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(body) + .with_body(comp::Body::QuadrupedMedium( + comp::quadruped_medium::Body::random_with( + dynamic_rng, + &comp::quadruped_medium::Species::Bonerattler, + ), + )) .with_name("Bonerattler".to_string()) - .with_loot_drop( - chosen.read().choose().to_item(Some(body)) - ); + .with_loot_drop(chosen.read().choose().to_item()); 3 ] }, 2 => { let mut entities = Vec::new(); - let body = comp::Body::QuadrupedLow( - comp::quadruped_low::Body::random_with( - dynamic_rng, - &comp::quadruped_low::Species::Hakulaq, - ), - ); entities.resize_with(6, || { EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(body) + .with_body(comp::Body::QuadrupedLow( + comp::quadruped_low::Body::random_with( + dynamic_rng, + &comp::quadruped_low::Species::Hakulaq, + ), + )) .with_name("Hakulaq".to_string()) - .with_loot_drop( - chosen.read().choose().to_item(Some(body)), - ) + .with_loot_drop(chosen.read().choose().to_item()) }); entities }, 3 => { let mut entities = Vec::new(); - let body = comp::Body::Humanoid(comp::humanoid::Body::random()); entities.push( EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(body) + .with_body(comp::Body::Humanoid(comp::humanoid::Body::random())) .with_name("Animal Trainer".to_string()) - .with_loot_drop(chosen.read().choose().to_item(Some(body))) + .with_loot_drop(chosen.read().choose().to_item()) .with_loadout_config(loadout_builder::LoadoutConfig::CultistAcolyte) .with_skillset_config( common::skillset_builder::SkillSetConfig::CultistAcolyte @@ -1092,53 +1027,44 @@ impl Floor { }, )), ); - let body = comp::Body::QuadrupedMedium( - comp::quadruped_medium::Body::random_with( - dynamic_rng, - &comp::quadruped_medium::Species::Darkhound, - ), - ); entities.resize_with(entities.len() + 2, || { EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(body) + .with_body(comp::Body::QuadrupedMedium( + comp::quadruped_medium::Body::random_with( + dynamic_rng, + &comp::quadruped_medium::Species::Darkhound, + ), + )) .with_name("Tamed Darkhound".to_string()) - .with_loot_drop( - chosen.read().choose().to_item(Some(body)), - ) + .with_loot_drop(chosen.read().choose().to_item()) }); entities }, 4 => { - let body = comp::Body::BipedLarge( - comp::biped_large::Body::random_with( - dynamic_rng, - &comp::biped_large::Species::Dullahan, - ), - ); vec![ EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(body) + .with_body(comp::Body::BipedLarge( + comp::biped_large::Body::random_with( + dynamic_rng, + &comp::biped_large::Species::Dullahan, + ), + )) .with_name("Dullahan Guard".to_string()) - .with_loot_drop( - chosen.read().choose().to_item(Some(body)), - ), + .with_loot_drop(chosen.read().choose().to_item()), ] }, 5 => { - let body = comp::Body::BipedSmall( - comp::biped_small::Body::random_with( - dynamic_rng, - &comp::biped_small::Species::Husk, - ), - ); let mut entities = Vec::new(); entities.resize_with(10, || { EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_body(body) + .with_body(comp::Body::BipedSmall( + comp::biped_small::Body::random_with( + dynamic_rng, + &comp::biped_small::Species::Husk, + ), + )) .with_name("Cultist Husk".to_string()) - .with_loot_drop( - chosen.read().choose().to_item(Some(body)), - ) + .with_loot_drop(chosen.read().choose().to_item()) .with_loadout_config( loadout_builder::LoadoutConfig::Husk, )