Esempio n. 1
0
        private void TriggerScoreChange(ScoreChange change, HitObject hitObject)
        {
            if (change == ScoreChange.Ignore)
            {
                return;
            }

            ScoreChange hitAmount = change & ScoreChange.HitValuesOnly;

            if (hitAmount != ScoreChange.Ignore)
            {
                //handle combo additions here
                ComboScoreCounts[hitAmount] += 1;

                List <HitObject> objects = ActiveStreamObjects;

                int index = objects.IndexOf(hitObject);
                int count = objects.Count;

                bool multitouchSameEndTime = hitObject.connectedObject != null && Math.Abs(hitObject.connectedObject.EndTime - hitObject.EndTime) < 10;

                //is next hitObject the end of a combo?
                if (index == count - 1 || //last object in the song.
                    objects[index + 1].NewCombo || //next object is a new combo.
                    (multitouchSameEndTime && index < count - 2 && objects[index + 1] == hitObject.connectedObject && objects[index + 2].NewCombo)    //this is part of a multitouch sequence with a new combo following.
                    )
                {
                    //apply combo addition
                    if (ComboScoreCounts[ScoreChange.Hit100] == 0 && ComboScoreCounts[ScoreChange.Hit50] == 0 && ComboScoreCounts[ScoreChange.Miss] == 0)
                    {
                        change |= ScoreChange.GekiAddition;
                    }
                    else if (ComboScoreCounts[ScoreChange.Hit50] == 0 && ComboScoreCounts[ScoreChange.Miss] == 0)
                    {
                        change |= ScoreChange.KatuAddition;
                    }
                    else
                    {
                        change |= ScoreChange.MuAddition;
                    }

                    if (!(multitouchSameEndTime && !hitObject.connectedObject.IsHit))
                    {
                        ResetComboCounts();
                    }
                }
            }

            hitObject.HitAnimation(change);

            if (OnScoreChanged != null)
            {
                OnScoreChanged(change, hitObject);
            }
        }