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

Method getFrameCountBody

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

Source from the content-addressed store, hash-verified

66}
67
68int BattleUnitAnimationPack::getFrameCountBody(StateRef<AEquipmentType> heldItem,
69 BodyState currentBody, BodyState targetBody,
70 HandState currentHands, MovementState movement,
71 Vec2<int> facing)
72{
73 sp<AnimationEntry> e;
74 if (currentBody == targetBody)
75 {
76 AnimationKey key = {
77 heldItem ? (heldItem->two_handed ? ItemWieldMode::TwoHanded : ItemWieldMode::OneHanded)
78 : ItemWieldMode::None,
79 currentHands, movement, currentBody};
80
81 e = standart_animations[key][facing];
82 }
83 else
84 {
85 ChangingBodyStateAnimationKey key = {
86 heldItem ? (heldItem->two_handed ? ItemWieldMode::TwoHanded : ItemWieldMode::OneHanded)
87 : ItemWieldMode::None,
88 currentHands, movement, currentBody, targetBody};
89 e = body_state_animations[key][facing];
90 }
91 if (e)
92 return e->frame_count;
93 else
94 return 0;
95}
96
97int BattleUnitAnimationPack::getFrameCountHands(StateRef<AEquipmentType> heldItem,
98 BodyState currentBody, HandState currentHands,

Callers 6

tryToRiseUpMethod · 0.80
dropDownMethod · 0.80
beginBodyStateChangeMethod · 0.80
setBodyStateMethod · 0.80
setMovementStateMethod · 0.80
getGrenadeDecisionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected