From 718c5b88f493a268e3f914d99b72858d3f7ed914 Mon Sep 17 00:00:00 2001 From: juliancoffee Date: Mon, 24 May 2021 22:55:30 +0300 Subject: [PATCH 1/5] Adding different chests for each dungeon --- .../loot_tables/dungeon/tier-0/chest.ron | 8 ++ .../loot_tables/dungeon/tier-1/chest.ron | 8 ++ .../loot_tables/dungeon/tier-2/chest.ron | 8 ++ .../loot_tables/dungeon/tier-3/chest.ron | 8 ++ .../loot_tables/dungeon/tier-4/chest.ron | 8 ++ .../loot_tables/dungeon/tier-5/chest.ron | 8 ++ assets/voxygen/voxel/sprite_manifest.ron | 62 ++++++++++++ common/src/comp/inventory/item/mod.rs | 96 ++++++++++++++----- common/src/terrain/sprite.rs | 35 ++++++- world/src/site/dungeon/mod.rs | 10 +- 10 files changed, 227 insertions(+), 24 deletions(-) create mode 100644 assets/common/loot_tables/dungeon/tier-0/chest.ron create mode 100644 assets/common/loot_tables/dungeon/tier-1/chest.ron create mode 100644 assets/common/loot_tables/dungeon/tier-2/chest.ron create mode 100644 assets/common/loot_tables/dungeon/tier-3/chest.ron create mode 100644 assets/common/loot_tables/dungeon/tier-4/chest.ron create mode 100644 assets/common/loot_tables/dungeon/tier-5/chest.ron diff --git a/assets/common/loot_tables/dungeon/tier-0/chest.ron b/assets/common/loot_tables/dungeon/tier-0/chest.ron new file mode 100644 index 0000000000..98f99d2ec4 --- /dev/null +++ b/assets/common/loot_tables/dungeon/tier-0/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/dungeon/tier-1/chest.ron b/assets/common/loot_tables/dungeon/tier-1/chest.ron new file mode 100644 index 0000000000..98f99d2ec4 --- /dev/null +++ b/assets/common/loot_tables/dungeon/tier-1/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/dungeon/tier-2/chest.ron b/assets/common/loot_tables/dungeon/tier-2/chest.ron new file mode 100644 index 0000000000..98f99d2ec4 --- /dev/null +++ b/assets/common/loot_tables/dungeon/tier-2/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/dungeon/tier-3/chest.ron b/assets/common/loot_tables/dungeon/tier-3/chest.ron new file mode 100644 index 0000000000..98f99d2ec4 --- /dev/null +++ b/assets/common/loot_tables/dungeon/tier-3/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/dungeon/tier-4/chest.ron b/assets/common/loot_tables/dungeon/tier-4/chest.ron new file mode 100644 index 0000000000..98f99d2ec4 --- /dev/null +++ b/assets/common/loot_tables/dungeon/tier-4/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/dungeon/tier-5/chest.ron b/assets/common/loot_tables/dungeon/tier-5/chest.ron new file mode 100644 index 0000000000..98f99d2ec4 --- /dev/null +++ b/assets/common/loot_tables/dungeon/tier-5/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/voxygen/voxel/sprite_manifest.ron b/assets/voxygen/voxel/sprite_manifest.ron index 4e2b11a7cd..0e997614ec 100644 --- a/assets/voxygen/voxel/sprite_manifest.ron +++ b/assets/voxygen/voxel/sprite_manifest.ron @@ -671,6 +671,68 @@ Chest: Some(( wind_sway: 0.0, )), +// Dungeon Chests +DungeonChest0: Some(( + variations: [ + ( + model: "voxygen.voxel.sprite.chests.chest_vines", + offset: (-7.0, -5.0, -0.0), + lod_axes: (1.0, 1.0, 1.0), + ), + ], + wind_sway: 0.0, +)), +DungeonChest1: Some(( + variations: [ + ( + model: "voxygen.voxel.sprite.chests.chest_skull", + offset: (-7.0, -5.0, -0.0), + lod_axes: (1.0, 1.0, 1.0), + ), + ], + wind_sway: 0.0, +)), +DungeonChest2: Some(( + variations: [ + ( + model: "voxygen.voxel.sprite.chests.chest_light", + offset: (-7.0, -5.0, -0.0), + lod_axes: (1.0, 1.0, 1.0), + ), + ], + wind_sway: 0.0, +)), +DungeonChest3: Some(( + variations: [ + ( + model: "voxygen.voxel.sprite.chests.chest_gold", + offset: (-7.0, -5.0, -0.0), + lod_axes: (1.0, 1.0, 1.0), + ), + ], + wind_sway: 0.0, +)), +DungeonChest4: Some(( + variations: [ + ( + model: "voxygen.voxel.sprite.chests.chest_gold", + offset: (-7.0, -5.0, -0.0), + lod_axes: (1.0, 1.0, 1.0), + ), + ], + wind_sway: 0.0, +)), +DungeonChest5: Some(( + variations: [ + ( + model: "voxygen.voxel.sprite.chests.chest_demon", + offset: (-7.0, -5.0, -0.0), + lod_axes: (1.0, 1.0, 1.0), + ), + ], + wind_sway: 0.0, +)), + // Welwitch Welwitch: Some(( variations: [ diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index 83b07c9e0b..bc5aab8cba 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -703,7 +703,6 @@ impl Item { pub fn slot_mut(&mut self, slot: usize) -> Option<&mut InvSlot> { self.slots.get_mut(slot) } pub fn try_reclaim_from_block(block: Block) -> Option { - let chosen; Some(Item::new_from_asset_expect(match block.get_sprite()? { SpriteKind::Apple => "common.items.food.apple", SpriteKind::Mushroom => "common.items.food.mushroom", @@ -721,27 +720,6 @@ impl Item { SpriteKind::MediumGrass => "common.items.grasses.medium", SpriteKind::ShortGrass => "common.items.grasses.short", SpriteKind::Coconut => "common.items.food.coconut", - - // Containers - // IMPORTANT: Add any new container to `SpriteKind::is_container` - SpriteKind::Chest => { - chosen = Lottery::::load_expect("common.loot_tables.sprite.chest").read(); - return Some(chosen.choose().to_item()); - }, - 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("common.loot_tables.sprite.mud").read(); - return Some(chosen.choose().to_item()); - }, - SpriteKind::Crate => { - chosen = Lottery::::load_expect("common.loot_tables.sprite.crate").read(); - return Some(chosen.choose().to_item()); - }, - SpriteKind::Beehive => "common.items.crafting_ing.honey", SpriteKind::Stones => "common.items.crafting_ing.stones", SpriteKind::Twigs => "common.items.crafting_ing.twigs", @@ -761,10 +739,84 @@ impl Item { SpriteKind::EmeraldSmall => "common.items.crafting_ing.emerald", SpriteKind::SapphireSmall => "common.items.crafting_ing.sapphire", SpriteKind::Seashells => "common.items.crafting_ing.seashells", + // Containers + // IMPORTANT: Add any new container to `SpriteKind::is_container` + container @ (SpriteKind::DungeonChest0 + | SpriteKind::DungeonChest1 + | SpriteKind::DungeonChest2 + | SpriteKind::DungeonChest3 + | SpriteKind::DungeonChest4 + | SpriteKind::DungeonChest5 + | SpriteKind::Chest + | SpriteKind::Mud + | SpriteKind::Crate + | SpriteKind::ChestBuried) => { + return Item::from_container(container); + }, _ => return None, })) } + fn from_container(container: SpriteKind) -> Option { + let chosen; + match container { + SpriteKind::DungeonChest0 => { + chosen = + Lottery::::load_expect("common.loot_tables.dungeon.tier-0.chest") + .read(); + return Some(chosen.choose().to_item()); + }, + SpriteKind::DungeonChest1 => { + chosen = + Lottery::::load_expect("common.loot_tables.dungeon.tier-1.chest") + .read(); + return Some(chosen.choose().to_item()); + }, + SpriteKind::DungeonChest2 => { + chosen = + Lottery::::load_expect("common.loot_tables.dungeon.tier-2.chest") + .read(); + return Some(chosen.choose().to_item()); + }, + SpriteKind::DungeonChest3 => { + chosen = + Lottery::::load_expect("common.loot_tables.dungeon.tier-3.chest") + .read(); + return Some(chosen.choose().to_item()); + }, + SpriteKind::DungeonChest4 => { + chosen = + Lottery::::load_expect("common.loot_tables.dungeon.tier-4.chest") + .read(); + return Some(chosen.choose().to_item()); + }, + SpriteKind::DungeonChest5 => { + chosen = + Lottery::::load_expect("common.loot_tables.dungeon.tier-5.chest") + .read(); + return Some(chosen.choose().to_item()); + }, + SpriteKind::Chest => { + chosen = Lottery::::load_expect("common.loot_tables.sprite.chest").read(); + return Some(chosen.choose().to_item()); + }, + 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("common.loot_tables.sprite.mud").read(); + return Some(chosen.choose().to_item()); + }, + SpriteKind::Crate => { + chosen = Lottery::::load_expect("common.loot_tables.sprite.crate").read(); + return Some(chosen.choose().to_item()); + }, + _ => None, + } + } + pub fn ability_spec(&self) -> Option<&AbilitySpec> { self.item_def.ability_spec.as_ref() } } diff --git a/common/src/terrain/sprite.rs b/common/src/terrain/sprite.rs index e967185ba6..4f74e3a9d8 100644 --- a/common/src/terrain/sprite.rs +++ b/common/src/terrain/sprite.rs @@ -148,6 +148,12 @@ make_case_elim!( Cauldron = 0x79, Anvil = 0x7A, CookingPot = 0x7B, + DungeonChest0 = 0x7C, + DungeonChest1 = 0x7D, + DungeonChest2 = 0x7E, + DungeonChest3 = 0x7F, + DungeonChest4 = 0x80, + DungeonChest5 = 0x81, } ); @@ -163,6 +169,12 @@ impl SpriteKind { SpriteKind::Pumpkin => 0.81, SpriteKind::Cabbage => 0.45, SpriteKind::Chest => 1.09, + SpriteKind::DungeonChest0 => 1.09, + SpriteKind::DungeonChest1 => 1.09, + SpriteKind::DungeonChest2 => 1.09, + SpriteKind::DungeonChest3 => 1.09, + SpriteKind::DungeonChest4 => 1.09, + SpriteKind::DungeonChest5 => 1.09, SpriteKind::StreetLamp => 2.65, SpriteKind::Carrot => 0.18, SpriteKind::Radish => 0.18, @@ -235,6 +247,12 @@ impl SpriteKind { // SpriteKind::Velorite => true, // SpriteKind::VeloriteFrag => true, SpriteKind::Chest => true, + SpriteKind::DungeonChest0 => true, + SpriteKind::DungeonChest1 => true, + SpriteKind::DungeonChest2 => true, + SpriteKind::DungeonChest3 => true, + SpriteKind::DungeonChest4 => true, + SpriteKind::DungeonChest5 => true, SpriteKind::Coconut => true, SpriteKind::Stones => true, SpriteKind::Twigs => true, @@ -254,7 +272,16 @@ impl SpriteKind { pub fn is_container(&self) -> bool { matches!( self, - SpriteKind::Chest | SpriteKind::ChestBuried | SpriteKind::Mud | SpriteKind::Crate, + SpriteKind::DungeonChest0 + | SpriteKind::DungeonChest1 + | SpriteKind::DungeonChest2 + | SpriteKind::DungeonChest3 + | SpriteKind::DungeonChest4 + | SpriteKind::DungeonChest5 + | SpriteKind::Chest + | SpriteKind::ChestBuried + | SpriteKind::Mud + | SpriteKind::Crate, ) } @@ -310,6 +337,12 @@ impl SpriteKind { | SpriteKind::WardrobeDouble | SpriteKind::Pot | SpriteKind::Chest + | SpriteKind::DungeonChest0 + | SpriteKind::DungeonChest1 + | SpriteKind::DungeonChest2 + | SpriteKind::DungeonChest3 + | SpriteKind::DungeonChest4 + | SpriteKind::DungeonChest5 | SpriteKind::DropGate | SpriteKind::DropGateBottom | SpriteKind::Door diff --git a/world/src/site/dungeon/mod.rs b/world/src/site/dungeon/mod.rs index cf8dd7e3ae..e55a7fbe50 100644 --- a/world/src/site/dungeon/mod.rs +++ b/world/src/site/dungeon/mod.rs @@ -996,7 +996,15 @@ impl Floor { { let room = &self.rooms[*room]; if RandomField::new(room.seed).chance(Vec3::from(pos), room.loot_density * 0.5) { - BlockMask::new(with_sprite(SpriteKind::Chest), 1) + match room.difficulty { + 0 => BlockMask::new(with_sprite(SpriteKind::DungeonChest0), 1), + 1 => BlockMask::new(with_sprite(SpriteKind::DungeonChest1), 1), + 2 => BlockMask::new(with_sprite(SpriteKind::DungeonChest2), 1), + 3 => BlockMask::new(with_sprite(SpriteKind::DungeonChest3), 1), + 4 => BlockMask::new(with_sprite(SpriteKind::DungeonChest4), 1), + 5 => BlockMask::new(with_sprite(SpriteKind::DungeonChest5), 1), + _ => BlockMask::new(with_sprite(SpriteKind::Chest), 1), + } } else { vacant } From 9bc15c3adf47a73ab19e826d5615b8a68db4cdc7 Mon Sep 17 00:00:00 2001 From: juliancoffee Date: Tue, 25 May 2021 00:20:18 +0300 Subject: [PATCH 2/5] Overhaul loot tables --- assets/common/item_price_calculation.ron | 8 ++++---- assets/common/loot_tables/consumables.ron | 14 -------------- assets/common/loot_tables/consumables/default.ron | 5 +++++ .../loot_tables/{ => consumables}/fireworks.ron | 0 assets/common/loot_tables/consumables/misc.ron | 5 +++++ assets/common/loot_tables/consumables/potions.ron | 6 ++++++ .../common/loot_tables/consumables/throwables.ron | 5 +++++ assets/common/loot_tables/dungeon/tier-0/chest.ron | 7 ++----- .../common/loot_tables/dungeon/tier-0/miniboss.ron | 2 +- assets/common/loot_tables/dungeon/tier-5/enemy.ron | 3 +-- .../common/loot_tables/dungeon/tier-5/minion.ron | 2 +- 11 files changed, 30 insertions(+), 27 deletions(-) delete mode 100644 assets/common/loot_tables/consumables.ron create mode 100644 assets/common/loot_tables/consumables/default.ron rename assets/common/loot_tables/{ => consumables}/fireworks.ron (100%) create mode 100644 assets/common/loot_tables/consumables/misc.ron create mode 100644 assets/common/loot_tables/consumables/potions.ron create mode 100644 assets/common/loot_tables/consumables/throwables.ron diff --git a/assets/common/item_price_calculation.ron b/assets/common/item_price_calculation.ron index 36638b304b..95952696f0 100644 --- a/assets/common/item_price_calculation.ron +++ b/assets/common/item_price_calculation.ron @@ -10,8 +10,8 @@ loot_tables: [ (1.0, false, "common.loot_tables.weapons.tier-4"), (0.5, false, "common.loot_tables.weapons.tier-5"), (0.05, false, "common.loot_tables.weapons.cultist"), - (0.125, false, "common.loot_tables.weapons.cave"), - (0.0625, false, "common.loot_tables.weapons.legendary"), + (0.05, false, "common.loot_tables.weapons.cave"), + (0.04, false, "common.loot_tables.weapons.legendary"), // Armor (20.0, true, "common.loot_tables.armor.cloth"), (6.0, true, "common.loot_tables.armor.agile"), @@ -30,8 +30,8 @@ loot_tables: [ (0.3, true, "common.loot_tables.food.farm_ingredients"), (0.4, true, "common.loot_tables.food.wild_ingredients"), (0.2, true, "common.loot_tables.food.prepared"), - // TODO: Change consumables when they are split up later - (1.0, true, "common.loot_tables.consumables"), + // TODO: Change consumables and split them up + (1.0, true, "common.loot_tables.consumables.default"), (0.5, false, "common.loot_tables.trading"), ], // this is the amount of that good the most common item represents diff --git a/assets/common/loot_tables/consumables.ron b/assets/common/loot_tables/consumables.ron deleted file mode 100644 index ca1bbe4833..0000000000 --- a/assets/common/loot_tables/consumables.ron +++ /dev/null @@ -1,14 +0,0 @@ -[ - // potions - (1.0, Item("common.items.consumable.potion_minor")), - (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")), - // 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/consumables/default.ron b/assets/common/loot_tables/consumables/default.ron new file mode 100644 index 0000000000..e6e0e88af0 --- /dev/null +++ b/assets/common/loot_tables/consumables/default.ron @@ -0,0 +1,5 @@ +[ + (2.0, LootTable("common.loot_tables.consumables.potions")), + (0.5, LootTable("common.loot_tables.consumables.throwables")), + (1.0, LootTable("common.loot_tables.consumables.misc")), +] diff --git a/assets/common/loot_tables/fireworks.ron b/assets/common/loot_tables/consumables/fireworks.ron similarity index 100% rename from assets/common/loot_tables/fireworks.ron rename to assets/common/loot_tables/consumables/fireworks.ron diff --git a/assets/common/loot_tables/consumables/misc.ron b/assets/common/loot_tables/consumables/misc.ron new file mode 100644 index 0000000000..a4f4a71ae7 --- /dev/null +++ b/assets/common/loot_tables/consumables/misc.ron @@ -0,0 +1,5 @@ +[ + // misc + (0.1, Item("common.items.utility.collar")), + (1.0, LootTable("common.loot_tables.consumables.fireworks")), +] diff --git a/assets/common/loot_tables/consumables/potions.ron b/assets/common/loot_tables/consumables/potions.ron new file mode 100644 index 0000000000..75fb6b66ea --- /dev/null +++ b/assets/common/loot_tables/consumables/potions.ron @@ -0,0 +1,6 @@ +[ + // potions + (1.0, Item("common.items.consumable.potion_minor")), + (0.5, Item("common.items.consumable.potion_med")), + (0.2, Item("common.items.consumable.potion_big")), +] diff --git a/assets/common/loot_tables/consumables/throwables.ron b/assets/common/loot_tables/consumables/throwables.ron new file mode 100644 index 0000000000..3fc2ea2b8d --- /dev/null +++ b/assets/common/loot_tables/consumables/throwables.ron @@ -0,0 +1,5 @@ +[ + // bombs + (0.6, Item("common.items.utility.bomb")), + (0.2, Item("common.items.utility.bomb_pile")), +] diff --git a/assets/common/loot_tables/dungeon/tier-0/chest.ron b/assets/common/loot_tables/dungeon/tier-0/chest.ron index 98f99d2ec4..7abbbab30f 100644 --- a/assets/common/loot_tables/dungeon/tier-0/chest.ron +++ b/assets/common/loot_tables/dungeon/tier-0/chest.ron @@ -1,8 +1,5 @@ [ (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 + (1.0, ItemQuantity("common.items.utility.coins", 10, 20)), +] diff --git a/assets/common/loot_tables/dungeon/tier-0/miniboss.ron b/assets/common/loot_tables/dungeon/tier-0/miniboss.ron index c64f6a7c0e..615293ed66 100644 --- a/assets/common/loot_tables/dungeon/tier-0/miniboss.ron +++ b/assets/common/loot_tables/dungeon/tier-0/miniboss.ron @@ -1,5 +1,5 @@ [ (1.0, LootTable("common.loot_tables.armor.cloth")), (2.0, LootTable("common.loot_tables.weapons.tier-0")), - (2.0, LootTable("common.loot_tables.consumables")), + (2.0, LootTable("common.loot_tables.consumables.potions")), ] diff --git a/assets/common/loot_tables/dungeon/tier-5/enemy.ron b/assets/common/loot_tables/dungeon/tier-5/enemy.ron index 3654da6f6e..2bf145da77 100644 --- a/assets/common/loot_tables/dungeon/tier-5/enemy.ron +++ b/assets/common/loot_tables/dungeon/tier-5/enemy.ron @@ -14,6 +14,5 @@ (0.1, Item("common.items.glider.glider_blue")), (0.001, Item("common.items.armor.misc.back.backpack")), (0.1, Item("common.items.armor.misc.bag.heavy_seabag")), - (0.5, LootTable("common.loot_tables.fireworks")), - (0.5, Item("common.items.utility.bomb")), + (1.0, LootTable("common.loot_tables.consumables.default")), ] diff --git a/assets/common/loot_tables/dungeon/tier-5/minion.ron b/assets/common/loot_tables/dungeon/tier-5/minion.ron index a465f429bd..efcd9f0c57 100644 --- a/assets/common/loot_tables/dungeon/tier-5/minion.ron +++ b/assets/common/loot_tables/dungeon/tier-5/minion.ron @@ -5,5 +5,5 @@ (3.0, LootTable("common.loot_tables.food.wild_ingredients")), (0.5, LootTable("common.loot_tables.food.prepared")), // Consumables - (0.5, LootTable("common.loot_tables.consumables")), + (0.5, LootTable("common.loot_tables.consumables.default")), ] From 0fada1cfdefa50590abb1022aa2a6b6efb4f5429 Mon Sep 17 00:00:00 2001 From: juliancoffee Date: Tue, 25 May 2021 00:42:43 +0300 Subject: [PATCH 3/5] Unique loot tables for each dungeon chest --- .../loot_tables/dungeon/tier-0/chest.ron | 15 +++++++++--- .../loot_tables/dungeon/tier-1/chest.ron | 23 ++++++++++++------ .../loot_tables/dungeon/tier-2/chest.ron | 23 ++++++++++++------ .../loot_tables/dungeon/tier-3/chest.ron | 24 +++++++++++++------ .../loot_tables/dungeon/tier-4/chest.ron | 24 +++++++++++++------ .../loot_tables/dungeon/tier-5/chest.ron | 24 +++++++++++++------ 6 files changed, 95 insertions(+), 38 deletions(-) diff --git a/assets/common/loot_tables/dungeon/tier-0/chest.ron b/assets/common/loot_tables/dungeon/tier-0/chest.ron index 7abbbab30f..a322ba9b3c 100644 --- a/assets/common/loot_tables/dungeon/tier-0/chest.ron +++ b/assets/common/loot_tables/dungeon/tier-0/chest.ron @@ -1,5 +1,14 @@ [ - (1.0, LootTable("common.loot_tables.weapons.tier-0")), - (1.0, LootTable("common.loot_tables.armor.cloth")), - (1.0, ItemQuantity("common.items.utility.coins", 10, 20)), + // Gear + (0.5, LootTable("common.loot_tables.weapons.tier-0")), + (0.5, LootTable("common.loot_tables.armor.cloth")), + // Currency + (2.0, ItemQuantity("common.items.utility.coins", 10, 20)), + // Consumables + (1.0, Item("common.items.consumable.potion_minor")), + // Food + (1.0, Item("common.items.food.cheese")), + (1.0, Item("common.items.food.plainsalad")), + (0.5, Item("common.items.food.apple_stick")), + (0.5, Item("common.items.food.mushroom_stick")), ] diff --git a/assets/common/loot_tables/dungeon/tier-1/chest.ron b/assets/common/loot_tables/dungeon/tier-1/chest.ron index 98f99d2ec4..c355a5c8ea 100644 --- a/assets/common/loot_tables/dungeon/tier-1/chest.ron +++ b/assets/common/loot_tables/dungeon/tier-1/chest.ron @@ -1,8 +1,17 @@ [ - (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 + // Gear + // Don't put progression items until we have progression gates + // such as skill requirements or opening chest animations + + // Currency + (2.0, ItemQuantity("common.items.utility.coins", 20, 50)), + // Consumables + (1.0, Item("common.items.consumable.potion_minor")), + (0.2, Item("common.items.consumable.potion_med")), + // Food + (1.0, Item("common.items.food.cheese")), + (1.0, Item("common.items.food.tomatosalad")), + (0.5, Item("common.items.food.apple_stick")), + (0.5, Item("common.items.food.mushroom_stick")), + (0.1, Item("common.items.food.sunflower_icetea")), +] diff --git a/assets/common/loot_tables/dungeon/tier-2/chest.ron b/assets/common/loot_tables/dungeon/tier-2/chest.ron index 98f99d2ec4..17cbf8f811 100644 --- a/assets/common/loot_tables/dungeon/tier-2/chest.ron +++ b/assets/common/loot_tables/dungeon/tier-2/chest.ron @@ -1,8 +1,17 @@ [ - (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 + // Gear + // Don't put progression items until we have progression gates + // such as skill requirements or opening chest animations + + // Currency + (2.0, ItemQuantity("common.items.utility.coins", 50, 100)), + // Consumables + (1.0, ItemQuantity("common.items.consumable.potion_minor", 1, 2)), + (0.2, Item("common.items.consumable.potion_med")), + // Food + (1.0, ItemQuantity("common.items.food.cheese", 1, 3)), + (1.0, ItemQuantity("common.items.food.tomatosalad", 1, 3)), + (0.5, ItemQuantity("common.items.food.apple_stick", 1, 2)), + (0.5, ItemQuantity("common.items.food.mushroom_stick", 1, 2)), + (0.1, Item("common.items.food.sunflower_icetea")), +] diff --git a/assets/common/loot_tables/dungeon/tier-3/chest.ron b/assets/common/loot_tables/dungeon/tier-3/chest.ron index 98f99d2ec4..ecfd9d6db8 100644 --- a/assets/common/loot_tables/dungeon/tier-3/chest.ron +++ b/assets/common/loot_tables/dungeon/tier-3/chest.ron @@ -1,8 +1,18 @@ [ - (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 + // Gear + // Don't put progression items until we have progression gates + // such as skill requirements or opening chest animations + + // Currency + (2.0, ItemQuantity("common.items.utility.coins", 100, 500)), + // Consumables + (1.0, ItemQuantity("common.items.consumable.potion_minor", 1, 3)), + (0.5, ItemQuantity("common.items.consumable.potion_minor", 1, 2)), + (0.1, Item("common.items.consumable.potion_big")), + // Food + (1.0, ItemQuantity("common.items.food.cheese", 1, 4)), + (1.0, ItemQuantity("common.items.food.tomatosalad", 1, 3)), + (0.5, ItemQuantity("common.items.food.apple_stick", 1, 2)), + (0.5, ItemQuantity("common.items.food.mushroom_stick", 1, 2)), + (0.1, Item("common.items.food.sunflower_icetea")), +] diff --git a/assets/common/loot_tables/dungeon/tier-4/chest.ron b/assets/common/loot_tables/dungeon/tier-4/chest.ron index 98f99d2ec4..1ec6061bc2 100644 --- a/assets/common/loot_tables/dungeon/tier-4/chest.ron +++ b/assets/common/loot_tables/dungeon/tier-4/chest.ron @@ -1,8 +1,18 @@ [ - (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 + // Gear + // Don't put progression items until we have progression gates + // such as skill requirements or opening chest animations + + // Currency + (2.0, ItemQuantity("common.items.utility.coins", 200, 800)), + // Consumables + (1.0, ItemQuantity("common.items.consumable.potion_minor", 2, 4)), + (0.5, ItemQuantity("common.items.consumable.potion_minor", 1, 2)), + (0.1, Item("common.items.consumable.potion_big")), + // Food + (1.0, ItemQuantity("common.items.food.cheese", 1, 5)), + (1.0, ItemQuantity("common.items.food.tomatosalad", 1, 3)), + (0.5, ItemQuantity("common.items.food.apple_stick", 1, 2)), + (0.5, ItemQuantity("common.items.food.mushroom_stick", 1, 2)), + (0.5, Item("common.items.food.sunflower_icetea")), +] diff --git a/assets/common/loot_tables/dungeon/tier-5/chest.ron b/assets/common/loot_tables/dungeon/tier-5/chest.ron index 98f99d2ec4..2e6f58fc66 100644 --- a/assets/common/loot_tables/dungeon/tier-5/chest.ron +++ b/assets/common/loot_tables/dungeon/tier-5/chest.ron @@ -1,8 +1,18 @@ [ - (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 + // Gear + // Don't put progression items until we have progression gates + // such as skill requirements or opening chest animations + + // Currency + (2.0, ItemQuantity("common.items.utility.coins", 200, 1000)), + // Consumables + (1.5, ItemQuantity("common.items.consumable.potion_med", 1, 2)), + (0.5, Item("common.items.consumable.potion_big")), + // Food + (1.0, ItemQuantity("common.items.food.cheese", 1, 5)), + (1.0, ItemQuantity("common.items.food.tomatosalad", 1, 3)), + (0.5, ItemQuantity("common.items.food.apple_stick", 1, 2)), + (0.5, ItemQuantity("common.items.food.mushroom_stick", 1, 2)), + (0.5, Item("common.items.food.sunflower_icetea")), + (0.5, Item("common.items.food.apple_mushroom_curry")), +] From dc7c093bbb0b9739f5da212afad30a68015551d6 Mon Sep 17 00:00:00 2001 From: juliancoffee Date: Tue, 25 May 2021 01:08:11 +0300 Subject: [PATCH 4/5] add CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23fba0ed3f..82d00174ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Chat tabs - NPC's now hear certain sounds - Renamed Animal Trainers to Beastmasters and gave them their own set of armor to wear +- Add chest to each dungeon with unique loot ### Changed From e36e63825db13ebf27b6e6d78e8f24c4a0eb0325 Mon Sep 17 00:00:00 2001 From: juliancoffee Date: Tue, 25 May 2021 01:23:13 +0300 Subject: [PATCH 5/5] fmt --- assets/common/item_price_calculation.ron | 2 +- assets/common/loot_tables/consumable/default.ron | 5 +++++ .../{consumables/fireworks.ron => consumable/firework.ron} | 0 assets/common/loot_tables/consumable/misc.ron | 5 +++++ .../{consumables/potions.ron => consumable/potion.ron} | 0 .../{consumables/throwables.ron => consumable/throwable.ron} | 0 assets/common/loot_tables/consumables/default.ron | 5 ----- assets/common/loot_tables/consumables/misc.ron | 5 ----- assets/common/loot_tables/dungeon/tier-0/miniboss.ron | 2 +- assets/common/loot_tables/dungeon/tier-5/enemy.ron | 2 +- assets/common/loot_tables/dungeon/tier-5/minion.ron | 2 +- common/src/comp/inventory/item/mod.rs | 4 +++- 12 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 assets/common/loot_tables/consumable/default.ron rename assets/common/loot_tables/{consumables/fireworks.ron => consumable/firework.ron} (100%) create mode 100644 assets/common/loot_tables/consumable/misc.ron rename assets/common/loot_tables/{consumables/potions.ron => consumable/potion.ron} (100%) rename assets/common/loot_tables/{consumables/throwables.ron => consumable/throwable.ron} (100%) delete mode 100644 assets/common/loot_tables/consumables/default.ron delete mode 100644 assets/common/loot_tables/consumables/misc.ron diff --git a/assets/common/item_price_calculation.ron b/assets/common/item_price_calculation.ron index 95952696f0..0bc268b1e7 100644 --- a/assets/common/item_price_calculation.ron +++ b/assets/common/item_price_calculation.ron @@ -31,7 +31,7 @@ loot_tables: [ (0.4, true, "common.loot_tables.food.wild_ingredients"), (0.2, true, "common.loot_tables.food.prepared"), // TODO: Change consumables and split them up - (1.0, true, "common.loot_tables.consumables.default"), + (1.0, true, "common.loot_tables.consumable.default"), (0.5, false, "common.loot_tables.trading"), ], // this is the amount of that good the most common item represents diff --git a/assets/common/loot_tables/consumable/default.ron b/assets/common/loot_tables/consumable/default.ron new file mode 100644 index 0000000000..88738054df --- /dev/null +++ b/assets/common/loot_tables/consumable/default.ron @@ -0,0 +1,5 @@ +[ + (2.0, LootTable("common.loot_tables.consumable.potion")), + (0.5, LootTable("common.loot_tables.consumable.throwable")), + (1.0, LootTable("common.loot_tables.consumable.misc")), +] diff --git a/assets/common/loot_tables/consumables/fireworks.ron b/assets/common/loot_tables/consumable/firework.ron similarity index 100% rename from assets/common/loot_tables/consumables/fireworks.ron rename to assets/common/loot_tables/consumable/firework.ron diff --git a/assets/common/loot_tables/consumable/misc.ron b/assets/common/loot_tables/consumable/misc.ron new file mode 100644 index 0000000000..02b2c9c0c7 --- /dev/null +++ b/assets/common/loot_tables/consumable/misc.ron @@ -0,0 +1,5 @@ +[ + // misc + (0.1, Item("common.items.utility.collar")), + (1.0, LootTable("common.loot_tables.consumable.firework")), +] diff --git a/assets/common/loot_tables/consumables/potions.ron b/assets/common/loot_tables/consumable/potion.ron similarity index 100% rename from assets/common/loot_tables/consumables/potions.ron rename to assets/common/loot_tables/consumable/potion.ron diff --git a/assets/common/loot_tables/consumables/throwables.ron b/assets/common/loot_tables/consumable/throwable.ron similarity index 100% rename from assets/common/loot_tables/consumables/throwables.ron rename to assets/common/loot_tables/consumable/throwable.ron diff --git a/assets/common/loot_tables/consumables/default.ron b/assets/common/loot_tables/consumables/default.ron deleted file mode 100644 index e6e0e88af0..0000000000 --- a/assets/common/loot_tables/consumables/default.ron +++ /dev/null @@ -1,5 +0,0 @@ -[ - (2.0, LootTable("common.loot_tables.consumables.potions")), - (0.5, LootTable("common.loot_tables.consumables.throwables")), - (1.0, LootTable("common.loot_tables.consumables.misc")), -] diff --git a/assets/common/loot_tables/consumables/misc.ron b/assets/common/loot_tables/consumables/misc.ron deleted file mode 100644 index a4f4a71ae7..0000000000 --- a/assets/common/loot_tables/consumables/misc.ron +++ /dev/null @@ -1,5 +0,0 @@ -[ - // misc - (0.1, Item("common.items.utility.collar")), - (1.0, LootTable("common.loot_tables.consumables.fireworks")), -] diff --git a/assets/common/loot_tables/dungeon/tier-0/miniboss.ron b/assets/common/loot_tables/dungeon/tier-0/miniboss.ron index 615293ed66..910575b7e0 100644 --- a/assets/common/loot_tables/dungeon/tier-0/miniboss.ron +++ b/assets/common/loot_tables/dungeon/tier-0/miniboss.ron @@ -1,5 +1,5 @@ [ (1.0, LootTable("common.loot_tables.armor.cloth")), (2.0, LootTable("common.loot_tables.weapons.tier-0")), - (2.0, LootTable("common.loot_tables.consumables.potions")), + (2.0, LootTable("common.loot_tables.consumable.potion")), ] diff --git a/assets/common/loot_tables/dungeon/tier-5/enemy.ron b/assets/common/loot_tables/dungeon/tier-5/enemy.ron index 2bf145da77..88530ec0c6 100644 --- a/assets/common/loot_tables/dungeon/tier-5/enemy.ron +++ b/assets/common/loot_tables/dungeon/tier-5/enemy.ron @@ -14,5 +14,5 @@ (0.1, Item("common.items.glider.glider_blue")), (0.001, Item("common.items.armor.misc.back.backpack")), (0.1, Item("common.items.armor.misc.bag.heavy_seabag")), - (1.0, LootTable("common.loot_tables.consumables.default")), + (1.0, LootTable("common.loot_tables.consumable.default")), ] diff --git a/assets/common/loot_tables/dungeon/tier-5/minion.ron b/assets/common/loot_tables/dungeon/tier-5/minion.ron index efcd9f0c57..a382efce96 100644 --- a/assets/common/loot_tables/dungeon/tier-5/minion.ron +++ b/assets/common/loot_tables/dungeon/tier-5/minion.ron @@ -5,5 +5,5 @@ (3.0, LootTable("common.loot_tables.food.wild_ingredients")), (0.5, LootTable("common.loot_tables.food.prepared")), // Consumables - (0.5, LootTable("common.loot_tables.consumables.default")), + (0.5, LootTable("common.loot_tables.consumable.default")), ] diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index bc5aab8cba..f1d4216ed3 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -741,7 +741,9 @@ impl Item { SpriteKind::Seashells => "common.items.crafting_ing.seashells", // Containers // IMPORTANT: Add any new container to `SpriteKind::is_container` - container @ (SpriteKind::DungeonChest0 + container + @ + (SpriteKind::DungeonChest0 | SpriteKind::DungeonChest1 | SpriteKind::DungeonChest2 | SpriteKind::DungeonChest3