From 8b72d093843a68d3268a15fc419bb768c5e32234 Mon Sep 17 00:00:00 2001 From: 0auBSQ <58159635+0auBSQ@users.noreply.github.com> Date: Sat, 19 Aug 2023 02:54:55 +0900 Subject: [PATCH] Edit and improve effects methods --- TJAPlayer3/Databases/DBCharacter.cs | 18 ++++++++ TJAPlayer3/Databases/DBPuchichara.cs | 10 +++++ TJAPlayer3/Helpers/HRarity.cs | 20 +++++++++ TJAPlayer3/Songs/CDTX.cs | 36 +++++++-------- TJAPlayer3/Stages/01.StartUp/CCharacter.cs | 10 +++++ TJAPlayer3/Stages/01.StartUp/CPuchichara.cs | 10 +++++ TJAPlayer3/Stages/08.Result/CStage結果.cs | 46 +------------------- Test/Global/Characters/Template/Effects.json | 4 +- 8 files changed, 91 insertions(+), 63 deletions(-) diff --git a/TJAPlayer3/Databases/DBCharacter.cs b/TJAPlayer3/Databases/DBCharacter.cs index aecc1dc3..e623d95f 100644 --- a/TJAPlayer3/Databases/DBCharacter.cs +++ b/TJAPlayer3/Databases/DBCharacter.cs @@ -11,11 +11,29 @@ namespace TJAPlayer3 public CharacterEffect() { Gauge = "Normal"; + BombFactor = 20; + FuseRollFactor = 0; + } + + public float GetCoinMultiplier() + { + float mult = 1f; + + if (Gauge == "Hard") mult *= 1.5f; + if (Gauge == "Extreme") mult *= 1.8f; + + return mult; } [JsonProperty("gauge")] public string Gauge; + + [JsonProperty("bombFactor")] + public int BombFactor; + + [JsonProperty("fuseRollFactor")] + public int FuseRollFactor; } public class CharacterData diff --git a/TJAPlayer3/Databases/DBPuchichara.cs b/TJAPlayer3/Databases/DBPuchichara.cs index c07467ab..8b7df7da 100644 --- a/TJAPlayer3/Databases/DBPuchichara.cs +++ b/TJAPlayer3/Databases/DBPuchichara.cs @@ -16,6 +16,16 @@ namespace TJAPlayer3 SplitLane = false; } + public float GetCoinMultiplier() + { + float mult = 1f; + + if (Autoroll > 0) mult *= 0f; + if (ShowAdlib == true) mult *= 0.9f; + if (AllPurple == true) mult *= 1.1f; + + return mult; + } [JsonProperty("allpurple")] public bool AllPurple; diff --git a/TJAPlayer3/Helpers/HRarity.cs b/TJAPlayer3/Helpers/HRarity.cs index 7609b189..ae73c119 100644 --- a/TJAPlayer3/Helpers/HRarity.cs +++ b/TJAPlayer3/Helpers/HRarity.cs @@ -29,6 +29,16 @@ namespace TJAPlayer3 ["Legendary"] = 4, }; + private static Dictionary RarityToCoinMultiplier = new Dictionary + { + ["Poor"] = 0.8f, + ["Common"] = 1f, + ["Uncommon"] = 1.1f, + ["Rare"] = 1.2f, + ["Epic"] = 1.3f, + ["Legendary"] = 1.5f, + }; + public static Color tRarityToColor(string rarity) { @@ -51,6 +61,16 @@ namespace TJAPlayer3 return modalInt; } + public static float tRarityToRarityToCoinMultiplier(string rarity) + { + float coinMult = 1f; + + if (RarityToCoinMultiplier.ContainsKey(rarity)) + coinMult = RarityToCoinMultiplier[rarity]; + + return coinMult; + } + } } diff --git a/TJAPlayer3/Songs/CDTX.cs b/TJAPlayer3/Songs/CDTX.cs index ea5905e9..5e17f90d 100644 --- a/TJAPlayer3/Songs/CDTX.cs +++ b/TJAPlayer3/Songs/CDTX.cs @@ -1872,22 +1872,30 @@ namespace TJAPlayer3 Random rnd = new System.Random(); var eFun = TJAPlayer3.ConfigIni.nFunMods[TJAPlayer3.GetActualPlayer(player)]; + var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character]; + + var bombFactor = Math.Max(1, Math.Min(100, chara.effect.BombFactor)); + var fuseRollFactor = Math.Max(0, Math.Min(100, chara.effect.FuseRollFactor)); switch (eFun) { case EFunMods.MINESWEEPER: foreach (var chip in this.listChip) { - int n = rnd.Next(100); - - if (n >= 0 && n <= 20) - { - if (NotesManager.IsMissableNote(chip)) - { - chip.nチャンネル番号 = 0x1C; - } - + if (NotesManager.IsMissableNote(chip)) + { + int n = rnd.Next(100); + + if (n < bombFactor) chip.nチャンネル番号 = 0x1C; } + + if (NotesManager.IsBalloon(chip)) + { + int n = rnd.Next(100); + + if (n < fuseRollFactor) chip.nチャンネル番号 = 0x1D; + } + } break; case EFunMods.AVALANCHE: @@ -2029,19 +2037,13 @@ namespace TJAPlayer3 { switch (chip.nチャンネル番号) { - case 0x11: - chip.nチャンネル番号 = 0x101; - break; - case 0x12: - chip.nチャンネル番号 = 0x101; - break; case 0x13: + case 0x1A: chip.nチャンネル番号 = 0x101; - chip.nSenote = 6; break; case 0x14: + case 0x1B: chip.nチャンネル番号 = 0x101; - chip.nSenote = 5; break; } } diff --git a/TJAPlayer3/Stages/01.StartUp/CCharacter.cs b/TJAPlayer3/Stages/01.StartUp/CCharacter.cs index c67ac7a5..195c20d7 100644 --- a/TJAPlayer3/Stages/01.StartUp/CCharacter.cs +++ b/TJAPlayer3/Stages/01.StartUp/CCharacter.cs @@ -15,6 +15,16 @@ namespace TJAPlayer3 public DBUnlockables.CUnlockConditions unlock; public string _path; + public float GetEffectCoinMultiplier() + { + float mult = 1f; + + mult *= HRarity.tRarityToRarityToCoinMultiplier(metadata.Rarity); + mult *= effect.GetCoinMultiplier(); + + return mult; + } + public CCharacter(string path) { _path = path; diff --git a/TJAPlayer3/Stages/01.StartUp/CPuchichara.cs b/TJAPlayer3/Stages/01.StartUp/CPuchichara.cs index 9fbec8a2..c1ce5ece 100644 --- a/TJAPlayer3/Stages/01.StartUp/CPuchichara.cs +++ b/TJAPlayer3/Stages/01.StartUp/CPuchichara.cs @@ -19,6 +19,16 @@ namespace TJAPlayer3 public DBUnlockables.CUnlockConditions unlock; public string _path; + public float GetEffectCoinMultiplier() + { + float mult = 1f; + + mult *= HRarity.tRarityToRarityToCoinMultiplier(metadata.Rarity); + mult *= effect.GetCoinMultiplier(); + + return mult; + } + public CPuchichara(string path) { _path = path; diff --git a/TJAPlayer3/Stages/08.Result/CStage結果.cs b/TJAPlayer3/Stages/08.Result/CStage結果.cs index 1e53585b..c5a47725 100644 --- a/TJAPlayer3/Stages/08.Result/CStage結果.cs +++ b/TJAPlayer3/Stages/08.Result/CStage結果.cs @@ -482,52 +482,8 @@ namespace TJAPlayer3 var chara = TJAPlayer3.Tx.Characters[TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character]; var puchichara = TJAPlayer3.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(TJAPlayer3.GetActualPlayer(player))]; - float charamul = 1.0f; - switch(chara.metadata.Rarity) - { - case "Poor": - charamul = 0.8f; - break; - case "Common": - charamul = 1.0f; - break; - case "Uncommon": - charamul = 1.1f; - break; - case "Rare": - charamul = 1.2f; - break; - case "Epic": - charamul = 1.3f; - break; - case "Legendary": - charamul = 1.5f; - break; - } - float puchimul = 1.0f; - switch (puchichara.metadata.Rarity) - { - case "Poor": - puchimul = 0.8f; - break; - case "Common": - puchimul = 1.0f; - break; - case "Uncommon": - puchimul = 1.1f; - break; - case "Rare": - puchimul = 1.2f; - break; - case "Epic": - puchimul = 1.3f; - break; - case "Legendary": - puchimul = 1.5f; - break; - } - return charamul * puchimul; + return chara.GetEffectCoinMultiplier() * puchichara.GetEffectCoinMultiplier(); } if (TJAPlayer3.stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Tower) diff --git a/Test/Global/Characters/Template/Effects.json b/Test/Global/Characters/Template/Effects.json index 332f0350..4b1824c7 100644 --- a/Test/Global/Characters/Template/Effects.json +++ b/Test/Global/Characters/Template/Effects.json @@ -1,3 +1,5 @@ { - "gauge":"Normal" + "gauge":"Normal", + "bombFactor":20, + "fuseRollFactor":0 } \ No newline at end of file