mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
47 lines
1.3 KiB
Rust
47 lines
1.3 KiB
Rust
use crate::{comp::PoiseChange, uid::Uid, Damage, GroupTarget, Knockback};
|
|
use serde::{Deserialize, Serialize};
|
|
use specs::{Component, DerefFlaggedStorage};
|
|
use specs_idvs::IdvStorage;
|
|
use std::time::Duration;
|
|
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
pub struct Properties {
|
|
pub angle: f32,
|
|
pub vertical_angle: f32,
|
|
pub speed: f32,
|
|
pub effects: Vec<(Option<GroupTarget>, Damage, PoiseChange)>,
|
|
pub knockback: Knockback,
|
|
pub requires_ground: bool,
|
|
pub duration: Duration,
|
|
pub owner: Option<Uid>,
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
pub struct Shockwave {
|
|
pub properties: Properties,
|
|
#[serde(skip)]
|
|
/// Time that the shockwave was created at
|
|
/// Used to calculate shockwave propagation
|
|
/// Deserialized from the network as `None`
|
|
pub creation: Option<f64>,
|
|
}
|
|
|
|
impl Component for Shockwave {
|
|
type Storage = DerefFlaggedStorage<Self, IdvStorage<Self>>;
|
|
}
|
|
|
|
impl std::ops::Deref for Shockwave {
|
|
type Target = Properties;
|
|
|
|
fn deref(&self) -> &Properties { &self.properties }
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
pub struct ShockwaveHitEntities {
|
|
pub hit_entities: Vec<Uid>,
|
|
}
|
|
|
|
impl Component for ShockwaveHitEntities {
|
|
type Storage = IdvStorage<Self>;
|
|
}
|