commonlibsse_ng\re\t/
TESObjectWEAP.rs

1// NOTE: The name `Flag` is not Reexported due to batting.
2pub mod critical_data;
3pub mod data;
4
5use self::critical_data::CriticalData;
6use self::data::Data;
7use crate::re::BGSEquipType::BGSEquipType;
8use crate::re::BGSKeywordForm::BGSKeywordForm;
9use crate::re::BGSSoundDescriptorForm::BGSSoundDescriptorForm;
10use crate::re::BSFixedString::BSFixedString;
11use crate::re::SoundLevel::SOUND_LEVEL;
12use crate::re::TESAttackDamageForm::TESAttackDamageForm;
13use crate::re::TESBoundObject::TESBoundObject;
14use crate::re::TESDescription::TESDescription;
15use crate::re::TESEnchantableForm::TESEnchantableForm;
16use crate::re::TESFullName::TESFullName;
17use crate::re::TESIcon::TESIcon;
18use crate::re::TESModel::TESModel;
19use crate::re::TESModelTextSwap::TESModelTextureSwap;
20use crate::re::TESValueForm::TESValueForm;
21use crate::re::TESWeightForm::TESWeightForm;
22use crate::re::{
23    BGSBlockBashData, BGSDestructibleObjectForm, BGSImpactDataSet, BGSMessageIcon,
24    BGSPickupPutdownSounds, BGSPreloadable, TESEffectShader, TESObjectSTAT,
25};
26
27#[commonlibsse_ng_derive_internal::to_bitflags]
28#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
29#[repr(u32)]
30pub enum WEAPON_RUMBLE_PATTERN {
31    Constant = 0,
32    PeriodicSquare = 1,
33    PeriodicTriangle = 2,
34    PeriodicSawtooth = 3,
35}
36
37#[commonlibsse_ng_derive_internal::to_bitflags]
38#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
39#[repr(u32)]
40pub enum RecordFlag {
41    NonPlayable = 1 << 2,
42    Deleted = 1 << 5,
43    Ignored = 1 << 12,
44}
45
46#[repr(C)]
47#[derive(Debug)]
48pub struct RangedData {
49    pub sightFOV: f32,                        // 0x00
50    pub unk04: f32,                           // 0x04
51    pub firingRumbleLeftMotorStrength: f32,   // 0x08
52    pub firingRumbleRightMotorStrength: f32,  // 0x0C
53    pub firingRumbleDuration: f32,            // 0x10
54    pub rumblePattern: WEAPON_RUMBLE_PATTERN, // 0x14
55    pub numProjectiles: i8,                   // 0x18
56    pad19: u8,                                // 0x19
57    pad1A: u16,                               // 0x1A
58}
59const _: () = assert!(core::mem::size_of::<RangedData>() == 0x1C);
60
61#[repr(C)]
62#[derive(Debug)]
63pub struct Unk1B8 {
64    pub unk00: TESModel,             // 00
65    pub unk28: *mut TESEffectShader, // 28
66}
67const _: () = assert!(core::mem::size_of::<Unk1B8>() == 0x30);
68
69#[repr(C)]
70#[derive(Debug)]
71pub struct TESObjectWEAP {
72    pub __base0: TESBoundObject,                      // 0x000
73    pub __base1: TESFullName,                         // 0x030
74    pub __base2: TESModelTextureSwap,                 // 0x040
75    pub __base3: TESIcon,                             // 0x078
76    pub __base4: TESEnchantableForm,                  // 0x088
77    pub __base5: TESValueForm,                        // 0x0A0
78    pub __base6: TESWeightForm,                       // 0x0B0
79    pub __base7: TESAttackDamageForm,                 // 0x0C0
80    pub __base8: BGSDestructibleObjectForm,           // 0x0D0
81    pub __base9: BGSEquipType,                        // 0x0E0
82    pub __base10: BGSPreloadable,                     // 0x0F0
83    pub __base11: BGSMessageIcon,                     // 0x0F8
84    pub __base12: BGSPickupPutdownSounds,             // 0x110
85    pub __base13: BGSBlockBashData,                   // 0x128
86    pub __base14: BGSKeywordForm,                     // 0x140
87    pub __base15: TESDescription,                     // 0x158
88    pub weaponData: Data,                             // 0x168 - DNAM
89    pub criticalData: CriticalData,                   // 0x1A0 - CRDT
90    pub unk1B8: *mut Unk1B8,                          // 0x1B8
91    pub attackSound: *mut BGSSoundDescriptorForm,     // 0x1C0 - SNAM
92    pub attackSound2D: *mut BGSSoundDescriptorForm,   // 0x1C8 - XNAM
93    pub attackLoopSound: *mut BGSSoundDescriptorForm, // 0x1D0 - NAM7
94    pub attackFailSound: *mut BGSSoundDescriptorForm, // 0x1D8 - TNAM
95    pub idleSound: *mut BGSSoundDescriptorForm,       // 0x1E0 - UNAM
96    pub equipSound: *mut BGSSoundDescriptorForm,      // 0x1E8 - NAM9
97    pub unequipSound: *mut BGSSoundDescriptorForm,    // 0x1F0 - NAM8
98    pub impactDataSet: *mut BGSImpactDataSet,         // 0x1F8
99    pub firstPersonModelObject: *mut TESObjectSTAT,   // 0x200 - WNAM
100    pub templateWeapon: *mut TESObjectWEAP,           // 0x208 - CNAM
101    pub embeddedNode: BSFixedString,                  // 0x210
102    pub soundLevel: SOUND_LEVEL,                      // 0x218 - VNAM
103    pub pad21C: u32,                                  // 0x21C
104}
105const _: () = assert!(core::mem::size_of::<TESObjectWEAP>() == 0x220);