diff --git a/CHANGELOG.md b/CHANGELOG.md index da63bfdf8b..0ad39e4695 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added hit_timing to BasicMelee abilities - A tavern building where npcs go to relax. - Toggle for walking instead of running (Default: `I`). +- Added day duration slider configuration on map creation UI. +- Potion of Agility ### Changed @@ -73,6 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed offset of items carried on backs when wearing cloaks and backpacks - Linearize light colors on the CPU rather than in shaders on the GPU - You can no longer stack self buffs +- Renamed "Burning Potion" to "Potion of Combustion" ### Removed - Medium and large potions from all loot tables @@ -91,6 +94,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed bug where airship captains would mass generate after using /reload_chunks - Fixed french translation "Énergie Consommée" -> "Regain d'Énergie" - Fixed Perforate icon not displaying +- Make cave entrances easier to follow +- Renamed Twiggy Shoulders to match the Twig Armor set ## [0.15.0] - 2023-07-01 diff --git a/Cargo.lock b/Cargo.lock index 5861bca5eb..07cfe7aa8c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -58,14 +58,15 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if 1.0.0", "getrandom 0.2.10", "once_cell", "version_check", + "zerocopy", ] [[package]] @@ -320,7 +321,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f00425f4c1f3349b35daf0a73477249f6574fe89f4b9d76aca0b2a1356886b3b" dependencies = [ "ab_glyph", - "ahash 0.8.3", + "ahash 0.8.7", "bincode", "crossbeam-channel", "log", @@ -350,7 +351,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -655,7 +656,7 @@ checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -872,7 +873,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -1572,7 +1573,7 @@ dependencies = [ "ident_case", "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -1594,7 +1595,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -1755,7 +1756,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -1773,7 +1774,7 @@ version = "5.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd05cab02d6074145c6f92ddf1b57357e4bc1424f87c790c044de62bdc94c13a" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.7", "lazy_static", "log", "nom", @@ -1875,7 +1876,7 @@ checksum = "ccb14d927583dd5c2eac0f2cf264fc4762aefe1ae14c47a8a20fc1939d3a5fc0" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -1896,7 +1897,7 @@ dependencies = [ "darling 0.20.3", "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -2238,7 +2239,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -2703,7 +2704,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.7", "rayon", "serde", ] @@ -2714,7 +2715,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.7", "allocator-api2", ] @@ -4005,7 +4006,7 @@ checksum = "9e6a0fd4f737c707bd9086cc16c925f294943eb62eb71499e9fd4cf71f8b9f4e" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -4112,7 +4113,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -4511,7 +4512,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -4667,7 +4668,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "097bf8b99121dfb8c75eed54dfbdbdb1d53e372c53d2353e8a15aad2a479249d" dependencies = [ "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -5047,7 +5048,7 @@ dependencies = [ "quote 1.0.33", "refinery-core", "regex", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -5486,7 +5487,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.7", "cfg-if 1.0.0", "hashbrown 0.13.2", ] @@ -5633,7 +5634,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -5665,7 +5666,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -5767,10 +5768,9 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "shred" version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6b2cd1ccb08cf2b25d75c936e0cc9c8cb93c39a83814956da32653236338c0" +source = "git+https://github.com/amethyst/shred.git?rev=5d52c6fc390dd04c12158633e77591f6523d1f85#5d52c6fc390dd04c12158633e77591f6523d1f85" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.7", "arrayvec 0.7.4", "atomic_refcell", "rayon", @@ -5782,8 +5782,7 @@ dependencies = [ [[package]] name = "shred-derive" version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5404c36bd155e41a54276ab6aafedad2fb627e5e5849d36ec439c9ddc044a2f" +source = "git+https://github.com/amethyst/shred.git?rev=5d52c6fc390dd04c12158633e77591f6523d1f85#5d52c6fc390dd04c12158633e77591f6523d1f85" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", @@ -6200,9 +6199,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.29" +version = "2.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", @@ -6277,7 +6276,7 @@ checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -6456,7 +6455,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -6597,7 +6596,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -6723,7 +6722,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "rand 0.8.5", "static_assertions", ] @@ -7176,7 +7175,7 @@ version = "0.1.0" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -7596,7 +7595,7 @@ dependencies = [ "once_cell", "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", "wasm-bindgen-shared", ] @@ -7653,7 +7652,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.29", + "syn 2.0.32", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -8499,3 +8498,23 @@ checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ "time 0.3.28", ] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.32", +] diff --git a/Cargo.toml b/Cargo.toml index a43941d513..53665a2a94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -165,6 +165,7 @@ winit = { git = "https://github.com/Imberflur/winit.git", tag = "raw-window-hand wgpu = { git = "https://github.com/pythonesque/wgpu.git", rev = "179ea209374a92837cde252f1d9ee01f628cae08" } # ntapi 3.7 fails to compile under windows due to the bug https://github.com/MSxDOS/ntapi/pull/12 ntapi = { git = "https://github.com/MSxDOS/ntapi.git", rev = "9f56b149c9e25796739157c0fce3e0007a7de6eb" } +shred = { git = "https://github.com/amethyst/shred.git", rev = "5d52c6fc390dd04c12158633e77591f6523d1f85" } [patch."https://github.com/gfx-rs/gfx"] gfx-hal = { git = "https://github.com/Imberflur/gfx.git", tag = "veloren-fixes-v1" } diff --git a/assets/common/abilities/axesimple/doublestrike.ron b/assets/common/abilities/axesimple/doublestrike.ron index cdcebef941..d80d9e3a38 100644 --- a/assets/common/abilities/axesimple/doublestrike.ron +++ b/assets/common/abilities/axesimple/doublestrike.ron @@ -1,55 +1,57 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 8.0, - damage_increase: 1.0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 8.0, - range: 3.5, - angle: 50.0, - base_buildup_duration: 0.4, - base_swing_duration: 0.08, + melee_constructor: ( + kind: Slash( + damage: 8, + poise: 15, + knockback: 8, + energy_regen: 0, + ), + range: 3.5, + angle: 50.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 0.4, + swing_duration: 0.08, hit_timing: 0.5, - base_recover_duration: 0.5, - forward_movement: 2.5, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 0.5, + movement: ( + swing: Some(Forward(2.5)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 10.0, - damage_increase: 1.5, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 12.0, - range: 3.5, - angle: 30.0, - base_buildup_duration: 0.7, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Slash( + damage: 10, + poise: 20, + knockback: 12, + energy_regen: 0, + ), + range: 3.5, + angle: 30.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 0.7, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.7, - forward_movement: 2.0, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 0.7, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, -) \ No newline at end of file + energy_cost_per_strike: 0, +) diff --git a/assets/common/abilities/custom/arthropods/antlion/singlestrike.ron b/assets/common/abilities/custom/arthropods/antlion/singlestrike.ron index b8be2929c9..9a7d5d8d98 100644 --- a/assets/common/abilities/custom/arthropods/antlion/singlestrike.ron +++ b/assets/common/abilities/custom/arthropods/antlion/singlestrike.ron @@ -1,33 +1,31 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 74, - damage_increase: 0, - base_poise_damage: 27.5, - poise_damage_increase: 0, - knockback: 9.0, - range: 3.0, - angle: 60.0, - base_buildup_duration: 1.4, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 74, + poise: 27.5, + knockback: 9, + energy_regen: 0, + ), + range: 3.0, + angle: 60.0, + damage_effect: Some(Buff(( + kind: Ensnared, + dur_secs: 6.0, + strength: Value(0.5), + chance: 0.6, + ))), + ), + buildup_duration: 1.4, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 1.0, - damage_kind: Crushing, - damage_effect: Some(Buff(( - kind: Ensnared, - dur_secs: 6.0, - strength: DamageFraction(0.1), - chance: 0.6, - ))), + recover_duration: 0.8, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.8, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.8, -) \ No newline at end of file + energy_cost_per_strike: 0, +) diff --git a/assets/common/abilities/custom/arthropods/blackwidow/singlestrike.ron b/assets/common/abilities/custom/arthropods/blackwidow/singlestrike.ron index 4b996d24e8..d13f5f7b05 100644 --- a/assets/common/abilities/custom/arthropods/blackwidow/singlestrike.ron +++ b/assets/common/abilities/custom/arthropods/blackwidow/singlestrike.ron @@ -1,33 +1,31 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 50, - damage_increase: 0, - base_poise_damage: 16, - poise_damage_increase: 0, - knockback: 2.0, - range: 3.0, - angle: 60.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Stab( + damage: 50, + poise: 16, + knockback: 2, + energy_regen: 0, + ), + range: 3.0, + angle: 60.0, + damage_effect: Some(Buff(( + kind: Poisoned, + dur_secs: 7.0, + strength: DamageFraction(0.6), + chance: 0.4, + ))), + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 1.0, - damage_kind: Piercing, - damage_effect: Some(Buff(( - kind: Poisoned, - dur_secs: 7.0, - strength: DamageFraction(0.6), - chance: 0.4, - ))), + recover_duration: 0.8, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.8, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.8, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/arthropods/hornbeetle/singlestrike.ron b/assets/common/abilities/custom/arthropods/hornbeetle/singlestrike.ron index 171813d5b0..d50bdaa969 100644 --- a/assets/common/abilities/custom/arthropods/hornbeetle/singlestrike.ron +++ b/assets/common/abilities/custom/arthropods/hornbeetle/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 54, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 5.0, - range: 3.0, - angle: 60.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 54, + poise: 20, + knockback: 5, + energy_regen: 0, + ), + range: 3.0, + angle: 60.0, + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.8, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.5, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.5, -) \ No newline at end of file + energy_cost_per_strike: 0, +) diff --git a/assets/common/abilities/custom/arthropods/tarantula/singlestrike.ron b/assets/common/abilities/custom/arthropods/tarantula/singlestrike.ron index 491e047f85..9038d0709e 100644 --- a/assets/common/abilities/custom/arthropods/tarantula/singlestrike.ron +++ b/assets/common/abilities/custom/arthropods/tarantula/singlestrike.ron @@ -1,33 +1,31 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 60, - damage_increase: 0, - base_poise_damage: 21, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.0, - angle: 60.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Stab( + damage: 60, + poise: 21, + knockback: 3, + energy_regen: 0, + ), + range: 3.0, + angle: 60.0, + damage_effect: Some(Buff(( + kind: Poisoned, + dur_secs: 9.0, + strength: DamageFraction(0.7), + chance: 0.8, + ))), + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 1.0, - damage_kind: Piercing, - damage_effect: Some(Buff(( - kind: Poisoned, - dur_secs: 9.0, - strength: DamageFraction(0.7), - chance: 0.8, - ))), + recover_duration: 0.8, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.8, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.8, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/arthropods/weevil/singlestrike.ron b/assets/common/abilities/custom/arthropods/weevil/singlestrike.ron index 29692ed1b2..a53e224097 100644 --- a/assets/common/abilities/custom/arthropods/weevil/singlestrike.ron +++ b/assets/common/abilities/custom/arthropods/weevil/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 44, - damage_increase: 0, - base_poise_damage: 14, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.0, - angle: 60.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 44, + poise: 14, + knockback: 3, + energy_regen: 0, + ), + range: 3.0, + angle: 60.0, + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.8, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.6, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.6, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/asp/singlestrike.ron b/assets/common/abilities/custom/asp/singlestrike.ron index 4b20b6615d..99b8bd3a64 100644 --- a/assets/common/abilities/custom/asp/singlestrike.ron +++ b/assets/common/abilities/custom/asp/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 28.0, - damage_increase: 0, - base_poise_damage: 28, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.5, - angle: 60.0, - base_buildup_duration: 1.2, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 28, + poise: 28, + knockback: 3, + energy_regen: 0, + ), + range: 3.5, + angle: 60.0, + ), + buildup_duration: 1.2, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 2.0, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.65, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.65, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/basilisk/triplestrike.ron b/assets/common/abilities/custom/basilisk/triplestrike.ron index 0339a5a8fe..4e5e5c1d90 100644 --- a/assets/common/abilities/custom/basilisk/triplestrike.ron +++ b/assets/common/abilities/custom/basilisk/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 36.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.8, - angle: 30.0, - base_buildup_duration: 1.4, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 36, + poise: 15, + knockback: 3, + energy_regen: 0, + ), + range: 2.8, + angle: 30.0, + ), + buildup_duration: 1.4, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.3, - forward_movement: 2.0, - damage_kind: Crushing, + recover_duration: 0.3, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.65, ), ( - stage: 2, - base_damage: 36.0, - damage_increase: 0, - base_poise_damage: 18, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.8, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 36, + poise: 18, + knockback: 3, + energy_regen: 0, + ), + range: 2.8, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.3, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.3, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.65, ), ( - stage: 3, - base_damage: 36.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.8, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 36, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 2.8, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.3, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.3, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.65, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.65, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/birdmediumbasic/singlestrike.ron b/assets/common/abilities/custom/birdmediumbasic/singlestrike.ron index 774dda8307..b4ed42e026 100644 --- a/assets/common/abilities/custom/birdmediumbasic/singlestrike.ron +++ b/assets/common/abilities/custom/birdmediumbasic/singlestrike.ron @@ -1,27 +1,18 @@ -ComboMelee( - stage_data: [ - ( - stage: 1, - base_damage: 1.0, - damage_increase: 0, - base_poise_damage: 0, - poise_damage_increase: 0, - knockback: 0.0, - range: 2.5, - angle: 150.0, - base_buildup_duration: 0.1, - base_swing_duration: 0.07, - hit_timing: 0.5, - base_recover_duration: 0.2, - forward_movement: 0.0, - damage_kind: Piercing, +BasicMelee( + energy_cost: 0, + buildup_duration: 0.1, + swing_duration: 0.07, + hit_timing: 0.5, + recover_duration: 0.2, + melee_constructor: ( + kind: Stab( + damage: 1, + poise: 0, + knockback: 0, + energy_regen: 0, ), - ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, + range: 2.5, + angle: 150.0, + ), ori_modifier: 0.6, ) diff --git a/assets/common/abilities/custom/boreal_warrior/hammer/singlestrike.ron b/assets/common/abilities/custom/boreal_warrior/hammer/singlestrike.ron index cf12b4631a..6aa0832916 100644 --- a/assets/common/abilities/custom/boreal_warrior/hammer/singlestrike.ron +++ b/assets/common/abilities/custom/boreal_warrior/hammer/singlestrike.ron @@ -1,31 +1,28 @@ -ComboMelee( - stage_data: [( - stage: 1, - base_damage: 15.0, - damage_increase: 0.75, - base_poise_damage: 0, - poise_damage_increase: 0, - knockback: 3.5, - range: 4.5, - angle: 50.0, - base_buildup_duration: 0.7, - base_swing_duration: 0.1, - hit_timing: 0.5, - base_recover_duration: 0.45, - forward_movement: 0.0, - damage_kind: Crushing, - damage_effect: Some(Buff(( - kind: Frozen, - dur_secs: 2.0, - strength: Value(0.3), - chance: 0.4, - ))), - )], - initial_energy_gain: 5.0, - max_energy_gain: 12.5, - energy_increase: 2.5, - speed_increase: 0.1, - max_speed_increase: 0.4, - scales_from_combo: 2, - ori_modifier: 1.0, -) \ No newline at end of file +ComboMelee2( + strikes: [ + ( + melee_constructor: ( + kind: Bash( + damage: 15, + poise: 0, + knockback: 3.5, + energy_regen: 5, + ), + range: 4.5, + angle: 50.0, + damage_effect: Some(Buff(( + kind: Frozen, + dur_secs: 2.0, + strength: Value(0.3), + chance: 0.4, + ))), + ), + buildup_duration: 0.7, + swing_duration: 0.1, + hit_timing: 0.5, + recover_duration: 0.45, + ori_modifier: 1.0, + ), + ], + energy_cost_per_strike: 0, +) diff --git a/assets/common/abilities/custom/cyclops/doublestrike.ron b/assets/common/abilities/custom/cyclops/doublestrike.ron index 0fa7b32a60..fd1121ab4d 100644 --- a/assets/common/abilities/custom/cyclops/doublestrike.ron +++ b/assets/common/abilities/custom/cyclops/doublestrike.ron @@ -1,49 +1,51 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 32.0, - damage_increase: 0.0, - base_poise_damage: 20, - poise_damage_increase: 0.0, - knockback: 5.0, - range: 6, - angle: 90.0, - base_buildup_duration: 0.5, - base_swing_duration: 0.4, + melee_constructor: ( + kind: Bash( + damage: 32, + poise: 20, + knockback: 5, + energy_regen: 0, + ), + range: 6.0, + angle: 90.0, + ), + buildup_duration: 0.5, + swing_duration: 0.4, hit_timing: 0.4, - base_recover_duration: 0.4, - forward_movement: 0.3, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(0.3)), + ), + ori_modifier: 0.65, ), ( - stage: 2, - base_damage: 36.0, - damage_increase: 0.0, - base_poise_damage: 40.0, - poise_damage_increase: 0.0, - knockback: 10.0, - range: 8, - angle: 45.0, - base_buildup_duration: 0.6, - base_swing_duration: 0.6, + melee_constructor: ( + kind: Bash( + damage: 36, + poise: 40, + knockback: 10, + energy_regen: 0, + ), + range: 8.0, + angle: 45.0, + damage_effect: Some(Buff(( + kind: Crippled, + dur_secs: 3.0, + strength: DamageFraction(0.1), + chance: 1.0, + ))), + ), + buildup_duration: 0.6, + swing_duration: 0.6, hit_timing: 0.3, - base_recover_duration: 1.2, - forward_movement: 0.2, - damage_kind: Crushing, - damage_effect: Some(Buff(( - kind: Crippled, - dur_secs: 3.0, - strength: DamageFraction(0.1), - chance: 1.0, - ))), + recover_duration: 1.2, + movement: ( + swing: Some(Forward(0.2)), + ), + ori_modifier: 0.65, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.65, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/dullahan/melee.ron b/assets/common/abilities/custom/dullahan/melee.ron index c5e30bfc0e..3aee8dddf7 100644 --- a/assets/common/abilities/custom/dullahan/melee.ron +++ b/assets/common/abilities/custom/dullahan/melee.ron @@ -1,55 +1,57 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 35.5, - damage_increase: 0.0, - base_poise_damage: 15.0, - poise_damage_increase: 0.0, - knockback: 2.0, - range: 6.0, - angle: 60.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Slash( + damage: 35, + poise: 15, + knockback: 2, + energy_regen: 0, + ), + range: 6.0, + angle: 60.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 3.0, + strength: DamageFraction(0.05), + chance: 0.3, + ))), + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.4, - base_recover_duration: 0.3, - forward_movement: 0.8, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 3.0, - strength: DamageFraction(0.05), - chance: 0.3, - ))), + recover_duration: 0.3, + movement: ( + swing: Some(Forward(0.8)), + ), + ori_modifier: 0.6, ), ( - stage: 2, - base_damage: 38.5, - damage_increase: 0.0, - base_poise_damage: 20.0, - poise_damage_increase: 0.0, - knockback: 8.0, - range: 6.0, - angle: 60.0, - base_buildup_duration: 0.7, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Slash( + damage: 38.5, + poise: 20, + knockback: 8, + energy_regen: 0, + ), + range: 6.0, + angle: 60.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 3.0, + strength: DamageFraction(0.1), + chance: 0.15, + ))), + ), + buildup_duration: 0.7, + swing_duration: 0.1, hit_timing: 0.4, - base_recover_duration: 1.3, - forward_movement: 0.2, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 3.0, - strength: DamageFraction(0.1), - chance: 0.15, - ))), + recover_duration: 1.3, + movement: ( + swing: Some(Forward(0.2)), + ), + ori_modifier: 0.6, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.6, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/husk_brute/singlestrike.ron b/assets/common/abilities/custom/husk_brute/singlestrike.ron index d0f6834487..0f1ada65f6 100644 --- a/assets/common/abilities/custom/husk_brute/singlestrike.ron +++ b/assets/common/abilities/custom/husk_brute/singlestrike.ron @@ -1,27 +1,18 @@ -ComboMelee( - stage_data: [ - ( - stage: 1, - base_damage: 40.0, - damage_increase: 0, - base_poise_damage: 12, - poise_damage_increase: 0, - knockback: 5.0, - range: 3.5, - angle: 60.0, - base_buildup_duration: 1.0, - base_swing_duration: 0.2, - hit_timing: 0.5, - base_recover_duration: 1.0, - forward_movement: 0.5, - damage_kind: Crushing, +BasicMelee( + energy_cost: 0, + buildup_duration: 1.0, + swing_duration: 0.2, + hit_timing: 0.5, + recover_duration: 1.0, + melee_constructor: ( + kind: Bash( + damage: 40, + poise: 12, + knockback: 5, + energy_regen: 0, ), - ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, + range: 3.5, + angle: 60.0, + ), ori_modifier: 0.6, ) diff --git a/assets/common/abilities/custom/maneater/singlestrike.ron b/assets/common/abilities/custom/maneater/singlestrike.ron index 47624c8d27..756337b4a2 100644 --- a/assets/common/abilities/custom/maneater/singlestrike.ron +++ b/assets/common/abilities/custom/maneater/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 40.0, - damage_increase: 0, - base_poise_damage: 28, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.5, - angle: 60.0, - base_buildup_duration: 1.0, - base_swing_duration: 0.075, + melee_constructor: ( + kind: Bash( + damage: 40, + poise: 28, + knockback: 3, + energy_regen: 0, + ), + range: 3.5, + angle: 60.0, + ), + buildup_duration: 1.0, + swing_duration: 0.075, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 2.0, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.65, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.65, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/oni/doublestrike.ron b/assets/common/abilities/custom/oni/doublestrike.ron index 91ad4917b5..f347805769 100644 --- a/assets/common/abilities/custom/oni/doublestrike.ron +++ b/assets/common/abilities/custom/oni/doublestrike.ron @@ -1,55 +1,57 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 18.0, - damage_increase: 1.0, - base_poise_damage: 0, - poise_damage_increase: 0, - knockback: 4.0, - range: 3.5, - angle: 50.0, - base_buildup_duration: 1.2, - base_swing_duration: 0.12, + melee_constructor: ( + kind: Slash( + damage: 18, + poise: 0, + knockback: 4, + energy_regen: 0, + ), + range: 3.5, + angle: 50.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 1.2, + swing_duration: 0.12, hit_timing: 0.5, - base_recover_duration: 1.2, - forward_movement: 3.5, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 1.2, + movement: ( + swing: Some(Forward(3.5)), + ), + ori_modifier: 0.6, ), ( - stage: 2, - base_damage: 26.0, - damage_increase: 1.5, - base_poise_damage: 0, - poise_damage_increase: 0, - knockback: 16.0, - range: 5.5, - angle: 15.0, - base_buildup_duration: 1.0, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Slash( + damage: 26, + poise: 0, + knockback: 16, + energy_regen: 0, + ), + range: 5.5, + angle: 15.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 1.0, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 2.4, - forward_movement: 4.5, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 2.4, + movement: ( + swing: Some(Forward(4.5)), + ), + ori_modifier: 0.6, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.6, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadlowbasic/singlestrike.ron b/assets/common/abilities/custom/quadlowbasic/singlestrike.ron index 3938023f8a..a929d60112 100644 --- a/assets/common/abilities/custom/quadlowbasic/singlestrike.ron +++ b/assets/common/abilities/custom/quadlowbasic/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 40.0, - damage_increase: 0, - base_poise_damage: 28, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.0, - angle: 60.0, - base_buildup_duration: 1.2, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 40, + poise: 28, + knockback: 3, + energy_regen: 0, + ), + range: 2.0, + angle: 60.0, + ), + buildup_duration: 1.2, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 3.0, - damage_kind: Crushing, + recover_duration: 0.8, + movement: ( + swing: Some(Forward(3.0)), + ), + ori_modifier: 0.6, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.6, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadlowbasic/triplestrike.ron b/assets/common/abilities/custom/quadlowbasic/triplestrike.ron index b90c3aca84..33276cdc93 100644 --- a/assets/common/abilities/custom/quadlowbasic/triplestrike.ron +++ b/assets/common/abilities/custom/quadlowbasic/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 28.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 1.3, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 28, + poise: 15, + knockback: 3, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 1.3, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 2.0, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.65, ), ( - stage: 2, - base_damage: 28.0, - damage_increase: 0, - base_poise_damage: 18, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 28, + poise: 18, + knockback: 3, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.65, ), ( - stage: 3, - base_damage: 28.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 28, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.65, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.65, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadlowbreathe/triplestrike.ron b/assets/common/abilities/custom/quadlowbreathe/triplestrike.ron index 6884a54b17..aa109a29d0 100644 --- a/assets/common/abilities/custom/quadlowbreathe/triplestrike.ron +++ b/assets/common/abilities/custom/quadlowbreathe/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 44.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 1.3, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 44, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 1.3, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 2.0, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 44.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 44, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.7, ), ( - stage: 3, - base_damage: 44.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 44, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadlowquick/quadstrike.ron b/assets/common/abilities/custom/quadlowquick/quadstrike.ron index fe86f0e1fb..a0ec0c8b8a 100644 --- a/assets/common/abilities/custom/quadlowquick/quadstrike.ron +++ b/assets/common/abilities/custom/quadlowquick/quadstrike.ron @@ -1,75 +1,85 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 12.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 1.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 1.2, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 12, + poise: 15, + knockback: 1, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 1.2, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.2, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.2, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.8, ), ( - stage: 2, - base_damage: 12.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 1.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.3, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 12, + poise: 15, + knockback: 1, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.3, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.2, - forward_movement: 0.8, - damage_kind: Crushing, + recover_duration: 0.2, + movement: ( + swing: Some(Forward(0.8)), + ), + ori_modifier: 0.8, ), ( - stage: 3, - base_damage: 12.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 1.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.4, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 12, + poise: 15, + knockback: 1, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.4, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.2, - forward_movement: 0.8, - damage_kind: Crushing, + recover_duration: 0.2, + movement: ( + swing: Some(Forward(0.8)), + ), + ori_modifier: 0.8, ), ( - stage: 4, - base_damage: 12.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 8.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.4, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 12, + poise: 15, + knockback: 8, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.4, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.2, - forward_movement: 0.8, - damage_kind: Crushing, + recover_duration: 0.2, + movement: ( + swing: Some(Forward(0.8)), + ), + ori_modifier: 0.8, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.8, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadlowtail/triplestrike.ron b/assets/common/abilities/custom/quadlowtail/triplestrike.ron index 2c532bd30a..2b2e056d84 100644 --- a/assets/common/abilities/custom/quadlowtail/triplestrike.ron +++ b/assets/common/abilities/custom/quadlowtail/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 16.0, - damage_increase: 0, - base_poise_damage: 0, - poise_damage_increase: 22, - knockback: 10.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 1.3, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 16, + poise: 22, + knockback: 10, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 1.3, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 2.0, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 16.0, - damage_increase: 0, - base_poise_damage: 22, - poise_damage_increase: 0, - knockback: 10.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 0.4, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 16, + poise: 22, + knockback: 10, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 0.4, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ( - stage: 3, - base_damage: 16.0, - damage_increase: 0, - base_poise_damage: 22, - poise_damage_increase: 0, - knockback: 10.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 0.2, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 16, + poise: 22, + knockback: 10, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 0.2, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadmedbasic/singlestrike.ron b/assets/common/abilities/custom/quadmedbasic/singlestrike.ron index 312c4dd9ad..fc8b819beb 100644 --- a/assets/common/abilities/custom/quadmedbasic/singlestrike.ron +++ b/assets/common/abilities/custom/quadmedbasic/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 20.0, - damage_increase: 0, - base_poise_damage: 28, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.7, - angle: 60.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 20, + poise: 28, + knockback: 3, + energy_regen: 0, + ), + range: 2.7, + angle: 60.0, + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.8, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadmedbasic/triplestrike.ron b/assets/common/abilities/custom/quadmedbasic/triplestrike.ron index 62e3b574ce..757a3d9a8a 100644 --- a/assets/common/abilities/custom/quadmedbasic/triplestrike.ron +++ b/assets/common/abilities/custom/quadmedbasic/triplestrike.ron @@ -1,59 +1,62 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 10.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 5.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.9, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 10, + poise: 15, + knockback: 5, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.9, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 10.0, - damage_increase: 0, - base_poise_damage: 18, - poise_damage_increase: 0, - knockback: 5.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 10, + poise: 18, + knockback: 5, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 0.0, - damage_kind: Crushing, + recover_duration: 0.4, + ori_modifier: 0.7, ), ( - stage: 3, - base_damage: 10.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 5.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 10, + poise: 20, + knockback: 5, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadmedcharge/doublestrike.ron b/assets/common/abilities/custom/quadmedcharge/doublestrike.ron index 59eeddd680..076cc6c178 100644 --- a/assets/common/abilities/custom/quadmedcharge/doublestrike.ron +++ b/assets/common/abilities/custom/quadmedcharge/doublestrike.ron @@ -1,43 +1,45 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 50.0, - damage_increase: 0, - base_poise_damage: 22, - poise_damage_increase: 0, - knockback: 4.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 1.3, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 50, + poise: 22, + knockback: 4, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 1.3, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 74.0, - damage_increase: 0, - base_poise_damage: 0, - poise_damage_increase: 22, - knockback: 4.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 74, + poise: 22, + knockback: 4, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 0.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(0.5)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadmedjump/doublestrike.ron b/assets/common/abilities/custom/quadmedjump/doublestrike.ron index ca4fa9c29f..07d0b4d635 100644 --- a/assets/common/abilities/custom/quadmedjump/doublestrike.ron +++ b/assets/common/abilities/custom/quadmedjump/doublestrike.ron @@ -1,43 +1,45 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 16.0, - damage_increase: 0, - base_poise_damage: 30, - poise_damage_increase: 0, - knockback: 4.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 1.3, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 16, + poise: 30, + knockback: 4, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 1.3, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.8, ), ( - stage: 2, - base_damage: 16.0, - damage_increase: 0, - base_poise_damage: 30, - poise_damage_increase: 0, - knockback: 4.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 16, + poise: 30, + knockback: 4, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.8, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.8, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadmedquick/triplestrike.ron b/assets/common/abilities/custom/quadmedquick/triplestrike.ron index 015e7dbc2b..2b0ee263c9 100644 --- a/assets/common/abilities/custom/quadmedquick/triplestrike.ron +++ b/assets/common/abilities/custom/quadmedquick/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 20.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 5.0, - range: 2.2, - angle: 40.0, - base_buildup_duration: 1.2, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 20, + poise: 15, + knockback: 5, + energy_regen: 0, + ), + range: 2.2, + angle: 40.0, + ), + buildup_duration: 1.2, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 0.3, - damage_kind: Crushing, + recover_duration: 0.8, + movement: ( + swing: Some(Forward(0.3)), + ), + ori_modifier: 0.8, ), ( - stage: 2, - base_damage: 20.0, - damage_increase: 0, - base_poise_damage: 17, - poise_damage_increase: 0, - knockback: 5.0, - range: 2.2, - angle: 40.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 20, + poise: 17, + knockback: 5, + energy_regen: 0, + ), + range: 2.2, + angle: 40.0, + ), + buildup_duration: 0.8, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 0.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(0.5)), + ), + ori_modifier: 0.8, ), ( - stage: 3, - base_damage: 20.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 5.0, - range: 2.2, - angle: 40.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 20, + poise: 20, + knockback: 5, + energy_regen: 0, + ), + range: 2.2, + angle: 40.0, + ), + buildup_duration: 0.8, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 0.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(0.5)), + ), + ori_modifier: 0.8, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.8, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadsmallbasic/singlestrike.ron b/assets/common/abilities/custom/quadsmallbasic/singlestrike.ron index 8b10305b23..a83773e74b 100644 --- a/assets/common/abilities/custom/quadsmallbasic/singlestrike.ron +++ b/assets/common/abilities/custom/quadsmallbasic/singlestrike.ron @@ -1,27 +1,18 @@ -ComboMelee( - stage_data: [ - ( - stage: 1, - base_damage: 6.0, - damage_increase: 0, - base_poise_damage: 10, - poise_damage_increase: 0, - knockback: 1.0, - range: 1.5, - angle: 50.0, - base_buildup_duration: 0.6, - base_swing_duration: 0.15, - hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.0, - damage_kind: Crushing, +BasicMelee( + energy_cost: 0, + buildup_duration: 0.6, + swing_duration: 0.15, + hit_timing: 0.5, + recover_duration: 0.6, + melee_constructor: ( + kind: Bash( + damage: 6, + poise: 10, + knockback: 1, + energy_regen: 0, ), - ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, + range: 1.5, + angle: 50.0, + ), ori_modifier: 0.7, ) diff --git a/assets/common/abilities/custom/roshwalr/doublehusk.ron b/assets/common/abilities/custom/roshwalr/doublehusk.ron index 95b11639ad..002139e71c 100644 --- a/assets/common/abilities/custom/roshwalr/doublehusk.ron +++ b/assets/common/abilities/custom/roshwalr/doublehusk.ron @@ -1,43 +1,45 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 28.0, - damage_increase: 0, - base_poise_damage: 7.5, - poise_damage_increase: 0, - knockback: 3.0, - range: 3, - angle: 75.0, - base_buildup_duration: 1.2, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Stab( + damage: 28, + poise: 7.5, + knockback: 3, + energy_regen: 5, + ), + range: 3.0, + angle: 75.0, + ), + buildup_duration: 1.2, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.3, - forward_movement: 0.25, - damage_kind: Piercing, + recover_duration: 0.3, + movement: ( + swing: Some(Forward(0.25)), + ), + ori_modifier: 0.5, ), ( - stage: 2, - base_damage: 28.0, - damage_increase: 0, - base_poise_damage: 7.5, - poise_damage_increase: 0, - knockback: 3.0, - range: 3, - angle: 75.0, - base_buildup_duration: 0.2, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Stab( + damage: 28, + poise: 7.5, + knockback: 3, + energy_regen: 5, + ), + range: 3.0, + angle: 75.0, + ), + buildup_duration: 0.2, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 0.25, - damage_kind: Piercing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(0.25)), + ), + ori_modifier: 0.5, ), ], - initial_energy_gain: 5, - max_energy_gain: 5, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.65, -) \ No newline at end of file + energy_cost_per_strike: 0, +) diff --git a/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron b/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron index 774dda8307..b4ed42e026 100644 --- a/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron +++ b/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron @@ -1,27 +1,18 @@ -ComboMelee( - stage_data: [ - ( - stage: 1, - base_damage: 1.0, - damage_increase: 0, - base_poise_damage: 0, - poise_damage_increase: 0, - knockback: 0.0, - range: 2.5, - angle: 150.0, - base_buildup_duration: 0.1, - base_swing_duration: 0.07, - hit_timing: 0.5, - base_recover_duration: 0.2, - forward_movement: 0.0, - damage_kind: Piercing, +BasicMelee( + energy_cost: 0, + buildup_duration: 0.1, + swing_duration: 0.07, + hit_timing: 0.5, + recover_duration: 0.2, + melee_constructor: ( + kind: Stab( + damage: 1, + poise: 0, + knockback: 0, + energy_regen: 0, ), - ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, + range: 2.5, + angle: 150.0, + ), ori_modifier: 0.6, ) diff --git a/assets/common/abilities/custom/stonegolemfist/singlestrike.ron b/assets/common/abilities/custom/stonegolemfist/singlestrike.ron index 1ecf3c0de5..239124743b 100644 --- a/assets/common/abilities/custom/stonegolemfist/singlestrike.ron +++ b/assets/common/abilities/custom/stonegolemfist/singlestrike.ron @@ -1,27 +1,18 @@ -ComboMelee( - stage_data: [ - ( - stage: 1, - base_damage: 60.0, - damage_increase: 0, - base_poise_damage: 40, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.5, - angle: 60.0, - base_buildup_duration: 1.8, - base_swing_duration: 0.1, - hit_timing: 0.5, - base_recover_duration: 1.8, - forward_movement: 3.0, - damage_kind: Crushing, +BasicMelee( + energy_cost: 0, + buildup_duration: 1.8, + swing_duration: 0.1, + hit_timing: 0.5, + recover_duration: 1.8, + melee_constructor: ( + kind: Bash( + damage: 60, + poise: 40, + knockback: 3, + energy_regen: 0, ), - ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, + range: 3.5, + angle: 60.0, + ), ori_modifier: 0.7, ) diff --git a/assets/common/abilities/custom/theropodbasic/singlestrike.ron b/assets/common/abilities/custom/theropodbasic/singlestrike.ron index dc8fc4fb43..f73beb51c1 100644 --- a/assets/common/abilities/custom/theropodbasic/singlestrike.ron +++ b/assets/common/abilities/custom/theropodbasic/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 54.0, - damage_increase: 0, - base_poise_damage: 40, - poise_damage_increase: 0, - knockback: 4.0, - range: 7.5, - angle: 60.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 54, + poise: 40, + knockback: 4, + energy_regen: 0, + ), + range: 7.5, + angle: 60.0, + ), + buildup_duration: 0.8, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 3.0, - damage_kind: Crushing, + recover_duration: 0.8, + movement: ( + swing: Some(Forward(3.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/theropodbasic/triplestrike.ron b/assets/common/abilities/custom/theropodbasic/triplestrike.ron index c989cdef26..0d7f779ffb 100644 --- a/assets/common/abilities/custom/theropodbasic/triplestrike.ron +++ b/assets/common/abilities/custom/theropodbasic/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 40.0, - damage_increase: 0, - base_poise_damage: 32.5, - poise_damage_increase: 0, - knockback: 3.0, - range: 7.5, - angle: 30.0, - base_buildup_duration: 1.3, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 40, + poise: 32.5, + knockback: 3, + energy_regen: 0, + ), + range: 7.5, + angle: 30.0, + ), + buildup_duration: 1.3, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.5, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.5, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 50.0, - damage_increase: 0, - base_poise_damage: 32.5, - poise_damage_increase: 0, - knockback: 3.0, - range: 5.5, - angle: 30.0, - base_buildup_duration: 0.2, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 50, + poise: 32.5, + knockback: 3, + energy_regen: 0, + ), + range: 5.5, + angle: 30.0, + ), + buildup_duration: 0.2, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.3, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.3, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ( - stage: 3, - base_damage: 60.0, - damage_increase: 0, - base_poise_damage: 32.5, - poise_damage_increase: 0, - knockback: 25.0, - range: 5.5, - angle: 30.0, - base_buildup_duration: 0.4, - base_swing_duration: 0.125, + melee_constructor: ( + kind: Bash( + damage: 60, + poise: 32.5, + knockback: 25, + energy_regen: 0, + ), + range: 5.5, + angle: 30.0, + ), + buildup_duration: 0.4, + swing_duration: 0.125, hit_timing: 0.5, - base_recover_duration: 1.6, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 1.6, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/theropodbird/singlestrike.ron b/assets/common/abilities/custom/theropodbird/singlestrike.ron index 217070715f..61c04e29ce 100644 --- a/assets/common/abilities/custom/theropodbird/singlestrike.ron +++ b/assets/common/abilities/custom/theropodbird/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 22.0, - damage_increase: 0, - base_poise_damage: 28, - poise_damage_increase: 0, - knockback: 2.0, - range: 3.0, - angle: 15.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 22, + poise: 28, + knockback: 2, + energy_regen: 0, + ), + range: 3.0, + angle: 15.0, + ), + buildup_duration: 0.8, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 3.0, - damage_kind: Crushing, + recover_duration: 0.8, + movement: ( + swing: Some(Forward(3.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/theropodbird/triplestrike.ron b/assets/common/abilities/custom/theropodbird/triplestrike.ron index 6124283d1b..d4d1965298 100644 --- a/assets/common/abilities/custom/theropodbird/triplestrike.ron +++ b/assets/common/abilities/custom/theropodbird/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 16.5, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.0, - angle: 15.0, - base_buildup_duration: 0.95, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 16.5, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 3.0, + angle: 15.0, + ), + buildup_duration: 0.95, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.50, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.5, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.6, ), ( - stage: 2, - base_damage: 30.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.0, - angle: 15.0, - base_buildup_duration: 0.65, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 30, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 3.0, + angle: 15.0, + ), + buildup_duration: 0.65, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.50, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.5, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.6, ), ( - stage: 3, - base_damage: 36.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.0, - angle: 15.0, - base_buildup_duration: 0.525, - base_swing_duration: 0.125, + melee_constructor: ( + kind: Bash( + damage: 36, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 3.0, + angle: 15.0, + ), + buildup_duration: 0.525, + swing_duration: 0.125, hit_timing: 0.5, - base_recover_duration: 1.25, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 1.25, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.6, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.6, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/theropodsmall/triplestrike.ron b/assets/common/abilities/custom/theropodsmall/triplestrike.ron index 95b93b7584..33cf6f3ca7 100644 --- a/assets/common/abilities/custom/theropodsmall/triplestrike.ron +++ b/assets/common/abilities/custom/theropodsmall/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 30.0, - damage_increase: 0, - base_poise_damage: 17.5, - poise_damage_increase: 0, - knockback: 3.0, - range: 4.5, - angle: 30.0, - base_buildup_duration: 1.3, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 30, + poise: 17.5, + knockback: 3, + energy_regen: 0, + ), + range: 4.5, + angle: 30.0, + ), + buildup_duration: 1.3, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.5, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.5, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 30.0, - damage_increase: 0, - base_poise_damage: 20.5, - poise_damage_increase: 0, - knockback: 3.0, - range: 4.5, - angle: 30.0, - base_buildup_duration: 0.2, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 30, + poise: 20.5, + knockback: 3, + energy_regen: 0, + ), + range: 4.5, + angle: 30.0, + ), + buildup_duration: 0.2, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.3, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.3, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ( - stage: 3, - base_damage: 30.0, - damage_increase: 0, - base_poise_damage: 22.5, - poise_damage_increase: 0, - knockback: 25.0, - range: 5.5, - angle: 30.0, - base_buildup_duration: 0.4, - base_swing_duration: 0.125, + melee_constructor: ( + kind: Bash( + damage: 30, + poise: 22.5, + knockback: 25, + energy_regen: 0, + ), + range: 5.5, + angle: 30.0, + ), + buildup_duration: 0.4, + swing_duration: 0.125, hit_timing: 0.5, - base_recover_duration: 1.6, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 1.6, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, -) \ No newline at end of file + energy_cost_per_strike: 0, +) diff --git a/assets/common/abilities/custom/wendigomagic/singlestrike.ron b/assets/common/abilities/custom/wendigomagic/singlestrike.ron index 6e4cd6edcf..3990f13158 100644 --- a/assets/common/abilities/custom/wendigomagic/singlestrike.ron +++ b/assets/common/abilities/custom/wendigomagic/singlestrike.ron @@ -1,27 +1,18 @@ -ComboMelee( - stage_data: [ - ( - stage: 1, - base_damage: 36.0, - damage_increase: 0, - base_poise_damage: 40, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 1.2, - base_swing_duration: 0.4, - hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 5.0, - damage_kind: Crushing, +BasicMelee( + energy_cost: 0, + buildup_duration: 1.2, + swing_duration: 0.4, + hit_timing: 0.5, + recover_duration: 0.8, + melee_constructor: ( + kind: Bash( + damage: 36, + poise: 40, + knockback: 3, + energy_regen: 0, ), - ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, + range: 2.5, + angle: 30.0, + ), ori_modifier: 0.7, ) diff --git a/assets/common/abilities/daggersimple/singlestrike.ron b/assets/common/abilities/daggersimple/singlestrike.ron index 4cf543c1b7..428a8bd297 100644 --- a/assets/common/abilities/daggersimple/singlestrike.ron +++ b/assets/common/abilities/daggersimple/singlestrike.ron @@ -1,33 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 2.0, - damage_increase: 1.0, - base_poise_damage: 8, - poise_damage_increase: 0, - knockback: 8.0, - range: 3.5, - angle: 50.0, - base_buildup_duration: 0.1, - base_swing_duration: 0.05, + melee_constructor: ( + kind: Slash( + damage: 2, + poise: 8, + knockback: 8, + energy_regen: 0, + ), + range: 3.5, + angle: 50.0, + ), + buildup_duration: 0.1, + swing_duration: 0.05, hit_timing: 0.5, - base_recover_duration: 0.05, - forward_movement: 1.0, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 0.05, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, -) \ No newline at end of file + energy_cost_per_strike: 0, +) diff --git a/assets/common/abilities/hammer/singlestrike.ron b/assets/common/abilities/hammer/singlestrike.ron index 40e8f9ae57..3f93b52230 100644 --- a/assets/common/abilities/hammer/singlestrike.ron +++ b/assets/common/abilities/hammer/singlestrike.ron @@ -1,4 +1,4 @@ -ComboMelee( +ComboMeleeDeprecated( stage_data: [( stage: 1, base_damage: 15.0, diff --git a/assets/common/abilities/hammersimple/doublestrike.ron b/assets/common/abilities/hammersimple/doublestrike.ron index bd98b61286..cfde38dd41 100644 --- a/assets/common/abilities/hammersimple/doublestrike.ron +++ b/assets/common/abilities/hammersimple/doublestrike.ron @@ -1,43 +1,45 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 24.0, - damage_increase: 1.0, - base_poise_damage: 40, - poise_damage_increase: 0, - knockback: 4.0, - range: 4.5, - angle: 50.0, - base_buildup_duration: 0.6, - base_swing_duration: 0.08, + melee_constructor: ( + kind: Bash( + damage: 24, + poise: 40, + knockback: 4, + energy_regen: 0, + ), + range: 4.5, + angle: 50.0, + ), + buildup_duration: 0.6, + swing_duration: 0.08, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 3.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(3.5)), + ), + ori_modifier: 0.65, ), ( - stage: 2, - base_damage: 32.0, - damage_increase: 1.5, - base_poise_damage: 40, - poise_damage_increase: 0, - knockback: 16.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.6, - base_swing_duration: 0.25, + melee_constructor: ( + kind: Bash( + damage: 32, + poise: 40, + knockback: 16, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.6, + swing_duration: 0.25, hit_timing: 0.5, - base_recover_duration: 1.2, - forward_movement: 2.0, - damage_kind: Crushing, + recover_duration: 1.2, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.65, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.65, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/spear/doublestrike.ron b/assets/common/abilities/spear/doublestrike.ron index 3c7f904ae2..76e629d136 100644 --- a/assets/common/abilities/spear/doublestrike.ron +++ b/assets/common/abilities/spear/doublestrike.ron @@ -1,55 +1,57 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 6.5, - damage_increase: 0, - base_poise_damage: 18, - poise_damage_increase: 0, - knockback: 4.0, - range: 2.5, - angle: 15.0, - base_buildup_duration: 0.35, - base_swing_duration: 0.075, + melee_constructor: ( + kind: Stab( + damage: 6.5, + poise: 18, + knockback: 4, + energy_regen: 0, + ), + range: 2.5, + angle: 15.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 0.35, + swing_duration: 0.075, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 0.7, - damage_kind: Piercing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 0.4, + movement: ( + swing: Some(Forward(0.7)), + ), + ori_modifier: 0.75, ), ( - stage: 2, - base_damage: 8.0, - damage_increase: 0, - base_poise_damage: 18, - poise_damage_increase: 0, - knockback: 7.0, - range: 2.5, - angle: 15.0, - base_buildup_duration: 0.5, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Stab( + damage: 8, + poise: 18, + knockback: 7, + energy_regen: 0, + ), + range: 2.5, + angle: 15.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 0.5, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.5, - forward_movement: 0.7, - damage_kind: Piercing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 0.5, + movement: ( + swing: Some(Forward(0.7)), + ), + ori_modifier: 0.75, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 3.0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 2, - ori_modifier: 0.75, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/swordsimple/doublestrike.ron b/assets/common/abilities/swordsimple/doublestrike.ron index 34ca8c1f76..d80d9e3a38 100644 --- a/assets/common/abilities/swordsimple/doublestrike.ron +++ b/assets/common/abilities/swordsimple/doublestrike.ron @@ -1,55 +1,57 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 8.0, - damage_increase: 1.0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 8.0, - range: 3.5, - angle: 50.0, - base_buildup_duration: 0.4, - base_swing_duration: 0.08, + melee_constructor: ( + kind: Slash( + damage: 8, + poise: 15, + knockback: 8, + energy_regen: 0, + ), + range: 3.5, + angle: 50.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 0.4, + swing_duration: 0.08, hit_timing: 0.5, - base_recover_duration: 0.5, - forward_movement: 2.5, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 0.5, + movement: ( + swing: Some(Forward(2.5)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 10.0, - damage_increase: 1.5, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 12.0, - range: 3.5, - angle: 30.0, - base_buildup_duration: 0.7, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Slash( + damage: 10, + poise: 20, + knockback: 12, + energy_regen: 0, + ), + range: 3.5, + angle: 30.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 0.7, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.7, - forward_movement: 2.0, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 0.7, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/items/armor/twigs/shoulder.ron b/assets/common/items/armor/twigs/shoulder.ron index 282e943691..3d937d1429 100644 --- a/assets/common/items/armor/twigs/shoulder.ron +++ b/assets/common/items/armor/twigs/shoulder.ron @@ -1,11 +1,11 @@ ItemDef( - name: "Twiggy Shoulders", + name: "Twig Shoulders", description: "Spaulders made from tightly tied twigs.", kind: Armor(( kind: Shoulder, stats: FromSet("Twigs"), )), - quality: Common, + quality: Moderate, tags: [ SalvageInto(Twig, 1), ], diff --git a/assets/common/items/consumable/potion_agility.ron b/assets/common/items/consumable/potion_agility.ron new file mode 100644 index 0000000000..e7ebefd0e8 --- /dev/null +++ b/assets/common/items/consumable/potion_agility.ron @@ -0,0 +1,27 @@ +ItemDef( + name: "Potion of Agility", + description: "Fly, you fools!", + kind: Consumable( + kind: Drink, + effects: All([ + Buff(( + kind: Agility, + data: ( + strength: 0.55, + duration: Some(25), + ), + cat_ids: [Natural], + )), + Buff(( + kind: PotionSickness, + data: ( + strength: 0.5, + duration: Some(60), + ), + cat_ids: [Natural], + )), + ]) + ), + quality: Moderate, + tags: [Potion], +) diff --git a/assets/common/items/consumable/potion_burning.ron b/assets/common/items/consumable/potion_combustion.ron similarity index 92% rename from assets/common/items/consumable/potion_burning.ron rename to assets/common/items/consumable/potion_combustion.ron index 2efca88089..6bf6f6736d 100644 --- a/assets/common/items/consumable/potion_burning.ron +++ b/assets/common/items/consumable/potion_combustion.ron @@ -1,5 +1,5 @@ ItemDef( - name: "Burning Potion", + name: "Potion of Combustion", description: "Sets the user ablaze", kind: Consumable( kind: Drink, diff --git a/assets/common/recipe_book.ron b/assets/common/recipe_book.ron index 701913e9aa..b5c7cf78d4 100644 --- a/assets/common/recipe_book.ron +++ b/assets/common/recipe_book.ron @@ -31,8 +31,8 @@ ], craft_sprite: Some(Anvil), ), - "potion_burning": ( - output: ("common.items.consumable.potion_burning", 1), + "potion_combustion": ( + output: ("common.items.consumable.potion_combustion", 1), inputs: [ (Item("common.items.crafting_ing.empty_vial"), 1, false), (Item("common.items.crafting_ing.living_embers"), 3, false), @@ -40,6 +40,16 @@ ], craft_sprite: Some(Cauldron), ), + "potion_agility": ( + output: ("common.items.consumable.potion_agility", 1), + inputs: [ + (Item("common.items.crafting_ing.empty_vial"), 1, false), + (Item("common.items.mineral.ore.veloritefrag"), 2, false), + (Item("common.items.crafting_ing.animal_misc.raptor_feather"), 2, false), + (Item("common.items.crafting_ing.animal_misc.viscous_ooze"), 3, false), + ], + craft_sprite: Some(Cauldron), + ), "potion_s": ( output: ("common.items.consumable.potion_minor", 1), inputs: [ diff --git a/assets/voxygen/audio/calendar/christmas/soundtrack.ron b/assets/voxygen/audio/calendar/christmas/soundtrack.ron index ead126e9a8..88aef1d681 100644 --- a/assets/voxygen/audio/calendar/christmas/soundtrack.ron +++ b/assets/voxygen/audio/calendar/christmas/soundtrack.ron @@ -307,6 +307,19 @@ // Dungeon music + Individual(( + title: "A Heart's Ice-Cold Protection", + path: "voxygen.audio.soundtrack.dungeon.a_hearts_ice-cold_protection", + length: 205.0, + timing: None, + weather: None, + biomes:[], + sites: [ + Dungeon(Adlet), + ], + music_state: Activity(Explore), + artist: ("GeekyGami", "https://geekygami.newgrounds.com/audio/"), + )), Individual(( title: "Mysty Temple", path: "voxygen.audio.soundtrack.dungeon.mysty_temple", @@ -316,6 +329,7 @@ biomes:[], sites: [ Dungeon(Old), + Dungeon(Adlet), ], music_state: Activity(Explore), artist: ("Tiny", None), @@ -342,6 +356,7 @@ biomes: [], sites: [ Dungeon(Old), + Dungeon(Adlet), ], music_state: Activity(Explore), artist: ("Aeronic", "https://soundcloud.com/aeronic"), @@ -355,6 +370,7 @@ biomes: [], sites: [ Dungeon(Old), + Dungeon(Adlet), ], music_state: Activity(Explore), artist: ("Aeronic", "https://soundcloud.com/aeronic"), @@ -436,8 +452,8 @@ Dungeon(Old), ], segments: [ - ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-start", 56.0, Transition(Explore, Combat(High)), Some(Combat(High))), - ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-loop", 54.0, Activity(Combat(High)), None), + ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-start", 61.818, Transition(Explore, Combat(High)), Some(Combat(High))), + ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-loop", 54.545, Activity(Combat(High)), None), ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-end", 6.0, Transition(Combat(High), Explore), None), ], artist: ("DaforLynx", "https://daforlynx.neocities.org/"), @@ -451,14 +467,14 @@ Dungeon(Old), ], segments: [ - ("voxygen.audio.soundtrack.combat.reversal.reversal-start", 60.0, Transition(Explore, Combat(High)), Some(Combat(High))), + ("voxygen.audio.soundtrack.combat.reversal.reversal-start", 61.666, Transition(Explore, Combat(High)), Some(Combat(High))), ("voxygen.audio.soundtrack.combat.reversal.reversal-loop", 60.0, Activity(Combat(High)), None), - ("voxygen.audio.soundtrack.combat.reversal.reversal-end", 4.0, Transition(Combat(High), Explore), None), + ("voxygen.audio.soundtrack.combat.reversal.reversal-end", 3.666, Transition(Combat(High), Explore), None), ], artist: ("DaforLynx", "https://daforlynx.neocities.org/"), ), Segmented( - title: "Valiant Voxels", + title: "Clash", timing: None, weather: None, biomes: [], @@ -466,11 +482,11 @@ Dungeon(Old), ], segments: [ - ("voxygen.audio.soundtrack.combat.valiant_voxels.valiant_voxels-start", 7.846, Transition(Explore, Combat(High)), Some(Combat(High))), - ("voxygen.audio.soundtrack.combat.valiant_voxels.valiant_voxels-loop", 59.126, Activity(Combat(High)), None), - ("voxygen.audio.soundtrack.combat.valiant_voxels.valiant_voxels-end", 5.49, Transition(Combat(High), Explore), None), + ("voxygen.audio.soundtrack.combat.clash.clash-start", 121.5, Transition(Explore, Combat(High)), Some(Combat(High))), + ("voxygen.audio.soundtrack.combat.clash.clash-loop", 81.0, Activity(Combat(High)), None), + ("voxygen.audio.soundtrack.combat.clash.clash-end", 1.5, Transition(Combat(High), Explore), None), ], - artist: ("Seventh Sam", "https://seventhsam.com/"), + artist: ("Alfredo Pompa D & Rodriogo Plata", None), ), ] ) \ No newline at end of file diff --git a/assets/voxygen/audio/calendar/halloween/soundtrack.ron b/assets/voxygen/audio/calendar/halloween/soundtrack.ron index 5b33dcfec8..526b83e19b 100644 --- a/assets/voxygen/audio/calendar/halloween/soundtrack.ron +++ b/assets/voxygen/audio/calendar/halloween/soundtrack.ron @@ -165,6 +165,19 @@ // Dungeon music + Individual(( + title: "A Heart's Ice-Cold Protection", + path: "voxygen.audio.soundtrack.dungeon.a_hearts_ice-cold_protection", + length: 205.0, + timing: None, + weather: None, + biomes:[], + sites: [ + Dungeon(Adlet), + ], + music_state: Activity(Explore), + artist: ("GeekyGami", "https://geekygami.newgrounds.com/audio/"), + )), Individual(( title: "Mysty Temple", path: "voxygen.audio.soundtrack.dungeon.mysty_temple", @@ -174,6 +187,7 @@ biomes:[], sites: [ Dungeon(Old), + Dungeon(Adlet), ], music_state: Activity(Explore), artist: ("Tiny", None), @@ -200,6 +214,7 @@ biomes: [], sites: [ Dungeon(Old), + Dungeon(Adlet), ], music_state: Activity(Explore), artist: ("Aeronic", "https://soundcloud.com/aeronic"), @@ -213,6 +228,7 @@ biomes: [], sites: [ Dungeon(Old), + Dungeon(Adlet), ], music_state: Activity(Explore), artist: ("Aeronic", "https://soundcloud.com/aeronic"), @@ -294,8 +310,8 @@ Dungeon(Old), ], segments: [ - ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-start", 56.0, Transition(Explore, Combat(High)), Some(Combat(High))), - ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-loop", 54.0, Activity(Combat(High)), None), + ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-start", 61.818, Transition(Explore, Combat(High)), Some(Combat(High))), + ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-loop", 54.545, Activity(Combat(High)), None), ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-end", 6.0, Transition(Combat(High), Explore), None), ], artist: ("DaforLynx", "https://daforlynx.neocities.org/"), @@ -309,11 +325,26 @@ Dungeon(Old), ], segments: [ - ("voxygen.audio.soundtrack.combat.reversal.reversal-start", 60.0, Transition(Explore, Combat(High)), Some(Combat(High))), + ("voxygen.audio.soundtrack.combat.reversal.reversal-start", 61.666, Transition(Explore, Combat(High)), Some(Combat(High))), ("voxygen.audio.soundtrack.combat.reversal.reversal-loop", 60.0, Activity(Combat(High)), None), - ("voxygen.audio.soundtrack.combat.reversal.reversal-end", 4.0, Transition(Combat(High), Explore), None), + ("voxygen.audio.soundtrack.combat.reversal.reversal-end", 3.666, Transition(Combat(High), Explore), None), ], artist: ("DaforLynx", "https://daforlynx.neocities.org/"), ), + Segmented( + title: "Clash", + timing: None, + weather: None, + biomes: [], + sites: [ + Dungeon(Old), + ], + segments: [ + ("voxygen.audio.soundtrack.combat.clash.clash-start", 121.5, Transition(Explore, Combat(High)), Some(Combat(High))), + ("voxygen.audio.soundtrack.combat.clash.clash-loop", 81.0, Activity(Combat(High)), None), + ("voxygen.audio.soundtrack.combat.clash.clash-end", 1.5, Transition(Combat(High), Explore), None), + ], + artist: ("Alfredo Pompa D & Rodriogo Plata", None), + ), ] ) \ No newline at end of file diff --git a/assets/voxygen/audio/sfx.ron b/assets/voxygen/audio/sfx.ron index 86289a130b..893fee2c16 100644 --- a/assets/voxygen/audio/sfx.ron +++ b/assets/voxygen/audio/sfx.ron @@ -397,27 +397,6 @@ threshold: 0.7, subtitle: "subtitle-hammer-attack", ), - Attack(ComboMelee(Action, 1), Sword): ( - files: [ - "voxygen.audio.sfx.abilities.swing_sword", - ], - threshold: 0.7, - subtitle: "subtitle-sword_attack", - ), - Attack(ComboMelee(Action, 2), Sword): ( - files: [ - "voxygen.audio.sfx.abilities.separated_second_swing", - ], - threshold: 0.7, - subtitle: "subtitle-sword_attack", - ), - Attack(ComboMelee(Action, 3), Sword): ( - files: [ - "voxygen.audio.sfx.abilities.separated_third_swing", - ], - threshold: 0.7, - subtitle: "subtitle-sword_attack", - ), Inventory(CollectedTool(Sword)): ( files: [ "voxygen.audio.sfx.inventory.pickup_sword", @@ -443,7 +422,7 @@ threshold: 0.5, subtitle: "subtitle-unwield_hammer", ), - Attack(ComboMelee(Action, 1), Hammer): ( + Attack(ComboMeleeDeprecated(Action, 1), Hammer): ( files: [ "voxygen.audio.sfx.abilities.swing", ], @@ -489,20 +468,6 @@ threshold: 0.5, subtitle: "subtitle-unwield_axe", ), - Attack(ComboMelee(Action, 1), Axe): ( - files: [ - "voxygen.audio.sfx.abilities.swing", - ], - threshold: 0.7, - subtitle: "subtitle-axe_attack", - ), - Attack(ComboMelee(Action, 2), Axe): ( - files: [ - "voxygen.audio.sfx.abilities.swing", - ], - threshold: 0.7, - subtitle: "subtitle-axe_attack", - ), Attack(RapidMelee(Action), Axe): ( files: [ "voxygen.audio.sfx.abilities.swing", @@ -549,13 +514,6 @@ threshold: 0.5, subtitle: "subtitle-unwield_staff", ), - Attack(BasicBeam, Staff): ( - files: [ - "voxygen.audio.sfx.abilities.flame_thrower", - ], - threshold: 0.2, - subtitle: "subtitle-staff_attack", - ), //Attack(BasicRanged, Staff): ( // files: [ // "voxygen.audio.sfx.abilities.staff_channeling", diff --git a/assets/voxygen/audio/soundtrack.ron b/assets/voxygen/audio/soundtrack.ron index 023f2eab02..8ebbca0ce1 100644 --- a/assets/voxygen/audio/soundtrack.ron +++ b/assets/voxygen/audio/soundtrack.ron @@ -16,6 +16,20 @@ // Overworld exploration tracks + Individual(( + title: "Graceful Journey", + path: "voxygen.audio.soundtrack.overworld.graceful_journey", + length: 240.0, + timing: Day, + weather: None, + biomes: [ + (Lake, 1), + (Grassland, 1), + ], + sites: [Void], + music_state: Activity(Explore), + artist: ("Tobias Thy - (Thy SFX)", "https://soundcloud.com/thyofficial"), + )), Individual(( title: "A Cold Breeze Blows", path: "voxygen.audio.soundtrack.overworld.a_cold_breeze_blows", @@ -744,6 +758,19 @@ // Dungeon music + Individual(( + title: "A Heart's Ice-Cold Protection", + path: "voxygen.audio.soundtrack.dungeon.a_hearts_ice-cold_protection", + length: 205.0, + timing: None, + weather: None, + biomes:[], + sites: [ + Dungeon(Adlet), + ], + music_state: Activity(Explore), + artist: ("GeekyGami", "https://geekygami.newgrounds.com/audio/"), + )), Individual(( title: "Mysty Temple", path: "voxygen.audio.soundtrack.dungeon.mysty_temple", @@ -753,6 +780,7 @@ biomes:[], sites: [ Dungeon(Old), + Dungeon(Adlet), ], music_state: Activity(Explore), artist: ("Tiny", None), @@ -779,6 +807,7 @@ biomes: [], sites: [ Dungeon(Old), + Dungeon(Adlet), ], music_state: Activity(Explore), artist: ("Aeronic", "https://soundcloud.com/aeronic"), @@ -792,6 +821,7 @@ biomes: [], sites: [ Dungeon(Old), + Dungeon(Adlet), ], music_state: Activity(Explore), artist: ("Aeronic", "https://soundcloud.com/aeronic"), @@ -873,8 +903,8 @@ Dungeon(Old), ], segments: [ - ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-start", 56.0, Transition(Explore, Combat(High)), Some(Combat(High))), - ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-loop", 54.0, Activity(Combat(High)), None), + ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-start", 61.818, Transition(Explore, Combat(High)), Some(Combat(High))), + ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-loop", 54.545, Activity(Combat(High)), None), ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-end", 6.0, Transition(Combat(High), Explore), None), ], artist: ("DaforLynx", "https://daforlynx.neocities.org/"), @@ -888,11 +918,26 @@ Dungeon(Old), ], segments: [ - ("voxygen.audio.soundtrack.combat.reversal.reversal-start", 60.0, Transition(Explore, Combat(High)), Some(Combat(High))), + ("voxygen.audio.soundtrack.combat.reversal.reversal-start", 61.666, Transition(Explore, Combat(High)), Some(Combat(High))), ("voxygen.audio.soundtrack.combat.reversal.reversal-loop", 60.0, Activity(Combat(High)), None), - ("voxygen.audio.soundtrack.combat.reversal.reversal-end", 4.0, Transition(Combat(High), Explore), None), + ("voxygen.audio.soundtrack.combat.reversal.reversal-end", 3.666, Transition(Combat(High), Explore), None), ], artist: ("DaforLynx", "https://daforlynx.neocities.org/"), ), + Segmented( + title: "Clash", + timing: None, + weather: None, + biomes: [], + sites: [ + Dungeon(Old), + ], + segments: [ + ("voxygen.audio.soundtrack.combat.clash.clash-start", 121.5, Transition(Explore, Combat(High)), Some(Combat(High))), + ("voxygen.audio.soundtrack.combat.clash.clash-loop", 81.0, Activity(Combat(High)), None), + ("voxygen.audio.soundtrack.combat.clash.clash-end", 1.5, Transition(Combat(High), Explore), None), + ], + artist: ("Alfredo Pompa D & Rodriogo Plata", None), + ), ] ) diff --git a/assets/voxygen/audio/soundtrack/combat/barred_paths/barred_paths-end.ogg b/assets/voxygen/audio/soundtrack/combat/barred_paths/barred_paths-end.ogg index e37ec3d725..c56b2b3388 100644 --- a/assets/voxygen/audio/soundtrack/combat/barred_paths/barred_paths-end.ogg +++ b/assets/voxygen/audio/soundtrack/combat/barred_paths/barred_paths-end.ogg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f5c8599fc233c297c38007171b7dd6f69aca672fa35e4b19b5302321f2322589 -size 120714 +oid sha256:06cc579f22b2a4c936d6c1f18568baa38be7c4bbef2dba68198ec369bb5236e3 +size 108695 diff --git a/assets/voxygen/audio/soundtrack/combat/barred_paths/barred_paths-loop.ogg b/assets/voxygen/audio/soundtrack/combat/barred_paths/barred_paths-loop.ogg index 9633b51d0d..b1b069676f 100644 --- a/assets/voxygen/audio/soundtrack/combat/barred_paths/barred_paths-loop.ogg +++ b/assets/voxygen/audio/soundtrack/combat/barred_paths/barred_paths-loop.ogg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1cce1fa94fa5c0ccb00e5395ece57efd4a790e5ae9fe62e5bbfca83ab50a19bf -size 943627 +oid sha256:0e2e93bb20dc3e8385ff28e9f52d2b846716ed696bf96ff4a582932bb7281432 +size 1135031 diff --git a/assets/voxygen/audio/soundtrack/combat/barred_paths/barred_paths-start.ogg b/assets/voxygen/audio/soundtrack/combat/barred_paths/barred_paths-start.ogg index 0660e81960..0892ea73a0 100644 --- a/assets/voxygen/audio/soundtrack/combat/barred_paths/barred_paths-start.ogg +++ b/assets/voxygen/audio/soundtrack/combat/barred_paths/barred_paths-start.ogg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fbc1d7abca1f39d8bdf5357c3b200ab690707dab922ee1cfd664e516ba26a420 -size 964398 +oid sha256:1cb04992aba1daf08d06737fcaee628dff8c933b0371dac85161fedfae8e625a +size 1269890 diff --git a/assets/voxygen/audio/soundtrack/combat/clash/clash-end.ogg b/assets/voxygen/audio/soundtrack/combat/clash/clash-end.ogg new file mode 100644 index 0000000000..49b8e51068 --- /dev/null +++ b/assets/voxygen/audio/soundtrack/combat/clash/clash-end.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c81b21c7fb02f0abbf59a1ec726518b8fe71fa7a5e17041e07486ae2f7e36717 +size 84147 diff --git a/assets/voxygen/audio/soundtrack/combat/clash/clash-loop.ogg b/assets/voxygen/audio/soundtrack/combat/clash/clash-loop.ogg new file mode 100644 index 0000000000..ff6ed2ad4e --- /dev/null +++ b/assets/voxygen/audio/soundtrack/combat/clash/clash-loop.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c15dfa6c62d15306d5c7d8b579099676d9f6f0d577bdbbd8e67b71805f034c2 +size 4625703 diff --git a/assets/voxygen/audio/soundtrack/combat/clash/clash-start.ogg b/assets/voxygen/audio/soundtrack/combat/clash/clash-start.ogg new file mode 100644 index 0000000000..3a1526e9cb --- /dev/null +++ b/assets/voxygen/audio/soundtrack/combat/clash/clash-start.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b563dec0b4ab2ffd0b19d638e07270c9a3841db72f90ebccf17fc6a853fa924 +size 6881122 diff --git a/assets/voxygen/audio/soundtrack/combat/reversal/reversal-end.ogg b/assets/voxygen/audio/soundtrack/combat/reversal/reversal-end.ogg index 24d16db2da..e667c9db8e 100644 --- a/assets/voxygen/audio/soundtrack/combat/reversal/reversal-end.ogg +++ b/assets/voxygen/audio/soundtrack/combat/reversal/reversal-end.ogg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:87e520774165f100cdb518d02d30813d32cb0972ffdc64721864527dfbf8cf8f -size 74003 +oid sha256:65320e821bf0885073fa6d85de32e75f0cc3959cf01f92b31183061dc807c464 +size 76296 diff --git a/assets/voxygen/audio/soundtrack/combat/reversal/reversal-loop.ogg b/assets/voxygen/audio/soundtrack/combat/reversal/reversal-loop.ogg index cc21c059bc..01802a29f0 100644 --- a/assets/voxygen/audio/soundtrack/combat/reversal/reversal-loop.ogg +++ b/assets/voxygen/audio/soundtrack/combat/reversal/reversal-loop.ogg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7c3d57aef0e7d2d3d09cad432d2842a31b50ebe4c66a6bc00cb851463f240029 -size 1207268 +oid sha256:a9288aeb3c2e22f949654e76df2d8b8199cb1a6065e290095b0c5c8ed6d4ef9e +size 1237788 diff --git a/assets/voxygen/audio/soundtrack/combat/reversal/reversal-start.ogg b/assets/voxygen/audio/soundtrack/combat/reversal/reversal-start.ogg index c29dcb2a01..016522f90c 100644 --- a/assets/voxygen/audio/soundtrack/combat/reversal/reversal-start.ogg +++ b/assets/voxygen/audio/soundtrack/combat/reversal/reversal-start.ogg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8895e472f2d1f6379afef7e2a220278b31c06beacdcd3d8c7bba588c4b6a6ff6 -size 1196913 +oid sha256:0092e0a19117895ff1b2f89901349890f46d035c98d2bb70e10fe90a25b369d0 +size 1274056 diff --git a/assets/voxygen/audio/soundtrack/dungeon/a_hearts_ice-cold_protection.ogg b/assets/voxygen/audio/soundtrack/dungeon/a_hearts_ice-cold_protection.ogg new file mode 100644 index 0000000000..e7d9512630 --- /dev/null +++ b/assets/voxygen/audio/soundtrack/dungeon/a_hearts_ice-cold_protection.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28543be4d93d52510911e69dc00b66496bb6e136c1abce34f918ab47dfb33bb8 +size 4163325 diff --git a/assets/voxygen/audio/soundtrack/overworld/graceful_journey.ogg b/assets/voxygen/audio/soundtrack/overworld/graceful_journey.ogg new file mode 100644 index 0000000000..f76d865b77 --- /dev/null +++ b/assets/voxygen/audio/soundtrack/overworld/graceful_journey.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68eb2b8efacb2f7413d7ee23f57c37940eec52290da5885a4b34d5daca8757c2 +size 3798458 diff --git a/assets/voxygen/i18n/en/buff.ftl b/assets/voxygen/i18n/en/buff.ftl index 6c05bafc53..3ba397931d 100644 --- a/assets/voxygen/i18n/en/buff.ftl +++ b/assets/voxygen/i18n/en/buff.ftl @@ -5,6 +5,14 @@ buff-stat-health = Restores { $str_total } Health ## Potion buff-title-potion = Potion buff-desc-potion = Drinking... +## Agility +buff-title-agility = Agility +buff-desc-agility = Your movement is faster, but you deal less damage, and take more damage. +buff-stat-agility = + Increases movement speed by { $strength }%. + but decreases your damage by 100%, + and increases your damage vulnerability + by 100%. ## Saturation buff-title-saturation = Saturation buff-desc-saturation = Gain health over time from consumables. @@ -69,9 +77,9 @@ buff-title-parried = Parried buff-desc-parried = You were parried and now are slow to recover. ## Potion sickness buff-title-potionsickness = Potion sickness -buff-desc-potionsickness = Potions heal you less after recently consuming a potion. +buff-desc-potionsickness = Potions have less positive effect on you after recently consuming a potion. buff-stat-potionsickness = - Decreases the amount you heal from + Decreases the positive effects of subsequent potions by { $strength }%. ## Reckless buff-title-reckless = Reckless diff --git a/assets/voxygen/i18n/en/main.ftl b/assets/voxygen/i18n/en/main.ftl index 7c7ef8a1c8..bb137293ff 100644 --- a/assets/voxygen/i18n/en/main.ftl +++ b/assets/voxygen/i18n/en/main.ftl @@ -7,30 +7,30 @@ main-tip = Tip: main-unbound_key_tip = unbound main-notice = Welcome to the alpha version of Veloren! - + Before you dive into the fun, please keep a few things in mind: - + - This is a very early alpha. Expect bugs, extremely unfinished gameplay, unpolished mechanics, and missing features. - + - If you have constructive feedback or bug reports, you can contact us via Reddit, GitLab, or our community Discord server. - + - Veloren is licensed under the GPL 3 open-source licence. That means you're free to play, modify, and redistribute the game however you wish (provided derived work is also under GPL 3). - + - Veloren is a non-profit community project, and everybody working on it is a volunteer. If you like what you see, you're welcome to join the development or art teams! - + Thanks for taking the time to read this notice, we hope you enjoy the game! - + ~ The Veloren Devs main-login_process = Information on the Login Process: - + Please note that you need an account to play on auth-enabled servers. - + You can create an account over at - + https://veloren.net/account/. main-singleplayer-new = New main-singleplayer-delete = Delete @@ -38,6 +38,7 @@ main-singleplayer-regenerate = Regenerate main-singleplayer-create_custom = Create Custom main-singleplayer-invalid_name = Error: Invalid name main-singleplayer-seed = Seed +main-singleplayer-day_length = Day duration main-singleplayer-random_seed = Random main-singleplayer-size_lg = Logarithmic size main-singleplayer-map_large_warning = Warning: Large worlds will take a long time to start for the first time diff --git a/assets/voxygen/i18n/uk/buff.ftl b/assets/voxygen/i18n/uk/buff.ftl index 4af482d22f..13ef379db6 100644 --- a/assets/voxygen/i18n/uk/buff.ftl +++ b/assets/voxygen/i18n/uk/buff.ftl @@ -94,6 +94,10 @@ buff-desc-wet = Земля плутає ваші ноги ускладнючи buff-title-ensnared = Пастка buff-desc-ensnared = Ліани опутують ваші ноги, перешкоджаючи ходьбі. +## Fortitude +buff-title-fortitude = Стійкість +buff-desc-fortitude = Ви протистоїте дезорієнтації. Коли отримуєте ушкодження вам легше дезорієнтувати інших. + ## Util buff-text-for_seconds = протягом { $dur_secs } сек. @@ -143,6 +147,9 @@ buff-desc-bloodfeast = Атаки по ворогам, які кровоточа ## Berserk buff-title-berserk = Берсерк buff-desc-berserk = Ви перебуваєте в шаленій люті, через що ваші атаки стають сильнішими та стрімкішими, а ваша швидкість збільшується. Однак у результаті ваші захисні можливості зменшуються +## Heatstroke +buff-title-heatstroke = Тепловий Удар +buff-desc-heatstroke = Вам було спекотно і тепер ви страждаєте від теплового удару. Ваші енергетичні винагороди і швидкість руху зменшені. Охолоньте. ## Util buff-mysterious = Таємничий ефект buff-remove = Натисніть, щоб видалити diff --git a/assets/voxygen/i18n/uk/command.ftl b/assets/voxygen/i18n/uk/command.ftl new file mode 100644 index 0000000000..810f997ded --- /dev/null +++ b/assets/voxygen/i18n/uk/command.ftl @@ -0,0 +1,96 @@ +command-no-permission = Ви не маєте прав використовувати '/{ $command_name }' +command-position-unavailable = Неможливо отримати позицію для { $target } +command-player-role-unavailable = Неможливо отримати ролі адміністратора для { $target } +command-uid-unavailable = Неможливо отримати uid для { $target } +command-area-not-found = Неможливо знайти область '{ $area }' +command-player-not-found = Гравець '{ $player }' не знайдений! +command-player-uuid-not-found = Гравець з UUID '{ $uuid }' не знайдений! +command-username-uuid-unavailable = Неможливо визначити UUID для логіну { $username } +command-uuid-username-unavailable = Неможливо визначити логін для UUID { $uuid } +command-no-sudo = Вдавати інших гравців неввічливо +command-entity-dead = Сутність '{ $entity }' мертва! +command-error-while-evaluating-request = При валідації запиту сталася помилка: { $error } +command-give-inventory-full = Інвентар гравця повний. Видано { $given -> + [1] лише один + *[other] { $given } +} з { $total } предметів. +command-invalid-item = Неправильний предмет: { $item } +command-invalid-block-kind = Неправильний тип блока: { $kind } +command-nof-entities-at-least = Сутностей має бути щонайменше 1 +command-nof-entities-less-than = Сутностей має бути менше 50 +command-entity-load-failed = Не вдалося завантажити конфігурацію сутності: { $config } +command-spawned-entities-config = Створено { $n } сутностей з конфігурації: { $config } +command-invalid-sprite = Неправильний тип спрайта: { $kind } +command-time-parse-too-large = { $n } невалідний, не може мати більше 16 цифр. +command-time-parse-negative = { $n } невалідний, не може бути від'ємний. +command-time-backwards = { $t } в минулому, час не може йти навпаки. +command-time-invalid = { $t } невалідний час. +command-rtsim-purge-perms = Ви маєте бути адміністратором (не тимчасовим) щоб видаляти дані rtsim. +command-chunk-not-loaded = Чанк { $x }, { $y } не завантажений +command-chunk-out-of-bounds = Чанк { $x }, { $y } за межами карти +command-spawned-entity = Створено сутність з ID: { $id } +command-spawned-dummy = Створено тренувальний манекен +command-spawned-airship = Створено повітряний корабель +command-spawned-campfire = Створено багаття +command-spawned-safezone = Створено безпечну зону +command-volume-size-incorrect = Розмір повинен бути від 1 до 127. +command-volume-created = Створено об'єм +command-permit-build-given = Ви не можете будувати в '{ $area }' +command-permit-build-granted = Надано дозвіл на будування в '{ $area }' +command-revoke-build-recv = Дозвіл на будування в '{ $area }' відкликано +command-revoke-build = Дозвіл будувати в '{ $area }' відкликано +command-revoke-build-all = Ваші дозволи на будування відкликано +command-revoked-all-build = Всі дозволи на будування відкликано +command-no-buid-perms = Ви не маєте дозволу будувати. +command-set-build-mode-off = Режим будівництва вимкнено. +command-set-build-mode-on-persistent = Режим будівництва увімкнуто. Ввімкнено експериментальне збереження змін ландшафту. Сервер намагатиметься зберегти зміни, але збереження не гарантується. +command-set-build-mode-on-unpersistent = Режим будівництва увімкнуто. Зміни пропадуть після перезавантаження чанка. +command-invalid-alignment = Неправильне вирівнювання: { $alignment } +command-kit-not-enough-slots = Недостатньо слотів в інвентарі +command-lantern-unequiped = Будь ласка, спочатку візьміть ліхтар +command-lantern-adjusted-strength = Ви змінили силу полум'я. +command-lantern-adjusted-strength-color = Ви змінили силу та колір полум'я.. +command-explosion-power-too-high = Сила вибуху не може перевищувати { $power } +command-explosion-power-too-low = Сила вибуху повинна бути більше за { $power } +# Note: Do not translate "confirm" here +command-disconnectall-confirm = Виконайте, будь ласка, команду ще раз вказавши "confirm" як другий аргумент, щоб відключити всіх гравців. +command-invalid-skill-group = { $group } не група вмінь! +command-unknown = Невідома команда +command-disabled-by-settings = Команда вимкнена в налаштуваннях +command-battlemode-intown = Ви повинні бути в місті, щоб змінити бойовий режим! +command-battlemode-cooldown = Період очікування активний. Спробуйте ще раз через { $cooldown } секунд. +command-battlemode-available-modes = Доступні режими: pvp, pve +command-battlemode-same = Спроба встановити той самий бойовий режим. +command-battlemode-updated = Новий бойовий режим: { $battlemode } +command-buff-unknown = Невідомий баф: { $buff } +command-skillpreset-load-error = Помилка при завантаженні пресетів +command-skillpreset-broken = Пресет вмінь пошкоджений +command-skillpreset-missing = Пресет не існує: { $preset } +command-location-invalid = Назва локації '{ $location }' невалідна. Назви можуть містити тільки малі літери ASCII та підкреслення. +command-location-duplicate = Локація '{ $location }' вже існує. +command-location-not-found = Локація '{ $location }' не існує +command-location-created = Свторено локацію '{ $location }' +command-location-deleted = Видалено локацію '{ $location }' +command-locations-empty = Зараз не має локацій +command-locations-list = Доступні локації: { $locations } +# Note: Do not translate these weather names +command-weather-valid-values = Допустимі значення: 'clear', 'rain', 'wind', 'storm' +command-scale-set = Встановити масштаб в { $scale } +command-repaired-items = Всі одягнути речі відремонтовано +command-message-group-missing = Ви використовуєте чат групи, до якої не належите. Використовуйте /world чи + /region щоб змінити чат. +command-tell-request = { $sender } хоче говорити з вами. + +# Unreachable/untestable but added for consistency + +command-player-info-unavailable = Неможливо отримати інформацію про гравця для { $target } +command-unimplemented-waypoint-spawn = Створення точки шляху не реалізовано +command-unimplemented-teleporter-spawn = Створення телепорта не реалізовано +command-kit-inventory-unavailable = Неможливо отримати інвентар +command-inventory-cant-fit-item = Предмет не вміщується в інвентар +# Emitted by /disconnect_all when you dont exist (?) +command-you-dont-exist = Ви не існуєте, отже не можете використовувати цю команду +command-destroyed-tethers = Всі пута знищено! Тепер ви вільні +command-destroyed-no-tethers = Ви не підключені до пут +command-dismounted = Ви спішилися +command-no-dismount = Ви не їдете верхи і ніхто не їде верхи на вас \ No newline at end of file diff --git a/assets/voxygen/i18n/uk/common.ftl b/assets/voxygen/i18n/uk/common.ftl index 619eeb99bb..76e07dcd6a 100644 --- a/assets/voxygen/i18n/uk/common.ftl +++ b/assets/voxygen/i18n/uk/common.ftl @@ -115,3 +115,4 @@ common-sprite-chest = Скриня common-sprite-chair = Стілець common-sprite-mud = Грязь common-sprite-grave = Могила +common-sprite-crate = Ящик diff --git a/assets/voxygen/i18n/uk/gameinput.ftl b/assets/voxygen/i18n/uk/gameinput.ftl index eaa30a1bac..479a4944e7 100644 --- a/assets/voxygen/i18n/uk/gameinput.ftl +++ b/assets/voxygen/i18n/uk/gameinput.ftl @@ -74,4 +74,5 @@ gameinput-mutemaster = Вимкнути всі звуки gameinput-muteinactivemaster = Вимкнути всі звуки (В неактивному вікні) gameinput-mutemusic = Вимкнути музику gameinput-mutesfx = Вимкнути звуки спец. ефектів -gameinput-muteambience = Вимкнути довколишню музику \ No newline at end of file +gameinput-muteambience = Вимкнути довколишню музику +gameinput-togglewalk = Перемкнути режим ходьби \ No newline at end of file diff --git a/assets/voxygen/i18n/uk/hud/bag.ftl b/assets/voxygen/i18n/uk/hud/bag.ftl index 35d05a6329..6bc0e93ae6 100644 --- a/assets/voxygen/i18n/uk/hud/bag.ftl +++ b/assets/voxygen/i18n/uk/hud/bag.ftl @@ -14,6 +14,7 @@ hud-bag-glider = Дельтаплан hud-bag-belt = Пояс hud-bag-ring = Кільце hud-bag-back = Спина +hud-bag-backpack = Наплічник hud-bag-legs = Ноги hud-bag-feet = Ступні hud-bag-mainhand = Основна рука diff --git a/assets/voxygen/i18n/uk/hud/misc.ftl b/assets/voxygen/i18n/uk/hud/misc.ftl index f3594b0556..c0f09423da 100644 --- a/assets/voxygen/i18n/uk/hud/misc.ftl +++ b/assets/voxygen/i18n/uk/hud/misc.ftl @@ -38,6 +38,7 @@ hud-auto_walk_indicator = Авто Рух hud-zoom_lock_indicator-remind = Зум зафіксовано hud-zoom_lock_indicator-enable = Зум камери зафіксовано hud-zoom_lock_indicator-disable = Фіксацію зума скасовано +hud-activate = Активувати hud-collect = Зібрати hud-pick_up = Підібрати hud-open = Відкрити @@ -56,4 +57,25 @@ hud-mount = Осідлати hud-follow = Слідувати hud-stay = Чекати hud-sit = Сидіти -hud-steer = Керувати \ No newline at end of file +hud-steer = Керувати +hud-lay = Лежати +hud-portal = Портал + +-server = Server +-client = Client +hud-init-stage-singleplayer = Старт сервера одиночної гри... +hud-init-stage-server-db-migrations = [{ -server }]: Міграція бази даних... +hud-init-stage-server-db-vacuum = [{ -server }]: Очистка бази даних... +hud-init-stage-server-worldsim-erosion = [{ -server }]: Ерозія { $percentage }% +hud-init-stage-server-worldciv-civcreate = [{ -server }]: Згенеровано { $generated } з { $total } цивілізацій +hud-init-stage-server-worldciv-site = [{ -server }]: Генерую місця... +hud-init-stage-server-economysim = [{ -server }]: Симулюю економіку... +hud-init-stage-server-spotgen = [{ -server }]: Генерація точок... +hud-init-stage-server-starting = [{ -server }]: Запуск сервера... +hud-init-stage-multiplayer = Запуск мультиплеєра +hud-init-stage-client-connection-establish = [{ -client }]: Підключення до сервера... +hud-init-stage-client-request-server-version = [{ -client }]: Очікування версії сервера... +hud-init-stage-client-authentication = [{ -client }]: Автентифікація... +hud-init-stage-client-load-init-data = [{ -client }]: Завантаження ініціалізаційних даних... +hud-init-stage-client-starting-client = [{ -client }]: Підготовка клієнта... +hud-init-stage-render-pipeline = Створення render pipeline ({ $done }/{ $total }) diff --git a/assets/voxygen/i18n/uk/hud/settings.ftl b/assets/voxygen/i18n/uk/hud/settings.ftl index 9013f5cb70..42c3afd975 100644 --- a/assets/voxygen/i18n/uk/hud/settings.ftl +++ b/assets/voxygen/i18n/uk/hud/settings.ftl @@ -16,9 +16,12 @@ hud-settings-custom_scaling = Ручне hud-settings-crosshair = Приціл hud-settings-opacity = Прозорість hud-settings-hotbar = Панель швидкого доступу +hud-settings-slots = Слоти hud-settings-toggle_shortcuts = Гарячі клавіші hud-settings-buffs_skillbar = Бафи біля Панелі Швидкого Доступу hud-settings-buffs_mmap = Бафи біля Мінімапи +hud-settings-use_prefixes = Показувати позначки SI для кількостей +hud-settings-prefix_switch_point = Максимальна кількість цифр для переключення позначок SI hud-settings-toggle_bar_experience = Панель досвіду hud-settings-scrolling_combat_text = Відображення Пошкоджень/Зцілень hud-settings-damage_accumulation_duration = Тривалість Аккумулювання Шкоди @@ -54,6 +57,8 @@ hud-settings-enable_mouse_smoothing = камери hud-settings-free_look_behavior = Вмикання вільного перегляду hud-settings-auto_walk_behavior = Вмикання авто-ходи +hud-settings-walking_speed_behavior = Налаштування швидкості ходи +hud-settings-walking_speed = Швидкість ходи hud-settings-camera_clamp_behavior = Поведінка закріпленої камери hud-settings-zoom_lock_behavior = Функція фіксації віддаленості камери hud-settings-player_physics_behavior = Фізика гравця (експериментальнe) diff --git a/assets/voxygen/i18n/uk/hud/subtitles.ftl b/assets/voxygen/i18n/uk/hud/subtitles.ftl index 46b39a6fbc..5ab669d798 100644 --- a/assets/voxygen/i18n/uk/hud/subtitles.ftl +++ b/assets/voxygen/i18n/uk/hud/subtitles.ftl @@ -4,6 +4,8 @@ subtitle-bees = Дзижчання бджіл subtitle-owl = Укання сови subtitle-running_water = Булькання води subtitle-lightning = Грім +subtitle-portal-activated = Портал активовано +subtitle-portal-teleported = Телепортовано subtitle-footsteps_grass = Ходьба по траві subtitle-footsteps_earth = Ходьба по землі @@ -107,8 +109,9 @@ subtitle-deep_laugh = Глибокий сміх subtitle-attack-flash_freeze = Миттєве заморожування subtitle-attack-icy_spikes = Крижані шипи subtitle-attack-ice_crack = Крижана тріщина -subtitle-attack-steam = Пар +subtitle-attack-steam = Пара subtitle-attack-shovel = Копання Лопатою +subtitle-attack-from-the-ashes = Звук зцілення subtitle-consume_potion = Пиття зілля subtitle-consume_apple = Споживання яблука @@ -152,3 +155,5 @@ subtitle-utterance-wolf-angry = Вовк гарчить subtitle-utterance-wolf-hurt = Вовк скиглить subtitle-utterance-wyvern-angry = Рев Виверни subtitle-utterance-wyvern-hurt = Виверні боляче +subtitle-utterance-phoenix-angry = Крик Фенікса +subtitle-utterance-phoenix-hurt = Феніксу боляче diff --git a/assets/voxygen/i18n/uk/main.ftl b/assets/voxygen/i18n/uk/main.ftl index f4bfa0add0..3cad41bb07 100644 --- a/assets/voxygen/i18n/uk/main.ftl +++ b/assets/voxygen/i18n/uk/main.ftl @@ -1,4 +1,4 @@ -main-username = Ім'я користовуча +main-username = Ім'я користувача main-server = Сервер main-password = Пароль main-connecting = З'єднання @@ -32,9 +32,26 @@ main-login_process = Створити обліковий запис можна тут: https://veloren.net/account/. +main-singleplayer-new = Нова +main-singleplayer-delete = Видалити +main-singleplayer-regenerate = Перегенерувати +main-singleplayer-create_custom = Налаштувати +main-singleplayer-invalid_name = Помилка: неприпустиме ім'я +main-singleplayer-seed = Зерно +main-singleplayer-random_seed = Випадкова +main-singleplayer-size_lg = Логарифмічний розмір +main-singleplayer-map_large_warning = Увага: Перший запуск великих світів може зайняти багато часу +main-singleplayer-world_name = Назва світу +main-singleplayer-map_scale = Вертикальне масштабування +main-singleplayer-map_erosion_quality = Якість ерозії +main-singleplayer-map_shape = Форма +main-singleplayer-play = Грати +main-singleplayer-generate_and_play = Згенерувати і Грати +menu-singleplayer-confirm_delete = Ви дійсно хочте видалити "{ $world_name }" +menu-singleplayer-confirm_regenerate = Ви дійсно хочете перегенерувати "{ $world_name }" main-login-server_not_found = Сервер не знайдено main-login-authentication_error = Помилка авторизації на сервері -main-login-internal_error = Внутріння помилка у кліента (скоріше за все, персонаж був видалений) +main-login-internal_error = Внутрішня помилка у кліента (скоріше за все, персонаж був видалений) main-login-failed_auth_server_url_invalid = Не вдалося з'єднатися з сервером аутентифікації main-login-insecure_auth_scheme = HTTP схема аутентифікації НЕ підтримується. Це небезпечно! Для розробки це дозволено для 'localhost' або дебажних збірок main-login-server_full = Сервер переповнено @@ -58,11 +75,11 @@ main-login-username_bad_characters = Ім'я персонажа містить main-login-username_too_long = Ім'я персонажа занадто довге! Максимальна довжина: { $max_len } main-servers-select_server = Виберіть сервер main-servers-singleplayer_error = Помилка підключення до внутрішьного серверу: { $sp_error } -main-servers-network_error = Помилка сокету/мережі серверов: { $raw_error } +main-servers-network_error = Помилка сокету/мережі серверів: { $raw_error } main-servers-participant_error = Від'єднання учасника/помилка протоколу: { $raw_error } main-servers-stream_error = Помилка данних клієнто під час підключення: { $raw_error } main-servers-database_error = Помилка данних серверу: { $raw_error } -main-servers-persistence_error = Помилка постійності сервера (Можливо, пов'язано з ресурсами гри або данними про персонажа): { $raw_error } +main-servers-persistence_error = Помилка зберігання (Можливо, пов'язано з ресурсами гри або данними про персонажа): { $raw_error } main-servers-other_error = Помилка сервера: { $raw_error } main-credits = Подяки main-credits-created_by = зроблено diff --git a/assets/voxygen/i18n/uk/npc.ftl b/assets/voxygen/i18n/uk/npc.ftl index eb05ff86c2..ede890ec09 100644 --- a/assets/voxygen/i18n/uk/npc.ftl +++ b/assets/voxygen/i18n/uk/npc.ftl @@ -286,4 +286,5 @@ npc-speech-dist_very_far = дуже далеко npc-speech-dist_far = далеко npc-speech-dist_ahead = трохи подалі npc-speech-dist_near = поблизу -npc-speech-dist_near_to = дуже близько \ No newline at end of file +npc-speech-dist_near_to = дуже близько +npc-speech-arena = Давайте присядемо тут! \ No newline at end of file diff --git a/assets/voxygen/item_image_manifest.ron b/assets/voxygen/item_image_manifest.ron index 2bb9671c4b..95acc5ac91 100644 --- a/assets/voxygen/item_image_manifest.ron +++ b/assets/voxygen/item_image_manifest.ron @@ -3199,8 +3199,12 @@ "voxel.object.curious_potion", (0.0, 0.0, 0.0), (-50.0, 30.0, 20.0), 0.7, ), - Simple("common.items.consumable.potion_burning"): VoxTrans( - "voxel.object.potion_burning", + Simple("common.items.consumable.potion_combustion"): VoxTrans( + "voxel.object.potion_combustion", + (0.0, 0.0, 0.0), (-50.0, 30.0, 20.0), 0.7, + ), + Simple("common.items.consumable.potion_agility"): VoxTrans( + "voxel.object.potion_agility", (0.0, 0.0, 0.0), (-50.0, 30.0, 20.0), 0.7, ), Simple("common.items.charms.burning_charm"): VoxTrans( diff --git a/assets/voxygen/shaders/premultiply-alpha-vert.glsl b/assets/voxygen/shaders/premultiply-alpha-vert.glsl index 646582ee3f..e8737f9e9b 100644 --- a/assets/voxygen/shaders/premultiply-alpha-vert.glsl +++ b/assets/voxygen/shaders/premultiply-alpha-vert.glsl @@ -13,17 +13,14 @@ layout(push_constant) uniform Params { layout(location = 0) out vec2 source_coords; -uvec2 unpack(uint xy) { - return uvec2( - bitfieldExtract(xy, 0, 16), - bitfieldExtract(xy, 16, 16) - ); +vec2 unpack(uint xy) { + return vec2(xy & 0xFFFF, (xy >> 16) & 0xFFFF); } void main() { - vec2 source_size = vec2(unpack(source_size_xy)); - vec2 target_offset = vec2(unpack(target_offset_xy)); - vec2 target_size = vec2(unpack(target_size_xy)); + vec2 source_size = unpack(source_size_xy); + vec2 target_offset = unpack(target_offset_xy); + vec2 target_size = unpack(target_size_xy); // Generate rectangle (counter clockwise triangles) // diff --git a/assets/voxygen/voxel/item_drop_manifest.ron b/assets/voxygen/voxel/item_drop_manifest.ron index 9f05d84d7f..8cbf53f90d 100644 --- a/assets/voxygen/voxel/item_drop_manifest.ron +++ b/assets/voxygen/voxel/item_drop_manifest.ron @@ -809,7 +809,8 @@ Simple("common.items.consumable.potion_minor"): "voxel.object.potion_red", Simple("common.items.consumable.potion_big"): "voxel.object.potion_red", Simple("common.items.consumable.curious_potion"): "voxel.object.curious_potion", - Simple("common.items.consumable.potion_burning"): "voxel.object.potion_burning", + Simple("common.items.consumable.potion_combustion"): "voxel.object.potion_combustion", + Simple("common.items.consumable.potion_agility"): "voxel.object.potion_agility", Simple("common.items.charms.burning_charm"): "voxel.object.burning_charm", Simple("common.items.charms.frozen_charm"): "voxel.object.frozen_charm", Simple("common.items.charms.lifesteal_charm"): "voxel.object.lifesteal_charm", diff --git a/assets/voxygen/voxel/object/potion_agility.vox b/assets/voxygen/voxel/object/potion_agility.vox new file mode 100644 index 0000000000..08e69134f9 --- /dev/null +++ b/assets/voxygen/voxel/object/potion_agility.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07286a926c75c0426c58c458fcaae01cfbc46886b3e0d028bd7dd38f3001fc8e +size 1704 diff --git a/assets/voxygen/voxel/object/potion_burning.vox b/assets/voxygen/voxel/object/potion_combustion.vox similarity index 100% rename from assets/voxygen/voxel/object/potion_burning.vox rename to assets/voxygen/voxel/object/potion_combustion.vox diff --git a/client/examples/chat-cli/main.rs b/client/examples/chat-cli/main.rs index fb766195d3..a3246eb610 100644 --- a/client/examples/chat-cli/main.rs +++ b/client/examples/chat-cli/main.rs @@ -65,6 +65,7 @@ fn main() { &password, |provider| provider == "https://auth.veloren.net", &|_| {}, + |_| {}, )) .expect("Failed to create client instance"); @@ -85,7 +86,7 @@ fn main() { client.send_chat(msg) } - let events = match client.tick(comp::ControllerInputs::default(), clock.dt(), |_| {}) { + let events = match client.tick(comp::ControllerInputs::default(), clock.dt()) { Ok(events) => events, Err(err) => { error!("Error: {:?}", err); diff --git a/client/src/bin/bot/main.rs b/client/src/bin/bot/main.rs index 4ac6449d46..4c0648abe2 100644 --- a/client/src/bin/bot/main.rs +++ b/client/src/bin/bot/main.rs @@ -73,6 +73,7 @@ pub fn make_client( password, |_| true, &|_| {}, + |_| {}, )) .ok() } @@ -99,7 +100,7 @@ impl BotClient { for (username, client) in self.bot_clients.iter_mut() { trace!(?username, "tick"); let _msgs: Result, veloren_client::Error> = - client.tick(comp::ControllerInputs::default(), self.clock.dt(), |_| {}); + client.tick(comp::ControllerInputs::default(), self.clock.dt()); } } diff --git a/client/src/bin/swarm/main.rs b/client/src/bin/swarm/main.rs index 3c122421f5..5b9117c57d 100644 --- a/client/src/bin/swarm/main.rs +++ b/client/src/bin/swarm/main.rs @@ -123,6 +123,7 @@ fn run_client( &username, "", |_| false, + |_| {}, )) { Err(e) => tracing::warn!(?e, "Client {} disconnected", index), Ok(client) => break client, diff --git a/client/src/lib.rs b/client/src/lib.rs index 7d525585b1..6977133a8f 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -307,6 +307,7 @@ impl Client { password: &str, auth_trusted: impl FnMut(&str) -> bool, init_stage_update: &(dyn Fn(ClientInitStage) + Send + Sync), + add_foreign_systems: impl Fn(&mut DispatcherBuilder) + Send + 'static, ) -> Result { let network = Network::new(Pid::new(), &runtime); @@ -409,7 +410,16 @@ impl Client { // Initialize `State` let pools = State::pools(GameMode::Client); - let mut state = State::client(pools, map_size_lg, world_map.default_chunk); + let mut state = State::client( + pools, + map_size_lg, + world_map.default_chunk, + // TODO: Add frontend systems + |dispatch_builder| { + add_local_systems(dispatch_builder); + add_foreign_systems(dispatch_builder); + }, + ); // Client-only components state.ecs_mut().register::>(); let entity = state.ecs_mut().apply_entity_package(entity_package); @@ -1796,12 +1806,7 @@ impl Client { /// Execute a single client tick, handle input and update the game state by /// the given duration. - pub fn tick( - &mut self, - inputs: ControllerInputs, - dt: Duration, - add_foreign_systems: impl Fn(&mut DispatcherBuilder), - ) -> Result, Error> { + pub fn tick(&mut self, inputs: ControllerInputs, dt: Duration) -> Result, Error> { span!(_guard, "tick", "Client::tick"); // This tick function is the centre of the Veloren universe. Most client-side // things are managed from here, and as such it's important that it @@ -1902,10 +1907,6 @@ impl Client { // 4) Tick the client's LocalState self.state.tick( Duration::from_secs_f64(dt.as_secs_f64() * self.dt_adjustment), - |dispatch_builder| { - add_local_systems(dispatch_builder); - add_foreign_systems(dispatch_builder); - }, true, None, &self.connected_server_constants, @@ -3011,6 +3012,7 @@ mod tests { password, |suggestion: &str| suggestion == auth_server, &|_| {}, + |_| {}, )); let localisation = LocalizationHandle::load_expect("en"); @@ -3020,7 +3022,7 @@ mod tests { //tick let events_result: Result, Error> = - client.tick(ControllerInputs::default(), clock.dt(), |_| {}); + client.tick(ControllerInputs::default(), clock.dt()); //chat functionality client.send_chat("foobar".to_string()); diff --git a/common/src/cmd.rs b/common/src/cmd.rs index b7bc6e0e1d..a41a9c93b7 100644 --- a/common/src/cmd.rs +++ b/common/src/cmd.rs @@ -155,6 +155,7 @@ lazy_static! { BuffKind::Bleeding => "bleeding", BuffKind::Cursed => "cursed", BuffKind::Potion => "potion", + BuffKind::Agility => "agility", BuffKind::CampfireHeal => "campfire_heal", BuffKind::EnergyRegen => "energy_regen", BuffKind::IncreaseMaxEnergy => "increase_max_energy", diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 94729755a2..20560ef8de 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -615,7 +615,7 @@ pub enum CharacterAbilityType { ChargedRanged, DashMelee(StageSection), BasicBlock, - ComboMelee(StageSection, u32), + ComboMeleeDeprecated(StageSection, u32), ComboMelee2(StageSection), FinisherMelee(StageSection), DiveMelee(StageSection), @@ -642,7 +642,9 @@ impl From<&CharacterState> for CharacterAbilityType { CharacterState::BasicBlock(_) => Self::BasicBlock, CharacterState::LeapMelee(data) => Self::LeapMelee(data.stage_section), CharacterState::LeapShockwave(data) => Self::LeapShockwave(data.stage_section), - CharacterState::ComboMelee(data) => Self::ComboMelee(data.stage_section, data.stage), + CharacterState::ComboMeleeDeprecated(data) => { + Self::ComboMeleeDeprecated(data.stage_section, data.stage) + }, CharacterState::ComboMelee2(data) => Self::ComboMelee2(data.stage_section), CharacterState::FinisherMelee(data) => Self::FinisherMelee(data.stage_section), CharacterState::DiveMelee(data) => Self::DiveMelee(data.stage_section), @@ -771,7 +773,7 @@ pub enum CharacterAbility { #[serde(default)] meta: AbilityMeta, }, - ComboMelee { + ComboMeleeDeprecated { stage_data: Vec>, initial_energy_gain: f32, max_energy_gain: f32, @@ -1134,7 +1136,7 @@ impl CharacterAbility { (data.physics.on_ground.is_none() || buildup_duration.is_some()) && update.energy.try_change_by(-*energy_cost).is_ok() }, - CharacterAbility::ComboMelee { .. } + CharacterAbility::ComboMeleeDeprecated { .. } | CharacterAbility::Boost { .. } | CharacterAbility::BasicBeam { .. } | CharacterAbility::Blink { .. } @@ -1303,7 +1305,7 @@ impl CharacterAbility { *recover_duration /= stats.speed; *energy_cost /= stats.energy_efficiency; }, - ComboMelee { + ComboMeleeDeprecated { ref mut stage_data, initial_energy_gain: _, max_energy_gain: _, @@ -1720,7 +1722,7 @@ impl CharacterAbility { } }, Boost { .. } - | ComboMelee { .. } + | ComboMeleeDeprecated { .. } | Blink { .. } | Music { .. } | BasicSummon { .. } @@ -1768,7 +1770,7 @@ impl CharacterAbility { | RiposteMelee { .. } | BasicBeam { .. } | Boost { .. } - | ComboMelee { .. } + | ComboMeleeDeprecated { .. } | Blink { .. } | Music { .. } | BasicSummon { .. } @@ -1795,7 +1797,7 @@ impl CharacterAbility { | SelfBuff { meta, .. } | BasicBeam { meta, .. } | Boost { meta, .. } - | ComboMelee { meta, .. } + | ComboMeleeDeprecated { meta, .. } | ComboMelee2 { meta, .. } | Blink { meta, .. } | BasicSummon { meta, .. } @@ -1872,7 +1874,7 @@ impl CharacterAbility { use skills::{HammerSkill::*, Skill::Hammer}; match self { - CharacterAbility::ComboMelee { + CharacterAbility::ComboMeleeDeprecated { ref mut speed_increase, ref mut max_speed_increase, ref mut stage_data, @@ -2385,9 +2387,8 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState { was_wielded: false, // false by default. utils might set it to true prev_aimed_dir: None, is_sneaking: false, - was_combo: None, }), - CharacterAbility::ComboMelee { + CharacterAbility::ComboMeleeDeprecated { stage_data, initial_energy_gain, max_energy_gain, @@ -2397,7 +2398,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState { scales_from_combo, ori_modifier, meta: _, - } => CharacterState::ComboMelee(combo_melee::Data { + } => CharacterState::ComboMeleeDeprecated(combo_melee::Data { static_data: combo_melee::StaticData { num_stages: stage_data.len() as u32, stage_data: stage_data.iter().map(|stage| stage.to_duration()).collect(), diff --git a/common/src/comp/buff.rs b/common/src/comp/buff.rs index 821a3768b1..cef10d70c3 100644 --- a/common/src/comp/buff.rs +++ b/common/src/comp/buff.rs @@ -37,6 +37,11 @@ pub enum BuffKind { /// Applied when drinking a potion. /// Strength should be the healing per second. Potion, + /// Increases movement speed and vulnerability to damage as well as + /// decreases the amount of damage dealt. + /// Movement speed increases linearly with strength 1.0 is an 100% increase + /// Damage vulnerability and damage reduction are both hard set to 100% + Agility, /// Applied when sitting at a campfire. /// Strength is fraction of health restored per second. CampfireHeal, @@ -177,6 +182,7 @@ impl BuffKind { BuffKind::Regeneration | BuffKind::Saturation | BuffKind::Potion + | BuffKind::Agility | BuffKind::CampfireHeal | BuffKind::Frenzied | BuffKind::EnergyRegen @@ -264,6 +270,13 @@ impl BuffKind { tick_dur: Secs(0.1), }] }, + BuffKind::Agility => vec![ + BuffEffect::MovementSpeed( + 1.0 + data.strength * stats.map_or(1.0, |s| s.move_speed_multiplier), + ), + BuffEffect::DamageReduction(-1.0), + BuffEffect::AttackDamage(0.0), + ], BuffKind::CampfireHeal => vec![BuffEffect::HealthChangeOverTime { rate: data.strength, kind: ModifierKind::Multiplicative, @@ -351,7 +364,11 @@ impl BuffKind { }, ], BuffKind::Parried => vec![BuffEffect::AttackSpeed(0.5)], - BuffKind::PotionSickness => vec![BuffEffect::HealReduction(data.strength)], + //TODO: Handle potion sickness in a more general way. + BuffKind::PotionSickness => vec![ + BuffEffect::HealReduction(data.strength), + BuffEffect::MoveSpeedReduction(data.strength), + ], BuffKind::Reckless => vec![ BuffEffect::DamageReduction(-data.strength), BuffEffect::AttackDamage(1.0 + data.strength), @@ -557,6 +574,8 @@ pub enum BuffEffect { PoiseReduction(f32), /// Reduces amount healed by consumables HealReduction(f32), + /// Reduces amount of speed increase by consumables + MoveSpeedReduction(f32), /// Increases poise damage dealt when health is lost PoiseDamageFromLostHealth { initial_health: f32, diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 1854ed5c00..2e2d74b2b5 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -95,7 +95,7 @@ pub enum CharacterState { DashMelee(dash_melee::Data), /// A three-stage attack where each attack pushes player forward /// and successive attacks increase in damage, while player holds button. - ComboMelee(combo_melee::Data), + ComboMeleeDeprecated(combo_melee::Data), /// A state where you progress through multiple melee attacks ComboMelee2(combo_melee2::Data), /// A leap followed by a small aoe ground attack @@ -154,7 +154,7 @@ impl CharacterState { | CharacterState::BasicMelee(_) | CharacterState::BasicRanged(_) | CharacterState::DashMelee(_) - | CharacterState::ComboMelee(_) + | CharacterState::ComboMeleeDeprecated(_) | CharacterState::ComboMelee2(_) | CharacterState::BasicBlock(_) | CharacterState::LeapMelee(_) @@ -220,7 +220,7 @@ impl CharacterState { CharacterState::BasicMelee(_) | CharacterState::BasicRanged(_) | CharacterState::DashMelee(_) - | CharacterState::ComboMelee(_) + | CharacterState::ComboMeleeDeprecated(_) | CharacterState::ComboMelee2(_) | CharacterState::LeapMelee(_) | CharacterState::LeapShockwave(_) @@ -247,7 +247,7 @@ impl CharacterState { CharacterState::BasicMelee(_) | CharacterState::BasicRanged(_) | CharacterState::DashMelee(_) - | CharacterState::ComboMelee(_) + | CharacterState::ComboMeleeDeprecated(_) | CharacterState::ComboMelee2(_) | CharacterState::BasicBlock(_) | CharacterState::LeapMelee(_) @@ -377,7 +377,7 @@ impl CharacterState { pub fn is_forced_movement(&self) -> bool { matches!(self, - CharacterState::ComboMelee(s) if s.stage_section == StageSection::Action) + CharacterState::ComboMeleeDeprecated(s) if s.stage_section == StageSection::Action) || matches!(self, CharacterState::ComboMelee2(s) if s.stage_section == StageSection::Action) || matches!(self, CharacterState::DashMelee(s) if s.stage_section == StageSection::Charge) || matches!(self, CharacterState::LeapMelee(s) if s.stage_section == StageSection::Movement) @@ -403,7 +403,7 @@ impl CharacterState { | CharacterState::Wielding(_) | CharacterState::BasicMelee(_) | CharacterState::BasicRanged(_) - | CharacterState::ComboMelee(_) + | CharacterState::ComboMeleeDeprecated(_) | CharacterState::ComboMelee2(_) | CharacterState::ChargedRanged(_) | CharacterState::RepeaterRanged(_) @@ -458,7 +458,7 @@ impl CharacterState { CharacterState::Roll(data) => data.behavior(j, output_events), CharacterState::Wielding(data) => data.behavior(j, output_events), CharacterState::Equipping(data) => data.behavior(j, output_events), - CharacterState::ComboMelee(data) => data.behavior(j, output_events), + CharacterState::ComboMeleeDeprecated(data) => data.behavior(j, output_events), CharacterState::ComboMelee2(data) => data.behavior(j, output_events), CharacterState::BasicMelee(data) => data.behavior(j, output_events), CharacterState::BasicRanged(data) => data.behavior(j, output_events), @@ -511,7 +511,9 @@ impl CharacterState { CharacterState::Roll(data) => data.handle_event(j, output_events, action), CharacterState::Wielding(data) => data.handle_event(j, output_events, action), CharacterState::Equipping(data) => data.handle_event(j, output_events, action), - CharacterState::ComboMelee(data) => data.handle_event(j, output_events, action), + CharacterState::ComboMeleeDeprecated(data) => { + data.handle_event(j, output_events, action) + }, CharacterState::ComboMelee2(data) => data.handle_event(j, output_events, action), CharacterState::BasicMelee(data) => data.handle_event(j, output_events, action), CharacterState::BasicRanged(data) => data.handle_event(j, output_events, action), @@ -564,7 +566,7 @@ impl CharacterState { CharacterState::Roll(data) => Some(data.static_data.ability_info), CharacterState::Wielding(_) => None, CharacterState::Equipping(_) => None, - CharacterState::ComboMelee(data) => Some(data.static_data.ability_info), + CharacterState::ComboMeleeDeprecated(data) => Some(data.static_data.ability_info), CharacterState::ComboMelee2(data) => Some(data.static_data.ability_info), CharacterState::BasicMelee(data) => Some(data.static_data.ability_info), CharacterState::BasicRanged(data) => Some(data.static_data.ability_info), @@ -608,7 +610,7 @@ impl CharacterState { CharacterState::Roll(data) => Some(data.stage_section), CharacterState::Equipping(_) => Some(StageSection::Buildup), CharacterState::Wielding(_) => None, - CharacterState::ComboMelee(data) => Some(data.stage_section), + CharacterState::ComboMeleeDeprecated(data) => Some(data.stage_section), CharacterState::ComboMelee2(data) => Some(data.stage_section), CharacterState::BasicMelee(data) => Some(data.stage_section), CharacterState::BasicRanged(data) => Some(data.stage_section), @@ -668,7 +670,7 @@ impl CharacterState { buildup: Some(data.static_data.buildup_duration), ..Default::default() }), - CharacterState::ComboMelee(data) => { + CharacterState::ComboMeleeDeprecated(data) => { let stage_index = data.stage_index(); let stage = data.static_data.stage_data[stage_index]; Some(DurationsInfo { @@ -840,7 +842,7 @@ impl CharacterState { CharacterState::Roll(data) => Some(data.timer), CharacterState::Wielding(_) => None, CharacterState::Equipping(data) => Some(data.timer), - CharacterState::ComboMelee(data) => Some(data.timer), + CharacterState::ComboMeleeDeprecated(data) => Some(data.timer), CharacterState::ComboMelee2(data) => Some(data.timer), CharacterState::BasicMelee(data) => Some(data.timer), CharacterState::BasicRanged(data) => Some(data.timer), @@ -884,7 +886,7 @@ impl CharacterState { CharacterState::Roll(_) => None, CharacterState::Wielding(_) => None, CharacterState::Equipping(_) => None, - CharacterState::ComboMelee(_) => Some(AttackSource::Melee), + CharacterState::ComboMeleeDeprecated(_) => Some(AttackSource::Melee), CharacterState::ComboMelee2(_) => Some(AttackSource::Melee), CharacterState::BasicMelee(_) => Some(AttackSource::Melee), CharacterState::BasicRanged(data) => { diff --git a/common/src/comp/inventory/loadout_builder.rs b/common/src/comp/inventory/loadout_builder.rs index 94d7edfe7d..6d29df89b9 100644 --- a/common/src/comp/inventory/loadout_builder.rs +++ b/common/src/comp/inventory/loadout_builder.rs @@ -705,7 +705,7 @@ fn default_main_tool(body: &Body) -> Item { arthropod::Species::Dagonite => Some(Item::new_from_asset_expect( "common.items.npc_weapons.unique.arthropods.dagonite", )), - _ => Some(Item::new_from_asset_expect( + arthropod::Species::Leafbeetle => Some(Item::new_from_asset_expect( "common.items.npc_weapons.unique.arthropods.leafbeetle", )), }, diff --git a/common/src/comp/stats.rs b/common/src/comp/stats.rs index c30f06a981..7a61319d32 100644 --- a/common/src/comp/stats.rs +++ b/common/src/comp/stats.rs @@ -56,8 +56,10 @@ pub struct Stats { pub damage_reduction: f32, pub poise_reduction: f32, pub heal_multiplier: f32, + pub move_speed_multiplier: f32, pub max_health_modifiers: StatsModifier, pub move_speed_modifier: f32, + pub jump_modifier: f32, pub attack_speed_modifier: f32, pub friction_modifier: f32, pub max_energy_modifiers: StatsModifier, @@ -83,8 +85,10 @@ impl Stats { damage_reduction: 0.0, poise_reduction: 0.0, heal_multiplier: 1.0, + move_speed_multiplier: 1.0, max_health_modifiers: StatsModifier::default(), move_speed_modifier: 1.0, + jump_modifier: 1.0, attack_speed_modifier: 1.0, friction_modifier: 1.0, max_energy_modifiers: StatsModifier::default(), diff --git a/common/src/consts.rs b/common/src/consts.rs index 8da03b3598..ea0017acdd 100644 --- a/common/src/consts.rs +++ b/common/src/consts.rs @@ -35,3 +35,6 @@ pub const ENERGY_PER_LEVEL: u16 = 5; pub const HP_PER_LEVEL: u16 = 5; pub const TELEPORTER_RADIUS: f32 = 3.; + +// Map settings +pub const DAY_LENGTH_DEFAULT: f64 = 30.0; diff --git a/common/src/states/combo_melee.rs b/common/src/states/combo_melee.rs index 63c370afc8..a1a6aef699 100644 --- a/common/src/states/combo_melee.rs +++ b/common/src/states/combo_melee.rs @@ -170,14 +170,14 @@ impl CharacterBehavior for Data { ); // Build up - update.character = CharacterState::ComboMelee(Data { + update.character = CharacterState::ComboMeleeDeprecated(Data { static_data: self.static_data.clone(), timer: tick_attack_or_default(data, self.timer, Some(speed_modifier)), ..*self }); } else { // Transitions to swing section of stage - update.character = CharacterState::ComboMelee(Data { + update.character = CharacterState::ComboMeleeDeprecated(Data { static_data: self.static_data.clone(), timer: Duration::default(), stage_section: StageSection::Action, @@ -194,7 +194,7 @@ impl CharacterBehavior for Data { && !self.exhausted { // Swing - update.character = CharacterState::ComboMelee(Data { + update.character = CharacterState::ComboMeleeDeprecated(Data { static_data: self.static_data.clone(), timer: tick_attack_or_default(data, self.timer, None), exhausted: true, @@ -304,14 +304,14 @@ impl CharacterBehavior for Data { ); // Swings - update.character = CharacterState::ComboMelee(Data { + update.character = CharacterState::ComboMeleeDeprecated(Data { static_data: self.static_data.clone(), timer: tick_attack_or_default(data, self.timer, Some(speed_modifier)), ..*self }); } else { // Transitions to recover section of stage - update.character = CharacterState::ComboMelee(Data { + update.character = CharacterState::ComboMeleeDeprecated(Data { static_data: self.static_data.clone(), timer: Duration::default(), stage_section: StageSection::Recover, @@ -328,7 +328,7 @@ impl CharacterBehavior for Data { None, ); // Recovers - update.character = CharacterState::ComboMelee(Data { + update.character = CharacterState::ComboMeleeDeprecated(Data { static_data: self.static_data.clone(), timer: tick_attack_or_default(data, self.timer, Some(speed_modifier)), ..*self @@ -380,7 +380,7 @@ fn reset_state( data.static_data.ability_info.input, ); - if let CharacterState::ComboMelee(c) = &mut update.character { + if let CharacterState::ComboMeleeDeprecated(c) = &mut update.character { c.stage = (data.stage % data.static_data.num_stages) + 1; } } diff --git a/common/src/states/roll.rs b/common/src/states/roll.rs index 24a7af4c5a..1741cc19e7 100644 --- a/common/src/states/roll.rs +++ b/common/src/states/roll.rs @@ -2,7 +2,7 @@ use crate::{ comp::{ buff::{BuffChange, BuffKind}, character_state::{AttackFilters, OutputEvents}, - CharacterState, InputKind, StateUpdate, + CharacterState, StateUpdate, }, event::ServerEvent, states::{ @@ -46,8 +46,6 @@ pub struct Data { pub prev_aimed_dir: Option, /// Is sneaking, true if previous state was also considered sneaking pub is_sneaking: bool, - /// Was in state with combo - pub was_combo: Option<(InputKind, u32)>, } impl CharacterBehavior for Data { @@ -126,20 +124,7 @@ impl CharacterBehavior for Data { }); } else { // Done - if let Some((input, stage)) = self.was_combo { - if input_is_pressed(data, input) { - handle_input(data, output_events, &mut update, input); - // If other states are introduced that progress through stages, add them - // here - if let CharacterState::ComboMelee(c) = &mut update.character { - c.stage = stage; - } - } else { - end_ability(data, &mut update); - } - } else { - end_ability(data, &mut update); - } + end_ability(data, &mut update); } }, _ => { diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index dc0b6a0e1d..9140a33cf9 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -1193,7 +1193,7 @@ pub fn handle_jump( data.entity, strength * impulse / data.mass.0 * data.scale.map_or(1.0, |s| s.0.powf(13.0).powf(0.25)) - * data.stats.move_speed_modifier, + * data.stats.jump_modifier, )); }) .is_some() @@ -1243,16 +1243,11 @@ fn handle_ability( } } if let CharacterState::Roll(roll) = &mut update.character { - if let CharacterState::ComboMelee(c) = data.character { - roll.was_combo = Some((c.static_data.ability_info.input, c.stage)); + if data.character.is_wield() || data.character.was_wielded() { roll.was_wielded = true; - } else { - if data.character.is_wield() || data.character.was_wielded() { - roll.was_wielded = true; - } - if data.character.is_stealthy() { - roll.is_sneaking = true; - } + } + if data.character.is_stealthy() { + roll.is_sneaking = true; } if data.character.is_aimed() { roll.prev_aimed_dir = Some(data.controller.inputs.look_dir); diff --git a/common/src/terrain/site.rs b/common/src/terrain/site.rs index e857268f77..4734f18e5e 100644 --- a/common/src/terrain/site.rs +++ b/common/src/terrain/site.rs @@ -14,6 +14,7 @@ pub enum SiteKindMeta { pub enum DungeonKindMeta { Old, Gnarling, + Adlet, } #[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq, Eq)] diff --git a/common/state/src/state.rs b/common/state/src/state.rs index 377b6cbc90..4f380dd0f9 100644 --- a/common/state/src/state.rs +++ b/common/state/src/state.rs @@ -33,7 +33,7 @@ use hashbrown::{HashMap, HashSet}; use rayon::{ThreadPool, ThreadPoolBuilder}; use specs::{ prelude::Resource, - shred::{Fetch, FetchMut}, + shred::{Fetch, FetchMut, SendDispatcher}, storage::{MaskedStorage as EcsMaskedStorage, Storage as EcsStorage}, Component, DispatcherBuilder, Entity as EcsEntity, WorldExt, }; @@ -128,6 +128,7 @@ pub struct State { ecs: specs::World, // Avoid lifetime annotation by storing a thread pool instead of the whole dispatcher thread_pool: Arc, + dispatcher: SendDispatcher<'static>, } pub type Pools = Arc; @@ -150,13 +151,35 @@ impl State { } /// Create a new `State` in client mode. - pub fn client(pools: Pools, map_size_lg: MapSizeLg, default_chunk: Arc) -> Self { - Self::new(GameMode::Client, pools, map_size_lg, default_chunk) + pub fn client( + pools: Pools, + map_size_lg: MapSizeLg, + default_chunk: Arc, + add_systems: impl Fn(&mut DispatcherBuilder), + ) -> Self { + Self::new( + GameMode::Client, + pools, + map_size_lg, + default_chunk, + add_systems, + ) } /// Create a new `State` in server mode. - pub fn server(pools: Pools, map_size_lg: MapSizeLg, default_chunk: Arc) -> Self { - Self::new(GameMode::Server, pools, map_size_lg, default_chunk) + pub fn server( + pools: Pools, + map_size_lg: MapSizeLg, + default_chunk: Arc, + add_systems: impl Fn(&mut DispatcherBuilder), + ) -> Self { + Self::new( + GameMode::Server, + pools, + map_size_lg, + default_chunk, + add_systems, + ) } pub fn new( @@ -164,10 +187,23 @@ impl State { pools: Pools, map_size_lg: MapSizeLg, default_chunk: Arc, + add_systems: impl Fn(&mut DispatcherBuilder), ) -> Self { + prof_span!(guard, "create dispatcher"); + let mut dispatch_builder = + DispatcherBuilder::<'static, 'static>::new().with_pool(Arc::clone(&pools)); + // TODO: Consider alternative ways to do this + add_systems(&mut dispatch_builder); + let dispatcher = dispatch_builder + .build() + .try_into_sendable() + .unwrap_or_else(|_| panic!("Thread local systems not allowed")); + drop(guard); + Self { ecs: Self::setup_ecs_world(game_mode, Arc::clone(&pools), map_size_lg, default_chunk), thread_pool: pools, + dispatcher, } } @@ -615,7 +651,6 @@ impl State { pub fn tick( &mut self, dt: Duration, - add_systems: impl Fn(&mut DispatcherBuilder), update_terrain: bool, mut metrics: Option<&mut StateTickMetrics>, server_constants: &ServerConstants, @@ -645,19 +680,9 @@ impl State { self.ecs.write_resource::().0 = (dt.as_secs_f32() * time_scale as f32).min(MAX_DELTA_TIME); - section_span!(guard, "create dispatcher"); - // Run systems to update the world. - // Create and run a dispatcher for ecs systems. - let mut dispatch_builder = - DispatcherBuilder::new().with_pool(Arc::clone(&self.thread_pool)); - // TODO: Consider alternative ways to do this - add_systems(&mut dispatch_builder); - // This dispatches all the systems in parallel. - let mut dispatcher = dispatch_builder.build(); - drop(guard); - section_span!(guard, "run systems"); - dispatcher.dispatch(&self.ecs); + // This dispatches all the systems in parallel. + self.dispatcher.dispatch(&self.ecs); drop(guard); section_span!(guard, "maintain ecs"); diff --git a/common/systems/src/aura.rs b/common/systems/src/aura.rs index 201326d5b3..037b42d84c 100644 --- a/common/systems/src/aura.rs +++ b/common/systems/src/aura.rs @@ -11,9 +11,7 @@ use common::{ uid::{IdMaps, Uid}, }; use common_ecs::{Job, Origin, Phase, System}; -use specs::{ - shred::ResourceId, Entities, Entity as EcsEntity, Join, Read, ReadStorage, SystemData, World, -}; +use specs::{shred, Entities, Entity as EcsEntity, Join, Read, ReadStorage, SystemData}; #[derive(SystemData)] pub struct ReadData<'a> { diff --git a/common/systems/src/beam.rs b/common/systems/src/beam.rs index 3d25e5b54a..d22bae4bc6 100644 --- a/common/systems/src/beam.rs +++ b/common/systems/src/beam.rs @@ -17,8 +17,7 @@ use common_ecs::{Job, Origin, ParMode, Phase, System}; use rand::Rng; use rayon::iter::ParallelIterator; use specs::{ - shred::ResourceId, Entities, LendJoin, ParJoin, Read, ReadExpect, ReadStorage, SystemData, - World, WriteStorage, + shred, Entities, LendJoin, ParJoin, Read, ReadExpect, ReadStorage, SystemData, WriteStorage, }; use vek::*; @@ -121,6 +120,10 @@ impl<'a> System<'a> for Sys { sound: Sound::new(SoundKind::Beam, pos.0, 13.0, read_data.time.0), }); } + outcomes.push(Outcome::Beam { + pos: pos.0, + specifier: beam.specifier, + }); // Group to ignore collisions with // Might make this more nuanced if beams are used for non damage effects diff --git a/common/systems/src/buff.rs b/common/systems/src/buff.rs index 8f890ee0c2..f7d48fcb18 100644 --- a/common/systems/src/buff.rs +++ b/common/systems/src/buff.rs @@ -22,8 +22,8 @@ use common_base::prof_span; use common_ecs::{Job, Origin, ParMode, Phase, System}; use rayon::iter::ParallelIterator; use specs::{ - shred::ResourceId, Entities, Entity, LendJoin, ParJoin, Read, ReadExpect, ReadStorage, - SystemData, World, WriteStorage, + shred, Entities, Entity, LendJoin, ParJoin, Read, ReadExpect, ReadStorage, SystemData, + WriteStorage, }; #[derive(SystemData)] @@ -664,6 +664,9 @@ fn execute_effect( BuffEffect::HealReduction(red) => { stat.heal_multiplier *= 1.0 - *red; }, + BuffEffect::MoveSpeedReduction(red) => { + stat.move_speed_multiplier *= 1.0 - *red; + }, BuffEffect::PoiseDamageFromLostHealth { initial_health, strength, diff --git a/common/systems/src/character_behavior.rs b/common/systems/src/character_behavior.rs index 4bf9c95863..37b09aca26 100644 --- a/common/systems/src/character_behavior.rs +++ b/common/systems/src/character_behavior.rs @@ -1,6 +1,5 @@ use specs::{ - shred::ResourceId, Entities, LazyUpdate, LendJoin, Read, ReadExpect, ReadStorage, SystemData, - World, WriteStorage, + shred, Entities, LazyUpdate, LendJoin, Read, ReadExpect, ReadStorage, SystemData, WriteStorage, }; use common::{ diff --git a/common/systems/src/controller.rs b/common/systems/src/controller.rs index 4ad8a18177..9b6dec9ab2 100644 --- a/common/systems/src/controller.rs +++ b/common/systems/src/controller.rs @@ -9,10 +9,7 @@ use common::{ uid::IdMaps, }; use common_ecs::{Job, Origin, Phase, System}; -use specs::{ - shred::ResourceId, Entities, Join, Read, ReadExpect, ReadStorage, SystemData, World, - WriteStorage, -}; +use specs::{shred, Entities, Join, Read, ReadExpect, ReadStorage, SystemData, WriteStorage}; use vek::*; #[derive(SystemData)] diff --git a/common/systems/src/interpolation.rs b/common/systems/src/interpolation.rs index 0f0fb13fa5..c79bc3782a 100644 --- a/common/systems/src/interpolation.rs +++ b/common/systems/src/interpolation.rs @@ -6,8 +6,8 @@ use common_base::prof_span; use common_ecs::{Job, Origin, Phase, System}; use common_net::sync::InterpolatableComponent; use specs::{ - prelude::ParallelIterator, shred::ResourceId, Entities, ParJoin, Read, ReadStorage, SystemData, - World, WriteStorage, + prelude::ParallelIterator, shred, Entities, ParJoin, Read, ReadStorage, SystemData, + WriteStorage, }; #[derive(SystemData)] diff --git a/common/systems/src/melee.rs b/common/systems/src/melee.rs index 2ee6941f77..b51b224dff 100644 --- a/common/systems/src/melee.rs +++ b/common/systems/src/melee.rs @@ -18,8 +18,7 @@ use common::{ use common_ecs::{Job, Origin, Phase, System}; use itertools::Itertools; use specs::{ - shred::ResourceId, Entities, Join, LendJoin, Read, ReadExpect, ReadStorage, SystemData, World, - WriteStorage, + shred, Entities, Join, LendJoin, Read, ReadExpect, ReadStorage, SystemData, WriteStorage, }; use vek::*; diff --git a/common/systems/src/phys.rs b/common/systems/src/phys.rs index b0ab8fa0a1..f12a5738e0 100644 --- a/common/systems/src/phys.rs +++ b/common/systems/src/phys.rs @@ -22,9 +22,8 @@ use common_base::{prof_span, span}; use common_ecs::{Job, Origin, ParMode, Phase, PhysicsMetrics, System}; use rayon::iter::ParallelIterator; use specs::{ - shred::{ResourceId, World}, - Entities, Entity, Join, LendJoin, ParJoin, Read, ReadExpect, ReadStorage, SystemData, Write, - WriteExpect, WriteStorage, + shred, Entities, Entity, Join, LendJoin, ParJoin, Read, ReadExpect, ReadStorage, SystemData, + Write, WriteExpect, WriteStorage, }; use std::ops::Range; use vek::*; @@ -562,10 +561,11 @@ impl<'a> PhysicsData<'a> { let radius_cutoff = 64; let mut spatial_grid = SpatialGrid::new(lg2_cell_size, lg2_large_cell_size, radius_cutoff); // TODO: give voxel colliders their own component type - for (entity, pos, collider, ori) in ( + for (entity, pos, collider, scale, ori) in ( &read.entities, &write.positions, &read.colliders, + read.scales.maybe(), &write.orientations, ) .join() @@ -573,7 +573,7 @@ impl<'a> PhysicsData<'a> { let vol = collider.get_vol(&voxel_colliders_manifest); if let Some(vol) = vol { - let sphere = voxel_collider_bounding_sphere(vol, pos, ori); + let sphere = voxel_collider_bounding_sphere(vol, pos, ori, scale); let radius = sphere.radius.ceil() as u32; let pos_2d = sphere.center.xy().map(|e| e as i32); const POS_TRUNCATION_ERROR: u32 = 1; @@ -1084,15 +1084,17 @@ impl<'a> PhysicsData<'a> { voxel_collider_spatial_grid .in_circle_aabr(query_center, query_radius) .filter_map(|entity| { - positions - .get(entity) - .and_then(|l| velocities.get(entity).map(|r| (l, r))) - .and_then(|l| previous_phys_cache.get(entity).map(|r| (l, r))) - .and_then(|l| read.colliders.get(entity).map(|r| (l, r))) - .and_then(|l| orientations.get(entity).map(|r| (l, r))) - .map(|((((pos, vel), previous_cache), collider), ori)| { - (entity, pos, vel, previous_cache, collider, ori) - }) + positions.get(entity).and_then(|pos| { + Some(( + entity, + pos, + velocities.get(entity)?, + previous_phys_cache.get(entity)?, + read.colliders.get(entity)?, + read.scales.get(entity), + orientations.get(entity)?, + )) + }) }) .for_each( |( @@ -1101,6 +1103,7 @@ impl<'a> PhysicsData<'a> { vel_other, previous_cache_other, collider_other, + scale_other, ori_other, )| { if entity == entity_other { @@ -1126,6 +1129,7 @@ impl<'a> PhysicsData<'a> { voxel_collider, pos_other, ori_other, + scale_other, ); // Early check if voxel_sphere.center.distance_squared(path_sphere.center) @@ -1942,6 +1946,7 @@ fn voxel_collider_bounding_sphere( voxel_collider: &VoxelCollider, pos: &Pos, ori: &Ori, + scale: Option<&Scale>, ) -> Sphere { let origin_offset = voxel_collider.translation; use common::vol::SizedVol; @@ -1964,7 +1969,7 @@ fn voxel_collider_bounding_sphere( Sphere { center: wpos_center, - radius, + radius: radius * scale.map_or(1.0, |s| s.0), } } diff --git a/common/systems/src/projectile.rs b/common/systems/src/projectile.rs index 28c0f8dacb..814bd21f10 100644 --- a/common/systems/src/projectile.rs +++ b/common/systems/src/projectile.rs @@ -17,8 +17,8 @@ use common::vol::ReadVol; use common_ecs::{Job, Origin, Phase, System}; use rand::Rng; use specs::{ - shred::ResourceId, Entities, Entity as EcsEntity, Join, Read, ReadExpect, ReadStorage, - SystemData, World, WriteStorage, + shred, Entities, Entity as EcsEntity, Join, Read, ReadExpect, ReadStorage, SystemData, + WriteStorage, }; use std::time::Duration; use vek::*; diff --git a/common/systems/src/shockwave.rs b/common/systems/src/shockwave.rs index 9ddcdc140c..fa4fb4dd65 100644 --- a/common/systems/src/shockwave.rs +++ b/common/systems/src/shockwave.rs @@ -15,9 +15,7 @@ use common::{ }; use common_ecs::{Job, Origin, Phase, System}; use rand::Rng; -use specs::{ - shred::ResourceId, Entities, Join, LendJoin, Read, ReadStorage, SystemData, World, WriteStorage, -}; +use specs::{shred, Entities, Join, LendJoin, Read, ReadStorage, SystemData, WriteStorage}; use vek::*; #[derive(SystemData)] diff --git a/common/systems/src/stats.rs b/common/systems/src/stats.rs index 6c0f10d216..8dd19cf102 100644 --- a/common/systems/src/stats.rs +++ b/common/systems/src/stats.rs @@ -12,8 +12,7 @@ use common::{ }; use common_ecs::{Job, Origin, Phase, System}; use specs::{ - shred::ResourceId, Entities, LendJoin, Read, ReadExpect, ReadStorage, SystemData, World, Write, - WriteStorage, + shred, Entities, LendJoin, Read, ReadExpect, ReadStorage, SystemData, Write, WriteStorage, }; const ENERGY_REGEN_ACCEL: f32 = 1.0; @@ -174,7 +173,7 @@ impl<'a> System<'a> for Sys { | CharacterState::DashMelee(_) | CharacterState::LeapMelee(_) | CharacterState::LeapShockwave(_) - | CharacterState::ComboMelee(_) + | CharacterState::ComboMeleeDeprecated(_) | CharacterState::ComboMelee2(_) | CharacterState::BasicRanged(_) | CharacterState::Music(_) diff --git a/common/systems/tests/character_state.rs b/common/systems/tests/character_state.rs index 27a785cd84..74cc50fd77 100644 --- a/common/systems/tests/character_state.rs +++ b/common/systems/tests/character_state.rs @@ -34,6 +34,9 @@ mod tests { pools, DEFAULT_WORLD_CHUNKS_LG, Arc::new(TerrainChunk::water(0)), + |dispatch_builder| { + dispatch::(dispatch_builder, &[]); + }, ); let msm = MaterialStatManifest::load().cloned(); state.ecs_mut().insert(msm); @@ -78,9 +81,6 @@ mod tests { fn tick(state: &mut State, dt: Duration) { state.tick( dt, - |dispatch_builder| { - dispatch::(dispatch_builder, &[]); - }, false, None, &ServerConstants { diff --git a/common/systems/tests/phys/basic.rs b/common/systems/tests/phys/basic.rs index 53d5c97a5e..340c24d3fc 100644 --- a/common/systems/tests/phys/basic.rs +++ b/common/systems/tests/phys/basic.rs @@ -5,17 +5,13 @@ use specs::WorldExt; use std::error::Error; use utils::{DT, DT_F64, EPSILON}; use vek::{approx, Vec2, Vec3}; -use veloren_common_systems::add_local_systems; #[test] fn simple_run() { - let mut state = utils::setup(); + let mut state = utils::setup(veloren_common_systems::add_local_systems); utils::create_player(&mut state); state.tick( DT, - |dispatcher_builder| { - add_local_systems(dispatcher_builder); - }, false, None, &ServerConstants { @@ -27,7 +23,7 @@ fn simple_run() { #[test] fn dont_fall_outside_world() -> Result<(), Box> { - let mut state = utils::setup(); + let mut state = utils::setup(utils::add_char_and_phys_systems); let p1 = utils::create_player(&mut state); { @@ -54,7 +50,7 @@ fn dont_fall_outside_world() -> Result<(), Box> { #[test] fn fall_simple() -> Result<(), Box> { - let mut state = utils::setup(); + let mut state = utils::setup(utils::add_char_and_phys_systems); let p1 = utils::create_player(&mut state); let (pos, vel, _) = utils::get_transform(&state, p1)?; @@ -93,8 +89,8 @@ fn fall_simple() -> Result<(), Box> { /// will fall in 20 x DT and 2 x 10*DT steps. compare the end result and make /// log the "error" between both calculations fn fall_dt_speed_diff() -> Result<(), Box> { - let mut sstate = utils::setup(); - let mut fstate = utils::setup(); + let mut sstate = utils::setup(utils::add_char_and_phys_systems); + let mut fstate = utils::setup(utils::add_char_and_phys_systems); let sp1 = utils::create_player(&mut sstate); let fp1 = utils::create_player(&mut fstate); @@ -142,7 +138,7 @@ fn fall_dt_speed_diff() -> Result<(), Box> { #[test] fn walk_simple() -> Result<(), Box> { - let mut state = utils::setup(); + let mut state = utils::setup(utils::add_char_and_phys_systems); let p1 = utils::create_player(&mut state); for _ in 0..100 { @@ -187,7 +183,7 @@ fn walk_simple() -> Result<(), Box> { #[test] fn walk_max() -> Result<(), Box> { - let mut state = utils::setup(); + let mut state = utils::setup(utils::add_char_and_phys_systems); for x in 2..30 { utils::generate_chunk(&mut state, Vec2::new(x, 0)); } @@ -220,8 +216,8 @@ fn walk_max() -> Result<(), Box> { /// will run in 20 x DT and 2 x 10*DT steps. compare the end result and make /// log the "error" between both calculations fn walk_dt_speed_diff() -> Result<(), Box> { - let mut sstate = utils::setup(); - let mut fstate = utils::setup(); + let mut sstate = utils::setup(utils::add_char_and_phys_systems); + let mut fstate = utils::setup(utils::add_char_and_phys_systems); let sp1 = utils::create_player(&mut sstate); let fp1 = utils::create_player(&mut fstate); @@ -275,7 +271,7 @@ fn walk_dt_speed_diff() -> Result<(), Box> { #[test] fn cant_run_during_fall() -> Result<(), Box> { - let mut state = utils::setup(); + let mut state = utils::setup(utils::add_char_and_phys_systems); let p1 = utils::create_player(&mut state); let mut actions = Controller::default(); diff --git a/common/systems/tests/phys/utils.rs b/common/systems/tests/phys/utils.rs index 38613f7158..6ab734812a 100644 --- a/common/systems/tests/phys/utils.rs +++ b/common/systems/tests/phys/utils.rs @@ -35,13 +35,14 @@ const DEFAULT_WORLD_CHUNKS_LG: MapSizeLg = panic!("Default world chunk size does not satisfy required invariants."); }; -pub fn setup() -> State { +pub fn setup(add_systems: impl Fn(&mut specs::DispatcherBuilder)) -> State { let pools = State::pools(GameMode::Server); let mut state = State::new( GameMode::Server, pools, DEFAULT_WORLD_CHUNKS_LG, Arc::new(TerrainChunk::water(0)), + add_systems, ); state.ecs_mut().insert(MaterialStatManifest::with_empty()); state.ecs_mut().insert(AbilityMap::load().cloned()); @@ -55,14 +56,14 @@ pub fn setup() -> State { state } +pub fn add_char_and_phys_systems(dispatch_builder: &mut specs::DispatcherBuilder) { + dispatch::(dispatch_builder, &[]); + dispatch::(dispatch_builder, &[&character_behavior::Sys::sys_name()]); +} pub fn tick(state: &mut State, dt: Duration) { state.tick( dt, - |dispatch_builder| { - dispatch::(dispatch_builder, &[]); - dispatch::(dispatch_builder, &[&character_behavior::Sys::sys_name()]); - }, false, None, &ServerConstants { diff --git a/flake.lock b/flake.lock index 05c389c3d9..080a295f33 100644 --- a/flake.lock +++ b/flake.lock @@ -3,71 +3,35 @@ "crane": { "flake": false, "locked": { - "lastModified": 1681175776, - "narHash": "sha256-7SsUy9114fryHAZ8p1L6G6YSu7jjz55FddEwa2U8XZc=", + "lastModified": 1699217310, + "narHash": "sha256-xpW3VFUG7yE6UE6Wl0dhqencuENSkV7qpnpe9I8VbPw=", "owner": "ipetkov", "repo": "crane", - "rev": "445a3d222947632b5593112bb817850e8a9cf737", + "rev": "d535642bbe6f377077f7c23f0febb78b1463f449", "type": "github" }, "original": { "owner": "ipetkov", - "ref": "v0.12.1", + "ref": "v0.15.0", "repo": "crane", "type": "github" } }, "dream2nix": { "inputs": { - "all-cabal-json": [ - "nci" - ], - "crane": "crane", - "devshell": [ - "nci" - ], - "drv-parts": "drv-parts", - "flake-compat": "flake-compat", - "flake-parts": [ - "nci", - "parts" - ], - "flake-utils-pre-commit": [ - "nci" - ], - "ghc-utils": [ - "nci" - ], - "gomod2nix": [ - "nci" - ], - "mach-nix": [ - "nci" - ], - "nix-pypi-fetcher": [ - "nci" - ], "nixpkgs": [ "nci", "nixpkgs" ], - "nixpkgsV1": "nixpkgsV1", - "poetry2nix": [ - "nci" - ], - "pre-commit-hooks": [ - "nci" - ], - "pruned-racket-catalog": [ - "nci" - ] + "purescript-overlay": "purescript-overlay", + "pyproject-nix": "pyproject-nix" }, "locked": { - "lastModified": 1686064783, - "narHash": "sha256-qyptOk4vDut2JkRMJ+815eJNqqd8gIfjpz3l4WCCtMY=", + "lastModified": 1702457430, + "narHash": "sha256-8NQiXtYCOiC7XFayy6GPGDudCBrPROry3mfWjpdVj5g=", "owner": "nix-community", "repo": "dream2nix", - "rev": "0c064fa9dd025069cc215b0a8b4eb5ea734aceb0", + "rev": "262198033e23e9ee832f0cc8133d38f07598f555", "type": "github" }, "original": { @@ -76,54 +40,6 @@ "type": "github" } }, - "drv-parts": { - "inputs": { - "flake-compat": [ - "nci", - "dream2nix", - "flake-compat" - ], - "flake-parts": [ - "nci", - "dream2nix", - "flake-parts" - ], - "nixpkgs": [ - "nci", - "dream2nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1680698112, - "narHash": "sha256-FgnobN/DvCjEsc0UAZEAdPLkL4IZi2ZMnu2K2bUaElc=", - "owner": "davhau", - "repo": "drv-parts", - "rev": "e8c2ec1157dc1edb002989669a0dbd935f430201", - "type": "github" - }, - "original": { - "owner": "davhau", - "repo": "drv-parts", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "mk-naked-shell": { "flake": false, "locked": { @@ -142,20 +58,22 @@ }, "nci": { "inputs": { + "crane": "crane", "dream2nix": "dream2nix", "mk-naked-shell": "mk-naked-shell", "nixpkgs": [ "nixpkgs" ], "parts": "parts", - "rust-overlay": "rust-overlay" + "rust-overlay": "rust-overlay", + "treefmt": "treefmt" }, "locked": { - "lastModified": 1686550289, - "narHash": "sha256-2tmTVciCJJVEMLDdd28BeTUKOYlR9Z47oEUiKl/OXKg=", + "lastModified": 1703916624, + "narHash": "sha256-sauEKoCC7xiLMb1r2d7TBDJYn9b7qRcRnR7kYKUgouA=", "owner": "yusdacra", "repo": "nix-cargo-integration", - "rev": "acb9cf3a5e31b791d675515eac4d73df13555061", + "rev": "d5a24e3098dd968491ac58e51b5af5728b2853d5", "type": "github" }, "original": { @@ -166,11 +84,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1686412476, - "narHash": "sha256-inl9SVk6o5h75XKC79qrDCAobTD1Jxh6kVYTZKHzewA=", + "lastModified": 1703438236, + "narHash": "sha256-aqVBq1u09yFhL7bj1/xyUeJjzr92fXVvQSSEx6AdB1M=", "owner": "nixos", "repo": "nixpkgs", - "rev": "21951114383770f96ae528d0ae68824557768e81", + "rev": "5f64a12a728902226210bf01d25ec6cbb9d9265b", "type": "github" }, "original": { @@ -183,11 +101,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1685564631, - "narHash": "sha256-8ywr3AkblY4++3lIVxmrWZFzac7+f32ZEhH/A8pNscI=", + "lastModified": 1701253981, + "narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4f53efe34b3a8877ac923b9350c874e3dcd5dc0a", + "rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58", "type": "github" }, "original": { @@ -198,21 +116,6 @@ "type": "github" } }, - "nixpkgsV1": { - "locked": { - "lastModified": 1678500271, - "narHash": "sha256-tRBLElf6f02HJGG0ZR7znMNFv/Uf7b2fFInpTHiHaSE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "5eb98948b66de29f899c7fe27ae112a47964baf8", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-22.11", - "type": "indirect" - } - }, "parts": { "inputs": { "nixpkgs-lib": [ @@ -221,11 +124,11 @@ ] }, "locked": { - "lastModified": 1685662779, - "narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=", + "lastModified": 1701473968, + "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3", + "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", "type": "github" }, "original": { @@ -239,11 +142,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1685662779, - "narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=", + "lastModified": 1701473968, + "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3", + "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", "type": "github" }, "original": { @@ -252,6 +155,46 @@ "type": "github" } }, + "purescript-overlay": { + "inputs": { + "nixpkgs": [ + "nci", + "dream2nix", + "nixpkgs" + ], + "slimlock": "slimlock" + }, + "locked": { + "lastModified": 1696022621, + "narHash": "sha256-eMjFmsj2G1E0Q5XiibUNgFjTiSz0GxIeSSzzVdoN730=", + "owner": "thomashoneyman", + "repo": "purescript-overlay", + "rev": "047c7933abd6da8aa239904422e22d190ce55ead", + "type": "github" + }, + "original": { + "owner": "thomashoneyman", + "repo": "purescript-overlay", + "type": "github" + } + }, + "pyproject-nix": { + "flake": false, + "locked": { + "lastModified": 1702448246, + "narHash": "sha256-hFg5s/hoJFv7tDpiGvEvXP0UfFvFEDgTdyHIjDVHu1I=", + "owner": "davhau", + "repo": "pyproject.nix", + "rev": "5a06a2697b228c04dd2f35659b4b659ca74f7aeb", + "type": "github" + }, + "original": { + "owner": "davhau", + "ref": "dream2nix", + "repo": "pyproject.nix", + "type": "github" + } + }, "root": { "inputs": { "nci": "nci", @@ -262,11 +205,11 @@ "rust-overlay": { "flake": false, "locked": { - "lastModified": 1686537156, - "narHash": "sha256-mJD80brS6h6P4jzwdKID0S9RvfyiruxgJbXvPPIDqF0=", + "lastModified": 1703902408, + "narHash": "sha256-qXdWvu+tlgNjeoz8yQMRKSom6QyRROfgpmeOhwbujqw=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "e75da5cfc7da874401decaa88f4ccb3b4d64d20d", + "rev": "319f57cd2c34348c55970a4bf2b35afe82088681", "type": "github" }, "original": { @@ -274,6 +217,50 @@ "repo": "rust-overlay", "type": "github" } + }, + "slimlock": { + "inputs": { + "nixpkgs": [ + "nci", + "dream2nix", + "purescript-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1688610262, + "narHash": "sha256-Wg0ViDotFWGWqKIQzyYCgayeH8s4U1OZcTiWTQYdAp4=", + "owner": "thomashoneyman", + "repo": "slimlock", + "rev": "b5c6cdcaf636ebbebd0a1f32520929394493f1a6", + "type": "github" + }, + "original": { + "owner": "thomashoneyman", + "repo": "slimlock", + "type": "github" + } + }, + "treefmt": { + "inputs": { + "nixpkgs": [ + "nci", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1702979157, + "narHash": "sha256-RnFBbLbpqtn4AoJGXKevQMCGhra4h6G2MPcuTSZZQ+g=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "2961375283668d867e64129c22af532de8e77734", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 208f36b398..7b3cb39a3a 100644 --- a/flake.nix +++ b/flake.nix @@ -86,7 +86,6 @@ pkgs.runCommand old.name { - inherit (old) pname version; meta = old.meta or {}; passthru = (old.passthru or {}) @@ -102,12 +101,13 @@ --set VELOREN_GIT_VERSION "${git.prettyRev}" \ --set VELOREN_GIT_TAG "${git.tag}" ''; - veloren-common-ov = { + veloren-common-env = { # We don't add in any information here because otherwise anything # that depends on common will be recompiled. We will set these in # our wrapper instead. NIX_GIT_HASH = ""; NIX_GIT_TAG = ""; + VELOREN_USERDATA_STRATEGY = "system"; }; voxygenOut = config.nci.outputs."veloren-voxygen"; serverCliOut = config.nci.outputs."veloren-server-cli"; @@ -124,62 +124,35 @@ if [ $? -ne 0 ]; then exit 1 fi + export VELOREN_GIT_VERSION="${git.prettyRev}" + export VELOREN_GIT_TAG="${git.tag}" ''; }); - nci.projects."veloren".relPath = ""; - nci.crates."veloren-server-cli" = let - veloren-server-cli-deps-ov = _: { - doCheck = false; - dontCheck = true; - }; - in { + nci.projects."veloren" = { + export = false; + path = ./.; + }; + nci.crates."veloren-server-cli" = { profiles = { release.features = ["default-publish"]; + release.runTests = false; dev.features = ["default-publish"]; + dev.runTests = false; }; - depsOverrides.fix-build.overrideAttrs = veloren-server-cli-deps-ov; - overrides = { - fix-veloren-common = veloren-common-ov; - add-deps-reqs.overrideAttrs = veloren-server-cli-deps-ov; - fix-build.override = _: { + drvConfig = { + mkDerivation = { src = filteredSource; - VELOREN_USERDATA_STRATEGY = "system"; }; + env = veloren-common-env; }; }; - nci.crates."veloren-voxygen" = let - veloren-voxygen-deps-ov = prev: { - buildInputs = - (prev.buildInputs or []) - ++ ( - with pkgs; [ - alsa-lib - libxkbcommon - udev - xorg.libxcb - ] - ); - nativeBuildInputs = - (prev.nativeBuildInputs or []) - ++ ( - with pkgs; [ - python3 - pkg-config - cmake - gnumake - ] - ); - - SHADERC_LIB_DIR = "${pkgs.shaderc.lib}/lib"; - VELOREN_ASSETS = "${assets}"; - - checkPhase = ":"; - }; - in { + nci.crates."veloren-voxygen" = { profiles = { release.features = ["default-publish"]; + release.runTests = false; dev.features = ["default-publish"]; + dev.runTests = false; }; runtimeLibs = with pkgs; [ xorg.libX11 @@ -194,26 +167,48 @@ vulkan-loader stdenv.cc.cc.lib ]; - depsOverrides.fix-build.overrideAttrs = veloren-voxygen-deps-ov; - overrides = { - fix-veloren-common = veloren-common-ov; - add-deps-reqs.overrideAttrs = veloren-voxygen-deps-ov; - fix-build.overrideAttrs = prev: { - src = filteredSource; - - VELOREN_USERDATA_STRATEGY = "system"; - - dontUseCmakeConfigure = true; - - preConfigure = '' - ${prev.preConfigure or ""} - substituteInPlace voxygen/src/audio/soundcache.rs \ - --replace \ - "../../../assets/voxygen/audio/null.ogg" \ - "${./assets/voxygen/audio/null.ogg}" - ''; + depsDrvConfig = { + env = + veloren-common-env + // { + SHADERC_LIB_DIR = "${pkgs.shaderc.lib}/lib"; + VELOREN_ASSETS = "${assets}"; + }; + mkDerivation = { + buildInputs = with pkgs; [ + alsa-lib + libxkbcommon + udev + xorg.libxcb + ]; + nativeBuildInputs = with pkgs; [ + python3 + pkg-config + cmake + gnumake + ]; }; }; + drvConfig = let + depsConf = config.nci.crates."veloren-voxygen".depsDrvConfig; + in { + env = + depsConf.env + // { + dontUseCmakeConfigure = true; + }; + mkDerivation = + depsConf.mkDerivation + // { + src = filteredSource; + preConfigure = '' + substituteInPlace voxygen/src/audio/soundcache.rs \ + --replace \ + "../../../assets/voxygen/audio/null.ogg" \ + "${./assets/voxygen/audio/null.ogg}" + ''; + }; + }; }; }; }; diff --git a/server/agent/src/action_nodes.rs b/server/agent/src/action_nodes.rs index bf83a93e44..8e8f8017a0 100644 --- a/server/agent/src/action_nodes.rs +++ b/server/agent/src/action_nodes.rs @@ -594,7 +594,10 @@ impl<'a> AgentData<'a> { tgt_pos: &Pos, ) { if read_data.is_riders.contains(*self.entity) - || read_data.is_volume_riders.contains(*self.entity) + || read_data + .is_volume_riders + .get(*self.entity) + .map_or(false, |r| !r.is_steering_entity()) { controller.push_event(ControlEvent::Unmount); } @@ -652,7 +655,10 @@ impl<'a> AgentData<'a> { const MAX_FLEE_SPEED: f32 = 0.65; if read_data.is_riders.contains(*self.entity) - || read_data.is_volume_riders.contains(*self.entity) + || read_data + .is_volume_riders + .get(*self.entity) + .map_or(false, |r| !r.is_steering_entity()) { controller.push_event(ControlEvent::Unmount); } diff --git a/server/agent/src/attack.rs b/server/agent/src/attack.rs index c3e5bf1bc7..b4c00451aa 100644 --- a/server/agent/src/attack.rs +++ b/server/agent/src/attack.rs @@ -3410,7 +3410,7 @@ impl<'a> AgentData<'a> { { // If already in dash, keep dashing if not in recover controller.push_basic_input(InputKind::Ability(0)); - } else if matches!(self.char_state, CharacterState::ComboMelee(c) if matches!(c.stage_section, StageSection::Recover)) + } else if matches!(self.char_state, CharacterState::ComboMelee2(c) if matches!(c.stage_section, StageSection::Recover)) { // If already in combo keep comboing if not in recover controller.push_basic_input(InputKind::Primary); diff --git a/server/agent/src/data.rs b/server/agent/src/data.rs index e14ce4d889..eea12e5053 100755 --- a/server/agent/src/data.rs +++ b/server/agent/src/data.rs @@ -26,10 +26,7 @@ use common::{ terrain::TerrainGrid, uid::{IdMaps, Uid}, }; -use specs::{ - shred::ResourceId, Entities, Entity as EcsEntity, Read, ReadExpect, ReadStorage, SystemData, - World, -}; +use specs::{shred, Entities, Entity as EcsEntity, Read, ReadExpect, ReadStorage, SystemData}; // TODO: Move rtsim back into AgentData after rtsim2 when it has a separate // crate diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 40bfb98592..d7c7ae24c2 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -26,8 +26,7 @@ use common::{ }, comp::{ self, - aura::{Aura, AuraKind, AuraTarget}, - buff::{Buff, BuffCategory, BuffData, BuffKind, BuffSource}, + buff::{Buff, BuffData, BuffKind, BuffSource}, inventory::{ item::{tool::AbilityMap, MaterialStatManifest, Quality}, slot::Slot, @@ -1941,44 +1940,11 @@ fn handle_spawn_campfire( _action: &ServerChatCommand, ) -> CmdResult<()> { let pos = position(server, target, "target")?; - let time = server.state.get_time(); server .state - .create_object(pos, comp::object::Body::CampfireLit) - .with(LightEmitter { - col: Rgb::new(1.0, 0.65, 0.2), - strength: 2.0, - flicker: 1.0, - animated: true, - }) - .with(WaypointArea::default()) - .with(comp::Auras::new(vec![ - Aura::new( - AuraKind::Buff { - kind: BuffKind::CampfireHeal, - data: BuffData::new(0.02, Some(Secs(1.0))), - category: BuffCategory::Natural, - source: BuffSource::World, - }, - 5.0, - None, - AuraTarget::All, - Time(time), - ), - Aura::new( - AuraKind::Buff { - kind: BuffKind::Burning, - data: BuffData::new(2.0, Some(Secs(10.0))), - category: BuffCategory::Natural, - source: BuffSource::World, - }, - 0.7, - None, - AuraTarget::All, - Time(time), - ), - ])) - .build(); + .ecs() + .read_resource::>() + .emit_now(ServerEvent::CreateWaypoint(pos.0)); server.notify_client( client, diff --git a/server/src/lib.rs b/server/src/lib.rs index fe5ce2e79a..071db2b428 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -306,6 +306,16 @@ impl Server { pools, world.sim().map_size_lg(), Arc::clone(&map.default_chunk), + |dispatcher_builder| { + add_local_systems(dispatcher_builder); + sys::msg::add_server_systems(dispatcher_builder); + sys::add_server_systems(dispatcher_builder); + #[cfg(feature = "worldgen")] + { + rtsim::add_server_systems(dispatcher_builder); + weather::add_server_systems(dispatcher_builder); + } + }, ); state.ecs_mut().insert(battlemode_buffer); state.ecs_mut().insert(settings.clone()); @@ -752,16 +762,6 @@ impl Server { let mut state_tick_metrics = Default::default(); self.state.tick( dt, - |dispatcher_builder| { - add_local_systems(dispatcher_builder); - sys::msg::add_server_systems(dispatcher_builder); - sys::add_server_systems(dispatcher_builder); - #[cfg(feature = "worldgen")] - { - rtsim::add_server_systems(dispatcher_builder); - weather::add_server_systems(dispatcher_builder); - } - }, false, Some(&mut state_tick_metrics), &self.server_constants, diff --git a/server/src/migrations/V53__potion_combustion.sql b/server/src/migrations/V53__potion_combustion.sql new file mode 100644 index 0000000000..f41559e61d --- /dev/null +++ b/server/src/migrations/V53__potion_combustion.sql @@ -0,0 +1,2 @@ +UPDATE item +SET item_definition_id = 'common.items.consumable.potion_combustion' WHERE item_definition_id = 'common.items.consumable.potion_burning'; \ No newline at end of file diff --git a/server/src/settings.rs b/server/src/settings.rs index 4756011a66..011f4e32f3 100644 --- a/server/src/settings.rs +++ b/server/src/settings.rs @@ -16,6 +16,7 @@ pub use whitelist::{Whitelist, WhitelistInfo, WhitelistRecord}; use chrono::Utc; use common::{ calendar::{Calendar, CalendarEvent}, + consts::DAY_LENGTH_DEFAULT, resources::BattleMode, rtsim::WorldSettings, }; @@ -205,7 +206,7 @@ impl Default for Settings { world_seed: DEFAULT_WORLD_SEED, server_name: "Veloren Server".into(), max_players: 100, - day_length: 30.0, + day_length: DAY_LENGTH_DEFAULT, start_time: 9.0 * 3600.0, map_file: None, max_view_distance: Some(65), diff --git a/server/src/sys/msg/register.rs b/server/src/sys/msg/register.rs index d2f261e7bc..09ef22e801 100644 --- a/server/src/sys/msg/register.rs +++ b/server/src/sys/msg/register.rs @@ -24,8 +24,8 @@ use itertools::Either; use plugin_api::Health; use rayon::prelude::*; use specs::{ - shred::ResourceId, Entities, Join, LendJoin, ParJoin, Read, ReadExpect, ReadStorage, - SystemData, World, WriteStorage, + shred, Entities, Join, LendJoin, ParJoin, Read, ReadExpect, ReadStorage, SystemData, + WriteStorage, }; use tracing::{debug, info, trace, warn}; diff --git a/server/src/sys/sentinel.rs b/server/src/sys/sentinel.rs index ecc844fff6..b0a748419e 100644 --- a/server/src/sys/sentinel.rs +++ b/server/src/sys/sentinel.rs @@ -11,10 +11,7 @@ use common_net::{ sync::{CompSyncPackage, EntityPackage, EntitySyncPackage, NetSync, SyncFrom, UpdateTracker}, }; use hashbrown::HashMap; -use specs::{ - shred::ResourceId, Entity as EcsEntity, Join, ReadExpect, ReadStorage, SystemData, World, - WriteExpect, -}; +use specs::{shred, Entity as EcsEntity, Join, ReadExpect, ReadStorage, SystemData, WriteExpect}; use vek::*; /// Always watching diff --git a/server/src/sys/wiring.rs b/server/src/sys/wiring.rs index 7ef9ad73d7..445f80607d 100644 --- a/server/src/sys/wiring.rs +++ b/server/src/sys/wiring.rs @@ -8,8 +8,7 @@ use common_ecs::{Job, Origin, Phase, System}; use common_state::BlockChange; use hashbrown::HashMap; use specs::{ - shred::ResourceId, Entities, Entity, Join, LendJoin, Read, ReadStorage, SystemData, World, - Write, WriteStorage, + shred, Entities, Entity, Join, LendJoin, Read, ReadStorage, SystemData, Write, WriteStorage, }; #[derive(SystemData)] diff --git a/voxygen/anim/src/arthropod/alpha.rs b/voxygen/anim/src/arthropod/combomelee.rs similarity index 93% rename from voxygen/anim/src/arthropod/alpha.rs rename to voxygen/anim/src/arthropod/combomelee.rs index a90f507e0f..d767d4e7fc 100644 --- a/voxygen/anim/src/arthropod/alpha.rs +++ b/voxygen/anim/src/arthropod/combomelee.rs @@ -6,19 +6,19 @@ use super::{ }; use common::states::utils::StageSection; -pub struct AlphaAnimation; +pub struct ComboAnimation; -impl Animation for AlphaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); +impl Animation for ComboAnimation { + type Dependency<'a> = (Option<&'a str>, StageSection, usize, f32, f32); type Skeleton = ArthropodSkeleton; #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"arthropod_alpha\0"; + const UPDATE_FN: &'static [u8] = b"arthropod_combo\0"; - #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_alpha")] + #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_combo")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency<'_>, + (_ability_id, stage_section, _current_strike, global_time, timer): Self::Dependency<'_>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, @@ -26,9 +26,9 @@ impl Animation for AlphaAnimation { let mut next = (*skeleton).clone(); let (movement1, movement2, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.powi(2), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), + StageSection::Buildup => (anim_time.powi(2), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), _ => (0.0, 0.0, 0.0), }; let pullback = 1.0 - movement3; diff --git a/voxygen/anim/src/arthropod/mod.rs b/voxygen/anim/src/arthropod/mod.rs index 9bc370a1b8..e44831d840 100644 --- a/voxygen/anim/src/arthropod/mod.rs +++ b/voxygen/anim/src/arthropod/mod.rs @@ -1,4 +1,4 @@ -pub mod alpha; +pub mod combomelee; pub mod dash; pub mod idle; pub mod jump; @@ -11,7 +11,7 @@ pub mod summon; // Reexports pub use self::{ - alpha::AlphaAnimation, dash::DashAnimation, idle::IdleAnimation, jump::JumpAnimation, + combomelee::ComboAnimation, dash::DashAnimation, idle::IdleAnimation, jump::JumpAnimation, leapmelee::LeapMeleeAnimation, leapshockwave::LeapShockAnimation, run::RunAnimation, shoot::ShootAnimation, stunned::StunnedAnimation, summon::SummonAnimation, }; diff --git a/voxygen/anim/src/biped_large/alpha.rs b/voxygen/anim/src/biped_large/alpha.rs index ebc8f5f84a..070530669a 100644 --- a/voxygen/anim/src/biped_large/alpha.rs +++ b/voxygen/anim/src/biped_large/alpha.rs @@ -1,6 +1,7 @@ use super::{ super::{vek::*, Animation}, - BipedLargeSkeleton, SkeletonAttr, + biped_large_alpha_axe, biped_large_alpha_hammer, biped_large_alpha_sword, + init_biped_large_alpha, BipedLargeSkeleton, SkeletonAttr, }; use common::{ comp::item::tool::{AbilitySpec, ToolKind}, @@ -45,17 +46,7 @@ impl Animation for AlphaAnimation { ) -> Self::Skeleton { *rate = 1.0; let mut next = (*skeleton).clone(); - let speed = Vec2::::from(velocity).magnitude(); - let lab: f32 = 0.65 * s_a.tempo; - let speednorm = (speed / 12.0).powf(0.4); - let foothoril = (acc_vel * lab + PI * 1.45).sin() * speednorm; - let foothorir = (acc_vel * lab + PI * (0.45)).sin() * speednorm; - let footrotl = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 1.4).sin()).powi(2))).sqrt()) - * ((acc_vel * lab + PI * 1.4).sin()); - - let footrotr = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 0.4).sin()).powi(2))).sqrt()) - * ((acc_vel * lab + PI * 0.4).sin()); let (move1base, move2base, move3) = match stage_section { Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), Some(StageSection::Action) => (1.0, anim_time, 0.0), @@ -65,85 +56,20 @@ impl Animation for AlphaAnimation { let pullback = 1.0 - move3; let move1 = move1base * pullback; let move2 = move2base * pullback; + let subtract = global_time - timer; let check = subtract - subtract.trunc(); let mirror = (check - 0.5).signum(); - next.second.position = Vec3::new(0.0, 0.0, 0.0); - next.second.orientation = Quaternion::rotation_x(0.0); - next.shoulder_l.position = Vec3::new( - -s_a.shoulder.0, - s_a.shoulder.1, - s_a.shoulder.2 - foothorir * 1.0, - ); - next.shoulder_l.orientation = - Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotr * -0.2) * speednorm); + let speed = Vec2::::from(velocity).magnitude(); - next.shoulder_r.position = Vec3::new( - s_a.shoulder.0, - s_a.shoulder.1, - s_a.shoulder.2 - foothoril * 1.0, - ); - next.shoulder_r.orientation = - Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotl * -0.2) * speednorm); - - next.main.position = Vec3::new(0.0, 0.0, 0.0); - next.main.orientation = Quaternion::rotation_x(0.0); - - next.hand_l.position = Vec3::new(0.0, 0.0, s_a.grip.0); - next.hand_r.position = Vec3::new(0.0, 0.0, s_a.grip.0); - - next.hand_l.orientation = Quaternion::rotation_x(0.0); - next.hand_r.orientation = Quaternion::rotation_x(0.0); + let foothorir = init_biped_large_alpha(&mut next, s_a, speed, acc_vel, move1); match active_tool_kind { Some(ToolKind::Sword) => { - next.control_l.position = Vec3::new(-1.0, 1.0, 1.0); - next.control_r.position = Vec3::new(0.0, 2.0, -3.0); - next.head.orientation = Quaternion::rotation_x(move1 * -0.25) - * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); - next.control.position = Vec3::new( - -3.0 + move1 * -4.0 + move2 * 5.0, - 5.0 + s_a.grip.0 / 1.2 + move1 * -4.0 + move2 * 8.0, - -4.0 + -s_a.grip.0 / 2.0 + move2 * -5.0, - ); - next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.5 + move2 * -0.7); - next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.5 + move2 * 0.7); - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0 + move1 * -0.5 + move2 * 1.5) - * Quaternion::rotation_y(-0.2); - next.control_r.orientation = - Quaternion::rotation_x(PI / 2.2 + move1 * -0.5 + move2 * 1.5) - * Quaternion::rotation_y(0.2) - * Quaternion::rotation_z(0.0); - - next.control.orientation = - Quaternion::rotation_x(-0.2 + move1 * 0.5 + move2 * -2.0) - * Quaternion::rotation_y(-0.1 + move1 * -0.5 + move2 * 1.0); + biped_large_alpha_sword(&mut next, s_a, move1, move2); }, Some(ToolKind::Hammer) => { - next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); - next.control_r.position = Vec3::new(1.0, 2.0, -2.0); - - next.control.position = Vec3::new( - 4.0 + move1 * -12.0 + move2 * 20.0, - (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * 5.0, - (-s_a.grip.0 / 0.8) + move1 * -2.0 + move2 * 8.0, - ); - next.head.orientation = Quaternion::rotation_x(move1 * -0.25) - * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); - next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.2 + move2 * -0.4); - next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.2 + move2 * 0.2); - - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - - next.control.orientation = - Quaternion::rotation_x(-1.0 + move1 * -0.5 + move2 * -0.3) - * Quaternion::rotation_y(-1.8 + move1 * -0.8 + move2 * 3.0) - * Quaternion::rotation_z(move1 * -0.8 + move2 * -0.8); + biped_large_alpha_hammer(&mut next, s_a, move1, move2); }, Some(ToolKind::Axe) => match ability_id { Some("common.abilities.custom.gigas_frost.cleave") => { @@ -257,32 +183,7 @@ impl Animation for AlphaAnimation { next.main.orientation = Quaternion::rotation_y(move1 * 0.4 + move2 * -1.2); }, _ => { - next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); - next.control_r.position = Vec3::new(1.0, 2.0, -2.0); - - next.control.position = Vec3::new( - 4.0 + move1 * -12.0 + move2 * 28.0, - (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * -5.0, - (-s_a.grip.0 / 0.8) + move1 * 2.0 + move2 * 8.0, - ); - next.head.orientation = Quaternion::rotation_x(move1 * -0.25) - * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); - next.upper_torso.orientation = - Quaternion::rotation_z(move1 * 0.6 + move2 * -0.9); - next.lower_torso.orientation = - Quaternion::rotation_z(move1 * -0.6 + move2 * 0.9); - - next.control_l.orientation = Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) - * Quaternion::rotation_y(-0.0); - next.control_r.orientation = - Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - - next.control.orientation = - Quaternion::rotation_x(-1.0 + move1 * -0.5 + move2 * -0.3) - * Quaternion::rotation_y(-1.8 + move1 * -0.4 + move2 * 3.5) - * Quaternion::rotation_z(move1 * -1.0 + move2 * -1.5); + biped_large_alpha_axe(&mut next, s_a, move1, move2); }, }, Some(ToolKind::Natural) => match ability_id { @@ -306,7 +207,6 @@ impl Animation for AlphaAnimation { * Quaternion::rotation_z(move1 * -0.5 + move2 * 0.6); next.head.orientation = Quaternion::rotation_x(move1 * 0.3); }, - Some("common.abilities.custom.tidalwarrior.pincer") => { if mirror > 0.0 { next.head.orientation = Quaternion::rotation_z(move1 * 0.75); diff --git a/voxygen/anim/src/biped_large/beta.rs b/voxygen/anim/src/biped_large/beta.rs index 75eaa37bfe..34065d6542 100644 --- a/voxygen/anim/src/biped_large/beta.rs +++ b/voxygen/anim/src/biped_large/beta.rs @@ -1,5 +1,6 @@ use super::{ super::{vek::*, Animation}, + biped_large_beta_axe, biped_large_beta_hammer, biped_large_beta_sword, init_biped_large_beta, BipedLargeSkeleton, SkeletonAttr, }; use common::{ @@ -43,17 +44,7 @@ impl Animation for BetaAnimation { ) -> Self::Skeleton { *rate = 1.0; let mut next = (*skeleton).clone(); - let speed = Vec2::::from(velocity).magnitude(); - let lab: f32 = 0.65 * s_a.tempo; - let speednorm = (speed / 12.0).powf(0.4); - let foothoril = (acc_vel * lab + PI * 1.45).sin() * speednorm; - let foothorir = (acc_vel * lab + PI * (0.45)).sin() * speednorm; - let footrotl = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 1.4).sin()).powi(2))).sqrt()) - * ((acc_vel * lab + PI * 1.4).sin()); - - let footrotr = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 0.4).sin()).powi(2))).sqrt()) - * ((acc_vel * lab + PI * 0.4).sin()); let (move1base, move2base, move3) = match stage_section { Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), Some(StageSection::Action) => (1.0, anim_time, 0.0), @@ -64,108 +55,19 @@ impl Animation for BetaAnimation { let move1 = move1base * pullback; let move2 = move2base * pullback; - next.shoulder_l.position = Vec3::new( - -s_a.shoulder.0, - s_a.shoulder.1, - s_a.shoulder.2 - foothorir * 1.0, - ); - next.shoulder_l.orientation = - Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotr * -0.2) * speednorm); + let speed = Vec2::::from(velocity).magnitude(); - next.shoulder_r.position = Vec3::new( - s_a.shoulder.0, - s_a.shoulder.1, - s_a.shoulder.2 - foothoril * 1.0, - ); - next.shoulder_r.orientation = - Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotl * -0.2) * speednorm); - next.torso.orientation = Quaternion::rotation_z(0.0); - - next.main.position = Vec3::new(0.0, 0.0, 0.0); - next.main.orientation = Quaternion::rotation_x(0.0); - - next.hand_l.position = Vec3::new(0.0, 0.0, s_a.grip.0); - next.hand_r.position = Vec3::new(0.0, 0.0, s_a.grip.0); - - next.hand_l.orientation = Quaternion::rotation_x(0.0); - next.hand_r.orientation = Quaternion::rotation_x(0.0); + init_biped_large_beta(&mut next, s_a, speed, acc_vel, move1); match active_tool_kind { Some(ToolKind::Sword) => { - next.control_l.position = Vec3::new(-1.0, 1.0, 1.0); - next.control_r.position = Vec3::new(0.0, 2.0, -3.0); - next.head.orientation = Quaternion::rotation_x(move1 * -0.25) - * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); - next.control.position = Vec3::new( - -3.0 + move1 * -4.0 + move2 * 5.0, - 5.0 + s_a.grip.0 / 1.2 + move1 * -4.0 + move2 * 8.0, - -4.0 + -s_a.grip.0 / 2.0 + move2 * -5.0, - ); - next.upper_torso.orientation = - Quaternion::rotation_z(move1base * 0.5 + move2 * -0.7); - next.lower_torso.orientation = - Quaternion::rotation_z(move1base * -0.5 + move2 * 0.7); - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0 + move1 * -0.5 + move2 * 1.5) - * Quaternion::rotation_y(-0.2); - next.control_r.orientation = - Quaternion::rotation_x(PI / 2.2 + move1 * -0.5 + move2 * 1.5) - * Quaternion::rotation_y(0.2) - * Quaternion::rotation_z(0.0); - - next.control.orientation = - Quaternion::rotation_x(-0.2 + move1 * 0.5 + move2 * -1.5) - * Quaternion::rotation_y(-0.1 + move1 * -0.5 + move2 * 1.0); + biped_large_beta_sword(&mut next, s_a, move1base, move1, move2); }, Some(ToolKind::Hammer) => { - next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); - next.control_r.position = Vec3::new(1.0, 2.0, -2.0); - - next.control.position = Vec3::new( - 4.0 + move1 * -12.0 + move2 * 20.0, - (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * 5.0, - (-s_a.grip.0 / 0.8) + move1 * 6.0 + move2 * 8.0, - ); - next.head.orientation = Quaternion::rotation_x(move1 * -0.25) - * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); - next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.6 + move2 * -1.5); - next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.6 + move2 * 1.5); - - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - - next.control.orientation = - Quaternion::rotation_x(-1.0 + move1 * -1.5 + move2 * -0.3) - * Quaternion::rotation_y(-1.8 + move1 * -0.8 + move2 * 3.0) - * Quaternion::rotation_z(move1 * -0.8 + move2 * -0.8); + biped_large_beta_hammer(&mut next, s_a, move1, move2); }, Some(ToolKind::Axe) => { - next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); - next.control_r.position = Vec3::new(1.0, 2.0, -2.0); - - next.control.position = Vec3::new( - 4.0 + move1 * -18.0 + move2 * 20.0, - (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * 12.0, - (-s_a.grip.0 / 0.8) + move1 * -2.0 + move2 * 4.0, - ); - next.head.orientation = Quaternion::rotation_x(move1 * -0.25) - * Quaternion::rotation_z(move1 * -0.9 + move2 * 0.6); - next.upper_torso.orientation = Quaternion::rotation_z(move1 * 1.2 + move2 * -1.0); - next.lower_torso.orientation = Quaternion::rotation_z(move1 * -1.2 + move2 * 1.0); - - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - - next.control.orientation = - Quaternion::rotation_x(-1.0 + move1 * 0.0 + move2 * -0.8) - * Quaternion::rotation_y(-1.8 + move1 * 3.0 + move2 * -0.9) - * Quaternion::rotation_z(move1 * -0.2 + move2 * -1.5); + biped_large_beta_axe(&mut next, s_a, move1, move2); }, Some(ToolKind::Natural) => match ability_id { Some("common.abilities.custom.wendigomagic.singlestrike") => { diff --git a/voxygen/anim/src/biped_large/combomelee.rs b/voxygen/anim/src/biped_large/combomelee.rs index f5255e2450..2629238eab 100644 --- a/voxygen/anim/src/biped_large/combomelee.rs +++ b/voxygen/anim/src/biped_large/combomelee.rs @@ -1,5 +1,7 @@ use super::{ super::{vek::*, Animation}, + biped_large_alpha_axe, biped_large_alpha_hammer, biped_large_alpha_sword, biped_large_beta_axe, + biped_large_beta_hammer, biped_large_beta_sword, init_biped_large_alpha, init_biped_large_beta, BipedLargeSkeleton, SkeletonAttr, }; use common::states::utils::{AbilityInfo, StageSection}; @@ -13,6 +15,8 @@ impl Animation for ComboAnimation { Option, usize, Vec2, + Vec3, + f32, ); type Skeleton = BipedLargeSkeleton; @@ -22,7 +26,7 @@ impl Animation for ComboAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_combo")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (ability_id, stage_section, _ability_info, current_strike, _move_dir): Self::Dependency<'_>, + (ability_id, stage_section, _ability_info, current_strike, _move_dir, velocity, acc_vel): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, @@ -108,6 +112,114 @@ impl Animation for ComboAnimation { _ => {}, } }, + Some( + "common.abilities.custom.cyclops.doublestrike" + | "common.abilities.hammersimple.doublestrike", + ) => { + let speed = Vec2::::from(velocity).magnitude(); + match strike { + 0 => { + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1 = move1base * pullback; + let move2 = move2base * pullback; + + init_biped_large_alpha(&mut next, s_a, speed, acc_vel, move1); + biped_large_alpha_hammer(&mut next, s_a, move1, move2); + }, + 1 => { + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(6)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1 = move1base * pullback; + let move2 = move2base * pullback; + + init_biped_large_beta(&mut next, s_a, speed, acc_vel, move1); + biped_large_beta_hammer(&mut next, s_a, move1, move2); + }, + _ => {}, + } + }, + Some( + "common.abilities.custom.dullahan.melee" + | "common.abilities.swordsimple.doublestrike", + ) => { + let speed = Vec2::::from(velocity).magnitude(); + match strike { + 0 => { + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1 = move1base * pullback; + let move2 = move2base * pullback; + + init_biped_large_alpha(&mut next, s_a, speed, acc_vel, move1); + biped_large_alpha_sword(&mut next, s_a, move1, move2); + }, + 1 => { + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(6)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1 = move1base * pullback; + let move2 = move2base * pullback; + + init_biped_large_beta(&mut next, s_a, speed, acc_vel, move1); + biped_large_beta_sword(&mut next, s_a, move1base, move1, move2); + }, + _ => {}, + } + }, + Some("common.abilities.custom.oni.doublestrike") => { + let speed = Vec2::::from(velocity).magnitude(); + match strike { + 0 => { + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1 = move1base * pullback; + let move2 = move2base * pullback; + + init_biped_large_alpha(&mut next, s_a, speed, acc_vel, move1); + biped_large_alpha_axe(&mut next, s_a, move1, move2); + }, + 1 => { + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(6)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1 = move1base * pullback; + let move2 = move2base * pullback; + + init_biped_large_beta(&mut next, s_a, speed, acc_vel, move1); + biped_large_beta_axe(&mut next, s_a, move1, move2); + }, + _ => {}, + } + }, _ => {}, } } diff --git a/voxygen/anim/src/biped_large/mod.rs b/voxygen/anim/src/biped_large/mod.rs index cd4f435069..d851f0e4a6 100644 --- a/voxygen/anim/src/biped_large/mod.rs +++ b/voxygen/anim/src/biped_large/mod.rs @@ -633,3 +633,268 @@ fn mount_point(body: &Body) -> Vec3 { } .into() } + +pub fn init_biped_large_alpha( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + speed: f32, + acc_vel: f32, + move1: f32, +) -> f32 { + let lab: f32 = 0.65 * s_a.tempo; + let speednorm = (speed / 12.0).powf(0.4); + let foothoril = (acc_vel * lab + PI * 1.45).sin() * speednorm; + let foothorir = (acc_vel * lab + PI * (0.45)).sin() * speednorm; + let footrotl = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 1.4).sin()).powi(2))).sqrt()) + * ((acc_vel * lab + PI * 1.4).sin()); + + let footrotr = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 0.4).sin()).powi(2))).sqrt()) + * ((acc_vel * lab + PI * 0.4).sin()); + next.second.position = Vec3::new(0.0, 0.0, 0.0); + next.second.orientation = Quaternion::rotation_x(0.0); + next.shoulder_l.position = Vec3::new( + -s_a.shoulder.0, + s_a.shoulder.1, + s_a.shoulder.2 - foothorir * 1.0, + ); + next.shoulder_l.orientation = + Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotr * -0.2) * speednorm); + + next.shoulder_r.position = Vec3::new( + s_a.shoulder.0, + s_a.shoulder.1, + s_a.shoulder.2 - foothoril * 1.0, + ); + next.shoulder_r.orientation = + Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotl * -0.2) * speednorm); + + next.main.position = Vec3::new(0.0, 0.0, 0.0); + next.main.orientation = Quaternion::rotation_x(0.0); + + next.hand_l.position = Vec3::new(0.0, 0.0, s_a.grip.0); + next.hand_r.position = Vec3::new(0.0, 0.0, s_a.grip.0); + + next.hand_l.orientation = Quaternion::rotation_x(0.0); + next.hand_r.orientation = Quaternion::rotation_x(0.0); + + foothorir +} + +pub fn init_biped_large_beta( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + speed: f32, + acc_vel: f32, + move1: f32, +) { + let lab: f32 = 0.65 * s_a.tempo; + let speednorm = (speed / 12.0).powf(0.4); + let foothoril = (acc_vel * lab + PI * 1.45).sin() * speednorm; + let foothorir = (acc_vel * lab + PI * (0.45)).sin() * speednorm; + let footrotl = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 1.4).sin()).powi(2))).sqrt()) + * ((acc_vel * lab + PI * 1.4).sin()); + + let footrotr = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 0.4).sin()).powi(2))).sqrt()) + * ((acc_vel * lab + PI * 0.4).sin()); + + next.shoulder_l.position = Vec3::new( + -s_a.shoulder.0, + s_a.shoulder.1, + s_a.shoulder.2 - foothorir * 1.0, + ); + next.shoulder_l.orientation = + Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotr * -0.2) * speednorm); + + next.shoulder_r.position = Vec3::new( + s_a.shoulder.0, + s_a.shoulder.1, + s_a.shoulder.2 - foothoril * 1.0, + ); + next.shoulder_r.orientation = + Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotl * -0.2) * speednorm); + next.torso.orientation = Quaternion::rotation_z(0.0); + + next.main.position = Vec3::new(0.0, 0.0, 0.0); + next.main.orientation = Quaternion::rotation_x(0.0); + + next.hand_l.position = Vec3::new(0.0, 0.0, s_a.grip.0); + next.hand_r.position = Vec3::new(0.0, 0.0, s_a.grip.0); + + next.hand_l.orientation = Quaternion::rotation_x(0.0); + next.hand_r.orientation = Quaternion::rotation_x(0.0); +} + +pub fn biped_large_alpha_hammer( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + move1: f32, + move2: f32, +) { + next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); + next.control_r.position = Vec3::new(1.0, 2.0, -2.0); + + next.control.position = Vec3::new( + 4.0 + move1 * -12.0 + move2 * 20.0, + (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * 5.0, + (-s_a.grip.0 / 0.8) + move1 * -2.0 + move2 * 8.0, + ); + next.head.orientation = + Quaternion::rotation_x(move1 * -0.25) * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); + next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.2 + move2 * -0.4); + next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.2 + move2 * 0.2); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); + + next.control.orientation = Quaternion::rotation_x(-1.0 + move1 * -0.5 + move2 * -0.3) + * Quaternion::rotation_y(-1.8 + move1 * -0.8 + move2 * 3.0) + * Quaternion::rotation_z(move1 * -0.8 + move2 * -0.8); +} + +pub fn biped_large_beta_hammer( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + move1: f32, + move2: f32, +) { + next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); + next.control_r.position = Vec3::new(1.0, 2.0, -2.0); + + next.control.position = Vec3::new( + 4.0 + move1 * -12.0 + move2 * 20.0, + (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * 5.0, + (-s_a.grip.0 / 0.8) + move1 * 6.0 + move2 * 8.0, + ); + next.head.orientation = + Quaternion::rotation_x(move1 * -0.25) * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); + next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.6 + move2 * -1.5); + next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.6 + move2 * 1.5); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); + + next.control.orientation = Quaternion::rotation_x(-1.0 + move1 * -1.5 + move2 * -0.3) + * Quaternion::rotation_y(-1.8 + move1 * -0.8 + move2 * 3.0) + * Quaternion::rotation_z(move1 * -0.8 + move2 * -0.8); +} + +pub fn biped_large_alpha_sword( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + move1: f32, + move2: f32, +) { + next.control_l.position = Vec3::new(-1.0, 1.0, 1.0); + next.control_r.position = Vec3::new(0.0, 2.0, -3.0); + next.head.orientation = + Quaternion::rotation_x(move1 * -0.25) * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); + next.control.position = Vec3::new( + -3.0 + move1 * -4.0 + move2 * 5.0, + 5.0 + s_a.grip.0 / 1.2 + move1 * -4.0 + move2 * 8.0, + -4.0 + -s_a.grip.0 / 2.0 + move2 * -5.0, + ); + next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.5 + move2 * -0.7); + next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.5 + move2 * 0.7); + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0 + move1 * -0.5 + move2 * 1.5) + * Quaternion::rotation_y(-0.2); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.2 + move1 * -0.5 + move2 * 1.5) + * Quaternion::rotation_y(0.2) + * Quaternion::rotation_z(0.0); + + next.control.orientation = Quaternion::rotation_x(-0.2 + move1 * 0.5 + move2 * -2.0) + * Quaternion::rotation_y(-0.1 + move1 * -0.5 + move2 * 1.0); +} + +pub fn biped_large_beta_sword( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + move1base: f32, + move1: f32, + move2: f32, +) { + next.control_l.position = Vec3::new(-1.0, 1.0, 1.0); + next.control_r.position = Vec3::new(0.0, 2.0, -3.0); + next.head.orientation = + Quaternion::rotation_x(move1 * -0.25) * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); + next.control.position = Vec3::new( + -3.0 + move1 * -4.0 + move2 * 5.0, + 5.0 + s_a.grip.0 / 1.2 + move1 * -4.0 + move2 * 8.0, + -4.0 + -s_a.grip.0 / 2.0 + move2 * -5.0, + ); + next.upper_torso.orientation = Quaternion::rotation_z(move1base * 0.5 + move2 * -0.7); + next.lower_torso.orientation = Quaternion::rotation_z(move1base * -0.5 + move2 * 0.7); + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0 + move1 * -0.5 + move2 * 1.5) + * Quaternion::rotation_y(-0.2); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.2 + move1 * -0.5 + move2 * 1.5) + * Quaternion::rotation_y(0.2) + * Quaternion::rotation_z(0.0); + + next.control.orientation = Quaternion::rotation_x(-0.2 + move1 * 0.5 + move2 * -1.5) + * Quaternion::rotation_y(-0.1 + move1 * -0.5 + move2 * 1.0); +} + +pub fn biped_large_alpha_axe( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + move1: f32, + move2: f32, +) { + next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); + next.control_r.position = Vec3::new(1.0, 2.0, -2.0); + + next.control.position = Vec3::new( + 4.0 + move1 * -12.0 + move2 * 28.0, + (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * -5.0, + (-s_a.grip.0 / 0.8) + move1 * 2.0 + move2 * 8.0, + ); + next.head.orientation = + Quaternion::rotation_x(move1 * -0.25) * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); + next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.6 + move2 * -0.9); + next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.6 + move2 * 0.9); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); + + next.control.orientation = Quaternion::rotation_x(-1.0 + move1 * -0.5 + move2 * -0.3) + * Quaternion::rotation_y(-1.8 + move1 * -0.4 + move2 * 3.5) + * Quaternion::rotation_z(move1 * -1.0 + move2 * -1.5); +} + +pub fn biped_large_beta_axe( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + move1: f32, + move2: f32, +) { + next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); + next.control_r.position = Vec3::new(1.0, 2.0, -2.0); + + next.control.position = Vec3::new( + 4.0 + move1 * -18.0 + move2 * 20.0, + (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * 12.0, + (-s_a.grip.0 / 0.8) + move1 * -2.0 + move2 * 4.0, + ); + next.head.orientation = + Quaternion::rotation_x(move1 * -0.25) * Quaternion::rotation_z(move1 * -0.9 + move2 * 0.6); + next.upper_torso.orientation = Quaternion::rotation_z(move1 * 1.2 + move2 * -1.0); + next.lower_torso.orientation = Quaternion::rotation_z(move1 * -1.2 + move2 * 1.0); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); + + next.control.orientation = Quaternion::rotation_x(-1.0 + move1 * 0.0 + move2 * -0.8) + * Quaternion::rotation_y(-1.8 + move1 * 3.0 + move2 * -0.9) + * Quaternion::rotation_z(move1 * -0.2 + move2 * -1.5); +} diff --git a/voxygen/anim/src/biped_small/alpha.rs b/voxygen/anim/src/biped_small/alpha.rs index 3c1effd0b6..874b75cb0d 100644 --- a/voxygen/anim/src/biped_small/alpha.rs +++ b/voxygen/anim/src/biped_small/alpha.rs @@ -1,6 +1,7 @@ use super::{ super::{vek::*, Animation}, - BipedSmallSkeleton, SkeletonAttr, + biped_small_alpha_axe, biped_small_alpha_dagger, biped_small_alpha_spear, + init_biped_small_alpha, BipedSmallSkeleton, SkeletonAttr, }; use common::{comp::item::ToolKind, states::utils::StageSection}; use std::f32::consts::PI; @@ -49,12 +50,12 @@ impl Animation for AlphaAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); let speed = Vec2::::from(velocity).magnitude(); + let speednorm = speed / 9.4; + let speednormcancel = 1.0 - speednorm; let fast = (anim_time * 10.0).sin(); let fastalt = (anim_time * 10.0 + PI / 2.0).sin(); - let speednorm = speed / 9.4; - let speednormcancel = 1.0 - speednorm; let anim_time = anim_time.min(1.0); let (move1base, move2base, move3) = match stage_section { Some(StageSection::Buildup) => (anim_time.sqrt(), 0.0, 0.0), @@ -70,105 +71,26 @@ impl Animation for AlphaAnimation { let move2 = move2base * pullback * mirror; let move1abs = move1base * pullback; let move2abs = move2base * pullback; - next.hand_l.position = Vec3::new(s_a.grip.0 * 4.0, 0.0, s_a.grip.2); - next.hand_r.position = Vec3::new(-s_a.grip.0 * 4.0, 0.0, s_a.grip.2); - next.main.position = Vec3::new(0.0, 0.0, 0.0); - next.main.orientation = Quaternion::rotation_x(0.0); - next.hand_l.orientation = Quaternion::rotation_x(0.0); - next.hand_r.orientation = Quaternion::rotation_x(0.0); + + init_biped_small_alpha(&mut next, s_a); + match active_tool_kind { Some(ToolKind::Spear) => { - next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); - next.head.orientation = Quaternion::rotation_x(move1abs * 0.2 + move2abs * 0.3) - * Quaternion::rotation_z(move1abs * -0.2 + move2abs * 0.6) - * Quaternion::rotation_y(move1abs * 0.3 + move2abs * -0.5); - next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1); - next.chest.orientation = Quaternion::rotation_x(move1abs * -0.2 + move2abs * 0.3) - * Quaternion::rotation_z(move1abs * 0.5 + move2abs * -0.6); - - next.pants.position = Vec3::new(0.0, s_a.pants.0, s_a.pants.1); - next.pants.orientation = Quaternion::rotation_x(move1abs * 0.2 + move2abs * -0.3) - * Quaternion::rotation_z(move1abs * -0.2 + move2abs * 0.2); - - next.control_l.position = Vec3::new(1.0 - s_a.grip.0 * 2.0, 2.0, -2.0); - next.control_r.position = Vec3::new(-1.0 + s_a.grip.0 * 2.0, 2.0, 2.0); - - next.control.position = Vec3::new( - -3.0 + move1abs * -3.0 + move2abs * 5.0, - s_a.grip.2 + move1abs * -12.0 + move2abs * 17.0, - -s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0 + move2abs * 5.0, + biped_small_alpha_spear( + &mut next, + s_a, + move1abs, + move2abs, + fast, + fastalt, + speednormcancel, ); - - next.control_l.orientation = - Quaternion::rotation_x(PI / 1.5 + move1abs * -1.5 + move2abs * 2.5) - * Quaternion::rotation_y(-0.3); - next.control_r.orientation = Quaternion::rotation_x( - PI / 1.5 + s_a.grip.0 * 0.2 + move1abs * -1.5 + move2abs * 2.5, - ) * Quaternion::rotation_y(0.5 + s_a.grip.0 * 0.2); - - next.control.orientation = - Quaternion::rotation_x(-1.35 + move1abs * -0.3 + move2abs * 0.5) - * Quaternion::rotation_z(move1abs * 1.0 + move2abs * -1.0) - * Quaternion::rotation_y(move2abs * 0.0); - - next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1); - next.tail.orientation = Quaternion::rotation_x(0.05 * fastalt * speednormcancel) - * Quaternion::rotation_z(fast * 0.15 * speednormcancel); }, Some(ToolKind::Axe | ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => { - next.head.orientation = Quaternion::rotation_z(move1abs * 0.3 + move2abs * -0.6); - next.control_l.position = Vec3::new(2.0 - s_a.grip.0 * 2.0, 1.0, 3.0); - next.control_r.position = Vec3::new( - 9.0 + move1abs * -10.0 + s_a.grip.0 * 2.0, - -1.0 + move1abs * 2.0, - move1abs * 3.0 - 2.0, - ); - - next.control.position = Vec3::new( - -5.0 + move1abs * 5.0, - -1.0 + s_a.grip.2, - -1.0 + move1abs * 3.0 + -s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0, - ); - - next.control_l.orientation = Quaternion::rotation_x(PI / 2.0 + move2abs * 1.0) - * Quaternion::rotation_y(-0.0) - * Quaternion::rotation_z(-0.0); - next.control_r.orientation = - Quaternion::rotation_x(0.5 + move1abs * 1.5 + s_a.grip.0 * 0.2) - * Quaternion::rotation_y(0.2 + s_a.grip.0 * 0.2) - * Quaternion::rotation_z(-0.0); - - next.control.orientation = Quaternion::rotation_x(-0.3 + move2abs * -1.0) - * Quaternion::rotation_y(move1abs * -0.9 + move2abs * 2.0) - * Quaternion::rotation_z(-0.3); + biped_small_alpha_axe(&mut next, s_a, move1abs, move2abs); }, Some(ToolKind::Dagger) => { - next.head.orientation = Quaternion::rotation_x(move1abs * 0.15 + move2abs * -0.15) - * Quaternion::rotation_z(move1abs * 0.15 + move2abs * -0.3); - next.control_l.position = Vec3::new(2.0 - s_a.grip.0 * 2.0, 1.0, 3.0); - next.control_r.position = Vec3::new( - 9.0 + move1abs * -7.0 + s_a.grip.0 * 2.0, - -1.0 + move1abs * 6.0, - -2.0, - ); - - next.control.position = Vec3::new( - -5.0 + move1abs * 5.0 + move2abs * 9.0, - -1.0 + move2abs * -3.0 + s_a.grip.2, - -1.0 + move1abs * 3.0 + -s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0, - ); - - next.control_l.orientation = Quaternion::rotation_x(PI / 2.0) - * Quaternion::rotation_y(-0.0) - * Quaternion::rotation_z(-0.0); - next.control_r.orientation = - Quaternion::rotation_x(0.5 + move1abs * 1.5 + s_a.grip.0 * 0.2) - * Quaternion::rotation_y(0.2 + s_a.grip.0 * 0.2) - * Quaternion::rotation_z(-0.0); - - next.control.orientation = Quaternion::rotation_x(-0.3 + move2abs * -1.0) - * Quaternion::rotation_y(move1abs * -0.4 + move2abs * 1.0) - * Quaternion::rotation_z(-0.3 + move2abs * -2.2); + biped_small_alpha_dagger(&mut next, s_a, move1abs, move2abs); }, Some(ToolKind::Staff) => match ability_id { Some("common.abilities.custom.dwarves.flamekeeper.flamecrush") => { diff --git a/voxygen/anim/src/biped_small/combomelee.rs b/voxygen/anim/src/biped_small/combomelee.rs index e8c546513b..8a0ff7cbe8 100644 --- a/voxygen/anim/src/biped_small/combomelee.rs +++ b/voxygen/anim/src/biped_small/combomelee.rs @@ -1,18 +1,14 @@ use super::{ super::{vek::*, Animation}, - BipedSmallSkeleton, SkeletonAttr, + biped_small_alpha_axe, biped_small_alpha_dagger, biped_small_alpha_spear, + init_biped_small_alpha, BipedSmallSkeleton, SkeletonAttr, }; -use common::states::utils::{AbilityInfo, StageSection}; +use common::states::utils::StageSection; +use std::f32::consts::PI; pub struct ComboAnimation; impl Animation for ComboAnimation { - type Dependency<'a> = ( - Option<&'a str>, - Option, - Option, - usize, - Vec2, - ); + type Dependency<'a> = (Option<&'a str>, StageSection, usize, Vec3, f32, f32); type Skeleton = BipedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -21,7 +17,7 @@ impl Animation for ComboAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_combo")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (ability_id, stage_section, _ability_info, current_strike, _move_dir): Self::Dependency<'_>, + (ability_id, stage_section, current_strike, velocity, _global_time, _timer): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, @@ -32,7 +28,7 @@ impl Animation for ComboAnimation { next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_z(0.0); let multi_strike_pullback = 1.0 - - if matches!(stage_section, Some(StageSection::Recover)) { + - if matches!(stage_section, StageSection::Recover) { anim_time.powi(4) } else { 0.0 @@ -50,11 +46,11 @@ impl Animation for ComboAnimation { ) => { let (move1, move2) = if strike == current_strike { match stage_section { - Some(StageSection::Buildup) => { + StageSection::Buildup => { (((anim_time.max(0.4) - 0.4) * 1.5).powf(0.5), 0.0) }, - Some(StageSection::Action) => (1.0, (anim_time.min(0.4) * 2.5).powi(2)), - Some(StageSection::Recover) => (1.0, 1.0), + StageSection::Action => (1.0, (anim_time.min(0.4) * 2.5).powi(2)), + StageSection::Recover => (1.0, 1.0), _ => (0.0, 0.0), } } else { @@ -81,6 +77,68 @@ impl Animation for ComboAnimation { _ => {}, } }, + Some( + "common.abilities.axesimple.doublestrike" + | "common.abilities.custom.boreal_warrior.hammer", + ) => { + let anim_time = anim_time.min(1.0); + let (move1base, move2base, move3) = match stage_section { + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1abs = move1base * pullback; + let move2abs = move2base * pullback; + + init_biped_small_alpha(&mut next, s_a); + biped_small_alpha_axe(&mut next, s_a, move1abs, move2abs); + }, + Some("common.abilities.daggersimple.singlestrike") => { + let anim_time = anim_time.min(1.0); + let (move1base, move2base, move3) = match stage_section { + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1abs = move1base * pullback; + let move2abs = move2base * pullback; + + init_biped_small_alpha(&mut next, s_a); + biped_small_alpha_dagger(&mut next, s_a, move1abs, move2abs); + }, + Some("common.abilities.spear.doublestrike") => { + let anim_time = anim_time.min(1.0); + let speed = Vec2::::from(velocity).magnitude(); + let speednorm = speed / 9.4; + let speednormcancel = 1.0 - speednorm; + let fast = (anim_time * 10.0).sin(); + let fastalt = (anim_time * 10.0 + PI / 2.0).sin(); + + let (move1base, move2base, move3) = match stage_section { + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1abs = move1base * pullback; + let move2abs = move2base * pullback; + + init_biped_small_alpha(&mut next, s_a); + biped_small_alpha_spear( + &mut next, + s_a, + move1abs, + move2abs, + fast, + fastalt, + speednormcancel, + ); + }, _ => {}, } } diff --git a/voxygen/anim/src/biped_small/mod.rs b/voxygen/anim/src/biped_small/mod.rs index 893b8ec20c..ead28a2d8f 100644 --- a/voxygen/anim/src/biped_small/mod.rs +++ b/voxygen/anim/src/biped_small/mod.rs @@ -22,6 +22,7 @@ pub use self::{ use super::{make_bone, vek::*, FigureBoneData, Offsets, Skeleton}; use common::comp::{self}; use core::convert::TryFrom; +use std::f32::consts::PI; pub type Body = comp::biped_small::Body; @@ -280,3 +281,123 @@ impl<'a> From<&'a Body> for SkeletonAttr { } } } + +pub fn init_biped_small_alpha(next: &mut BipedSmallSkeleton, s_a: &SkeletonAttr) { + next.hand_l.position = Vec3::new(s_a.grip.0 * 4.0, 0.0, s_a.grip.2); + next.hand_r.position = Vec3::new(-s_a.grip.0 * 4.0, 0.0, s_a.grip.2); + next.main.position = Vec3::new(0.0, 0.0, 0.0); + next.main.orientation = Quaternion::rotation_x(0.0); + next.hand_l.orientation = Quaternion::rotation_x(0.0); + next.hand_r.orientation = Quaternion::rotation_x(0.0); +} + +pub fn biped_small_alpha_spear( + next: &mut BipedSmallSkeleton, + s_a: &SkeletonAttr, + move1abs: f32, + move2abs: f32, + fast: f32, + fastalt: f32, + speednormcancel: f32, +) { + next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); + next.head.orientation = Quaternion::rotation_x(move1abs * 0.2 + move2abs * 0.3) + * Quaternion::rotation_z(move1abs * -0.2 + move2abs * 0.6) + * Quaternion::rotation_y(move1abs * 0.3 + move2abs * -0.5); + next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1); + next.chest.orientation = Quaternion::rotation_x(move1abs * -0.2 + move2abs * 0.3) + * Quaternion::rotation_z(move1abs * 0.5 + move2abs * -0.6); + + next.pants.position = Vec3::new(0.0, s_a.pants.0, s_a.pants.1); + next.pants.orientation = Quaternion::rotation_x(move1abs * 0.2 + move2abs * -0.3) + * Quaternion::rotation_z(move1abs * -0.2 + move2abs * 0.2); + + next.control_l.position = Vec3::new(1.0 - s_a.grip.0 * 2.0, 2.0, -2.0); + next.control_r.position = Vec3::new(-1.0 + s_a.grip.0 * 2.0, 2.0, 2.0); + + next.control.position = Vec3::new( + -3.0 + move1abs * -3.0 + move2abs * 5.0, + s_a.grip.2 + move1abs * -12.0 + move2abs * 17.0, + -s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0 + move2abs * 5.0, + ); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 1.5 + move1abs * -1.5 + move2abs * 2.5) + * Quaternion::rotation_y(-0.3); + next.control_r.orientation = + Quaternion::rotation_x(PI / 1.5 + s_a.grip.0 * 0.2 + move1abs * -1.5 + move2abs * 2.5) + * Quaternion::rotation_y(0.5 + s_a.grip.0 * 0.2); + + next.control.orientation = Quaternion::rotation_x(-1.35 + move1abs * -0.3 + move2abs * 0.5) + * Quaternion::rotation_z(move1abs * 1.0 + move2abs * -1.0) + * Quaternion::rotation_y(move2abs * 0.0); + + next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1); + next.tail.orientation = Quaternion::rotation_x(0.05 * fastalt * speednormcancel) + * Quaternion::rotation_z(fast * 0.15 * speednormcancel); +} + +pub fn biped_small_alpha_axe( + next: &mut BipedSmallSkeleton, + s_a: &SkeletonAttr, + move1abs: f32, + move2abs: f32, +) { + next.head.orientation = Quaternion::rotation_z(move1abs * 0.3 + move2abs * -0.6); + next.control_l.position = Vec3::new(2.0 - s_a.grip.0 * 2.0, 1.0, 3.0); + next.control_r.position = Vec3::new( + 9.0 + move1abs * -10.0 + s_a.grip.0 * 2.0, + -1.0 + move1abs * 2.0, + move1abs * 3.0 - 2.0, + ); + + next.control.position = Vec3::new( + -5.0 + move1abs * 5.0, + -1.0 + s_a.grip.2, + -1.0 + move1abs * 3.0 + -s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0, + ); + + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0 + move2abs * 1.0) + * Quaternion::rotation_y(-0.0) + * Quaternion::rotation_z(-0.0); + next.control_r.orientation = Quaternion::rotation_x(0.5 + move1abs * 1.5 + s_a.grip.0 * 0.2) + * Quaternion::rotation_y(0.2 + s_a.grip.0 * 0.2) + * Quaternion::rotation_z(-0.0); + + next.control.orientation = Quaternion::rotation_x(-0.3 + move2abs * -1.0) + * Quaternion::rotation_y(move1abs * -0.9 + move2abs * 2.0) + * Quaternion::rotation_z(-0.3); +} + +pub fn biped_small_alpha_dagger( + next: &mut BipedSmallSkeleton, + s_a: &SkeletonAttr, + move1abs: f32, + move2abs: f32, +) { + next.head.orientation = Quaternion::rotation_x(move1abs * 0.15 + move2abs * -0.15) + * Quaternion::rotation_z(move1abs * 0.15 + move2abs * -0.3); + next.control_l.position = Vec3::new(2.0 - s_a.grip.0 * 2.0, 1.0, 3.0); + next.control_r.position = Vec3::new( + 9.0 + move1abs * -7.0 + s_a.grip.0 * 2.0, + -1.0 + move1abs * 6.0, + -2.0, + ); + + next.control.position = Vec3::new( + -5.0 + move1abs * 5.0 + move2abs * 9.0, + -1.0 + move2abs * -3.0 + s_a.grip.2, + -1.0 + move1abs * 3.0 + -s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0, + ); + + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0) + * Quaternion::rotation_y(-0.0) + * Quaternion::rotation_z(-0.0); + next.control_r.orientation = Quaternion::rotation_x(0.5 + move1abs * 1.5 + s_a.grip.0 * 0.2) + * Quaternion::rotation_y(0.2 + s_a.grip.0 * 0.2) + * Quaternion::rotation_z(-0.0); + + next.control.orientation = Quaternion::rotation_x(-0.3 + move2abs * -1.0) + * Quaternion::rotation_y(move1abs * -0.4 + move2abs * 1.0) + * Quaternion::rotation_z(-0.3 + move2abs * -2.2); +} diff --git a/voxygen/anim/src/golem/combomelee.rs b/voxygen/anim/src/golem/combomelee.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/voxygen/anim/src/quadruped_low/alpha.rs b/voxygen/anim/src/quadruped_low/alpha.rs deleted file mode 100644 index 3633c95869..0000000000 --- a/voxygen/anim/src/quadruped_low/alpha.rs +++ /dev/null @@ -1,60 +0,0 @@ -use super::{ - super::{vek::*, Animation}, - QuadrupedLowSkeleton, SkeletonAttr, -}; -use common::states::utils::StageSection; -//use std::ops::Rem; - -pub struct AlphaAnimation; - -impl Animation for AlphaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); - type Skeleton = QuadrupedLowSkeleton; - - #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"quadruped_low_alpha\0"; - - #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_alpha")] - fn update_skeleton_inner( - skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency<'_>, - anim_time: f32, - _rate: &mut f32, - _s_a: &SkeletonAttr, - ) -> Self::Skeleton { - let mut next = (*skeleton).clone(); - - let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.sqrt(), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), - _ => (0.0, 0.0, 0.0), - }; - let pullback = 1.0 - movement3; - let subtract = global_time - timer; - let check = subtract - subtract.trunc(); - let mirror = (check - 0.5).signum(); - let twitch3 = (mirror * movement3 * 9.0).sin(); - let movement1 = mirror * movement1base * pullback; - let movement2 = mirror * movement2base * pullback; - let movement1abs = movement1base * pullback; - let movement2abs = movement2base * pullback; - - next.head_upper.orientation = Quaternion::rotation_z(twitch3 * -0.7); - - next.head_lower.orientation = - Quaternion::rotation_x(movement1abs * 0.35 + movement2abs * -0.9) - * Quaternion::rotation_y(movement1 * 0.7 + movement2 * -1.0); - - next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * 0.5); - next.chest.orientation = Quaternion::rotation_y(movement1 * -0.08 + movement2 * 0.15) - * Quaternion::rotation_z(movement1 * -0.2 + movement2 * 0.6); - - next.tail_front.orientation = Quaternion::rotation_x(0.15) - * Quaternion::rotation_z(movement1 * -0.4 + movement2 * -0.2); - - next.tail_rear.orientation = Quaternion::rotation_x(-0.12) - * Quaternion::rotation_z(movement1 * -0.4 + movement2 * -0.2); - next - } -} diff --git a/voxygen/anim/src/quadruped_low/beta.rs b/voxygen/anim/src/quadruped_low/beta.rs index 70dd80948c..287c252d0b 100644 --- a/voxygen/anim/src/quadruped_low/beta.rs +++ b/voxygen/anim/src/quadruped_low/beta.rs @@ -1,14 +1,11 @@ -use super::{ - super::{vek::*, Animation}, - QuadrupedLowSkeleton, SkeletonAttr, -}; +use super::{super::Animation, quadruped_low_beta, QuadrupedLowSkeleton, SkeletonAttr}; use common::states::utils::StageSection; //use std::ops::Rem; pub struct BetaAnimation; impl Animation for BetaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, StageSection, f32); type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -20,41 +17,12 @@ impl Animation for BetaAnimation { (_velocity, global_time, stage_section, timer): Self::Dependency<'_>, anim_time: f32, _rate: &mut f32, - _s_a: &SkeletonAttr, + s_a: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.sqrt(), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), - _ => (0.0, 0.0, 0.0), - }; - let pullback = 1.0 - movement3; - let subtract = global_time - timer; - let check = subtract - subtract.trunc(); - let mirror = (check - 0.5).signum(); - let twitch3 = (mirror * movement3 * 9.0).sin(); - let movement1 = mirror * movement1base * pullback; - let movement2 = mirror * movement2base * pullback; - let movement1abs = movement1base * pullback; - let movement2abs = movement2base * pullback; + quadruped_low_beta(&mut next, s_a, stage_section, anim_time, global_time, timer); - next.head_upper.orientation = Quaternion::rotation_z(twitch3 * 0.2); - - next.head_lower.orientation = - Quaternion::rotation_x(movement1abs * 0.15 + movement2abs * -0.6) - * Quaternion::rotation_y(movement1 * -0.1 + movement2 * 0.15); - - next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.9); - next.chest.orientation = Quaternion::rotation_y(movement1 * 0.08 + movement2 * -0.15) - * Quaternion::rotation_z(movement1 * 0.2 + movement2 * -0.3); - - next.tail_front.orientation = Quaternion::rotation_x(0.15) - * Quaternion::rotation_z(movement1 * 0.4 + movement2 * 0.2); - - next.tail_rear.orientation = Quaternion::rotation_x(-0.12) - * Quaternion::rotation_z(movement1 * 0.4 + movement2 * 0.2); next } } diff --git a/voxygen/anim/src/quadruped_low/combomelee.rs b/voxygen/anim/src/quadruped_low/combomelee.rs index cc874bdea9..81dfd9b709 100644 --- a/voxygen/anim/src/quadruped_low/combomelee.rs +++ b/voxygen/anim/src/quadruped_low/combomelee.rs @@ -1,19 +1,12 @@ use super::{ super::{vek::*, Animation}, - QuadrupedLowSkeleton, SkeletonAttr, + quadruped_low_alpha, quadruped_low_beta, QuadrupedLowSkeleton, SkeletonAttr, }; -use common::states::utils::{AbilityInfo, StageSection}; +use common::states::utils::StageSection; pub struct ComboAnimation; impl Animation for ComboAnimation { - type Dependency<'a> = ( - Option<&'a str>, - Option, - Option, - usize, - f32, - f32, - ); + type Dependency<'a> = (Option<&'a str>, StageSection, usize, f32, f32); type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -22,16 +15,16 @@ impl Animation for ComboAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_combo")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (ability_id, stage_section, _ability_info, current_strike, global_time, timer): Self::Dependency<'_>, + (ability_id, stage_section, current_strike, global_time, timer): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, - _s_a: &SkeletonAttr, + s_a: &SkeletonAttr, ) -> Self::Skeleton { *rate = 1.0; let mut next = (*skeleton).clone(); let _multi_strike_pullback = 1.0 - - if matches!(stage_section, Some(StageSection::Recover)) { + - if matches!(stage_section, StageSection::Recover) { anim_time.powi(4) } else { 0.0 @@ -45,9 +38,9 @@ impl Animation for ComboAnimation { | "common.abilities.custom.driggle.bite", ) => { let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.sqrt(), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), _ => (0.0, 0.0, 0.0), }; let pullback = 1.0 - movement3; @@ -102,6 +95,71 @@ impl Animation for ComboAnimation { _ => {}, } }, + Some( + "common.abilities.custom.asp.singlestrike" + | "comon.abilities.custom.maneater.singlestrike" + | "common.abilities.custom.quadlowbasic.singlestrike", + ) => { + quadruped_low_alpha( + &mut next, + s_a, + stage_section, + anim_time, + global_time, + timer, + ); + }, + Some( + "common.abilities.custom.basilisk.triplestrike" + | "common.abilities.custom.quadlowbasic.triplestrike" + | "common.abilities.custom.quadlowbreathe.triplestrike" + | "common.abilities.custom.quadlowtail.triplestrike", + ) => match strike { + 0 | 2 => { + quadruped_low_alpha( + &mut next, + s_a, + stage_section, + anim_time, + global_time, + timer, + ); + }, + 1 => { + quadruped_low_beta( + &mut next, + s_a, + stage_section, + anim_time, + global_time, + timer, + ); + }, + _ => {}, + }, + Some("common.abilities.custom.quadlowquick.quadstrike") => match strike { + 0 | 2 | 3 => { + quadruped_low_alpha( + &mut next, + s_a, + stage_section, + anim_time, + global_time, + timer, + ); + }, + 1 => { + quadruped_low_beta( + &mut next, + s_a, + stage_section, + anim_time, + global_time, + timer, + ); + }, + _ => {}, + }, _ => {}, } } diff --git a/voxygen/anim/src/quadruped_low/mod.rs b/voxygen/anim/src/quadruped_low/mod.rs index d301aa0655..2c309316b0 100644 --- a/voxygen/anim/src/quadruped_low/mod.rs +++ b/voxygen/anim/src/quadruped_low/mod.rs @@ -1,4 +1,3 @@ -pub mod alpha; pub mod beta; pub mod breathe; pub mod combomelee; @@ -14,14 +13,17 @@ pub mod tailwhip; // Reexports pub use self::{ - alpha::AlphaAnimation, beta::BetaAnimation, breathe::BreatheAnimation, - combomelee::ComboAnimation, dash::DashAnimation, idle::IdleAnimation, jump::JumpAnimation, - run::RunAnimation, shockwave::ShockwaveAnimation, shoot::ShootAnimation, - spritesummon::SpriteSummonAnimation, stunned::StunnedAnimation, tailwhip::TailwhipAnimation, + beta::BetaAnimation, breathe::BreatheAnimation, combomelee::ComboAnimation, + dash::DashAnimation, idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation, + shockwave::ShockwaveAnimation, shoot::ShootAnimation, spritesummon::SpriteSummonAnimation, + stunned::StunnedAnimation, tailwhip::TailwhipAnimation, }; use super::{make_bone, vek::*, FigureBoneData, Offsets, Skeleton}; -use common::comp::{self}; +use common::{ + comp::{self}, + states::utils::StageSection, +}; use core::convert::TryFrom; pub type Body = comp::quadruped_low::Body; @@ -435,3 +437,83 @@ fn mount_point(body: &Body) -> Vec3 { } .into() } + +pub fn quadruped_low_alpha( + next: &mut QuadrupedLowSkeleton, + _s_a: &SkeletonAttr, + stage_section: StageSection, + anim_time: f32, + global_time: f32, + timer: f32, +) { + let (movement1base, movement2base, movement3) = match stage_section { + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - movement3; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum(); + let twitch3 = (mirror * movement3 * 9.0).sin(); + let movement1 = mirror * movement1base * pullback; + let movement2 = mirror * movement2base * pullback; + let movement1abs = movement1base * pullback; + let movement2abs = movement2base * pullback; + + next.head_upper.orientation = Quaternion::rotation_z(twitch3 * -0.7); + + next.head_lower.orientation = Quaternion::rotation_x(movement1abs * 0.35 + movement2abs * -0.9) + * Quaternion::rotation_y(movement1 * 0.7 + movement2 * -1.0); + + next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * 0.5); + next.chest.orientation = Quaternion::rotation_y(movement1 * -0.08 + movement2 * 0.15) + * Quaternion::rotation_z(movement1 * -0.2 + movement2 * 0.6); + + next.tail_front.orientation = + Quaternion::rotation_x(0.15) * Quaternion::rotation_z(movement1 * -0.4 + movement2 * -0.2); + + next.tail_rear.orientation = + Quaternion::rotation_x(-0.12) * Quaternion::rotation_z(movement1 * -0.4 + movement2 * -0.2); +} + +pub fn quadruped_low_beta( + next: &mut QuadrupedLowSkeleton, + _s_a: &SkeletonAttr, + stage_section: StageSection, + anim_time: f32, + global_time: f32, + timer: f32, +) { + let (movement1base, movement2base, movement3) = match stage_section { + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - movement3; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum(); + let twitch3 = (mirror * movement3 * 9.0).sin(); + let movement1 = mirror * movement1base * pullback; + let movement2 = mirror * movement2base * pullback; + let movement1abs = movement1base * pullback; + let movement2abs = movement2base * pullback; + + next.head_upper.orientation = Quaternion::rotation_z(twitch3 * 0.2); + + next.head_lower.orientation = Quaternion::rotation_x(movement1abs * 0.15 + movement2abs * -0.6) + * Quaternion::rotation_y(movement1 * -0.1 + movement2 * 0.15); + + next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.9); + next.chest.orientation = Quaternion::rotation_y(movement1 * 0.08 + movement2 * -0.15) + * Quaternion::rotation_z(movement1 * 0.2 + movement2 * -0.3); + + next.tail_front.orientation = + Quaternion::rotation_x(0.15) * Quaternion::rotation_z(movement1 * 0.4 + movement2 * 0.2); + + next.tail_rear.orientation = + Quaternion::rotation_x(-0.12) * Quaternion::rotation_z(movement1 * 0.4 + movement2 * 0.2); +} diff --git a/voxygen/anim/src/quadruped_medium/alpha.rs b/voxygen/anim/src/quadruped_medium/alpha.rs deleted file mode 100644 index 32bb388f2a..0000000000 --- a/voxygen/anim/src/quadruped_medium/alpha.rs +++ /dev/null @@ -1,99 +0,0 @@ -use super::{ - super::{vek::*, Animation}, - QuadrupedMediumSkeleton, SkeletonAttr, -}; -use common::states::utils::StageSection; - -pub struct AlphaAnimation; - -impl Animation for AlphaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); - type Skeleton = QuadrupedMediumSkeleton; - - #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"quadruped_medium_alpha\0"; - - #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_alpha")] - fn update_skeleton_inner( - skeleton: &Self::Skeleton, - (velocity, global_time, stage_section, timer): Self::Dependency<'_>, - anim_time: f32, - _rate: &mut f32, - s_a: &SkeletonAttr, - ) -> Self::Skeleton { - let mut next = (*skeleton).clone(); - let speed = (Vec2::::from(velocity).magnitude()).min(24.0); - - let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powf(0.25), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), - _ => (0.0, 0.0, 0.0), - }; - let pullback = 1.0 - movement3; - let subtract = global_time - timer; - let check = subtract - subtract.trunc(); - let mirror = (check - 0.5).signum(); - let movement1 = movement1base * mirror * pullback; - let movement1abs = movement1base * pullback; - let movement2 = movement2base * mirror * pullback; - let movement2abs = movement2base * pullback; - let twitch1 = (movement1 * 10.0).sin() * pullback; - let twitch2 = (movement3 * 5.0).sin() * pullback; - let twitchmovement = twitch1 + twitch2; - - next.head.orientation = Quaternion::rotation_x(movement1abs * -0.3 + movement2abs * 0.6) - * Quaternion::rotation_y(movement1 * 0.35 + movement2 * -0.15) - * Quaternion::rotation_z(movement1 * 0.15 + movement2 * -0.5); - - next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.2 + movement2abs * -0.2) - * Quaternion::rotation_y(movement1 * 0.0) - * Quaternion::rotation_z(movement1 * 0.10 + movement1 * -0.15); - - next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 0.4); - - next.tail.orientation = Quaternion::rotation_z( - movement1 * 0.5 + movement2 * -0.8 + twitchmovement * 0.2 * mirror, - ); - next.torso_front.position = Vec3::new( - 0.0, - s_a.torso_front.0 + movement1abs * -4.0, - s_a.torso_front.1, - ); - next.torso_front.orientation = Quaternion::rotation_y(movement1 * -0.25 * movement2 * 0.25) - * Quaternion::rotation_z(movement1 * 0.35 + movement2 * -0.45); - - next.torso_back.orientation = Quaternion::rotation_y(movement1 * 0.25 + movement1 * -0.25) - * Quaternion::rotation_z(movement1 * -0.4 + movement2 * 0.65); - - next.ears.orientation = Quaternion::rotation_x(twitchmovement * 0.2); - if speed < 0.5 { - next.leg_fl.orientation = - Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) - * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) - * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); - - next.leg_fr.orientation = - Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) - * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) - * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); - - next.leg_bl.orientation = Quaternion::rotation_x(movement1 * 0.1 + movement2 * -0.3); - - next.leg_br.orientation = Quaternion::rotation_x(movement1 * -0.1 + movement2 * 0.3); - - next.foot_fl.orientation = - Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); - - next.foot_fr.orientation = - Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); - - next.foot_bl.orientation = - Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); - - next.foot_br.orientation = - Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); - }; - next - } -} diff --git a/voxygen/anim/src/quadruped_medium/beta.rs b/voxygen/anim/src/quadruped_medium/beta.rs deleted file mode 100644 index 8d189b8eb8..0000000000 --- a/voxygen/anim/src/quadruped_medium/beta.rs +++ /dev/null @@ -1,99 +0,0 @@ -use super::{ - super::{vek::*, Animation}, - QuadrupedMediumSkeleton, SkeletonAttr, -}; -use common::states::utils::StageSection; - -pub struct BetaAnimation; - -impl Animation for BetaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); - type Skeleton = QuadrupedMediumSkeleton; - - #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"quadruped_medium_beta\0"; - - #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_beta")] - fn update_skeleton_inner( - skeleton: &Self::Skeleton, - (velocity, global_time, stage_section, timer): Self::Dependency<'_>, - anim_time: f32, - _rate: &mut f32, - s_a: &SkeletonAttr, - ) -> Self::Skeleton { - let mut next = (*skeleton).clone(); - let speed = (Vec2::::from(velocity).magnitude()).min(24.0); - - let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.sqrt(), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), - _ => (0.0, 0.0, 0.0), - }; - let pullback = 1.0 - movement3; - let subtract = global_time - timer; - let check = subtract - subtract.trunc(); - let mirror = (check - 0.5).signum(); - let movement1 = movement1base * mirror * pullback; - let movement1abs = movement1base * pullback; - let movement2 = movement2base * mirror * pullback; - let movement2abs = movement2base * pullback; - let twitch1 = (movement1 * 10.0).sin() * pullback; - let twitch2 = (movement2abs * -8.0).sin(); - let twitchmovement = twitch1 + twitch2; - - next.head.orientation = Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 1.1) - * Quaternion::rotation_y(movement1 * -0.35 + movement2 * 0.25) - * Quaternion::rotation_z(movement1 * -0.25 + movement2 * 0.5); - - next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.0 + movement2abs * -0.2) - * Quaternion::rotation_y(movement1 * 0.0) - * Quaternion::rotation_z(movement1 * -0.10 + movement1 * 0.15); - - next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 + twitch2 * -0.4); - - next.tail.orientation = Quaternion::rotation_z( - movement1 * 0.5 + movement2 * -0.8 + twitchmovement * 0.2 * mirror, - ); - next.torso_front.position = Vec3::new( - 0.0, - s_a.torso_front.0 + movement1abs * -4.0, - s_a.torso_front.1, - ); - next.torso_front.orientation = Quaternion::rotation_y(movement1 * -0.25 * movement2 * 0.25) - * Quaternion::rotation_z(movement1 * 0.35 + movement2 * -0.45); - - next.torso_back.orientation = Quaternion::rotation_y(movement1 * 0.25 + movement1 * -0.25) - * Quaternion::rotation_z(movement1 * -0.4 + movement2 * 0.65); - - next.ears.orientation = Quaternion::rotation_x(twitchmovement * 0.2); - if speed < 0.5 { - next.leg_fl.orientation = - Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) - * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) - * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); - - next.leg_fr.orientation = - Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) - * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) - * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); - - next.leg_bl.orientation = Quaternion::rotation_x(movement1 * 0.1 + movement2 * -0.3); - - next.leg_br.orientation = Quaternion::rotation_x(movement1 * -0.1 + movement2 * 0.3); - - next.foot_fl.orientation = - Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); - - next.foot_fr.orientation = - Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); - - next.foot_bl.orientation = - Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); - - next.foot_br.orientation = - Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); - }; - next - } -} diff --git a/voxygen/anim/src/quadruped_medium/combomelee.rs b/voxygen/anim/src/quadruped_medium/combomelee.rs index c52a3a5304..18e10b452e 100644 --- a/voxygen/anim/src/quadruped_medium/combomelee.rs +++ b/voxygen/anim/src/quadruped_medium/combomelee.rs @@ -1,19 +1,12 @@ use super::{ super::{vek::*, Animation}, - QuadrupedMediumSkeleton, SkeletonAttr, + quadruped_medium_alpha, quadruped_medium_beta, QuadrupedMediumSkeleton, SkeletonAttr, }; -use common::states::utils::{AbilityInfo, StageSection}; +use common::states::utils::StageSection; pub struct ComboAnimation; impl Animation for ComboAnimation { - type Dependency<'a> = ( - Option<&'a str>, - Option, - Option, - usize, - f32, - f32, - ); + type Dependency<'a> = (Option<&'a str>, StageSection, usize, f32, f32, f32); type Skeleton = QuadrupedMediumSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -22,16 +15,18 @@ impl Animation for ComboAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_combo")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (ability_id, stage_section, _ability_info, current_strike, global_time, timer): Self::Dependency<'_>, + (ability_id, stage_section, current_strike, speed, global_time, timer): Self::Dependency< + '_, + >, anim_time: f32, rate: &mut f32, - _s_a: &SkeletonAttr, + s_a: &SkeletonAttr, ) -> Self::Skeleton { *rate = 1.0; let mut next = (*skeleton).clone(); let _multi_strike_pullback = 1.0 - - if matches!(stage_section, Some(StageSection::Recover)) { + - if matches!(stage_section, StageSection::Recover) { anim_time.powi(4) } else { 0.0 @@ -44,9 +39,9 @@ impl Animation for ComboAnimation { | "common.abilities.custom.frostfang.triplestrike", ) => { let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.sqrt(), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), _ => (0.0, 0.0, 0.0), }; let pullback = 1.0 - movement3; @@ -101,6 +96,77 @@ impl Animation for ComboAnimation { _ => {}, } }, + Some("common.abilities.custom.quadmedbasic.singlestrike") => match strike { + 0 => { + quadruped_medium_alpha( + &mut next, + s_a, + speed, + stage_section, + anim_time, + global_time, + timer, + ); + }, + _ => {}, + }, + Some( + "common.abilities.custom.quadmedbasic.triplestrike" + | "common.abilities.custom.quadmedquick.triplestrike", + ) => match strike { + 0 | 2 => { + quadruped_medium_alpha( + &mut next, + s_a, + speed, + stage_section, + anim_time, + global_time, + timer, + ); + }, + 1 => { + quadruped_medium_beta( + &mut next, + s_a, + speed, + stage_section, + anim_time, + global_time, + timer, + ); + }, + _ => {}, + }, + Some( + "common.abilities.custom.quadmedcharge.doublestrike" + | "common.abilities.custom.quadmedjump.doublestrike" + | "common.abilities.custom.roshwalr.doublehusk", + ) => match strike { + 0 => { + quadruped_medium_alpha( + &mut next, + s_a, + speed, + stage_section, + anim_time, + global_time, + timer, + ); + }, + 1 => { + quadruped_medium_beta( + &mut next, + s_a, + speed, + stage_section, + anim_time, + global_time, + timer, + ); + }, + _ => {}, + }, _ => {}, } } diff --git a/voxygen/anim/src/quadruped_medium/mod.rs b/voxygen/anim/src/quadruped_medium/mod.rs index 2d6f243030..91b53198e4 100644 --- a/voxygen/anim/src/quadruped_medium/mod.rs +++ b/voxygen/anim/src/quadruped_medium/mod.rs @@ -1,5 +1,3 @@ -pub mod alpha; -pub mod beta; pub mod combomelee; pub mod dash; pub mod feed; @@ -13,14 +11,16 @@ pub mod stunned; // Reexports pub use self::{ - alpha::AlphaAnimation, beta::BetaAnimation, combomelee::ComboAnimation, dash::DashAnimation, - feed::FeedAnimation, hoof::HoofAnimation, idle::IdleAnimation, jump::JumpAnimation, - leapmelee::LeapMeleeAnimation, run::RunAnimation, shockwave::ShockwaveAnimation, - stunned::StunnedAnimation, + combomelee::ComboAnimation, dash::DashAnimation, feed::FeedAnimation, hoof::HoofAnimation, + idle::IdleAnimation, jump::JumpAnimation, leapmelee::LeapMeleeAnimation, run::RunAnimation, + shockwave::ShockwaveAnimation, stunned::StunnedAnimation, }; use super::{make_bone, vek::*, FigureBoneData, Offsets, Skeleton}; -use common::comp::{self}; +use common::{ + comp::{self}, + states::utils::StageSection, +}; use core::convert::TryFrom; pub type Body = comp::quadruped_medium::Body; @@ -797,3 +797,159 @@ fn mount_point(body: &Body) -> Vec3 { } .into() } + +pub fn quadruped_medium_alpha( + next: &mut QuadrupedMediumSkeleton, + s_a: &SkeletonAttr, + speed: f32, + stage_section: StageSection, + anim_time: f32, + global_time: f32, + timer: f32, +) { + let speed = (Vec2::::from(speed).magnitude()).min(24.0); + + let (movement1base, movement2base, movement3) = match stage_section { + StageSection::Buildup => (anim_time.powf(0.25), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powf(0.25), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - movement3; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum(); + let movement1 = movement1base * mirror * pullback; + let movement1abs = movement1base * pullback; + let movement2 = movement2base * mirror * pullback; + let movement2abs = movement2base * pullback; + let twitch1 = (movement1 * 10.0).sin() * pullback; + let twitch2 = (movement3 * 5.0).sin() * pullback; + let twitchmovement = twitch1 + twitch2; + + next.head.orientation = Quaternion::rotation_x(movement1abs * -0.3 + movement2abs * 0.6) + * Quaternion::rotation_y(movement1 * 0.35 + movement2 * -0.15) + * Quaternion::rotation_z(movement1 * 0.15 + movement2 * -0.5); + + next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.2 + movement2abs * -0.2) + * Quaternion::rotation_y(movement1 * 0.0) + * Quaternion::rotation_z(movement1 * 0.10 + movement1 * -0.15); + + next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 0.4); + + next.tail.orientation = + Quaternion::rotation_z(movement1 * 0.5 + movement2 * -0.8 + twitchmovement * 0.2 * mirror); + next.torso_front.position = Vec3::new( + 0.0, + s_a.torso_front.0 + movement1abs * -4.0, + s_a.torso_front.1, + ); + next.torso_front.orientation = Quaternion::rotation_y(movement1 * -0.25 * movement2 * 0.25) + * Quaternion::rotation_z(movement1 * 0.35 + movement2 * -0.45); + + next.torso_back.orientation = Quaternion::rotation_y(movement1 * 0.25 + movement1 * -0.25) + * Quaternion::rotation_z(movement1 * -0.4 + movement2 * 0.65); + + next.ears.orientation = Quaternion::rotation_x(twitchmovement * 0.2); + if speed < 0.5 { + next.leg_fl.orientation = Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) + * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) + * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); + + next.leg_fr.orientation = Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) + * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) + * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); + + next.leg_bl.orientation = Quaternion::rotation_x(movement1 * 0.1 + movement2 * -0.3); + + next.leg_br.orientation = Quaternion::rotation_x(movement1 * -0.1 + movement2 * 0.3); + + next.foot_fl.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); + + next.foot_fr.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); + + next.foot_bl.orientation = + Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); + + next.foot_br.orientation = + Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); + }; +} + +pub fn quadruped_medium_beta( + next: &mut QuadrupedMediumSkeleton, + s_a: &SkeletonAttr, + speed: f32, + stage_section: StageSection, + anim_time: f32, + global_time: f32, + timer: f32, +) { + let speed = (Vec2::::from(speed).magnitude()).min(24.0); + + let (movement1base, movement2base, movement3) = match stage_section { + StageSection::Buildup => (anim_time.powf(0.25), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.sqrt(), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - movement3; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum(); + let movement1 = movement1base * mirror * pullback; + let movement1abs = movement1base * pullback; + let movement2 = movement2base * mirror * pullback; + let movement2abs = movement2base * pullback; + let twitch1 = (movement1 * 10.0).sin() * pullback; + let twitch2 = (movement2abs * -8.0).sin(); + let twitchmovement = twitch1 + twitch2; + + next.head.orientation = Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 1.1) + * Quaternion::rotation_y(movement1 * -0.35 + movement2 * 0.25) + * Quaternion::rotation_z(movement1 * -0.25 + movement2 * 0.5); + + next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.0 + movement2abs * -0.2) + * Quaternion::rotation_y(movement1 * 0.0) + * Quaternion::rotation_z(movement1 * -0.10 + movement1 * 0.15); + + next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 + twitch2 * -0.4); + + next.tail.orientation = + Quaternion::rotation_z(movement1 * 0.5 + movement2 * -0.8 + twitchmovement * 0.2 * mirror); + next.torso_front.position = Vec3::new( + 0.0, + s_a.torso_front.0 + movement1abs * -4.0, + s_a.torso_front.1, + ); + next.torso_front.orientation = Quaternion::rotation_y(movement1 * -0.25 * movement2 * 0.25) + * Quaternion::rotation_z(movement1 * 0.35 + movement2 * -0.45); + + next.torso_back.orientation = Quaternion::rotation_y(movement1 * 0.25 + movement1 * -0.25) + * Quaternion::rotation_z(movement1 * -0.4 + movement2 * 0.65); + + next.ears.orientation = Quaternion::rotation_x(twitchmovement * 0.2); + if speed < 0.5 { + next.leg_fl.orientation = Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) + * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) + * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); + + next.leg_fr.orientation = Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) + * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) + * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); + + next.leg_bl.orientation = Quaternion::rotation_x(movement1 * 0.1 + movement2 * -0.3); + + next.leg_br.orientation = Quaternion::rotation_x(movement1 * -0.1 + movement2 * 0.3); + + next.foot_fl.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); + + next.foot_fr.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); + + next.foot_bl.orientation = + Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); + + next.foot_br.orientation = + Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); + }; +} diff --git a/voxygen/anim/src/quadruped_small/alpha.rs b/voxygen/anim/src/quadruped_small/alpha.rs index fa8f1e431c..69510a0d51 100644 --- a/voxygen/anim/src/quadruped_small/alpha.rs +++ b/voxygen/anim/src/quadruped_small/alpha.rs @@ -8,7 +8,7 @@ use common::states::utils::StageSection; pub struct AlphaAnimation; impl Animation for AlphaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); + type Dependency<'a> = (f32, StageSection, f32); type Skeleton = QuadrupedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -17,7 +17,7 @@ impl Animation for AlphaAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_small_alpha")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency<'_>, + (global_time, stage_section, timer): Self::Dependency<'_>, anim_time: f32, _rate: &mut f32, _s_a: &SkeletonAttr, @@ -25,9 +25,9 @@ impl Animation for AlphaAnimation { let mut next = (*skeleton).clone(); let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.sqrt(), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), _ => (0.0, 0.0, 0.0), }; let pullback = 1.0 - movement3; diff --git a/voxygen/anim/src/theropod/alpha.rs b/voxygen/anim/src/theropod/alpha.rs deleted file mode 100644 index ee9ecf8903..0000000000 --- a/voxygen/anim/src/theropod/alpha.rs +++ /dev/null @@ -1,66 +0,0 @@ -use super::{ - super::{vek::*, Animation}, - SkeletonAttr, TheropodSkeleton, -}; -use common::states::utils::StageSection; - -pub struct AlphaAnimation; - -impl Animation for AlphaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); - type Skeleton = TheropodSkeleton; - - #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"theropod_alpha\0"; - - #[cfg_attr(feature = "be-dyn-lib", export_name = "theropod_alpha")] - fn update_skeleton_inner( - skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency<'_>, - anim_time: f32, - _rate: &mut f32, - _s_a: &SkeletonAttr, - ) -> Self::Skeleton { - let mut next = (*skeleton).clone(); - - let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.powi(2), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), - _ => (0.0, 0.0, 0.0), - }; - let pullback = 1.0 - movement3; - let subtract = global_time - timer; - let check = subtract - subtract.trunc(); - let mirror = (check - 0.5).signum(); - let movement1 = mirror * movement1base * pullback; - let movement2 = mirror * movement2base * pullback; - let movement1abs = movement1base * pullback; - let movement2abs = movement2base * pullback; - - next.head.orientation = Quaternion::rotation_x(movement1abs * 0.2) - * Quaternion::rotation_y(movement1 * 0.1 + movement2 * 0.2); - next.neck.orientation = Quaternion::rotation_x(movement1abs * -0.3) - * Quaternion::rotation_y(movement1 * 0.1 + movement2 * 0.1); - - next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * 0.5); - - next.chest_front.orientation = Quaternion::rotation_x(movement1abs * -0.2); - next.chest_back.orientation = Quaternion::rotation_x(movement1abs * 0.2); - - next.leg_l.orientation = Quaternion::rotation_x(movement1abs * -0.1); - - next.leg_r.orientation = Quaternion::rotation_x(movement1abs * -0.1); - next.foot_l.orientation = Quaternion::rotation_x(movement1abs * -0.3); - next.foot_r.orientation = Quaternion::rotation_x(movement1abs * -0.3); - - next.tail_front.orientation = - Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3) - * Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2); - - next.tail_back.orientation = - Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3) - * Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2); - next - } -} diff --git a/voxygen/anim/src/theropod/beta.rs b/voxygen/anim/src/theropod/beta.rs deleted file mode 100644 index 12f0db1367..0000000000 --- a/voxygen/anim/src/theropod/beta.rs +++ /dev/null @@ -1,65 +0,0 @@ -use super::{ - super::{vek::*, Animation}, - SkeletonAttr, TheropodSkeleton, -}; -use common::states::utils::StageSection; -//use std::ops::Rem; - -pub struct BetaAnimation; - -impl Animation for BetaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); - type Skeleton = TheropodSkeleton; - - #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"theropod_beta\0"; - - #[cfg_attr(feature = "be-dyn-lib", export_name = "theropod_beta")] - fn update_skeleton_inner( - skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency<'_>, - anim_time: f32, - _rate: &mut f32, - _s_a: &SkeletonAttr, - ) -> Self::Skeleton { - let mut next = (*skeleton).clone(); - - let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.powi(2), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), - _ => (0.0, 0.0, 0.0), - }; - let pullback = 1.0 - movement3; - let subtract = global_time - timer; - let check = subtract - subtract.trunc(); - let mirror = (check - 0.5).signum(); - let movement1 = mirror * movement1base * pullback; - let movement2 = mirror * movement2base * pullback; - let movement1abs = movement1base * pullback; - let movement2abs = movement2base * pullback; - - next.head.orientation = Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 1.2) - * Quaternion::rotation_y(movement1 * 0.1 + movement2 * -0.1); - next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.4 + movement2abs * -1.2) - * Quaternion::rotation_y(movement1 * 0.1 + movement2 * -0.1); - - next.chest_front.orientation = - Quaternion::rotation_x(movement1abs * 0.6 + movement2abs * -1.5); - next.chest_back.orientation = - Quaternion::rotation_x(movement1abs * -0.6 + movement2abs * 1.5); - - next.leg_l.orientation = Quaternion::rotation_x(movement1abs * -0.5); - - next.leg_r.orientation = Quaternion::rotation_x(movement1abs * -0.5); - next.foot_l.orientation = Quaternion::rotation_x(movement1abs * 0.4); - next.foot_r.orientation = Quaternion::rotation_x(movement1abs * 0.4); - - next.tail_front.orientation = - Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3); - - next.tail_back.orientation = - Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3); - next - } -} diff --git a/voxygen/anim/src/theropod/combomelee.rs b/voxygen/anim/src/theropod/combomelee.rs new file mode 100644 index 0000000000..609091fbe8 --- /dev/null +++ b/voxygen/anim/src/theropod/combomelee.rs @@ -0,0 +1,118 @@ +use super::{ + super::{vek::*, Animation}, + SkeletonAttr, TheropodSkeleton, +}; +use common::states::utils::StageSection; + +pub struct ComboAnimation; + +impl Animation for ComboAnimation { + type Dependency<'a> = (Option<&'a str>, StageSection, usize, f32, f32); + type Skeleton = TheropodSkeleton; + + #[cfg(feature = "use-dyn-lib")] + const UPDATE_FN: &'static [u8] = b"theropod_combo\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "theropod_combo")] + fn update_skeleton_inner( + skeleton: &Self::Skeleton, + (_ability_id, stage_section, current_strike, global_time, timer): Self::Dependency<'_>, + anim_time: f32, + _rate: &mut f32, + _s_a: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + + let multi_strike_pullback = 1.0 + - if matches!(stage_section, StageSection::Recover) { + anim_time.powi(4) + } else { + 0.0 + }; + + for strike in 0..=current_strike { + match strike { + 0 => { + let (movement1base, movement2base) = match stage_section { + StageSection::Buildup => (anim_time.powi(2), 0.0), + StageSection::Action => (1.0, anim_time.powi(4)), + _ => (0.0, 0.0), + }; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum(); + let movement1 = mirror * movement1base * multi_strike_pullback; + let movement2 = mirror * movement2base * multi_strike_pullback; + let movement1abs = movement1base * multi_strike_pullback; + let movement2abs = movement2base * multi_strike_pullback; + + next.head.orientation = Quaternion::rotation_x(movement1abs * 0.2) + * Quaternion::rotation_y(movement1 * 0.1 + movement2 * 0.2); + next.neck.orientation = Quaternion::rotation_x(movement1abs * -0.3) + * Quaternion::rotation_y(movement1 * 0.1 + movement2 * 0.1); + + next.jaw.orientation = + Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * 0.5); + + next.chest_front.orientation = Quaternion::rotation_x(movement1abs * -0.2); + next.chest_back.orientation = Quaternion::rotation_x(movement1abs * 0.2); + + next.leg_l.orientation = Quaternion::rotation_x(movement1abs * -0.1); + + next.leg_r.orientation = Quaternion::rotation_x(movement1abs * -0.1); + next.foot_l.orientation = Quaternion::rotation_x(movement1abs * -0.3); + next.foot_r.orientation = Quaternion::rotation_x(movement1abs * -0.3); + + next.tail_front.orientation = + Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3) + * Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2); + + next.tail_back.orientation = + Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3) + * Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2); + }, + 1 | 2 => { + let (movement1base, movement2base) = match stage_section { + StageSection::Buildup => (anim_time.powi(2), 0.0), + StageSection::Action => (1.0, anim_time.powi(4)), + _ => (0.0, 0.0), + }; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum(); + let movement1 = mirror * movement1base * multi_strike_pullback; + let movement2 = mirror * movement2base * multi_strike_pullback; + let movement1abs = movement1base * multi_strike_pullback; + let movement2abs = movement2base * multi_strike_pullback; + + next.head.orientation = + Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 1.2) + * Quaternion::rotation_y(movement1 * 0.1 + movement2 * -0.1); + next.neck.orientation = + Quaternion::rotation_x(movement1abs * 0.4 + movement2abs * -1.2) + * Quaternion::rotation_y(movement1 * 0.1 + movement2 * -0.1); + + next.chest_front.orientation = + Quaternion::rotation_x(movement1abs * 0.6 + movement2abs * -1.5); + next.chest_back.orientation = + Quaternion::rotation_x(movement1abs * -0.6 + movement2abs * 1.5); + + next.leg_l.orientation = Quaternion::rotation_x(movement1abs * -0.5); + + next.leg_r.orientation = Quaternion::rotation_x(movement1abs * -0.5); + next.foot_l.orientation = Quaternion::rotation_x(movement1abs * 0.4); + next.foot_r.orientation = Quaternion::rotation_x(movement1abs * 0.4); + + next.tail_front.orientation = + Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3); + + next.tail_back.orientation = + Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3); + }, + _ => {}, + } + } + + next + } +} diff --git a/voxygen/anim/src/theropod/mod.rs b/voxygen/anim/src/theropod/mod.rs index 51e1e4b130..18d8ebc100 100644 --- a/voxygen/anim/src/theropod/mod.rs +++ b/voxygen/anim/src/theropod/mod.rs @@ -1,5 +1,4 @@ -pub mod alpha; -pub mod beta; +pub mod combomelee; pub mod dash; pub mod idle; pub mod jump; @@ -7,8 +6,8 @@ pub mod run; // Reexports pub use self::{ - alpha::AlphaAnimation, beta::BetaAnimation, dash::DashAnimation, idle::IdleAnimation, - jump::JumpAnimation, run::RunAnimation, + combomelee::ComboAnimation, dash::DashAnimation, idle::IdleAnimation, jump::JumpAnimation, + run::RunAnimation, }; use super::{make_bone, vek::*, FigureBoneData, Offsets, Skeleton}; diff --git a/voxygen/egui/src/character_states.rs b/voxygen/egui/src/character_states.rs index b2dec83c46..81b8761999 100644 --- a/voxygen/egui/src/character_states.rs +++ b/voxygen/egui/src/character_states.rs @@ -1,7 +1,7 @@ use crate::{widgets::two_col_row, SelectedEntityInfo}; use common::{ comp::CharacterState, - states::{charged_melee, combo_melee, dash_melee, leap_melee}, + states::{charged_melee, dash_melee, leap_melee}, }; use egui::{Grid, Ui}; @@ -15,9 +15,6 @@ pub fn draw_char_state_group( ui.label(character_state.to_string()); }); match character_state { - CharacterState::ComboMelee(data) => { - combo_melee_grid(ui, data); - }, CharacterState::DashMelee(data) => dash_melee_grid(ui, data), CharacterState::ChargedMelee(data) => charged_melee_grid(ui, data), // Character states with no associated data to display @@ -47,18 +44,6 @@ fn charged_melee_grid(ui: &mut Ui, data: &charged_melee::Data) { }); } -fn combo_melee_grid(ui: &mut Ui, data: &combo_melee::Data) { - Grid::new("selected_entity_combo_melee_grid") - .spacing([40.0, 4.0]) - .max_col_width(100.0) - .striped(true) - .show(ui, |ui| #[rustfmt::skip] { - two_col_row(ui, "Stage", data.stage.to_string()); - two_col_row(ui, "Timer", format!("{}ms", data.timer.as_millis())); - two_col_row(ui, "num_stages", data.static_data.num_stages.to_string()); - }); -} - fn dash_melee_grid(ui: &mut Ui, data: &dash_melee::Data) { Grid::new("selected_entity_dash_melee_grid") .spacing([40.0, 4.0]) diff --git a/voxygen/i18n-helpers/src/lib.rs b/voxygen/i18n-helpers/src/lib.rs index 41c8f787e2..5751cfab38 100644 --- a/voxygen/i18n-helpers/src/lib.rs +++ b/voxygen/i18n-helpers/src/lib.rs @@ -109,6 +109,7 @@ pub fn localize_chat_message( BuffKind::Regeneration | BuffKind::Saturation | BuffKind::Potion + | BuffKind::Agility | BuffKind::CampfireHeal | BuffKind::EnergyRegen | BuffKind::IncreaseMaxEnergy diff --git a/voxygen/src/audio/music.rs b/voxygen/src/audio/music.rs index 29499a264e..6c5868b4b8 100644 --- a/voxygen/src/audio/music.rs +++ b/voxygen/src/audio/music.rs @@ -165,8 +165,8 @@ pub struct MusicMgr { /// The previous track's activity kind, for transitions last_activity: MusicState, // For debug menu - pub current_track: String, - pub current_artist: String, + current_track: String, + current_artist: String, track_length: f32, } @@ -493,6 +493,17 @@ impl MusicMgr { } } + pub fn current_track(&self) -> String { self.current_track.clone() } + + pub fn current_artist(&self) -> String { self.current_artist.clone() } + + pub fn reset_track(&mut self) { + self.began_playing = Instant::now(); + self.next_track_change = 0.0; + self.current_artist = String::from("None"); + self.current_track = String::from("None"); + } + /// Loads default soundtrack if no events are active. Otherwise, attempts to /// compile and load all active event soundtracks, falling back to default /// if they are empty. diff --git a/voxygen/src/audio/sfx/event_mapper/combat/tests.rs b/voxygen/src/audio/sfx/event_mapper/combat/tests.rs index 6de8f43ecc..cb8e75dfef 100644 --- a/voxygen/src/audio/sfx/event_mapper/combat/tests.rs +++ b/voxygen/src/audio/sfx/event_mapper/combat/tests.rs @@ -1,7 +1,6 @@ use super::*; use crate::audio::sfx::SfxEvent; use common::{ - combat::DamageKind, comp::{ controller::InputKind, inventory::loadout_builder::LoadoutBuilder, item::tool::ToolKind, melee, CharacterAbilityType, CharacterState, Item, @@ -115,128 +114,6 @@ fn maps_basic_melee() { ); } -#[test] -fn matches_ability_stage() { - let loadout = LoadoutBuilder::empty() - .active_mainhand(Some(Item::new_from_asset_expect( - "common.items.weapons.sword.starter", - ))) - .build(); - let inventory = Inventory::with_loadout_humanoid(loadout); - - let result = CombatEventMapper::map_event( - &CharacterState::ComboMelee(states::combo_melee::Data { - static_data: states::combo_melee::StaticData { - num_stages: 1, - stage_data: vec![states::combo_melee::Stage { - stage: 1, - base_damage: 100.0, - base_poise_damage: 100.0, - damage_increase: 10.0, - poise_damage_increase: 10.0, - knockback: 10.0, - range: 4.0, - angle: 30.0, - base_buildup_duration: Duration::from_millis(500), - base_swing_duration: Duration::from_millis(200), - hit_timing: 0.5, - base_recover_duration: Duration::from_millis(400), - forward_movement: 0.5, - damage_kind: DamageKind::Slashing, - damage_effect: None, - }], - initial_energy_gain: 0.0, - max_energy_gain: 100.0, - energy_increase: 20.0, - speed_increase: 0.05, - max_speed_increase: 0.8, - scales_from_combo: 2, - ori_modifier: 1.0, - ability_info: empty_ability_info(), - }, - exhausted: false, - stage: 1, - timer: Duration::default(), - stage_section: states::utils::StageSection::Action, - }), - &PreviousEntityState { - event: SfxEvent::Idle, - time: Instant::now(), - weapon_drawn: true, - }, - &inventory, - ); - - assert_eq!( - result, - SfxEvent::Attack( - CharacterAbilityType::ComboMelee(states::utils::StageSection::Action, 1), - ToolKind::Sword - ) - ); -} - -#[test] -fn ignores_different_ability_stage() { - let loadout = LoadoutBuilder::empty() - .active_mainhand(Some(Item::new_from_asset_expect( - "common.items.weapons.axe.starter_axe", - ))) - .build(); - let inventory = Inventory::with_loadout_humanoid(loadout); - - let result = CombatEventMapper::map_event( - &CharacterState::ComboMelee(states::combo_melee::Data { - static_data: states::combo_melee::StaticData { - num_stages: 1, - stage_data: vec![states::combo_melee::Stage { - stage: 1, - base_damage: 100.0, - base_poise_damage: 100.0, - damage_increase: 100.0, - poise_damage_increase: 10.0, - knockback: 10.0, - range: 4.0, - angle: 30.0, - base_buildup_duration: Duration::from_millis(500), - base_swing_duration: Duration::from_millis(200), - hit_timing: 0.5, - base_recover_duration: Duration::from_millis(400), - forward_movement: 0.5, - damage_kind: DamageKind::Slashing, - damage_effect: None, - }], - initial_energy_gain: 0.0, - max_energy_gain: 100.0, - energy_increase: 20.0, - speed_increase: 0.05, - max_speed_increase: 0.8, - scales_from_combo: 2, - ori_modifier: 1.0, - ability_info: empty_ability_info(), - }, - exhausted: false, - stage: 1, - timer: Duration::default(), - stage_section: states::utils::StageSection::Action, - }), - &PreviousEntityState { - event: SfxEvent::Idle, - time: Instant::now(), - weapon_drawn: true, - }, - &inventory, - ); - - assert_ne!( - result, - SfxEvent::Attack( - CharacterAbilityType::ComboMelee(states::utils::StageSection::Action, 2), - ToolKind::Sword - ) - ); -} - fn empty_ability_info() -> states::utils::AbilityInfo { states::utils::AbilityInfo { tool: None, diff --git a/voxygen/src/audio/sfx/event_mapper/movement/tests.rs b/voxygen/src/audio/sfx/event_mapper/movement/tests.rs index 2e60775dc3..8c1c7de7b7 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/tests.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/tests.rs @@ -202,7 +202,6 @@ fn maps_roll() { was_wielded: true, prev_aimed_dir: None, is_sneaking: false, - was_combo: None, }), &PhysicsState { on_ground: Some(Block::empty()), diff --git a/voxygen/src/audio/sfx/mod.rs b/voxygen/src/audio/sfx/mod.rs index 4fccce9e88..c1b1dc29b2 100644 --- a/voxygen/src/audio/sfx/mod.rs +++ b/voxygen/src/audio/sfx/mod.rs @@ -71,13 +71,6 @@ //! ], //! threshold: 1.2, //! ), -//! // A multi-stage attack ability which depends on the weapon -//! Attack(ComboMelee(Swing, 1), Sword): ( -//! files: [ -//! "voxygen.audio.sfx.abilities.swing_sword", -//! ], -//! threshold: 0.5, -//! ), //! ``` mod event_mapper; diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 8d43e185e3..f25efa52ef 100755 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -5165,6 +5165,8 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id { BuffKind::Regeneration => imgs.buff_plus_0, BuffKind::Saturation => imgs.buff_saturation_0, BuffKind::Potion => imgs.buff_potion_0, + // TODO: Need unique image for Agility (uses same as Hastened atm) + BuffKind::Agility => imgs.buff_haste_0, BuffKind::CampfireHeal => imgs.buff_campfire_heal_0, BuffKind::EnergyRegen => imgs.buff_energyplus_0, BuffKind::IncreaseMaxEnergy => imgs.buff_energyplus_0, @@ -5208,6 +5210,7 @@ pub fn get_buff_title(buff: BuffKind, localized_strings: &Localization) -> Cow localized_strings.get_msg("buff-title-heal"), BuffKind::Saturation => localized_strings.get_msg("buff-title-saturation"), BuffKind::Potion => localized_strings.get_msg("buff-title-potion"), + BuffKind::Agility => localized_strings.get_msg("buff-title-agility"), BuffKind::CampfireHeal => localized_strings.get_msg("buff-title-campfire_heal"), BuffKind::EnergyRegen => localized_strings.get_msg("buff-title-energy_regen"), BuffKind::IncreaseMaxHealth => localized_strings.get_msg("buff-title-increase_max_health"), @@ -5250,6 +5253,7 @@ pub fn get_buff_desc(buff: BuffKind, data: BuffData, localized_strings: &Localiz BuffKind::Regeneration => localized_strings.get_msg("buff-desc-heal"), BuffKind::Saturation => localized_strings.get_msg("buff-desc-saturation"), BuffKind::Potion => localized_strings.get_msg("buff-desc-potion"), + BuffKind::Agility => localized_strings.get_msg("buff-desc-agility"), BuffKind::CampfireHeal => { localized_strings.get_msg_ctx("buff-desc-campfire_heal", &i18n::fluent_args! { "rate" => data.strength * 100.0 diff --git a/voxygen/src/hud/util.rs b/voxygen/src/hud/util.rs index fc3a3eb733..63c655805e 100644 --- a/voxygen/src/hud/util.rs +++ b/voxygen/src/hud/util.rs @@ -189,6 +189,11 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec { "strength" => format_float(strength * 100.0), }) }, + BuffKind::Agility => { + i18n.get_msg_ctx("buff-stat-agility", &i18n::fluent_args! { + "strength" => format_float(strength * 100.0), + }) + }, BuffKind::Invulnerability => i18n.get_msg("buff-stat-invulnerability"), BuffKind::Bleeding | BuffKind::Burning @@ -231,6 +236,7 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec { }) }, BuffKind::IncreaseMaxEnergy + | BuffKind::Agility | BuffKind::IncreaseMaxHealth | BuffKind::Invulnerability | BuffKind::PotionSickness diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index 784adc249b..8fb6707683 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -206,11 +206,10 @@ impl PlayState for CharSelectionState { // Tick the client (currently only to keep the connection alive). let localized_strings = &global_state.i18n.read(); - let res = self.client.borrow_mut().tick( - comp::ControllerInputs::default(), - global_state.clock.dt(), - |_| {}, - ); + let res = self + .client + .borrow_mut() + .tick(comp::ControllerInputs::default(), global_state.clock.dt()); match res { Ok(events) => { for event in events { diff --git a/voxygen/src/menu/main/client_init.rs b/voxygen/src/menu/main/client_init.rs index a07c67920a..c1fcc57819 100644 --- a/voxygen/src/menu/main/client_init.rs +++ b/voxygen/src/menu/main/client_init.rs @@ -85,6 +85,7 @@ impl ClientInit { &|stage| { let _ = init_stage_tx.send(stage); }, + crate::ecs::sys::add_local_systems, ) .await { diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index bc388fde44..0f6fe9d1c7 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -251,11 +251,7 @@ impl PlayState for MainMenuState { // Tick the client to keep the connection alive if we are waiting on pipelines if let InitState::Pipeline(client) = &mut self.init { - match client.tick( - comp::ControllerInputs::default(), - global_state.clock.dt(), - |_| {}, - ) { + match client.tick(comp::ControllerInputs::default(), global_state.clock.dt()) { Ok(events) => { for event in events { match event { diff --git a/voxygen/src/menu/main/ui/mod.rs b/voxygen/src/menu/main/ui/mod.rs index cf83b03dd3..ff5181d575 100644 --- a/voxygen/src/menu/main/ui/mod.rs +++ b/voxygen/src/menu/main/ui/mod.rs @@ -92,6 +92,7 @@ const BG_IMGS: [&str; 14] = [ pub enum WorldChange { Name(String), Seed(u32), + DayLength(f64), SizeX(u32), SizeY(u32), Scale(f64), @@ -108,6 +109,7 @@ impl WorldChange { match self { WorldChange::Name(name) => world.name = name, WorldChange::Seed(seed) => world.seed = seed, + WorldChange::DayLength(d) => world.day_length = d, WorldChange::SizeX(s) => gen_opts.x_lg = s, WorldChange::SizeY(s) => gen_opts.y_lg = s, WorldChange::Scale(scale) => gen_opts.scale = scale, diff --git a/voxygen/src/menu/main/ui/world_selector.rs b/voxygen/src/menu/main/ui/world_selector.rs index 1bff0c83db..1e4c36f19b 100644 --- a/voxygen/src/menu/main/ui/world_selector.rs +++ b/voxygen/src/menu/main/ui/world_selector.rs @@ -47,6 +47,7 @@ pub struct Screen { world_name: text_input::State, map_seed: text_input::State, + day_length: slider::State, random_seed_button: button::State, world_size_x: slider::State, world_size_y: slider::State, @@ -196,6 +197,9 @@ impl Screen { const SLIDER_BAR_PAD: u16 = 0; // Height of interactable area const SLIDER_HEIGHT: u16 = 30; + // Day length slider values + pub const DAY_LENGTH_MIN: f64 = 10.0; + pub const DAY_LENGTH_MAX: f64 = 60.0; let mut gen_content = vec![ BackgroundContainer::new( @@ -288,6 +292,42 @@ impl Screen { gen_content.push(Row::with_children(seed_content).into()); if let Some(gen_opts) = world.gen_opts.as_ref() { + // Day length setting label + gen_content.push( + Text::new(format!( + "{}: {}", + i18n.get_msg("main-singleplayer-day_length"), + world.day_length + )) + .size(SLIDER_TEXT_SIZE) + .horizontal_alignment(iced::HorizontalAlignment::Center) + .into(), + ); + + // Day length setting slider + if can_edit { + gen_content.push( + Row::with_children(vec![ + Slider::new( + &mut self.day_length, + DAY_LENGTH_MIN..=DAY_LENGTH_MAX, + world.day_length, + move |d| message(WorldChange::DayLength(d)), + ) + .height(SLIDER_HEIGHT) + .style(style::slider::Style::images( + imgs.slider_indicator, + imgs.slider_range, + SLIDER_BAR_PAD, + SLIDER_CURSOR_SIZE, + SLIDER_BAR_HEIGHT, + )) + .into(), + ]) + .into(), + ) + } + gen_content.push( Text::new(format!( "{}: x: {}, y: {}", diff --git a/voxygen/src/render/renderer.rs b/voxygen/src/render/renderer.rs index 87ac68791f..c91ab2b3a7 100644 --- a/voxygen/src/render/renderer.rs +++ b/voxygen/src/render/renderer.rs @@ -1451,7 +1451,7 @@ impl Renderer { /// Queue to obtain a screenshot on the next frame render pub fn create_screenshot( &mut self, - screenshot_handler: impl FnOnce(Result) + Send + 'static, + screenshot_handler: impl FnOnce(Result) + Send + 'static, ) { // Queue screenshot self.take_screenshot = Some(Box::new(screenshot_handler)); diff --git a/voxygen/src/render/renderer/screenshot.rs b/voxygen/src/render/renderer/screenshot.rs index 672c1056d8..c5c73c833a 100644 --- a/voxygen/src/render/renderer/screenshot.rs +++ b/voxygen/src/render/renderer/screenshot.rs @@ -1,7 +1,8 @@ use super::super::pipelines::blit; +use common_base::prof_span; use tracing::error; -pub type ScreenshotFn = Box) + Send>; +pub type ScreenshotFn = Box) + Send>; pub struct TakeScreenshot { bind_group: blit::BindGroup, @@ -132,6 +133,7 @@ impl TakeScreenshot { } fn download_and_handle_internal(self) { + prof_span!("download_and_handle_internal"); // Calculate padded bytes per row let padded_bytes_per_row = padded_bytes_per_row(self.width, self.bytes_per_pixel); let singlethread_rt = match tokio::runtime::Builder::new_current_thread().build() { @@ -145,21 +147,19 @@ impl TakeScreenshot { // Map buffer let buffer_slice = self.buffer.slice(..); let buffer_map_future = buffer_slice.map_async(wgpu::MapMode::Read); + let padded_buffer; // Wait on buffer mapping - let mut pixel_bytes = match singlethread_rt.block_on(buffer_map_future) { + let rows = match singlethread_rt.block_on(buffer_map_future) { // Buffer is mapped and we can read it Ok(()) => { // Copy to a Vec - let padded_buffer = buffer_slice.get_mapped_range(); - let mut pixel_bytes = Vec::new(); + padded_buffer = buffer_slice.get_mapped_range(); padded_buffer .chunks(padded_bytes_per_row as usize) .map(|padded_chunk| { &padded_chunk[..self.width as usize * self.bytes_per_pixel as usize] }) - .for_each(|row| pixel_bytes.extend_from_slice(row)); - pixel_bytes }, // Error Err(err) => { @@ -171,36 +171,54 @@ impl TakeScreenshot { }, }; + // Note: we don't use bytes_per_pixel here since we expect only certain formats + // below. + let bytes_per_rgb = 3; + let mut pixel_bytes = + Vec::with_capacity(self.width as usize * self.height as usize * bytes_per_rgb); // Construct image let image = match self.tex_format { wgpu::TextureFormat::Bgra8UnormSrgb => { - let (pixels, rest) = pixel_bytes.as_chunks_mut(); - assert!( - rest.is_empty(), - "Always valid because each pixel uses four bytes" - ); - // Swap blue and red components to get a RGBA texture. - for [b, _g, r, _a] in pixels { - std::mem::swap(b, r); - } + prof_span!("copy image"); + rows.for_each(|row| { + let (pixels, rest) = row.as_chunks(); + assert!( + rest.is_empty(), + "Always valid because each pixel uses four bytes" + ); + // Swap blue and red components and drop alpha to get a RGB texture. + for &[b, g, r, _a] in pixels { + pixel_bytes.extend_from_slice(&[r, g, b]) + } + }); + + Ok(pixel_bytes) + }, + wgpu::TextureFormat::Rgba8UnormSrgb => { + prof_span!("copy image"); + rows.for_each(|row| { + let (pixels, rest) = row.as_chunks(); + assert!( + rest.is_empty(), + "Always valid because each pixel uses four bytes" + ); + // Drop alpha to get a RGB texture. + for &[r, g, b, _a] in pixels { + pixel_bytes.extend_from_slice(&[r, g, b]) + } + }); + Ok(pixel_bytes) }, - wgpu::TextureFormat::Rgba8UnormSrgb => Ok(pixel_bytes), format => Err(format!( "Unhandled format for screenshot texture: {:?}", format, )), } .map(|pixel_bytes| { - let image = image::ImageBuffer::, Vec>::from_vec( - self.width, - self.height, - pixel_bytes, - ) - .expect( + image::RgbImage::from_vec(self.width, self.height, pixel_bytes).expect( "Failed to create ImageBuffer! Buffer was not large enough. This should not occur", - ); - image::DynamicImage::ImageRgba8(image) + ) }); // Call supplied handler diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 11858e1f84..3683843c6b 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -1835,7 +1835,7 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::ComboMelee(s) => { + CharacterState::ComboMeleeDeprecated(s) => { let stage_index = (s.stage - 1) as usize; let stage_time = s.timer.as_secs_f32(); let stage_progress = @@ -2313,40 +2313,29 @@ impl FigureMgr { ), }; let target_bones = match &character { - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; + CharacterState::BasicMelee(s) => { let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - { - anim::quadruped_small::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ) - } + + let stage_progress = match s.stage_section { + StageSection::Buildup => { + stage_time / s.static_data.buildup_duration.as_secs_f32() + }, + StageSection::Action => { + stage_time / s.static_data.swing_duration.as_secs_f32() + }, + StageSection::Recover => { + stage_time / s.static_data.recover_duration.as_secs_f32() + }, + + _ => 0.0, + }; + anim::quadruped_small::AlphaAnimation::update_skeleton( + &target_base, + (time, s.stage_section, state.state_time), + stage_progress, + &mut state_animation_rate, + skeleton_attr, + ) }, CharacterState::ComboMelee2(s) => { let timer = s.timer.as_secs_f32(); @@ -2675,65 +2664,6 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; - let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - match s.stage { - 1 => anim::quadruped_medium::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - 2 => anim::quadruped_medium::BetaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - _ => anim::quadruped_medium::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - } - }, CharacterState::ComboMelee2(s) => { let timer = s.timer.as_secs_f32(); let current_strike = s.completed_strikes % s.static_data.strikes.len(); @@ -2755,9 +2685,9 @@ impl FigureMgr { &target_base, ( ability_id, - Some(s.stage_section), - Some(s.static_data.ability_info), + s.stage_section, current_strike, + rel_vel.magnitude(), time, state.state_time, ), @@ -3028,12 +2958,7 @@ impl FigureMgr { }; anim::quadruped_low::BetaAnimation::update_skeleton( &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), + (rel_vel.magnitude(), time, s.stage_section, state.state_time), stage_progress, &mut state_animation_rate, skeleton_attr, @@ -3141,8 +3066,7 @@ impl FigureMgr { &target_base, ( ability_id, - Some(s.stage_section), - Some(s.static_data.ability_info), + s.stage_section, current_strike, time, state.state_time, @@ -3152,65 +3076,6 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; - let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - match s.stage { - 1 => anim::quadruped_low::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - 2 => anim::quadruped_low::BetaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - _ => anim::quadruped_low::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - } - }, CharacterState::BasicBeam(s) => { let stage_time = s.timer.as_secs_f32(); let stage_progress = match s.stage_section { @@ -3417,27 +3282,20 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; + CharacterState::BasicMelee(s) => { let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - + let stage_progress = match s.stage_section { + StageSection::Buildup => { + stage_time / s.static_data.buildup_duration.as_secs_f32() + }, + StageSection::Action => { + stage_time / s.static_data.swing_duration.as_secs_f32() + }, + StageSection::Recover => { + stage_time / s.static_data.recover_duration.as_secs_f32() + }, + _ => 0.0, + }; anim::bird_medium::AlphaAnimation::update_skeleton( &target_base, ( @@ -3878,10 +3736,11 @@ impl FigureMgr { &target_base, ( ability_id, - Some(s.stage_section), - Some(s.static_data.ability_info), + s.stage_section, current_strike, - move_dir, + rel_vel, + time, + state.state_time, ), progress, &mut state_animation_rate, @@ -4054,65 +3913,6 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; - let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - match s.stage { - 1 => anim::biped_small::AlphaAnimation::update_skeleton( - &target_base, - ( - ability_id, - active_tool_kind, - rel_vel, - ori * anim::vek::Vec3::::unit_y(), - state.last_ori * anim::vek::Vec3::::unit_y(), - time, - rel_avg_vel, - state.acc_vel, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - _ => anim::biped_small::AlphaAnimation::update_skeleton( - &target_base, - ( - ability_id, - active_tool_kind, - rel_vel, - ori * anim::vek::Vec3::::unit_y(), - state.last_ori * anim::vek::Vec3::::unit_y(), - time, - rel_avg_vel, - state.acc_vel, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - } - }, CharacterState::BasicMelee(s) => { let stage_time = s.timer.as_secs_f32(); let stage_progress = match s.stage_section { @@ -4431,52 +4231,36 @@ impl FigureMgr { ), }; let target_bones = match &character { - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; - let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - match s.stage { - 1 => anim::theropod::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, + CharacterState::ComboMelee2(s) => { + let timer = s.timer.as_secs_f32(); + let current_strike = s.completed_strikes % s.static_data.strikes.len(); + let strike_data = s.static_data.strikes[current_strike]; + let progress = match s.stage_section { + StageSection::Buildup => { + timer / strike_data.buildup_duration.as_secs_f32() + }, + StageSection::Action => { + timer / strike_data.swing_duration.as_secs_f32() + }, + StageSection::Recover => { + timer / strike_data.recover_duration.as_secs_f32() + }, + _ => 0.0, + }; + + anim::theropod::ComboAnimation::update_skeleton( + &target_base, + ( + ability_id, + s.stage_section, + current_strike, + time, + state.state_time, ), - _ => anim::theropod::BetaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - } + progress, + &mut state_animation_rate, + skeleton_attr, + ) }, CharacterState::DashMelee(s) => { let stage_time = s.timer.as_secs_f32(); @@ -4610,52 +4394,36 @@ impl FigureMgr { ), }; let target_bones = match &character { - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; - let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - match s.stage { - 1 => anim::arthropod::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, + CharacterState::ComboMelee2(s) => { + let timer = s.timer.as_secs_f32(); + let current_strike = s.completed_strikes % s.static_data.strikes.len(); + let strike_data = s.static_data.strikes[current_strike]; + let progress = match s.stage_section { + StageSection::Buildup => { + timer / strike_data.buildup_duration.as_secs_f32() + }, + StageSection::Action => { + timer / strike_data.swing_duration.as_secs_f32() + }, + StageSection::Recover => { + timer / strike_data.recover_duration.as_secs_f32() + }, + _ => 0.0, + }; + + anim::arthropod::ComboAnimation::update_skeleton( + &target_base, + ( + ability_id, + s.stage_section, + current_strike, + time, + state.state_time, ), - _ => anim::arthropod::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - } + progress, + &mut state_animation_rate, + skeleton_attr, + ) }, CharacterState::LeapMelee(s) => { let stage_time = s.timer.as_secs_f32(); @@ -5733,6 +5501,8 @@ impl FigureMgr { Some(s.static_data.ability_info), current_strike, move_dir, + rel_vel, + state.acc_vel, ), progress, &mut state_animation_rate, @@ -5899,75 +5669,6 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; - let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - match s.stage { - 1 => anim::biped_large::AlphaAnimation::update_skeleton( - &target_base, - ( - active_tool_kind, - (second_tool_kind, second_tool_spec), - rel_vel, - time, - Some(s.stage_section), - state.acc_vel, - state.state_time, - ability_id, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - 2 => anim::biped_large::BetaAnimation::update_skeleton( - &target_base, - ( - active_tool_kind, - (second_tool_kind, second_tool_spec), - rel_vel, - time, - Some(s.stage_section), - state.acc_vel, - ability_id, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - _ => anim::biped_large::BetaAnimation::update_skeleton( - &target_base, - ( - active_tool_kind, - (second_tool_kind, second_tool_spec), - rel_vel, - time, - Some(s.stage_section), - state.acc_vel, - ability_id, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - } - }, CharacterState::RapidMelee(s) => { let stage_time = s.timer.as_secs_f32(); let stage_progress = match s.stage_section { @@ -6288,35 +5989,6 @@ impl FigureMgr { ), }; let target_bones = match &character { - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; - let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - - anim::golem::AlphaAnimation::update_skeleton( - &target_base, - (Some(s.stage_section), time, state.state_time, ability_id), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ) - }, CharacterState::BasicRanged(s) => { let stage_time = s.timer.as_secs_f32(); diff --git a/voxygen/src/session/mod.rs b/voxygen/src/session/mod.rs index 41dc581495..f0fbbce1fa 100644 --- a/voxygen/src/session/mod.rs +++ b/voxygen/src/session/mod.rs @@ -272,7 +272,7 @@ impl SessionState { self.mumble_link.update(player_pos, player_pos); } - for event in client.tick(self.inputs.clone(), dt, crate::ecs::sys::add_local_systems)? { + for event in client.tick(self.inputs.clone(), dt)? { match event { client::Event::Chat(m) => { self.hud.new_message(m); @@ -412,7 +412,7 @@ impl SessionState { client::Event::CharacterCreated(_) => {}, client::Event::CharacterEdited(_) => {}, client::Event::CharacterError(_) => {}, - client::Event::CharacterJoined(_) => {}, + client::Event::CharacterJoined(_) => self.scene.music_mgr.reset_track(), client::Event::MapMarker(event) => { self.hud.show.update_map_markers(event); }, @@ -1493,8 +1493,8 @@ impl PlayState for SessionState { num_particles: self.scene.particle_mgr().particle_count() as u32, num_particles_visible: self.scene.particle_mgr().particle_count_visible() as u32, - current_track: self.scene.music_mgr().current_track.clone(), - current_artist: self.scene.music_mgr().current_artist.clone(), + current_track: self.scene.music_mgr().current_track(), + current_artist: self.scene.music_mgr().current_artist(), } }); diff --git a/voxygen/src/singleplayer/mod.rs b/voxygen/src/singleplayer/mod.rs index 6920188078..9c0280295c 100644 --- a/voxygen/src/singleplayer/mod.rs +++ b/voxygen/src/singleplayer/mod.rs @@ -87,6 +87,7 @@ impl SingleplayerState { settings.map_file = Some(file_opts); settings.world_seed = world.seed; + settings.day_length = world.day_length; let (stop_server_s, stop_server_r) = unbounded(); diff --git a/voxygen/src/singleplayer/singleplayer_world.rs b/voxygen/src/singleplayer/singleplayer_world.rs index 8885064b08..4f76ee1198 100644 --- a/voxygen/src/singleplayer/singleplayer_world.rs +++ b/voxygen/src/singleplayer/singleplayer_world.rs @@ -1,9 +1,10 @@ use std::{ fs, + io::Read, path::{Path, PathBuf}, }; -use common::assets::ASSETS_PATH; +use common::{assets::ASSETS_PATH, consts::DAY_LENGTH_DEFAULT}; use serde::{Deserialize, Serialize}; use server::{FileOpts, GenOpts, DEFAULT_WORLD_MAP}; use tracing::error; @@ -18,6 +19,7 @@ struct World0 { pub struct SingleplayerWorld { pub name: String, pub gen_opts: Option, + pub day_length: f64, pub seed: u32, pub is_generated: bool, pub path: PathBuf, @@ -40,7 +42,12 @@ fn load_map(path: &Path) -> Option { return None; }; - version::try_load(&f, path) + let Ok(bytes) = f.bytes().collect::, _>>() else { + error!("Failed to read {}", meta_path.to_string_lossy()); + return None; + }; + + version::try_load(std::io::Cursor::new(bytes), path) } fn write_world_meta(world: &SingleplayerWorld) { @@ -78,11 +85,13 @@ fn migrate_old_singleplayer(from: &Path, to: &Path) { } let mut seed = 0; + let mut day_length = DAY_LENGTH_DEFAULT; let (map_file, gen_opts) = fs::read_to_string(to.join("server_config/settings.ron")) .ok() .and_then(|settings| { let settings: server::Settings = ron::from_str(&settings).ok()?; seed = settings.world_seed; + day_length = settings.day_length; Some(match settings.map_file? { FileOpts::LoadOrGenerate { name, opts, .. } => { (Some(PathBuf::from(name)), Some(opts)) @@ -107,6 +116,7 @@ fn migrate_old_singleplayer(from: &Path, to: &Path) { name: "singleplayer world".to_string(), gen_opts, seed, + day_length, path: to.to_path_buf(), // Isn't persisted so doesn't matter what it's set to. is_generated: false, @@ -226,6 +236,7 @@ impl SingleplayerWorlds { let new_world = SingleplayerWorld { name: "New World".to_string(), gen_opts: None, + day_length: DAY_LENGTH_DEFAULT, seed: 0, is_generated: false, map_path: path.join("map.bin"), @@ -251,13 +262,13 @@ mod version { use super::*; - pub type Current = V1; + pub type Current = V2; type LoadWorldFn = fn(R, &Path) -> Result; fn loaders<'a, R: std::io::Read + Clone>() -> &'a [LoadWorldFn] { // Step [4] - &[load_raw::] + &[load_raw::, load_raw::] } #[derive(Deserialize, Serialize)] @@ -269,18 +280,6 @@ mod version { seed: u32, } - impl V1 { - /// This function is only needed for the current version - pub fn from_world(world: &SingleplayerWorld) -> Self { - V1 { - version: 1, - name: world.name.clone(), - gen_opts: world.gen_opts.clone(), - seed: world.seed, - } - } - } - impl ToWorld for V1 { fn to_world(self, path: PathBuf) -> SingleplayerWorld { let map_path = path.join("map.bin"); @@ -290,6 +289,46 @@ mod version { name: self.name, gen_opts: self.gen_opts, seed: self.seed, + day_length: DAY_LENGTH_DEFAULT, + is_generated, + path, + map_path, + } + } + } + + #[derive(Deserialize, Serialize)] + pub struct V2 { + #[serde(deserialize_with = "version::<_, 2>")] + version: u64, + name: String, + gen_opts: Option, + seed: u32, + day_length: f64, + } + + impl V2 { + pub fn from_world(world: &SingleplayerWorld) -> Self { + V2 { + version: 2, + name: world.name.clone(), + gen_opts: world.gen_opts.clone(), + seed: world.seed, + day_length: world.day_length, + } + } + } + + impl ToWorld for V2 { + fn to_world(self, path: PathBuf) -> SingleplayerWorld { + let map_path = path.join("map.bin"); + let is_generated = fs::metadata(&map_path).is_ok_and(|f| f.is_file()); + + SingleplayerWorld { + name: self.name, + gen_opts: self.gen_opts, + seed: self.seed, + day_length: self.day_length, is_generated, path, map_path, diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index c1cc1fb621..e2e5076562 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -1347,7 +1347,7 @@ impl Window { // Check if folder exists and create it if it does not if !path.exists() { if let Err(e) = std::fs::create_dir_all(&path) { - warn!(?e, "Couldn't create folder for screenshot"); + warn!(?e, ?path, "Couldn't create folder for screenshot"); let _result = sender.send(String::from("Couldn't create folder for screenshot")); } @@ -1360,8 +1360,8 @@ impl Window { .unwrap_or(0) )); // Try to save the image - if let Err(e) = image.into_rgba8().save(&path) { - warn!(?e, "Couldn't save screenshot"); + if let Err(e) = image.save(&path) { + warn!(?e, ?path, "Couldn't save screenshot"); let _result = sender.send(String::from("Couldn't save screenshot")); } else { let _result = diff --git a/world/src/layer/cave.rs b/world/src/layer/cave.rs index 17788ada9d..da50591377 100644 --- a/world/src/layer/cave.rs +++ b/world/src/layer/cave.rs @@ -124,11 +124,12 @@ impl Tunnel { * 96.0 * ((1.0 - (t - 0.5).abs() * 2.0) * 8.0).min(1.0); let alt_here = info.land().get_alt_approx(closest.map(|e| e as i32)); - let base = Lerp::lerp( + let base = (Lerp::lerp( alt_here as f64 - self.a.depth as f64, alt_here as f64 - self.b.depth as f64, t, - ) + z_offs; + ) + z_offs) + .min(alt_here as f64); Some(( (base - height_here * 0.3) as i32..(base + height_here * 1.35) as i32, radius, diff --git a/world/src/lib.rs b/world/src/lib.rs index 604af5618c..02a4565a65 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -378,7 +378,18 @@ impl World { sim_chunk .sites .iter() - .find_map(|site| index.sites[*site].kind.convert_to_meta()), + .filter(|id| { + index.sites[**id] + .get_origin() + .distance_squared(chunk_center_wpos2d) as f32 + <= index.sites[**id].radius().powi(2) + }) + .min_by_key(|id| { + index.sites[**id] + .get_origin() + .distance_squared(chunk_center_wpos2d) + }) + .map(|id| index.sites[*id].kind.convert_to_meta().unwrap_or_default()), ); let mut chunk = TerrainChunk::new(base_z, stone, air, meta); diff --git a/world/src/site/mod.rs b/world/src/site/mod.rs index 45c05d42d9..c16ddf5143 100644 --- a/world/src/site/mod.rs +++ b/world/src/site/mod.rs @@ -467,6 +467,7 @@ impl SiteKind { }, SiteKind::Dungeon(_) => Some(SiteKindMeta::Dungeon(DungeonKindMeta::Old)), SiteKind::Gnarling(_) => Some(SiteKindMeta::Dungeon(DungeonKindMeta::Gnarling)), + SiteKind::Adlet(_) => Some(SiteKindMeta::Dungeon(DungeonKindMeta::Adlet)), _ => None, } }