From 9857446ba85509956af1fe45c366bafe940ca331 Mon Sep 17 00:00:00 2001 From: "@permadeath.com" Date: Fri, 21 Aug 2026 13:14:13 -0400 Subject: [PATCH] feat(unit-rules): show a vehicle's or a suit's working in bv-report --unit The per-design view read every design with the Mek reader, so anything else failed on a header line it does not have and printed no terms at all. Change-Id: Ie0241969645d9517a9a1e0c5966eb1eb51c44cd6 --- crates/helm-cli/src/main.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/crates/helm-cli/src/main.rs b/crates/helm-cli/src/main.rs index 611fce0..6956791 100644 --- a/crates/helm-cli/src/main.rs +++ b/crates/helm-cli/src/main.rs @@ -615,7 +615,35 @@ fn one_unit( unit.heat_sinks.as_deref().unwrap_or("no heat sinks"), ); + // `Machine::read` is the Mek reader, so a vehicle or a suit read through + // it fails on a header line it does not have. Its terms are the same + // terms, and they come from the gate every entry point goes through. let machine = helm_bv::Machine::read(unit, catalogue); + if machine.is_err() + && let Ok(t) = helm_bv::terms_in(unit, catalogue, &helm_bv::Condition::undamaged()) + { + println!("\ndefensive"); + println!(" armour {:>10.1}", t.defensive.armor); + println!(" structure {:>10.1}", t.defensive.structure); + println!(" equipment {:>10.1}", t.defensive.equipment); + println!(" explosive {:>10.1}", t.defensive.explosive); + println!(" subtotal {:>10.1}", t.defensive.subtotal); + println!(" x factor {:>10.2}", t.defensive.factor); + println!(" = {:>22.1}", t.defensive.total); + println!("\noffensive"); + println!(" weapons {:>10.1}", t.offensive.weapons); + println!(" equipment {:>10.1}", t.offensive.equipment); + println!(" ammo {:>10.1}", t.offensive.ammo); + println!(" weight {:>10.1}", t.offensive.weight); + println!(" subtotal {:>10.1}", t.offensive.subtotal); + println!(" x fire control {:>10.2}", t.offensive.fire_control); + println!(" x speed {:>10.2}", t.offensive.speed_factor); + println!(" = {:>22.1}", t.offensive.total); + println!("\n x scale {:>10.2}", t.scale); + println!(" battle value {:>10}", t.battle_value); + print_megamek(megamek, &name); + return Ok(()); + } match machine .as_ref() .map_err(Clone::clone) -- 2.51.2