From 71dbb5cb3d0004a11724668364b7f913207a4e39 Mon Sep 17 00:00:00 2001 From: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Date: Sun, 10 Dec 2023 15:53:43 +0100 Subject: [PATCH] star colors and senior gradient --- Assets/Scripts/Games/KarateMan/KarateMan.cs | 27 ++++++++++++++----- .../Scripts/Games/KarateMan/KarateManPot.cs | 3 +++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Games/KarateMan/KarateMan.cs b/Assets/Scripts/Games/KarateMan/KarateMan.cs index 4e2e5f55f..ff874a968 100644 --- a/Assets/Scripts/Games/KarateMan/KarateMan.cs +++ b/Assets/Scripts/Games/KarateMan/KarateMan.cs @@ -260,7 +260,7 @@ namespace HeavenStudio.Games.Loaders new Param("fxType", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed"), new Param("type", KarateMan.NoriMode.None, "Flow Bar type", "The type of Flow bar to use", new List() { - new Param.CollapseParam((x, _) => (int)x != (int)KarateMan.NoriMode.None, new string[] { "startColor" }) + new Param.CollapseParam((x, _) => (int)x != (int)KarateMan.NoriMode.None, new string[] { "type" }) }), new Param("hitsPerHeart", new EntityTypes.Float(0f, 20f, 0f), "Hits Per Heart", "How many hits will it take for each heart to light up? (0 will do it automatically.)"), new Param("toggle", true, "Enable Combos", "Allow the player to combo? (Contextual combos will still be allowed even when off)"), @@ -340,7 +340,7 @@ namespace HeavenStudio.Games.Loaders { function = delegate { var e = eventCaller.currentEntity; - KarateMan.instance.UpdateMaterialColour(e["colorA"], e["colorB"], e["colorC"]); + KarateMan.instance.UpdateMaterialColour(e["colorA"], e["colorB"], e["colorC"], e["colorD"], e["star"]); }, defaultLength = 0.5f, parameters = new List() @@ -348,6 +348,11 @@ namespace HeavenStudio.Games.Loaders new Param("colorA", new Color(1,1,1,1), "Joe Body Color", "The color to use for Karate Joe's body"), new Param("colorB", new Color(0.81f,0.81f,0.81f,1), "Joe Highlight Color", "The color to use for Karate Joe's highlights"), new Param("colorC", new Color(1,1,1,1), "Item Color", "The color to use for the thrown items"), + new Param("star", KarateMan.StarColorOption.ItemColor, "Star Color Options", "", new() + { + new((x, _) => (int)x == (int)KarateMan.StarColorOption.Custom, new string[] { "colorD" }) + }), + new Param("colorD", new Color(1,1,1,1), "Star Color", "The color to use for star particles"), }, }, new GameAction("particle effects", "Particle Effects") @@ -480,7 +485,7 @@ namespace HeavenStudio.Games Gradient, Radial, Blood, - //ManMan? + SeniorGradient } public enum ShadowType @@ -555,6 +560,8 @@ namespace HeavenStudio.Games public Color BodyColor = Color.white; public Color HighlightColor = new Color(0.81f, 0.81f, 0.81f); public Color ItemColor = Color.white; + [NonSerialized] public bool useItemColorForStar = true; + public Color StarColor = Color.white; [Header("Word")] public Animator Word; @@ -765,9 +772,9 @@ namespace HeavenStudio.Games } if (obj != null) { - UpdateMaterialColour(obj["colorA"], obj["colorB"], obj["colorC"]); + UpdateMaterialColour(obj["colorA"], obj["colorB"], obj["colorC"], obj["colorD"], obj["star"]); } else { - UpdateMaterialColour(Color.white, new Color(0.81f, 0.81f, 0.81f), Color.white); + UpdateMaterialColour(Color.white, new Color(0.81f, 0.81f, 0.81f), Color.white, Color.white, (int)StarColorOption.ItemColor); } // init modifier(s) @@ -1139,11 +1146,19 @@ namespace HeavenStudio.Games IsComboEnable = combo; } - public void UpdateMaterialColour(Color mainCol, Color highlightCol, Color objectCol) + public enum StarColorOption + { + ItemColor, + Custom + } + + public void UpdateMaterialColour(Color mainCol, Color highlightCol, Color objectCol, Color starCol, int starColOption) { BodyColor = mainCol; HighlightColor = highlightCol; ItemColor = objectCol; + StarColor = starCol; + useItemColorForStar = starColOption == 0; } public void SetParticleEffect(double beat, int type, bool instant, float windStrength, float particleStrength) diff --git a/Assets/Scripts/Games/KarateMan/KarateManPot.cs b/Assets/Scripts/Games/KarateMan/KarateManPot.cs index f5efa2437..b1d283fbf 100644 --- a/Assets/Scripts/Games/KarateMan/KarateManPot.cs +++ b/Assets/Scripts/Games/KarateMan/KarateManPot.cs @@ -617,6 +617,9 @@ namespace HeavenStudio.Games.Scripts_KarateMan else SoundByte.PlayOneShotGame("karateman/potHit", forcePlay: true); p = Instantiate(HitParticles[3], HitPosition[1].position, Quaternion.identity, game.ItemHolder); + var main = p.main; + if (game.useItemColorForStar) main.startColor = new(game.ItemColor); + else main.startColor = new(game.StarColor); p.Play(); break;