| 5234 | } |
| 5235 | |
| 5236 | void BattleUnit::beginHandStateChange(HandState state) |
| 5237 | { |
| 5238 | // This is ONLY called after confirming with canHandStateChange that change is valid |
| 5239 | // Therefore, we're not checking for conditions |
| 5240 | |
| 5241 | if (target_hand_state == state) |
| 5242 | { |
| 5243 | return; |
| 5244 | } |
| 5245 | |
| 5246 | int frameCount = agent->getAnimationPack()->getFrameCountHands( |
| 5247 | displayedItem, current_body_state, current_hand_state, state, current_movement_state, |
| 5248 | facing); |
| 5249 | int ticks = frameCount * TICKS_PER_FRAME_UNIT; |
| 5250 | |
| 5251 | if (ticks > 0 && target_hand_state != state) |
| 5252 | { |
| 5253 | target_hand_state = state; |
| 5254 | hand_animation_ticks_remaining = ticks; |
| 5255 | } |
| 5256 | else |
| 5257 | { |
| 5258 | setHandState(state); |
| 5259 | } |
| 5260 | residual_aiming_ticks_remaining = 0; |
| 5261 | } |
| 5262 | |
| 5263 | void BattleUnit::setHandState(HandState state) |
| 5264 | { |
nothing calls this directly
no test coverage detected