forked from akanyan/mu3-mods
57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
using MU3.DB;
|
|
using MU3.User;
|
|
using MU3.Util;
|
|
using System;
|
|
|
|
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 = Math.Max(_userFumen?.TechScoreMax ?? 0, TechnicalRankID.AA.getLower());
|
|
}
|
|
|
|
switch(_eAbort) {
|
|
case patch_UserOption.eAbort.SSS1:
|
|
self = TechnicalRankID.SSS1.getLower();
|
|
break;
|
|
case patch_UserOption.eAbort.PB:
|
|
self = _previousPb;
|
|
break;
|
|
case patch_UserOption.eAbort.FB:
|
|
case patch_UserOption.eAbort.AA:
|
|
self = TechnicalRankID.AA.getLower();
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
if(self >= 0) {
|
|
_retireScoreBase = 1010000L - self;
|
|
_retireScoreCurrent = _retireScoreBase;
|
|
}
|
|
|
|
orig_updateUIScore(type);
|
|
}
|
|
}
|