Merge branch 'floppy_instrument_sample_edits' into 'master'

add guitar & instrument sample edits

See merge request veloren/veloren!3574
This commit is contained in:
Samuel Keiffer 2022-09-10 17:23:38 +00:00
commit 513b135d58
80 changed files with 590 additions and 436 deletions

View File

@ -457,6 +457,11 @@
secondary: "common.abilities.music.lute",
abilities: [],
),
Custom("Guitar"): (
primary: "common.abilities.music.guitar",
secondary: "common.abilities.music.guitar",
abilities: [],
),
Custom("Sitar"): (
primary: "common.abilities.music.sitar",
secondary: "common.abilities.music.sitar",

View File

@ -1,6 +1,4 @@
Music(
buildup_duration: 0.1,
play_duration: 0.1,
recover_duration: 0.1,
play_duration: 0.4,
ori_modifier: 1.0,
)

View File

@ -1,6 +1,4 @@
Music(
buildup_duration: 0.1,
play_duration: 0.1,
recover_duration: 0.1,
play_duration: 0.4,
ori_modifier: 1.0,
)

View File

@ -0,0 +1,4 @@
Music(
play_duration: 0.4,
ori_modifier: 1.0,
)

View File

@ -1,6 +1,4 @@
Music(
buildup_duration: 0.1,
play_duration: 0.1,
recover_duration: 0.1,
play_duration: 0.4,
ori_modifier: 1.0,
)

View File

@ -1,6 +1,4 @@
Music(
buildup_duration: 0.1,
play_duration: 0.1,
recover_duration: 0.1,
play_duration: 0.4,
ori_modifier: 1.0,
)

View File

@ -1,6 +1,4 @@
Music(
buildup_duration: 0.1,
play_duration: 0.1,
recover_duration: 0.1,
play_duration: 0.4,
ori_modifier: 1.0,
)

View File

@ -1,6 +1,4 @@
Music(
buildup_duration: 0.1,
play_duration: 0.1,
recover_duration: 0.1,
play_duration: 0.4,
ori_modifier: 1.0,
)

View File

@ -1,6 +1,4 @@
Music(
buildup_duration: 0.1,
play_duration: 0.1,
recover_duration: 0.1,
play_duration: 0.4,
ori_modifier: 1.0,
)

View File

@ -1,6 +1,4 @@
Music(
buildup_duration: 0.1,
play_duration: 0.1,
recover_duration: 0.1,
play_duration: 0.4,
ori_modifier: 1.0,
)

View File

@ -18,4 +18,4 @@ ItemDef(
quality: Common,
tags: [],
ability_spec: Some(Custom("Bass")),
)
)

View File

@ -18,4 +18,4 @@ ItemDef(
quality: Common,
tags: [],
ability_spec: Some(Custom("Flute")),
)
)

View File

@ -0,0 +1,21 @@
ItemDef(
name: "Guitar",
description: "Common Guitar.",
kind: Tool((
kind: Instrument,
hands: Two,
stats: (
equip_time_secs: 0.4,
power: 0.0,
effect_power: 1.0,
speed: 1.0,
crit_chance: 0.0,
range: 0.0,
energy_efficiency: 1.0,
buff_strength: 1.0,
),
)),
quality: Common,
tags: [],
ability_spec: Some(Custom("Guitar")),
)

View File

@ -18,4 +18,4 @@ ItemDef(
quality: Common,
tags: [],
ability_spec: Some(Custom("Harp")),
)
)

View File

@ -18,4 +18,4 @@ ItemDef(
quality: Common,
tags: [],
ability_spec: Some(Custom("Kalimba")),
)
)

View File

@ -18,4 +18,4 @@ ItemDef(
quality: Common,
tags: [],
ability_spec: Some(Custom("Lute")),
)
)

View File

@ -18,4 +18,4 @@ ItemDef(
quality: Common,
tags: [],
ability_spec: Some(Custom("Melodica")),
)
)

View File

@ -18,4 +18,4 @@ ItemDef(
quality: Common,
tags: [],
ability_spec: Some(Custom("Perc")),
)
)

View File

@ -18,4 +18,4 @@ ItemDef(
quality: Common,
tags: [],
ability_spec: Some(Custom("Sitar")),
)
)

View File

@ -378,4 +378,15 @@
(Item("common.items.armor.merchant.pants"),1),
(Item("common.items.armor.merchant.shoulder"),1),
],
"instruments": [
(Item("common.items.tool.instruments.bass"),1),
(Item("common.items.tool.instruments.flute"),1),
(Item("common.items.tool.instruments.guitar"),1),
(Item("common.items.tool.instruments.harp"),1),
(Item("common.items.tool.instruments.kalimba"),1),
(Item("common.items.tool.instruments.lute"),1),
(Item("common.items.tool.instruments.melodica"),1),
(Item("common.items.tool.instruments.sitar"),1),
(Item("common.items.tool.instruments.perc"),1),
],
})

View File

