it compiles now
this Background Appearance block got hands ‼️
working on converting everything to the new bg color system
this will be so annoying to build a RiqUpdater for.
This commit is contained in:
parent
26b082983f
commit
b044d400c4
|
|
@ -5,20 +5,19 @@ using UnityEngine;
|
|||
|
||||
using HeavenStudio.Util;
|
||||
using Jukebox;
|
||||
using System.Linq;
|
||||
|
||||
namespace HeavenStudio.Games.Loaders
|
||||
{
|
||||
using static Minigames;
|
||||
public static class RvlNewKarateLoader
|
||||
{
|
||||
public static Minigame AddGame(EventCaller eventCaller)
|
||||
public static Minigame AddGame(EventCaller eventCaller)
|
||||
{
|
||||
RiqEntity WarningUpdater(string datamodel, RiqEntity entity)
|
||||
{
|
||||
if (datamodel == "karateman/hitX")
|
||||
{
|
||||
entity.datamodel = "karateman/warnings";
|
||||
|
||||
int newWarning = (int)entity["type"];
|
||||
if (entity["type"] < 7) {
|
||||
newWarning++;
|
||||
|
|
@ -27,19 +26,58 @@ namespace HeavenStudio.Games.Loaders
|
|||
}
|
||||
|
||||
entity.CreateProperty("whichWarning", newWarning);
|
||||
|
||||
entity.CreateProperty("customLength", false);
|
||||
entity.CreateProperty("cutOut", true);
|
||||
|
||||
entity.dynamicData.Remove("type");
|
||||
|
||||
entity.datamodel = "karateman/warnings";
|
||||
return entity;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
RiqBeatmap.OnUpdateEntity += WarningUpdater;
|
||||
|
||||
|
||||
RiqEntity BackgroundUpdater(string datamodel, RiqEntity entity)
|
||||
{
|
||||
if (datamodel == "karateman/set background effects")
|
||||
{
|
||||
|
||||
return entity;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
RiqBeatmap.OnUpdateEntity += BackgroundUpdater;
|
||||
|
||||
/*
|
||||
RiqEntity NameUpdater(string datamodel, RiqEntity entity)
|
||||
{
|
||||
if (entity.datamodel.Split('/')[0] == "karateman")
|
||||
{
|
||||
if (entity.datamodel == "karateman/bulb") Debug.Log(entity["colorA"]);
|
||||
Debug.Log(datamodel);
|
||||
// this was the only way i could figure out how to convert from that freaky format into an actual color :(
|
||||
// if (entity.dynamicData.ContainsKey("colorA")) {
|
||||
// for (int i = 0; i < (entity.dynamicData.ContainsKey("colorB") ? 4 : 1); i++)
|
||||
// {
|
||||
// string whichColor = i switch {
|
||||
// 0 => "colorA",
|
||||
// 1 => "colorB",
|
||||
// 2 => "colorC",
|
||||
// _ => "colorD",
|
||||
// };
|
||||
// string[] tempValues = entity[whichColor].ToString().Split(": ");
|
||||
// List<float> values = new();
|
||||
// foreach (string value in tempValues)
|
||||
// {
|
||||
// string temp = string.Join("", value.Where(x => x == '.' || char.IsDigit(x)));
|
||||
// if (temp != string.Empty) values.Add(float.Parse(temp));
|
||||
// }
|
||||
|
||||
// entity[whichColor] = new Color(values[0], values[1], values[2]);
|
||||
// }
|
||||
// }
|
||||
|
||||
entity.datamodel = entity.datamodel.Remove(0, 9);
|
||||
entity.datamodel = "karateMan" + entity.datamodel;
|
||||
return entity;
|
||||
|
|
@ -49,9 +87,20 @@ namespace HeavenStudio.Games.Loaders
|
|||
return null;
|
||||
}
|
||||
RiqBeatmap.OnUpdateEntity += NameUpdater;
|
||||
*/
|
||||
|
||||
return new Minigame("karateMan", "Karate Man", "fbca3e", false, false, new List<GameAction>()
|
||||
return new Minigame("karateman", "Karate Man", "fbca3e", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("test", "Test")
|
||||
{
|
||||
function = delegate { Debug.Log(eventCaller.currentEntity["string"]); },
|
||||
resizable = true,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("bool", true, "Disable Below When Inactive", "Whether to bop to the beat or not"),
|
||||
new Param("string", "test", "Will Get Disabled", "Disable When Above Is Inactive")
|
||||
},
|
||||
},
|
||||
new GameAction("bop", "Bop")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.ToggleBop(e.beat, e.length, e["toggle2"], e["toggle"]); },
|
||||
|
|
@ -85,17 +134,13 @@ namespace HeavenStudio.Games.Loaders
|
|||
{
|
||||
function = delegate {
|
||||
var e = eventCaller.currentEntity;
|
||||
Debug.Log(e.beat);
|
||||
Debug.Log(e["type"]);
|
||||
Debug.Log(e["colorA"]);
|
||||
Debug.Log(e["type2"]);
|
||||
KarateMan.instance.CreateBulbSpecial(e.beat, e["type"], e["colorA"], e["type2"]);
|
||||
KarateMan.CreateItemSFX(e.beat, e["type"], e["mute"], true);
|
||||
KarateMan.CreateItemSFX(e.beat, e["type"], false, true);
|
||||
},
|
||||
inactiveFunction = delegate {
|
||||
var e = eventCaller.currentEntity;
|
||||
KarateMan.QueueBulb(e.beat, e["type"], e["colorA"], e["type2"]);
|
||||
KarateMan.CreateItemSFX(e.beat, e["type"], e["mute"], true);
|
||||
KarateMan.CreateItemSFX(e.beat, e["type"], false, true);
|
||||
},
|
||||
defaultLength = 2,
|
||||
parameters = new List<Param>()
|
||||
|
|
@ -163,28 +208,28 @@ namespace HeavenStudio.Games.Loaders
|
|||
},
|
||||
inactiveFunction = delegate {
|
||||
var e = eventCaller.currentEntity;
|
||||
KarateMan.DoWordSound(e.beat, e.length, e["type"], e["customLength"]);
|
||||
KarateMan.DoWordSound(e.beat, e.length, e["whichWarning"], e["customLength"]);
|
||||
}
|
||||
},
|
||||
new GameAction("special camera", "Special Camera")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; KarateMan.DoSpecialCamera(e.beat, e.length, e["toggle"]); },
|
||||
function = delegate { var e = eventCaller.currentEntity; KarateMan.DoSpecialCamera(e.beat, e.length, e["toggle"]); },
|
||||
defaultLength = 8f,
|
||||
resizable = true,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("toggle", true, "Return Camera", "Camera zooms back in?"),
|
||||
},
|
||||
inactiveFunction = delegate { var e = eventCaller.currentEntity; KarateMan.DoSpecialCamera(e.beat, e.length, e["toggle"]); }
|
||||
inactiveFunction = delegate { var e = eventCaller.currentEntity; KarateMan.DoSpecialCamera(e.beat, e.length, e["toggle"]); }
|
||||
},
|
||||
new GameAction("prepare", "Preparation Stance")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.Prepare(e.beat, e.length);},
|
||||
resizable = true,
|
||||
},
|
||||
new GameAction("set gameplay modifiers", "Gameplay Modifiers")
|
||||
new GameAction("set gameplay modifiers", "Flow/Gameplay Modifiers")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetGameplayMods(e.beat, e["type"], e["toggle"]); },
|
||||
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetGameplayMods(e.beat, e["type"], e["toggle"]); },
|
||||
defaultLength = 0.5f,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
|
|
@ -193,28 +238,52 @@ namespace HeavenStudio.Games.Loaders
|
|||
new Param("toggle2", true, "Enable Kicks", "Allow the player to kick? (Contextual kicks will still be allowed even when off)"),
|
||||
},
|
||||
},
|
||||
new GameAction("set background effects", "Background Appearance")
|
||||
new GameAction("background appearance", "Background Appearance")
|
||||
{
|
||||
function = delegate {
|
||||
var e = eventCaller.currentEntity;
|
||||
KarateMan.instance.SetBgAndShadowCol(e.beat, e.length, e["type"], e["type2"], e["colorA"], e["colorB"], e["type3"]);
|
||||
KarateMan.instance.SetBgTexture(e["type4"], e["type5"], e["colorC"], e["colorD"]);
|
||||
KarateMan.instance.BackgroundColor(e.beat, e.length, e["presetBg"], e["shadowType"], e["fxType"], e["startColor"], e["endColor"], e["bgEase"]);
|
||||
//KarateMan.instance.SetBgTexture(e["type4"], e["type5"], e["colorC"], e["colorD"]);
|
||||
},
|
||||
defaultLength = 0.5f,
|
||||
resizable = true,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("type", KarateMan.BackgroundType.Yellow, "Background Type", "The preset background type"),
|
||||
new Param("type2", KarateMan.ShadowType.Tinted, "Shadow Type", "The shadow type. If Tinted doesn't work with your background color try Custom"),
|
||||
new Param("colorA", new Color(), "Custom Background Color", "The background color to use when background type is set to Custom"),
|
||||
new Param("colorB", new Color(), "Custom Shadow Color", "The shadow color to use when shadow type is set to Custom. When fading the background colour shadows fade to this color"),
|
||||
new Param("type3", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed. Fade uses the entity length to determine colour fading speed"),
|
||||
new Param("presetBg", KarateMan.BackgroundType.Yellow, "Preset Background Type", "The preset background type (will by default fade from the existing )"),
|
||||
new Param("startColor", new Color(0.985f, 0.79f, 0.243f), "Start Background Color", "The background color to use when background type is set to Custom"),
|
||||
new Param("endColor", new Color(0.985f, 0.79f, 0.243f), "End Background Color", "When using the Fade background effect, make filter colour fade to this colour"),
|
||||
new Param("bgEase", Util.EasingFunction.Ease.Instant, "Ease", "Ease to use when fading color"),
|
||||
new Param("shadowType", KarateMan.ShadowType.Tinted, "Shadow Type", "The shadow type. If Tinted doesn't work with your background color try Custom"),
|
||||
new Param("shadowColor", new Color(), "Custom Shadow Color", "The shadow color to use when shadow type is set to Custom. When fading the background colour shadows fade to this color"),
|
||||
new Param("fxType", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed. Fade uses the entity length to determine colour fading speed"),
|
||||
new Param("type4", KarateMan.BackgroundTextureType.Plain, "Texture", "The type of background texture to use"),
|
||||
new Param("type5", KarateMan.ShadowType.Tinted, "Color Filter Type", "The method used to apply colour to the texture"),
|
||||
new Param("colorC", new Color(), "Custom Filter Color", "The filter color to use when color filter type is set to Custom"),
|
||||
new Param("colorD", new Color(), "Fading Filter Color", "When using the Fade background effect, make filter colour fade to this colour"),
|
||||
},
|
||||
},
|
||||
// new GameAction("set background effects", "Background Appearance (OLD)")
|
||||
// {
|
||||
// function = delegate {
|
||||
// var e = eventCaller.currentEntity;
|
||||
// KarateMan.instance.SetBgAndShadowCol(e.beat, e.length, e["type"], e["type2"], e["colorA"], e["colorB"], e["type3"]);
|
||||
// KarateMan.instance.SetBgTexture(e["type4"], e["type5"], e["colorC"], e["colorD"]);
|
||||
// },
|
||||
// defaultLength = 0.5f,
|
||||
// resizable = true,
|
||||
// parameters = new List<Param>()
|
||||
// {
|
||||
// new Param("type", KarateMan.BackgroundType.Yellow, "Background Type", "The preset background type"),
|
||||
// new Param("type2", KarateMan.ShadowType.Tinted, "Shadow Type", "The shadow type. If Tinted doesn't work with your background color try Custom"),
|
||||
// new Param("colorA", new Color(), "Custom Background Color", "The background color to use when background type is set to Custom"),
|
||||
// new Param("colorB", new Color(), "Custom Shadow Color", "The shadow color to use when shadow type is set to Custom. When fading the background colour shadows fade to this color"),
|
||||
// new Param("type3", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed. Fade uses the entity length to determine colour fading speed"),
|
||||
// new Param("type4", KarateMan.BackgroundTextureType.Plain, "Texture", "The type of background texture to use"),
|
||||
// new Param("type5", KarateMan.ShadowType.Tinted, "Color Filter Type", "The method used to apply colour to the texture"),
|
||||
// new Param("colorC", new Color(), "Custom Filter Color", "The filter color to use when color filter type is set to Custom"),
|
||||
// new Param("colorD", new Color(), "Fading Filter Color", "When using the Fade background effect, make filter colour fade to this colour"),
|
||||
// },
|
||||
// },
|
||||
new GameAction("set object colors", "Object Colors")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; KarateMan.UpdateMaterialColour(e["colorA"], e["colorB"], e["colorC"]); },
|
||||
|
|
@ -431,7 +500,7 @@ namespace HeavenStudio.Games
|
|||
private double colorStartBeat = -1;
|
||||
private float colorLength = 0f;
|
||||
private Color colorStart = new Color(0.985f, 0.79f, 0.243f);
|
||||
private Color colorEnd = Color.white;
|
||||
private Color colorEnd = new Color(0.985f, 0.79f, 0.243f);
|
||||
private Util.EasingFunction.Ease colorEase;
|
||||
|
||||
static int bgType = (int) BackgroundType.Yellow;
|
||||
|
|
@ -439,7 +508,7 @@ namespace HeavenStudio.Games
|
|||
|
||||
public SpriteRenderer BGPlane;
|
||||
public GameObject BGEffect;
|
||||
|
||||
|
||||
|
||||
Animator bgEffectAnimator;
|
||||
SpriteRenderer bgEffectSpriteRenderer;
|
||||
|
|
@ -454,6 +523,7 @@ namespace HeavenStudio.Games
|
|||
SpriteRenderer bgBloodRenderer;
|
||||
public GameObject BGRadial;
|
||||
SpriteRenderer bgRadialRenderer;
|
||||
SpriteRenderer[] bgFxRenderers;
|
||||
|
||||
[Header("Shadows")]
|
||||
static int currentShadowType = (int) ShadowType.Tinted;
|
||||
|
|
@ -482,6 +552,10 @@ namespace HeavenStudio.Games
|
|||
instance = this;
|
||||
KarateManPot.ResetLastCombo();
|
||||
cameraPosition = CameraPosition[0].position;
|
||||
|
||||
bgGradientRenderer = BGGradient.GetComponent<SpriteRenderer>();
|
||||
bgBloodRenderer = BGBlood.GetComponent<SpriteRenderer>();
|
||||
bgRadialRenderer = BGRadial.GetComponent<SpriteRenderer>();
|
||||
}
|
||||
|
||||
public override void OnGameSwitch(double beat)
|
||||
|
|
@ -507,19 +581,24 @@ namespace HeavenStudio.Games
|
|||
queuedCombos.Clear();
|
||||
}
|
||||
|
||||
List<RiqEntity> prevEntities = GameManager.instance.Beatmap.Entities.FindAll(c => c.datamodel.Split(0) == "karateMan");
|
||||
List<RiqEntity> prevEntities = GameManager.instance.Beatmap.Entities.FindAll(c => c.datamodel.Split(0) == "karateman");
|
||||
|
||||
// init colors
|
||||
RiqEntity bg = prevEntities.FindLast(c => c.beat < beat && c.datamodel.Split(1) == "set background effects");
|
||||
RiqEntity obj = prevEntities.FindLast(c => c.beat < beat && c.datamodel.Split(1) == "set object colors");
|
||||
|
||||
if (bg != null) {
|
||||
SetBgAndShadowCol(bg.beat, 0, bg["type"], bg["type2"], bg["colorA"], bg["colorB"], bg["type3"] == (int)BackgroundFXType.Fade ? 0 : bg["type3"]);
|
||||
SetBgTexture(bg["type4"], bg["type5"], bg["colorC"], bg["colorD"]);
|
||||
|
||||
} else {
|
||||
SetBgAndShadowCol(0, 0, 0, 0, new Color(), new Color(), 0);
|
||||
SetBgTexture(0, 0, new Color(), new Color());
|
||||
|
||||
}
|
||||
// if (bg != null) {
|
||||
// SetBgAndShadowCol(bg.beat, 0, bg["type"], bg["type2"], bg["colorA"], bg["colorB"], bg["type3"] == (int)BackgroundFXType.Fade ? 0 : bg["type3"]);
|
||||
// SetBgTexture(bg["type4"], bg["type5"], bg["colorC"], bg["colorD"]);
|
||||
// } else {
|
||||
// SetBgAndShadowCol(0, 0, 0, 0, new Color(), new Color(), 0);
|
||||
// SetBgTexture(0, 0, new Color(), new Color());
|
||||
// }
|
||||
|
||||
if (obj != null) {
|
||||
UpdateMaterialColour(obj["colorA"], obj["colorB"], obj["colorC"]);
|
||||
|
|
@ -617,7 +696,7 @@ namespace HeavenStudio.Games
|
|||
}
|
||||
|
||||
BackgroundColorUpdate();
|
||||
|
||||
|
||||
GameCamera.additionalPosition = cameraPosition - GameCamera.defaultPosition;
|
||||
BGEffect.transform.position = new Vector3(GameCamera.instance.transform.position.x, GameCamera.instance.transform.position.y, 0);
|
||||
}
|
||||
|
|
@ -636,7 +715,7 @@ namespace HeavenStudio.Games
|
|||
static List<RiqEntity> allEnds = new List<RiqEntity>();
|
||||
public static int CountHitsToEnd(double fromBeat)
|
||||
{
|
||||
allHits = EventCaller.GetAllInGameManagerList("karateMan", new string[] { "hit", "bulb", "kick", "combo" });
|
||||
allHits = EventCaller.GetAllInGameManagerList("karateman", new string[] { "hit", "bulb", "kick", "combo" });
|
||||
allEnds = EventCaller.GetAllInGameManagerList("gameManager", new string[] { "switchGame", "end" });
|
||||
|
||||
allHits.Sort((x, y) => x.beat.CompareTo(y.beat));
|
||||
|
|
@ -654,7 +733,6 @@ namespace HeavenStudio.Games
|
|||
}
|
||||
|
||||
//count each hit event beginning from our current beat to the beat of the closest game switch or end
|
||||
// this still counts hits even if they happen after a switch / end!!!
|
||||
int count = 0;
|
||||
string type;
|
||||
for (int i = 0; i < allHits.Count; i++)
|
||||
|
|
@ -666,7 +744,7 @@ namespace HeavenStudio.Games
|
|||
{
|
||||
//kicks and combos count for 2 hits
|
||||
type = (h.datamodel.Split('/'))[1];
|
||||
count += (type == "kick" || type == "combo" ? 2 : 1);
|
||||
count += (type is "kick" or "combo" ? 2 : 1);
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
|
@ -695,6 +773,15 @@ namespace HeavenStudio.Games
|
|||
{
|
||||
string word = "NoPose";
|
||||
double clear = 0f;
|
||||
if (type <= (int)HitThree.HitFour) {
|
||||
string number = type.ToString().Substring(3);
|
||||
number = char.ToLower(number[0]).ToString() + number.Substring(1);
|
||||
MultiSound.Play(new MultiSound.Sound[] {
|
||||
new MultiSound.Sound($"karateman/{(type == (int)HitThree.HitThreeAlt ? "hitAlt" : "hit")}", beat + 0.5f, offset: hitVoiceOffset),
|
||||
new MultiSound.Sound($"karateman/{number}", beat + 1f),
|
||||
}, forcePlay: true);
|
||||
clear = beat + 4f;
|
||||
}
|
||||
switch (type)
|
||||
{
|
||||
case (int) HitThree.HitOne: // lol
|
||||
|
|
@ -702,8 +789,8 @@ namespace HeavenStudio.Games
|
|||
clear = beat + 4f;
|
||||
if (doSound)
|
||||
MultiSound.Play(new MultiSound.Sound[] {
|
||||
new MultiSound.Sound("karateMan/hit", beat + 0.5f, offset: hitVoiceOffset),
|
||||
new MultiSound.Sound("karateMan/one", beat + 1f),
|
||||
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
|
||||
new MultiSound.Sound("karateman/one", beat + 1f),
|
||||
}, forcePlay: true);
|
||||
break;
|
||||
case (int) HitThree.HitTwo:
|
||||
|
|
@ -711,8 +798,8 @@ namespace HeavenStudio.Games
|
|||
clear = beat + 4f;
|
||||
if (doSound)
|
||||
MultiSound.Play(new MultiSound.Sound[] {
|
||||
new MultiSound.Sound("karateMan/hit", beat + 0.5f, offset: hitVoiceOffset),
|
||||
new MultiSound.Sound("karateMan/two", beat + 1f),
|
||||
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
|
||||
new MultiSound.Sound("karateman/two", beat + 1f),
|
||||
}, forcePlay: true);
|
||||
break;
|
||||
case (int) HitThree.HitThree:
|
||||
|
|
@ -720,8 +807,8 @@ namespace HeavenStudio.Games
|
|||
clear = beat + 4f;
|
||||
if (doSound)
|
||||
MultiSound.Play(new MultiSound.Sound[] {
|
||||
new MultiSound.Sound("karateMan/hit", beat + 0.5f, offset: hitVoiceOffset),
|
||||
new MultiSound.Sound("karateMan/three", beat + 1f),
|
||||
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
|
||||
new MultiSound.Sound("karateman/three", beat + 1f),
|
||||
}, forcePlay: true);
|
||||
break;
|
||||
case (int) HitThree.HitThreeAlt:
|
||||
|
|
@ -729,8 +816,8 @@ namespace HeavenStudio.Games
|
|||
clear = beat + 4f;
|
||||
if (doSound)
|
||||
MultiSound.Play(new MultiSound.Sound[] {
|
||||
new MultiSound.Sound("karateMan/hitAlt", beat + 0.5f, offset: hitVoiceOffset),
|
||||
new MultiSound.Sound("karateMan/threeAlt", beat + 1f),
|
||||
new MultiSound.Sound("karateman/hitAlt", beat + 0.5f, offset: hitVoiceOffset),
|
||||
new MultiSound.Sound("karateman/threeAlt", beat + 1f),
|
||||
}, forcePlay: true);
|
||||
break;
|
||||
case (int) HitThree.HitFour:
|
||||
|
|
@ -739,8 +826,8 @@ namespace HeavenStudio.Games
|
|||
if (doSound)
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
new MultiSound.Sound("karateMan/hit", beat + 0.5f, offset: hitVoiceOffset),
|
||||
new MultiSound.Sound("karateMan/four", beat + 1f),
|
||||
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
|
||||
new MultiSound.Sound("karateman/four", beat + 1f),
|
||||
}, forcePlay: true);
|
||||
break;
|
||||
case (int) HitThree.Grr:
|
||||
|
|
@ -765,15 +852,7 @@ namespace HeavenStudio.Games
|
|||
|
||||
public static void CreateItemSFX(double beat, int type, bool muteSound = false, bool isBulb = false)
|
||||
{
|
||||
string outSound;
|
||||
string whichObj = (type == (int)HitType.Lightbulb || isBulb) ? "Lightbulb" : "Object";
|
||||
if ((beat + 0.5f) % 1.0 == 0f) {
|
||||
outSound = $"karateMan/offbeat{whichObj}Out";
|
||||
} else {
|
||||
outSound = $"karateMan/{whichObj.ToLower()}Out";
|
||||
}
|
||||
|
||||
if (!muteSound) SoundByte.PlayOneShotGame(outSound, forcePlay: true);
|
||||
if (!muteSound) SoundByte.PlayOneShotGame($"karateman/{(beat % 1.0 == 0.5 ? "offbeatObject" : "object")}Out", forcePlay: true);
|
||||
}
|
||||
|
||||
public static void QueueItem(double beat, int type, int expression)
|
||||
|
|
@ -843,7 +922,7 @@ namespace HeavenStudio.Games
|
|||
|
||||
public static void ComboSFX()
|
||||
{
|
||||
SoundByte.PlayOneShotGame("karateMan/barrelOutCombos", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/barrelOutCombos", forcePlay: true);
|
||||
}
|
||||
|
||||
public static void QueueCombo(double beat, int expression, bool cutOut, bool noVoice)
|
||||
|
|
@ -873,12 +952,12 @@ namespace HeavenStudio.Games
|
|||
if (noVoice) return;
|
||||
|
||||
List<MultiSound.Sound> sounds = new() {
|
||||
new MultiSound.Sound("karateMan/punchy1", beat + 1f),
|
||||
new MultiSound.Sound("karateMan/punchy2", beat + 1.25f),
|
||||
new MultiSound.Sound("karateMan/punchy3", beat + 1.5f),
|
||||
new MultiSound.Sound("karateMan/punchy4", beat + 1.75f),
|
||||
new MultiSound.Sound("karateMan/ko", beat + 2f),
|
||||
new MultiSound.Sound("karateMan/pow", beat + 2.5f)
|
||||
new MultiSound.Sound("karateman/punchy1", beat + 1f),
|
||||
new MultiSound.Sound("karateman/punchy2", beat + 1.25f),
|
||||
new MultiSound.Sound("karateman/punchy3", beat + 1.5f),
|
||||
new MultiSound.Sound("karateman/punchy4", beat + 1.75f),
|
||||
new MultiSound.Sound("karateman/ko", beat + 2f),
|
||||
new MultiSound.Sound("karateman/pow", beat + 2.5f)
|
||||
};
|
||||
|
||||
if (voiceEntities.Count > 0) {
|
||||
|
|
@ -893,7 +972,7 @@ namespace HeavenStudio.Games
|
|||
|
||||
public static void KickSFX()
|
||||
{
|
||||
SoundByte.PlayOneShotGame("karateMan/barrelOutKicks", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/barrelOutKicks", forcePlay: true);
|
||||
}
|
||||
|
||||
public static void QueueKick(double beat, bool ball, int expression, bool cutOut, bool noVoice)
|
||||
|
|
@ -913,10 +992,10 @@ namespace HeavenStudio.Games
|
|||
|
||||
if (!noVoice) {
|
||||
MultiSound.Play(new MultiSound.Sound[] {
|
||||
new MultiSound.Sound("karateMan/punchKick1", beat + 1f),
|
||||
new MultiSound.Sound("karateMan/punchKick2", beat + 1.5f),
|
||||
new MultiSound.Sound("karateMan/punchKick3", beat + 1.75f),
|
||||
new MultiSound.Sound("karateMan/punchKick4", beat + 2.5f),
|
||||
new MultiSound.Sound("karateman/punchKick1", beat + 1f),
|
||||
new MultiSound.Sound("karateman/punchKick2", beat + 1.5f),
|
||||
new MultiSound.Sound("karateman/punchKick3", beat + 1.75f),
|
||||
new MultiSound.Sound("karateman/punchKick4", beat + 2.5f),
|
||||
}, forcePlay: true);
|
||||
}
|
||||
}
|
||||
|
|
@ -937,21 +1016,19 @@ namespace HeavenStudio.Games
|
|||
return mobj;
|
||||
}
|
||||
|
||||
private void BackgroundColorUpdate()
|
||||
public void BackgroundColor(double beat, float length, int presetBG, int shadowType, int fxType, Color colorStartSet, Color colorEndSet, int ease)
|
||||
{
|
||||
float normalizedBeat = Mathf.Clamp01(Conductor.instance.GetPositionFromBeat(colorStartBeat, colorLength));
|
||||
//////////////////////////////////////////
|
||||
// preset = BackgroundType //
|
||||
// shadow = ShadowType //
|
||||
// fxType = BackgroundFXType //
|
||||
// textureType = BackgroundTextureType //
|
||||
//////////////////////////////////////////
|
||||
|
||||
var func = Util.EasingFunction.GetEasingFunction(colorEase);
|
||||
if (presetBG != (int)BackgroundType.Custom) {
|
||||
colorEndSet = BackgroundColors[presetBG];
|
||||
}
|
||||
|
||||
float newR = func(colorStart.r, colorEnd.r, normalizedBeat);
|
||||
float newG = func(colorStart.g, colorEnd.g, normalizedBeat);
|
||||
float newB = func(colorStart.b, colorEnd.b, normalizedBeat);
|
||||
|
||||
BGPlane.color = new Color(newR, newG, newB);
|
||||
}
|
||||
|
||||
public void BackgroundColor(double beat, float length, Color colorStartSet, Color colorEndSet, int ease)
|
||||
{
|
||||
colorStartBeat = beat;
|
||||
colorLength = length;
|
||||
colorStart = colorStartSet;
|
||||
|
|
@ -959,54 +1036,16 @@ namespace HeavenStudio.Games
|
|||
colorEase = (Util.EasingFunction.Ease)ease;
|
||||
}
|
||||
|
||||
public void SetBgAndShadowCol(double beat, float length, int newBgType, int shadowType, Color a, Color b, int fx)
|
||||
{
|
||||
SetBgFx(fx, beat, length);
|
||||
UpdateShadowColour(shadowType, b);
|
||||
|
||||
bgType = newBgType;
|
||||
if (bgType == (int) BackgroundType.Custom)
|
||||
bgColour = a;
|
||||
else
|
||||
bgColour = BackgroundColors[newBgType];
|
||||
BGPlane.color = bgColour;
|
||||
|
||||
//😢
|
||||
if (fx != (int) BackgroundFXType.Fade)
|
||||
{
|
||||
bgColourLast = bgColour;
|
||||
oldShadowColour = GetShadowColor(true);
|
||||
}
|
||||
|
||||
if (textureFilterType == (int) ShadowType.Tinted)
|
||||
filterColour = Color.LerpUnclamped(bgColour, ShadowBlendColor, 0.45f);
|
||||
}
|
||||
|
||||
public void SetBgFx(int fx, double beat, float length)
|
||||
{
|
||||
switch (fx)
|
||||
{
|
||||
case (int) BackgroundFXType.Fade:
|
||||
bgColourLast = bgColour;
|
||||
bgFadeTime = beat;
|
||||
bgFadeDuration = length;
|
||||
break;
|
||||
default:
|
||||
currentBgEffect = fx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetBgTexture(int type, int filterType, Color filterColor, Color nextColor)
|
||||
public void SetBgTexture(int type, int filterType, Color colorStartSet, Color colorEndSet)
|
||||
{
|
||||
textureType = type;
|
||||
textureFilterType = filterType;
|
||||
if (textureFilterType == (int) ShadowType.Tinted)
|
||||
filterColour = Color.LerpUnclamped(bgColour, filterColor, 0.45f);
|
||||
filterColour = Color.LerpUnclamped(colorStartSet, colorEndSet, 0.45f);
|
||||
else
|
||||
{
|
||||
filterColour = filterColor;
|
||||
filterColourNext = nextColor;
|
||||
filterColour = colorStartSet;
|
||||
filterColourNext = colorEndSet;
|
||||
}
|
||||
switch (textureType)
|
||||
{
|
||||
|
|
@ -1031,9 +1070,64 @@ namespace HeavenStudio.Games
|
|||
BGRadial.SetActive(false);
|
||||
break;
|
||||
}
|
||||
UpdateFilterColour(bgColour, filterColour);
|
||||
BackgroundColorUpdate();
|
||||
}
|
||||
|
||||
private void BackgroundColorUpdate()
|
||||
{
|
||||
float normalizedBeat = Mathf.Clamp01(Conductor.instance.GetPositionFromBeat(colorStartBeat, colorLength));
|
||||
|
||||
var func = Util.EasingFunction.GetEasingFunction(colorEase);
|
||||
|
||||
float newR = func(colorStart.r, colorEnd.r, normalizedBeat);
|
||||
float newG = func(colorStart.g, colorEnd.g, normalizedBeat);
|
||||
float newB = func(colorStart.b, colorEnd.b, normalizedBeat);
|
||||
|
||||
BGPlane.color = new Color(newR, newG, newB);
|
||||
|
||||
// bgGradientRenderer.color = filterCol;
|
||||
// bgBloodRenderer.color = filterCol;
|
||||
// bgRadialRenderer.color = filterCol;
|
||||
}
|
||||
|
||||
// public void SetBgAndShadowCol(double beat, float length, int newBgType, int shadowType, Color a, Color b, int fx)
|
||||
// {
|
||||
// SetBgFx(fx, beat, length);
|
||||
// UpdateShadowColour(shadowType, b);
|
||||
|
||||
// bgType = newBgType;
|
||||
// if (bgType == (int) BackgroundType.Custom)
|
||||
// bgColour = a;
|
||||
// else
|
||||
// bgColour = BackgroundColors[newBgType];
|
||||
// BGPlane.color = bgColour;
|
||||
|
||||
// //😢
|
||||
// if (fx != (int) BackgroundFXType.Fade)
|
||||
// {
|
||||
// bgColourLast = bgColour;
|
||||
// oldShadowColour = GetShadowColor(true);
|
||||
// }
|
||||
|
||||
// if (textureFilterType == (int) ShadowType.Tinted)
|
||||
// filterColour = Color.LerpUnclamped(bgColour, ShadowBlendColor, 0.45f);
|
||||
// }
|
||||
|
||||
// public void SetBgFx(int fx, double beat, float length)
|
||||
// {
|
||||
// switch (fx)
|
||||
// {
|
||||
// case (int) BackgroundFXType.Fade:
|
||||
// bgColourLast = bgColour;
|
||||
// bgFadeTime = beat;
|
||||
// bgFadeDuration = length;
|
||||
// break;
|
||||
// default:
|
||||
// currentBgEffect = fx;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
public void SetGameplayMods(double beat, int mode, bool combo)
|
||||
{
|
||||
NoriGO.SetActive(true);
|
||||
|
|
@ -1041,55 +1135,39 @@ namespace HeavenStudio.Games
|
|||
IsComboEnable = combo;
|
||||
}
|
||||
|
||||
void UpdateFilterColour(Color bgColor, Color filterColor)
|
||||
{
|
||||
bgGradientRenderer = BGGradient.GetComponent<SpriteRenderer>();
|
||||
bgBloodRenderer = BGBlood.GetComponent<SpriteRenderer>();
|
||||
bgRadialRenderer = BGRadial.GetComponent<SpriteRenderer>();
|
||||
Color col;
|
||||
if (textureFilterType == (int) ShadowType.Tinted)
|
||||
col = Color.LerpUnclamped(bgColor, ShadowBlendColor, 0.45f);
|
||||
else
|
||||
col = filterColor;
|
||||
|
||||
bgGradientRenderer.color = col;
|
||||
bgBloodRenderer.color = col;
|
||||
bgRadialRenderer.color = col;
|
||||
}
|
||||
|
||||
public static Color ShadowBlendColor = new Color(195 / 255f, 48 / 255f, 2 / 255f);
|
||||
public Color GetShadowColor(bool next = false)
|
||||
{
|
||||
Color lastCol, nextCol;
|
||||
lastCol = oldShadowColour;
|
||||
// public Color GetShadowColor(bool next = false)
|
||||
// {
|
||||
// Color lastCol, nextCol;
|
||||
// lastCol = oldShadowColour;
|
||||
|
||||
if (currentShadowType == (int) ShadowType.Custom)
|
||||
nextCol = customShadowColour;
|
||||
else if (bgType < (int) BackgroundType.Custom)
|
||||
nextCol = ShadowColors[bgType];
|
||||
else
|
||||
nextCol = Color.LerpUnclamped(bgColour, ShadowBlendColor, 0.45f);
|
||||
// if (currentShadowType == (int) ShadowType.Custom)
|
||||
// nextCol = customShadowColour;
|
||||
// else if (bgType < (int) BackgroundType.Custom)
|
||||
// nextCol = ShadowColors[bgType];
|
||||
// else
|
||||
// nextCol = Color.LerpUnclamped(bgColour, ShadowBlendColor, 0.45f);
|
||||
|
||||
float fadeProg = Conductor.instance.GetPositionFromBeat(bgFadeTime, bgFadeDuration);
|
||||
if (fadeProg <= 1f && fadeProg >= 0)
|
||||
{
|
||||
return Color.LerpUnclamped(lastCol, nextCol, fadeProg);
|
||||
}
|
||||
return next ? nextCol : lastCol;
|
||||
}
|
||||
// float fadeProg = Conductor.instance.GetPositionFromBeat(bgFadeTime, bgFadeDuration);
|
||||
// if (fadeProg <= 1f && fadeProg >= 0)
|
||||
// {
|
||||
// return Color.LerpUnclamped(lastCol, nextCol, fadeProg);
|
||||
// }
|
||||
// return next ? nextCol : lastCol;
|
||||
// }
|
||||
|
||||
public void UpdateShadowColour(int type, Color colour)
|
||||
{
|
||||
if (currentShadowType == (int) ShadowType.Custom)
|
||||
oldShadowColour = customShadowColour;
|
||||
else if (bgType < (int) BackgroundType.Custom)
|
||||
oldShadowColour = ShadowColors[bgType];
|
||||
else
|
||||
oldShadowColour = Color.LerpUnclamped(bgColour, ShadowBlendColor, 0.45f);
|
||||
// public void UpdateShadowColour(int type, Color colour)
|
||||
// {
|
||||
// if (currentShadowType == (int) ShadowType.Custom)
|
||||
// oldShadowColour = customShadowColour;
|
||||
// else if (bgType < (int) BackgroundType.Custom)
|
||||
// oldShadowColour = ShadowColors[bgType];
|
||||
// else
|
||||
// oldShadowColour = Color.LerpUnclamped(bgColour, ShadowBlendColor, 0.45f);
|
||||
|
||||
currentShadowType = type;
|
||||
customShadowColour = colour;
|
||||
}
|
||||
// currentShadowType = type;
|
||||
// customShadowColour = colour;
|
||||
// }
|
||||
|
||||
public static void UpdateMaterialColour(Color mainCol, Color highlightCol, Color objectCol)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
if (!KarateMan.instance.IsExpectingInputNow(InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN))
|
||||
{
|
||||
Punch(1);
|
||||
SoundByte.PlayOneShotGame("karateMan/swingNoHit", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/swingNoHit", forcePlay: true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
else if (inKick && cond.GetPositionFromBeat(lastChargeTime, 2.75f) <= 0.5f && !KarateMan.instance.IsExpectingInputNow(InputType.STANDARD_UP | InputType.DIRECTION_UP))
|
||||
{
|
||||
Kick(cond.songPositionInBeatsAsDouble);
|
||||
SoundByte.PlayOneShotGame("karateMan/swingKick", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/swingKick", forcePlay: true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -189,7 +189,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
|
||||
public bool Punch(int forceHand = 0)
|
||||
{
|
||||
if (GameManager.instance.currentGame != "karateMan") return false;
|
||||
if (GameManager.instance.currentGame != "karateman") return false;
|
||||
var cond = Conductor.instance;
|
||||
bool straight = false;
|
||||
|
||||
|
|
@ -232,7 +232,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
|
||||
public void ComboSequence(int seq)
|
||||
{
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
var cond = Conductor.instance;
|
||||
bop.startBeat = cond.songPositionInBeatsAsDouble + 1f;
|
||||
unPrepareTime = double.MinValue;
|
||||
|
|
@ -286,10 +286,10 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
new MultiSound.Sound("karateMan/swingNoHit", beat),
|
||||
new MultiSound.Sound("karateMan/swingNoHit_Alt", beat + 0.25f),
|
||||
new MultiSound.Sound("karateMan/swingNoHit_Alt", beat + 0.5f),
|
||||
new MultiSound.Sound("karateMan/comboMiss", beat + 0.75f),
|
||||
new MultiSound.Sound("karateman/swingNoHit", beat),
|
||||
new MultiSound.Sound("karateman/swingNoHit_Alt", beat + 0.25f),
|
||||
new MultiSound.Sound("karateman/swingNoHit_Alt", beat + 0.5f),
|
||||
new MultiSound.Sound("karateman/comboMiss", beat + 0.75f),
|
||||
}, forcePlay: true);
|
||||
}
|
||||
|
||||
|
|
@ -338,7 +338,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
{
|
||||
foreach (var shadow in Shadows)
|
||||
{
|
||||
shadow.color = KarateMan.instance.GetShadowColor();
|
||||
//shadow.color = KarateMan.instance.GetShadowColor();
|
||||
}
|
||||
|
||||
Color mainCol = KarateMan.BodyColor;
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
if (KarateMan.instance.NoriPerformance >= 0.6f && oldNori / MaxNori < 0.6f && !playedJust)
|
||||
{
|
||||
playedJust = true;
|
||||
SoundByte.PlayOneShotGame("karateMan/nori_just");
|
||||
SoundByte.PlayOneShotGame("karateman/nori_just");
|
||||
}
|
||||
UpdateHeartColours();
|
||||
}
|
||||
|
|
@ -193,7 +193,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
if (KarateMan.instance.NoriPerformance < 0.6f && oldNori / MaxNori >= 0.6f)
|
||||
{
|
||||
playedJust = false;
|
||||
SoundByte.PlayOneShotGame("karateMan/nori_ng");
|
||||
SoundByte.PlayOneShotGame("karateman/nori_ng");
|
||||
}
|
||||
UpdateHeartColours();
|
||||
}
|
||||
|
|
@ -205,7 +205,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
if (noriMode == (int) KarateMan.NoriMode.Tengoku)
|
||||
{
|
||||
if (Nori >= MaxNori)
|
||||
SoundByte.PlayOneShotGame("karateMan/nori_through");
|
||||
SoundByte.PlayOneShotGame("karateman/nori_through");
|
||||
playedJust = false;
|
||||
Nori = 0;
|
||||
foreach (Animator anim in NoriHeartAnimators)
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
|
||||
ShadowInstance = GameObject.Instantiate(Shadow, KarateMan.instance.ItemHolder);
|
||||
shadowRenderer = ShadowInstance.GetComponent<SpriteRenderer>();
|
||||
shadowRenderer.color = KarateMan.instance.GetShadowColor();
|
||||
//shadowRenderer.color = KarateMan.instance.GetShadowColor();
|
||||
ShadowInstance.SetActive(true);
|
||||
ShadowInstance.transform.position = new Vector3(transform.position.x, floorHeight - 0.5f, transform.position.z);
|
||||
}
|
||||
|
|
@ -321,7 +321,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
GameObject.Destroy(ShadowInstance.gameObject);
|
||||
GameObject.Destroy(gameObject);
|
||||
|
||||
SoundByte.PlayOneShotGame("karateMan/bombBreak", volume: 0.25f);
|
||||
SoundByte.PlayOneShotGame("karateman/bombBreak", volume: 0.25f);
|
||||
return;
|
||||
}
|
||||
else if (cond.songPositionInBeatsAsDouble >= startBeat + Mathf.Max(2f, curveTargetBeat) || CurrentCurve == null) {
|
||||
|
|
@ -414,7 +414,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
break;
|
||||
}
|
||||
ShadowInstance.transform.position = new Vector3(transform.position.x, floorHeight - 0.5f, transform.position.z);
|
||||
shadowRenderer.color = KarateMan.instance.GetShadowColor();
|
||||
//shadowRenderer.color = KarateMan.instance.GetShadowColor();
|
||||
SetColourMapping();
|
||||
}
|
||||
|
||||
|
|
@ -440,7 +440,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
case ItemType.Bulb:
|
||||
CurrentCurve = ItemCurves[straight ? 1 : 0];
|
||||
curveTargetBeat = straight ? 1f : 1.5f;;
|
||||
SoundByte.PlayOneShotGame("karateMan/lightbulbHit", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/lightbulbHit", forcePlay: true);
|
||||
p = Instantiate(HitParticles[5], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
|
||||
if (effectTint.a == 0)
|
||||
|
|
@ -464,101 +464,101 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
case ItemType.Rock:
|
||||
CurrentCurve = ItemCurves[1];
|
||||
curveTargetBeat = 1f;
|
||||
SoundByte.PlayOneShotGame("karateMan/rockHit", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/rockHit", forcePlay: true);
|
||||
p = Instantiate(HitParticles[4], HitPosition[1].position, Quaternion.identity, game.ItemHolder);
|
||||
p.Play();
|
||||
|
||||
if (game.IsNoriActive && game.NoriPerformance >= 1f)
|
||||
SoundByte.PlayOneShotGame("karateMan/rockHit_fullNori", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/rockHit_fullNori", forcePlay: true);
|
||||
break;
|
||||
case ItemType.Ball:
|
||||
CurrentCurve = ItemCurves[1];
|
||||
curveTargetBeat = 1f;
|
||||
SoundByte.PlayOneShotGame("karateMan/soccerHit", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/soccerHit", forcePlay: true);
|
||||
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;
|
||||
SoundByte.PlayOneShotGame("karateMan/cookingPot", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/cookingPot", forcePlay: true);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
game.CreateItemInstance(startBeat + 1f, "Item09", 0, ItemType.CookingLid);
|
||||
GetComponent<Animator>().Play("Item08", -1, 0);
|
||||
|
||||
if (game.IsNoriActive && game.NoriPerformance >= 1f)
|
||||
SoundByte.PlayOneShotGame("karateMan/rockHit_fullNori", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/rockHit_fullNori", forcePlay: true);
|
||||
break;
|
||||
case ItemType.Alien:
|
||||
CurrentCurve = ItemCurves[1];
|
||||
curveTargetBeat = 1f;
|
||||
SoundByte.PlayOneShotGame("karateMan/alienHit", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/alienHit", forcePlay: true);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
|
||||
if (game.IsNoriActive && game.NoriPerformance >= 1f)
|
||||
SoundByte.PlayOneShotGame("karateMan/rockHit_fullNori", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/rockHit_fullNori", forcePlay: true);
|
||||
break;
|
||||
case ItemType.Bomb:
|
||||
CurrentCurve = ItemCurves[1];
|
||||
curveTargetBeat = 1f;
|
||||
SoundByte.PlayOneShotGame("karateMan/bombHit", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/bombHit", forcePlay: true);
|
||||
p = Instantiate(HitParticles[2], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
game.Joe.RemoveBombGlow(startBeat + 1f, 1f);
|
||||
|
||||
if (game.IsNoriActive && game.NoriPerformance >= 1f)
|
||||
SoundByte.PlayOneShotGame("karateMan/rockHit_fullNori", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/rockHit_fullNori", forcePlay: true);
|
||||
break;
|
||||
case ItemType.TacoBell:
|
||||
CurrentCurve = ItemCurves[1];
|
||||
curveTargetBeat = 1f;
|
||||
SoundByte.PlayOneShotGame("karateMan/rockHit", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateMan/tacobell", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/rockHit", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/tacobell", forcePlay: true);
|
||||
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
|
||||
if (game.IsNoriActive && game.NoriPerformance >= 1f)
|
||||
SoundByte.PlayOneShotGame("karateMan/rockHit_fullNori", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/rockHit_fullNori", forcePlay: true);
|
||||
break;
|
||||
case ItemType.ComboPot1:
|
||||
CurrentCurve = ItemCurves[straight ? 1 : 0];
|
||||
curveTargetBeat = 1.5f;
|
||||
SoundByte.PlayOneShotGame("karateMan/comboHit1", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/comboHit1", forcePlay: true);
|
||||
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;
|
||||
SoundByte.PlayOneShotGame("karateMan/comboHit1", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/comboHit1", forcePlay: true);
|
||||
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;
|
||||
SoundByte.PlayOneShotGame("karateMan/comboHit2", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/comboHit2", forcePlay: true);
|
||||
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;
|
||||
SoundByte.PlayOneShotGame("karateMan/comboHit3", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/comboHit3", forcePlay: true);
|
||||
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;
|
||||
SoundByte.PlayOneShotGame("karateMan/comboHit3", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/comboHit3", forcePlay: true);
|
||||
p = Instantiate(HitParticles[1], HitPosition[4].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder);
|
||||
p.Play();
|
||||
break;
|
||||
case ItemType.ComboBarrel:
|
||||
SoundByte.PlayOneShotGame("karateMan/comboHit4", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/comboHit4", forcePlay: true);
|
||||
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)), game.ItemHolder);
|
||||
|
|
@ -572,7 +572,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
game.Joe.ApplyBombGlow();
|
||||
game.CreateItemInstance(startBeat + 1f, "Item04", OnHitExpression, ItemType.KickBomb);
|
||||
}
|
||||
SoundByte.PlayOneShotGame("karateMan/barrelBreak", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/barrelBreak", forcePlay: true);
|
||||
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)), game.ItemHolder);
|
||||
|
|
@ -580,14 +580,14 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
|
||||
break;
|
||||
case ItemType.KickBomb:
|
||||
SoundByte.PlayOneShotGame("karateMan/bombKick", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/bombKick", forcePlay: true);
|
||||
p = Instantiate(HitParticles[2], ItemCurves[6].GetPoint(0.5f), Quaternion.identity, game.ItemHolder);
|
||||
p.Play();
|
||||
|
||||
game.Joe.RemoveBombGlow(startBeat + 0.75f);
|
||||
break;
|
||||
case ItemType.KickBall:
|
||||
SoundByte.PlayOneShotGame("karateMan/bombKick", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/bombKick", forcePlay: true);
|
||||
p = Instantiate(HitParticles[1], ItemCurves[6].GetPoint(0.5f), Quaternion.identity, game.ItemHolder);
|
||||
p.Play();
|
||||
break;
|
||||
|
|
@ -596,11 +596,11 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
curveTargetBeat = straight ? 1f : 1.5f;
|
||||
if (game.IsNoriActive && game.NoriPerformance < 0.6f)
|
||||
{
|
||||
SoundByte.PlayOneShotGame("karateMan/potHit_lowNori", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateMan/potHit", volume: 0.66f, forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/potHit_lowNori", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/potHit", volume: 0.66f, forcePlay: true);
|
||||
}
|
||||
else
|
||||
SoundByte.PlayOneShotGame("karateMan/potHit", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/potHit", forcePlay: true);
|
||||
p = Instantiate(HitParticles[3], HitPosition[1].position, Quaternion.identity, game.ItemHolder);
|
||||
p.Play();
|
||||
|
||||
|
|
@ -657,7 +657,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
|
||||
void JoeComboSequence()
|
||||
{
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
var joe = KarateMan.instance.Joe;
|
||||
if (joe.GetShouldComboId() != comboId || !joe.inCombo) return;
|
||||
switch (type)
|
||||
|
|
@ -665,7 +665,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
case ItemType.ComboPot2:
|
||||
joe.Punch(2);
|
||||
if (joe.GetComboId() != comboId)
|
||||
SoundByte.PlayOneShotGame("karateMan/swingNoHit_Alt", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/swingNoHit_Alt", forcePlay: true);
|
||||
else
|
||||
{
|
||||
ItemHitEffect();
|
||||
|
|
@ -683,7 +683,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
//if the button isn't held anymore make Joe spin
|
||||
if (joe.GetComboId() != comboId) {
|
||||
joe.ComboMiss(startBeat + 1f);
|
||||
SoundByte.PlayOneShotGame("karateMan/comboMiss", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/comboMiss", forcePlay: true);
|
||||
joe.SetShouldComboId(-2);
|
||||
}
|
||||
else
|
||||
|
|
@ -730,7 +730,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
|
||||
public void ItemJustOrNg(PlayerActionEvent caller, float state)
|
||||
{
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
var joe = KarateMan.instance.Joe;
|
||||
if (state <= -1f || state >= 1f) {
|
||||
bool straight = joe.Punch(ItemPunchHand());
|
||||
|
|
@ -758,7 +758,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
CreateHitMark(false);
|
||||
startBeat = Conductor.instance.songPositionInBeatsAsDouble;
|
||||
status = FlyStatus.HitWeak;
|
||||
SoundByte.PlayOneShotGame("karateMan/hitNoNori", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/hitNoNori", forcePlay: true);
|
||||
joe.Punch(3);
|
||||
transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z - 30f);
|
||||
KarateMan.instance.Nori.DoNG();
|
||||
|
|
@ -775,7 +775,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
|
||||
public void ItemWrongAction(PlayerActionEvent caller, float state)
|
||||
{
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
if (!KarateMan.IsComboEnable) return;
|
||||
//hitting a normal object with the alt input
|
||||
//WHEN SCORING THIS IS A MISS
|
||||
|
|
@ -809,13 +809,13 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
public void ItemThrough(PlayerActionEvent caller)
|
||||
{
|
||||
var joe = KarateMan.instance.Joe;
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
if (status != FlyStatus.Fly || gameObject == null) return;
|
||||
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(startBeat + 2f, delegate {
|
||||
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise);
|
||||
SoundByte.PlayOneShotGame("karateMan/karate_through", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/karate_through", forcePlay: true);
|
||||
}),
|
||||
new BeatAction.Action(startBeat + 5f, delegate {
|
||||
if (joe.wantFace == -1)
|
||||
|
|
@ -835,7 +835,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
|
||||
public void ComboStartJustOrNg(PlayerActionEvent caller, float state)
|
||||
{
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
var joe = KarateMan.instance.Joe;
|
||||
joe.inCombo = true;
|
||||
joe.Punch(1);
|
||||
|
|
@ -860,13 +860,13 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
public void ComboStartThrough(PlayerActionEvent caller)
|
||||
{
|
||||
var joe = KarateMan.instance.Joe;
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
if (status != FlyStatus.Fly || gameObject == null) return;
|
||||
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(startBeat + 2f, delegate {
|
||||
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise);
|
||||
SoundByte.PlayOneShotGame("karateMan/karate_through", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/karate_through", forcePlay: true);
|
||||
}),
|
||||
new BeatAction.Action(startBeat + 5f, delegate {
|
||||
if (joe.wantFace == -1)
|
||||
|
|
@ -880,7 +880,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
|
||||
public void ComboStartWrongAction(PlayerActionEvent caller, float state)
|
||||
{
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
//hitting a combo start with the normal input
|
||||
//WHEN SCORING THIS IS A MISS
|
||||
var joe = KarateMan.instance.Joe;
|
||||
|
|
@ -906,7 +906,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
|
||||
public void ComboEndJustOrNg(PlayerActionEvent caller, float state)
|
||||
{
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
var joe = KarateMan.instance.Joe;
|
||||
joe.inCombo = false;
|
||||
joe.SetComboId(-1);
|
||||
|
|
@ -939,7 +939,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
}
|
||||
|
||||
public void ComboEndOut(PlayerActionEvent caller) {
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
var joe = KarateMan.instance.Joe;
|
||||
if (status == FlyStatus.Fly && joe.inCombo && joe.GetComboId() == comboId && joe.comboWaiting)
|
||||
{
|
||||
|
|
@ -947,14 +947,14 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
joe.SetComboId(-1);
|
||||
joe.SetShouldComboId(-1);
|
||||
joe.ComboSequence(3);
|
||||
SoundByte.PlayOneShotGame("karateMan/swingKick", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/swingKick", forcePlay: true);
|
||||
}
|
||||
OnHit.CanHit(false);
|
||||
}
|
||||
|
||||
public void ComboEndThrough(PlayerActionEvent caller)
|
||||
{
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
if (status != FlyStatus.Fly || gameObject == null) return;
|
||||
var joe = KarateMan.instance.Joe;
|
||||
if (joe.GetComboId() != comboId || !joe.inCombo)
|
||||
|
|
@ -995,7 +995,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
|
||||
public void KickChargeJustOrNg(PlayerActionEvent caller, float state)
|
||||
{
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
var joe = KarateMan.instance.Joe;
|
||||
|
||||
joe.Punch(ItemPunchHand());
|
||||
|
|
@ -1028,13 +1028,13 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
public void KickChargeThrough(PlayerActionEvent caller)
|
||||
{
|
||||
var joe = KarateMan.instance.Joe;
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
if (status != FlyStatus.Fly || gameObject == null) return;
|
||||
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(startBeat + 2f, delegate {
|
||||
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise);
|
||||
SoundByte.PlayOneShotGame("karateMan/karate_through", forcePlay: true);
|
||||
SoundByte.PlayOneShotGame("karateman/karate_through", forcePlay: true);
|
||||
}),
|
||||
new BeatAction.Action(startBeat + 5f, delegate {
|
||||
if (joe.wantFace == -1)
|
||||
|
|
@ -1054,7 +1054,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
|
||||
public void KickJustOrNg(PlayerActionEvent caller, float state)
|
||||
{
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
var joe = KarateMan.instance.Joe;
|
||||
|
||||
joe.Kick(Conductor.instance.songPositionInBeatsAsDouble);
|
||||
|
|
@ -1094,7 +1094,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
|||
|
||||
public void KickThrough(PlayerActionEvent caller)
|
||||
{
|
||||
if (GameManager.instance.currentGame != "karateMan") return;
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
if (status != FlyStatus.Fly || gameObject == null) return;
|
||||
BeatAction.New(KarateMan.instance.Joe.gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue