예제 #1
0
        protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
        {
            base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);

            lastBeatIndex = beatIndex;

            var beatLength = timingPoint.BeatLength;

            float amplitudeAdjust = Math.Min(1, 0.4f + amplitudes.Maximum);

            if (beatIndex < 0)
            {
                return;
            }

            if (IsHovered)
            {
                this.Delay(early_activation).Schedule(() => sampleBeat.Play());
            }

            logoBeatContainer
            .ScaleTo(1 - 0.02f * amplitudeAdjust, early_activation, Easing.Out)
            .Then()
            .ScaleTo(1, beatLength * 2, Easing.OutQuint);

            ripple.ClearTransforms();
            ripple
            .ScaleTo(logoAmplitudeContainer.Scale)
            .ScaleTo(logoAmplitudeContainer.Scale * (1 + 0.04f * amplitudeAdjust), beatLength, Easing.OutQuint)
            .FadeTo(0.15f * amplitudeAdjust).FadeOut(beatLength, Easing.OutQuint);

            if (effectPoint.KiaiMode && flashLayer.Alpha < 0.4f)
            {
                flashLayer.ClearTransforms();
                flashLayer
                .FadeTo(0.2f * amplitudeAdjust, early_activation, Easing.Out)
                .Then()
                .FadeOut(beatLength);

                visualizer.ClearTransforms();
                visualizer
                .FadeTo(0.9f * amplitudeAdjust, early_activation, Easing.Out)
                .Then()
                .FadeTo(0.5f, beatLength);
            }
        }
예제 #2
0
        protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
        {
            base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);

            if (!IsHovered)
            {
                return;
            }

            double duration = timingPoint.BeatLength / 2;

            icon.RotateTo(rightward ? 10 : -10, duration * 2, Easing.InOutSine);

            icon.Animate(
                i => i.MoveToY(-10, duration, Easing.Out),
                i => i.ScaleTo(1, duration, Easing.Out)
                ).Then(
                i => i.MoveToY(0, duration, Easing.In),
                i => i.ScaleTo(new Vector2(1, 0.9f), duration, Easing.In)
                );

            rightward = !rightward;
        }
예제 #3
0
        protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
        {
            base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);

            if (Hovering)
            {
                sampleBeat.Play();
            }

            lastBeatIndex = beatIndex;

            var beatLength = timingPoint.BeatLength;

            float amplitudeAdjust = Math.Min(1, 0.4f + amplitudes.Maximum);

            if (beatIndex < 0)
            {
                return;
            }

            logoBeatContainer.ScaleTo(1 - 0.02f * amplitudeAdjust, beat_in_time, EasingTypes.Out);
            using (logoBeatContainer.BeginDelayedSequence(beat_in_time))
                logoBeatContainer.ScaleTo(1, beatLength * 2, EasingTypes.OutQuint);

            ripple.ClearTransforms();

            ripple.ScaleTo(logoAmplitudeContainer.Scale);
            ripple.Alpha = 0.15f * amplitudeAdjust;

            ripple.ScaleTo(logoAmplitudeContainer.Scale * (1 + 0.04f * amplitudeAdjust), beatLength, EasingTypes.OutQuint);
            ripple.FadeOut(beatLength, EasingTypes.OutQuint);

            if (effectPoint.KiaiMode && flashLayer.Alpha < 0.4f)
            {
                flashLayer.ClearTransforms();
                visualizer.ClearTransforms();

                flashLayer.FadeTo(0.2f * amplitudeAdjust, beat_in_time, EasingTypes.Out);
                visualizer.FadeTo(0.9f * amplitudeAdjust, beat_in_time, EasingTypes.Out);
                using (flashLayer.BeginDelayedSequence(beat_in_time))
                    flashLayer.FadeOut(beatLength);
                using (visualizer.BeginDelayedSequence(beat_in_time))
                    visualizer.FadeTo(0.5f, beatLength);
            }
        }
예제 #4
0
        protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
        {
            if (effectPoint.KiaiMode)
            {
                bool   direction = beatIndex % 2 == 1;
                double duration  = timingPoint.BeatLength / 2;

                Child.RotateTo(direction ? 10 : -10, duration * 2, Easing.InOutSine);

                Child.Animate(i => i.MoveToY(-10, duration, Easing.Out))
                .Then(i => i.MoveToY(0, duration, Easing.In));
            }
            else
            {
                Child.ClearTransforms();
                Child.RotateTo(0, 500, Easing.Out);
                Child.MoveTo(Vector2.Zero, 500, Easing.Out);
            }
        }
예제 #5
0
 private void flash(Drawable d, double beatLength, bool kiai, TrackAmplitudes amplitudes)
 {
     d.FadeTo(Math.Max(0, ((d.Equals(leftBox) ? amplitudes.LeftChannel : amplitudes.RightChannel) - amplitude_dead_zone) / (kiai ? kiai_multiplier : alpha_multiplier)), box_fade_in_time)
     .Then()
     .FadeOut(beatLength, Easing.In);
 }
