From 6cce09be851aca201d2c540dcd0233741e5a75ec Mon Sep 17 00:00:00 2001 From: Samuel Keiffer Date: Sat, 18 Jul 2020 00:05:28 +0000 Subject: [PATCH] Added protection stat to admin armor hidden in debug folder. Removed blue cultist armor set from drop table as it is an admin set. --- CHANGELOG.md | 1 + Cargo.lock | 50 +++++ assets/common/items/armor/back/admin.ron | 10 +- assets/common/items/armor/back/short_0.ron | 10 +- assets/common/items/armor/belt/assassin.ron | 10 +- .../common/items/armor/belt/cloth_blue_0.ron | 10 +- .../common/items/armor/belt/cloth_green_0.ron | 10 +- .../items/armor/belt/cloth_purple_0.ron | 10 +- .../common/items/armor/belt/cultist_belt.ron | 10 +- assets/common/items/armor/belt/druid.ron | 10 +- assets/common/items/armor/belt/leather_0.ron | 10 +- assets/common/items/armor/belt/leather_2.ron | 8 +- assets/common/items/armor/belt/plate_0.ron | 10 +- assets/common/items/armor/belt/steel_0.ron | 10 +- assets/common/items/armor/belt/twig.ron | 10 +- .../common/items/armor/belt/twigsflowers.ron | 10 +- .../common/items/armor/belt/twigsleaves.ron | 10 +- assets/common/items/armor/chest/assassin.ron | 10 +- .../common/items/armor/chest/cloth_blue_0.ron | 10 +- .../items/armor/chest/cloth_green_0.ron | 10 +- .../items/armor/chest/cloth_purple_0.ron | 10 +- .../items/armor/chest/cultist_chest_blue.ron | 10 +- .../armor/chest/cultist_chest_purple.ron | 10 +- assets/common/items/armor/chest/druid.ron | 10 +- assets/common/items/armor/chest/leather_0.ron | 10 +- assets/common/items/armor/chest/leather_2.ron | 10 +- .../items/armor/chest/plate_green_0.ron | 10 +- assets/common/items/armor/chest/steel_0.ron | 10 +- assets/common/items/armor/chest/twig.ron | 10 +- .../common/items/armor/chest/twigsflowers.ron | 10 +- .../common/items/armor/chest/twigsleaves.ron | 10 +- .../items/armor/chest/worker_green_0.ron | 10 +- .../items/armor/chest/worker_green_1.ron | 10 +- .../items/armor/chest/worker_orange_0.ron | 10 +- .../items/armor/chest/worker_orange_1.ron | 10 +- .../items/armor/chest/worker_purple_0.ron | 10 +- .../items/armor/chest/worker_purple_1.ron | 10 +- .../common/items/armor/chest/worker_red_0.ron | 10 +- .../common/items/armor/chest/worker_red_1.ron | 10 +- .../items/armor/chest/worker_yellow_0.ron | 10 +- .../items/armor/chest/worker_yellow_1.ron | 10 +- assets/common/items/armor/foot/assassin.ron | 10 +- .../common/items/armor/foot/cloth_blue_0.ron | 10 +- .../common/items/armor/foot/cloth_green_0.ron | 10 +- .../items/armor/foot/cloth_purple_0.ron | 10 +- .../common/items/armor/foot/cultist_boots.ron | 10 +- assets/common/items/armor/foot/druid.ron | 10 +- .../items/armor/foot/jackalope_slippers.ron | 10 +- assets/common/items/armor/foot/leather_0.ron | 10 +- assets/common/items/armor/foot/leather_2.ron | 10 +- assets/common/items/armor/foot/plate_0.ron | 10 +- assets/common/items/armor/foot/steel_0.ron | 10 +- assets/common/items/armor/foot/twig.ron | 10 +- .../common/items/armor/foot/twigsflowers.ron | 10 +- .../common/items/armor/foot/twigsleaves.ron | 10 +- assets/common/items/armor/hand/assassin.ron | 10 +- .../common/items/armor/hand/cloth_blue_0.ron | 10 +- .../common/items/armor/hand/cloth_green_0.ron | 10 +- .../items/armor/hand/cloth_purple_0.ron | 10 +- .../items/armor/hand/cultist_hands_blue.ron | 10 +- .../items/armor/hand/cultist_hands_purple.ron | 10 +- assets/common/items/armor/hand/druid.ron | 10 +- assets/common/items/armor/hand/leather_0.ron | 10 +- assets/common/items/armor/hand/leather_2.ron | 10 +- assets/common/items/armor/hand/plate_0.ron | 10 +- assets/common/items/armor/hand/steel_0.ron | 10 +- assets/common/items/armor/hand/twig.ron | 10 +- .../common/items/armor/hand/twigsflowers.ron | 10 +- .../common/items/armor/hand/twigsleaves.ron | 10 +- .../common/items/armor/head/assa_mask_0.ron | 10 +- assets/common/items/armor/head/leather_0.ron | 10 +- assets/common/items/armor/neck/neck_0.ron | 10 +- assets/common/items/armor/pants/assassin.ron | 10 +- .../common/items/armor/pants/cloth_blue_0.ron | 10 +- .../items/armor/pants/cloth_green_0.ron | 10 +- .../items/armor/pants/cloth_purple_0.ron | 10 +- .../items/armor/pants/cultist_legs_blue.ron | 10 +- .../items/armor/pants/cultist_legs_purple.ron | 10 +- assets/common/items/armor/pants/druid.ron | 10 +- assets/common/items/armor/pants/hunting.ron | 10 +- assets/common/items/armor/pants/leather_0.ron | 10 +- assets/common/items/armor/pants/leather_2.ron | 10 +- .../items/armor/pants/plate_green_0.ron | 10 +- assets/common/items/armor/pants/steel_0.ron | 10 +- assets/common/items/armor/pants/twig.ron | 10 +- .../common/items/armor/pants/twigsflowers.ron | 10 +- .../common/items/armor/pants/twigsleaves.ron | 10 +- .../items/armor/pants/worker_blue_0.ron | 10 +- assets/common/items/armor/ring/ring_0.ron | 10 +- .../common/items/armor/shoulder/assassin.ron | 10 +- .../items/armor/shoulder/cloth_blue_0.ron | 10 +- .../items/armor/shoulder/cloth_blue_1.ron | 10 +- .../items/armor/shoulder/cloth_green_0.ron | 10 +- .../items/armor/shoulder/cloth_purple_0.ron | 10 +- .../armor/shoulder/cultist_shoulder_blue.ron | 10 +- .../shoulder/cultist_shoulder_purple.ron | 10 +- .../items/armor/shoulder/druidshoulder.ron | 10 +- .../items/armor/shoulder/iron_spikes.ron | 10 +- .../common/items/armor/shoulder/leather_0.ron | 10 +- .../common/items/armor/shoulder/leather_1.ron | 10 +- .../common/items/armor/shoulder/leather_2.ron | 10 +- .../items/armor/shoulder/leather_iron_0.ron | 10 +- .../items/armor/shoulder/leather_iron_1.ron | 10 +- .../items/armor/shoulder/leather_iron_2.ron | 10 +- .../items/armor/shoulder/leather_iron_3.ron | 10 +- .../items/armor/shoulder/leather_strips.ron | 10 +- .../common/items/armor/shoulder/plate_0.ron | 10 +- .../common/items/armor/shoulder/steel_0.ron | 10 +- assets/common/items/armor/shoulder/twigs.ron | 10 +- .../items/armor/shoulder/twigsflowers.ron | 10 +- .../items/armor/shoulder/twigsleaves.ron | 10 +- .../items/armor/starter/rugged_chest.ron | 10 +- .../items/armor/starter/rugged_pants.ron | 10 +- .../common/items/armor/starter/sandals_0.ron | 10 +- assets/common/items/armor/tabard/admin.ron | 10 +- assets/common/items/debug/admin.ron | 10 +- assets/common/items/debug/admin_back.ron | 10 +- assets/common/items/debug/cultist_belt.ron | 10 +- assets/common/items/debug/cultist_boots.ron | 10 +- .../common/items/debug/cultist_chest_blue.ron | 10 +- .../common/items/debug/cultist_hands_blue.ron | 10 +- .../common/items/debug/cultist_legs_blue.ron | 10 +- .../items/debug/cultist_shoulder_blue.ron | 10 +- assets/common/items/testing/test_boots.ron | 8 +- assets/common/loot_table.ron | 141 ++++++++++---- assets/voxygen/element/icons/protection.png | 3 + assets/voxygen/i18n/en.ron | 2 + common/Cargo.toml | 1 + common/src/comp/ability.rs | 64 +++++-- common/src/comp/body.rs | 108 +++++++++++ common/src/comp/inventory/item/armor.rs | 26 ++- common/src/comp/inventory/item/mod.rs | 15 +- common/src/comp/inventory/mod.rs | 4 +- common/src/comp/inventory/slot.rs | 61 +++--- common/src/comp/stats.rs | 74 -------- common/src/loadout_builder.rs | 38 ---- common/src/sys/combat.rs | 12 +- .../down.sql | 1 + .../up.sql | 29 +++ voxygen/src/hud/bag.rs | 179 +++++++----------- voxygen/src/hud/img_ids.rs | 1 + voxygen/src/hud/item_imgs.rs | 6 +- voxygen/src/hud/mod.rs | 1 + voxygen/src/hud/util.rs | 85 +++++++++ voxygen/src/scene/figure/cache.rs | 72 +++++-- voxygen/src/scene/figure/load.rs | 58 +++--- 146 files changed, 1515 insertions(+), 733 deletions(-) create mode 100644 assets/voxygen/element/icons/protection.png create mode 100644 server/src/migrations/2020-07-16-044718_migrate_armour_stats/down.sql create mode 100644 server/src/migrations/2020-07-16-044718_migrate_armour_stats/up.sql create mode 100644 voxygen/src/hud/util.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 94cc10600e..2ae20e10bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Creature specific stats - Minimap compass - Initial crafting system implementation +- Protection stat to armor that reduces incoming damage ### Changed diff --git a/Cargo.lock b/Cargo.lock index 3fd74c3e2b..a847fa1d48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -108,6 +108,18 @@ dependencies = [ "syn 1.0.33", ] +[[package]] +name = "arraygen" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc755b23c19211c270ef000fa7ce871377825e6cc7d1bfd0311076f22c5e6ba1" +dependencies = [ + "proc-macro-error", + "proc-macro2 1.0.18", + "quote 1.0.7", + "syn 1.0.33", +] + [[package]] name = "arrayref" version = "0.3.6" @@ -2945,6 +2957,32 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" +[[package]] +name = "proc-macro-error" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18f33027081eba0a6d8aba6d1b1c3a3be58cbb12106341c2d5759fcd9b5277e7" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2 1.0.18", + "quote 1.0.7", + "syn 1.0.33", + "version_check 0.9.2", +] + +[[package]] +name = "proc-macro-error-attr" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a5b4b77fdb63c1eca72173d68d24501c54ab1269409f6b672c85deb18af69de" +dependencies = [ + "proc-macro2 1.0.18", + "quote 1.0.7", + "syn 1.0.33", + "syn-mid", + "version_check 0.9.2", +] + [[package]] name = "proc-macro-hack" version = "0.5.16" @@ -3827,6 +3865,17 @@ dependencies = [ "unicode-xid 0.2.0", ] +[[package]] +name = "syn-mid" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a" +dependencies = [ + "proc-macro2 1.0.18", + "quote 1.0.7", + "syn 1.0.33", +] + [[package]] name = "synstructure" version = "0.12.4" @@ -4373,6 +4422,7 @@ dependencies = [ name = "veloren-common" version = "0.6.0" dependencies = [ + "arraygen", "authc", "criterion", "crossbeam", diff --git a/assets/common/items/armor/back/admin.ron b/assets/common/items/armor/back/admin.ron index f07273b7c6..1e7e0a313b 100644 --- a/assets/common/items/armor/back/admin.ron +++ b/assets/common/items/armor/back/admin.ron @@ -1,8 +1,12 @@ Item( name: "Admin's Cape", - description: "Back\n\nArmor: 0\n\nWith great power comes\ngreat responsibility.\n\n", + description: "With great power comes\ngreat responsibility.", kind: Armor( - kind: Back(Admin), - stats: (20), + ( + kind: Back(Admin), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/back/short_0.ron b/assets/common/items/armor/back/short_0.ron index f1759c553d..a1093e90b8 100644 --- a/assets/common/items/armor/back/short_0.ron +++ b/assets/common/items/armor/back/short_0.ron @@ -1,8 +1,12 @@ Item( name: "Short leather Cape", - description: "Back\n\nArmor: 0\n\n", + description: "Probably made of the finest leather.", kind: Armor( - kind: Back(Short0), - stats: (20), + ( + kind: Back(Short0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/belt/assassin.ron b/assets/common/items/armor/belt/assassin.ron index dc086baa18..2c00d9066a 100644 --- a/assets/common/items/armor/belt/assassin.ron +++ b/assets/common/items/armor/belt/assassin.ron @@ -1,8 +1,12 @@ Item( name: "Assassin Belt", - description: "Belt\n\nArmor: 0\n\nOnly the best for a member of the creed.\n\n", + description: "Only the best for a member of the creed.", kind: Armor( - kind: Belt(Assassin), - stats: (20), + ( + kind: Belt(Assassin), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/belt/cloth_blue_0.ron b/assets/common/items/armor/belt/cloth_blue_0.ron index 1faaafb7f3..ef9085cf85 100644 --- a/assets/common/items/armor/belt/cloth_blue_0.ron +++ b/assets/common/items/armor/belt/cloth_blue_0.ron @@ -1,8 +1,12 @@ Item( name: "Blue Linen Belt", - description: "Belt\n\nArmor: 0\n\nSoft and warm\n\n", + description: "Soft and warm", kind: Armor( - kind: Belt(ClothBlue0), - stats: (20), + ( + kind: Belt(ClothBlue0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/belt/cloth_green_0.ron b/assets/common/items/armor/belt/cloth_green_0.ron index 15be2149ea..b4cba9679d 100644 --- a/assets/common/items/armor/belt/cloth_green_0.ron +++ b/assets/common/items/armor/belt/cloth_green_0.ron @@ -1,8 +1,12 @@ Item( name: "Green Linen Belt", - description: "Belt\n\nArmor: 0\n\nSoft and warm\n\n", + description: "Soft and warm.", kind: Armor( - kind: Belt(ClothGreen0), - stats: (20), + ( + kind: Belt(ClothGreen0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/belt/cloth_purple_0.ron b/assets/common/items/armor/belt/cloth_purple_0.ron index 7060fd9c83..54cc8647dc 100644 --- a/assets/common/items/armor/belt/cloth_purple_0.ron +++ b/assets/common/items/armor/belt/cloth_purple_0.ron @@ -1,8 +1,12 @@ Item( name: "Purple Linen Belt", - description: "Belt\n\nArmor: 0\n\nSoft and warm\n\n", + description: "Soft and warm.", kind: Armor( - kind: Belt(ClothPurple0), - stats: (20), + ( + kind: Belt(ClothPurple0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/belt/cultist_belt.ron b/assets/common/items/armor/belt/cultist_belt.ron index 1b2765d2c8..439851225a 100644 --- a/assets/common/items/armor/belt/cultist_belt.ron +++ b/assets/common/items/armor/belt/cultist_belt.ron @@ -1,8 +1,12 @@ Item( name: "Cultist Belt", - description: "Belt\n\nArmor: 0\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Belt(Cultist), - stats: (20), + ( + kind: Belt(Cultist), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/belt/druid.ron b/assets/common/items/armor/belt/druid.ron index 0a761f49c0..941ebbe6ca 100644 --- a/assets/common/items/armor/belt/druid.ron +++ b/assets/common/items/armor/belt/druid.ron @@ -1,8 +1,12 @@ Item( name: "Druid's Belt", - description: "Twisted vines to keep everything secure.\n\n", + description: "Twisted vines to keep everything secure.", kind: Armor( - kind: Belt(Druid), - stats: (20), + ( + kind: Belt(Druid), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/belt/leather_0.ron b/assets/common/items/armor/belt/leather_0.ron index 6ca49af665..6c7b499bfb 100644 --- a/assets/common/items/armor/belt/leather_0.ron +++ b/assets/common/items/armor/belt/leather_0.ron @@ -1,8 +1,12 @@ Item( name: "Swift Belt", - description: "Belt\n\nArmor: 0\n\nSwift like the wind.\n\n", + description: "Swift like the wind.", kind: Armor( - kind: Belt(Leather0), - stats: (20), + ( + kind: Belt(Leather0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/belt/leather_2.ron b/assets/common/items/armor/belt/leather_2.ron index ae3fd773f4..fb2d1d05a4 100644 --- a/assets/common/items/armor/belt/leather_2.ron +++ b/assets/common/items/armor/belt/leather_2.ron @@ -2,7 +2,11 @@ Item( name: "Leather Belt", description: "A belt made from simple leather.", kind: Armor( - kind: Belt(Leather2), - stats: (20), + ( + kind: Belt(Leather2), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/belt/plate_0.ron b/assets/common/items/armor/belt/plate_0.ron index f1269346f1..c48c0bdb0a 100644 --- a/assets/common/items/armor/belt/plate_0.ron +++ b/assets/common/items/armor/belt/plate_0.ron @@ -1,8 +1,12 @@ Item( name: "Iron Belt", - description: "Belt\n\nArmor: 0\n\n", + description: "A belt with a buckle forged from iron.", kind: Armor( - kind: Belt(Plate0), - stats: (20), + ( + kind: Belt(Plate0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/belt/steel_0.ron b/assets/common/items/armor/belt/steel_0.ron index 03086db2f9..0b9d7df412 100644 --- a/assets/common/items/armor/belt/steel_0.ron +++ b/assets/common/items/armor/belt/steel_0.ron @@ -1,8 +1,12 @@ Item( name: "Steel Belt", - description: "A belt made from Steel.", + description: "A belt forged from steel.", kind: Armor( - kind: Belt(Steel0), - stats: (20), + ( + kind: Belt(Steel0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/belt/twig.ron b/assets/common/items/armor/belt/twig.ron index 42c53c5dbb..754206366b 100644 --- a/assets/common/items/armor/belt/twig.ron +++ b/assets/common/items/armor/belt/twig.ron @@ -1,8 +1,12 @@ Item( name: "Twig Belt", - description: "A belt made from woven from twigs.\n\n", + description: "A belt made from woven from twigs.", kind: Armor( - kind: Belt(Twig), - stats: (20), + ( + kind: Belt(Twig), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/belt/twigsflowers.ron b/assets/common/items/armor/belt/twigsflowers.ron index f11985c104..0d503ef7d7 100644 --- a/assets/common/items/armor/belt/twigsflowers.ron +++ b/assets/common/items/armor/belt/twigsflowers.ron @@ -1,8 +1,12 @@ Item( name: "Flowery Belt", - description: "A belt woven from twigs and flowers.\n\n", + description: "A belt woven from twigs and flowers.", kind: Armor( - kind: Belt(Twigsflowers), - stats: (20), + ( + kind: Belt(Twigsflowers), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/belt/twigsleaves.ron b/assets/common/items/armor/belt/twigsleaves.ron index 5f00fce3e8..883f1ebe77 100644 --- a/assets/common/items/armor/belt/twigsleaves.ron +++ b/assets/common/items/armor/belt/twigsleaves.ron @@ -1,8 +1,12 @@ Item( name: "Leafy Belt", - description: "A belt woven from twigs and leaves.\n\n", + description: "A belt woven from twigs and leaves.", kind: Armor( - kind: Belt(Twigsleaves), - stats: (20), + ( + kind: Belt(Twigsleaves), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/assassin.ron b/assets/common/items/armor/chest/assassin.ron index ba969ddd30..cbe034b1f1 100644 --- a/assets/common/items/armor/chest/assassin.ron +++ b/assets/common/items/armor/chest/assassin.ron @@ -1,8 +1,12 @@ Item( name: "Assassin Chest", - description: "Chest\n\nArmor: 0\n\nOnly the best for a member of the creed.\n\n", + description: "Only the best for a member of the creed.", kind: Armor( - kind: Chest(Assassin), - stats: (20), + ( + kind: Chest(Assassin), + stats: ( + protection: Normal(6.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/cloth_blue_0.ron b/assets/common/items/armor/chest/cloth_blue_0.ron index a36d093faf..d2a69a427c 100644 --- a/assets/common/items/armor/chest/cloth_blue_0.ron +++ b/assets/common/items/armor/chest/cloth_blue_0.ron @@ -1,8 +1,12 @@ Item( name: "Blue Linen Chest", - description: "Chest\n\nArmor: 0\n\nSoft and warm\n\n", + description: "Soft and warm.", kind: Armor( - kind: Chest(ClothBlue0), - stats: (20), + ( + kind: Chest(ClothBlue0), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/cloth_green_0.ron b/assets/common/items/armor/chest/cloth_green_0.ron index 0098c1b869..840c3f1c37 100644 --- a/assets/common/items/armor/chest/cloth_green_0.ron +++ b/assets/common/items/armor/chest/cloth_green_0.ron @@ -1,8 +1,12 @@ Item( name: "Green Linen Chest", - description: "Chest\n\nArmor: 0\n\nSoft and warm\n\n", + description: "Soft and warm.", kind: Armor( - kind: Chest(ClothGreen0), - stats: (20), + ( + kind: Chest(ClothGreen0), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/cloth_purple_0.ron b/assets/common/items/armor/chest/cloth_purple_0.ron index fef6404226..b77ab71883 100644 --- a/assets/common/items/armor/chest/cloth_purple_0.ron +++ b/assets/common/items/armor/chest/cloth_purple_0.ron @@ -1,8 +1,12 @@ Item( name: "Purple Linen Chest", - description: "Chest\n\nArmor: 0\n\nSoft and warm\n\n", + description: "Soft and warm.", kind: Armor( - kind: Chest(ClothPurple0), - stats: (20), + ( + kind: Chest(ClothPurple0), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/cultist_chest_blue.ron b/assets/common/items/armor/chest/cultist_chest_blue.ron index 2039ea6d76..ddb8dcac4c 100644 --- a/assets/common/items/armor/chest/cultist_chest_blue.ron +++ b/assets/common/items/armor/chest/cultist_chest_blue.ron @@ -1,8 +1,12 @@ Item( name: "Blue Cultist Chest", - description: "Chest\n\nArmor: 0\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Chest(CultistBlue), - stats: (20), + ( + kind: Chest(CultistBlue), + stats: ( + protection: Normal(5.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/cultist_chest_purple.ron b/assets/common/items/armor/chest/cultist_chest_purple.ron index a3bf40b1ff..d043e49512 100644 --- a/assets/common/items/armor/chest/cultist_chest_purple.ron +++ b/assets/common/items/armor/chest/cultist_chest_purple.ron @@ -1,8 +1,12 @@ Item( name: "Purple Cultist Chest", - description: "Chest\n\nArmor: 0\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Chest(CultistPurple), - stats: (20), + ( + kind: Chest(CultistPurple), + stats: ( + protection: Normal(5.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/druid.ron b/assets/common/items/armor/chest/druid.ron index 71ad9e1bef..96855c249a 100644 --- a/assets/common/items/armor/chest/druid.ron +++ b/assets/common/items/armor/chest/druid.ron @@ -1,8 +1,12 @@ Item( name: "Druid's Vest", - description: "Druidic chest wrappings.\n\n", + description: "Druidic chest wrappings.", kind: Armor( - kind: Chest(Druid), - stats: (20), + ( + kind: Chest(Druid), + stats: ( + protection: Normal(6.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/leather_0.ron b/assets/common/items/armor/chest/leather_0.ron index 1135163213..21767b4c06 100644 --- a/assets/common/items/armor/chest/leather_0.ron +++ b/assets/common/items/armor/chest/leather_0.ron @@ -1,8 +1,12 @@ Item( name: "Swift Chest", - description: "Chest\n\nArmor: 0\n\nSwift like the wind.\n\n", + description: "Swift like the wind.", kind: Armor( - kind: Chest(Leather0), - stats: (20), + ( + kind: Chest(Leather0), + stats: ( + protection: Normal(10.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/leather_2.ron b/assets/common/items/armor/chest/leather_2.ron index 1a046a7942..75661e56a0 100644 --- a/assets/common/items/armor/chest/leather_2.ron +++ b/assets/common/items/armor/chest/leather_2.ron @@ -1,8 +1,12 @@ Item( name: "Leather Cuirass", - description: "A cuirass made of simple leather", + description: "A cuirass made of simple leather.", kind: Armor( - kind: Chest(Leather2), - stats: (20), + ( + kind: Chest(Leather2), + stats: ( + protection: Normal(10.0), + ), + ) ), ) \ No newline at end of file diff --git a/assets/common/items/armor/chest/plate_green_0.ron b/assets/common/items/armor/chest/plate_green_0.ron index aabc7ab943..dda388739b 100644 --- a/assets/common/items/armor/chest/plate_green_0.ron +++ b/assets/common/items/armor/chest/plate_green_0.ron @@ -1,8 +1,12 @@ Item( name: "Iron Chestplate", - description: "Chest\n\nArmor: 0\n\n", + description: "A chestplate forged from iron.", kind: Armor( - kind: Chest(PlateGreen0), - stats: (20), + ( + kind: Chest(PlateGreen0), + stats: ( + protection: Normal(20.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/steel_0.ron b/assets/common/items/armor/chest/steel_0.ron index c97a49a7c4..314bf57e95 100644 --- a/assets/common/items/armor/chest/steel_0.ron +++ b/assets/common/items/armor/chest/steel_0.ron @@ -1,8 +1,12 @@ Item( name: "Steel Cuirass", - description: "A cuirass of steel plate", + description: "A cuirass of steel plate.", kind: Armor( - kind: Chest(Steel0), - stats: (20), + ( + kind: Chest(Steel0), + stats: ( + protection: Normal(25.0), + ), + ) ), ) \ No newline at end of file diff --git a/assets/common/items/armor/chest/twig.ron b/assets/common/items/armor/chest/twig.ron index 6dd728f2bf..56c3584569 100644 --- a/assets/common/items/armor/chest/twig.ron +++ b/assets/common/items/armor/chest/twig.ron @@ -1,8 +1,12 @@ Item( name: "Twig Shirt", - description: "A shirt woven from twigs.\n\n", + description: "A shirt woven from twigs.", kind: Armor( - kind: Chest(Twig), - stats: (20), + ( + kind: Chest(Twig), + stats: ( + protection: Normal(15.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/twigsflowers.ron b/assets/common/items/armor/chest/twigsflowers.ron index 698ae8dc64..8b364b55e9 100644 --- a/assets/common/items/armor/chest/twigsflowers.ron +++ b/assets/common/items/armor/chest/twigsflowers.ron @@ -1,8 +1,12 @@ Item( name: "Flowery Shirt", - description: "A shirt woven from twigs and flowers.\n\n", + description: "A shirt woven from twigs and flowers.", kind: Armor( - kind: Chest(Twigsflowers), - stats: (20), + ( + kind: Chest(Twigsflowers), + stats: ( + protection: Normal(15.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/twigsleaves.ron b/assets/common/items/armor/chest/twigsleaves.ron index e1cc509b9e..336182d654 100644 --- a/assets/common/items/armor/chest/twigsleaves.ron +++ b/assets/common/items/armor/chest/twigsleaves.ron @@ -1,8 +1,12 @@ Item( name: "Leafy Shirt", - description: "A shirt woven from twigs and leaves.\n\n", + description: "A shirt woven from twigs and leaves.", kind: Armor( - kind: Chest(Twigsleaves), - stats: (20), + ( + kind: Chest(Twigsleaves), + stats: ( + protection: Normal(15.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/worker_green_0.ron b/assets/common/items/armor/chest/worker_green_0.ron index d474d10ddf..90f884c50b 100644 --- a/assets/common/items/armor/chest/worker_green_0.ron +++ b/assets/common/items/armor/chest/worker_green_0.ron @@ -1,8 +1,12 @@ Item( name: "Green Worker Shirt", - description: "Chest\n\nArmor: 0\n\n", + description: "Was used by a farmer, until recently.", kind: Armor( - kind: Chest(WorkerGreen0), - stats: (20), + ( + kind: Chest(WorkerGreen0), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/worker_green_1.ron b/assets/common/items/armor/chest/worker_green_1.ron index bae09a6fe9..5a52626017 100644 --- a/assets/common/items/armor/chest/worker_green_1.ron +++ b/assets/common/items/armor/chest/worker_green_1.ron @@ -1,8 +1,12 @@ Item( name: "Green Worker Shirt", - description: "Chest\n\nArmor: 0\n\n", + description: "Was used by a farmer, until recently.", kind: Armor( - kind: Chest(WorkerGreen1), - stats: (20), + ( + kind: Chest(WorkerGreen1), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/worker_orange_0.ron b/assets/common/items/armor/chest/worker_orange_0.ron index 6de8ffca79..a65db86c4e 100644 --- a/assets/common/items/armor/chest/worker_orange_0.ron +++ b/assets/common/items/armor/chest/worker_orange_0.ron @@ -1,8 +1,12 @@ Item( name: "Orange Worker Shirt", - description: "Chest\n\nArmor: 0\n\n", + description: "Was used by a farmer, until recently.", kind: Armor( - kind: Chest(WorkerOrange0), - stats: (20), + ( + kind: Chest(WorkerOrange0), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/worker_orange_1.ron b/assets/common/items/armor/chest/worker_orange_1.ron index 02e1f57b77..b0e41761c1 100644 --- a/assets/common/items/armor/chest/worker_orange_1.ron +++ b/assets/common/items/armor/chest/worker_orange_1.ron @@ -1,8 +1,12 @@ Item( name: "Orange Worker Shirt", - description: "Chest\n\nArmor: 0\n\n", + description: "Was used by a farmer, until recently.", kind: Armor( - kind: Chest(WorkerOrange1), - stats: (20), + ( + kind: Chest(WorkerOrange1), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/worker_purple_0.ron b/assets/common/items/armor/chest/worker_purple_0.ron index f9fc9b26a5..b8dd21d140 100644 --- a/assets/common/items/armor/chest/worker_purple_0.ron +++ b/assets/common/items/armor/chest/worker_purple_0.ron @@ -1,8 +1,12 @@ Item( name: "Purple Worker Shirt", - description: "Chest\n\nArmor: 0\n\n", + description: "Was used by a farmer, until recently.", kind: Armor( - kind: Chest(WorkerPurple0), - stats: (20), + ( + kind: Chest(WorkerPurple0), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/worker_purple_1.ron b/assets/common/items/armor/chest/worker_purple_1.ron index b183b6607b..f6782a1632 100644 --- a/assets/common/items/armor/chest/worker_purple_1.ron +++ b/assets/common/items/armor/chest/worker_purple_1.ron @@ -1,8 +1,12 @@ Item( name: "Purple Worker Shirt", - description: "Chest\n\nArmor: 0\n\n", + description: "Was used by a farmer, until recently.", kind: Armor( - kind: Chest(WorkerPurple1), - stats: (20), + ( + kind: Chest(WorkerPurple1), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/worker_red_0.ron b/assets/common/items/armor/chest/worker_red_0.ron index 0cbdffed32..62f3159ace 100644 --- a/assets/common/items/armor/chest/worker_red_0.ron +++ b/assets/common/items/armor/chest/worker_red_0.ron @@ -1,8 +1,12 @@ Item( name: "Red Worker Shirt", - description: "Chest\n\nArmor: 0\n\n", + description: "Was used by a farmer, until recently.", kind: Armor( - kind: Chest(WorkerRed0), - stats: (20), + ( + kind: Chest(WorkerRed0), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/worker_red_1.ron b/assets/common/items/armor/chest/worker_red_1.ron index 5edb6ef876..a1a3b5eda7 100644 --- a/assets/common/items/armor/chest/worker_red_1.ron +++ b/assets/common/items/armor/chest/worker_red_1.ron @@ -1,8 +1,12 @@ Item( name: "Red Worker Shirt", - description: "Chest\n\nArmor: 0\n\n", + description: "Was used by a farmer, until recently.", kind: Armor( - kind: Chest(WorkerRed1), - stats: (20), + ( + kind: Chest(WorkerRed1), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/worker_yellow_0.ron b/assets/common/items/armor/chest/worker_yellow_0.ron index c79a242550..0d625111f8 100644 --- a/assets/common/items/armor/chest/worker_yellow_0.ron +++ b/assets/common/items/armor/chest/worker_yellow_0.ron @@ -1,8 +1,12 @@ Item( name: "Yellow Worker Shirt", - description: "Chest\n\nArmor: 0\n\n", + description: "Was used by a farmer, until recently.", kind: Armor( - kind: Chest(WorkerYellow0), - stats: (20), + ( + kind: Chest(WorkerYellow0), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/chest/worker_yellow_1.ron b/assets/common/items/armor/chest/worker_yellow_1.ron index 2200e50e91..85d69c6a98 100644 --- a/assets/common/items/armor/chest/worker_yellow_1.ron +++ b/assets/common/items/armor/chest/worker_yellow_1.ron @@ -1,8 +1,12 @@ Item( name: "Yellow Worker Shirt", - description: "Chest\n\nArmor: 0\n\n", + description: "Was used by a farmer, until recently.", kind: Armor( - kind: Chest(WorkerYellow1), - stats: (20), + ( + kind: Chest(WorkerYellow1), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/foot/assassin.ron b/assets/common/items/armor/foot/assassin.ron index 6fd150c332..2b3c47390c 100644 --- a/assets/common/items/armor/foot/assassin.ron +++ b/assets/common/items/armor/foot/assassin.ron @@ -1,8 +1,12 @@ Item( name: "Assassin Boots", - description: "Feet\n\nArmor: 0\n\nOnly the best for a member of the creed.\n\n", + description: "Only the best for a member of the creed.", kind: Armor( - kind: Foot(Assassin), - stats: (20), + ( + kind: Foot(Assassin), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/foot/cloth_blue_0.ron b/assets/common/items/armor/foot/cloth_blue_0.ron index 77c9b299db..239b32ca05 100644 --- a/assets/common/items/armor/foot/cloth_blue_0.ron +++ b/assets/common/items/armor/foot/cloth_blue_0.ron @@ -1,8 +1,12 @@ Item( name: "Blue Linen Boots", - description: "Feet\n\nArmor: 0\n\nSoft and warm\n\n", + description: "Soft and warm.", kind: Armor( - kind: Foot(ClothBlue0), - stats: (20), + ( + kind: Foot(ClothBlue0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/foot/cloth_green_0.ron b/assets/common/items/armor/foot/cloth_green_0.ron index b2eccab1f2..66586701a0 100644 --- a/assets/common/items/armor/foot/cloth_green_0.ron +++ b/assets/common/items/armor/foot/cloth_green_0.ron @@ -1,8 +1,12 @@ Item( name: "Green Linen Boots", - description: "Feet\n\nArmor: 0\n\nSoft and warm\n\n", + description: "Soft and warm.", kind: Armor( - kind: Foot(ClothGreen0), - stats: (20), + ( + kind: Foot(ClothGreen0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/foot/cloth_purple_0.ron b/assets/common/items/armor/foot/cloth_purple_0.ron index 77db769d55..fcc1e9b15d 100644 --- a/assets/common/items/armor/foot/cloth_purple_0.ron +++ b/assets/common/items/armor/foot/cloth_purple_0.ron @@ -1,8 +1,12 @@ Item( name: "Purple Linen Boots", - description: "Feet\n\nArmor: 0\n\nSoft and warm\n\n", + description: "Soft and warm.", kind: Armor( - kind: Foot(ClothPurple0), - stats: (20), + ( + kind: Foot(ClothPurple0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/foot/cultist_boots.ron b/assets/common/items/armor/foot/cultist_boots.ron index 70d134e5fe..d24453912e 100644 --- a/assets/common/items/armor/foot/cultist_boots.ron +++ b/assets/common/items/armor/foot/cultist_boots.ron @@ -1,8 +1,12 @@ Item( name: "Cultist Boots", - description: "Feet\n\nArmor: 0\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Foot(Cultist), - stats: (20), + ( + kind: Foot(Cultist), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/foot/druid.ron b/assets/common/items/armor/foot/druid.ron index ceb8f5979f..51cd2072d4 100644 --- a/assets/common/items/armor/foot/druid.ron +++ b/assets/common/items/armor/foot/druid.ron @@ -1,8 +1,12 @@ Item( name: "Druid's Slippers", - description: "For treading softly through the woods.\n\n", + description: "For treading softly through the woods.", kind: Armor( - kind: Foot(Druid), - stats: (20), + ( + kind: Foot(Druid), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/foot/jackalope_slippers.ron b/assets/common/items/armor/foot/jackalope_slippers.ron index bd0804c5d3..751dce12a3 100644 --- a/assets/common/items/armor/foot/jackalope_slippers.ron +++ b/assets/common/items/armor/foot/jackalope_slippers.ron @@ -1,8 +1,12 @@ Item( name: "Fluffy Jackalope Slippers", - description: "So warm and cozy!\n\n", + description: "So warm and cozy!", kind: Armor( - kind: Foot(JackalopeSlips), - stats: (20), + ( + kind: Foot(JackalopeSlips), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/foot/leather_0.ron b/assets/common/items/armor/foot/leather_0.ron index 7e811efc3a..bd508944de 100644 --- a/assets/common/items/armor/foot/leather_0.ron +++ b/assets/common/items/armor/foot/leather_0.ron @@ -1,8 +1,12 @@ Item( name: "Swift Boots", - description: "Feet\n\nArmor: 0\n\nSwift like the wind.\nWon't make you run faster.\n\n", + description: "Swift like the wind.", kind: Armor( - kind: Foot(Leather0), - stats: (20), + ( + kind: Foot(Leather0), + stats: ( + protection: Normal(2.0), + ), + ) ), ) diff --git a/assets/common/items/armor/foot/leather_2.ron b/assets/common/items/armor/foot/leather_2.ron index ad91562bb3..6fe2ce0c6f 100644 --- a/assets/common/items/armor/foot/leather_2.ron +++ b/assets/common/items/armor/foot/leather_2.ron @@ -1,8 +1,12 @@ Item( name: "Leather Boots", - description: "Boots made of simple leather", + description: "Boots made of simple leather.", kind: Armor( - kind: Foot(Leather2), - stats: (20), + ( + kind: Foot(Leather2), + stats: ( + protection: Normal(2.0), + ), + ) ), ) diff --git a/assets/common/items/armor/foot/plate_0.ron b/assets/common/items/armor/foot/plate_0.ron index 21dc0fe27c..fd9c41bb15 100644 --- a/assets/common/items/armor/foot/plate_0.ron +++ b/assets/common/items/armor/foot/plate_0.ron @@ -1,8 +1,12 @@ Item( name: "Iron Feet", - description: "Feet\n\nArmor: 0\n\n", + description: "Boots forged from iron.", kind: Armor( - kind: Foot(Plate0), - stats: (20), + ( + kind: Foot(Plate0), + stats: ( + protection: Normal(4.0), + ), + ) ), ) diff --git a/assets/common/items/armor/foot/steel_0.ron b/assets/common/items/armor/foot/steel_0.ron index ccd47f75fb..5b39db22e4 100644 --- a/assets/common/items/armor/foot/steel_0.ron +++ b/assets/common/items/armor/foot/steel_0.ron @@ -1,8 +1,12 @@ Item( name: "Steel Boots", - description: "Boots plated in steel", + description: "Boots forged from steel.", kind: Armor( - kind: Foot(Steel0), - stats: (20), + ( + kind: Foot(Steel0), + stats: ( + protection: Normal(5.0), + ), + ) ), ) diff --git a/assets/common/items/armor/foot/twig.ron b/assets/common/items/armor/foot/twig.ron index e367a857dd..742c7b1cc9 100644 --- a/assets/common/items/armor/foot/twig.ron +++ b/assets/common/items/armor/foot/twig.ron @@ -1,8 +1,12 @@ Item( name: "Twig Boots", - description: "Boots woven from twigs.\n\n", + description: "Boots woven from twigs.", kind: Armor( - kind: Foot(Twig), - stats: (20), + ( + kind: Foot(Twig), + stats: ( + protection: Normal(3.0), + ), + ) ), ) diff --git a/assets/common/items/armor/foot/twigsflowers.ron b/assets/common/items/armor/foot/twigsflowers.ron index fda0a894fc..ec1918a11b 100644 --- a/assets/common/items/armor/foot/twigsflowers.ron +++ b/assets/common/items/armor/foot/twigsflowers.ron @@ -1,8 +1,12 @@ Item( name: "Flowery Boots", - description: "Boots woven from twigs and flowers.\n\n", + description: "Boots woven from twigs and flowers.", kind: Armor( - kind: Foot(Twigsflowers), - stats: (20), + ( + kind: Foot(Twigsflowers), + stats: ( + protection: Normal(3.0), + ), + ) ), ) diff --git a/assets/common/items/armor/foot/twigsleaves.ron b/assets/common/items/armor/foot/twigsleaves.ron index 7aed59cedd..7dfa97ac34 100644 --- a/assets/common/items/armor/foot/twigsleaves.ron +++ b/assets/common/items/armor/foot/twigsleaves.ron @@ -1,8 +1,12 @@ Item( name: "Leafy Boots", - description: "Boots woven from twigs and leaves.\n\n", + description: "Boots woven from twigs and leaves.", kind: Armor( - kind: Foot(Twigsleaves), - stats: (20), + ( + kind: Foot(Twigsleaves), + stats: ( + protection: Normal(3.0), + ), + ) ), ) diff --git a/assets/common/items/armor/hand/assassin.ron b/assets/common/items/armor/hand/assassin.ron index 8e923a13d4..9b635f7a0d 100644 --- a/assets/common/items/armor/hand/assassin.ron +++ b/assets/common/items/armor/hand/assassin.ron @@ -1,8 +1,12 @@ Item( name: "Assassin Gloves", - description: "Hands\n\nArmor: 0\n\nOnly the best for a member of the creed.\n\n", + description: "Only the best for a member of the creed.", kind: Armor( - kind: Hand(Assassin), - stats: (20), + ( + kind: Hand(Assassin), + stats: ( + protection: Normal(2.0), + ), + ) ), ) diff --git a/assets/common/items/armor/hand/cloth_blue_0.ron b/assets/common/items/armor/hand/cloth_blue_0.ron index f692f8123f..9fcc19d577 100644 --- a/assets/common/items/armor/hand/cloth_blue_0.ron +++ b/assets/common/items/armor/hand/cloth_blue_0.ron @@ -1,8 +1,12 @@ Item( name: "Blue Linen Wrists", - description: "Hands\n\nArmor: 0\n\n", + description: "A strip of cloth.", kind: Armor( - kind: Hand(ClothBlue0), - stats: (20), + ( + kind: Hand(ClothBlue0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/hand/cloth_green_0.ron b/assets/common/items/armor/hand/cloth_green_0.ron index 5a20af9f12..face79a1d4 100644 --- a/assets/common/items/armor/hand/cloth_green_0.ron +++ b/assets/common/items/armor/hand/cloth_green_0.ron @@ -1,8 +1,12 @@ Item( name: "Green Linen Wrists", - description: "Hands\n\nArmor: 0\n\n", + description: "A strip of cloth.", kind: Armor( - kind: Hand(ClothGreen0), - stats: (20), + ( + kind: Hand(ClothGreen0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/hand/cloth_purple_0.ron b/assets/common/items/armor/hand/cloth_purple_0.ron index f4c99713f6..5946dddd2f 100644 --- a/assets/common/items/armor/hand/cloth_purple_0.ron +++ b/assets/common/items/armor/hand/cloth_purple_0.ron @@ -1,8 +1,12 @@ Item( name: "Purple Silk Wrists", - description: "Hands\n\nArmor: 0\n\n", + description: "A strip of cloth.", kind: Armor( - kind: Hand(ClothPurple0), - stats: (20), + ( + kind: Hand(ClothPurple0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/hand/cultist_hands_blue.ron b/assets/common/items/armor/hand/cultist_hands_blue.ron index c6d3076b58..32875de0cd 100644 --- a/assets/common/items/armor/hand/cultist_hands_blue.ron +++ b/assets/common/items/armor/hand/cultist_hands_blue.ron @@ -1,8 +1,12 @@ Item( name: "Blue Cultist Gloves", - description: "Hands\n\nArmor: 0\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Hand(CultistBlue), - stats: (20), + ( + kind: Hand(CultistBlue), + stats: ( + protection: Normal(2.0), + ), + ) ), ) diff --git a/assets/common/items/armor/hand/cultist_hands_purple.ron b/assets/common/items/armor/hand/cultist_hands_purple.ron index fb89f73edd..3df26460d4 100644 --- a/assets/common/items/armor/hand/cultist_hands_purple.ron +++ b/assets/common/items/armor/hand/cultist_hands_purple.ron @@ -1,8 +1,12 @@ Item( name: "Purple Cultist Gloves", - description: "Hands\n\nArmor: 0\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Hand(CultistPurple), - stats: (20), + ( + kind: Hand(CultistPurple), + stats: ( + protection: Normal(2.0), + ), + ) ), ) diff --git a/assets/common/items/armor/hand/druid.ron b/assets/common/items/armor/hand/druid.ron index 63400b0f1f..ddb12753a7 100644 --- a/assets/common/items/armor/hand/druid.ron +++ b/assets/common/items/armor/hand/druid.ron @@ -1,8 +1,12 @@ Item( name: "Druid's Gloves", - description: "Soft, strong, and flexible.\n\n", + description: "Soft, strong, and flexible.", kind: Armor( - kind: Hand(Druid), - stats: (20), + ( + kind: Hand(Druid), + stats: ( + protection: Normal(2.0), + ), + ) ), ) diff --git a/assets/common/items/armor/hand/leather_0.ron b/assets/common/items/armor/hand/leather_0.ron index d19024f3e7..050623f3c3 100644 --- a/assets/common/items/armor/hand/leather_0.ron +++ b/assets/common/items/armor/hand/leather_0.ron @@ -1,8 +1,12 @@ Item( name: "Swift Gloves", - description: "Hands\n\nArmor: 0\n\nSwift like the wind.\n\n", + description: "Swift like the wind.", kind: Armor( - kind: Hand(Leather0), - stats: (20), + ( + kind: Hand(Leather0), + stats: ( + protection: Normal(4.0), + ), + ) ), ) diff --git a/assets/common/items/armor/hand/leather_2.ron b/assets/common/items/armor/hand/leather_2.ron index 22b52d99a1..639b1ba37a 100644 --- a/assets/common/items/armor/hand/leather_2.ron +++ b/assets/common/items/armor/hand/leather_2.ron @@ -1,8 +1,12 @@ Item( name: "Leather Gloves", - description: "Gloves made of simple leather", + description: "Gloves made of simple leather.", kind: Armor( - kind: Hand(Leather2), - stats: (20), + ( + kind: Hand(Leather2), + stats: ( + protection: Normal(4.0), + ), + ) ), ) diff --git a/assets/common/items/armor/hand/plate_0.ron b/assets/common/items/armor/hand/plate_0.ron index 516aab8625..20242b87ed 100644 --- a/assets/common/items/armor/hand/plate_0.ron +++ b/assets/common/items/armor/hand/plate_0.ron @@ -1,8 +1,12 @@ Item( name: "Iron Handguards", - description: "Hands\n\nArmor: 0\n\n", + description: "Gauntlets forged from iron.", kind: Armor( - kind: Hand(Plate0), - stats: (20), + ( + kind: Hand(Plate0), + stats: ( + protection: Normal(8.0), + ), + ) ), ) diff --git a/assets/common/items/armor/hand/steel_0.ron b/assets/common/items/armor/hand/steel_0.ron index ad7e237adc..6978576802 100644 --- a/assets/common/items/armor/hand/steel_0.ron +++ b/assets/common/items/armor/hand/steel_0.ron @@ -1,8 +1,12 @@ Item( name: "Steel Gauntlets", - description: "Gauntlets made of steel", + description: "Gauntlets forged from steel.", kind: Armor( - kind: Hand(Steel0), - stats: (20), + ( + kind: Hand(Steel0), + stats: ( + protection: Normal(10.0), + ), + ) ), ) diff --git a/assets/common/items/armor/hand/twig.ron b/assets/common/items/armor/hand/twig.ron index bf61fe0209..9cb73a911b 100644 --- a/assets/common/items/armor/hand/twig.ron +++ b/assets/common/items/armor/hand/twig.ron @@ -1,8 +1,12 @@ Item( name: "Twig Wraps", - description: "Handwraps woven from twigs.\n\n", + description: "Handwraps woven from twigs.", kind: Armor( - kind: Hand(Twig), - stats: (20), + ( + kind: Hand(Twig), + stats: ( + protection: Normal(6.0), + ), + ) ), ) diff --git a/assets/common/items/armor/hand/twigsflowers.ron b/assets/common/items/armor/hand/twigsflowers.ron index 68cbc953aa..04a6f4b098 100644 --- a/assets/common/items/armor/hand/twigsflowers.ron +++ b/assets/common/items/armor/hand/twigsflowers.ron @@ -1,8 +1,12 @@ Item( name: "Flowery Wraps", - description: "Handwraps woven from twigs and flowers.\n\n", + description: "Handwraps woven from twigs and flowers.", kind: Armor( - kind: Hand(Twigsflowers), - stats: (20), + ( + kind: Hand(Twigsflowers), + stats: ( + protection: Normal(6.0), + ), + ) ), ) diff --git a/assets/common/items/armor/hand/twigsleaves.ron b/assets/common/items/armor/hand/twigsleaves.ron index 13337ae564..8226c3d103 100644 --- a/assets/common/items/armor/hand/twigsleaves.ron +++ b/assets/common/items/armor/hand/twigsleaves.ron @@ -1,8 +1,12 @@ Item( name: "Leafy Wraps", - description: "Handwraps woven from twigs and leaves.\n\n", + description: "Handwraps woven from twigs and leaves.", kind: Armor( - kind: Hand(Twigsleaves), - stats: (20), + ( + kind: Hand(Twigsleaves), + stats: ( + protection: Normal(6.0), + ), + ) ), ) diff --git a/assets/common/items/armor/head/assa_mask_0.ron b/assets/common/items/armor/head/assa_mask_0.ron index 236ea82ef3..2ee38ca25e 100644 --- a/assets/common/items/armor/head/assa_mask_0.ron +++ b/assets/common/items/armor/head/assa_mask_0.ron @@ -1,8 +1,12 @@ Item( name: "Dark Assassin Mask", - description: "Head\n\nArmor: 0\n\n", + description: "Used to obscure your face.", kind: Armor( - kind: Head(AssaMask0), - stats: (20), + ( + kind: Head(AssaMask0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/head/leather_0.ron b/assets/common/items/armor/head/leather_0.ron index c568860917..9ce5ba6814 100644 --- a/assets/common/items/armor/head/leather_0.ron +++ b/assets/common/items/armor/head/leather_0.ron @@ -1,8 +1,12 @@ Item( name: "Swift Leather Cap", - description: "Head\n\nArmor: 0\n\n", + description: "Swift like the wind.", kind: Armor( - kind: Head(Leather0), - stats: (20), + ( + kind: Head(Leather0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/neck/neck_0.ron b/assets/common/items/armor/neck/neck_0.ron index d170113336..e8b25c6f58 100644 --- a/assets/common/items/armor/neck/neck_0.ron +++ b/assets/common/items/armor/neck/neck_0.ron @@ -1,8 +1,12 @@ Item( name: "Plain Necklace", - description: "Neck\n\nArmor: 0\n\n", + description: "It's become tarnished with age.", kind: Armor( - kind: Neck(Neck0), - stats: (20), + ( + kind: Neck(Neck0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/assassin.ron b/assets/common/items/armor/pants/assassin.ron index 3fce548e9a..be00f18aa6 100644 --- a/assets/common/items/armor/pants/assassin.ron +++ b/assets/common/items/armor/pants/assassin.ron @@ -1,8 +1,12 @@ Item( name: "Assassin Pants", - description: "Legs\n\nArmor: 0\n\nOnly the best for a member of the creed.\n\n", + description: "Only the best for a member of the creed.", kind: Armor( - kind: Pants(Assassin), - stats: (20), + ( + kind: Pants(Assassin), + stats: ( + protection: Normal(5.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/cloth_blue_0.ron b/assets/common/items/armor/pants/cloth_blue_0.ron index 2b0dc7e163..52ebc0c3a5 100644 --- a/assets/common/items/armor/pants/cloth_blue_0.ron +++ b/assets/common/items/armor/pants/cloth_blue_0.ron @@ -1,8 +1,12 @@ Item( name: "Blue Linen Skirt", - description: "Legs\n\nArmor: 0\n\n", + description: "A skirt made from linen.", kind: Armor( - kind: Pants(ClothBlue0), - stats: (20), + ( + kind: Pants(ClothBlue0), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/cloth_green_0.ron b/assets/common/items/armor/pants/cloth_green_0.ron index b184717ccf..364e058cee 100644 --- a/assets/common/items/armor/pants/cloth_green_0.ron +++ b/assets/common/items/armor/pants/cloth_green_0.ron @@ -1,8 +1,12 @@ Item( name: "Green Linen Skirt", - description: "Legs\n\nArmor: 0\n\n", + description: "A skirt made from linen.", kind: Armor( - kind: Pants(ClothGreen0), - stats: (20), + ( + kind: Pants(ClothGreen0), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/cloth_purple_0.ron b/assets/common/items/armor/pants/cloth_purple_0.ron index f37662b7db..efcd70f574 100644 --- a/assets/common/items/armor/pants/cloth_purple_0.ron +++ b/assets/common/items/armor/pants/cloth_purple_0.ron @@ -1,8 +1,12 @@ Item( name: "Purple Linen Skirt", - description: "Legs\n\nArmor: 0\n\n", + description: "A skirt made from linen.", kind: Armor( - kind: Pants(ClothPurple0), - stats: (20), + ( + kind: Pants(ClothPurple0), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/cultist_legs_blue.ron b/assets/common/items/armor/pants/cultist_legs_blue.ron index 5ad8a8c25a..33fe4c2826 100644 --- a/assets/common/items/armor/pants/cultist_legs_blue.ron +++ b/assets/common/items/armor/pants/cultist_legs_blue.ron @@ -1,8 +1,12 @@ Item( name: "Blue Cultist Skirt", - description: "Legs\n\nArmor: 0\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Pants(CultistBlue), - stats: (20), + ( + kind: Pants(CultistBlue), + stats: ( + protection: Normal(3.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/cultist_legs_purple.ron b/assets/common/items/armor/pants/cultist_legs_purple.ron index 39550047d6..a6e7cdb7a5 100644 --- a/assets/common/items/armor/pants/cultist_legs_purple.ron +++ b/assets/common/items/armor/pants/cultist_legs_purple.ron @@ -1,8 +1,12 @@ Item( name: "Purple Cultist Skirt", - description: "Legs\n\nArmor: 0\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Pants(CultistPurple), - stats: (20), + ( + kind: Pants(CultistPurple), + stats: ( + protection: Normal(3.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/druid.ron b/assets/common/items/armor/pants/druid.ron index d4b635d4ff..f1e35bac41 100644 --- a/assets/common/items/armor/pants/druid.ron +++ b/assets/common/items/armor/pants/druid.ron @@ -1,8 +1,12 @@ Item( name: "Druid's Kilt", - description: "Feel the breeze!\n\n", + description: "Feel the breeze!", kind: Armor( - kind: Pants(Druid), - stats: (20), + ( + kind: Pants(Druid), + stats: ( + protection: Normal(4.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/hunting.ron b/assets/common/items/armor/pants/hunting.ron index bd30d1801f..16dbf0d1c8 100644 --- a/assets/common/items/armor/pants/hunting.ron +++ b/assets/common/items/armor/pants/hunting.ron @@ -1,8 +1,12 @@ Item( name: "Hunting Pants", - description: "Crafted from soft, supple leather\n\n", + description: "Crafted from soft, supple leather.", kind: Armor( - kind: Pants(Hunting), - stats: (20), + ( + kind: Pants(Hunting), + stats: ( + protection: Normal(8.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/leather_0.ron b/assets/common/items/armor/pants/leather_0.ron index 8eb99060d7..cf7b058a02 100644 --- a/assets/common/items/armor/pants/leather_0.ron +++ b/assets/common/items/armor/pants/leather_0.ron @@ -1,8 +1,12 @@ Item( name: "Swift Pants", - description: "Legs\n\nArmor: 0\n\n", + description: "Swift like the wind.", kind: Armor( - kind: Pants(Leather0), - stats: (20), + ( + kind: Pants(Leather0), + stats: ( + protection: Normal(8.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/leather_2.ron b/assets/common/items/armor/pants/leather_2.ron index 31b55c6f62..05d4fcf9df 100644 --- a/assets/common/items/armor/pants/leather_2.ron +++ b/assets/common/items/armor/pants/leather_2.ron @@ -1,8 +1,12 @@ Item( name: "Leather Leg Armour", - description: "Leg armour made of simple leather", + description: "Leg armour made of simple leather.", kind: Armor( - kind: Pants(Leather2), - stats: (20), + ( + kind: Pants(Leather2), + stats: ( + protection: Normal(8.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/plate_green_0.ron b/assets/common/items/armor/pants/plate_green_0.ron index 3194cac534..d1167a6934 100644 --- a/assets/common/items/armor/pants/plate_green_0.ron +++ b/assets/common/items/armor/pants/plate_green_0.ron @@ -1,8 +1,12 @@ Item( name: "Iron Legguards", - description: "Legs\n\nArmor: 0\n\n", + description: "Greaves forged from iron.", kind: Armor( - kind: Pants(PlateGreen0), - stats: (20), + ( + kind: Pants(PlateGreen0), + stats: ( + protection: Normal(16.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/steel_0.ron b/assets/common/items/armor/pants/steel_0.ron index aed385a94d..7349351884 100644 --- a/assets/common/items/armor/pants/steel_0.ron +++ b/assets/common/items/armor/pants/steel_0.ron @@ -1,8 +1,12 @@ Item( name: "Steel Chausses", - description: "Leg armour made of steel plates", + description: "Greaves forged from steel.", kind: Armor( - kind: Pants(Steel0), - stats: (20), + ( + kind: Pants(Steel0), + stats: ( + protection: Normal(20.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/twig.ron b/assets/common/items/armor/pants/twig.ron index 0cbb923d0e..8dfa916027 100644 --- a/assets/common/items/armor/pants/twig.ron +++ b/assets/common/items/armor/pants/twig.ron @@ -1,8 +1,12 @@ Item( name: "Twig Pants", - description: "Pants woven from twigs. Chafey!\n\n", + description: "Pants woven from twigs. Chafey!", kind: Armor( - kind: Pants(Twig), - stats: (20), + ( + kind: Pants(Twig), + stats: ( + protection: Normal(12.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/twigsflowers.ron b/assets/common/items/armor/pants/twigsflowers.ron index abed6274eb..2af4112492 100644 --- a/assets/common/items/armor/pants/twigsflowers.ron +++ b/assets/common/items/armor/pants/twigsflowers.ron @@ -1,8 +1,12 @@ Item( name: "Flowery Pants", - description: "Pants woven from twigs and flowers. Fragrant!\n\n", + description: "Pants woven from twigs and flowers. Fragrant!", kind: Armor( - kind: Pants(Twigsflowers), - stats: (20), + ( + kind: Pants(Twigsflowers), + stats: ( + protection: Normal(12.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/twigsleaves.ron b/assets/common/items/armor/pants/twigsleaves.ron index 803993b8d0..14065ef14c 100644 --- a/assets/common/items/armor/pants/twigsleaves.ron +++ b/assets/common/items/armor/pants/twigsleaves.ron @@ -1,8 +1,12 @@ Item( name: "Leafy Pants", - description: "Pants woven from twigs and leaves. Slightly less chafey than the twig pants!\n\n", + description: "Pants woven from twigs and leaves. Slightly less chafey than the twig pants!", kind: Armor( - kind: Pants(Twigsleaves), - stats: (20), + ( + kind: Pants(Twigsleaves), + stats: ( + protection: Normal(12.0), + ), + ) ), ) diff --git a/assets/common/items/armor/pants/worker_blue_0.ron b/assets/common/items/armor/pants/worker_blue_0.ron index 8fc56c4ee6..bd9f2a7916 100644 --- a/assets/common/items/armor/pants/worker_blue_0.ron +++ b/assets/common/items/armor/pants/worker_blue_0.ron @@ -1,8 +1,12 @@ Item( name: "Blue Worker Pants", - description: "Legs\n\nArmor: 0\n\n", + description: "Pants used by a farmer, until recently.", kind: Armor( - kind: Pants(WorkerBlue0), - stats: (20), + ( + kind: Pants(WorkerBlue0), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/ring/ring_0.ron b/assets/common/items/armor/ring/ring_0.ron index d0448912f3..daa0914bbd 100644 --- a/assets/common/items/armor/ring/ring_0.ron +++ b/assets/common/items/armor/ring/ring_0.ron @@ -1,8 +1,12 @@ Item( name: "Scratched Ring", - description: "Ring\n\nBarely fits your finger.\n\n", + description: "Barely fits your finger.", kind: Armor( - kind: Ring(Ring0), - stats: (20), + ( + kind: Ring(Ring0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/assassin.ron b/assets/common/items/armor/shoulder/assassin.ron index bff3ac8131..a3dbee15aa 100644 --- a/assets/common/items/armor/shoulder/assassin.ron +++ b/assets/common/items/armor/shoulder/assassin.ron @@ -1,8 +1,12 @@ Item( name: "Assassin Shoulder Guard", - description: "Shoulders\n\nArmor: 0\n\nOnly the best for a member of the creed.\n\n", + description: "Only the best for a member of the creed.", kind: Armor( - kind: Shoulder(Assassin), - stats: (20), + ( + kind: Shoulder(Assassin), + stats: ( + protection: Normal(3.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/cloth_blue_0.ron b/assets/common/items/armor/shoulder/cloth_blue_0.ron index 7c19790bd8..432ae4af55 100644 --- a/assets/common/items/armor/shoulder/cloth_blue_0.ron +++ b/assets/common/items/armor/shoulder/cloth_blue_0.ron @@ -1,8 +1,12 @@ Item( name: "Blue Linen Coat", - description: "Shoulders\n\nArmor: 0\n\n", + description: "A warm coat.", kind: Armor( - kind: Shoulder(ClothBlue0), - stats: (20), + ( + kind: Shoulder(ClothBlue0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/cloth_blue_1.ron b/assets/common/items/armor/shoulder/cloth_blue_1.ron index c63a33dbd3..d435fc8ebf 100644 --- a/assets/common/items/armor/shoulder/cloth_blue_1.ron +++ b/assets/common/items/armor/shoulder/cloth_blue_1.ron @@ -1,8 +1,12 @@ Item( name: "Blue Cloth Pads", - description: "Simple shoulderpads made from blue cloth.\n\n", + description: "Simple shoulderpads made from blue cloth.", kind: Armor( - kind: Shoulder(ClothBlue1), - stats: (20), + ( + kind: Shoulder(ClothBlue1), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/cloth_green_0.ron b/assets/common/items/armor/shoulder/cloth_green_0.ron index b3362a8d82..d9eaa35359 100644 --- a/assets/common/items/armor/shoulder/cloth_green_0.ron +++ b/assets/common/items/armor/shoulder/cloth_green_0.ron @@ -1,8 +1,12 @@ Item( name: "Green Linen Coat", - description: "Shoulders\n\nArmor: 0\n\n", + description: "A warm coat.", kind: Armor( - kind: Shoulder(ClothGreen0), - stats: (20), + ( + kind: Shoulder(ClothGreen0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/cloth_purple_0.ron b/assets/common/items/armor/shoulder/cloth_purple_0.ron index ecf434a9b3..10a73ef105 100644 --- a/assets/common/items/armor/shoulder/cloth_purple_0.ron +++ b/assets/common/items/armor/shoulder/cloth_purple_0.ron @@ -1,8 +1,12 @@ Item( name: "Purple Linen Coat", - description: "Shoulders\n\nArmor: 0\n\n", + description: "A warm coat.", kind: Armor( - kind: Shoulder(ClothPurple0), - stats: (20), + ( + kind: Shoulder(ClothPurple0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/cultist_shoulder_blue.ron b/assets/common/items/armor/shoulder/cultist_shoulder_blue.ron index 1e4d3965c8..a7df2169aa 100644 --- a/assets/common/items/armor/shoulder/cultist_shoulder_blue.ron +++ b/assets/common/items/armor/shoulder/cultist_shoulder_blue.ron @@ -1,8 +1,12 @@ Item( name: "Blue Cultist Mantle", - description: "Shoulders\n\nArmor: 0\n\nA strong shoulder to lean on.\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Shoulder(CultistBlue), - stats: (20), + ( + kind: Shoulder(CultistBlue), + stats: ( + protection: Normal(3.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/cultist_shoulder_purple.ron b/assets/common/items/armor/shoulder/cultist_shoulder_purple.ron index 095d218bf3..3d01973bff 100644 --- a/assets/common/items/armor/shoulder/cultist_shoulder_purple.ron +++ b/assets/common/items/armor/shoulder/cultist_shoulder_purple.ron @@ -1,8 +1,12 @@ Item( name: "Purple Cultist Mantle", - description: "Shoulders\n\nArmor: 0\n\nA strong shoulder to lean on.\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Shoulder(CultistPurple), - stats: (20), + ( + kind: Shoulder(CultistPurple), + stats: ( + protection: Normal(3.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/druidshoulder.ron b/assets/common/items/armor/shoulder/druidshoulder.ron index b17c658c28..7f88373304 100644 --- a/assets/common/items/armor/shoulder/druidshoulder.ron +++ b/assets/common/items/armor/shoulder/druidshoulder.ron @@ -1,8 +1,12 @@ Item( name: "Druid Shoulders", - description: "Forged for protectors of the wild.\n\n", + description: "Forged for protectors of the wild.", kind: Armor( - kind: Shoulder(DruidShoulder), - stats: (20), + ( + kind: Shoulder(DruidShoulder), + stats: ( + protection: Normal(3.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/iron_spikes.ron b/assets/common/items/armor/shoulder/iron_spikes.ron index a2c95c9360..a253e7a276 100644 --- a/assets/common/items/armor/shoulder/iron_spikes.ron +++ b/assets/common/items/armor/shoulder/iron_spikes.ron @@ -1,8 +1,12 @@ Item( name: "Iron Spiked Pauldrons", - description: "Iron shoulder pads with spikes attached.\n\n", + description: "Iron shoulder pads with spikes attached.", kind: Armor( - kind: Shoulder(IronSpikes), - stats: (20), + ( + kind: Shoulder(IronSpikes), + stats: ( + protection: Normal(12.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/leather_0.ron b/assets/common/items/armor/shoulder/leather_0.ron index 82e18d2d45..bbdc133063 100644 --- a/assets/common/items/armor/shoulder/leather_0.ron +++ b/assets/common/items/armor/shoulder/leather_0.ron @@ -1,8 +1,12 @@ Item( name: "Leather Pauldrons", - description: "Shoulders\n\nArmor: 0\n\n", + description: "Shoulder pads made of leather.", kind: Armor( - kind: Shoulder(Leather0), - stats: (20), + ( + kind: Shoulder(Leather0), + stats: ( + protection: Normal(6.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/leather_1.ron b/assets/common/items/armor/shoulder/leather_1.ron index 1237ac242c..92c9047c26 100644 --- a/assets/common/items/armor/shoulder/leather_1.ron +++ b/assets/common/items/armor/shoulder/leather_1.ron @@ -1,8 +1,12 @@ Item( name: "Swift Shoulderpads", - description: "Shoulders\n\nArmor: 0\n\nSwift like the wind.\n\n", + description: "Swift like the wind.", kind: Armor( - kind: Shoulder(Leather1), - stats: (20), + ( + kind: Shoulder(Leather1), + stats: ( + protection: Normal(6.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/leather_2.ron b/assets/common/items/armor/shoulder/leather_2.ron index 883e07d95d..2a8531895e 100644 --- a/assets/common/items/armor/shoulder/leather_2.ron +++ b/assets/common/items/armor/shoulder/leather_2.ron @@ -1,8 +1,12 @@ Item( name: "Leather Shoulder Pad", - description: "A simple shoulder pad made of leather", + description: "A simple shoulder pad made of leather.", kind: Armor( - kind: Shoulder(Leather2), - stats: (20), + ( + kind: Shoulder(Leather2), + stats: ( + protection: Normal(6.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/leather_iron_0.ron b/assets/common/items/armor/shoulder/leather_iron_0.ron index f19799ca90..6a26e9c7c5 100644 --- a/assets/common/items/armor/shoulder/leather_iron_0.ron +++ b/assets/common/items/armor/shoulder/leather_iron_0.ron @@ -1,8 +1,12 @@ Item( name: "Iron and Leather Spaulders", - description: "Robust spaulders made from iron and leather.\n\n", + description: "Robust spaulders made from iron and leather.", kind: Armor( - kind: Shoulder(IronLeather0), - stats: (20), + ( + kind: Shoulder(IronLeather0), + stats: ( + protection: Normal(9.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/leather_iron_1.ron b/assets/common/items/armor/shoulder/leather_iron_1.ron index aaac593da4..2f2bc043fa 100644 --- a/assets/common/items/armor/shoulder/leather_iron_1.ron +++ b/assets/common/items/armor/shoulder/leather_iron_1.ron @@ -1,8 +1,12 @@ Item( name: "Iron and Leather Spaulders", - description: "Robust spaulders made from iron and leather.\n\n", + description: "Robust spaulders made from iron and leather.", kind: Armor( - kind: Shoulder(IronLeather1), - stats: (20), + ( + kind: Shoulder(IronLeather1), + stats: ( + protection: Normal(9.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/leather_iron_2.ron b/assets/common/items/armor/shoulder/leather_iron_2.ron index c939e0e0e7..653597c82e 100644 --- a/assets/common/items/armor/shoulder/leather_iron_2.ron +++ b/assets/common/items/armor/shoulder/leather_iron_2.ron @@ -1,8 +1,12 @@ Item( name: "Iron and Leather Spaulders", - description: "Robust spaulders made from iron and leather.\n\n", + description: "Robust spaulders made from iron and leather.", kind: Armor( - kind: Shoulder(IronLeather2), - stats: (20), + ( + kind: Shoulder(IronLeather2), + stats: ( + protection: Normal(9.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/leather_iron_3.ron b/assets/common/items/armor/shoulder/leather_iron_3.ron index 2c30a2452a..fb0eb45951 100644 --- a/assets/common/items/armor/shoulder/leather_iron_3.ron +++ b/assets/common/items/armor/shoulder/leather_iron_3.ron @@ -1,8 +1,12 @@ Item( name: "Iron and Leather Spaulders", - description: "Robust spaulders made from iron and leather.\n\n", + description: "Robust spaulders made from iron and leather.", kind: Armor( - kind: Shoulder(IronLeather3), - stats: (20), + ( + kind: Shoulder(IronLeather3), + stats: ( + protection: Normal(9.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/leather_strips.ron b/assets/common/items/armor/shoulder/leather_strips.ron index e8a84127f8..fa0e176e2b 100644 --- a/assets/common/items/armor/shoulder/leather_strips.ron +++ b/assets/common/items/armor/shoulder/leather_strips.ron @@ -1,8 +1,12 @@ Item( name: "Leather Strips", - description: "Shoulder wraps made from leather strips.\n\n", + description: "Shoulder wraps made from leather strips.", kind: Armor( - kind: Shoulder(LeatherStrips), - stats: (20), + ( + kind: Shoulder(LeatherStrips), + stats: ( + protection: Normal(4.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/plate_0.ron b/assets/common/items/armor/shoulder/plate_0.ron index f6d3cc8590..54c7fa4dbf 100644 --- a/assets/common/items/armor/shoulder/plate_0.ron +++ b/assets/common/items/armor/shoulder/plate_0.ron @@ -1,8 +1,12 @@ Item( name: "Iron Shoulderguards", - description: "Shoulders\n\nArmor: 0\n\nA strong shoulder to lean on.\n\n", + description: "Shoulderguards forged from iron.", kind: Armor( - kind: Shoulder(Plate0), - stats: (20), + ( + kind: Shoulder(Plate0), + stats: ( + protection: Normal(12.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/steel_0.ron b/assets/common/items/armor/shoulder/steel_0.ron index 6c48846f9a..0ccd4a907a 100644 --- a/assets/common/items/armor/shoulder/steel_0.ron +++ b/assets/common/items/armor/shoulder/steel_0.ron @@ -1,8 +1,12 @@ Item( name: "Steel Shoulder Pad", - description: "A simple shoulder pad made of steel", + description: "A simple shoulder pad made of steel.", kind: Armor( - kind: Shoulder(Steel0), - stats: (20), + ( + kind: Shoulder(Steel0), + stats: ( + protection: Normal(15.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/twigs.ron b/assets/common/items/armor/shoulder/twigs.ron index 144d5552b0..65995c6699 100644 --- a/assets/common/items/armor/shoulder/twigs.ron +++ b/assets/common/items/armor/shoulder/twigs.ron @@ -1,8 +1,12 @@ Item( name: "Twiggy Shoulders", - description: "Spaulders made from tightly tied twigs.\n\n", + description: "Spaulders made from tightly tied twigs.", kind: Armor( - kind: Shoulder(TwiggyShoulder), - stats: (20), + ( + kind: Shoulder(TwiggyShoulder), + stats: ( + protection: Normal(9.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/twigsflowers.ron b/assets/common/items/armor/shoulder/twigsflowers.ron index d62e5d3e10..e8f2fecfe2 100644 --- a/assets/common/items/armor/shoulder/twigsflowers.ron +++ b/assets/common/items/armor/shoulder/twigsflowers.ron @@ -1,8 +1,12 @@ Item( name: "Flowery Shoulders", - description: "Flowery, leafy spaulders.\n\n", + description: "Flowery, leafy spaulders.", kind: Armor( - kind: Shoulder(FlowerShoulder), - stats: (20), + ( + kind: Shoulder(FlowerShoulder), + stats: ( + protection: Normal(9.0), + ), + ) ), ) diff --git a/assets/common/items/armor/shoulder/twigsleaves.ron b/assets/common/items/armor/shoulder/twigsleaves.ron index dc88f790e2..9e87f878f5 100644 --- a/assets/common/items/armor/shoulder/twigsleaves.ron +++ b/assets/common/items/armor/shoulder/twigsleaves.ron @@ -1,8 +1,12 @@ Item( name: "Leafy Shoulders", - description: "Spaulders made from tied twigs and leaves.\n\n", + description: "Spaulders made from tied twigs and leaves.", kind: Armor( - kind: Shoulder(LeafyShoulder), - stats: (20), + ( + kind: Shoulder(LeafyShoulder), + stats: ( + protection: Normal(9.0), + ), + ) ), ) diff --git a/assets/common/items/armor/starter/rugged_chest.ron b/assets/common/items/armor/starter/rugged_chest.ron index d559dd6dec..2ad170a8ae 100644 --- a/assets/common/items/armor/starter/rugged_chest.ron +++ b/assets/common/items/armor/starter/rugged_chest.ron @@ -1,8 +1,12 @@ Item( name: "Rugged Shirt", - description: "Chest\n\nArmor: 0\n\nSmells like Adventure.\n\n", + description: "Smells like Adventure.", kind: Armor( - kind: Chest(Rugged0), - stats: (20), + ( + kind: Chest(Rugged0), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/starter/rugged_pants.ron b/assets/common/items/armor/starter/rugged_pants.ron index 0444aeb665..3b46eb61ba 100644 --- a/assets/common/items/armor/starter/rugged_pants.ron +++ b/assets/common/items/armor/starter/rugged_pants.ron @@ -1,8 +1,12 @@ Item( name: "Rugged Commoner's Pants", - description: "Legs\n\nArmor: 0\n\nThey remind you of the old days.\n\n", + description: "They remind you of the old days.", kind: Armor( - kind: Pants(Rugged0), - stats: (20), + ( + kind: Pants(Rugged0), + stats: ( + protection: Normal(1.0), + ), + ) ), ) diff --git a/assets/common/items/armor/starter/sandals_0.ron b/assets/common/items/armor/starter/sandals_0.ron index 3d2201aa19..cbfd3b4805 100644 --- a/assets/common/items/armor/starter/sandals_0.ron +++ b/assets/common/items/armor/starter/sandals_0.ron @@ -1,8 +1,12 @@ Item( name: "Worn out Sandals", - description: "Feet\n\nArmor: 0\n\nLoyal companions.\n\n", + description: "Loyal companions.", kind: Armor( - kind: Foot(Sandal0), - stats: (20), + ( + kind: Foot(Sandal0), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/armor/tabard/admin.ron b/assets/common/items/armor/tabard/admin.ron index 4ad17edb50..665541e195 100644 --- a/assets/common/items/armor/tabard/admin.ron +++ b/assets/common/items/armor/tabard/admin.ron @@ -1,8 +1,12 @@ Item( name: "Admin's Tabard", - description: "Tabard\n\nWith great power comes\ngreat responsibility.\n\n", + description: "With great power comes\ngreat responsibility.", kind: Armor( - kind: Tabard(Admin), - stats: (20), + ( + kind: Tabard(Admin), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/items/debug/admin.ron b/assets/common/items/debug/admin.ron index d1741be6b5..433e9c0ecc 100644 --- a/assets/common/items/debug/admin.ron +++ b/assets/common/items/debug/admin.ron @@ -1,8 +1,12 @@ Item( name: "Admin's Tabard", - description: "Tabard\n\nWith great power comes\ngreat responsibility. ", + description: "With great power comes\ngreat responsibility.", kind: Armor( - kind: Tabard(Admin), - stats: (20), + ( + kind: Tabard(Admin), + stats: ( + protection: Invincible, + ), + ) ), ) diff --git a/assets/common/items/debug/admin_back.ron b/assets/common/items/debug/admin_back.ron index dbdfed10f3..d491343bbf 100644 --- a/assets/common/items/debug/admin_back.ron +++ b/assets/common/items/debug/admin_back.ron @@ -1,8 +1,12 @@ Item( name: "Admin's Cape", - description: "Back\n\nArmor: 0\n\nWith great power comes\ngreat responsibility. ", + description: "With great power comes\ngreat responsibility.", kind: Armor( - kind: Back(Admin), - stats: (20), + ( + kind: Back(Admin), + stats: ( + protection: Invincible, + ), + ) ), ) diff --git a/assets/common/items/debug/cultist_belt.ron b/assets/common/items/debug/cultist_belt.ron index 1b2765d2c8..648c2a5adb 100644 --- a/assets/common/items/debug/cultist_belt.ron +++ b/assets/common/items/debug/cultist_belt.ron @@ -1,8 +1,12 @@ Item( name: "Cultist Belt", - description: "Belt\n\nArmor: 0\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Belt(Cultist), - stats: (20), + ( + kind: Belt(Cultist), + stats: ( + protection: Invincible, + ), + ) ), ) diff --git a/assets/common/items/debug/cultist_boots.ron b/assets/common/items/debug/cultist_boots.ron index 70d134e5fe..5a130430be 100644 --- a/assets/common/items/debug/cultist_boots.ron +++ b/assets/common/items/debug/cultist_boots.ron @@ -1,8 +1,12 @@ Item( name: "Cultist Boots", - description: "Feet\n\nArmor: 0\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Foot(Cultist), - stats: (20), + ( + kind: Foot(Cultist), + stats: ( + protection: Invincible, + ), + ) ), ) diff --git a/assets/common/items/debug/cultist_chest_blue.ron b/assets/common/items/debug/cultist_chest_blue.ron index 2039ea6d76..7ae1a9f3ab 100644 --- a/assets/common/items/debug/cultist_chest_blue.ron +++ b/assets/common/items/debug/cultist_chest_blue.ron @@ -1,8 +1,12 @@ Item( name: "Blue Cultist Chest", - description: "Chest\n\nArmor: 0\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Chest(CultistBlue), - stats: (20), + ( + kind: Chest(CultistBlue), + stats: ( + protection: Invincible, + ), + ) ), ) diff --git a/assets/common/items/debug/cultist_hands_blue.ron b/assets/common/items/debug/cultist_hands_blue.ron index c6d3076b58..e9955b2a23 100644 --- a/assets/common/items/debug/cultist_hands_blue.ron +++ b/assets/common/items/debug/cultist_hands_blue.ron @@ -1,8 +1,12 @@ Item( name: "Blue Cultist Gloves", - description: "Hands\n\nArmor: 0\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Hand(CultistBlue), - stats: (20), + ( + kind: Hand(CultistBlue), + stats: ( + protection: Invincible, + ), + ) ), ) diff --git a/assets/common/items/debug/cultist_legs_blue.ron b/assets/common/items/debug/cultist_legs_blue.ron index 5ad8a8c25a..4ab7fa5119 100644 --- a/assets/common/items/debug/cultist_legs_blue.ron +++ b/assets/common/items/debug/cultist_legs_blue.ron @@ -1,8 +1,12 @@ Item( name: "Blue Cultist Skirt", - description: "Legs\n\nArmor: 0\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Pants(CultistBlue), - stats: (20), + ( + kind: Pants(CultistBlue), + stats: ( + protection: Invincible, + ), + ) ), ) diff --git a/assets/common/items/debug/cultist_shoulder_blue.ron b/assets/common/items/debug/cultist_shoulder_blue.ron index 1e4d3965c8..92c1ff5092 100644 --- a/assets/common/items/debug/cultist_shoulder_blue.ron +++ b/assets/common/items/debug/cultist_shoulder_blue.ron @@ -1,8 +1,12 @@ Item( name: "Blue Cultist Mantle", - description: "Shoulders\n\nArmor: 0\n\nA strong shoulder to lean on.\n\n", + description: "Ceremonial attire used by members.", kind: Armor( - kind: Shoulder(CultistBlue), - stats: (20), + ( + kind: Shoulder(CultistBlue), + stats: ( + protection: Invincible, + ), + ) ), ) diff --git a/assets/common/items/testing/test_boots.ron b/assets/common/items/testing/test_boots.ron index b8a4bfa3cf..405cd4d7c9 100644 --- a/assets/common/items/testing/test_boots.ron +++ b/assets/common/items/testing/test_boots.ron @@ -2,7 +2,11 @@ Item( name: "Testing Boots", description: "Hopefully this test doesn't break!", kind: Armor( - kind: Foot(Dark), - stats: (20), + ( + kind: Foot(Dark), + stats: ( + protection: Normal(0.0), + ), + ) ), ) diff --git a/assets/common/loot_table.ron b/assets/common/loot_table.ron index 7358a55729..2ba9b1da1d 100644 --- a/assets/common/loot_table.ron +++ b/assets/common/loot_table.ron @@ -59,53 +59,110 @@ // bows (1, "common.items.weapons.bow.starter_bow"), // belts - (0.2, "common.items.armor.belt.cloth_blue_0"), - (0.2, "common.items.armor.belt.cloth_green_0"), - (0.2, "common.items.armor.belt.cloth_purple_0"), - (0.15, "common.items.armor.belt.leather_0"), - (0.15, "common.items.armor.belt.leather_2"), - (0.1, "common.items.armor.belt.steel_0"), - (0.05, "common.items.armor.belt.plate_0"), + (0.17, "common.items.armor.belt.cloth_blue_0"), + (0.17, "common.items.armor.belt.cloth_green_0"), + (0.17, "common.items.armor.belt.cloth_purple_0"), + (0.08, "common.items.armor.belt.cultist_belt"), + (0.08, "common.items.armor.belt.assassin"), + (0.08, "common.items.armor.belt.druid"), + (0.06, "common.items.armor.belt.leather_0"), + (0.06, "common.items.armor.belt.leather_2"), + (0.02, "common.items.armor.belt.twig"), + (0.02, "common.items.armor.belt.twigsflowers"), + (0.02, "common.items.armor.belt.twigsleaves"), + (0.03, "common.items.armor.belt.plate_0"), + (0.01, "common.items.armor.belt.steel_0"), // chests - (0.2, "common.items.armor.chest.cloth_blue_0"), - (0.2, "common.items.armor.chest.cloth_green_0"), - (0.2, "common.items.armor.chest.cloth_purple_0"), - (0.15, "common.items.armor.chest.leather_0"), - (0.15, "common.items.armor.chest.leather_2"), - (0.1, "common.items.armor.chest.steel_0"), - (0.05, "common.items.armor.chest.plate_green_0"), + (0.08, "common.items.armor.chest.cloth_blue_0"), + (0.08, "common.items.armor.chest.cloth_green_0"), + (0.08, "common.items.armor.chest.cloth_purple_0"), + (0.025, "common.items.armor.chest.worker_green_0"), + (0.025, "common.items.armor.chest.worker_green_1"), + (0.025, "common.items.armor.chest.worker_orange_0"), + (0.025, "common.items.armor.chest.worker_orange_1"), + (0.025, "common.items.armor.chest.worker_purple_0"), + (0.025, "common.items.armor.chest.worker_purple_1"), + (0.025, "common.items.armor.chest.worker_red_0"), + (0.025, "common.items.armor.chest.worker_red_1"), + (0.025, "common.items.armor.chest.worker_yellow_0"), + (0.025, "common.items.armor.chest.worker_yellow_1"), + (0.08, "common.items.armor.chest.cultist_chest_purple"), + (0.08, "common.items.armor.chest.assassin"), + (0.08, "common.items.armor.chest.druid"), + (0.06, "common.items.armor.chest.leather_0"), + (0.06, "common.items.armor.chest.leather_2"), + (0.02, "common.items.armor.chest.twig"), + (0.02, "common.items.armor.chest.twigsflowers"), + (0.02, "common.items.armor.chest.twigsleaves"), + (0.03, "common.items.armor.chest.plate_green_0"), + (0.01, "common.items.armor.chest.steel_0"), // shoes - (0.2, "common.items.armor.foot.cloth_blue_0"), - (0.2, "common.items.armor.foot.cloth_green_0"), - (0.2, "common.items.armor.foot.cloth_purple_0"), - (0.15, "common.items.armor.foot.leather_0"), - (0.15, "common.items.armor.foot.leather_2"), - (0.1, "common.items.armor.foot.steel_0"), - (0.05, "common.items.armor.foot.plate_0"), + (0.15, "common.items.armor.foot.cloth_blue_0"), + (0.15, "common.items.armor.foot.cloth_green_0"), + (0.15, "common.items.armor.foot.cloth_purple_0"), + (0.05, "common.items.armor.foot.jackalope_slippers"), + (0.08, "common.items.armor.foot.cultist_boots"), + (0.08, "common.items.armor.foot.assassin"), + (0.08, "common.items.armor.foot.druid"), + (0.06, "common.items.armor.foot.leather_0"), + (0.06, "common.items.armor.foot.leather_2"), + (0.02, "common.items.armor.foot.twig"), + (0.02, "common.items.armor.foot.twigsflowers"), + (0.02, "common.items.armor.foot.twigsleaves"), + (0.03, "common.items.armor.foot.plate_0"), + (0.01, "common.items.armor.foot.steel_0"), // pants - (0.2, "common.items.armor.pants.cloth_blue_0"), - (0.2, "common.items.armor.pants.cloth_green_0"), - (0.2, "common.items.armor.pants.cloth_purple_0"), - (0.15, "common.items.armor.pants.leather_0"), - (0.1, "common.items.armor.pants.steel_0"), - (0.05, "common.items.armor.pants.plate_green_0"), + (0.125, "common.items.armor.pants.cloth_blue_0"), + (0.125, "common.items.armor.pants.cloth_green_0"), + (0.125, "common.items.armor.pants.cloth_purple_0"), + (0.125, "common.items.armor.pants.worker_blue_0"), + (0.08, "common.items.armor.pants.cultist_legs_purple"), + (0.08, "common.items.armor.pants.assassin"), + (0.08, "common.items.armor.pants.druid"), + (0.04, "common.items.armor.pants.leather_0"), + (0.04, "common.items.armor.pants.leather_2"), + (0.04, "common.items.armor.pants.hunting"), + (0.02, "common.items.armor.pants.twig"), + (0.02, "common.items.armor.pants.twigsflowers"), + (0.02, "common.items.armor.pants.twigsleaves"), + (0.03, "common.items.armor.pants.plate_green_0"), + (0.01, "common.items.armor.pants.steel_0"), // shoulders - (0.2, "common.items.armor.shoulder.cloth_blue_0"), - (0.2, "common.items.armor.shoulder.cloth_green_0"), - (0.2, "common.items.armor.shoulder.cloth_purple_0"), - (0.1, "common.items.armor.shoulder.leather_0"), - (0.1, "common.items.armor.shoulder.leather_1"), - (0.1, "common.items.armor.shoulder.leather_2"), - (0.1, "common.items.armor.shoulder.steel_0"), - (0.05, "common.items.armor.shoulder.plate_0"), + (0.125, "common.items.armor.shoulder.cloth_blue_0"), + (0.125, "common.items.armor.shoulder.cloth_blue_1"), + (0.125, "common.items.armor.shoulder.cloth_green_0"), + (0.125, "common.items.armor.shoulder.cloth_purple_0"), + (0.06, "common.items.armor.shoulder.cultist_shoulder_purple"), + (0.06, "common.items.armor.shoulder.assassin"), + (0.06, "common.items.armor.shoulder.druidshoulder"), + (0.06, "common.items.armor.shoulder.leather_strips"), + (0.04, "common.items.armor.shoulder.leather_0"), + (0.04, "common.items.armor.shoulder.leather_1"), + (0.04, "common.items.armor.shoulder.leather_2"), + (0.01, "common.items.armor.shoulder.twigs"), + (0.01, "common.items.armor.shoulder.twigsflowers"), + (0.01, "common.items.armor.shoulder.twigsleaves"), + (0.01, "common.items.armor.shoulder.leather_iron_0"), + (0.01, "common.items.armor.shoulder.leather_iron_1"), + (0.01, "common.items.armor.shoulder.leather_iron_2"), + (0.01, "common.items.armor.shoulder.leather_iron_3"), + (0.015, "common.items.armor.shoulder.plate_0"), + (0.015, "common.items.armor.shoulder.iron_spikes"), + (0.01, "common.items.armor.shoulder.steel_0"), //gloves - (0.2, "common.items.armor.hand.cloth_blue_0"), - (0.2, "common.items.armor.hand.cloth_green_0"), - (0.2, "common.items.armor.hand.cloth_purple_0"), - (0.15, "common.items.armor.hand.leather_0"), - (0.15, "common.items.armor.hand.leather_2"), - (0.1, "common.items.armor.hand.steel_0"), - (0.05, "common.items.armor.hand.plate_0"), + (0.17, "common.items.armor.hand.cloth_blue_0"), + (0.17, "common.items.armor.hand.cloth_green_0"), + (0.17, "common.items.armor.hand.cloth_purple_0"), + (0.08, "common.items.armor.hand.cultist_hands_purple"), + (0.08, "common.items.armor.hand.assassin"), + (0.08, "common.items.armor.hand.druid"), + (0.06, "common.items.armor.hand.leather_0"), + (0.06, "common.items.armor.hand.leather_2"), + (0.02, "common.items.armor.hand.twig"), + (0.02, "common.items.armor.hand.twigsflowers"), + (0.02, "common.items.armor.hand.twigsleaves"), + (0.03, "common.items.armor.hand.plate_0"), + (0.01, "common.items.armor.hand.steel_0"), // rings (0.6, "common.items.armor.ring.ring_0"), // capes diff --git a/assets/voxygen/element/icons/protection.png b/assets/voxygen/element/icons/protection.png new file mode 100644 index 0000000000..06e02352b5 --- /dev/null +++ b/assets/voxygen/element/icons/protection.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6412a1b82a084f9a7828f185752c891d40c5ce8c7575f91edfc360af47cf710f +size 404 diff --git a/assets/voxygen/i18n/en.ron b/assets/voxygen/i18n/en.ron index d727a07c90..7b5f5b2c4e 100644 --- a/assets/voxygen/i18n/en.ron +++ b/assets/voxygen/i18n/en.ron @@ -414,6 +414,8 @@ magically infused items?"#, Fitness Willpower + +Protection "#, /// End character window section diff --git a/common/Cargo.toml b/common/Cargo.toml index eda6f2efcd..47dd092a67 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -8,6 +8,7 @@ edition = "2018" no-assets = [] [dependencies] +arraygen = "0.1.13" specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git", branch = "specs-git" } specs = { git = "https://github.com/amethyst/specs.git", features = ["serde", "storage-event-control"], rev = "7a2e348ab2223818bad487695c66c43db88050a5" } diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index b09b7bfaf8..b795222abe 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -1,11 +1,13 @@ use crate::{ comp::{ - ability::Stage, item::Item, Body, CharacterState, EnergySource, Gravity, LightEmitter, - Projectile, StateUpdate, + ability::Stage, + item::{armor::Protection, Item, ItemKind}, + Body, CharacterState, EnergySource, Gravity, LightEmitter, Projectile, StateUpdate, }, states::{triple_strike::*, *}, sys::character_behavior::JoinData, }; +use arraygen::Arraygen; use serde::{Deserialize, Serialize}; use specs::{Component, FlaggedStorage}; use specs_idvs::IdvStorage; @@ -144,25 +146,63 @@ pub struct ItemConfig { pub dodge_ability: Option, } -#[derive(Clone, PartialEq, Default, Debug, Serialize, Deserialize)] +#[derive(Arraygen, Clone, PartialEq, Default, Debug, Serialize, Deserialize)] +#[gen_array(pub fn get_armor: &Option)] pub struct Loadout { pub active_item: Option, pub second_item: Option, - pub shoulder: Option, - pub chest: Option, - pub belt: Option, - pub hand: Option, - pub pants: Option, - pub foot: Option, - pub back: Option, - pub ring: Option, - pub neck: Option, pub lantern: Option, + + #[in_array(get_armor)] + pub shoulder: Option, + #[in_array(get_armor)] + pub chest: Option, + #[in_array(get_armor)] + pub belt: Option, + #[in_array(get_armor)] + pub hand: Option, + #[in_array(get_armor)] + pub pants: Option, + #[in_array(get_armor)] + pub foot: Option, + #[in_array(get_armor)] + pub back: Option, + #[in_array(get_armor)] + pub ring: Option, + #[in_array(get_armor)] + pub neck: Option, + #[in_array(get_armor)] pub head: Option, + #[in_array(get_armor)] pub tabard: Option, } +impl Loadout { + pub fn get_damage_reduction(&self) -> f32 { + let protection = self + .get_armor() + .iter() + .flat_map(|armor| armor.as_ref()) + .filter_map(|item| { + if let ItemKind::Armor(armor) = item.kind { + Some(armor.get_protection()) + } else { + None + } + }) + .map(|protection| match protection { + Protection::Normal(protection) => Some(protection), + Protection::Invincible => None, + }) + .sum::>(); + match protection { + Some(dr) => dr / (60.0 + dr.abs()), + None => 1.0, + } + } +} + impl From<&CharacterAbility> for CharacterState { fn from(ability: &CharacterAbility) -> Self { match ability { diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index 8f1b7482a0..80eaef09f8 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -130,6 +130,114 @@ impl Body { // Note: currently assumes sphericality pub fn height(&self) -> f32 { self.radius() * 2.0 } + + pub fn base_health(&self) -> u32 { + match self { + Body::Humanoid(_) => 52, + Body::QuadrupedSmall(_) => 44, + Body::QuadrupedMedium(_) => 72, + Body::BirdMedium(_) => 36, + Body::FishMedium(_) => 32, + Body::Dragon(_) => 256, + Body::BirdSmall(_) => 24, + Body::FishSmall(_) => 20, + Body::BipedLarge(_) => 144, + Body::Object(_) => 100, + Body::Golem(_) => 168, + Body::Critter(_) => 32, + Body::QuadrupedLow(_) => 64, + } + } + + pub fn base_health_increase(&self) -> u32 { + match self { + Body::Humanoid(_) => 5, + Body::QuadrupedSmall(_) => 4, + Body::QuadrupedMedium(_) => 7, + Body::BirdMedium(_) => 4, + Body::FishMedium(_) => 3, + Body::Dragon(_) => 26, + Body::BirdSmall(_) => 2, + Body::FishSmall(_) => 2, + Body::BipedLarge(_) => 14, + Body::Object(_) => 0, + Body::Golem(_) => 17, + Body::Critter(_) => 3, + Body::QuadrupedLow(_) => 6, + } + } + + pub fn base_exp(&self) -> u32 { + match self { + Body::Humanoid(_) => 15, + Body::QuadrupedSmall(_) => 12, + Body::QuadrupedMedium(_) => 28, + Body::BirdMedium(_) => 10, + Body::FishMedium(_) => 8, + Body::Dragon(_) => 160, + Body::BirdSmall(_) => 5, + Body::FishSmall(_) => 4, + Body::BipedLarge(_) => 75, + Body::Object(_) => 0, + Body::Golem(_) => 75, + Body::Critter(_) => 8, + Body::QuadrupedLow(_) => 24, + } + } + + pub fn base_exp_increase(&self) -> u32 { + match self { + Body::Humanoid(_) => 3, + Body::QuadrupedSmall(_) => 2, + Body::QuadrupedMedium(_) => 6, + Body::BirdMedium(_) => 2, + Body::FishMedium(_) => 2, + Body::Dragon(_) => 32, + Body::BirdSmall(_) => 1, + Body::FishSmall(_) => 1, + Body::BipedLarge(_) => 15, + Body::Object(_) => 0, + Body::Golem(_) => 15, + Body::Critter(_) => 2, + Body::QuadrupedLow(_) => 5, + } + } + + pub fn base_dmg(&self) -> u32 { + match self { + Body::Humanoid(_) => 6, + Body::QuadrupedSmall(_) => 8, + Body::QuadrupedMedium(_) => 12, + Body::BirdMedium(_) => 7, + Body::FishMedium(_) => 6, + Body::Dragon(_) => 90, + Body::BirdSmall(_) => 5, + Body::FishSmall(_) => 3, + Body::BipedLarge(_) => 36, + Body::Object(_) => 0, + Body::Golem(_) => 36, + Body::Critter(_) => 7, + Body::QuadrupedLow(_) => 11, + } + } + + pub fn base_range(&self) -> f32 { + match self { + Body::Humanoid(_) => 5.0, + Body::QuadrupedSmall(_) => 4.5, + Body::QuadrupedMedium(_) => 5.5, + Body::BirdMedium(_) => 3.5, + Body::FishMedium(_) => 3.5, + Body::Dragon(_) => 12.5, + Body::BirdSmall(_) => 3.0, + Body::FishSmall(_) => 3.0, + Body::BipedLarge(_) => 10.0, + Body::Object(_) => 3.0, + Body::Golem(_) => 7.5, + Body::Critter(_) => 3.0, + Body::QuadrupedLow(_) => 4.5, + } + } } impl Component for Body { diff --git a/common/src/comp/inventory/item/armor.rs b/common/src/comp/inventory/item/armor.rs index 65e1ebe560..f9df886468 100644 --- a/common/src/comp/inventory/item/armor.rs +++ b/common/src/comp/inventory/item/armor.rs @@ -335,7 +335,7 @@ pub enum Tabard { pub const ALL_TABARDS: [Tabard; 1] = [Tabard::Admin]; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -pub enum Armor { +pub enum ArmorKind { Shoulder(Shoulder), Chest(Chest), Belt(Belt), @@ -354,9 +354,27 @@ impl Armor { /// one another (i.e: one may be substituted for the other in crafting /// recipes or item possession checks). pub fn superficially_eq(&self, other: &Self) -> bool { - std::mem::discriminant(self) == std::mem::discriminant(other) + std::mem::discriminant(&self.kind) == std::mem::discriminant(&other.kind) } } -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -pub struct Stats(pub u32); +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] +pub struct Stats { + protection: Protection, +} + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] +pub enum Protection { + Invincible, + Normal(f32), +} + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] +pub struct Armor { + pub kind: ArmorKind, + pub stats: Stats, +} + +impl Armor { + pub fn get_protection(&self) -> Protection { self.stats.protection } +} diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index a210ae2d8b..895f07bd34 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -90,15 +90,12 @@ impl Lantern { fn default_amount() -> u32 { 1 } -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub enum ItemKind { /// Something wieldable Tool(tool::Tool), Lantern(Lantern), - Armor { - kind: armor::Armor, - stats: armor::Stats, - }, + Armor(armor::Armor), Consumable { kind: Consumable, effect: Effect, @@ -122,7 +119,7 @@ pub enum ItemKind { }, } -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Item { name: String, description: String, @@ -237,9 +234,7 @@ impl Item { (ItemKind::Tool(a), ItemKind::Tool(b)) => a.superficially_eq(b), // TODO: Differentiate between lantern colors? (ItemKind::Lantern(_), ItemKind::Lantern(_)) => true, - (ItemKind::Armor { kind: a, .. }, ItemKind::Armor { kind: b, .. }) => { - a.superficially_eq(b) - }, + (ItemKind::Armor(a), ItemKind::Armor(b)) => a.superficially_eq(b), (ItemKind::Consumable { kind: a, .. }, ItemKind::Consumable { kind: b, .. }) => a == b, (ItemKind::Throwable { kind: a, .. }, ItemKind::Throwable { kind: b, .. }) => a == b, (ItemKind::Utility { kind: a, .. }, ItemKind::Utility { kind: b, .. }) => a == b, @@ -253,7 +248,7 @@ impl Component for Item { type Storage = FlaggedStorage>; } -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ItemDrop(pub Item); impl Component for ItemDrop { diff --git a/common/src/comp/inventory/mod.rs b/common/src/comp/inventory/mod.rs index 22b3622971..875fab148c 100644 --- a/common/src/comp/inventory/mod.rs +++ b/common/src/comp/inventory/mod.rs @@ -11,7 +11,7 @@ use std::ops::Not; // The limit on distance between the entity and a collectible (squared) pub const MAX_PICKUP_RANGE_SQR: f32 = 64.0; -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Inventory { pub slots: Vec>, pub amount: u32, @@ -401,7 +401,7 @@ impl Component for Inventory { type Storage = HashMapStorage; } -#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub enum InventoryUpdateEvent { Init, Used, diff --git a/common/src/comp/inventory/slot.rs b/common/src/comp/inventory/slot.rs index 312a81ac3c..db09354b25 100644 --- a/common/src/comp/inventory/slot.rs +++ b/common/src/comp/inventory/slot.rs @@ -1,4 +1,7 @@ -use crate::{comp, comp::item}; +use crate::{ + comp, + comp::{item, item::armor}, +}; use comp::{Inventory, Loadout}; use serde::{Deserialize, Serialize}; use tracing::warn; @@ -47,9 +50,10 @@ impl Slot { impl EquipSlot { fn can_hold(self, item_kind: &item::ItemKind) -> bool { + use armor::Armor; use item::ItemKind; match (self, item_kind) { - (Self::Armor(slot), ItemKind::Armor { kind, .. }) => slot.can_hold(kind), + (Self::Armor(slot), ItemKind::Armor(Armor { kind, .. })) => slot.can_hold(kind), (Self::Mainhand, ItemKind::Tool(_)) => true, (Self::Offhand, ItemKind::Tool(_)) => true, (Self::Lantern, ItemKind::Lantern(_)) => true, @@ -59,20 +63,20 @@ impl EquipSlot { } impl ArmorSlot { - fn can_hold(self, armor: &item::armor::Armor) -> bool { - use item::armor::Armor; + fn can_hold(self, armor: &item::armor::ArmorKind) -> bool { + use item::armor::ArmorKind; match (self, armor) { - (Self::Head, Armor::Head(_)) => true, - (Self::Neck, Armor::Neck(_)) => true, - (Self::Shoulders, Armor::Shoulder(_)) => true, - (Self::Chest, Armor::Chest(_)) => true, - (Self::Hands, Armor::Hand(_)) => true, - (Self::Ring, Armor::Ring(_)) => true, - (Self::Back, Armor::Back(_)) => true, - (Self::Belt, Armor::Belt(_)) => true, - (Self::Legs, Armor::Pants(_)) => true, - (Self::Feet, Armor::Foot(_)) => true, - (Self::Tabard, Armor::Tabard(_)) => true, + (Self::Head, ArmorKind::Head(_)) => true, + (Self::Neck, ArmorKind::Neck(_)) => true, + (Self::Shoulders, ArmorKind::Shoulder(_)) => true, + (Self::Chest, ArmorKind::Chest(_)) => true, + (Self::Hands, ArmorKind::Hand(_)) => true, + (Self::Ring, ArmorKind::Ring(_)) => true, + (Self::Back, ArmorKind::Back(_)) => true, + (Self::Belt, ArmorKind::Belt(_)) => true, + (Self::Legs, ArmorKind::Pants(_)) => true, + (Self::Feet, ArmorKind::Foot(_)) => true, + (Self::Tabard, ArmorKind::Tabard(_)) => true, _ => false, } } @@ -285,22 +289,23 @@ pub fn swap( /// assert_eq!(boots, loadout.foot); /// ``` pub fn equip(slot: usize, inventory: &mut Inventory, loadout: &mut Loadout) { - use item::{armor::Armor, ItemKind}; + use armor::Armor; + use item::{armor::ArmorKind, ItemKind}; let equip_slot = inventory.get(slot).and_then(|i| match &i.kind { ItemKind::Tool(_) => Some(EquipSlot::Mainhand), - ItemKind::Armor { kind, .. } => Some(EquipSlot::Armor(match kind { - Armor::Head(_) => ArmorSlot::Head, - Armor::Neck(_) => ArmorSlot::Neck, - Armor::Shoulder(_) => ArmorSlot::Shoulders, - Armor::Chest(_) => ArmorSlot::Chest, - Armor::Hand(_) => ArmorSlot::Hands, - Armor::Ring(_) => ArmorSlot::Ring, - Armor::Back(_) => ArmorSlot::Back, - Armor::Belt(_) => ArmorSlot::Belt, - Armor::Pants(_) => ArmorSlot::Legs, - Armor::Foot(_) => ArmorSlot::Feet, - Armor::Tabard(_) => ArmorSlot::Tabard, + ItemKind::Armor(Armor { kind, .. }) => Some(EquipSlot::Armor(match kind { + ArmorKind::Head(_) => ArmorSlot::Head, + ArmorKind::Neck(_) => ArmorSlot::Neck, + ArmorKind::Shoulder(_) => ArmorSlot::Shoulders, + ArmorKind::Chest(_) => ArmorSlot::Chest, + ArmorKind::Hand(_) => ArmorSlot::Hands, + ArmorKind::Ring(_) => ArmorSlot::Ring, + ArmorKind::Back(_) => ArmorSlot::Back, + ArmorKind::Belt(_) => ArmorSlot::Belt, + ArmorKind::Pants(_) => ArmorSlot::Legs, + ArmorKind::Foot(_) => ArmorSlot::Feet, + ArmorKind::Tabard(_) => ArmorSlot::Tabard, })), ItemKind::Lantern(_) => Some(EquipSlot::Lantern), _ => None, diff --git a/common/src/comp/stats.rs b/common/src/comp/stats.rs index 98392efbd9..3e8bd44a9e 100644 --- a/common/src/comp/stats.rs +++ b/common/src/comp/stats.rs @@ -134,80 +134,6 @@ pub struct Stats { pub body_type: Body, } -impl Body { - pub fn base_health(&self) -> u32 { - match self { - Body::Humanoid(_) => 52, - Body::QuadrupedSmall(_) => 44, - Body::QuadrupedMedium(_) => 72, - Body::BirdMedium(_) => 36, - Body::FishMedium(_) => 32, - Body::Dragon(_) => 256, - Body::BirdSmall(_) => 24, - Body::FishSmall(_) => 20, - Body::BipedLarge(_) => 144, - Body::Object(_) => 100, - Body::Golem(_) => 168, - Body::Critter(_) => 32, - Body::QuadrupedLow(_) => 64, - } - } - - pub fn base_health_increase(&self) -> u32 { - match self { - Body::Humanoid(_) => 5, - Body::QuadrupedSmall(_) => 4, - Body::QuadrupedMedium(_) => 7, - Body::BirdMedium(_) => 4, - Body::FishMedium(_) => 3, - Body::Dragon(_) => 26, - Body::BirdSmall(_) => 2, - Body::FishSmall(_) => 2, - Body::BipedLarge(_) => 14, - Body::Object(_) => 0, - Body::Golem(_) => 17, - Body::Critter(_) => 3, - Body::QuadrupedLow(_) => 6, - } - } - - pub fn base_exp(&self) -> u32 { - match self { - Body::Humanoid(_) => 15, - Body::QuadrupedSmall(_) => 12, - Body::QuadrupedMedium(_) => 28, - Body::BirdMedium(_) => 10, - Body::FishMedium(_) => 8, - Body::Dragon(_) => 160, - Body::BirdSmall(_) => 5, - Body::FishSmall(_) => 4, - Body::BipedLarge(_) => 75, - Body::Object(_) => 0, - Body::Golem(_) => 75, - Body::Critter(_) => 8, - Body::QuadrupedLow(_) => 24, - } - } - - pub fn base_exp_increase(&self) -> u32 { - match self { - Body::Humanoid(_) => 3, - Body::QuadrupedSmall(_) => 2, - Body::QuadrupedMedium(_) => 6, - Body::BirdMedium(_) => 2, - Body::FishMedium(_) => 2, - Body::Dragon(_) => 32, - Body::BirdSmall(_) => 1, - Body::FishSmall(_) => 1, - Body::BipedLarge(_) => 15, - Body::Object(_) => 0, - Body::Golem(_) => 15, - Body::Critter(_) => 2, - Body::QuadrupedLow(_) => 5, - } - } -} - impl Stats { pub fn should_die(&self) -> bool { self.health.current == 0 } diff --git a/common/src/loadout_builder.rs b/common/src/loadout_builder.rs index 1ed2512b0a..b3b65bd5bd 100644 --- a/common/src/loadout_builder.rs +++ b/common/src/loadout_builder.rs @@ -24,44 +24,6 @@ use std::time::Duration; /// ``` pub struct LoadoutBuilder(Loadout); -impl Body { - pub fn base_dmg(&self) -> u32 { - match self { - Body::Humanoid(_) => 8, - Body::QuadrupedSmall(_) => 7, - Body::QuadrupedMedium(_) => 10, - Body::BirdMedium(_) => 6, - Body::FishMedium(_) => 5, - Body::Dragon(_) => 75, - Body::BirdSmall(_) => 4, - Body::FishSmall(_) => 3, - Body::BipedLarge(_) => 30, - Body::Object(_) => 0, - Body::Golem(_) => 30, - Body::Critter(_) => 6, - Body::QuadrupedLow(_) => 9, - } - } - - pub fn base_range(&self) -> f32 { - match self { - Body::Humanoid(_) => 5.0, - Body::QuadrupedSmall(_) => 4.5, - Body::QuadrupedMedium(_) => 5.5, - Body::BirdMedium(_) => 3.5, - Body::FishMedium(_) => 3.5, - Body::Dragon(_) => 12.5, - Body::BirdSmall(_) => 3.0, - Body::FishSmall(_) => 3.0, - Body::BipedLarge(_) => 10.0, - Body::Object(_) => 3.0, - Body::Golem(_) => 7.5, - Body::Critter(_) => 3.0, - Body::QuadrupedLow(_) => 4.5, - } - } -} - impl LoadoutBuilder { #[allow(clippy::new_without_default)] // TODO: Pending review in #587 pub fn new() -> Self { diff --git a/common/src/sys/combat.rs b/common/src/sys/combat.rs index f0e84e65bb..f11714b23b 100644 --- a/common/src/sys/combat.rs +++ b/common/src/sys/combat.rs @@ -1,7 +1,7 @@ use crate::{ comp::{ - Alignment, Attacking, Body, CharacterState, HealthChange, HealthSource, Ori, Pos, Scale, - Stats, + Alignment, Attacking, Body, CharacterState, HealthChange, HealthSource, Loadout, Ori, Pos, + Scale, Stats, }, event::{EventBus, LocalEvent, ServerEvent}, sync::Uid, @@ -29,6 +29,7 @@ impl<'a> System<'a> for Sys { ReadStorage<'a, Alignment>, ReadStorage<'a, Body>, ReadStorage<'a, Stats>, + ReadStorage<'a, Loadout>, WriteStorage<'a, Attacking>, WriteStorage<'a, CharacterState>, ); @@ -46,6 +47,7 @@ impl<'a> System<'a> for Sys { alignments, bodies, stats, + loadouts, mut attacking_storage, character_states, ): Self::SystemData, @@ -145,6 +147,12 @@ impl<'a> System<'a> for Sys { healthchange *= 1.0 - BLOCK_EFFICIENCY } + // Armor + if let Some(loadout) = loadouts.get(b) { + let damage_reduction = loadout.get_damage_reduction(); + healthchange *= 1.0 - damage_reduction; + } + if healthchange != 0.0 { server_emitter.emit(ServerEvent::Damage { uid: *uid_b, diff --git a/server/src/migrations/2020-07-16-044718_migrate_armour_stats/down.sql b/server/src/migrations/2020-07-16-044718_migrate_armour_stats/down.sql new file mode 100644 index 0000000000..c1733c05f6 --- /dev/null +++ b/server/src/migrations/2020-07-16-044718_migrate_armour_stats/down.sql @@ -0,0 +1 @@ +-- No down action for this migration \ No newline at end of file diff --git a/server/src/migrations/2020-07-16-044718_migrate_armour_stats/up.sql b/server/src/migrations/2020-07-16-044718_migrate_armour_stats/up.sql new file mode 100644 index 0000000000..b55f5eec50 --- /dev/null +++ b/server/src/migrations/2020-07-16-044718_migrate_armour_stats/up.sql @@ -0,0 +1,29 @@ +-- This migration updates all "stats" fields for each armour item in player loadouts +UPDATE + loadout +SET + items = json_replace( + items, + '$.back.kind.Armor.stats', + json('{ "protection": { "Normal": 1.0 } }'), + '$.belt.kind.Armor.stats', + json('{ "protection": { "Normal": 1.0 } }'), + '$.chest.kind.Armor.stats', + json('{ "protection": { "Normal": 1.0 } }'), + '$.foot.kind.Armor.stats', + json('{ "protection": { "Normal": 1.0 } }'), + '$.hand.kind.Armor.stats', + json('{ "protection": { "Normal": 1.0 } }'), + '$.head.kind.Armor.stats', + json('{ "protection": { "Normal": 1.0 } }'), + '$.neck.kind.Armor.stats', + json('{ "protection": { "Normal": 1.0 } }'), + '$.pants.kind.Armor.stats', + json('{ "protection": { "Normal": 1.0 } }'), + '$.ring.kind.Armor.stats', + json('{ "protection": { "Normal": 1.0 } }'), + '$.shoulder.kind.Armor.stats', + json('{ "protection": { "Normal": 1.0 } }'), + '$.tabard.kind.Armor.stats', + json('{ "protection": { "Normal": 1.0 } }') + ); \ No newline at end of file diff --git a/voxygen/src/hud/bag.rs b/voxygen/src/hud/bag.rs index 65f6e34d6d..0af0b8b244 100644 --- a/voxygen/src/hud/bag.rs +++ b/voxygen/src/hud/bag.rs @@ -2,6 +2,7 @@ use super::{ img_ids::{Imgs, ImgsRot}, item_imgs::ItemImgs, slots::{ArmorSlot, EquipSlot, InventorySlot, SlotManager}, + util::loadout_slot_text, Show, CRITICAL_HP_COLOR, LOW_HP_COLOR, TEXT_COLOR, UI_HIGHLIGHT_0, UI_MAIN, XP_COLOR, }; use crate::{ @@ -19,6 +20,7 @@ use conrod_core::{ widget::{self, Button, Image, Rectangle, Text}, widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; + use vek::Vec2; widget_ids! { @@ -76,6 +78,7 @@ widget_ids! { end_ico, fit_ico, wp_ico, + prot_ico, } } @@ -339,180 +342,139 @@ impl<'a> Widget for Bag<'a> { image_source: self.item_imgs, slot_manager: Some(self.slot_manager), }; + let i18n = &self.localized_strings; // Head - let (title, desc) = loadout - .head - .as_ref() - .map_or((self.localized_strings.get("hud.bag.head"), ""), |item| { - (item.name(), item.description()) - }); + let (title, desc) = + loadout_slot_text(loadout.head.as_ref(), || (i18n.get("hud.bag.head"), "")); slot_maker .fabricate(EquipSlot::Armor(ArmorSlot::Head), [45.0; 2]) .mid_top_with_margin_on(state.ids.bg_frame, 60.0) .with_icon(self.imgs.head_bg, Vec2::new(32.0, 40.0), Some(UI_MAIN)) - .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.head_slot, ui); // Necklace - let (title, desc) = loadout - .neck - .as_ref() - .map_or((self.localized_strings.get("hud.bag.neck"), ""), |item| { - (item.name(), item.description()) - }); + let (title, desc) = + loadout_slot_text(loadout.neck.as_ref(), || (i18n.get("hud.bag.neck"), "")); slot_maker .fabricate(EquipSlot::Armor(ArmorSlot::Neck), [45.0; 2]) .mid_bottom_with_margin_on(state.ids.head_slot, -55.0) .with_icon(self.imgs.necklace_bg, Vec2::new(40.0, 31.0), Some(UI_MAIN)) - .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.neck_slot, ui); // Chest //Image::new(self.imgs.armor_slot) // different graphics for empty/non empty - let (title, desc) = loadout - .chest - .as_ref() - .map_or((self.localized_strings.get("hud.bag.chest"), ""), |item| { - (item.name(), item.description()) - }); + let (title, desc) = + loadout_slot_text(loadout.chest.as_ref(), || (i18n.get("hud.bag.chest"), "")); slot_maker .fabricate(EquipSlot::Armor(ArmorSlot::Chest), [85.0; 2]) .mid_bottom_with_margin_on(state.ids.neck_slot, -95.0) .with_icon(self.imgs.chest_bg, Vec2::new(64.0, 42.0), Some(UI_MAIN)) - .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.chest_slot, ui); // Shoulders - let (title, desc) = loadout.shoulder.as_ref().map_or( - (self.localized_strings.get("hud.bag.shoulders"), ""), - |item| (item.name(), item.description()), - ); + let (title, desc) = loadout_slot_text(loadout.shoulder.as_ref(), || { + (i18n.get("hud.bag.shoulders"), "") + }); slot_maker .fabricate(EquipSlot::Armor(ArmorSlot::Shoulders), [70.0; 2]) .bottom_left_with_margins_on(state.ids.chest_slot, 0.0, -80.0) .with_icon(self.imgs.shoulders_bg, Vec2::new(60.0, 36.0), Some(UI_MAIN)) - .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.shoulders_slot, ui); // Hands - let (title, desc) = loadout - .hand - .as_ref() - .map_or((self.localized_strings.get("hud.bag.hands"), ""), |item| { - (item.name(), item.description()) - }); + let (title, desc) = + loadout_slot_text(loadout.hand.as_ref(), || (i18n.get("hud.bag.hands"), "")); slot_maker .fabricate(EquipSlot::Armor(ArmorSlot::Hands), [70.0; 2]) .bottom_right_with_margins_on(state.ids.chest_slot, 0.0, -80.0) .with_icon(self.imgs.hands_bg, Vec2::new(55.0, 60.0), Some(UI_MAIN)) - .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.hands_slot, ui); // Belt - let (title, desc) = loadout - .belt - .as_ref() - .map_or((self.localized_strings.get("hud.bag.belt"), ""), |item| { - (item.name(), item.description()) - }); + let (title, desc) = + loadout_slot_text(loadout.belt.as_ref(), || (i18n.get("hud.bag.belt"), "")); slot_maker .fabricate(EquipSlot::Armor(ArmorSlot::Belt), [45.0; 2]) .mid_bottom_with_margin_on(state.ids.chest_slot, -55.0) .with_icon(self.imgs.belt_bg, Vec2::new(40.0, 23.0), Some(UI_MAIN)) - .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.belt_slot, ui); // Legs - let (title, desc) = loadout - .pants - .as_ref() - .map_or((self.localized_strings.get("hud.bag.legs"), ""), |item| { - (item.name(), item.description()) - }); + let (title, desc) = + loadout_slot_text(loadout.pants.as_ref(), || (i18n.get("hud.bag.legs"), "")); slot_maker .fabricate(EquipSlot::Armor(ArmorSlot::Legs), [85.0; 2]) .mid_bottom_with_margin_on(state.ids.belt_slot, -95.0) .with_icon(self.imgs.legs_bg, Vec2::new(48.0, 70.0), Some(UI_MAIN)) - .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.legs_slot, ui); // Lantern - let (title, desc) = loadout.lantern.as_ref().map_or( - (self.localized_strings.get("hud.bag.lantern"), ""), - |item| (item.name(), item.description()), - ); + let (title, desc) = loadout_slot_text(loadout.lantern.as_ref(), || { + (i18n.get("hud.bag.lantern"), "") + }); slot_maker .fabricate(EquipSlot::Lantern, [45.0; 2]) .bottom_right_with_margins_on(state.ids.shoulders_slot, -55.0, 0.0) .with_icon(self.imgs.lantern_bg, Vec2::new(24.0, 38.0), Some(UI_MAIN)) - .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.lantern_slot, ui); // Ring - let (title, desc) = loadout - .ring - .as_ref() - .map_or((self.localized_strings.get("hud.bag.ring"), ""), |item| { - (item.name(), item.description()) - }); + let (title, desc) = + loadout_slot_text(loadout.ring.as_ref(), || (i18n.get("hud.bag.ring"), "")); slot_maker .fabricate(EquipSlot::Armor(ArmorSlot::Ring), [45.0; 2]) .bottom_left_with_margins_on(state.ids.hands_slot, -55.0, 0.0) .with_icon(self.imgs.ring_bg, Vec2::new(36.0, 40.0), Some(UI_MAIN)) - .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.ring_slot, ui); // Back - let (title, desc) = loadout - .back - .as_ref() - .map_or((self.localized_strings.get("hud.bag.back"), ""), |item| { - (item.name(), item.description()) - }); + let (title, desc) = + loadout_slot_text(loadout.back.as_ref(), || (i18n.get("hud.bag.back"), "")); slot_maker .fabricate(EquipSlot::Armor(ArmorSlot::Back), [45.0; 2]) .down_from(state.ids.lantern_slot, 10.0) .with_icon(self.imgs.back_bg, Vec2::new(33.0, 40.0), Some(UI_MAIN)) - .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.back_slot, ui); // Foot - let (title, desc) = loadout - .foot - .as_ref() - .map_or((self.localized_strings.get("hud.bag.feet"), ""), |item| { - (item.name(), item.description()) - }); + let (title, desc) = + loadout_slot_text(loadout.foot.as_ref(), || (i18n.get("hud.bag.feet"), "")); slot_maker .fabricate(EquipSlot::Armor(ArmorSlot::Feet), [45.0; 2]) .down_from(state.ids.ring_slot, 10.0) .with_icon(self.imgs.feet_bg, Vec2::new(32.0, 40.0), Some(UI_MAIN)) - .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.feet_slot, ui); // Tabard - let (title, desc) = loadout - .tabard - .as_ref() - .map_or((self.localized_strings.get("hud.bag.tabard"), ""), |item| { - (item.name(), item.description()) - }); + let (title, desc) = + loadout_slot_text(loadout.tabard.as_ref(), || (i18n.get("hud.bag.tabard"), "")); slot_maker .fabricate(EquipSlot::Armor(ArmorSlot::Tabard), [70.0; 2]) .top_right_with_margins_on(state.ids.bg_frame, 80.5, 53.0) .with_icon(self.imgs.tabard_bg, Vec2::new(60.0, 60.0), Some(UI_MAIN)) - .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.tabard_slot, ui); // Mainhand/Left-Slot - let (title, desc) = loadout.active_item.as_ref().map(|i| &i.item).map_or( - (self.localized_strings.get("hud.bag.mainhand"), ""), - |item| (item.name(), item.description()), - ); + let (title, desc) = + loadout_slot_text(loadout.active_item.as_ref().map(|i| &i.item), || { + (i18n.get("hud.bag.mainhand"), "") + }); slot_maker .fabricate(EquipSlot::Mainhand, [85.0; 2]) .bottom_right_with_margins_on(state.ids.back_slot, -95.0, 0.0) .with_icon(self.imgs.mainhand_bg, Vec2::new(75.0, 75.0), Some(UI_MAIN)) - .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.mainhand_slot, ui); // Offhand/Right-Slot - let (title, desc) = loadout.second_item.as_ref().map(|i| &i.item).map_or( - (self.localized_strings.get("hud.bag.offhand"), ""), - |item| (item.name(), item.description()), - ); + let (title, desc) = + loadout_slot_text(loadout.second_item.as_ref().map(|i| &i.item), || { + (i18n.get("hud.bag.offhand"), "") + }); slot_maker .fabricate(EquipSlot::Offhand, [85.0; 2]) .bottom_left_with_margins_on(state.ids.feet_slot, -95.0, 0.0) .with_icon(self.imgs.offhand_bg, Vec2::new(75.0, 75.0), Some(UI_MAIN)) - .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.offhand_slot, ui); } else { // Stats @@ -580,11 +542,14 @@ impl<'a> Widget for Bag<'a> { // Divider /*Image::new(self.imgs.divider) .w_h(50.0, 5.0) - .mid_top_with_margin_on(state.ids.exp, 30.0) + .mid_top_with_margin_on(state.ids.exp, 20.0) .color(Some(UI_HIGHLIGHT_0)) .set(state.ids.divider, ui);*/ // Stats + // Defense + let damage_reduction = (100.0 * loadout.get_damage_reduction()) as i32; + Text::new( &self .localized_strings @@ -596,24 +561,29 @@ impl<'a> Widget for Bag<'a> { .color(TEXT_COLOR) .set(state.ids.statnames, ui); Image::new(self.imgs.endurance_ico) - .w_h(30.0, 30.0) - .top_left_with_margins_on(state.ids.statnames, -10.0, -40.0) + .w_h(20.0, 20.0) + .top_left_with_margins_on(state.ids.statnames, 0.0, -40.0) .color(Some(UI_HIGHLIGHT_0)) .set(state.ids.end_ico, ui); Image::new(self.imgs.fitness_ico) - .w_h(30.0, 30.0) - .down_from(state.ids.end_ico, 10.0) + .w_h(20.0, 20.0) + .down_from(state.ids.end_ico, 15.0) .color(Some(UI_HIGHLIGHT_0)) .set(state.ids.fit_ico, ui); Image::new(self.imgs.willpower_ico) - .w_h(30.0, 30.0) - .down_from(state.ids.fit_ico, 10.0) + .w_h(20.0, 20.0) + .down_from(state.ids.fit_ico, 15.0) .color(Some(UI_HIGHLIGHT_0)) .set(state.ids.wp_ico, ui); + Image::new(self.imgs.protection_ico) + .w_h(20.0, 20.0) + .down_from(state.ids.wp_ico, 15.0) + .color(Some(UI_HIGHLIGHT_0)) + .set(state.ids.prot_ico, ui); Text::new(&format!( - "{}\n\n{}\n\n{}", - self.stats.endurance, self.stats.fitness, self.stats.willpower + "{}\n\n{}\n\n{}\n\n{}%", + self.stats.endurance, self.stats.fitness, self.stats.willpower, damage_reduction )) .top_right_with_margins_on(state.ids.stats_alignment, 120.0, 150.0) .font_id(self.fonts.cyri.conrod_id) @@ -662,16 +632,9 @@ impl<'a> Widget for Bag<'a> { 0.0 + x as f64 * (40.0), ); if let Some(item) = item { + let (title, desc) = super::util::item_text(item); slot_widget - .with_tooltip( - self.tooltip_manager, - &item.name(), - &format!( - "{}", - /* item.kind, item.effect(), */ item.description() - ), - &item_tooltip, - ) + .with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip) .set(state.ids.inv_slots[i], ui); } else { slot_widget.set(state.ids.inv_slots[i], ui); diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index 17e87924de..240860dd6e 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -241,6 +241,7 @@ image_ids! { willpower_ico: "voxygen.element.icons.willpower", endurance_ico: "voxygen.element.icons.endurance", fitness_ico: "voxygen.element.icons.fitness", + protection_ico: "voxygen.element.icons.protection", not_found:"voxygen.element.not_found", diff --git a/voxygen/src/hud/item_imgs.rs b/voxygen/src/hud/item_imgs.rs index 8661e911fe..53f55d1b1f 100644 --- a/voxygen/src/hud/item_imgs.rs +++ b/voxygen/src/hud/item_imgs.rs @@ -2,7 +2,7 @@ use crate::ui::{Graphic, SampleStrat, Transform, Ui}; use common::{ assets::{self, watch::ReloadIndicator, Asset}, comp::item::{ - armor::Armor, + armor::{Armor, ArmorKind}, tool::{Tool, ToolKind}, Consumable, Ingredient, Item, ItemKind, Lantern, LanternKind, Throwable, Utility, }, @@ -21,7 +21,7 @@ use vek::*; pub enum ItemKey { Tool(ToolKind), Lantern(LanternKind), - Armor(Armor), + Armor(ArmorKind), Utility(Utility), Consumable(Consumable), Throwable(Throwable), @@ -33,7 +33,7 @@ impl From<&Item> for ItemKey { match &item.kind { ItemKind::Tool(Tool { kind, .. }) => ItemKey::Tool(*kind), ItemKind::Lantern(Lantern { kind, .. }) => ItemKey::Lantern(*kind), - ItemKind::Armor { kind, .. } => ItemKey::Armor(*kind), + ItemKind::Armor(Armor { kind, .. }) => ItemKey::Armor(*kind), ItemKind::Utility { kind, .. } => ItemKey::Utility(*kind), ItemKind::Consumable { kind, .. } => ItemKey::Consumable(*kind), ItemKind::Throwable { kind, .. } => ItemKey::Throwable(*kind), diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 89bf34089c..7a4c2a75f6 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -15,6 +15,7 @@ mod skillbar; mod slots; mod social; mod spell; +mod util; use crate::{ecs::comp::HpFloaterList, hud::img_ids::ImgsRot, ui::img_ids::Rotations}; pub use hotbar::{SlotContents as HotbarSlotContents, State as HotbarState}; diff --git a/voxygen/src/hud/util.rs b/voxygen/src/hud/util.rs new file mode 100644 index 0000000000..5b8c15cbb9 --- /dev/null +++ b/voxygen/src/hud/util.rs @@ -0,0 +1,85 @@ +use common::comp::item::{ + armor::{Armor, ArmorKind, Protection}, + Item, ItemKind, +}; +use std::borrow::Cow; + +pub fn loadout_slot_text<'a>( + item: Option<&'a Item>, + mut empty: impl FnMut() -> (&'a str, &'a str), +) -> (&'a str, Cow<'a, str>) { + item.map_or_else( + || { + let (title, desc) = empty(); + (title, Cow::Borrowed(desc)) + }, + item_text, + ) +} + +pub fn item_text<'a>(item: &'a Item) -> (&'_ str, Cow<'a, str>) { + let desc = match item.kind { + ItemKind::Armor(armor) => Cow::Owned(armor_desc(armor, item.description())), + // ItemKind::Tool => {}, + /*ItemKind::Consumable(kind, effect, ..) => { + Cow::Owned(consumable_desc(consumable, item.description())) + },*/ + // ItemKind::Throwable => {}, + // ItemKind::Utility => {}, + // ItemKind::Ingredient => {}, + // ItemKind::Lantern => {}, + _ => Cow::Borrowed(item.description()), + }; + + (item.name(), desc) +} +// Armor Description +fn armor_desc(armor: Armor, desc: &str) -> String { + // TODO: localization + let kind = match armor.kind { + ArmorKind::Shoulder(_) => "Shoulders", + ArmorKind::Chest(_) => "Chest", + ArmorKind::Belt(_) => "Belt", + ArmorKind::Hand(_) => "Hands", + ArmorKind::Pants(_) => "Legs", + ArmorKind::Foot(_) => "Feet", + ArmorKind::Back(_) => "Back", + ArmorKind::Ring(_) => "Ring", + ArmorKind::Neck(_) => "Neck", + ArmorKind::Head(_) => "Head", + ArmorKind::Tabard(_) => "Tabard", + }; + let armor = match armor.get_protection() { + Protection::Normal(a) => a.to_string(), + Protection::Invincible => "Inf".to_string(), + }; + + if !desc.is_empty() { + format!( + "{}\n\nArmor: {}\n\n{}\n\n", + kind, armor, desc + ) + } else { + format!("{}\n\nArmor: {}\n\n", kind, armor) + } +} +// Weapon/Tool Description + +// Consumable Description +/*fn consumable_desc(consumable: Consumable, desc: &str) -> String { + // TODO: localization + let kind = "Consumable"; + if !desc.is_empty() { + format!("{}\n\n{}\n\n", kind, desc) + } else { + format!("{}\n\n", kind) + } +}*/ + +// Throwable Description + +// Utility Description + +// Ingredient Description + +// Lantern Description diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index 09faea2a4f..20f4f0ea48 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -8,8 +8,8 @@ use anim::Skeleton; use common::{ assets::watch::ReloadIndicator, comp::{ - item::{tool::ToolKind, ItemKind}, - Body, CharacterState, Item, Loadout, + item::{armor::ArmorKind, tool::ToolKind, ItemKind, LanternKind}, + Body, CharacterState, Loadout, }, figure::Segment, vol::BaseVol, @@ -33,14 +33,14 @@ struct CharacterCacheKey { state: Option>, // TODO: Can this be simplified? active_tool: Option, second_tool: Option, - shoulder: Option, - chest: Option, - belt: Option, - back: Option, - lantern: Option, - hand: Option, - pants: Option, - foot: Option, + shoulder: Option, + chest: Option, + belt: Option, + back: Option, + lantern: Option, + hand: Option, + pants: Option, + foot: Option, } impl CharacterCacheKey { @@ -61,14 +61,50 @@ impl CharacterCacheKey { } else { None }, - shoulder: loadout.shoulder.clone(), - chest: loadout.chest.clone(), - belt: loadout.belt.clone(), - back: loadout.back.clone(), - lantern: loadout.lantern.clone(), - hand: loadout.hand.clone(), - pants: loadout.pants.clone(), - foot: loadout.foot.clone(), + shoulder: if let Some(ItemKind::Armor(armor)) = + loadout.shoulder.as_ref().map(|i| &i.kind) + { + Some(armor.kind) + } else { + None + }, + chest: if let Some(ItemKind::Armor(armor)) = loadout.chest.as_ref().map(|i| &i.kind) { + Some(armor.kind) + } else { + None + }, + belt: if let Some(ItemKind::Armor(armor)) = loadout.belt.as_ref().map(|i| &i.kind) { + Some(armor.kind) + } else { + None + }, + back: if let Some(ItemKind::Armor(armor)) = loadout.back.as_ref().map(|i| &i.kind) { + Some(armor.kind) + } else { + None + }, + lantern: if let Some(ItemKind::Lantern(lantern)) = + loadout.lantern.as_ref().map(|i| &i.kind) + { + Some(lantern.kind) + } else { + None + }, + hand: if let Some(ItemKind::Armor(armor)) = loadout.hand.as_ref().map(|i| &i.kind) { + Some(armor.kind) + } else { + None + }, + pants: if let Some(ItemKind::Armor(armor)) = loadout.pants.as_ref().map(|i| &i.kind) { + Some(armor.kind) + } else { + None + }, + foot: if let Some(ItemKind::Armor(armor)) = loadout.foot.as_ref().map(|i| &i.kind) { + Some(armor.kind) + } else { + None + }, } } } diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index cf1f324a1d..ab5fdb8e7b 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -11,7 +11,9 @@ use common::{ golem::{BodyType as GBodyType, Species as GSpecies}, humanoid::{Body, BodyType, EyeColor, Skin, Species}, item::{ - armor::{Armor, Back, Belt, Chest, Foot, Hand, Head, Pants, Shoulder, Tabard}, + armor::{ + Armor, ArmorKind, Back, Belt, Chest, Foot, Hand, Head, Pants, Shoulder, Tabard, + }, tool::{Tool, ToolKind}, ItemKind, Lantern, LanternKind, }, @@ -365,10 +367,10 @@ impl HumArmorShoulderSpec { flipped: bool, generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, ) -> Mesh { - let spec = if let Some(ItemKind::Armor { - kind: Armor::Shoulder(shoulder), + let spec = if let Some(ItemKind::Armor(Armor { + kind: ArmorKind::Shoulder(shoulder), .. - }) = loadout.shoulder.as_ref().map(|i| &i.kind) + })) = loadout.shoulder.as_ref().map(|i| &i.kind) { match self.0.map.get(&shoulder) { Some(spec) => spec, @@ -447,10 +449,10 @@ impl HumArmorChestSpec { loadout: &Loadout, generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, ) -> Mesh { - let spec = if let Some(ItemKind::Armor { - kind: Armor::Chest(chest), + let spec = if let Some(ItemKind::Armor(Armor { + kind: ArmorKind::Chest(chest), .. - }) = loadout.chest.as_ref().map(|i| &i.kind) + })) = loadout.chest.as_ref().map(|i| &i.kind) { match self.0.map.get(&chest) { Some(spec) => spec, @@ -504,10 +506,10 @@ impl HumArmorHandSpec { flipped: bool, generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, ) -> Mesh { - let spec = if let Some(ItemKind::Armor { - kind: Armor::Hand(hand), + let spec = if let Some(ItemKind::Armor(Armor { + kind: ArmorKind::Hand(hand), .. - }) = loadout.hand.as_ref().map(|i| &i.kind) + })) = loadout.hand.as_ref().map(|i| &i.kind) { match self.0.map.get(&hand) { Some(spec) => spec, @@ -580,10 +582,10 @@ impl HumArmorBeltSpec { loadout: &Loadout, generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, ) -> Mesh { - let spec = if let Some(ItemKind::Armor { - kind: Armor::Belt(belt), + let spec = if let Some(ItemKind::Armor(Armor { + kind: ArmorKind::Belt(belt), .. - }) = loadout.belt.as_ref().map(|i| &i.kind) + })) = loadout.belt.as_ref().map(|i| &i.kind) { match self.0.map.get(&belt) { Some(spec) => spec, @@ -624,10 +626,10 @@ impl HumArmorBackSpec { loadout: &Loadout, generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, ) -> Mesh { - let spec = if let Some(ItemKind::Armor { - kind: Armor::Back(back), + let spec = if let Some(ItemKind::Armor(Armor { + kind: ArmorKind::Back(back), .. - }) = loadout.back.as_ref().map(|i| &i.kind) + })) = loadout.back.as_ref().map(|i| &i.kind) { match self.0.map.get(&back) { Some(spec) => spec, @@ -667,10 +669,10 @@ impl HumArmorPantsSpec { loadout: &Loadout, generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, ) -> Mesh { - let spec = if let Some(ItemKind::Armor { - kind: Armor::Pants(pants), + let spec = if let Some(ItemKind::Armor(Armor { + kind: ArmorKind::Pants(pants), .. - }) = loadout.pants.as_ref().map(|i| &i.kind) + })) = loadout.pants.as_ref().map(|i| &i.kind) { match self.0.map.get(&pants) { Some(spec) => spec, @@ -724,10 +726,10 @@ impl HumArmorFootSpec { flipped: bool, generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, ) -> Mesh { - let spec = if let Some(ItemKind::Armor { - kind: Armor::Foot(foot), + let spec = if let Some(ItemKind::Armor(Armor { + kind: ArmorKind::Foot(foot), .. - }) = loadout.foot.as_ref().map(|i| &i.kind) + })) = loadout.foot.as_ref().map(|i| &i.kind) { match self.0.map.get(&foot) { Some(spec) => spec, @@ -879,10 +881,10 @@ impl HumArmorHeadSpec { loadout: &Loadout, generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, ) -> Mesh { - let spec = if let Some(ItemKind::Armor { - kind: Armor::Head(head), + let spec = if let Some(ItemKind::Armor(Armor { + kind: ArmorKind::Head(head), .. - }) = loadout.head.as_ref().map(|i| &i.kind) + })) = loadout.head.as_ref().map(|i| &i.kind) { match self.0.map.get(&head) { Some(spec) => spec, @@ -934,10 +936,10 @@ impl HumArmorTabardSpec { loadout: &Loadout, generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, ) -> Mesh { - let spec = if let Some(ItemKind::Armor { - kind: Armor::Tabard(tabard), + let spec = if let Some(ItemKind::Armor(Armor { + kind: ArmorKind::Tabard(tabard), .. - }) = loadout.tabard.as_ref().map(|i| &i.kind) + })) = loadout.tabard.as_ref().map(|i| &i.kind) { match self.0.map.get(&tabard) { Some(spec) => spec,