mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
TripleAttack -> TimedCombo
(it wasnt the right logic for the tiple attack)
This commit is contained in:
parent
a3fc3c3122
commit
a64bf1ac60
@ -6,7 +6,7 @@ pub enum AbilityState {
|
|||||||
BasicBlock,
|
BasicBlock,
|
||||||
Roll,
|
Roll,
|
||||||
ChargeAttack,
|
ChargeAttack,
|
||||||
TripleAttack,
|
TimedCombo,
|
||||||
}
|
}
|
||||||
impl Default for AbilityState {
|
impl Default for AbilityState {
|
||||||
fn default() -> Self { Self::BasicAttack }
|
fn default() -> Self { Self::BasicAttack }
|
||||||
@ -28,7 +28,7 @@ impl Default for AbilityPool {
|
|||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
primary: Some(AbilityState::BasicAttack),
|
primary: Some(AbilityState::BasicAttack),
|
||||||
// primary: Some(AbilityState::TripleAttack),
|
// primary: Some(AbilityState::TimedCombo),
|
||||||
secondary: Some(AbilityState::BasicBlock),
|
secondary: Some(AbilityState::BasicBlock),
|
||||||
block: None,
|
block: None,
|
||||||
dodge: Some(AbilityState::Roll),
|
dodge: Some(AbilityState::Roll),
|
||||||
|
@ -52,7 +52,7 @@ pub enum CharacterState {
|
|||||||
},
|
},
|
||||||
/// A three-stage attack where play must click at appropriate times
|
/// A three-stage attack where play must click at appropriate times
|
||||||
/// to continue attack chain.
|
/// to continue attack chain.
|
||||||
TripleAttack {
|
TimedCombo {
|
||||||
/// The tool this state will read to handle damage, etc.
|
/// The tool this state will read to handle damage, etc.
|
||||||
tool: ToolData,
|
tool: ToolData,
|
||||||
/// `int` denoting what stage (of 3) the attack is in.
|
/// `int` denoting what stage (of 3) the attack is in.
|
||||||
|
@ -8,6 +8,6 @@ pub mod glide;
|
|||||||
pub mod idle;
|
pub mod idle;
|
||||||
pub mod roll;
|
pub mod roll;
|
||||||
pub mod sit;
|
pub mod sit;
|
||||||
pub mod triple_attack;
|
pub mod timed_combo;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
pub mod wielding;
|
pub mod wielding;
|
||||||
|
@ -16,7 +16,7 @@ pub fn behavior(data: &JoinData) -> StateUpdate {
|
|||||||
server_events: VecDeque::new(),
|
server_events: VecDeque::new(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if let CharacterState::TripleAttack {
|
if let CharacterState::TimedCombo {
|
||||||
tool,
|
tool,
|
||||||
stage,
|
stage,
|
||||||
stage_time_active,
|
stage_time_active,
|
||||||
@ -55,7 +55,7 @@ pub fn behavior(data: &JoinData) -> StateUpdate {
|
|||||||
|
|
||||||
if new_stage_time_active > tool.attack_duration() {
|
if new_stage_time_active > tool.attack_duration() {
|
||||||
if new_can_transition {
|
if new_can_transition {
|
||||||
update.character = CharacterState::TripleAttack {
|
update.character = CharacterState::TimedCombo {
|
||||||
tool: *tool,
|
tool: *tool,
|
||||||
stage: 2,
|
stage: 2,
|
||||||
stage_time_active: Duration::default(),
|
stage_time_active: Duration::default(),
|
||||||
@ -67,7 +67,7 @@ pub fn behavior(data: &JoinData) -> StateUpdate {
|
|||||||
attempt_wield(data, &mut update);
|
attempt_wield(data, &mut update);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
update.character = CharacterState::TripleAttack {
|
update.character = CharacterState::TimedCombo {
|
||||||
tool: *tool,
|
tool: *tool,
|
||||||
stage: 1,
|
stage: 1,
|
||||||
stage_time_active: new_stage_time_active,
|
stage_time_active: new_stage_time_active,
|
@ -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.
|
// initialization gets too lengthy.
|
||||||
|
|
||||||
/// Maps from `AbilityState`s to `CharacterStates`s. Also handles intializing
|
/// 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 {
|
AbilityState::ChargeAttack { .. } => CharacterState::ChargeAttack {
|
||||||
remaining_duration: Duration::from_millis(600),
|
remaining_duration: Duration::from_millis(600),
|
||||||
},
|
},
|
||||||
AbilityState::TripleAttack { .. } => {
|
AbilityState::TimedCombo { .. } => {
|
||||||
if let Some(tool) = unwrap_tool_data(data) {
|
if let Some(tool) = unwrap_tool_data(data) {
|
||||||
CharacterState::TripleAttack {
|
CharacterState::TimedCombo {
|
||||||
tool,
|
tool,
|
||||||
stage: 1,
|
stage: 1,
|
||||||
stage_time_active: Duration::default(),
|
stage_time_active: Duration::default(),
|
||||||
|
@ -177,7 +177,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
CharacterState::BasicBlock { .. } => states::basic_block::behavior(&j),
|
CharacterState::BasicBlock { .. } => states::basic_block::behavior(&j),
|
||||||
CharacterState::ChargeAttack { .. } => states::charge_attack::behavior(&j),
|
CharacterState::ChargeAttack { .. } => states::charge_attack::behavior(&j),
|
||||||
CharacterState::Sit { .. } => states::sit::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.
|
// Do not use default match.
|
||||||
// _ => StateUpdate {
|
// _ => StateUpdate {
|
||||||
|
Loading…
Reference in New Issue
Block a user