@ -450,12 +450,6 @@
],
threshold: 0.2,
),
Attack(BasicAura, Instrument): (
files: [
"voxygen.audio.sfx.abilities.barrel_organ",
],
threshold: 34.75,
),
//Attack(BasicRanged, Staff): (
// files: [
// "voxygen.audio.sfx.abilities.staff_channeling",
@ -527,6 +521,14 @@
//
// Instruments
// NPC Organ
Attack(BasicAura, Instrument): (
files: [
"voxygen.audio.sfx.abilities.barrel_organ",
],
threshold: 34.75,
),
// Player Instruments
Wield(Instrument): (
files: [
"voxygen.audio.sfx.weapon.weapon_out",
@ -616,6 +618,23 @@
],
threshold: 0.5,
),
Music(Instrument, Custom("Guitar")): (
files: [
"voxygen.audio.sfx.instrument.guitar.guitar_c",
"voxygen.audio.sfx.instrument.guitar.guitar_g",
"voxygen.audio.sfx.instrument.guitar.guitar_d",
"voxygen.audio.sfx.instrument.guitar.guitar_a",
"voxygen.audio.sfx.instrument.guitar.guitar_e",
"voxygen.audio.sfx.instrument.guitar.guitar_c1",
"voxygen.audio.sfx.instrument.guitar.guitar_ac1a",
"voxygen.audio.sfx.instrument.guitar.guitar_c1d1c1",
"voxygen.audio.sfx.instrument.guitar.guitar_cdc",
"voxygen.audio.sfx.instrument.guitar.guitar_ded",
"voxygen.audio.sfx.instrument.guitar.guitar_ege",
"voxygen.audio.sfx.instrument.guitar.guitar_gag",
],
threshold: 0.5,
),
Music(Instrument, Custom("Perc")): (
files: [
"voxygen.audio.sfx.instrument.perc.perc_c",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/voxygen/audio/sfx/instrument/guitar/guitar_a.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/audio/sfx/instrument/guitar/guitar_ac1a.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/audio/sfx/instrument/guitar/guitar_c.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/audio/sfx/instrument/guitar/guitar_c1.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/audio/sfx/instrument/guitar/guitar_c1d1c1.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/audio/sfx/instrument/guitar/guitar_cdc.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/audio/sfx/instrument/guitar/guitar_d.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/audio/sfx/instrument/guitar/guitar_ded.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/audio/sfx/instrument/guitar/guitar_e.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/audio/sfx/instrument/guitar/guitar_ege.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/audio/sfx/instrument/guitar/guitar_g.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/audio/sfx/instrument/guitar/guitar_gag.ogg (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1646,6 +1646,10 @@
"voxel.weapon.tool.lute",
(0.0, 0.0, 0.0), (45.0, 90.0, 0.0), 1.0,
),
Simple("common.items.tool.instruments.guitar"): VoxTrans(
"voxel.weapon.tool.guitar",
(0.0, 0.0, 0.0), (45.0, 90.0, 0.0), 1.1,
),
Simple("common.items.tool.instruments.sitar"): VoxTrans(
"voxel.weapon.tool.sitar",
(0.0, 0.0, 0.0), (45.0, 90.0, 0.0), 1.2,

View File

@ -1148,6 +1148,10 @@
vox_spec: ("weapon.tool.lute", (-2.5, -6.0, 4.0)),
color: None
),
Tool("common.items.tool.instruments.guitar"): (
vox_spec: ("weapon.tool.guitar", (-4.5, -6.0, 0.0)),
color: None
),
Tool("common.items.tool.instruments.sitar"): (
vox_spec: ("weapon.tool.sitar", (-4.0, -6.0, 5.0)),
color: None

View File

@ -406,6 +406,7 @@
Simple("common.items.tool.instruments.melodica"): "voxel.weapon.tool.melodica",
Simple("common.items.tool.instruments.lute"): "voxel.weapon.tool.lute",
Simple("common.items.tool.instruments.sitar"): "voxel.weapon.tool.sitar",
Simple("common.items.tool.instruments.guitar"): "voxel.weapon.tool.guitar",
// Other
Simple("common.items.utility.coins"): "voxel.object.v-coin",
Simple("common.items.utility.collar"): "voxel.object.collar",

BIN
assets/voxygen/voxel/weapon/tool/guitar.vox (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -614,9 +614,7 @@ pub enum CharacterAbility {
sparseness: f64,
},
Music {
buildup_duration: f32,
play_duration: f32,
recover_duration: f32,
ori_modifier: f32,
},
}
@ -1073,14 +1071,10 @@ impl CharacterAbility {
*outer_dist *= stats.range;
},
Music {
ref mut buildup_duration,
ref mut play_duration,
ref mut recover_duration,
ori_modifier: _,
} => {
*buildup_duration /= stats.speed;
*play_duration /= stats.speed;
*recover_duration /= stats.speed;
},
}
self
@ -2228,20 +2222,16 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
achieved_radius: summon_distance.0.floor() as i32 - 1,
}),
CharacterAbility::Music {
buildup_duration,
play_duration,
recover_duration,
ori_modifier,
} => CharacterState::Music(music::Data {
static_data: music::StaticData {
buildup_duration: Duration::from_secs_f32(*buildup_duration),
play_duration: Duration::from_secs_f32(*play_duration),
recover_duration: Duration::from_secs_f32(*recover_duration),
ori_modifier: *ori_modifier,
ability_info,
},
timer: Duration::default(),
stage_section: StageSection::Buildup,
stage_section: StageSection::Action,
exhausted: false,
}),
}

View File

