mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 08:47:37 +02:00
put resources in assetbundle
- implements the bomb glow for DS karate man kicks
This commit is contained in:
@ -66,13 +66,13 @@ namespace HeavenStudio.Games.Loaders
|
||||
},
|
||||
inactiveFunction: delegate { var e = eventCaller.currentEntity; KarateMan.SetBgEffectsUnloaded(e.beat, e.length, e.type, e.type2, e.colorA, e.colorB, e.type3, e.type4, e.type5, e.colorC, e.colorD); }
|
||||
),
|
||||
new GameAction("set object colors", delegate { var e = eventCaller.currentEntity; KarateMan.instance.UpdateMaterialColour(e.colorA, e.colorB, e.colorC); }, 0.5f, false, new List<Param>()
|
||||
new GameAction("set object colors", delegate { var e = eventCaller.currentEntity; KarateMan.UpdateMaterialColour(e.colorA, e.colorB, e.colorC); }, 0.5f, false, new List<Param>()
|
||||
{
|
||||
new Param("colorA", new Color(), "Joe Body Color", "The color to use for Karate Joe's body"),
|
||||
new Param("colorB", new Color(), "Joe Highlight Color", "The color to use for Karate Joe's highlights"),
|
||||
new Param("colorC", new Color(), "Item Color", "The color to use for the thrown items"),
|
||||
},
|
||||
inactiveFunction: delegate { var e = eventCaller.currentEntity; KarateMan.UpdateMaterialColourUnloaded(e.colorA, e.colorB, e.colorC); }
|
||||
inactiveFunction: delegate { var e = eventCaller.currentEntity; KarateMan.UpdateMaterialColour(e.colorA, e.colorB, e.colorC); }
|
||||
),
|
||||
new GameAction("particle effects", delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetParticleEffect(e.beat, e.type, e.valA, e.valB); }, 0.5f, false, new List<Param>()
|
||||
{
|
||||
@ -124,7 +124,11 @@ namespace HeavenStudio.Games.Loaders
|
||||
},
|
||||
hidden: true),
|
||||
|
||||
});
|
||||
},
|
||||
new List<string>() {"agb", "ntr", "rvl", "ctr", "pco", "normal"},
|
||||
"karate", "en",
|
||||
new List<string>() {"en"}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -247,7 +251,7 @@ namespace HeavenStudio.Games
|
||||
Vector3 cameraPosition;
|
||||
static float startCamSpecial = Single.MinValue;
|
||||
static float wantsReturn = Single.MinValue;
|
||||
static float cameraReturnLength = 2f;
|
||||
static float cameraReturnLength = 0f;
|
||||
static CameraAngle cameraAngle = CameraAngle.Normal;
|
||||
|
||||
//pot trajectory stuff
|
||||
@ -260,9 +264,9 @@ namespace HeavenStudio.Games
|
||||
|
||||
[Header("Colour Map")]
|
||||
public Material MappingMaterial;
|
||||
public static Color BodyColor;
|
||||
public static Color HighlightColor;
|
||||
public static Color ItemColor;
|
||||
public static Color BodyColor = Color.white;
|
||||
public static Color HighlightColor = Color.white;
|
||||
public static Color ItemColor = Color.white;
|
||||
|
||||
[Header("Word")]
|
||||
public Animator Word;
|
||||
@ -846,15 +850,7 @@ namespace HeavenStudio.Games
|
||||
customShadowColour = colour;
|
||||
}
|
||||
|
||||
public void UpdateMaterialColour(Color mainCol, Color highlightCol, Color objectCol)
|
||||
{
|
||||
MappingMaterial.SetColor("_ColorAlpha", mainCol);
|
||||
MappingMaterial.SetColor("_ColorBravo", new Color(1, 0, 0, 1));
|
||||
MappingMaterial.SetColor("_ColorDelta", highlightCol);
|
||||
ItemColor = objectCol;
|
||||
}
|
||||
|
||||
public static void UpdateMaterialColourUnloaded(Color mainCol, Color highlightCol, Color objectCol)
|
||||
public static void UpdateMaterialColour(Color mainCol, Color highlightCol, Color objectCol)
|
||||
{
|
||||
BodyColor = mainCol;
|
||||
HighlightColor = highlightCol;
|
||||
|
@ -15,6 +15,12 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
||||
public GameEvent bop = new GameEvent();
|
||||
public SpriteRenderer[] Shadows;
|
||||
|
||||
public Color BombGlowTint;
|
||||
float bombGlowStart = Single.MinValue;
|
||||
float bombGlowLength = 0f;
|
||||
float bombGlowIntensity;
|
||||
const float bombGlowRatio = 1f;
|
||||
|
||||
float lastPunchTime = Single.MinValue;
|
||||
float lastComboMissTime = Single.MinValue;
|
||||
float lastUpperCutTime = Single.MinValue;
|
||||
@ -48,6 +54,20 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
||||
{
|
||||
var cond = Conductor.instance;
|
||||
|
||||
if (cond.songPositionInBeats < bombGlowStart)
|
||||
{
|
||||
bombGlowIntensity = 1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
float glowProg = cond.GetPositionFromBeat(bombGlowStart, bombGlowLength);
|
||||
bombGlowIntensity = 1f - glowProg;
|
||||
if (cond.songPositionInBeats >= bombGlowStart + bombGlowLength)
|
||||
{
|
||||
bombGlowStart = Single.MinValue;
|
||||
bombGlowLength = 0f;
|
||||
}
|
||||
}
|
||||
UpdateShadowColour();
|
||||
|
||||
if (canEmote && wantFace >= 0)
|
||||
@ -314,6 +334,19 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
||||
{
|
||||
shadow.color = KarateMan.instance.GetShadowColor();
|
||||
}
|
||||
|
||||
Color mainCol = KarateMan.BodyColor;
|
||||
Color highlightCol = KarateMan.HighlightColor;
|
||||
|
||||
if (bombGlowIntensity > 0)
|
||||
{
|
||||
highlightCol = Color.LerpUnclamped(highlightCol, mainCol, bombGlowIntensity);
|
||||
mainCol += BombGlowTint * bombGlowIntensity * bombGlowRatio;
|
||||
}
|
||||
|
||||
KarateMan.instance.MappingMaterial.SetColor("_ColorAlpha", mainCol);
|
||||
KarateMan.instance.MappingMaterial.SetColor("_ColorBravo", new Color(1, 0, 0, 1));
|
||||
KarateMan.instance.MappingMaterial.SetColor("_ColorDelta", highlightCol);
|
||||
}
|
||||
|
||||
public void Prepare(float beat, float length)
|
||||
@ -334,5 +367,19 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
||||
if (canEmote || ignoreCheck)
|
||||
FaceAnim.DoScaledAnimationAsync("Face" + face.ToString("D2"));
|
||||
}
|
||||
|
||||
public void ApplyBombGlow()
|
||||
{
|
||||
bombGlowStart = Single.MaxValue;
|
||||
bombGlowLength = 0f;
|
||||
bombGlowIntensity = 1f;
|
||||
}
|
||||
|
||||
public void RemoveBombGlow(float beat, float length = 0.5f)
|
||||
{
|
||||
bombGlowStart = beat;
|
||||
bombGlowLength = length;
|
||||
bombGlowIntensity = 0f;
|
||||
}
|
||||
}
|
||||
}
|
@ -374,13 +374,14 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
||||
{
|
||||
ParticleSystem p;
|
||||
CreateHitMark(type == ItemType.KickBomb);
|
||||
KarateMan game = KarateMan.instance;
|
||||
switch (type)
|
||||
{
|
||||
case ItemType.Bulb:
|
||||
CurrentCurve = ItemCurves[straight ? 1 : 0];
|
||||
curveTargetBeat = straight ? 1f : 1.5f;;
|
||||
Jukebox.PlayOneShotGame("karateman/lightbulbHit", forcePlay: true);
|
||||
p = Instantiate(HitParticles[5], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[5], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
|
||||
if (effectTint.a == 0)
|
||||
break;
|
||||
@ -404,30 +405,30 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
||||
CurrentCurve = ItemCurves[1];
|
||||
curveTargetBeat = 1f;
|
||||
Jukebox.PlayOneShotGame("karateman/rockHit", forcePlay: true);
|
||||
p = Instantiate(HitParticles[4], HitPosition[1].position, Quaternion.identity, KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[4], HitPosition[1].position, Quaternion.identity, game.ItemHolder);
|
||||
p.Play();
|
||||
break;
|
||||
case ItemType.Ball:
|
||||
CurrentCurve = ItemCurves[1];
|
||||
curveTargetBeat = 1f;
|
||||
Jukebox.PlayOneShotGame("karateman/soccerHit", forcePlay: true);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
break;
|
||||
case ItemType.Cooking:
|
||||
CurrentCurve = ItemCurves[1];
|
||||
curveTargetBeat = 1f;
|
||||
Jukebox.PlayOneShotGame("karateman/cookingPot", forcePlay: true);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
KarateMan.instance.CreateItemInstance(startBeat + 1f, "Item09", ItemType.CookingLid);
|
||||
game.CreateItemInstance(startBeat + 1f, "Item09", ItemType.CookingLid);
|
||||
GetComponent<Animator>().Play("Item08", -1, 0);
|
||||
break;
|
||||
case ItemType.Alien:
|
||||
CurrentCurve = ItemCurves[1];
|
||||
curveTargetBeat = 1f;
|
||||
Jukebox.PlayOneShotGame("karateman/alienHit", forcePlay: true);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
break;
|
||||
case ItemType.TacoBell:
|
||||
@ -435,69 +436,73 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
||||
curveTargetBeat = 1f;
|
||||
Jukebox.PlayOneShotGame("karateman/rockHit", forcePlay: true);
|
||||
Jukebox.PlayOneShotGame("karateman/tacobell", forcePlay: true);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
break;
|
||||
case ItemType.ComboPot1:
|
||||
CurrentCurve = ItemCurves[straight ? 1 : 0];
|
||||
curveTargetBeat = 1.5f;
|
||||
Jukebox.PlayOneShotGame("karateman/comboHit1", forcePlay: true);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
break;
|
||||
case ItemType.ComboPot2:
|
||||
CurrentCurve = ItemCurves[0];
|
||||
curveTargetBeat = 1.5f;
|
||||
Jukebox.PlayOneShotGame("karateman/comboHit1", forcePlay: true);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
break;
|
||||
case ItemType.ComboPot3:
|
||||
CurrentCurve = ItemCurves[2];
|
||||
curveTargetBeat = 1f;
|
||||
Jukebox.PlayOneShotGame("karateman/comboHit2", forcePlay: true);
|
||||
p = Instantiate(HitParticles[1], HitPosition[2].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[1], HitPosition[2].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
break;
|
||||
case ItemType.ComboPot4:
|
||||
CurrentCurve = ItemCurves[3];
|
||||
curveTargetBeat = 1f;
|
||||
Jukebox.PlayOneShotGame("karateman/comboHit3", forcePlay: true);
|
||||
p = Instantiate(HitParticles[1], HitPosition[3].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[1], HitPosition[3].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
break;
|
||||
case ItemType.ComboPot5:
|
||||
CurrentCurve = ItemCurves[4];
|
||||
curveTargetBeat = 1f;
|
||||
Jukebox.PlayOneShotGame("karateman/comboHit3", forcePlay: true);
|
||||
p = Instantiate(HitParticles[1], HitPosition[4].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[1], HitPosition[4].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
break;
|
||||
case ItemType.ComboBarrel:
|
||||
Jukebox.PlayOneShotGame("karateman/comboHit4", forcePlay: true);
|
||||
p = Instantiate(HitParticles[0], HitPosition[5].position, Quaternion.identity, KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[0], HitPosition[5].position, Quaternion.identity, game.ItemHolder);
|
||||
p.Play();
|
||||
p = Instantiate(HitParticles[1], HitPosition[5].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[1], HitPosition[5].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
break;
|
||||
case ItemType.KickBarrel:
|
||||
KarateMan.instance.CreateItemInstance(startBeat + 1f, "Item04", ItemType.KickBomb);
|
||||
game.CreateItemInstance(startBeat + 1f, "Item04", ItemType.KickBomb);
|
||||
Jukebox.PlayOneShotGame("karateman/barrelBreak", forcePlay: true);
|
||||
p = Instantiate(HitParticles[0], HitPosition[1].position, Quaternion.Euler(0, 0, -5f), KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[0], HitPosition[1].position, Quaternion.Euler(0, 0, -5f), game.ItemHolder);
|
||||
p.Play();
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
|
||||
game.Joe.ApplyBombGlow();
|
||||
break;
|
||||
case ItemType.KickBomb:
|
||||
Jukebox.PlayOneShotGame("karateman/bombKick", forcePlay: true);
|
||||
p = Instantiate(HitParticles[2], ItemCurves[6].GetPoint(0.5f), Quaternion.identity, KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[2], ItemCurves[6].GetPoint(0.5f), Quaternion.identity, game.ItemHolder);
|
||||
p.Play();
|
||||
|
||||
game.Joe.RemoveBombGlow(startBeat + 0.75f);
|
||||
break;
|
||||
default:
|
||||
CurrentCurve = ItemCurves[straight ? 1 : 0];
|
||||
curveTargetBeat = straight ? 1f : 1.5f;
|
||||
Jukebox.PlayOneShotGame("karateman/potHit", forcePlay: true);
|
||||
p = Instantiate(HitParticles[3], HitPosition[1].position, Quaternion.identity, KarateMan.instance.ItemHolder);
|
||||
p = Instantiate(HitParticles[3], HitPosition[1].position, Quaternion.identity, game.ItemHolder);
|
||||
p.Play();
|
||||
break;
|
||||
}
|
||||
@ -947,6 +952,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
||||
});
|
||||
|
||||
KarateMan.instance.Nori.DoNG();
|
||||
joe.RemoveBombGlow(startBeat + 0.75f);
|
||||
}
|
||||
else {
|
||||
ItemHitEffect();
|
||||
@ -988,6 +994,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
||||
});
|
||||
KarateMan.instance.Nori.DoThrough();
|
||||
OnHit.CanHit(false);
|
||||
KarateMan.instance.Joe.RemoveBombGlow(startBeat + 0.75f * 2, 1.5f);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user