mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
add ToolData::get_primary_abilities()
This commit is contained in:
parent
68dd8c578f
commit
00e4ad61f7
@ -1,5 +1,6 @@
|
||||
use crate::{
|
||||
assets::{self, Asset},
|
||||
comp::AbilityState,
|
||||
effect::Effect,
|
||||
terrain::{Block, BlockKind},
|
||||
};
|
||||
@ -7,7 +8,7 @@ use crate::{
|
||||
use rand::seq::SliceRandom;
|
||||
use specs::{Component, FlaggedStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use std::{fs::File, io::BufReader, time::Duration};
|
||||
use std::{fs::File, io::BufReader, time::Duration, vec::Vec};
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum SwordKind {
|
||||
@ -45,6 +46,22 @@ impl ToolData {
|
||||
pub fn attack_duration(&self) -> Duration {
|
||||
self.attack_buildup_duration() + self.attack_recover_duration()
|
||||
}
|
||||
|
||||
pub fn get_primary_abilities(&self) -> Vec<AbilityState> {
|
||||
use AbilityState::*;
|
||||
use SwordKind::*;
|
||||
use ToolKind::*;
|
||||
|
||||
let default_return = vec![AbilityState::default()];
|
||||
|
||||
match self.kind {
|
||||
Sword(kind) => match kind {
|
||||
Rapier => vec![TimedCombo { cost: -150 }],
|
||||
Scimitar => default_return,
|
||||
},
|
||||
_ => default_return,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
|
Loading…
Reference in New Issue
Block a user