2023-10-14 22:23:06 +11:00
|
|
|
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,
|
2023-10-16 22:18:03 +11:00
|
|
|
Bleed,
|
2023-10-14 22:23:06 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
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 (explicit, non explicit) message.
|
|
|
|
BroadcastMessage {
|
|
|
|
delay_secs: u64,
|
|
|
|
messagef: Box<dyn Fn(&Item, &Item, &Item) -> (String, 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, String) + Sync + Send>,
|
|
|
|
},
|
|
|
|
}
|