public int MaxScore(EStageLevel stageLevel) { int combo = 0; int ret = 0; int comboLevel = 0; foreach (CTaiguRoundInfo rinfo in this.RoundInfoList) { foreach (TaiguBallType ball in rinfo.BallList) { if (ball <= TaiguBallType.None || ball >= TaiguBallType.Max) { continue; } if (stageLevel > EStageLevel.Hard) { comboLevel = 10; } else { combo++; // comboLevel = (combo > 100 ? 10 : combo / 10); } int rankMark = mBaseMark[(int)BeatResultRank.Perfect - 1]; int thisScore = rankMark + rankMark * comboLevel * mComboBonus / 100; ret += thisScore; } } return(ret); }
/// <summary> /// 스테이지 데이터 클래스의 멤버변수 정보를 초기화한다. /// </summary> public void InitData() { stageNumber = 0; eStageLevel = EStageLevel.normal; eClearState = EClearState.none; currentStageStarCount = 0; rewardType = ERewardType.gold; }
void AnalysisRoundNote(Dictionary <int, string[]> roundNote, EStageLevel stageLevel) { foreach (KeyValuePair <int, string[]> kvp in roundNote) { if (kvp.Value[0].Length == MaxBallNum && kvp.Value[1].Length == MaxBallNum) { CTranditionalRoundInfo roundInfo = new CTranditionalRoundInfo(); List <CTranditionalSubNote> LineNote = new List <CTranditionalSubNote>(); for (int x = 0; x < MaxBallNum; x++) { for (int y = 0; y < 2; y++) { if (kvp.Value[y][x] == '8') { CTranditionalSubNote Note = new CTranditionalSubNote(); Note.Position[0] = x; Note.Position[1] = y; LineNote.Add(Note); } else if (kvp.Value[y][x] == '9') { CTranditionalSubNote Note = new CTranditionalSubNote(); Note.Position[0] = x; Note.Position[1] = y; LineNote.Add(Note); roundInfo.BallList.Add(LineNote.ToArray()); LineNote.Clear(); } else if (kvp.Value[y][x] != '0') { CTranditionalSubNote Note = new CTranditionalSubNote(); Note.Position[0] = x; Note.Position[1] = y; if (stageLevel < EStageLevel.SuperEasy) { if (kvp.Value[y][x] != '1') { Note.Double = true; } } LineNote.Add(Note); roundInfo.BallList.Add(LineNote.ToArray()); LineNote.Clear(); } } } RoundInfoMap.Add(kvp.Key, roundInfo); } } }
void AnalysisRoundNote(Dictionary <int, string> roundNote, EStageLevel stageLevel) { foreach (KeyValuePair <int, string> kvp in roundNote) { AuditionRoundInfo roundInfo = new AuditionRoundInfo(); roundInfo.RoundNO = kvp.Key; string stringNote = kvp.Value; bool IsReverse = false; for (int index = 0; index < stringNote.Length; ++index) { string note = stringNote.Substring(index, 1); AuditionBallInfo ballInfo = new AuditionBallInfo(); if (note[0] == '*') { IsReverse = true; if (stageLevel > EStageLevel.Hard) { if (note.Contains("5")) { roundNote.Remove(kvp.Key); } } } else { int ballIndex = 0; int.TryParse(note, out ballIndex); AuditionBallType ballType = CAuditionBallType.GetBallType(ballIndex); if (IsReverse) { ballInfo.m_bIsReverse = true; IsReverse = false; } ballInfo.m_BallType = ballType; roundInfo.BallList.Add(ballInfo); if (CAuditionBallType.IsValid(ballType)) { if (roundInfo.m_bAllEmpty) { roundInfo.m_bAllEmpty = false; } } } } RoundInfoMap.Add(kvp.Key, roundInfo); } }
void AnalysisRoundNote(List <string> roundNote, EStageLevel stageLevel) { for (int i = 0; i < roundNote.Count; ++i) { string stringNote = roundNote[i]; CTaiguRoundInfo roundInfo = new CTaiguRoundInfo(); if (stageLevel > EStageLevel.Hard) { for (int j = 0; j < stringNote.Length; j++) { if (stringNote[j] == '8') { if (!stringNote.Contains('9')) { roundNote.Remove(stringNote); } else { IncludeZero(j, stringNote, roundNote); } } } } for (int index = 0; index < stringNote.Length; ++index) { if (stringNote[index] == '1') { roundInfo.BallList.Add(TaiguBallType.Red); } else if (stringNote[index] == '2') { roundInfo.BallList.Add(TaiguBallType.Blue); } else if (stringNote[index] == '3') { roundInfo.BallList.Add(TaiguBallType.RBMix); } else { roundInfo.BallList.Add(TaiguBallType.None); } } RoundInfoList.Add(roundInfo); } }
/// <summary> /// 스테이지의 레벨을 설정한다. /// </summary> /// <param name="level">설정 할 스테이지 레벨</param> public void OnClick_SetStageLevelBtn(int level) { int enumCount = System.Enum.GetNames(typeof(EStageLevel)).Length; // Enum의 개수를 리턴한다. (Enum.GetNames이 Enum.GetValues보다 빠르다) Debug.Log("level enum count : " + enumCount); // 레벨 선택 범위를 벗어났을 경우. if (level < 0 || level >= enumCount) { Debug.LogWarning("스테이지의 레벨을 선택할 수 있는 범위를 벗어났습니다. (" + level + "~" + exploreStages.Length + ")"); return; } eStageLevel = (EStageLevel)level; UpdateUI(); levelsPanel.SetActive(false); }
/// <summary> /// enum형태의 난이도를 입력받아 한글 텍스트로 변환해서 리턴해주는 함수. /// </summary> /// <param name="level">난이도 값</param> /// <returns>한글로 변환된 난이도 텍스트</returns> public string GetLevelTextFromStageLevelOfEnum(EStageLevel level) { string levelText = ""; switch (eStageLevel) { case EStageLevel.easy: levelText = "쉬움"; break; case EStageLevel.normal: levelText = "보통"; break; case EStageLevel.difficult: levelText = "어려움"; break; default: Debug.Assert(false); break; } return(levelText); }
public virtual void LoadStageInfo(string stagePath, EStageLevel stageLevel) { }
public override void LoadStageInfo(string stagePath, EStageLevel stageLevel) { using (StreamReader sr = new StreamReader(stagePath, Encoding.GetEncoding("gb18030"))) { char[] invalidFlag = { ':' }; char[] trimStart = { ' ', '\t' }; char[] trimEnd = { ' ', '\r', '\n', '\t' }; Dictionary <int, string> roundNote = new Dictionary <int, string>(); string stringLine = null; while ((stringLine = sr.ReadLine()) != null) { if (stringLine != "") { if (!m_bInvalidFlag && ContainsFlag(stringLine, invalidFlag)) { m_bInvalidFlag = true; } stringLine.TrimEnd(trimEnd); stringLine.TrimStart(trimStart); if (BeginWithFlag(stringLine, '#')) { StageTag tag = AnalyseTag(ref stringLine, '#'); if (tag == StageTag.Round) { stringLine = stringLine.Replace(" ", ""); string strHead = ""; string strNote = ""; SeparateString(stringLine, ':', ref strHead, ref strNote); NodeHeadList.Add(strHead); int nHead = Convert.ToInt32(strHead); if (!roundNote.ContainsKey(nHead)) { roundNote.Add(nHead, strNote); } else { DebugLog.Write("CRhythmStageInfo LoadStageInfo Error: Round NO is duplicate " + strHead, LogLevel.ERROR); } } else if (tag == StageTag.PatEnd) { AnalysisRoundNote(roundNote); roundNote.Clear(); } } else if (BeginWithFlag(stringLine, '@')) { stringLine = stringLine.Replace(" ", ""); string strHead = ""; string strBegin = ""; string strEnd = ""; SeparateString(stringLine, ':', ref strHead, ref strBegin, ref strEnd); int nBegin = Convert.ToInt32(strBegin); int nEnd = Convert.ToInt32(strEnd); if (nBegin > 0 && nBegin < nEnd) { CRhythmShowTime showTime = new CRhythmShowTime(); showTime.BeginTime = nBegin; showTime.EndTime = nEnd; ShowTimeList.Add(showTime); } } else { string key = ""; string value = ""; SeparateString(stringLine, ':', ref key, ref value); key = key.ToUpper(); SetMatchValue(key, value); } } } sr.Close(); } }
/// <summary> /// UI 상태를 초기화한다. /// </summary> public void InitUI() { levelsPanel.SetActive(false); // 레벨 선택 패널을 끈다. eStageLevel = EStageLevel.normal; UpdateUI(); }
public override void LoadStageInfo(string stagePath, EStageLevel stageLevel) { using (StreamReader sr = new StreamReader(stagePath, Encoding.GetEncoding("gb18030"))) { char[] invalidFlag = { ',' }; char[] trimStart = { ' ', '\t' }; char[] trimEnd = { ' ', '\r', '\n', '\t' }; string stringLine = null; EOSU_SECTION curSection = EOSU_SECTION.EOSU_SECTION_NON; EOSU_SECTION Section = EOSU_SECTION.EOSU_SECTION_NON; while ((stringLine = sr.ReadLine()) != null) { if (!m_bInvalidFlag && ContainsFlag(stringLine, invalidFlag)) { m_bInvalidFlag = true; } stringLine = stringLine.TrimEnd(trimEnd); stringLine = stringLine.TrimStart(trimStart); if (IsComment(stringLine)) { continue; } if (GetSection(stringLine, ref Section)) { curSection = Section; } else { if (BeginWithNum(stringLine)) { if (Section == EOSU_SECTION.EOSU_SECTION_HITOBJECTS) { AddNewOperator(stringLine); } if (Section == EOSU_SECTION.EOSU_SECTION_TIMEPOINT) { string[] splitResult = stringLine.Split(','); if (splitResult.Length >= 3) { float offset = 0; float.TryParse(splitResult[0], out offset); mOffset = offset / 1000; float bpm = 0; float.TryParse(splitResult[1], out bpm); mBPM = 60000 / bpm; int nbeat = 0; int.TryParse(splitResult[2], out nbeat); if (nbeat == 3) { mBeatN = 3; } } } } else { string strkey = null; string strvalue = null; if (Section == EOSU_SECTION.EOSU_SECTION_METADATA) { SeparateString(stringLine, ':', ref strkey, ref strvalue); if (strkey == "Tags") { float fv = 0; float.TryParse(strvalue, out fv); mMatchTime = fv; } else if (strkey == "Source") { //for show time; string[] ShowTomes = strvalue.Split(','); mShowtimeRound = new int[ShowTomes.Length]; for (int i = 0; i < ShowTomes.Length; i++) { int nv = 0; int.TryParse(ShowTomes[i], out nv); mShowtimeRound[i] = nv; } } } else if (Section == EOSU_SECTION.EOSU_SECTION_DIFFICULTY) { SeparateString(stringLine, ':', ref strkey, ref strvalue); } } } } sr.Close(); } }
public static string GetStageExtension(EStageMode stageMode, EStageLevel stageLevel, bool isSuper) { string stageExtension = "."; if (stageMode == EStageMode.Taiko) { if (isSuper) { stageExtension += "sg"; } else { stageExtension += "tg"; } } else if (stageMode == EStageMode.Tradition) { if (isSuper) { stageExtension += "sd"; } else { stageExtension += "td"; } } else if (stageMode == EStageMode.Osu) { if (isSuper) { stageExtension += "so"; } else { stageExtension += "os"; } } else if (EStageMode.Audition == stageMode) { if (isSuper) { stageExtension += "su"; } else { stageExtension += "au"; } } else if (stageMode == EStageMode.Rhythm) { stageExtension += "rh"; } else if (EStageMode.HeartBeats == stageMode) { stageExtension += "hb"; } if (stageLevel == EStageLevel.Easy) { stageExtension += "e"; } else if (stageLevel == EStageLevel.Normal) { stageExtension += "n"; } else if (stageLevel == EStageLevel.Hard) { stageExtension += "h"; } else if (stageLevel == EStageLevel.SuperEasy) { stageExtension += "e"; } else if (stageLevel == EStageLevel.SuperNormal) { stageExtension += "n"; } else if (stageLevel == EStageLevel.SuperHard) { stageExtension += "h"; } return(stageExtension); }