pub struct AreMiniGameVehicle {
pub models: Vec<AreMiniGameModel>,
pub track: ResRef,
pub hit_points: u32,
pub max_hps: u32,
pub sphere_radius: f32,
pub invince_period: f32,
pub bump_damage: i32,
pub num_loops: i32,
pub scripts: AreMiniGameVehicleScripts,
pub sounds: AreMiniGameSounds,
pub gun_banks: Vec<AreMiniGameGunBank>,
}Expand description
The fields the player vehicle and every enemy vehicle both carry.
The engine backs both with one class, CSWTrackFollower, and both
CSWMiniPlayer::Load and CSWMiniEnemy::Load delegate to
CSWTrackFollower::Load on an embedded sub-object before reading anything
of their own. So the sharing here is a fact about the engine’s object
graph, not a resemblance spotted between two field lists.
The distinction decides whether a shared base is worth having at all. One derived from the intersection of two field lists is a coincidence given a name, and it breaks the moment either side gains a field the other lacks. This one names a class the engine has, so a new field belongs either to that class or to one of the two subclasses, and the model has somewhere honest to put it either way.
Obstacles sit outside this entirely. CSWMGObstacle::Load reads a name and
a scripts struct, with no lifecycle, weapon or track data at all.
Fields§
§models: Vec<AreMiniGameModel>Model list (Models).
track: ResRefTrack resref (Track) the vehicle follows.
hit_points: u32Current hit points (Hit_Points).
The engine applies the file’s value only when it is greater than zero. A zero or absent value leaves whatever the object was constructed with, so zero here means “engine decides”, not “starts dead”.
max_hps: u32Maximum hit points (Max_HPs), gated the same way as Self::hit_points.
sphere_radius: f32Collision sphere radius (Sphere_Radius).
Default -1.0, which the engine reads as a sentinel: it applies the
value only when it is at or above zero, so a negative radius means the
constructed default stands.
invince_period: f32Invulnerability window in seconds after a hit (Invince_Period).
bump_damage: i32Damage dealt to whatever this vehicle bumps into (Bump_Damage).
num_loops: i32Number of times the vehicle loops its track (Num_Loops).
Default -10, a sentinel the engine passes through to a virtual setter
whose own handling of it was not traced. Vanilla writes -1 for every
enemy, which is a different sentinel again.
scripts: AreMiniGameVehicleScriptsScript slots (Scripts).
Not an Option despite being a nested struct, unlike
AreMiniGame::mouse. The engine’s read here is traced and provably
indifferent: an absent Scripts and one holding nothing but empty
resrefs leave the object in the same state, because every slot is
written whether or not the file supplied it. Materializing one invents
a label but no behaviour. Once absent-value auditing can express “omit
when equal to the audited default”, an all-empty Scripts is a
candidate to stop being written at all.
sounds: AreMiniGameSoundsEngine and destruction sounds (Sounds), on the same footing as
Self::scripts.
gun_banks: Vec<AreMiniGameGunBank>Weapon hardpoints (Gun_Banks).
Trait Implementations§
Source§impl Clone for AreMiniGameVehicle
impl Clone for AreMiniGameVehicle
Source§fn clone(&self) -> AreMiniGameVehicle
fn clone(&self) -> AreMiniGameVehicle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AreMiniGameVehicle
impl Debug for AreMiniGameVehicle
Source§impl Default for AreMiniGameVehicle
impl Default for AreMiniGameVehicle
Source§impl PartialEq for AreMiniGameVehicle
impl PartialEq for AreMiniGameVehicle
Source§fn eq(&self, other: &AreMiniGameVehicle) -> bool
fn eq(&self, other: &AreMiniGameVehicle) -> bool
self and other values to be equal, and is used by ==.