namespace TD.Core
{
///
/// How a tower's attack damage is typed. Determines which lingering effect is applied
/// on hit and how enemy resistances/weaknesses are calculated (Phase 1.5+).
///
public enum DamageType : byte
{
Physical = 0,
Piercing = 1,
Cold = 2,
Fire = 3,
Poison = 4,
Holy = 5,
Electric = 6,
}
///
/// How a tower selects which enemy in range to attack.
///
public enum TargetPriority : byte
{
/// Nearest enemy to the tower's center.
Closest = 0,
/// Enemy with the lowest current HP.
Weakest = 1,
/// Enemy with the highest current HP.
Strongest = 2,
}
///
/// How a tower's damage is distributed across enemies.
/// Orthogonal to : any target type
/// can be delivered by a projectile or hitscan.
///
public enum TargetType : byte
{
/// Hits one enemy for full damage.
Single = 0,
/// Hits the primary target, then all enemies within SplashRadius.
Splash = 1,
/// Chains damage to up to ChainCount additional nearby enemies.
Chain = 2,
/// Hits EVERY enemy within the tower's Range each attack (e.g. Tesla Coil).
/// Hitscan only — pairs with a null ProjectilePrefab.
AllInRange = 3,
}
///
/// Paint color applied to a built tower by the Paint tool. Orthogonal to the owner's
/// player color: means "unpainted" and the tower shows its owner
/// color; any other value overrides the visual tint and (in a later iteration) drives
/// projectile behavior (splash / poison-DoT / slow). Backed by byte for compact
/// NetworkVariable replication.
///
public enum PaintColor : byte
{
/// Unpainted — tower shows its owner color. Also the Reset brush.
None = 0,
Red = 1,
Green = 2,
Blue = 3,
}
///
/// Identifies a player slot in a match. Backed by byte to keep grid arrays compact.
///
///
/// None is a sentinel value used in OwnerGrid to mark tiles not owned by any player zone.
/// Maps use a contiguous prefix of the player values.
///
/// The enum runs to 9, but only slots are ever
/// allocated. Lobbies capped at 3 for the 2.0 design; the surplus values are kept because
/// they are baked into existing LevelData owner grids, and renumbering the enum would
/// force a re-bake of every map to no runtime benefit.
///
///
/// Global phase of a match, driven by MatchState.
///
///
/// Transitions are server-authoritative. Clients react to
/// NetworkVariable<MatchPhase>.OnValueChanged.
///
public enum MatchPhase : byte
{
/// Pre-match; players are connecting and the server hasn't started the countdown.
Lobby = 0,
/// Brief count-down before waves begin. Placement is still allowed.
CountDown = 1,
/// Waves are in progress; normal gameplay.
Playing = 2,
/// All waves cleared; co-op win state.
Victory = 3,
/// All lives lost; co-op defeat state.
Defeat = 4,
}
///
/// Which step of the between-encounters sequence is currently running. Replicated by
/// WaveManager so every HUD can label the shared countdown correctly.
///
///
/// These run strictly in order and never overlap: players take their personal draft, then vote
/// on the buff for the wave they just cleared, then build. The build timer deliberately does
/// NOT run concurrently with the choices — "after all players have chosen" only means
/// something if it isn't racing a clock players also want to spend on their maze.
///
public enum InterWaveStage : byte
{
/// No inter-wave step running — a wave is spawning or being fought.
None = 0,
/// Players are picking their personal draft reward.
Draft = 1,
/// Players are voting on the buff for the wave they just cleared.
Vote = 2,
/// Build countdown before the next wave spawns.
Build = 3,
}
///
/// Stable identifier per race. Values 1-16 reserve slots for the planned
/// 16-race grid in the lobby; only races with a corresponding
/// RaceDefinition asset registered with RaceRegistry are
/// playable. Unregistered slots render as "Coming Soon" in the selection UI.
///
/// Names are intentionally generic so display names / lore can be authored
/// on the asset without renaming the enum — renaming would change byte
/// values and break save data once persistence lands.
///
public enum RaceId : byte
{
/// No race selected yet (lobby / pre-pick).
None = 0,
Race1 = 1, Race2 = 2, Race3 = 3, Race4 = 4,
Race5 = 5, Race6 = 6, Race7 = 7, Race8 = 8,
Race9 = 9, Race10 = 10, Race11 = 11, Race12 = 12,
Race13 = 13, Race14 = 14, Race15 = 15, Race16 = 16,
}
public enum PlayerSlot : byte
{
None = 0,
Player1 = 1,
Player2 = 2,
Player3 = 3,
Player4 = 4,
Player5 = 5,
Player6 = 6,
Player7 = 7,
Player8 = 8,
Player9 = 9,
}
///
/// Whether a volume permits tower placement on the tiles it covers.
///
///
/// Defaults: Allowed for , Invalid for
/// , , and
/// .
/// Composition rule when volumes overlap: "Invalid wins" — any tile covered by an Invalid volume
/// becomes regardless of other volumes covering it.
///
public enum PlacementValidity
{
Invalid = 0,
Allowed = 1,
}
///
/// Cardinal direction for spawner facing. Used by gizmos (direction arrow) and may be used
/// at runtime to bias initial enemy movement direction out of a spawner.
///
public enum Direction
{
North,
South,
East,
West,
}
///
/// Per-tile placement state in the baked PlacementGrid.
///
///
/// Backed by byte so default-initialized arrays (all zero) start as Outside, which is
/// the correct default for any tile not covered by an authoring volume.
///
public enum PlacementState : byte
{
/// Tile is not covered by any authoring volume. Towers cannot be placed.
Outside = 0,
/// Tile is inside a player zone and not covered by any Invalid-validity volume.
/// Towers can be placed here (subject to runtime checks: ownership, footprint, gold, path).
Buildable = 1,
/// Tile is covered by at least one Invalid-validity volume (spawner, leak exit, goal).
/// Towers cannot be placed here. Note: this affects placement only; pathfinding still treats
/// the tile as walkable.
Restricted = 2,
}
///
/// Whether a map restricts tower placement to each player's own zone, or lets everyone build
/// anywhere on the map's buildable area.
///
///
/// This governs placement PERMISSION only. Zone ownership keeps doing everything else it
/// does today under both modes — leak attribution, camera start position, builder spawn point,
/// minimap tinting. A shared-build map still has distinct player territories; they are simply
/// all buildable by everyone.
///
/// Backed by byte with OwnerOnly = 0 so LevelData assets baked before this
/// existed deserialize to the pre-existing behaviour without needing a re-bake.
///
/// Tower OWNERSHIP is unaffected: a tower belongs to whoever paid for it, and sell /
/// upgrade stay owner-gated in both modes.
///
public enum BuildAccess : byte
{
/// A player may only build on tiles covered by their own PlayerZoneVolume.
OwnerOnly = 0,
/// Any player may build on any Buildable tile, whichever zone owns it.
Shared = 1,
}
///
/// Outcome of a bake operation, recorded on the baked asset.
///
///
/// Failure is not represented here because failed bakes do not persist any state to the asset —
/// the previous successful bake (if any) remains on disk untouched. Failure state lives in
/// editor-only memory and is not part of the data schema.
///
public enum BakeOutcome
{
Success,
SuccessWithWarnings,
}
}