mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 08:07:38 +02:00
bread2unity BCCAD interpreter setup
This commit is contained in:
40
Assets/Scripts/Games/RhythmTweezers/LongHair.cs
Normal file
40
Assets/Scripts/Games/RhythmTweezers/LongHair.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RhythmHeavenMania.Games.RhythmTweezers
|
||||
{
|
||||
public class LongHair : PlayerActionObject
|
||||
{
|
||||
public float createBeat;
|
||||
private RhythmTweezers game;
|
||||
private Tweezers tweezers;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
game = RhythmTweezers.instance;
|
||||
tweezers = game.Tweezers;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
float stateBeat = Conductor.instance.GetPositionFromBeat(createBeat + game.tweezerBeatOffset, game.beatInterval);
|
||||
StateCheck(stateBeat);
|
||||
|
||||
if (PlayerInput.Pressed() && tweezers.hitOnFrame == 0)
|
||||
{
|
||||
if (state.perfect)
|
||||
{
|
||||
Ace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Ace()
|
||||
{
|
||||
tweezers.LongPluck(true, this);
|
||||
|
||||
tweezers.hitOnFrame++;
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Games/RhythmTweezers/LongHair.cs.meta
Normal file
11
Assets/Scripts/Games/RhythmTweezers/LongHair.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3279e585337e95a40b3621073b3c77b1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -17,6 +17,7 @@ namespace RhythmHeavenMania.Games.RhythmTweezers
|
||||
public Animator VegetableAnimator;
|
||||
public Tweezers Tweezers;
|
||||
public GameObject hairBase;
|
||||
public GameObject longHairBase;
|
||||
|
||||
[SerializeField] private GameObject HairsHolder;
|
||||
[NonSerialized] public int hairsLeft = 0;
|
||||
@ -57,6 +58,25 @@ namespace RhythmHeavenMania.Games.RhythmTweezers
|
||||
hairsLeft++;
|
||||
}
|
||||
|
||||
public void SpawnLongHair(float beat)
|
||||
{
|
||||
StopTransitionIfActive();
|
||||
|
||||
if (!intervalStarted)
|
||||
{
|
||||
SetIntervalStart(beat, beatInterval);
|
||||
}
|
||||
|
||||
Jukebox.PlayOneShotGame("rhythmTweezers/longAppear", beat);
|
||||
LongHair hair = Instantiate(longHairBase, HairsHolder.transform).GetComponent<LongHair>();
|
||||
hair.gameObject.SetActive(true);
|
||||
|
||||
float rot = -58f + 116 * Mathp.Normalize(beat, intervalStartBeat, intervalStartBeat + beatInterval - 1f);
|
||||
hair.transform.eulerAngles = new Vector3(0, 0, rot);
|
||||
hair.createBeat = beat;
|
||||
hairsLeft++;
|
||||
}
|
||||
|
||||
public void SetIntervalStart(float beat, float interval = 4f)
|
||||
{
|
||||
// End transition early if the interval starts a lil early.
|
||||
|
@ -11,11 +11,14 @@ namespace RhythmHeavenMania.Games.RhythmTweezers
|
||||
public int hitOnFrame;
|
||||
private Animator anim;
|
||||
private Animator vegetableAnim;
|
||||
private RhythmTweezers game;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
anim = GetComponent<Animator>();
|
||||
vegetableAnim = RhythmTweezers.instance.VegetableAnimator;
|
||||
|
||||
game = RhythmTweezers.instance;
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
@ -35,8 +38,6 @@ namespace RhythmHeavenMania.Games.RhythmTweezers
|
||||
|
||||
if (ace)
|
||||
{
|
||||
var game = RhythmTweezers.instance;
|
||||
|
||||
Jukebox.PlayOneShotGame($"rhythmTweezers/shortPluck{Random.Range(1, 21)}");
|
||||
Destroy(hair.gameObject);
|
||||
|
||||
@ -48,5 +49,24 @@ namespace RhythmHeavenMania.Games.RhythmTweezers
|
||||
vegetableAnim.Play("Hop", 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void LongPluck(bool ace, LongHair hair)
|
||||
{
|
||||
anim.Play("Tweezers_Pluck", 0, 0);
|
||||
|
||||
if (hitOnFrame > 0) return;
|
||||
|
||||
if (ace)
|
||||
{
|
||||
float beat = Conductor.instance.songPositionInBeats;
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
new MultiSound.Sound($"rhythmTweezers/longPull{Random.Range(1, 5)}", beat),
|
||||
new MultiSound.Sound("rhythmTweezers/longPullEnd", beat + 0.5f),
|
||||
});
|
||||
|
||||
Destroy(hair.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -78,10 +78,10 @@ namespace RhythmHeavenMania
|
||||
{
|
||||
new Minigame("gameManager", "Game Manager", "", false, true, new List<GameAction>()
|
||||
{
|
||||
new GameAction("switchGame", delegate { GameManager.instance.SwitchGame(eventCaller.currentSwitchGame); }, 0.5f),
|
||||
new GameAction("end", delegate { Debug.Log("end"); }),
|
||||
new GameAction("skill star", delegate { }, 1f, true),
|
||||
new GameAction("flash", delegate
|
||||
new GameAction("switchGame", delegate { GameManager.instance.SwitchGame(eventCaller.currentSwitchGame); }, 0.5f),
|
||||
new GameAction("end", delegate { Debug.Log("end"); }),
|
||||
new GameAction("skill star", delegate { }, 1f, true),
|
||||
new GameAction("flash", delegate
|
||||
{
|
||||
|
||||
/*Color colA = eventCaller.currentEntity.colorA;
|
||||
@ -103,19 +103,19 @@ namespace RhythmHeavenMania
|
||||
}),
|
||||
new Minigame("countIn", "Count-Ins", "", false, true, new List<GameAction>()
|
||||
{
|
||||
new GameAction("cowbell", delegate { Jukebox.PlayOneShot("count-ins/cowbell"); }, 1f),
|
||||
new GameAction("one", delegate { Jukebox.PlayOneShot("count-ins/one1"); }, 1f),
|
||||
new GameAction("one (alt)", delegate { Jukebox.PlayOneShot("count-ins/one2"); }, 1f),
|
||||
new GameAction("two", delegate { Jukebox.PlayOneShot("count-ins/two1"); }, 1f),
|
||||
new GameAction("two (alt)", delegate { Jukebox.PlayOneShot("count-ins/two2"); }, 1f),
|
||||
new GameAction("three", delegate { Jukebox.PlayOneShot("count-ins/three1"); }, 1f),
|
||||
new GameAction("three (alt)", delegate { Jukebox.PlayOneShot("count-ins/three2"); }, 1f),
|
||||
new GameAction("four", delegate { Jukebox.PlayOneShot("count-ins/four1"); }, 1f),
|
||||
new GameAction("four (alt)", delegate { Jukebox.PlayOneShot("count-ins/four2"); }, 1f),
|
||||
new GameAction("and", delegate { Jukebox.PlayOneShot("count-ins/and"); }, 0.5f),
|
||||
new GameAction("go!", delegate { Jukebox.PlayOneShot("count-ins/go1"); }, 1f),
|
||||
new GameAction("go! (alt)", delegate { Jukebox.PlayOneShot("count-ins/go2"); }, 1f),
|
||||
new GameAction("ready!", delegate
|
||||
new GameAction("cowbell", delegate { Jukebox.PlayOneShot("count-ins/cowbell"); }, 1f),
|
||||
new GameAction("one", delegate { Jukebox.PlayOneShot("count-ins/one1"); }, 1f),
|
||||
new GameAction("one (alt)", delegate { Jukebox.PlayOneShot("count-ins/one2"); }, 1f),
|
||||
new GameAction("two", delegate { Jukebox.PlayOneShot("count-ins/two1"); }, 1f),
|
||||
new GameAction("two (alt)", delegate { Jukebox.PlayOneShot("count-ins/two2"); }, 1f),
|
||||
new GameAction("three", delegate { Jukebox.PlayOneShot("count-ins/three1"); }, 1f),
|
||||
new GameAction("three (alt)", delegate { Jukebox.PlayOneShot("count-ins/three2"); }, 1f),
|
||||
new GameAction("four", delegate { Jukebox.PlayOneShot("count-ins/four1"); }, 1f),
|
||||
new GameAction("four (alt)", delegate { Jukebox.PlayOneShot("count-ins/four2"); }, 1f),
|
||||
new GameAction("and", delegate { Jukebox.PlayOneShot("count-ins/and"); }, 0.5f),
|
||||
new GameAction("go!", delegate { Jukebox.PlayOneShot("count-ins/go1"); }, 1f),
|
||||
new GameAction("go! (alt)", delegate { Jukebox.PlayOneShot("count-ins/go2"); }, 1f),
|
||||
new GameAction("ready!", delegate
|
||||
{
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
@ -126,82 +126,83 @@ namespace RhythmHeavenMania
|
||||
}),
|
||||
new Minigame("forkLifter", "Fork Lifter", "FFFFFF", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("pea", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 0); }, 3),
|
||||
new GameAction("topbun", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 1); }, 3),
|
||||
new GameAction("burger", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 2); }, 3),
|
||||
new GameAction("bottombun", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 3); }, 3),
|
||||
new GameAction("prepare", delegate { ForkLifter.instance.ForkLifterHand.Prepare(); }, 0.5f),
|
||||
new GameAction("gulp", delegate { ForkLifterPlayer.instance.Eat(); }),
|
||||
new GameAction("sigh", delegate { Jukebox.PlayOneShot("sigh"); })
|
||||
new GameAction("pea", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 0); }, 3),
|
||||
new GameAction("topbun", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 1); }, 3),
|
||||
new GameAction("burger", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 2); }, 3),
|
||||
new GameAction("bottombun", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 3); }, 3),
|
||||
new GameAction("prepare", delegate { ForkLifter.instance.ForkLifterHand.Prepare(); }, 0.5f),
|
||||
new GameAction("gulp", delegate { ForkLifterPlayer.instance.Eat(); }),
|
||||
new GameAction("sigh", delegate { Jukebox.PlayOneShot("sigh"); })
|
||||
}),
|
||||
new Minigame("clappyTrio", "The Clappy Trio", "29E7FF", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("clap", delegate { ClappyTrio.instance.Clap(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 3, true),
|
||||
new GameAction("bop", delegate { ClappyTrio.instance.Bop(eventCaller.currentEntity.beat); } ),
|
||||
new GameAction("prepare", delegate { ClappyTrio.instance.Prepare(0); } ),
|
||||
new GameAction("prepare_alt", delegate { ClappyTrio.instance.Prepare(3); } ),
|
||||
new GameAction("clap", delegate { ClappyTrio.instance.Clap(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 3, true),
|
||||
new GameAction("bop", delegate { ClappyTrio.instance.Bop(eventCaller.currentEntity.beat); } ),
|
||||
new GameAction("prepare", delegate { ClappyTrio.instance.Prepare(0); } ),
|
||||
new GameAction("prepare_alt", delegate { ClappyTrio.instance.Prepare(3); } ),
|
||||
}),
|
||||
new Minigame("spaceball", "Spaceball", "00A518", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("shoot", delegate { Spaceball.instance.Shoot(eventCaller.currentEntity.beat, false, eventCaller.currentEntity.type); }, 2, false),
|
||||
new GameAction("shootHigh", delegate { Spaceball.instance.Shoot(eventCaller.currentEntity.beat, true, eventCaller.currentEntity.type); }, 3),
|
||||
new GameAction("costume", delegate { Spaceball.instance.Costume(eventCaller.currentEntity.type); }, 1f, false, new List<Param>()
|
||||
new GameAction("shoot", delegate { Spaceball.instance.Shoot(eventCaller.currentEntity.beat, false, eventCaller.currentEntity.type); }, 2, false),
|
||||
new GameAction("shootHigh", delegate { Spaceball.instance.Shoot(eventCaller.currentEntity.beat, true, eventCaller.currentEntity.type); }, 3),
|
||||
new GameAction("costume", delegate { Spaceball.instance.Costume(eventCaller.currentEntity.type); }, 1f, false, new List<Param>()
|
||||
{
|
||||
new Param("type", new EntityTypes.Integer(0, 2), "Type")
|
||||
} ),
|
||||
new GameAction("alien", delegate { Spaceball.instance.alien.Show(eventCaller.currentEntity.beat); } ),
|
||||
new GameAction("camera", delegate { Spaceball.instance.OverrideCurrentZoom(); }, 4, true, new List<Param>()
|
||||
new GameAction("alien", delegate { Spaceball.instance.alien.Show(eventCaller.currentEntity.beat); } ),
|
||||
new GameAction("camera", delegate { Spaceball.instance.OverrideCurrentZoom(); }, 4, true, new List<Param>()
|
||||
{
|
||||
new Param("valA", new EntityTypes.Integer(1, 320, 10), "Zoom"),
|
||||
new Param("ease", EasingFunction.Ease.Linear, "Ease")
|
||||
} ),
|
||||
new GameAction("prepare dispenser", delegate { Spaceball.instance.PrepareDispenser(); }, 1 ),
|
||||
new GameAction("prepare dispenser", delegate { Spaceball.instance.PrepareDispenser(); }, 1 ),
|
||||
}),
|
||||
new Minigame("karateman", "Karate Man", "70A8D8", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("bop", delegate { KarateMan.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
|
||||
new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 0); }, 2),
|
||||
new GameAction("bulb", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 1); }, 2),
|
||||
new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 2); }, 2),
|
||||
new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 3); }, 2),
|
||||
new GameAction("kick", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 4); }, 4.5f),
|
||||
new GameAction("combo", delegate { KarateMan.instance.Combo(eventCaller.currentEntity.beat); }, 4f),
|
||||
new GameAction("hit3", delegate { KarateMan.instance.Hit3(eventCaller.currentEntity.beat); }),
|
||||
new GameAction("hit4", delegate { KarateMan.instance.Hit4(eventCaller.currentEntity.beat); }),
|
||||
new GameAction("prepare", delegate { KarateMan.instance.Prepare(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 1f, true),
|
||||
new GameAction("bgfxon", delegate { KarateMan.instance.BGFXOn(); } ),
|
||||
new GameAction("bgfxoff", delegate { KarateMan.instance.BGFXOff(); }),
|
||||
new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 6); }, 2),
|
||||
new GameAction("bop", delegate { KarateMan.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
|
||||
new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 0); }, 2),
|
||||
new GameAction("bulb", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 1); }, 2),
|
||||
new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 2); }, 2),
|
||||
new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 3); }, 2),
|
||||
new GameAction("kick", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 4); }, 4.5f),
|
||||
new GameAction("combo", delegate { KarateMan.instance.Combo(eventCaller.currentEntity.beat); }, 4f),
|
||||
new GameAction("hit3", delegate { KarateMan.instance.Hit3(eventCaller.currentEntity.beat); }),
|
||||
new GameAction("hit4", delegate { KarateMan.instance.Hit4(eventCaller.currentEntity.beat); }),
|
||||
new GameAction("prepare", delegate { KarateMan.instance.Prepare(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 1f, true),
|
||||
new GameAction("bgfxon", delegate { KarateMan.instance.BGFXOn(); } ),
|
||||
new GameAction("bgfxoff", delegate { KarateMan.instance.BGFXOff(); }),
|
||||
new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 6); }, 2),
|
||||
}),
|
||||
new Minigame("spaceSoccer", "Space Soccer", "B888F8", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("ball dispense", delegate { SpaceSoccer.instance.Dispense(eventCaller.currentEntity.beat); }, 2f),
|
||||
new GameAction("keep-up", delegate { }, 4f, true),
|
||||
new GameAction("high kick-toe!", delegate { }, 3f, false, new List<Param>()
|
||||
new GameAction("ball dispense", delegate { SpaceSoccer.instance.Dispense(eventCaller.currentEntity.beat); }, 2f),
|
||||
new GameAction("keep-up", delegate { }, 4f, true),
|
||||
new GameAction("high kick-toe!", delegate { }, 3f, false, new List<Param>()
|
||||
{
|
||||
new Param("valA", new EntityTypes.Float(0, 1), "Swing")
|
||||
}),
|
||||
}),
|
||||
new Minigame("djSchool", "DJ School \n<color=#eb5454>[Non-Playable]</color>", "008c97", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("bop", delegate { DJSchool.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
|
||||
new GameAction("and stop ooh", delegate { DJSchool.instance.AndStop(eventCaller.currentEntity.beat); }, 2.5f),
|
||||
new GameAction("break c'mon ooh", delegate { DJSchool.instance.BreakCmon(eventCaller.currentEntity.beat, eventCaller.currentEntity.type); }, 3f, false, new List<Param>()
|
||||
new GameAction("bop", delegate { DJSchool.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
|
||||
new GameAction("and stop ooh", delegate { DJSchool.instance.AndStop(eventCaller.currentEntity.beat); }, 2.5f),
|
||||
new GameAction("break c'mon ooh", delegate { DJSchool.instance.BreakCmon(eventCaller.currentEntity.beat, eventCaller.currentEntity.type); }, 3f, false, new List<Param>()
|
||||
{
|
||||
new Param("type", new EntityTypes.Integer(0, 2, 0), "Type"),
|
||||
}),
|
||||
new GameAction("scratch-o hey", delegate { DJSchool.instance.ScratchoHey(eventCaller.currentEntity.beat, eventCaller.currentEntity.type); }, 3f, false, new List<Param>()
|
||||
new GameAction("scratch-o hey", delegate { DJSchool.instance.ScratchoHey(eventCaller.currentEntity.beat, eventCaller.currentEntity.type); }, 3f, false, new List<Param>()
|
||||
{
|
||||
new Param("type", new EntityTypes.Integer(0, 2, 0), "Type"),
|
||||
}),
|
||||
}),
|
||||
new Minigame("rhythmTweezers", "Rhythm Tweezers \n<color=#eb5454>[WIP don't use]</color>", "98b389", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("start interval", delegate { RhythmTweezers.instance.SetIntervalStart(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 4f, true),
|
||||
new GameAction("short hair", delegate { RhythmTweezers.instance.SpawnHair(eventCaller.currentEntity.beat); }, 0.5f),
|
||||
new GameAction("next vegetable", delegate { RhythmTweezers.instance.NextVegetable(eventCaller.currentEntity.beat); }, 0.5f),
|
||||
new GameAction("start interval", delegate { RhythmTweezers.instance.SetIntervalStart(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 4f, true),
|
||||
new GameAction("short hair", delegate { RhythmTweezers.instance.SpawnHair(eventCaller.currentEntity.beat); }, 0.5f),
|
||||
new GameAction("long hair", delegate { RhythmTweezers.instance.SpawnLongHair(eventCaller.currentEntity.beat); }, 0.5f),
|
||||
new GameAction("next vegetable", delegate { RhythmTweezers.instance.NextVegetable(eventCaller.currentEntity.beat); }, 0.5f),
|
||||
new GameAction("set tweezer delay", delegate { RhythmTweezers.instance.tweezerBeatOffset = eventCaller.currentEntity.length; }, 1f, true),
|
||||
new GameAction("reset tweezer delay", delegate { RhythmTweezers.instance.tweezerBeatOffset = 0f; }, 0.5f),
|
||||
new GameAction("reset tweezer delay", delegate { RhythmTweezers.instance.tweezerBeatOffset = 0f; }, 0.5f),
|
||||
}),
|
||||
/*
|
||||
new Minigame("rhythmRally", "Rhythm Rally", "B888F8", true, false, new List<GameAction>()
|
||||
|
Reference in New Issue
Block a user