diff --git a/common/src/comp/inventory/item.rs b/common/src/comp/inventory/item.rs index 27549b101e..2636d0a245 100644 --- a/common/src/comp/inventory/item.rs +++ b/common/src/comp/inventory/item.rs @@ -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 { + 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)]