veloren/common/src/comp/projectile.rs
Monty Marz fdfab6a807 refactor: create_projectile doesn't take a light
It returns a builder so the caller can just do it
2019-10-17 20:59:36 +00:00

28 lines
637 B
Rust

use crate::comp;
use crate::state::Uid;
use specs::{Component, FlaggedStorage};
use specs_idvs::IDVStorage;
use std::time::Duration;
#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum Effect {
Damage(comp::HealthChange),
Vanish,
Stick,
Possess,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Projectile {
pub owner: Uid,
pub hit_ground: Vec<Effect>,
pub hit_wall: Vec<Effect>,
pub hit_entity: Vec<Effect>,
/// Time left until the projectile will despawn
pub time_left: Duration,
}
impl Component for Projectile {
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}