Consolidated Use into Action as well.

This commit is contained in:
Sam 2021-08-09 10:31:17 -04:00
parent 5f37509a78
commit 52ee598cf1
4 changed files with 5 additions and 6 deletions

View File

@ -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 {

View File

@ -921,7 +921,6 @@ pub enum StageSection {
Charge,
Movement,
Action,
Use,
}
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]

View File

@ -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),
};

View File

@ -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()
},