diff --git a/Assets/Prefabs/UI/PlayResultScreen/PlayResultScreen.prefab b/Assets/Prefabs/UI/PlayResultScreen/PlayResultScreen.prefab index 77185b400..a8454008c 100644 --- a/Assets/Prefabs/UI/PlayResultScreen/PlayResultScreen.prefab +++ b/Assets/Prefabs/UI/PlayResultScreen/PlayResultScreen.prefab @@ -1,5 +1,144 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!1 &2158101557756457678 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 593572179698199281} + - component: {fileID: 2481007977002337565} + - component: {fileID: 6640033541102545540} + m_Layer: 5 + m_Name: Score WIP Notice + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &593572179698199281 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2158101557756457678} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8264468827415930220} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.87500006} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2481007977002337565 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2158101557756457678} + m_CullTransparentMesh: 1 +--- !u!114 &6640033541102545540 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2158101557756457678} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 'SCORE AND STARS SYSTEM ARE SUBJECT TO CHANGE AND ARE NOT FINAL. + + SCORES + MAY BE WIPED BETWEEN UPDATES DURING DEVELOPMENT.' + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 2df099280d0df81438dd6cd8bc6b2766, type: 2} + m_sharedMaterial: {fileID: -4356099095613367612, guid: 2df099280d0df81438dd6cd8bc6b2766, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 27.25 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 1 + m_fontSizeMin: 0 + m_fontSizeMax: 999 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &2318137390385720136 GameObject: m_ObjectHideFlags: 0 @@ -241,7 +380,7 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 39.4 + m_fontSize: 48.3 m_fontSizeBase: 40 m_fontWeight: 400 m_enableAutoSizing: 1 @@ -683,7 +822,7 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 19.7 + m_fontSize: 24.15 m_fontSizeBase: 36 m_fontWeight: 400 m_enableAutoSizing: 1 @@ -839,7 +978,7 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 32.6 + m_fontSize: 39.95 m_fontSizeBase: 36 m_fontWeight: 400 m_enableAutoSizing: 1 @@ -951,6 +1090,7 @@ MonoBehaviour: marginContainerRT: {fileID: 2622748020820660481} helpBarRT: {fileID: 1770877436458841397} playerCardsContainer: {fileID: 5192816751450639872} + scoreWIPNotice: {fileID: 6640033541102545540} --- !u!1 &2622748021320471148 GameObject: m_ObjectHideFlags: 0 @@ -1058,10 +1198,10 @@ RectTransform: m_Children: - {fileID: 4706769500185451813} m_Father: {fileID: 8264468827415930220} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 0.9} + m_AnchorMax: {x: 1, y: 0.75} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} @@ -1119,6 +1259,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 593572179698199281} - {fileID: 2993275657788534953} m_Father: {fileID: 2622748020820660481} m_RootOrder: 0 @@ -1517,7 +1658,7 @@ PrefabInstance: - target: {fileID: 3011040150514529251, guid: bf4101105cbc9af4abd83b117ec835be, type: 3} propertyPath: m_SizeDelta.x - value: 54.255917 + value: 66.476776 objectReference: {fileID: 0} - target: {fileID: 3011040150514529251, guid: bf4101105cbc9af4abd83b117ec835be, type: 3} @@ -1532,7 +1673,7 @@ PrefabInstance: - target: {fileID: 4570336199446443965, guid: bf4101105cbc9af4abd83b117ec835be, type: 3} propertyPath: m_fontSize - value: 17.35 + value: 21.3 objectReference: {fileID: 0} - target: {fileID: 6015766815798681171, guid: bf4101105cbc9af4abd83b117ec835be, type: 3} @@ -1726,7 +1867,7 @@ PrefabInstance: - target: {fileID: 3011040150514529251, guid: bf4101105cbc9af4abd83b117ec835be, type: 3} propertyPath: m_SizeDelta.x - value: 54.255917 + value: 66.476776 objectReference: {fileID: 0} - target: {fileID: 3011040150514529251, guid: bf4101105cbc9af4abd83b117ec835be, type: 3} @@ -1746,7 +1887,7 @@ PrefabInstance: - target: {fileID: 4570336199446443965, guid: bf4101105cbc9af4abd83b117ec835be, type: 3} propertyPath: m_fontSize - value: 17.35 + value: 21.3 objectReference: {fileID: 0} - target: {fileID: 6015766815798681171, guid: bf4101105cbc9af4abd83b117ec835be, type: 3} @@ -2533,17 +2674,17 @@ PrefabInstance: - target: {fileID: 1194046009032460958, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} propertyPath: m_fontSize - value: 14.45 + value: 14.75 objectReference: {fileID: 0} - target: {fileID: 1266162281580313134, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} propertyPath: m_fontSize - value: 14.45 + value: 14.75 objectReference: {fileID: 0} - target: {fileID: 1619932211422409174, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} propertyPath: m_fontSize - value: 28.55 + value: 29.15 objectReference: {fileID: 0} - target: {fileID: 2044582496420157559, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} @@ -2578,12 +2719,12 @@ PrefabInstance: - target: {fileID: 2115190651333479625, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} propertyPath: m_fontSize - value: 14.45 + value: 14.75 objectReference: {fileID: 0} - target: {fileID: 2127037780535138637, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} propertyPath: m_fontSize - value: 27.35 + value: 27.9 objectReference: {fileID: 0} - target: {fileID: 2278683627010739094, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} @@ -2653,7 +2794,7 @@ PrefabInstance: - target: {fileID: 2555765053582587274, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} propertyPath: m_fontSize - value: 14.45 + value: 14.75 objectReference: {fileID: 0} - target: {fileID: 2621259071427413874, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} @@ -2858,7 +2999,7 @@ PrefabInstance: - target: {fileID: 3563853899743806951, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} propertyPath: m_fontSize - value: 14.45 + value: 14.75 objectReference: {fileID: 0} - target: {fileID: 3642272724672605703, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} @@ -3153,7 +3294,7 @@ PrefabInstance: - target: {fileID: 4506782558550738543, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} propertyPath: m_fontSize - value: 60.55 + value: 61.8 objectReference: {fileID: 0} - target: {fileID: 4994320818034838144, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} @@ -3188,7 +3329,7 @@ PrefabInstance: - target: {fileID: 5169645697017489166, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} propertyPath: m_fontSize - value: 20.15 + value: 20.6 objectReference: {fileID: 0} - target: {fileID: 5371834738989781616, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} @@ -3313,7 +3454,7 @@ PrefabInstance: - target: {fileID: 5999799324668889936, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} propertyPath: m_fontSize - value: 14.45 + value: 14.75 objectReference: {fileID: 0} - target: {fileID: 6197817577866305028, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} @@ -3498,7 +3639,7 @@ PrefabInstance: - target: {fileID: 8653733435553734207, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} propertyPath: m_fontSize - value: 62.25 + value: 63.55 objectReference: {fileID: 0} - target: {fileID: 8684313221566951526, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} @@ -3553,7 +3694,7 @@ PrefabInstance: - target: {fileID: 9106554932078669887, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} propertyPath: m_fontSize - value: 32.2 + value: 32.9 objectReference: {fileID: 0} - target: {fileID: 9149902261495578651, guid: db32e91337da4084f85c3e2fd8b2ced0, type: 3} diff --git a/Assets/Script/PlayMode/CommonTrack.cs b/Assets/Script/PlayMode/CommonTrack.cs index 8c016a850..f7f1db641 100644 --- a/Assets/Script/PlayMode/CommonTrack.cs +++ b/Assets/Script/PlayMode/CommonTrack.cs @@ -52,7 +52,6 @@ public sealed class CommonTrack : MonoBehaviour { public bool strongFinishNotifsEnabled; public bool overdriveReadyNotifsEnabled; public bool fullComboTrumpsStrongFinish; - [Space] // Numeric performance text settings public int hotStartCutoff; diff --git a/Assets/Script/PlayMode/DrumsTrack.cs b/Assets/Script/PlayMode/DrumsTrack.cs index 2f7235034..c05b3dd96 100644 --- a/Assets/Script/PlayMode/DrumsTrack.cs +++ b/Assets/Script/PlayMode/DrumsTrack.cs @@ -85,7 +85,7 @@ protected override void StartTrack() { kickFretInside.material.SetColor("_EmissionColor", commonTrack.FretColor(kickIndex) * 2); // initialize scoring variables - ptsPerNote = proInst.Contains(player.chosenInstrument) ? 30 : 25; + ptsPerNote = proInst.Contains(player.chosenInstrument) ? 60 : 50; starsKeeper = new(Chart, scoreKeeper, player.chosenInstrument, ptsPerNote); diff --git a/Assets/Script/PlayMode/FiveFretTrack.cs b/Assets/Script/PlayMode/FiveFretTrack.cs index 2b270bbe5..a92e24037 100644 --- a/Assets/Script/PlayMode/FiveFretTrack.cs +++ b/Assets/Script/PlayMode/FiveFretTrack.cs @@ -37,8 +37,8 @@ public class FiveFretTrack : AbstractTrack { private int[] allowedChordGhosts = new int[] { -1, -1, -1, -1, -1 }; // -1 = not a chord; 0 = ghosted; 1 = ghost allowed // https://www.reddit.com/r/Rockband/comments/51t3c0/exactly_how_many_points_are_sustains_worth/ - private const double SUSTAIN_PTS_PER_BEAT = 12.0; - private const int PTS_PER_NOTE = 25; + private const double SUSTAIN_PTS_PER_BEAT = 25.0; + private const int PTS_PER_NOTE = 50; private int noteCount = -1; protected override void StartTrack() { notePool.player = player; diff --git a/Assets/Script/PlayMode/MicPlayer.cs b/Assets/Script/PlayMode/MicPlayer.cs index 5a306ecfa..9f0026bf7 100644 --- a/Assets/Script/PlayMode/MicPlayer.cs +++ b/Assets/Script/PlayMode/MicPlayer.cs @@ -147,7 +147,7 @@ private string EndPhraseName { // easy, medium, hard, expert // https://rockband.scorehero.com/forum/viewtopic.php?t=4545 // max harmony pts = 10% of main points per extra mic - private readonly int[] MAX_POINTS = { 200, 400, 800, 1000, 1000 }; + private readonly int[] MAX_POINTS = { 400, 800, 1600, 2000, 2000 }; private StarScoreKeeper starsKeeper; private int ptsPerPhrase; // pts per phrase, set depending on difficulty diff --git a/Assets/Script/PlayMode/Play.cs b/Assets/Script/PlayMode/Play.cs index dcfb7dc74..037b380cf 100644 --- a/Assets/Script/PlayMode/Play.cs +++ b/Assets/Script/PlayMode/Play.cs @@ -7,9 +7,10 @@ using MoonscraperChartEditor.Song.IO; using TrombLoader.Helpers; using UnityEngine; +using UnityEngine.UI; using UnityEngine.AddressableAssets; using UnityEngine.InputSystem; -using UnityEngine.UI; +using DG.Tweening; using YARG.Chart; using YARG.Data; using YARG.Serialization.Parser; @@ -514,7 +515,7 @@ public IEnumerator EndSong(bool showResultScreen) { backgroundRenderTexture.ClearTexture(); OnSongEnd?.Invoke(Song); - + // run animation + save if we've reached end of song if (showResultScreen) { yield return playCover @@ -527,7 +528,6 @@ public IEnumerator EndSong(bool showResultScreen) { Destroy(track.gameObject); } _tracks.Clear(); - // save MicPlayer score and destroy it if (MicPlayer.Instance != null) { MicPlayer.Instance.SetPlayerScore(); @@ -537,7 +537,6 @@ public IEnumerator EndSong(bool showResultScreen) { // show play result screen; this is our main focus now playResultScreen.SetActive(true); } - scoreDisplay.SetActive(false); } diff --git a/Assets/Script/PlayMode/RealGuitarTrack.cs b/Assets/Script/PlayMode/RealGuitarTrack.cs index 2ed440043..6b90e7410 100644 --- a/Assets/Script/PlayMode/RealGuitarTrack.cs +++ b/Assets/Script/PlayMode/RealGuitarTrack.cs @@ -30,8 +30,8 @@ public class RealGuitarTrack : AbstractTrack { private Queue expectedHits = new(); private List heldNotes = new(); - private const int PTS_PER_NOTE = 60; - private const int SUSTAIN_PTS_PER_BEAT = 30; + private const int PTS_PER_NOTE = 120; + private const int SUSTAIN_PTS_PER_BEAT = 60; protected override void StartTrack() { diff --git a/Assets/Script/PlayMode/ScoreKeeper.cs b/Assets/Script/PlayMode/ScoreKeeper.cs index 2c1f90e90..cd8ea6350 100644 --- a/Assets/Script/PlayMode/ScoreKeeper.cs +++ b/Assets/Script/PlayMode/ScoreKeeper.cs @@ -51,12 +51,12 @@ public double AddSolo(int notesHit, int notesMax) { // linear double multiplier = math.clamp((ratio - 0.6) / 0.4, 0, 1); - double ptsEarned = 100 * notesHit * multiplier; + double ptsEarned = 200 * notesHit * multiplier; // +5% bonus points // TODO: limit to FC? decide to keep at all? - if (ratio >= 1) - ptsEarned = 1.05 * ptsEarned; + // if (ratio >= 1) + // ptsEarned = 1.05 * ptsEarned; Add(ptsEarned); return ptsEarned; diff --git a/Assets/Script/PlayMode/StarScoreKeeper.cs b/Assets/Script/PlayMode/StarScoreKeeper.cs index e1811d2cf..75f64e5f1 100644 --- a/Assets/Script/PlayMode/StarScoreKeeper.cs +++ b/Assets/Script/PlayMode/StarScoreKeeper.cs @@ -3,29 +3,33 @@ using System.Linq; using UnityEngine; using YARG.Data; +using YARG.Util; namespace YARG.PlayMode { /// /// Star-score tracking. Could probably be combined with ScoreKeeper. /// public class StarScoreKeeper { + // https://github.com/hmxmilohax/Rock-Band-4-Deluxe/blob/0f1562bcf838b82bac0f9bdd8e6193152a73ae88/_rivals_ark/ps4/config/include/star_thresholds.dta /// /// Minimum avg. multipliers to get 1, 2, 3, 4, 5, and gold stars respectively. /// - public static readonly Dictionary instrumentThreshold = new() { - { "guitar", new float[] { .21f, .46f, .77f, 1.85f, 3.08f, 4.52f } }, - { "bass", new float[] { .21f, .5f, .9f, 2.77f, 4.62f, 6.78f } }, - { "keys", new float[] { .21f, .46f, .77f, 1.85f, 3.08f, 4.52f } }, - { "guitarCoop", new float[] { .21f, .46f, .77f, 1.85f, 3.08f, 4.52f } }, - { "rhythm", new float[] { .21f, .46f, .77f, 1.85f, 3.08f, 4.52f } }, - { "realGuitar", new float[] { .21f, .46f, .77f, 1.85f, 3.08f, 4.52f } }, - { "realBass", new float[] { .21f, .46f, .77f, 1.85f, 3.08f, 4.52f } }, - { "drums", new float[] { .21f, .46f, .77f, 1.85f, 3.08f, 4.52f } }, - { "realDrums", new float[] { .21f, .46f, .77f, 1.85f, 3.08f, 4.52f } }, - { "ghDrums", new float[] { .21f, .46f, .77f, 1.85f, 3.08f, 4.52f } }, - { "vocals", new float[] { 4f*0.05f, 4f*0.11f, 4f*0.19f, 4f*0.46f, 4f*0.77f, 4f*1.06f } }, - { "harmVocals", new float[] { 4f*0.05f, 4f*0.11f, 4f*0.19f, 4f*0.46f, 4f*0.77f, 4f*1.06f } } - }; + public static readonly float[] starThresholdsDefault = { .21f, .46f, .77f, 1.85f, 3.08f, 4.52f }; + + /// + /// Minimum avg. multipliers to get 1, 2, 3, 4, 5, and gold stars on Bass respectively. + /// + public static readonly float[] starThresholdsBass = { .21f, .5f, .9f, 2.77f, 4.62f, 6.78f }; + + /// + /// Minimum avg. multipliers to get 1, 2, 3, 4, 5, and gold stars on Drums respectively. + /// + public static readonly float[] starThresholdsDrums = { .21f, .46f, .77f, 1.85f, 3.08f, 4.29f }; + + /// + /// Minimum avg. multipliers to get 1, 2, 3, 4, 5, and gold stars on Vocals respectively. + /// + public static readonly float[] starThresholdsVocals = { .21f, .46f, .77f, 1.85f, 3.08f, 4.18f }; // keep track of all instances in Play to calculate the band total public static List instances = new(); @@ -59,7 +63,7 @@ public static void Reset() { /// /// Minimum points needed to get 1, 2, 3, 4, 5, and gold stars respectively. /// - public double[] scoreThreshold; + public double[] scoreThresholds; /// /// How many stars currently earned. @@ -67,16 +71,16 @@ public static void Reset() { public double Stars { get { int stars = 5; - while (stars >= 0 && scoreKeeper.Score < scoreThreshold[stars]) { --stars; } + while (stars >= 0 && scoreKeeper.Score < scoreThresholds[stars]) { --stars; } stars += 1; // stars earned, also index of threshold for next star switch (stars) { case int s when s == 0: - return scoreKeeper.Score / scoreThreshold[s]; + return scoreKeeper.Score / scoreThresholds[s]; case int s when s <= 5: - return (double) s + (scoreKeeper.Score - scoreThreshold[s - 1]) / (scoreThreshold[s] - scoreThreshold[s - 1]); + return (double) s + (scoreKeeper.Score - scoreThresholds[s - 1]) / (scoreThresholds[s] - scoreThresholds[s - 1]); default: // 6+ stars - return (double) 5 + (scoreKeeper.Score - scoreThreshold[4]) / (scoreThreshold[5] - scoreThreshold[4]); + return (double) 5 + (scoreKeeper.Score - scoreThresholds[4]) / (scoreThresholds[5] - scoreThresholds[4]); } } } @@ -85,37 +89,68 @@ public StarScoreKeeper(List chart, ScoreKeeper scoreKeeper, string ins instances.Add(this); this.scoreKeeper = scoreKeeper; + // solo sections + List soloEvents = new(); + foreach (var ev in Play.Instance.chart.events) { + if (ev.name == $"solo_{instrument}") { + soloEvents.Add(ev); + } + } + // calculate and store base score BaseScore = 0; foreach (var note in chart) { BaseScore += ptPerNote; if (note.length > .2f) { - BaseScore += ptSusPerBeat * Util.Utils.InfoLengthInBeats(note, Play.Instance.chart.beats); + BaseScore += ptSusPerBeat * Utils.InfoLengthInBeats(note, Play.Instance.chart.beats); } + + // check if note is in a solo section + foreach (var ev in soloEvents) { + if (ev.time <= note.time && note.time < ev.EndTime) { + // solo notes get double score, effectively + BaseScore += ptPerNote; + goto leaveSoloCheck; + } + } + leaveSoloCheck:; } SetupScoreThreshold(instrument); } - public StarScoreKeeper(ScoreKeeper scoreKeeper, string instrument, int noteCount, int ptPerNote) { + public StarScoreKeeper(ScoreKeeper scoreKeeper, string instrument, int noteCount, int ptPerNote, int soloNotes = 0) { instances.Add(this); this.scoreKeeper = scoreKeeper; - BaseScore = noteCount * ptPerNote; + // solo notes get double score, effectively + BaseScore = (noteCount + soloNotes) * ptPerNote; SetupScoreThreshold(instrument); } // populate scoreThreshold private void SetupScoreThreshold(string instrument) { - scoreThreshold = new double[] { - instrumentThreshold[instrument][0] * BaseScore, - instrumentThreshold[instrument][1] * BaseScore, - instrumentThreshold[instrument][2] * BaseScore, - instrumentThreshold[instrument][3] * BaseScore, - instrumentThreshold[instrument][4] * BaseScore, - instrumentThreshold[instrument][5] * BaseScore - }; + float[] curThresholds; + switch (instrument) { + case var i when i.ToLower().Contains("bass"): + curThresholds = starThresholdsBass; + break; + case var i when i.ToLower().Contains("drum"): + curThresholds = starThresholdsDrums; + break; + case var i when i.ToLower().Contains("vocal"): + curThresholds = starThresholdsVocals; + break; + default: + curThresholds = starThresholdsDefault; + break; + } + scoreThresholds = (from mul in curThresholds select mul * BaseScore).ToArray(); + + // Debug.Log(instrument); + // Debug.Log($"Base Score: {BaseScore}"); + // Debug.Log($"Star Reqs: {string.Join(", ", scoreThresholds)}"); } } } \ No newline at end of file diff --git a/Assets/Script/UI/PlayResultScreen/PlayResultScreen.cs b/Assets/Script/UI/PlayResultScreen/PlayResultScreen.cs index be92edecd..d561964f4 100644 --- a/Assets/Script/UI/PlayResultScreen/PlayResultScreen.cs +++ b/Assets/Script/UI/PlayResultScreen/PlayResultScreen.cs @@ -48,6 +48,8 @@ public class PlayResultScreen : MonoBehaviour { [Space] [SerializeField] private GameObject playerCardsContainer; + [SerializeField] + private TextMeshProUGUI scoreWIPNotice; private List playerCards = new(); @@ -194,6 +196,11 @@ IEnumerator EnableAnimation() { marginContainerRT.anchorMin += new Vector2(0, 1); marginContainerRT.anchorMax += new Vector2(0, 1); + // score WIP notice (attached to player cards) + var wipC = scoreWIPNotice.color; + wipC.a = 0; + scoreWIPNotice.color = wipC; + // help bar var hbYMinTgt = helpBarRT.anchorMin.y; var hbYMaxTgt = helpBarRT.anchorMax.y; @@ -222,6 +229,8 @@ IEnumerator EnableAnimation() { .SetEase(Ease.OutBack, overshoot: 1.2f) .WaitForCompletion(); + // show note that scoring system is WIP + scoreWIPNotice.DOFade(1f, 1f); OnEnableAnimationFinish();