1
0
mirror of synced 2024-11-28 09:20:53 +01:00

Modificators now alter the score and earned coin counts, added song speed change on the submenu

This commit is contained in:
0aubsq 2022-05-04 11:14:36 +02:00
parent bb65c0c95d
commit e111e31f6d
4 changed files with 152 additions and 8 deletions

View File

@ -45,6 +45,18 @@ namespace TJAPlayer3
#endregion
for (int i = 0; i < txSongSpeed.Length; i++)
{
Color _c = Color.White;
if (i < 5)
_c = Color.LimeGreen;
else if (i > 5)
_c = Color.Red;
txSongSpeed[i] = OptionTypeTx((0.5f + i * 0.1f).ToString("n1"), _c, Color.Black);
}
txSwitch[0] = OptionTypeTx(CLangManager.LangInstance.GetString(9000), Color.White, Color.Black);
txSwitch[1] = OptionTypeTx(CLangManager.LangInstance.GetString(9001), Color.White, Color.Black);
@ -82,8 +94,6 @@ namespace TJAPlayer3
txOtoiro[0] = OptionTypeTx(CLangManager.LangInstance.GetString(9007), Color.White, Color.Black);
}
OptionType[0] = OptionTypeTx(CLangManager.LangInstance.GetString(9008), Color.White, Color.Black);
OptionType[1] = OptionTypeTx(CLangManager.LangInstance.GetString(9009), Color.White, Color.Black);
OptionType[2] = OptionTypeTx(CLangManager.LangInstance.GetString(9010), Color.White, Color.Black);
@ -92,7 +102,7 @@ namespace TJAPlayer3
OptionType[5] = OptionTypeTx(CLangManager.LangInstance.GetString(72), Color.White, Color.Black);
OptionType[6] = OptionTypeTx(CLangManager.LangInstance.GetString(9012), Color.White, Color.Black);
OptionType[7] = OptionTypeTx(CLangManager.LangInstance.GetString(9013), Color.White, Color.Black);
OptionType[8] = OptionTypeTx(CLangManager.LangInstance.GetString(9014), Color.White, Color.Black);
OptionType[8] = OptionTypeTx(CLangManager.LangInstance.GetString(10), Color.White, Color.Black);
OptionType[9] = OptionTypeTx(CLangManager.LangInstance.GetString(9015), Color.White, Color.Black);
var _timingColors = new Color[] { Color.LimeGreen, Color.YellowGreen, Color.White, Color.Orange, Color.Red };
@ -107,9 +117,16 @@ namespace TJAPlayer3
base.On活性化();
}
public void tFetchMults(int player)
{
var scoreMult = tGetModMultiplier(EBalancingType.SCORE, true, player);
var coinMult = tGetModMultiplier(EBalancingType.COINS, true, player);
txModMults[0] = OptionTypeTx("Score Multiplier : " + scoreMult.ToString("n2"), Color.White, Color.Black);
txModMults[1] = OptionTypeTx("Coins Multiplier : " + coinMult.ToString("n2"), Color.White, Color.Black);
}
public override void On非活性化()
{
base.On非活性化();
}
public override void OnManagedリソースの作成()
@ -123,6 +140,8 @@ namespace TJAPlayer3
base.OnManagedリソースの解放();
}
public int On進行描画(int player)
{
if (this.b活性化してない)
@ -169,7 +188,7 @@ namespace TJAPlayer3
txJust[nJust],
txGameMode[nGameMode],
txSwitch[nAutoMode],
txNone,
txSongSpeed[nSongSpeed],
txOtoiro[nOtoiro],
};
@ -184,6 +203,9 @@ namespace TJAPlayer3
OptionType[i].t2D描画(TJAPlayer3.app.Device, baseX - 184, baseY + 4 + i * 40.8f);
}
txModMults[0]?.t2D拡大率考慮描画(TJAPlayer3.app.Device, CTexture.RefPnt.Up, baseX - 92, baseY + 4 - 5 * 40.8f);
txModMults[1]?.t2D拡大率考慮描画(TJAPlayer3.app.Device, CTexture.RefPnt.Up, baseX - 92, baseY + 4 - 4 * 40.8f);
for (int i = 0; i < _textures.Length; i++)
{
_textures[i]?.t2D拡大率考慮描画(TJAPlayer3.app.Device, CTexture.RefPnt.Up, baseX, baseY + 4 + i * 40.8f);
@ -219,8 +241,19 @@ namespace TJAPlayer3
: (TJAPlayer3.Pad.b押された(E楽器パート.DRUMS, Eパッド.LRed2P) || TJAPlayer3.Pad.b押された(E楽器パート.DRUMS, Eパッド.RRed2P));
if (_leftDrum) { OptionSelect(true); TJAPlayer3.Skin.sound変更音.t再生する(); };
if (_rightDrum) { OptionSelect(false); TJAPlayer3.Skin.sound変更音.t再生する(); };
if (_leftDrum)
{
OptionSelect(true);
tFetchMults(player);
TJAPlayer3.Skin.sound変更音.t再生する();
}
if (_rightDrum)
{
OptionSelect(false);
tFetchMults(player);
TJAPlayer3.Skin.sound変更音.t再生する();
}
if (_centerDrum && ctOpen.n現在の値 >= ctOpen.n終了値)
{
@ -283,6 +316,11 @@ namespace TJAPlayer3
public CHitSounds hsInfo;
public int nOtoiro = 0;
public CTexture[] txSongSpeed = new CTexture[16];
public int nSongSpeed = 5;
public CTexture[] txModMults = new CTexture[2];
public CTexture OptionTypeTx(string str文字, Color forecolor, Color backcolor)
{
using (var bmp = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 13).DrawPrivateFont(str文字, forecolor, backcolor))
@ -336,6 +374,9 @@ namespace TJAPlayer3
if (nAutoMode == 0) nAutoMode = 1;
else nAutoMode = 0;
break;
case 8:
ShiftVal(left, ref nSongSpeed, txSongSpeed.Length - 1, 0);
break;
case 9:
ShiftVal(left, ref nOtoiro, txOtoiro.Length - 1, 0);
break;
@ -444,6 +485,14 @@ namespace TJAPlayer3
#endregion
#region [ Song speed ]
nSongSpeed = Math.Max(0, Math.Min(txSongSpeed.Length - 1, (TJAPlayer3.ConfigIni.n演奏速度 / 2) - 5));
#endregion
tFetchMults(player);
}
public void Decision(int player)
@ -564,7 +613,86 @@ namespace TJAPlayer3
hsInfo.tReloadHitSounds(nOtoiro, actual);
#endregion
#region [ Song speed ]
TJAPlayer3.ConfigIni.n演奏速度 = (nSongSpeed + 5) * 2;
#endregion
}
#region [ Balancing functions ]
public float tGetScrollSpeedFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0)
{
var _compare = (isMenu) ? nSpeedCount != 1 : TJAPlayer3.ConfigIni.nScrollSpeed[actual] != 9;
if (ebt == EBalancingType.SCORE)
return (_compare) ? 0.9f : 1f;
return 1f;
}
public float tGetSongSpeedFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0)
{
var _compare = ((isMenu) ? (nSongSpeed + 5) * 2 : TJAPlayer3.ConfigIni.n演奏速度) / 20f;
if (ebt == EBalancingType.SCORE || _compare <= 1f)
return Math.Min(1f, (float)Math.Pow(_compare, 1.3));
return Math.Max(1f, (float)Math.Pow(_compare, 0.7));
}
public float tGetJustFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0)
{
var _compare = (isMenu) ? nJust : TJAPlayer3.ConfigIni.bJust[actual];
if (ebt == EBalancingType.SCORE)
return (_compare == 2) ? 0.6f : 1f;
return (_compare > 0) ? ((_compare > 1) ? 0.5f : 1.3f) : 1f;
}
public float tGetTimingFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0)
{
var _compare = (isMenu) ? nTiming - 2 : TJAPlayer3.ConfigIni.nTimingZones[actual] - 2;
if (ebt == EBalancingType.SCORE)
return (_compare < 0) ? (1f + 0.2f * _compare) : 1f;
return 1f + 0.2f * _compare;
}
public float tGetDoronFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0)
{
var _compare = (isMenu) ? nStealth : (int)TJAPlayer3.ConfigIni.eSTEALTH;
if (ebt == EBalancingType.SCORE || _compare == 0)
return 1f;
// Doron : x1.1 coins, Stealth : x1.4 coins
return 1f + 0.1f * (float)Math.Pow(_compare, 2);
}
public float tGetModMultiplier(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int player = 0)
{
float factor = 1f;
int actual = TJAPlayer3.GetActualPlayer(player);
factor *= tGetScrollSpeedFactor(ebt, isMenu, actual);
factor *= tGetSongSpeedFactor(ebt, isMenu, actual);
factor *= tGetJustFactor(ebt, isMenu, actual);
factor *= tGetTimingFactor(ebt, isMenu, actual);
factor *= tGetDoronFactor(ebt, isMenu, actual);
return ebt == EBalancingType.SCORE ? Math.Min(factor, 1f) : factor;
}
public enum EBalancingType
{
SCORE,
COINS
}
#endregion
}
}

