mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Spin attack for axe
This commit is contained in:
parent
921c8a81d6
commit
fe47a14ba5
@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Better pathfinding
|
- Better pathfinding
|
||||||
- Bombs
|
- Bombs
|
||||||
- Training dummy items
|
- Training dummy items
|
||||||
|
- Added spin attack for axe
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
BIN
assets/voxygen/element/icons/2haxe_m1.png
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/2haxe_m1.png
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/skill_axespin.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/icons/skill_axespin.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/axe/rusty_2h.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/weapon/axe/rusty_2h.vox
(Stored with Git LFS)
Binary file not shown.
@ -20,6 +20,7 @@ pub enum CharacterAbilityType {
|
|||||||
BasicBlock,
|
BasicBlock,
|
||||||
TripleStrike(Stage),
|
TripleStrike(Stage),
|
||||||
LeapMelee,
|
LeapMelee,
|
||||||
|
SpinMelee,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<&CharacterState> for CharacterAbilityType {
|
impl From<&CharacterState> for CharacterAbilityType {
|
||||||
@ -32,6 +33,7 @@ impl From<&CharacterState> for CharacterAbilityType {
|
|||||||
CharacterState::BasicBlock => Self::BasicBlock,
|
CharacterState::BasicBlock => Self::BasicBlock,
|
||||||
CharacterState::LeapMelee(_) => Self::LeapMelee,
|
CharacterState::LeapMelee(_) => Self::LeapMelee,
|
||||||
CharacterState::TripleStrike(data) => Self::TripleStrike(data.stage),
|
CharacterState::TripleStrike(data) => Self::TripleStrike(data.stage),
|
||||||
|
CharacterState::SpinMelee(_) => Self::SpinMelee,
|
||||||
_ => Self::BasicMelee,
|
_ => Self::BasicMelee,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,6 +82,12 @@ pub enum CharacterAbility {
|
|||||||
recover_duration: Duration,
|
recover_duration: Duration,
|
||||||
base_damage: u32,
|
base_damage: u32,
|
||||||
},
|
},
|
||||||
|
SpinMelee {
|
||||||
|
energy_cost: u32,
|
||||||
|
buildup_duration: Duration,
|
||||||
|
recover_duration: Duration,
|
||||||
|
base_damage: u32,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CharacterAbility {
|
impl CharacterAbility {
|
||||||
@ -117,6 +125,10 @@ impl CharacterAbility {
|
|||||||
.energy
|
.energy
|
||||||
.try_change_by(-(*energy_cost as i32), EnergySource::Ability)
|
.try_change_by(-(*energy_cost as i32), EnergySource::Ability)
|
||||||
.is_ok(),
|
.is_ok(),
|
||||||
|
CharacterAbility::SpinMelee { energy_cost, .. } => update
|
||||||
|
.energy
|
||||||
|
.try_change_by(-(*energy_cost as i32), EnergySource::Ability)
|
||||||
|
.is_ok(),
|
||||||
_ => true,
|
_ => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -239,6 +251,26 @@ impl From<&CharacterAbility> for CharacterState {
|
|||||||
recover_duration: *recover_duration,
|
recover_duration: *recover_duration,
|
||||||
base_damage: *base_damage,
|
base_damage: *base_damage,
|
||||||
}),
|
}),
|
||||||
|
CharacterAbility::SpinMelee {
|
||||||
|
energy_cost,
|
||||||
|
buildup_duration,
|
||||||
|
recover_duration,
|
||||||
|
base_damage,
|
||||||
|
} => CharacterState::SpinMelee(spin_melee::Data {
|
||||||
|
exhausted: false,
|
||||||
|
energy_cost: *energy_cost,
|
||||||
|
buildup_duration: *buildup_duration,
|
||||||
|
buildup_duration_default: *buildup_duration,
|
||||||
|
recover_duration: *recover_duration,
|
||||||
|
recover_duration_default: *recover_duration,
|
||||||
|
base_damage: *base_damage,
|
||||||
|
// This isn't needed for it's continuous implementation, but is left in should this
|
||||||
|
// skill be moved to the skillbar
|
||||||
|
hits_remaining: 1,
|
||||||
|
hits_remaining_default: 1, /* Should be the same value as hits_remaining, also
|
||||||
|
* this value can be removed if ability moved to
|
||||||
|
* skillbar */
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,6 +64,8 @@ pub enum CharacterState {
|
|||||||
TripleStrike(triple_strike::Data),
|
TripleStrike(triple_strike::Data),
|
||||||
/// A leap followed by a small aoe ground attack
|
/// A leap followed by a small aoe ground attack
|
||||||
LeapMelee(leap_melee::Data),
|
LeapMelee(leap_melee::Data),
|
||||||
|
/// Spin around, dealing damage to enemies surrounding you
|
||||||
|
SpinMelee(spin_melee::Data),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CharacterState {
|
impl CharacterState {
|
||||||
@ -75,7 +77,8 @@ impl CharacterState {
|
|||||||
| CharacterState::DashMelee(_)
|
| CharacterState::DashMelee(_)
|
||||||
| CharacterState::TripleStrike(_)
|
| CharacterState::TripleStrike(_)
|
||||||
| CharacterState::BasicBlock
|
| CharacterState::BasicBlock
|
||||||
| CharacterState::LeapMelee(_) => true,
|
| CharacterState::LeapMelee(_)
|
||||||
|
| CharacterState::SpinMelee(_) => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -86,7 +89,8 @@ impl CharacterState {
|
|||||||
| CharacterState::BasicRanged(_)
|
| CharacterState::BasicRanged(_)
|
||||||
| CharacterState::DashMelee(_)
|
| CharacterState::DashMelee(_)
|
||||||
| CharacterState::TripleStrike(_)
|
| CharacterState::TripleStrike(_)
|
||||||
| CharacterState::LeapMelee(_) => true,
|
| CharacterState::LeapMelee(_)
|
||||||
|
| CharacterState::SpinMelee(_) => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -221,13 +221,11 @@ impl Tool {
|
|||||||
base_damage: 7,
|
base_damage: 7,
|
||||||
needs_timing: true,
|
needs_timing: true,
|
||||||
},
|
},
|
||||||
BasicMelee {
|
SpinMelee {
|
||||||
energy_cost: 100,
|
energy_cost: 100,
|
||||||
buildup_duration: Duration::from_millis(700),
|
buildup_duration: Duration::from_millis(125),
|
||||||
recover_duration: Duration::from_millis(100),
|
recover_duration: Duration::from_millis(125),
|
||||||
base_healthchange: -12,
|
base_damage: 5,
|
||||||
range: 3.5,
|
|
||||||
max_angle: 30.0,
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
Hammer(_) => vec![
|
Hammer(_) => vec![
|
||||||
|
@ -12,6 +12,7 @@ pub mod idle;
|
|||||||
pub mod leap_melee;
|
pub mod leap_melee;
|
||||||
pub mod roll;
|
pub mod roll;
|
||||||
pub mod sit;
|
pub mod sit;
|
||||||
|
pub mod spin_melee;
|
||||||
pub mod triple_strike;
|
pub mod triple_strike;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
pub mod wielding;
|
pub mod wielding;
|
||||||
|
146
common/src/states/spin_melee.rs
Normal file
146
common/src/states/spin_melee.rs
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
use crate::{
|
||||||
|
comp::{Attacking, CharacterState, EnergySource, StateUpdate},
|
||||||
|
sys::character_behavior::*,
|
||||||
|
};
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
use std::time::Duration;
|
||||||
|
use vek::Vec3;
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)]
|
||||||
|
pub struct Data {
|
||||||
|
/// How long until the state attacks
|
||||||
|
pub buildup_duration: Duration,
|
||||||
|
/// Allows for buildup_duration to be reset to default value
|
||||||
|
pub buildup_duration_default: Duration,
|
||||||
|
/// How long until state ends
|
||||||
|
pub recover_duration: Duration,
|
||||||
|
/// Allows for recover_duration to be reset to default value
|
||||||
|
pub recover_duration_default: Duration,
|
||||||
|
/// Base damage
|
||||||
|
pub base_damage: u32,
|
||||||
|
/// Whether the attack can deal more damage
|
||||||
|
pub exhausted: bool,
|
||||||
|
/// How many hits it can do before ending
|
||||||
|
pub hits_remaining: u32,
|
||||||
|
/// Allows for hits_remaining to be reset to default value
|
||||||
|
pub hits_remaining_default: u32,
|
||||||
|
/// Energy cost per attack
|
||||||
|
pub energy_cost: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
const MOVE_SPEED: f32 = 5.0;
|
||||||
|
|
||||||
|
impl CharacterBehavior for Data {
|
||||||
|
fn behavior(&self, data: &JoinData) -> StateUpdate {
|
||||||
|
let mut update = StateUpdate::from(data);
|
||||||
|
|
||||||
|
if self.buildup_duration != Duration::default() {
|
||||||
|
// Allows for moving
|
||||||
|
update.vel.0 =
|
||||||
|
Vec3::new(data.inputs.move_dir.x, data.inputs.move_dir.y, 0.0) * MOVE_SPEED;
|
||||||
|
|
||||||
|
update.character = CharacterState::SpinMelee(Data {
|
||||||
|
buildup_duration: self
|
||||||
|
.buildup_duration
|
||||||
|
.checked_sub(Duration::from_secs_f32(data.dt.0))
|
||||||
|
.unwrap_or_default(),
|
||||||
|
buildup_duration_default: self.buildup_duration_default,
|
||||||
|
recover_duration: self.recover_duration,
|
||||||
|
recover_duration_default: self.recover_duration_default,
|
||||||
|
base_damage: self.base_damage,
|
||||||
|
exhausted: self.exhausted,
|
||||||
|
hits_remaining: self.hits_remaining,
|
||||||
|
hits_remaining_default: self.hits_remaining_default,
|
||||||
|
energy_cost: self.energy_cost,
|
||||||
|
});
|
||||||
|
} else if !self.exhausted {
|
||||||
|
//Hit attempt
|
||||||
|
data.updater.insert(data.entity, Attacking {
|
||||||
|
base_healthchange: -(self.base_damage as i32),
|
||||||
|
range: 3.5,
|
||||||
|
max_angle: 360_f32.to_radians(),
|
||||||
|
applied: false,
|
||||||
|
hit_count: 0,
|
||||||
|
knockback: 0.0,
|
||||||
|
});
|
||||||
|
|
||||||
|
update.character = CharacterState::SpinMelee(Data {
|
||||||
|
buildup_duration: self.buildup_duration,
|
||||||
|
buildup_duration_default: self.buildup_duration_default,
|
||||||
|
recover_duration: self.recover_duration,
|
||||||
|
recover_duration_default: self.recover_duration_default,
|
||||||
|
base_damage: self.base_damage,
|
||||||
|
exhausted: true,
|
||||||
|
hits_remaining: self.hits_remaining - 1,
|
||||||
|
hits_remaining_default: self.hits_remaining_default,
|
||||||
|
energy_cost: self.energy_cost,
|
||||||
|
});
|
||||||
|
} else if self.recover_duration != Duration::default() {
|
||||||
|
// Allows for moving
|
||||||
|
update.vel.0 =
|
||||||
|
Vec3::new(data.inputs.move_dir.x, data.inputs.move_dir.y, 0.0) * MOVE_SPEED;
|
||||||
|
|
||||||
|
update.character = CharacterState::SpinMelee(Data {
|
||||||
|
buildup_duration: self.buildup_duration,
|
||||||
|
buildup_duration_default: self.buildup_duration_default,
|
||||||
|
recover_duration: self
|
||||||
|
.recover_duration
|
||||||
|
.checked_sub(Duration::from_secs_f32(data.dt.0))
|
||||||
|
.unwrap_or_default(),
|
||||||
|
recover_duration_default: self.recover_duration_default,
|
||||||
|
base_damage: self.base_damage,
|
||||||
|
exhausted: self.exhausted,
|
||||||
|
hits_remaining: self.hits_remaining,
|
||||||
|
hits_remaining_default: self.hits_remaining_default,
|
||||||
|
energy_cost: self.energy_cost,
|
||||||
|
});
|
||||||
|
} else if self.hits_remaining != 0 {
|
||||||
|
// Allows for one ability usage to have multiple hits
|
||||||
|
// This isn't needed for it's continuous implementation, but is left in should
|
||||||
|
// this skill be moved to the skillbar
|
||||||
|
update.character = CharacterState::SpinMelee(Data {
|
||||||
|
buildup_duration: self.buildup_duration_default,
|
||||||
|
buildup_duration_default: self.buildup_duration_default,
|
||||||
|
recover_duration: self.recover_duration_default,
|
||||||
|
recover_duration_default: self.recover_duration_default,
|
||||||
|
base_damage: self.base_damage,
|
||||||
|
exhausted: false,
|
||||||
|
hits_remaining: self.hits_remaining,
|
||||||
|
hits_remaining_default: self.hits_remaining_default,
|
||||||
|
energy_cost: self.energy_cost,
|
||||||
|
});
|
||||||
|
} else if update.energy.current() >= self.energy_cost && data.inputs.secondary.is_pressed()
|
||||||
|
{
|
||||||
|
update.character = CharacterState::SpinMelee(Data {
|
||||||
|
buildup_duration: self.buildup_duration_default,
|
||||||
|
buildup_duration_default: self.buildup_duration_default,
|
||||||
|
recover_duration: self.recover_duration_default,
|
||||||
|
recover_duration_default: self.recover_duration_default,
|
||||||
|
base_damage: self.base_damage,
|
||||||
|
exhausted: false,
|
||||||
|
hits_remaining: self.hits_remaining_default,
|
||||||
|
hits_remaining_default: self.hits_remaining_default,
|
||||||
|
energy_cost: self.energy_cost,
|
||||||
|
});
|
||||||
|
// Consumes energy if there's enough left and RMB is held down
|
||||||
|
update
|
||||||
|
.energy
|
||||||
|
.change_by(-(self.energy_cost as i32), EnergySource::Ability);
|
||||||
|
} else {
|
||||||
|
// Done
|
||||||
|
update.character = CharacterState::Wielding;
|
||||||
|
// Make sure attack component is removed
|
||||||
|
data.updater.remove::<Attacking>(data.entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Grant energy on successful hit
|
||||||
|
if let Some(attack) = data.attacking {
|
||||||
|
if attack.applied && attack.hit_count > 0 {
|
||||||
|
data.updater.remove::<Attacking>(data.entity);
|
||||||
|
update.energy.change_by(10, EnergySource::HitEnemy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
update
|
||||||
|
}
|
||||||
|
}
|
@ -244,6 +244,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
CharacterState::Boost(data) => data.handle_event(&j, action),
|
CharacterState::Boost(data) => data.handle_event(&j, action),
|
||||||
CharacterState::DashMelee(data) => data.handle_event(&j, action),
|
CharacterState::DashMelee(data) => data.handle_event(&j, action),
|
||||||
CharacterState::LeapMelee(data) => data.handle_event(&j, action),
|
CharacterState::LeapMelee(data) => data.handle_event(&j, action),
|
||||||
|
CharacterState::SpinMelee(data) => data.handle_event(&j, action),
|
||||||
};
|
};
|
||||||
local_emitter.append(&mut state_update.local_events);
|
local_emitter.append(&mut state_update.local_events);
|
||||||
server_emitter.append(&mut state_update.server_events);
|
server_emitter.append(&mut state_update.server_events);
|
||||||
@ -269,6 +270,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
CharacterState::Boost(data) => data.behavior(&j),
|
CharacterState::Boost(data) => data.behavior(&j),
|
||||||
CharacterState::DashMelee(data) => data.behavior(&j),
|
CharacterState::DashMelee(data) => data.behavior(&j),
|
||||||
CharacterState::LeapMelee(data) => data.behavior(&j),
|
CharacterState::LeapMelee(data) => data.behavior(&j),
|
||||||
|
CharacterState::SpinMelee(data) => data.behavior(&j),
|
||||||
};
|
};
|
||||||
|
|
||||||
local_emitter.append(&mut state_update.local_events);
|
local_emitter.append(&mut state_update.local_events);
|
||||||
|
@ -103,6 +103,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
CharacterState::BasicMelee { .. }
|
CharacterState::BasicMelee { .. }
|
||||||
| CharacterState::DashMelee { .. }
|
| CharacterState::DashMelee { .. }
|
||||||
| CharacterState::LeapMelee { .. }
|
| CharacterState::LeapMelee { .. }
|
||||||
|
| CharacterState::SpinMelee { .. }
|
||||||
| CharacterState::TripleStrike { .. }
|
| CharacterState::TripleStrike { .. }
|
||||||
| CharacterState::BasicRanged { .. } => {
|
| CharacterState::BasicRanged { .. } => {
|
||||||
if energy.get_unchecked().regen_rate != 0.0 {
|
if energy.get_unchecked().regen_rate != 0.0 {
|
||||||
|
@ -17,6 +17,7 @@ pub mod run;
|
|||||||
pub mod shoot;
|
pub mod shoot;
|
||||||
pub mod sit;
|
pub mod sit;
|
||||||
pub mod spin;
|
pub mod spin;
|
||||||
|
pub mod spinmelee;
|
||||||
pub mod stand;
|
pub mod stand;
|
||||||
pub mod swim;
|
pub mod swim;
|
||||||
pub mod wield;
|
pub mod wield;
|
||||||
@ -28,8 +29,8 @@ pub use self::{
|
|||||||
dance::DanceAnimation, dash::DashAnimation, equip::EquipAnimation,
|
dance::DanceAnimation, dash::DashAnimation, equip::EquipAnimation,
|
||||||
glidewield::GlideWieldAnimation, gliding::GlidingAnimation, idle::IdleAnimation,
|
glidewield::GlideWieldAnimation, gliding::GlidingAnimation, idle::IdleAnimation,
|
||||||
jump::JumpAnimation, leapmelee::LeapAnimation, roll::RollAnimation, run::RunAnimation,
|
jump::JumpAnimation, leapmelee::LeapAnimation, roll::RollAnimation, run::RunAnimation,
|
||||||
shoot::ShootAnimation, sit::SitAnimation, spin::SpinAnimation, stand::StandAnimation,
|
shoot::ShootAnimation, sit::SitAnimation, spin::SpinAnimation, spinmelee::SpinMeleeAnimation,
|
||||||
swim::SwimAnimation, wield::WieldAnimation,
|
stand::StandAnimation, swim::SwimAnimation, wield::WieldAnimation,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{Bone, FigureBoneData, Skeleton};
|
use super::{Bone, FigureBoneData, Skeleton};
|
||||||
|
170
voxygen/src/anim/src/character/spinmelee.rs
Normal file
170
voxygen/src/anim/src/character/spinmelee.rs
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
use super::{super::Animation, CharacterSkeleton, SkeletonAttr};
|
||||||
|
use common::comp::item::{Hands, ToolKind};
|
||||||
|
use std::f32::consts::PI;
|
||||||
|
use vek::*;
|
||||||
|
|
||||||
|
pub struct SpinMeleeAnimation;
|
||||||
|
|
||||||
|
impl Animation for SpinMeleeAnimation {
|
||||||
|
type Dependency = (Option<ToolKind>, Option<ToolKind>, Vec3<f32>, f64);
|
||||||
|
type Skeleton = CharacterSkeleton;
|
||||||
|
|
||||||
|
#[cfg(feature = "use-dyn-lib")]
|
||||||
|
const UPDATE_FN: &'static [u8] = b"character_spinmelee\0";
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_spinmelee")]
|
||||||
|
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
|
||||||
|
fn update_skeleton_inner(
|
||||||
|
skeleton: &Self::Skeleton,
|
||||||
|
(active_tool_kind, second_tool_kind, velocity, _global_time): Self::Dependency,
|
||||||
|
anim_time: f64,
|
||||||
|
rate: &mut f32,
|
||||||
|
skeleton_attr: &SkeletonAttr,
|
||||||
|
) -> Self::Skeleton {
|
||||||
|
*rate = 1.0;
|
||||||
|
let lab = 1.0;
|
||||||
|
let speed = Vec2::<f32>::from(velocity).magnitude();
|
||||||
|
let mut next = (*skeleton).clone();
|
||||||
|
//torso movement
|
||||||
|
let xshift = if velocity.z.abs() < 0.1 {
|
||||||
|
((anim_time as f32 - 1.1) * lab as f32 * 3.0).sin()
|
||||||
|
} else {
|
||||||
|
0.0
|
||||||
|
};
|
||||||
|
let yshift = if velocity.z.abs() < 0.1 {
|
||||||
|
((anim_time as f32 - 1.1) * lab as f32 * 3.0 + PI / 2.0).sin()
|
||||||
|
} else {
|
||||||
|
0.0
|
||||||
|
};
|
||||||
|
|
||||||
|
let spin = if anim_time < 1.1 && velocity.z.abs() < 0.1 {
|
||||||
|
0.5 * ((anim_time as f32).powf(2.0))
|
||||||
|
} else {
|
||||||
|
lab as f32 * anim_time as f32 * 0.9
|
||||||
|
};
|
||||||
|
|
||||||
|
//feet
|
||||||
|
let slowersmooth = (anim_time as f32 * lab as f32 * 4.0).sin();
|
||||||
|
let quick = (anim_time as f32 * lab as f32 * 8.0).sin();
|
||||||
|
|
||||||
|
if let Some(ToolKind::Axe(_)) = active_tool_kind {
|
||||||
|
next.l_hand.offset = Vec3::new(-0.5, 0.0, 4.0);
|
||||||
|
next.l_hand.ori = Quaternion::rotation_x(PI / 2.0)
|
||||||
|
* Quaternion::rotation_z(0.0)
|
||||||
|
* Quaternion::rotation_y(PI);
|
||||||
|
next.l_hand.scale = Vec3::one() * 1.08;
|
||||||
|
next.r_hand.offset = Vec3::new(0.5, 0.0, -2.5);
|
||||||
|
next.r_hand.ori = Quaternion::rotation_x(PI / 2.0)
|
||||||
|
* Quaternion::rotation_z(0.0)
|
||||||
|
* Quaternion::rotation_y(0.0);
|
||||||
|
next.r_hand.scale = Vec3::one() * 1.06;
|
||||||
|
next.main.offset = Vec3::new(-0.0, -2.0, -1.0);
|
||||||
|
next.main.ori = Quaternion::rotation_x(0.0)
|
||||||
|
* Quaternion::rotation_y(0.0)
|
||||||
|
* Quaternion::rotation_z(0.0);
|
||||||
|
|
||||||
|
next.control.offset = Vec3::new(0.0, 16.0, 3.0);
|
||||||
|
next.control.ori = Quaternion::rotation_x(-1.4)
|
||||||
|
* Quaternion::rotation_y(0.0)
|
||||||
|
* Quaternion::rotation_z(1.4);
|
||||||
|
next.control.scale = Vec3::one();
|
||||||
|
|
||||||
|
next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1);
|
||||||
|
next.head.ori = Quaternion::rotation_z(0.0)
|
||||||
|
* Quaternion::rotation_x(-0.15)
|
||||||
|
* Quaternion::rotation_y(0.08);
|
||||||
|
next.chest.offset = Vec3::new(
|
||||||
|
0.0,
|
||||||
|
skeleton_attr.chest.0 - 3.0,
|
||||||
|
skeleton_attr.chest.1 - 2.0,
|
||||||
|
);
|
||||||
|
next.chest.ori = Quaternion::rotation_z(0.0)
|
||||||
|
* Quaternion::rotation_x(-0.1)
|
||||||
|
* Quaternion::rotation_y(0.3);
|
||||||
|
next.chest.scale = Vec3::one();
|
||||||
|
|
||||||
|
next.belt.offset = Vec3::new(0.0, 1.0, -1.0);
|
||||||
|
next.belt.ori = Quaternion::rotation_z(0.0)
|
||||||
|
* Quaternion::rotation_x(0.4)
|
||||||
|
* Quaternion::rotation_y(0.0);
|
||||||
|
next.belt.scale = Vec3::one() * 0.98;
|
||||||
|
next.shorts.offset = Vec3::new(0.0, 3.0, -2.5);
|
||||||
|
next.shorts.ori = Quaternion::rotation_z(0.0)
|
||||||
|
* Quaternion::rotation_x(0.7)
|
||||||
|
* Quaternion::rotation_y(0.0);
|
||||||
|
next.shorts.scale = Vec3::one();
|
||||||
|
next.torso.offset = Vec3::new(
|
||||||
|
-xshift * (anim_time as f32).min(0.6),
|
||||||
|
-yshift * (anim_time as f32).min(0.6),
|
||||||
|
0.0,
|
||||||
|
) * skeleton_attr.scaler;
|
||||||
|
next.torso.ori = Quaternion::rotation_z(spin * -16.0)
|
||||||
|
* Quaternion::rotation_x(0.0)
|
||||||
|
* Quaternion::rotation_y(0.0);
|
||||||
|
next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;
|
||||||
|
}
|
||||||
|
if velocity.z.abs() > 0.1 {
|
||||||
|
next.l_foot.offset = Vec3::new(-skeleton_attr.foot.0, 8.0, skeleton_attr.foot.2 + 2.0);
|
||||||
|
next.l_foot.ori = Quaternion::rotation_x(1.0) * Quaternion::rotation_z(0.0);
|
||||||
|
next.l_foot.scale = Vec3::one();
|
||||||
|
|
||||||
|
next.r_foot.offset = Vec3::new(skeleton_attr.foot.0, 8.0, skeleton_attr.foot.2 + 2.0);
|
||||||
|
next.r_foot.ori = Quaternion::rotation_x(1.0);
|
||||||
|
next.r_foot.scale = Vec3::one();
|
||||||
|
} else if speed < 0.5 {
|
||||||
|
next.l_foot.offset = Vec3::new(
|
||||||
|
-skeleton_attr.foot.0,
|
||||||
|
2.0 + quick * -6.0,
|
||||||
|
skeleton_attr.foot.2,
|
||||||
|
);
|
||||||
|
next.l_foot.ori =
|
||||||
|
Quaternion::rotation_x(0.5 + slowersmooth * 0.2) * Quaternion::rotation_z(0.0);
|
||||||
|
next.l_foot.scale = Vec3::one();
|
||||||
|
|
||||||
|
next.r_foot.offset = Vec3::new(skeleton_attr.foot.0, 4.0, skeleton_attr.foot.2);
|
||||||
|
next.r_foot.ori =
|
||||||
|
Quaternion::rotation_x(0.5 - slowersmooth * 0.2) * Quaternion::rotation_y(-0.4);
|
||||||
|
next.r_foot.scale = Vec3::one();
|
||||||
|
} else {
|
||||||
|
next.l_foot.offset = Vec3::new(
|
||||||
|
-skeleton_attr.foot.0,
|
||||||
|
2.0 + quick * -6.0,
|
||||||
|
skeleton_attr.foot.2,
|
||||||
|
);
|
||||||
|
next.l_foot.ori =
|
||||||
|
Quaternion::rotation_x(0.5 + slowersmooth * 0.2) * Quaternion::rotation_z(0.0);
|
||||||
|
next.l_foot.scale = Vec3::one();
|
||||||
|
|
||||||
|
next.r_foot.offset = Vec3::new(
|
||||||
|
skeleton_attr.foot.0,
|
||||||
|
2.0 + quick * 6.0,
|
||||||
|
skeleton_attr.foot.2,
|
||||||
|
);
|
||||||
|
next.r_foot.ori =
|
||||||
|
Quaternion::rotation_x(0.5 - slowersmooth * 0.2) * Quaternion::rotation_z(0.0);
|
||||||
|
next.r_foot.scale = Vec3::one();
|
||||||
|
};
|
||||||
|
next.lantern.offset = Vec3::new(
|
||||||
|
skeleton_attr.lantern.0,
|
||||||
|
skeleton_attr.lantern.1,
|
||||||
|
skeleton_attr.lantern.2,
|
||||||
|
);
|
||||||
|
next.lantern.ori = Quaternion::rotation_z(0.0)
|
||||||
|
* Quaternion::rotation_x(0.7)
|
||||||
|
* Quaternion::rotation_y(-0.8);
|
||||||
|
next.glider.offset = Vec3::new(0.0, 0.0, 10.0);
|
||||||
|
next.glider.scale = Vec3::one() * 0.0;
|
||||||
|
next.l_control.scale = Vec3::one();
|
||||||
|
next.r_control.scale = Vec3::one();
|
||||||
|
|
||||||
|
next.second.scale = match (
|
||||||
|
active_tool_kind.map(|tk| tk.into_hands()),
|
||||||
|
second_tool_kind.map(|tk| tk.into_hands()),
|
||||||
|
) {
|
||||||
|
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
|
||||||
|
(_, _) => Vec3::zero(),
|
||||||
|
};
|
||||||
|
|
||||||
|
next
|
||||||
|
}
|
||||||
|
}
|
@ -131,7 +131,7 @@ impl Animation for WieldAnimation {
|
|||||||
let hand_scale = 1.12;
|
let hand_scale = 1.12;
|
||||||
|
|
||||||
next.control.offset = Vec3::new(0.0, 0.0, 0.0);
|
next.control.offset = Vec3::new(0.0, 0.0, 0.0);
|
||||||
// next.control.ori = Quaternion::rotation_x(u_slow * 0.15 + 1.0)
|
//next.control.ori = Quaternion::rotation_x(slow * 1.0);
|
||||||
// * Quaternion::rotation_y(0.0)
|
// * Quaternion::rotation_y(0.0)
|
||||||
// * Quaternion::rotation_z(u_slowalt * 0.08);
|
// * Quaternion::rotation_z(u_slowalt * 0.08);
|
||||||
// next.control.scale = Vec3::one();
|
// next.control.scale = Vec3::one();
|
||||||
@ -172,26 +172,52 @@ impl Animation for WieldAnimation {
|
|||||||
// next.r_control.scale = Vec3::one();
|
// next.r_control.scale = Vec3::one();
|
||||||
},
|
},
|
||||||
Some(ToolKind::Axe(_)) => {
|
Some(ToolKind::Axe(_)) => {
|
||||||
next.l_hand.offset = Vec3::new(-4.0, 3.0, 6.0);
|
if velocity < 0.5 {
|
||||||
next.l_hand.ori = Quaternion::rotation_x(-0.3)
|
next.head.offset = Vec3::new(
|
||||||
* Quaternion::rotation_z(3.14 - 0.3)
|
0.0,
|
||||||
* Quaternion::rotation_y(-0.8);
|
-3.5 + skeleton_attr.head.0,
|
||||||
|
skeleton_attr.head.1 + u_slow * 0.1,
|
||||||
|
);
|
||||||
|
next.head.ori = Quaternion::rotation_z(head_look.x)
|
||||||
|
* Quaternion::rotation_x(0.35 + head_look.y.abs());
|
||||||
|
next.head.scale = Vec3::one() * skeleton_attr.head_scale;
|
||||||
|
next.chest.ori = Quaternion::rotation_x(-0.35)
|
||||||
|
* Quaternion::rotation_y(u_slowalt * 0.04)
|
||||||
|
* Quaternion::rotation_z(0.15);
|
||||||
|
next.belt.offset =
|
||||||
|
Vec3::new(0.0, 1.0 + skeleton_attr.belt.0, skeleton_attr.belt.1);
|
||||||
|
next.belt.ori = Quaternion::rotation_x(0.15)
|
||||||
|
* Quaternion::rotation_y(u_slowalt * 0.03)
|
||||||
|
* Quaternion::rotation_z(0.15);
|
||||||
|
next.shorts.offset =
|
||||||
|
Vec3::new(0.0, 1.0 + skeleton_attr.shorts.0, skeleton_attr.shorts.1);
|
||||||
|
next.shorts.ori = Quaternion::rotation_x(0.15) * Quaternion::rotation_z(0.25);
|
||||||
|
next.control.ori = Quaternion::rotation_x(1.8)
|
||||||
|
* Quaternion::rotation_y(-0.5)
|
||||||
|
* Quaternion::rotation_z(PI - 0.2);
|
||||||
|
next.control.scale = Vec3::one();
|
||||||
|
} else {
|
||||||
|
next.control.ori = Quaternion::rotation_x(2.1)
|
||||||
|
* Quaternion::rotation_y(-0.4)
|
||||||
|
* Quaternion::rotation_z(PI - 0.2);
|
||||||
|
next.control.scale = Vec3::one();
|
||||||
|
}
|
||||||
|
next.l_hand.offset = Vec3::new(-0.5, 0.0, 4.0);
|
||||||
|
next.l_hand.ori = Quaternion::rotation_x(PI / 2.0)
|
||||||
|
* Quaternion::rotation_z(0.0)
|
||||||
|
* Quaternion::rotation_y(0.0);
|
||||||
next.l_hand.scale = Vec3::one() * 1.08;
|
next.l_hand.scale = Vec3::one() * 1.08;
|
||||||
next.r_hand.offset = Vec3::new(-2.5, 9.0, 4.0);
|
next.r_hand.offset = Vec3::new(0.5, 0.0, -2.5);
|
||||||
next.r_hand.ori = Quaternion::rotation_x(-0.3)
|
next.r_hand.ori = Quaternion::rotation_x(PI / 2.0)
|
||||||
* Quaternion::rotation_z(3.14 - 0.3)
|
* Quaternion::rotation_z(0.0)
|
||||||
* Quaternion::rotation_y(-0.8);
|
* Quaternion::rotation_y(0.0);
|
||||||
next.r_hand.scale = Vec3::one() * 1.06;
|
next.r_hand.scale = Vec3::one() * 1.06;
|
||||||
next.main.offset = Vec3::new(-6.0, 10.0, -1.0);
|
next.main.offset = Vec3::new(-0.0, -2.0, -1.0);
|
||||||
next.main.ori = Quaternion::rotation_x(1.27)
|
next.main.ori = Quaternion::rotation_x(0.0)
|
||||||
* Quaternion::rotation_y(-0.3)
|
* Quaternion::rotation_y(0.0)
|
||||||
* Quaternion::rotation_z(-0.8);
|
* Quaternion::rotation_z(0.0);
|
||||||
|
|
||||||
next.control.offset = Vec3::new(0.0, 0.0, 0.0);
|
next.control.offset = Vec3::new(-3.0, 11.0, 3.0);
|
||||||
next.control.ori = Quaternion::rotation_x(u_slowalt * 0.1 + 0.2)
|
|
||||||
* Quaternion::rotation_y(-0.3)
|
|
||||||
* Quaternion::rotation_z(u_slow * 0.1 + 0.0);
|
|
||||||
next.control.scale = Vec3::one();
|
|
||||||
},
|
},
|
||||||
Some(ToolKind::Hammer(_)) => {
|
Some(ToolKind::Hammer(_)) => {
|
||||||
next.l_hand.offset = Vec3::new(-12.0, 0.0, 0.0);
|
next.l_hand.offset = Vec3::new(-12.0, 0.0, 0.0);
|
||||||
|
@ -117,6 +117,7 @@ image_ids! {
|
|||||||
flyingrod_m2: "voxygen.element.icons.debug_wand_m2",
|
flyingrod_m2: "voxygen.element.icons.debug_wand_m2",
|
||||||
charge: "voxygen.element.icons.skill_charge_3",
|
charge: "voxygen.element.icons.skill_charge_3",
|
||||||
hammerleap: "voxygen.element.icons.skill_hammerleap",
|
hammerleap: "voxygen.element.icons.skill_hammerleap",
|
||||||
|
axespin: "voxygen.element.icons.skill_axespin",
|
||||||
|
|
||||||
// Skillbar
|
// Skillbar
|
||||||
level_up: "voxygen.element.misc_bg.level_up",
|
level_up: "voxygen.element.misc_bg.level_up",
|
||||||
|
@ -708,7 +708,7 @@ impl<'a> Widget for Skillbar<'a> {
|
|||||||
Some(ToolKind::Dagger(_)) => self.imgs.onehdagger_m2,
|
Some(ToolKind::Dagger(_)) => self.imgs.onehdagger_m2,
|
||||||
Some(ToolKind::Shield(_)) => self.imgs.onehshield_m2,
|
Some(ToolKind::Shield(_)) => self.imgs.onehshield_m2,
|
||||||
Some(ToolKind::Hammer(_)) => self.imgs.hammerleap,
|
Some(ToolKind::Hammer(_)) => self.imgs.hammerleap,
|
||||||
Some(ToolKind::Axe(_)) => self.imgs.nothing,
|
Some(ToolKind::Axe(_)) => self.imgs.axespin,
|
||||||
Some(ToolKind::Bow(_)) => self.imgs.bow_m2,
|
Some(ToolKind::Bow(_)) => self.imgs.bow_m2,
|
||||||
Some(ToolKind::Staff(StaffKind::Sceptre)) => self.imgs.heal_0,
|
Some(ToolKind::Staff(StaffKind::Sceptre)) => self.imgs.heal_0,
|
||||||
Some(ToolKind::Staff(_)) => self.imgs.staff_m2,
|
Some(ToolKind::Staff(_)) => self.imgs.staff_m2,
|
||||||
|
@ -708,6 +708,15 @@ impl FigureMgr {
|
|||||||
skeleton_attr,
|
skeleton_attr,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
CharacterState::SpinMelee(_) => {
|
||||||
|
anim::character::SpinMeleeAnimation::update_skeleton(
|
||||||
|
&target_base,
|
||||||
|
(active_tool_kind, second_tool_kind, vel.0, time),
|
||||||
|
state.state_time,
|
||||||
|
&mut state_animation_rate,
|
||||||
|
skeleton_attr,
|
||||||
|
)
|
||||||
|
},
|
||||||
CharacterState::TripleStrike(s) => match s.stage {
|
CharacterState::TripleStrike(s) => match s.stage {
|
||||||
triple_strike::Stage::First => {
|
triple_strike::Stage::First => {
|
||||||
anim::character::AlphaAnimation::update_skeleton(
|
anim::character::AlphaAnimation::update_skeleton(
|
||||||
|
Loading…
Reference in New Issue
Block a user