1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
use std::ptr::NonNull;
use shared::F32Vector4;
use crate::cs::{ChrIns, FieldInsHandle};
/// Source of name: RTTI
#[repr(C)]
pub struct CSChrLadderModule {
vftable: usize,
pub owner: NonNull<ChrIns>,
/// FieldInsHandle of the ladder's [`crate::cs::CSWorldGeomIns`].
pub ladder_handle: FieldInsHandle,
/// Animation and control state for the currently ongoing ladder interaction.
pub state: LadderState,
/// Havok coordinates of the ladder's top.
pub top: F32Vector4,
/// Havok coordinates of the ladder's bottom.
pub bottom: F32Vector4,
unk40: u8,
unk44: u32,
flags: u8,
}
/// Left and right are viewed from the ladder's perspective (character's front) rather than
/// from the character's back.
/// When moving up or down the ladder your character starts alternating between left and right with
/// every step.
///
/// Source of entry names: common_define.hks.
#[repr(i8)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum LadderState {
/// Character is not on a ladder.
None = -1,
/// Getting onto the ladder from the bottom.
StartBottom = 0,
/// Getting onto the ladder fromn the top.
StartTop = 1,
/// Moving up using your left hand.
UpRight = 2,
/// Moving up using your right hand.
UpLeft = 3,
/// Moving down using your left hand.
DownRight = 4,
/// Moving down using your right hand.
DownLeft = 5,
/// Getting off the ladder at the top.
EndTop = 6,
/// Getting off the ladder at the bottom.
EndBottom = 7,
/// Not moving on the ladder with the left hand being the upper one.
IdleRight = 8,
/// Not moving on the ladder with the right hand being the upper one.
IdleLeft = 9,
/// Attacking (punching) up with your left hand.
AttackUpRight = 10,
/// Attacking (punching) up with your right hand.
AttackUpLeft = 11,
/// Attacking (kicking) down with your left leg.
AttackDownRight = 12,
/// Attacking (kicking) down with your right leg.
AttackDownLeft = 13,
/// Starting to slide down the ladder.
CoastStart = 14,
/// Slide down the ladder. Left was our last side to the dominant.
CoastRight = 15,
/// Stopping the slide downwards.
CoastStop = 16,
/// Slide down the ladder. Right was our last side to the dominant.
CoastLeft = 18,
/// Stopping the slide downwards by landing on the ground.
CoastLanding = 20,
/// Taking small amounts of damage.
DamageSmall = 21,
/// Taking large amounts of damage.
DamageLarge = 22,
}