From 772f7ff92d37d96e46079cb01ffc4a2107ddf4ad Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Thu, 12 Mar 2020 07:33:19 -0700 Subject: [PATCH] Remove can_transition and begin triple_strike --- common/src/comp/character_state.rs | 2 -- common/src/states/triple_strike.rs | 45 ++---------------------------- 2 files changed, 2 insertions(+), 45 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 09c89e644a..f7b4e4dbd6 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -75,8 +75,6 @@ pub enum CharacterState { stage_time_active: Duration, /// Whether current stage has exhausted its attack stage_exhausted: bool, - /// Whether player has clicked at the proper time to go to next stage - can_transition: bool, }, } diff --git a/common/src/states/triple_strike.rs b/common/src/states/triple_strike.rs index a73a23152c..8bd24e5a05 100644 --- a/common/src/states/triple_strike.rs +++ b/common/src/states/triple_strike.rs @@ -40,49 +40,8 @@ pub fn behavior(data: &JoinData) -> StateUpdate { match stage { 1 => { - if new_stage_time_active > tool.attack_buildup_duration() { - if !*stage_exhausted { - // Try to deal damage - data.updater.insert(data.entity, Attacking { - weapon: Some(*tool), - applied: false, - hit_count: 0, - }); - new_stage_exhausted = true; - } else { - // Make sure to remove Attacking component - data.updater.remove::(data.entity); - } - - // Check if player has timed click right - if data.inputs.primary.is_just_pressed() { - println!("Can transition"); - new_can_transition = true; - } - } - - if new_stage_time_active > tool.attack_duration() { - if new_can_transition { - update.character = CharacterState::TimedCombo { - tool: *tool, - stage: 2, - stage_time_active: Duration::default(), - stage_exhausted: false, - can_transition: false, - } - } else { - println!("Failed"); - attempt_wield(data, &mut update); - } - } else { - update.character = CharacterState::TimedCombo { - tool: *tool, - stage: 1, - stage_time_active: new_stage_time_active, - stage_exhausted: new_stage_exhausted, - can_transition: new_can_transition, - } - } + println!("1"); + attempt_wield(data, &mut update); }, 2 => { println!("2");