From f411ff7e047c822d5f92eb8aa255d85d748ef587 Mon Sep 17 00:00:00 2001 From: jshipsey Date: Sat, 21 Nov 2020 14:06:36 -0500 Subject: [PATCH] bunch of animations and more attacks --- .../abilities/unique/quadlowbasic/basic.ron | 10 -- .../unique/quadlowbasic/singlestrike.ron | 23 ++++ .../unique/quadlowbreathe/flamethrower.ron | 14 ++ .../unique/quadlowbreathe/triplestrike.ron | 49 +++++++ .../abilities/unique/quadlowranged/basic.ron | 10 -- .../unique/quadlowranged/singlestrike.ron | 23 ++++ .../unique/quadmedbasic/triplestrike.ron | 36 ++--- .../unique/quadsmallbasic/singlestrike.ron | 23 ++++ .../unique/theropodbasic/singlestrike.ron | 23 ++++ .../unique/theropodbasic/triplestrike.ron | 49 +++++++ .../abilities/weapon_ability_manifest.ron | 23 +++- .../npc_weapons/unique/quadlowbreathe.ron | 15 ++ .../npc_weapons/unique/quadsmallbasic.ron | 15 ++ .../npc_weapons/unique/theropodbasic.ron | 15 ++ assets/common/npc_names.json | 4 + .../voxel/npc/lavadrake/male/chest.vox | 3 + .../voxel/npc/lavadrake/male/foot_bl.vox | 3 + .../voxel/npc/lavadrake/male/foot_br.vox | 3 + .../voxel/npc/lavadrake/male/foot_fl.vox | 3 + .../voxel/npc/lavadrake/male/foot_fr.vox | 3 + .../voxel/npc/lavadrake/male/head_lower.vox | 3 + .../voxel/npc/lavadrake/male/head_upper.vox | 3 + .../voxygen/voxel/npc/lavadrake/male/jaw.vox | 3 + .../voxel/npc/lavadrake/male/tail_front.vox | 3 + .../voxel/npc/lavadrake/male/tail_rear.vox | 3 + .../voxel/quadruped_low_central_manifest.ron | 52 +++++++ .../voxel/quadruped_low_lateral_manifest.ron | 36 +++++ common/src/comp/body/quadruped_low.rs | 6 +- common/src/comp/inventory/item/tool.rs | 3 + common/src/loadout_builder.rs | 19 +++ common/src/states/utils.rs | 3 +- voxygen/src/anim/src/character/swim.rs | 2 +- voxygen/src/anim/src/quadruped_low/breathe.rs | 70 ++++++++++ voxygen/src/anim/src/quadruped_low/mod.rs | 15 +- voxygen/src/anim/src/quadruped_medium/dash.rs | 99 ++++++++++++++ voxygen/src/anim/src/quadruped_medium/mod.rs | 3 +- voxygen/src/anim/src/quadruped_small/alpha.rs | 53 ++++++++ voxygen/src/anim/src/quadruped_small/mod.rs | 3 +- voxygen/src/anim/src/theropod/alpha.rs | 66 +++++++++ voxygen/src/anim/src/theropod/beta.rs | 64 +++++++++ voxygen/src/anim/src/theropod/mod.rs | 4 +- voxygen/src/anim/src/theropod/run.rs | 22 +-- voxygen/src/scene/figure/mod.rs | 128 +++++++++++++++++- 43 files changed, 944 insertions(+), 66 deletions(-) delete mode 100644 assets/common/abilities/unique/quadlowbasic/basic.ron create mode 100644 assets/common/abilities/unique/quadlowbasic/singlestrike.ron create mode 100644 assets/common/abilities/unique/quadlowbreathe/flamethrower.ron create mode 100644 assets/common/abilities/unique/quadlowbreathe/triplestrike.ron delete mode 100644 assets/common/abilities/unique/quadlowranged/basic.ron create mode 100644 assets/common/abilities/unique/quadlowranged/singlestrike.ron create mode 100644 assets/common/abilities/unique/quadsmallbasic/singlestrike.ron create mode 100644 assets/common/abilities/unique/theropodbasic/singlestrike.ron create mode 100644 assets/common/abilities/unique/theropodbasic/triplestrike.ron create mode 100644 assets/common/items/npc_weapons/unique/quadlowbreathe.ron create mode 100644 assets/common/items/npc_weapons/unique/quadsmallbasic.ron create mode 100644 assets/common/items/npc_weapons/unique/theropodbasic.ron create mode 100644 assets/voxygen/voxel/npc/lavadrake/male/chest.vox create mode 100644 assets/voxygen/voxel/npc/lavadrake/male/foot_bl.vox create mode 100644 assets/voxygen/voxel/npc/lavadrake/male/foot_br.vox create mode 100644 assets/voxygen/voxel/npc/lavadrake/male/foot_fl.vox create mode 100644 assets/voxygen/voxel/npc/lavadrake/male/foot_fr.vox create mode 100644 assets/voxygen/voxel/npc/lavadrake/male/head_lower.vox create mode 100644 assets/voxygen/voxel/npc/lavadrake/male/head_upper.vox create mode 100644 assets/voxygen/voxel/npc/lavadrake/male/jaw.vox create mode 100644 assets/voxygen/voxel/npc/lavadrake/male/tail_front.vox create mode 100644 assets/voxygen/voxel/npc/lavadrake/male/tail_rear.vox create mode 100644 voxygen/src/anim/src/quadruped_low/breathe.rs create mode 100644 voxygen/src/anim/src/quadruped_medium/dash.rs create mode 100644 voxygen/src/anim/src/quadruped_small/alpha.rs create mode 100644 voxygen/src/anim/src/theropod/alpha.rs create mode 100644 voxygen/src/anim/src/theropod/beta.rs diff --git a/assets/common/abilities/unique/quadlowbasic/basic.ron b/assets/common/abilities/unique/quadlowbasic/basic.ron deleted file mode 100644 index e8c969d6d8..0000000000 --- a/assets/common/abilities/unique/quadlowbasic/basic.ron +++ /dev/null @@ -1,10 +0,0 @@ -BasicMelee( - energy_cost: 0, - buildup_duration: 500, - swing_duration: 150, - recover_duration: 400, - base_damage: 200, - knockback: 25.0, - range: 4.0, - max_angle: 120.0, -) \ No newline at end of file diff --git a/assets/common/abilities/unique/quadlowbasic/singlestrike.ron b/assets/common/abilities/unique/quadlowbasic/singlestrike.ron new file mode 100644 index 0000000000..ebc29a8cc9 --- /dev/null +++ b/assets/common/abilities/unique/quadlowbasic/singlestrike.ron @@ -0,0 +1,23 @@ +ComboMelee( + stage_data: [ + ( + stage: 1, + base_damage: 100, + max_damage: 60, + damage_increase: 10, + knockback: 5.0, + range: 3.5, + angle: 60.0, + base_buildup_duration: 500, + base_swing_duration: 150, + base_recover_duration: 400, + forward_movement: 3.0, + ), + ], + initial_energy_gain: 0, + max_energy_gain: 100, + energy_increase: 20, + speed_increase: 0.05, + max_speed_increase: 1.8, + is_interruptible: true, +) \ No newline at end of file diff --git a/assets/common/abilities/unique/quadlowbreathe/flamethrower.ron b/assets/common/abilities/unique/quadlowbreathe/flamethrower.ron new file mode 100644 index 0000000000..9fb88a8edd --- /dev/null +++ b/assets/common/abilities/unique/quadlowbreathe/flamethrower.ron @@ -0,0 +1,14 @@ +BasicBeam( + buildup_duration: 400, + recover_duration: 250, + beam_duration: 500, + base_hps: 0, + base_dps: 150, + tick_rate: 3.0, + range: 15.0, + max_angle: 22.5, + lifesteal_eff: 0.0, + energy_regen: 0, + energy_cost: 0, + energy_drain: 0, +) \ No newline at end of file diff --git a/assets/common/abilities/unique/quadlowbreathe/triplestrike.ron b/assets/common/abilities/unique/quadlowbreathe/triplestrike.ron new file mode 100644 index 0000000000..69ca84f03a --- /dev/null +++ b/assets/common/abilities/unique/quadlowbreathe/triplestrike.ron @@ -0,0 +1,49 @@ +ComboMelee( + stage_data: [ + ( + stage: 1, + base_damage: 100, + max_damage: 120, + damage_increase: 10, + knockback: 10.0, + range: 3.5, + angle: 30.0, + base_buildup_duration: 900, + base_swing_duration: 100, + base_recover_duration: 300, + forward_movement: 2.0, + ), + ( + stage: 2, + base_damage: 80, + max_damage: 110, + damage_increase: 15, + knockback: 10.0, + range: 3.5, + angle: 30.0, + base_buildup_duration: 500, + base_swing_duration: 100, + base_recover_duration: 300, + forward_movement: 1.5, + ), + ( + stage: 3, + base_damage: 130, + max_damage: 170, + damage_increase: 20, + knockback: 10.0, + range: 3.5, + angle: 30.0, + base_buildup_duration: 500, + base_swing_duration: 100, + base_recover_duration: 300, + forward_movement: 1.5, + ), + ], + initial_energy_gain: 0, + max_energy_gain: 100, + energy_increase: 20, + speed_increase: 0.05, + max_speed_increase: 1.8, + is_interruptible: true, +) \ No newline at end of file diff --git a/assets/common/abilities/unique/quadlowranged/basic.ron b/assets/common/abilities/unique/quadlowranged/basic.ron deleted file mode 100644 index 1df4fab649..0000000000 --- a/assets/common/abilities/unique/quadlowranged/basic.ron +++ /dev/null @@ -1,10 +0,0 @@ -BasicMelee( - energy_cost: 0, - buildup_duration: 600, - swing_duration: 100, - recover_duration: 350, - base_damage: 200, - knockback: 25.0, - range: 2.0, - max_angle: 120.0, -) \ No newline at end of file diff --git a/assets/common/abilities/unique/quadlowranged/singlestrike.ron b/assets/common/abilities/unique/quadlowranged/singlestrike.ron new file mode 100644 index 0000000000..ebc29a8cc9 --- /dev/null +++ b/assets/common/abilities/unique/quadlowranged/singlestrike.ron @@ -0,0 +1,23 @@ +ComboMelee( + stage_data: [ + ( + stage: 1, + base_damage: 100, + max_damage: 60, + damage_increase: 10, + knockback: 5.0, + range: 3.5, + angle: 60.0, + base_buildup_duration: 500, + base_swing_duration: 150, + base_recover_duration: 400, + forward_movement: 3.0, + ), + ], + initial_energy_gain: 0, + max_energy_gain: 100, + energy_increase: 20, + speed_increase: 0.05, + max_speed_increase: 1.8, + is_interruptible: true, +) \ No newline at end of file diff --git a/assets/common/abilities/unique/quadmedbasic/triplestrike.ron b/assets/common/abilities/unique/quadmedbasic/triplestrike.ron index f1c9adfd14..b1810ba980 100644 --- a/assets/common/abilities/unique/quadmedbasic/triplestrike.ron +++ b/assets/common/abilities/unique/quadmedbasic/triplestrike.ron @@ -5,39 +5,39 @@ ComboMelee( base_damage: 100, max_damage: 120, damage_increase: 10, - knockback: 5.0, + knockback: 10.0, range: 3.5, - angle: 60.0, - base_buildup_duration: 800, - base_swing_duration: 150, - base_recover_duration: 400, - forward_movement: 3.0, + angle: 30.0, + base_buildup_duration: 900, + base_swing_duration: 100, + base_recover_duration: 200, + forward_movement: 2.0, ), ( stage: 2, base_damage: 80, max_damage: 110, damage_increase: 15, - knockback: 5.0, + knockback: 10.0, range: 3.5, - angle: 60.0, - base_buildup_duration: 600, - base_swing_duration: 150, - base_recover_duration: 300, - forward_movement: 3.5, + angle: 30.0, + base_buildup_duration: 200, + base_swing_duration: 100, + base_recover_duration: 200, + forward_movement: 1.0, ), ( stage: 3, base_damage: 130, max_damage: 170, damage_increase: 20, - knockback: 5.0, + knockback: 10.0, range: 3.5, - angle: 60.0, - base_buildup_duration: 600, - base_swing_duration: 150, - base_recover_duration: 300, - forward_movement: 4.5, + angle: 30.0, + base_buildup_duration: 200, + base_swing_duration: 100, + base_recover_duration: 200, + forward_movement: 1.0, ), ], initial_energy_gain: 0, diff --git a/assets/common/abilities/unique/quadsmallbasic/singlestrike.ron b/assets/common/abilities/unique/quadsmallbasic/singlestrike.ron new file mode 100644 index 0000000000..2fee6f846b --- /dev/null +++ b/assets/common/abilities/unique/quadsmallbasic/singlestrike.ron @@ -0,0 +1,23 @@ +ComboMelee( + stage_data: [ + ( + stage: 1, + base_damage: 10, + max_damage: 20, + damage_increase: 10, + knockback: 5.0, + range: 3.5, + angle: 60.0, + base_buildup_duration: 300, + base_swing_duration: 150, + base_recover_duration: 300, + forward_movement: 1.0, + ), + ], + initial_energy_gain: 0, + max_energy_gain: 100, + energy_increase: 20, + speed_increase: 0.05, + max_speed_increase: 1.8, + is_interruptible: true, +) \ No newline at end of file diff --git a/assets/common/abilities/unique/theropodbasic/singlestrike.ron b/assets/common/abilities/unique/theropodbasic/singlestrike.ron new file mode 100644 index 0000000000..2b3f37cfb1 --- /dev/null +++ b/assets/common/abilities/unique/theropodbasic/singlestrike.ron @@ -0,0 +1,23 @@ +ComboMelee( + stage_data: [ + ( + stage: 1, + base_damage: 100, + max_damage: 60, + damage_increase: 10, + knockback: 5.0, + range: 7.5, + angle: 60.0, + base_buildup_duration: 500, + base_swing_duration: 150, + base_recover_duration: 400, + forward_movement: 3.0, + ), + ], + initial_energy_gain: 0, + max_energy_gain: 100, + energy_increase: 20, + speed_increase: 0.05, + max_speed_increase: 1.8, + is_interruptible: true, +) \ No newline at end of file diff --git a/assets/common/abilities/unique/theropodbasic/triplestrike.ron b/assets/common/abilities/unique/theropodbasic/triplestrike.ron new file mode 100644 index 0000000000..d820eda3ef --- /dev/null +++ b/assets/common/abilities/unique/theropodbasic/triplestrike.ron @@ -0,0 +1,49 @@ +ComboMelee( + stage_data: [ + ( + stage: 1, + base_damage: 100, + max_damage: 120, + damage_increase: 10, + knockback: 10.0, + range: 7.5, + angle: 30.0, + base_buildup_duration: 900, + base_swing_duration: 150, + base_recover_duration: 300, + forward_movement: 3.0, + ), + ( + stage: 2, + base_damage: 80, + max_damage: 110, + damage_increase: 15, + knockback: 10.0, + range: 5.5, + angle: 30.0, + base_buildup_duration: 500, + base_swing_duration: 150, + base_recover_duration: 150, + forward_movement: 2.0, + ), + ( + stage: 3, + base_damage: 130, + max_damage: 170, + damage_increase: 20, + knockback: 10.0, + range: 5.5, + angle: 30.0, + base_buildup_duration: 350, + base_swing_duration: 125, + base_recover_duration: 900, + forward_movement: 2.0, + ), + ], + initial_energy_gain: 0, + max_energy_gain: 100, + energy_increase: 20, + speed_increase: 0.05, + max_speed_increase: 1.8, + is_interruptible: true, +) \ No newline at end of file diff --git a/assets/common/abilities/weapon_ability_manifest.ron b/assets/common/abilities/weapon_ability_manifest.ron index 2ddc71ef9a..1760626cc7 100644 --- a/assets/common/abilities/weapon_ability_manifest.ron +++ b/assets/common/abilities/weapon_ability_manifest.ron @@ -79,8 +79,8 @@ skills: [], ), Unique(QuadMedHoof): ( - primary: "common.abilities.unique.quadmedbasic.basic", - secondary: "common.abilities.unique.quadmedbasic.basic", + primary: "common.abilities.unique.quadmedhoof.basic", + secondary: "common.abilities.unique.quadmedhoof.basic", skills: [], ), Unique(QuadMedBasic): ( @@ -89,10 +89,15 @@ skills: [], ), Unique(QuadLowRanged): ( - primary: "common.abilities.unique.quadlowranged.basic", + primary: "common.abilities.unique.quadlowranged.singlestrike", secondary: "common.abilities.unique.quadlowranged.firebomb", skills: [], ), + Unique(QuadLowBreathe): ( + primary: "common.abilities.unique.quadlowbreathe.flamethrower", + secondary: "common.abilities.unique.quadlowbreathe.triplestrike", + skills: [], + ), Unique(QuadLowTail): ( primary: "common.abilities.unique.quadlowtail.charged", secondary: "common.abilities.unique.quadlowtail.triplestrike", @@ -105,7 +110,17 @@ ), Unique(QuadLowBasic): ( primary: "common.abilities.unique.quadlowbasic.triplestrike", - secondary: "common.abilities.unique.quadlowbasic.basic", + secondary: "common.abilities.unique.quadlowbasic.singlestrike", + skills: [], + ), + Unique(QuadSmallBasic): ( + primary: "common.abilities.unique.quadsmallbasic.singlestrike", + secondary: "common.abilities.unique.quadsmallbasic.singlestrike", + skills: [], + ), + Unique(TheropodBasic): ( + primary: "common.abilities.unique.theropodbasic.triplestrike", + secondary: "common.abilities.unique.theropodbasic.triplestrike", skills: [], ), Debug: ( diff --git a/assets/common/items/npc_weapons/unique/quadlowbreathe.ron b/assets/common/items/npc_weapons/unique/quadlowbreathe.ron new file mode 100644 index 0000000000..04b230bc6c --- /dev/null +++ b/assets/common/items/npc_weapons/unique/quadlowbreathe.ron @@ -0,0 +1,15 @@ +ItemDef( + name: "Quad Low Breathe", + description: "testing123", + kind: Tool( + ( + kind: Unique(QuadLowBreathe), + stats: ( + equip_time_millis: 10, + power: 1.00, + speed: 1.00, + ), + ) + ), + quality: Low, +) diff --git a/assets/common/items/npc_weapons/unique/quadsmallbasic.ron b/assets/common/items/npc_weapons/unique/quadsmallbasic.ron new file mode 100644 index 0000000000..da263d6109 --- /dev/null +++ b/assets/common/items/npc_weapons/unique/quadsmallbasic.ron @@ -0,0 +1,15 @@ +ItemDef( + name: "Quad Small Basic", + description: "testing123", + kind: Tool( + ( + kind: Unique(QuadSmallBasic), + stats: ( + equip_time_millis: 10, + power: 1.00, + speed: 1.00, + ), + ) + ), + quality: Low, +) diff --git a/assets/common/items/npc_weapons/unique/theropodbasic.ron b/assets/common/items/npc_weapons/unique/theropodbasic.ron new file mode 100644 index 0000000000..19bf867622 --- /dev/null +++ b/assets/common/items/npc_weapons/unique/theropodbasic.ron @@ -0,0 +1,15 @@ +ItemDef( + name: "Theropod Basic", + description: "testing123", + kind: Tool( + ( + kind: Unique(TheropodBasic), + stats: ( + equip_time_millis: 10, + power: 1.00, + speed: 1.00, + ), + ) + ), + quality: Low, +) diff --git a/assets/common/npc_names.json b/assets/common/npc_names.json index 3bd21d78e5..a6ed9ad6a5 100644 --- a/assets/common/npc_names.json +++ b/assets/common/npc_names.json @@ -769,6 +769,10 @@ "hakulaq": { "keyword": "hakulaq", "generic": "Hakulaq" + }, + "lavadrake": { + "keyword": "lavadrake", + "generic": "Lava Drake" } } } diff --git a/assets/voxygen/voxel/npc/lavadrake/male/chest.vox b/assets/voxygen/voxel/npc/lavadrake/male/chest.vox new file mode 100644 index 0000000000..c1b7e3a0a6 --- /dev/null +++ b/assets/voxygen/voxel/npc/lavadrake/male/chest.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00605926f47844af38c8a749947fbc8b2dfb3d55416b9ade151bd19933ac76c0 +size 13236 diff --git a/assets/voxygen/voxel/npc/lavadrake/male/foot_bl.vox b/assets/voxygen/voxel/npc/lavadrake/male/foot_bl.vox new file mode 100644 index 0000000000..8c9ccb376e --- /dev/null +++ b/assets/voxygen/voxel/npc/lavadrake/male/foot_bl.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72c688fda5396ab81daab975daf0c3315b95e2b5ff035f938fa0896e2b4dc1bd +size 2284 diff --git a/assets/voxygen/voxel/npc/lavadrake/male/foot_br.vox b/assets/voxygen/voxel/npc/lavadrake/male/foot_br.vox new file mode 100644 index 0000000000..0e6e71ff5c --- /dev/null +++ b/assets/voxygen/voxel/npc/lavadrake/male/foot_br.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d237ea643dd4c25ab493a8cf8b089fd7ba708a40b26d32ac8545a1310c540a13 +size 2284 diff --git a/assets/voxygen/voxel/npc/lavadrake/male/foot_fl.vox b/assets/voxygen/voxel/npc/lavadrake/male/foot_fl.vox new file mode 100644 index 0000000000..a2e38341e7 --- /dev/null +++ b/assets/voxygen/voxel/npc/lavadrake/male/foot_fl.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68f6ad2f0f9f865b05e02cf4dd150fe7110f636de1229b20b8dc84a728d436dc +size 2748 diff --git a/assets/voxygen/voxel/npc/lavadrake/male/foot_fr.vox b/assets/voxygen/voxel/npc/lavadrake/male/foot_fr.vox new file mode 100644 index 0000000000..e36f0ed846 --- /dev/null +++ b/assets/voxygen/voxel/npc/lavadrake/male/foot_fr.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4e02a5d12aa6c7404147a10accb193b83c20c7a2a1eb9453cbfd3cd419f28da +size 2748 diff --git a/assets/voxygen/voxel/npc/lavadrake/male/head_lower.vox b/assets/voxygen/voxel/npc/lavadrake/male/head_lower.vox new file mode 100644 index 0000000000..256a558797 --- /dev/null +++ b/assets/voxygen/voxel/npc/lavadrake/male/head_lower.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d55f987cf95bf4e086e80fa00f8ba752f16c5fa31ee98c49bd8396df3a6a90f0 +size 3704 diff --git a/assets/voxygen/voxel/npc/lavadrake/male/head_upper.vox b/assets/voxygen/voxel/npc/lavadrake/male/head_upper.vox new file mode 100644 index 0000000000..7239b10afa --- /dev/null +++ b/assets/voxygen/voxel/npc/lavadrake/male/head_upper.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33983793e6059e957a845c2ab7a77d16283e36b816dae7daf177581f392282ab +size 3676 diff --git a/assets/voxygen/voxel/npc/lavadrake/male/jaw.vox b/assets/voxygen/voxel/npc/lavadrake/male/jaw.vox new file mode 100644 index 0000000000..422b9f2495 --- /dev/null +++ b/assets/voxygen/voxel/npc/lavadrake/male/jaw.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a2e15eb7c1c2078e83936edcb466a25f35a0c232bbe6c3a974306de16de92c7 +size 1892 diff --git a/assets/voxygen/voxel/npc/lavadrake/male/tail_front.vox b/assets/voxygen/voxel/npc/lavadrake/male/tail_front.vox new file mode 100644 index 0000000000..d823b990b3 --- /dev/null +++ b/assets/voxygen/voxel/npc/lavadrake/male/tail_front.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b55691df732d3eda0f6b26e03cf2a9a542fac3f9609efbfc90a9996c7e967a41 +size 3476 diff --git a/assets/voxygen/voxel/npc/lavadrake/male/tail_rear.vox b/assets/voxygen/voxel/npc/lavadrake/male/tail_rear.vox new file mode 100644 index 0000000000..1e46fc058f --- /dev/null +++ b/assets/voxygen/voxel/npc/lavadrake/male/tail_rear.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3cd3fbf2b78169f8d58157267d17790ad2123d95affbf5fd3a72e1257fcbd217 +size 2592 diff --git a/assets/voxygen/voxel/quadruped_low_central_manifest.ron b/assets/voxygen/voxel/quadruped_low_central_manifest.ron index e876a8781d..b25366bac1 100644 --- a/assets/voxygen/voxel/quadruped_low_central_manifest.ron +++ b/assets/voxygen/voxel/quadruped_low_central_manifest.ron @@ -572,4 +572,56 @@ central: ("npc.sandshark.male.tail_front"), ), ), + (Lavadrake, Male): ( + upper: ( + offset: (-6.5, -2.0, -6.0), + central: ("npc.lavadrake.male.head_upper"), + ), + lower: ( + offset: (-6.5, -1.0, -3.0), + central: ("npc.lavadrake.male.head_lower"), + ), + jaw: ( + offset: (-3.5, 0.0, -5.0), + central: ("npc.lavadrake.male.jaw"), + ), + chest: ( + offset: (-9.5, -11.5, -11.5), + central: ("npc.lavadrake.male.chest"), + ), + tail_rear: ( + offset: (-6.5, -24.0, -3.5), + central: ("npc.lavadrake.male.tail_rear"), + ), + tail_front: ( + offset: (-5.5, -12.0, -6.5), + central: ("npc.lavadrake.male.tail_front"), + ), + ), + (Lavadrake, Female): ( + upper: ( + offset: (-6.5, -2.0, -6.0), + central: ("npc.lavadrake.male.head_upper"), + ), + lower: ( + offset: (-6.5, -1.0, -3.0), + central: ("npc.lavadrake.male.head_lower"), + ), + jaw: ( + offset: (-3.5, 0.0, -5.0), + central: ("npc.lavadrake.male.jaw"), + ), + chest: ( + offset: (-9.5, -11.5, -11.5), + central: ("npc.lavadrake.male.chest"), + ), + tail_rear: ( + offset: (-6.5, -24.0, -3.5), + central: ("npc.lavadrake.male.tail_rear"), + ), + tail_front: ( + offset: (-5.5, -12.0, -6.5), + central: ("npc.lavadrake.male.tail_front"), + ), + ), }) diff --git a/assets/voxygen/voxel/quadruped_low_lateral_manifest.ron b/assets/voxygen/voxel/quadruped_low_lateral_manifest.ron index f258623544..8201bdb88b 100644 --- a/assets/voxygen/voxel/quadruped_low_lateral_manifest.ron +++ b/assets/voxygen/voxel/quadruped_low_lateral_manifest.ron @@ -395,4 +395,40 @@ lateral: ("npc.sandshark.male.foot_br"), ), ), + (Lavadrake, Male): ( + front_left: ( + offset: (-14.0, -4.0, -10.0), + lateral: ("npc.lavadrake.male.foot_fl"), + ), + front_right: ( + offset: (0.0, -4.0, -10.0), + lateral: ("npc.lavadrake.male.foot_fr"), + ), + back_left: ( + offset: (-14.0, -7.5, -10.0), + lateral: ("npc.lavadrake.male.foot_bl"), + ), + back_right: ( + offset: (0.0, -7.5, -10.0), + lateral: ("npc.lavadrake.male.foot_br"), + ), + ), + (Lavadrake, Female): ( + front_left: ( + offset: (-14.0, -4.0, -10.0), + lateral: ("npc.lavadrake.male.foot_fl"), + ), + front_right: ( + offset: (0.0, -4.0, -10.0), + lateral: ("npc.lavadrake.male.foot_fr"), + ), + back_left: ( + offset: (-14.0, -7.5, -10.0), + lateral: ("npc.lavadrake.male.foot_bl"), + ), + back_right: ( + offset: (0.0, -7.5, -10.0), + lateral: ("npc.lavadrake.male.foot_br"), + ), + ), }) diff --git a/common/src/comp/body/quadruped_low.rs b/common/src/comp/body/quadruped_low.rs index 126f5d6c30..0ad0f137b4 100644 --- a/common/src/comp/body/quadruped_low.rs +++ b/common/src/comp/body/quadruped_low.rs @@ -45,6 +45,7 @@ make_case_elim!( Maneater = 8, Sandshark = 9, Hakulaq = 10, + Lavadrake = 11, } ); @@ -64,6 +65,7 @@ pub struct AllSpecies { pub maneater: SpeciesMeta, pub sandshark: SpeciesMeta, pub hakulaq: SpeciesMeta, + pub lavadrake: SpeciesMeta, } impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies { @@ -83,11 +85,12 @@ impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies Species::Maneater => &self.maneater, Species::Sandshark => &self.sandshark, Species::Hakulaq => &self.hakulaq, + Species::Lavadrake => &self.lavadrake, } } } -pub const ALL_SPECIES: [Species; 11] = [ +pub const ALL_SPECIES: [Species; 12] = [ Species::Crocodile, Species::Alligator, Species::Salamander, @@ -99,6 +102,7 @@ pub const ALL_SPECIES: [Species; 11] = [ Species::Maneater, Species::Sandshark, Species::Hakulaq, + Species::Lavadrake, ]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { diff --git a/common/src/comp/inventory/item/tool.rs b/common/src/comp/inventory/item/tool.rs index 2d39a95714..80d465336d 100644 --- a/common/src/comp/inventory/item/tool.rs +++ b/common/src/comp/inventory/item/tool.rs @@ -178,7 +178,10 @@ pub enum UniqueKind { QuadMedBasic, QuadMedCharge, QuadLowRanged, + QuadLowBreathe, QuadLowTail, QuadLowQuick, QuadLowBasic, + QuadSmallBasic, + TheropodBasic, } diff --git a/common/src/loadout_builder.rs b/common/src/loadout_builder.rs index 567562b8d0..d3eb45560c 100644 --- a/common/src/loadout_builder.rs +++ b/common/src/loadout_builder.rs @@ -152,12 +152,31 @@ impl LoadoutBuilder { "common.items.npc_weapons.unique.quadlowquick", )); }, + quadruped_low::Species::Lavadrake => { + main_tool = Some(Item::new_from_asset_expect( + "common.items.npc_weapons.unique.quadlowbreathe", + )); + }, _ => { main_tool = Some(Item::new_from_asset_expect( "common.items.npc_weapons.unique.quadlowbasic", )); }, }, + Body::QuadrupedSmall(quadruped_small) => match quadruped_small.species { + _ => { + main_tool = Some(Item::new_from_asset_expect( + "common.items.npc_weapons.unique.quadsmallbasic", + )); + }, + }, + Body::Theropod(theropod) => match theropod.species { + _ => { + main_tool = Some(Item::new_from_asset_expect( + "common.items.npc_weapons.unique.theropodbasic", + )); + }, + }, Body::BipedLarge(biped_large) => match (biped_large.species, biped_large.body_type) { (biped_large::Species::Occultsaurok, _) => { diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index efe7aa89d3..ef7027f811 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -81,6 +81,7 @@ impl Body { quadruped_low::Species::Maneater => 80.0, quadruped_low::Species::Sandshark => 160.0, quadruped_low::Species::Hakulaq => 140.0, + quadruped_low::Species::Lavadrake => 100.0, }, } } @@ -117,7 +118,7 @@ impl Body { Body::BipedLarge(_) => 12.0, Body::Object(_) => 5.0, Body::Golem(_) => 8.0, - Body::Theropod(_) => 35.0, + Body::Theropod(_) => 1.0, Body::QuadrupedLow(_) => 12.0, } } diff --git a/voxygen/src/anim/src/character/swim.rs b/voxygen/src/anim/src/character/swim.rs index 71a8142ec3..a2d7f8f885 100644 --- a/voxygen/src/anim/src/character/swim.rs +++ b/voxygen/src/anim/src/character/swim.rs @@ -93,7 +93,7 @@ impl Animation for SwimAnimation { let abstilt = tilt.abs(); let squash = if abstilt > 0.2 { 0.35 } else { 1.0 }; //condenses the body at strong turns - next.head.position = Vec3::new(0.0, -3.0 + s_a.head.0, s_a.head.1 - 1.0 + short * 0.3); + next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 - 1.0 + short * 0.3); next.head.orientation = Quaternion::rotation_z(head_look.x * 0.3 + short * -0.2 * intensity + tilt * 3.0) * Quaternion::rotation_x( diff --git a/voxygen/src/anim/src/quadruped_low/breathe.rs b/voxygen/src/anim/src/quadruped_low/breathe.rs new file mode 100644 index 0000000000..4d10f87f25 --- /dev/null +++ b/voxygen/src/anim/src/quadruped_low/breathe.rs @@ -0,0 +1,70 @@ +use super::{ + super::{vek::*, Animation}, + QuadrupedLowSkeleton, SkeletonAttr, +}; +use common::states::utils::StageSection; +//use std::ops::Rem; +use std::f32::consts::PI; + +pub struct BreatheAnimation; + +impl Animation for BreatheAnimation { + type Dependency = (f32, f64, Option, f64); + type Skeleton = QuadrupedLowSkeleton; + + #[cfg(feature = "use-dyn-lib")] + const UPDATE_FN: &'static [u8] = b"quadruped_low_breathe\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_breathe")] + fn update_skeleton_inner( + skeleton: &Self::Skeleton, + (velocity, global_time, stage_section, timer): Self::Dependency, + anim_time: f64, + _rate: &mut f32, + _s_a: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + let speed = (Vec2::::from(velocity).magnitude()).min(24.0); + + let (movement1base, _movement2base, movement3, twitch) = match stage_section { + Some(StageSection::Buildup) => ((anim_time as f32).powf(0.5), 0.0, 0.0, 0.0), + Some(StageSection::Cast) => (1.0, (anim_time as f32).min(1.0), 0.0, anim_time as f32), + Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32, 1.0), + _ => (0.0, 0.0, 0.0, 0.0), + }; + let pullback = 1.0 - movement3; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum() as f32; + let twitch2 = mirror*(twitch*20.0).sin()*pullback; + let twitch2alt = mirror*(twitch*20.0+PI/2.0).sin()*pullback; + + let movement1abs = movement1base * pullback; + + next.head_upper.orientation = Quaternion::rotation_x(movement1abs * 0.3+twitch2alt*0.02); + + next.head_lower.orientation = + Quaternion::rotation_x(movement1abs * -0.3 ) + * Quaternion::rotation_y(twitch2 * 0.02); + + next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.7 + twitch2 * 0.1); + next.chest.orientation = Quaternion::rotation_y(twitch2 * -0.02) + * Quaternion::rotation_z(0.0); + + next.tail_front.orientation = Quaternion::rotation_x(0.15+movement1abs*-0.15+twitch2alt*0.02) + * Quaternion::rotation_z(0.0); + + next.tail_rear.orientation = Quaternion::rotation_x(-0.12+movement1abs*-0.2+twitch2alt*0.08) + * Quaternion::rotation_z(0.0); +if speed < 0.5{ + next.foot_fl.orientation = Quaternion::rotation_y(twitch2 * 0.02); + + next.foot_fr.orientation = Quaternion::rotation_y(twitch2 * 0.02); + + next.foot_bl.orientation = Quaternion::rotation_y(twitch2 * 0.02); + + next.foot_br.orientation = Quaternion::rotation_y(twitch2 * 0.02); +} else{}; + next + } +} diff --git a/voxygen/src/anim/src/quadruped_low/mod.rs b/voxygen/src/anim/src/quadruped_low/mod.rs index dfccacf5ef..00dda9020c 100644 --- a/voxygen/src/anim/src/quadruped_low/mod.rs +++ b/voxygen/src/anim/src/quadruped_low/mod.rs @@ -1,5 +1,6 @@ pub mod alpha; pub mod beta; +pub mod breathe; pub mod dash; pub mod idle; pub mod jump; @@ -9,7 +10,7 @@ pub mod tailwhip; // Reexports pub use self::{ - alpha::AlphaAnimation, beta::BetaAnimation, dash::DashAnimation, idle::IdleAnimation, + alpha::AlphaAnimation, beta::BetaAnimation, breathe::BreatheAnimation, dash::DashAnimation, idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation, shoot::ShootAnimation, tailwhip::TailwhipAnimation, }; @@ -127,6 +128,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Maneater, _) => (7.0, 11.5), (Sandshark, _) => (8.5, 0.5), (Hakulaq, _) => (8.0, 10.0), + (Lavadrake, _) => (7.0, 8.0), }, head_lower: match (body.species, body.body_type) { (Crocodile, _) => (8.0, 0.0), @@ -141,6 +143,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Maneater, _) => (1.0, 4.5), (Sandshark, _) => (13.5, -10.5), (Hakulaq, _) => (10.5, 1.0), + (Lavadrake, _) => (11.5, -6.0), }, jaw: match (body.species, body.body_type) { (Crocodile, _) => (2.5, -3.0), @@ -155,6 +158,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Maneater, _) => (-1.0, 4.0), (Sandshark, _) => (-8.0, -5.5), (Hakulaq, _) => (-6.5, -4.0), + (Lavadrake, _) => (3.0, -5.0), }, chest: match (body.species, body.body_type) { (Crocodile, _) => (0.0, 5.0), @@ -169,6 +173,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Maneater, _) => (0.0, 12.0), (Sandshark, _) => (0.0, 20.0), (Hakulaq, _) => (0.0, 13.5), + (Lavadrake, _) => (0.0, 16.5), }, tail_rear: match (body.species, body.body_type) { (Crocodile, _) => (-12.5, -1.0), @@ -183,6 +188,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Maneater, _) => (-15.0, 4.0), (Sandshark, _) => (-10.0, 0.5), (Hakulaq, _) => (-9.0, -2.0), + (Lavadrake, _) => (-12.0, -2.0), }, tail_front: match (body.species, body.body_type) { (Crocodile, _) => (-6.0, 0.0), @@ -197,6 +203,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Maneater, _) => (-1.0, 4.0), (Sandshark, _) => (-13.0, -8.0), (Hakulaq, _) => (-6.0, -5.5), + (Lavadrake, _) => (-7.0, -4.5), }, feet_f: match (body.species, body.body_type) { (Crocodile, _) => (3.5, 6.0, -1.0), @@ -211,6 +218,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Maneater, _) => (4.5, 4.0, -5.5), (Sandshark, _) => (5.5, 2.0, -8.0), (Hakulaq, _) => (4.5, 2.0, -4.5), + (Lavadrake, _) => (4.5, 4.0, -6.5), }, feet_b: match (body.species, body.body_type) { (Crocodile, _) => (3.5, -6.0, -1.0), @@ -225,6 +233,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Maneater, _) => (4.5, -2.5, -3.0), (Sandshark, _) => (3.5, -15.0, -14.0), (Hakulaq, _) => (3.5, -8.0, -4.5), + (Lavadrake, _) => (3.5, -8.0, -6.5), }, lean: match (body.species, body.body_type) { (Pangolin, _) => (0.4, 0.0), @@ -232,7 +241,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { }, scaler: match (body.species, body.body_type) { (Crocodile, _) => (1.3), - (Alligator, _) => (1.5), + (Alligator, _) => (1.4), (Salamander, _) => (1.4), (Monitor, _) => (1.1), (Asp, _) => (1.4), @@ -242,6 +251,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Maneater, _) => (1.4), (Sandshark, _) => (1.0), (Hakulaq, _) => (1.0), + (Lavadrake, _) => (1.4), }, tempo: match (body.species, body.body_type) { (Crocodile, _) => (0.7), @@ -255,6 +265,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Maneater, _) => (0.9), (Sandshark, _) => (1.0), (Hakulaq, _) => (1.0), + (Lavadrake, _) => (1.1), }, } } diff --git a/voxygen/src/anim/src/quadruped_medium/dash.rs b/voxygen/src/anim/src/quadruped_medium/dash.rs new file mode 100644 index 0000000000..2d9bc716dd --- /dev/null +++ b/voxygen/src/anim/src/quadruped_medium/dash.rs @@ -0,0 +1,99 @@ +use super::{ + super::{vek::*, Animation}, + QuadrupedMediumSkeleton, SkeletonAttr, +}; +use common::states::utils::StageSection; +//use std::ops::Rem; +use std::f32::consts::PI; + +pub struct DashAnimation; + +impl Animation for DashAnimation { + type Dependency = (f32, f64, Option, f64); + type Skeleton = QuadrupedMediumSkeleton; + + #[cfg(feature = "use-dyn-lib")] + const UPDATE_FN: &'static [u8] = b"quadruped_medium_dash\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_dash")] + fn update_skeleton_inner( + skeleton: &Self::Skeleton, + (velocity, global_time, stage_section, timer): Self::Dependency, + anim_time: f64, + _rate: &mut f32, + _s_a: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + let speed = (Vec2::::from(velocity).magnitude()).min(24.0); + + let (movement1base, chargemovementbase, movement2base, movement3) = match stage_section { + Some(StageSection::Buildup) => ((anim_time as f32).powf(0.5), 0.0, 0.0, 0.0), + Some(StageSection::Charge) => (1.0, 1.0, 0.0, 0.0), + Some(StageSection::Swing) => (1.0, 1.0, (anim_time as f32).powf(4.0), 0.0), + Some(StageSection::Recover) => (1.0, 1.0, 1.0, anim_time as f32), + _ => (0.0, 0.0, 0.0, 0.0), + }; + let pullback = 1.0 - movement3; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum() as f32; + let twitch1 = (mirror * movement1base * 9.5).sin(); + let twitch1fast = (mirror * movement1base * 25.0).sin(); + //let twitch3 = (mirror * movement3 * 4.0).sin(); + //let movement1 = mirror * movement1base * pullback; + //let movement2 = mirror * movement2base * pullback; + let movement1abs = movement1base * pullback; + let movement2abs = movement2base * pullback; + let short = (((1.0) + / (0.72 + + 0.28 * ((anim_time as f32 * 16.0 as f32 + PI * 0.25).sin()).powf(2.0 as f32))) + .sqrt()) + * ((anim_time as f32 * 16.0 as f32 + PI * 0.25).sin()) + * chargemovementbase + * pullback; + let shortalt = + (anim_time as f32 * 16.0 as f32 + PI * 0.25).sin() * chargemovementbase * pullback; + + next.head.orientation = + Quaternion::rotation_x(movement1abs * -0.2 + movement2abs * 0.8) + * Quaternion::rotation_z(short * -0.06 + twitch1 * 0.2); + + next.neck.orientation = + Quaternion::rotation_x(movement1abs * -0.2 + movement2abs * 0.5) + * Quaternion::rotation_z(short * 0.15 + twitch1 * 0.2); + + next.jaw.orientation = Quaternion::rotation_x( + twitch1fast * 0.2 + + movement1abs * -0.3 + + movement2abs * 1.2 + + chargemovementbase * -0.5, + ); + next.torso_front.orientation = + Quaternion::rotation_z(twitch1 * 0.06) * Quaternion::rotation_y(short * 0.06); + + next.tail.orientation = Quaternion::rotation_x( + 0.15 + movement1abs * -0.4 + movement2abs * 0.2 + chargemovementbase * 0.2, + ) * Quaternion::rotation_z(shortalt * 0.15); +if speed < 0.5 +{ + if mirror == 1.0 { + next.leg_fl.orientation = Quaternion::rotation_x(movement1abs*0.6); + + next.foot_fl.orientation = Quaternion::rotation_x(movement1abs*-0.6+twitch1 * 0.3); + next.leg_bl.orientation = Quaternion::rotation_x(movement1abs*0.6); + + next.foot_bl.orientation = Quaternion::rotation_x(movement1abs*-0.6+twitch1 * 0.3); + }else{ + next.leg_fr.orientation = Quaternion::rotation_x(movement1abs*0.6); + + next.foot_fr.orientation = Quaternion::rotation_x(movement1abs*-0.6+twitch1 * 0.3); + + next.leg_br.orientation = Quaternion::rotation_x(movement1abs*0.6); + + next.foot_br.orientation = Quaternion::rotation_x(movement1abs*-0.6+twitch1 * 0.3); + } +} + + next + } +} diff --git a/voxygen/src/anim/src/quadruped_medium/mod.rs b/voxygen/src/anim/src/quadruped_medium/mod.rs index 1ba5bd465d..61ad978342 100644 --- a/voxygen/src/anim/src/quadruped_medium/mod.rs +++ b/voxygen/src/anim/src/quadruped_medium/mod.rs @@ -1,5 +1,6 @@ pub mod alpha; pub mod beta; +pub mod dash; pub mod feed; pub mod hoof; pub mod idle; @@ -9,7 +10,7 @@ pub mod run; // Reexports pub use self::{ - alpha::AlphaAnimation, beta::BetaAnimation, feed::FeedAnimation, hoof::HoofAnimation, + alpha::AlphaAnimation, beta::BetaAnimation, dash::DashAnimation, feed::FeedAnimation, hoof::HoofAnimation, idle::IdleAnimation, jump::JumpAnimation, leapmelee::LeapMeleeAnimation, run::RunAnimation, }; diff --git a/voxygen/src/anim/src/quadruped_small/alpha.rs b/voxygen/src/anim/src/quadruped_small/alpha.rs new file mode 100644 index 0000000000..6bd2376330 --- /dev/null +++ b/voxygen/src/anim/src/quadruped_small/alpha.rs @@ -0,0 +1,53 @@ +use super::{ + super::{vek::*, Animation}, + QuadrupedSmallSkeleton, SkeletonAttr, +}; +use common::states::utils::StageSection; +//use std::ops::Rem; + +pub struct AlphaAnimation; + +impl Animation for AlphaAnimation { + type Dependency = (f32, f64, Option, f64); + type Skeleton = QuadrupedSmallSkeleton; + + #[cfg(feature = "use-dyn-lib")] + const UPDATE_FN: &'static [u8] = b"quadruped_small_alpha\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_small_alpha")] + fn update_skeleton_inner( + skeleton: &Self::Skeleton, + (_velocity, global_time, stage_section, timer): Self::Dependency, + anim_time: f64, + _rate: &mut f32, + _s_a: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + + let (movement1base, movement2base, movement3) = match stage_section { + Some(StageSection::Buildup) => ((anim_time as f32).powf(0.5), 0.0, 0.0), + Some(StageSection::Swing) => (1.0, (anim_time as f32).powf(4.0), 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - movement3; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum() as f32; + let movement1 = mirror * movement1base * pullback; + let movement2 = mirror * movement2base * pullback; + let movement1abs = movement1base * pullback; + let movement2abs = movement2base * pullback; + + next.head.orientation = Quaternion::rotation_x(movement1abs*-0.7+movement2abs*2.0)*Quaternion::rotation_y(movement1*-0.6+movement2*1.2); + + + next.chest.orientation = Quaternion::rotation_y(movement1 * -0.08 + movement2 * 0.15) + * Quaternion::rotation_z(movement1 * 0.2 + movement2 * -0.6); + + next.tail.orientation = Quaternion::rotation_x(movement1abs*0.5+movement2abs*-1.0) + * Quaternion::rotation_z(movement1 * -0.4 + movement2 * -0.2); + + next + } +} diff --git a/voxygen/src/anim/src/quadruped_small/mod.rs b/voxygen/src/anim/src/quadruped_small/mod.rs index 3ca7129099..0afa46bf77 100644 --- a/voxygen/src/anim/src/quadruped_small/mod.rs +++ b/voxygen/src/anim/src/quadruped_small/mod.rs @@ -1,10 +1,11 @@ +pub mod alpha; pub mod feed; pub mod idle; pub mod jump; pub mod run; // Reexports -pub use self::{feed::FeedAnimation, idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation}; +pub use self::{alpha::AlphaAnimation, feed::FeedAnimation, idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation}; use super::{make_bone, vek::*, FigureBoneData, Skeleton}; use common::comp::{self}; diff --git a/voxygen/src/anim/src/theropod/alpha.rs b/voxygen/src/anim/src/theropod/alpha.rs new file mode 100644 index 0000000000..e91a222ca4 --- /dev/null +++ b/voxygen/src/anim/src/theropod/alpha.rs @@ -0,0 +1,66 @@ +use super::{ + super::{vek::*, Animation}, + TheropodSkeleton, SkeletonAttr, +}; +use common::states::utils::StageSection; +//use std::ops::Rem; + +pub struct AlphaAnimation; + +impl Animation for AlphaAnimation { + type Dependency = (f32, f64, Option, f64); + type Skeleton = TheropodSkeleton; + + #[cfg(feature = "use-dyn-lib")] + const UPDATE_FN: &'static [u8] = b"theropod_alpha\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "theropod_alpha")] + fn update_skeleton_inner( + skeleton: &Self::Skeleton, + (_velocity, global_time, stage_section, timer): Self::Dependency, + anim_time: f64, + _rate: &mut f32, + _s_a: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + + let (movement1base, movement2base, movement3) = match stage_section { + Some(StageSection::Buildup) => ((anim_time as f32).powf(2.0), 0.0, 0.0), + Some(StageSection::Swing) => (1.0, (anim_time as f32).powf(4.0), 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - movement3; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum() as f32; + let movement1 = mirror * movement1base * pullback; + let movement2 = mirror * movement2base * pullback; + let movement1abs = movement1base * pullback; + let movement2abs = movement2base * pullback; + + next.head.orientation = Quaternion::rotation_x(movement1abs*0.2)*Quaternion::rotation_y(movement1*0.1+movement2*0.2); + next.neck.orientation = Quaternion::rotation_x(movement1abs*-0.3)*Quaternion::rotation_y(movement1*0.1+movement2*0.1); + + + + next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 +movement2abs*0.5); + + next.chest_front.orientation = Quaternion::rotation_x(movement1abs * -0.2) + ; + next.chest_back.orientation = Quaternion::rotation_x(movement1abs * 0.2); + + next.leg_l.orientation = Quaternion::rotation_x(movement1abs *-0.1); + + next.leg_r.orientation = Quaternion::rotation_x(movement1abs *-0.1); + next.foot_l.orientation = Quaternion::rotation_x(movement1abs *-0.3); + next.foot_r.orientation = Quaternion::rotation_x(movement1abs *-0.3); + + next.tail_front.orientation = Quaternion::rotation_x(0.1+movement1abs*-0.1+movement2abs*-0.3) + * Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2); + + next.tail_back.orientation = Quaternion::rotation_x(0.1+movement1abs*-0.1+movement2abs*-0.3) + * Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2); + next + } +} diff --git a/voxygen/src/anim/src/theropod/beta.rs b/voxygen/src/anim/src/theropod/beta.rs new file mode 100644 index 0000000000..1af78a9fa4 --- /dev/null +++ b/voxygen/src/anim/src/theropod/beta.rs @@ -0,0 +1,64 @@ +use super::{ + super::{vek::*, Animation}, + TheropodSkeleton, SkeletonAttr, +}; +use common::states::utils::StageSection; +//use std::ops::Rem; + +pub struct BetaAnimation; + +impl Animation for BetaAnimation { + type Dependency = (f32, f64, Option, f64); + type Skeleton = TheropodSkeleton; + + #[cfg(feature = "use-dyn-lib")] + const UPDATE_FN: &'static [u8] = b"theropod_beta\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "theropod_beta")] + fn update_skeleton_inner( + skeleton: &Self::Skeleton, + (_velocity, global_time, stage_section, timer): Self::Dependency, + anim_time: f64, + _rate: &mut f32, + _s_a: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + + let (movement1base, movement2base, movement3) = match stage_section { + Some(StageSection::Buildup) => ((anim_time as f32).powf(2.0), 0.0, 0.0), + Some(StageSection::Swing) => (1.0, (anim_time as f32).powf(4.0), 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - movement3; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum() as f32; + let movement1 = mirror * movement1base * pullback; + let movement2 = mirror * movement2base * pullback; + let movement1abs = movement1base * pullback; + let movement2abs = movement2base * pullback; + + next.head.orientation = Quaternion::rotation_x(movement1abs*-0.4+movement2abs*1.2)*Quaternion::rotation_y(movement1*0.1+movement2*-0.1); + next.neck.orientation = Quaternion::rotation_x(movement1abs*0.4+movement2abs*-1.2)*Quaternion::rotation_y(movement1*0.1+movement2*-0.1); + + + + next.chest_front.orientation = Quaternion::rotation_x(movement1abs * 0.6+movement2abs*-1.5) + ; + next.chest_back.orientation = Quaternion::rotation_x(movement1abs * -0.6+movement2abs*1.5); + + next.leg_l.orientation = Quaternion::rotation_x(movement1abs *-0.5); + + next.leg_r.orientation = Quaternion::rotation_x(movement1abs *-0.5); + next.foot_l.orientation = Quaternion::rotation_x(movement1abs *0.4); + next.foot_r.orientation = Quaternion::rotation_x(movement1abs *0.4); + + next.tail_front.orientation = Quaternion::rotation_x(0.1+movement1abs*-0.1+movement2abs*-0.3) + ; + + next.tail_back.orientation = Quaternion::rotation_x(0.1+movement1abs*-0.1+movement2abs*-0.3) + ; + next + } +} diff --git a/voxygen/src/anim/src/theropod/mod.rs b/voxygen/src/anim/src/theropod/mod.rs index aff0a75fd0..5fa9e7cc8d 100644 --- a/voxygen/src/anim/src/theropod/mod.rs +++ b/voxygen/src/anim/src/theropod/mod.rs @@ -1,9 +1,11 @@ +pub mod alpha; +pub mod beta; pub mod idle; pub mod jump; pub mod run; // Reexports -pub use self::{idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation}; +pub use self::{alpha::AlphaAnimation, beta::BetaAnimation, idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation}; use super::{make_bone, vek::*, FigureBoneData, Skeleton}; use common::comp::{self}; diff --git a/voxygen/src/anim/src/theropod/run.rs b/voxygen/src/anim/src/theropod/run.rs index 7ef233c7c4..6279827b52 100644 --- a/voxygen/src/anim/src/theropod/run.rs +++ b/voxygen/src/anim/src/theropod/run.rs @@ -21,7 +21,7 @@ impl Animation for RunAnimation { s_a: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let speed = Vec2::::from(velocity).magnitude(); + let speed = (Vec2::::from(velocity).magnitude()).min(22.0); *rate = 1.0; let breathe = (anim_time as f32 * 0.8).sin(); @@ -81,7 +81,7 @@ impl Animation for RunAnimation { next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + breathe * 0.3); next.head.orientation = Quaternion::rotation_x(-0.1 + short * -0.05) * Quaternion::rotation_y(tilt * 0.8) - * Quaternion::rotation_z(shortalt * -0.2 - tilt * 1.2); + * Quaternion::rotation_z(shortalt * -0.2 - tilt * 4.5); next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); next.jaw.orientation = Quaternion::rotation_x(short * -0.03); @@ -89,7 +89,7 @@ impl Animation for RunAnimation { next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1); next.neck.orientation = Quaternion::rotation_x(-0.1 + short * -0.04) * Quaternion::rotation_y(tilt * 0.3) - * Quaternion::rotation_z(shortalt * -0.1 - tilt * 1.2); + * Quaternion::rotation_z(shortalt * -0.1 - tilt * 4.2); next.chest_front.position = Vec3::new( 0.0, @@ -123,25 +123,25 @@ impl Animation for RunAnimation { next.leg_l.position = Vec3::new( -s_a.leg.0, s_a.leg.1 + amplitude3 * foot1b * -1.3, - s_a.leg.2 + amplitude3 * foot1a * 1.4, + s_a.leg.2 + amplitude3 * foot1a * 1.0, ); - next.leg_l.orientation = Quaternion::rotation_x(-0.2 + amplitude3 * foot1a * 0.2) + next.leg_l.orientation = Quaternion::rotation_x(-0.2 + amplitude3 * foot1a * 0.15) * Quaternion::rotation_y(tilt * 0.5) * Quaternion::rotation_z(foot1a * -0.3 + tilt * -0.5); next.leg_r.position = Vec3::new( s_a.leg.0, s_a.leg.1 + amplitude3 * foot2b * -1.3, - s_a.leg.2 + amplitude3 * foot2a * 1.4, + s_a.leg.2 + amplitude3 * foot2a * 1.0, ); - next.leg_r.orientation = Quaternion::rotation_x(-0.2 + amplitude3 * foot2a * 0.2) + next.leg_r.orientation = Quaternion::rotation_x(-0.2 + amplitude3 * foot2a * 0.15) * Quaternion::rotation_y(tilt * 0.5) * Quaternion::rotation_z(foot2a * 0.3 + tilt * -0.5); next.foot_l.position = Vec3::new( -s_a.foot.0, - s_a.foot.1 + canceler * -2.0 + amplitude3 * foot1b * -2.0, - s_a.foot.2 + canceler * 2.0 + (foot1a * 2.0).max(0.0) * amplitude2, + s_a.foot.1 + canceler * -1.0 + amplitude3 * foot1b * -2.0, + s_a.foot.2 + canceler * 2.0 + (foot1a * 1.5).max(0.0) * amplitude2, ); next.foot_l.orientation = Quaternion::rotation_x(-0.3 + amplitude2 * foot1b * -0.35) * Quaternion::rotation_y(tilt * -1.0) @@ -149,8 +149,8 @@ impl Animation for RunAnimation { next.foot_r.position = Vec3::new( s_a.foot.0, - s_a.foot.1 + canceler * -2.0 + amplitude3 * foot2b * -2.0, - s_a.foot.2 + canceler * 2.0 + (foot2a * 2.0).max(0.0) * amplitude2, + s_a.foot.1 + canceler * -1.0 + amplitude3 * foot2b * -2.0, + s_a.foot.2 + canceler * 2.0 + (foot2a * 1.5).max(0.0) * amplitude2, ); next.foot_r.orientation = Quaternion::rotation_x(-0.3 + amplitude2 * foot2b * -0.35) * Quaternion::rotation_y(tilt * -1.0); diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index d4a016eda4..81ab7eb1d7 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -1415,6 +1415,46 @@ impl FigureMgr { ), }; let target_bones = match &character { + + CharacterState::ComboMelee(s) => { + let stage_index = (s.stage - 1) as usize; + let stage_time = s.timer.as_secs_f64(); + let stage_progress = match s.stage_section { + StageSection::Buildup => { + stage_time + / s.static_data.stage_data[stage_index] + .base_buildup_duration + .as_secs_f64() + }, + StageSection::Swing => { + stage_time + / s.static_data.stage_data[stage_index] + .base_swing_duration + .as_secs_f64() + }, + StageSection::Recover => { + stage_time + / s.static_data.stage_data[stage_index] + .base_recover_duration + .as_secs_f64() + }, + _ => 0.0, + }; + match s.stage { + _ => anim::quadruped_small::AlphaAnimation::update_skeleton( + &target_base, + ( + vel.0.magnitude(), + time, + Some(s.stage_section), + state.state_time, + ), + stage_progress, + &mut state_animation_rate, + skeleton_attr, + ), + } + }, CharacterState::Sit { .. } => { anim::quadruped_small::FeedAnimation::update_skeleton( &target_base, @@ -1572,7 +1612,7 @@ impl FigureMgr { }, _ => 0.0, }; - anim::quadruped_medium::AlphaAnimation::update_skeleton( + anim::quadruped_medium::DashAnimation::update_skeleton( &target_base, ( vel.0.magnitude(), @@ -1929,6 +1969,31 @@ impl FigureMgr { ), } }, + CharacterState::BasicBeam(s) => { + let stage_time = s.timer.as_secs_f64(); + let stage_progress = match s.stage_section { + StageSection::Buildup => { + stage_time / s.static_data.buildup_duration.as_secs_f64() + }, + StageSection::Cast => s.timer.as_secs_f64(), + StageSection::Recover => { + stage_time / s.static_data.recover_duration.as_secs_f64() + }, + _ => 0.0, + }; + anim::quadruped_low::BreatheAnimation::update_skeleton( + &target_base, + ( + vel.0.magnitude(), + time, + Some(s.stage_section), + state.state_time, + ), + stage_progress, + &mut state_animation_rate, + skeleton_attr, + ) + }, CharacterState::DashMelee(s) => { let stage_time = s.timer.as_secs_f64(); let stage_progress = match s.stage_section { @@ -2311,9 +2376,7 @@ impl FigureMgr { &mut state_animation_rate, skeleton_attr, ), - - // TODO! - _ => anim::theropod::IdleAnimation::update_skeleton( + _=> anim::theropod::IdleAnimation::update_skeleton( &TheropodSkeleton::default(), time, state.state_time, @@ -2321,8 +2384,63 @@ impl FigureMgr { skeleton_attr, ), }; + let target_bones = match &character { + CharacterState::ComboMelee(s) => { + let stage_index = (s.stage - 1) as usize; + let stage_time = s.timer.as_secs_f64(); + let stage_progress = match s.stage_section { + StageSection::Buildup => { + stage_time + / s.static_data.stage_data[stage_index] + .base_buildup_duration + .as_secs_f64() + }, + StageSection::Swing => { + stage_time + / s.static_data.stage_data[stage_index] + .base_swing_duration + .as_secs_f64() + }, + StageSection::Recover => { + stage_time + / s.static_data.stage_data[stage_index] + .base_recover_duration + .as_secs_f64() + }, + _ => 0.0, + }; + match s.stage { + 1 => anim::theropod::AlphaAnimation::update_skeleton( + &target_base, + ( + vel.0.magnitude(), + time, + Some(s.stage_section), + state.state_time, + ), + stage_progress, + &mut state_animation_rate, + skeleton_attr, + ), + _ => anim::theropod::BetaAnimation::update_skeleton( + &target_base, + ( + vel.0.magnitude(), + time, + Some(s.stage_section), + state.state_time, + ), + stage_progress, + &mut state_animation_rate, + skeleton_attr, + ), + } + }, + // TODO! + _ => target_base, + }; - state.skeleton = anim::vek::Lerp::lerp(&state.skeleton, &target_base, dt_lerp); + state.skeleton = anim::vek::Lerp::lerp(&state.skeleton, &target_bones, dt_lerp); state.update( renderer, pos.0,