From 2749072078cf55f13e343fad9d973bdda2773a83 Mon Sep 17 00:00:00 2001 From: telecomadm1145 <1587496147@qq.com> Date: Sun, 19 Nov 2023 11:17:27 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E6=80=A7=E7=9A=84taiko?= =?UTF-8?q?=E6=BB=91=E6=9D=A1=E5=88=A4=E5=AE=9A=EF=BC=88=E6=9C=89=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmania/SongSelectScreen.cpp | 2 +- cmania/TaikoObject.h | 1 + cmania/TaikoRuleset.h | 43 +++++++++++++++++++++++++++++------- cmania/TaikoScoreProcessor.h | 39 ++++++++++++++++++-------------- 4 files changed, 60 insertions(+), 25 deletions(-) diff --git a/cmania/SongSelectScreen.cpp b/cmania/SongSelectScreen.cpp index f760092..ff1f2b8 100644 --- a/cmania/SongSelectScreen.cpp +++ b/cmania/SongSelectScreen.cpp @@ -391,7 +391,7 @@ class SongSelectScreen : public Screen { selected = i; if (i != INT_MAX) { if (selected_entry == &cache && selected_entry_2 == &diff) { - parent->Navigate(MakeGameplayScreen(selected_entry_2->path, mods, selected_entry_2->mode)); + parent->Navigate(MakeGameplayScreen(selected_entry_2->path, mods, selected_entry_2->mode ? 1 : 1)); return; } selected_entry = &cache; diff --git a/cmania/TaikoObject.h b/cmania/TaikoObject.h index e33fae3..2cb5882 100644 --- a/cmania/TaikoObject.h +++ b/cmania/TaikoObject.h @@ -9,6 +9,7 @@ struct TaikoObject : public HitObject { Spinner = 4,// 2λ Barline = 8, SliderTick = 16, + Slider = 32, } ObjectType; double EndTime; int RemainsHits; diff --git a/cmania/TaikoRuleset.h b/cmania/TaikoRuleset.h index 34102d9..4625464 100644 --- a/cmania/TaikoRuleset.h +++ b/cmania/TaikoRuleset.h @@ -129,7 +129,7 @@ class TaikoRuleset : public Ruleset { to.StartTime = obj.StartTime; auto tp = GetTimingPointTiming(orig_bmp, obj.StartTime); auto bpm = tp.BPM(); - auto blen = 60.0 / bpm; + auto blen = 1000 / (bpm / 60.0); auto vec = GetTimingPointNonTiming(orig_bmp, obj.StartTime).SpeedMultiplier(); auto odd_s = std::abs(orig_bmp.SliderTickRate - 3) < 0.01; bool isKat = HasFlag(obj.SoundType, HitSoundType::Whistle) || HasFlag(obj.SoundType, HitSoundType::Clap); @@ -151,14 +151,15 @@ class TaikoRuleset : public Ruleset { auto snap = odd_s ? 6 : (bpm <= 125.0 ? 8 : 4); blen /= snap; auto duration = obj.Length / velocity; - for (auto i = obj.StartTime + blen; i < duration; i += blen) { + for (auto i = obj.StartTime + blen; i < obj.StartTime + duration; i += blen) { TaikoObject to{}; to.StartTime = i; to.ObjectType = TaikoObject::SliderTick; to.Velocity = vec; Beatmap.push_back(to); } - continue; + to.EndTime = to.StartTime + duration; + to.Velocity = vec; } else if (HasFlag(obj.Type, HitObjectType::Spinner)) { auto snap = odd_s ? 6 : (bpm <= 125.0 ? 8 : 4); @@ -218,9 +219,11 @@ class TaikoRuleset : public Ruleset { if (pressed) { auto rx = HasFlag(Mods, OsuMods::Relax); auto first_hit = Beatmap > Where([&](TaikoObject& obj) -> bool { - return !obj.HasHit && (obj.StartTime - clock < miss_offset); + return !obj.HasHit && (obj.StartTime - clock < miss_offset) && !HasFlag(obj.ObjectType, TaikoObject::Barline); }) > FirstOrDefault(); if (first_hit != 0) { + if (HasFlag(first_hit->ObjectType, TaikoObject::Slider)) + return; auto kat = HasFlag(first_hit->ObjectType, TaikoObject::Kat); auto large = HasFlag(first_hit->ObjectType, TaikoObject::Large); // miss if a wrong action has been pressed @@ -315,13 +318,33 @@ class TaikoRuleset : public Ruleset { // } // } // } + auto tick = HasFlag(obj.ObjectType, TaikoObject::SliderTick); + if (tick) { + if (time > obj.StartTime + miss_offset && !obj.HasHit) { + obj.HasHit = true; + } + } + auto spin = HasFlag(obj.ObjectType, TaikoObject::Spinner); + if (spin) { + if (obj.RemainsHits <= 0) { + obj.HasHit = true; + } + } auto large = HasFlag(obj.ObjectType, TaikoObject::Large); if (large) { if (obj.RemainsHits == -1 && time > obj.StartTime + miss_offset) { obj.HasHit = true; } } - if (!obj.HasHit) { + if (HasFlag(obj.ObjectType, TaikoObject::Slider)) + { + if (time > obj.EndTime) + { + obj.HasHit = true; + } + return; + } + if (!obj.HasHit && !HasFlag(obj.ObjectType, TaikoObject::Slider) && !HasFlag(obj.ObjectType, TaikoObject::Barline)) { if (time > obj.StartTime + miss_offset) { RulesetScoreProcessor->ApplyHit(obj, 1.0 / 0 * 0); LastHitResult = HitResult::Miss; @@ -349,8 +372,7 @@ class TaikoRuleset : public Ruleset { return 1; auto hd = HasFlag(mods, OsuMods::Hidden); auto fo = HasFlag(mods, OsuMods::FadeOut); - if (hd && fo) - { + if (hd && fo) { if (ratio < 0.7) { return pow(ratio / 0.7, 3); } @@ -401,6 +423,10 @@ class TaikoRuleset : public Ruleset { } if (HasFlag(obj.ObjectType, TaikoObject::SliderTick)) { fill = { 220, 255, 237, 77 }; + sz = scale * 3; + } + if (HasFlag(obj.ObjectType, TaikoObject::Slider)) { + fill = { 220, 255, 237, 77 }; } if (HasFlag(obj.ObjectType, TaikoObject::Large)) { sz = scale * 8; @@ -411,7 +437,8 @@ class TaikoRuleset : public Ruleset { continue; outter.Alpha = fill.Alpha = (unsigned char)(CalcFlashlight(Mods, 1 - v) * 255) * std::clamp((1 - v) * 3, 0.0, 1.0); buf.FillCircle(objx, hitpos.Y, sz, rt, { {}, fill, ' ' }); - buf.DrawCircle(objx, hitpos.Y, sz, 0.25, rt, { {}, outter, ' ' }); + if (!HasFlag(obj.ObjectType, TaikoObject::SliderTick) && !HasFlag(obj.ObjectType,TaikoObject::Slider)) + buf.DrawCircle(objx, hitpos.Y, sz, 0.25, rt, { {}, outter, ' ' }); } LastHitResultAnimator.Update(e_ms, [&](double val) { diff --git a/cmania/TaikoScoreProcessor.h b/cmania/TaikoScoreProcessor.h index b61f7ea..2befe3c 100644 --- a/cmania/TaikoScoreProcessor.h +++ b/cmania/TaikoScoreProcessor.h @@ -10,6 +10,7 @@ class TaikoScoreProcessor : public ScoreProcessor { double reference_rating = 1; double pp_m = 1; double score_m = 1; + int bonus_score = 0; public: virtual void ApplyBeatmap(double ref_rating) override { @@ -36,6 +37,7 @@ class TaikoScoreProcessor : public ScoreProcessor { // ͨ¹ý ScoreProcessor ¼Ì³Ð virtual HitResult ApplyHit(TaikoObject& to, double err) override { auto large = HasFlag(to.ObjectType, TaikoObject::Large); + auto tick = HasFlag(to.ObjectType, TaikoObject::SliderTick); auto is_hold = to.EndTime != 0; if (to.HasHit && !is_hold) { // need more code there. @@ -53,6 +55,12 @@ class TaikoScoreProcessor : public ScoreProcessor { } }); } + if (tick) { + to.HasHit = true; + bonus_score += 300; + UpdateScore(); + return HitResult::None; + } if (res > HitResult::None) { if (!is_hold && to.RemainsHits == 0 && large) { @@ -62,34 +70,33 @@ class TaikoScoreProcessor : public ScoreProcessor { { to.HasHit = true; } - Combo++; + Combo++; if (res == HitResult::Miss) Combo = 0; - MaxCombo = std::max(Combo, MaxCombo); - - RawAccuracy += std::min(GetBaseScore(res), GetBaseScore(HitResult::Great)); AppliedHit++; - - Accuracy = (double)RawAccuracy / AppliedHit / GetBaseScore(HitResult::Great); - - Rating = reference_rating * std::pow(((double)MaxCombo / BeatmapMaxCombo), 0.3) * pow(Accuracy, 1.3) * pow(pp_m, 1.2) * pow(0.95, ResultCounter[HitResult::Miss]); - + ResultCounter[res]++; RawScore += GetBaseScore(res); - + RawAccuracy += std::min(GetBaseScore(res), GetBaseScore(HitResult::Great)); if (res != HitResult::Miss) { RawError += err; Errors.push_back(err); - Mean = (double)RawError / Errors.size(); - Error = variance(Mean, Errors); } - - Score = (((double)RawScore / BeatmapMaxCombo / GetBaseScore(HitResult::Perfect)) * 0.7 + ((double)MaxCombo / BeatmapMaxCombo) * 0.3) * score_m; - - ResultCounter[res]++; + UpdateScore(); } return res; } + void UpdateScore() { + + MaxCombo = std::max(Combo, MaxCombo); + + Accuracy = (double)RawAccuracy / AppliedHit / GetBaseScore(HitResult::Great); + + Rating = reference_rating * std::pow(((double)MaxCombo / BeatmapMaxCombo), 0.3) * pow(Accuracy, 1.3) * pow(pp_m, 1.2) * pow(0.95, ResultCounter[HitResult::Miss]); + Mean = (double)RawError / Errors.size(); + Error = variance(Mean, Errors); + Score = (((double)RawScore / BeatmapMaxCombo / GetBaseScore(HitResult::Perfect)) * 0.7 + ((double)MaxCombo / BeatmapMaxCombo) * 0.3) * score_m + bonus_score / 1000000.0; + } virtual double GetHealthIncreaseFor(HitResult res) override { return 0.0; } From d0c409e3c4d98e4994afb665f204ab0d60029dae Mon Sep 17 00:00:00 2001 From: telecomadm1145 <1587496147@qq.com> Date: Sun, 19 Nov 2023 13:08:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=AE=E4=BD=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmania/TaikoRuleset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmania/TaikoRuleset.h b/cmania/TaikoRuleset.h index 4625464..17337f5 100644 --- a/cmania/TaikoRuleset.h +++ b/cmania/TaikoRuleset.h @@ -402,7 +402,7 @@ class TaikoRuleset : public Ruleset { buf.FillRect(0, buf.Height / 4, buf.Width, buf.Height * 2 / 4, { {}, { 255, 40, 40, 40 }, ' ' }); for (size_t i = 0; i < 4; i++) { buf.FillRect(hitpos.X - ((double)i - 1) * scale * 5 - scale * 10, buf.Height / 4, hitpos.X - (i)*scale * 5 - scale * 10, buf.Height * 2 / 4, { {}, { 120, 80, 80, 80 }, ' ' }); - KeyHighlight[i].Update(e_ms, [&](double v) { + KeyHighlight[3-i].Update(e_ms, [&](double v) { Color clr{ 220, 20, 212, 255 }; if ((i == 1) || (i == 2)) { clr = { 220, 255, 30, 30 }; From bfb0da43cb22d8e2ff5d629767018da7ddefaba1 Mon Sep 17 00:00:00 2001 From: telecomadm1145 <1587496147@qq.com> Date: Sun, 19 Nov 2023 13:09:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=A0=E9=99=A4hack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmania/SongSelectScreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmania/SongSelectScreen.cpp b/cmania/SongSelectScreen.cpp index ff1f2b8..f760092 100644 --- a/cmania/SongSelectScreen.cpp +++ b/cmania/SongSelectScreen.cpp @@ -391,7 +391,7 @@ class SongSelectScreen : public Screen { selected = i; if (i != INT_MAX) { if (selected_entry == &cache && selected_entry_2 == &diff) { - parent->Navigate(MakeGameplayScreen(selected_entry_2->path, mods, selected_entry_2->mode ? 1 : 1)); + parent->Navigate(MakeGameplayScreen(selected_entry_2->path, mods, selected_entry_2->mode)); return; } selected_entry = &cache;