From 818f3966e3d817eba08043bcaf273ce08b894aa9 Mon Sep 17 00:00:00 2001 From: 0aubsq <0aubsq@gmail.com> Date: Thu, 14 Oct 2021 02:48:44 +0200 Subject: [PATCH] (Pre. v.0.4.3) Parse and display LIFE parameter while playing Tower charts --- TJAPlayer3/Songs/CDTX.cs | 9 +++ TJAPlayer3/Songs/CSong管理.cs | 16 +++-- TJAPlayer3/Songs/Cスコア.cs | 5 +- TJAPlayer3/Songs/C曲リストノード.cs | 4 ++ TJAPlayer3/Stages/05.SongSelect/CStage選曲.cs | 3 + .../07.Game/Taiko/CAct演奏Drumsゲージ.cs | 2 +- .../Stages/07.Game/Taiko/CAct演奏Drums背景.cs | 64 ++++++++++++++++++- 7 files changed, 96 insertions(+), 7 deletions(-) diff --git a/TJAPlayer3/Songs/CDTX.cs b/TJAPlayer3/Songs/CDTX.cs index 9f093f1b..62a3d500 100644 --- a/TJAPlayer3/Songs/CDTX.cs +++ b/TJAPlayer3/Songs/CDTX.cs @@ -1185,6 +1185,10 @@ namespace TJAPlayer3 public STDGBVALUE LEVEL; public bool bLyrics; public int[] LEVELtaiko = new int[(int)Difficulty.Total] { -1, -1, -1, -1, -1, -1, -1 }; + + // Tower lifes + public int LIFE; + public Dictionary listAVI; public Dictionary listAVIPAN; public Dictionary listDS; @@ -4881,6 +4885,11 @@ namespace TJAPlayer3 this.LEVEL.Taiko = level; this.LEVELtaiko[this.n参照中の難易度] = level; } + else if (strCommandName.Equals("LIFE")) + { + var life = (int)Convert.ToDouble(strCommandParam); + this.LIFE = life; + } else if (strCommandName.Equals("BPM")) { if (strCommandParam.IndexOf(",") != -1) diff --git a/TJAPlayer3/Songs/CSong管理.cs b/TJAPlayer3/Songs/CSong管理.cs index fcdc9a0c..2a24bdec 100644 --- a/TJAPlayer3/Songs/CSong管理.cs +++ b/TJAPlayer3/Songs/CSong管理.cs @@ -203,9 +203,12 @@ namespace TJAPlayer3 { c曲リストノード.strジャンル = c曲リストノード.r親ノード.strジャンル; } - c曲リストノード.nLevel = dtx.LEVELtaiko; - - switch (c曲リストノード.strジャンル) + c曲リストノード.nLevel = dtx.LEVELtaiko; + + // LIFE here + c曲リストノード.nLife = dtx.LIFE; + + switch (c曲リストノード.strジャンル) { case "J-POP": c曲リストノード.strジャンル = "ポップス"; @@ -949,7 +952,12 @@ namespace TJAPlayer3 c曲リストノード.arスコア[ i ].譜面情報.nレベル[4] = cdtx.LEVELtaiko[4]; c曲リストノード.arスコア[i].譜面情報.nレベル[5] = cdtx.LEVELtaiko[5]; c曲リストノード.arスコア[i].譜面情報.nレベル[6] = cdtx.LEVELtaiko[6]; - this.nファイルから反映できたスコア数++; + + // Tower Lives + c曲リストノード.arスコア[i].譜面情報.nLife = cdtx.LIFE; + + + this.nファイルから反映できたスコア数++; cdtx.On非活性化(); //Debug.WriteLine( "★" + this.nファイルから反映できたスコア数 + " " + c曲リストノード.arスコア[ i ].譜面情報.タイトル ); #region [ 曲検索ログ出力 ] diff --git a/TJAPlayer3/Songs/Cスコア.cs b/TJAPlayer3/Songs/Cスコア.cs index 7329a286..33bce960 100644 --- a/TJAPlayer3/Songs/Cスコア.cs +++ b/TJAPlayer3/Songs/Cスコア.cs @@ -79,7 +79,10 @@ namespace TJAPlayer3 public string strサブタイトル; public int[] nレベル; public int[] nクリア; //0:未クリア 1:クリア 2:フルコンボ 3:ドンダフルコンボ - public int[] nスコアランク; //0:未取得 1:白粋 2:銅粋 3:銀粋 4:金雅 5:桃雅 6:紫雅 7:虹極 + public int[] nスコアランク; //0:未取得 1:白粋 2:銅粋 3:銀粋 4:金雅 5:桃雅 6:紫雅 7:虹極 + + // Tower lifes + public int nLife; [Serializable] [StructLayout( LayoutKind.Sequential )] diff --git a/TJAPlayer3/Songs/C曲リストノード.cs b/TJAPlayer3/Songs/C曲リストノード.cs index be7521f5..9f4bb05a 100644 --- a/TJAPlayer3/Songs/C曲リストノード.cs +++ b/TJAPlayer3/Songs/C曲リストノード.cs @@ -59,6 +59,10 @@ namespace TJAPlayer3 public string strSkinPath = ""; // #28195 2012.5.4 yyagi; box.defでのスキン切り替え対応 public bool bBranch = false; public int[] nLevel = new int[(int)Difficulty.Total]{ 0, 0, 0, 0, 0, 0, 0 }; + + // Tower Lives + public int nLife = 5; + public string[] strBoxText = new string[3]; public Eジャンル eジャンル = Eジャンル.None; diff --git a/TJAPlayer3/Stages/05.SongSelect/CStage選曲.cs b/TJAPlayer3/Stages/05.SongSelect/CStage選曲.cs index cf7d70fe..cbd238c8 100644 --- a/TJAPlayer3/Stages/05.SongSelect/CStage選曲.cs +++ b/TJAPlayer3/Stages/05.SongSelect/CStage選曲.cs @@ -670,6 +670,9 @@ namespace TJAPlayer3 { if (TJAPlayer3.ConfigIni.nPlayerCount == 1) { + // Init tower variables + CFloorManagement.reinitialize(this.r現在選択中の曲.arスコア[(int)Difficulty.Tower].譜面情報.nLife); + TJAPlayer3.Skin.sound決定音.t再生する(); this.t曲を選択する(); } diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsゲージ.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsゲージ.cs index e9ea07d6..efcfe2b8 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsゲージ.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsゲージ.cs @@ -379,7 +379,7 @@ namespace TJAPlayer3 } #endregion - + // Soul fire here if(TJAPlayer3.Tx.Gauge_Soul_Fire != null ) { //仮置き diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums背景.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums背景.cs index 857a176b..fd008622 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums背景.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums背景.cs @@ -6,6 +6,21 @@ using static TJAPlayer3.CActSelect曲リスト; namespace TJAPlayer3 { + // Small static class which refers to the latest encountered floor, would allow more control later + static internal class CFloorManagement + { + public static void reinitialize(int life) + { + CFloorManagement.LastRegisteredFloor = 1; + CFloorManagement.MaxNumberOfLives = life; + CFloorManagement.CurrentNumberOfLives = life; + } + + public static int LastRegisteredFloor = 1; + public static int MaxNumberOfLives = 5; + public static int CurrentNumberOfLives = 5; + } + internal class CAct演奏Drums背景 : CActivity { // 本家っぽい背景を表示させるメソッド。 @@ -54,6 +69,8 @@ namespace TJAPlayer3 this.ttkTouTatsuKaiSuu = new TitleTextureKey("到達階数", pfTowerText, Color.White, Color.Black, 700); this.ttkKai = new TitleTextureKey("階", pfTowerText, Color.White, Color.Black, 700); + this.ct炎 = new CCounter(0, 6, 50, TJAPlayer3.Timer); + base.On活性化(); } @@ -328,9 +345,13 @@ namespace TJAPlayer3 TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(ttkTouTatsuKaiSuu).t2D描画(TJAPlayer3.app.Device, 550, 32); TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(ttkKai).t2D描画(TJAPlayer3.app.Device, 750, 104); + this.ct炎.t進行Loop(); + #region [Floor number] - string floorStr = TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0].ToString(); + CFloorManagement.LastRegisteredFloor = TJAPlayer3.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1; + + string floorStr = CFloorManagement.LastRegisteredFloor.ToString(); int len = floorStr.Length; @@ -350,6 +371,45 @@ namespace TJAPlayer3 digitLength, TJAPlayer3.Tx.Taiko_Combo[0].szテクスチャサイズ.Height)); } + #endregion + + #region [Life Tamashii icon] + + int baseX = 886; + int baseY = 22; + + TJAPlayer3.Tx.Gauge_Soul_Fire?.t2D描画(TJAPlayer3.app.Device, baseX, baseY, new Rectangle(230 * (this.ct炎.n現在の値), 0, 230, 230)); + TJAPlayer3.Tx.Gauge_Soul?.t2D描画(TJAPlayer3.app.Device, baseX + 72, baseY + 73, new Rectangle(0, 0, 80, 80)); + + #endregion + + #region [Life number] + + string lifeStr = CFloorManagement.CurrentNumberOfLives.ToString(); + + len = lifeStr.Length; + + bool lifeSpecialCase = CFloorManagement.CurrentNumberOfLives == 1 && CFloorManagement.MaxNumberOfLives != 1; + float lifeRatio = CFloorManagement.CurrentNumberOfLives / (float)CFloorManagement.MaxNumberOfLives; + + Color4 lifeColor = (lifeRatio > 0.5f && !lifeSpecialCase) ? new Color4(0.2f, 1f, 0.2f) + : ((lifeRatio >= 0.2f && !lifeSpecialCase) ? new Color4(1f, 1f, 0.2f) + : new Color4(1f, 0.2f, 0.2f)); + + TJAPlayer3.Tx.Taiko_Combo[0].color4 = lifeColor; + TJAPlayer3.Tx.Taiko_Combo[0].vc拡大縮小倍率.X = 1.1f; + TJAPlayer3.Tx.Taiko_Combo[0].vc拡大縮小倍率.Y = 1.1f; + + for (int idx = 0; idx < len; idx++) + { + int currentNum = int.Parse(lifeStr[len - idx - 1].ToString()); + + TJAPlayer3.Tx.Taiko_Combo[0].t2D描画(TJAPlayer3.app.Device, 996 + ((digitLength - 8) * (len - idx) * 1.1f), + 106, + new Rectangle(digitLength * currentNum, 0, + digitLength, TJAPlayer3.Tx.Taiko_Combo[0].szテクスチャサイズ.Height)); + } + TJAPlayer3.Tx.Taiko_Combo[0].color4 = new Color4(1f, 1f, 1f); #endregion @@ -443,6 +503,8 @@ namespace TJAPlayer3 private TitleTextureKey ttkKai; private CPrivateFastFont pfTowerText; + private CCounter ct炎; + private EFIFOモード eFadeMode; //----------------- #endregion