1
0
mirror of synced 2025-02-20 20:41:46 +01:00

Judge clap note on konga mode

This commit is contained in:
0aubsq 2022-05-08 04:28:30 +02:00
parent 0949bf690c
commit e77537d927
4 changed files with 206 additions and 45 deletions

View File

@ -158,42 +158,6 @@ namespace TJAPlayer3
}
/*
if (TJAPlayer3.Tx.Taiko_Base != null )
{
TJAPlayer3.Tx.Taiko_Base.t2D描画( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[0], TJAPlayer3.Skin.Game_Taiko_Y[0]);
if( TJAPlayer3.stage演奏ドラム画面.bDoublePlay )
TJAPlayer3.Tx.Taiko_Base.t2D描画( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[1], TJAPlayer3.Skin.Game_Taiko_Y[1]);
}
*/
/*
if( TJAPlayer3.Tx.Taiko_Don_Left != null && TJAPlayer3.Tx.Taiko_Don_Right != null && TJAPlayer3.Tx.Taiko_Ka_Left != null && TJAPlayer3.Tx.Taiko_Ka_Right != null )
{
TJAPlayer3.Tx.Taiko_Ka_Left.Opacity = this.stパッド状態[0].n明るさ * 73;
TJAPlayer3.Tx.Taiko_Ka_Right.Opacity = this.stパッド状態[1].n明るさ * 73;
TJAPlayer3.Tx.Taiko_Don_Left.Opacity = this.stパッド状態[2].n明るさ * 73;
TJAPlayer3.Tx.Taiko_Don_Right.Opacity = this.stパッド状態[3].n明るさ * 73;
TJAPlayer3.Tx.Taiko_Ka_Left.t2D描画( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[0], TJAPlayer3.Skin.Game_Taiko_Y[0], new Rectangle( 0, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Height) );
TJAPlayer3.Tx.Taiko_Ka_Right.t2D描画( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[0] + TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, TJAPlayer3.Skin.Game_Taiko_Y[0], new Rectangle(TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Height) );
TJAPlayer3.Tx.Taiko_Don_Left.t2D描画( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[0], TJAPlayer3.Skin.Game_Taiko_Y[0], new Rectangle( 0, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Height) );
TJAPlayer3.Tx.Taiko_Don_Right.t2D描画( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[0] + TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, TJAPlayer3.Skin.Game_Taiko_Y[0], new Rectangle(TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Height));
}
if( TJAPlayer3.Tx.Taiko_Don_Left != null && TJAPlayer3.Tx.Taiko_Don_Right != null && TJAPlayer3.Tx.Taiko_Ka_Left != null && TJAPlayer3.Tx.Taiko_Ka_Right != null )
{
TJAPlayer3.Tx.Taiko_Ka_Left.Opacity = this.stパッド状態[4].n明るさ * 73;
TJAPlayer3.Tx.Taiko_Ka_Right.Opacity = this.stパッド状態[5].n明るさ * 73;
TJAPlayer3.Tx.Taiko_Don_Left.Opacity = this.stパッド状態[6].n明るさ * 73;
TJAPlayer3.Tx.Taiko_Don_Right.Opacity = this.stパッド状態[7].n明るさ * 73;
TJAPlayer3.Tx.Taiko_Ka_Left.t2D描画( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[1], TJAPlayer3.Skin.Game_Taiko_Y[1], new Rectangle( 0, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Height) );
TJAPlayer3.Tx.Taiko_Ka_Right.t2D描画( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[1] + TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, TJAPlayer3.Skin.Game_Taiko_Y[1], new Rectangle(TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Height) );
TJAPlayer3.Tx.Taiko_Don_Left.t2D描画( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[1], TJAPlayer3.Skin.Game_Taiko_Y[1], new Rectangle( 0, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Height) );
TJAPlayer3.Tx.Taiko_Don_Right.t2D描画( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[1] + TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, TJAPlayer3.Skin.Game_Taiko_Y[1], new Rectangle(TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, 0, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.szテクスチャサイズ.Height) );
}
*/
int[] nLVUPY = new int[] { 127, 127, 0, 0 };

