Unit definitions and spawning #4

Closed
opened 2026-08-06 21:51:49 +00:00 by icub3d · 0 comments
Owner

Get units onto the map: player-controlled characters from the roster, and hostiles.

CharacterDef (src/character/definition.rs) is the authored person; it has no combat
stats. This issue adds the combat-side definition and the components that represent a
unit in a mission.

Scope

  • UnitDef — combat stats as data: health, TurnSpeed, movement allowance, a basic
    attack. RON, loaded through the existing RonAsset trait.
  • Components: newtypes with meaning, not bare integers — Health, TurnSpeed,
    ActionPoints(u8), GridPos, and a team/allegiance marker.
  • Spawn player units and enemies at the map's spawn points, rendered as distinct
    primitives, tinted UNIT_PLAYER / UNIT_ENEMY from theme::semantic.

Acceptance criteria

  • A unit's identity comes from a CharacterId, so a save can point at it.
  • Allegiance is readable from shape or icon, not colour alone.
  • Spawning is deterministic: same map plus same roster produces the same units at
    the same positions, in the same order.
  • Unit tests cover the def-to-components mapping.
Get units onto the map: player-controlled characters from the roster, and hostiles. `CharacterDef` (`src/character/definition.rs`) is the authored *person*; it has no combat stats. This issue adds the combat-side definition and the components that represent a unit in a mission. ## Scope - `UnitDef` — combat stats as data: health, `TurnSpeed`, movement allowance, a basic attack. RON, loaded through the existing `RonAsset` trait. - Components: newtypes with meaning, not bare integers — `Health`, `TurnSpeed`, `ActionPoints(u8)`, `GridPos`, and a team/allegiance marker. - Spawn player units and enemies at the map's spawn points, rendered as distinct primitives, tinted `UNIT_PLAYER` / `UNIT_ENEMY` from `theme::semantic`. ## Acceptance criteria - [ ] A unit's identity comes from a `CharacterId`, so a save can point at it. - [ ] Allegiance is readable from shape or icon, not colour alone. - [ ] Spawning is deterministic: same map plus same roster produces the same units at the same positions, in the same order. - [ ] Unit tests cover the def-to-components mapping.
icub3d referenced this issue from a commit 2026-08-08 01:43:32 +00:00
Sign in to join this conversation.
No description provided.