예제 #6
0
            protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
            {
                base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);

                var beatLength = timingPoint.BeatLength;

                float amplitudeAdjust = Math.Min(1, 0.4f + amplitudes.Maximum);

                if (beatIndex < 0)
                {
                    return;
                }

                icon.ScaleTo(1 - 0.1f * amplitudeAdjust, beat_in_time, Easing.Out)
                .Then()
                .ScaleTo(1, beatLength * 2, Easing.OutQuint);
            }
예제 #7
0
 protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
 {
     this.FadeColour(effectPoint.KiaiMode ? osuColour.PinkLight : osuColour.BlueLight, 1000);
 }
예제 #8
0
 protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
 {
     if (!hasSelection)
     {
         this.FadeTo(0.7f).FadeTo(0.4f, timingPoint.BeatLength, Easing.InOutSine);
     }
 }
예제 #9
0
파일: CirclePiece.cs 프로젝트: mist9/osu
        protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
        {
            if (!effectPoint.KiaiMode)
            {
                return;
            }

            if (beatIndex % (int)timingPoint.TimeSignature != 0)
            {
                return;
            }

            double duration = timingPoint.BeatLength * 2;

            background.FadeEdgeEffectTo(1, pre_beat_transition_time, EasingTypes.OutQuint);
            using (background.BeginDelayedSequence(pre_beat_transition_time))
                background.FadeEdgeEffectTo(edge_alpha_kiai, duration, EasingTypes.OutQuint);
        }
예제 #10
0
            protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
            {
                if (effectPoint.KiaiMode)
                {
                    kiaiBeatIndex += 1;

                    if (firstKiaiBeat)
                    {
                        visualisation.FlashColour(Color4.White, timingPoint.BeatLength * 4, Easing.In);
                        firstKiaiBeat = false;

                        return;
                    }

                    if (kiaiBeatIndex >= 5)
                    {
                        visualisation.FlashColour(Color4.White.Opacity(0.15f), timingPoint.BeatLength, Easing.In);
                    }
                }
                else
                {
                    firstKiaiBeat = true;
                    kiaiBeatIndex = 0;
                }
            }
예제 #11
0
        protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
        {
            base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);

            if (!IsHovered)
            {
                return;
            }

            bool   rightward = beatIndex % 2 == 1;
            double duration  = timingPoint.BeatLength / 2;

            icon.RotateTo(rightward ? 10 : -10, duration * 2, EasingTypes.InOutSine);

            icon.MoveToY(-10, duration, EasingTypes.Out);
            icon.ScaleTo(Vector2.One, duration, EasingTypes.Out);

            using (icon.BeginDelayedSequence(duration))
            {
                icon.MoveToY(0, duration, EasingTypes.In);
                icon.ScaleTo(new Vector2(1, 0.9f), duration, EasingTypes.In);
            }
        }
예제 #12
0
 protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
 {
     if (effectPoint.KiaiMode && kiaiEffect.Value)
     {
         visualisation.FadeIn(200);
     }
     else
     {
         visualisation.FadeOut(500);
     }
 }
예제 #13
0
            protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
            {
                base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);

                int beatsPerBar   = (int)timingPoint.TimeSignature;
                int segmentLength = beatsPerBar * Divisor * bars_per_segment;

                if (!IsBeatSyncedWithTrack)
                {
                    firstBeat = null;
                    return;
                }

                if (!firstBeat.HasValue || beatIndex < firstBeat)
                {
                    // decide on a good starting beat index if once has not yet been decided.
                    firstBeat = beatIndex < 0 ? 0 : (beatIndex / segmentLength + 1) * segmentLength;
                }

                if (beatIndex >= firstBeat)
                {
                    playBeatFor(beatIndex % segmentLength, timingPoint.TimeSignature);
                }
            }
예제 #14
0
            protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
            {
                base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);

                timingPointCount.Value   = timingPoints.Count;
                currentTimingPoint.Value = timingPoints.IndexOf(timingPoint);
                beatCount.Value          = calculateBeatCount(timingPoint);
                currentBeat.Value        = beatIndex;
                beatsPerMinute.Value     = 60000 / timingPoint.BeatLength;
                adjustedBeatLength.Value = timingPoint.BeatLength;

                flashLayer.ClearTransforms();
                flashLayer.FadeTo(1);
                flashLayer.FadeTo(0, timingPoint.BeatLength);
            }
예제 #15
0
        protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
        {
            if (beatIndex < 0)
            {
                return;
            }

            if (effectPoint.KiaiMode ? beatIndex % 2 == 0 : beatIndex % (int)timingPoint.TimeSignature == 0)
            {
                flash(leftBox, timingPoint.BeatLength, effectPoint.KiaiMode, amplitudes);
            }
            if (effectPoint.KiaiMode ? beatIndex % 2 == 1 : beatIndex % (int)timingPoint.TimeSignature == 0)
            {
                flash(rightBox, timingPoint.BeatLength, effectPoint.KiaiMode, amplitudes);
            }
        }
예제 #16
0
 protected virtual void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
 {
 }
예제 #17
0
 protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
 {
     kiaiMode = effectPoint.KiaiMode;
 }