From 8d0a1ad7b44df179da8fd1280f4225c8f6c1c45e Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Sat, 26 Jun 2021 02:44:02 +0000 Subject: [PATCH] Gem Rings and small change to trading. --- CHANGELOG.md | 2 +- .../common/items/armor/misc/ring/amethyst.ron | 17 +++++++ .../common/items/armor/misc/ring/diamond.ron | 17 +++++++ .../common/items/armor/misc/ring/emerald.ron | 17 +++++++ assets/common/items/armor/misc/ring/gold.ron | 2 +- assets/common/items/armor/misc/ring/ruby.ron | 17 +++++++ .../common/items/armor/misc/ring/sapphire.ron | 17 +++++++ assets/common/items/armor/misc/ring/topaz.ron | 17 +++++++ .../loot_tables/food/wild_ingredients.ron | 1 + assets/common/loot_tables/trading.ron | 11 ++--- assets/common/recipe_book.ron | 48 +++++++++++++++++++ assets/server/manifests/kits.ron | 42 ++++++++++++++-- assets/voxygen/item_image_manifest.ron | 31 ++++++++++-- .../voxel/armor/misc/ring/amethyst.vox | 3 ++ .../voxygen/voxel/armor/misc/ring/diamond.vox | 3 ++ .../voxygen/voxel/armor/misc/ring/emerald.vox | 3 ++ assets/voxygen/voxel/armor/misc/ring/gold.vox | 4 +- assets/voxygen/voxel/armor/misc/ring/ruby.vox | 3 ++ .../voxel/armor/misc/ring/sapphire.vox | 3 ++ .../voxel/armor/misc/ring/scratched.vox | 4 +- .../voxygen/voxel/armor/misc/ring/topaz.vox | 3 ++ common/src/comp/inventory/trade_pricing.rs | 13 ++++- 22 files changed, 254 insertions(+), 24 deletions(-) create mode 100644 assets/common/items/armor/misc/ring/amethyst.ron create mode 100644 assets/common/items/armor/misc/ring/diamond.ron create mode 100644 assets/common/items/armor/misc/ring/emerald.ron create mode 100644 assets/common/items/armor/misc/ring/ruby.ron create mode 100644 assets/common/items/armor/misc/ring/sapphire.ron create mode 100644 assets/common/items/armor/misc/ring/topaz.ron create mode 100644 assets/voxygen/voxel/armor/misc/ring/amethyst.vox create mode 100644 assets/voxygen/voxel/armor/misc/ring/diamond.vox create mode 100644 assets/voxygen/voxel/armor/misc/ring/emerald.vox create mode 100644 assets/voxygen/voxel/armor/misc/ring/ruby.vox create mode 100644 assets/voxygen/voxel/armor/misc/ring/sapphire.vox create mode 100644 assets/voxygen/voxel/armor/misc/ring/topaz.vox diff --git a/CHANGELOG.md b/CHANGELOG.md index 31b7a1ec1d..ee02ecbc91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - NPCs and animals can now make sounds in response to certain events - Players can press H to greet others - Ability to toggle chat visibility - +- Added gem rings with various stat improvements. ### Changed - Entity-entity pushback is no longer applied in forced movement states like rolling and leaping. diff --git a/assets/common/items/armor/misc/ring/amethyst.ron b/assets/common/items/armor/misc/ring/amethyst.ron new file mode 100644 index 0000000000..5d72036ecf --- /dev/null +++ b/assets/common/items/armor/misc/ring/amethyst.ron @@ -0,0 +1,17 @@ +ItemDef( + name: "Amethyst Ring", + description: "A tin ring with an amethyst gem.", + kind: Armor(( + kind: Ring("Amethyst"), + stats: ( + protection: Normal(0.0), + poise_resilience: Normal(0.0), + energy_max: 0, + energy_reward: 0.025, + crit_power: 0.0, + stealth: 0.0, + ), + )), + quality: Moderate, + tags: [], +) \ No newline at end of file diff --git a/assets/common/items/armor/misc/ring/diamond.ron b/assets/common/items/armor/misc/ring/diamond.ron new file mode 100644 index 0000000000..a82fb13ea6 --- /dev/null +++ b/assets/common/items/armor/misc/ring/diamond.ron @@ -0,0 +1,17 @@ +ItemDef( + name: "Diamond Ring", + description: "A gold ring with an expensive diamond.", + kind: Armor(( + kind: Ring("Diamond"), + stats: ( + protection: Normal(0.0), + poise_resilience: Normal(0.0), + energy_max: 0, + energy_reward: -0.05, + crit_power: 0.1, + stealth: 0.0, + ), + )), + quality: Epic, + tags: [], +) \ No newline at end of file diff --git a/assets/common/items/armor/misc/ring/emerald.ron b/assets/common/items/armor/misc/ring/emerald.ron new file mode 100644 index 0000000000..16b7ba430c --- /dev/null +++ b/assets/common/items/armor/misc/ring/emerald.ron @@ -0,0 +1,17 @@ +ItemDef( + name: "Emerald Ring", + description: "A cobalt ring with an emerald gem.", + kind: Armor(( + kind: Ring("Emerald"), + stats: ( + protection: Normal(0.0), + poise_resilience: Normal(0.0), + energy_max: 100, + energy_reward: 0.0, + crit_power: -0.025, + stealth: 0.0, + ), + )), + quality: Moderate, + tags: [], +) \ No newline at end of file diff --git a/assets/common/items/armor/misc/ring/gold.ron b/assets/common/items/armor/misc/ring/gold.ron index 77bfc0c7d8..b8113d6b9c 100644 --- a/assets/common/items/armor/misc/ring/gold.ron +++ b/assets/common/items/armor/misc/ring/gold.ron @@ -1,6 +1,6 @@ ItemDef( name: "Gold Ring", - description: "Someone is surely missing it...", + description: "A plain gold ring... almost as if it is missing a gem.", kind: Armor(( kind: Ring("Gold"), stats: ( diff --git a/assets/common/items/armor/misc/ring/ruby.ron b/assets/common/items/armor/misc/ring/ruby.ron new file mode 100644 index 0000000000..9f2d8b147d --- /dev/null +++ b/assets/common/items/armor/misc/ring/ruby.ron @@ -0,0 +1,17 @@ +ItemDef( + name: "Ruby Ring", + description: "A silver ring with a ruby gem.", + kind: Armor(( + kind: Ring("Ruby"), + stats: ( + protection: Normal(0.0), + poise_resilience: Normal(0.0), + energy_max: -100, + energy_reward: 0.05, + crit_power: 0.0, + stealth: 0.0, + ), + )), + quality: High, + tags: [], +) \ No newline at end of file diff --git a/assets/common/items/armor/misc/ring/sapphire.ron b/assets/common/items/armor/misc/ring/sapphire.ron new file mode 100644 index 0000000000..8242516a44 --- /dev/null +++ b/assets/common/items/armor/misc/ring/sapphire.ron @@ -0,0 +1,17 @@ +ItemDef( + name: "Sapphire Ring", + description: "An iron ring with a sapphire gem.", + kind: Armor(( + kind: Ring("Sapphire"), + stats: ( + protection: Normal(0.0), + poise_resilience: Normal(0.0), + energy_max: 0, + energy_reward: 0.0, + crit_power: 0.05, + stealth: 0.0, + ), + )), + quality: Moderate, + tags: [], +) \ No newline at end of file diff --git a/assets/common/items/armor/misc/ring/topaz.ron b/assets/common/items/armor/misc/ring/topaz.ron new file mode 100644 index 0000000000..4156ca723a --- /dev/null +++ b/assets/common/items/armor/misc/ring/topaz.ron @@ -0,0 +1,17 @@ +ItemDef( + name: "Topaz Ring", + description: "A copper ring with a topaz gem.", + kind: Armor(( + kind: Ring("Topaz"), + stats: ( + protection: Normal(0.0), + poise_resilience: Normal(0.0), + energy_max: 50, + energy_reward: 0.00, + crit_power: 0.0, + stealth: 0.0, + ), + )), + quality: Moderate, + tags: [], +) \ 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 index cd99728eb1..3a915112bd 100644 --- a/assets/common/loot_tables/food/wild_ingredients.ron +++ b/assets/common/loot_tables/food/wild_ingredients.ron @@ -2,4 +2,5 @@ (1.0, Item("common.items.food.apple")), (1.0, Item("common.items.food.coconut")), (1.5, Item("common.items.food.mushroom")), + (1.0, Item("common.items.crafting_ing.honey")), ] diff --git a/assets/common/loot_tables/trading.ron b/assets/common/loot_tables/trading.ron index 559a023911..82679c07a7 100644 --- a/assets/common/loot_tables/trading.ron +++ b/assets/common/loot_tables/trading.ron @@ -2,11 +2,10 @@ // Please keep it sorting by rarity so it's easier to reason about things [ // Ores - // Uncomment when bug with crafting doesn't propagating can_sell will be fixed - // (0.03, Item("common.items.mineral.ore.gold")), - // (0.045, Item("common.items.mineral.ore.silver")), - // (0.1, Item("common.items.mineral.ore.bloodstone")), - // (0.2, Item("common.items.mineral.ore.cobalt")), + (0.03, Item("common.items.mineral.ore.gold")), + (0.045, Item("common.items.mineral.ore.silver")), + (0.1, Item("common.items.mineral.ore.bloodstone")), + (0.2, Item("common.items.mineral.ore.cobalt")), (0.25, Item("common.items.mineral.ore.coal")), (0.3, Item("common.items.mineral.ore.iron")), (0.5, Item("common.items.mineral.ore.velorite")), @@ -32,6 +31,4 @@ (1.0, Item("common.items.food.meat.beast_small_raw")), (1.2, Item("common.items.food.meat.fish_raw")), (1.3, Item("common.items.food.meat.bird_raw")), - // Others - (1.0, Item("common.items.crafting_ing.honey")), ] diff --git a/assets/common/recipe_book.ron b/assets/common/recipe_book.ron index 9f8f48e7dd..88727b29e0 100644 --- a/assets/common/recipe_book.ron +++ b/assets/common/recipe_book.ron @@ -1748,6 +1748,54 @@ ], craft_sprite: Some(Anvil), ), + "diamond ring": ( + output: ("common.items.armor.misc.ring.diamond", 1), + inputs: [ + (Item("common.items.mineral.ingot.gold"), 1), + (Item("common.items.mineral.gem.diamond"), 1), + ], + craft_sprite: Some(CraftingBench), + ), + "ruby ring": ( + output: ("common.items.armor.misc.ring.ruby", 1), + inputs: [ + (Item("common.items.mineral.ingot.silver"), 1), + (Item("common.items.mineral.gem.ruby"), 1), + ], + craft_sprite: Some(CraftingBench), + ), + "emerald ring": ( + output: ("common.items.armor.misc.ring.emerald", 1), + inputs: [ + (Item("common.items.mineral.ingot.cobalt"), 1), + (Item("common.items.mineral.gem.emerald"), 1), + ], + craft_sprite: Some(CraftingBench), + ), + "sapphire ring": ( + output: ("common.items.armor.misc.ring.sapphire", 1), + inputs: [ + (Item("common.items.mineral.ingot.iron"), 1), + (Item("common.items.mineral.gem.sapphire"), 1), + ], + craft_sprite: Some(CraftingBench), + ), + "topaz ring": ( + output: ("common.items.armor.misc.ring.topaz", 1), + inputs: [ + (Item("common.items.mineral.ingot.copper"), 1), + (Item("common.items.mineral.gem.topaz"), 1), + ], + craft_sprite: Some(CraftingBench), + ), + "amethyst ring": ( + output: ("common.items.armor.misc.ring.amethyst", 1), + inputs: [ + (Item("common.items.mineral.ingot.tin"), 1), + (Item("common.items.mineral.gem.amethyst"), 1), + ], + craft_sprite: Some(CraftingBench), + ), //"metal_blade": ( // output: ("common.items.crafting_ing.modular.damage.sword.metal_blade", 1), // inputs: [ diff --git a/assets/server/manifests/kits.ron b/assets/server/manifests/kits.ron index 61d7ffc46c..1c1e45d206 100644 --- a/assets/server/manifests/kits.ron +++ b/assets/server/manifests/kits.ron @@ -12,12 +12,44 @@ ("common.items.consumable.potion_big", 100), ("common.items.food.apple_mushroom_curry", 100), ], - "endgame": [ - // Biju - ("common.items.armor.misc.neck.plain_1",1), - ("common.items.armor.misc.ring.skull",1), - ("common.items.armor.misc.ring.skull",1), + "jewellery": [ + // TODO: remove duplicates and handle quantity of non-stackable items + // Necklace + ("common.items.armor.misc.neck.plain_1",1), + ("common.items.armor.misc.neck.shell",1), + + // Rings + // With effects + ("common.items.armor.misc.ring.diamond",1), + ("common.items.armor.misc.ring.diamond",1), + + ("common.items.armor.misc.ring.ruby",1), + ("common.items.armor.misc.ring.ruby",1), + + ("common.items.armor.misc.ring.emerald",1), + ("common.items.armor.misc.ring.emerald",1), + + ("common.items.armor.misc.ring.sapphire",1), + ("common.items.armor.misc.ring.sapphire",1), + + ("common.items.armor.misc.ring.topaz",1), + ("common.items.armor.misc.ring.topaz",1), + + ("common.items.armor.misc.ring.amethyst",1), + ("common.items.armor.misc.ring.amethyst",1), + + // Without effects + ("common.items.armor.misc.ring.scratched",1), + ("common.items.armor.misc.ring.scratched",1), + + ("common.items.armor.misc.ring.gold",1), + ("common.items.armor.misc.ring.gold",1), + + ("common.items.armor.misc.ring.skull",1), + ("common.items.armor.misc.ring.skull",1), + ], + "endgame": [ // Cultist weapons ("common.items.weapons.hammer.cultist_purp_2h-0",1), ("common.items.weapons.staff.cultist_staff",1), diff --git a/assets/voxygen/item_image_manifest.ron b/assets/voxygen/item_image_manifest.ron index 8159668653..5901e2a296 100644 --- a/assets/voxygen/item_image_manifest.ron +++ b/assets/voxygen/item_image_manifest.ron @@ -2194,17 +2194,40 @@ // Rings Armor(Ring("Scratched")): VoxTrans( "voxel.armor.misc.ring.scratched", - (0.0, 0.0, 0.0), (30.0, 0.0, 0.0), 0.9, + (0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9, ), Armor(Ring("Gold")): VoxTrans( "voxel.armor.misc.ring.gold", - (0.0, 0.0, 0.0), (30.0, 0.0, 0.0), 0.9, + (0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9, + ), + Armor(Ring("Topaz")): VoxTrans( + "voxel.armor.misc.ring.topaz", + (0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9, + ), + Armor(Ring("Amethyst")): VoxTrans( + "voxel.armor.misc.ring.amethyst", + (0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9, + ), + Armor(Ring("Sapphire")): VoxTrans( + "voxel.armor.misc.ring.sapphire", + (0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9, + ), + Armor(Ring("Emerald")): VoxTrans( + "voxel.armor.misc.ring.emerald", + (0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9, + ), + Armor(Ring("Ruby")): VoxTrans( + "voxel.armor.misc.ring.ruby", + (0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9, + ), + Armor(Ring("Diamond")): VoxTrans( + "voxel.armor.misc.ring.diamond", + (0.0, 0.0, 0.0), (45.0, 20.0, 0.0), 0.9, ), Armor(Ring("Skull")): VoxTrans( "voxel.armor.misc.ring.skull", - (0.0, 0.0, 0.0), (30.0, 0.0, 0.0), 0.9, + (0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9, ), - // Necks Armor(Neck("Plain0")): Png( "element.items.neck-0", diff --git a/assets/voxygen/voxel/armor/misc/ring/amethyst.vox b/assets/voxygen/voxel/armor/misc/ring/amethyst.vox new file mode 100644 index 0000000000..f19efe90ea --- /dev/null +++ b/assets/voxygen/voxel/armor/misc/ring/amethyst.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50425f178ba8bf15f003e76a854662ab1f1a4ef7c3a920c7322b1096af75e037 +size 27414 diff --git a/assets/voxygen/voxel/armor/misc/ring/diamond.vox b/assets/voxygen/voxel/armor/misc/ring/diamond.vox new file mode 100644 index 0000000000..db5e30b046 --- /dev/null +++ b/assets/voxygen/voxel/armor/misc/ring/diamond.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9d075cec317d5b00c3be31c359435133d1620f42d14fd87d5eed2558f5f7ef0 +size 27414 diff --git a/assets/voxygen/voxel/armor/misc/ring/emerald.vox b/assets/voxygen/voxel/armor/misc/ring/emerald.vox new file mode 100644 index 0000000000..5afe24d161 --- /dev/null +++ b/assets/voxygen/voxel/armor/misc/ring/emerald.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d455bdd68e3955c7cf626026e7bebb68e8d0f8ea27e550fefaaa3ab8b76ad924 +size 27414 diff --git a/assets/voxygen/voxel/armor/misc/ring/gold.vox b/assets/voxygen/voxel/armor/misc/ring/gold.vox index 0086958447..637116f91b 100644 --- a/assets/voxygen/voxel/armor/misc/ring/gold.vox +++ b/assets/voxygen/voxel/armor/misc/ring/gold.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1ce921e48cb12d03ae53b14da5e72175349cdd69f0bfe3fe869a80c1e47b1398 -size 1260 +oid sha256:33a964cab0c197e23be83e924159eaf3f0d13f0cb14b0e1908adfb76e4e9539c +size 27378 diff --git a/assets/voxygen/voxel/armor/misc/ring/ruby.vox b/assets/voxygen/voxel/armor/misc/ring/ruby.vox new file mode 100644 index 0000000000..fa1a98d7b4 --- /dev/null +++ b/assets/voxygen/voxel/armor/misc/ring/ruby.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e439ef7eb904260bd1f6f66093b55a7068cc009195c94935d541b5cacf48dc41 +size 27414 diff --git a/assets/voxygen/voxel/armor/misc/ring/sapphire.vox b/assets/voxygen/voxel/armor/misc/ring/sapphire.vox new file mode 100644 index 0000000000..c44cd17dd7 --- /dev/null +++ b/assets/voxygen/voxel/armor/misc/ring/sapphire.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:931051f7524c2a7c21823a1944b755c8cb7deb0982309a9b73c2a02121ef74b0 +size 27414 diff --git a/assets/voxygen/voxel/armor/misc/ring/scratched.vox b/assets/voxygen/voxel/armor/misc/ring/scratched.vox index e055f9d786..ac526b2c66 100644 --- a/assets/voxygen/voxel/armor/misc/ring/scratched.vox +++ b/assets/voxygen/voxel/armor/misc/ring/scratched.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8d3b50a1478580f84711ebcad5f076f0465a261f6c573f2d4c72b5a1a18ea4ba -size 1236 +oid sha256:f333e00a6090e89361ad337d993d80e0ea10363492b6127b4fd3533f49f77596 +size 27378 diff --git a/assets/voxygen/voxel/armor/misc/ring/topaz.vox b/assets/voxygen/voxel/armor/misc/ring/topaz.vox new file mode 100644 index 0000000000..4def403756 --- /dev/null +++ b/assets/voxygen/voxel/armor/misc/ring/topaz.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef47be70091859883d2eba7ba1168258becede06d006e47b39df2e200b6f997d +size 27414 diff --git a/common/src/comp/inventory/trade_pricing.rs b/common/src/comp/inventory/trade_pricing.rs index 78fc2b7dda..7dcff3bc56 100644 --- a/common/src/comp/inventory/trade_pricing.rs +++ b/common/src/comp/inventory/trade_pricing.rs @@ -376,11 +376,18 @@ impl TradePricing { false } else if recipe.material_cost < Self::UNAVAILABLE_PRICE { let actual_cost = result.calculate_material_cost(recipe, &eqset); + let output_tradeable = recipe.input.iter().all(|(input, _)| { + result + .get_list_by_path(&input) + .iter() + .find(|(item, _, _)| item == input) + .map_or(false, |(_, _, tradeable)| *tradeable) + }); result.get_list_by_path_mut(&recipe.output).add( &eqset, &recipe.output, (recipe.amount as f32) / actual_cost * Self::CRAFTING_FACTOR, - true, + output_tradeable, ); false } else { @@ -424,7 +431,9 @@ impl TradePricing { Some(Self::COIN_ITEM.into()) } else { let table = self.get_list(good); - if table.is_empty() { + if table.is_empty() + || (selling && table.iter().filter(|(_, _, can_sell)| *can_sell).count() == 0) + { warn!("Good: {:?}, was unreachable.", good); return None; }