@ -12,12 +12,8 @@ use std::time::Duration;
/// Separated out to condense update portions of character state
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct StaticData {
/// How long until state should make sound
pub buildup_duration: Duration,
/// How long the state is playing for
pub play_duration: Duration,
/// How long the state has until exiting
pub recover_duration: Duration,
/// Adjusts turning rate during the attack
pub ori_modifier: f32,
/// What key is used to press ability
@ -46,22 +42,6 @@ impl CharacterBehavior for Data {
handle_jump(data, output_events, &mut update, 1.0);
match self.stage_section {
StageSection::Buildup => {
if self.timer < self.static_data.buildup_duration {
// Build up
update.character = CharacterState::Music(Data {
timer: tick_attack_or_default(data, self.timer, None),
..*self
});
} else {
// Transitions to play section of stage
update.character = CharacterState::Music(Data {
timer: Duration::default(),
stage_section: StageSection::Action,
..*self
});
}
},
StageSection::Action => {
if !self.exhausted {
update.character = CharacterState::Music(Data {
@ -75,22 +55,6 @@ impl CharacterBehavior for Data {
timer: tick_attack_or_default(data, self.timer, None),
..*self
});
} else {
// Transitions to recover section of stage
update.character = CharacterState::Music(Data {
timer: Duration::default(),
stage_section: StageSection::Recover,
..*self
});
}
},
StageSection::Recover => {
if self.timer < self.static_data.recover_duration {
// Recovery
update.character = CharacterState::Music(Data {
timer: tick_attack_or_default(data, self.timer, None),
..*self
});
} else {
// Done
if input_is_pressed(data, self.static_data.ability_info.input) {
@ -130,4 +94,4 @@ fn reset_state(
update,
data.static_data.ability_info.input,
);
}
}

View File

@ -3,7 +3,7 @@ use super::{
CharacterSkeleton, SkeletonAttr,
};
use common::{
comp::item::{AbilitySpec, Hands, ToolKind},
comp::item::{Hands, ToolKind},
states::utils::{AbilityInfo, StageSection},
};
use core::f32::consts::PI;
@ -13,7 +13,7 @@ pub struct AlphaAnimation;
type AlphaAnimationDependency<'a> = (
(Option<Hands>, Option<Hands>),
Option<StageSection>,
(Option<AbilityInfo>, Option<&'a AbilitySpec>),
Option<AbilityInfo>,
);
impl Animation for AlphaAnimation {
type Dependency<'a> = AlphaAnimationDependency<'a>;
@ -25,7 +25,7 @@ impl Animation for AlphaAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_alpha")]
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(hands, stage_section, (ability_info, active_tool_spec)): Self::Dependency<'a>,
(hands, stage_section, ability_info): Self::Dependency<'a>,
anim_time: f32,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -78,53 +78,6 @@ impl Animation for AlphaAnimation {
* Quaternion::rotation_z(0.0 + move1 * 1.5 + move2 * -2.5);
next.head.orientation = Quaternion::rotation_z(0.0 + move1 * -1.5 + move2 * 2.5);
},
// TODO: create Instrument SubToolKinds to distinguish instruments
Some(ToolKind::Instrument) => {
if let Some(AbilitySpec::Custom(spec)) = active_tool_spec {
match spec.as_str() {
"Flute" => {
let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
Some(StageSection::Action) => (1.0, anim_time, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
_ => (0.0, 0.0, 0.0),
};
next.head.position =
Vec3::new(move2 * 0.1, s_a.head.0 + move2 * 0.2, s_a.head.1);
next.chest.orientation = Quaternion::rotation_x(
0.0 + move1 * 0.2 + move2 * -0.2 + move3 * 0.1,
) * Quaternion::rotation_y(
0.0 + move1 * 0.0 + move2 * 0.0 + move3 * 0.0,
) * Quaternion::rotation_z(
0.0 + move1 * 0.1 + move2 * -0.1 + move3 * 0.1,
);
next.head.orientation = Quaternion::rotation_z(
0.0 + move1 * -0.1 + move2 * 0.1 + move3 * -0.2,
);
},
_ => {
let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
Some(StageSection::Action) => (1.0, anim_time, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
_ => (0.0, 0.0, 0.0),
};
next.head.position =
Vec3::new(move2 * 1.0, s_a.head.0 + move2 * 1.0, s_a.head.1);
next.chest.orientation = Quaternion::rotation_x(
0.0 + move1 * 0.2 + move2 * -0.2 + move3 * 0.1,
) * Quaternion::rotation_y(
0.0 + move1 * 0.0 + move2 * 0.0 + move3 * 0.0,
) * Quaternion::rotation_z(
0.0 + move1 * 0.3 + move2 * -0.3 + move3 * 0.2,
);
next.head.orientation = Quaternion::rotation_z(
0.0 + move1 * -0.1 + move2 * 0.1 + move3 * -0.2,
);
},
}
}
},
Some(ToolKind::Hammer) | Some(ToolKind::Pick) => {
let (move1, move2, move3) = match stage_section {
@ -203,205 +156,6 @@ impl Animation for AlphaAnimation {
s_a.ac.5 + move1 * -2.0 + move2 * -1.0 + move3 * 2.5,
)
},
Some(ToolKind::Instrument) => {
if let Some(AbilitySpec::Custom(spec)) = active_tool_spec {
match spec.as_str() {
"Bass" => {
next.hand_r.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
next.hand_l.orientation = Quaternion::rotation_x(2.0)
* Quaternion::rotation_y(-0.75)
* Quaternion::rotation_z(0.40);
next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
next.hand_r.orientation = Quaternion::rotation_x(1.0)
* Quaternion::rotation_y(0.75)
* Quaternion::rotation_z(-0.40);
next.main.position = Vec3::new(-4.0, 6.0, 14.0);
next.main.orientation = Quaternion::rotation_x(0.1)
* Quaternion::rotation_y(3.0)
* Quaternion::rotation_z(PI / -3.0);
let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
Some(StageSection::Action) => (1.0, anim_time, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
_ => (0.0, 0.0, 0.0),
};
next.hand_r.position = Vec3::new(
s_a.ahr.0 + move1 * 5.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahr.1 + move1 * 8.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahr.2 + move1 * 1.0 + move2 * 0.0 + move3 * 0.0,
);
next.hand_l.position = Vec3::new(
s_a.ahl.0 + move1 * -5.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahl.1 + move1 * 6.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahl.2 + move1 * 1.0 + move2 * 0.0 + move3 * 0.0,
);
},
"Lute" => {
next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
next.hand_l.orientation = Quaternion::rotation_x(2.0)
* Quaternion::rotation_y(-0.75)
* Quaternion::rotation_z(0.40);
next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
next.hand_r.orientation = Quaternion::rotation_x(1.0)
* Quaternion::rotation_y(0.75)
* Quaternion::rotation_z(-0.40);
next.main.position = Vec3::new(-14.0, 6.0, 4.0);
next.main.orientation = Quaternion::rotation_x(0.1)
* Quaternion::rotation_y(2.0)
* Quaternion::rotation_z(PI / -3.0);
let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
Some(StageSection::Action) => (1.0, anim_time, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
_ => (0.0, 0.0, 0.0),
};
next.hand_r.position = Vec3::new(
s_a.ahr.0 + move1 * 5.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahr.1 + move1 * 8.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahr.2 + move1 * 1.0 + move2 * 0.0 + move3 * 0.0,
);
next.hand_l.position = Vec3::new(
s_a.ahl.0 + move1 * -5.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahl.1 + move1 * 6.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahl.2 + move1 * -6.0 + move2 * 0.0 + move3 * 0.0,
);
},
"Sitar" => {
next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
next.hand_l.orientation = Quaternion::rotation_x(2.0)
* Quaternion::rotation_y(-0.75)
* Quaternion::rotation_z(0.40);
next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
next.hand_r.orientation = Quaternion::rotation_x(1.0)
* Quaternion::rotation_y(0.75)
* Quaternion::rotation_z(-0.40);
next.main.position = Vec3::new(-14.0, 6.0, 4.0);
next.main.orientation = Quaternion::rotation_x(0.1)
* Quaternion::rotation_y(2.0)
* Quaternion::rotation_z(PI / -3.0);
let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
Some(StageSection::Action) => (1.0, anim_time, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
_ => (0.0, 0.0, 0.0),
};
next.hand_r.position = Vec3::new(
s_a.ahr.0 + move1 * 5.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahr.1 + move1 * 8.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahr.2 + move1 * 1.0 + move2 * 0.0 + move3 * 0.0,
);
next.hand_l.position = Vec3::new(
s_a.ahl.0 + move1 * -5.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahl.1 + move1 * 6.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahl.2 + move1 * -6.0 + move2 * 0.0 + move3 * 0.0,
);
},
"Flute" => {
next.hand_l.position = Vec3::new(-4.0, 6.0, 4.5);
next.hand_l.orientation = Quaternion::rotation_x(2.0)
* Quaternion::rotation_y(-0.75)
* Quaternion::rotation_z(0.40);
next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
next.hand_r.orientation = Quaternion::rotation_x(1.0)
* Quaternion::rotation_y(0.75)
* Quaternion::rotation_z(-0.40);
next.main.position = Vec3::new(-2.5, 10.0, -12.0);
next.main.orientation = Quaternion::rotation_x(3.5)
* Quaternion::rotation_y(PI)
* Quaternion::rotation_z(0.05);
let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
Some(StageSection::Action) => (1.0, anim_time, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
_ => (0.0, 0.0, 0.0),
};
next.hand_r.position = Vec3::new(
s_a.ahr.0 + move1 * 5.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahr.1 + move1 * 8.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahr.2 + move1 * 1.0 + move2 * 0.0 + move3 * 0.0,
);
},
"Kalimba" => {
next.hand_l.position = Vec3::new(-4.0, 6.0, 2.0);
next.hand_l.orientation = Quaternion::rotation_x(1.00)
* Quaternion::rotation_y(-0.75)
* Quaternion::rotation_z(0.20);
next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
next.hand_r.orientation = Quaternion::rotation_x(1.75)
* Quaternion::rotation_y(0.75)
* Quaternion::rotation_z(-0.40);
next.main.position = Vec3::new(8.0, 12.0, -6.0);
next.main.orientation = Quaternion::rotation_x(0.2)
* Quaternion::rotation_y(-0.75)
* Quaternion::rotation_z(PI - 0.2);
let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
Some(StageSection::Action) => (1.0, anim_time, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
_ => (0.0, 0.0, 0.0),
};
next.hand_r.position = Vec3::new(
s_a.ahr.0 + move1 * 5.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahr.1 + move1 * 8.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahr.2 + move1 * 3.0 + move2 * 0.0 + move3 * 0.0,
);
},
"Melodica" => {
next.hand_l.position = Vec3::new(-3.0, 6.0, 3.5);
next.hand_l.orientation = Quaternion::rotation_x(2.0)
* Quaternion::rotation_y(-0.75)
* Quaternion::rotation_z(0.40);
next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
next.hand_r.orientation = Quaternion::rotation_x(1.0)
* Quaternion::rotation_y(0.75)
* Quaternion::rotation_z(-0.40);
next.main.position = Vec3::new(-1.0, 2.0, 15.0);
next.main.orientation = Quaternion::rotation_x(0.3)
* Quaternion::rotation_y(PI)
* Quaternion::rotation_z(PI / -2.0);
let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
Some(StageSection::Action) => (1.0, anim_time, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
_ => (0.0, 0.0, 0.0),
};
next.hand_r.position = Vec3::new(
s_a.ahr.0 + move1 * 5.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahr.1 + move1 * 8.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahr.2 + move1 * 1.0 + move2 * 0.0 + move3 * 0.0,
);
},
_ => {
next.hand_l.position = Vec3::new(-4.0, 6.0, 2.0);
next.hand_l.orientation = Quaternion::rotation_x(1.00)
* Quaternion::rotation_y(-0.75)
* Quaternion::rotation_z(0.20);
next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
next.hand_r.orientation = Quaternion::rotation_x(1.75)
* Quaternion::rotation_y(0.75)
* Quaternion::rotation_z(-0.40);
next.main.position = Vec3::new(8.0, 14.0, -6.0);
next.main.orientation = Quaternion::rotation_x(0.2)
* Quaternion::rotation_y(-0.75)
* Quaternion::rotation_z(0.20);
let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
Some(StageSection::Action) => (1.0, anim_time, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
_ => (0.0, 0.0, 0.0),
};
next.hand_r.position = Vec3::new(
s_a.ahr.0 + move1 * 5.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahr.1 + move1 * 8.0 + move2 * 0.0 + move3 * 0.0,
s_a.ahr.2 + move1 * 3.0 + move2 * 0.0 + move3 * 0.0,
);
},
}
}
},
Some(ToolKind::Hammer) | Some(ToolKind::Pick) => {
let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),

View File

@ -15,6 +15,7 @@ pub mod idle;
pub mod jump;
pub mod leapmelee;
pub mod mount;
pub mod music;
pub mod repeater;
pub mod roll;
pub mod run;
@ -41,7 +42,7 @@ pub use self::{
chargeswing::ChargeswingAnimation, climb::ClimbAnimation, collect::CollectAnimation,
consume::ConsumeAnimation, dance::DanceAnimation, dash::DashAnimation, equip::EquipAnimation,
glidewield::GlideWieldAnimation, gliding::GlidingAnimation, idle::IdleAnimation,
jump::JumpAnimation, leapmelee::LeapAnimation, mount::MountAnimation,
jump::JumpAnimation, leapmelee::LeapAnimation, mount::MountAnimation, music::MusicAnimation,
repeater::RepeaterAnimation, roll::RollAnimation, run::RunAnimation,
shockwave::ShockwaveAnimation, shoot::ShootAnimation, sit::SitAnimation, sneak::SneakAnimation,
sneakequip::SneakEquipAnimation, sneakwield::SneakWieldAnimation, spin::SpinAnimation,

View File

@ -0,0 +1,335 @@
use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::{
comp::item::{AbilitySpec, Hands, ToolKind},
states::utils::AbilityInfo,
};
use std::{f32::consts::PI, ops::Mul};
pub struct MusicAnimation;
type MusicAnimationDependency<'a> = (
(Option<Hands>, Option<Hands>),
(Option<AbilityInfo>, Option<&'a AbilitySpec>, f32),
);
impl Animation for MusicAnimation {
type Dependency<'a> = MusicAnimationDependency<'a>;
type Skeleton = CharacterSkeleton;
#[cfg(feature = "use-dyn-lib")]
const UPDATE_FN: &'static [u8] = b"character_music\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_music")]
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(_hands, (ability_info, active_tool_spec, global_time)): Self::Dependency<'a>,
anim_time: f32,
rate: &mut f32,
s_a: &SkeletonAttr,
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
*rate = 2.0;
let lab: f32 = 1.0;
let short = ((5.0 / (3.0 + 2.0 * ((anim_time * lab * 6.0).sin()).powi(2))).sqrt())
* ((anim_time * lab * 6.0).sin());
let noisea = (anim_time * 11.0 + PI / 6.0).sin();
let noiseb = (anim_time * 19.0 + PI / 4.0).sin();
let shorte = (anim_time * lab * 6.0).sin();
let shortealt = (anim_time * lab * 6.0 + PI / 2.0).sin();
let foot = ((0.1 / (1.0 + (4.0) * ((anim_time * lab * 8.0).sin()).powi(2))).sqrt())
* ((anim_time * lab * 8.0).sin());
// common animations
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + shortealt * 1.5);
next.chest.orientation = Quaternion::rotation_z(short * 0.35)
* Quaternion::rotation_y(shorte * 0.08)
* Quaternion::rotation_x(foot * 0.07);
next.belt.position = Vec3::new(0.0, s_a.belt.0, s_a.belt.1);
next.belt.orientation = Quaternion::rotation_z(shorte * 0.25);
next.back.position = Vec3::new(0.0, s_a.back.0, s_a.back.1);
next.back.orientation =
Quaternion::rotation_x(-0.25 + shorte * 0.1 + noisea * 0.1 + noiseb * 0.1);
next.shorts.position = Vec3::new(0.0, s_a.shorts.0, s_a.shorts.1);
next.shorts.orientation = Quaternion::rotation_z(foot * 0.35);
next.foot_l.position = Vec3::new(
-s_a.foot.0 + foot * 0.8,
1.5 + -s_a.foot.1 + foot * -4.0,
s_a.foot.2,
);
next.foot_l.orientation =
Quaternion::rotation_x(foot * -0.3) * Quaternion::rotation_z(short * -0.15);
next.foot_r.position = Vec3::new(
s_a.foot.0 + foot * 0.8,
1.5 + -s_a.foot.1 + foot * 4.0,
s_a.foot.2,
);
next.foot_r.orientation =
Quaternion::rotation_x(foot * 0.3) * Quaternion::rotation_z(short * 0.15);
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_l.orientation = Quaternion::rotation_x(shorte * 0.15);
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_r.orientation = Quaternion::rotation_x(shorte * -0.15);
next.lantern.orientation =
Quaternion::rotation_x(shorte * 0.7 + 0.4) * Quaternion::rotation_y(shorte * 0.4);
next.torso.position = Vec3::new(0.0, -3.3, 0.0);
next.torso.orientation = Quaternion::rotation_z(short * -0.2);
let head_look = Vec2::new(
(global_time + anim_time / 6.0).floor().mul(7331.0).sin() * 0.3,
(global_time + anim_time / 6.0).floor().mul(1337.0).sin() * 0.15,
);
// TODO: create Instrument SubToolKinds to distinguish instruments
match ability_info.and_then(|a| a.tool) {
Some(ToolKind::Instrument) => {
if let Some(AbilitySpec::Custom(spec)) = active_tool_spec {
// instrument specific head_bop
let head_bop = match spec.as_str() {
"Flute" | "Melodica" => 0.2,
"Guitar" | "Lute" | "Sitar" => 0.5,
"Harp" | "Kalimba" => 0.3,
_ => 1.0,
};
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.head.orientation = Quaternion::rotation_z((short * head_bop) * -0.6)
* Quaternion::rotation_x(
0.2 + head_look.y.max(0.0) + (shorte * head_bop).abs() * -0.2,
);
// instrument specific hand and instrument animations
match spec.as_str() {
"Bass" => {
next.hand_l.position = Vec3::new(
3.5 - s_a.hand.0,
7.0 + s_a.hand.1 + shortealt * -3.0,
8.0 + s_a.hand.2 + shortealt * -0.75,
);
next.hand_l.orientation = Quaternion::rotation_x(2.4 + foot * 0.15)
* Quaternion::rotation_y(-0.5);
next.hand_r.position = Vec3::new(
-2.0 + s_a.hand.0,
4.0 + s_a.hand.1 + shortealt * 6.0,
4.0 + s_a.hand.2 + shortealt * 0.75,
);
next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15)
* Quaternion::rotation_y(0.4);
next.main.position = Vec3::new(-4.0, 6.0, 16.0);
next.main.orientation = Quaternion::rotation_x(0.1)
* Quaternion::rotation_y(3.0)
* Quaternion::rotation_z(PI / -3.0);
},
"Flute" => {
next.hand_l.position = Vec3::new(
4.0 - s_a.hand.0,
6.0 + s_a.hand.1 + shortealt * -0.5,
4.0 + s_a.hand.2 + shortealt * -0.75,
);
next.hand_l.orientation = Quaternion::rotation_x(2.4 + foot * 0.15)
* Quaternion::rotation_y(-0.9);
next.hand_r.position = Vec3::new(
-4.5 + s_a.hand.0,
4.0 + s_a.hand.1 + shortealt * 2.0,
2.0 + s_a.hand.2 + shortealt * 0.75,
);
next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15)
* Quaternion::rotation_y(0.6);
next.main.position = Vec3::new(-2.5, 10.0, -11.0);
next.main.orientation = Quaternion::rotation_x(3.5)
* Quaternion::rotation_y(PI)
* Quaternion::rotation_z(0.05);
},
"Guitar" => {
next.hand_l.position = Vec3::new(
1.0 - s_a.hand.0,
6.0 + s_a.hand.1 + shortealt * -1.0,
2.0 + s_a.hand.2 + shortealt * -1.5,
);
next.hand_l.orientation = Quaternion::rotation_x(1.8 + foot * 0.15)
* Quaternion::rotation_y(-0.6)
* Quaternion::rotation_z(0.8);
next.hand_r.position = Vec3::new(
-2.0 + s_a.hand.0 - shortealt * 1.25,
6.0 + s_a.hand.1 + shortealt * 2.0,
3.0 + s_a.hand.2 + shortealt * 0.25,
);
next.hand_r.orientation = Quaternion::rotation_x(1.0 + foot * -0.15)
* Quaternion::rotation_y(0.6);
next.main.position = Vec3::new(-14.0, 6.0, 5.0);
next.main.orientation = Quaternion::rotation_x(0.1)
* Quaternion::rotation_y(2.0)
* Quaternion::rotation_z(PI / -3.0);
},
"Harp" => {
next.hand_l.position = Vec3::new(
3.0 - s_a.hand.0,
4.0 + s_a.hand.1 + shortealt * -0.1,
1.0 + s_a.hand.2 + shortealt * -0.2,
);
next.hand_l.orientation = Quaternion::rotation_x(1.4 + foot * 0.15)
* Quaternion::rotation_y(-0.6);
next.hand_r.position = Vec3::new(
-4.0 + s_a.hand.0 + shortealt * 2.0,
5.0 + s_a.hand.1 - shortealt * 3.0,
2.0 + s_a.hand.2 + shortealt * 0.75,
);
next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15)
* Quaternion::rotation_y(0.9);
next.main.position = Vec3::new(8.0, 14.0, -6.0);
next.main.orientation = Quaternion::rotation_x(0.2)
* Quaternion::rotation_y(-0.75)
* Quaternion::rotation_z(0.20);
},
"Kalimba" => {
next.hand_l.position = Vec3::new(
3.0 - s_a.hand.0,
4.0 + s_a.hand.1 + shortealt * -0.1,
1.0 + s_a.hand.2 + shortealt * -0.2,
);
next.hand_l.orientation = Quaternion::rotation_x(1.4 + foot * 0.15)
* Quaternion::rotation_y(-0.6);
next.hand_r.position = Vec3::new(
-2.0 + s_a.hand.0 + shortealt * 2.0,
5.0 + s_a.hand.1 - shortealt * 3.0,
2.0 + s_a.hand.2 + shortealt * 0.75,
);
next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15)
* Quaternion::rotation_y(0.9);
next.main.position = Vec3::new(8.0, 12.0, -8.0);
next.main.orientation = Quaternion::rotation_x(0.2)
* Quaternion::rotation_y(-0.75)
* Quaternion::rotation_z(PI - 0.2);
},
"Lute" => {
next.hand_l.position = Vec3::new(
2.0 - s_a.hand.0,
5.0 + s_a.hand.1 + shortealt * -1.0,
2.0 + s_a.hand.2 + shortealt * -1.5,
);
next.hand_l.orientation = Quaternion::rotation_x(1.8 + foot * 0.15)
* Quaternion::rotation_y(-0.6)
* Quaternion::rotation_z(0.8);
next.hand_r.position = Vec3::new(
-1.0 + s_a.hand.0 - shortealt * 1.25,
6.0 + s_a.hand.1 + shortealt * 2.0,
2.0 + s_a.hand.2 + shortealt * 0.25,
);
next.hand_r.orientation = Quaternion::rotation_x(1.0 + foot * -0.15)
* Quaternion::rotation_y(0.6);
next.main.position = Vec3::new(-14.0, 6.0, 4.0);
next.main.orientation = Quaternion::rotation_x(0.1)
* Quaternion::rotation_y(2.0)
* Quaternion::rotation_z(PI / -3.0);
},
"Melodica" => {
next.hand_l.position = Vec3::new(
4.0 - s_a.hand.0,
6.0 + s_a.hand.1 + shortealt * -0.5,
4.0 + s_a.hand.2 + shortealt * -0.75,
);
next.hand_l.orientation = Quaternion::rotation_x(2.4 + foot * 0.15)
* Quaternion::rotation_y(-0.9);
next.hand_r.position = Vec3::new(
-3.5 + s_a.hand.0,
4.0 + s_a.hand.1 + shortealt * 2.0,
2.0 + s_a.hand.2 + shortealt * 0.75,
);
next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15)
* Quaternion::rotation_y(0.6);
next.main.position = Vec3::new(-1.0, 2.0, 16.0);
next.main.orientation = Quaternion::rotation_x(0.3)
* Quaternion::rotation_y(PI)
* Quaternion::rotation_z(PI / -2.0);
},
"Perc" => {
next.hand_l.position = Vec3::new(
3.0 - s_a.hand.0,
4.0 + s_a.hand.1 + shortealt * -0.1,
1.0 + s_a.hand.2 + shortealt * -0.2,
);
next.hand_l.orientation = Quaternion::rotation_x(1.4 + foot * 0.15)
* Quaternion::rotation_y(-0.6);
next.hand_r.position = Vec3::new(
-4.0 + s_a.hand.0 + shortealt * 2.0,
5.0 + s_a.hand.1 - shortealt * 3.0,
2.0 + s_a.hand.2 + shortealt * 0.75,
);
next.hand_r.orientation = Quaternion::rotation_x(1.4 + foot * -0.15)
* Quaternion::rotation_y(0.9);
next.main.position = Vec3::new(8.0, 14.0, -6.0);
next.main.orientation = Quaternion::rotation_x(0.2)
* Quaternion::rotation_y(-0.75)
* Quaternion::rotation_z(0.20);
},
"Sitar" => {
next.hand_l.position = Vec3::new(
2.0 - s_a.hand.0,
6.0 + s_a.hand.1 + shortealt * -1.0,
1.0 + s_a.hand.2 + shortealt * -1.5,
);
next.hand_l.orientation = Quaternion::rotation_x(1.8 + foot * 0.15)
* Quaternion::rotation_y(-0.6)
* Quaternion::rotation_z(0.8);
next.hand_r.position = Vec3::new(
-2.0 + s_a.hand.0 - shortealt * 1.25,
6.0 + s_a.hand.1 + shortealt * 2.0,
2.0 + s_a.hand.2 + shortealt * 0.25,
);
next.hand_r.orientation = Quaternion::rotation_x(1.0 + foot * -0.15)
* Quaternion::rotation_y(0.6);
next.main.position = Vec3::new(-14.0, 6.0, 4.0);
next.main.orientation = Quaternion::rotation_x(0.1)
* Quaternion::rotation_y(2.0)
* Quaternion::rotation_z(PI / -3.0);
},
_ => {},
}
}
},
_ => {},
}
if skeleton.holding_lantern {
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1 + 5.0, s_a.hand.2 + 12.0);
next.hand_r.orientation = Quaternion::rotation_x(2.25) * Quaternion::rotation_z(0.9);
next.lantern.position = Vec3::new(-0.5, -0.5, 5.5);
next.lantern.orientation = next.hand_r.orientation.inverse();
}
next
}
}

