feat(bevy_battle): fix flaky test + add combat snapshot module#8091
Merged
feat(bevy_battle): fix flaky test + add combat snapshot module#8091
Conversation
Bump test enemy HP to 500 and guard against enemy flee (all level tiers have Flee in their intent pool). The test validates burning effect stacking, not flee behavior, so it gracefully skips the burning assertion if the enemy fled between fire flask uses.
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Add bevy_battle::snapshot with CombatSnapshot, PlayerSnapshot, EnemySnapshot, and EffectSnapshot types. The capture() function extracts a game-agnostic combat snapshot from the ECS world that any renderer (SVG cards, isometric HUD, web UI) can consume. 6 new tests covering player/enemy capture, effects, death detection, index sorting, defending flag, and clone/debug traits.
Add snapshot capture to CombatTurnResult and GameCardTemplate::from_snapshot() that reads combat fields (HP, armor, effects, intent) from bevy_battle's ECS snapshot while preserving session fields (gold, XP, gear, room, phase). This establishes a single source of truth for combat display data across SVG cards, isometric game, and future web UI renderers.
Align with upstream proto rename (slug → ref) across itemdb, npcdb, mapdb, and questdb schemas. Updates id_for_slug → id_for_ref, from_slug → from_ref, and .slug → .r#ref field access.
This was referenced Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
multiple_fire_flasks_stack_burningintermittently panicked because all enemy level tiers includeIntent::Fleein their intent pool. Bump HP to 500 and guard assertion with bounds check.bevy_battle::snapshotextracts render-readyCombatSnapshotfrom the ECS world afterapp.update(). Game-agnostic types (PlayerSnapshot,EnemySnapshot,EffectSnapshot) that any renderer (SVG cards, isometric HUD, web UI) can consume without importing bevy or discord types.Part of #8010 (Phase 3)
Test plan
cargo test -p bevy_battle— 58 tests pass (52 original + 6 snapshot)cargo test -p axum-discordsh— 556 tests pass🤖 Generated with Claude Code