Beispiel #1
0
        public override bool OnPressed(TaikoAction action)
        {
            validKeyPressed = HitActions.Contains(action);

            // Only count this as handled if the new judgement is a hit
            return(UpdateJudgement(true));
        }
Beispiel #2
0
        public override bool OnPressed(TaikoAction action)
        {
            if (pressHandledThisFrame)
            {
                return(true);
            }

            if (Judged)
            {
                return(false);
            }

            validActionPressed = HitActions.Contains(action);

            // Only count this as handled if the new judgement is a hit
            var result = UpdateResult(true);

            if (IsHit)
            {
                HitAction = action;
            }

            // Regardless of whether we've hit or not, any secondary key presses in the same frame should be discarded
            // E.g. hitting a non-strong centre as a strong should not fall through and perform a hit on the next note
            pressHandledThisFrame = true;

            return(result);
        }
Beispiel #3
0
        public bool OnPressed(KeyBindingPressEvent <TauAction> e)
        {
            if (AllJudged)
            {
                return(false);
            }

            if (HitActions.Contains(e.Action))
            {
                return(UpdateResult(true));
            }

            return(false);
        }
Beispiel #4
0
        public bool OnPressed(TauAction action)
        {
            if (AllJudged)
            {
                return(false);
            }

            if (HitActions.Contains(action))
            {
                return(UpdateResult(true));
            }

            return(false);
        }
Beispiel #5
0
        public bool OnPressed(TauAction action)
        {
            if (Judged)
            {
                return(false);
            }

            validActionPressed = HitActions.Contains(action);

            var result = UpdateResult(true);

            if (IsHit)
            {
                HitAction = action;
            }

            return(result);
        }
Beispiel #6
0
        public bool OnPressed(KeyBindingPressEvent <TauAction> e)
        {
            if (Judged)
            {
                return(false);
            }

            validActionPressed = HitActions.Contains(e.Action);

            var result = UpdateResult(true);

            if (IsHit)
            {
                HitAction = e.Action;
            }

            return(result);
        }
 public TDCHitByWeapon(HitActions mHitAction)
 {
     switch (mHitAction)
     {
         case HitActions.Break:
             HitAction += Break;
             break;
         case HitActions.KillBrain:
             HitAction += KillBrain;
             break;
         case HitActions.Kill:
             HitAction += Kill;
             break;
         case HitActions.BreakIfOff:
             HitAction += BreakIfOff;
             break;
     }
 }
Beispiel #8
0
        public override bool OnPressed(TaikoAction action)
        {
            if (Judged)
            {
                return(false);
            }

            validActionPressed = HitActions.Contains(action);

            // Only count this as handled if the new judgement is a hit
            var result = UpdateResult(true);

            if (IsHit)
            {
                HitAction = action;
            }

            return(result);
        }
Beispiel #9
0
        public override bool OnPressed(TaikoAction action)
        {
            // Check if we've handled the first key
            if (Judgement.Result == HitResult.None)
            {
                // First key hasn't been handled yet, attempt to handle it
                bool handled = base.OnPressed(action);

                if (handled)
                {
                    firstHitTime   = Time.Current;
                    firstHitAction = action;
                    firstKeyHeld   = true;
                }

                return(handled);
            }

            // If we've already hit the second key, don't handle this object any further
            if (Judgement.SecondHit)
            {
                return(false);
            }

            // Don't handle represses of the first key
            if (firstHitAction == action)
            {
                return(false);
            }

            // Don't handle invalid hit action presses
            if (!HitActions.Contains(action))
            {
                return(false);
            }

            // Assume the intention was to hit the strong hit with both keys only if the first key is still being held down
            return(firstKeyHeld && UpdateJudgement(true));
        }
Beispiel #10
0
        public override bool OnPressed(TaikoAction action)
        {
            validKeyPressed = HitActions.Contains(action);

            return(UpdateJudgement(true));
        }
Beispiel #11
0
 public bool OnPressed(KeyBindingPressEvent <TauAction> e) => HitActions.Contains(e.Action) && !Tracking.Value;
