add entity to collapse function, start on new animation thingy
im gonna use fork lifter to demonstrate DoScaledAnimationFromBeatAsync() cuz it uses animations to cue the peas also i fixed that months old bug where the fork lifter sfx wasn't playing correctly :/
This commit is contained in:
parent
33490298c8
commit
c30ac8e282
|
|
@ -190,7 +190,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("enable", true, "Enable", "", new List<Param.CollapseParam>()
|
new Param("enable", true, "Enable", "", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "main", "side", "speed", "endSpeed", "ease" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "main", "side", "speed", "endSpeed", "ease" })
|
||||||
}),
|
}),
|
||||||
new Param("main", new EntityTypes.Integer(0, 300, 50), "Main Trees", "How many trees per second?"),
|
new Param("main", new EntityTypes.Integer(0, 300, 50), "Main Trees", "How many trees per second?"),
|
||||||
new Param("side", new EntityTypes.Integer(0, 100, 30), "Side Trees", "How many trees per second?"),
|
new Param("side", new EntityTypes.Integer(0, 100, 30), "Side Trees", "How many trees per second?"),
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("silent", false, "Mute Audio", "Whether the piano notes should be muted or not.", new List<Param.CollapseParam>()
|
new Param("silent", false, "Mute Audio", "Whether the piano notes should be muted or not.", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => !(bool)x, new string[] { "note1", "note2", "note3", "note4", "note5", "note6"})
|
new Param.CollapseParam((x, _) => !(bool)x, new string[] { "note1", "note2", "note3", "note4", "note5", "note6"})
|
||||||
}),
|
}),
|
||||||
new Param("note1", new EntityTypes.Integer(-24, 24, 0), "1st note", "The number of semitones up or down this note should be pitched"),
|
new Param("note1", new EntityTypes.Integer(-24, 24, 0), "1st note", "The number of semitones up or down this note should be pitched"),
|
||||||
new Param("note2", new EntityTypes.Integer(-24, 24, 2), "2nd note", "The number of semitones up or down this note should be pitched"),
|
new Param("note2", new EntityTypes.Integer(-24, 24, 2), "2nd note", "The number of semitones up or down this note should be pitched"),
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
new Param("side", CatchyTune.Side.Left, "Side", "The side the orange falls down"),
|
new Param("side", CatchyTune.Side.Left, "Side", "The side the orange falls down"),
|
||||||
new Param("smile", false, "Smile", "If the characters smile with the heart message after catching", new List<Param.CollapseParam>()
|
new Param("smile", false, "Smile", "If the characters smile with the heart message after catching", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "endSmile" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "endSmile" })
|
||||||
}),
|
}),
|
||||||
new Param("endSmile", new EntityTypes.Float(2, 100, 2), "End Smile Beat", "How many beats after the catch should the smile end?")
|
new Param("endSmile", new EntityTypes.Float(2, 100, 2), "End Smile Beat", "How many beats after the catch should the smile end?")
|
||||||
},
|
},
|
||||||
|
|
@ -37,7 +37,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
new Param("side", CatchyTune.Side.Left, "Side", "The side the pineapple falls down"),
|
new Param("side", CatchyTune.Side.Left, "Side", "The side the pineapple falls down"),
|
||||||
new Param("smile", false, "Smile", "If the characters smile with the heart message after catching", new List<Param.CollapseParam>()
|
new Param("smile", false, "Smile", "If the characters smile with the heart message after catching", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "endSmile" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "endSmile" })
|
||||||
}),
|
}),
|
||||||
new Param("endSmile", new EntityTypes.Float(2, 100, 2), "End Smile Beat", "How many beats after the catch should the smile end?")
|
new Param("endSmile", new EntityTypes.Float(2, 100, 2), "End Smile Beat", "How many beats after the catch should the smile end?")
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
new Param("limit", new EntityTypes.Integer(1, 1000, 80), "Limit", "What is the limit for plants collected?"),
|
new Param("limit", new EntityTypes.Integer(1, 1000, 80), "Limit", "What is the limit for plants collected?"),
|
||||||
new Param("force", false, "Force Amount of Collected Plants", "", new List<Param.CollapseParam>()
|
new Param("force", false, "Force Amount of Collected Plants", "", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "forceAmount" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "forceAmount" })
|
||||||
}),
|
}),
|
||||||
new Param("forceAmount", new EntityTypes.Integer(0, 1000, 0), "Force Amount")
|
new Param("forceAmount", new EntityTypes.Integer(0, 1000, 0), "Force Amount")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("toggle", false, "Set All to Player", "Sets all Miis to the Player's Mii", new List<Param.CollapseParam>()
|
new Param("toggle", false, "Set All to Player", "Sets all Miis to the Player's Mii", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => !(bool)x, new string[] { "type", "type2", "type3" })
|
new Param.CollapseParam((x, _) => !(bool)x, new string[] { "type", "type2", "type3" })
|
||||||
}),
|
}),
|
||||||
new Param("type", DrummingPractice.MiiType.Random, "Player Mii", "The Mii that the player will control"),
|
new Param("type", DrummingPractice.MiiType.Random, "Player Mii", "The Mii that the player will control"),
|
||||||
new Param("type2", DrummingPractice.MiiType.Random, "Left Mii", "The Mii on the left"),
|
new Param("type2", DrummingPractice.MiiType.Random, "Left Mii", "The Mii on the left"),
|
||||||
|
|
|
||||||
|
|
@ -59,12 +59,12 @@ namespace HeavenStudio.Games.Loaders
|
||||||
new Param("uh", new EntityTypes.Integer(0, 3, 0), "Uh Count", "How many Uhs should Captain Tuck say after the flippers roll?"),
|
new Param("uh", new EntityTypes.Integer(0, 3, 0), "Uh Count", "How many Uhs should Captain Tuck say after the flippers roll?"),
|
||||||
new Param("appreciation", FlipperFlop.AppreciationType.None, "Appreciation", "Which appreciation line should Captain Tuck say?", new List<Param.CollapseParam>()
|
new Param("appreciation", FlipperFlop.AppreciationType.None, "Appreciation", "Which appreciation line should Captain Tuck say?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (int)x != (int)FlipperFlop.AppreciationType.None, new string[] { "heart" })
|
new Param.CollapseParam((x, _) => (int)x != (int)FlipperFlop.AppreciationType.None, new string[] { "heart" })
|
||||||
}),
|
}),
|
||||||
new Param("heart", false, "Hearts", "Should Captain Tuck blush and make hearts appear when he expresses his appreciation?"),
|
new Param("heart", false, "Hearts", "Should Captain Tuck blush and make hearts appear when he expresses his appreciation?"),
|
||||||
new Param("thatsIt", false, "That's it!", "Whether or not Captain Tuck should say -That's it!- on the final flipper roll.", new List<Param.CollapseParam>()
|
new Param("thatsIt", false, "That's it!", "Whether or not Captain Tuck should say -That's it!- on the final flipper roll.", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "barber" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "barber" })
|
||||||
}),
|
}),
|
||||||
new Param("barber", false, "Barbershop that's it variant", "Should captain tuck use the Barbershop remix variant of that's it?")
|
new Param("barber", false, "Barbershop that's it variant", "Should captain tuck use the Barbershop remix variant of that's it?")
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -14,17 +14,29 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new GameAction("flick", "Flick Food")
|
new GameAction("flick", "Flick Food")
|
||||||
{
|
{
|
||||||
function = delegate { var e = eventCaller.currentEntity; ForkLifter.instance.Flick(e.beat, e["type"]); },
|
function = delegate {
|
||||||
|
var e = eventCaller.currentEntity;
|
||||||
|
ForkLifter.instance.Flick(e.beat, e["type"]);
|
||||||
|
},
|
||||||
defaultLength = 3,
|
defaultLength = 3,
|
||||||
parameters = new List<Param>()
|
parameters = new List<Param>()
|
||||||
{
|
{
|
||||||
new Param("type", ForkLifter.FlickType.Pea, "Object", "The object to be flicked")
|
new Param("type", ForkLifter.FlickType.Pea, "Object", "The object to be flicked")
|
||||||
}
|
},
|
||||||
|
inactiveFunction = delegate {
|
||||||
|
var e = eventCaller.currentEntity;
|
||||||
|
ForkLifter.queuedFlicks.Add(e);
|
||||||
|
ForkLifter.instance.Flick(e.beat, e["type"]);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
new GameAction("prepare", "Prepare Hand")
|
new GameAction("prepare", "Prepare Hand")
|
||||||
{
|
{
|
||||||
function = delegate { ForkLifter.instance.ForkLifterHand.Prepare(); },
|
function = delegate { ForkLifter.instance.ForkLifterHand.Prepare(eventCaller.currentEntity["mute"]); },
|
||||||
defaultLength = 0.5f
|
defaultLength = 0.5f,
|
||||||
|
parameters = new List<Param>()
|
||||||
|
{
|
||||||
|
new Param("mute", false, "Mute Prepare")
|
||||||
|
}
|
||||||
},
|
},
|
||||||
new GameAction("gulp", "Swallow")
|
new GameAction("gulp", "Swallow")
|
||||||
{
|
{
|
||||||
|
|
@ -32,7 +44,6 @@ namespace HeavenStudio.Games.Loaders
|
||||||
},
|
},
|
||||||
new GameAction("sigh", "Sigh")
|
new GameAction("sigh", "Sigh")
|
||||||
{
|
{
|
||||||
|
|
||||||
function = delegate { SoundByte.PlayOneShot("games/forkLifter/sigh"); }
|
function = delegate { SoundByte.PlayOneShot("games/forkLifter/sigh"); }
|
||||||
},
|
},
|
||||||
new GameAction("color", "Background Color")
|
new GameAction("color", "Background Color")
|
||||||
|
|
@ -67,32 +78,6 @@ namespace HeavenStudio.Games.Loaders
|
||||||
},
|
},
|
||||||
resizable = true,
|
resizable = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
// These are still here for backwards-compatibility but are hidden in the editor
|
|
||||||
new GameAction("pea", "")
|
|
||||||
{
|
|
||||||
function = delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 0); },
|
|
||||||
defaultLength = 3,
|
|
||||||
hidden = true
|
|
||||||
},
|
|
||||||
new GameAction("topbun", "")
|
|
||||||
{
|
|
||||||
function = delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 1); },
|
|
||||||
defaultLength = 3,
|
|
||||||
hidden = true
|
|
||||||
},
|
|
||||||
new GameAction("burger", "")
|
|
||||||
{
|
|
||||||
function = delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 2); },
|
|
||||||
defaultLength = 3,
|
|
||||||
hidden = true
|
|
||||||
},
|
|
||||||
new GameAction("bottombun", "")
|
|
||||||
{
|
|
||||||
function = delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 3); },
|
|
||||||
defaultLength = 3,
|
|
||||||
hidden = true
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
new List<string>() {"rvl", "normal"},
|
new List<string>() {"rvl", "normal"},
|
||||||
"rvlfork", "en",
|
"rvlfork", "en",
|
||||||
|
|
@ -104,10 +89,12 @@ namespace HeavenStudio.Games.Loaders
|
||||||
|
|
||||||
namespace HeavenStudio.Games
|
namespace HeavenStudio.Games
|
||||||
{
|
{
|
||||||
|
using Jukebox;
|
||||||
using Scripts_ForkLifter;
|
using Scripts_ForkLifter;
|
||||||
|
|
||||||
public class ForkLifter : Minigame
|
public class ForkLifter : Minigame
|
||||||
{
|
{
|
||||||
|
public static List<RiqEntity> queuedFlicks = new();
|
||||||
|
|
||||||
public enum FlickType
|
public enum FlickType
|
||||||
{
|
{
|
||||||
|
|
@ -149,27 +136,46 @@ namespace HeavenStudio.Games
|
||||||
public override void OnGameSwitch(double beat)
|
public override void OnGameSwitch(double beat)
|
||||||
{
|
{
|
||||||
base.OnGameSwitch(beat);
|
base.OnGameSwitch(beat);
|
||||||
|
if (queuedFlicks.Count > 0) {
|
||||||
|
foreach (var flick in queuedFlicks) { FlickActive(flick.beat, flick["type"], beat - flick.beat); }
|
||||||
|
queuedFlicks.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
ForkLifterHand.allFlickEntities = GameManager.instance.Beatmap.Entities.FindAll(c => (c.datamodel == "forkLifter/flick") && (c.beat >= beat));
|
||||||
ForkLifterHand.CheckNextFlick();
|
ForkLifterHand.CheckNextFlick();
|
||||||
PersistColor(beat);
|
PersistColor(beat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void Bop(double beat, double length, bool doesBop, bool autoBop)
|
public void Bop(double beat, double length, bool doesBop, bool autoBop)
|
||||||
{
|
{
|
||||||
playerInstance.shouldBop = (autoBop || doesBop);
|
playerInstance.shouldBop = autoBop;
|
||||||
if (!autoBop && doesBop) {
|
if (doesBop)
|
||||||
BeatAction.New(this, new List<BeatAction.Action>() {
|
{
|
||||||
new BeatAction.Action(beat + length, delegate {
|
var actions = new List<BeatAction.Action>();
|
||||||
playerInstance.shouldBop = false;
|
for (int i = 0; i < length; i++) {
|
||||||
})
|
actions.Add(new(beat + i, delegate { playerInstance.SingleBop(); }));
|
||||||
});
|
}
|
||||||
|
BeatAction.New(playerInstance, actions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Flick(double beat, int type)
|
public void Flick(double beat, int type, double currentBeat = 0)
|
||||||
{
|
{
|
||||||
SoundByte.PlayOneShotGame("forkLifter/flick");
|
SoundByte.PlayOneShotGame("forkLifter/flick");
|
||||||
handAnim.Play("Hand_Flick", 0, 0);
|
handAnim.DoScaledAnimationFromBeatAsync("Hand_Flick", 0.5f, beat, currentBeat);
|
||||||
|
ForkLifterHand.currentFlickIndex++;
|
||||||
|
GameObject fo = Instantiate(flickedObject);
|
||||||
|
fo.transform.parent = flickedObject.transform.parent;
|
||||||
|
Pea pea = fo.GetComponent<Pea>();
|
||||||
|
pea.startBeat = beat;
|
||||||
|
pea.type = type;
|
||||||
|
fo.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FlickActive(double beat, int type, double currentBeat = 0)
|
||||||
|
{
|
||||||
|
SoundByte.PlayOneShotGame("forkLifter/flick");
|
||||||
|
handAnim.DoScaledAnimationFromBeatAsync("Hand_Flick", 0.5f, beat, currentBeat);
|
||||||
ForkLifterHand.currentFlickIndex++;
|
ForkLifterHand.currentFlickIndex++;
|
||||||
GameObject fo = Instantiate(flickedObject);
|
GameObject fo = Instantiate(flickedObject);
|
||||||
fo.transform.parent = flickedObject.transform.parent;
|
fo.transform.parent = flickedObject.transform.parent;
|
||||||
|
|
|
||||||
|
|
@ -15,57 +15,32 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
|
||||||
|
|
||||||
public Sprite[] fastSprites;
|
public Sprite[] fastSprites;
|
||||||
|
|
||||||
private List<RiqEntity> allFlickEntities = new List<RiqEntity>();
|
public List<RiqEntity> allFlickEntities = new List<RiqEntity>();
|
||||||
|
|
||||||
public int currentFlickIndex;
|
public int currentFlickIndex;
|
||||||
|
|
||||||
|
ForkLifter game;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
var flickEntities = EventCaller.GetAllInGameManagerList("forkLifter", new string[] { "flick" });
|
game = ForkLifter.instance;
|
||||||
List<RiqEntity> tempEvents = new List<RiqEntity>();
|
|
||||||
for (int i = 0; i < flickEntities.Count; i++)
|
|
||||||
{
|
|
||||||
if (flickEntities[i].beat >= Conductor.instance.songPositionInBeatsAsDouble)
|
|
||||||
{
|
|
||||||
tempEvents.Add(flickEntities[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
allFlickEntities = tempEvents;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CheckNextFlick()
|
public void CheckNextFlick()
|
||||||
{
|
{
|
||||||
if (allFlickEntities.Count > 0 && currentFlickIndex >= 0 && currentFlickIndex < allFlickEntities.Count)
|
if (allFlickEntities.Count > 0 && currentFlickIndex >= 0 && currentFlickIndex < allFlickEntities.Count)
|
||||||
{
|
{
|
||||||
switch (allFlickEntities[currentFlickIndex]["type"])
|
int nextType = allFlickEntities[currentFlickIndex]["type"];
|
||||||
{
|
game.peaPreview.sprite = game.peaSprites[nextType];
|
||||||
case (int)ForkLifter.FlickType.Pea:
|
fastSprite.sprite = fastSprites[nextType == (int)ForkLifter.FlickType.Burger ? 1 : 0];
|
||||||
ForkLifter.instance.peaPreview.sprite = ForkLifter.instance.peaSprites[0];
|
} else {
|
||||||
fastSprite.sprite = fastSprites[0];
|
game.peaPreview.sprite = null;
|
||||||
break;
|
|
||||||
case (int)ForkLifter.FlickType.TopBun:
|
|
||||||
ForkLifter.instance.peaPreview.sprite = ForkLifter.instance.peaSprites[1];
|
|
||||||
fastSprite.sprite = fastSprites[0];
|
|
||||||
break;
|
|
||||||
case (int)ForkLifter.FlickType.Burger:
|
|
||||||
ForkLifter.instance.peaPreview.sprite = ForkLifter.instance.peaSprites[2];
|
|
||||||
fastSprite.sprite = fastSprites[1];
|
|
||||||
break;
|
|
||||||
case (int)ForkLifter.FlickType.BottomBun:
|
|
||||||
ForkLifter.instance.peaPreview.sprite = ForkLifter.instance.peaSprites[3];
|
|
||||||
fastSprite.sprite = fastSprites[0];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ForkLifter.instance.peaPreview.sprite = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Prepare()
|
public void Prepare(bool mute)
|
||||||
{
|
{
|
||||||
SoundByte.PlayOneShotGame("forkLifter/flickPrepare");
|
if (!mute) SoundByte.PlayOneShotGame("forkLifter/flickPrepare");
|
||||||
GetComponent<Animator>().Play("Hand_Prepare", 0, 0);
|
GetComponent<Animator>().Play("Hand_Prepare", 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,10 +57,15 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
|
||||||
|
|
||||||
if (Conductor.instance.ReportBeat(ref lastReportedBeat) && anim.IsAnimationNotPlaying() && shouldBop)
|
if (Conductor.instance.ReportBeat(ref lastReportedBeat) && anim.IsAnimationNotPlaying() && shouldBop)
|
||||||
{
|
{
|
||||||
anim.DoScaledAnimationAsync("Player_Bop", 0.5f);
|
SingleBop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SingleBop()
|
||||||
|
{
|
||||||
|
anim.DoScaledAnimationAsync("Player_Bop", 0.5f);
|
||||||
|
}
|
||||||
|
|
||||||
public void Eat()
|
public void Eat()
|
||||||
{
|
{
|
||||||
if (currentEarlyPeasOnFork != 0 || currentPerfectPeasOnFork != 0 || currentLatePeasOnFork != 0)
|
if (currentEarlyPeasOnFork != 0 || currentPerfectPeasOnFork != 0 || currentLatePeasOnFork != 0)
|
||||||
|
|
|
||||||
|
|
@ -10,23 +10,22 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
|
||||||
{
|
{
|
||||||
public class Pea : MonoBehaviour
|
public class Pea : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public double startBeat;
|
||||||
|
public int type;
|
||||||
|
|
||||||
ForkLifter game;
|
ForkLifter game;
|
||||||
|
ForkLifterPlayer player;
|
||||||
private Animator anim;
|
private Animator anim;
|
||||||
|
|
||||||
public double startBeat;
|
|
||||||
|
|
||||||
public int type;
|
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
game = ForkLifter.instance;
|
game = ForkLifter.instance;
|
||||||
|
player = ForkLifterPlayer.instance;
|
||||||
anim = GetComponent<Animator>();
|
anim = GetComponent<Animator>();
|
||||||
|
|
||||||
// SCHEDULING zoom sound so it lines up with when it meets the fork.
|
var offset = SoundByte.GetClipLengthGame("forkLifter/zoomFast") - 0.03;
|
||||||
var currentDspTime = AudioSettings.dspTime;
|
SoundByte.PlayOneShotGame("forkLifter/zoomFast", startBeat + 2, offset: offset);
|
||||||
var cond = Conductor.instance;
|
|
||||||
var zoomStartTime = currentDspTime + (cond.pitchedSecPerBeatAsDouble * 2) - 0.317;
|
|
||||||
SoundByte.PlayOneShotScheduledGame("forkLifter/zoomFast", zoomStartTime);
|
|
||||||
|
|
||||||
GetComponentInChildren<SpriteRenderer>().sprite = game.peaSprites[type];
|
GetComponentInChildren<SpriteRenderer>().sprite = game.peaSprites[type];
|
||||||
|
|
||||||
|
|
@ -40,13 +39,13 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
|
||||||
|
|
||||||
public void Hit()
|
public void Hit()
|
||||||
{
|
{
|
||||||
ForkLifterPlayer.instance.Stab(this);
|
player.Stab(this);
|
||||||
|
|
||||||
if (ForkLifterPlayer.instance.currentPerfectPeasOnFork < 4)
|
if (player.currentPerfectPeasOnFork < 4)
|
||||||
{
|
{
|
||||||
GameObject pea = new GameObject();
|
GameObject pea = new GameObject();
|
||||||
|
|
||||||
pea.transform.parent = ForkLifterPlayer.instance.perfect.transform;
|
pea.transform.parent = player.perfect.transform;
|
||||||
pea.transform.localScale = Vector2.one;
|
pea.transform.localScale = Vector2.one;
|
||||||
pea.transform.localRotation = Quaternion.Euler(0, 0, 0);
|
pea.transform.localRotation = Quaternion.Euler(0, 0, 0);
|
||||||
|
|
||||||
|
|
@ -54,59 +53,42 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
|
||||||
|
|
||||||
float peaOffset = 0;
|
float peaOffset = 0;
|
||||||
|
|
||||||
if (ForkLifterPlayer.instance.currentPerfectPeasOnFork == 3) peaOffset = -0.15724f;
|
if (player.currentPerfectPeasOnFork == 3) peaOffset = -0.15724f;
|
||||||
|
|
||||||
for (int i = 0; i < ForkLifterPlayer.instance.perfect.transform.childCount; i++)
|
for (int i = 0; i < player.perfect.transform.childCount; i++)
|
||||||
{
|
{
|
||||||
ForkLifterPlayer.instance.perfect.transform.GetChild(i).transform.localPosition = new Vector3(0, (-1.67f - (0.15724f * i)) + 0.15724f * ForkLifterPlayer.instance.currentPerfectPeasOnFork + peaOffset);
|
player.perfect.transform.GetChild(i).transform.localPosition = new Vector3(0, (-1.67f - (0.15724f * i)) + 0.15724f * player.currentPerfectPeasOnFork + peaOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
SpriteRenderer psprite = pea.AddComponent<SpriteRenderer>();
|
SpriteRenderer psprite = pea.AddComponent<SpriteRenderer>();
|
||||||
|
|
||||||
psprite.sprite = game.peaHitSprites[type];
|
psprite.sprite = game.peaHitSprites[type];
|
||||||
psprite.sortingOrder = 20;
|
psprite.sortingOrder = type switch {
|
||||||
switch (type)
|
0 => 101,
|
||||||
{
|
1 => 104,
|
||||||
case 0:
|
2 => 103,
|
||||||
psprite.sortingOrder = 101;
|
3 => 102,
|
||||||
break;
|
_ => 20,
|
||||||
case 1:
|
};
|
||||||
psprite.sortingOrder = 104;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
psprite.sortingOrder = 103;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
psprite.sortingOrder = 102;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GameObject hitFXo = new GameObject();
|
GameObject hitFXo = new GameObject();
|
||||||
hitFXo.transform.localPosition = new Vector3(1.9969f, -3.7026f);
|
hitFXo.transform.localPosition = new Vector3(1.9969f, -3.7026f);
|
||||||
hitFXo.transform.localScale = new Vector3(3.142196f, 3.142196f);
|
hitFXo.transform.localScale = new Vector3(3.142196f, 3.142196f);
|
||||||
SpriteRenderer hfxs = hitFXo.AddComponent<SpriteRenderer>();
|
SpriteRenderer hfxs = hitFXo.AddComponent<SpriteRenderer>();
|
||||||
hfxs.sprite = ForkLifterPlayer.instance.hitFX;
|
hfxs.sprite = player.hitFX;
|
||||||
hfxs.sortingOrder = 100;
|
hfxs.sortingOrder = 100;
|
||||||
hfxs.DOColor(new Color(1, 1, 1, 0), 0.05f).OnComplete(delegate { Destroy(hitFXo); });
|
hfxs.DOColor(new Color(1, 1, 1, 0), 0.05f).OnComplete(delegate { Destroy(hitFXo); });
|
||||||
|
|
||||||
ForkLifterPlayer.instance.FastEffectHit(type);
|
player.FastEffectHit(type);
|
||||||
|
|
||||||
SoundByte.PlayOneShotGame("forkLifter/stab");
|
SoundByte.PlayOneShotGame("forkLifter/stab");
|
||||||
|
|
||||||
ForkLifterPlayer.instance.currentPerfectPeasOnFork++;
|
player.currentPerfectPeasOnFork++;
|
||||||
|
|
||||||
if (type == 1)
|
player.topbun = type == 1;
|
||||||
{
|
player.middleburger = type == 2;
|
||||||
ForkLifterPlayer.instance.topbun = true;
|
player.bottombun = type == 3;
|
||||||
}
|
|
||||||
else if (type == 2)
|
|
||||||
{
|
|
||||||
ForkLifterPlayer.instance.middleburger = true;
|
|
||||||
}
|
|
||||||
else if (type == 3)
|
|
||||||
{
|
|
||||||
ForkLifterPlayer.instance.bottombun = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Destroy(this.gameObject);
|
Destroy(this.gameObject);
|
||||||
}
|
}
|
||||||
|
|
@ -115,30 +97,30 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
|
||||||
{
|
{
|
||||||
GameObject pea = new GameObject();
|
GameObject pea = new GameObject();
|
||||||
|
|
||||||
pea.transform.parent = ForkLifterPlayer.instance.early.transform;
|
pea.transform.parent = player.early.transform;
|
||||||
pea.transform.localScale = Vector2.one;
|
pea.transform.localScale = Vector2.one;
|
||||||
|
|
||||||
pea.transform.localPosition = Vector3.zero;
|
pea.transform.localPosition = Vector3.zero;
|
||||||
pea.transform.localRotation = Quaternion.Euler(0, 0, 90);
|
pea.transform.localRotation = Quaternion.Euler(0, 0, 90);
|
||||||
|
|
||||||
for (int i = 0; i < ForkLifterPlayer.instance.early.transform.childCount; i++)
|
for (int i = 0; i < player.early.transform.childCount; i++)
|
||||||
{
|
{
|
||||||
ForkLifterPlayer.instance.early.transform.GetChild(i).transform.localPosition = new Vector3(0, (-1.67f - (0.15724f * i)) + 0.15724f * ForkLifterPlayer.instance.currentEarlyPeasOnFork);
|
player.early.transform.GetChild(i).transform.localPosition = new Vector3(0, (-1.67f - (0.15724f * i)) + 0.15724f * player.currentEarlyPeasOnFork);
|
||||||
}
|
}
|
||||||
|
|
||||||
SpriteRenderer psprite = pea.AddComponent<SpriteRenderer>();
|
SpriteRenderer psprite = pea.AddComponent<SpriteRenderer>();
|
||||||
psprite.sprite = game.peaHitSprites[type];
|
psprite.sprite = game.peaHitSprites[type];
|
||||||
psprite.sortingOrder = 20;
|
psprite.sortingOrder = 20;
|
||||||
ForkLifterPlayer.instance.HitFXMiss(new Vector2(1.0424f, -4.032f), new Vector2(1.129612f, 1.129612f));
|
player.HitFXMiss(new Vector2(1.0424f, -4.032f), new Vector2(1.129612f, 1.129612f));
|
||||||
ForkLifterPlayer.instance.HitFXMiss(new Vector2(0.771f, -3.016f), new Vector2(1.71701f, 1.71701f));
|
player.HitFXMiss(new Vector2(0.771f, -3.016f), new Vector2(1.71701f, 1.71701f));
|
||||||
ForkLifterPlayer.instance.HitFXMiss(new Vector2(2.598f, -2.956f), new Vector2(1.576043f, 1.576043f));
|
player.HitFXMiss(new Vector2(2.598f, -2.956f), new Vector2(1.576043f, 1.576043f));
|
||||||
ForkLifterPlayer.instance.HitFXMiss(new Vector2(2.551f, -3.609f), new Vector2(1.200788f, 1.200788f));
|
player.HitFXMiss(new Vector2(2.551f, -3.609f), new Vector2(1.200788f, 1.200788f));
|
||||||
|
|
||||||
ForkLifterPlayer.instance.FastEffectHit(type);
|
player.FastEffectHit(type);
|
||||||
|
|
||||||
SoundByte.PlayOneShot("miss");
|
SoundByte.PlayOneShot("miss");
|
||||||
|
|
||||||
ForkLifterPlayer.instance.currentEarlyPeasOnFork++;
|
player.currentEarlyPeasOnFork++;
|
||||||
|
|
||||||
Destroy(this.gameObject);
|
Destroy(this.gameObject);
|
||||||
}
|
}
|
||||||
|
|
@ -146,30 +128,30 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
|
||||||
public void Late()
|
public void Late()
|
||||||
{
|
{
|
||||||
GameObject pea = new GameObject();
|
GameObject pea = new GameObject();
|
||||||
pea.transform.parent = ForkLifterPlayer.instance.late.transform;
|
pea.transform.parent = player.late.transform;
|
||||||
pea.transform.localScale = Vector2.one;
|
pea.transform.localScale = Vector2.one;
|
||||||
|
|
||||||
pea.transform.localPosition = Vector3.zero;
|
pea.transform.localPosition = Vector3.zero;
|
||||||
pea.transform.localRotation = Quaternion.Euler(0, 0, 90);
|
pea.transform.localRotation = Quaternion.Euler(0, 0, 90);
|
||||||
|
|
||||||
for (int i = 0; i < ForkLifterPlayer.instance.late.transform.childCount; i++)
|
for (int i = 0; i < player.late.transform.childCount; i++)
|
||||||
{
|
{
|
||||||
ForkLifterPlayer.instance.late.transform.GetChild(i).transform.localPosition = new Vector3(0, (-1.67f - (0.15724f * i)) + 0.15724f * ForkLifterPlayer.instance.currentLatePeasOnFork);
|
player.late.transform.GetChild(i).transform.localPosition = new Vector3(0, (-1.67f - (0.15724f * i)) + 0.15724f * player.currentLatePeasOnFork);
|
||||||
}
|
}
|
||||||
|
|
||||||
SpriteRenderer psprite = pea.AddComponent<SpriteRenderer>();
|
SpriteRenderer psprite = pea.AddComponent<SpriteRenderer>();
|
||||||
psprite.sprite = game.peaHitSprites[type];
|
psprite.sprite = game.peaHitSprites[type];
|
||||||
psprite.sortingOrder = 20;
|
psprite.sortingOrder = 20;
|
||||||
ForkLifterPlayer.instance.HitFXMiss(new Vector2(1.0424f, -4.032f), new Vector2(1.129612f, 1.129612f));
|
player.HitFXMiss(new Vector2(1.0424f, -4.032f), new Vector2(1.129612f, 1.129612f));
|
||||||
ForkLifterPlayer.instance.HitFXMiss(new Vector2(0.771f, -3.016f), new Vector2(1.71701f, 1.71701f));
|
player.HitFXMiss(new Vector2(0.771f, -3.016f), new Vector2(1.71701f, 1.71701f));
|
||||||
ForkLifterPlayer.instance.HitFXMiss(new Vector2(2.598f, -2.956f), new Vector2(1.576043f, 1.576043f));
|
player.HitFXMiss(new Vector2(2.598f, -2.956f), new Vector2(1.576043f, 1.576043f));
|
||||||
ForkLifterPlayer.instance.HitFXMiss(new Vector2(2.551f, -3.609f), new Vector2(1.200788f, 1.200788f));
|
player.HitFXMiss(new Vector2(2.551f, -3.609f), new Vector2(1.200788f, 1.200788f));
|
||||||
|
|
||||||
ForkLifterPlayer.instance.FastEffectHit(type);
|
player.FastEffectHit(type);
|
||||||
|
|
||||||
SoundByte.PlayOneShot("miss");
|
SoundByte.PlayOneShot("miss");
|
||||||
|
|
||||||
ForkLifterPlayer.instance.currentLatePeasOnFork++;
|
player.currentLatePeasOnFork++;
|
||||||
Destroy(this.gameObject);
|
Destroy(this.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -182,16 +164,11 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
|
||||||
|
|
||||||
private void Just(PlayerActionEvent caller, float state)
|
private void Just(PlayerActionEvent caller, float state)
|
||||||
{
|
{
|
||||||
if (state >= 1f)
|
if (state >= 1f) {
|
||||||
{
|
|
||||||
Late();
|
Late();
|
||||||
}
|
} else if (state <= -1f) {
|
||||||
else if (state <= -1f)
|
|
||||||
{
|
|
||||||
Early();
|
Early();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
Hit();
|
Hit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
new Param("close", GleeClub.MouthOpenClose.Both, "Close/Open Mouth", "Should the chorus kids close/open their mouth?"),
|
new Param("close", GleeClub.MouthOpenClose.Both, "Close/Open Mouth", "Should the chorus kids close/open their mouth?"),
|
||||||
new Param("repeat", false, "Repeating", "Should the left and middle chorus kid repeat this singing cue?", new List<Param.CollapseParam>()
|
new Param("repeat", false, "Repeating", "Should the left and middle chorus kid repeat this singing cue?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "semiTonesLeft2", "semiTonesLeft3", "semiTonesMiddle2" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "semiTonesLeft2", "semiTonesLeft3", "semiTonesMiddle2" })
|
||||||
}),
|
}),
|
||||||
new Param("semiTonesLeft2", new EntityTypes.Integer(-24, 24, 0), "Semitones (Repeat Left First)", "The number of semitones up or down this note should be pitched"),
|
new Param("semiTonesLeft2", new EntityTypes.Integer(-24, 24, 0), "Semitones (Repeat Left First)", "The number of semitones up or down this note should be pitched"),
|
||||||
new Param("semiTonesLeft3", new EntityTypes.Integer(-24, 24, 0), "Semitones (Repeat Left Last)", "The number of semitones up or down this note should be pitched"),
|
new Param("semiTonesLeft3", new EntityTypes.Integer(-24, 24, 0), "Semitones (Repeat Left Last)", "The number of semitones up or down this note should be pitched"),
|
||||||
|
|
|
||||||
|
|
@ -143,14 +143,14 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("type", KarateMan.LightBulbType.Normal, "Type", "The preset bulb type. Yellow is used for kicks while Blue is used for combos", new List<Param.CollapseParam>()
|
new Param("type", KarateMan.LightBulbType.Normal, "Type", "The preset bulb type. Yellow is used for kicks while Blue is used for combos", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (int)x == (int)KarateMan.LightBulbType.Custom, new string[] { "colorA" })
|
new Param.CollapseParam((x, _) => (int)x == (int)KarateMan.LightBulbType.Custom, new string[] { "colorA" })
|
||||||
}),
|
}),
|
||||||
new Param("colorA", new Color(1f,1f,1f), "Custom Color", "The color to use when the bulb type is set to Custom"),
|
new Param("colorA", new Color(1f,1f,1f), "Custom Color", "The color to use when the bulb type is set to Custom"),
|
||||||
new Param("type2", KarateMan.KarateManFaces.Normal, "Success Expression", "The facial expression to set Joe to on hit"),
|
new Param("type2", KarateMan.KarateManFaces.Normal, "Success Expression", "The facial expression to set Joe to on hit"),
|
||||||
new Param("mute", false, "Mute", "Should the throwing sound be muted?"),
|
new Param("mute", false, "Mute", "Should the throwing sound be muted?"),
|
||||||
new Param("sfx", KarateMan.LightBulbSfx.Automatic, "SFX", "What type of SFX to use for the bulb?", new List<Param.CollapseParam>()
|
new Param("sfx", KarateMan.LightBulbSfx.Automatic, "SFX", "What type of SFX to use for the bulb?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (int)x == (int)KarateMan.LightBulbSfx.Custom, new string[] { "throwSfx", "hitSfx" }),
|
new Param.CollapseParam((x, _) => (int)x == (int)KarateMan.LightBulbSfx.Custom, new string[] { "throwSfx", "hitSfx" }),
|
||||||
}),
|
}),
|
||||||
new Param("throwSfx", "lightbulbOut", "Throw SFX", "Custom throw SFX to use for the bulb"),
|
new Param("throwSfx", "lightbulbOut", "Throw SFX", "Custom throw SFX to use for the bulb"),
|
||||||
new Param("hitSfx", "lightbulbHit", "Hit SFX", "Custom hit SFX to use for the bulb"),
|
new Param("hitSfx", "lightbulbHit", "Hit SFX", "Custom hit SFX to use for the bulb"),
|
||||||
|
|
@ -176,7 +176,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
new Param("type", KarateMan.KarateManFaces.Smirk, "Success Expression", "The facial expression to set Joe to on hit"),
|
new Param("type", KarateMan.KarateManFaces.Smirk, "Success Expression", "The facial expression to set Joe to on hit"),
|
||||||
new Param("pitchVoice", false, "Pitch Voice", "Pitch the voice of this cue?", new List<Param.CollapseParam>()
|
new Param("pitchVoice", false, "Pitch Voice", "Pitch the voice of this cue?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "forcePitch" }),
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "forcePitch" }),
|
||||||
}),
|
}),
|
||||||
new Param("forcePitch", new EntityTypes.Float(0.5f, 2f, 1f), "Force Pitch", "Override the automatic pitching if not set to 1"),
|
new Param("forcePitch", new EntityTypes.Float(0.5f, 2f, 1f), "Force Pitch", "Override the automatic pitching if not set to 1"),
|
||||||
new Param("cutOut", true, "Cut Out Voice", "Will this cue be cut out by another voice?"),
|
new Param("cutOut", true, "Cut Out Voice", "Will this cue be cut out by another voice?"),
|
||||||
|
|
@ -203,7 +203,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
new Param("type", KarateMan.KarateManFaces.Happy, "Success Expression", "The facial expression to set Joe to on hit"),
|
new Param("type", KarateMan.KarateManFaces.Happy, "Success Expression", "The facial expression to set Joe to on hit"),
|
||||||
new Param("pitchVoice", false, "Pitch Voice", "Pitch the voice of this cue?", new List<Param.CollapseParam>()
|
new Param("pitchVoice", false, "Pitch Voice", "Pitch the voice of this cue?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "forcePitch" }),
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "forcePitch" }),
|
||||||
}),
|
}),
|
||||||
new Param("forcePitch", new EntityTypes.Float(0.5f, 2f, 1f), "Force Pitch", "Override the automatic pitching if not set to 1"),
|
new Param("forcePitch", new EntityTypes.Float(0.5f, 2f, 1f), "Force Pitch", "Override the automatic pitching if not set to 1"),
|
||||||
new Param("cutOut", true, "Cut Out Voice", "Will this cue be cut out by another voice?"),
|
new Param("cutOut", true, "Cut Out Voice", "Will this cue be cut out by another voice?"),
|
||||||
|
|
@ -221,11 +221,11 @@ namespace HeavenStudio.Games.Loaders
|
||||||
parameters = new List<Param>()
|
parameters = new List<Param>()
|
||||||
{
|
{
|
||||||
new Param("whichWarning", KarateMan.HitThree.HitThree, "Which Warning", "The warning text to show and the sfx to play"),
|
new Param("whichWarning", KarateMan.HitThree.HitThree, "Which Warning", "The warning text to show and the sfx to play"),
|
||||||
new Param("pitchVoice", false, "Pitch Voice", "Pitch the voice of this cue?", new List<Param.CollapseParam>()
|
new Param("pitchVoice", false, "Auto Pitch Voice", "Pitch the voice of this cue depending on the BPM", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "forcePitch" }),
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "forcePitch" }),
|
||||||
}),
|
}),
|
||||||
new Param("forcePitch", new EntityTypes.Float(0.5f, 2f, 1f), "Force Pitch", "Override the automatic pitching if not set to 1"),
|
new Param("forcePitch", new EntityTypes.Float(0.5f, 2f, 1f), "Force Pitch", "Pitch the voice of this cue depending on the value"),
|
||||||
new Param("customLength", false, "Custom Length", "Have the warning text appear for the length of the block"),
|
new Param("customLength", false, "Custom Length", "Have the warning text appear for the length of the block"),
|
||||||
new Param("cutOut", true, "Cut Out Voice", "Will this cue be cut out by another voice?"),
|
new Param("cutOut", true, "Cut Out Voice", "Will this cue be cut out by another voice?"),
|
||||||
},
|
},
|
||||||
|
|
@ -259,7 +259,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
new Param("fxType", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed"),
|
new Param("fxType", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed"),
|
||||||
new Param("type", KarateMan.NoriMode.None, "Flow Bar type", "The type of Flow bar to use", new List<Param.CollapseParam>()
|
new Param("type", KarateMan.NoriMode.None, "Flow Bar type", "The type of Flow bar to use", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (int)x != (int)KarateMan.NoriMode.None, new string[] { "startColor" })
|
new Param.CollapseParam((x, _) => (int)x != (int)KarateMan.NoriMode.None, new string[] { "startColor" })
|
||||||
}),
|
}),
|
||||||
new Param("hitsPerHeart", new EntityTypes.Float(0f, 20f, 0f), "Hits Per Heart", "How many hits will it take for each heart to light up? (0 will do it automatically.)"),
|
new Param("hitsPerHeart", new EntityTypes.Float(0f, 20f, 0f), "Hits Per Heart", "How many hits will it take for each heart to light up? (0 will do it automatically.)"),
|
||||||
new Param("toggle", true, "Enable Combos", "Allow the player to combo? (Contextual combos will still be allowed even when off)"),
|
new Param("toggle", true, "Enable Combos", "Allow the player to combo? (Contextual combos will still be allowed even when off)"),
|
||||||
|
|
@ -285,34 +285,41 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("presetBg", KarateMan.BackgroundType.Yellow, "Preset BG Color", "The preset background type (will by default fade from the existing background color)", new List<Param.CollapseParam>()
|
new Param("presetBg", KarateMan.BackgroundType.Yellow, "Preset BG Color", "The preset background type (will by default fade from the existing background color)", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (int)x == (int)KarateMan.BackgroundType.Custom, new string[] { "startColor", "endColor" })
|
new Param.CollapseParam((x, y) => {
|
||||||
|
Debug.Log(y["endColor"]);
|
||||||
|
RiqEntity bg = GameManager.instance.Beatmap.Entities.FindLast(c => c.beat <= y.beat && c.datamodel == "karateman/background appearance");
|
||||||
|
y["startColor"] = bg["endColor"];
|
||||||
|
y["endColor"] = KarateMan.BackgroundColors[(int)x];
|
||||||
|
Debug.Log(y["endColor"]);
|
||||||
|
return true;
|
||||||
|
}, new string[] { /* "startColor", "endColor" */ "presetBg" })
|
||||||
}),
|
}),
|
||||||
new Param("startColor", new Color(0.985f, 0.79f, 0.243f), "Start BG Color", "The background color to start with"),
|
new Param("startColor", new Color(0.985f, 0.79f, 0.243f), "Start BG Color", "The background color to start with"),
|
||||||
new Param("endColor", new Color(0.985f, 0.79f, 0.243f), "End BG Color", "The background color to end with"),
|
new Param("endColor", new Color(0.985f, 0.79f, 0.243f), "End BG Color", "The background color to end with"),
|
||||||
new Param("ease", Util.EasingFunction.Ease.Instant, "BG Color Ease", "Ease to use when fading color", new List<Param.CollapseParam>()
|
new Param("ease", Util.EasingFunction.Ease.Instant, "BG Color Ease", "Ease to use when fading color", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
//new Param.CollapseParam(x => (int)x != (int)Util.EasingFunction.Ease.Instant, new string[] { "startColor" })
|
new Param.CollapseParam((x, _) => (int)x != (int)Util.EasingFunction.Ease.Instant, new string[] { "startColor" })
|
||||||
}),
|
}),
|
||||||
new Param("shadowType", KarateMan.ShadowType.Tinted, "Shadow Type", "The shadow type. If Tinted doesn't work with your background color try Custom", new List<Param.CollapseParam>()
|
new Param("shadowType", KarateMan.ShadowType.Tinted, "Shadow Type", "The shadow type. If Tinted doesn't work with your background color try Custom", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (int)x == (int)KarateMan.ShadowType.Custom, new string[] { "shadowStart", "shadowEnd" }),
|
new Param.CollapseParam((x, _) => (int)x == (int)KarateMan.ShadowType.Custom, new string[] { "shadowStart", "shadowEnd" }),
|
||||||
}),
|
}),
|
||||||
new Param("shadowStart", new Color(), "Start Shadow Color", "The shadow color to start with"),
|
new Param("shadowStart", new Color(), "Start Shadow Color", "The shadow color to start with"),
|
||||||
new Param("shadowEnd", new Color(), "End Shadow Color", "The shadow color to end with"),
|
new Param("shadowEnd", new Color(), "End Shadow Color", "The shadow color to end with"),
|
||||||
|
|
||||||
new Param("textureType", KarateMan.BackgroundTextureType.Plain, "Texture", "The type of background texture to use", new List<Param.CollapseParam>()
|
new Param("textureType", KarateMan.BackgroundTextureType.Plain, "Texture", "The type of background texture to use", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (int)x != (int)KarateMan.BackgroundTextureType.Plain, new string[] { "startTexture", "endTexture" })
|
new Param.CollapseParam((x, _) => (int)x != (int)KarateMan.BackgroundTextureType.Plain, new string[] { "startTexture", "endTexture" })
|
||||||
}),
|
}),
|
||||||
new Param("autoColor", true, "Use BG Color For Texture", "Use a tint of the background color for the texture?", new List<Param.CollapseParam>()
|
new Param("autoColor", true, "Use BG Color For Texture", "Use a tint of the background color for the texture?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
//new Param.CollapseParam(x => (int)x != (int)KarateMan.ShadowType.Tinted, new string[] { "startTexture", "endTexture" })
|
new Param.CollapseParam((x, _) => !(bool)x, new string[] { "startTexture", "endTexture" })
|
||||||
}),
|
}),
|
||||||
new Param("startTexture", new Color(), "Start Texture Color", "The texture color to start with"),
|
new Param("startTexture", new Color(), "Start Texture Color", "The texture color to start with"),
|
||||||
new Param("endTexture", new Color(), "End Texture Color", "The texture color to end with"),
|
new Param("endTexture", new Color(), "End Texture Color", "The texture color to end with"),
|
||||||
new Param("fxType", new EntityTypes.Integer(0, 3, 3), "Check Tooltip", "Ping @AstrlJelly on discord if you see this; it should be hidden.", new List<Param.CollapseParam>()
|
new Param("fxType", new EntityTypes.Integer(0, 3, 3), "Check Tooltip", "Ping @AstrlJelly on discord if you see this; it should be hidden.", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => false, new string[] { "fxType" })
|
new Param.CollapseParam((x, _) => false, new string[] { "fxType" })
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -532,7 +539,7 @@ namespace HeavenStudio.Games
|
||||||
public float NoriPerformance { get { if (IsNoriActive) return Nori.Nori / Nori.MaxNori; else return 1f; } }
|
public float NoriPerformance { get { if (IsNoriActive) return Nori.Nori / Nori.MaxNori; else return 1f; } }
|
||||||
|
|
||||||
public Color[] LightBulbColors;
|
public Color[] LightBulbColors;
|
||||||
public Color[] BackgroundColors;
|
public static Color[] BackgroundColors;
|
||||||
|
|
||||||
//camera positions (normal, special)
|
//camera positions (normal, special)
|
||||||
[Header("Camera Positions")]
|
[Header("Camera Positions")]
|
||||||
|
|
@ -783,7 +790,7 @@ namespace HeavenStudio.Games
|
||||||
Word.Play(DoWordSound(beat, length, type, pitchVoice, forcePitch, customLength, doSound));
|
Word.Play(DoWordSound(beat, length, type, pitchVoice, forcePitch, customLength, doSound));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string DoWordSound(double beat, double length, int type, bool pitchVoice = false, float forcePitch = 1, bool customLength = false, bool doSound = true)
|
public static string DoWordSound(double beat, double length, int type, bool bpmPitch = false, float forcePitch = 1, bool customLength = false, bool doSound = true)
|
||||||
{
|
{
|
||||||
double clear = type switch {
|
double clear = type switch {
|
||||||
<= (int)HitThree.HitFour => beat + 4f,
|
<= (int)HitThree.HitFour => beat + 4f,
|
||||||
|
|
@ -799,9 +806,7 @@ namespace HeavenStudio.Games
|
||||||
new MultiSound.Sound($"karateman/{(type == (int)HitThree.HitThreeAlt ? "hitAlt" : "hit")}", beat + 0.5f, offset: 0.042f),
|
new MultiSound.Sound($"karateman/{(type == (int)HitThree.HitThreeAlt ? "hitAlt" : "hit")}", beat + 0.5f, offset: 0.042f),
|
||||||
new MultiSound.Sound($"karateman/{number}", beat + 1f),
|
new MultiSound.Sound($"karateman/{number}", beat + 1f),
|
||||||
};
|
};
|
||||||
if (pitchVoice) {
|
Array.ForEach(sounds, x => x.pitch = bpmPitch ? Conductor.instance.GetBpmAtBeat(x.beat) / 125 : forcePitch);
|
||||||
Array.ForEach(sounds, x => x.pitch = (forcePitch == 1) ? Conductor.instance.GetBpmAtBeat(x.beat) / 125 : forcePitch);
|
|
||||||
}
|
|
||||||
MultiSound.Play(sounds, forcePlay: true);
|
MultiSound.Play(sounds, forcePlay: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -891,7 +896,7 @@ namespace HeavenStudio.Games
|
||||||
SoundByte.PlayOneShotGame("karateman/barrelOutCombos", forcePlay: true);
|
SoundByte.PlayOneShotGame("karateman/barrelOutCombos", forcePlay: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Combo(double beat, int expression, bool pitchVoice, float forcePitch, bool cutOut, bool noVoice)
|
public void Combo(double beat, int expression, bool bpmPitch, float forcePitch, bool cutOut, bool noVoice)
|
||||||
{
|
{
|
||||||
int comboId = KarateManPot.GetNewCombo();
|
int comboId = KarateManPot.GetNewCombo();
|
||||||
|
|
||||||
|
|
@ -916,10 +921,6 @@ namespace HeavenStudio.Games
|
||||||
new MultiSound.Sound("karateman/pow", beat + 2.5f)
|
new MultiSound.Sound("karateman/pow", beat + 2.5f)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (pitchVoice) {
|
|
||||||
sounds.ForEach(x => x.pitch = (forcePitch == 1) ? Conductor.instance.GetBpmAtBeat(x.beat) / 125 : forcePitch);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (voiceEntities.Count > 0 && cutOut)
|
if (voiceEntities.Count > 0 && cutOut)
|
||||||
{
|
{
|
||||||
RiqEntity firstVoice = voiceEntities.Find(x => x.beat >= beat + 1);
|
RiqEntity firstVoice = voiceEntities.Find(x => x.beat >= beat + 1);
|
||||||
|
|
@ -928,6 +929,8 @@ namespace HeavenStudio.Games
|
||||||
if (firstHitVoice != null) sounds.RemoveAll(x => x.beat > firstHitVoice.beat - 0.5);
|
if (firstHitVoice != null) sounds.RemoveAll(x => x.beat > firstHitVoice.beat - 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sounds.ForEach(x => x.pitch = bpmPitch ? Conductor.instance.GetBpmAtBeat(x.beat) / 125 : forcePitch);
|
||||||
|
|
||||||
MultiSound.Play(sounds.ToArray(), forcePlay: true);
|
MultiSound.Play(sounds.ToArray(), forcePlay: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -936,7 +939,7 @@ namespace HeavenStudio.Games
|
||||||
SoundByte.PlayOneShotGame("karateman/barrelOutKicks", forcePlay: true);
|
SoundByte.PlayOneShotGame("karateman/barrelOutKicks", forcePlay: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Kick(double beat, bool ball, bool glow, int expression, bool pitchVoice, float forcePitch, bool cutOut, bool noVoice, Color woodColor, Color hoopColor)
|
public void Kick(double beat, bool ball, bool glow, int expression, bool bpmPitch, float forcePitch, bool cutOut, bool noVoice, Color woodColor, Color hoopColor)
|
||||||
{
|
{
|
||||||
var barrel = CreateItemInstance(beat, "Item05", expression, KarateManPot.ItemType.KickBarrel, content: ball, shouldGlow: glow);
|
var barrel = CreateItemInstance(beat, "Item05", expression, KarateManPot.ItemType.KickBarrel, content: ball, shouldGlow: glow);
|
||||||
// red : new Color(0.451f, 0.302f, 0.271f)
|
// red : new Color(0.451f, 0.302f, 0.271f)
|
||||||
|
|
@ -954,10 +957,6 @@ namespace HeavenStudio.Games
|
||||||
new MultiSound.Sound("karateman/punchKick4", beat + 2.5f),
|
new MultiSound.Sound("karateman/punchKick4", beat + 2.5f),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (pitchVoice) {
|
|
||||||
sounds.ForEach(x => x.pitch = (forcePitch == 1) ? Conductor.instance.GetBpmAtBeat(x.beat) / 125 : forcePitch);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (voiceEntities.Count > 0 && cutOut)
|
if (voiceEntities.Count > 0 && cutOut)
|
||||||
{
|
{
|
||||||
RiqEntity firstVoice = voiceEntities.Find(x => x.beat >= beat + 1);
|
RiqEntity firstVoice = voiceEntities.Find(x => x.beat >= beat + 1);
|
||||||
|
|
@ -966,6 +965,8 @@ namespace HeavenStudio.Games
|
||||||
if (firstHitVoice != null) sounds.RemoveAll(x => x.beat > firstHitVoice.beat);
|
if (firstHitVoice != null) sounds.RemoveAll(x => x.beat > firstHitVoice.beat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sounds.ForEach(x => x.pitch = bpmPitch ? Conductor.instance.GetBpmAtBeat(x.beat) / 125 : forcePitch);
|
||||||
|
|
||||||
MultiSound.Play(sounds.ToArray(), forcePlay: true);
|
MultiSound.Play(sounds.ToArray(), forcePlay: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -995,16 +996,15 @@ namespace HeavenStudio.Games
|
||||||
colorEases[i] = (Util.EasingFunction.Ease)colorEaseSet;
|
colorEases[i] = (Util.EasingFunction.Ease)colorEaseSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool preset = presetBG != (int)BackgroundType.Custom;
|
|
||||||
bool tinted = shadowType == (int)ShadowType.Tinted;
|
bool tinted = shadowType == (int)ShadowType.Tinted;
|
||||||
Color bgColorStart = preset ? BGPlane.color : colorStart;
|
Color bgColorStart = colorStart;
|
||||||
colorStarts = new Color[] {
|
colorStarts = new Color[] {
|
||||||
bgColorStart,
|
bgColorStart,
|
||||||
tinted ? TintColor(bgColorStart) : shadowStart,
|
tinted ? TintColor(bgColorStart) : shadowStart,
|
||||||
autoColor ? TintColor(bgColorStart): filterStart,
|
autoColor ? TintColor(bgColorStart): filterStart,
|
||||||
};
|
};
|
||||||
|
|
||||||
Color bgColorEnd = preset ? BackgroundColors[presetBG] : colorEnd;
|
Color bgColorEnd = colorEnd;
|
||||||
colorEnds = new Color[] {
|
colorEnds = new Color[] {
|
||||||
bgColorEnd,
|
bgColorEnd,
|
||||||
tinted ? TintColor(bgColorEnd) : shadowEnd,
|
tinted ? TintColor(bgColorEnd) : shadowEnd,
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("toggle", true, "Stars Enabled", "Starfall Or No?", new List<Param.CollapseParam>()
|
new Param("toggle", true, "Stars Enabled", "Starfall Or No?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "valA", "valB", "valC"})
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "valA", "valB", "valC"})
|
||||||
}),
|
}),
|
||||||
new Param("valA", new EntityTypes.Float(0.1f, 10f, 1f), "Star Density", "How many stars are on the screen"),
|
new Param("valA", new EntityTypes.Float(0.1f, 10f, 1f), "Star Density", "How many stars are on the screen"),
|
||||||
new Param("valB", new EntityTypes.Float(0.01f, 5f, 0.1f), "Front Star Fall Speed", "How fast the front stars fall to the edge of the screen"),
|
new Param("valB", new EntityTypes.Float(0.01f, 5f, 0.1f), "Front Star Fall Speed", "How fast the front stars fall to the edge of the screen"),
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("sound", false, "Sound", "Hai if onbeat, ho if offbeat.", new List<Param.CollapseParam>()
|
new Param("sound", false, "Sound", "Hai if onbeat, ho if offbeat.", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "amount" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "amount" })
|
||||||
}),
|
}),
|
||||||
new Param("amount", new EntityTypes.Integer(1, 50, 1), "Sound Amount", "How many sounds will play consecutively?"),
|
new Param("amount", new EntityTypes.Integer(1, 50, 1), "Sound Amount", "How many sounds will play consecutively?"),
|
||||||
new Param("visual", true, "Background Visual")
|
new Param("visual", true, "Background Visual")
|
||||||
|
|
@ -106,7 +106,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("sound", false, "Sound", "Hai if onbeat, ho if offbeat.", new List<Param.CollapseParam>()
|
new Param("sound", false, "Sound", "Hai if onbeat, ho if offbeat.", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "amount" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "amount" })
|
||||||
}),
|
}),
|
||||||
new Param("amount", new EntityTypes.Integer(1, 50, 1), "Sound Amount", "How many sounds will play consecutively?"),
|
new Param("amount", new EntityTypes.Integer(1, 50, 1), "Sound Amount", "How many sounds will play consecutively?"),
|
||||||
new Param("visual", true, "Background Visual")
|
new Param("visual", true, "Background Visual")
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
parameters = new List<Param>() {
|
parameters = new List<Param>() {
|
||||||
new Param("shouldPrep", true, "Prepare?", "Plays a prepare animation before the cue.", new List<Param.CollapseParam>()
|
new Param("shouldPrep", true, "Prepare?", "Plays a prepare animation before the cue.", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "prepBeats" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "prepBeats" })
|
||||||
}),
|
}),
|
||||||
new Param("prepBeats", new EntityTypes.Float(0, 4, 1), "Prepare Beats", "How many beats before the cue does the octopus prepare?"),
|
new Param("prepBeats", new EntityTypes.Float(0, 4, 1), "Prepare Beats", "How many beats before the cue does the octopus prepare?"),
|
||||||
},
|
},
|
||||||
|
|
@ -84,7 +84,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
new Param("autoBop", true, "Hit/Miss Bop", "Plays a bop depending on if you hit or missed the cues."),
|
new Param("autoBop", true, "Hit/Miss Bop", "Plays a bop depending on if you hit or missed the cues."),
|
||||||
new Param("autoText", true, "Display Text", "Displays text depending on if you hit or missed the cues.", new List<Param.CollapseParam>()
|
new Param("autoText", true, "Display Text", "Displays text depending on if you hit or missed the cues.", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "hitText", "missText" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "hitText", "missText" })
|
||||||
}),
|
}),
|
||||||
new Param("hitText", "Good!", "Hit Text", "The text to display if you hit the cues."),
|
new Param("hitText", "Good!", "Hit Text", "The text to display if you hit the cues."),
|
||||||
new Param("missText", "Wrong! Try again!", "Miss Text", "The text to display if you missed the cues."),
|
new Param("missText", "Wrong! Try again!", "Miss Text", "The text to display if you missed the cues."),
|
||||||
|
|
@ -109,7 +109,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
new Param("isInstant", true, "Instant", "Will the bubbles disappear appear?"),
|
new Param("isInstant", true, "Instant", "Will the bubbles disappear appear?"),
|
||||||
new Param("setActive", OctopusMachine.Actives.Activate, "Activate or Deactivate", "Will the bubbles disappear or appear?", new List<Param.CollapseParam>()
|
new Param("setActive", OctopusMachine.Actives.Activate, "Activate or Deactivate", "Will the bubbles disappear or appear?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (int)x == (int)OctopusMachine.Actives.Activate, new string[] { "particleStrength" })
|
new Param.CollapseParam((x, _) => (int)x == (int)OctopusMachine.Actives.Activate, new string[] { "particleStrength" })
|
||||||
}),
|
}),
|
||||||
new Param("particleStrength", new EntityTypes.Float(0, 25, 3), "Bubble Intensity", "The amount of bubbles"),
|
new Param("particleStrength", new EntityTypes.Float(0, 25, 3), "Bubble Intensity", "The amount of bubbles"),
|
||||||
new Param("particleSpeed", new EntityTypes.Float(0, 25, 5), "Bubble Speed", "The speed of the bubbles"),
|
new Param("particleSpeed", new EntityTypes.Float(0, 25, 5), "Bubble Speed", "The speed of the bubbles"),
|
||||||
|
|
@ -150,19 +150,19 @@ namespace HeavenStudio.Games.Loaders
|
||||||
parameters = new List<Param>() {
|
parameters = new List<Param>() {
|
||||||
new Param("oct1", true, "Show Octopus 1", "Should the first octopus be enabled?", new List<Param.CollapseParam>()
|
new Param("oct1", true, "Show Octopus 1", "Should the first octopus be enabled?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "oct1x", "oct1y" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "oct1x", "oct1y" })
|
||||||
}),
|
}),
|
||||||
new Param("oct1x", new EntityTypes.Float(-10, 10, -4.64f), "X Octopus 1", "Change Octopus 1's X"),
|
new Param("oct1x", new EntityTypes.Float(-10, 10, -4.64f), "X Octopus 1", "Change Octopus 1's X"),
|
||||||
new Param("oct1y", new EntityTypes.Float(-10, 10, 2.5f), "Y Octopus 1", "Change Octopus 1's Y"),
|
new Param("oct1y", new EntityTypes.Float(-10, 10, 2.5f), "Y Octopus 1", "Change Octopus 1's Y"),
|
||||||
new Param("oct2", true, "Show Octopus 2", "Should the second octopus be enabled?", new List<Param.CollapseParam>()
|
new Param("oct2", true, "Show Octopus 2", "Should the second octopus be enabled?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "oct2x", "oct2y" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "oct2x", "oct2y" })
|
||||||
}),
|
}),
|
||||||
new Param("oct2x", new EntityTypes.Float(-10, 10, -0.637f), "X Octopus 2", "Change Octopus 2's X"),
|
new Param("oct2x", new EntityTypes.Float(-10, 10, -0.637f), "X Octopus 2", "Change Octopus 2's X"),
|
||||||
new Param("oct2y", new EntityTypes.Float(-10, 10, 0f), "Y Octopus 2", "Change Octopus 2's Y"),
|
new Param("oct2y", new EntityTypes.Float(-10, 10, 0f), "Y Octopus 2", "Change Octopus 2's Y"),
|
||||||
new Param("oct3", true, "Show Octopus 3", "Should the third octopus be enabled?", new List<Param.CollapseParam>()
|
new Param("oct3", true, "Show Octopus 3", "Should the third octopus be enabled?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "oct3x", "oct3y" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "oct3x", "oct3y" })
|
||||||
}),
|
}),
|
||||||
new Param("oct3x", new EntityTypes.Float(-10, 10, 3.363f), "X Octopus 3", "Change Octopus 3's X"),
|
new Param("oct3x", new EntityTypes.Float(-10, 10, 3.363f), "X Octopus 3", "Change Octopus 3's X"),
|
||||||
new Param("oct3y", new EntityTypes.Float(-10, 10, -2.5f), "Y Octopus 3", "Change Octopus 3's Y"),
|
new Param("oct3y", new EntityTypes.Float(-10, 10, -2.5f), "Y Octopus 3", "Change Octopus 3's Y"),
|
||||||
|
|
@ -312,7 +312,7 @@ namespace HeavenStudio.Games
|
||||||
|
|
||||||
var main = bubble.main;
|
var main = bubble.main;
|
||||||
main.prewarm = isInstant;
|
main.prewarm = isInstant;
|
||||||
main.simulationSpeed = particleSpeed/10;
|
main.simulationSpeed = particleSpeed / 10;
|
||||||
|
|
||||||
var emm = bubble.emission;
|
var emm = bubble.emission;
|
||||||
emm.rateOverTime = particleStrength;
|
emm.rateOverTime = particleStrength;
|
||||||
|
|
@ -379,12 +379,9 @@ namespace HeavenStudio.Games
|
||||||
//call this in OnPlay(double beat) and OnGameSwitch(double beat)
|
//call this in OnPlay(double beat) and OnGameSwitch(double beat)
|
||||||
private void PersistColor(double beat)
|
private void PersistColor(double beat)
|
||||||
{
|
{
|
||||||
var allEventsBeforeBeat = EventCaller.GetAllInGameManagerList("octopusMachine", new string[] { "changeColor" }).FindAll(x => x.beat < beat);
|
var bgColor = GameManager.instance.Beatmap.Entities.FindLast(c => c.datamodel == "octopusMachine/changeColor" && c.beat < beat);
|
||||||
if (allEventsBeforeBeat.Count > 0)
|
if (bgColor != null) {
|
||||||
{
|
BackgroundColor(bgColor.beat, bgColor.length, bgColor["color1"], bgColor["color2"], bgColor["octoColor"], bgColor["squeezedColor"], bgColor["ease"]);
|
||||||
allEventsBeforeBeat.Sort((x, y) => x.beat.CompareTo(y.beat)); //just in case
|
|
||||||
var lastEvent = allEventsBeforeBeat[^1];
|
|
||||||
BackgroundColor(lastEvent.beat, lastEvent.length, lastEvent["color1"], lastEvent["color2"], lastEvent["octoColor"], lastEvent["squeezedColor"], lastEvent["ease"]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("auto", true, "Auto Pass Turn", "", new List<Param.CollapseParam>()
|
new Param("auto", true, "Auto Pass Turn", "", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "sound", "con", "visual", "audio" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "sound", "con", "visual", "audio" })
|
||||||
}),
|
}),
|
||||||
new Param("sound", true, "Play Time-Up Sound?", "Should the Time-Up sound play at the end of the interval?"),
|
new Param("sound", true, "Play Time-Up Sound?", "Should the Time-Up sound play at the end of the interval?"),
|
||||||
new Param("con", false, "Consecutive", "Disables everything that happens at the end of the interval if ticked on."),
|
new Param("con", false, "Consecutive", "Disables everything that happens at the end of the interval if ticked on."),
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("high", false, "High", "Will they perform high jumps?", new List<Param.CollapseParam>()
|
new Param("high", false, "High", "Will they perform high jumps?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "height", "camMove" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "height", "camMove" })
|
||||||
}),
|
}),
|
||||||
new Param("height", new EntityTypes.Float(0, 1, 0), "Height", "Controls how high the high jump will go, 0 is the minimum height, 1 is the maximum height."),
|
new Param("height", new EntityTypes.Float(0, 1, 0), "Height", "Controls how high the high jump will go, 0 is the minimum height, 1 is the maximum height."),
|
||||||
new Param("camMove", true, "Camera Movement", "Will the camera follow saw when it jumps up high?")
|
new Param("camMove", true, "Camera Movement", "Will the camera follow saw when it jumps up high?")
|
||||||
|
|
@ -35,7 +35,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("high", false, "High", "Will they perform high jumps?", new List<Param.CollapseParam>()
|
new Param("high", false, "High", "Will they perform high jumps?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "height", "camMove" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "height", "camMove" })
|
||||||
}),
|
}),
|
||||||
new Param("height", new EntityTypes.Float(0, 1, 0), "Height", "Controls how high the high jump will go, 0 is the minimum height, 1 is the maximum height."),
|
new Param("height", new EntityTypes.Float(0, 1, 0), "Height", "Controls how high the high jump will go, 0 is the minimum height, 1 is the maximum height."),
|
||||||
new Param("camMove", true, "Camera Movement", "Will the camera follow saw when it jumps up high?")
|
new Param("camMove", true, "Camera Movement", "Will the camera follow saw when it jumps up high?")
|
||||||
|
|
@ -49,7 +49,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("high", false, "High", "Will they perform high jumps?", new List<Param.CollapseParam>()
|
new Param("high", false, "High", "Will they perform high jumps?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "height", "camMove" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "height", "camMove" })
|
||||||
}),
|
}),
|
||||||
new Param("height", new EntityTypes.Float(0, 1, 0), "Height", "Controls how high the high jump will go, 0 is the minimum height, 1 is the maximum height."),
|
new Param("height", new EntityTypes.Float(0, 1, 0), "Height", "Controls how high the high jump will go, 0 is the minimum height, 1 is the maximum height."),
|
||||||
new Param("camMove", true, "Camera Movement", "Will the camera follow saw when it jumps up high?")
|
new Param("camMove", true, "Camera Movement", "Will the camera follow saw when it jumps up high?")
|
||||||
|
|
@ -63,7 +63,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("high", false, "High", "Will they perform high jumps?", new List<Param.CollapseParam>()
|
new Param("high", false, "High", "Will they perform high jumps?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "height", "camMove" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "height", "camMove" })
|
||||||
}),
|
}),
|
||||||
new Param("height", new EntityTypes.Float(0, 1, 0), "Height", "Controls how high the high jump will go, 0 is the minimum height, 1 is the maximum height."),
|
new Param("height", new EntityTypes.Float(0, 1, 0), "Height", "Controls how high the high jump will go, 0 is the minimum height, 1 is the maximum height."),
|
||||||
new Param("camMove", true, "Camera Movement", "Will the camera follow saw when it jumps up high?")
|
new Param("camMove", true, "Camera Movement", "Will the camera follow saw when it jumps up high?")
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("preset", SpaceSoccer.EnterExitPresets.FiveKickers, "Preset", "Which preset should be used?", new List<Param.CollapseParam>()
|
new Param("preset", SpaceSoccer.EnterExitPresets.FiveKickers, "Preset", "Which preset should be used?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (int)x == (int)SpaceSoccer.EnterExitPresets.Custom, new string[] { "amount", "x", "y", "z" })
|
new Param.CollapseParam((x, _) => (int)x == (int)SpaceSoccer.EnterExitPresets.Custom, new string[] { "amount", "x", "y", "z" })
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -78,7 +78,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("preset", SpaceSoccer.PlayerPresets.LaunchStart, "Preset", "Which preset should be used?", new List<Param.CollapseParam>()
|
new Param("preset", SpaceSoccer.PlayerPresets.LaunchStart, "Preset", "Which preset should be used?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (int)x == (int)SpaceSoccer.PlayerPresets.Custom, new string[] { "x", "y", "z", "ease", "sound" })
|
new Param.CollapseParam((x, _) => (int)x == (int)SpaceSoccer.PlayerPresets.Custom, new string[] { "x", "y", "z", "ease", "sound" })
|
||||||
}),
|
}),
|
||||||
new Param("x", new EntityTypes.Float(-30, 30, 0f), "X Pos", "Which position should the player move to on the x axis?"),
|
new Param("x", new EntityTypes.Float(-30, 30, 0f), "X Pos", "Which position should the player move to on the x axis?"),
|
||||||
new Param("y", new EntityTypes.Float(-30, 30, 0f), "Y Pos", "Which position should the player move to on the y axis?"),
|
new Param("y", new EntityTypes.Float(-30, 30, 0f), "Y Pos", "Which position should the player move to on the y axis?"),
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("toggle", true, "Scroll FX", "Will scroll", new List<Param.CollapseParam>()
|
new Param("toggle", true, "Scroll FX", "Will scroll", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "flash", "m"})
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "flash", "m"})
|
||||||
}),
|
}),
|
||||||
new Param("flash", true, "Flash FX", "Will flash to white"),
|
new Param("flash", true, "Flash FX", "Will flash to white"),
|
||||||
new Param("m", new EntityTypes.Float(0, 10, 1), "Speed Multiplier")
|
new Param("m", new EntityTypes.Float(0, 10, 1), "Speed Multiplier")
|
||||||
|
|
|
||||||
|
|
@ -33,12 +33,12 @@ namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
new Param("okay", true, "Okay Voice Line", "Whether or not the tappers should say -Okay!- after successfully tapping.", new List<Param.CollapseParam>()
|
new Param("okay", true, "Okay Voice Line", "Whether or not the tappers should say -Okay!- after successfully tapping.", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (bool)x, new string[] { "okayType" })
|
new Param.CollapseParam((x, _) => (bool)x, new string[] { "okayType" })
|
||||||
}),
|
}),
|
||||||
new Param("okayType", TapTroupe.OkayType.OkayA, "Okay Type", "Which version of the okay voice line should the tappers say?"),
|
new Param("okayType", TapTroupe.OkayType.OkayA, "Okay Type", "Which version of the okay voice line should the tappers say?"),
|
||||||
new Param("animType", TapTroupe.OkayAnimType.Normal, "Okay Animation", "Which animations should be played when the tapper say OK?", new List<Param.CollapseParam>()
|
new Param("animType", TapTroupe.OkayAnimType.Normal, "Okay Animation", "Which animations should be played when the tapper say OK?", new List<Param.CollapseParam>()
|
||||||
{
|
{
|
||||||
new Param.CollapseParam(x => (int)x == (int)TapTroupe.OkayAnimType.Popper, new string[]{ "popperBeats"})
|
new Param.CollapseParam((x, _) => (int)x == (int)TapTroupe.OkayAnimType.Popper, new string[]{ "popperBeats"})
|
||||||
}),
|
}),
|
||||||
new Param("popperBeats", new EntityTypes.Float(0f, 80f, 2f), "Popper Beats", "How many beats until the popper will pop?"),
|
new Param("popperBeats", new EntityTypes.Float(0f, 80f, 2f), "Popper Beats", "How many beats until the popper will pop?"),
|
||||||
new Param("randomVoiceLine", true, "Extra Random Voice Line", "Whether there should be randomly said woos or laughs after the tappers say OK!"),
|
new Param("randomVoiceLine", true, "Extra Random Voice Line", "Whether there should be randomly said woos or laughs after the tappers say OK!"),
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ using UnityEngine;
|
||||||
using HeavenStudio.Editor.Track;
|
using HeavenStudio.Editor.Track;
|
||||||
using Jukebox;
|
using Jukebox;
|
||||||
using Jukebox.Legacy;
|
using Jukebox.Legacy;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace HeavenStudio.Editor
|
namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
|
|
@ -111,12 +112,8 @@ namespace HeavenStudio.Editor
|
||||||
EventPropertyPrefab input = ePrefabs[p.propertyName].GetComponent<EventPropertyPrefab>();
|
EventPropertyPrefab input = ePrefabs[p.propertyName].GetComponent<EventPropertyPrefab>();
|
||||||
foreach (var c in p.collapseParams)
|
foreach (var c in p.collapseParams)
|
||||||
{
|
{
|
||||||
List<GameObject> collapseables = new();
|
List<GameObject> collapseables = c.collapseables.Select(x => ePrefabs[x]).ToList();
|
||||||
foreach (var s in c.collapseables)
|
input.propertyCollapses.Add(new EventPropertyPrefab.PropertyCollapse(collapseables, c.CollapseOn, entity));
|
||||||
{
|
|
||||||
collapseables.Add(ePrefabs[s]);
|
|
||||||
}
|
|
||||||
input.propertyCollapses.Add(new EventPropertyPrefab.PropertyCollapse(collapseables, c.CollapseOn));
|
|
||||||
}
|
}
|
||||||
input.SetCollapses(p.parameter);
|
input.SetCollapses(p.parameter);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ using TMPro;
|
||||||
using Starpelly;
|
using Starpelly;
|
||||||
|
|
||||||
using HeavenStudio.Util;
|
using HeavenStudio.Util;
|
||||||
|
using Jukebox;
|
||||||
|
|
||||||
namespace HeavenStudio.Editor
|
namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
|
|
@ -38,7 +39,7 @@ namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
foreach (var c in p.collapseables)
|
foreach (var c in p.collapseables)
|
||||||
{
|
{
|
||||||
if (c != null) c.SetActive(p.collapseOn(type) && gameObject.activeSelf);
|
if (c != null) c.SetActive(p.collapseOn(type, p.entity) && gameObject.activeSelf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -46,12 +47,14 @@ namespace HeavenStudio.Editor
|
||||||
public class PropertyCollapse
|
public class PropertyCollapse
|
||||||
{
|
{
|
||||||
public List<GameObject> collapseables;
|
public List<GameObject> collapseables;
|
||||||
public Func<object, bool> collapseOn;
|
public Func<object, RiqEntity, bool> collapseOn;
|
||||||
|
public RiqEntity entity;
|
||||||
|
|
||||||
public PropertyCollapse(List<GameObject> collapseables, Func<object, bool> collapseOn)
|
public PropertyCollapse(List<GameObject> collapseables, Func<object, RiqEntity, bool> collapseOn, RiqEntity entity)
|
||||||
{
|
{
|
||||||
this.collapseables = collapseables;
|
this.collapseables = collapseables;
|
||||||
this.collapseOn = collapseOn;
|
this.collapseOn = collapseOn;
|
||||||
|
this.entity = entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -486,14 +486,14 @@ namespace HeavenStudio
|
||||||
|
|
||||||
public class CollapseParam
|
public class CollapseParam
|
||||||
{
|
{
|
||||||
public Func<object, bool> CollapseOn;
|
public Func<object, RiqEntity, bool> CollapseOn;
|
||||||
public string[] collapseables;
|
public string[] collapseables;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class that decides how other parameters will be collapsed
|
/// Class that decides how other parameters will be collapsed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="collapseOn">What values should make it collapse/uncollapse?</param>
|
/// <param name="collapseOn">What values should make it collapse/uncollapse?</param>
|
||||||
/// <param name="collapseables">IDs of the parameters to collapse</param>
|
/// <param name="collapseables">IDs of the parameters to collapse</param>
|
||||||
public CollapseParam(Func<object, bool> collapseOn, string[] collapseables)
|
public CollapseParam(Func<object, RiqEntity, bool> collapseOn, string[] collapseables)
|
||||||
{
|
{
|
||||||
CollapseOn = collapseOn;
|
CollapseOn = collapseOn;
|
||||||
this.collapseables = collapseables;
|
this.collapseables = collapseables;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace HeavenStudio.Util
|
namespace HeavenStudio.Util
|
||||||
{
|
{
|
||||||
|
|
@ -52,7 +53,27 @@ namespace HeavenStudio.Util
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Plays animation on animator, scaling speed to song BPM
|
/// Plays animation on animator, scaling speed to song BPM
|
||||||
/// call this funtion once, when playing an animation
|
/// call this function once, when playing an animation
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="anim">Animator to play animation on</param>
|
||||||
|
/// <param name="animName">name of animation to play</param>
|
||||||
|
/// <param name="timeScale">multiplier for animation speed</param>
|
||||||
|
/// <param name="startBeat">beat that this animation would start on</param>
|
||||||
|
/// <param name="currentBeat">how many beats after startBeat that the animation actually starts playing</param>
|
||||||
|
/// <param name="animLayer">animator layer to play animation on</param>
|
||||||
|
public static void DoScaledAnimationFromBeatAsync(this Animator anim, string animName, float timeScale = 1f, double startBeat = 0, double currentBeat = 0, int animLayer = -1)
|
||||||
|
{
|
||||||
|
var cond = Conductor.instance;
|
||||||
|
var animClip = Array.Find(anim.runtimeAnimatorController.animationClips, x => x.name == animName);
|
||||||
|
var animLength = cond.GetBeatFromSongPos(cond.GetSongPosFromBeat(startBeat) + animClip.length);
|
||||||
|
var pos = cond.GetPositionFromBeat(startBeat + currentBeat, animLength) * timeScale;
|
||||||
|
anim.Play(animName, animLayer, pos);
|
||||||
|
anim.speed = 1f / (cond.pitchedSecPerBeat * timeScale);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Plays animation on animator, scaling speed to song BPM
|
||||||
|
/// call this function once, when playing an animation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="anim">Animator to play animation on</param>
|
/// <param name="anim">Animator to play animation on</param>
|
||||||
/// <param name="animName">name of animation to play</param>
|
/// <param name="animName">name of animation to play</param>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue