Exemplo n.º 1
0
        public void SetNote(int id, float start, float end, float frame, float speed, float threshold, NoteInfo mode, FlickMode flick, Color32 color, List <int> previous, int next)
        {
            ID              = id;
            StartLine       = start;
            EndLine         = end;
            ReachFrame      = frame;
            Speed           = speed;
            FlickThreshold  = threshold;
            Mode            = mode;
            Flick           = flick;
            ColorKey        = color;
            PreviousNoteIDs = previous;
            NextNoteID      = next;

            SetNoteObject();
            ResetValue();
        }
Exemplo n.º 2
0
 /// <summary>
 /// 플릭 노트의 판정 쿨타임을 재설정하는 함수입니다.
 /// </summary>
 /// <param name="flick">해당 노트의 플릭 모드입니다.</param>
 /// <param name="pos">해당 노트의 도달 지점 값입니다.</param>
 public void SetFlickHitted(FlickMode flick, double pos)
 {
     if (flick.Equals(FlickMode.Left))
     {
         LeftHitted[pos]        = true;
         RightHitted[pos]       = false;
         RightRecoverCount[pos] = 0;
         UpHitted[pos]          = false;
         UpRecoverCount[pos]    = 0;
         DownHitted[pos]        = false;
         DownRecoverCount[pos]  = 0;
     }
     else if (flick.Equals(FlickMode.Right))
     {
         RightHitted[pos]      = true;
         LeftHitted[pos]       = false;
         LeftRecoverCount[pos] = 0;
         UpHitted[pos]         = false;
         UpRecoverCount[pos]   = 0;
         DownHitted[pos]       = false;
         DownRecoverCount[pos] = 0;
     }
     else if (flick.Equals(FlickMode.Up))
     {
         UpHitted[pos]          = true;
         LeftHitted[pos]        = false;
         LeftRecoverCount[pos]  = 0;
         RightHitted[pos]       = false;
         RightRecoverCount[pos] = 0;
         DownHitted[pos]        = false;
         DownRecoverCount[pos]  = 0;
     }
     else if (flick.Equals(FlickMode.Down))
     {
         DownHitted[pos]        = true;
         LeftHitted[pos]        = false;
         LeftRecoverCount[pos]  = 0;
         RightHitted[pos]       = false;
         RightRecoverCount[pos] = 0;
         UpHitted[pos]          = false;
         UpRecoverCount[pos]    = 0;
     }
 }
