mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
hoof attack, tweaks
This commit is contained in:
parent
1337fdaa57
commit
6f72e68ad6
@ -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: 60.0,
|
||||
)
|
23
assets/common/abilities/unique/quadmedbasic/singlestrike.ron
Normal file
23
assets/common/abilities/unique/quadmedbasic/singlestrike.ron
Normal file
@ -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,
|
||||
)
|
@ -1,17 +1,17 @@
|
||||
DashMelee(
|
||||
energy_cost: 0,
|
||||
base_damage: 30,
|
||||
max_damage: 40,
|
||||
base_damage: 150,
|
||||
max_damage: 160,
|
||||
base_knockback: 8.0,
|
||||
max_knockback: 15.0,
|
||||
range: 2.0,
|
||||
max_knockback: 25.0,
|
||||
range: 4.0,
|
||||
angle: 45.0,
|
||||
energy_drain: 0,
|
||||
forward_speed: 2.0,
|
||||
buildup_duration: 500,
|
||||
charge_duration: 1200,
|
||||
swing_duration: 100,
|
||||
recover_duration: 500,
|
||||
recover_duration: 800,
|
||||
infinite_charge: true,
|
||||
is_interruptible: true,
|
||||
)
|
||||
|
@ -1,10 +1,10 @@
|
||||
BasicMelee(
|
||||
energy_cost: 0,
|
||||
buildup_duration: 500,
|
||||
swing_duration: 100,
|
||||
recover_duration: 400,
|
||||
buildup_duration: 600,
|
||||
swing_duration: 500,
|
||||
recover_duration: 350,
|
||||
base_damage: 200,
|
||||
knockback: 25.0,
|
||||
range: 4.0,
|
||||
range: 2.0,
|
||||
max_angle: 120.0,
|
||||
)
|
36
assets/common/abilities/unique/quadmedjump/doublestrike.ron
Normal file
36
assets/common/abilities/unique/quadmedjump/doublestrike.ron
Normal file
@ -0,0 +1,36 @@
|
||||
ComboMelee(
|
||||
stage_data: [
|
||||
(
|
||||
stage: 1,
|
||||
base_damage: 100,
|
||||
max_damage: 120,
|
||||
damage_increase: 10,
|
||||
knockback: 8.0,
|
||||
range: 3.5,
|
||||
angle: 30.0,
|
||||
base_buildup_duration: 900,
|
||||
base_swing_duration: 100,
|
||||
base_recover_duration: 300,
|
||||
forward_movement: 1.0,
|
||||
),
|
||||
(
|
||||
stage: 2,
|
||||
base_damage: 80,x
|
||||
max_damage: 110,
|
||||
damage_increase: 15,
|
||||
knockback: 8.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,
|
||||
)
|
13
assets/common/abilities/unique/quadmedjump/quickleap.ron
Normal file
13
assets/common/abilities/unique/quadmedjump/quickleap.ron
Normal file
@ -0,0 +1,13 @@
|
||||
LeapMelee(
|
||||
energy_cost: 0,
|
||||
buildup_duration: 200,
|
||||
movement_duration: 300,
|
||||
swing_duration: 75,
|
||||
recover_duration: 125,
|
||||
base_damage: 120,
|
||||
knockback: 7.0,
|
||||
range: 4.5,
|
||||
max_angle: 180.0,
|
||||
forward_leap_strength: 20.0,
|
||||
vertical_leap_strength: 5.0,
|
||||
)
|
49
assets/common/abilities/unique/quadmedquick/triplestrike.ron
Normal file
49
assets/common/abilities/unique/quadmedquick/triplestrike.ron
Normal file
@ -0,0 +1,49 @@
|
||||
ComboMelee(
|
||||
stage_data: [
|
||||
(
|
||||
stage: 1,
|
||||
base_damage: 100,
|
||||
max_damage: 120,
|
||||
damage_increase: 10,
|
||||
knockback: 5.0,
|
||||
range: 3.5,
|
||||
angle: 60.0,
|
||||
base_buildup_duration: 800,
|
||||
base_swing_duration: 150,
|
||||
base_recover_duration: 400,
|
||||
forward_movement: 3.0,
|
||||
),
|
||||
(
|
||||
stage: 2,
|
||||
base_damage: 80,
|
||||
max_damage: 110,
|
||||
damage_increase: 15,
|
||||
knockback: 5.0,
|
||||
range: 3.5,
|
||||
angle: 60.0,
|
||||
base_buildup_duration: 600,
|
||||
base_swing_duration: 150,
|
||||
base_recover_duration: 300,
|
||||
forward_movement: 3.5,
|
||||
),
|
||||
(
|
||||
stage: 3,
|
||||
base_damage: 130,
|
||||
max_damage: 170,
|
||||
damage_increase: 20,
|
||||
knockback: 5.0,
|
||||
range: 3.5,
|
||||
angle: 60.0,
|
||||
base_buildup_duration: 600,
|
||||
base_swing_duration: 150,
|
||||
base_recover_duration: 300,
|
||||
forward_movement: 4.5,
|
||||
),
|
||||
],
|
||||
initial_energy_gain: 0,
|
||||
max_energy_gain: 100,
|
||||
energy_increase: 20,
|
||||
speed_increase: 0.05,
|
||||
max_speed_increase: 1.8,
|
||||
is_interruptible: true,
|
||||
)
|
@ -62,22 +62,29 @@
|
||||
skills: [],
|
||||
),
|
||||
Unique(QuadMedQuick): (
|
||||
primary: "common.abilities.unique.quadmedquick.basic",
|
||||
primary: "common.abilities.unique.quadmedquick.triplestrike",
|
||||
secondary: "common.abilities.unique.quadmedquick.dash",
|
||||
skills: [],
|
||||
),
|
||||
Unique(QuadMedJump): (
|
||||
primary: "common.abilities.unique.quadmedjump.leap",
|
||||
secondary: "common.abilities.unique.quadmedjump.leap",
|
||||
skills: [],
|
||||
secondary: "common.abilities.unique.quadmedjump.doublestrike",
|
||||
skills: [
|
||||
"common.abilities.unique.quadmedjump.quickleap"
|
||||
],
|
||||
),
|
||||
Unique(QuadMedCharge): (
|
||||
primary: "common.abilities.unique.quadmedcharge.doublestrike",
|
||||
secondary: "common.abilities.unique.quadmedcharge.dash",
|
||||
skills: [],
|
||||
),
|
||||
Unique(QuadMedHoof): (
|
||||
primary: "common.abilities.unique.quadmedbasic.basic",
|
||||
secondary: "common.abilities.unique.quadmedbasic.basic",
|
||||
skills: [],
|
||||
),
|
||||
Unique(QuadMedBasic): (
|
||||
primary: "common.abilities.unique.quadmedbasic.triplestrike",
|
||||
primary: "common.abilities.unique.quadmedbasic.singlestrike",
|
||||
secondary: "common.abilities.unique.quadmedbasic.triplestrike",
|
||||
skills: [],
|
||||
),
|
||||
|
15
assets/common/items/npc_weapons/unique/quadmedhoof.ron
Normal file
15
assets/common/items/npc_weapons/unique/quadmedhoof.ron
Normal file
@ -0,0 +1,15 @@
|
||||
ItemDef(
|
||||
name: "Quad Med Hoof",
|
||||
description: "testing123",
|
||||
kind: Tool(
|
||||
(
|
||||
kind: Unique(QuadMedHoof),
|
||||
stats: (
|
||||
equip_time_millis: 10,
|
||||
power: 1.00,
|
||||
speed: 1.00,
|
||||
),
|
||||
)
|
||||
),
|
||||
quality: Low,
|
||||
)
|
@ -174,6 +174,7 @@ pub enum UniqueKind {
|
||||
BeastClaws,
|
||||
QuadMedQuick,
|
||||
QuadMedJump,
|
||||
QuadMedHoof,
|
||||
QuadMedBasic,
|
||||
QuadMedCharge,
|
||||
QuadLowRanged,
|
||||
|
@ -109,12 +109,21 @@ impl LoadoutBuilder {
|
||||
"common.items.npc_weapons.unique.quadmedquick",
|
||||
));
|
||||
},
|
||||
quadruped_medium::Species::Donkey
|
||||
| quadruped_medium::Species::Horse
|
||||
| quadruped_medium::Species::Zebra
|
||||
| quadruped_medium::Species::Kelpie
|
||||
| quadruped_medium::Species::Antelope => {
|
||||
main_tool = Some(Item::new_from_asset_expect(
|
||||
"common.items.npc_weapons.unique.quadmedhoof",
|
||||
));
|
||||
},
|
||||
quadruped_medium::Species::Saber => {
|
||||
main_tool = Some(Item::new_from_asset_expect(
|
||||
"common.items.npc_weapons.unique.quadmedjump",
|
||||
));
|
||||
},
|
||||
quadruped_medium::Species::Tuskram => {
|
||||
quadruped_medium::Species::Tuskram | quadruped_medium::Species::Roshwalr => {
|
||||
main_tool = Some(Item::new_from_asset_expect(
|
||||
"common.items.npc_weapons.unique.quadmedcharge",
|
||||
));
|
||||
|
@ -52,13 +52,13 @@ impl Body {
|
||||
quadruped_medium::Species::Bonerattler => 130.0,
|
||||
quadruped_medium::Species::Deer => 150.0,
|
||||
quadruped_medium::Species::Hirdrasil => 160.0,
|
||||
quadruped_medium::Species::Roshwalr => 75.0,
|
||||
quadruped_medium::Species::Roshwalr => 160.0,
|
||||
quadruped_medium::Species::Donkey => 110.0,
|
||||
quadruped_medium::Species::Camel => 100.0,
|
||||
quadruped_medium::Species::Zebra => 140.0,
|
||||
quadruped_medium::Species::Antelope => 170.0,
|
||||
quadruped_medium::Species::Kelpie => 175.0,
|
||||
quadruped_medium::Species::Horse => 190.0,
|
||||
quadruped_medium::Species::Camel => 75.0,
|
||||
quadruped_medium::Species::Zebra => 150.0,
|
||||
quadruped_medium::Species::Antelope => 185.0,
|
||||
quadruped_medium::Species::Kelpie => 180.0,
|
||||
quadruped_medium::Species::Horse => 180.0,
|
||||
},
|
||||
Body::BirdMedium(_) => 80.0,
|
||||
Body::FishMedium(_) => 50.0,
|
||||
@ -79,8 +79,8 @@ impl Body {
|
||||
quadruped_low::Species::Rocksnapper => 70.0,
|
||||
quadruped_low::Species::Pangolin => 120.0,
|
||||
quadruped_low::Species::Maneater => 80.0,
|
||||
quadruped_low::Species::Sandshark => 70.0,
|
||||
quadruped_low::Species::Hakulaq => 170.0,
|
||||
quadruped_low::Species::Sandshark => 160.0,
|
||||
quadruped_low::Species::Hakulaq => 140.0,
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -199,7 +199,7 @@ pub fn handle_forced_movement(
|
||||
// Multiply decreasing amount linearly over time (with average of 1)
|
||||
* 2.0 * progress
|
||||
// Apply inputted movement directions with some efficiency
|
||||
+ (data.inputs.move_dir.try_normalized().unwrap_or_default() + update.vel.0.xy())
|
||||
+ (data.inputs.look_dir.try_normalized().unwrap_or_default()/* + update.vel.0.xy()*/)
|
||||
.try_normalized()
|
||||
.unwrap_or_default()
|
||||
// Multiply by forward leap strength
|
||||
|
93
voxygen/src/anim/src/quadruped_medium/hoof.rs
Normal file
93
voxygen/src/anim/src/quadruped_medium/hoof.rs
Normal file
@ -0,0 +1,93 @@
|
||||
use super::{
|
||||
super::{vek::*, Animation},
|
||||
QuadrupedMediumSkeleton, SkeletonAttr,
|
||||
};
|
||||
use common::states::utils::StageSection;
|
||||
use std::f32::consts::PI;
|
||||
|
||||
pub struct HoofAnimation;
|
||||
|
||||
impl Animation for HoofAnimation {
|
||||
type Dependency = (f32, f64, Option<StageSection>, f64);
|
||||
type Skeleton = QuadrupedMediumSkeleton;
|
||||
|
||||
#[cfg(feature = "use-dyn-lib")]
|
||||
const UPDATE_FN: &'static [u8] = b"quadruped_medium_hoof\0";
|
||||
|
||||
#[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_hoof")]
|
||||
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::<f32>::from(velocity).magnitude()).min(24.0);
|
||||
|
||||
let (movement1base, movement2base, movement3, twitch) = match stage_section {
|
||||
Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0, 0.0),
|
||||
Some(StageSection::Swing) => {
|
||||
(1.0, (anim_time as f32).powf(0.25), 0.0, anim_time as f32)
|
||||
},
|
||||
Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powf(4.0), 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 movement1 = movement1base * mirror * pullback;
|
||||
let movement2 = movement2base * mirror * pullback;
|
||||
let movement1abs = movement1base * pullback;
|
||||
let movement2abs = movement2base * pullback;
|
||||
let twitchleft = (twitch as f32 * 16.0).sin() * pullback * mirror;
|
||||
let twitchright = (twitch * 8.0 + PI / 2.0).sin() * pullback * mirror;
|
||||
|
||||
next.head.orientation = Quaternion::rotation_x(movement1abs * -0.6 + movement2abs * 0.6)
|
||||
* Quaternion::rotation_y(movement1 * 0.35 + movement2 * -0.15)
|
||||
* Quaternion::rotation_z(movement1 * 0.15 + movement2 * -0.5);
|
||||
|
||||
next.neck.orientation = Quaternion::rotation_x(movement1abs * -0.8 + movement2abs * -0.2)
|
||||
* Quaternion::rotation_y(movement1 * 0.0)
|
||||
* Quaternion::rotation_z(movement1 * 0.10 + movement1 * -0.15);
|
||||
|
||||
next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.7 + movement2abs * 0.7);
|
||||
|
||||
next.tail.orientation = Quaternion::rotation_x(movement1 * 0.5 + movement2 * -0.8);
|
||||
next.torso_front.position = Vec3::new(
|
||||
0.0,
|
||||
s_a.torso_front.0 + movement1abs * -6.0,
|
||||
s_a.torso_front.1 + movement1abs * 9.0,
|
||||
) * s_a.scaler
|
||||
/ 11.0;
|
||||
next.torso_front.orientation = Quaternion::rotation_x(movement1abs * 1.2);
|
||||
|
||||
next.torso_back.orientation = Quaternion::rotation_x(movement1abs * -0.8);
|
||||
|
||||
next.ears.orientation = Quaternion::rotation_x(0.0);
|
||||
next.leg_fl.orientation = Quaternion::rotation_x(movement1abs * 0.8 + twitchleft * 0.5)
|
||||
* Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3)
|
||||
* Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45);
|
||||
|
||||
next.leg_fr.orientation = Quaternion::rotation_x(movement1abs * 0.8 + twitchright * 0.5)
|
||||
* Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3)
|
||||
* Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45);
|
||||
|
||||
next.foot_fl.orientation =
|
||||
Quaternion::rotation_x(movement1abs * -0.9 + twitchleft * 0.5 + movement2abs * 0.6);
|
||||
|
||||
next.foot_fr.orientation =
|
||||
Quaternion::rotation_x(movement1abs * -0.9 + twitchright * 0.5 + movement2abs * 0.6);
|
||||
if speed < 0.5 {
|
||||
next.leg_bl.orientation = Quaternion::rotation_x(movement1abs * -0.2);
|
||||
|
||||
next.leg_br.orientation = Quaternion::rotation_x(movement1abs * -0.2);
|
||||
|
||||
next.foot_bl.orientation = Quaternion::rotation_x(movement1abs * -0.2);
|
||||
|
||||
next.foot_br.orientation = Quaternion::rotation_x(movement1abs * -0.2);
|
||||
};
|
||||
next
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
pub mod alpha;
|
||||
pub mod beta;
|
||||
pub mod feed;
|
||||
pub mod hoof;
|
||||
pub mod idle;
|
||||
pub mod jump;
|
||||
pub mod leapmelee;
|
||||
@ -8,8 +9,8 @@ pub mod run;
|
||||
|
||||
// Reexports
|
||||
pub use self::{
|
||||
alpha::AlphaAnimation, beta::BetaAnimation, feed::FeedAnimation, idle::IdleAnimation,
|
||||
jump::JumpAnimation, leapmelee::LeapMeleeAnimation, run::RunAnimation,
|
||||
alpha::AlphaAnimation, beta::BetaAnimation, feed::FeedAnimation, hoof::HoofAnimation,
|
||||
idle::IdleAnimation, jump::JumpAnimation, leapmelee::LeapMeleeAnimation, run::RunAnimation,
|
||||
};
|
||||
|
||||
use super::{make_bone, vek::*, FigureBoneData, Skeleton};
|
||||
|
@ -1544,7 +1544,7 @@ impl FigureMgr {
|
||||
|
||||
_ => 0.0,
|
||||
};
|
||||
anim::quadruped_medium::AlphaAnimation::update_skeleton(
|
||||
anim::quadruped_medium::HoofAnimation::update_skeleton(
|
||||
&target_base,
|
||||
(
|
||||
vel.0.magnitude(),
|
||||
|
Loading…
Reference in New Issue
Block a user