mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
fdfab6a807
It returns a builder so the caller can just do it
18 lines
414 B
Rust
18 lines
414 B
Rust
use crate::comp;
|
|
|
|
/// An effect that may be applied to an entity
|
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
|
pub enum Effect {
|
|
Health(comp::HealthChange),
|
|
Xp(i64),
|
|
}
|
|
|
|
impl Effect {
|
|
pub fn info(&self) -> String {
|
|
match self {
|
|
Effect::Health(c) => format!("{:+} health", c.amount),
|
|
Effect::Xp(n) => format!("{:+} exp", n),
|
|
}
|
|
}
|
|
}
|