td

Artifact [2afa251f35]
Login

Artifact [2afa251f35]

Artifact 2afa251f3596498e2abe4493b57517d8925eebb3b56cc33a1000d44d9cd7d31b:


//! Shared domain value types — small `Copy`/`Clone` enums and structs that flow through
//! commands, contexts, and entities. Deliberately dependency-light so every other module
//! can lean on them without creating awkward import cycles.

use crate::{enemy::Corpse, world::EntityId};

pub type DamageType = i32;

/// Who fired the projectile / pool that's running a behavior. Drives kill attribution and
/// lets a drone's shots be told apart from the tower's.
#[derive(Clone, Copy, Debug)]
pub enum Source {
    Tower,
    None,
}

/// How a `Command::Damage` arrived — an instant on-hit tick vs. a status ticking over time.
/// Exists so downstream tracking (DPS meters) can bucket the two separately instead of
/// blending "one big hit" and "many small ticks" into one number that's hard to read either
/// way. Also the reason DoT damage goes through `Command::Damage` at all instead of a status
/// mutating the enemy directly: routing it through the same queue as everything else means a
/// future global player modifier (e.g. "+30% all damage") only has to hook one place to see
/// every damage event, tagged, rather than needing special-cased access to the status system.
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum DamageDelivery {
    Hit,
    Dot,
}

#[derive(Clone, Copy)]
pub struct DespawnReason;

#[derive(Clone)]
pub enum GameEvent {
    EnemyKilled(Corpse),
    DespawnEnemy(EntityId),
    Custom(String),
}

#[derive(Clone, Copy)]
pub enum ResourceKind {
    Wp,
    Sp,
    Tp,
}