pub struct Destruct { /* private fields */ }Expand description
A destruction state of a building piece.
Each piece can have multiple destructs representing different damage states. Destructs contain all the gameplay logic for that damage state: platforms, pipes, gates, EF lines, collision, etc.
§Fields
name- Name identifier for this destruction stateindex- Index of this destructcollision_3d- Collision mesh (legacy, moved to.cs2.collisionin newer games)collision_outlines- 2D collision outlineswindows- Number of window positionsdoors- Number of door positionsgates- Gate collision data for wall gatespipes- Unit movement paths (stairs, ladders, doors, etc.)footprints- Footprint rings of the level, beside its collision outlines (x and z)platforms- Walkable surfaces for unitsuk_2- Unknown fieldbounding_box- Bounding box for this destructcannon_emitters- Projectile emitter count for cannons (legacy)arrow_emitters- Projectile emitters for arrows (legacy)docking_points- Number of docking pointssoft_collisions- Soft collision datauk_7- Unknown field (v18 and later)vfx_emitters- VFX the destruct always plays (v13 and before)file_refs- Attached model references (e.g., torches)ef_lines- Entity Formation lines for unit positioningdocking_lines- Lines where siege equipment can attachf_1- Unknown fieldaction_vfx- VFX for actionsaction_vfx_attachments- VFX attachment pointsaction_vfx_triangles- Peraction_vfxentry, the hull triangles it belongs tobin_data_2- Unknown binary data (present in some Three Kingdoms gates)
§Examples
for destruct in piece.destructs() {
println!("Destruct '{}': {} platforms, {} pipes",
destruct.name(),
destruct.platforms().len(),
destruct.pipes().len()
);
}Implementations§
Source§impl Destruct
impl Destruct
Sourcepub fn collision_3d(&self) -> &Collision3d
pub fn collision_3d(&self) -> &Collision3d
Collision mesh (legacy, moved to separate .cs2.collision files in newer games).
Sourcepub fn collision_outlines(&self) -> &Vec<CollisionOutline>
pub fn collision_outlines(&self) -> &Vec<CollisionOutline>
2D collision outlines.
Sourcepub fn footprints(&self) -> &Vec<Vec<FootprintCorner>>
pub fn footprints(&self) -> &Vec<Vec<FootprintCorner>>
Footprint rings of the level, beside its collision outlines: the ground it covers (x and z). Drawn as an orange line in Terry.
Sourcepub fn bounding_box(&self) -> &Cube
pub fn bounding_box(&self) -> &Cube
Bounding box for this destruct.
Sourcepub fn cannon_emitters(&self) -> &i32
pub fn cannon_emitters(&self) -> &i32
Projectile emitter count for cannons (legacy, moved to map in newer games).
Sourcepub fn arrow_emitters(&self) -> &Vec<ProjectileEmitter>
pub fn arrow_emitters(&self) -> &Vec<ProjectileEmitter>
Projectile emitters for arrows (legacy, moved to map in newer games).
Sourcepub fn docking_points(&self) -> &i32
pub fn docking_points(&self) -> &i32
Number of docking points.
Sourcepub fn soft_collisions(&self) -> &Vec<SoftCollisions>
pub fn soft_collisions(&self) -> &Vec<SoftCollisions>
Soft collision data.
Sourcepub fn uk_7(&self) -> &i32
pub fn uk_7(&self) -> &i32
Unknown field (v18 and later; not checked whether it is the count of vfx_emitters there too).
Sourcepub fn vfx_emitters(&self) -> &Vec<Vfx>
pub fn vfx_emitters(&self) -> &Vec<Vfx>
VFX the destruct always plays (v13 and before). In Attila, the name of the effect is the key without its first three and its last
_ tokens: piece01_destruct01_emitter_action_vfx_torch_fire_small_01 plays action_vfx_torch_fire_small. No file shipped with
the game has any, but they play in game.
Sourcepub fn docking_lines(&self) -> &Vec<DockingLine>
pub fn docking_lines(&self) -> &Vec<DockingLine>
Lines where siege equipment can attach.
Sourcepub fn action_vfx(&self) -> &Vec<Vfx>
pub fn action_vfx(&self) -> &Vec<Vfx>
VFX for actions.
Sourcepub fn action_vfx_attachments(&self) -> &Vec<Vfx>
pub fn action_vfx_attachments(&self) -> &Vec<Vfx>
VFX attachment points.
Sourcepub fn action_vfx_triangles(&self) -> &Vec<Vec<i16>>
pub fn action_vfx_triangles(&self) -> &Vec<Vec<i16>>
Lists of indices into the level’s collision_3d triangles, as many lists as action_vfx entries, together covering every
hull triangle once: probably which effect a hit on that part of the hull plays (the pairing by index is not checked in game).
Sourcepub fn bin_data_2(&self) -> &Vec<Vec<i16>>
pub fn bin_data_2(&self) -> &Vec<Vec<i16>>
Unknown binary data (present in some Three Kingdoms gates).
Source§impl Destruct
impl Destruct
Sourcepub fn collision_3d_mut(&mut self) -> &mut Collision3d
pub fn collision_3d_mut(&mut self) -> &mut Collision3d
Collision mesh (legacy, moved to separate .cs2.collision files in newer games).
Sourcepub fn collision_outlines_mut(&mut self) -> &mut Vec<CollisionOutline>
pub fn collision_outlines_mut(&mut self) -> &mut Vec<CollisionOutline>
2D collision outlines.
Sourcepub fn windows_mut(&mut self) -> &mut i32
pub fn windows_mut(&mut self) -> &mut i32
Number of window positions.
Sourcepub fn footprints_mut(&mut self) -> &mut Vec<Vec<FootprintCorner>>
pub fn footprints_mut(&mut self) -> &mut Vec<Vec<FootprintCorner>>
Footprint rings of the level, beside its collision outlines: the ground it covers (x and z). Drawn as an orange line in Terry.
Sourcepub fn platforms_mut(&mut self) -> &mut Vec<Platform>
pub fn platforms_mut(&mut self) -> &mut Vec<Platform>
Walkable platform surfaces.
Sourcepub fn bounding_box_mut(&mut self) -> &mut Cube
pub fn bounding_box_mut(&mut self) -> &mut Cube
Bounding box for this destruct.
Sourcepub fn cannon_emitters_mut(&mut self) -> &mut i32
pub fn cannon_emitters_mut(&mut self) -> &mut i32
Projectile emitter count for cannons (legacy, moved to map in newer games).
Sourcepub fn arrow_emitters_mut(&mut self) -> &mut Vec<ProjectileEmitter>
pub fn arrow_emitters_mut(&mut self) -> &mut Vec<ProjectileEmitter>
Projectile emitters for arrows (legacy, moved to map in newer games).
Sourcepub fn docking_points_mut(&mut self) -> &mut i32
pub fn docking_points_mut(&mut self) -> &mut i32
Number of docking points.
Sourcepub fn soft_collisions_mut(&mut self) -> &mut Vec<SoftCollisions>
pub fn soft_collisions_mut(&mut self) -> &mut Vec<SoftCollisions>
Soft collision data.
Sourcepub fn uk_7_mut(&mut self) -> &mut i32
pub fn uk_7_mut(&mut self) -> &mut i32
Unknown field (v18 and later; not checked whether it is the count of vfx_emitters there too).
Sourcepub fn vfx_emitters_mut(&mut self) -> &mut Vec<Vfx>
pub fn vfx_emitters_mut(&mut self) -> &mut Vec<Vfx>
VFX the destruct always plays (v13 and before). In Attila, the name of the effect is the key without its first three and its last
_ tokens: piece01_destruct01_emitter_action_vfx_torch_fire_small_01 plays action_vfx_torch_fire_small. No file shipped with
the game has any, but they play in game.
Sourcepub fn file_refs_mut(&mut self) -> &mut Vec<FileRef>
pub fn file_refs_mut(&mut self) -> &mut Vec<FileRef>
Attached model references (e.g., torches).
Sourcepub fn ef_lines_mut(&mut self) -> &mut Vec<EFLine>
pub fn ef_lines_mut(&mut self) -> &mut Vec<EFLine>
Entity Formation lines for unit positioning.
Sourcepub fn docking_lines_mut(&mut self) -> &mut Vec<DockingLine>
pub fn docking_lines_mut(&mut self) -> &mut Vec<DockingLine>
Lines where siege equipment can attach.
Sourcepub fn action_vfx_mut(&mut self) -> &mut Vec<Vfx>
pub fn action_vfx_mut(&mut self) -> &mut Vec<Vfx>
VFX for actions.
Sourcepub fn action_vfx_attachments_mut(&mut self) -> &mut Vec<Vfx>
pub fn action_vfx_attachments_mut(&mut self) -> &mut Vec<Vfx>
VFX attachment points.
Sourcepub fn action_vfx_triangles_mut(&mut self) -> &mut Vec<Vec<i16>>
pub fn action_vfx_triangles_mut(&mut self) -> &mut Vec<Vec<i16>>
Lists of indices into the level’s collision_3d triangles, as many lists as action_vfx entries, together covering every
hull triangle once: probably which effect a hit on that part of the hull plays (the pairing by index is not checked in game).
Sourcepub fn bin_data_2_mut(&mut self) -> &mut Vec<Vec<i16>>
pub fn bin_data_2_mut(&mut self) -> &mut Vec<Vec<i16>>
Unknown binary data (present in some Three Kingdoms gates).
Source§impl Destruct
impl Destruct
Sourcepub fn set_name(&mut self, val: String) -> &mut Self
pub fn set_name(&mut self, val: String) -> &mut Self
Name identifier for this destruction state.
Sourcepub fn set_collision_3d(&mut self, val: Collision3d) -> &mut Self
pub fn set_collision_3d(&mut self, val: Collision3d) -> &mut Self
Collision mesh (legacy, moved to separate .cs2.collision files in newer games).
Sourcepub fn set_collision_outlines(
&mut self,
val: Vec<CollisionOutline>,
) -> &mut Self
pub fn set_collision_outlines( &mut self, val: Vec<CollisionOutline>, ) -> &mut Self
2D collision outlines.
Sourcepub fn set_windows(&mut self, val: i32) -> &mut Self
pub fn set_windows(&mut self, val: i32) -> &mut Self
Number of window positions.
Sourcepub fn set_pipes(&mut self, val: Vec<Pipe>) -> &mut Self
pub fn set_pipes(&mut self, val: Vec<Pipe>) -> &mut Self
Unit movement paths between platforms.
Sourcepub fn set_footprints(&mut self, val: Vec<Vec<FootprintCorner>>) -> &mut Self
pub fn set_footprints(&mut self, val: Vec<Vec<FootprintCorner>>) -> &mut Self
Footprint rings of the level, beside its collision outlines: the ground it covers (x and z). Drawn as an orange line in Terry.
Sourcepub fn set_platforms(&mut self, val: Vec<Platform>) -> &mut Self
pub fn set_platforms(&mut self, val: Vec<Platform>) -> &mut Self
Walkable platform surfaces.
Sourcepub fn set_bounding_box(&mut self, val: Cube) -> &mut Self
pub fn set_bounding_box(&mut self, val: Cube) -> &mut Self
Bounding box for this destruct.
Sourcepub fn set_cannon_emitters(&mut self, val: i32) -> &mut Self
pub fn set_cannon_emitters(&mut self, val: i32) -> &mut Self
Projectile emitter count for cannons (legacy, moved to map in newer games).
Sourcepub fn set_arrow_emitters(&mut self, val: Vec<ProjectileEmitter>) -> &mut Self
pub fn set_arrow_emitters(&mut self, val: Vec<ProjectileEmitter>) -> &mut Self
Projectile emitters for arrows (legacy, moved to map in newer games).
Sourcepub fn set_docking_points(&mut self, val: i32) -> &mut Self
pub fn set_docking_points(&mut self, val: i32) -> &mut Self
Number of docking points.
Sourcepub fn set_soft_collisions(&mut self, val: Vec<SoftCollisions>) -> &mut Self
pub fn set_soft_collisions(&mut self, val: Vec<SoftCollisions>) -> &mut Self
Soft collision data.
Sourcepub fn set_uk_7(&mut self, val: i32) -> &mut Self
pub fn set_uk_7(&mut self, val: i32) -> &mut Self
Unknown field (v18 and later; not checked whether it is the count of vfx_emitters there too).
Sourcepub fn set_vfx_emitters(&mut self, val: Vec<Vfx>) -> &mut Self
pub fn set_vfx_emitters(&mut self, val: Vec<Vfx>) -> &mut Self
VFX the destruct always plays (v13 and before). In Attila, the name of the effect is the key without its first three and its last
_ tokens: piece01_destruct01_emitter_action_vfx_torch_fire_small_01 plays action_vfx_torch_fire_small. No file shipped with
the game has any, but they play in game.
Sourcepub fn set_file_refs(&mut self, val: Vec<FileRef>) -> &mut Self
pub fn set_file_refs(&mut self, val: Vec<FileRef>) -> &mut Self
Attached model references (e.g., torches).
Sourcepub fn set_ef_lines(&mut self, val: Vec<EFLine>) -> &mut Self
pub fn set_ef_lines(&mut self, val: Vec<EFLine>) -> &mut Self
Entity Formation lines for unit positioning.
Sourcepub fn set_docking_lines(&mut self, val: Vec<DockingLine>) -> &mut Self
pub fn set_docking_lines(&mut self, val: Vec<DockingLine>) -> &mut Self
Lines where siege equipment can attach.
Sourcepub fn set_action_vfx(&mut self, val: Vec<Vfx>) -> &mut Self
pub fn set_action_vfx(&mut self, val: Vec<Vfx>) -> &mut Self
VFX for actions.
Sourcepub fn set_action_vfx_attachments(&mut self, val: Vec<Vfx>) -> &mut Self
pub fn set_action_vfx_attachments(&mut self, val: Vec<Vfx>) -> &mut Self
VFX attachment points.
Sourcepub fn set_action_vfx_triangles(&mut self, val: Vec<Vec<i16>>) -> &mut Self
pub fn set_action_vfx_triangles(&mut self, val: Vec<Vec<i16>>) -> &mut Self
Lists of indices into the level’s collision_3d triangles, as many lists as action_vfx entries, together covering every
hull triangle once: probably which effect a hit on that part of the hull plays (the pairing by index is not checked in game).
Sourcepub fn set_bin_data_2(&mut self, val: Vec<Vec<i16>>) -> &mut Self
pub fn set_bin_data_2(&mut self, val: Vec<Vec<i16>>) -> &mut Self
Unknown binary data (present in some Three Kingdoms gates).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Destruct
impl<'de> Deserialize<'de> for Destruct
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Destruct
Auto Trait Implementations§
impl Freeze for Destruct
impl RefUnwindSafe for Destruct
impl Send for Destruct
impl Sync for Destruct
impl Unpin for Destruct
impl UnsafeUnpin for Destruct
impl UnwindSafe for Destruct
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.