diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f3e32f16c..bec6a47843 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added ability to jump while underwater - Added proper SFX system - Added changelog +- Added animated Map and Minimap position indicator +- Added visuals to indicate strength compared to the player ### Changed @@ -44,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed cloud performance - Fixed region display name - Fixed the bow fire rate +- Healthbars now flash on critical health ### Removed diff --git a/Cargo.toml b/Cargo.toml index 4c463c2db7..9c674add42 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ members = [ # default profile for devs, fast to compile, okay enough to run, no debug information [profile.dev] opt-level = 2 -overflow-checks = true +overflow-checks = false debug-assertions = true panic = "abort" debug = false diff --git a/assets/common/items/weapons/hammer_1.ron b/assets/common/items/weapons/hammer_1.ron new file mode 100644 index 0000000000..badb1732cc --- /dev/null +++ b/assets/common/items/weapons/hammer_1.ron @@ -0,0 +1,8 @@ +Item( + name: "Crude Mallet", + description: "Breaks bones like sticks and stones.", + kind: Tool( + kind: Hammer, + power: 20, + ), +) diff --git a/assets/common/items/weapons/staff_1.ron b/assets/common/items/weapons/staff_1.ron new file mode 100644 index 0000000000..59e41d09ed --- /dev/null +++ b/assets/common/items/weapons/staff_1.ron @@ -0,0 +1,8 @@ +Item( + name: "Humble Stick", + description: "Walking stick with a sharpened end.", + kind: Tool( + kind: Hammer, + power: 6, + ), +) diff --git a/assets/common/items/weapons/starter_axe.ron b/assets/common/items/weapons/starter_axe.ron index 74d97b8864..7a27c1e6db 100644 --- a/assets/common/items/weapons/starter_axe.ron +++ b/assets/common/items/weapons/starter_axe.ron @@ -3,6 +3,6 @@ Item( description: "Every dent tells the story of a chopped tree.", kind: Tool( kind: Axe, - power: 10, + power: 15, ), ) diff --git a/assets/common/items/weapons/starter_bow.ron b/assets/common/items/weapons/starter_bow.ron index d59933630c..0be646d0e3 100644 --- a/assets/common/items/weapons/starter_bow.ron +++ b/assets/common/items/weapons/starter_bow.ron @@ -3,6 +3,6 @@ Item( description: "Someone carved his initials into it...", kind: Tool( kind: Bow, - power: 10, + power: 15, ), ) diff --git a/assets/common/items/weapons/starter_dagger.ron b/assets/common/items/weapons/starter_dagger.ron index e374c14160..88b4990620 100644 --- a/assets/common/items/weapons/starter_dagger.ron +++ b/assets/common/items/weapons/starter_dagger.ron @@ -3,6 +3,6 @@ Item( description: "Great for cutting meat.", kind: Tool( kind: Dagger, - power: 10, + power: 15, ), ) diff --git a/assets/common/items/weapons/starter_hammer.ron b/assets/common/items/weapons/starter_hammer.ron index 02e0840e17..c27875a5c2 100644 --- a/assets/common/items/weapons/starter_hammer.ron +++ b/assets/common/items/weapons/starter_hammer.ron @@ -3,6 +3,6 @@ Item( description: "'Property of...' The rest is missing. ", kind: Tool( kind: Hammer, - power: 10, + power: 15, ), ) diff --git a/assets/common/items/weapons/starter_staff.ron b/assets/common/items/weapons/starter_staff.ron index f2ada50d49..791b518bea 100644 --- a/assets/common/items/weapons/starter_staff.ron +++ b/assets/common/items/weapons/starter_staff.ron @@ -3,6 +3,6 @@ Item( description: "Smells like resin and magic.", kind: Tool( kind: Staff, - power: 10, + power: 20, ), ) diff --git a/assets/common/items/weapons/starter_sword.ron b/assets/common/items/weapons/starter_sword.ron index dadbc9d2d5..eb4ce67111 100644 --- a/assets/common/items/weapons/starter_sword.ron +++ b/assets/common/items/weapons/starter_sword.ron @@ -3,6 +3,6 @@ Item( description: "Held together by Rust and hope.", kind: Tool( kind: Sword, - power: 10, + power: 15, ), ) diff --git a/assets/voxygen/element/buttons/indicator_mmap.vox b/assets/voxygen/element/buttons/indicator_mmap.vox index 942f8892cc..b1a6233f9b 100644 --- a/assets/voxygen/element/buttons/indicator_mmap.vox +++ b/assets/voxygen/element/buttons/indicator_mmap.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0773c7dd90d30b77affb6452cd3499f0bd5b069c71b4b1cc1734d7815a14d239 -size 56900 +oid sha256:5e647033fe3c7370a0dbf5b923c8efbe5839e4d485a12c5c3c21084936d34355 +size 56692 diff --git a/assets/voxygen/element/buttons/indicator_mmap_2.vox b/assets/voxygen/element/buttons/indicator_mmap_2.vox new file mode 100644 index 0000000000..63da2b0477 --- /dev/null +++ b/assets/voxygen/element/buttons/indicator_mmap_2.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c503390eed517f975dbc4e55b40cad10e4337a1b35b26e344d8fa5fe38a7813e +size 56772 diff --git a/assets/voxygen/element/buttons/indicator_mmap_3.vox b/assets/voxygen/element/buttons/indicator_mmap_3.vox new file mode 100644 index 0000000000..b0dd4025d8 --- /dev/null +++ b/assets/voxygen/element/buttons/indicator_mmap_3.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:571d8fa25a8ad7e9cf02fcab951dd94cfae360b8ae480b0307aded8bcbc57949 +size 56772 diff --git a/assets/voxygen/element/buttons/min_plus/mmap_button-min.vox b/assets/voxygen/element/buttons/min_plus/mmap_button-min.vox new file mode 100644 index 0000000000..2d357a2041 --- /dev/null +++ b/assets/voxygen/element/buttons/min_plus/mmap_button-min.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c333365527174d741c93b2b76718f36b93d9c095a4069d86fb6709f977ab0a0 +size 1640 diff --git a/assets/voxygen/element/buttons/min_plus/mmap_button-min_hover.vox b/assets/voxygen/element/buttons/min_plus/mmap_button-min_hover.vox new file mode 100644 index 0000000000..7aa3bfb619 --- /dev/null +++ b/assets/voxygen/element/buttons/min_plus/mmap_button-min_hover.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b7dba6b97ae900053f4b65c82964bf9097af87ef1860ae773e12b6008f6808a +size 1640 diff --git a/assets/voxygen/element/buttons/min_plus/mmap_button-min_press.vox b/assets/voxygen/element/buttons/min_plus/mmap_button-min_press.vox new file mode 100644 index 0000000000..2da392109a --- /dev/null +++ b/assets/voxygen/element/buttons/min_plus/mmap_button-min_press.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c4e5b2f0c0a612025fdfc85c968a090ab635e7c51b56ec464c3c2855ccd25d3 +size 1624 diff --git a/assets/voxygen/element/buttons/min_plus/mmap_button-plus.vox b/assets/voxygen/element/buttons/min_plus/mmap_button-plus.vox new file mode 100644 index 0000000000..85ba1d2f1a --- /dev/null +++ b/assets/voxygen/element/buttons/min_plus/mmap_button-plus.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1c9f4927664cc47d6b28d6962c15c5414ff87dcc4734cb04a4f824d69253d41 +size 1656 diff --git a/assets/voxygen/element/buttons/min_plus/mmap_button-plus_hover.vox b/assets/voxygen/element/buttons/min_plus/mmap_button-plus_hover.vox new file mode 100644 index 0000000000..05db19fa1a --- /dev/null +++ b/assets/voxygen/element/buttons/min_plus/mmap_button-plus_hover.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea0a6a621d1c9d1b44aaddb16a21a1711ba4f5e9283f3bb8f66055d414e6b641 +size 1656 diff --git a/assets/voxygen/element/buttons/min_plus/mmap_button-plus_press.vox b/assets/voxygen/element/buttons/min_plus/mmap_button-plus_press.vox new file mode 100644 index 0000000000..c61033c8a7 --- /dev/null +++ b/assets/voxygen/element/buttons/min_plus/mmap_button-plus_press.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15f28c6f1b7ae17aaf6766ec036f9cc837c74715ea4beeb242b7d69efb92edae +size 1608 diff --git a/assets/voxygen/element/frames/enemybar.vox b/assets/voxygen/element/frames/enemybar.vox new file mode 100644 index 0000000000..86d8e7b3d9 --- /dev/null +++ b/assets/voxygen/element/frames/enemybar.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6bb91912f72a88fb39e4a06dd6a847b0e4512a934ce193cb1325abb91549e455 +size 60720 diff --git a/assets/voxygen/element/help.png b/assets/voxygen/element/help.png index de5404dc26..c399bd2d1a 100644 --- a/assets/voxygen/element/help.png +++ b/assets/voxygen/element/help.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:58e48fef0c655f3d4de7dc94b4aa4d5583183d4d6b9c796764b1518de00ffb04 -size 14170 +oid sha256:4c71ba3a6458d00f3c6fb2820f1a83c6138a4776fdfd7167c2766b40b7bbb377 +size 14939 diff --git a/assets/voxygen/element/icons/skull.vox b/assets/voxygen/element/icons/skull.vox new file mode 100644 index 0000000000..6f12b02c2b --- /dev/null +++ b/assets/voxygen/element/icons/skull.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6eeb17f7682aa533fc805de9272f55f01d10c06d2c6afefed54ce23d46fe93ab +size 56456 diff --git a/assets/voxygen/element/icons/skull_2.vox b/assets/voxygen/element/icons/skull_2.vox new file mode 100644 index 0000000000..a32adc29ff --- /dev/null +++ b/assets/voxygen/element/icons/skull_2.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6717aca430c81b346951f22fbb03e2dca4765a3fd56b7e515f267138af9f6e18 +size 56512 diff --git a/assets/voxygen/voxel/armor/back/short-0.vox b/assets/voxygen/voxel/armor/back/short-0.vox new file mode 100644 index 0000000000..b9c5362a58 --- /dev/null +++ b/assets/voxygen/voxel/armor/back/short-0.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c9e63b1debc909844e95ad7eb8b16c3dc94d1362b541fca7028f24dc2398fbd +size 44573 diff --git a/assets/voxygen/voxel/npc/oger/belt.vox b/assets/voxygen/voxel/npc/oger/belt.vox new file mode 100644 index 0000000000..3be13b8607 --- /dev/null +++ b/assets/voxygen/voxel/npc/oger/belt.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:640138a4516812405d5b7b8fe5e92652127e939cf09882ec2d40066995944aed +size 1736 diff --git a/assets/voxygen/voxel/npc/oger/chest.vox b/assets/voxygen/voxel/npc/oger/chest.vox new file mode 100644 index 0000000000..a7851d6b4f --- /dev/null +++ b/assets/voxygen/voxel/npc/oger/chest.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1a313f34a4ac2da2e4622f0b3c641d6f3c22da12c08433eba641be35b20b4c7 +size 3124 diff --git a/assets/voxygen/voxel/npc/oger/foot.vox b/assets/voxygen/voxel/npc/oger/foot.vox new file mode 100644 index 0000000000..5f93e9b833 --- /dev/null +++ b/assets/voxygen/voxel/npc/oger/foot.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:922d8355b060ba8344793dafb3bf998198753d8b6bc528e125e11423ac15d149 +size 1508 diff --git a/assets/voxygen/voxel/npc/oger/hand-l.vox b/assets/voxygen/voxel/npc/oger/hand-l.vox new file mode 100644 index 0000000000..605d6363f9 --- /dev/null +++ b/assets/voxygen/voxel/npc/oger/hand-l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64beb9f9cabf9cd887b8fe7d6323bdf0908063359809e2c18da58733fb9b82bc +size 44439 diff --git a/assets/voxygen/voxel/npc/oger/hand-r.vox b/assets/voxygen/voxel/npc/oger/hand-r.vox new file mode 100644 index 0000000000..09d273756c --- /dev/null +++ b/assets/voxygen/voxel/npc/oger/hand-r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5367735a13345ea6d2cc64bdc99bb1153851553658ff6c1425874de6cf06b5b8 +size 1332 diff --git a/assets/voxygen/voxel/npc/oger/head.vox b/assets/voxygen/voxel/npc/oger/head.vox new file mode 100644 index 0000000000..ff1ff1f084 --- /dev/null +++ b/assets/voxygen/voxel/npc/oger/head.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1bdee396a4bddcd426bde3bdf8fd06b2fb544a992398dd1f0a804a7149a35a4b +size 3784 diff --git a/assets/voxygen/voxel/npc/oger/legs.vox b/assets/voxygen/voxel/npc/oger/legs.vox new file mode 100644 index 0000000000..68243de5b6 --- /dev/null +++ b/assets/voxygen/voxel/npc/oger/legs.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb8b4fdac51bc1a662ebb1cec3e5ef2c52167e0a021b603c9226e9afe2259ab8 +size 2428 diff --git a/assets/voxygen/voxel/npc/oger/shoulder.vox b/assets/voxygen/voxel/npc/oger/shoulder.vox new file mode 100644 index 0000000000..93585a80e0 --- /dev/null +++ b/assets/voxygen/voxel/npc/oger/shoulder.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52a3f3b21c4994f1e610c1377587d0131b32b14b2ed07bcaaec2ddb88cbb2505 +size 1748 diff --git a/assets/voxygen/voxel/weapon/hammer/hammer_1_2h.vox b/assets/voxygen/voxel/weapon/hammer/hammer_1_2h.vox new file mode 100644 index 0000000000..cb72e2bf45 --- /dev/null +++ b/assets/voxygen/voxel/weapon/hammer/hammer_1_2h.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:192c79add7e4fb06f635176fd1324fd8b95df85f5a58428cf71d0235cf378ef4 +size 58028 diff --git a/assets/voxygen/voxel/weapon/staff/wood-simple.vox b/assets/voxygen/voxel/weapon/staff/wood-simple.vox new file mode 100644 index 0000000000..7e69534fda --- /dev/null +++ b/assets/voxygen/voxel/weapon/staff/wood-simple.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b3fe2dfa4d4e9505762e70bd86c1719cfa0b579b0050211a30f769492c77898 +size 55932 diff --git a/assets/world/tree/acacia/1.vox b/assets/world/tree/acacia/1.vox index cda1574acc..c430606bfc 100644 --- a/assets/world/tree/acacia/1.vox +++ b/assets/world/tree/acacia/1.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c8f5224352c662e4400b16f0ebff2ee7accdf188b20748d5049f16f7011902bd -size 51468 +oid sha256:2a5035086a7d26f04608f40d22aca9d47adf98998d1b7e15e2372888a3b43ae8 +size 76828 diff --git a/assets/world/tree/acacia/2.vox b/assets/world/tree/acacia/2.vox index 32ecce590e..5ebcb50566 100644 --- a/assets/world/tree/acacia/2.vox +++ b/assets/world/tree/acacia/2.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fcbe884c673e8e16911318fe228bfba6bc36e65bc1f8c26c9706d92719eac97c -size 44527 +oid sha256:688a03d477499e69541b7feec4ce6bebd7dede1e743540e2c3cbcd9b0a53c016 +size 56619 diff --git a/assets/world/tree/acacia/3.vox b/assets/world/tree/acacia/3.vox index 8bc06e54cc..7c8243bb9a 100644 --- a/assets/world/tree/acacia/3.vox +++ b/assets/world/tree/acacia/3.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9734b6769fa66c77ddee14490b1c6a1241048fbdf7f7cfacfefb77c045e484b2 -size 44795 +oid sha256:455b635d1bc20402a3290cbfdc7c030d3de428287b820cf0dde1aa0be4a74ee2 +size 57487 diff --git a/assets/world/tree/acacia/4.vox b/assets/world/tree/acacia/4.vox index 6bc02dac6e..d089cfa34e 100644 --- a/assets/world/tree/acacia/4.vox +++ b/assets/world/tree/acacia/4.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c2a53a49c63b45712ee7ddcf9c6ec991193bc17041d12f63264e6372e112c056 -size 51196 +oid sha256:a37debf05102414ef85d2a1799ba28749de7e5d5290c152d374494a984bfe22a +size 72004 diff --git a/assets/world/tree/acacia/5.vox b/assets/world/tree/acacia/5.vox index 0c22065caa..56f0e5f01a 100644 --- a/assets/world/tree/acacia/5.vox +++ b/assets/world/tree/acacia/5.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cdea24bb04530868486a9b50a84c756a5a90981a70af1bb3c50c1ca72e3b666e -size 51672 +oid sha256:c1cc51107d88924dbf1637ae8f424b5292299eb35c50eeb07cae0be5fe3766f6 +size 88092 diff --git a/assets/world/tree/acacia_savannah/1.vox b/assets/world/tree/acacia_savannah/1.vox new file mode 100644 index 0000000000..cda1574acc --- /dev/null +++ b/assets/world/tree/acacia_savannah/1.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8f5224352c662e4400b16f0ebff2ee7accdf188b20748d5049f16f7011902bd +size 51468 diff --git a/assets/world/tree/acacia_savannah/2.vox b/assets/world/tree/acacia_savannah/2.vox new file mode 100644 index 0000000000..32ecce590e --- /dev/null +++ b/assets/world/tree/acacia_savannah/2.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fcbe884c673e8e16911318fe228bfba6bc36e65bc1f8c26c9706d92719eac97c +size 44527 diff --git a/assets/world/tree/acacia_savannah/3.vox b/assets/world/tree/acacia_savannah/3.vox new file mode 100644 index 0000000000..8bc06e54cc --- /dev/null +++ b/assets/world/tree/acacia_savannah/3.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9734b6769fa66c77ddee14490b1c6a1241048fbdf7f7cfacfefb77c045e484b2 +size 44795 diff --git a/assets/world/tree/acacia_savannah/4.vox b/assets/world/tree/acacia_savannah/4.vox new file mode 100644 index 0000000000..6bc02dac6e --- /dev/null +++ b/assets/world/tree/acacia_savannah/4.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2a53a49c63b45712ee7ddcf9c6ec991193bc17041d12f63264e6372e112c056 +size 51196 diff --git a/assets/world/tree/acacia_savannah/5.vox b/assets/world/tree/acacia_savannah/5.vox new file mode 100644 index 0000000000..0c22065caa --- /dev/null +++ b/assets/world/tree/acacia_savannah/5.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cdea24bb04530868486a9b50a84c756a5a90981a70af1bb3c50c1ca72e3b666e +size 51672 diff --git a/common/src/comp/body/giant.rs b/common/src/comp/body/giant.rs new file mode 100644 index 0000000000..9ded72c2b5 --- /dev/null +++ b/common/src/comp/body/giant.rs @@ -0,0 +1,69 @@ +use rand::{seq::SliceRandom, thread_rng}; + +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct Body { + pub head: Head, + pub shoulder: Shoulder, + pub chest: Chest, + pub hand: Hand + pub belt: Belt, + pub pants: Pants, + pub foot: Foot, +} + +impl Body { + pub fn random() -> Self { + let mut rng = thread_rng(); + Self { + head: *(&ALL_HEADS).choose(&mut rng).unwrap(), + shoulder: *(&ALL_SHOULDERS).choose(&mut rng).unwrap(), + chest: *(&ALL_CHESTS).choose(&mut rng).unwrap(), + hand: *(&ALL_HANDS).choose(&mut rng).unwrap(), + belt: *(&ALL_BELTS).choose(&mut rng).unwrap(), + pants: *(&ALL_PANTS).choose(&mut rng).unwrap(), + foot: *(&ALL_FEET).choose(&mut rng).unwrap(), + } + } +} + +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum Head { + Default, +} +const ALL_HEADS: [Head; 1] = [Head::Default]; + +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum Shoulder { + Default, +} +const ALL_SHOULDERS: [Shoulder; 1] = [Shoulder::Default]; + +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum Chest { + Default, +} +const ALL_CHESTS: [Chest; 1] = [Chest::Default]; + +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum Hand { + Default, +} +const ALL_HANDS: [Hand; 1] = [Hand::Default]; + +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum Belt { + Default, +} +const ALL_BELTS: [Belt; 1] = [Belt::Default]; +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum Pants { + Default, +} +const ALL_FEET: [Foot; 1] = [Foot::Default]; +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum Foot { + Default, +} + + + diff --git a/server/src/sys/message.rs b/server/src/sys/message.rs index b7b47c0215..f2466c281f 100644 --- a/server/src/sys/message.rs +++ b/server/src/sys/message.rs @@ -109,6 +109,7 @@ impl<'a> System<'a> for Sys { client.error_state(RequestStateError::Already) } ClientState::Spectator | ClientState::Character | ClientState::Dead => { + // TODO: remove position etc here client.allow_state(ClientState::Registered) } ClientState::Pending => {} diff --git a/server/src/sys/terrain.rs b/server/src/sys/terrain.rs index c9560c4b81..c72866d385 100644 --- a/server/src/sys/terrain.rs +++ b/server/src/sys/terrain.rs @@ -98,10 +98,8 @@ impl<'a> System<'a> for Sys { for npc in supplement.npcs { let (mut stats, mut body) = if rand::random() { let stats = comp::Stats::new( - "Humanoid".to_string(), - Some(assets::load_expect_cloned( - "common.items.weapons.starter_sword", - )), + "Traveler".to_string(), + Some(assets::load_expect_cloned("common.items.weapons.staff_1")), ); let body = comp::Body::Humanoid(comp::humanoid::Body::random()); (stats, body) @@ -113,20 +111,18 @@ impl<'a> System<'a> for Sys { let mut scale = 1.0; // TODO: Remove this and implement scaling or level depending on stuff like species instead - stats.level.set_level(rand::thread_rng().gen_range(1, 3)); + stats.level.set_level(rand::thread_rng().gen_range(1, 10)); if npc.boss { if rand::random::() < 0.8 { stats = comp::Stats::new( - "Humanoid".to_string(), - Some(assets::load_expect_cloned( - "common.items.weapons.starter_sword", - )), + "Fearless Wanderer".to_string(), + Some(assets::load_expect_cloned("common.items.weapons.hammer_1")), ); body = comp::Body::Humanoid(comp::humanoid::Body::random()); } - stats.level.set_level(rand::thread_rng().gen_range(10, 50)); - scale = 2.5 + rand::random::(); + stats.level.set_level(rand::thread_rng().gen_range(20, 50)); + scale = 2.0 + rand::random::(); } stats.update_max_hp(); diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index b4b37616e9..ac1593693f 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -118,10 +118,14 @@ image_ids! { grass: "voxygen.element.icons.item_grass", apple: "voxygen.element.icons.item_apple", mushroom: "voxygen.element.icons.item_mushroom", + skull: "voxygen.element.icons.skull", + skull_2: "voxygen.element.icons.skull_2", // Map map_indicator: "voxygen.element.buttons.map_indicator", indicator_mmap: "voxygen.element.buttons.indicator_mmap", + indicator_mmap_2: "voxygen.element.buttons.indicator_mmap_2", + indicator_mmap_3: "voxygen.element.buttons.indicator_mmap_3", // Crosshair @@ -154,6 +158,12 @@ image_ids! { mmap_open: "voxygen.element.buttons.button_mmap_open", mmap_open_hover: "voxygen.element.buttons.button_mmap_open_hover", mmap_open_press: "voxygen.element.buttons.button_mmap_open_press", + mmap_plus: "voxygen.element.buttons.min_plus.mmap_button-plus", + mmap_plus_hover: "voxygen.element.buttons.min_plus.mmap_button-plus_hover", + mmap_plus_press: "voxygen.element.buttons.min_plus.mmap_button-plus_hover", + mmap_minus: "voxygen.element.buttons.min_plus.mmap_button-min", + mmap_minus_hover: "voxygen.element.buttons.min_plus.mmap_button-min_hover", + mmap_minus_press: "voxygen.element.buttons.min_plus.mmap_button-min_press", // Grid grid: "voxygen.element.buttons.grid", @@ -221,6 +231,10 @@ image_ids! { key: "voxygen.voxel.object.key", key_gold: "voxygen.voxel.object.key_gold", + // Enemy Healthbar + enemy_health: "voxygen.element.frames.enemybar", + + ////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/voxygen/src/hud/map.rs b/voxygen/src/hud/map.rs index 885a69f319..8d7eccc10c 100644 --- a/voxygen/src/hud/map.rs +++ b/voxygen/src/hud/map.rs @@ -5,7 +5,7 @@ use conrod_core::{ color, image::Id, widget::{self, Button, Image, Rectangle, Text}, - widget_ids, Colorable, Positionable, Sizeable, Widget, WidgetCommon, + widget_ids, Color, Colorable, Positionable, Sizeable, Widget, WidgetCommon, }; use specs::WorldExt; use vek::*; @@ -31,12 +31,12 @@ widget_ids! { pub struct Map<'a> { _show: &'a Show, client: &'a Client, - _world_map: Id, imgs: &'a Imgs, fonts: &'a Fonts, #[conrod(common_builder)] common: widget::CommonBuilder, + pulse: f32, } impl<'a> Map<'a> { pub fn new( @@ -45,6 +45,7 @@ impl<'a> Map<'a> { imgs: &'a Imgs, world_map: Id, fonts: &'a Fonts, + pulse: f32, ) -> Self { Self { _show: show, @@ -53,6 +54,7 @@ impl<'a> Map<'a> { client, fonts: fonts, common: widget::CommonBuilder::default(), + pulse, } } } @@ -129,9 +131,10 @@ impl<'a> Widget for Map<'a> { // Location Name match self.client.current_chunk() { Some(chunk) => Text::new(chunk.meta().name()) - .mid_top_with_margin_on(state.ids.map_bg, 70.0) - .font_size(20) + .mid_top_with_margin_on(state.ids.map_bg, 55.0) + .font_size(60) .color(TEXT_COLOR) + .font_id(self.fonts.alkhemi) .parent(state.ids.map_frame_r) .set(state.ids.location_name, ui), None => Text::new(" ") @@ -157,15 +160,33 @@ impl<'a> Widget for Map<'a> { .map_or(Vec3::zero(), |pos| pos.0); let worldsize = 32768.0; // TODO This has to get the actual world size and not be hardcoded - let x = player_pos.x as f64 / worldsize * 700.0; + let x = player_pos.x as f64 / worldsize * 700.0/*= x-Size of the map image*/; let y = (/*1.0 -*/player_pos.y as f64 / worldsize) * 700.0; + let indic_ani = (self.pulse * 6.0/*animation speed*/).cos()/*starts at 1.0*/ * 0.5 + 0.50; // changes the animation frame + let indic_scale = 1.2; // Indicator - Image::new(self.imgs.map_indicator) - .bottom_left_with_margins_on(state.ids.grid, y, x - (12.0 * 1.4) / 2.0) - .w_h(12.0 * 1.4, 21.0 * 1.4) - .floating(true) - .parent(ui.window) - .set(state.ids.indicator, ui); + Image::new(if indic_ani <= 0.3 { + self.imgs.indicator_mmap + } else if indic_ani <= 0.6 { + self.imgs.indicator_mmap_2 + } else { + self.imgs.indicator_mmap_3 + }) + .bottom_left_with_margins_on(state.ids.grid, y, x - (20.0 * 1.2) / 2.0) + .w_h( + 22.0 * 1.2, + if indic_ani <= 0.3 { + 16.0 * indic_scale + } else if indic_ani <= 0.6 { + 23.0 * indic_scale + } else { + 34.0 * indic_scale + }, + ) + .color(Some(Color::Rgba(1.0, 1.0, 1.0, 1.0))) + .floating(true) + .parent(ui.window) + .set(state.ids.indicator, ui); None } diff --git a/voxygen/src/hud/minimap.rs b/voxygen/src/hud/minimap.rs index be1e34ad2c..e5b7f8278c 100644 --- a/voxygen/src/hud/minimap.rs +++ b/voxygen/src/hud/minimap.rs @@ -17,6 +17,8 @@ widget_ids! { mmap_frame_bg, mmap_location, mmap_button, + mmap_plus, + mmap_minus, zone_display_bg, zone_display, grid, @@ -35,6 +37,8 @@ pub struct MiniMap<'a> { fonts: &'a Fonts, #[conrod(common_builder)] common: widget::CommonBuilder, + pulse: f32, + zoom: f32, } impl<'a> MiniMap<'a> { @@ -44,6 +48,8 @@ impl<'a> MiniMap<'a> { imgs: &'a Imgs, world_map: Id, fonts: &'a Fonts, + pulse: f32, + zoom: f32, ) -> Self { Self { show, @@ -52,6 +58,8 @@ impl<'a> MiniMap<'a> { _world_map: world_map, fonts: fonts, common: widget::CommonBuilder::default(), + pulse, + zoom, } } } @@ -87,20 +95,49 @@ impl<'a> Widget for MiniMap<'a> { fn update(self, args: widget::UpdateArgs) -> Self::Event { let widget::UpdateArgs { state, ui, .. } = args; - + let zoom = self.zoom as f64; if self.show.mini_map { Image::new(self.imgs.mmap_frame) - .w_h(100.0 * 4.0, 100.0 * 4.0) + .w_h(100.0 * 4.0 * zoom, 100.0 * 4.0 * zoom) .top_right_with_margins_on(ui.window, 5.0, 5.0) .set(state.ids.mmap_frame, ui); Rectangle::fill_with([92.0 * 4.0, 82.0 * 4.0], color::TRANSPARENT) - .mid_top_with_margin_on(state.ids.mmap_frame, 13.0 * 4.0 + 4.0) + .mid_top_with_margin_on(state.ids.mmap_frame, 13.0 * 4.0 + 4.0 * zoom) .set(state.ids.mmap_frame_bg, ui); + // Zoom Buttons + // TODO: Add zoomable minimap + + /*if Button::image(self.imgs.mmap_plus) + .w_h(100.0 * 0.2 * zoom, 100.0 * 0.2 * zoom) + .hover_image(self.imgs.mmap_plus_hover) + .press_image(self.imgs.mmap_plus_press) + .top_left_with_margins_on(state.ids.mmap_frame, 0.0, 0.0) + .set(state.ids.mmap_plus, ui) + .was_clicked() + { + if zoom > 0.0 { + zoom = zoom + 1.0 + } else if zoom == 5.0 { + } + } + if Button::image(self.imgs.mmap_minus) + .w_h(100.0 * 0.2 * zoom, 100.0 * 0.2 * zoom) + .hover_image(self.imgs.mmap_minus_hover) + .press_image(self.imgs.mmap_minus_press) + .down_from(state.ids.mmap_plus, 0.0) + .set(state.ids.mmap_minus, ui) + .was_clicked() + { + if zoom < 6.0 { + zoom = zoom - 1.0 + } else if zoom == 0.0 { + } + }*/ // Map Image Image::new(/*self.world_map*/ self.imgs.map_placeholder) .middle_of(state.ids.mmap_frame_bg) - .w_h(92.0 * 4.0, 82.0 * 4.0) + .w_h(92.0 * 4.0 * zoom, 82.0 * 4.0 * zoom) .parent(state.ids.mmap_frame_bg) .set(state.ids.grid, ui); // Coordinates @@ -115,13 +152,28 @@ impl<'a> Widget for MiniMap<'a> { let worldsize = 32768.0; // TODO This has to get the actual world size and not be hardcoded let x = player_pos.x as f64 / worldsize * 92.0 * 4.0; let y = (/*1.0X-*/player_pos.y as f64 / worldsize) * 82.0 * 4.0; + let indic_ani = (self.pulse * 6.0).cos() * 0.5 + 0.5; //Animation timer + let indic_scale = 0.8; // Indicator - Image::new(self.imgs.indicator_mmap) - .bottom_left_with_margins_on(state.ids.grid, y, x - 5.0) - .w_h(10.0, 10.0) - .floating(true) - .parent(ui.window) - .set(state.ids.indicator, ui); + Image::new(if indic_ani <= 0.5 { + self.imgs.indicator_mmap + } else { + self.imgs.indicator_mmap_2 + }) + .bottom_left_with_margins_on(state.ids.grid, y, x - 5.0) + .w_h( + // Animation frames depening on timer value from 0.0 to 1.0 + 22.0 * 0.8, + if indic_ani <= 0.5 { + 18.0 * indic_scale + } else { + 23.0 * indic_scale + }, + ) + .color(Some(Color::Rgba(1.0, 1.0, 1.0, 1.0))) + .floating(true) + .parent(ui.window) + .set(state.ids.indicator, ui); } else { Image::new(self.imgs.mmap_frame_closed) .w_h(100.0 * 2.0, 11.0 * 2.0) @@ -137,7 +189,7 @@ impl<'a> Widget for MiniMap<'a> { .wh(if self.show.mini_map { [100.0 * 0.4; 2] } else { - [100.0 * 0.2; 2] + [100.0 * 0.2 * zoom; 2] }) .hover_image(if self.show.mini_map { self.imgs.mmap_open_hover diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 7da5038331..b718dc912d 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -14,7 +14,9 @@ mod social; mod spell; use crate::hud::img_ids::ImgsRot; +//use rand::Rng; pub use settings_window::ScaleChange; +use std::time::Duration; use bag::Bag; use buttons::Buttons; @@ -64,7 +66,7 @@ const TEXT_COLOR_3: Color = Color::Rgba(1.0, 1.0, 1.0, 0.1); //const BG_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 0.8); const HP_COLOR: Color = Color::Rgba(0.33, 0.63, 0.0, 1.0); const LOW_HP_COLOR: Color = Color::Rgba(0.93, 0.59, 0.03, 1.0); -const CRITICAL_HP_COLOR: Color = Color::Rgba(1.0, 0.0, 0.0, 1.0); +const CRITICAL_HP_COLOR: Color = Color::Rgba(0.79, 0.19, 0.17, 1.0); const MANA_COLOR: Color = Color::Rgba(0.47, 0.55, 1.0, 0.9); //const FOCUS_COLOR: Color = Color::Rgba(1.0, 0.56, 0.04, 1.0); //const RAGE_COLOR: Color = Color::Rgba(0.5, 0.04, 0.13, 1.0); @@ -86,8 +88,12 @@ widget_ids! { // Character Names name_tags[], + levels[], + levels_skull[], // Health Bars health_bars[], + mana_bars[], + health_bar_fronts[], health_bar_backs[], // Intro Text @@ -410,6 +416,8 @@ pub struct Hud { force_ungrab: bool, force_chat_input: Option, force_chat_cursor: Option, + pulse: f32, + zoom: f32, } impl Hud { @@ -469,6 +477,8 @@ impl Hud { force_ungrab: false, force_chat_input: None, force_chat_cursor: None, + pulse: 0.0, + zoom: 1.0, } } @@ -477,9 +487,12 @@ impl Hud { client: &Client, global_state: &GlobalState, debug_info: DebugInfo, + dt: Duration, ) -> Vec { let mut events = Vec::new(); let (ref mut ui_widgets, ref mut tooltip_manager) = self.ui.set_widgets(); + // pulse time for pulsating elements + self.pulse = self.pulse + dt.as_secs_f32(); let version = format!( "{}-{}", @@ -522,6 +535,10 @@ impl Hud { let entities = ecs.entities(); let me = client.entity(); let view_distance = client.view_distance().unwrap_or(1); + let own_level = stats + .get(client.entity()) + .map_or(0, |stats| stats.level.level()); + // Get player position. let player_pos = client .state() @@ -530,8 +547,95 @@ impl Hud { .get(client.entity()) .map_or(Vec3::zero(), |pos| pos.0); let mut name_id_walker = self.ids.name_tags.walk(); + let mut level_id_walker = self.ids.levels.walk(); + let mut level_skull_id_walker = self.ids.levels_skull.walk(); let mut health_id_walker = self.ids.health_bars.walk(); + let mut mana_id_walker = self.ids.mana_bars.walk(); let mut health_back_id_walker = self.ids.health_bar_backs.walk(); + let mut health_front_id_walker = self.ids.health_bar_fronts.walk(); + // Render Health Bars + for (_entity, pos, stats, scale) in (&entities, &pos, &stats, scales.maybe()) + .join() + .filter(|(entity, _, stats, _)| { + *entity != me && !stats.is_dead + //&& stats.health.current() != stats.health.maximum() + }) + // Don't process health bars outside the vd (visibility further limited by ui backend) + .filter(|(_, pos, _, _)| { + Vec2::from(pos.0 - player_pos) + .map2(TerrainChunk::RECT_SIZE, |d: f32, sz| { + d.abs() as f32 / sz as f32 + }) + .magnitude() + < view_distance as f32 + }) + { + let scale = scale.map(|s| s.0).unwrap_or(1.0); + + let back_id = health_back_id_walker.next( + &mut self.ids.health_bar_backs, + &mut ui_widgets.widget_id_generator(), + ); + let health_bar_id = health_id_walker.next( + &mut self.ids.health_bars, + &mut ui_widgets.widget_id_generator(), + ); + let mana_bar_id = mana_id_walker.next( + &mut self.ids.mana_bars, + &mut ui_widgets.widget_id_generator(), + ); + let front_id = health_front_id_walker.next( + &mut self.ids.health_bar_fronts, + &mut ui_widgets.widget_id_generator(), + ); + let hp_percentage = + stats.health.current() as f64 / stats.health.maximum() as f64 * 100.0; + let hp_ani = (self.pulse * 4.0/*speed factor*/).cos() * 0.5 + 1.0; //Animation timer + let crit_hp_color: Color = Color::Rgba(0.79, 0.19, 0.17, hp_ani); + + // Background + Rectangle::fill_with([82.0, 8.0], Color::Rgba(0.3, 0.3, 0.3, 0.5)) + .x_y(0.0, -25.0) + .position_ingame(pos.0 + Vec3::new(0.0, 0.0, 1.5 * scale + 1.5)) + .resolution(100.0) + .set(back_id, ui_widgets); + + // % HP Filling + Image::new(self.imgs.bar_content) + .w_h(72.9 * (hp_percentage / 100.0), 5.9) + .x_y(4.5, -24.0) + .color(Some(if hp_percentage <= 25.0 { + crit_hp_color + } else if hp_percentage <= 50.0 { + LOW_HP_COLOR + } else { + HP_COLOR + })) + .position_ingame(pos.0 + Vec3::new(0.0, 0.0, 1.5 * scale + 1.5)) + .resolution(100.0) + .set(health_bar_id, ui_widgets); + // % Mana Filling + Rectangle::fill_with( + [ + 73.0 * (stats.energy.current() as f64 / stats.energy.maximum() as f64), + 1.5, + ], + MANA_COLOR, + ) + .x_y(4.5, -28.0) + .position_ingame(pos.0 + Vec3::new(0.0, 0.0, 1.5 * scale + 1.5)) + .resolution(100.0) + .set(mana_bar_id, ui_widgets); + + // Foreground + Image::new(self.imgs.enemy_health) + .w_h(84.0, 10.0) + .x_y(0.0, -25.0) + .color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.99))) + .position_ingame(pos.0 + Vec3::new(0.0, 0.0, 1.5 * scale + 1.5)) + .resolution(100.0) + .set(front_id, ui_widgets); + } // Render Name Tags for (pos, name, level, scale) in @@ -558,69 +662,71 @@ impl Hud { (pos.0, name, stats.level, scale) }) { - let info = format!("{} Level {}", name, level.level()); + let name = format!("{}", name); let scale = scale.map(|s| s.0).unwrap_or(1.0); - - let id = name_id_walker.next( + let name_id = name_id_walker.next( &mut self.ids.name_tags, &mut ui_widgets.widget_id_generator(), ); - Text::new(&info) + let level_id = level_id_walker + .next(&mut self.ids.levels, &mut ui_widgets.widget_id_generator()); + let level_skull_id = level_skull_id_walker.next( + &mut self.ids.levels_skull, + &mut ui_widgets.widget_id_generator(), + ); + + // Name + Text::new(&name) .font_size(20) .color(Color::Rgba(0.61, 0.61, 0.89, 1.0)) .x_y(0.0, 0.0) .position_ingame(pos + Vec3::new(0.0, 0.0, 1.5 * scale + 1.5)) .resolution(100.0) - .set(id, ui_widgets); - } + .set(name_id, ui_widgets); - // Render Health Bars - for (_entity, pos, stats, scale) in (&entities, &pos, &stats, scales.maybe()) - .join() - .filter(|(entity, _, stats, _)| { - *entity != me - && !stats.is_dead - && stats.health.current() != stats.health.maximum() - }) - // Don't process health bars outside the vd (visibility further limited by ui backend) - .filter(|(_, pos, _, _)| { - Vec2::from(pos.0 - player_pos) - .map2(TerrainChunk::RECT_SIZE, |d: f32, sz| { - d.abs() as f32 / sz as f32 - }) - .magnitude() - < view_distance as f32 - }) - { - let scale = scale.map(|s| s.0).unwrap_or(1.0); - - let back_id = health_back_id_walker.next( - &mut self.ids.health_bar_backs, - &mut ui_widgets.widget_id_generator(), - ); - let bar_id = health_id_walker.next( - &mut self.ids.health_bars, - &mut ui_widgets.widget_id_generator(), - ); - // Background - Rectangle::fill_with([120.0, 8.0], Color::Rgba(0.3, 0.3, 0.3, 0.5)) - .x_y(0.0, -25.0) - .position_ingame(pos.0 + Vec3::new(0.0, 0.0, 1.5 * scale + 1.5)) + // Level + const LOW: Color = Color::Rgba(0.54, 0.81, 0.94, 0.4); + const HIGH: Color = Color::Rgba(1.0, 0.0, 0.0, 1.0); + const EQUAL: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0); + let op_level = level.level(); + let level_str = format!("{}", op_level); + // Change visuals of the level display depending on the player level/opponent level + let level_comp = op_level as i64 - own_level as i64; + // + 10 level above player -> skull + // + 5-10 levels above player -> high + // -5 - +5 levels around player level -> equal + // - 5 levels below player -> low + Text::new(if level_comp < 10 { &level_str } else { "?" }) + .font_size(if op_level > 9 && level_comp < 10 { + 7 + } else { + 8 + }) + .color(if level_comp > 4 { + HIGH + } else if level_comp < -5 { + LOW + } else { + EQUAL + }) + .x_y(-37.0, -24.0) + .position_ingame(pos + Vec3::new(0.0, 0.0, 1.5 * scale + 1.5)) .resolution(100.0) - .set(back_id, ui_widgets); - - // % HP Filling - Rectangle::fill_with( - [ - 120.0 * (stats.health.current() as f64 / stats.health.maximum() as f64), - 8.0, - ], - HP_COLOR, - ) - .x_y(0.0, -25.0) - .position_ingame(pos.0 + Vec3::new(0.0, 0.0, 1.5 * scale + 1.5)) - .resolution(100.0) - .set(bar_id, ui_widgets); + .set(level_id, ui_widgets); + if level_comp > 9 { + let skull_ani = ((self.pulse * 0.7/*speed factor*/).cos() * 0.5 + 0.5) * 10.0; //Animation timer + Image::new(if skull_ani as i32 == 1 && rand::random::() < 0.9 { + self.imgs.skull_2 + } else { + self.imgs.skull + }) + .w_h(30.0, 30.0) + .x_y(0.0, 24.0) + .color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.8))) + .position_ingame(pos + Vec3::new(0.0, 0.0, 1.5 * scale + 1.5)) + .resolution(100.0) + .set(level_skull_id, ui_widgets); + } } } // Introduction Text @@ -915,7 +1021,7 @@ impl Hud { if self.show.help && !self.show.map && !self.show.esc_menu { Image::new(self.imgs.help) .middle_of(ui_widgets.window) - .w_h(1260.0, 519.0) + .w_h(1260.0 * 1.2, 519.0 * 1.2) .set(self.ids.help, ui_widgets); // Show tips if Button::image(self.imgs.button) @@ -969,8 +1075,16 @@ impl Hud { } // MiniMap - match MiniMap::new(&self.show, client, &self.imgs, self.world_map, &self.fonts) - .set(self.ids.minimap, ui_widgets) + match MiniMap::new( + &self.show, + client, + &self.imgs, + self.world_map, + &self.fonts, + self.pulse, + self.zoom, + ) + .set(self.ids.minimap, ui_widgets) { Some(minimap::Event::Toggle) => self.show.toggle_mini_map(), None => {} @@ -1005,7 +1119,7 @@ impl Hud { .read_storage::() .get(client.entity()) { - Skillbar::new(global_state, &self.imgs, &self.fonts, stats) + Skillbar::new(global_state, &self.imgs, &self.fonts, &stats, self.pulse) .set(self.ids.skillbar, ui_widgets); } @@ -1169,8 +1283,15 @@ impl Hud { } // Map if self.show.map { - match Map::new(&self.show, client, &self.imgs, self.world_map, &self.fonts) - .set(self.ids.map, ui_widgets) + match Map::new( + &self.show, + client, + &self.imgs, + self.world_map, + &self.fonts, + self.pulse, + ) + .set(self.ids.map, ui_widgets) { Some(map::Event::Close) => { self.show.map(false); @@ -1354,11 +1475,12 @@ impl Hud { global_state: &mut GlobalState, debug_info: DebugInfo, camera: &Camera, + dt: Duration, ) -> Vec { if let Some(maybe_id) = self.to_focus.take() { self.ui.focus_widget(maybe_id); } - let events = self.update_layout(client, global_state, debug_info); + let events = self.update_layout(client, global_state, debug_info, dt); let (view_mat, _, _) = camera.compute_dependents(client); let fov = camera.get_fov(); self.ui.maintain( diff --git a/voxygen/src/hud/settings_window.rs b/voxygen/src/hud/settings_window.rs index bb7572a61e..97f635463f 100644 --- a/voxygen/src/hud/settings_window.rs +++ b/voxygen/src/hud/settings_window.rs @@ -451,7 +451,7 @@ impl<'a> Widget for SettingsWindow<'a> { if let Some(new_val) = ImageSlider::continuous( scale.log(2.0), 0.5f64.log(2.0), - 1.2f64.log(2.0), + 1.0f64.log(2.0), self.imgs.slider_indicator, self.imgs.slider, ) @@ -857,7 +857,7 @@ impl<'a> Widget for SettingsWindow<'a> { { events.push(Event::ChatTransp(new_val)); } - Rectangle::fill_with([40.0 * 4.0, 1.0 * 4.0], color::TRANSPARENT) + Rectangle::fill_with([60.0 * 4.0, 1.0 * 4.0], color::TRANSPARENT) .down_from(state.ids.chat_transp_title, 30.0) .set(state.ids.placeholder, ui); } diff --git a/voxygen/src/hud/skillbar.rs b/voxygen/src/hud/skillbar.rs index 860ef4f57b..ff536fc45e 100644 --- a/voxygen/src/hud/skillbar.rs +++ b/voxygen/src/hud/skillbar.rs @@ -92,6 +92,7 @@ pub struct Skillbar<'a> { imgs: &'a Imgs, fonts: &'a Fonts, stats: &'a Stats, + pulse: f32, #[conrod(common_builder)] common: widget::CommonBuilder, current_resource: ResourceType, @@ -103,6 +104,7 @@ impl<'a> Skillbar<'a> { imgs: &'a Imgs, fonts: &'a Fonts, stats: &'a Stats, + pulse: f32, ) -> Self { Self { imgs, @@ -111,6 +113,7 @@ impl<'a> Skillbar<'a> { global_state, current_resource: ResourceType::Mana, common: widget::CommonBuilder::default(), + pulse, } } } @@ -164,6 +167,8 @@ impl<'a> Widget for Skillbar<'a> { const BG_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 0.8); const BG_COLOR_2: Color = Color::Rgba(0.0, 0.0, 0.0, 0.99); + let hp_ani = (self.pulse * 4.0/*speed factor*/).cos() * 0.5 + 0.8; //Animation timer + let crit_hp_color: Color = Color::Rgba(0.79, 0.19, 0.17, hp_ani); // Stamina Wheel /* @@ -300,7 +305,6 @@ impl<'a> Widget for Skillbar<'a> { .top_left_with_margins_on(state.ids.xp_bar_left, 2.0 * scale, 10.0 * scale) .set(state.ids.xp_bar_filling, ui); // Level Display - if self.stats.level.level() < 10 { Text::new(&level) .bottom_left_with_margins_on( @@ -777,7 +781,7 @@ impl<'a> Widget for Skillbar<'a> { Image::new(self.imgs.bar_content) .w_h(97.0 * scale * hp_percentage / 100.0, 16.0 * scale) .color(Some(if hp_percentage <= 20.0 { - CRITICAL_HP_COLOR + crit_hp_color } else if hp_percentage <= 40.0 { LOW_HP_COLOR } else { diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 2ff3286fd0..8e7e0275c0 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -389,6 +389,7 @@ impl PlayState for SessionState { .cloned(), }, &self.scene.camera(), + clock.get_last_delta(), ); // Maintain the UI.