Beispiel #12
0
        protected override void UpdateAfterChildren()
        {
            base.UpdateAfterChildren();
            path.ClearVertices();

            float maxDistance = TauPlayfield.BASE_SIZE.X / 2;

            for (double t = Math.Max(Time.Current, HitObject.StartTime + HitObject.Nodes.First().Time);
                 t < Math.Min(Time.Current + HitObject.TimePreempt, HitObject.StartTime + HitObject.Nodes.Last().Time);
                 t += 20) // Generate vertex every 20ms
            {
                var currentNode = HitObject.Nodes.Last(x => t >= HitObject.StartTime + x.Time);
                var nextNode    = HitObject.Nodes.GetNext(currentNode);

                double nodeStart = HitObject.StartTime + currentNode.Time;
                double nodeEnd   = HitObject.StartTime + nextNode.Time;
                double duration  = nodeEnd - nodeStart;

                float actualProgress = (float)((t - nodeStart) / duration);

                // Larger the time, the further in it is.
                float distanceFromCentre = (float)(1 - ((t - Time.Current) / HitObject.TimePreempt)) * maxDistance;

                if (inversed)
                {
                    distanceFromCentre = (maxDistance * 2) - distanceFromCentre;
                }

                // Angle calc
                float difference = (nextNode.Angle - currentNode.Angle) % 360;

                if (difference > 180)
                {
                    difference -= 360;
                }
                else if (difference < -180)
                {
                    difference += 360;
                }

                float targetAngle = (float)Interpolation.Lerp(currentNode.Angle, currentNode.Angle + difference, actualProgress);

                path.AddVertex(Extensions.GetCircularPosition(distanceFromCentre, targetAngle));
            }

            //Check if the last node is visible
            if (Time.Current + HitObject.TimePreempt > HitObject.StartTime + HitObject.Nodes.Last().Time)
            {
                double timeDiff = HitObject.StartTime + HitObject.Nodes.Last().Time - Time.Current;
                double progress = 1 - (timeDiff / HitObject.TimePreempt);

                float endNodeDistanceFromCentre = (float)(progress * maxDistance);

                if (inversed)
                {
                    endNodeDistanceFromCentre = (maxDistance * 2) - endNodeDistanceFromCentre;
                }

                path.AddVertex(Extensions.GetCircularPosition(endNodeDistanceFromCentre, HitObject.Nodes.Last().Angle));
            }

            path.Position       = path.Vertices.Any() ? path.Vertices.First() : new Vector2(0);
            path.OriginPosition = path.Vertices.Any() ? path.PositionInBoundingBox(path.Vertices.First()) : base.OriginPosition;

            if (IsWithinPaddle && TauActionInputManager.PressedActions.Any(x => HitActions.Contains(x)))
            {
                if (Tracking.Value == false)
                {
                    Tracking.Value = true;
                }
            }
            else
            {
                if (Tracking.Value)
                {
                    Tracking.Value = false;
                }
            }

            if (Time.Current < HitObject.StartTime || Time.Current >= HitObject.GetEndTime())
            {
                return;
            }

            if (IsWithinPaddle && TauActionInputManager.PressedActions.Any(x => HitActions.Contains(x)))
            {
                if (!HitObject.Kiai)
                {
                    playfield?.CreateSliderEffect(Vector2.Zero.GetDegreesFromPosition(path.Position));
                }

                totalTimeHeld += Time.Elapsed;

                if (!HitObject.Kiai)
                {
                    return;
                }

                var       angle    = Vector2.Zero.GetDegreesFromPosition(path.Position);
                Drawable  particle = Empty();
                const int duration = 1500;

                switch (effect.Value)
                {
                case KiaiType.Turbulent:
                    if ((int)totalTimeHeld % 8 == 0)
                    {
                        playfield.SliderParticleEmitter.AddParticle(angle, inversed);
                    }

                    break;

                case KiaiType.Classic:
                    if ((int)Time.Current % 8 != 0)
                    {
                        break;
                    }

                    particle = new Triangle
                    {
                        Position = Extensions.GetCircularPosition(380, angle),
                        Rotation = (float)RNG.NextDouble() * 360f,
                        Anchor   = Anchor.Centre,
                        Origin   = Anchor.Centre,
                        Size     = new Vector2(RNG.Next(5, 15)),
                        Clock    = new FramedClock(),
                        Alpha    = RNG.NextSingle(0.25f, 1f),
                        Blending = BlendingParameters.Additive,
                        Colour   = TauPlayfield.ACCENT_COLOR.Value
                    };

                    particle.MoveTo(Extensions.GetCircularPosition(inversed ? -((RNG.NextSingle() * 75) + 390) : ((RNG.NextSingle() * 75) + 390), angle), duration, Easing.OutQuint)
                    .RotateTo(RNG.NextSingle(-720, 720), duration).FadeOut(duration).Expire();

                    playfield.SliderParticleEmitter.Add(particle);

                    break;
                }
            }
        }