mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Consolidated Use into Action as well.
This commit is contained in:
parent
5f37509a78
commit
52ee598cf1
@ -82,7 +82,7 @@ impl CharacterBehavior for Data {
|
||||
update.character = CharacterState::UseItem(Data {
|
||||
static_data: self.static_data.clone(),
|
||||
timer: Duration::default(),
|
||||
stage_section: StageSection::Use,
|
||||
stage_section: StageSection::Action,
|
||||
});
|
||||
if let UsePoint::BuildupUse = use_point {
|
||||
// Create inventory manipulation event
|
||||
@ -90,7 +90,7 @@ impl CharacterBehavior for Data {
|
||||
}
|
||||
}
|
||||
},
|
||||
StageSection::Use => {
|
||||
StageSection::Action => {
|
||||
if self.timer < self.static_data.use_duration {
|
||||
// Item use
|
||||
update.character = CharacterState::UseItem(Data {
|
||||
|
@ -921,7 +921,6 @@ pub enum StageSection {
|
||||
Charge,
|
||||
Movement,
|
||||
Action,
|
||||
Use,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
|
||||
|
@ -30,7 +30,7 @@ impl Animation for ConsumeAnimation {
|
||||
Some(ItemUseKind::Consumable(ConsumableKind::Drink)) => {
|
||||
let (move1, move2, move3) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
|
||||
Some(StageSection::Use) => (1.0, (anim_time * 8.0).sin(), 0.0),
|
||||
Some(StageSection::Action) => (1.0, (anim_time * 8.0).sin(), 0.0),
|
||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powf(0.25)),
|
||||
_ => (0.0, 0.0, 0.0),
|
||||
};
|
||||
@ -59,7 +59,7 @@ impl Animation for ConsumeAnimation {
|
||||
Some(ItemUseKind::Consumable(ConsumableKind::Food | ConsumableKind::ComplexFood)) => {
|
||||
let (move1, move2, move3) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
|
||||
Some(StageSection::Use) => (1.0, (anim_time * 12.0).sin(), 0.0),
|
||||
Some(StageSection::Action) => (1.0, (anim_time * 12.0).sin(), 0.0),
|
||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powf(0.25)),
|
||||
_ => (0.0, 0.0, 0.0),
|
||||
};
|
||||
|
@ -1462,7 +1462,7 @@ impl FigureMgr {
|
||||
StageSection::Buildup => {
|
||||
stage_time / s.static_data.buildup_duration.as_secs_f32()
|
||||
},
|
||||
StageSection::Use => stage_time,
|
||||
StageSection::Action => stage_time,
|
||||
StageSection::Recover => {
|
||||
stage_time / s.static_data.recover_duration.as_secs_f32()
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user