From 8e27a07bd33f3f9617f3635f7c3103b81a7ca22d Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Thu, 12 Mar 2020 05:16:40 -0700 Subject: [PATCH] TripleAttack -> TimedCombo (it wasnt the right logic for the tiple attack) --- common/src/comp/ability.rs | 4 ++-- common/src/comp/character_state.rs | 2 +- common/src/states/mod.rs | 2 +- common/src/states/{triple_attack/mod.rs => timed_combo.rs} | 6 +++--- common/src/states/utils.rs | 6 +++--- common/src/sys/character_behavior.rs | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) rename common/src/states/{triple_attack/mod.rs => timed_combo.rs} (94%) diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index a6f9b41eef..bc10cc31d0 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -6,7 +6,7 @@ pub enum AbilityState { BasicBlock, Roll, ChargeAttack, - TripleAttack, + TimedCombo, } impl Default for AbilityState { fn default() -> Self { Self::BasicAttack } @@ -28,7 +28,7 @@ impl Default for AbilityPool { fn default() -> Self { Self { primary: Some(AbilityState::BasicAttack), - // primary: Some(AbilityState::TripleAttack), + // primary: Some(AbilityState::TimedCombo), secondary: Some(AbilityState::BasicBlock), block: None, dodge: Some(AbilityState::Roll), diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index cb3f239148..62716a3606 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -52,7 +52,7 @@ pub enum CharacterState { }, /// A three-stage attack where play must click at appropriate times /// to continue attack chain. - TripleAttack { + TimedCombo { /// The tool this state will read to handle damage, etc. tool: ToolData, /// `int` denoting what stage (of 3) the attack is in. diff --git a/common/src/states/mod.rs b/common/src/states/mod.rs index 530679e37a..322060ecfb 100644 --- a/common/src/states/mod.rs +++ b/common/src/states/mod.rs @@ -8,6 +8,6 @@ pub mod glide; pub mod idle; pub mod roll; pub mod sit; -pub mod triple_attack; +pub mod timed_combo; pub mod utils; pub mod wielding; diff --git a/common/src/states/triple_attack/mod.rs b/common/src/states/timed_combo.rs similarity index 94% rename from common/src/states/triple_attack/mod.rs rename to common/src/states/timed_combo.rs index dc14398de5..aa176ead02 100644 --- a/common/src/states/triple_attack/mod.rs +++ b/common/src/states/timed_combo.rs @@ -16,7 +16,7 @@ pub fn behavior(data: &JoinData) -> StateUpdate { server_events: VecDeque::new(), }; - if let CharacterState::TripleAttack { + if let CharacterState::TimedCombo { tool, stage, stage_time_active, @@ -55,7 +55,7 @@ pub fn behavior(data: &JoinData) -> StateUpdate { if new_stage_time_active > tool.attack_duration() { if new_can_transition { - update.character = CharacterState::TripleAttack { + update.character = CharacterState::TimedCombo { tool: *tool, stage: 2, stage_time_active: Duration::default(), @@ -67,7 +67,7 @@ pub fn behavior(data: &JoinData) -> StateUpdate { attempt_wield(data, &mut update); } } else { - update.character = CharacterState::TripleAttack { + update.character = CharacterState::TimedCombo { tool: *tool, stage: 1, stage_time_active: new_stage_time_active, diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index f127863d81..0859b83114 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -237,7 +237,7 @@ pub fn attempt_dodge_ability(data: &JoinData, update: &mut StateUpdate) { } } -// TODO: Wight need a fn `CharacterState::new(data, update)` if +// TODO: Might need a fn `CharacterState::new(data, update)` if // initialization gets too lengthy. /// Maps from `AbilityState`s to `CharacterStates`s. Also handles intializing @@ -261,9 +261,9 @@ pub fn ability_to_character_state(data: &JoinData, ability_state: AbilityState) AbilityState::ChargeAttack { .. } => CharacterState::ChargeAttack { remaining_duration: Duration::from_millis(600), }, - AbilityState::TripleAttack { .. } => { + AbilityState::TimedCombo { .. } => { if let Some(tool) = unwrap_tool_data(data) { - CharacterState::TripleAttack { + CharacterState::TimedCombo { tool, stage: 1, stage_time_active: Duration::default(), diff --git a/common/src/sys/character_behavior.rs b/common/src/sys/character_behavior.rs index 1a5accd49a..a50b4987d0 100644 --- a/common/src/sys/character_behavior.rs +++ b/common/src/sys/character_behavior.rs @@ -177,7 +177,7 @@ impl<'a> System<'a> for Sys { CharacterState::BasicBlock { .. } => states::basic_block::behavior(&j), CharacterState::ChargeAttack { .. } => states::charge_attack::behavior(&j), CharacterState::Sit { .. } => states::sit::behavior(&j), - CharacterState::TripleAttack { .. } => states::triple_attack::behavior(&j), + CharacterState::TimedCombo { .. } => states::triple_attack::behavior(&j), // Do not use default match. // _ => StateUpdate {