Exemplo n.º 3
0
 public bool FindFlickHitted(FlickMode flick, double pos)
 {
     if (flick.Equals(FlickMode.Left))
     {
         return(LeftHitted[pos]);
     }
     else if (flick.Equals(FlickMode.Right))
     {
         return(RightHitted[pos]);
     }
     else if (flick.Equals(FlickMode.Up))
     {
         return(UpHitted[pos]);
     }
     else if (flick.Equals(FlickMode.Down))
     {
         return(DownHitted[pos]);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 4
0
        private void ParseSSTrain(string path)
        {
            bool         initNoteUsed = false;
            float        initNotePos  = 0;
            StreamReader stream       = null;

            try { stream = new StreamReader(path); }
            catch { Game.ThrowError(ErrorMode.NoJsonFile); }
            try
            {
                string   rawdata = stream.ReadToEnd();
                JsonData data    = JsonMapper.ToObject(rawdata);
                if (PlayerPrefs.HasKey("gamesync").Equals(true))
                {
                    initNotePos = PlayerPrefs.GetFloat("gamesync");
                }
                else
                {
                    Game.ThrowError(ErrorMode.NoSyncValue); return;
                }
                for (int i = 0; i < data["notes"].Count; i++)
                {
                    int    index = (int)data["notes"][i]["id"];
                    double frame;
                    if (data["notes"][i]["timing"].IsDouble.Equals(true))
                    {
                        frame = (double)data["notes"][i]["timing"];
                    }
                    else
                    {
                        frame = (int)data["notes"][i]["timing"];
                    }
                    if (initNoteUsed.Equals(false) && initNotePos <= (float)frame)
                    {
                        Game.Dispensor.CreateNote(0, 0, Color.white, NoteInfo.SystemNoteStarter, FlickMode.None, initNotePos, Game.GlobalNoteSpeed, 1, 1, new List <int>()); initNoteUsed = true;
                    }
                    int       speci = (int)data["notes"][i]["type"];
                    int       start = (int)data["notes"][i]["startPos"];
                    int       end   = (int)data["notes"][i]["endPos"];
                    FlickMode mode  = (FlickMode)(int)data["notes"][i]["status"];
                    int       prev  = (int)data["notes"][i]["prevNoteId"];
                    int       next  = (int)data["notes"][i]["nextNoteId"];
                    // 예외적 허용: 롱 노트 끝부분 슬라이드를 종류 1번으로 처리한 채보가 존재함. 그 때 값을 2로 수정. 그리고 롱 노트 끝부분의 경우 시작지점 통일
                    if (prev > 0 && Game.Dispensor.Notes[prev].Mode.Equals(NoteInfo.LongNoteStart))
                    {
                        if (speci.Equals(1))
                        {
                            speci = 2;
                        }
                        start = (int)Game.Dispensor.Notes[prev].StartLine;
                        if (DataSender.ReturnMirror())
                        {
                            start = 6 - start;
                        }
                    }

                    NoteInfo noteMode = NoteInfo.NormalNote;
                    if (speci.Equals(1))
                    {
                        noteMode = NoteInfo.NormalNote;
                    }
                    else if (speci.Equals(2) && prev <= 0)
                    {
                        noteMode = NoteInfo.LongNoteStart;
                    }
                    else if (speci.Equals(2) && prev > 0)
                    {
                        noteMode = NoteInfo.LongNoteEnd;
                    }
                    else if (speci.Equals(3) && prev <= 0)
                    {
                        noteMode = NoteInfo.SlideNoteStart;
                    }
                    else if (speci.Equals(3) && prev > 0)
                    {
                        noteMode = NoteInfo.SlideNoteCheckpoint;
                    }
                    //else if (speci.Equals(3) && prev > 0 && next <= 0) { noteMode = NoteInfo.SlideNoteEnd; }

                    if (DataSender.ReturnRandWave())
                    {
                        start = UnityEngine.Random.Range(1, 6);
                    }
                    if (DataSender.ReturnMirror())
                    {
                        if (mode.Equals(FlickMode.Left))
                        {
                            mode = FlickMode.Right;
                        }
                        else if (mode.Equals(FlickMode.Right))
                        {
                            mode = FlickMode.Left;
                        }
                        start = 6 - start;
                        end   = 6 - end;
                    }

                    List <int> Prevs = new List <int>();
                    if (prev > 0)
                    {
                        Prevs.Add(prev);
                    }
                    Game.Dispensor.CreateNote(index, 1, new Color32(255, 255, 255, 255), noteMode, mode, (float)frame * 60, Game.GlobalNoteSpeed, start, end, Prevs);
                }
            }
            catch (Exception e)
            {
                Game.ThrowError(ErrorMode.NotemapSyntaxError, e.Message + e.StackTrace);
                Debug.Log(e);
            }
            stream.Close();
        }
Exemplo n.º 5
0
        private void ParseTWx(int maxLine)
        {
            float        StarterNotePos = 0;
            StreamReader stream         = null;

            try { stream = new StreamReader(DataSender.ReturnMobilePath(DataSender.ReturnNotemapMode())); }
            catch { Game.ThrowError(ErrorMode.NoJsonFile); return; }

            try
            {
                string   RawData = stream.ReadToEnd();
                JsonData data    = JsonMapper.ToObject(RawData);
                if (PlayerPrefs.HasKey("gamesync").Equals(true))
                {
                    StarterNotePos = PlayerPrefs.GetFloat("gamesync");
                }
                Game.Dispensor.CreateNote(0, 0, Color.white, NoteInfo.SystemNoteStarter, FlickMode.None, StarterNotePos, Game.GlobalNoteSpeed, 1, 1, new List <int>());

                int verCode = 0;
                try { verCode = (int)data["version"]; }
                catch { verCode = 0; }
                Debug.Log("TWx version: " + verCode + ", Max line: " + maxLine);

                for (int i = 0; i < data["notes"].Count; i++)
                {
                    int        id     = (int)data["notes"][i]["ID"];
                    int        size   = (int)data["notes"][i]["Size"];
                    Color32    color  = new Color32((byte)(int)data["notes"][i]["Color"][0], (byte)(int)data["notes"][i]["Color"][1], (byte)(int)data["notes"][i]["Color"][2], (byte)(int)data["notes"][i]["Color"][3]);
                    int        ModNum = (int)data["notes"][i]["Mode"];
                    FlickMode  flick  = (FlickMode)(int)data["notes"][i]["Flick"];
                    double     time   = (double)data["notes"][i]["Time"];
                    double     speed  = (double)data["notes"][i]["Speed"];
                    double     start  = (double)data["notes"][i]["StartLine"];
                    double     end    = (double)data["notes"][i]["EndLine"];
                    List <int> prevs  = new List <int>();
                    for (int j = 0; j < data["notes"][i]["PrevIDs"].Count; j++)
                    {
                        if (!((int)data["notes"][i]["PrevIDs"][j]).Equals(0))
                        {
                            prevs.Add((int)data["notes"][i]["PrevIDs"][j]);
                        }
                    }
                    //int next = (int)data["notes"][i]["NextID"];

                    if (verCode < 1)
                    {
                        double k = 0;
                        if (maxLine.Equals(2))
                        {
                            k = 1.5 - ((1.5 - start) * (9d / 5));
                        }
                        else if (maxLine.Equals(4))
                        {
                            k = 2.5 - ((2.5 - start) * (9d / 5));
                        }
                        else if (maxLine.Equals(6))
                        {
                            k = 3.5 - ((3.5 - start) * (9d / 5));
                        }
                        start = k;
                    }

                    NoteInfo mode = NoteInfo.NormalNote;
                    if (ModNum.Equals(0))
                    {
                        mode = NoteInfo.NormalNote;
                    }
                    else if (ModNum.Equals(1) && prevs.Count.Equals(0))
                    {
                        mode = NoteInfo.LongNoteStart;
                    }
                    else if (ModNum.Equals(1) && prevs.Count > 0)
                    {
                        mode = NoteInfo.LongNoteEnd;
                    }
                    else if (ModNum.Equals(2) && prevs.Count.Equals(0))
                    {
                        mode = NoteInfo.SlideNoteStart;
                    }
                    else if (ModNum.Equals(2) && prevs.Count > 0)
                    {
                        mode = NoteInfo.SlideNoteCheckpoint;
                    }
                    else if (ModNum.Equals(3))
                    {
                        mode = NoteInfo.DamageNote;
                    }
                    else if (ModNum.Equals(4))
                    {
                        mode = NoteInfo.HiddenNote;
                    }
                    else if (ModNum.Equals(12))
                    {
                        mode = NoteInfo.SystemNoteScroller;
                    }
                    //else if (ModNum.Equals(11)) { mode = NoteInfo.SystemNoteSpeeder; }

                    if (DataSender.ReturnRandWave())
                    {
                        start = UnityEngine.Random.Range(0f, maxLine + 1);
                    }
                    if (DataSender.ReturnMirror())
                    {
                        if (flick.Equals(FlickMode.Left))
                        {
                            flick = FlickMode.Right;
                        }
                        else if (flick.Equals(FlickMode.Right))
                        {
                            flick = FlickMode.Left;
                        }
                        start = (maxLine + 1) - start;
                        end   = (maxLine + 1) - end;
                    }
                    Game.Dispensor.CreateNote(id, size, color, mode, flick, (float)time * 60, (float)speed * Game.GlobalNoteSpeed, (float)start, (float)end, prevs);
                }
            }
            catch (Exception e)
            {
                Game.ThrowError(ErrorMode.NotemapSyntaxError, e.Message + e.StackTrace);
                Debug.Log(e);
                return;
            }

            stream.Close();
        }
Exemplo n.º 6
0
        public Sprite GetNoteTexture(NoteInfo mode, FlickMode flick)
        {
            Sprite text = null;

            if (Mode.Equals(GameMode.Starlight) || Mode.Equals(GameMode.Platinum))
            {
                if (!flick.Equals(FlickMode.None))
                {
                    text = Instantiate(IsNoteColored ? StarlightWhite[(int)flick] : StarlightTexture[(int)flick]) as Sprite;
                }
                else
                {
                    if (mode.Equals(NoteInfo.NormalNote))
                    {
                        text = Instantiate(IsNoteColored ? StarlightWhite[0] : StarlightTexture[0]) as Sprite;
                    }
                    else if (mode.Equals(NoteInfo.LongNoteStart) || mode.Equals(NoteInfo.LongNoteEnd))
                    {
                        text = Instantiate(IsNoteColored ? StarlightWhite[5] : StarlightTexture[5]) as Sprite;
                    }
                    else if (mode.Equals(NoteInfo.SlideNoteStart) || mode.Equals(NoteInfo.SlideNoteEnd) || mode.Equals(NoteInfo.SystemNoteSlideDummy))
                    {
                        text = Instantiate(IsNoteColored ? StarlightWhite[6] : StarlightTexture[6]) as Sprite;
                    }
                    else if (mode.Equals(NoteInfo.SlideNoteCheckpoint))
                    {
                        text = Instantiate(IsNoteColored ? StarlightWhite[7] : StarlightTexture[7]) as Sprite;
                    }
                    else if (mode.Equals(NoteInfo.DamageNote))
                    {
                        text = Instantiate(IsNoteColored ? StarlightWhite[8] : StarlightTexture[8]) as Sprite;
                    }
                }
            }
            else
            {
                if (!flick.Equals(FlickMode.None))
                {
                    text = Instantiate(IsNoteColored ? WhiteTexture[(int)flick] : NoteTexture[(int)flick]) as Sprite;
                }
                else
                {
                    if (mode.Equals(NoteInfo.NormalNote))
                    {
                        text = Instantiate(IsNoteColored ? WhiteTexture[0] : NoteTexture[0]) as Sprite;
                    }
                    else if (mode.Equals(NoteInfo.LongNoteStart) || mode.Equals(NoteInfo.LongNoteEnd))
                    {
                        text = Instantiate(IsNoteColored ? WhiteTexture[5] : NoteTexture[5]) as Sprite;
                    }
                    else if (mode.Equals(NoteInfo.SlideNoteStart) || mode.Equals(NoteInfo.SlideNoteEnd) || mode.Equals(NoteInfo.SystemNoteSlideDummy))
                    {
                        text = Instantiate(IsNoteColored ? WhiteTexture[6] : NoteTexture[6]) as Sprite;
                    }
                    else if (mode.Equals(NoteInfo.SlideNoteCheckpoint))
                    {
                        text = Instantiate(IsNoteColored ? WhiteTexture[7] : NoteTexture[7]) as Sprite;
                    }
                    else if (mode.Equals(NoteInfo.DamageNote))
                    {
                        text = Instantiate(IsNoteColored ? WhiteTexture[8] : NoteTexture[8]) as Sprite;
                    }
                }
            }
            return(text);
        }
Exemplo n.º 7
0
        public void CreateNote(int ID, int Size, Color32 Color, NoteInfo Mode, FlickMode Flick, float Time, float Speed, float Start, float End, List <int> Prev)
        {
            if (Mode.Equals(NoteInfo.SlideNoteStart))
            {
                CreateNote(ID, Size, Color, NoteInfo.SystemNoteSlideDummy, Flick, Time, Speed, Start, End, new List <int>());
            }

            GameObject newNote  = null;
            Note       noteComp = null;

            if (Game.Mode.Equals(GameMode.Starlight))
            {
                if (Size <= 1)
                {
                    newNote = Instantiate(Game.StarlightNote) as GameObject;
                }
                else
                {
                    newNote = Instantiate(Game.StarlightXL) as GameObject;
                }
                noteComp = newNote.GetComponent <StarlightNote>();
            }
            else if (Game.Mode.Equals(GameMode.Theater) || Game.Mode.Equals(GameMode.Theater4) || Game.Mode.Equals(GameMode.Theater2L) || Game.Mode.Equals(GameMode.Theater2P))
            {
                if (Size.Equals(0))
                {
                    newNote = Instantiate(Game.TheaterSmall) as GameObject;
                }
                else if (Size.Equals(1))
                {
                    newNote = Instantiate(Game.TheaterLarge) as GameObject;
                }
                else if (Size > 1)
                {
                    newNote = Instantiate(Game.TheaterXL) as GameObject;
                }
                noteComp = newNote.GetComponent <TheaterNote>();
            }
            else if (Game.Mode.Equals(GameMode.Platinum))
            {
                if (Size.Equals(0))
                {
                    newNote = Instantiate(Game.PlatinumSmall) as GameObject;
                }
                else if (Size.Equals(1))
                {
                    newNote = Instantiate(Game.PlatinumLarge) as GameObject;
                }
                else if (Size > 1)
                {
                    newNote = Instantiate(Game.PlatinumXL) as GameObject;
                }
                noteComp = newNote.GetComponent <PlatinumNote>();
            }
            newNote.GetComponent <RectTransform>().SetParent(Game.NoteParent, false);
            float resist = 0;

            if (!Flick.Equals(FlickMode.None))
            {
                int flickVal;
                if (PlayerPrefs.HasKey("flickmode"))
                {
                    flickVal = PlayerPrefs.GetInt("flickmode");
                }
                else
                {
                    flickVal = 1;
                }
                if (flickVal.Equals(0))
                {
                    resist = 20;
                }
                else if (flickVal.Equals(1))
                {
                    resist = 40;
                }
                else if (flickVal.Equals(2))
                {
                    resist = 60;
                }
                else if (flickVal.Equals(3))
                {
                    // TODO 하기
                    //if (!Game.Mode.Equals(GameMode.Starlight)) { resist = 35; }
                    if (Game.Mode.Equals(GameMode.Starlight))
                    {
                        bool applied = false;
                        for (int i = 0; i < Prev.Count; i++)
                        {
                            if (!Notes[Prev[i]].Flick.Equals(FlickMode.None))
                            {
                                float decVal;
                                if (Time * (1 / Game.ScrollAmp) - Notes[Prev[i]].ReachFrame < 4)
                                {
                                    decVal = 20;
                                }
                                else if (Time * (1 / Game.ScrollAmp) - Notes[Prev[i]].ReachFrame >= 20)
                                {
                                    decVal = 60;
                                }
                                else
                                {
                                    decVal = 20 + (2.5f * (Time * (1 / Game.ScrollAmp) - Notes[Prev[i]].ReachFrame - 4));
                                }
                                Notes[Prev[i]].FlickThreshold = decVal;
                                resist  = decVal;
                                applied = true;
                            }
                        }
                        if (!applied)
                        {
                            resist = 40;
                        }
                    }
                    else
                    {
                        resist = 50;
                    }
                }
            }
            noteComp.SetNote(ID, Start, End, Time * (1 / Game.ScrollAmp), Speed, resist, Mode, Flick, Color, Prev, 0);
            if ((int)noteComp.Mode < 10)
            {
                if (!Game.Judger.NoteQueue.ContainsKey(noteComp.EndLine))
                {
                    Game.Judger.MakeNewKey(noteComp.EndLine);
                }
                Game.Judger.NoteQueue[noteComp.EndLine].Add(noteComp.ID);
            }
            if (!Mode.Equals(NoteInfo.SystemNoteSlideDummy))
            {
                Notes.Add(ID, noteComp);
                NoteCount++;
            }
            else
            {
                Notes.Add(XLNoteID--, noteComp);
            }
            for (int i = 0; i < Prev.Count; i++)
            {
                Notes[Prev[i]].NextNoteID = ID;
                Notes[Prev[i]].CreateTailConnector();
                if (Game.Mode.Equals(GameMode.Theater) || Game.Mode.Equals(GameMode.Theater4) || Game.Mode.Equals(GameMode.Theater2L) || Game.Mode.Equals(GameMode.Theater2P))
                {
                    if ((Notes[Prev[i]].Mode.Equals(NoteInfo.LongNoteStart) ||
                         Notes[Prev[i]].Mode.Equals(NoteInfo.SlideNoteStart) ||
                         Notes[Prev[i]].Mode.Equals(NoteInfo.SlideNoteCheckpoint)) && Size.Equals(0))
                    {
                        (Notes[Prev[i]] as TheaterNote).SizeInPixelNext = 70;
                    }
                    else if ((Notes[Prev[i]].Mode.Equals(NoteInfo.LongNoteStart) ||
                              Notes[Prev[i]].Mode.Equals(NoteInfo.SlideNoteStart) ||
                              Notes[Prev[i]].Mode.Equals(NoteInfo.SlideNoteCheckpoint)) && Notes[Prev[i]].SizeInPixel.Equals(70))
                    {
                        (Notes[ID] as TheaterNote).SizeInPixelPrev = 70;
                    }
                }
                else if (Game.Mode.Equals(GameMode.Platinum))
                {
                    if ((Notes[Prev[i]].Mode.Equals(NoteInfo.LongNoteStart) ||
                         Notes[Prev[i]].Mode.Equals(NoteInfo.SlideNoteStart) ||
                         Notes[Prev[i]].Mode.Equals(NoteInfo.SlideNoteCheckpoint)) && Size.Equals(0))
                    {
                        (Notes[Prev[i]] as PlatinumNote).SizeInPixelNext = 70;
                    }
                    else if ((Notes[Prev[i]].Mode.Equals(NoteInfo.LongNoteStart) ||
                              Notes[Prev[i]].Mode.Equals(NoteInfo.SlideNoteStart) ||
                              Notes[Prev[i]].Mode.Equals(NoteInfo.SlideNoteCheckpoint)) && Notes[Prev[i]].SizeInPixel.Equals(70))
                    {
                        (Notes[ID] as PlatinumNote).SizeInPixelPrev = 70;
                    }
                }
            }
            if ((int)noteComp.Mode < 7)
            {
                VisibleNoteCount++;
            }

            if (Mode.Equals(NoteInfo.SystemNoteScroller)) // 스크롤러일 경우 배수 값을 저장합니다.
            {
                CurScrollVal = Speed;
            }

            if (Size >= 2) // 스페셜 노트가 나타났을 경우
            {
                XLReachFrame = Time * (1 / Game.ScrollAmp);
                if (!XLAppeared) // 그중 처음일 경우
                {
                    GameObject xlStart = GetNoteInstance();
                    xlStart.GetComponent <RectTransform>().SetParent(Game.NoteParent, false);
                    xlStart.GetComponent <Note>().Game = Game;
                    xlStart.GetComponent <Note>().SetNote(XLNoteID, 0, 0, (Time * (1 / Game.ScrollAmp)) - (45 * CurScrollVal), Game.GlobalNoteSpeed, 0, NoteInfo.SystemNoteXLStarter, FlickMode.None, new Color32(0, 0, 0, 0), new List <int>(), 0);
                    Notes.Add(XLNoteID--, xlStart.GetComponent <Note>());
                    XLAppeared = true;
                }
            }
            else if (Size < 2 && XLAppeared) // 스페셜 노트 이후 첫 다른 노트가 나타날 경우
            {
                GameObject xlEnd = GetNoteInstance();
                xlEnd.GetComponent <RectTransform>().SetParent(Game.NoteParent, false);
                xlEnd.GetComponent <Note>().Game = Game;
                xlEnd.GetComponent <Note>().SetNote(XLNoteID, 0, 0, (Time * (1 / Game.ScrollAmp)) - (90 * CurScrollVal) >= XLReachFrame + 15 ? (Time * (1 / Game.ScrollAmp)) - (90 * CurScrollVal) : XLReachFrame + 15, Game.GlobalNoteSpeed, 0, NoteInfo.SystemNoteXLEnder, FlickMode.None, new Color32(0, 0, 0, 0), new List <int>(), 0);
                Notes.Add(XLNoteID--, xlEnd.GetComponent <Note>());
                XLAppeared = false;
            }
        }
Exemplo n.º 8
0
        private void DecisionProcess(int DecValue, FlickMode Flick)
        {
            int TweakedDec = DecValue;

            if (!AllowTempestic && DecValue.Equals(5))
            {
                TweakedDec--;
            }

            if (TweakedDec < 3)
            {
                CurCombo = 0;
                ComboValueText.Nuzzle();
                if (HitSound)
                {
                    if (Game.Mode.Equals(GameMode.Starlight))
                    {
                        StarlightBad.Play();
                    }
                    else
                    {
                        TapBadSound.Play();
                    }
                }
            }
            else
            {
                CurCombo += 1;
                ComboValueText.Wake(CurCombo);
                Data.TryUpdateCombo(CurCombo);
                if (HitSound)
                {
                    if (Flick.Equals(FlickMode.None))
                    {
                        if (Game.Mode.Equals(GameMode.Starlight))
                        {
                            StarlightTap.Play();
                        }
                        else
                        {
                            TapSound.Play();
                        }
                    }
                    else
                    {
                        if (Game.Mode.Equals(GameMode.Starlight))
                        {
                            StarlightFlick.Play();
                        }
                        else
                        {
                            FlickSound.Play();
                        }
                    }
                }
            }

            switch (TweakedDec)
            {
            case 0:
                break;

            case 1:
                CalculateScore(0.1f, ComboMultilpier());
                break;

            case 2:
                CalculateScore(0.3f, ComboMultilpier());
                break;

            case 3:
                CalculateScore(0.7f, ComboMultilpier());
                break;

            case 4:
                CalculateScore(1.0f, ComboMultilpier());
                break;

            case 5:
                CalculateScore(1.1f, ComboMultilpier());
                break;
            }
            Data.UpdateNote(TweakedDec);
            DecisionText.Wake(TweakedDec);
        }
Exemplo n.º 9
0
 /// <summary>
 /// 게임의 판정을 총괄하는 함수입니다. 판정 절차가 이루어졌으면 true, 그렇지 않으면 false를 반환합니다.
 /// </summary>
 /// <param name="gMode">게임의 모드입니다.</param>
 /// <param name="nMode">판정될 노트의 모드입니다.</param>
 /// <param name="fMode">판정될 노트의 플릭 여부입니다.</param>
 /// <param name="MyFrame">판정될 노트의 현재 프레임 값입니다.</param>
 /// <param name="RefFrame">판정될 노트의 기준 프레임 값입니다.</param>
 /// <param name="HasInput">사용자의 입력에 의한 판정인지의 여부입니다.</param>
 /// <returns>판정이 진행되었는지의 여부입니다.</returns>
 public bool HitJudge(GameMode gMode, NoteInfo nMode, FlickMode fMode, float MyFrame, float RefFrame, bool HasInput)
 {
     if (nMode.Equals(NoteInfo.DamageNote))
     {
         if (HasInput)
         {
             if (MyFrame < RefFrame - BadBorder)
             {
                 return(false);
             }
             else
             {
                 DecisionProcess(0, fMode);
             }
         }
         else
         {
             DecisionProcess(5, fMode);
         }
     }
     else if (fMode.Equals(0) && (nMode.Equals(NoteInfo.NormalNote) || nMode.Equals(NoteInfo.HiddenNote)))
     {
         if (MyFrame < RefFrame - BadBorder)
         {
             return(false);
         }
         else if (MyFrame >= RefFrame - BadBorder && MyFrame < RefFrame - NiceBorder)
         {
             DecisionProcess(1, fMode);
         }
         else if (MyFrame >= RefFrame - NiceBorder && MyFrame < RefFrame - GreatBorder)
         {
             DecisionProcess(2, fMode);
         }
         else if (MyFrame >= RefFrame - GreatBorder && MyFrame < RefFrame - PerfectBorder)
         {
             DecisionProcess(3, fMode);
         }
         else if (MyFrame >= RefFrame - PerfectBorder && MyFrame < RefFrame - 0.5f)
         {
             DecisionProcess(4, fMode);
         }
         else if (MyFrame >= RefFrame - 0.5f && MyFrame <= RefFrame + 0.5f)
         {
             DecisionProcess(5, fMode);
         }
         else if (MyFrame > RefFrame + 0.5f && MyFrame <= RefFrame + PerfectBorder)
         {
             DecisionProcess(4, fMode);
         }
         else if (MyFrame > RefFrame + PerfectBorder && MyFrame <= RefFrame + GreatBorder)
         {
             if (nMode.Equals(NoteInfo.HiddenNote))
             {
                 return(false);
             }
             else
             {
                 DecisionProcess(3, fMode);
             }
         }
         else if (MyFrame > RefFrame + GreatBorder && MyFrame <= RefFrame + NiceBorder)
         {
             if (nMode.Equals(NoteInfo.HiddenNote))
             {
                 return(false);
             }
             else
             {
                 DecisionProcess(2, fMode);
             }
         }
         else if (MyFrame > RefFrame + NiceBorder && MyFrame <= RefFrame + BadBorder)
         {
             if (nMode.Equals(NoteInfo.HiddenNote))
             {
                 return(false);
             }
             else
             {
                 DecisionProcess(1, fMode);
             }
         }
         else if (MyFrame > RefFrame + BadBorder)
         {
             if (nMode.Equals(NoteInfo.HiddenNote))
             {
                 return(false);
             }
             else
             {
                 DecisionProcess(0, fMode);
             }
         }
     }
     else
     {
         if (MyFrame < RefFrame - BadBorderL)
         {
             if (nMode.Equals(NoteInfo.LongNoteEnd) || nMode.Equals(NoteInfo.SlideNoteEnd))
             {
                 DecisionProcess(0, fMode);
             }
             else
             {
                 return(false);
             }
         }
         else if (MyFrame >= RefFrame - BadBorderL && MyFrame < RefFrame - NiceBorderL)
         {
             DecisionProcess(1, fMode);
         }
         else if (MyFrame >= RefFrame - NiceBorderL && MyFrame < RefFrame - GreatBorderL)
         {
             DecisionProcess(2, fMode);
         }
         else if (MyFrame >= RefFrame - GreatBorderL && MyFrame < RefFrame - PerfectBorderL)
         {
             DecisionProcess(3, fMode);
         }
         else if (MyFrame >= RefFrame - PerfectBorderL && MyFrame < RefFrame - 0.5f)
         {
             DecisionProcess(4, fMode);
         }
         else if (MyFrame >= RefFrame - 0.5f && MyFrame <= RefFrame + 0.5f)
         {
             DecisionProcess(5, fMode);
         }
         else if (MyFrame > RefFrame + 0.5f && MyFrame <= RefFrame + PerfectBorderL)
         {
             DecisionProcess(4, fMode);
         }
         else if (MyFrame > RefFrame + PerfectBorderL && MyFrame <= RefFrame + GreatBorderL)
         {
             DecisionProcess(3, fMode);
         }
         else if (MyFrame > RefFrame + GreatBorderL && MyFrame <= RefFrame + NiceBorderL)
         {
             DecisionProcess(2, fMode);
         }
         else if (MyFrame > RefFrame + NiceBorderL && MyFrame <= RefFrame + BadBorderL)
         {
             DecisionProcess(1, fMode);
         }
         else if (MyFrame > RefFrame + BadBorderL)
         {
             DecisionProcess(0, fMode);
         }
     }
     return(true);
 }