366 {
368 {
370 {
371 const float animPhaseOffset = 0.167;
372
373 Magnum_Cylinder cylinder = Magnum_Cylinder.Cast(GetAttachmentByType(Magnum_Cylinder));
374 Magnum_Ejector ejector = Magnum_Ejector.Cast(GetAttachmentByType(Magnum_Ejector));
375
376 if (cylinder)
377 {
378 float animPhase = cylinder.GetAnimationPhase("Rotate_Cylinder");
379 if (animPhase + animPhaseOffset > 1.0)
380 {
381 animPhase -= 1.0;
382 cylinder.ResetAnimationPhase("Rotate_Cylinder", animPhase);
383 ejector.ResetAnimationPhase("Rotate_Ejector", animPhase);
384 }
385
386 cylinder.SetAnimationPhase("Rotate_Cylinder", animPhase);
387 ejector.ResetAnimationPhase("Rotate_Ejector", animPhase);
388 }
389 }
390 }
391
392 return super.OnAction(action_id, player, ctx);
393 }