View File

@ -295,7 +295,8 @@ impl Animation for WieldAnimation {
next.hand_l.orientation =
Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI);
next.hand_r.position = Vec3::new(-4.0, 2.0, 6.0);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_z(PI / 2.0);
next.main.position = Vec3::new(-2.0, 10.0, 12.0);
next.main.orientation = Quaternion::rotation_y(PI);
@ -311,7 +312,7 @@ impl Animation for WieldAnimation {
0.0 + head_look.y.abs() + look_dir.z * 0.7,
);
}
next.hand_l.position = Vec3::new(-1.0, 2.0, -2.0);
next.hand_l.position = Vec3::new(-1.0, 4.0, -1.0);
next.hand_l.orientation = Quaternion::rotation_x(2.5)
* Quaternion::rotation_y(0.9)
* Quaternion::rotation_z(PI);
@ -338,8 +339,9 @@ impl Animation for WieldAnimation {
* Quaternion::rotation_y(0.7)
* Quaternion::rotation_y(0.25)
* Quaternion::rotation_z(PI);
next.hand_r.position = Vec3::new(-2.0, 2.0, 6.0);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.hand_r.position = Vec3::new(-2.0, 4.0, 5.0);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_z(PI / 2.0);
next.main.position = Vec3::new(-14.0, 4.0, -6.0);
next.main.orientation = Quaternion::rotation_x(-0.2)
* Quaternion::rotation_y(1.2)
@ -361,7 +363,8 @@ impl Animation for WieldAnimation {
next.hand_l.orientation =
Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI);
next.hand_r.position = Vec3::new(-4.0, 2.0, 6.0);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_z(PI / 2.0);
next.main.position = Vec3::new(-2.0, 10.0, 12.0);
next.main.orientation = Quaternion::rotation_y(PI);
@ -377,12 +380,13 @@ impl Animation for WieldAnimation {
0.0 + head_look.y.abs() + look_dir.z * 0.7,
);
}
next.hand_l.position = Vec3::new(-2.0, 2.0, -4.0);
next.hand_l.position = Vec3::new(0.0, 2.0, -4.0);
next.hand_l.orientation =
Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI);
next.hand_r.position = Vec3::new(-4.0, 2.0, 6.0);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.main.position = Vec3::new(-2.0, 7.0, 12.0);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_z(PI / 2.0);
next.main.position = Vec3::new(0.0, 7.0, 12.0);
next.main.orientation =
Quaternion::rotation_y(PI) * Quaternion::rotation_z(PI);
@ -404,7 +408,33 @@ impl Animation for WieldAnimation {
* Quaternion::rotation_y(0.25)
* Quaternion::rotation_z(PI);
next.hand_r.position = Vec3::new(-5.0, 2.0, 6.0);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_z(PI / 2.0);
next.main.position = Vec3::new(-2.0, 4.0, -12.0);
next.main.orientation = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(0.2)
* Quaternion::rotation_z(-1.3);
next.control.position = Vec3::new(-2.0 + slow * 0.5, 0.5, 0.8);
next.control.orientation = Quaternion::rotation_x(u_slow * 0.1)
* Quaternion::rotation_y(2.0 + u_slow * 0.1)
* Quaternion::rotation_z(u_slowalt * 0.1);
},
"Guitar" => {
if speed < 0.5 {
next.head.orientation = Quaternion::rotation_z(head_look.x)
* Quaternion::rotation_x(
0.0 + head_look.y.abs() + look_dir.z * 0.7,
);
}
next.hand_l.position = Vec3::new(0.0, 5.0, -4.0);
next.hand_l.orientation = Quaternion::rotation_x((PI / 2.0) + 0.3)
* Quaternion::rotation_y(0.7)
* Quaternion::rotation_y(0.25)
* Quaternion::rotation_z(PI);
next.hand_r.position = Vec3::new(-5.0, 2.0, 6.0);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_z(PI / 2.0);
next.main.position = Vec3::new(-2.0, 4.0, -12.0);
next.main.orientation = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(0.2)
@ -454,7 +484,8 @@ impl Animation for WieldAnimation {
* Quaternion::rotation_y(0.25)
* Quaternion::rotation_z(PI);
next.hand_r.position = Vec3::new(-5.0, 2.0, 6.0);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_z(PI / 2.0);
next.main.position = Vec3::new(-2.0, 4.0, -12.0);
next.main.orientation = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(0.2)

View File

@ -370,6 +370,7 @@ pub fn ability_image(imgs: &img_ids::Imgs, ability_id: &str) -> image::Id {
"common.abilities.music.kalimba" => imgs.instrument,
"common.abilities.music.melodica" => imgs.instrument,
"common.abilities.music.lute" => imgs.instrument,
"common.abilities.music.guitar" => imgs.instrument,
"common.abilities.music.sitar" => imgs.instrument,
_ => imgs.not_found,
}

View File

@ -1151,7 +1151,7 @@ impl FigureMgr {
(
hands,
Some(s.stage_section),
(Some(s.static_data.ability_info), None),
Some(s.static_data.ability_info),
),
stage_progress,
&mut state_animation_rate,
@ -1331,7 +1331,7 @@ impl FigureMgr {
CharacterState::Boost(_) => {
anim::character::AlphaAnimation::update_skeleton(
&target_base,
(hands, None, (None, None)),
(hands, None, None),
state.state_time,
&mut state_animation_rate,
skeleton_attr,
@ -1589,7 +1589,7 @@ impl FigureMgr {
(
hands,
Some(s.stage_section),
(Some(s.static_data.ability_info), None),
Some(s.static_data.ability_info),
),
stage_progress,
&mut state_animation_rate,
@ -1833,27 +1833,13 @@ impl FigureMgr {
)
},
CharacterState::Music(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::Action => {
stage_time / s.static_data.play_duration.as_secs_f32()
},
StageSection::Recover => {
stage_time / s.static_data.recover_duration.as_secs_f32()
},
_ => 0.0,
};
anim::character::AlphaAnimation::update_skeleton(
anim::character::MusicAnimation::update_skeleton(
&target_base,
(
hands,
Some(s.stage_section),
(Some(s.static_data.ability_info), active_tool_spec),
(Some(s.static_data.ability_info), active_tool_spec, time),
),
stage_progress,
state.state_time,
&mut state_animation_rate,
skeleton_attr,
)