forked from akanyan/mu3-mods
feat!: NaiveRating -> MoreProfileOptions
This commit is contained in:
51
Extras/MoreProfileOptions/MU3.Battle/patch_Counters.cs
Normal file
51
Extras/MoreProfileOptions/MU3.Battle/patch_Counters.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using MU3.DB;
|
||||
using MU3.User;
|
||||
using MU3.Util;
|
||||
|
||||
namespace MU3.Battle;
|
||||
class patch_Counters: Counters {
|
||||
private long _techScoreLost;
|
||||
private long _tsjBellLost;
|
||||
private patch_UserOption.eAbort _eAbort;
|
||||
private long _retireScoreBase;
|
||||
private long _retireScoreCurrent;
|
||||
|
||||
private UserFumen _userFumen;
|
||||
private int _previousPb;
|
||||
public new int getTechScoreEnable() {
|
||||
if(_eAbort == patch_UserOption.eAbort.FB && _tsjBellLost > 0) {
|
||||
return 0;
|
||||
}
|
||||
return (int)(1010000 - _techScoreLost);
|
||||
}
|
||||
|
||||
private extern void orig_updateUIScore(ScoreType type = ScoreType.Max);
|
||||
private void updateUIScore(ScoreType type = ScoreType.Max) {
|
||||
int self = -1;
|
||||
|
||||
if(_userFumen == null) {
|
||||
GameEngine ge = SingletonMonoBehaviour<GameEngine>.instance;
|
||||
UserManager userManager = Singleton<UserManager>.instance;
|
||||
_userFumen = userManager.getUserFumen(ge.sessionInfo.musicData.id, ge.sessionInfo.musicLevel, create: false);
|
||||
_previousPb = _userFumen?.TechScoreMax ?? 0;
|
||||
}
|
||||
|
||||
switch(_eAbort) {
|
||||
case patch_UserOption.eAbort.SSS1:
|
||||
self = TechnicalRankID.SSS1.getLower();
|
||||
break;
|
||||
case patch_UserOption.eAbort.PB:
|
||||
self = _previousPb;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if(self >= 0) {
|
||||
_retireScoreBase = 1010000L - self;
|
||||
_retireScoreCurrent = _retireScoreBase;
|
||||
}
|
||||
|
||||
orig_updateUIScore(type);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user