diff --git a/assets/common/abilities/unique/birdlargebreathe/flamethrower.ron b/assets/common/abilities/unique/birdlargebreathe/flamethrower.ron new file mode 100644 index 0000000000..4bf507fa86 --- /dev/null +++ b/assets/common/abilities/unique/birdlargebreathe/flamethrower.ron @@ -0,0 +1,14 @@ +BasicBeam( + buildup_duration: 0.4, + recover_duration: 0.25, + beam_duration: 0.5, + damage: 50, + tick_rate: 3.0, + range: 15.0, + max_angle: 22.5, + damage_effect: None, + energy_regen: 0, + energy_drain: 0, + orientation_behavior: Normal, + specifier: Flamethrower, +) \ No newline at end of file diff --git a/assets/common/abilities/unique/birdlargebreathe/triplestrike.ron b/assets/common/abilities/unique/birdlargebreathe/triplestrike.ron new file mode 100644 index 0000000000..2eaa09c043 --- /dev/null +++ b/assets/common/abilities/unique/birdlargebreathe/triplestrike.ron @@ -0,0 +1,53 @@ +ComboMelee( + stage_data: [ + ( + stage: 1, + base_damage: 100, + damage_increase: 0, + base_poise_damage: 0, + poise_damage_increase: 0, + knockback: 5.0, + range: 4.5, + angle: 30.0, + base_buildup_duration: 0.4, + base_swing_duration: 0.1, + base_recover_duration: 0.3, + forward_movement: 2.0, + ), + ( + stage: 2, + base_damage: 80, + damage_increase: 0, + base_poise_damage: 0, + poise_damage_increase: 0, + knockback: 5.0, + range: 3.5, + angle: 30.0, + base_buildup_duration: 0.4, + base_swing_duration: 0.1, + base_recover_duration: 0.3, + forward_movement: 1.5, + ), + ( + stage: 3, + base_damage: 130, + damage_increase: 0, + base_poise_damage: 0, + poise_damage_increase: 0, + knockback: 10.0, + range: 3.5, + angle: 30.0, + base_buildup_duration: 0.65, + base_swing_duration: 0.1, + base_recover_duration: 0.3, + forward_movement: 1.5, + ), + ], + initial_energy_gain: 0, + max_energy_gain: 0, + energy_increase: 0, + speed_increase: 0.0, + max_speed_increase: 0.0, + scales_from_combo: 0, + is_interruptible: false, +) diff --git a/assets/common/abilities/weapon_ability_manifest.ron b/assets/common/abilities/weapon_ability_manifest.ron index 21a39831a8..b952cbe08a 100644 --- a/assets/common/abilities/weapon_ability_manifest.ron +++ b/assets/common/abilities/weapon_ability_manifest.ron @@ -207,6 +207,11 @@ (None, "common.abilities.unique.mindflayer.summonminions"), ], ), + Unique(BirdLargeBreathe): ( + primary: "common.abilities.unique.birdlargebreathe.flamethrower", + secondary: "common.abilities.unique.birdlargebreathe.triplestrike", + abilities: [], + ), Debug: ( primary: "common.abilities.debug.forwardboost", secondary: "common.abilities.debug.upboost", diff --git a/assets/common/items/npc_weapons/unique/birdlargebreathe.ron b/assets/common/items/npc_weapons/unique/birdlargebreathe.ron new file mode 100644 index 0000000000..15b41aa6ed --- /dev/null +++ b/assets/common/items/npc_weapons/unique/birdlargebreathe.ron @@ -0,0 +1,18 @@ +ItemDef( + name: "Bird Large Breathe", + description: "testing123", + kind: Tool(( + kind: Unique(BirdLargeBreathe), + hands: Two, + stats: Direct(( + equip_time_secs: 0.01, + power: 1.0, + poise_strength: 1.0, + speed: 1.0, + crit_chance: 0.0625, + crit_mult: 1.9142857, + )), + )), + quality: Low, + tags: [], +) \ No newline at end of file diff --git a/assets/voxygen/voxel/npc/cockatrice/male/foot_l.vox b/assets/voxygen/voxel/npc/cockatrice/male/foot_l.vox deleted file mode 100644 index 0ea88c0ee4..0000000000 --- a/assets/voxygen/voxel/npc/cockatrice/male/foot_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ef58ad83fe6ee4a9d8ced58df5886b3f6144d371299bfdd8efceab65a499585c -size 1588 diff --git a/assets/voxygen/voxel/npc/cockatrice/male/leg_l.vox b/assets/voxygen/voxel/npc/cockatrice/male/leg_l.vox deleted file mode 100644 index efe2d31ed4..0000000000 --- a/assets/voxygen/voxel/npc/cockatrice/male/leg_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:741ab2f771236ba57fb6d34dba6dbfc260e4ce2c664c82dc7962252afc94ff41 -size 2224 diff --git a/assets/voxygen/voxel/npc/cockatrice/male/wing_in_l.vox b/assets/voxygen/voxel/npc/cockatrice/male/wing_in_l.vox deleted file mode 100644 index 146351be65..0000000000 --- a/assets/voxygen/voxel/npc/cockatrice/male/wing_in_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1448a9817dfae3206f6b00f67b23b8bb461c9ca05ce2855ed3532d3969fd6438 -size 1412 diff --git a/assets/voxygen/voxel/npc/cockatrice/male/wing_mid_l.vox b/assets/voxygen/voxel/npc/cockatrice/male/wing_mid_l.vox deleted file mode 100644 index 5b1dde72bb..0000000000 --- a/assets/voxygen/voxel/npc/cockatrice/male/wing_mid_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fff15b813df74818b29500ae5c0041532f74dbd1642845226fd775c7bf51dc13 -size 1408 diff --git a/assets/voxygen/voxel/npc/cockatrice/male/wing_out_l.vox b/assets/voxygen/voxel/npc/cockatrice/male/wing_out_l.vox deleted file mode 100644 index 514b14ef94..0000000000 --- a/assets/voxygen/voxel/npc/cockatrice/male/wing_out_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0a6bd4c5688f363ec218d6a7b65da76cbf5783a4cebf27c148c865559953981e -size 1624 diff --git a/assets/voxygen/voxel/npc/phoenix/male/foot_l.vox b/assets/voxygen/voxel/npc/phoenix/male/foot_l.vox deleted file mode 100644 index bde15a7c43..0000000000 --- a/assets/voxygen/voxel/npc/phoenix/male/foot_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b9f61f8cfac427534cd542007480b88893f669a95c12c69640abed0a83d7cf75 -size 1156 diff --git a/assets/voxygen/voxel/npc/phoenix/male/leg_l.vox b/assets/voxygen/voxel/npc/phoenix/male/leg_l.vox deleted file mode 100644 index 3399409d3a..0000000000 --- a/assets/voxygen/voxel/npc/phoenix/male/leg_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d31f5f6553d9b9e1739c0afc4ebe2f3d84eadfa8f88eed13c6a74ad94ce3cec8 -size 1172 diff --git a/assets/voxygen/voxel/npc/phoenix/male/wing_in_l.vox b/assets/voxygen/voxel/npc/phoenix/male/wing_in_l.vox deleted file mode 100644 index a5519a63dd..0000000000 --- a/assets/voxygen/voxel/npc/phoenix/male/wing_in_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:17b3fcf2ca92de9478495abb38b9b4c1dc8860eb4550abc31613be9b7e8e1aa7 -size 1248 diff --git a/assets/voxygen/voxel/npc/phoenix/male/wing_mid_l.vox b/assets/voxygen/voxel/npc/phoenix/male/wing_mid_l.vox deleted file mode 100644 index 88eba2be05..0000000000 --- a/assets/voxygen/voxel/npc/phoenix/male/wing_mid_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7aa8b949cffebf4fd59e7945792defa28eac3151e1873018e1debdf4f7616a9c -size 1204 diff --git a/assets/voxygen/voxel/npc/phoenix/male/wing_out_l.vox b/assets/voxygen/voxel/npc/phoenix/male/wing_out_l.vox deleted file mode 100644 index ad01ca23ad..0000000000 --- a/assets/voxygen/voxel/npc/phoenix/male/wing_out_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:08e8b0ae325de84ca1a50205415dc4300e47cea795447f4572dcc4ea3299a817 -size 1272 diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index abaa7672e6..b48678bd18 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -122,7 +122,6 @@ impl<'a, BodyMeta, SpeciesMeta> core::ops::Index<&'a Body> for AllBodies &self.bird_large.body, Body::FishMedium(_) => &self.fish_medium.body, Body::Dragon(_) => &self.dragon.body, - Body::BirdLarge(_) => &self.bird_large.body, Body::FishSmall(_) => &self.fish_small.body, Body::BipedLarge(_) => &self.biped_large.body, Body::BipedSmall(_) => &self.biped_small.body, @@ -433,7 +432,7 @@ impl Body { }, Body::FishMedium(_) => 50, Body::Dragon(_) => 5000, - Body::BirdLarge(_) => 50, + Body::BirdLarge(_) => 9999999, Body::FishSmall(_) => 20, Body::BipedLarge(biped_large) => match biped_large.species { biped_large::Species::Ogre => 2500, diff --git a/common/src/comp/body/bird_large.rs b/common/src/comp/body/bird_large.rs index 3d6ac3601d..629317082a 100644 --- a/common/src/comp/body/bird_large.rs +++ b/common/src/comp/body/bird_large.rs @@ -60,10 +60,7 @@ impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies } } -pub const ALL_SPECIES: [Species; 2] = [ - Species::Phoenix, - Species::Cockatrice, -]; +pub const ALL_SPECIES: [Species; 2] = [Species::Phoenix, Species::Cockatrice]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { type IntoIter = std::iter::Copied>; diff --git a/common/src/comp/inventory/item/tool.rs b/common/src/comp/inventory/item/tool.rs index f9c0701742..13f7f2b56d 100644 --- a/common/src/comp/inventory/item/tool.rs +++ b/common/src/comp/inventory/item/tool.rs @@ -441,4 +441,5 @@ pub enum UniqueKind { ObjectTurret, WoodenSpear, MindflayerStaff, + BirdLargeBreathe, } diff --git a/common/src/comp/inventory/loadout_builder.rs b/common/src/comp/inventory/loadout_builder.rs index 6e7668d62c..3bba61a08d 100644 --- a/common/src/comp/inventory/loadout_builder.rs +++ b/common/src/comp/inventory/loadout_builder.rs @@ -1,6 +1,6 @@ use crate::{ comp::{ - biped_large, biped_small, golem, + biped_large, biped_small, bird_large, golem, inventory::{ loadout::Loadout, slot::{ArmorSlot, EquipSlot}, @@ -333,6 +333,14 @@ impl LoadoutBuilder { )); }, }, + Body::BirdLarge(bird_large) => match (bird_large.species, bird_large.body_type) { + (bird_large::Species::Cockatrice, _) => { + main_tool = Some(Item::new_from_asset_expect( + "common.items.npc_weapons.unique.birdlargebreathe", + )); + }, + _ => {}, + }, _ => {}, }; } diff --git a/voxygen/anim/src/bird_large/alpha.rs b/voxygen/anim/src/bird_large/alpha.rs new file mode 100644 index 0000000000..378851e192 --- /dev/null +++ b/voxygen/anim/src/bird_large/alpha.rs @@ -0,0 +1,87 @@ +use super::{ + super::{vek::*, Animation}, + BirdLargeSkeleton, SkeletonAttr, +}; +use common::states::utils::StageSection; + +pub struct AlphaAnimation; + +impl Animation for AlphaAnimation { + type Dependency = (Option, f32, f32); + type Skeleton = BirdLargeSkeleton; + + #[cfg(feature = "use-dyn-lib")] + const UPDATE_FN: &'static [u8] = b"bird_large_alpha\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_alpha")] + fn update_skeleton_inner( + skeleton: &Self::Skeleton, + (stage_section, _global_time, _timer): Self::Dependency, + anim_time: f32, + _rate: &mut f32, + s_a: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Swing) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powf(4.0)), + _ => (0.0, 0.0, 0.0), + }; + + let wave_slow_cos = (anim_time * 4.5).cos(); + + let pullback = 1.0 - move3; + + let move1 = move1base * pullback; + let move2 = move2base * pullback; + + next.head.scale = Vec3::one() * 0.98; + next.neck.scale = Vec3::one() * 1.02; + next.beak.scale = Vec3::one() * 0.98; + next.leg_l.scale = Vec3::one() / 8.0 * 0.98; + next.leg_r.scale = Vec3::one() / 8.0 * 0.98; + next.foot_l.scale = Vec3::one() * 1.02; + next.foot_r.scale = Vec3::one() * 1.02; + next.chest.scale = Vec3::one() * s_a.scaler / 8.0; + + next.chest.position = + Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06) * s_a.scaler / 8.0; + next.chest.orientation = Quaternion::rotation_x(move1 * 0.5 - move2 * 0.8); + + next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1); + next.neck.orientation = Quaternion::rotation_x(move1 * 0.5 - move2 * 0.8); + + next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); + next.head.orientation = Quaternion::rotation_x(move1 * 0.5 - move2 * 0.8); + + next.beak.position = Vec3::new(0.0, s_a.beak.0, s_a.beak.1); + next.beak.orientation = Quaternion::rotation_x(wave_slow_cos * -0.02 - 0.02); + + next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1); + next.tail_front.orientation = Quaternion::rotation_x(-move1 * 0.2); + next.tail_rear.position = Vec3::new(0.0, s_a.tail_rear.0, s_a.tail_rear.1); + next.tail_rear.orientation = Quaternion::rotation_x(0.0); + + next.wing_in_l.position = Vec3::new(-s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); + next.wing_in_r.position = Vec3::new(s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); + + next.wing_in_l.orientation = + Quaternion::rotation_y(-1.0 + wave_slow_cos * 0.06) * Quaternion::rotation_z(0.2); + next.wing_in_r.orientation = + Quaternion::rotation_y(1.0 - wave_slow_cos * 0.06) * Quaternion::rotation_z(-0.2); + + next.wing_mid_l.position = Vec3::new(-s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); + next.wing_mid_r.position = Vec3::new(s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); + next.wing_mid_l.orientation = Quaternion::rotation_y(-0.1) * Quaternion::rotation_z(0.7); + next.wing_mid_r.orientation = Quaternion::rotation_y(0.1) * Quaternion::rotation_z(-0.7); + + next.wing_out_l.position = Vec3::new(-s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2); + next.wing_out_r.position = Vec3::new(s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2); + next.wing_out_l.orientation = Quaternion::rotation_y(-0.2) * Quaternion::rotation_z(0.2); + next.wing_out_r.orientation = Quaternion::rotation_y(0.2) * Quaternion::rotation_z(-0.2); + + next + } +} diff --git a/voxygen/anim/src/bird_large/breathe.rs b/voxygen/anim/src/bird_large/breathe.rs new file mode 100644 index 0000000000..96cc860f9b --- /dev/null +++ b/voxygen/anim/src/bird_large/breathe.rs @@ -0,0 +1,137 @@ +use super::{ + super::{vek::*, Animation}, + BirdLargeSkeleton, SkeletonAttr, +}; +use common::{states::utils::StageSection, util::Dir}; + +pub struct BreatheAnimation; + +type BreatheAnimationDependency = ( + f32, + f32, + Vec3, + Vec3, + Option, + f32, + Dir, + bool, +); + +impl Animation for BreatheAnimation { + type Dependency = BreatheAnimationDependency; + type Skeleton = BirdLargeSkeleton; + + #[cfg(feature = "use-dyn-lib")] + const UPDATE_FN: &'static [u8] = b"bird_large_breathe\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_breathe")] + fn update_skeleton_inner( + skeleton: &Self::Skeleton, + (_velocity, global_time, orientation, last_ori, stage_section, timer, look_dir, on_ground): Self::Dependency, + anim_time: f32, + _rate: &mut f32, + s_a: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + + let (movement1base, movement2base, movement3, twitch) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0, 0.0), + Some(StageSection::Cast) => (1.0, anim_time.min(1.0).powf(0.1), 0.0, anim_time), + Some(StageSection::Recover) => (1.0, 1.0, anim_time, 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(); + let twitch2 = mirror * (twitch * 20.0).sin() * pullback; + + let movement1abs = movement1base * pullback; + let movement2abs = movement2base * pullback; + + let wave_slow_cos = (anim_time * 4.5).cos(); + + next.head.scale = Vec3::one() * 0.98; + next.neck.scale = Vec3::one() * 1.02; + next.beak.scale = Vec3::one() * 0.98; + next.leg_l.scale = Vec3::one() / 8.0 * 0.98; + next.leg_r.scale = Vec3::one() / 8.0 * 0.98; + next.foot_l.scale = Vec3::one() * 1.02; + next.foot_r.scale = Vec3::one() * 1.02; + next.chest.scale = Vec3::one() * s_a.scaler / 8.0; + + next.chest.position = Vec3::new( + 0.0, + s_a.chest.0, + s_a.chest.1 + wave_slow_cos * 0.06 + twitch2 * 0.1, + ) * s_a.scaler + / 8.0; + + next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1); + next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.5 - movement2abs * 0.5); + + next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); + next.head.orientation = + Quaternion::rotation_x(movement1abs * 0.5 - movement2abs * 0.5 + look_dir.z * 0.4); + + next.beak.position = Vec3::new(0.0, s_a.beak.0, s_a.beak.1); + next.beak.orientation = Quaternion::rotation_x(movement1abs * -0.7 + twitch2 * 0.1); + + if on_ground { + next.chest.orientation = + Quaternion::rotation_x(movement1abs * 0.1 - movement2abs * 0.1); + + next.wing_in_l.position = Vec3::new(-s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); + next.wing_in_r.position = Vec3::new(s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); + + next.wing_in_l.orientation = + Quaternion::rotation_y(-1.0 + movement1abs * 0.8 - movement2abs * 0.4) + * Quaternion::rotation_z(0.2 - movement1abs * 0.8 + movement2abs * 0.4); + next.wing_in_r.orientation = + Quaternion::rotation_y(1.0 - movement1abs * 0.8 + movement2abs * 0.4) + * Quaternion::rotation_z(-0.2 + movement1abs * 0.8 - movement2abs * 0.4); + + next.wing_mid_l.position = Vec3::new(-s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); + next.wing_mid_r.position = Vec3::new(s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); + next.wing_mid_l.orientation = + Quaternion::rotation_y(-0.1) * Quaternion::rotation_z(0.7); + next.wing_mid_r.orientation = + Quaternion::rotation_y(0.1) * Quaternion::rotation_z(-0.7); + + next.wing_out_l.position = Vec3::new(-s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2); + next.wing_out_r.position = Vec3::new(s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2); + next.wing_out_l.orientation = + Quaternion::rotation_y(-0.2) * Quaternion::rotation_z(0.2); + next.wing_out_r.orientation = + Quaternion::rotation_y(0.2) * Quaternion::rotation_z(-0.2); + + next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1); + next.tail_front.orientation = + Quaternion::rotation_x(-movement1abs * 0.1 + movement2abs * 0.1 + twitch2 * 0.02); + next.tail_rear.position = Vec3::new(0.0, s_a.tail_rear.0, s_a.tail_rear.1); + next.tail_rear.orientation = + Quaternion::rotation_x(-movement1abs * 0.1 + movement2abs * 0.1 + twitch2 * 0.02); + } else { + let ori: Vec2 = Vec2::from(orientation); + let last_ori = Vec2::from(last_ori); + let tilt = if ::vek::Vec2::new(ori, last_ori) + .map(|o| o.magnitude_squared()) + .map(|m| m > 0.001 && m.is_finite()) + .reduce_and() + && ori.angle_between(last_ori).is_finite() + { + ori.angle_between(last_ori).min(0.2) + * last_ori.determine_side(Vec2::zero(), ori).signum() + } else { + 0.0 + } * 1.3; + + next.chest.orientation = + Quaternion::rotation_x(movement1abs * 0.1 - movement2abs * 0.1) + * Quaternion::rotation_y(tilt * 1.8); + } + + next + } +} diff --git a/voxygen/anim/src/bird_large/feed.rs b/voxygen/anim/src/bird_large/feed.rs index 3626fac9f1..8b8acf44fe 100644 --- a/voxygen/anim/src/bird_large/feed.rs +++ b/voxygen/anim/src/bird_large/feed.rs @@ -42,15 +42,15 @@ impl Animation for FeedAnimation { next.head.scale = Vec3::one() * 0.98; next.neck.scale = Vec3::one() * 1.02; next.beak.scale = Vec3::one() * 0.98; - next.leg_l.scale = Vec3::one() * 0.98; - next.leg_r.scale = Vec3::one() * 0.98; - next.foot_l.scale = Vec3::one() * 0.98; - next.foot_r.scale = Vec3::one() * 0.98; - next.chest.scale = Vec3::one() * s_a.scaler / 4.0; + next.leg_l.scale = Vec3::one() / 8.0 * 0.98; + next.leg_r.scale = Vec3::one() / 8.0 * 0.98; + next.foot_l.scale = Vec3::one() * 1.02; + next.foot_r.scale = Vec3::one() * 1.02; + next.chest.scale = Vec3::one() * s_a.scaler / 8.0; next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06 - 1.8) * s_a.scaler - / 4.0; + / 8.0; next.chest.orientation = Quaternion::rotation_x(-0.5); next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1); @@ -72,9 +72,11 @@ impl Animation for FeedAnimation { next.wing_in_r.position = Vec3::new(s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); next.wing_in_l.orientation = - Quaternion::rotation_y(-s_a.wings_angle + 0.3 + wave_fast * 0.08) * Quaternion::rotation_z(0.2); + Quaternion::rotation_y(-s_a.wings_angle + 0.3 + wave_fast * 0.08) + * Quaternion::rotation_z(0.2); next.wing_in_r.orientation = - Quaternion::rotation_y(s_a.wings_angle - 0.3 - wave_fast * 0.08) * Quaternion::rotation_z(-0.2); + Quaternion::rotation_y(s_a.wings_angle - 0.3 - wave_fast * 0.08) + * Quaternion::rotation_z(-0.2); next.wing_mid_l.position = Vec3::new(-s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); next.wing_mid_r.position = Vec3::new(s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); @@ -86,9 +88,9 @@ impl Animation for FeedAnimation { next.wing_out_l.orientation = Quaternion::rotation_y(-0.2) * Quaternion::rotation_z(0.2); next.wing_out_r.orientation = Quaternion::rotation_y(0.2) * Quaternion::rotation_z(-0.2); - next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 - wave_slow_cos * 0.06); + next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0; next.leg_l.orientation = Quaternion::rotation_x(0.5); - next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 - wave_slow_cos * 0.06); + next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0; next.leg_r.orientation = Quaternion::rotation_x(0.5); next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2); diff --git a/voxygen/anim/src/bird_large/fly.rs b/voxygen/anim/src/bird_large/fly.rs index eb30962272..5d987d74a4 100644 --- a/voxygen/anim/src/bird_large/fly.rs +++ b/voxygen/anim/src/bird_large/fly.rs @@ -15,7 +15,7 @@ impl Animation for FlyAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_fly")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (velocity, orientation, last_ori, _global_time, avg_vel, _acc_vel): Self::Dependency, + (velocity, orientation, last_ori, _global_time, _avg_vel, _acc_vel): Self::Dependency, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, @@ -60,25 +60,27 @@ impl Animation for FlyAnimation { next.head.scale = Vec3::one() * 0.98; next.neck.scale = Vec3::one() * 1.02; next.beak.scale = Vec3::one() * 0.98; - next.leg_l.scale = Vec3::one() * 0.98; - next.leg_r.scale = Vec3::one() * 0.98; - next.foot_l.scale = Vec3::one() * 0.98; - next.foot_r.scale = Vec3::one() * 0.98; - next.chest.scale = Vec3::one() * s_a.scaler / 4.0; + next.leg_l.scale = Vec3::one() / 8.0 * 0.98; + next.leg_r.scale = Vec3::one() / 8.0 * 0.98; + next.foot_l.scale = Vec3::one() * 1.02; + next.foot_r.scale = Vec3::one() * 1.02; + next.chest.scale = Vec3::one() * s_a.scaler / 8.0; next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1); next.neck.orientation = - Quaternion::rotation_x((-0.4 + 0.2 * velocity.xy().magnitude() / 5.0).max(-0.4)); + Quaternion::rotation_x((-0.4 + 0.2 * velocity.xy().magnitude() / 5.0).min(0.15)); next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); - next.head.orientation = - Quaternion::rotation_x((-0.6 + 0.2 * velocity.xy().magnitude() / 5.0).max(-0.6) + fast * 0.05); + + next.head.orientation = Quaternion::rotation_x( + (-0.6 + 0.2 * velocity.xy().magnitude() / 5.0).min(-0.3) + fast * 0.05, + ); next.beak.position = Vec3::new(0.0, s_a.beak.0, s_a.beak.1); if velocity.z > 2.0 || velocity.xy().magnitude() < 1.8 { next.chest.position = - Vec3::new(0.0, s_a.chest.0, s_a.chest.1 - flap4 * 1.5) * s_a.scaler / 4.0; + Vec3::new(0.0, s_a.chest.0, s_a.chest.1 - flap4 * 1.5) * s_a.scaler / 8.0; next.chest.orientation = Quaternion::rotation_x( (0.8 - 0.8 * velocity.xy().magnitude() / 5.0).max(-0.2) - flap1 * 0.2, ) * Quaternion::rotation_y(tilt * 1.8 + fast * 0.01); @@ -108,14 +110,14 @@ impl Animation for FlyAnimation { next.tail_rear.orientation = Quaternion::rotation_x(-flap3 * 0.3) * Quaternion::rotation_z(-tilt * 1.0); - next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2); + next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 - flap4 * 1.5) / 8.0; next.leg_l.orientation = Quaternion::rotation_x( - (-1.0 - 0.8 * velocity.xy().magnitude() / 5.0).max(-0.8) + flap1 * -0.1, - ); - next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2); + (-1.0 * velocity.xy().magnitude() / 5.0).max(-1.0) + flap1 * -0.1, + ) * Quaternion::rotation_y(tilt * 1.6 + fast * 0.01); + next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 - flap4 * 1.5) / 8.0; next.leg_r.orientation = Quaternion::rotation_x( - (-1.0 - 0.8 * velocity.xy().magnitude() / 5.0).max(-0.8) + flap1 * -0.1, - ); + (-1.0 * velocity.xy().magnitude() / 5.0).max(-1.0) + flap1 * -0.1, + ) * Quaternion::rotation_y(tilt * 1.6 + fast * 0.01); next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2); next.foot_l.orientation = Quaternion::rotation_x(flap1 * -0.05); @@ -123,7 +125,7 @@ impl Animation for FlyAnimation { next.foot_r.orientation = Quaternion::rotation_x(flap1 * -0.05); } else { next.chest.position = - Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + slow * 0.05) * s_a.scaler / 4.0; + Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + slow * 0.05) * s_a.scaler / 8.0; next.chest.orientation = Quaternion::rotation_x(-0.2 + slow * 0.05 + (0.8 * velocity.z / 80.0).min(0.8)) * Quaternion::rotation_y(tilt * 1.8 + fast * 0.01); @@ -157,10 +159,12 @@ impl Animation for FlyAnimation { next.tail_rear.orientation = Quaternion::rotation_x(-0.2 + slow * 0.08) * Quaternion::rotation_z(-tilt * 1.0); - next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2); - next.leg_l.orientation = Quaternion::rotation_x(-1.0 + slow * -0.05); - next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2); - next.leg_r.orientation = Quaternion::rotation_x(-1.0 + slow * -0.05); + next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + slow * 0.05) / 8.0; + next.leg_l.orientation = Quaternion::rotation_x(-1.0 + slow * -0.05) + * Quaternion::rotation_y(tilt * 1.6 + fast * 0.01); + next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + slow * 0.05) / 8.0; + next.leg_r.orientation = Quaternion::rotation_x(-1.0 + slow * -0.05) + * Quaternion::rotation_y(tilt * 1.6 + fast * 0.01); next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2); next.foot_l.orientation = Quaternion::rotation_x(slow * -0.05); diff --git a/voxygen/anim/src/bird_large/idle.rs b/voxygen/anim/src/bird_large/idle.rs index 29947a21b2..1b4a8243df 100644 --- a/voxygen/anim/src/bird_large/idle.rs +++ b/voxygen/anim/src/bird_large/idle.rs @@ -40,14 +40,15 @@ impl Animation for IdleAnimation { next.head.scale = Vec3::one() * 0.98; next.neck.scale = Vec3::one() * 1.02; next.beak.scale = Vec3::one() * 0.98; - next.leg_l.scale = Vec3::one() * 0.98; - next.leg_r.scale = Vec3::one() * 0.98; - next.foot_l.scale = Vec3::one() * 0.98; - next.foot_r.scale = Vec3::one() * 0.98; - next.chest.scale = Vec3::one() * s_a.scaler / 4.0; + next.leg_l.scale = Vec3::one() / 8.0 * 0.98; + next.leg_r.scale = Vec3::one() / 8.0 * 0.98; + next.foot_l.scale = Vec3::one() * 1.02; + next.foot_r.scale = Vec3::one() * 1.02; + next.chest.scale = Vec3::one() * s_a.scaler / 8.0; - next.chest.position = - Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06) * s_a.scaler / 4.0; + next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06 + 1.5) + * s_a.scaler + / 8.0; next.chest.orientation = Quaternion::rotation_x(0.0); next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1); @@ -83,9 +84,9 @@ impl Animation for IdleAnimation { next.wing_out_l.orientation = Quaternion::rotation_y(-0.2) * Quaternion::rotation_z(0.2); next.wing_out_r.orientation = Quaternion::rotation_y(0.2) * Quaternion::rotation_z(-0.2); - next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 - wave_slow_cos * 0.06); + next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0; next.leg_l.orientation = Quaternion::rotation_x(0.0); - next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 - wave_slow_cos * 0.06); + next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0; next.leg_r.orientation = Quaternion::rotation_x(0.0); next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2); diff --git a/voxygen/anim/src/bird_large/mod.rs b/voxygen/anim/src/bird_large/mod.rs index 9c7e190c58..eef7b229c6 100644 --- a/voxygen/anim/src/bird_large/mod.rs +++ b/voxygen/anim/src/bird_large/mod.rs @@ -1,10 +1,16 @@ +pub mod alpha; +pub mod breathe; pub mod feed; pub mod fly; pub mod idle; pub mod run; +pub mod stunned; // Reexports -pub use self::{feed::FeedAnimation, fly::FlyAnimation, idle::IdleAnimation, run::RunAnimation}; +pub use self::{ + alpha::AlphaAnimation, breathe::BreatheAnimation, feed::FeedAnimation, fly::FlyAnimation, + idle::IdleAnimation, run::RunAnimation, stunned::StunnedAnimation, +}; use super::{make_bone, vek::*, FigureBoneData, Skeleton}; use common::comp::{self}; @@ -58,8 +64,8 @@ impl Skeleton for BirdLargeSkeleton { let wing_mid_r_mat = wing_in_r_mat * Mat4::::from(self.wing_mid_r); let wing_out_l_mat = wing_mid_l_mat * Mat4::::from(self.wing_out_l); let wing_out_r_mat = wing_mid_r_mat * Mat4::::from(self.wing_out_r); - let leg_l_mat = chest_mat * Mat4::::from(self.leg_l); - let leg_r_mat = chest_mat * Mat4::::from(self.leg_r); + let leg_l_mat = base_mat * Mat4::::from(self.leg_l); + let leg_r_mat = base_mat * Mat4::::from(self.leg_r); let foot_l_mat = leg_l_mat * Mat4::::from(self.foot_l); let foot_r_mat = leg_r_mat * Mat4::::from(self.foot_r); @@ -99,7 +105,6 @@ pub struct SkeletonAttr { foot: (f32, f32, f32), scaler: f32, wings_angle: f32, - flight_angle: f32, } impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { @@ -129,7 +134,6 @@ impl Default for SkeletonAttr { foot: (0.0, 0.0, 0.0), scaler: 0.0, wings_angle: 0.0, - flight_angle: 0.0, } } } @@ -176,11 +180,11 @@ impl<'a> From<&'a Body> for SkeletonAttr { }, leg: match (body.species, body.body_type) { (Phoenix, _) => (2.5, -2.5, -3.5), - (Cockatrice, _) => (2.5, 2.5, -3.5), + (Cockatrice, _) => (3.5, 2.5, 13.0), }, foot: match (body.species, body.body_type) { (Phoenix, _) => (0.0, -0.5, -0.5), - (Cockatrice, _) => (1.5, -3.0, -3.0), + (Cockatrice, _) => (0.5, -3.0, -3.0), }, scaler: match (body.species, body.body_type) { (Phoenix, _) => (1.0), @@ -190,10 +194,6 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Phoenix, _) => (1.3), (Cockatrice, _) => (0.9), }, - flight_angle: match (body.species, body.body_type) { - (Phoenix, _) => (-0.5), - (Cockatrice, _) => (1.0), - }, } } } diff --git a/voxygen/anim/src/bird_large/run.rs b/voxygen/anim/src/bird_large/run.rs index 0243871d25..b2088f0c4e 100644 --- a/voxygen/anim/src/bird_large/run.rs +++ b/voxygen/anim/src/bird_large/run.rs @@ -16,7 +16,7 @@ impl Animation for RunAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_run")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency, + (velocity, orientation, last_ori, _global_time, _avg_vel, acc_vel): Self::Dependency, _anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, @@ -64,11 +64,11 @@ impl Animation for RunAnimation { next.head.scale = Vec3::one() * 0.98; next.neck.scale = Vec3::one() * 1.02; next.beak.scale = Vec3::one() * 0.98; - next.leg_l.scale = Vec3::one() * 0.98; - next.leg_r.scale = Vec3::one() * 0.98; - next.foot_l.scale = Vec3::one() * 0.98; - next.foot_r.scale = Vec3::one() * 0.98; - next.chest.scale = Vec3::one() * s_a.scaler / 4.0; + next.leg_l.scale = Vec3::one() / 8.0 * 0.98; + next.leg_r.scale = Vec3::one() / 8.0 * 0.98; + next.foot_l.scale = Vec3::one() * 1.02; + next.foot_r.scale = Vec3::one() * 1.02; + next.chest.scale = Vec3::one() * s_a.scaler / 8.0; next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); next.head.orientation = Quaternion::rotation_x(-0.1 * speednorm + short * -0.05) @@ -88,7 +88,7 @@ impl Animation for RunAnimation { s_a.chest.0, s_a.chest.1 + short * 0.5 + 0.5 * speednorm, ) * s_a.scaler - / 4.0; + / 8.0; next.chest.orientation = Quaternion::rotation_x(short * 0.07) * Quaternion::rotation_y(tilt * 0.8) * Quaternion::rotation_z(shortalt * 0.10); @@ -102,8 +102,10 @@ impl Animation for RunAnimation { next.wing_in_l.position = Vec3::new(-s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); next.wing_in_r.position = Vec3::new(s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); - next.wing_in_l.orientation = Quaternion::rotation_y(-s_a.wings_angle) * Quaternion::rotation_z(0.2); - next.wing_in_r.orientation = Quaternion::rotation_y(s_a.wings_angle) * Quaternion::rotation_z(-0.2); + next.wing_in_l.orientation = + Quaternion::rotation_y(-s_a.wings_angle) * Quaternion::rotation_z(0.2); + next.wing_in_r.orientation = + Quaternion::rotation_y(s_a.wings_angle) * Quaternion::rotation_z(-0.2); next.wing_mid_l.position = Vec3::new(-s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); next.wing_mid_r.position = Vec3::new(s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); @@ -121,7 +123,7 @@ impl Animation for RunAnimation { -s_a.leg.0 + speednorm * 1.5, s_a.leg.1 + foot1b * -2.3, s_a.leg.2, - ); + ) / 8.0; next.leg_l.orientation = Quaternion::rotation_x(-0.2 * speednorm + foot1a * 0.15) * Quaternion::rotation_y(tilt * 0.5); @@ -129,7 +131,7 @@ impl Animation for RunAnimation { s_a.leg.0 + speednorm * -1.5, s_a.leg.1 + foot2b * -2.3, s_a.leg.2, - ); + ) / 8.0; next.leg_r.orientation = Quaternion::rotation_x(-0.2 * speednorm + foot2a * 0.15) * Quaternion::rotation_y(tilt * 0.5); diff --git a/voxygen/anim/src/bird_large/stunned.rs b/voxygen/anim/src/bird_large/stunned.rs new file mode 100644 index 0000000000..782af0f881 --- /dev/null +++ b/voxygen/anim/src/bird_large/stunned.rs @@ -0,0 +1,111 @@ +use super::{ + super::{vek::*, Animation}, + BirdLargeSkeleton, SkeletonAttr, +}; +use common::states::utils::StageSection; +use std::ops::Mul; + +pub struct StunnedAnimation; + +impl Animation for StunnedAnimation { + type Dependency = (f32, f32, Option, f32); + type Skeleton = BirdLargeSkeleton; + + #[cfg(feature = "use-dyn-lib")] + const UPDATE_FN: &'static [u8] = b"bird_large_stunned\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_stunned")] + fn update_skeleton_inner( + skeleton: &Self::Skeleton, + (_velocity, global_time, stage_section, timer): Self::Dependency, + anim_time: f32, + _rate: &mut f32, + s_a: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + + let duck_head_look = Vec2::new( + (global_time / 2.0 + anim_time / 8.0) + .floor() + .mul(7331.0) + .sin() + * 0.5, + (global_time / 2.0 + anim_time / 8.0) + .floor() + .mul(1337.0) + .sin() + * 0.25, + ); + let wave_slow_cos = (anim_time * 4.5).cos(); + + let (movement1base, movement2, twitch) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.1), 0.0, anim_time), + Some(StageSection::Recover) => (1.0, anim_time.powf(4.0), 1.0), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - movement2; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum(); + let twitch2 = mirror * (twitch * 20.0).sin() * pullback; + let movement1abs = movement1base * pullback; + + next.head.scale = Vec3::one() * 0.98; + next.neck.scale = Vec3::one() * 1.02; + next.beak.scale = Vec3::one() * 0.98; + next.leg_l.scale = Vec3::one() / 8.0 * 0.98; + next.leg_r.scale = Vec3::one() / 8.0 * 0.98; + next.foot_l.scale = Vec3::one() * 1.02; + next.foot_r.scale = Vec3::one() * 1.02; + next.chest.scale = Vec3::one() * s_a.scaler / 8.0; + + next.chest.position = + Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06) * s_a.scaler / 8.0; + next.chest.orientation = Quaternion::rotation_x(movement1base * 0.5); + + next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1); + next.neck.orientation = Quaternion::rotation_x(0.0); + + next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); + next.head.orientation = Quaternion::rotation_z(twitch2 * 0.8) + * Quaternion::rotation_x(-duck_head_look.y.abs() + wave_slow_cos * 0.01); + + next.beak.position = Vec3::new(0.0, s_a.beak.0, s_a.beak.1); + next.beak.orientation = Quaternion::rotation_x(-movement1abs * 0.8); + + next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1); + next.tail_front.orientation = Quaternion::rotation_x(0.0); + next.tail_rear.position = Vec3::new(0.0, s_a.tail_rear.0, s_a.tail_rear.1); + next.tail_rear.orientation = Quaternion::rotation_x(0.0); + + next.wing_in_l.position = Vec3::new(-s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); + next.wing_in_r.position = Vec3::new(s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); + + next.wing_in_l.orientation = Quaternion::rotation_y(wave_slow_cos * 0.06 + twitch2 * 0.8) + * Quaternion::rotation_z(0.2 - movement1abs); + next.wing_in_r.orientation = Quaternion::rotation_y(wave_slow_cos * 0.06 - twitch2 * 0.8) + * Quaternion::rotation_z(-0.2 + movement1abs); + + next.wing_mid_l.position = Vec3::new(-s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); + next.wing_mid_r.position = Vec3::new(s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); + next.wing_mid_l.orientation = Quaternion::rotation_y(-0.1) * Quaternion::rotation_z(0.7); + next.wing_mid_r.orientation = Quaternion::rotation_y(0.1) * Quaternion::rotation_z(-0.7); + + next.wing_out_l.position = Vec3::new(-s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2); + next.wing_out_r.position = Vec3::new(s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2); + next.wing_out_l.orientation = Quaternion::rotation_y(-0.2) * Quaternion::rotation_z(0.2); + next.wing_out_r.orientation = Quaternion::rotation_y(0.2) * Quaternion::rotation_z(-0.2); + + next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0; + next.leg_l.orientation = Quaternion::rotation_x(movement1abs * 0.8); + next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0; + next.leg_r.orientation = Quaternion::rotation_x(0.0); + + next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2); + next.foot_l.orientation = Quaternion::rotation_x(0.0); + next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2); + next.foot_r.orientation = Quaternion::rotation_x(0.0); + + next + } +} diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index e2a4ddeb10..1a0dde31f7 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -3334,7 +3334,7 @@ impl BirdLargeLateralSpec { return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); }, }; - let lateral = graceful_load_segment(&spec.wing_in_l.lateral.0); + let lateral = graceful_load_segment_flipped(&spec.wing_in_l.lateral.0, true); (lateral, Vec3::from(spec.wing_in_l.offset)) } @@ -3366,7 +3366,7 @@ impl BirdLargeLateralSpec { return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); }, }; - let lateral = graceful_load_segment(&spec.wing_mid_l.lateral.0); + let lateral = graceful_load_segment_flipped(&spec.wing_mid_l.lateral.0, true); (lateral, Vec3::from(spec.wing_mid_l.offset)) } @@ -3398,7 +3398,7 @@ impl BirdLargeLateralSpec { return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); }, }; - let lateral = graceful_load_segment(&spec.wing_out_l.lateral.0); + let lateral = graceful_load_segment_flipped(&spec.wing_out_l.lateral.0, true); (lateral, Vec3::from(spec.wing_out_l.offset)) } @@ -3430,7 +3430,7 @@ impl BirdLargeLateralSpec { return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); }, }; - let lateral = graceful_load_segment(&spec.leg_l.lateral.0); + let lateral = graceful_load_segment_flipped(&spec.leg_l.lateral.0, true); (lateral, Vec3::from(spec.leg_l.offset)) } @@ -3462,7 +3462,7 @@ impl BirdLargeLateralSpec { return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); }, }; - let lateral = graceful_load_segment(&spec.foot_l.lateral.0); + let lateral = graceful_load_segment_flipped(&spec.foot_l.lateral.0, true); (lateral, Vec3::from(spec.foot_l.offset)) } diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index b243d73c7b..ab1e900fe7 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -3359,7 +3359,100 @@ impl FigureMgr { skeleton_attr, ) }, + CharacterState::BasicBeam(s) => { + let stage_time = s.timer.as_secs_f32(); + let stage_progress = match s.stage_section { + StageSection::Buildup => { + stage_time / s.static_data.buildup_duration.as_secs_f32() + }, + StageSection::Cast => s.timer.as_secs_f32(), + StageSection::Recover => { + stage_time / s.static_data.recover_duration.as_secs_f32() + }, + _ => 0.0, + }; + anim::bird_large::BreatheAnimation::update_skeleton( + &target_base, + ( + rel_vel.magnitude(), + time, + ori * anim::vek::Vec3::::unit_y(), + state.last_ori * anim::vek::Vec3::::unit_y(), + Some(s.stage_section), + state.state_time, + look_dir, + physics.on_ground, + ), + stage_progress, + &mut state_animation_rate, + skeleton_attr, + ) + }, + CharacterState::ComboMelee(s) => { + let stage_index = (s.stage - 1) as usize; + let stage_time = s.timer.as_secs_f32(); + let stage_progress = match s.stage_section { + StageSection::Buildup => { + stage_time + / s.static_data.stage_data[stage_index] + .base_buildup_duration + .as_secs_f32() + }, + StageSection::Swing => { + stage_time + / s.static_data.stage_data[stage_index] + .base_swing_duration + .as_secs_f32() + }, + StageSection::Recover => { + stage_time + / s.static_data.stage_data[stage_index] + .base_recover_duration + .as_secs_f32() + }, + _ => 0.0, + }; + anim::bird_large::AlphaAnimation::update_skeleton( + &target_base, + (Some(s.stage_section), time, state.state_time), + stage_progress, + &mut state_animation_rate, + skeleton_attr, + ) + }, + CharacterState::Stunned(s) => { + let stage_time = s.timer.as_secs_f32(); + let stage_progress = match s.stage_section { + StageSection::Buildup => { + stage_time / s.static_data.buildup_duration.as_secs_f32() + }, + StageSection::Recover => { + stage_time / s.static_data.recover_duration.as_secs_f32() + }, + _ => 0.0, + }; + match s.static_data.poise_state { + PoiseState::Normal + | PoiseState::Interrupted + | PoiseState::Stunned + | PoiseState::Dazed + | PoiseState::KnockedDown => { + anim::bird_large::StunnedAnimation::update_skeleton( + &target_base, + ( + rel_vel.magnitude(), + time, + Some(s.stage_section), + state.state_time, + ), + stage_progress, + &mut state_animation_rate, + skeleton_attr, + ) + }, + } + }, // TODO! _ => target_base, }; diff --git a/world/src/layer/mod.rs b/world/src/layer/mod.rs index 854eb18072..9785b7b01a 100644 --- a/world/src/layer/mod.rs +++ b/world/src/layer/mod.rs @@ -282,7 +282,7 @@ pub fn apply_caves_supplement<'a>( }, _ => { is_hostile = true; - let species = match dynamic_rng.gen_range(0..4) { + let species = match dynamic_rng.gen_range(0..5) { 0 => comp::biped_large::Species::Ogre, 1 => comp::biped_large::Species::Cyclops, 2 => comp::biped_large::Species::Wendigo, diff --git a/world/src/layer/wildlife.rs b/world/src/layer/wildlife.rs index 0bdef79828..062b5900f4 100644 --- a/world/src/layer/wildlife.rs +++ b/world/src/layer/wildlife.rs @@ -1,8 +1,8 @@ use crate::{column::ColumnSample, sim::SimChunk, IndexRef, CONFIG}; use common::{ comp::{ - biped_large, bird_medium, bird_large, fish_medium, fish_small, quadruped_low, quadruped_medium, - quadruped_small, theropod, Alignment, + biped_large, bird_large, bird_medium, fish_medium, fish_small, quadruped_low, + quadruped_medium, quadruped_small, theropod, Alignment, }, generation::{ChunkSupplement, EntityInfo}, terrain::Block,