32 lines
870 B
Rust
32 lines
870 B
Rust
use super::item::Item;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(PartialEq, Eq, PartialOrd, Clone, Serialize, Deserialize, Debug, Ord)]
|
|
pub enum EffectType {
|
|
Ephemeral, // i.e. no enduring impact to show in status.
|
|
Bandages,
|
|
Bleed,
|
|
Stunned,
|
|
}
|
|
|
|
pub struct EffectSet {
|
|
pub effect_type: EffectType,
|
|
pub effects: Vec<Effect>,
|
|
}
|
|
|
|
pub enum Effect {
|
|
// messagef takes player, causative item, target as the 3 parameters. Returns message.
|
|
BroadcastMessage {
|
|
delay_secs: u64,
|
|
messagef: Box<dyn Fn(&Item, &Item, &Item) -> String + Sync + Send>,
|
|
},
|
|
// skill_multiplier is always positive - sign flipped for crit fails.
|
|
ChangeTargetHealth {
|
|
delay_secs: u64,
|
|
base_effect: i64,
|
|
skill_multiplier: f64,
|
|
max_effect: i64,
|
|
message: Box<dyn Fn(&Item) -> String + Sync + Send>,
|
|
},
|
|
}
|