TripleAttack -> TimedCombo

(it wasnt the right logic for the tiple attack)
This commit is contained in:
Adam Whitehurst 2020-03-12 05:16:40 -07:00
parent a3fc3c3122
commit a64bf1ac60
6 changed files with 11 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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