internal SliderMania(HitObjectManager hom, Vector2 startPosition, int startTime, HitObjectSoundType soundType, int repeatCount, double sliderLength, List <Vector2> sliderPoints, List <HitObjectSoundType> soundTypes, ManiaConvertType cvtType, bool[] lastRow) : base( hom, startPosition, startTime, false, soundType, CurveTypes.Bezier, repeatCount, sliderLength, sliderPoints, soundTypes, 0) { hitFactoryMania = hitObjectManager.hitFactory as HitFactoryMania; HitObjects = new List <HitCircleMania>(); EndTime = VirtualEndTime; //that's enough. convertType = cvtType; deltaTime = Length / repeatCount; int col = hitObjectManager.ManiaStage.ColumnAt(startPosition); this.lastRow = lastRow; // useBomb = false; for (int i = 0; i < lastRow.Length; i++) { if (lastRow[i]) { lastCount++; } } }
internal override Slider CreateSlider(Vector2 startPosition, int startTime, bool newCombo, HitObjectSoundType soundType, CurveTypes curveType, int repeatCount, double sliderLength, List <Vector2> sliderPoints, List <HitObjectSoundType> soundTypes, int comboOffset, SampleSet sampleSet, SampleSet addSet, List <SampleSet> sampleSets, List <SampleSet> sampleSetAdditions, CustomSampleSet customSampleSet, int volume, string sampleFile) { SliderMania s; if (hitObjectManager.Beatmap.PlayMode == PlayModes.OsuMania) { s = new SliderMania(hitObjectManager, startPosition, startTime, soundType, repeatCount, sliderLength, sliderPoints, soundTypes, ManiaConvertType.NotChange, prevRow); s.SampleSet = sampleSet; s.SampleSetAdditions = addSet; s.CustomSampleSet = customSampleSet; s.SampleVolume = volume; s.GenerateHitObjects(); s.HitObjects.ForEach(n => n.ProcessSampleFile(sampleFile)); record(startPosition, s.EndTime); } else { ControlPoint cp = hitObjectManager.Beatmap.ControlPointAt(startTime); ManiaConvertType ctype = ManiaConvertType.None; if (cp != null && !cp.KiaiMode) { ctype = ManiaConvertType.LowProbability; } s = new SliderMania(hitObjectManager, startPosition, startTime, soundType, repeatCount, sliderLength, sliderPoints, soundTypes, ctype, prevRow); s.SampleSet = sampleSet; s.SampleSetAdditions = addSet; s.SampleSetList = sampleSets; s.SampleSetAdditionList = sampleSetAdditions; s.CustomSampleSet = customSampleSet; s.SampleVolume = volume; s.GenerateHitObjects(); prevRow = new bool[hitObjectManager.ManiaStage.Columns.Count]; if (s.HitObjects.Count > 1) { foreach (HitCircleMania hb in s.HitObjects.FindAll(h => h.EndTime == s.EndTime)) { prevRow[hb.LogicalColumn] = true; } } else { prevRow[s.HitObjects[0].LogicalColumn] = true; } s.HitObjects.ForEach(n => n.ProcessSampleFile(sampleFile)); int intv = (s.EndTime - startTime) / repeatCount; while (repeatCount-- >= 0) { record(startPosition, startTime); densityUpdate(startTime); startTime += intv; } } return(s); }
internal SpinnerMania(HitObjectManager hom, int startTime, int endTime, HitObjectSoundType soundType, ManiaConvertType convertType, bool[] lastRow) : base(hom, startTime, endTime, soundType) { this.lastRow = lastRow; for (int i = 0; i < lastRow.Length; i++) { if (lastRow[i]) { lastCount++; } } this.convertType = convertType; if (lastCount == hitObjectManager.ManiaStage.Columns.Count) { this.convertType &= ~ManiaConvertType.ForceNotStack; } HitObjects = new List <HitCircleMania>(); }
public HitCircleManiaRow(HitObjectManager hom, Vector2 startPosition, int startTime, HitObjectSoundType soundType, ManiaConvertType cvtType, bool[] lastRow) : base(hom) { HitObjects = new List <HitCircleMania>(); convertType = cvtType; this.lastRow = lastRow; Position = startPosition; BasePosition = startPosition; StartTime = startTime; SoundType = soundType; for (int i = 0; i < lastRow.Length; i++) { if (lastRow[i]) { lastCount++; lastColumn = i; } } }
internal override HitCircle CreateHitCircle(Vector2 startPosition, int startTime, bool newCombo, HitObjectSoundType soundType, int comboOffset, SampleSet sampleSet, SampleSet addSet, CustomSampleSet customSampleSet, int volume, string sampleFile) { HitCircleManiaRow r = null; if (hitObjectManager.Beatmap.PlayMode == PlayModes.OsuMania) { r = new HitCircleManiaRow(hitObjectManager, startPosition, startTime, soundType, ManiaConvertType.NotChange, prevRow); r.SampleSet = sampleSet; r.SampleSetAdditions = addSet; r.CustomSampleSet = customSampleSet; r.SampleVolume = volume; r.GenerateHitObjects(); r.HitObjects.ForEach(n => n.ProcessSampleFile(sampleFile)); record(startPosition, startTime); } else { densityUpdate(startTime);//update before generate notes int delta = startTime - prevTime; double beatIntv = hitObjectManager.Beatmap.BeatLengthAt(startTime, false); ManiaConvertType ctype = ManiaConvertType.None; if (delta <= 80)// more than 187bpm { ctype = ManiaConvertType.ForceNotStack | ManiaConvertType.KeepSingle; } else if (delta <= 95) //more than 157bpm { ctype = ManiaConvertType.ForceNotStack | ManiaConvertType.KeepSingle | currentStair; } else if (delta <= 105)//140bpm { ctype = ManiaConvertType.ForceNotStack | ManiaConvertType.LowProbability; } else if (delta <= 125)//120bpm { ctype = ManiaConvertType.ForceNotStack | ManiaConvertType.None; } else { float deltaPos = (startPosition - prevPos).Length(); ControlPoint cp = hitObjectManager.Beatmap.ControlPointAt(startTime); if (delta <= 135 && deltaPos < 20) //111bpm { ctype = ManiaConvertType.Cycle | ManiaConvertType.KeepSingle; } else if (delta <= 150 && deltaPos < 20) //100bpm stream, forceStack { ctype = ManiaConvertType.ForceStack | ManiaConvertType.LowProbability; } else if (deltaPos < 20 && noteDensity >= beatIntv / 2.5) { ctype = ManiaConvertType.Reverse | ManiaConvertType.LowProbability; } else if (noteDensity < beatIntv / 2.5 || (cp != null && cp.KiaiMode)) //high note density { ctype = ManiaConvertType.None; } else //low note density { ctype = ManiaConvertType.LowProbability; } } r = new HitCircleManiaRow(hitObjectManager, startPosition, startTime, soundType, ctype, prevRow); r.SampleSet = sampleSet; r.SampleSetAdditions = addSet; r.CustomSampleSet = customSampleSet; r.SampleVolume = volume; r.GenerateHitObjects(); prevRow = new bool[hitObjectManager.ManiaStage.Columns.Count]; foreach (HitCircleMania note in r.HitObjects) { prevRow[note.LogicalColumn] = true; if ((ctype & ManiaConvertType.Stair) > 0 && note.LogicalColumn == hitObjectManager.ManiaStage.Columns.Count - 1) { currentStair = ManiaConvertType.ReverseStair; } else if ((ctype & ManiaConvertType.ReverseStair) > 0 && note.LogicalColumn == hitObjectManager.ManiaStage.RandomStart) { currentStair = ManiaConvertType.Stair; } note.ProcessSampleFile(sampleFile); } record(startPosition, startTime); } return(r); }
internal void GenerateHitObjects() { int col = hitObjectManager.ManiaStage.ColumnAt(Position); int repeatCount = SegmentCount; //for specific only if ((convertType & ManiaConvertType.NotChange) > ManiaConvertType.None || hitObjectManager.ManiaStage.Columns.Count == 1) { Add(col, StartTime, EndTime); return; } if (repeatCount > 1) { if (deltaTime <= 90) { AddRandomNote(1, StartTime, EndTime - StartTime); } else if (deltaTime <= 120) //ignore repeatCount { // AddRandomNote(1, StartTime, EndTime - StartTime, 1); this.convertType |= ManiaConvertType.ForceNotStack; AddNormal(StartTime, deltaTime, repeatCount); } else if (deltaTime <= 160) //special conversion { AddStair(StartTime, deltaTime, repeatCount); } else if (deltaTime <= 200 && hitObjectManager.Beatmap.DifficultyBemaniStars > 3.0) { AddMultiNormal(StartTime, deltaTime, repeatCount); } else { int total = EndTime - StartTime; if (total >= 4000) { NoteCalculation(StartTime, total, 1, 1, 0.77f); } else if (deltaTime > 400 && total < 4000 && repeatCount < hitObjectManager.ManiaStage.Columns.Count - 1 - hitObjectManager.ManiaStage.RandomStart) { AddTileNote(repeatCount, StartTime, deltaTime); } else { AddLongAndNormal(StartTime, deltaTime, repeatCount); } } } else { if (deltaTime <= 110) { if (lastCount < hitObjectManager.ManiaStage.Columns.Count) { this.convertType |= ManiaConvertType.ForceNotStack; } else { this.convertType &= ~ManiaConvertType.ForceNotStack; } AddNormal(StartTime, deltaTime, deltaTime < 80 ? 0 : 1); } else { if (hitObjectManager.Beatmap.DifficultyBemaniStars > 6.5) { if ((convertType & ManiaConvertType.LowProbability) > 0) { NoteCalculation(StartTime, EndTime - StartTime, 1f, 0.7f, 0.22f); } else { NoteCalculation(StartTime, EndTime - StartTime, 0.97f, 0.64f, 0.15f); } } else if (hitObjectManager.Beatmap.DifficultyBemaniStars > 4.0) { if ((convertType & ManiaConvertType.LowProbability) > 0) { NoteCalculation(StartTime, EndTime - StartTime, 1, 0.92f, 0.57f); } else { NoteCalculation(StartTime, EndTime - StartTime, 1, 0.82f, 0.44f); } } else if (hitObjectManager.Beatmap.DifficultyBemaniStars > 2.5) { if ((convertType & ManiaConvertType.LowProbability) > 0) { NoteCalculation(StartTime, EndTime - StartTime, 1, 1, 0.7f); } else { NoteCalculation(StartTime, EndTime - StartTime, 1, 0.92f, 0.63f); } } else { if ((convertType & ManiaConvertType.LowProbability) > 0) { NoteCalculation(StartTime, EndTime - StartTime, 1, 1, 0.83f); } else { NoteCalculation(StartTime, EndTime - StartTime, 1, 1f, 0.73f); } } } } }
internal void GenerateHitObjects() { hitFactoryMania = hitObjectManager.hitFactory as HitFactoryMania; //sample specific,arranged by priority //don't generate mirror style for 7+1K if ((convertType & ManiaConvertType.KeepSingle) == 0) { if (SoundType.IsType(HitObjectSoundType.Finish) && hitObjectManager.ManiaStage.Columns.Count != 8) { convertType |= ManiaConvertType.Mirror; } else if (SoundType.IsType(HitObjectSoundType.Clap)) { convertType |= ManiaConvertType.Gathered; } } //some special convertypes ignore other conversion indication. if ((convertType & ManiaConvertType.NotChange) > 0 || hitObjectManager.ManiaStage.Columns.Count == 1) { Add(hitObjectManager.ManiaStage.ColumnAt(Position)); PostProcessing(); return; } if ((convertType & ManiaConvertType.Reverse) > 0 && lastCount > 0) { for (int i = hitObjectManager.ManiaStage.RandomStart; i < lastRow.Length; i++) { if (lastRow[i]) { Add(hitObjectManager.ManiaStage.Columns.Count - i - 1 + hitObjectManager.ManiaStage.RandomStart); } } PostProcessing(); return; } if ((convertType & ManiaConvertType.Cycle) > 0 && lastCount == 1) { //make sure last note not in centre column. if (!(hitObjectManager.ManiaStage.Columns.Count == 8 && lastColumn == 0) && (hitObjectManager.ManiaStage.Columns.Count % 2 == 0 || lastColumn != hitObjectManager.ManiaStage.Columns.Count / 2)) { lastColumn = hitObjectManager.ManiaStage.Columns.Count - lastColumn - 1 + hitObjectManager.ManiaStage.RandomStart; Add(lastColumn); PostProcessing(); return; } } if ((convertType & ManiaConvertType.ForceStack) > 0 && lastCount > 0) { //keep the same column with last row for (int i = hitObjectManager.ManiaStage.RandomStart; i < lastRow.Length; i++) { if (lastRow[i]) { Add(i); } } PostProcessing(); return; } if ((convertType & (ManiaConvertType.Stair | ManiaConvertType.ReverseStair)) > 0 && lastCount == 1) { if ((convertType & ManiaConvertType.Stair) > 0) { lastColumn++; if (lastColumn == hitObjectManager.ManiaStage.Columns.Count) { lastColumn = hitObjectManager.ManiaStage.RandomStart; } } else { lastColumn--; if (lastColumn == hitObjectManager.ManiaStage.RandomStart - 1) { lastColumn = hitObjectManager.ManiaStage.Columns.Count - 1; } } Add(lastColumn); PostProcessing(); return; } if ((convertType & ManiaConvertType.KeepSingle) > 0) { AddRandomNote(1); PostProcessing(); return; } if ((convertType & ManiaConvertType.Mirror) > 0) { if (hitObjectManager.Beatmap.DifficultyBemaniStars > 6.5) { NoteCalculationMirror(0.88f, 0.88f, 0.62f); } else if (hitObjectManager.Beatmap.DifficultyBemaniStars > 4.0) { NoteCalculationMirror(0.88f, 1f, 0.83f); } else { NoteCalculationMirror(0.88f, 1f, 1f); } } else { if (hitObjectManager.Beatmap.DifficultyBemaniStars > 6.5) { if ((convertType & ManiaConvertType.LowProbability) > ManiaConvertType.None) { NoteCalculationNormal(1f, 1f, 0.58f, 0.22f); } else { NoteCalculationNormal(1f, 1f, 0.38f, 0); } } else if (hitObjectManager.Beatmap.DifficultyBemaniStars > 4.0) { if ((convertType & ManiaConvertType.LowProbability) > ManiaConvertType.None) { NoteCalculationNormal(1f, 1f, 0.92f, 0.65f); } else { NoteCalculationNormal(1f, 1f, 0.85f, 0.48f); } } else if (hitObjectManager.Beatmap.DifficultyBemaniStars > 2.0) { if ((convertType & ManiaConvertType.LowProbability) > ManiaConvertType.None) { NoteCalculationNormal(1f, 1f, 1f, 0.82f); } else { NoteCalculationNormal(1f, 1f, 1f, 0.55f); } } else { NoteCalculationNormal(1f, 1f, 1f, 1f); } } if (hitObjectManager.ManiaStage.RandomStart > 0 && SoundType.IsType(HitObjectSoundType.Finish | HitObjectSoundType.Clap)) { Add(0); } PostProcessing(); }