Ejemplo n.º 1
0
        public override void OnJudgement(DrawableHitObject <TaikoHitObject, TaikoJudgement> judgedObject)
        {
            bool wasHit    = judgedObject.Judgement.Result == HitResult.Hit;
            bool secondHit = judgedObject.Judgement.SecondHit;

            judgementContainer.Add(new DrawableTaikoJudgement(judgedObject.Judgement)
            {
                Anchor = wasHit ? Anchor.TopLeft : Anchor.CentreLeft,
                Origin = wasHit ? Anchor.BottomCentre : Anchor.Centre,
                RelativePositionAxes = Axes.X,
                X = wasHit ? judgedObject.Position.X : 0,
            });

            if (!wasHit)
            {
                return;
            }

            if (!secondHit)
            {
                if (judgedObject.X >= -0.05f && !(judgedObject is DrawableSwell))
                {
                    // If we're far enough away from the left stage, we should bring outselves in front of it
                    topLevelHitContainer.Add(judgedObject.CreateProxy());
                }

                hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement));
            }
            else
            {
                hitExplosionContainer.Children.FirstOrDefault(e => e.Judgement == judgedObject.Judgement)?.AddSecondHit();
            }
        }
Ejemplo n.º 2
0
        internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement)
        {
            if (judgedObject.DisplayJudgement && judgementContainer.FirstOrDefault(j => j.JudgedObject == judgedObject) == null)
            {
                judgementContainer.Add(new DrawableTaikoJudgement(judgement, judgedObject)
                {
                    Anchor = judgement.IsHit ? Anchor.TopLeft : Anchor.CentreLeft,
                    Origin = judgement.IsHit ? Anchor.BottomCentre : Anchor.Centre,
                    RelativePositionAxes = Axes.X,
                    X = judgement.IsHit ? judgedObject.Position.X : 0,
                });
            }

            if (!judgement.IsHit)
            {
                return;
            }

            bool isRim = judgedObject.HitObject is RimHit;

            if (judgement is TaikoStrongHitJudgement)
            {
                hitExplosionContainer.Children.FirstOrDefault(e => e.JudgedObject == judgedObject)?.VisualiseSecondHit();
            }
            else
            {
                if (judgedObject.X >= -0.05f && judgedObject is DrawableHit)
                {
                    // If we're far enough away from the left stage, we should bring outselves in front of it
                    // Todo: The following try-catch is temporary for replay rewinding support
                    try
                    {
                        topLevelHitContainer.Add(judgedObject.CreateProxy());
                    }
                    catch
                    {
                    }
                }

                hitExplosionContainer.Add(new HitExplosion(judgedObject, isRim));

                if (judgedObject.HitObject.Kiai)
                {
                    kiaiExplosionContainer.Add(new KiaiHitExplosion(judgedObject, isRim));
                }
            }
        }