Exemplo n.º 1
0
 public override void Clear(NoteRanking ranking)
 {
     base.Clear(ranking);
     if (connectedNoteView == null && chainHead != null) // Last chain note
     {
         Destroy(chainHead.gameObject);
     }
 }
Exemplo n.º 2
0
 public virtual void Clear(NoteRanking ranking)
 {
     cleared = true;
     // Add to play data
     game.PlayData.ClearNote(note.id, ranking);
     particleManager.PlayClearFX(this, ranking);
     ringSpriteRenderer.enabled = false;
     fillSpriteRenderer.enabled = false;
     circleCollider.enabled     = false;
     StartCoroutine(DestroyLater());
 }
Exemplo n.º 3
0
 public override void Clear(NoteRanking ranking)
 {
     if (cleared)
     {
         Debug.LogError("This note is cleared already.");
     }
     base.Clear(ranking);
     if (holdRail != null)
     {
         Destroy(holdRail.gameObject);
     }
     if (holdCart != null)
     {
         Destroy(holdCart.gameObject);
     }
     if (mask != null)
     {
         Destroy(mask.gameObject);
     }
 }
Exemplo n.º 4
0
    public static float TpWeight(this NoteRanking ranking)
    {
        switch (ranking)
        {
        case NoteRanking.Perfect:
            return(1f);

        case NoteRanking.Excellent:
            return(0.7f);

        case NoteRanking.Good:
            return(0.3f);

        case NoteRanking.Bad:
            return(0f);

        case NoteRanking.Miss:
            return(0f);
        }
        return(0f);
    }
Exemplo n.º 5
0
 public void ClearNote(int id, NoteRanking ranking)
 {
     if (ranking != NoteRanking.Perfect && ranking != NoteRanking.Excellent)
     {
         CanMM = false;
     }
     if (NoteRankings[id] == NoteRanking.Undetermined)
     {
         NoteCleared++;
     }
     NoteRankings[id] = ranking;
     if (ranking == NoteRanking.Bad || ranking == NoteRanking.Miss)
     {
         Combo = 0;
     }
     else
     {
         Combo++;
         if (MaxCombo < Combo)
         {
             MaxCombo = Combo;
         }
     }
     Score += 900000f / NoteCount * ranking.ScoreWeight() + 100000f / (NoteCount * (float)(NoteCount + 1) / 2f) * Combo;
     if (Score > 999500)
     {
         if (NoteCleared == NoteCount && CanMM)
         {
             Score = 1000000;
         }
     }
     if (Score > 1000000)
     {
         Score = 1000000;
     }
     tpNow += 100f * ranking.TpWeight();
     Tp     = tpNow / NoteCleared;
 }
Exemplo n.º 6
0
    public void PlayClearFX(NoteView noteView, NoteRanking ranking)
    {
        var at      = noteView.transform.position;
        var clearFX = this.clearFX;

        if (noteView is ChainNoteView)
        {
            clearFX = clearChainFX;
        }
        if (noteView.note.type == NoteType.Hold)
        {
            at = new Vector3(at.x, ScannerView.Instance.transform.position.y, at.z);
        }
        if (ranking == NoteRanking.Miss)
        {
            var fx = Instantiate(missFX, at, Quaternion.identity);
            fx.Stop();

            var mainModule = fx.main;
            mainModule.simulationSpeed = 0.3f;
            mainModule.duration        = mainModule.duration / 0.3f;
            mainModule.startColor      = theme.missColor;

            /*var childFx = fx.transform.GetChild(0).GetComponent<ParticleSystem>();
             * var childMainModule = childFx.main;
             * childMainModule.startColor = noteView.fillColor;*/

            if (noteView.note.type == NoteType.Chain)
            {
                fx.transform.localScale = new Vector3(2, 2, 2);
            }

            fx.Play();
            Destroy(fx.gameObject, fx.main.duration);
        }
        else
        {
            var fx = Instantiate(clearFX, at, Quaternion.identity);
            fx.Stop();

            var speed = 1f;
            var color = theme.perfectColor;
            switch (ranking)
            {
            case NoteRanking.Excellent:
                speed = 0.9f;
                color = theme.excellentColor;
                break;

            case NoteRanking.Good:
                speed = 0.7f;
                color = theme.goodColor;
                break;

            case NoteRanking.Bad:
                speed = 0.5f;
                color = theme.badColor;
                break;
            }

            var mainModule = fx.main;
            mainModule.simulationSpeed = speed;
            mainModule.duration        = mainModule.duration / speed;
            mainModule.startColor      = color;

            if (noteView.note.type == NoteType.Chain)
            {
                fx.transform.localScale = new Vector3(3f, 3f, 3f);
            }

            /*var childFx = fx.transform.GetChild(0).GetComponent<ParticleSystem>();
             * var childMainModule = childFx.main;
             * childMainModule.startColor = noteView.fillColor;*/

            fx.Play();
            Destroy(fx.gameObject, fx.main.duration);
        }
    }