View File

@ -780,6 +780,10 @@ namespace TJAPlayer3
if( b両手入力 )
nInput = 3;
break;
case Eパッド.CLAP:
case Eパッド.CLAP2P:
nInput = 3;
break;
}
@ -818,6 +822,8 @@ namespace TJAPlayer3
int nLane = index;
int nPad = index;
var _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(nPlayer)];
E判定 e判定 = this.e指定時刻からChipのJUDGEを返す( nHitTime, pChip, nPlayer );
e判定 = AlterJudgement(nPlayer, e判定, false);
@ -848,7 +854,7 @@ namespace TJAPlayer3
break;
case 0x14:
case 0x1B:
nFly = b両手入力 ? 4 : 2;
nFly = (b両手入力 || _gt == EGameType.KONGA) ? 4 : 2;
break;
case 0x1F:
nFly = nInput == 0 ? 1 : 2;
@ -1112,6 +1118,14 @@ namespace TJAPlayer3
TJAPlayer3.stage演奏ドラム画面.actMtaiko.tMtaikoEvent(nChannel, nHand, nUsePlayer);
#endregion
// Chip bools
EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(nUsePlayer)];
bool _isBigKaTaiko = NotesManager.IsBigKaTaiko(chipNoHit, _gt);
bool _isBigDonTaiko = NotesManager.IsBigDonTaiko(chipNoHit, _gt);
bool _isClapKonga = NotesManager.IsClapKonga(chipNoHit, _gt);
bool _isPinkKonga = NotesManager.IsSwapNote(chipNoHit, _gt);
if (this.b連打中[nUsePlayer])
{
@ -1124,9 +1138,132 @@ namespace TJAPlayer3
break;
}
switch (((Eパッド)nPad))
{
case Eパッド.LRed:
case Eパッド.LRed2P:
case Eパッド.RRed:
case Eパッド.RRed2P:
case Eパッド.LBlue:
case Eパッド.LBlue2P:
case Eパッド.RBlue:
case Eパッド.RBlue2P:
{
// Regular notes
#region [Fetch values]
// Flatten pads from 8 to 4
var _pad = (Eパッド)nPad;
if ((Eパッド)nPad == Eパッド.LRed2P) _pad = Eパッド.LRed;
if ((Eパッド)nPad == Eパッド.RRed2P) _pad = Eパッド.RRed;
if ((Eパッド)nPad == Eパッド.LBlue2P) _pad = Eパッド.LBlue;
if ((Eパッド)nPad == Eパッド.RBlue2P) _pad = Eパッド.RBlue;
bool _isLeftPad = _pad == Eパッド.LRed || _pad == Eパッド.LBlue;
bool _isBlue = _pad == Eパッド.RBlue || _pad == Eパッド.LBlue;
int waitInstr = _isLeftPad ? 2 : 1;
int waitRec = waitInstr == 2 ? 1 : 2;
bool _isBigNoteTaiko = _isBlue ? _isBigKaTaiko : _isBigDonTaiko;
bool _isSmallNote = NotesManager.IsSmallNote(chipNoHit, _isBlue);
#endregion
// Process small note
if (e判定 != E判定.Miss && _isSmallNote)
{
this.tドラムヒット処理(nTime, _pad, chipNoHit, false, nUsePlayer);
bHitted = true;
}
// Process big notes (judge big notes off)
if (e判定 != E判定.Miss && _isBigNoteTaiko && !TJAPlayer3.ConfigIni.b大音符判定)
{
this.tドラムヒット処理(nTime, _pad, chipNoHit, true, nUsePlayer);
bHitted = true;
this.nWaitButton = 0;
break;
}
// Process big notes (judge big notes on)
if (e判定 != E判定.Miss && ((_isBigNoteTaiko && TJAPlayer3.ConfigIni.b大音符判定) || _isPinkKonga))
{
double divided_songspeed = (double)TJAPlayer3.ConfigIni.n演奏速度 / 20.0;
float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * divided_songspeed);
int nWaitTime = TJAPlayer3.ConfigIni.n両手判定の待ち時間;
if (chipNoHit.eNoteState == ENoteState.none)
{
if (time <= 110)
{
chipNoHit.nProcessTime = (int)(CSound管理.rc演奏用タイマ.n現在時刻ms * divided_songspeed);
chipNoHit.eNoteState = ENoteState.wait;
this.nWaitButton = waitInstr;
}
}
else if (chipNoHit.eNoteState == ENoteState.wait)
{
if (this.nWaitButton == waitRec && time <= 110 && chipNoHit.nProcessTime
+ nWaitTime > (int)(CSound管理.rc演奏用タイマ.n現在時刻ms * divided_songspeed))
{
this.tドラムヒット処理(nTime, _pad, chipNoHit, true, nUsePlayer);
bHitted = true;
this.nWaitButton = 0;
}
else if (this.nWaitButton == waitInstr && time <= 110 && chipNoHit.nProcessTime
+ nWaitTime < (int)(CSound管理.rc演奏用タイマ.n現在時刻ms * divided_songspeed))
{
this.tドラムヒット処理(nTime, _pad, chipNoHit, false, nUsePlayer);
bHitted = true;
this.nWaitButton = 0;
}
}
}
// Judge rolls
if (e判定 != E判定.Miss
&& (chipNoHit.nチャンネル番号 == 0x15 || chipNoHit.nチャンネル番号 == 0x16
|| chipNoHit.nチャンネル番号 == 0x17 && !_isBlue))
{
this.tドラムヒット処理(nTime, _pad, chipNoHit, false, nUsePlayer);
}
if (!bHitted)
break;
continue;
}
case Eパッド.CLAP:
case Eパッド.CLAP2P:
{
// Process konga clap
if (e判定 != E判定.Miss && _isClapKonga)
{
this.tドラムヒット処理(nTime, Eパッド.CLAP, chipNoHit, false, nUsePlayer);
bHitted = true;
}
if (!bHitted)
break;
continue;
}
}
#region [ (A) inputEvent ]
//-----------------------------
//-----------------------------
#region [Legacy]
/*
switch (((Eパッド)nPad))
{
case Eパッド.LRed:
@ -1139,14 +1276,14 @@ namespace TJAPlayer3
this.tドラムヒット処理(nTime, Eパッド.LRed, chipNoHit, false, nUsePlayer);
bHitted = true;
}
if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x13 || chipNoHit.nチャンネル番号 == 0x1A) && !TJAPlayer3.ConfigIni.b大音符判定)
if (e判定 != E判定.Miss && (_isBigDonTaiko || chipNoHit.nチャンネル番号 == 0x1A) && !TJAPlayer3.ConfigIni.b大音符判定)
{
this.tドラムヒット処理(nTime, Eパッド.LRed, chipNoHit, true, nUsePlayer);
bHitted = true;
this.nWaitButton = 0;
break;
}
if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x13 || chipNoHit.nチャンネル番号 == 0x1A) && TJAPlayer3.ConfigIni.b大音符判定)
if (e判定 != E判定.Miss && (_isBigDonTaiko || chipNoHit.nチャンネル番号 == 0x1A) && TJAPlayer3.ConfigIni.b大音符判定)
{
if (chipNoHit.eNoteState == ENoteState.none)
{
@ -1197,14 +1334,14 @@ namespace TJAPlayer3
this.tドラムヒット処理(nTime, Eパッド.RRed, chipNoHit, false, nUsePlayer);
bHitted = true;
}
if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x13 || chipNoHit.nチャンネル番号 == 0x1A) && !TJAPlayer3.ConfigIni.b大音符判定)
if (e判定 != E判定.Miss && (_isBigDonTaiko || chipNoHit.nチャンネル番号 == 0x1A) && !TJAPlayer3.ConfigIni.b大音符判定)
{
this.tドラムヒット処理(nTime, Eパッド.RRed, chipNoHit, true, nUsePlayer);
bHitted = true;
this.nWaitButton = 0;
break;
}
if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x13 || chipNoHit.nチャンネル番号 == 0x1A) && TJAPlayer3.ConfigIni.b大音符判定)
if (e判定 != E判定.Miss && (_isBigDonTaiko || chipNoHit.nチャンネル番号 == 0x1A) && TJAPlayer3.ConfigIni.b大音符判定)
{
if (chipNoHit.eNoteState == ENoteState.none)
{
@ -1253,7 +1390,10 @@ namespace TJAPlayer3
case Eパッド.LBlue2P:
#region[ ]
//-----------------------------
{
{
if (e判定 != E判定.Miss && chipNoHit.nチャンネル番号 == 0x12)
{
this.tドラムヒット処理(nTime, Eパッド.LBlue, chipNoHit, false, nUsePlayer);
@ -1369,7 +1509,11 @@ namespace TJAPlayer3
//-----------------------------
#endregion
}
//2016.07.14 kairera0467 Adlibの場合、一括して処理を行う。
*/
#endregion
//2016.07.14 kairera0467 Adlibの場合、一括して処理を行う。
if (e判定 != E判定.Miss && chipNoHit.nチャンネル番号 == 0x1F)
{
this.tドラムヒット処理(nTime, (Eパッド)nPad, chipNoHit, false, nUsePlayer);
@ -1378,6 +1522,8 @@ namespace TJAPlayer3
//-----------------------------
#endregion
#region [ (B) ]
//-----------------------------
int pad = nPad; // 以下、nPad の代わりに pad を用いる。(成りすまし用)

View File

@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TJAPlayer3
{
// Simple class containing functions to simplify readability of CChip elements
class NotesManager
{
public static bool IsSmallNote(CDTX.CChip chip, bool blue)
{
return blue ? chip.nチャンネル番号 == 0x12 : chip.nチャンネル番号 == 0x11;
}
public static bool IsBigKaTaiko(CDTX.CChip chip, EGameType gt)
{
return (chip.nチャンネル番号 == 0x14 || chip.nチャンネル番号 == 0x1B) && gt == EGameType.TAIKO;
}
public static bool IsBigDonTaiko(CDTX.CChip chip, EGameType gt)
{
return (chip.nチャンネル番号 == 0x13 || chip.nチャンネル番号 == 0x1A) && gt == EGameType.TAIKO;
}
public static bool IsClapKonga(CDTX.CChip chip, EGameType gt)
{
return (chip.nチャンネル番号 == 0x14 || chip.nチャンネル番号 == 0x1B) && gt == EGameType.KONGA;
}
public static bool IsSwapNote(CDTX.CChip chip, EGameType gt)
{
return (
((chip.nチャンネル番号 == 0x13 || chip.nチャンネル番号 == 0x1A) && gt == EGameType.KONGA) // Konga Pink note
|| IsPurpleNote(chip, gt) // Purple (Green) note
);
}
// Not implemented yet
public static bool IsPurpleNote(CDTX.CChip chip, EGameType gt)
{
return false;
}
}
}

View File

@ -146,6 +146,7 @@
<Compile Include="I18N\CLang_jp.cs" />
<Compile Include="I18N\CLang_zh.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Stages\07.Game\Taiko\NotesManager.cs" />
<Compile Include="Stages\XX.Templates\CStageTemplate.cs" />
<EmbeddedResource Include="Properties\Discord.resx">
<Generator>ResXFileCodeGenerator</Generator>