Put units on the map #19
No reviewers
Labels
No labels
area/ai
area/build
area/character
area/combat
area/data
area/docs
area/game
area/net
area/ui
area/world
size
l
size
m
size
s
type
bug
type
design
type
feature
type
refactor
type
test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
icub3d/terra-redux!19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "4-unit-definitions-and-spawning"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Gets units onto the map: two of the player's cell against two K-A Asset Protection
hostiles, standing on the Proving Ground's spawn points.
What this adds
UnitDef(assets/data/units/skirmish.units.ron) — combat stats as data, loadedthrough the existing
RonAssettrait on a*.units.ronextension. ACharacterDefisa person; a
UnitDefis what a person or a hostile is worth in a fight. Separatefiles because a backstory and a balance number change for different reasons.
UnitRegistry—Vec-backed and validated against the roster, so a unit naming acharacter who is not there fails at startup with the offending id. Rejects zero health,
speed, action points, attack damage, and attack range; allows zero movement, because a
unit that holds ground is a design rather than a mistake.
Health,TurnSpeed,Movement,ActionPoints,BasicAttack,beside the existing
GridPosandTeam. Newtypes with meaning, per § Code Style.Health and action points carry their maximum, so the HUD can draw a bar and the
scheduler can refill points without either one reaching for the registry.
plan()pairs each side's authored deployment with that side'sauthored spawn points;
spawn_unitscarries the result into the ECS. Everything wearsDespawnOnExit(GameState::Mission).Acceptance criteria
CharacterId— worn as a component by deployedroster characters. Hostiles deliberately have none: giving a template an id would
invent a person for a save to point at.
cone for a hostile.
orders, so the same map plus the same roster is the same fight; a test re-enters
the mission and compares.
combat_bundlein a bareWorld).Notes for review
mission's business, but missions are not data until M6 and M1 has exactly one. The
field is commented as moving when they are; the templates stay.
the mission. Map and deployment are authored in separate files today, so a mismatch is
a content gap, not a corrupt file. That changes when a mission chooses its own map.
CharacterRegistryexisting — the cross-registryreference is the one ordering between two subsystems that the loading gate alone does
not express. The gate still holds
Loadingopen for"units".WORLD.md§ Kessler-Arun; thehostiles are described with it rather than named into it.
Verification
cargo build,cargo test(94 passed),cargo clippy --all-targets -- -D warnings,cargo fmt --check, and--features devare all clean. There is no display here, sothe visuals are unverified: on entering a mission, look for two blue capsules on the
south edge at x=3 and x=5, two red cones on the north edge at x=6 and x=8, feet flush
with the tile tops, and nothing left behind on the way out.
Closes #4