game_data: Arsenal loader — player weapon options per hardpoint
Decode the player weapon arsenal from the UNITS tables (GP_HANGAR_ARSENAL.pak): the selectable weapons per Delta Saber hardpoint. Each `STANDARD_<hp>` header (Nose / Arm1-3) lists its options up to the next header — extracted by shape, unioned + deduped across configs. The arsenal reads with the game's own names: NOSE guns (Stiletto, Rapier, Broad Sword, Machine Cannon), ARM missiles/bombs (Falcon, Eagle, White Shark, Piranha, Tomahawk Rail Gun, Maelstrom Bomb). Example `arsenal` prints them. +1 test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
9
crates/sylpheed-formats/examples/arsenal.rs
Normal file
9
crates/sylpheed-formats/examples/arsenal.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
use sylpheed_formats::{game_data as gd, PakArchive};
|
||||
fn main(){
|
||||
let disc=std::env::var("SYLPHEED_DISC").unwrap();
|
||||
let pak=PakArchive::open(format!("{disc}/dat/GP_HANGAR_ARSENAL.pak")).unwrap();
|
||||
let a=gd::load_arsenal(&pak);
|
||||
for (hp,list) in [("NOSE",&a.nose),("ARM1",&a.arm1),("ARM2",&a.arm2),("ARM3",&a.arm3)]{
|
||||
println!("{hp} ({}): {:?}", list.len(), list.iter().take(8).collect::<Vec<_>>());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user