use crate::limits::LimitType;
use bevy::prelude::*;
#[derive(Message, Debug, Clone)]
pub struct SpendPowerEvent {
pub entity: Entity,
pub amount: f32,
}
#[derive(Message, Debug, Clone)]
pub struct PowerChangeEvent {
pub entity: Entity,
pub amount: f32,
}
#[derive(Message, Debug, Clone)]
pub struct ApplyLimitEvent {
pub entity: Entity,
pub id: u32,
pub limit_type: LimitType,
pub color: Color,
pub duration: Option<f32>,
pub resets_cooldown: bool,
}
impl ApplyLimitEvent {
pub fn points(
entity: Entity,
id: u32,
points: f32,
color: Color,
duration: Option<f32>,
resets_cooldown: bool,
) -> Self {
Self {
entity,
id,
limit_type: LimitType::Points(points),
color,
duration,
resets_cooldown,
}
}
pub fn percentage(
entity: Entity,
id: u32,
percentage: f32,
color: Color,
duration: Option<f32>,
resets_cooldown: bool,
) -> Self {
Self {
entity,
id,
limit_type: LimitType::Percentage(percentage),
color,
duration,
resets_cooldown,
}
}
}
#[derive(Message, Debug, Clone)]
pub struct LiftLimitEvent {
pub entity: Entity,
pub id: u32,
}
#[derive(Message, Debug, Clone)]
pub struct KnockedOutEvent {
pub entity: Entity,
}
#[derive(Message, Debug, Clone)]
pub struct ReviveEvent {
pub entity: Entity,
pub power_amount: f32,
}
#[derive(Message, Debug, Clone)]
pub struct LevelUpEvent {
pub entity: Entity,
pub new_level: u32,
pub power_bonus: f32,
}