示例#1
0
        public override void OnReleased(RushAction action)
        {
            if (!LaneMatchesAction(action))
            {
                return;
            }

            pressCount--;

            if (pressCount > 0 || AllJudged)
            {
                return;
            }

            if (HasBroken.Value || HoldStartTime == null || HoldEndTime != null)
            {
                return;
            }

            HoldEndTime = Time.Current;

            var tailOffset = Time.Current - Tail.HitObject.StartTime;

            tailOffset /= DrawableNoteSheetTail.RELEASE_WINDOW_LENIENCE;

            if (CompletionAmount < REQUIRED_COMPLETION)
            {
                HasBroken.Value = true;
            }
            else if (Tail.HitObject.HitWindows.CanBeHit(tailOffset))
            {
                Tail.UpdateResult();
                HasBroken.Value = !Tail.IsHit;
            }
        }
示例#2
0
        public override bool OnPressed(RushAction action)
        {
            if (AllJudged)
            {
                return(false);
            }

            if (!Air.AllJudged && Air.LaneMatchesAction(action))
            {
                Air.UpdateResult();
            }
            else if (!Ground.AllJudged && Ground.LaneMatchesAction(action))
            {
                Ground.UpdateResult();
            }
            else
            {
                return(false);
            }

            if (Air.AllJudged && Ground.AllJudged)
            {
                UpdateResult(true);
            }

            return(true);
        }
示例#3
0
        public override bool OnPressed(RushAction action)
        {
            if (!LaneMatchesAction(action) || Head.Judged)
            {
                return(false);
            }

            UpdateResult(true);
            return(Head.Judged);
        }
示例#4
0
        public override bool OnPressed(RushAction action)
        {
            if (!LaneMatchesAction(action) || AllJudged)
            {
                return(false);
            }

            if (!CheckHittable(this))
            {
                return(false);
            }

            return(UpdateResult(true));
        }
示例#5
0
        public override bool OnPressed(RushAction action)
        {
            if (AllJudged)
            {
                return(false);
            }

            var airResult    = !Air.AllJudged && Air.LaneMatchesAction(action) && Air.UpdateResult(true);
            var groundResult = !Ground.AllJudged && Ground.LaneMatchesAction(action) && Ground.UpdateResult(true);

            if (Air.AllJudged && Ground.AllJudged)
            {
                return(UpdateResult(true));
            }

            return(airResult || groundResult);
        }
示例#6
0
        public override bool OnPressed(RushAction action)
        {
            if (!action.IsLaneAction())
            {
                return(false);
            }

            if (!LaneMatchesAction(action) || Head.Judged)
            {
                return(false);
            }

            if (!CheckHittable(this))
            {
                return(false);
            }

            UpdateResult(true);
            return(Head.Judged);
        }
示例#7
0
        public override void OnReleased(RushAction action)
        {
            if (!LaneMatchesAction(action))
            {
                return;
            }

            // Check if there was also another action holding the same note sheet,
            // and use it in replace to this released one if so. (support for switching keys during hold)
            if (ActionInputManager.PressedActions.Count(LaneMatchesAction) > 1)
            {
                return;
            }

            // Note sheet not held yet (i.e. not our time yet) or already broken / finished.
            if (!Head.IsHit || Judged)
            {
                return;
            }

            UpdateResult(true);
        }
