fix(ui): render partial target-bank states
Records 90 through 104 and 109 through 120 deactivate in linked three-line groups. For each group, the flag-bearing head switches its recovered bounds from overlay B to overlay A until the complete bank rearms every record. Rust updated collision activity but never drew these nine intermediate states. Render the five bumper-bank and four TDK-bank head regions directly from the 175-record ledger. Extend the bank regression to prove partial activation and post-completion clearing, and seed two partial groups in the deterministic rules framebuffer. Test Plan: - `cargo test --workspace --all-targets --all-features` -- 120 passed - `cargo clippy --workspace --all-targets --all-features -- -D warnings` -- passed - `rumdl check --flavor commonmark RECONSTRUCTION.md CHANGELOG.md` -- passed - `cargo run -- --simulate targets --step 26 --screenshot /tmp/tdkpin-targets-banks.png` -- passed; partial bumper and TDK bank regions visually inspected at 640x460 - `git diff --cached --check` -- passed
This commit is contained in:
+27
-2
@@ -452,6 +452,16 @@ impl Game {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn begin_target_scenario(&mut self) {
|
||||
self.ball.in_launcher = false;
|
||||
self.ball.position = vec2(170.0, 230.0);
|
||||
self.players[0].bumper_value = 6_000;
|
||||
self.wheel_holes = [true, false, true, false, false];
|
||||
self.target_rotation_state = Some(0);
|
||||
self.object_active[90] = false;
|
||||
self.object_active[109] = false;
|
||||
}
|
||||
|
||||
fn fire_launcher(&mut self) {
|
||||
self.launcher_velocity_milli = self
|
||||
.launcher_velocity_milli
|
||||
@@ -1937,6 +1947,11 @@ impl Game {
|
||||
self.object_active[object_id]
|
||||
}
|
||||
|
||||
pub fn bank_target_lit(&self, object_id: u8) -> bool {
|
||||
matches!(object_id, 90 | 93 | 96 | 99 | 102 | 109 | 112 | 115 | 118)
|
||||
&& !self.object_active[usize::from(object_id)]
|
||||
}
|
||||
|
||||
pub fn effect_target_active(&self) -> bool {
|
||||
self.object_active[usize::from(EFFECT_SENSOR.id)]
|
||||
}
|
||||
@@ -2630,17 +2645,27 @@ mod tests {
|
||||
let mut game = Game::new(1);
|
||||
let mut events = Vec::new();
|
||||
|
||||
for object_id in [90, 93, 96, 99, 102] {
|
||||
for object_id in [90, 93, 96, 99] {
|
||||
game.apply_wall_rule(object_id, &mut events);
|
||||
}
|
||||
assert!(game.bank_target_lit(90));
|
||||
assert!(game.bank_target_lit(99));
|
||||
assert!(!game.bank_target_lit(102));
|
||||
game.apply_wall_rule(102, &mut events);
|
||||
assert_eq!(game.player().bumper_value, 2_000);
|
||||
assert!(game.object_active[90..=104].iter().all(|active| *active));
|
||||
assert!(!game.bank_target_lit(90));
|
||||
|
||||
for object_id in [109, 112, 115, 118] {
|
||||
for object_id in [109, 112, 115] {
|
||||
game.apply_wall_rule(object_id, &mut events);
|
||||
}
|
||||
assert!(game.bank_target_lit(109));
|
||||
assert!(game.bank_target_lit(115));
|
||||
assert!(!game.bank_target_lit(118));
|
||||
game.apply_wall_rule(118, &mut events);
|
||||
assert_eq!(game.player().diamond_segments, 1);
|
||||
assert!(game.object_active[109..=120].iter().all(|active| *active));
|
||||
assert!(!game.bank_target_lit(109));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user