MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / getFrameCountHands

Method getFrameCountHands

game/state/rules/battle/battleunitanimationpack.cpp:97–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97int BattleUnitAnimationPack::getFrameCountHands(StateRef<AEquipmentType> heldItem,
98 BodyState currentBody, HandState currentHands,
99 HandState targetHands, MovementState movement,
100 Vec2<int> facing)
101{
102 sp<AnimationEntry> e;
103 if (currentHands == targetHands)
104 {
105 AnimationKey key = {
106 heldItem ? (heldItem->two_handed ? ItemWieldMode::TwoHanded : ItemWieldMode::OneHanded)
107 : ItemWieldMode::None,
108 currentHands, movement, currentBody};
109
110 e = standart_animations[key][facing];
111 }
112 else
113 {
114 ChangingHandAnimationKey key = {
115 heldItem ? (heldItem->two_handed ? ItemWieldMode::TwoHanded : ItemWieldMode::OneHanded)
116 : ItemWieldMode::None,
117 currentHands, targetHands, movement, currentBody};
118 e = hand_state_animations[key][facing];
119 }
120 if (e)
121 return e->frame_count;
122 else
123 return 0;
124}
125
126int BattleUnitAnimationPack::getFrameCountFiring(StateRef<AEquipmentType> heldItem,
127 BodyState currentBody, MovementState movement,

Callers 1

beginHandStateChangeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected