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