View File

@ -220,6 +220,9 @@ namespace TJAPlayer3
public void Add( E楽器パート part, STAUTOPLAY bAutoPlay, long delta, int player )
{
double rev = 1.0;
delta = (long)(delta * TJAPlayer3.stage選曲.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, player));
switch ( part )
{
#region [ Unknown ]
@ -227,6 +230,7 @@ namespace TJAPlayer3
throw new ArgumentException();
#endregion
}
this.ctTimer = new CCounter( 0, 400, 1, TJAPlayer3.Timer );
for( int sc = 0; sc < 1; sc++ )

View File

@ -341,7 +341,6 @@ namespace TJAPlayer3
// other controller, etc. and the sounds of the input calibration audio file.
if (!TJAPlayer3.IsPerformingCalibration)
{
// Oto iro here
int actual1 = TJAPlayer3.GetActualPlayer(0);
int actual2 = TJAPlayer3.GetActualPlayer(1);

View File

@ -495,6 +495,12 @@ namespace TJAPlayer3
float starRate;
float redStarRate;
float[] modMultipliers =
{
TJAPlayer3.stage選曲.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.COINS, false, 0),
TJAPlayer3.stage選曲.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.COINS, false, 1)
};
if (TJAPlayer3.stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Tower)
{
diffModifier = 3;
@ -524,6 +530,7 @@ namespace TJAPlayer3
// this.nEarnedMedalsCount[0] = stars;
this.nEarnedMedalsCount[0] = 5 + (int)((diffModifier * (starRate + redStarRate)) * (floorRate * lengthBonus)) + clearModifier;
this.nEarnedMedalsCount[0] = Math.Max(5, (int)(this.nEarnedMedalsCount[0] * modMultipliers[0]));
}
else if (TJAPlayer3.stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Dan)
{
@ -576,7 +583,10 @@ namespace TJAPlayer3
if (clearModifier < 0)
this.nEarnedMedalsCount[0] = 10;
else
{
this.nEarnedMedalsCount[0] = 10 + goukakuModifier + clearModifier + (int)(partialScore * dAccuracyRate);
this.nEarnedMedalsCount[0] = Math.Max(10, (int)(this.nEarnedMedalsCount[0] * modMultipliers[0]));
}
}
else
{
@ -636,7 +646,10 @@ namespace TJAPlayer3
if (clearModifier < 0)
this.nEarnedMedalsCount[i] = 5;
else
{
this.nEarnedMedalsCount[i] = 5 + (int)((diffModifier * (starRate + redStarRate)) * dAccuracyRate) + clearModifier + scoreRankModifier;
this.nEarnedMedalsCount[i] = Math.Max(5, (int)(this.nEarnedMedalsCount[i] * modMultipliers[i]));
}
}
}