示例#8
0
        public override Replay Generate()
        {
            var pointGroups = generateActionPoints().GroupBy(a => a.Time).OrderBy(g => g.First().Time);

            var actions = new List <RushAction>();

            RushAction nextAir    = RushAction.AirPrimary;
            RushAction nextGround = RushAction.GroundPrimary;

            foreach (var group in pointGroups)
            {
                foreach (var point in group)
                {
                    switch (point)
                    {
                    case HitPoint _:
                        actions.Add(point.Lane == LanedHitLane.Air ? nextAir : nextGround);
                        break;

                    case ReleasePoint _:
                        actions.Remove(point.Lane == LanedHitLane.Air ? nextAir : nextGround);
                        if (point.Lane == LanedHitLane.Air)
                        {
                            nextAir = nextAir == RushAction.AirPrimary ? RushAction.AirSecondary : RushAction.AirPrimary;
                        }
                        else
                        {
                            nextGround = nextGround == RushAction.GroundPrimary ? RushAction.GroundSecondary : RushAction.GroundPrimary;
                        }
                        break;
                    }
                }

                Replay.Frames.Add(new RushReplayFrame(group.First().Time, actions.ToArray()));
            }

            return(Replay);
        }
示例#9
0
        public override bool OnPressed(RushAction action)
        {
            if (AllJudged || HasBroken.Value)
            {
                return(false);
            }

            if (!LaneMatchesAction(action))
            {
                return(false);
            }

            pressCount++;

            if (pressCount > 1)
            {
                return(true);
            }

            beginHoldAt(Time.Current - Head.HitObject.StartTime);
            Head.UpdateResult();

            return(true);
        }
示例#10
0
 public override bool OnPressed(RushAction action) => false;
示例#11
0
        public override bool OnPressed(RushAction action) => false; // Handled by the note sheet object itself.

        public override void OnReleased(RushAction action)
        {
        }
示例#12
0
 public override bool OnPressed(RushAction action) => false; // Handled by the note sheet object itself.
示例#13
0
 public override bool OnPressed(RushAction action) => UpdateResult(true);
示例#14
0
 public virtual void OnReleased(RushAction action)
 {
 }
示例#15
0
 public virtual bool OnPressed(RushAction action) => false;
示例#16
0
 public override bool OnPressed(RushAction action) => false; // Handled by the hold note
示例#17
0
 public static LanedHitLane Lane(this RushAction action) => action switch
 {
示例#18
0
 public virtual bool LaneMatchesAction(RushAction action) => action.Lane() == HitObject.Lane;
示例#19
0
 public static bool IsLaneAction(this RushAction action) => action < RushAction.Fever;
示例#20
0
        public override Replay Generate()
        {
            var pointGroups = generateActionPoints().GroupBy(a => a.Time).OrderBy(g => g.First().Time);

            var actions = new List <RushAction>();

            RushAction nextAir    = RushAction.AirPrimary;
            RushAction nextGround = RushAction.GroundPrimary;

            int airCount = 0, groundCount = 0;

            foreach (var group in pointGroups)
            {
                foreach (var point in group)
                {
                    switch (point)
                    {
                    case HitPoint _:
                        if (point.Lane == LanedHitLane.Air)
                        {
                            airCount++;
                            if (airCount == 1)
                            {
                                actions.Add(nextAir);
                            }
                        }
                        else
                        {
                            groundCount++;
                            if (groundCount == 1)
                            {
                                actions.Add(nextGround);
                            }
                        }

                        break;

                    case ReleasePoint _:
                        if (point.Lane == LanedHitLane.Air)
                        {
                            airCount--;

                            if (airCount == 0)
                            {
                                actions.Remove(nextAir);
                                nextAir = nextAir == RushAction.AirPrimary ? RushAction.AirSecondary : RushAction.AirPrimary;
                            }
                        }
                        else
                        {
                            groundCount--;

                            if (groundCount == 0)
                            {
                                actions.Remove(nextGround);
                                nextGround = nextGround == RushAction.GroundPrimary ? RushAction.GroundSecondary : RushAction.GroundPrimary;
                            }
                        }

                        break;
                    }
                }

                Replay.Frames.Add(new RushReplayFrame(group.First().Time, actions.ToArray())
                {
                    FeverActivationMode = FeverActivationMode.Automatic,
                });
            }

            return(Replay);
        }
示例#21
0
 public override bool OnPressed(RushAction action) => action.IsLaneAction() && UpdateResult(true);