generated from GarandPLG/rust-flake-template
Add support structures and stress mechanics
Introduce support structures (roof supports) and a stress system that propagates from bases through tunnels, causing collapses when stress reaches 100 %. Add auto‑support feature with toggleable tasks, new keybindings (Tasks, AutoSupports, Stress), and a support‑building tab. Implement collapsed tunnels, support work progress, and related UI rendering (stress view, auto‑support indicators). Extend board resize logic, update game state structs, and adjust keybinding actions. Update documentation (README, AGENTS, CODE_MAP, PROGRESS, TESTING) to reflect new features. Add flake.nix dependencies (bash, gitea‑actions‑runner, docker). Add extensive tests for tunnel stress, support building, auto‑supports, and related mechanics.
This commit is contained in:
1 parent
110d4c411a
commit
d293f95174
28 files changed
+1622
-73
No files matched your search
@@ -77,9 +77,16 @@ fn building_view_has_its_own_help_and_does_not_build_on_invalid_tile() -> () {
|
||||
assert!(app.states_ref().unwrap().skirmish.building_view);
|
||||
assert_eq!(
|
||||
available_skirmish_actions(&app.states_ref().unwrap().skirmish),
|
||||
[Action::Building, Action::Left, Action::Right, Action::Quit2]
|
||||
[
|
||||
Action::Building,
|
||||
Action::Left,
|
||||
Action::Right,
|
||||
Action::Stress,
|
||||
Action::Quit2
|
||||
]
|
||||
);
|
||||
press(&mut app, KeyCode::Left, KeyModifiers::NONE);
|
||||
press(&mut app, KeyCode::Right, KeyModifiers::NONE);
|
||||
press(&mut app, KeyCode::Enter, KeyModifiers::NONE);
|
||||
press(&mut app, KeyCode::Char(' '), KeyModifiers::NONE);
|
||||
assert_eq!(app.states_ref().unwrap().skirmish.board, before);
|
||||
@@ -218,12 +225,17 @@ fn popup_tabs_cycle_without_moving_map_or_changing_queues() -> () {
|
||||
let before: war_in_tunnels::app::states::skirmish_states::BoardState =
|
||||
app.states_ref().unwrap().skirmish.board.clone();
|
||||
press(&mut app, KeyCode::Char(key), KeyModifiers::NONE);
|
||||
for code in [KeyCode::Left, KeyCode::Right, KeyCode::Right, KeyCode::Left] {
|
||||
for (code, index) in [
|
||||
(KeyCode::Left, 1),
|
||||
(KeyCode::Right, 0),
|
||||
(KeyCode::Right, 1),
|
||||
(KeyCode::Left, 0),
|
||||
] {
|
||||
press(&mut app, code, KeyModifiers::NONE);
|
||||
let state: &war_in_tunnels::app::states::SkirmishState =
|
||||
&app.states_ref().unwrap().skirmish;
|
||||
assert_eq!(state.board, before);
|
||||
assert_eq!(state.selected_building, 0);
|
||||
assert_eq!(state.selected_building, if key == 'b' { index } else { 0 });
|
||||
assert_eq!(state.selected_recruit, 0);
|
||||
assert!(available_skirmish_actions(state).contains(&Action::Left));
|
||||
assert!(available_skirmish_actions(state).contains(&Action::Right));
|
||||
|
||||
Reference in new issue
Block a user