From 2a026d8deafa7188a759f573c6bdcf5c2b0ff5b7 Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Sat, 26 Feb 2022 13:27:02 -0500 Subject: [PATCH 1/7] Added "set background color" to Karate Man. Seemingly stops working after a few background changes but works between game changes --- Assets/Resources/Games/karateman.prefab | 108 +++++++++++++++++--- Assets/Scripts/Games/KarateMan/KarateMan.cs | 49 ++++++--- Assets/Scripts/Minigames.cs | 10 ++ 3 files changed, 141 insertions(+), 26 deletions(-) diff --git a/Assets/Resources/Games/karateman.prefab b/Assets/Resources/Games/karateman.prefab index 2452b4e5..2548eab2 100644 --- a/Assets/Resources/Games/karateman.prefab +++ b/Assets/Resources/Games/karateman.prefab @@ -17442,6 +17442,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 7248900333330862852} + - {fileID: 8701843541313247389} m_Father: {fileID: 7248900333300803150} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -17762,6 +17763,14 @@ MonoBehaviour: - {r: 0.007843138, g: 0.8117647, b: 1, a: 1} - {r: 233, g: 233, b: 0, a: 1} - {r: 0, g: 0, b: 0, a: 0} + BackgroundColors: + - {r: 0.9411765, g: 0.9137255, b: 0.4392157, a: 1} + - {r: 0.99607843, g: 0.60784316, b: 0.98039216, a: 1} + - {r: 0.42745098, g: 0.6666667, b: 0.8784314, a: 1} + - {r: 1, g: 0.09411766, b: 0, a: 1} + - {r: 1, g: 0.58431375, b: 0.3137255, a: 1} + - {r: 0.9607844, g: 0.7725491, b: 0.78823537, a: 1} + - {r: 0, g: 0, b: 0, a: 0} Pot: {fileID: 7248900332380919981} Bomb: {fileID: 1878496493894552565} KarateJoe: {fileID: 7248900332013002443} @@ -17774,14 +17783,6 @@ MonoBehaviour: - {fileID: 8671423413994339737, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: -6341196331951941137, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: -6283416824598814145, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - ObjectBottomSprites: - - {fileID: 0} - - {fileID: 21300000, guid: 2dcc4a0e0420a8e4097445cac4b2e1ab, type: 3} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} BarrelSprites: - {fileID: 6524922379630696755, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: 1156572009758090512, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} @@ -17790,10 +17791,11 @@ MonoBehaviour: - {fileID: 5805539206011318834, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} BGSprites: - Sprites: - - {fileID: 21300000, guid: 1c02ce8c213d84d4c972dcdcbfbf535c, type: 3} - {fileID: 21300000, guid: 72431c7c58f54e848bcb7527635bb72b, type: 3} - {fileID: 21300000, guid: f05694d1ff974fe4387e487d025edede, type: 3} BGSprite: {fileID: 7248900333330862853} + BGFXSprite: {fileID: 7037067448840752386} + BGColor: {r: 0.94117653, g: 0.91372555, b: 0.43921572, a: 1} comboRef: {fileID: 1174851578296134715} HIT3Ref: {fileID: 6398113137460299953} Numbers: @@ -17853,7 +17855,7 @@ Transform: m_GameObject: {fileID: 7248900333330862855} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: 600, y: 600, z: 1} m_Children: [] m_Father: {fileID: 7248900332961029735} m_RootOrder: 0 @@ -17898,8 +17900,8 @@ SpriteRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: -300 - m_Sprite: {fileID: 21300000, guid: 1c02ce8c213d84d4c972dcdcbfbf535c, type: 3} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Sprite: {fileID: 7482667652216324306, guid: ef2fa2a75dc283e40b9d4fe1f20dc6fb, type: 3} + m_Color: {r: 0.94117653, g: 0.91372555, b: 0.43921572, a: 1} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 0 @@ -18347,3 +18349,85 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: flickerInterval: 0.1 +--- !u!1 &8963803634876878173 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8701843541313247389} + - component: {fileID: 7037067448840752386} + m_Layer: 0 + m_Name: FX + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8701843541313247389 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8963803634876878173} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 7248900332961029735} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &7037067448840752386 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8963803634876878173} + m_Enabled: 0 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: -299 + m_Sprite: {fileID: 21300000, guid: 72431c7c58f54e848bcb7527635bb72b, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 12.8, y: 7.2} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 diff --git a/Assets/Scripts/Games/KarateMan/KarateMan.cs b/Assets/Scripts/Games/KarateMan/KarateMan.cs index 3ea5dafe..9ac84a51 100644 --- a/Assets/Scripts/Games/KarateMan/KarateMan.cs +++ b/Assets/Scripts/Games/KarateMan/KarateMan.cs @@ -16,13 +16,20 @@ namespace RhythmHeavenMania.Games.KarateMan Custom = 3 } - public Color[] LightBulbColors = new Color[] + public Color[] LightBulbColors; + + public enum BackgroundType { - new Color(0, 0, 0, 0), - new Color(2, 207, 255), - new Color(233, 233, 0), - new Color(0, 0, 0, 0) - }; + Yellow = 0, + Fushia = 1, + Blue = 2, + Red = 3, + Orange = 4, + Pink = 5, + Custom = 6 + } + + public Color[] BackgroundColors; const float hitVoiceOffset = 0.042f; @@ -34,13 +41,14 @@ namespace RhythmHeavenMania.Games.KarateMan public static KarateMan instance { get; set; } public Sprite[] ObjectSprites; - public Sprite[] ObjectBottomSprites; public Sprite[] BarrelSprites; public List BGSprites; public SpriteRenderer BGSprite; + public SpriteRenderer BGFXSprite; + + public Color BGColor; - private bool bgEnabled; private float newBeat; public GameEvent bop = new GameEvent(); @@ -64,6 +72,13 @@ namespace RhythmHeavenMania.Games.KarateMan private void Awake() { instance = this; + BGColor = BackgroundColors[0]; + } + + public override void OnGameSwitch() + { + base.OnGameSwitch(); + SetBackgroundColor(BGColor); } public void Combo(float beat) @@ -181,15 +196,15 @@ namespace RhythmHeavenMania.Games.KarateMan { if (Conductor.instance.ReportBeat(ref newBeat)) { - if (bgEnabled) + if (BGFXSprite.enabled) { if (bgBeat % 2 == 0) { - BGSprite.sprite = BGSprites[0].Sprites[1]; + BGFXSprite.sprite = BGSprites[0].Sprites[0]; } else { - BGSprite.sprite = BGSprites[0].Sprites[2]; + BGFXSprite.sprite = BGSprites[0].Sprites[1]; } bgBeat++; } @@ -234,13 +249,19 @@ namespace RhythmHeavenMania.Games.KarateMan public void BGFXOn() { - bgEnabled = true; + BGFXSprite.enabled = true; } public void BGFXOff() { - bgEnabled = false; - BGSprite.sprite = BGSprites[0].Sprites[0]; + BGFXSprite.enabled = false; + } + + public void SetBackgroundColor(Color color) + { + Debug.Log("THE COLOR IS " + color.ToString()); + BGColor = color; + BGSprite.color = color; } public void Bop(float beat, float length) diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index c2d8e684..eed3a93e 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -249,6 +249,16 @@ namespace RhythmHeavenMania new GameAction("prepare", delegate { KarateMan.instance.Prepare(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 1f, true), new GameAction("bgfxon", delegate { KarateMan.instance.BGFXOn(); } ), new GameAction("bgfxoff", delegate { KarateMan.instance.BGFXOff(); }), + new GameAction("set background color", delegate { + var e = eventCaller.currentEntity; + var c = KarateMan.instance.BackgroundColors[e.type]; + if(e.type == 6) c = e.colorA; + KarateMan.instance.SetBackgroundColor(c); + }, 1f, false, new List() + { + new Param("type", KarateMan.BackgroundType.Yellow, "Type"), + new Param("colorA", new Color(), "Custom Color") + }), new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 6); }, 2), }), new Minigame("spaceSoccer", "Space Soccer", "B888F8", false, false, new List() From ef710cc714d1e54688d8342dedf0c9ca517d5e2c Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Sat, 26 Feb 2022 13:57:09 -0500 Subject: [PATCH 2/7] Code Clean Up --- Assets/Scripts/Games/KarateMan/KarateMan.cs | 25 ++++++++++----------- Assets/Scripts/Minigames.cs | 7 +++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Assets/Scripts/Games/KarateMan/KarateMan.cs b/Assets/Scripts/Games/KarateMan/KarateMan.cs index 9ac84a51..579c6810 100644 --- a/Assets/Scripts/Games/KarateMan/KarateMan.cs +++ b/Assets/Scripts/Games/KarateMan/KarateMan.cs @@ -10,25 +10,24 @@ namespace RhythmHeavenMania.Games.KarateMan { public enum LightBulbType { - Normal = 0, - Blue = 1, - Yellow = 2, - Custom = 3 + Normal, + Blue, + Yellow, + Custom } - public Color[] LightBulbColors; - public enum BackgroundType { - Yellow = 0, - Fushia = 1, - Blue = 2, - Red = 3, - Orange = 4, - Pink = 5, - Custom = 6 + Yellow, + Fushia, + Blue, + Red, + Orange, + Pink, + Custom } + public Color[] LightBulbColors; public Color[] BackgroundColors; const float hitVoiceOffset = 0.042f; diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index eed3a93e..9af31c94 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -233,8 +233,8 @@ namespace RhythmHeavenMania new GameAction("bulb", delegate { var e = eventCaller.currentEntity; var c = KarateMan.instance.LightBulbColors[e.type]; - if(e.type == 3) c = e.colorA; - KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 1, tint: c); + if(e.type == (int)KarateMan.LightBulbType.Custom) c = e.colorA; + KarateMan.instance.Shoot(e.beat, 1, tint: c); }, 2, false, new List() { new Param("type", KarateMan.LightBulbType.Normal, "Type"), @@ -252,7 +252,8 @@ namespace RhythmHeavenMania new GameAction("set background color", delegate { var e = eventCaller.currentEntity; var c = KarateMan.instance.BackgroundColors[e.type]; - if(e.type == 6) c = e.colorA; + if(e.type == (int)KarateMan.BackgroundType.Custom) c = e.colorA; + Debug.Log("type - " + e.type.ToString()); KarateMan.instance.SetBackgroundColor(c); }, 1f, false, new List() { From ef27e832545e188ca5059b5765ed66ff439cc187 Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Sat, 26 Feb 2022 18:10:22 -0500 Subject: [PATCH 3/7] Added coloured shadows to Karate Man This is very pogchamp! --- Assets/Resources/Games/karateman.prefab | 4 ++++ Assets/Scripts/Games/KarateMan/KarateJoe.cs | 6 ++++++ Assets/Scripts/Games/KarateMan/Pot.cs | 6 +++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Assets/Resources/Games/karateman.prefab b/Assets/Resources/Games/karateman.prefab index 2548eab2..7fc2e68b 100644 --- a/Assets/Resources/Games/karateman.prefab +++ b/Assets/Resources/Games/karateman.prefab @@ -6257,6 +6257,10 @@ MonoBehaviour: - {fileID: 3379959602278205485, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: 8497358629359107968, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} missEffect: {fileID: 564650125393930190} + shadows: + - {fileID: 7248900332856218914} + - {fileID: 7248900333476518146} + - {fileID: 4233113091070337915} hitBarrel: 0 inCombo: 0 hitCombo: 0 diff --git a/Assets/Scripts/Games/KarateMan/KarateJoe.cs b/Assets/Scripts/Games/KarateMan/KarateJoe.cs index 587a7c2b..164fa3bf 100644 --- a/Assets/Scripts/Games/KarateMan/KarateJoe.cs +++ b/Assets/Scripts/Games/KarateMan/KarateJoe.cs @@ -18,6 +18,7 @@ namespace RhythmHeavenMania.Games.KarateMan [SerializeField] private SpriteRenderer head; [SerializeField] private Sprite[] heads; [SerializeField] private GameObject missEffect; + [SerializeField] private SpriteRenderer[] shadows; [Header("Properties")] public bool hitBarrel = false; @@ -168,6 +169,11 @@ namespace RhythmHeavenMania.Games.KarateMan Swing(null); } } + + for(int i=0;i < shadows.Length; i++) + { + shadows[i].color = Color.Lerp(KarateMan.instance.BGColor, new Color(35 / 255, 75 / 255, 1 / 255), 0.25f); + } } public void Combo(Pot p) diff --git a/Assets/Scripts/Games/KarateMan/Pot.cs b/Assets/Scripts/Games/KarateMan/Pot.cs index 1e0692c4..d622ffbd 100644 --- a/Assets/Scripts/Games/KarateMan/Pot.cs +++ b/Assets/Scripts/Games/KarateMan/Pot.cs @@ -116,10 +116,14 @@ namespace RhythmHeavenMania.Games.KarateMan private void Update() { if (Conductor.instance.songPositionInBeats >= createBeat) + { spriteComp.enabled = true; + shadowSpriteComp.color = Color.Lerp(KarateMan.instance.BGColor, new Color(35 / 255, 75 / 255, 1 / 255), 0.25f); + } else + { spriteComp.enabled = false; - + } float time2Destroy = Conductor.instance.GetPositionFromBeat(createBeat, 4); From f7434c8a349b50406762dca86c2094b6e3c28320 Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Sat, 26 Feb 2022 22:28:15 -0500 Subject: [PATCH 4/7] Shadow colours are much more accurate --- Assets/Scripts/Games/KarateMan/KarateJoe.cs | 2 +- Assets/Scripts/Games/KarateMan/KarateMan.cs | 8 ++++++++ Assets/Scripts/Games/KarateMan/Pot.cs | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Games/KarateMan/KarateJoe.cs b/Assets/Scripts/Games/KarateMan/KarateJoe.cs index 164fa3bf..319b7b01 100644 --- a/Assets/Scripts/Games/KarateMan/KarateJoe.cs +++ b/Assets/Scripts/Games/KarateMan/KarateJoe.cs @@ -172,7 +172,7 @@ namespace RhythmHeavenMania.Games.KarateMan for(int i=0;i < shadows.Length; i++) { - shadows[i].color = Color.Lerp(KarateMan.instance.BGColor, new Color(35 / 255, 75 / 255, 1 / 255), 0.25f); + shadows[i].color = KarateMan.instance.GetShadowColor(); } } diff --git a/Assets/Scripts/Games/KarateMan/KarateMan.cs b/Assets/Scripts/Games/KarateMan/KarateMan.cs index 579c6810..7e2d2131 100644 --- a/Assets/Scripts/Games/KarateMan/KarateMan.cs +++ b/Assets/Scripts/Games/KarateMan/KarateMan.cs @@ -29,6 +29,7 @@ namespace RhythmHeavenMania.Games.KarateMan public Color[] LightBulbColors; public Color[] BackgroundColors; + public static Color ShadowBlendColor = new Color(195f / 255f, 48f / 255f, 2f / 255f); const float hitVoiceOffset = 0.042f; @@ -308,5 +309,12 @@ namespace RhythmHeavenMania.Games.KarateMan shadow.transform.SetAsLastSibling(); bomb.GetComponent().shadow = shadow; } + + public Color GetShadowColor() + { + var col = Color.LerpUnclamped(KarateMan.instance.BGColor, KarateMan.ShadowBlendColor, 0.45f); + + return col; + } } } \ No newline at end of file diff --git a/Assets/Scripts/Games/KarateMan/Pot.cs b/Assets/Scripts/Games/KarateMan/Pot.cs index d622ffbd..b7021df2 100644 --- a/Assets/Scripts/Games/KarateMan/Pot.cs +++ b/Assets/Scripts/Games/KarateMan/Pot.cs @@ -118,7 +118,7 @@ namespace RhythmHeavenMania.Games.KarateMan if (Conductor.instance.songPositionInBeats >= createBeat) { spriteComp.enabled = true; - shadowSpriteComp.color = Color.Lerp(KarateMan.instance.BGColor, new Color(35 / 255, 75 / 255, 1 / 255), 0.25f); + shadowSpriteComp.color = KarateMan.instance.GetShadowColor(); } else { From 4403a3dd26e7641bede8264ee980e4f31acd1ece Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Sun, 27 Feb 2022 12:02:46 -0500 Subject: [PATCH 5/7] Added custom shadow colours And specific shadow colours for preset background types --- Assets/Resources/Games/karateman.prefab | 12 ++++++- Assets/Scripts/Beatmap.cs | 1 + Assets/Scripts/Games/KarateMan/KarateMan.cs | 38 ++++++++++++++++----- Assets/Scripts/Minigames.cs | 10 +++--- 4 files changed, 48 insertions(+), 13 deletions(-) diff --git a/Assets/Resources/Games/karateman.prefab b/Assets/Resources/Games/karateman.prefab index 7fc2e68b..10a80c70 100644 --- a/Assets/Resources/Games/karateman.prefab +++ b/Assets/Resources/Games/karateman.prefab @@ -17775,6 +17775,13 @@ MonoBehaviour: - {r: 1, g: 0.58431375, b: 0.3137255, a: 1} - {r: 0.9607844, g: 0.7725491, b: 0.78823537, a: 1} - {r: 0, g: 0, b: 0, a: 0} + ShadowColors: + - {r: 0.84313726, g: 0.52156866, b: 0.23137255, a: 1} + - {r: 0.88235295, g: 0.41960785, b: 0.5294118, a: 1} + - {r: 0.3137255, g: 0.31764707, b: 0.40784317, a: 1} + - {r: 0, g: 0, b: 0, a: 1} + - {r: 0.454902, g: 0.19607845, b: 0.121568635, a: 1} + - {r: 0.654902, g: 0.4156863, b: 0.45882356, a: 1} Pot: {fileID: 7248900332380919981} Bomb: {fileID: 1878496493894552565} KarateJoe: {fileID: 7248900332013002443} @@ -17799,7 +17806,10 @@ MonoBehaviour: - {fileID: 21300000, guid: f05694d1ff974fe4387e487d025edede, type: 3} BGSprite: {fileID: 7248900333330862853} BGFXSprite: {fileID: 7037067448840752386} + BGType: 0 BGColor: {r: 0.94117653, g: 0.91372555, b: 0.43921572, a: 1} + Shadow: 0 + ShadowColor: {r: 0, g: 0, b: 0, a: 0} comboRef: {fileID: 1174851578296134715} HIT3Ref: {fileID: 6398113137460299953} Numbers: @@ -17859,7 +17869,7 @@ Transform: m_GameObject: {fileID: 7248900333330862855} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 600, y: 600, z: 1} + m_LocalScale: {x: 300, y: 300, z: 1} m_Children: [] m_Father: {fileID: 7248900332961029735} m_RootOrder: 0 diff --git a/Assets/Scripts/Beatmap.cs b/Assets/Scripts/Beatmap.cs index 3e62aef8..c52efa68 100644 --- a/Assets/Scripts/Beatmap.cs +++ b/Assets/Scripts/Beatmap.cs @@ -26,6 +26,7 @@ namespace RhythmHeavenMania [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float valB; [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float valC; [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public int type; + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public int type2; [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public EasingFunction.Ease ease; [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public Color colorA; [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public Color colorB; diff --git a/Assets/Scripts/Games/KarateMan/KarateMan.cs b/Assets/Scripts/Games/KarateMan/KarateMan.cs index 7e2d2131..67f27725 100644 --- a/Assets/Scripts/Games/KarateMan/KarateMan.cs +++ b/Assets/Scripts/Games/KarateMan/KarateMan.cs @@ -27,8 +27,15 @@ namespace RhythmHeavenMania.Games.KarateMan Custom } + public enum ShadowType + { + Tinted, + Custom + } + public Color[] LightBulbColors; public Color[] BackgroundColors; + public Color[] ShadowColors; public static Color ShadowBlendColor = new Color(195f / 255f, 48f / 255f, 2f / 255f); const float hitVoiceOffset = 0.042f; @@ -47,8 +54,12 @@ namespace RhythmHeavenMania.Games.KarateMan public SpriteRenderer BGSprite; public SpriteRenderer BGFXSprite; + public BackgroundType BGType = BackgroundType.Yellow; public Color BGColor; + public ShadowType Shadow = ShadowType.Tinted; + public Color ShadowColor = Color.black; + private float newBeat; public GameEvent bop = new GameEvent(); @@ -72,13 +83,15 @@ namespace RhythmHeavenMania.Games.KarateMan private void Awake() { instance = this; + BGType = 0; BGColor = BackgroundColors[0]; + Shadow = 0; } public override void OnGameSwitch() { base.OnGameSwitch(); - SetBackgroundColor(BGColor); + SetBackgroundColor((int)BGType, (int)Shadow, BGColor, ShadowColor); } public void Combo(float beat) @@ -257,11 +270,13 @@ namespace RhythmHeavenMania.Games.KarateMan BGFXSprite.enabled = false; } - public void SetBackgroundColor(Color color) + public void SetBackgroundColor(int type, int shadowType, Color backgroundColor, Color shadowColor) { - Debug.Log("THE COLOR IS " + color.ToString()); - BGColor = color; - BGSprite.color = color; + BGType = (BackgroundType)type; + BGColor = backgroundColor; + BGSprite.color = backgroundColor; + Shadow = (ShadowType)shadowType; + ShadowColor = shadowColor; } public void Bop(float beat, float length) @@ -312,9 +327,16 @@ namespace RhythmHeavenMania.Games.KarateMan public Color GetShadowColor() { - var col = Color.LerpUnclamped(KarateMan.instance.BGColor, KarateMan.ShadowBlendColor, 0.45f); - - return col; + if(Shadow == ShadowType.Custom) + { + return ShadowColor; + } + else if(BGType < BackgroundType.Custom) + { + return ShadowColors[(int)BGType]; + } + + return Color.LerpUnclamped(BGColor, ShadowBlendColor, 0.45f); } } } \ No newline at end of file diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index 9af31c94..d644c9d5 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -252,13 +252,15 @@ namespace RhythmHeavenMania new GameAction("set background color", delegate { var e = eventCaller.currentEntity; var c = KarateMan.instance.BackgroundColors[e.type]; + Debug.Log("TYPE=" + e.type.ToString() + ", SHADOW=" + e.type2.ToString()); if(e.type == (int)KarateMan.BackgroundType.Custom) c = e.colorA; - Debug.Log("type - " + e.type.ToString()); - KarateMan.instance.SetBackgroundColor(c); + KarateMan.instance.SetBackgroundColor(e.type, e.type2, c, e.colorB); }, 1f, false, new List() { - new Param("type", KarateMan.BackgroundType.Yellow, "Type"), - new Param("colorA", new Color(), "Custom Color") + new Param("type", KarateMan.BackgroundType.Yellow, "Background Type"), + new Param("type2", KarateMan.ShadowType.Tinted, "Shadow Type"), + new Param("colorA", new Color(), "Custom Background Color"), + new Param("colorB", new Color(), "Custom Shadow Color") }), new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 6); }, 2), }), From b4cdc321cb8f320bdedeb2f034148d407c678179 Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Sun, 27 Feb 2022 13:49:52 -0500 Subject: [PATCH 6/7] Remove debug log --- Assets/Scripts/Minigames.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index 847f9407..0a7180e9 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -252,7 +252,6 @@ namespace RhythmHeavenMania new GameAction("set background color", delegate { var e = eventCaller.currentEntity; var c = KarateMan.instance.BackgroundColors[e.type]; - Debug.Log("TYPE=" + e.type.ToString() + ", SHADOW=" + e.type2.ToString()); if(e.type == (int)KarateMan.BackgroundType.Custom) c = e.colorA; KarateMan.instance.SetBackgroundColor(e.type, e.type2, c, e.colorB); }, 1f, false, new List() From ccac51d1a18f492b83f9d7cb011e936cd6a38a26 Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Sun, 27 Feb 2022 13:54:46 -0500 Subject: [PATCH 7/7] Make length of bgcolor event match rhythm tweezers --- Assets/Scripts/Minigames.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index 0a7180e9..5e07a7ff 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -254,7 +254,7 @@ namespace RhythmHeavenMania var c = KarateMan.instance.BackgroundColors[e.type]; if(e.type == (int)KarateMan.BackgroundType.Custom) c = e.colorA; KarateMan.instance.SetBackgroundColor(e.type, e.type2, c, e.colorB); - }, 1f, false, new List() + }, 0.5f, false, new List() { new Param("type", KarateMan.BackgroundType.Yellow, "Background Type"), new Param("type2", KarateMan.ShadowType.Tinted, "Shadow Type"),