veloren_common/comp/
pool.rs

1use crate::{
2    combat::Attack,
3    comp::ability::Dodgeable,
4    resources::{Secs, Time},
5    uid::Uid,
6};
7use serde::{Deserialize, Serialize};
8use specs::Component;
9
10#[derive(Clone, Debug, Serialize, Deserialize)]
11pub struct PoolProperties {
12    pub attack: Attack,
13    /// Radius of the AOE
14    pub radius: f32,
15    /// How often the pool applies its attack
16    pub tick_dur: Secs,
17    /// Total lifespan of the pool before it despawns
18    pub duration: Secs,
19    #[serde(default)]
20    pub dodgeable: Dodgeable,
21}
22
23/// A lingering area-of-effect hazard.  Placed at impact point by
24/// projectiles with Effect::Pool  
25//  Each tick it performs a line-of-sight check against entities in range
26#[derive(Clone, Debug, Serialize, Deserialize)]
27pub struct Pool {
28    pub properties: PoolProperties,
29    pub start_time: Time,
30    pub last_tick: Time,
31    pub owner: Option<Uid>,
32}
33
34impl Component for Pool {
35    type Storage = specs::DerefFlaggedStorage<Self, specs::DenseVecStorage<Self>>;
36}