use bitfield::bitfield;
use shared::{OwnedPtr, Subclass};
use std::ptr::NonNull;
use crate::cs::{CSPairAnimNode, ChrIns, P2PEntityHandle};
#[repr(C)]
#[derive(Subclass)]
#[subclass(base = CSPairAnimNode)]
pub struct CSThrowNode {
pub pair_anim_node: CSPairAnimNode,
unk58: [u8; 0x18],
pub throw_state: ThrowNodeState,
unk6c: u32,
unk70: f32,
unk74: f32,
unk78: f32,
unk7c: [u8; 0x34],
throw_self_esc: usize,
unkb8: [u8; 0xb8],
}
#[repr(C)]
pub struct CSChrThrowModule {
vftable: usize,
pub owner: NonNull<ChrIns>,
pub throw_node: OwnedPtr<CSThrowNode>,
pub flags: ThrowModuleFlags,
unk1c: u32,
unk20: u32,
p2p_entity_handle: P2PEntityHandle,
throw_target: usize,
unk28: [u8; 0x8],
}
#[repr(u32)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum ThrowNodeState {
Unk1 = 1,
Unk2 = 2,
InThrowAttacker = 3,
InThrowTarget = 4,
DeathAttacker = 5,
DeathTarget = 6,
Unk7 = 7,
Unk8 = 8,
}
bitfield! {
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
pub struct ThrowModuleFlags(u32);
impl Debug;
pub escape_transition, set_escape_transition: 0;
pub death_transition, set_death_transition: 1;
}