From 98e93d1a1c61be034166173cef050cb721d4d285 Mon Sep 17 00:00:00 2001 From: flo Date: Wed, 22 Feb 2023 01:32:05 +0000 Subject: [PATCH] spawn and loot tweaks, tursus and werewolf anims --- .../common/abilities/ability_set_manifest.ron | 5 + .../abilities/custom/tursus_claws/basic.ron | 17 + .../common/entity/wild/aggressive/axebeak.ron | 2 +- .../entity/wild/aggressive/bristleback.ron | 2 +- .../common/entity/wild/aggressive/tursus.ron | 2 +- .../items/npc_weapons/unique/akhlut.ron | 21 + .../items/npc_weapons/unique/tursus_claws.ron | 21 + .../creature/biped_large/tursus.ron | 4 + .../loot_tables/creature/theropod/axebeak.ron | 5 + .../voxel/biped_large_lateral_manifest.ron | 18 +- .../voxygen/voxel/biped_weapon_manifest.ron | 4 + assets/world/wildlife/spawn/arctic/ocean.ron | 6 +- assets/world/wildlife/spawn/taiga/area.ron | 1 + .../wildlife/spawn/temperate/rainforest.ron | 1 - common/src/comp/inventory/loadout_builder.rs | 5 +- voxygen/anim/src/biped_large/alpha.rs | 547 ++++++++++-------- voxygen/anim/src/biped_large/beam.rs | 255 ++++---- voxygen/anim/src/biped_large/beta.rs | 93 +-- voxygen/anim/src/biped_large/chargemelee.rs | 191 +++--- voxygen/anim/src/biped_large/dash.rs | 118 ++-- voxygen/anim/src/biped_large/mod.rs | 4 +- voxygen/anim/src/biped_large/shockwave.rs | 232 ++++---- voxygen/anim/src/biped_large/shoot.rs | 270 ++++----- voxygen/anim/src/biped_large/spritesummon.rs | 160 +++-- voxygen/anim/src/biped_large/stunned.rs | 2 +- voxygen/anim/src/biped_large/summon.rs | 188 +++--- voxygen/anim/src/biped_large/wield.rs | 2 +- voxygen/anim/src/bird_medium/mod.rs | 28 +- voxygen/anim/src/character/music.rs | 417 ++++++------- voxygen/src/scene/figure/mod.rs | 37 +- world/src/site2/plot/sea_chapel.rs | 2 +- 31 files changed, 1347 insertions(+), 1313 deletions(-) create mode 100644 assets/common/abilities/custom/tursus_claws/basic.ron create mode 100644 assets/common/items/npc_weapons/unique/akhlut.ron create mode 100644 assets/common/items/npc_weapons/unique/tursus_claws.ron create mode 100644 assets/common/loot_tables/creature/biped_large/tursus.ron create mode 100644 assets/common/loot_tables/creature/theropod/axebeak.ron diff --git a/assets/common/abilities/ability_set_manifest.ron b/assets/common/abilities/ability_set_manifest.ron index c31791ac1b..2dbf822acb 100644 --- a/assets/common/abilities/ability_set_manifest.ron +++ b/assets/common/abilities/ability_set_manifest.ron @@ -211,6 +211,11 @@ secondary: "common.abilities.custom.beastclaws.basic", abilities: [], ), + Custom("Tursus Claws"): ( + primary: "common.abilities.custom.tursus_claws.basic", + secondary: "common.abilities.custom.tursus_claws.basic", + abilities: [], + ), Custom("Wendigo Magic"): ( primary: "common.abilities.custom.wendigomagic.frostbomb", secondary: "common.abilities.custom.wendigomagic.singlestrike", diff --git a/assets/common/abilities/custom/tursus_claws/basic.ron b/assets/common/abilities/custom/tursus_claws/basic.ron new file mode 100644 index 0000000000..4829d1aa99 --- /dev/null +++ b/assets/common/abilities/custom/tursus_claws/basic.ron @@ -0,0 +1,17 @@ +BasicMelee( + energy_cost: 0, + buildup_duration: 0.5, + swing_duration: 0.1, + recover_duration: 0.5, + melee_constructor: ( + kind: Slash( + damage: 40.0, + poise: 40.0, + knockback: 25.0, + energy_regen: 0.0, + ), + range: 5.0, + angle: 120.0, + ), + ori_modifier: 1.0, +) diff --git a/assets/common/entity/wild/aggressive/axebeak.ron b/assets/common/entity/wild/aggressive/axebeak.ron index 1e5b678eaf..fcb6aee780 100644 --- a/assets/common/entity/wild/aggressive/axebeak.ron +++ b/assets/common/entity/wild/aggressive/axebeak.ron @@ -3,7 +3,7 @@ name: Automatic, body: RandomWith("axebeak"), alignment: Alignment(Enemy), - loot: LootTable("common.loot_tables.creature.theropod.horned"), + loot: LootTable("common.loot_tables.creature.theropod.axebeak"), inventory: ( loadout: FromBody, ), diff --git a/assets/common/entity/wild/aggressive/bristleback.ron b/assets/common/entity/wild/aggressive/bristleback.ron index e7fe06176f..19cd225825 100644 --- a/assets/common/entity/wild/aggressive/bristleback.ron +++ b/assets/common/entity/wild/aggressive/bristleback.ron @@ -3,7 +3,7 @@ name: Automatic, body: RandomWith("bristleback"), alignment: Alignment(Enemy), - loot: LootTable("common.loot_tables.creature.quad_medium.generic"), + loot: LootTable("common.loot_tables.creature.quad_medium.tuskram"), inventory: ( loadout: FromBody, ), diff --git a/assets/common/entity/wild/aggressive/tursus.ron b/assets/common/entity/wild/aggressive/tursus.ron index c072efdcbe..b434acca4c 100644 --- a/assets/common/entity/wild/aggressive/tursus.ron +++ b/assets/common/entity/wild/aggressive/tursus.ron @@ -3,7 +3,7 @@ name: Automatic, body: RandomWith("tursus"), alignment: Alignment(Enemy), - loot: LootTable("common.loot_tables.creature.biped_large.default"), + loot: LootTable("common.loot_tables.creature.biped_large.tursus"), inventory: ( loadout: FromBody, ), diff --git a/assets/common/items/npc_weapons/unique/akhlut.ron b/assets/common/items/npc_weapons/unique/akhlut.ron new file mode 100644 index 0000000000..f40170652a --- /dev/null +++ b/assets/common/items/npc_weapons/unique/akhlut.ron @@ -0,0 +1,21 @@ +ItemDef( + name: "Quad Med Basic", + description: "testing123", + kind: Tool(( + kind: Natural, + hands: Two, + stats: ( + equip_time_secs: 0.01, + power: 1.25, + effect_power: 1.0, + speed: 1.0, + crit_chance: 0.0625, + range: 1.0, + energy_efficiency: 1.0, + buff_strength: 1.0, + ), + )), + quality: Low, + tags: [], + ability_spec: Some(Custom("Quad Med Basic")), +) \ No newline at end of file diff --git a/assets/common/items/npc_weapons/unique/tursus_claws.ron b/assets/common/items/npc_weapons/unique/tursus_claws.ron new file mode 100644 index 0000000000..d804964d53 --- /dev/null +++ b/assets/common/items/npc_weapons/unique/tursus_claws.ron @@ -0,0 +1,21 @@ +ItemDef( + name: "Tursus Claws", + description: "Was attached to a beast.", + kind: Tool(( + kind: Natural, + hands: Two, + stats: ( + equip_time_secs: 0.5, + power: 1.0, + effect_power: 1.0, + speed: 1.0, + crit_chance: 0.0625, + range: 1.0, + energy_efficiency: 1.0, + buff_strength: 1.0, + ), + )), + quality: Low, + tags: [], + ability_spec: Some(Custom("Tursus Claws")), +) \ No newline at end of file diff --git a/assets/common/loot_tables/creature/biped_large/tursus.ron b/assets/common/loot_tables/creature/biped_large/tursus.ron new file mode 100644 index 0000000000..364321aa8d --- /dev/null +++ b/assets/common/loot_tables/creature/biped_large/tursus.ron @@ -0,0 +1,4 @@ +[ + (1.0, Item("common.items.crafting_ing.hide.rugged_hide")), + (1.0, ItemQuantity("common.items.crafting_ing.animal_misc.long_tusk", 1, 2)), +] \ No newline at end of file diff --git a/assets/common/loot_tables/creature/theropod/axebeak.ron b/assets/common/loot_tables/creature/theropod/axebeak.ron new file mode 100644 index 0000000000..e531d2db9f --- /dev/null +++ b/assets/common/loot_tables/creature/theropod/axebeak.ron @@ -0,0 +1,5 @@ +[ + (4.0, ItemQuantity("common.items.crafting_ing.animal_misc.elegant_crest", 3, 6)), + (1.0, Item("common.items.crafting_ing.animal_misc.raptor_feather")), + (0.5, Item("common.items.weapons.hammer.burnt_drumstick")), +] \ No newline at end of file diff --git a/assets/voxygen/voxel/biped_large_lateral_manifest.ron b/assets/voxygen/voxel/biped_large_lateral_manifest.ron index f1cd82e135..89239a3ce3 100644 --- a/assets/voxygen/voxel/biped_large_lateral_manifest.ron +++ b/assets/voxygen/voxel/biped_large_lateral_manifest.ron @@ -1429,19 +1429,19 @@ ), (Tursus, Male): ( shoulder_l: ( - offset: (-4.5, -4.0, -8.0), + offset: (-5.0, -3.5, -5.0), lateral: ("npc.tursus.male.shoulder_l"), ), shoulder_r: ( - offset: (-4.5, -4.0, -8.0), + offset: (-5.0, -3.5, -5.0), lateral: ("npc.tursus.male.shoulder_r"), ), hand_l: ( - offset: (-5.5, -3.5, -15.0), + offset: (-6.0, -3.5, -16.0), lateral: ("npc.tursus.male.hand_l"), ), hand_r: ( - offset: (-5.5, -3.5, -15.0), + offset: (-6.0, -3.5, -16.0), lateral: ("npc.tursus.male.hand_r"), ), leg_l: ( @@ -1462,20 +1462,20 @@ ), ), (Tursus, Female): ( - shoulder_l: ( - offset: (-4.5, -4.0, -8.0), + shoulder_l: ( + offset: (-5.0, -3.5, -5.0), lateral: ("npc.tursus.male.shoulder_l"), ), shoulder_r: ( - offset: (-4.5, -4.0, -8.0), + offset: (-5.0, -3.5, -5.0), lateral: ("npc.tursus.male.shoulder_r"), ), hand_l: ( - offset: (-5.5, -3.5, -15.0), + offset: (-6.0, -3.5, -16.0), lateral: ("npc.tursus.male.hand_l"), ), hand_r: ( - offset: (-5.5, -3.5, -15.0), + offset: (-6.0, -3.5, -16.0), lateral: ("npc.tursus.male.hand_r"), ), leg_l: ( diff --git a/assets/voxygen/voxel/biped_weapon_manifest.ron b/assets/voxygen/voxel/biped_weapon_manifest.ron index 3193ad31e4..f0b62fd118 100644 --- a/assets/voxygen/voxel/biped_weapon_manifest.ron +++ b/assets/voxygen/voxel/biped_weapon_manifest.ron @@ -1622,6 +1622,10 @@ vox_spec: ("armor.empty", (0.0, 0.0, 0.0)), color: None ), + Tool("common.items.npc_weapons.unique.tursus_claws"): ( + vox_spec: ("armor.empty", (0.0, 0.0, 0.0)), + color: None + ), Tool("common.items.npc_weapons.unique.wendigo_magic"): ( vox_spec: ("armor.empty", (0.0, 0.0, 0.0)), color: None diff --git a/assets/world/wildlife/spawn/arctic/ocean.ron b/assets/world/wildlife/spawn/arctic/ocean.ron index 4d96c71c0d..7d13c77cf0 100644 --- a/assets/world/wildlife/spawn/arctic/ocean.ron +++ b/assets/world/wildlife/spawn/arctic/ocean.ron @@ -11,8 +11,10 @@ SpawnEntry ( ), Pack( groups: [ - (2, (4, 12, "common.entity.wild.peaceful.penguin")), - (2, (4, 8, "common.entity.wild.peaceful.seal")), + (4, (4, 12, "common.entity.wild.peaceful.penguin")), + (4, (4, 8, "common.entity.wild.peaceful.seal")), + (1, (1, 1, "common.entity.wild.aggressive.tursus")), + (1, (1, 1, "common.entity.wild.aggressive.akhlut")), ], spawn_mode: Ice, day_period: [Night, Morning, Noon, Evening], diff --git a/assets/world/wildlife/spawn/taiga/area.ron b/assets/world/wildlife/spawn/taiga/area.ron index 42f10d4709..83b45ef0fd 100644 --- a/assets/world/wildlife/spawn/taiga/area.ron +++ b/assets/world/wildlife/spawn/taiga/area.ron @@ -10,6 +10,7 @@ SpawnEntry ( (1, (1, 1, "common.entity.wild.peaceful.moose")), (1, (1, 1, "common.entity.wild.peaceful.arctic_hare")), (1, (1, 1, "common.entity.wild.peaceful.tuskram")), + (1, (1, 1, "common.entity.wild.aggressive.bristleback")), (1, (1, 4, "common.entity.wild.peaceful.crow")), ], spawn_mode: Land, diff --git a/assets/world/wildlife/spawn/temperate/rainforest.ron b/assets/world/wildlife/spawn/temperate/rainforest.ron index a872a05ae4..61ec524242 100644 --- a/assets/world/wildlife/spawn/temperate/rainforest.ron +++ b/assets/world/wildlife/spawn/temperate/rainforest.ron @@ -43,7 +43,6 @@ SpawnEntry ( (1, (1, 1, "common.entity.wild.aggressive.batfox")), (5, (1, 1, "common.entity.wild.peaceful.forest_fox")), (5, (1, 1, "common.entity.wild.peaceful.raccoon")), - (3, (1, 1, "common.entity.wild.aggressive.bristleback")), // Pack (5, (1, 3, "common.entity.wild.peaceful.rat")), (5, (1, 3, "common.entity.wild.peaceful.squirrel")), diff --git a/common/src/comp/inventory/loadout_builder.rs b/common/src/comp/inventory/loadout_builder.rs index f539fcd72a..7909afada2 100644 --- a/common/src/comp/inventory/loadout_builder.rs +++ b/common/src/comp/inventory/loadout_builder.rs @@ -570,6 +570,9 @@ fn default_main_tool(body: &Body) -> Item { | quadruped_medium::Species::Yak => Some(Item::new_from_asset_expect( "common.items.npc_weapons.unique.quadmedbasicgentle", )), + quadruped_medium::Species::Akhlut => Some(Item::new_from_asset_expect( + "common.items.npc_weapons.unique.akhlut", + )), _ => Some(Item::new_from_asset_expect( "common.items.npc_weapons.unique.quadmedbasic", )), @@ -688,7 +691,7 @@ fn default_main_tool(body: &Body) -> Item { "common.items.npc_weapons.unique.beast_claws", )), (biped_large::Species::Tursus, _) => Some(Item::new_from_asset_expect( - "common.items.npc_weapons.unique.beast_claws", + "common.items.npc_weapons.unique.tursus_claws", )), (biped_large::Species::Cyclops, _) => Some(Item::new_from_asset_expect( "common.items.npc_weapons.hammer.cyclops_hammer", diff --git a/voxygen/anim/src/biped_large/alpha.rs b/voxygen/anim/src/biped_large/alpha.rs index f989d34992..0b0e17ce05 100644 --- a/voxygen/anim/src/biped_large/alpha.rs +++ b/voxygen/anim/src/biped_large/alpha.rs @@ -12,7 +12,7 @@ pub struct AlphaAnimation; impl Animation for AlphaAnimation { type Dependency<'a> = ( - (Option, Option<&'a AbilitySpec>), + Option, (Option, Option<&'a AbilitySpec>), Vec3, f32, @@ -30,7 +30,7 @@ impl Animation for AlphaAnimation { fn update_skeleton_inner( skeleton: &Self::Skeleton, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, _second_tool, velocity, global_time, @@ -146,7 +146,7 @@ impl Animation for AlphaAnimation { * Quaternion::rotation_z(move1 * -0.8 + move2 * -0.8); }, Some(ToolKind::Axe) => match ability_id { - Some("common.abilities.custom.gigas_frost.combomelee") => { + Some("common.abilities.custom.gigas_frost.cleave") => { 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); @@ -230,267 +230,334 @@ impl Animation for AlphaAnimation { * Quaternion::rotation_z(move1 * -1.0 + move2 * -1.5); }, }, - Some(ToolKind::Natural) => { - if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { - match spec.as_str() { - "Wendigo Magic" => { - next.torso.position = Vec3::new(0.0, 0.0, move1 * -2.18); - next.upper_torso.orientation = - Quaternion::rotation_x(move1 * -0.5 + move2 * -0.4); - next.lower_torso.orientation = - Quaternion::rotation_x(move1 * 0.5 + move2 * 0.4); + Some(ToolKind::Natural) => match ability_id { + Some("common.abilities.custom.wendigomagic.singlestrike") => { + next.torso.position = Vec3::new(0.0, 0.0, move1 * -2.18); + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * -0.5 + move2 * -0.4); + next.lower_torso.orientation = + Quaternion::rotation_x(move1 * 0.5 + move2 * 0.4); - next.control_l.position = Vec3::new( - -9.0 + move2 * 6.0, - 19.0 + move1 * 6.0, - -13.0 + move1 * 10.5, - ); - next.control_r.position = Vec3::new( - 9.0 + move2 * -6.0, - 19.0 + move1 * 6.0, - -13.0 + move1 * 14.5, - ); + next.control_l.position = + Vec3::new(-9.0 + move2 * 6.0, 19.0 + move1 * 6.0, -13.0 + move1 * 10.5); + next.control_r.position = + Vec3::new(9.0 + move2 * -6.0, 19.0 + move1 * 6.0, -13.0 + move1 * 14.5); - next.control_l.orientation = - Quaternion::rotation_x(PI / 3.0 + move1 * 0.5) - * Quaternion::rotation_y(-0.15) - * Quaternion::rotation_z(move1 * 0.5 + move2 * -0.6); - next.control_r.orientation = - Quaternion::rotation_x(PI / 3.0 + move1 * 0.5) - * Quaternion::rotation_y(0.15) - * Quaternion::rotation_z(move1 * -0.5 + move2 * 0.6); - next.head.orientation = Quaternion::rotation_x(move1 * 0.3); - }, - "Tidal Warrior" => { - if mirror > 0.0 { - next.head.orientation = Quaternion::rotation_z(move1 * 0.75); - next.upper_torso.orientation = - Quaternion::rotation_x(move1 * 0.2 + move2 * 0.7) - * Quaternion::rotation_z(move1 * -1.0 + move2 * 1.3); - next.lower_torso.orientation = - Quaternion::rotation_x(move1 * 0.2 + move2 * -0.7) - * Quaternion::rotation_y(move1 * -0.5 + move2 * 0.7) - * Quaternion::rotation_z(move1 * 1.0 + move2 * -1.2); + next.control_l.orientation = Quaternion::rotation_x(PI / 3.0 + move1 * 0.5) + * Quaternion::rotation_y(-0.15) + * Quaternion::rotation_z(move1 * 0.5 + move2 * -0.6); + next.control_r.orientation = Quaternion::rotation_x(PI / 3.0 + move1 * 0.5) + * Quaternion::rotation_y(0.15) + * Quaternion::rotation_z(move1 * -0.5 + move2 * 0.6); + next.head.orientation = Quaternion::rotation_x(move1 * 0.3); + }, - next.shoulder_l.orientation = - Quaternion::rotation_x(move1 * 0.3 + move2 * 0.8) - * Quaternion::rotation_y(move1 * -0.3 + move2 * -0.5); - next.hand_l.position = Vec3::new( - -14.0 + move1 * -2.0 + move2 * 4.0, - 2.0 + move2 * 4.0, - -4.0 + move2 * 3.0, - ); + Some("common.abilities.custom.tidalwarrior.pincer") => { + if mirror > 0.0 { + next.head.orientation = Quaternion::rotation_z(move1 * 0.75); + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * 0.2 + move2 * 0.7) + * Quaternion::rotation_z(move1 * -1.0 + move2 * 1.3); + next.lower_torso.orientation = + Quaternion::rotation_x(move1 * 0.2 + move2 * -0.7) + * Quaternion::rotation_y(move1 * -0.5 + move2 * 0.7) + * Quaternion::rotation_z(move1 * 1.0 + move2 * -1.2); - next.hand_l.orientation = - Quaternion::rotation_x(PI / 3.0 + move2 * 1.5) - * Quaternion::rotation_y(move2 * 0.5) - * Quaternion::rotation_z( - -0.35 + move1 * -0.5 + move2 * 1.0, - ); - next.hand_r.position = Vec3::new(14.0, 2.0, -4.0); + next.shoulder_l.orientation = + Quaternion::rotation_x(move1 * 0.3 + move2 * 0.8) + * Quaternion::rotation_y(move1 * -0.3 + move2 * -0.5); + next.hand_l.position = Vec3::new( + -14.0 + move1 * -2.0 + move2 * 4.0, + 2.0 + move2 * 4.0, + -4.0 + move2 * 3.0, + ); - next.hand_r.orientation = - Quaternion::rotation_x(PI / 3.0) * Quaternion::rotation_z(0.35); + next.hand_l.orientation = Quaternion::rotation_x(PI / 3.0 + move2 * 1.5) + * Quaternion::rotation_y(move2 * 0.5) + * Quaternion::rotation_z(-0.35 + move1 * -0.5 + move2 * 1.0); + next.hand_r.position = Vec3::new(14.0, 2.0, -4.0); - next.shoulder_r.orientation = Quaternion::rotation_x(0.0); - } else { - next.head.orientation = Quaternion::rotation_z(move1 * -0.75); - next.upper_torso.orientation = - Quaternion::rotation_x(move1 * 0.2 + move2 * 0.7) - * Quaternion::rotation_z(move1 * 1.0 + move2 * -1.3); - next.lower_torso.orientation = - Quaternion::rotation_x(move1 * 0.2 + move2 * -0.7) - * Quaternion::rotation_y(move1 * 0.5 + move2 * -0.7) - * Quaternion::rotation_z(move1 * -1.0 + move2 * 1.2); + next.hand_r.orientation = + Quaternion::rotation_x(PI / 3.0) * Quaternion::rotation_z(0.35); - next.shoulder_r.orientation = - Quaternion::rotation_x(move1 * 0.3 + move2 * 0.8) - * Quaternion::rotation_y(move1 * 0.3 + move2 * 0.5); - next.hand_r.position = Vec3::new( - 14.0 + move1 * 2.0 + move2 * -4.0, - 2.0 + move2 * 4.0, - -4.0 + move2 * 3.0, - ); + next.shoulder_r.orientation = Quaternion::rotation_x(0.0); + } else { + next.head.orientation = Quaternion::rotation_z(move1 * -0.75); + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * 0.2 + move2 * 0.7) + * Quaternion::rotation_z(move1 * 1.0 + move2 * -1.3); + next.lower_torso.orientation = + Quaternion::rotation_x(move1 * 0.2 + move2 * -0.7) + * Quaternion::rotation_y(move1 * 0.5 + move2 * -0.7) + * Quaternion::rotation_z(move1 * -1.0 + move2 * 1.2); - next.hand_r.orientation = - Quaternion::rotation_x(PI / 3.0 + move2 * 1.5) - * Quaternion::rotation_y(move2 * -0.5) - * Quaternion::rotation_z(0.35 + move1 * 0.5 + move2 * -1.0); - next.hand_l.position = Vec3::new(-14.0, 2.0, -4.0); + next.shoulder_r.orientation = + Quaternion::rotation_x(move1 * 0.3 + move2 * 0.8) + * Quaternion::rotation_y(move1 * 0.3 + move2 * 0.5); + next.hand_r.position = Vec3::new( + 14.0 + move1 * 2.0 + move2 * -4.0, + 2.0 + move2 * 4.0, + -4.0 + move2 * 3.0, + ); - next.hand_l.orientation = Quaternion::rotation_x(PI / 3.0) - * Quaternion::rotation_z(-0.35); + next.hand_r.orientation = Quaternion::rotation_x(PI / 3.0 + move2 * 1.5) + * Quaternion::rotation_y(move2 * -0.5) + * Quaternion::rotation_z(0.35 + move1 * 0.5 + move2 * -1.0); + next.hand_l.position = Vec3::new(-14.0, 2.0, -4.0); - next.shoulder_l.orientation = Quaternion::rotation_x(0.0); - }; - next.torso.position = Vec3::new(0.0, move2 * -10.35, move2 * -4.7); - }, - "Minotaur" => { - next.control_l.position = Vec3::new(0.0, 4.0, 5.0); - next.control_r.position = Vec3::new(0.0, 4.0, 5.0); - next.weapon_l.position = Vec3::new( - -12.0 + move1 * -9.0 + move2 * 16.0, - -6.0 + move2 * 8.0, - -18.0 + move1 * 8.0 + move2 * -4.0, - ); - next.weapon_r.position = Vec3::new( - 12.0 + move1 * 9.0 + move2 * -16.0, - -6.0 + move2 * 8.0, - -18.0 + move1 * 8.0 + move2 * -8.0, - ); + next.hand_l.orientation = + Quaternion::rotation_x(PI / 3.0) * Quaternion::rotation_z(-0.35); - next.weapon_l.orientation = Quaternion::rotation_x(-1.67) - * Quaternion::rotation_y(move1 * -0.3 + move2 * 1.0) - * Quaternion::rotation_z(move1 * 0.8 + move2 * -1.8); - next.weapon_r.orientation = Quaternion::rotation_x(-1.67) - * Quaternion::rotation_y(move1 * 0.3 + move2 * -0.6) - * Quaternion::rotation_z(move1 * -0.8 + move2 * 1.8); + next.shoulder_l.orientation = Quaternion::rotation_x(0.0); + }; + next.torso.position = Vec3::new(0.0, move2 * -10.35, move2 * -4.7); + }, + Some("common.abilities.custom.minotaur.cripplingstrike") => { + next.control_l.position = Vec3::new(0.0, 4.0, 5.0); + next.control_r.position = Vec3::new(0.0, 4.0, 5.0); + next.weapon_l.position = Vec3::new( + -12.0 + move1 * -9.0 + move2 * 16.0, + -6.0 + move2 * 8.0, + -18.0 + move1 * 8.0 + move2 * -4.0, + ); + next.weapon_r.position = Vec3::new( + 12.0 + move1 * 9.0 + move2 * -16.0, + -6.0 + move2 * 8.0, + -18.0 + move1 * 8.0 + move2 * -8.0, + ); - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0 + move2 * 1.0); - next.control_r.orientation = - Quaternion::rotation_x(PI / 2.0 + move2 * 1.0); + next.weapon_l.orientation = Quaternion::rotation_x(-1.67) + * Quaternion::rotation_y(move1 * -0.3 + move2 * 1.0) + * Quaternion::rotation_z(move1 * 0.8 + move2 * -1.8); + next.weapon_r.orientation = Quaternion::rotation_x(-1.67) + * Quaternion::rotation_y(move1 * 0.3 + move2 * -0.6) + * Quaternion::rotation_z(move1 * -0.8 + move2 * 1.8); - next.shoulder_l.orientation = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(move1 * 0.7 + move2 * -0.7); + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0 + move2 * 1.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + move2 * 1.0); - next.shoulder_r.orientation = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(move1 * -0.7 + move2 * 0.7); - next.second.scale = Vec3::one() * 1.0; - next.head.orientation = - Quaternion::rotation_x(move1 * -0.6 + move2 * 0.4) - }, - "Yeti" => { - 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.shoulder_l.orientation = Quaternion::rotation_x(-0.3) + * Quaternion::rotation_y(move1 * 0.7 + move2 * -0.7); - 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.shoulder_r.orientation = Quaternion::rotation_x(-0.3) + * Quaternion::rotation_y(move1 * -0.7 + move2 * 0.7); + next.second.scale = Vec3::one() * 1.0; + next.head.orientation = Quaternion::rotation_x(move1 * -0.6 + move2 * 0.4) + }, + Some("common.abilities.custom.yeti.strike") => { + 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_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.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.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); - }, - "Harvester" => { - next.head.orientation = - Quaternion::rotation_x(move1 * -0.25 + move2 * 0.25) - * Quaternion::rotation_z(move1 * -0.3 + move2 * 0.4); + 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.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1 + move2 * -0.5); - next.jaw.orientation = Quaternion::rotation_x(move2 * -0.15); + 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); + }, + Some("common.abilities.custom.harvester.scythe") => { + next.head.orientation = Quaternion::rotation_x(move1 * -0.25 + move2 * 0.25) + * Quaternion::rotation_z(move1 * -0.3 + move2 * 0.4); - next.upper_torso.orientation = - Quaternion::rotation_x(move1 * 0.2 + move2 * -0.2) - * Quaternion::rotation_z(move1 * -1.0 + move2 * 1.0); + next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1 + move2 * -0.5); + next.jaw.orientation = Quaternion::rotation_x(move2 * -0.15); - 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(-0.4 + move1 * 1.0 + move2 * -1.0) - * Quaternion::rotation_y(move1 * -0.2); - next.shoulder_r.orientation = - Quaternion::rotation_y(0.4 + move1 * -0.8 + move2 * 0.8) - * Quaternion::rotation_x(0.4 + move1 * -0.4 + move2 * 0.8); + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * 0.2 + move2 * -0.2) + * Quaternion::rotation_z(move1 * -1.0 + move2 * 1.0); - if speed == 0.0 { - next.leg_l.orientation = - Quaternion::rotation_x(move1 * 0.4 + move2 * -0.4); + 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(-0.4 + move1 * 1.0 + move2 * -1.0) + * Quaternion::rotation_y(move1 * -0.2); + next.shoulder_r.orientation = + Quaternion::rotation_y(0.4 + move1 * -0.8 + move2 * 0.8) + * Quaternion::rotation_x(0.4 + move1 * -0.4 + move2 * 0.8); - next.foot_l.position = Vec3::new( - -s_a.foot.0, - s_a.foot.1, - s_a.foot.2 + move1 * 2.0 + move2 * -2.0, - ); - next.foot_l.orientation = - Quaternion::rotation_x(move1 * -0.6 + move2 * 0.6); - } + if speed == 0.0 { + next.leg_l.orientation = Quaternion::rotation_x(move1 * 0.4 + move2 * -0.4); - next.control_l.position = Vec3::new(1.0, 2.0, 8.0); - next.control_r.position = Vec3::new(1.0, 1.0, -2.0); - - next.control.position = Vec3::new( - -7.0 + move1 * 26.0 - move2 * 32.0, - 0.0 + s_a.grip.0 / 1.0 - move1 * 4.0, - -s_a.grip.0 / 0.8, - ); - - next.control_l.orientation = Quaternion::rotation_x(PI / 2.0) - * Quaternion::rotation_y(-0.0) - * Quaternion::rotation_z(PI); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2) - * Quaternion::rotation_y(-1.0 + move1 * 1.0) - * Quaternion::rotation_z(0.0); - - next.control.orientation = Quaternion::rotation_x(-1.4 + move1 * -0.4) - * Quaternion::rotation_y(-2.8 + move1 * 3.0 + move2 * -3.0) - * Quaternion::rotation_z(move1 * -1.5); - }, - "Husk Brute" => { - next.shoulder_l.position = - Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2); - next.shoulder_r.position = - Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2); - next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2); - next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2); - - if mirror > 0.0 { - next.shoulder_l.orientation = Quaternion::rotation_x(move1 * 1.0) - * Quaternion::rotation_y(move1 * 1.0 + move2 * -2.0); - - next.shoulder_r.orientation = Quaternion::rotation_x(move1 * -0.6); - - next.upper_torso.orientation = - Quaternion::rotation_z(move1 * 0.4 + move2 * -1.1); - next.lower_torso.orientation = - Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); - - next.hand_l.orientation = Quaternion::rotation_x(move1 * 1.2) - * Quaternion::rotation_y(move1 * 1.0 + move2 * -2.0); - - next.hand_r.orientation = Quaternion::rotation_z(move1 * 1.0) - * Quaternion::rotation_y(move1 * 0.8 + move2 * -1.2); - } else { - next.shoulder_r.orientation = Quaternion::rotation_x(move1 * 1.0) - * Quaternion::rotation_y(move1 * -1.0 + move2 * 2.0); - - next.shoulder_l.orientation = Quaternion::rotation_x(move1 * 0.6); - - next.upper_torso.orientation = - Quaternion::rotation_z(move1 * -0.4 + move2 * 1.1); - next.lower_torso.orientation = - Quaternion::rotation_z(move1 * 0.2 + move2 * -0.6); - - next.hand_r.orientation = Quaternion::rotation_x(move1 * 1.2) - * Quaternion::rotation_y(move1 * -1.0 + move2 * 2.0); - - next.hand_l.orientation = Quaternion::rotation_z(move1 * 1.0) - * Quaternion::rotation_y(move1 * -0.8 + move2 * 1.2); - } - }, - _ => {}, + next.foot_l.position = Vec3::new( + -s_a.foot.0, + s_a.foot.1, + s_a.foot.2 + move1 * 2.0 + move2 * -2.0, + ); + next.foot_l.orientation = + Quaternion::rotation_x(move1 * -0.6 + move2 * 0.6); } - } + + next.control_l.position = Vec3::new(1.0, 2.0, 8.0); + next.control_r.position = Vec3::new(1.0, 1.0, -2.0); + + next.control.position = Vec3::new( + -7.0 + move1 * 26.0 - move2 * 32.0, + 0.0 + s_a.grip.0 / 1.0 - move1 * 4.0, + -s_a.grip.0 / 0.8, + ); + + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0) + * Quaternion::rotation_y(-0.0) + * Quaternion::rotation_z(PI); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2) + * Quaternion::rotation_y(-1.0 + move1 * 1.0) + * Quaternion::rotation_z(0.0); + + next.control.orientation = Quaternion::rotation_x(-1.4 + move1 * -0.4) + * Quaternion::rotation_y(-2.8 + move1 * 3.0 + move2 * -3.0) + * Quaternion::rotation_z(move1 * -1.5); + }, + Some("common.abilities.custom.husk.singlestrike") => { + next.shoulder_l.position = + Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2); + next.shoulder_r.position = + Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2); + next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2); + next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2); + + if mirror > 0.0 { + next.shoulder_l.orientation = Quaternion::rotation_x(move1 * 1.0) + * Quaternion::rotation_y(move1 * 1.0 + move2 * -2.0); + + next.shoulder_r.orientation = Quaternion::rotation_x(move1 * -0.6); + + next.upper_torso.orientation = + Quaternion::rotation_z(move1 * 0.4 + move2 * -1.1); + next.lower_torso.orientation = + Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); + + next.hand_l.orientation = Quaternion::rotation_x(move1 * 1.2) + * Quaternion::rotation_y(move1 * 1.0 + move2 * -2.0); + + next.hand_r.orientation = Quaternion::rotation_z(move1 * 1.0) + * Quaternion::rotation_y(move1 * 0.8 + move2 * -1.2); + } else { + next.shoulder_r.orientation = Quaternion::rotation_x(move1 * 1.0) + * Quaternion::rotation_y(move1 * -1.0 + move2 * 2.0); + + next.shoulder_l.orientation = Quaternion::rotation_x(move1 * 0.6); + + next.upper_torso.orientation = + Quaternion::rotation_z(move1 * -0.4 + move2 * 1.1); + next.lower_torso.orientation = + Quaternion::rotation_z(move1 * 0.2 + move2 * -0.6); + + next.hand_r.orientation = Quaternion::rotation_x(move1 * 1.2) + * Quaternion::rotation_y(move1 * -1.0 + move2 * 2.0); + + next.hand_l.orientation = Quaternion::rotation_z(move1 * 1.0) + * Quaternion::rotation_y(move1 * -0.8 + move2 * 1.2); + } + }, + Some("common.abilities.custom.beastclaws.basic") => { + next.shoulder_l.position = + Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2); + next.shoulder_r.position = + Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2); + next.hand_l.position = + Vec3::new(-s_a.hand.0 - 3.0, s_a.hand.1 + 4.5, s_a.hand.2 + 0.0); + next.hand_r.position = + Vec3::new(s_a.hand.0 + 3.0, s_a.hand.1 + 4.5, s_a.hand.2 + 0.0); + + if mirror > 0.0 { + next.shoulder_l.orientation = Quaternion::rotation_x(move1 * 1.0) + * Quaternion::rotation_y(move1 * 0.5 + move2 * -1.0); + + next.shoulder_r.orientation = Quaternion::rotation_x(move1 * 0.6); + + next.upper_torso.orientation = + Quaternion::rotation_z(move1 * 0.4 + move2 * -1.1); + next.lower_torso.orientation = + Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); + + next.hand_l.orientation = Quaternion::rotation_x(move1 * 1.2) + * Quaternion::rotation_y(move1 * 0.2 + move2 * -0.5) + * Quaternion::rotation_z(move1 * 2.0); + + next.hand_r.orientation = Quaternion::rotation_z(move1 * -2.0) + * Quaternion::rotation_y(move1 * 0.8 + move2 * -0.6); + } else { + next.shoulder_r.orientation = Quaternion::rotation_x(move1 * 1.0) + * Quaternion::rotation_y(move1 * -0.5 + move2 * 1.0); + + next.shoulder_l.orientation = Quaternion::rotation_x(move1 * 0.6); + + next.upper_torso.orientation = + Quaternion::rotation_z(move1 * -0.4 + move2 * 1.1); + next.lower_torso.orientation = + Quaternion::rotation_z(move1 * 0.2 + move2 * -0.6); + + next.hand_r.orientation = Quaternion::rotation_x(move1 * 1.2) + * Quaternion::rotation_y(move1 * -0.3 + move2 * 0.5) + * Quaternion::rotation_z(move1 * -2.0); + + next.hand_l.orientation = Quaternion::rotation_z(move1 * 1.0) + * Quaternion::rotation_y(move1 * -0.8 + move2 * 0.6); + } + }, + Some("common.abilities.custom.tursus_claws.basic") => { + next.shoulder_l.position = + Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2); + next.shoulder_r.position = + Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2); + next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2 + 4.0); + next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2 + 4.0); + + if mirror > 0.0 { + next.shoulder_l.orientation = Quaternion::rotation_x(move1 * 1.0) + * Quaternion::rotation_y(move1 * 1.0 + move2 * -2.0); + + next.shoulder_r.orientation = Quaternion::rotation_x(move1 * 0.6); + + next.upper_torso.orientation = + Quaternion::rotation_z(move1 * 0.4 + move2 * -1.1); + next.lower_torso.orientation = + Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); + + next.hand_l.orientation = Quaternion::rotation_x(move1 * 1.2) + * Quaternion::rotation_y(move1 * 1.0 + move2 * -2.0); + + next.hand_r.orientation = Quaternion::rotation_z(move1 * -1.0) + * Quaternion::rotation_y(move1 * 0.8 + move2 * -1.2); + } else { + next.shoulder_r.orientation = Quaternion::rotation_x(move1 * 1.0) + * Quaternion::rotation_y(move1 * -1.0 + move2 * 2.0); + + next.shoulder_l.orientation = Quaternion::rotation_x(move1 * 0.6); + + next.upper_torso.orientation = + Quaternion::rotation_z(move1 * -0.4 + move2 * 1.1); + next.lower_torso.orientation = + Quaternion::rotation_z(move1 * 0.2 + move2 * -0.6); + + next.hand_r.orientation = Quaternion::rotation_x(move1 * 1.2) + * Quaternion::rotation_y(move1 * -1.0 + move2 * 2.0); + + next.hand_l.orientation = Quaternion::rotation_z(move1 * 1.0) + * Quaternion::rotation_y(move1 * -0.8 + move2 * 1.2); + } + }, + _ => {}, }, _ => {}, } diff --git a/voxygen/anim/src/biped_large/beam.rs b/voxygen/anim/src/biped_large/beam.rs index 41738a201d..172a0b7637 100644 --- a/voxygen/anim/src/biped_large/beam.rs +++ b/voxygen/anim/src/biped_large/beam.rs @@ -12,13 +12,14 @@ pub struct BeamAnimation; impl Animation for BeamAnimation { type Dependency<'a> = ( - (Option, Option<&'a AbilitySpec>), + Option, (Option, Option<&'a AbilitySpec>), f32, Vec3, Option, f32, f32, + Option<&'a str>, ); type Skeleton = BipedLargeSkeleton; @@ -29,13 +30,14 @@ impl Animation for BeamAnimation { fn update_skeleton_inner( skeleton: &Self::Skeleton, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, _second_tool_kind, global_time, velocity, stage_section, acc_vel, timer, + ability_id, ): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, @@ -123,162 +125,147 @@ impl Animation for BeamAnimation { next.shoulder_r.orientation = Quaternion::rotation_x(move1 * 0.2 + 0.3 + 0.6 * speednorm + (footrotl * -0.2)); }, - Some(ToolKind::Natural) => { - if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { - match spec.as_str() { - "Tidal Warrior" => { - if mirror > 0.0 { - next.head.orientation = Quaternion::rotation_z(move1 * -0.6); - next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.6); - next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.6); + Some(ToolKind::Natural) => match ability_id { + Some("common.abilities.custom.tidalwarrior.bubbles") => { + if mirror > 0.0 { + next.head.orientation = Quaternion::rotation_z(move1 * -0.6); + next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.6); + next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.6); - next.shoulder_l.orientation = Quaternion::rotation_z(move1 * 0.3); - next.hand_l.position = Vec3::new(-14.0 + move1 * 3.0, 2.0, -4.0); + next.shoulder_l.orientation = Quaternion::rotation_z(move1 * 0.3); + next.hand_l.position = Vec3::new(-14.0 + move1 * 3.0, 2.0, -4.0); - next.hand_l.orientation = - Quaternion::rotation_x(PI / 3.0 + move2shake * -0.07) - * Quaternion::rotation_y(move1 * -0.5) - * Quaternion::rotation_z(-0.35 + move2shake * 0.07); - next.hand_r.position = Vec3::new(14.0 + move1 - 3.0, 2.0, -4.0); + next.hand_l.orientation = + Quaternion::rotation_x(PI / 3.0 + move2shake * -0.07) + * Quaternion::rotation_y(move1 * -0.5) + * Quaternion::rotation_z(-0.35 + move2shake * 0.07); + next.hand_r.position = Vec3::new(14.0 + move1 - 3.0, 2.0, -4.0); - next.hand_r.orientation = - Quaternion::rotation_x(PI / 3.0 + move2shake * 0.07) - * Quaternion::rotation_y(move1 * -0.5) - * Quaternion::rotation_z(0.35 - move2shake * 0.07); + next.hand_r.orientation = + Quaternion::rotation_x(PI / 3.0 + move2shake * 0.07) + * Quaternion::rotation_y(move1 * -0.5) + * Quaternion::rotation_z(0.35 - move2shake * 0.07); - next.shoulder_r.orientation = Quaternion::rotation_z(move1 * -0.3); - } else { - next.head.orientation = Quaternion::rotation_z(move1 * 0.6); - next.upper_torso.orientation = Quaternion::rotation_z(move1 * -0.6); - next.lower_torso.orientation = Quaternion::rotation_z(move1 * 0.6); + next.shoulder_r.orientation = Quaternion::rotation_z(move1 * -0.3); + } else { + next.head.orientation = Quaternion::rotation_z(move1 * 0.6); + next.upper_torso.orientation = Quaternion::rotation_z(move1 * -0.6); + next.lower_torso.orientation = Quaternion::rotation_z(move1 * 0.6); - next.shoulder_l.orientation = Quaternion::rotation_z(move1 * -0.3); - next.hand_l.position = Vec3::new(-14.0 + move1 * 3.0, 2.0, -4.0); + next.shoulder_l.orientation = Quaternion::rotation_z(move1 * -0.3); + next.hand_l.position = Vec3::new(-14.0 + move1 * 3.0, 2.0, -4.0); - next.hand_l.orientation = - Quaternion::rotation_x(PI / 3.0 + move2shake * 0.07) - * Quaternion::rotation_y(move1 * 0.5) - * Quaternion::rotation_z(-0.35 + move2shake * 0.07); - next.hand_r.position = Vec3::new(14.0 + move1 - 3.0, 2.0, -4.0); + next.hand_l.orientation = + Quaternion::rotation_x(PI / 3.0 + move2shake * 0.07) + * Quaternion::rotation_y(move1 * 0.5) + * Quaternion::rotation_z(-0.35 + move2shake * 0.07); + next.hand_r.position = Vec3::new(14.0 + move1 - 3.0, 2.0, -4.0); - next.hand_r.orientation = - Quaternion::rotation_x(PI / 3.0 + move2shake * -0.07) - * Quaternion::rotation_y(move1 * 0.5) - * Quaternion::rotation_z(0.35 - move2shake * -0.07); + next.hand_r.orientation = + Quaternion::rotation_x(PI / 3.0 + move2shake * -0.07) + * Quaternion::rotation_y(move1 * 0.5) + * Quaternion::rotation_z(0.35 - move2shake * -0.07); - next.shoulder_r.orientation = Quaternion::rotation_z(move1 * 0.3); - }; - }, - "Yeti" => { - next.second.scale = Vec3::one() * 0.0; + next.shoulder_r.orientation = Quaternion::rotation_z(move1 * 0.3); + }; + }, + Some("common.abilities.custom.yeti.frostbreath") => { + next.second.scale = Vec3::one() * 0.0; - next.head.orientation = Quaternion::rotation_x( - move1 * 0.5 + move2 * -0.5 + move2shake * -0.02, - ); - next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); - next.jaw.orientation = - Quaternion::rotation_x(move2 * -0.5 + move2shake * -0.1); - next.control_l.position = Vec3::new(-0.5, 4.0, 1.0); - next.control_r.position = Vec3::new(-0.5, 4.0, 1.0); - next.control_l.orientation = Quaternion::rotation_x(PI / 2.0); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0); + next.head.orientation = + Quaternion::rotation_x(move1 * 0.5 + move2 * -0.5 + move2shake * -0.02); + next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); + next.jaw.orientation = Quaternion::rotation_x(move2 * -0.5 + move2shake * -0.1); + next.control_l.position = Vec3::new(-0.5, 4.0, 1.0); + next.control_r.position = Vec3::new(-0.5, 4.0, 1.0); + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0); - next.weapon_l.position = Vec3::new(-12.0, -1.0, -15.0); - next.weapon_r.position = Vec3::new(12.0, -1.0, -15.0); + next.weapon_l.position = Vec3::new(-12.0, -1.0, -15.0); + next.weapon_r.position = Vec3::new(12.0, -1.0, -15.0); - next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1); - next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1); + next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1); + next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1); - next.arm_control_r.orientation = - Quaternion::rotation_x(move1 * 1.1 + move2 * -1.6) - * Quaternion::rotation_y(move1 * 1.4 + move2 * -1.8); + next.arm_control_r.orientation = + Quaternion::rotation_x(move1 * 1.1 + move2 * -1.6) + * Quaternion::rotation_y(move1 * 1.4 + move2 * -1.8); - next.shoulder_l.orientation = - Quaternion::rotation_x(move1 * 1.4 + move2 * -1.8); + next.shoulder_l.orientation = + Quaternion::rotation_x(move1 * 1.4 + move2 * -1.8); - next.shoulder_r.orientation = - Quaternion::rotation_x(move1 * 1.4 + move2 * -1.8); + next.shoulder_r.orientation = + Quaternion::rotation_x(move1 * 1.4 + move2 * -1.8); - next.upper_torso.position = Vec3::new( - 0.0, - s_a.upper_torso.0, - s_a.upper_torso.1 + move1 * -1.9 + move2 * 1.2, - ); - next.upper_torso.orientation = Quaternion::rotation_x( - move1 * 0.8 + move2 * -1.1 + move2shake * -0.02, - ); - next.lower_torso.position = - Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1); - next.lower_torso.orientation = Quaternion::rotation_x( - move1 * -0.8 + move2 * 1.1 + move2shake * 0.02, - ); - }, - "Harvester" => { - next.head.orientation = Quaternion::rotation_x( - move1 * 0.5 + move2 * -0.4 + move2shake * -0.02, - ); + next.upper_torso.position = Vec3::new( + 0.0, + s_a.upper_torso.0, + s_a.upper_torso.1 + move1 * -1.9 + move2 * 1.2, + ); + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * 0.8 + move2 * -1.1 + move2shake * -0.02); + next.lower_torso.position = + Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1); + next.lower_torso.orientation = + Quaternion::rotation_x(move1 * -0.8 + move2 * 1.1 + move2shake * 0.02); + }, + Some("common.abilities.custom.harvester.firebreath") => { + next.head.orientation = + Quaternion::rotation_x(move1 * 0.5 + move2 * -0.4 + move2shake * -0.02); - next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); - next.jaw.orientation = - Quaternion::rotation_x(move2 * -0.5 + move2shake * -0.1); + next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); + next.jaw.orientation = Quaternion::rotation_x(move2 * -0.5 + move2shake * -0.1); - next.upper_torso.position = Vec3::new( - 0.0, - s_a.upper_torso.0 + move1 * -3.0 + move2 * 3.0, - s_a.upper_torso.1 + move1 * -0.4, - ); - next.upper_torso.orientation = Quaternion::rotation_x( - move1 * 0.8 + move2 * -1.1 + move2shake * -0.02, - ); - next.lower_torso.position = - Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1); - next.lower_torso.orientation = Quaternion::rotation_x( - move1 * -0.8 + move2 * 1.1 + move2shake * 0.02, - ); + next.upper_torso.position = Vec3::new( + 0.0, + s_a.upper_torso.0 + move1 * -3.0 + move2 * 3.0, + s_a.upper_torso.1 + move1 * -0.4, + ); + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * 0.8 + move2 * -1.1 + move2shake * -0.02); + next.lower_torso.position = + Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1); + next.lower_torso.orientation = + Quaternion::rotation_x(move1 * -0.8 + move2 * 1.1 + move2shake * 0.02); - next.control_l.position = Vec3::new(1.0, 2.0, 8.0); - next.control_r.position = Vec3::new(1.0, 1.0, -2.0); + next.control_l.position = Vec3::new(1.0, 2.0, 8.0); + next.control_r.position = Vec3::new(1.0, 1.0, -2.0); - next.control.position = - Vec3::new(-6.0, 0.0 + s_a.grip.0 / 1.0, -s_a.grip.0 / 0.8); + next.control.position = + Vec3::new(-6.0, 0.0 + s_a.grip.0 / 1.0, -s_a.grip.0 / 0.8); - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2) - * Quaternion::rotation_y(-1.0); + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI); + next.control_r.orientation = + Quaternion::rotation_x(PI / 2.0 + 0.2) * Quaternion::rotation_y(-1.0); - next.control.orientation = - Quaternion::rotation_x(-1.4) * Quaternion::rotation_y(-2.8); + next.control.orientation = + Quaternion::rotation_x(-1.4) * Quaternion::rotation_y(-2.8); - next.weapon_l.position = - Vec3::new(move1 * 8.0, move1 * 1.0, move1 * 6.0); - next.weapon_l.orientation = Quaternion::rotation_x(move1 * 0.5) - * Quaternion::rotation_y(move1 * -0.8); + next.weapon_l.position = Vec3::new(move1 * 8.0, move1 * 1.0, move1 * 6.0); + next.weapon_l.orientation = + Quaternion::rotation_x(move1 * 0.5) * Quaternion::rotation_y(move1 * -0.8); - 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_y(-0.4 + move1 * 0.8) - * Quaternion::rotation_x(-0.4 + move1 * -0.2); - next.shoulder_r.orientation = - Quaternion::rotation_y(0.4 + move1 * -0.8) - * Quaternion::rotation_x(0.4 + move1 * -0.8); + 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_y(-0.4 + move1 * 0.8) + * Quaternion::rotation_x(-0.4 + move1 * -0.2); + next.shoulder_r.orientation = Quaternion::rotation_y(0.4 + move1 * -0.8) + * Quaternion::rotation_x(0.4 + move1 * -0.8); - next.hand_r.position = Vec3::new( - -s_a.grip.1 + move1 * -5.0, - 0.0 + move1 * 6.0, - s_a.grip.0 + move1 * 13.0, - ); - next.hand_r.orientation = Quaternion::rotation_x(move1 * -3.0) - * Quaternion::rotation_y(move1 * 1.5) - * Quaternion::rotation_z(move1 * -1.5); - }, - _ => {}, - } - } + next.hand_r.position = Vec3::new( + -s_a.grip.1 + move1 * -5.0, + 0.0 + move1 * 6.0, + s_a.grip.0 + move1 * 13.0, + ); + next.hand_r.orientation = Quaternion::rotation_x(move1 * -3.0) + * Quaternion::rotation_y(move1 * 1.5) + * Quaternion::rotation_z(move1 * -1.5); + }, + _ => {}, }, _ => {}, } diff --git a/voxygen/anim/src/biped_large/beta.rs b/voxygen/anim/src/biped_large/beta.rs index ff178dfa61..75eaa37bfe 100644 --- a/voxygen/anim/src/biped_large/beta.rs +++ b/voxygen/anim/src/biped_large/beta.rs @@ -12,12 +12,13 @@ pub struct BetaAnimation; impl Animation for BetaAnimation { type Dependency<'a> = ( - (Option, Option<&'a AbilitySpec>), + Option, (Option, Option<&'a AbilitySpec>), Vec3, f32, Option, f32, + Option<&'a str>, ); type Skeleton = BipedLargeSkeleton; @@ -28,12 +29,13 @@ impl Animation for BetaAnimation { fn update_skeleton_inner( skeleton: &Self::Skeleton, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, _second_tool, velocity, _global_time, stage_section, acc_vel, + ability_id, ): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, @@ -165,75 +167,28 @@ impl Animation for BetaAnimation { * Quaternion::rotation_y(-1.8 + move1 * 3.0 + move2 * -0.9) * Quaternion::rotation_z(move1 * -0.2 + move2 * -1.5); }, - Some(ToolKind::Natural) => { - if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { - match spec.as_str() { - "Wendigo Magic" => { - next.torso.position = Vec3::new(0.0, 0.0, move1 * -2.18); - next.upper_torso.orientation = - Quaternion::rotation_x(move1 * -0.5 + move2 * -0.4); - next.lower_torso.orientation = - Quaternion::rotation_x(move1 * 0.5 + move2 * 0.4); + Some(ToolKind::Natural) => match ability_id { + Some("common.abilities.custom.wendigomagic.singlestrike") => { + next.torso.position = Vec3::new(0.0, 0.0, move1 * -2.18); + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * -0.5 + move2 * -0.4); + next.lower_torso.orientation = + Quaternion::rotation_x(move1 * 0.5 + move2 * 0.4); - next.control_l.position = Vec3::new( - -9.0 + move2 * 6.0, - 19.0 + move1 * 6.0, - -13.0 + move1 * 10.5, - ); - next.control_r.position = Vec3::new( - 9.0 + move2 * -6.0, - 19.0 + move1 * 6.0, - -13.0 + move1 * 14.5, - ); + next.control_l.position = + Vec3::new(-9.0 + move2 * 6.0, 19.0 + move1 * 6.0, -13.0 + move1 * 10.5); + next.control_r.position = + Vec3::new(9.0 + move2 * -6.0, 19.0 + move1 * 6.0, -13.0 + move1 * 14.5); - next.control_l.orientation = - Quaternion::rotation_x(PI / 3.0 + move1 * 0.5) - * Quaternion::rotation_y(-0.15) - * Quaternion::rotation_z(move1 * 0.5 + move2 * -0.6); - next.control_r.orientation = - Quaternion::rotation_x(PI / 3.0 + move1 * 0.5) - * Quaternion::rotation_y(0.15) - * Quaternion::rotation_z(move1 * -0.5 + move2 * 0.6); - next.head.orientation = Quaternion::rotation_x(move1 * 0.3); - }, - "Tidal Claws" => { - next.torso.position = Vec3::new(0.0, 0.0, move1 * -1.4); - next.upper_torso.orientation = - Quaternion::rotation_x(move1 * -0.5 + move2 * -0.4); - next.lower_torso.orientation = - Quaternion::rotation_x(move1 * 0.5 + move2 * 0.4); - - next.shoulder_l.orientation = Quaternion::rotation_x( - move1 * 0.4 + 0.4 * speednorm + (footrotl * -0.2) * speednorm, - ); - next.shoulder_r.orientation = Quaternion::rotation_x( - move1 * 0.4 + 0.4 * speednorm + (footrotl * -0.2) * speednorm, - ); - - next.control_l.position = Vec3::new( - -14.0 + move2 * 9.0, - 12.0 + move1 * 6.0, - -12.0 + move1 * 9.0, - ); - next.control_r.position = Vec3::new( - 14.0 + move2 * -9.0, - 12.0 + move1 * 6.0, - -12.0 + move1 * 9.0, - ); - - next.control_l.orientation = - Quaternion::rotation_x(PI / 3.0 + move1 * 0.5) - * Quaternion::rotation_y(-0.15) - * Quaternion::rotation_z(move1 * 0.5 + move2 * -0.6); - next.control_r.orientation = - Quaternion::rotation_x(PI / 3.0 + move1 * 0.5) - * Quaternion::rotation_y(0.15) - * Quaternion::rotation_z(move1 * -0.5 + move2 * 0.6); - next.head.orientation = Quaternion::rotation_x(move1 * 0.3); - }, - _ => {}, - } - } + next.control_l.orientation = Quaternion::rotation_x(PI / 3.0 + move1 * 0.5) + * Quaternion::rotation_y(-0.15) + * Quaternion::rotation_z(move1 * 0.5 + move2 * -0.6); + next.control_r.orientation = Quaternion::rotation_x(PI / 3.0 + move1 * 0.5) + * Quaternion::rotation_y(0.15) + * Quaternion::rotation_z(move1 * -0.5 + move2 * 0.6); + next.head.orientation = Quaternion::rotation_x(move1 * 0.3); + }, + _ => {}, }, _ => {}, } diff --git a/voxygen/anim/src/biped_large/chargemelee.rs b/voxygen/anim/src/biped_large/chargemelee.rs index 901a86e63f..651aae777e 100644 --- a/voxygen/anim/src/biped_large/chargemelee.rs +++ b/voxygen/anim/src/biped_large/chargemelee.rs @@ -12,12 +12,13 @@ pub struct ChargeMeleeAnimation; impl Animation for ChargeMeleeAnimation { type Dependency<'a> = ( - (Option, Option<&'a AbilitySpec>), + Option, (Option, Option<&'a AbilitySpec>), Vec3, f32, Option, f32, + Option<&'a str>, ); type Skeleton = BipedLargeSkeleton; @@ -28,12 +29,13 @@ impl Animation for ChargeMeleeAnimation { fn update_skeleton_inner( skeleton: &Self::Skeleton, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, _second_tool, velocity, _global_time, stage_section, acc_vel, + ability_id, ): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, @@ -97,118 +99,107 @@ impl Animation for ChargeMeleeAnimation { #[allow(clippy::single_match)] match active_tool_kind { - Some(ToolKind::Natural) => { - if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { - match spec.as_str() { - "Minotaur" => { - next.upper_torso.orientation = - Quaternion::rotation_x(move1 * 0.3 + move2 * -0.9); - next.lower_torso.orientation = - Quaternion::rotation_x(move1 * -0.3 + move2 * 0.9); - next.head.orientation = - Quaternion::rotation_x(move1 * -0.5 + move2 * 0.5); + Some(ToolKind::Natural) => match ability_id { + Some("common.abilities.custom.minotaur.cleave") => { + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * 0.3 + move2 * -0.9); + next.lower_torso.orientation = + Quaternion::rotation_x(move1 * -0.3 + move2 * 0.9); + next.head.orientation = Quaternion::rotation_x(move1 * -0.5 + move2 * 0.5); - next.control_l.position = Vec3::new(0.0, 4.0, 5.0); - next.control_r.position = Vec3::new(0.0, 4.0, 5.0); - next.weapon_l.position = Vec3::new( - -12.0 + move2 * 5.0, - -6.0 + move1 * 22.0 + move2 * 8.0, - -18.0 + move1 * 16.0 + move2 * -19.0, - ); - next.weapon_r.position = Vec3::new( - 12.0 + move2 * -5.0, - -6.0 + move1 * 22.0 + move2 * 8.0, - -18.0 + move1 * 14.0 + move2 * -19.0, - ); - next.torso.position = Vec3::new(0.0, move2 * 7.06, 0.0); - next.second.scale = Vec3::one() * 1.0; + next.control_l.position = Vec3::new(0.0, 4.0, 5.0); + next.control_r.position = Vec3::new(0.0, 4.0, 5.0); + next.weapon_l.position = Vec3::new( + -12.0 + move2 * 5.0, + -6.0 + move1 * 22.0 + move2 * 8.0, + -18.0 + move1 * 16.0 + move2 * -19.0, + ); + next.weapon_r.position = Vec3::new( + 12.0 + move2 * -5.0, + -6.0 + move1 * 22.0 + move2 * 8.0, + -18.0 + move1 * 14.0 + move2 * -19.0, + ); + next.torso.position = Vec3::new(0.0, move2 * 7.06, 0.0); + next.second.scale = Vec3::one() * 1.0; - next.weapon_l.orientation = - Quaternion::rotation_x( - -1.67 + move1 * 2.8 + tension * 0.03 + move2 * -2.3, - ) * Quaternion::rotation_y(move1 * 0.3 + move2 * 0.5); - next.weapon_r.orientation = Quaternion::rotation_x( - -1.67 + move1 * 1.6 + tension * -0.03 + move2 * -0.7, - ) * Quaternion::rotation_y( - move1 * -0.3 + move2 * -0.5, - ) * Quaternion::rotation_z(0.0); + next.weapon_l.orientation = + Quaternion::rotation_x(-1.67 + move1 * 2.8 + tension * 0.03 + move2 * -2.3) + * Quaternion::rotation_y(move1 * 0.3 + move2 * 0.5); + next.weapon_r.orientation = Quaternion::rotation_x( + -1.67 + move1 * 1.6 + tension * -0.03 + move2 * -0.7, + ) * Quaternion::rotation_y( + move1 * -0.3 + move2 * -0.5, + ) * Quaternion::rotation_z(0.0); - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0 + move1 * 0.2 + move2 * 0.1); - next.control_r.orientation = - Quaternion::rotation_x(PI / 2.0 + move1 * 0.4 + move2 * -0.4); + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0 + move1 * 0.2 + move2 * 0.1); + next.control_r.orientation = + Quaternion::rotation_x(PI / 2.0 + move1 * 0.4 + move2 * -0.4); - next.control.orientation = - Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0); - next.shoulder_l.orientation = - Quaternion::rotation_x(-0.3 + move1 * 1.0); + next.control.orientation = + Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0); + next.shoulder_l.orientation = Quaternion::rotation_x(-0.3 + move1 * 1.0); - next.shoulder_r.orientation = - Quaternion::rotation_x(-0.3 + move1 * 1.0); - }, - "Husk Brute" => { - next.second.scale = Vec3::one() * 0.0; + next.shoulder_r.orientation = Quaternion::rotation_x(-0.3 + move1 * 1.0); + }, + Some("common.abilities.custom.husk_brute.chargedmelee") => { + next.second.scale = Vec3::one() * 0.0; - next.head.orientation = - Quaternion::rotation_x(move1 * 0.3 + move2 * -0.6); - next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); - next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3); - next.control_l.position = Vec3::new(-0.5, 4.0, 1.0); - next.control_r.position = Vec3::new(-0.5, 4.0, 1.0); - next.control_l.orientation = Quaternion::rotation_x(PI / 2.0); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0); - next.weapon_l.position = - Vec3::new(-12.0 + (move1 * 10.0).min(6.0), -1.0, -15.0); - next.weapon_r.position = - Vec3::new(12.0 + (move1 * -10.0).max(-6.0), -1.0, -15.0); + next.head.orientation = Quaternion::rotation_x(move1 * 0.3 + move2 * -0.6); + next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); + next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3); + next.control_l.position = Vec3::new(-0.5, 4.0, 1.0); + next.control_r.position = Vec3::new(-0.5, 4.0, 1.0); + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0); + next.weapon_l.position = + Vec3::new(-12.0 + (move1 * 10.0).min(6.0), -1.0, -15.0); + next.weapon_r.position = + Vec3::new(12.0 + (move1 * -10.0).max(-6.0), -1.0, -15.0); - next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1) - * Quaternion::rotation_z(move1 * -0.8); - next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1) - * Quaternion::rotation_z(move1 * 0.8); + next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1) + * Quaternion::rotation_z(move1 * -0.8); + next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1) + * Quaternion::rotation_z(move1 * 0.8); - next.shoulder_l.orientation = - Quaternion::rotation_x(-0.3 + move1 * 2.8 + move2 * -2.8); + next.shoulder_l.orientation = + Quaternion::rotation_x(-0.3 + move1 * 2.8 + move2 * -2.8); - next.shoulder_r.orientation = - Quaternion::rotation_x(-0.3 + move1 * 2.8 + move2 * -2.8); + next.shoulder_r.orientation = + Quaternion::rotation_x(-0.3 + move1 * 2.8 + move2 * -2.8); - next.control.orientation = - Quaternion::rotation_x(move1 * 2.5 + move2 * -2.0); + next.control.orientation = Quaternion::rotation_x(move1 * 2.5 + move2 * -2.0); - next.upper_torso.position = - Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1); - next.upper_torso.orientation = - Quaternion::rotation_x(move1 * 0.2 + move2 * -0.6); - next.lower_torso.orientation = - Quaternion::rotation_x(move1 * -0.2 + move2 * 0.6); + next.upper_torso.position = + Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1); + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * 0.2 + move2 * -0.6); + next.lower_torso.orientation = + Quaternion::rotation_x(move1 * -0.2 + move2 * 0.6); - if speed < 0.1 { - next.foot_l.position = Vec3::new( - -s_a.foot.0, - s_a.foot.1 + move1 * -7.0 + move2 * 7.0, - s_a.foot.2, - ); - next.foot_l.orientation = - Quaternion::rotation_x(move1 * -0.8 + move2 * 0.8) - * Quaternion::rotation_z(move1 * 0.3 + move2 * -0.3); + if speed < 0.1 { + next.foot_l.position = Vec3::new( + -s_a.foot.0, + s_a.foot.1 + move1 * -7.0 + move2 * 7.0, + s_a.foot.2, + ); + next.foot_l.orientation = + Quaternion::rotation_x(move1 * -0.8 + move2 * 0.8) + * Quaternion::rotation_z(move1 * 0.3 + move2 * -0.3); - next.foot_r.position = Vec3::new( - s_a.foot.0, - s_a.foot.1 + move1 * 5.0 + move2 * -5.0, - s_a.foot.2, - ); - next.foot_r.orientation = - Quaternion::rotation_y(move1 * -0.3 + move2 * 0.3) - * Quaternion::rotation_z(move1 * 0.4 + move2 * -0.4); - } - next.main.orientation = - Quaternion::rotation_y(move1 * 0.4 + move2 * -0.6) - * Quaternion::rotation_x(move2 * -0.4); - }, - _ => {}, + next.foot_r.position = Vec3::new( + s_a.foot.0, + s_a.foot.1 + move1 * 5.0 + move2 * -5.0, + s_a.foot.2, + ); + next.foot_r.orientation = + Quaternion::rotation_y(move1 * -0.3 + move2 * 0.3) + * Quaternion::rotation_z(move1 * 0.4 + move2 * -0.4); } - } + next.main.orientation = Quaternion::rotation_y(move1 * 0.4 + move2 * -0.6) + * Quaternion::rotation_x(move2 * -0.4); + }, + _ => {}, }, _ => {}, } diff --git a/voxygen/anim/src/biped_large/dash.rs b/voxygen/anim/src/biped_large/dash.rs index dd6e19c188..21ab4a8a9f 100644 --- a/voxygen/anim/src/biped_large/dash.rs +++ b/voxygen/anim/src/biped_large/dash.rs @@ -12,12 +12,13 @@ pub struct DashAnimation; impl Animation for DashAnimation { type Dependency<'a> = ( - (Option, Option<&'a AbilitySpec>), + Option, (Option, Option<&'a AbilitySpec>), Vec3, f32, Option, f32, + Option<&'a str>, ); type Skeleton = BipedLargeSkeleton; @@ -28,12 +29,13 @@ impl Animation for DashAnimation { fn update_skeleton_inner( skeleton: &Self::Skeleton, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, _second_tool, velocity, _global_time, stage_section, acc_vel, + ability_id, ): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, @@ -152,77 +154,65 @@ impl Animation for DashAnimation { * Quaternion::rotation_y(-1.8 + move1 * -0.2 + move3 * -0.2) * Quaternion::rotation_z(move1 * -0.8 + move3 * -0.1); }, - Some(ToolKind::Natural) => { - if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { - match spec.as_str() { - "Minotaur" => { - next.head.orientation = - Quaternion::rotation_x(move1 * 0.4 + move3 * 0.5) - * Quaternion::rotation_z(move1 * -0.3 + move3 * -0.3); - next.upper_torso.orientation = - Quaternion::rotation_x(move1 * -0.4 + move3 * 0.9) - * Quaternion::rotation_z(move1 * 0.6 + move3 * -1.5); - next.lower_torso.orientation = - Quaternion::rotation_y(move1 * -0.2 + move3 * -0.1) - * Quaternion::rotation_x( - move1 * 0.4 + move3 * -0.7 + footrotr * 0.1, - ) - * Quaternion::rotation_z(move1 * -0.6 + move3 * 1.6); - next.control_l.position = Vec3::new(0.0, 4.0, 5.0); - next.control_r.position = Vec3::new(0.0, 4.0, 5.0); - next.weapon_l.position = Vec3::new(-12.0 + move1 * -3.0, -6.0, -18.0); - next.weapon_r.position = Vec3::new( - 12.0 + move1 * -3.0, - -6.0 + move1 * 2.0, - -18.0 + move1 * 2.0, - ); - next.second.scale = Vec3::one() * 1.0; + Some(ToolKind::Natural) => match ability_id { + Some("common.abilities.custom.minotaur.charge") => { + next.head.orientation = Quaternion::rotation_x(move1 * 0.4 + move3 * 0.5) + * Quaternion::rotation_z(move1 * -0.3 + move3 * -0.3); + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * -0.4 + move3 * 0.9) + * Quaternion::rotation_z(move1 * 0.6 + move3 * -1.5); + next.lower_torso.orientation = + Quaternion::rotation_y(move1 * -0.2 + move3 * -0.1) + * Quaternion::rotation_x(move1 * 0.4 + move3 * -0.7 + footrotr * 0.1) + * Quaternion::rotation_z(move1 * -0.6 + move3 * 1.6); + next.control_l.position = Vec3::new(0.0, 4.0, 5.0); + next.control_r.position = Vec3::new(0.0, 4.0, 5.0); + next.weapon_l.position = Vec3::new(-12.0 + move1 * -3.0, -6.0, -18.0); + next.weapon_r.position = + Vec3::new(12.0 + move1 * -3.0, -6.0 + move1 * 2.0, -18.0 + move1 * 2.0); + next.second.scale = Vec3::one() * 1.0; - next.weapon_l.orientation = Quaternion::rotation_x(-1.67 + move1 * 0.4) - * Quaternion::rotation_y(move1 * 0.4 + move2 * 0.2) - * Quaternion::rotation_z(move3 * -0.5); - next.weapon_r.orientation = Quaternion::rotation_x(-1.67 + move1 * 0.3) - * Quaternion::rotation_y(move1 * 0.6 + move2 * -0.6) - * Quaternion::rotation_z(move3 * -0.5); + next.weapon_l.orientation = Quaternion::rotation_x(-1.67 + move1 * 0.4) + * Quaternion::rotation_y(move1 * 0.4 + move2 * 0.2) + * Quaternion::rotation_z(move3 * -0.5); + next.weapon_r.orientation = Quaternion::rotation_x(-1.67 + move1 * 0.3) + * Quaternion::rotation_y(move1 * 0.6 + move2 * -0.6) + * Quaternion::rotation_z(move3 * -0.5); - next.control_l.orientation = Quaternion::rotation_x(PI / 2.0); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0); + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0); - next.control.orientation = - Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0); - next.shoulder_l.orientation = Quaternion::rotation_x(-0.3); + next.control.orientation = + Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0); + next.shoulder_l.orientation = Quaternion::rotation_x(-0.3); - next.shoulder_r.orientation = Quaternion::rotation_x(-0.3); - }, - "Tidal Warrior" => { - next.head.orientation = - Quaternion::rotation_x(0.0) * Quaternion::rotation_z(move1 * -0.3); - next.upper_torso.orientation = Quaternion::rotation_x(move1 * -0.1) - * Quaternion::rotation_z(move1 * PI / 2.0); - next.lower_torso.orientation = Quaternion::rotation_x(move1 * 0.1) - * Quaternion::rotation_x(move1 * -0.1) - * Quaternion::rotation_z(move1 * -0.2); + next.shoulder_r.orientation = Quaternion::rotation_x(-0.3); + }, + Some("common.abilities.custom.tidalwarrior.scuttle") => { + next.head.orientation = + Quaternion::rotation_x(0.0) * Quaternion::rotation_z(move1 * -0.3); + next.upper_torso.orientation = Quaternion::rotation_x(move1 * -0.1) + * Quaternion::rotation_z(move1 * PI / 2.0); + next.lower_torso.orientation = Quaternion::rotation_x(move1 * 0.1) + * Quaternion::rotation_x(move1 * -0.1) + * Quaternion::rotation_z(move1 * -0.2); - next.hand_l.position = Vec3::new(-14.0, 2.0 + motion * 1.5, -4.0); + next.hand_l.position = Vec3::new(-14.0, 2.0 + motion * 1.5, -4.0); - next.hand_l.orientation = - Quaternion::rotation_x(PI / 3.0 + move1 * 1.0) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(-0.35 + motion * -0.6); - next.hand_r.position = Vec3::new(14.0, 2.0 + motion * -1.5, -4.0); + next.hand_l.orientation = Quaternion::rotation_x(PI / 3.0 + move1 * 1.0) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(-0.35 + motion * -0.6); + next.hand_r.position = Vec3::new(14.0, 2.0 + motion * -1.5, -4.0); - next.hand_r.orientation = - Quaternion::rotation_x(PI / 3.0 + move1 * 1.0) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.35 + motion * 0.6); + next.hand_r.orientation = Quaternion::rotation_x(PI / 3.0 + move1 * 1.0) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.35 + motion * 0.6); - next.shoulder_l.orientation = Quaternion::rotation_x(move1 * 0.8); + next.shoulder_l.orientation = Quaternion::rotation_x(move1 * 0.8); - next.shoulder_r.orientation = Quaternion::rotation_x(move1 * 0.8); - }, - _ => {}, - } - } + next.shoulder_r.orientation = Quaternion::rotation_x(move1 * 0.8); + }, + _ => {}, }, _ => {}, } diff --git a/voxygen/anim/src/biped_large/mod.rs b/voxygen/anim/src/biped_large/mod.rs index e4ed21a7d9..9631b80597 100644 --- a/voxygen/anim/src/biped_large/mod.rs +++ b/voxygen/anim/src/biped_large/mod.rs @@ -360,7 +360,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Cultistwarlord, _) => (11.5, -1.0, 4.5), (Cultistwarlock, _) => (8.0, 0.0, 3.5), (Huskbrute, _) => (10.5, 0.0, -1.5), - (Tursus, _) => (12.5, -2.5, 1.0), + (Tursus, _) => (12.5, -2.5, -2.0), (Gigasfrost, _) => (10.5, 0.5, 0.0), }, hand: match (body.species, body.body_type) { @@ -386,7 +386,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Cultistwarlord, _) => (11.5, -1.0, -1.0), (Cultistwarlock, _) => (9.5, -1.0, 1.0), (Huskbrute, _) => (13.0, 0.5, -4.0), - (Tursus, _) => (15.5, -2.5, -8.0), + (Tursus, _) => (15.5, 0.0, -7.0), (Gigasfrost, _) => (17.0, 0.5, -6.0), }, leg: match (body.species, body.body_type) { diff --git a/voxygen/anim/src/biped_large/shockwave.rs b/voxygen/anim/src/biped_large/shockwave.rs index deba0bc640..4dbda8d98d 100644 --- a/voxygen/anim/src/biped_large/shockwave.rs +++ b/voxygen/anim/src/biped_large/shockwave.rs @@ -11,11 +11,12 @@ use core::f32::consts::PI; pub struct ShockwaveAnimation; type ShockwaveAnimationDependency<'a> = ( - (Option, Option<&'a AbilitySpec>), + Option, (Option, Option<&'a AbilitySpec>), f32, f32, Option, + Option<&'a str>, ); impl Animation for ShockwaveAnimation { type Dependency<'a> = ShockwaveAnimationDependency<'a>; @@ -29,11 +30,12 @@ impl Animation for ShockwaveAnimation { fn update_skeleton_inner( skeleton: &Self::Skeleton, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, _second_tool_kind, _global_time, velocity, stage_section, + ability_id, ): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, @@ -125,150 +127,128 @@ impl Animation for ShockwaveAnimation { * Quaternion::rotation_z(move1 * 0.4 + move2 * -0.4); } }, - Some(ToolKind::Natural) => { - if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { - match spec.as_str() { - "Yeti" => { - next.second.scale = Vec3::one() * 0.0; + Some(ToolKind::Natural) => match ability_id { + Some("common.abilities.custom.yeti.icespikes") => { + next.second.scale = Vec3::one() * 0.0; - next.head.orientation = - Quaternion::rotation_x(move1pow * 0.8 + move2 * -1.2); - next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); - next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3); - next.control_l.position = Vec3::new(-0.5, 4.0, 1.0); - next.control_r.position = Vec3::new(-0.5, 4.0, 1.0); - next.control_l.orientation = Quaternion::rotation_x(PI / 2.0); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0); - next.weapon_l.position = - Vec3::new(-12.0 + (move1pow * 20.0).min(10.0), -1.0, -15.0); - next.weapon_r.position = - Vec3::new(12.0 + (move1pow * -20.0).max(-10.0), -1.0, -15.0); + next.head.orientation = Quaternion::rotation_x(move1pow * 0.8 + move2 * -1.2); + next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); + next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3); + next.control_l.position = Vec3::new(-0.5, 4.0, 1.0); + next.control_r.position = Vec3::new(-0.5, 4.0, 1.0); + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0); + next.weapon_l.position = + Vec3::new(-12.0 + (move1pow * 20.0).min(10.0), -1.0, -15.0); + next.weapon_r.position = + Vec3::new(12.0 + (move1pow * -20.0).max(-10.0), -1.0, -15.0); - next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1) - * Quaternion::rotation_z(move1pow * -1.0); - next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1) - * Quaternion::rotation_z(move1pow * 1.0); + next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1) + * Quaternion::rotation_z(move1pow * -1.0); + next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1) + * Quaternion::rotation_z(move1pow * 1.0); - next.shoulder_l.orientation = - Quaternion::rotation_x(-0.3 + move1pow * 2.8 + move2 * -2.8); + next.shoulder_l.orientation = + Quaternion::rotation_x(-0.3 + move1pow * 2.8 + move2 * -2.8); - next.shoulder_r.orientation = - Quaternion::rotation_x(-0.3 + move1pow * 2.8 + move2 * -2.8); + next.shoulder_r.orientation = + Quaternion::rotation_x(-0.3 + move1pow * 2.8 + move2 * -2.8); - next.control.orientation = - Quaternion::rotation_x(move1pow * 2.5 + move2 * -2.0); + next.control.orientation = + Quaternion::rotation_x(move1pow * 2.5 + move2 * -2.0); - let twist = move1 * 0.6 + move3 * -0.6; - next.upper_torso.position = - Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1); - next.upper_torso.orientation = - Quaternion::rotation_x(move1pow * 0.8 + move2 * -1.1) - * Quaternion::rotation_z( - twist * -0.2 + move1 * -0.1 + move2 * 0.3, - ); + let twist = move1 * 0.6 + move3 * -0.6; + next.upper_torso.position = + Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1); + next.upper_torso.orientation = + Quaternion::rotation_x(move1pow * 0.8 + move2 * -1.1) + * Quaternion::rotation_z(twist * -0.2 + move1 * -0.1 + move2 * 0.3); - next.lower_torso.orientation = - Quaternion::rotation_x(move1pow * -0.8 + move2 * 1.1) - * Quaternion::rotation_z(twist); + next.lower_torso.orientation = + Quaternion::rotation_x(move1pow * -0.8 + move2 * 1.1) + * Quaternion::rotation_z(twist); - next.foot_l.position = Vec3::new( - -s_a.foot.0, - s_a.foot.1 + move1pow * -7.0 + move2 * 7.0, - s_a.foot.2, - ); - next.foot_l.orientation = - Quaternion::rotation_x(move1pow * -0.8 + move2 * 0.8) - * Quaternion::rotation_z(move1pow * 0.3 + move2 * -0.3); + next.foot_l.position = Vec3::new( + -s_a.foot.0, + s_a.foot.1 + move1pow * -7.0 + move2 * 7.0, + s_a.foot.2, + ); + next.foot_l.orientation = Quaternion::rotation_x(move1pow * -0.8 + move2 * 0.8) + * Quaternion::rotation_z(move1pow * 0.3 + move2 * -0.3); - next.foot_r.position = Vec3::new( - s_a.foot.0, - s_a.foot.1 + move1pow * 5.0 + move2 * -5.0, - s_a.foot.2, - ); - next.foot_r.orientation = - Quaternion::rotation_y(move1pow * -0.3 + move2 * 0.3) - * Quaternion::rotation_z(move1pow * 0.4 + move2 * -0.4); + next.foot_r.position = Vec3::new( + s_a.foot.0, + s_a.foot.1 + move1pow * 5.0 + move2 * -5.0, + s_a.foot.2, + ); + next.foot_r.orientation = Quaternion::rotation_y(move1pow * -0.3 + move2 * 0.3) + * Quaternion::rotation_z(move1pow * 0.4 + move2 * -0.4); - next.main.orientation = - Quaternion::rotation_y(move1 * 0.4 + move2 * -0.6) - * Quaternion::rotation_x(move2 * -0.4); - }, - _ => {}, - } - } + next.main.orientation = Quaternion::rotation_y(move1 * 0.4 + move2 * -0.6) + * Quaternion::rotation_x(move2 * -0.4); + }, + _ => {}, }, - Some(ToolKind::Axe) => { - if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { - match spec.as_str() { - "Frost Gigas" => { - next.second.scale = Vec3::one() * 0.0; + Some(ToolKind::Axe) => match ability_id { + Some("common.abilities.custom.gigas_frost.flashfreeze") => { + next.second.scale = Vec3::one() * 0.0; - next.head.orientation = - Quaternion::rotation_x(move1pow * 0.8 + move2 * -1.2); - next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); - next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3); - next.control_l.position = Vec3::new(-0.5, 4.0, 1.0); - next.control_r.position = Vec3::new(-0.5, 4.0, 1.0); - next.control_l.orientation = Quaternion::rotation_x(PI / 2.0); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0); - next.weapon_l.position = - Vec3::new(-12.0 + (move1pow * 20.0).min(10.0), -1.0, -15.0); - next.weapon_r.position = - Vec3::new(12.0 + (move1pow * -20.0).max(-10.0), -1.0, -15.0); + next.head.orientation = Quaternion::rotation_x(move1pow * 0.8 + move2 * -1.2); + next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); + next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3); + next.control_l.position = Vec3::new(-0.5, 4.0, 1.0); + next.control_r.position = Vec3::new(-0.5, 4.0, 1.0); + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0); + next.weapon_l.position = + Vec3::new(-12.0 + (move1pow * 20.0).min(10.0), -1.0, -15.0); + next.weapon_r.position = + Vec3::new(12.0 + (move1pow * -20.0).max(-10.0), -1.0, -15.0); - next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1) - * Quaternion::rotation_z(move1pow * -1.0); - next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1) - * Quaternion::rotation_z(move1pow * 1.0); + next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1) + * Quaternion::rotation_z(move1pow * -1.0); + next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1) + * Quaternion::rotation_z(move1pow * 1.0); - next.shoulder_l.orientation = - Quaternion::rotation_x(-0.3 + move1pow * 2.8 + move2 * -2.8); + next.shoulder_l.orientation = + Quaternion::rotation_x(-0.3 + move1pow * 2.8 + move2 * -2.8); - next.shoulder_r.orientation = - Quaternion::rotation_x(-0.3 + move1pow * 2.8 + move2 * -2.8); + next.shoulder_r.orientation = + Quaternion::rotation_x(-0.3 + move1pow * 2.8 + move2 * -2.8); - next.control.orientation = - Quaternion::rotation_x(move1pow * 1.5 + move2 * 0.6); + next.control.orientation = Quaternion::rotation_x(move1pow * 1.5 + move2 * 0.6); - let twist = move1 * 0.6 + move3 * -0.6; - next.upper_torso.position = - Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1); - next.upper_torso.orientation = - Quaternion::rotation_x(move1pow * 0.4 + move2 * -1.1) - * Quaternion::rotation_z( - twist * -0.2 + move1 * -0.1 + move2 * 0.3, - ); + let twist = move1 * 0.6 + move3 * -0.6; + next.upper_torso.position = + Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1); + next.upper_torso.orientation = + Quaternion::rotation_x(move1pow * 0.4 + move2 * -1.1) + * Quaternion::rotation_z(twist * -0.2 + move1 * -0.1 + move2 * 0.3); - next.lower_torso.orientation = - Quaternion::rotation_x(move1pow * -0.4 + move2 * 1.1) - * Quaternion::rotation_z(twist); + next.lower_torso.orientation = + Quaternion::rotation_x(move1pow * -0.4 + move2 * 1.1) + * Quaternion::rotation_z(twist); - next.foot_l.position = Vec3::new( - -s_a.foot.0, - s_a.foot.1 + move1pow * -7.0 + move2 * 7.0, - s_a.foot.2, - ); - next.foot_l.orientation = - Quaternion::rotation_x(move1pow * -0.8 + move2 * 0.8) - * Quaternion::rotation_z(move1pow * 0.3 + move2 * -0.3); + next.foot_l.position = Vec3::new( + -s_a.foot.0, + s_a.foot.1 + move1pow * -7.0 + move2 * 7.0, + s_a.foot.2, + ); + next.foot_l.orientation = Quaternion::rotation_x(move1pow * -0.8 + move2 * 0.8) + * Quaternion::rotation_z(move1pow * 0.3 + move2 * -0.3); - next.foot_r.position = Vec3::new( - s_a.foot.0, - s_a.foot.1 + move1pow * 5.0 + move2 * -5.0, - s_a.foot.2, - ); - next.foot_r.orientation = - Quaternion::rotation_y(move1pow * -0.3 + move2 * 0.3) - * Quaternion::rotation_z(move1pow * 0.4 + move2 * -0.4); - next.main.position = - Vec3::new(-5.0 + (move1pow * 20.0).min(10.0), 4.0, 12.0); - next.main.orientation = - Quaternion::rotation_y(move1 * 0.4 + move2 * -0.1) - * Quaternion::rotation_x(PI); - }, - _ => {}, - } - } + next.foot_r.position = Vec3::new( + s_a.foot.0, + s_a.foot.1 + move1pow * 5.0 + move2 * -5.0, + s_a.foot.2, + ); + next.foot_r.orientation = Quaternion::rotation_y(move1pow * -0.3 + move2 * 0.3) + * Quaternion::rotation_z(move1pow * 0.4 + move2 * -0.4); + next.main.position = Vec3::new(-5.0 + (move1pow * 20.0).min(10.0), 4.0, 12.0); + next.main.orientation = Quaternion::rotation_y(move1 * 0.4 + move2 * -0.1) + * Quaternion::rotation_x(PI); + }, + _ => {}, }, _ => {}, } diff --git a/voxygen/anim/src/biped_large/shoot.rs b/voxygen/anim/src/biped_large/shoot.rs index 313f6890df..6ee550f540 100644 --- a/voxygen/anim/src/biped_large/shoot.rs +++ b/voxygen/anim/src/biped_large/shoot.rs @@ -11,7 +11,7 @@ use core::f32::consts::PI; pub struct ShootAnimation; type ShootAnimationDependency<'a> = ( - (Option, Option<&'a AbilitySpec>), + Option, (Option, Option<&'a AbilitySpec>), Vec3, Vec3, @@ -19,6 +19,7 @@ type ShootAnimationDependency<'a> = ( f32, Option, f32, + Option<&'a str>, ); impl Animation for ShootAnimation { type Dependency<'a> = ShootAnimationDependency<'a>; @@ -31,7 +32,7 @@ impl Animation for ShootAnimation { fn update_skeleton_inner( skeleton: &Self::Skeleton, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, _second_tool, velocity, _orientation, @@ -39,6 +40,7 @@ impl Animation for ShootAnimation { _global_time, stage_section, acc_vel, + ability_id, ): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, @@ -234,166 +236,146 @@ impl Animation for ShootAnimation { next.lower_torso.orientation = Quaternion::rotation_y(move1 * -0.3); next.torso.position = Vec3::new(move1, 0.0, 0.0); }, - Some(ToolKind::Natural) => { - if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { - match spec.as_str() { - "Wendigo Magic" => { - 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; - next.control_l.position = Vec3::new( - -9.0 + move1 * 6.0, - 19.0 + move1 * 6.0, - -13.0 + move1 * 10.5, - ); - next.control_r.position = Vec3::new( - 9.0 + move1 * -6.0, - 19.0 + move1 * 6.0, - -13.0 + move1 * 14.5, - ); + Some(ToolKind::Natural) => match ability_id { + Some("common.abilities.custom.wendigomagic.frostbomb") => { + 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; + next.control_l.position = + Vec3::new(-9.0 + move1 * 6.0, 19.0 + move1 * 6.0, -13.0 + move1 * 10.5); + next.control_r.position = + Vec3::new(9.0 + move1 * -6.0, 19.0 + move1 * 6.0, -13.0 + move1 * 14.5); - next.control_l.orientation = - Quaternion::rotation_x(PI / 3.0 + move1 * 0.5) - * Quaternion::rotation_y(-0.15) - * Quaternion::rotation_z(move1 * 0.5); - next.control_r.orientation = - Quaternion::rotation_x(PI / 3.0 + move1 * 0.5) - * Quaternion::rotation_y(0.15) - * Quaternion::rotation_z(move1 * -0.5); - next.head.orientation = Quaternion::rotation_x(move1 * -0.3); - }, - "Yeti" => { - let (move1, move2, 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), - }; - next.second.scale = Vec3::one() * 0.0; + next.control_l.orientation = Quaternion::rotation_x(PI / 3.0 + move1 * 0.5) + * Quaternion::rotation_y(-0.15) + * Quaternion::rotation_z(move1 * 0.5); + next.control_r.orientation = Quaternion::rotation_x(PI / 3.0 + move1 * 0.5) + * Quaternion::rotation_y(0.15) + * Quaternion::rotation_z(move1 * -0.5); + next.head.orientation = Quaternion::rotation_x(move1 * -0.3); + }, + Some("common.abilities.custom.yeti.snowball") => { + let (move1, move2, 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), + }; + next.second.scale = Vec3::one() * 0.0; - next.head.orientation = Quaternion::rotation_x(move1 * 0.4); - next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); - next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3); - next.control_l.position = Vec3::new(-0.5, 4.0, 1.0); - next.control_r.position = Vec3::new(-0.5, 4.0, 1.0); - next.control_l.orientation = Quaternion::rotation_x(PI / 2.0); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0); - next.weapon_l.position = Vec3::new(-12.0, -1.0, -15.0); - next.weapon_r.position = Vec3::new(12.0, -1.0, -15.0); + next.head.orientation = Quaternion::rotation_x(move1 * 0.4); + next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); + next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3); + next.control_l.position = Vec3::new(-0.5, 4.0, 1.0); + next.control_r.position = Vec3::new(-0.5, 4.0, 1.0); + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0); + next.weapon_l.position = Vec3::new(-12.0, -1.0, -15.0); + next.weapon_r.position = Vec3::new(12.0, -1.0, -15.0); - next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1); - next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1); + next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1); + next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1); - let twist = move1 * 0.8 + move3 * -0.8; - next.upper_torso.position = - Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1); - next.upper_torso.orientation = - Quaternion::rotation_x(move1 * 0.8 + move2 * -1.1) - * Quaternion::rotation_z( - twist * -0.2 + move1 * -0.1 + move2 * 0.3, - ); + let twist = move1 * 0.8 + move3 * -0.8; + next.upper_torso.position = + Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1); + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * 0.8 + move2 * -1.1) + * Quaternion::rotation_z(twist * -0.2 + move1 * -0.1 + move2 * 0.3); - next.lower_torso.orientation = - Quaternion::rotation_x(move1 * -0.8 + move2 * 1.1) - * Quaternion::rotation_z(twist); + next.lower_torso.orientation = + Quaternion::rotation_x(move1 * -0.8 + move2 * 1.1) + * Quaternion::rotation_z(twist); - next.arm_control_r.orientation = - Quaternion::rotation_x(move1 * PI / 2.0) - * Quaternion::rotation_y(move1 * -PI / 2.0 + move2 * 2.5); - //* Quaternion::rotation_y(move1 * -PI/2.0) - //* Quaternion::rotation_z(move1 * -PI/2.0); - next.arm_control_r.position = - Vec3::new(0.0, move1 * 10.0 + move2 * -10.0, 0.0); - }, - "Harvester" => { - let (move1, move2, 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), - }; - next.control_l.position = Vec3::new(1.0, 2.0, 8.0); - next.control_r.position = Vec3::new(1.0, 1.0, -2.0); + next.arm_control_r.orientation = Quaternion::rotation_x(move1 * PI / 2.0) + * Quaternion::rotation_y(move1 * -PI / 2.0 + move2 * 2.5); + //* Quaternion::rotation_y(move1 * -PI/2.0) + //* Quaternion::rotation_z(move1 * -PI/2.0); + next.arm_control_r.position = Vec3::new(0.0, move1 * 10.0 + move2 * -10.0, 0.0); + }, + Some("common.abilities.custom.harvester.explodingpumpkin") => { + let (move1, move2, 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), + }; + next.control_l.position = Vec3::new(1.0, 2.0, 8.0); + next.control_r.position = Vec3::new(1.0, 1.0, -2.0); - next.control.position = - Vec3::new(-7.0, 0.0 + s_a.grip.0 / 1.0, -s_a.grip.0 / 0.8); + next.control.position = + Vec3::new(-7.0, 0.0 + s_a.grip.0 / 1.0, -s_a.grip.0 / 0.8); - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2) - * Quaternion::rotation_y(-1.0) - * Quaternion::rotation_z(0.0); + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2) + * Quaternion::rotation_y(-1.0) + * Quaternion::rotation_z(0.0); - next.control.orientation = - Quaternion::rotation_x(-1.4) * Quaternion::rotation_y(-2.8); + next.control.orientation = + Quaternion::rotation_x(-1.4) * Quaternion::rotation_y(-2.8); - next.head.orientation = Quaternion::rotation_x(move1 * 0.2); - next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); - next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3); + next.head.orientation = Quaternion::rotation_x(move1 * 0.2); + next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); + next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3); - let twist = move1 * 0.8 + move3 * -0.8; - next.upper_torso.position = Vec3::new( - 0.0, - s_a.upper_torso.0, - s_a.upper_torso.1 + move1 * 1.0 + move2 * -1.0, - ); - next.upper_torso.orientation = - Quaternion::rotation_x(move1 * 0.8 + move2 * -1.1) - * Quaternion::rotation_z( - twist * -0.2 + move1 * -0.1 + move2 * 0.3, - ); + let twist = move1 * 0.8 + move3 * -0.8; + next.upper_torso.position = Vec3::new( + 0.0, + s_a.upper_torso.0, + s_a.upper_torso.1 + move1 * 1.0 + move2 * -1.0, + ); + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * 0.8 + move2 * -1.1) + * Quaternion::rotation_z(twist * -0.2 + move1 * -0.1 + move2 * 0.3); - next.lower_torso.orientation = - Quaternion::rotation_x(move1 * -0.8 + move2 * 1.1) - * Quaternion::rotation_z(-twist + move1 * 0.4); + next.lower_torso.orientation = + Quaternion::rotation_x(move1 * -0.8 + move2 * 1.1) + * Quaternion::rotation_z(-twist + move1 * 0.4); - 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(-0.4); + 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(-0.4); - next.shoulder_r.position = Vec3::new( - s_a.shoulder.0 + move2 * -2.0, - s_a.shoulder.1, - s_a.shoulder.2, - ); - next.shoulder_r.orientation = Quaternion::rotation_y(move1 * -PI / 2.0) - * Quaternion::rotation_x(move2 * 2.0) - * Quaternion::rotation_z(move1 * -PI / 2.0); + next.shoulder_r.position = Vec3::new( + s_a.shoulder.0 + move2 * -2.0, + s_a.shoulder.1, + s_a.shoulder.2, + ); + next.shoulder_r.orientation = Quaternion::rotation_y(move1 * -PI / 2.0) + * Quaternion::rotation_x(move2 * 2.0) + * Quaternion::rotation_z(move1 * -PI / 2.0); - next.hand_r.position = Vec3::new( - -s_a.grip.1 + move1 * -2.0 + move2 * 8.0, - 0.0 + move1 * 6.0, - s_a.grip.0 + move1 * 18.0 + move2 * -19.0, - ); - next.hand_r.orientation = - Quaternion::rotation_x(move1 * -3.0 + move2 * 3.0) - * Quaternion::rotation_y(move1 * 0.5 + move2 * -1.5) - * Quaternion::rotation_z(move1 * -1.5); + next.hand_r.position = Vec3::new( + -s_a.grip.1 + move1 * -2.0 + move2 * 8.0, + 0.0 + move1 * 6.0, + s_a.grip.0 + move1 * 18.0 + move2 * -19.0, + ); + next.hand_r.orientation = Quaternion::rotation_x(move1 * -3.0 + move2 * 3.0) + * Quaternion::rotation_y(move1 * 0.5 + move2 * -1.5) + * Quaternion::rotation_z(move1 * -1.5); - if speed == 0.0 { - next.leg_l.orientation = - Quaternion::rotation_x(move1 * 0.8 + move2 * -0.8); + if speed == 0.0 { + next.leg_l.orientation = Quaternion::rotation_x(move1 * 0.8 + move2 * -0.8); - next.foot_l.position = Vec3::new( - -s_a.foot.0, - s_a.foot.1, - s_a.foot.2 + move1 * 4.0 + move2 * -4.0, - ); - next.foot_l.orientation = - Quaternion::rotation_x(move1 * -0.6 + move2 * 0.6); - } - }, - _ => {}, + next.foot_l.position = Vec3::new( + -s_a.foot.0, + s_a.foot.1, + s_a.foot.2 + move1 * 4.0 + move2 * -4.0, + ); + next.foot_l.orientation = + Quaternion::rotation_x(move1 * -0.6 + move2 * 0.6); } - } + }, + _ => {}, }, _ => {}, } diff --git a/voxygen/anim/src/biped_large/spritesummon.rs b/voxygen/anim/src/biped_large/spritesummon.rs index 6a66b7a99f..4d9f8d0e22 100644 --- a/voxygen/anim/src/biped_large/spritesummon.rs +++ b/voxygen/anim/src/biped_large/spritesummon.rs @@ -11,11 +11,12 @@ use std::f32::consts::PI; pub struct SpriteSummonAnimation; type SpriteSummonAnimationDependency<'a> = ( - (Option, Option<&'a AbilitySpec>), + Option, (Option, Option<&'a AbilitySpec>), f32, f32, Option, + Option<&'a str>, ); impl Animation for SpriteSummonAnimation { type Dependency<'a> = SpriteSummonAnimationDependency<'a>; @@ -29,11 +30,12 @@ impl Animation for SpriteSummonAnimation { fn update_skeleton_inner( skeleton: &Self::Skeleton, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, _second_tool_kind, _global_time, velocity, stage_section, + ability_id, ): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, @@ -110,90 +112,80 @@ impl Animation for SpriteSummonAnimation { next.lower_torso.orientation = Quaternion::rotation_z(move1 * 0.5 + move2 * -0.5) * Quaternion::rotation_y(move2 * -0.1); }, - Some(ToolKind::Natural) => { - if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { - match spec.as_str() { - "Harvester" => { - let (move1, move1pow, move2, move3) = match stage_section { - Some(StageSection::Buildup) => { - (anim_time, anim_time.powf(0.1), 0.0, 0.0) - }, - Some(StageSection::Action) => { - (1.0, 1.0, (anim_time.powf(4.0) * 80.0).min(1.0), 0.0) - }, - Some(StageSection::Recover) => (1.0, 1.0, 1.0, anim_time), - _ => (0.0, 0.0, 0.0, 0.0), - }; - - let speed = Vec2::::from(velocity).magnitude(); - - let pullback = 1.0 - move3; - let move1 = move1 * pullback; - let move1pow = move1pow * pullback; - let move2 = move2 * pullback; - - next.head.orientation = Quaternion::rotation_x(move1 * 0.2); - next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); - next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3); - - let twist = move1 * 0.8 + move3 * -0.8; - next.upper_torso.position = Vec3::new( - 0.0, - s_a.upper_torso.0, - s_a.upper_torso.1 + move1 * 1.0 + move2 * -1.0, - ); - next.upper_torso.orientation = - Quaternion::rotation_x(move1 * 0.8 + move2 * -1.1) - * Quaternion::rotation_z( - twist * -0.2 + move1 * -0.1 + move2 * 0.3, - ); - - next.lower_torso.orientation = - Quaternion::rotation_x(move1 * -0.8 + move2 * 1.1) - * Quaternion::rotation_z(-twist + move1 * 0.4); - - next.control_l.position = Vec3::new(1.0, 2.0, 8.0); - next.control_r.position = Vec3::new(1.0, 1.0, -2.0); - - next.control.position = Vec3::new( - -7.0 + move1pow * 7.0, - 0.0 + s_a.grip.0 / 1.0 + move1pow * 12.0, - -s_a.grip.0 / 0.8 + move1pow * 20.0 + move2 * -3.0, - ); - - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2) - * Quaternion::rotation_y(-1.0) - * Quaternion::rotation_z(0.0); - - next.control.orientation = - Quaternion::rotation_x(-1.4 + move1pow * 2.2 + move2 * -0.6) - * Quaternion::rotation_y(-PI); - - next.shoulder_l.position = - Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2); - next.shoulder_l.orientation = - Quaternion::rotation_x(-0.4 + move1pow * 1.6); - next.shoulder_r.orientation = Quaternion::rotation_y(0.4) - * Quaternion::rotation_x(0.4 + move1pow * 1.0); - - if speed == 0.0 { - next.leg_l.orientation = - Quaternion::rotation_x(move1 * 0.8 + move2 * -0.8); - - next.foot_l.position = Vec3::new( - -s_a.foot.0, - s_a.foot.1, - s_a.foot.2 + move1 * 4.0 + move2 * -4.0, - ); - next.foot_l.orientation = - Quaternion::rotation_x(move1 * -0.6 + move2 * 0.6); - } + Some(ToolKind::Natural) => match ability_id { + Some("common.abilities.custom.harvester.ensnaringvines") => { + let (move1, move1pow, move2, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time, anim_time.powf(0.1), 0.0, 0.0), + Some(StageSection::Action) => { + (1.0, 1.0, (anim_time.powf(4.0) * 80.0).min(1.0), 0.0) }, - _ => {}, + Some(StageSection::Recover) => (1.0, 1.0, 1.0, anim_time), + _ => (0.0, 0.0, 0.0, 0.0), + }; + + let speed = Vec2::::from(velocity).magnitude(); + + let pullback = 1.0 - move3; + let move1 = move1 * pullback; + let move1pow = move1pow * pullback; + let move2 = move2 * pullback; + + next.head.orientation = Quaternion::rotation_x(move1 * 0.2); + next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); + next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3); + + let twist = move1 * 0.8 + move3 * -0.8; + next.upper_torso.position = Vec3::new( + 0.0, + s_a.upper_torso.0, + s_a.upper_torso.1 + move1 * 1.0 + move2 * -1.0, + ); + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * 0.8 + move2 * -1.1) + * Quaternion::rotation_z(twist * -0.2 + move1 * -0.1 + move2 * 0.3); + + next.lower_torso.orientation = + Quaternion::rotation_x(move1 * -0.8 + move2 * 1.1) + * Quaternion::rotation_z(-twist + move1 * 0.4); + + next.control_l.position = Vec3::new(1.0, 2.0, 8.0); + next.control_r.position = Vec3::new(1.0, 1.0, -2.0); + + next.control.position = Vec3::new( + -7.0 + move1pow * 7.0, + 0.0 + s_a.grip.0 / 1.0 + move1pow * 12.0, + -s_a.grip.0 / 0.8 + move1pow * 20.0 + move2 * -3.0, + ); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2) + * Quaternion::rotation_y(-1.0) + * Quaternion::rotation_z(0.0); + + next.control.orientation = + Quaternion::rotation_x(-1.4 + move1pow * 2.2 + move2 * -0.6) + * Quaternion::rotation_y(-PI); + + next.shoulder_l.position = + Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2); + next.shoulder_l.orientation = Quaternion::rotation_x(-0.4 + move1pow * 1.6); + next.shoulder_r.orientation = + Quaternion::rotation_y(0.4) * Quaternion::rotation_x(0.4 + move1pow * 1.0); + + if speed == 0.0 { + next.leg_l.orientation = Quaternion::rotation_x(move1 * 0.8 + move2 * -0.8); + + next.foot_l.position = Vec3::new( + -s_a.foot.0, + s_a.foot.1, + s_a.foot.2 + move1 * 4.0 + move2 * -4.0, + ); + next.foot_l.orientation = + Quaternion::rotation_x(move1 * -0.6 + move2 * 0.6); } - } + }, + _ => {}, }, _ => {}, } diff --git a/voxygen/anim/src/biped_large/stunned.rs b/voxygen/anim/src/biped_large/stunned.rs index 8e9bb21e70..9a61b019ec 100644 --- a/voxygen/anim/src/biped_large/stunned.rs +++ b/voxygen/anim/src/biped_large/stunned.rs @@ -225,7 +225,7 @@ impl Animation for StunnedAnimation { next.hand_r.orientation = Quaternion::rotation_x(PI / 3.0) * Quaternion::rotation_z(0.35); }, - "Beast Claws" => { + "Beast Claws" | "Tursus Claws" => { next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2); diff --git a/voxygen/anim/src/biped_large/summon.rs b/voxygen/anim/src/biped_large/summon.rs index ce4c0484c7..34695047c7 100644 --- a/voxygen/anim/src/biped_large/summon.rs +++ b/voxygen/anim/src/biped_large/summon.rs @@ -12,12 +12,13 @@ pub struct SummonAnimation; impl Animation for SummonAnimation { type Dependency<'a> = ( - (Option, Option<&'a AbilitySpec>), + Option, (Option, Option<&'a AbilitySpec>), Vec3, f32, Option, f32, + Option<&'a str>, ); type Skeleton = BipedLargeSkeleton; @@ -28,12 +29,13 @@ impl Animation for SummonAnimation { fn update_skeleton_inner( skeleton: &Self::Skeleton, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel, + ability_id, ): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, @@ -119,109 +121,95 @@ impl Animation for SummonAnimation { next.control.orientation = Quaternion::rotation_x(-0.2 + move1 * 1.0) * Quaternion::rotation_y(-0.1 + move2 * -0.8); }, - Some(ToolKind::Natural) => { - if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { - match spec.as_str() { - "Tidal Warrior" => { - let (move1base, move2base, move3) = match stage_section { - Some(StageSection::Buildup) => ((anim_time.powi(2)), 0.0, 0.0), - Some(StageSection::Action) => (1.0, (anim_time * 30.0).sin(), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), - _ => (0.0, 0.0, 0.0), - }; - let pullback = 1.0 - move3; - let move1 = move1base * pullback; - let move2 = move2base * pullback; - next.torso.position = Vec3::new(0.0, 0.0 + move1 * 4.7, move1 * -18.8); - next.upper_torso.position = - Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1); + Some(ToolKind::Natural) => match ability_id { + Some("common.abilities.custom.tidalwarrior.totem") => { + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => ((anim_time.powi(2)), 0.0, 0.0), + Some(StageSection::Action) => (1.0, (anim_time * 30.0).sin(), 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1 = move1base * pullback; + let move2 = move2base * pullback; + next.torso.position = Vec3::new(0.0, 0.0 + move1 * 4.7, move1 * -18.8); + next.upper_torso.position = + Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1); - next.lower_torso.position = - Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1); + next.lower_torso.position = + Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1); - next.head.position = - Vec3::new(0.0, s_a.head.0 + move1 * -8.0, s_a.head.1 + move1 * 6.0); - next.shoulder_l.orientation = Quaternion::rotation_x(move1 * 2.5) - * Quaternion::rotation_y(move1 * 0.4 + move2 * 0.05); - next.shoulder_r.orientation = Quaternion::rotation_x(move1 * 2.5) - * Quaternion::rotation_y(move1 * -0.4 + move2 * -0.05); - next.head.orientation = Quaternion::rotation_x(move1 * 1.4) - * Quaternion::rotation_y(move2 * 0.02); - next.upper_torso.orientation = Quaternion::rotation_x(move1 * -1.5) - * Quaternion::rotation_y(move2 * -0.02); - next.lower_torso.orientation = Quaternion::rotation_x(move1 * 0.2) - * Quaternion::rotation_y(move2 * 0.02); - next.hand_l.position = Vec3::new( - -14.0 + move1 * -5.0, - 2.0 + move1 * -2.0, - -4.0 + move1 * 12.0, - ); - next.hand_r.position = Vec3::new( - 14.0 + move1 * 5.0, - 2.0 + move1 * -2.0, - -4.0 + move1 * 12.0, - ); + next.head.position = + Vec3::new(0.0, s_a.head.0 + move1 * -8.0, s_a.head.1 + move1 * 6.0); + next.shoulder_l.orientation = Quaternion::rotation_x(move1 * 2.5) + * Quaternion::rotation_y(move1 * 0.4 + move2 * 0.05); + next.shoulder_r.orientation = Quaternion::rotation_x(move1 * 2.5) + * Quaternion::rotation_y(move1 * -0.4 + move2 * -0.05); + next.head.orientation = + Quaternion::rotation_x(move1 * 1.4) * Quaternion::rotation_y(move2 * 0.02); + next.upper_torso.orientation = Quaternion::rotation_x(move1 * -1.5) + * Quaternion::rotation_y(move2 * -0.02); + next.lower_torso.orientation = + Quaternion::rotation_x(move1 * 0.2) * Quaternion::rotation_y(move2 * 0.02); + next.hand_l.position = Vec3::new( + -14.0 + move1 * -5.0, + 2.0 + move1 * -2.0, + -4.0 + move1 * 12.0, + ); + next.hand_r.position = + Vec3::new(14.0 + move1 * 5.0, 2.0 + move1 * -2.0, -4.0 + move1 * 12.0); - next.hand_l.orientation = - Quaternion::rotation_x(PI / 3.0 + move1 * 1.5) - * Quaternion::rotation_y(-move1 * 0.7 + move2 * 0.2) - * Quaternion::rotation_z(-0.35); - next.hand_r.orientation = - Quaternion::rotation_x(PI / 3.0 + move1 * 1.5) - * Quaternion::rotation_y(move1 * 0.7 + move2 * 0.2) - * Quaternion::rotation_z(0.35); - next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2); - next.leg_l.orientation = - Quaternion::rotation_z(0.0) * Quaternion::rotation_x(move1 * -0.8); + next.hand_l.orientation = Quaternion::rotation_x(PI / 3.0 + move1 * 1.5) + * Quaternion::rotation_y(-move1 * 0.7 + move2 * 0.2) + * Quaternion::rotation_z(-0.35); + next.hand_r.orientation = Quaternion::rotation_x(PI / 3.0 + move1 * 1.5) + * Quaternion::rotation_y(move1 * 0.7 + move2 * 0.2) + * Quaternion::rotation_z(0.35); + next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2); + next.leg_l.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(move1 * -0.8); - next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2); - next.foot_l.position = - Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * -3.0, s_a.foot.2); - next.foot_r.position = - Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * -3.0, s_a.foot.2); - next.leg_r.orientation = - Quaternion::rotation_z(0.0) * Quaternion::rotation_x(move1 * -0.8); - next.foot_l.orientation = - Quaternion::rotation_z(0.0) * Quaternion::rotation_x(move1 * 0.8); - next.foot_r.orientation = - Quaternion::rotation_z(0.0) * Quaternion::rotation_x(move1 * 0.8); - }, - _ => {}, - } - } + next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2); + next.foot_l.position = + Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * -3.0, s_a.foot.2); + next.foot_r.position = + Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * -3.0, s_a.foot.2); + next.leg_r.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(move1 * -0.8); + next.foot_l.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(move1 * 0.8); + next.foot_r.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(move1 * 0.8); + }, + _ => {}, }, - Some(ToolKind::Axe) => { - if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { - match spec.as_str() { - "Frost Gigas" => { - 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 * 2.7 + 0.1 * speednorm) - * Quaternion::rotation_y(move1 * 0.7 + 0.1 * speednorm); - next.head.orientation = Quaternion::rotation_x(0.0); - next.hand_l.position = Vec3::new( - -14.0 + move1 * -5.0, - 2.0 + move1 * -2.0, - -2.0 + move1 * 6.0 + move2 * 4.0, - ); - next.hand_r.position = Vec3::new(14.0, 2.0, -4.0); - next.hand_l.orientation = - Quaternion::rotation_x(PI / 3.0 + move1 * 2.2) - * Quaternion::rotation_y(move1 * 0.1) - * Quaternion::rotation_z(-0.35); - next.hand_r.orientation = - Quaternion::rotation_x(PI / 3.0) * Quaternion::rotation_z(0.35); - next.main.position = Vec3::new(14.0, 2.0, -4.0); - next.main.orientation = - Quaternion::rotation_x(PI / 3.0) * Quaternion::rotation_z(0.35); - }, - _ => {}, - } - } + Some(ToolKind::Axe) => match ability_id { + Some("common.abilities.custom.gigas_frost.frost_summons") => { + 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 * 2.7 + 0.1 * speednorm) + * Quaternion::rotation_y(move1 * 0.7 + 0.1 * speednorm); + next.head.orientation = Quaternion::rotation_x(0.0); + next.hand_l.position = Vec3::new( + -14.0 + move1 * -5.0, + 2.0 + move1 * -2.0, + -2.0 + move1 * 6.0 + move2 * 4.0, + ); + next.hand_r.position = Vec3::new(14.0, 2.0, -4.0); + next.hand_l.orientation = Quaternion::rotation_x(PI / 3.0 + move1 * 2.2) + * Quaternion::rotation_y(move1 * 0.1) + * Quaternion::rotation_z(-0.35); + next.hand_r.orientation = + Quaternion::rotation_x(PI / 3.0) * Quaternion::rotation_z(0.35); + next.main.position = Vec3::new(14.0, 2.0, -4.0); + next.main.orientation = + Quaternion::rotation_x(PI / 3.0) * Quaternion::rotation_z(0.35); + }, + _ => {}, }, _ => {}, } diff --git a/voxygen/anim/src/biped_large/wield.rs b/voxygen/anim/src/biped_large/wield.rs index e757493c33..ed3a57a0e9 100644 --- a/voxygen/anim/src/biped_large/wield.rs +++ b/voxygen/anim/src/biped_large/wield.rs @@ -259,7 +259,7 @@ impl Animation for WieldAnimation { next.hand_r.orientation = Quaternion::rotation_x(PI / 3.0) * Quaternion::rotation_z(0.35); }, - "Beast Claws" => { + "Beast Claws" | "Tursus Claws" => { next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2); diff --git a/voxygen/anim/src/bird_medium/mod.rs b/voxygen/anim/src/bird_medium/mod.rs index c035293ccb..83ba9f5b13 100644 --- a/voxygen/anim/src/bird_medium/mod.rs +++ b/voxygen/anim/src/bird_medium/mod.rs @@ -272,20 +272,20 @@ impl<'a> From<&'a Body> for SkeletonAttr { feed: match (body.species, body.body_type) { (SnowyOwl, _) => -0.65, (HornedOwl, _) => -0.65, - (Duck, _) => -0.65, - (Cockatiel, _) => -0.65, - (Chicken, _) => 1.2, - (Bat, _) => -0.65, - (Penguin, _) => -0.65, - (Goose, _) => 1.4, - (Peacock, _) => 1.6, - (Eagle, _) => 1.2, - (Parrot, _) => 1.2, - (Crow, _) => 1.2, - (Dodo, _) => 1.2, - (Parakeet, _) => 1.2, - (Puffin, _) => 1.2, - (Toucan, _) => 1.2, + (Duck, _) => -0.55, + (Cockatiel, _) => -0.60, + (Chicken, _) => -0.65, + (Bat, _) => -0.55, + (Penguin, _) => -0.75, + (Goose, _) => -0.65, + (Peacock, _) => -1.2, + (Eagle, _) => -0.75, + (Parrot, _) => -0.60, + (Crow, _) => -0.65, + (Dodo, _) => -0.65, + (Parakeet, _) => -0.60, + (Puffin, _) => -0.75, + (Toucan, _) => -0.50, }, } } diff --git a/voxygen/anim/src/character/music.rs b/voxygen/anim/src/character/music.rs index d1680ac5d1..244fddc78f 100644 --- a/voxygen/anim/src/character/music.rs +++ b/voxygen/anim/src/character/music.rs @@ -3,7 +3,7 @@ use super::{ CharacterSkeleton, SkeletonAttr, }; use common::{ - comp::item::{AbilitySpec, Hands, ToolKind}, + comp::item::{Hands, ToolKind}, states::utils::AbilityInfo, }; use std::{f32::consts::PI, ops::Mul}; @@ -12,8 +12,9 @@ pub struct MusicAnimation; type MusicAnimationDependency<'a> = ( (Option, Option), - (Option, Option<&'a AbilitySpec>, f32), + (Option, f32), Vec3, + Option<&'a str>, ); impl Animation for MusicAnimation { type Dependency<'a> = MusicAnimationDependency<'a>; @@ -25,7 +26,7 @@ impl Animation for MusicAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_music")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (_hands, (ability_info, active_tool_spec, global_time), rel_vel): Self::Dependency<'_>, + (_hands, (ability_info, global_time), rel_vel, ability_id): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, @@ -98,228 +99,236 @@ impl Animation for MusicAnimation { (global_time + anim_time / 6.0).floor().mul(1337.0).sin() * 0.15, ); - // TODO: create Instrument SubToolKinds to distinguish instruments match ability_info.and_then(|a| a.tool) { Some(ToolKind::Instrument) => { - if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { - // instrument specific head_bop - let head_bop = match spec.as_str() { - "Flute" | "GlassFlute" | "Melodica" => 0.2, - "Guitar" | "DarkGuitar" | "Lute" | "Sitar" => 0.5, - "Lyre" | "IcyTalharpa" | "Kalimba" => 0.3, - _ => 1.0, - }; - next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); - next.head.orientation = Quaternion::rotation_z((short * head_bop) * -0.6) - * Quaternion::rotation_x( - 0.2 + head_look.y.max(0.0) + (shorte * head_bop).abs() * -0.2, + // instrument specific head_bop + let head_bop = match ability_id { + Some("common.abilities.music.flute") + | Some("common.abilities.music.glass_flute") + | Some("common.abilities.music.melodica") => 0.2, + + Some("common.abilities.music.guitar") + | Some("common.abilities.music.dark_guitar") + | Some("common.abilities.music.lute") + | Some("common.abilities.music.sitar") => 0.5, + + Some("common.abilities.music.lyre") + | Some("common.abilities.music.icy_talharpa") + | Some("common.abilities.music.kalimba") => 0.3, + _ => 1.0, + }; + next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); + next.head.orientation = Quaternion::rotation_z((short * head_bop) * -0.6) + * Quaternion::rotation_x( + 0.2 + head_look.y.max(0.0) + (shorte * head_bop).abs() * -0.2, + ); + // instrument specific hand and instrument animations + match ability_id { + Some("common.abilities.music.double_bass") => { + next.hand_l.position = Vec3::new( + 3.5 - s_a.hand.0, + 7.0 + s_a.hand.1 + shortealt * -3.0, + 8.0 + s_a.hand.2 + shortealt * -0.75, ); - // instrument specific hand and instrument animations - match spec.as_str() { - "DoubleBass" => { - next.hand_l.position = Vec3::new( - 3.5 - s_a.hand.0, - 7.0 + s_a.hand.1 + shortealt * -3.0, - 8.0 + s_a.hand.2 + shortealt * -0.75, - ); - next.hand_l.orientation = Quaternion::rotation_x(2.4 + foot * 0.15) - * Quaternion::rotation_y(-0.5); + next.hand_l.orientation = Quaternion::rotation_x(2.4 + foot * 0.15) + * Quaternion::rotation_y(-0.5); - next.hand_r.position = Vec3::new( - -2.0 + s_a.hand.0, - 4.0 + s_a.hand.1 + shortealt * 6.0, - 4.0 + s_a.hand.2 + shortealt * 0.75, - ); - next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15) - * Quaternion::rotation_y(0.4); + next.hand_r.position = Vec3::new( + -2.0 + s_a.hand.0, + 4.0 + s_a.hand.1 + shortealt * 6.0, + 4.0 + s_a.hand.2 + shortealt * 0.75, + ); + next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15) + * Quaternion::rotation_y(0.4); - next.main.position = Vec3::new(-4.0, 6.0, 16.0); - next.main.orientation = Quaternion::rotation_x(0.1) - * Quaternion::rotation_y(3.0) - * Quaternion::rotation_z(PI / -3.0); - }, - "Flute" | "GlassFlute" => { - next.hand_l.position = Vec3::new( - 4.0 - s_a.hand.0, - 6.0 + s_a.hand.1 + shortealt * -0.5, - 4.0 + s_a.hand.2 + shortealt * -0.75, - ); - next.hand_l.orientation = Quaternion::rotation_x(2.4 + foot * 0.15) - * Quaternion::rotation_y(-0.9); + next.main.position = Vec3::new(-4.0, 6.0, 16.0); + next.main.orientation = Quaternion::rotation_x(0.1) + * Quaternion::rotation_y(3.0) + * Quaternion::rotation_z(PI / -3.0); + }, + Some("common.abilities.music.flute") + | Some("common.abilities.music.glass_flute") => { + next.hand_l.position = Vec3::new( + 4.0 - s_a.hand.0, + 6.0 + s_a.hand.1 + shortealt * -0.5, + 4.0 + s_a.hand.2 + shortealt * -0.75, + ); + next.hand_l.orientation = Quaternion::rotation_x(2.4 + foot * 0.15) + * Quaternion::rotation_y(-0.9); - next.hand_r.position = Vec3::new( - -4.5 + s_a.hand.0, - 4.0 + s_a.hand.1 + shortealt * 2.0, - 2.0 + s_a.hand.2 + shortealt * 0.75, - ); - next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15) - * Quaternion::rotation_y(0.6); + next.hand_r.position = Vec3::new( + -4.5 + s_a.hand.0, + 4.0 + s_a.hand.1 + shortealt * 2.0, + 2.0 + s_a.hand.2 + shortealt * 0.75, + ); + next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15) + * Quaternion::rotation_y(0.6); - next.main.position = Vec3::new(-2.5, 10.0, -11.0); - next.main.orientation = Quaternion::rotation_x(3.5) - * Quaternion::rotation_y(PI) - * Quaternion::rotation_z(0.05); - }, - "Guitar" | "DarkGuitar" => { - next.hand_l.position = Vec3::new( - 1.0 - s_a.hand.0, - 6.0 + s_a.hand.1 + shortealt * -1.0, - 2.0 + s_a.hand.2 + shortealt * -1.5, - ); - next.hand_l.orientation = Quaternion::rotation_x(1.8 + foot * 0.15) - * Quaternion::rotation_y(-0.6) - * Quaternion::rotation_z(0.8); + next.main.position = Vec3::new(-2.5, 10.0, -11.0); + next.main.orientation = Quaternion::rotation_x(3.5) + * Quaternion::rotation_y(PI) + * Quaternion::rotation_z(0.05); + }, + Some("common.abilities.music.guitar") + | Some("common.abilities.music.dark_guitar") => { + next.hand_l.position = Vec3::new( + 1.0 - s_a.hand.0, + 6.0 + s_a.hand.1 + shortealt * -1.0, + 2.0 + s_a.hand.2 + shortealt * -1.5, + ); + next.hand_l.orientation = Quaternion::rotation_x(1.8 + foot * 0.15) + * Quaternion::rotation_y(-0.6) + * Quaternion::rotation_z(0.8); - next.hand_r.position = Vec3::new( - -2.0 + s_a.hand.0 - shortealt * 1.25, - 6.0 + s_a.hand.1 + shortealt * 2.0, - 3.0 + s_a.hand.2 + shortealt * 0.25, - ); - next.hand_r.orientation = Quaternion::rotation_x(1.0 + foot * -0.15) - * Quaternion::rotation_y(0.6); + next.hand_r.position = Vec3::new( + -2.0 + s_a.hand.0 - shortealt * 1.25, + 6.0 + s_a.hand.1 + shortealt * 2.0, + 3.0 + s_a.hand.2 + shortealt * 0.25, + ); + next.hand_r.orientation = Quaternion::rotation_x(1.0 + foot * -0.15) + * Quaternion::rotation_y(0.6); - next.main.position = Vec3::new(-14.0, 6.0, 5.0); - next.main.orientation = Quaternion::rotation_x(0.1) - * Quaternion::rotation_y(2.0) - * Quaternion::rotation_z(PI / -3.0); - }, - "Lyre" | "IcyTalharpa" => { - next.hand_l.position = Vec3::new( - 3.0 - s_a.hand.0, - 4.0 + s_a.hand.1 + shortealt * -0.1, - 1.0 + s_a.hand.2 + shortealt * -0.2, - ); - next.hand_l.orientation = Quaternion::rotation_x(1.4 + foot * 0.15) - * Quaternion::rotation_y(-0.6); + next.main.position = Vec3::new(-14.0, 6.0, 5.0); + next.main.orientation = Quaternion::rotation_x(0.1) + * Quaternion::rotation_y(2.0) + * Quaternion::rotation_z(PI / -3.0); + }, + Some("common.abilities.music.lyre") + | Some("common.abilities.music.icy_talharpa") => { + next.hand_l.position = Vec3::new( + 3.0 - s_a.hand.0, + 4.0 + s_a.hand.1 + shortealt * -0.1, + 1.0 + s_a.hand.2 + shortealt * -0.2, + ); + next.hand_l.orientation = Quaternion::rotation_x(1.4 + foot * 0.15) + * Quaternion::rotation_y(-0.6); - next.hand_r.position = Vec3::new( - -4.0 + s_a.hand.0 + shortealt * 2.0, - 5.0 + s_a.hand.1 - shortealt * 3.0, - 2.0 + s_a.hand.2 + shortealt * 0.75, - ); - next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15) - * Quaternion::rotation_y(0.9); + next.hand_r.position = Vec3::new( + -4.0 + s_a.hand.0 + shortealt * 2.0, + 5.0 + s_a.hand.1 - shortealt * 3.0, + 2.0 + s_a.hand.2 + shortealt * 0.75, + ); + next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15) + * Quaternion::rotation_y(0.9); - next.main.position = Vec3::new(8.0, 14.0, -6.0); - next.main.orientation = Quaternion::rotation_x(0.2) - * Quaternion::rotation_y(-0.75) - * Quaternion::rotation_z(0.20); - }, + next.main.position = Vec3::new(8.0, 14.0, -6.0); + next.main.orientation = Quaternion::rotation_x(0.2) + * Quaternion::rotation_y(-0.75) + * Quaternion::rotation_z(0.20); + }, + Some("common.abilities.music.kalimba") => { + next.hand_l.position = Vec3::new( + 3.0 - s_a.hand.0, + 4.0 + s_a.hand.1 + shortealt * -0.1, + 1.0 + s_a.hand.2 + shortealt * -0.2, + ); + next.hand_l.orientation = Quaternion::rotation_x(1.4 + foot * 0.15) + * Quaternion::rotation_y(-0.6); - "Kalimba" => { - next.hand_l.position = Vec3::new( - 3.0 - s_a.hand.0, - 4.0 + s_a.hand.1 + shortealt * -0.1, - 1.0 + s_a.hand.2 + shortealt * -0.2, - ); - next.hand_l.orientation = Quaternion::rotation_x(1.4 + foot * 0.15) - * Quaternion::rotation_y(-0.6); + next.hand_r.position = Vec3::new( + -2.0 + s_a.hand.0 + shortealt * 2.0, + 5.0 + s_a.hand.1 - shortealt * 3.0, + 2.0 + s_a.hand.2 + shortealt * 0.75, + ); + next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15) + * Quaternion::rotation_y(0.9); - next.hand_r.position = Vec3::new( - -2.0 + s_a.hand.0 + shortealt * 2.0, - 5.0 + s_a.hand.1 - shortealt * 3.0, - 2.0 + s_a.hand.2 + shortealt * 0.75, - ); - next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15) - * Quaternion::rotation_y(0.9); + next.main.position = Vec3::new(8.0, 12.0, -8.0); + next.main.orientation = Quaternion::rotation_x(0.2) + * Quaternion::rotation_y(-0.75) + * Quaternion::rotation_z(PI - 0.2); + }, + Some("common.abilities.music.lute") => { + next.hand_l.position = Vec3::new( + 2.0 - s_a.hand.0, + 5.0 + s_a.hand.1 + shortealt * -1.0, + 2.0 + s_a.hand.2 + shortealt * -1.5, + ); + next.hand_l.orientation = Quaternion::rotation_x(1.8 + foot * 0.15) + * Quaternion::rotation_y(-0.6) + * Quaternion::rotation_z(0.8); - next.main.position = Vec3::new(8.0, 12.0, -8.0); - next.main.orientation = Quaternion::rotation_x(0.2) - * Quaternion::rotation_y(-0.75) - * Quaternion::rotation_z(PI - 0.2); - }, - "Lute" => { - next.hand_l.position = Vec3::new( - 2.0 - s_a.hand.0, - 5.0 + s_a.hand.1 + shortealt * -1.0, - 2.0 + s_a.hand.2 + shortealt * -1.5, - ); - next.hand_l.orientation = Quaternion::rotation_x(1.8 + foot * 0.15) - * Quaternion::rotation_y(-0.6) - * Quaternion::rotation_z(0.8); + next.hand_r.position = Vec3::new( + -1.0 + s_a.hand.0 - shortealt * 1.25, + 6.0 + s_a.hand.1 + shortealt * 2.0, + 2.0 + s_a.hand.2 + shortealt * 0.25, + ); + next.hand_r.orientation = Quaternion::rotation_x(1.0 + foot * -0.15) + * Quaternion::rotation_y(0.6); - next.hand_r.position = Vec3::new( - -1.0 + s_a.hand.0 - shortealt * 1.25, - 6.0 + s_a.hand.1 + shortealt * 2.0, - 2.0 + s_a.hand.2 + shortealt * 0.25, - ); - next.hand_r.orientation = Quaternion::rotation_x(1.0 + foot * -0.15) - * Quaternion::rotation_y(0.6); + next.main.position = Vec3::new(-14.0, 6.0, 4.0); + next.main.orientation = Quaternion::rotation_x(0.1) + * Quaternion::rotation_y(2.0) + * Quaternion::rotation_z(PI / -3.0); + }, + Some("common.abilities.music.melodica") => { + next.hand_l.position = Vec3::new( + 4.0 - s_a.hand.0, + 6.0 + s_a.hand.1 + shortealt * -0.5, + 4.0 + s_a.hand.2 + shortealt * -0.75, + ); + next.hand_l.orientation = Quaternion::rotation_x(2.4 + foot * 0.15) + * Quaternion::rotation_y(-0.9); - next.main.position = Vec3::new(-14.0, 6.0, 4.0); - next.main.orientation = Quaternion::rotation_x(0.1) - * Quaternion::rotation_y(2.0) - * Quaternion::rotation_z(PI / -3.0); - }, - "Melodica" => { - next.hand_l.position = Vec3::new( - 4.0 - s_a.hand.0, - 6.0 + s_a.hand.1 + shortealt * -0.5, - 4.0 + s_a.hand.2 + shortealt * -0.75, - ); - next.hand_l.orientation = Quaternion::rotation_x(2.4 + foot * 0.15) - * Quaternion::rotation_y(-0.9); + next.hand_r.position = Vec3::new( + -3.5 + s_a.hand.0, + 4.0 + s_a.hand.1 + shortealt * 2.0, + 2.0 + s_a.hand.2 + shortealt * 0.75, + ); + next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15) + * Quaternion::rotation_y(0.6); - next.hand_r.position = Vec3::new( - -3.5 + s_a.hand.0, - 4.0 + s_a.hand.1 + shortealt * 2.0, - 2.0 + s_a.hand.2 + shortealt * 0.75, - ); - next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15) - * Quaternion::rotation_y(0.6); + next.main.position = Vec3::new(-1.0, 2.0, 16.0); + next.main.orientation = Quaternion::rotation_x(0.3) + * Quaternion::rotation_y(PI) + * Quaternion::rotation_z(PI / -2.0); + }, + Some("common.abilities.music.washboard") => { + next.hand_l.position = Vec3::new( + 3.0 - s_a.hand.0, + 4.0 + s_a.hand.1 + shortealt * -0.1, + 1.0 + s_a.hand.2 + shortealt * -0.2, + ); + next.hand_l.orientation = Quaternion::rotation_x(1.4 + foot * 0.15) + * Quaternion::rotation_y(-0.6); - next.main.position = Vec3::new(-1.0, 2.0, 16.0); - next.main.orientation = Quaternion::rotation_x(0.3) - * Quaternion::rotation_y(PI) - * Quaternion::rotation_z(PI / -2.0); - }, - "Washboard" => { - next.hand_l.position = Vec3::new( - 3.0 - s_a.hand.0, - 4.0 + s_a.hand.1 + shortealt * -0.1, - 1.0 + s_a.hand.2 + shortealt * -0.2, - ); - next.hand_l.orientation = Quaternion::rotation_x(1.4 + foot * 0.15) - * Quaternion::rotation_y(-0.6); + next.hand_r.position = Vec3::new( + -4.0 + s_a.hand.0 + shortealt * 2.0, + 5.0 + s_a.hand.1 - shortealt * 3.0, + 2.0 + s_a.hand.2 + shortealt * 0.75, + ); + next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15) + * Quaternion::rotation_y(0.9); - next.hand_r.position = Vec3::new( - -4.0 + s_a.hand.0 + shortealt * 2.0, - 5.0 + s_a.hand.1 - shortealt * 3.0, - 2.0 + s_a.hand.2 + shortealt * 0.75, - ); - next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15) - * Quaternion::rotation_y(0.9); + next.main.position = Vec3::new(8.0, 14.0, -6.0); + next.main.orientation = Quaternion::rotation_x(0.2) + * Quaternion::rotation_y(-0.75) + * Quaternion::rotation_z(0.20); + }, + Some("common.abilities.music.sitar") => { + next.hand_l.position = Vec3::new( + 2.0 - s_a.hand.0, + 6.0 + s_a.hand.1 + shortealt * -1.0, + 1.0 + s_a.hand.2 + shortealt * -1.5, + ); + next.hand_l.orientation = Quaternion::rotation_x(1.8 + foot * 0.15) + * Quaternion::rotation_y(-0.6) + * Quaternion::rotation_z(0.8); - next.main.position = Vec3::new(8.0, 14.0, -6.0); - next.main.orientation = Quaternion::rotation_x(0.2) - * Quaternion::rotation_y(-0.75) - * Quaternion::rotation_z(0.20); - }, - "Sitar" => { - next.hand_l.position = Vec3::new( - 2.0 - s_a.hand.0, - 6.0 + s_a.hand.1 + shortealt * -1.0, - 1.0 + s_a.hand.2 + shortealt * -1.5, - ); - next.hand_l.orientation = Quaternion::rotation_x(1.8 + foot * 0.15) - * Quaternion::rotation_y(-0.6) - * Quaternion::rotation_z(0.8); + next.hand_r.position = Vec3::new( + -2.0 + s_a.hand.0 - shortealt * 1.25, + 6.0 + s_a.hand.1 + shortealt * 2.0, + 2.0 + s_a.hand.2 + shortealt * 0.25, + ); + next.hand_r.orientation = Quaternion::rotation_x(1.0 + foot * -0.15) + * Quaternion::rotation_y(0.6); - next.hand_r.position = Vec3::new( - -2.0 + s_a.hand.0 - shortealt * 1.25, - 6.0 + s_a.hand.1 + shortealt * 2.0, - 2.0 + s_a.hand.2 + shortealt * 0.25, - ); - next.hand_r.orientation = Quaternion::rotation_x(1.0 + foot * -0.15) - * Quaternion::rotation_y(0.6); - - next.main.position = Vec3::new(-15.0, 6.0, 4.0); - next.main.orientation = Quaternion::rotation_x(0.1) - * Quaternion::rotation_y(2.0) - * Quaternion::rotation_z(PI / -3.0); - }, - _ => {}, - } + next.main.position = Vec3::new(-15.0, 6.0, 4.0); + next.main.orientation = Quaternion::rotation_x(0.1) + * Quaternion::rotation_y(2.0) + * Quaternion::rotation_z(PI / -3.0); + }, + _ => {}, } }, _ => {}, diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index eb42e8483c..2cb8dfcd31 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -2062,8 +2062,9 @@ impl FigureMgr { &target_base, ( hands, - (Some(s.static_data.ability_info), active_tool_spec, time), + (Some(s.static_data.ability_info), time), rel_vel, + ability_id, ), state.state_time, &mut state_animation_rate, @@ -5064,12 +5065,13 @@ impl FigureMgr { anim::biped_large::ChargeMeleeAnimation::update_skeleton( &target_base, ( - (active_tool_kind, active_tool_spec), + 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, @@ -5126,7 +5128,7 @@ impl FigureMgr { anim::biped_large::AlphaAnimation::update_skeleton( &target_base, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, (second_tool_kind, second_tool_spec), rel_vel, time, @@ -5157,7 +5159,7 @@ impl FigureMgr { anim::biped_large::ShootAnimation::update_skeleton( &target_base, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, (second_tool_kind, second_tool_spec), rel_vel, // TODO: Update to use the quaternion. @@ -5166,6 +5168,7 @@ impl FigureMgr { time, Some(s.stage_section), state.acc_vel, + ability_id, ), stage_progress, &mut state_animation_rate, @@ -5251,7 +5254,7 @@ impl FigureMgr { anim::biped_large::ShootAnimation::update_skeleton( &target_base, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, (second_tool_kind, second_tool_spec), rel_vel, // TODO: Update to use the quaternion. @@ -5260,6 +5263,7 @@ impl FigureMgr { time, Some(s.stage_section), state.acc_vel, + ability_id, ), stage_progress, &mut state_animation_rate, @@ -5286,12 +5290,13 @@ impl FigureMgr { anim::biped_large::DashAnimation::update_skeleton( &target_base, ( - (active_tool_kind, active_tool_spec), + 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, @@ -5322,7 +5327,7 @@ impl FigureMgr { 1 => anim::biped_large::AlphaAnimation::update_skeleton( &target_base, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, (second_tool_kind, second_tool_spec), rel_vel, time, @@ -5338,12 +5343,13 @@ impl FigureMgr { 2 => anim::biped_large::BetaAnimation::update_skeleton( &target_base, ( - (active_tool_kind, active_tool_spec), + 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, @@ -5352,12 +5358,13 @@ impl FigureMgr { _ => anim::biped_large::BetaAnimation::update_skeleton( &target_base, ( - (active_tool_kind, active_tool_spec), + 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, @@ -5415,12 +5422,13 @@ impl FigureMgr { anim::biped_large::SummonAnimation::update_skeleton( &target_base, ( - (active_tool_kind, active_tool_spec), + 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, @@ -5516,11 +5524,12 @@ impl FigureMgr { anim::biped_large::ShockwaveAnimation::update_skeleton( &target_base, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, (second_tool_kind, second_tool_spec), time, rel_vel.magnitude(), Some(s.stage_section), + ability_id, ), stage_progress, &mut state_animation_rate, @@ -5542,13 +5551,14 @@ impl FigureMgr { anim::biped_large::BeamAnimation::update_skeleton( &target_base, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, (second_tool_kind, second_tool_spec), time, rel_vel, Some(s.stage_section), state.acc_vel, state.state_time, + ability_id, ), stage_progress, &mut state_animation_rate, @@ -5572,11 +5582,12 @@ impl FigureMgr { anim::biped_large::SpriteSummonAnimation::update_skeleton( &target_base, ( - (active_tool_kind, active_tool_spec), + active_tool_kind, (second_tool_kind, second_tool_spec), time, rel_vel.magnitude(), Some(s.stage_section), + ability_id, ), stage_progress, &mut state_animation_rate, diff --git a/world/src/site2/plot/sea_chapel.rs b/world/src/site2/plot/sea_chapel.rs index 88fbef0b05..a0ab423511 100644 --- a/world/src/site2/plot/sea_chapel.rs +++ b/world/src/site2/plot/sea_chapel.rs @@ -2539,7 +2539,7 @@ impl Structure for SeaChapel { min: Vec3::new( cr_center.x + (diameter / 3) - 1, cr_center.y - 2, - base - (2 * (diameter / 3)) - (diameter / 4), + base - (2 * (diameter / 3)) - (diameter / 4) + 2, ), max: Vec3::new( cr_center.x + (diameter / 3) + 6,