commonlibsse_ng\re\t\TESObjectWEAP/
data.rs1use crate::re::ActorValues::{ActorValue_CEnum, ActorValue_u8};
2
3use super::RangedData;
4
5#[commonlibsse_ng_derive_internal::to_bitflags]
6#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
7#[repr(u32)]
8pub enum WEAPON_HIT_BEHAVIOR {
9 Normal = 0,
10 DismemberOnly = 1,
11 ExplodeOnly = 2,
12 NoDismemberOrExplode = 3,
13}
14
15#[commonlibsse_ng_derive_internal::to_bitflags]
16#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
17#[repr(u8)]
18pub enum WEAPON_TYPE {
19 HandToHandMelee = 0,
20 OneHandSword = 1,
21 OneHandDagger = 2,
22 OneHandAxe = 3,
23 OneHandMace = 4,
24 TwoHandSword = 5,
25 TwoHandAxe = 6,
26 Bow = 7,
27 Staff = 8,
28 Crossbow = 9,
29}
30
31#[commonlibsse_ng_derive_internal::to_bitflags]
32#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
33#[repr(u16)]
34pub enum Flag2 {
35 None = 0,
36 PlayerOnly = 1 << 0,
37 NPCsUseAmmo = 1 << 1,
38 NoJamAfterReload = 1 << 2, MinorCrime = 1 << 4,
40 RangeFixed = 1 << 5,
41 NotUsedInNormalCombat = 1 << 6,
42 DontUse3rdPersonISAnim = 1 << 8, BurstShot = 1 << 9,
44 RumbleAlternate = 1 << 10,
45 LongBursts = 1 << 11,
46 NonHostile = 1 << 12,
47 BoundWeapon = 1 << 13,
48}
49
50#[commonlibsse_ng_derive_internal::to_bitflags]
51#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
52#[repr(u8)]
53pub enum AttackAnimation {
54 AttackLeft = 26,
55 AttackRight = 32,
56 Attack3 = 38,
57 Attack4 = 44,
58 Attack5 = 50,
59 Attack7 = 62,
60 Attack8 = 68,
61 AttackLoop = 74,
62 AttackSpin = 80,
63 AttackSpin2 = 86,
64 PlaceMine = 97,
65 PlaceMine2 = 103,
66 AttackThrow = 109,
67 AttackThrow2 = 115,
68 AttackThrow3 = 121,
69 AttackThrow4 = 127,
70 AttackThrow5 = 133,
71 Default = 255,
72}
73
74#[commonlibsse_ng_derive_internal::to_bitflags]
75#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
76#[repr(u8)]
77pub enum Flag {
78 None = 0,
79 IgnoresNormalWeaponResistance = 1 << 0,
80 Automatic = 1 << 1, HasScope = 1 << 2, CantDrop = 1 << 3,
83 HideBackpack = 1 << 4, EmbeddedWeapon = 1 << 5, DontUseFirstPersonISAnim = 1 << 6, NonPlayable = 1 << 7,
87}
88
89#[repr(C)]
90#[derive(Debug)]
91pub struct Data {
92 pub rangedData: *mut RangedData, pub speed: f32, pub reach: f32, pub minRange: f32, pub maxRange: f32, pub animationAttackMult: f32, pub unk1C: f32, pub staggerValue: f32, pub hitBehavior: WEAPON_HIT_BEHAVIOR, pub skill: ActorValue_CEnum, pub resistance: ActorValue_CEnum, pub flags2: Flag2, pub baseVATSToHitChance: u8, pub attackAnimation: AttackAnimation, pub embeddedWeaponAV: ActorValue_u8, pub animationType: WEAPON_TYPE, pub flags: Flag, pub unk37: u8, }
111const _: () = assert!(core::mem::size_of::<Data>() == 0x38);