use crate::{ combat::GroupTarget, comp::buff::{BuffCategory, BuffData, BuffKind, BuffSource}, resources::{Secs, Time}, uid::Uid, }; use serde::{Deserialize, Serialize}; use slotmap::{new_key_type, SlotMap}; use specs::{Component, DerefFlaggedStorage, VecStorage}; new_key_type! { pub struct AuraKey; } /// AuraKind is what kind of effect an aura applies /// Currently only buffs are implemented #[derive(Clone, Copy, Debug, Serialize, Deserialize)] pub enum AuraKind { /// The Buff kind is (surprise!) a buff :D Buff { kind: BuffKind, data: BuffData, category: BuffCategory, source: BuffSource, }, /* TODO: Implement other effects here. Things to think about * are terrain/sprite effects, collision and physics, and * environmental conditions like temperature and humidity * Multiple auras can be given to an entity. */ } /// Aura /// Applies a buff to entities in the radius if meeting /// conditions set forth in the aura system. #[derive(Clone, Debug, Serialize, Deserialize)] pub struct Aura { /// The kind of aura applied pub aura_kind: AuraKind, /// The radius of the aura pub radius: f32, // None corresponds to an indefinite aura pub end_time: Option