mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Animation for cast aura, combo information passed to skillbar.
This commit is contained in:
parent
b6f4543a14
commit
c5f74e528d
@ -36,7 +36,7 @@ impl Animation for ShockwaveAnimation {
|
|||||||
|
|
||||||
let (move1, move2, move3) = match stage_section {
|
let (move1, move2, move3) = match stage_section {
|
||||||
Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
|
Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
|
||||||
Some(StageSection::Swing) => (1.0, anim_time, 0.0),
|
Some(StageSection::Swing) | Some(StageSection::Cast) => (1.0, anim_time, 0.0),
|
||||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time),
|
Some(StageSection::Recover) => (1.0, 1.0, anim_time),
|
||||||
_ => (0.0, 0.0, 0.0),
|
_ => (0.0, 0.0, 0.0),
|
||||||
};
|
};
|
||||||
|
@ -2158,6 +2158,7 @@ impl Hud {
|
|||||||
let controllers = ecs.read_storage::<comp::Controller>();
|
let controllers = ecs.read_storage::<comp::Controller>();
|
||||||
let ability_map = ecs.fetch::<comp::item::tool::AbilityMap>();
|
let ability_map = ecs.fetch::<comp::item::tool::AbilityMap>();
|
||||||
let bodies = ecs.read_storage::<comp::Body>();
|
let bodies = ecs.read_storage::<comp::Body>();
|
||||||
|
let combos = ecs.read_storage::<comp::Combo>();
|
||||||
|
|
||||||
if let (
|
if let (
|
||||||
Some(health),
|
Some(health),
|
||||||
@ -2165,12 +2166,14 @@ impl Hud {
|
|||||||
Some(energy),
|
Some(energy),
|
||||||
Some(_character_state),
|
Some(_character_state),
|
||||||
Some(_controller),
|
Some(_controller),
|
||||||
|
Some(combo),
|
||||||
) = (
|
) = (
|
||||||
healths.get(entity),
|
healths.get(entity),
|
||||||
inventories.get(entity),
|
inventories.get(entity),
|
||||||
energies.get(entity),
|
energies.get(entity),
|
||||||
character_states.get(entity),
|
character_states.get(entity),
|
||||||
controllers.get(entity).map(|c| &c.inputs),
|
controllers.get(entity).map(|c| &c.inputs),
|
||||||
|
combos.get(entity),
|
||||||
) {
|
) {
|
||||||
Skillbar::new(
|
Skillbar::new(
|
||||||
global_state,
|
global_state,
|
||||||
@ -2190,6 +2193,7 @@ impl Hud {
|
|||||||
i18n,
|
i18n,
|
||||||
&ability_map,
|
&ability_map,
|
||||||
&msm,
|
&msm,
|
||||||
|
&combo,
|
||||||
)
|
)
|
||||||
.set(self.ids.skillbar, ui_widgets);
|
.set(self.ids.skillbar, ui_widgets);
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ use common::comp::{
|
|||||||
tool::{AbilityMap, Tool, ToolKind},
|
tool::{AbilityMap, Tool, ToolKind},
|
||||||
Hands, Item, ItemKind, MaterialStatManifest,
|
Hands, Item, ItemKind, MaterialStatManifest,
|
||||||
},
|
},
|
||||||
Energy, Health, Inventory,
|
Combo, Energy, Health, Inventory,
|
||||||
};
|
};
|
||||||
use conrod_core::{
|
use conrod_core::{
|
||||||
color,
|
color,
|
||||||
@ -141,6 +141,7 @@ pub struct Skillbar<'a> {
|
|||||||
common: widget::CommonBuilder,
|
common: widget::CommonBuilder,
|
||||||
ability_map: &'a AbilityMap,
|
ability_map: &'a AbilityMap,
|
||||||
msm: &'a MaterialStatManifest,
|
msm: &'a MaterialStatManifest,
|
||||||
|
combo: &'a Combo,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Skillbar<'a> {
|
impl<'a> Skillbar<'a> {
|
||||||
@ -163,6 +164,7 @@ impl<'a> Skillbar<'a> {
|
|||||||
localized_strings: &'a Localization,
|
localized_strings: &'a Localization,
|
||||||
ability_map: &'a AbilityMap,
|
ability_map: &'a AbilityMap,
|
||||||
msm: &'a MaterialStatManifest,
|
msm: &'a MaterialStatManifest,
|
||||||
|
combo: &'a Combo,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
global_state,
|
global_state,
|
||||||
@ -183,6 +185,7 @@ impl<'a> Skillbar<'a> {
|
|||||||
localized_strings,
|
localized_strings,
|
||||||
ability_map,
|
ability_map,
|
||||||
msm,
|
msm,
|
||||||
|
combo,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1099,6 +1099,34 @@ impl FigureMgr {
|
|||||||
skeleton_attr,
|
skeleton_attr,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
CharacterState::CastAura(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 => {
|
||||||
|
stage_time / s.static_data.cast_duration.as_secs_f32()
|
||||||
|
},
|
||||||
|
StageSection::Recover => {
|
||||||
|
stage_time / s.static_data.recover_duration.as_secs_f32()
|
||||||
|
},
|
||||||
|
_ => 0.0,
|
||||||
|
};
|
||||||
|
anim::character::ShockwaveAnimation::update_skeleton(
|
||||||
|
&target_base,
|
||||||
|
(
|
||||||
|
active_tool_kind,
|
||||||
|
second_tool_kind,
|
||||||
|
time,
|
||||||
|
vel.0.magnitude(),
|
||||||
|
Some(s.stage_section),
|
||||||
|
),
|
||||||
|
stage_progress,
|
||||||
|
&mut state_animation_rate,
|
||||||
|
skeleton_attr,
|
||||||
|
)
|
||||||
|
},
|
||||||
CharacterState::LeapMelee(s) => {
|
CharacterState::LeapMelee(s) => {
|
||||||
let stage_progress = match active_tool_kind {
|
let stage_progress = match active_tool_kind {
|
||||||
Some(ToolKind::Axe | ToolKind::Hammer) => {
|
Some(ToolKind::Axe | ToolKind::Hammer) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user