Merge branch 'release_1' into KarateManAdditions_P1

This commit is contained in:
AstrlJelly 2023-09-15 19:46:54 -04:00
commit 07b56e4412
160 changed files with 49901 additions and 2274 deletions

View file

@ -1,6 +1,7 @@
{
"recommendations": [
"ms-dotnettools.csharp",
"editorconfig.editorconfig"
]
"recommendations": [
"ms-dotnettools.csharp",
"editorconfig.editorconfig",
"visualstudiotoolsforunity.vstuc"
]
}

10
.vscode/launch.json vendored Normal file
View file

@ -0,0 +1,10 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Unity",
"type": "vstuc",
"request": "attach"
}
]
}

107
.vscode/settings.json vendored
View file

@ -1,54 +1,55 @@
{
"files.exclude": {
"**/.DS_Store": true,
"**/.git": true,
"**/.gitmodules": true,
"**/*.booproj": true,
"**/*.pidb": true,
"**/*.suo": true,
"**/*.user": true,
"**/*.userprefs": true,
"**/*.unityproj": true,
"**/*.dll": true,
"**/*.exe": true,
"**/*.pdf": true,
"**/*.mid": true,
"**/*.midi": true,
"**/*.wav": true,
"**/*.gif": true,
"**/*.ico": true,
"**/*.jpg": true,
"**/*.jpeg": true,
"**/*.png": true,
"**/*.psd": true,
"**/*.tga": true,
"**/*.tif": true,
"**/*.tiff": true,
"**/*.3ds": true,
"**/*.3DS": true,
"**/*.fbx": true,
"**/*.FBX": true,
"**/*.lxo": true,
"**/*.LXO": true,
"**/*.ma": true,
"**/*.MA": true,
"**/*.obj": true,
"**/*.OBJ": true,
"**/*.asset": true,
"**/*.cubemap": true,
"**/*.flare": true,
"**/*.mat": true,
"**/*.meta": true,
"**/*.prefab": true,
"**/*.unity": true,
"build/": true,
"Build/": true,
"Library/": true,
"library/": true,
"obj/": true,
"Obj/": true,
"ProjectSettings/": true,
"temp/": true,
"Temp/": true
}
}
"files.exclude": {
"**/.DS_Store": true,
"**/.git": true,
"**/.gitmodules": true,
"**/*.booproj": true,
"**/*.pidb": true,
"**/*.suo": true,
"**/*.user": true,
"**/*.userprefs": true,
"**/*.unityproj": true,
"**/*.dll": true,
"**/*.exe": true,
"**/*.pdf": true,
"**/*.mid": true,
"**/*.midi": true,
"**/*.wav": true,
"**/*.gif": true,
"**/*.ico": true,
"**/*.jpg": true,
"**/*.jpeg": true,
"**/*.png": true,
"**/*.psd": true,
"**/*.tga": true,
"**/*.tif": true,
"**/*.tiff": true,
"**/*.3ds": true,
"**/*.3DS": true,
"**/*.fbx": true,
"**/*.FBX": true,
"**/*.lxo": true,
"**/*.LXO": true,
"**/*.ma": true,
"**/*.MA": true,
"**/*.obj": true,
"**/*.OBJ": true,
"**/*.asset": true,
"**/*.cubemap": true,
"**/*.flare": true,
"**/*.mat": true,
"**/*.meta": true,
"**/*.prefab": true,
"**/*.unity": true,
"build/": true,
"Build/": true,
"Library/": true,
"library/": true,
"obj/": true,
"Obj/": true,
"ProjectSettings/": true,
"temp/": true,
"Temp/": true
},
"dotnet.defaultSolution": "HeavenStudio.sln"
}

View file

@ -19,7 +19,7 @@ Material:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 89e1b1c005d29cf4598ea861deb35a80, type: 3}
m_Texture: {fileID: 2800000, guid: 8b8c8a10edf94ddc8cc4cc4fcd5696a9, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:

View file

@ -11,6 +11,16 @@ PluginImporter:
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 0
- first:
Any:
second:
@ -19,9 +29,35 @@ PluginImporter:
- first:
Editor: Editor
second:
enabled: 0
enabled: 1
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: x86_64
userData:
assetBundleName:
assetBundleVariant:

View file

@ -6,7 +6,7 @@ PluginImporter:
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isPreloaded: 1
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
@ -19,7 +19,7 @@ PluginImporter:
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 1
Exclude Win: 0
Exclude Win64: 0
- first:
Any:
@ -31,7 +31,7 @@ PluginImporter:
second:
enabled: 1
settings:
CPU: x86_64
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
@ -49,9 +49,9 @@ PluginImporter:
- first:
Standalone: Win
second:
enabled: 0
enabled: 1
settings:
CPU: None
CPU: x86
- first:
Standalone: Win64
second:

View file

@ -6,11 +6,21 @@ PluginImporter:
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isPreloaded: 1
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 1
Exclude Win: 0
Exclude Win64: 0
- first:
Any:
second:
@ -18,10 +28,36 @@ PluginImporter:
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
DefaultValueInitialized: true
CPU: None
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: x86_64
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 099214b717710f8468369d6cfe2f7135
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,63 +0,0 @@
fileFormatVersion: 2
guid: c603b06f7fc73b9448935991b913d915
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 1
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 47521c369c3ab7849aeb7e479bad21ea
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 12b152ed16fe1eb4698be175f621ffe4
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1055,15 +1055,17 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 50
m_enableWordWrapping: 0
m_TextWrappingMode: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@ -1713,15 +1715,17 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 3
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 00000000
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@ -2602,15 +2606,17 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 3
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
@ -4187,10 +4193,6 @@ MonoBehaviour:
SoundSequences: []
EligibleHits: []
scheduledInputs: []
firstEnable: 0
alienSpeakCount: 0
translatorSpeakCount: 0
hasMissed: 0
alien: {fileID: 1725356918350344904}
translator: {fileID: 2669316826032871973}
missionControl: {fileID: 1703073459706337243}

View file

@ -1,8 +1,8 @@
using System;
public static class AppInfo {
public const string Version = "0.0.981";
public static readonly DateTime Date = new DateTime(2023, 06, 19, 03, 38, 42, 219, DateTimeKind.Utc);
public const string Version = "0.0.982";
public static readonly DateTime Date = new DateTime(2023, 09, 11, 20, 44, 02, 741, DateTimeKind.Utc);
}

View file

@ -1,16 +1,25 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Starpelly;
using Jukebox;
using Jukebox.Legacy;
using HeavenStudio.Util;
namespace HeavenStudio
{
// [RequireComponent(typeof(AudioSource))]
public class Conductor : MonoBehaviour
{
public struct AddedPitchChange
{
public double time;
public float pitch;
}
public List<AddedPitchChange> addedPitchChanges = new List<AddedPitchChange>();
// Song beats per minute
// This is determined by the song you're trying to sync up to
public float songBpm;
@ -25,18 +34,19 @@ namespace HeavenStudio
// Current song position, in seconds
private double songPos; // for Conductor use only
public float songPosition => (float) songPos;
public float songPosition => (float)songPos;
public double songPositionAsDouble => songPos;
// Current song position, in beats
public double songPosBeat; // for Conductor use only
public float songPositionInBeats => (float) songPosBeat;
public float songPositionInBeats => (float)songPosBeat;
public double songPositionInBeatsAsDouble => songPosBeat;
// Current time of the song
private double time;
double dspTime, lastDspTime;
double absTime, lastAbsTime;
double dspTime;
double absTime, absTimeAdjust;
double dspMargin = 128 / 44100.0;
// the dspTime we started at
private double dspStart;
@ -45,6 +55,7 @@ namespace HeavenStudio
DateTime startTime;
//the beat we started at
private double startPos;
private double startBeat;
public double startBeatAsDouble => startBeat;
@ -59,7 +70,7 @@ namespace HeavenStudio
// Conductor is currently playing song
public bool isPlaying;
// Conductor is currently paused, but not fully stopped
public bool isPaused;
@ -79,16 +90,40 @@ namespace HeavenStudio
public void SetTimelinePitch(float pitch)
{
if (pitch != 0 && pitch * minigamePitch != SongPitch)
{
Debug.Log("added pitch change " + pitch * minigamePitch + " at" + absTime);
addedPitchChanges.Add(new AddedPitchChange { time = absTime, pitch = pitch * minigamePitch });
}
timelinePitch = pitch;
musicSource.pitch = SongPitch;
}
public void SetMinigamePitch(float pitch)
{
if (pitch != 0 && pitch * timelinePitch != SongPitch)
{
Debug.Log("added pitch change " + pitch * timelinePitch + " at" + absTime);
addedPitchChanges.Add(new AddedPitchChange { time = absTime, pitch = pitch * timelinePitch });
}
minigamePitch = pitch;
musicSource.pitch = SongPitch;
}
public void SetMinigamePitch(float pitch, double beat)
{
BeatAction.New( this,
new List<BeatAction.Action> {
new BeatAction.Action(beat, delegate {
SetMinigamePitch(pitch);
}),
}
);
}
void Awake()
{
instance = this;
@ -97,13 +132,16 @@ namespace HeavenStudio
void Start()
{
musicSource.priority = 0;
AudioConfiguration config = AudioSettings.GetConfiguration();
dspMargin = 2 * (config.dspBufferSize / (double)config.sampleRate);
addedPitchChanges.Clear();
}
public void SetBeat(double beat)
{
var chart = GameManager.instance.Beatmap;
double offset = chart.data.offset;
double startPos = GetSongPosFromBeat(beat);
startPos = GetSongPosFromBeat(beat);
double dspTime = AudioSettings.dspTime;
@ -113,19 +151,29 @@ namespace HeavenStudio
SeekMusicToTime(startPos);
songPosBeat = GetBeatFromSongPos(time);
GameManager.instance.SetCurrentEventToClosest(beat);
}
public void Play(double beat)
{
if (isPlaying) return;
if (!isPaused)
{
AudioConfiguration config = AudioSettings.GetConfiguration();
dspMargin = 2 * (config.dspBufferSize / (double)config.sampleRate);
addedPitchChanges.Clear();
addedPitchChanges.Add(new AddedPitchChange { time = 0, pitch = SongPitch });
}
var chart = GameManager.instance.Beatmap;
double offset = chart.data.offset;
double dspTime = AudioSettings.dspTime;
GameManager.instance.SortEventsList();
double startPos = GetSongPosFromBeat(beat);
dspStart = dspTime;
startPos = GetSongPosFromBeat(beat);
firstBeatOffset = offset;
time = startPos;
@ -137,24 +185,21 @@ namespace HeavenStudio
{
musicScheduledTime = dspTime + musicStartDelay / SongPitch;
musicScheduledPitch = SongPitch;
musicSource.PlayScheduled(musicScheduledTime);
}
else
{
musicScheduledTime = dspTime;
musicScheduledPitch = SongPitch;
musicSource.Play();
}
musicSource.PlayScheduled(musicScheduledTime);
}
songPosBeat = GetBeatFromSongPos(time);
startTime = DateTime.Now;
lastAbsTime = 0;
lastDspTime = AudioSettings.dspTime;
dspStart = dspTime;
startBeat = songPosBeat;
absTimeAdjust = 0;
startTime = DateTime.Now;
isPlaying = true;
isPaused = false;
}
@ -170,10 +215,15 @@ namespace HeavenStudio
public void Stop(double time)
{
if (absTimeAdjust != 0)
{
Debug.Log($"Last playthrough had a dsp (audio) drift of {absTimeAdjust}.\nConsider increasing audio buffer size if audio distortion was present.");
}
this.time = time;
songPos = time;
songPosBeat = 0;
absTimeAdjust = 0;
isPlaying = false;
isPaused = false;
@ -181,13 +231,48 @@ namespace HeavenStudio
musicSource.Stop();
}
void SeekMusicToTime(double startPos)
/// <summary>
/// stops playback of the audio without stopping beatkeeping
/// </summary>
public void StopOnlyAudio()
{
musicSource.Stop();
}
/// <summary>
/// fades out the audio over a duration
/// </summary>
/// <param name="duration">duration of the fade</param>
public void FadeOutAudio(float duration)
{
StartCoroutine(FadeOutAudioCoroutine(duration));
}
IEnumerator FadeOutAudioCoroutine(float duration)
{
float startVolume = musicSource.volume;
float endVolume = 0f;
float startTime = Time.time;
float endTime = startTime + duration;
while (Time.time < endTime)
{
float t = (Time.time - startTime) / duration;
musicSource.volume = Mathf.Lerp(startVolume, endVolume, t);
yield return null;
}
musicSource.volume = endVolume;
StopOnlyAudio();
}
void SeekMusicToTime(double fStartPos)
{
double offset = GameManager.instance.Beatmap.data.offset;
if (musicSource.clip != null && startPos < musicSource.clip.length - offset)
if (musicSource.clip != null && fStartPos < musicSource.clip.length - offset)
{
// https://www.desmos.com/calculator/81ywfok6xk
double musicStartDelay = -offset - startPos;
double musicStartDelay = -offset - fStartPos;
if (musicStartDelay > 0)
{
musicSource.timeSamples = 0;
@ -195,24 +280,13 @@ namespace HeavenStudio
else
{
int freq = musicSource.clip.frequency;
int samples = (int)(freq * (startPos + offset));
int samples = (int)(freq * (fStartPos + offset));
musicSource.timeSamples = samples;
}
}
}
double deltaTimeReal { get {
double ret = absTime - lastAbsTime;
lastAbsTime = absTime;
return ret;
}}
double deltaTimeDsp { get {
double ret = dspTime - lastDspTime;
lastDspTime = dspTime;
return ret;
}}
public void Update()
{
if (isPlaying)
@ -229,24 +303,54 @@ namespace HeavenStudio
musicSource.UnPause();
musicScheduledPitch = SongPitch;
musicScheduledTime = (AudioSettings.dspTime + (-GameManager.instance.Beatmap.data.offset - songPositionAsDouble)/(double)SongPitch);
musicScheduledTime = (AudioSettings.dspTime + (-GameManager.instance.Beatmap.data.offset - songPositionAsDouble) / (double)SongPitch);
musicSource.SetScheduledStartTime(musicScheduledTime);
}
}
absTime = (DateTime.Now - startTime).TotalSeconds;
//dspTime to sync with audio thread in case of drift
dspTime = AudioSettings.dspTime - dspStart;
double dt = deltaTimeReal;
if (Math.Abs(absTime + absTimeAdjust - dspTime) > dspMargin)
{
int i = 0;
while (Math.Abs(absTime + absTimeAdjust - dspTime) > dspMargin)
{
i++;
absTimeAdjust = (dspTime - absTime + absTimeAdjust) * 0.5;
if (i > 8) break;
}
}
//todo: dspTime to sync with audio thread in case of drift
time = MapTimeToPitchChanges(absTime + absTimeAdjust);
time += dt * SongPitch;
songPos = time;
songPos = startPos + time;
songPosBeat = GetBeatFromSongPos(songPos);
}
}
double MapTimeToPitchChanges(double time)
{
double counter = 0;
double lastChangeTime = 0;
float pitch = addedPitchChanges[0].pitch;
foreach (var pch in addedPitchChanges)
{
double changeTime = pch.time;
if (changeTime > time)
{
break;
}
counter += (changeTime - lastChangeTime) * pitch;
lastChangeTime = changeTime;
pitch = pch.pitch;
}
counter += (time - lastChangeTime) * pitch;
return counter;
}
public void LateUpdate()
{
@ -265,7 +369,7 @@ namespace HeavenStudio
{
if (metronomeSound != null)
{
metronomeSound.Delete();
metronomeSound.Stop();
metronomeSound = null;
}
}
@ -352,53 +456,53 @@ namespace HeavenStudio
break;
}
counter += (t.beat - lastTempoChangeBeat) * 60/bpm;
counter += (t.beat - lastTempoChangeBeat) * 60 / bpm;
bpm = t["tempo"];
lastTempoChangeBeat = t.beat;
}
counter += (beat - lastTempoChangeBeat) * 60/bpm;
counter += (beat - lastTempoChangeBeat) * 60 / bpm;
return counter;
}
//thank you @wooningcharithri#7419 for the psuedo-code
public double BeatsToSecs(double beats, float bpm)
{
return beats / bpm * 60f;
}
public double SecsToBeats(double s, float bpm)
{
return s / 60f * bpm;
}
public double BeatsToSecs(double beats, float bpm)
{
return beats / bpm * 60f;
}
public double SecsToBeats(double s, float bpm)
{
return s / 60f * bpm;
}
public double GetBeatFromSongPos(double seconds)
{
double lastTempoChangeBeat = 0f;
double counterSeconds = 0;
float lastBpm = 120f;
foreach (RiqEntity t in GameManager.instance.Beatmap.TempoChanges)
{
double beatToNext = t.beat - lastTempoChangeBeat;
double secToNext = BeatsToSecs(beatToNext, lastBpm);
double nextSecs = counterSeconds + secToNext;
public double GetBeatFromSongPos(double seconds)
{
double lastTempoChangeBeat = 0f;
double counterSeconds = 0;
float lastBpm = 120f;
if (nextSecs >= seconds)
break;
lastTempoChangeBeat = t.beat;
lastBpm = t["tempo"];
counterSeconds = nextSecs;
}
return lastTempoChangeBeat + SecsToBeats(seconds - counterSeconds, lastBpm);
foreach (RiqEntity t in GameManager.instance.Beatmap.TempoChanges)
{
double beatToNext = t.beat - lastTempoChangeBeat;
double secToNext = BeatsToSecs(beatToNext, lastBpm);
double nextSecs = counterSeconds + secToNext;
if (nextSecs >= seconds)
break;
lastTempoChangeBeat = t.beat;
lastBpm = t["tempo"];
counterSeconds = nextSecs;
}
return lastTempoChangeBeat + SecsToBeats(seconds - counterSeconds, lastBpm);
}
//
// convert real seconds to beats
public double GetRestFromRealTime(double seconds)
{
return seconds/pitchedSecPerBeat;
return seconds / pitchedSecPerBeat;
}
public void SetBpm(float bpm)

View file

@ -108,6 +108,27 @@ namespace HeavenStudio
}
}
static bool StringStartsWith(string a, string b)
{
int aLen = a.Length;
int bLen = b.Length;
int ap = 0; int bp = 0;
while (ap < aLen && bp < bLen && a [ap] == b [bp])
{
ap++;
bp++;
}
return (bp == bLen);
}
public static bool IsGameSwitch(RiqEntity entity)
{
return StringStartsWith(entity.datamodel, "gameManager/switchGame");
}
public static List<RiqEntity> GetAllInGameManagerList(string gameName, string[] include)
{
List<RiqEntity> temp1 = GameManager.instance.Beatmap.Entities.FindAll(c => c.datamodel.Split('/')[0] == gameName);

View file

@ -88,6 +88,7 @@ namespace HeavenStudio
AudioSource source = Conductor.AddComponent<AudioSource>();
Conductor.AddComponent<Conductor>();
Conductor.GetComponent<Conductor>().musicSource = source;
source.priority = 255;
source.outputAudioMixerGroup = Settings.GetMusicMixer();
// Conductor.AddComponent<AudioDspTimeKeeper>();

View file

@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Pool;
using Starpelly;
using Jukebox;
@ -14,10 +15,13 @@ namespace HeavenStudio
{
public class GameManager : MonoBehaviour
{
const int SoundPoolSizeMin = 32;
const int SoundPoolSizeMax = 32;
[Header("Lists")]
[NonSerialized] public RiqBeatmap Beatmap = new();
private List<GameObject> preloadedGames = new List<GameObject>();
[NonSerialized] public List<GameObject> SoundObjects = new List<GameObject>();
private List<GameObject> preloadedGames = new();
[NonSerialized] public ObjectPool<Sound> SoundObjects;
[Header("Components")]
[NonSerialized] public Camera GameCamera, CursorCam, OverlayCamera, StaticCamera;
@ -34,7 +38,8 @@ namespace HeavenStudio
[NonSerialized] public string txt = null;
[NonSerialized] public string ext = null;
[NonSerialized] public int currentEvent, currentTempoEvent, currentVolumeEvent, currentSectionEvent,
[NonSerialized]
public int currentEvent, currentTempoEvent, currentVolumeEvent, currentSectionEvent,
currentPreEvent, currentPreSwitch, currentPreSequence;
[NonSerialized] public double endBeat;
[NonSerialized] public float startOffset;
@ -49,6 +54,9 @@ namespace HeavenStudio
bool AudioLoadDone;
bool ChartLoadError;
List<double> eventBeats, tempoBeats, volumeBeats, sectionBeats;
List<RiqEntity> allGameSwitches;
public event Action<double> onBeatChanged;
public event Action<RiqEntity> onSectionChange;
@ -109,7 +117,7 @@ namespace HeavenStudio
{
AudioLoadDone = false;
ChartLoadError = false;
currentPreEvent= 0;
currentPreEvent = 0;
currentPreSwitch = 0;
currentPreSequence = 0;
@ -138,7 +146,9 @@ namespace HeavenStudio
GoForAPerfect.instance.Disable();
/////
SoundObjects = new ObjectPool<Sound>(CreatePooledSound, OnTakePooledSound, OnReturnPooledSound, OnDestroyPooledSound, true, SoundPoolSizeMin, SoundPoolSizeMax);
if (preLoaded)
{
@ -154,8 +164,9 @@ namespace HeavenStudio
if (Beatmap.Entities.Count >= 1)
{
SetCurrentGame(Beatmap.Entities[0].datamodel.Split(0));
SetGame(Beatmap.Entities[0].datamodel.Split(0));
string game = Beatmap.Entities[0].datamodel.Split(0);
SetCurrentGame(game);
SetGame(game);
}
else
{
@ -168,8 +179,42 @@ namespace HeavenStudio
}
}
Sound CreatePooledSound()
{
GameObject oneShot = new GameObject($"Pooled Scheduled Sound");
oneShot.transform.SetParent(transform);
AudioSource audioSource = oneShot.AddComponent<AudioSource>();
audioSource.playOnAwake = false;
Sound snd = oneShot.AddComponent<Sound>();
oneShot.SetActive(false);
return snd;
}
// Called when an item is returned to the pool using Release
void OnReturnPooledSound(Sound snd)
{
snd.Stop();
}
// Called when an item is taken from the pool using Get
void OnTakePooledSound(Sound snd)
{
snd.gameObject.SetActive(true);
}
// If the pool capacity is reached then any items returned will be destroyed.
void OnDestroyPooledSound(Sound snd)
{
snd.Stop();
Destroy(snd.gameObject);
}
public void NewRemix()
{
{
AudioLoadDone = false;
Beatmap = new("1", "HeavenStudio");
Beatmap.data.properties = Minigames.propertiesModel;
@ -246,8 +291,9 @@ namespace HeavenStudio
if (Beatmap.Entities.Count >= 1)
{
SetCurrentGame(Beatmap.Entities[0].datamodel.Split(0));
SetGame(Beatmap.Entities[0].datamodel.Split(0));
string game = Beatmap.Entities[0].datamodel.Split(0);
SetCurrentGame(game);
SetGame(game);
}
else
{
@ -260,7 +306,7 @@ namespace HeavenStudio
if (Beatmap.data.riqOrigin != "HeavenStudio")
{
string origin = Beatmap.data.riqOrigin?.DisplayName() ?? "Unknown Origin";
GlobalGameManager.ShowErrorMessage("Warning",
GlobalGameManager.ShowErrorMessage("Warning",
$"This chart came from\n<alpha=#AA>{origin}</color>\nand uses content not included in Heaven Studio.\n\n<color=\"yellow\">You may be able to edit this chart in Heaven Studio to be used in its original program.</color>");
}
}
@ -275,7 +321,7 @@ namespace HeavenStudio
{
SkillStarManager.instance.KillStar();
}
if (SkillStarManager.instance.IsEligible && !skillStarCollected && accuracy >= 1f)
{
if (SkillStarManager.instance.DoStarJust())
@ -287,18 +333,35 @@ namespace HeavenStudio
TimingAccuracyDisplay.instance.MakeAccuracyVfx(time, late);
}
static bool StringStartsWith(string a, string b)
{
int aLen = a.Length;
int bLen = b.Length;
int ap = 0; int bp = 0;
while (ap < aLen && bp < bLen && a [ap] == b [bp])
{
ap++;
bp++;
}
return (bp == bLen);
}
public void SeekAheadAndPreload(double start, float seekTime = 8f)
{
List<RiqEntity> entitiesAtSameBeat = ListPool<RiqEntity>.Get();
Minigames.Minigame inf;
//seek ahead to preload games that have assetbundles
//check game switches first
var gameSwitchs = Beatmap.Entities.FindAll(c => c.datamodel.Split(1) == "switchGame");
if (currentPreSwitch < gameSwitchs.Count && currentPreSwitch >= 0)
if (currentPreSwitch < allGameSwitches.Count && currentPreSwitch >= 0)
{
if (start + seekTime >= gameSwitchs[currentPreSwitch].beat)
if (start + seekTime >= allGameSwitches[currentPreSwitch].beat)
{
string gameName = gameSwitchs[currentPreSwitch].datamodel.Split(2);
var inf = GetGameInfo(gameName);
if (inf != null && inf.usesAssetBundle && !inf.AssetsLoaded)
string gameName = allGameSwitches[currentPreSwitch].datamodel.Split('/')[2];
inf = GetGameInfo(gameName);
if (inf != null && inf.usesAssetBundle && !inf.AssetsLoaded)
{
Debug.Log($"ASYNC loading assetbundles for game {gameName}");
StartCoroutine(inf.LoadCommonAssetBundleAsync());
@ -308,18 +371,23 @@ namespace HeavenStudio
}
}
//then check game entities
List<double> entities = Beatmap.Entities.Select(c => c.beat).ToList();
if (currentPreEvent < Beatmap.Entities.Count && currentPreEvent >= 0)
{
if (start + seekTime >= entities[currentPreEvent])
if (start + seekTime >= eventBeats[currentPreEvent])
{
var entitiesAtSameBeat = Beatmap.Entities.FindAll(c => c.beat == Beatmap.Entities[currentPreEvent].beat && !EventCaller.FXOnlyGames().Contains(EventCaller.instance.GetMinigame(c.datamodel.Split('/')[0])));
foreach (RiqEntity entity in Beatmap.Entities)
{
if (entity.beat == Beatmap.Entities[currentPreEvent].beat && !EventCaller.FXOnlyGames().Contains(eventCaller.GetMinigame(entity.datamodel.Split('/')[0])))
{
entitiesAtSameBeat.Add(entity);
}
}
SortEventsByPriority(entitiesAtSameBeat);
foreach (RiqEntity entity in entitiesAtSameBeat)
{
string gameName = entity.datamodel.Split('/')[0];
var inf = GetGameInfo(gameName);
if (inf != null && inf.usesAssetBundle && !inf.AssetsLoaded)
inf = GetGameInfo(gameName);
if (inf != null && inf.usesAssetBundle && !inf.AssetsLoaded)
{
Debug.Log($"ASYNC loading assetbundles for game {gameName}");
StartCoroutine(inf.LoadCommonAssetBundleAsync());
@ -329,29 +397,39 @@ namespace HeavenStudio
}
}
}
ListPool<RiqEntity>.Release(entitiesAtSameBeat);
}
public void SeekAheadAndDoPreEvent(double start)
{
List<double> entities = Beatmap.Entities.Select(c => c.beat).ToList();
if (currentPreSequence < Beatmap.Entities.Count && currentPreSequence >= 0)
{
var seekEntity = Beatmap.Entities[currentPreSequence];
List<RiqEntity> entitiesAtSameBeat = ListPool<RiqEntity>.Get();
RiqEntity seekEntity = Beatmap.Entities[currentPreSequence];
float seekTime = EventCaller.instance.GetGameAction(
EventCaller.instance.GetMinigame(seekEntity.datamodel.Split(0)), seekEntity.datamodel.Split(1)).preFunctionLength;
if (start + seekTime >= entities[currentPreSequence])
foreach (RiqEntity entity in Beatmap.Entities)
{
if (entity.beat == seekEntity.beat)
{
entitiesAtSameBeat.Add(entity);
}
}
SortEventsByPriority(entitiesAtSameBeat);
string[] seekEntityDatamodel = seekEntity.datamodel.Split('/');
float seekTime = eventCaller.GetGameAction(
eventCaller.GetMinigame(seekEntityDatamodel[0]), seekEntityDatamodel[1]).preFunctionLength;
if (start + seekTime >= eventBeats[currentPreSequence])
{
double beat = seekEntity.beat;
var entitiesAtSameBeat = Beatmap.Entities.FindAll(c => c.beat == seekEntity.beat);
SortEventsByPriority(entitiesAtSameBeat);
foreach (RiqEntity entity in entitiesAtSameBeat)
{
currentPreSequence++;
string gameName = entity.datamodel.Split('/')[0];
var inf = GetGameInfo(gameName);
if (inf != null && inf.usesAssetBundle && inf.AssetsLoaded && !inf.SequencesPreloaded)
if (inf != null && inf.usesAssetBundle && inf.AssetsLoaded && !inf.SequencesPreloaded)
{
Debug.Log($"Preloading game {gameName}");
PreloadGameSequences(gameName);
@ -359,6 +437,7 @@ namespace HeavenStudio
eventCaller.CallPreEvent(entity);
}
}
ListPool<RiqEntity>.Release(entitiesAtSameBeat);
}
}
@ -369,33 +448,28 @@ namespace HeavenStudio
if (!Conductor.instance.isPlaying)
return;
Conductor cond = Conductor.instance;
List<double> entities = Beatmap.Entities.Select(c => c.beat).ToList();
List<double> tempoChanges = Beatmap.TempoChanges.Select(c => c.beat).ToList();
if (currentTempoEvent < Beatmap.TempoChanges.Count && currentTempoEvent >= 0)
{
if (cond.songPositionInBeatsAsDouble >= tempoChanges[currentTempoEvent])
if (cond.songPositionInBeatsAsDouble >= tempoBeats[currentTempoEvent])
{
cond.SetBpm(Beatmap.TempoChanges[currentTempoEvent]["tempo"]);
currentTempoEvent++;
}
}
List<double> volumeChanges = Beatmap.VolumeChanges.Select(c => c.beat).ToList();
if (currentVolumeEvent < Beatmap.VolumeChanges.Count && currentVolumeEvent >= 0)
{
if (cond.songPositionInBeatsAsDouble >= volumeChanges[currentVolumeEvent])
if (cond.songPositionInBeatsAsDouble >= volumeBeats[currentVolumeEvent])
{
cond.SetVolume(Beatmap.VolumeChanges[currentVolumeEvent]["volume"]);
currentVolumeEvent++;
}
}
List<double> chartSections = Beatmap.SectionMarkers.Select(c => c.beat).ToList();
if (currentSectionEvent < Beatmap.SectionMarkers.Count && currentSectionEvent >= 0)
{
if (cond.songPositionInBeatsAsDouble >= chartSections[currentSectionEvent])
if (cond.songPositionInBeatsAsDouble >= sectionBeats[currentSectionEvent])
{
Debug.Log("Section " + Beatmap.SectionMarkers[currentSectionEvent]["sectionName"] + " started");
currentSection = Beatmap.SectionMarkers[currentSectionEvent];
@ -411,24 +485,39 @@ namespace HeavenStudio
float seekTime = 8f;
//seek ahead to preload games that have assetbundles
SeekAheadAndPreload(cond.songPositionInBeatsAsDouble, seekTime);
SeekAheadAndDoPreEvent(Conductor.instance.songPositionInBeatsAsDouble);
SeekAheadAndDoPreEvent(cond.songPositionInBeatsAsDouble);
if (currentEvent < Beatmap.Entities.Count && currentEvent >= 0)
{
if (cond.songPositionInBeatsAsDouble >= entities[currentEvent])
if (cond.songPositionInBeatsAsDouble >= eventBeats[currentEvent])
{
List<RiqEntity> entitiesAtSameBeat = ListPool<RiqEntity>.Get();
List<RiqEntity> fxEntities = ListPool<RiqEntity>.Get();
// allows for multiple events on the same beat to be executed on the same frame, so no more 1-frame delay
var entitiesAtSameBeat = Beatmap.Entities.FindAll(c => c.beat == Beatmap.Entities[currentEvent].beat && !EventCaller.FXOnlyGames().Contains(EventCaller.instance.GetMinigame(c.datamodel.Split('/')[0])));
var fxEntities = Beatmap.Entities.FindAll(c => c.beat == Beatmap.Entities[currentEvent].beat && EventCaller.FXOnlyGames().Contains(EventCaller.instance.GetMinigame(c.datamodel.Split('/')[0])));
using (PooledObject<List<RiqEntity>> pool = ListPool<RiqEntity>.Get(out List<RiqEntity> currentBeatEntities))
{
currentBeatEntities = Beatmap.Entities.FindAll(c => c.beat == Beatmap.Entities[currentEvent].beat);
foreach (RiqEntity entity in currentBeatEntities)
{
if (EventCaller.FXOnlyGames().Contains(eventCaller.GetMinigame(entity.datamodel.Split('/')[0])))
{
fxEntities.Add(entity);
}
else
{
entitiesAtSameBeat.Add(entity);
}
}
}
SortEventsByPriority(fxEntities);
SortEventsByPriority(entitiesAtSameBeat);
// FX entities should ALWAYS execute before gameplay entities
for (int i = 0; i < fxEntities.Count; i++)
foreach (RiqEntity entity in fxEntities)
{
eventCaller.CallEvent(fxEntities[i], true);
eventCaller.CallEvent(entity, true);
currentEvent++;
}
@ -447,6 +536,9 @@ namespace HeavenStudio
// Thank you to @shshwdr for bring this to my attention
currentEvent++;
}
ListPool<RiqEntity>.Release(entitiesAtSameBeat);
ListPool<RiqEntity>.Release(fxEntities);
}
}
@ -465,7 +557,8 @@ namespace HeavenStudio
}
}
private void LateUpdate() {
private void LateUpdate()
{
OverlaysManager.instance.TogleOverlaysVisibility(Editor.Editor.instance == null || Editor.Editor.instance.fullscreen || ((PersistentDataManager.gameSettings.overlaysInEditor) && (!Editor.Editor.instance.fullscreen)) || HeavenStudio.Editor.GameSettings.InPreview);
}
@ -509,23 +602,24 @@ namespace HeavenStudio
yield return new WaitForSeconds(delay);
bool paused = Conductor.instance.isPaused;
Conductor.instance.Play(beat);
if (paused)
{
Util.SoundByte.UnpauseOneShots();
}
else
else
{
Conductor.instance.SetBpm(Beatmap.TempoChanges[0]["tempo"]);
Conductor.instance.SetVolume(Beatmap.VolumeChanges[0]["volume"]);
Conductor.instance.firstBeatOffset = Beatmap.data.offset;
SetCurrentEventToClosest(beat);
KillAllSounds();
}
Minigame miniGame = currentGameO.GetComponent<Minigame>();
if (miniGame != null)
miniGame.OnPlay(beat);
Minigame miniGame = currentGameO?.GetComponent<Minigame>();
if (miniGame != null)
miniGame.OnPlay(beat);
}
Conductor.instance.Play(beat);
}
public void Pause()
@ -544,7 +638,6 @@ namespace HeavenStudio
Conductor.instance.Stop(beat);
SetCurrentEventToClosest(beat);
onBeatChanged?.Invoke(beat);
KillAllSounds();
// I feel like I should standardize the names
SkillStarManager.instance.KillStar();
@ -555,7 +648,7 @@ namespace HeavenStudio
// pass this data to rating screen + stats
Debug.Log($"== Playthrough statistics of {Beatmap["remixtitle"]} (played at {System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}) ==");
Debug.Log($"Average input offset for playthrough: {averageInputOffset}ms");
Debug.Log($"Accuracy for playthrough: {(PlayerAccuracy * 100) : 0.00}");
Debug.Log($"Accuracy for playthrough: {(PlayerAccuracy * 100): 0.00}");
Debug.Log($"Cleared {clearedSections.FindAll(c => c).Count} sections out of {Beatmap.SectionMarkers.Count}");
if (SkillStarManager.instance.IsCollected)
Debug.Log($"Skill Star collected");
@ -563,7 +656,8 @@ namespace HeavenStudio
Debug.Log($"Skill Star not collected");
if (GoForAPerfect.instance.perfect)
Debug.Log($"Perfect Clear!");
KillAllSounds();
if (playOnStart || restart)
{
Play(0, restartDelay);
@ -573,12 +667,16 @@ namespace HeavenStudio
private IEnumerator WaitReadyAndPlayCo(double beat)
{
WaitUntil yieldOverlays = new WaitUntil(() => OverlaysManager.OverlaysReady);
WaitUntil yieldBeatmap = new WaitUntil(() => Beatmap != null && Beatmap.Entities.Count > 0);
WaitUntil yieldAudio = new WaitUntil(() => AudioLoadDone || (ChartLoadError && !GlobalGameManager.IsShowingDialog));
// wait for overlays to be ready
yield return new WaitUntil(() => OverlaysManager.OverlaysReady);
yield return yieldOverlays;
// wait for first game to be loaded
yield return new WaitUntil(() => Beatmap != null && Beatmap.Entities.Count > 0);
yield return yieldBeatmap;
//wait for audio clip to be loaded
yield return new WaitUntil(() => AudioLoadDone || (ChartLoadError && !GlobalGameManager.IsShowingDialog));
yield return yieldAudio;
SkillStarManager.instance.KillStar();
TimingAccuracyDisplay.instance.StopStarFlash();
@ -588,13 +686,12 @@ namespace HeavenStudio
GlobalGameManager.UpdateDiscordStatus(Beatmap["remixtitle"], false, true);
Play(beat, 1f);
yield break;
}
public void KillAllSounds()
{
for (int i = 0; i < SoundObjects.Count; i++)
Destroy(SoundObjects[i].gameObject);
Debug.Log("Killing all sounds");
SoundObjects.Clear();
Util.SoundByte.KillOneShots();
}
@ -609,15 +706,28 @@ namespace HeavenStudio
Beatmap.TempoChanges.Sort((x, y) => x.beat.CompareTo(y.beat));
Beatmap.VolumeChanges.Sort((x, y) => x.beat.CompareTo(y.beat));
Beatmap.SectionMarkers.Sort((x, y) => x.beat.CompareTo(y.beat));
eventBeats = Beatmap.Entities.Select(c => c.beat).ToList();
tempoBeats = Beatmap.TempoChanges.Select(c => c.beat).ToList();
volumeBeats = Beatmap.VolumeChanges.Select(c => c.beat).ToList();
sectionBeats = Beatmap.SectionMarkers.Select(c => c.beat).ToList();
allGameSwitches = EventCaller.GetAllInGameManagerList("gameManager", new string[] { "switchGame" });
}
void SortEventsByPriority(List<RiqEntity> entities)
{
entities.Sort((x, y) => {
Minigames.Minigame xGame = EventCaller.instance.GetMinigame(x.datamodel.Split(0));
Minigames.GameAction xAction = EventCaller.instance.GetGameAction(xGame, x.datamodel.Split(1));
Minigames.Minigame yGame = EventCaller.instance.GetMinigame(y.datamodel.Split(0));
Minigames.GameAction yAction = EventCaller.instance.GetGameAction(yGame, y.datamodel.Split(1));
string[] xDatamodel;
string[] yDatamodel;
entities.Sort((x, y) =>
{
xDatamodel = x.datamodel.Split('/');
yDatamodel = y.datamodel.Split('/');
Minigames.Minigame xGame = eventCaller.GetMinigame(xDatamodel[0]);
Minigames.GameAction xAction = eventCaller.GetGameAction(xGame, xDatamodel[1]);
Minigames.Minigame yGame = eventCaller.GetMinigame(yDatamodel[0]);
Minigames.GameAction yAction = eventCaller.GetGameAction(yGame, yDatamodel[1]);
return yAction.priority.CompareTo(xAction.priority);
});
@ -632,25 +742,57 @@ namespace HeavenStudio
return double.MinValue;
}
public static int GetIndexAfter(List<double> list, double compareTo)
{
list.Sort();
if (list.Count > 0)
{
foreach (double item in list)
{
if (item >= compareTo)
{
return Math.Max(list.IndexOf(item), 0);
}
}
return list.Count;
}
return 0;
}
public static int GetIndexBefore(List<double> list, double compareTo)
{
list.Sort();
if (list.Count > 0)
{
foreach (double item in list)
{
if (item >= compareTo)
{
return Math.Max(list.IndexOf(item) - 1, 0);
}
}
return list.Count - 1;
}
return 0;
}
public void SetCurrentEventToClosest(double beat)
{
SortEventsList();
onBeatChanged?.Invoke(beat);
if (Beatmap.Entities.Count > 0)
{
List<double> entities = Beatmap.Entities.Select(c => c.beat).ToList();
currentEvent = GetIndexAfter(eventBeats, beat);
currentPreEvent = GetIndexAfter(eventBeats, beat);
currentPreSequence = GetIndexAfter(eventBeats, beat);
currentEvent = entities.IndexOf(GetClosestInList(entities, beat));
currentPreEvent = entities.IndexOf(GetClosestInList(entities, beat));
currentPreSequence = entities.IndexOf(GetClosestInList(entities, beat));
var gameSwitchs = Beatmap.Entities.FindAll(c => c.datamodel.Split("/")[1] == "switchGame");
var gameSwitchs = Beatmap.Entities.FindAll(c => c.datamodel.Split(1) == "switchGame");
string newGame = Beatmap.Entities[currentEvent].datamodel.Split(0);
string newGame = Beatmap.Entities[Math.Min(currentEvent, eventBeats.Count - 1)].datamodel.Split(0);
if (gameSwitchs.Count > 0)
{
int index = gameSwitchs.FindIndex(c => c.beat == GetClosestInList(gameSwitchs.Select(c => c.beat).ToList(), beat));
int index = GetIndexBefore(gameSwitchs.Select(c => c.beat).ToList(), beat);
currentPreSwitch = index;
var closestGameSwitch = gameSwitchs[index];
if (closestGameSwitch.beat <= beat)
@ -698,13 +840,12 @@ namespace HeavenStudio
if (Beatmap.TempoChanges.Count > 0)
{
currentTempoEvent = 0;
List<double> tempoChanges = Beatmap.TempoChanges.Select(c => c.beat).ToList();
//for tempo changes, just go over all of em until the last one we pass
for (int t = 0; t < tempoChanges.Count; t++)
for (int t = 0; t < tempoBeats.Count; t++)
{
// Debug.Log("checking tempo event " + t + " against beat " + beat + "( tc beat " + tempoChanges[t] + ")");
if (tempoChanges[t] > beat)
if (tempoBeats[t] > beat)
{
break;
}
@ -716,11 +857,10 @@ namespace HeavenStudio
if (Beatmap.VolumeChanges.Count > 0)
{
currentVolumeEvent = 0;
List<double> volumeChanges = Beatmap.VolumeChanges.Select(c => c.beat).ToList();
for (int t = 0; t < volumeChanges.Count; t++)
for (int t = 0; t < volumeBeats.Count; t++)
{
if (volumeChanges[t] > beat)
if (volumeBeats[t] > beat)
{
break;
}
@ -733,11 +873,10 @@ namespace HeavenStudio
if (Beatmap.SectionMarkers.Count > 0)
{
currentSectionEvent = 0;
List<double> beatmapSections = Beatmap.SectionMarkers.Select(c => c.beat).ToList();
for (int t = 0; t < beatmapSections.Count; t++)
for (int t = 0; t < sectionBeats.Count; t++)
{
if (beatmapSections[t] > beat)
if (sectionBeats[t] > beat)
{
break;
}
@ -763,7 +902,7 @@ namespace HeavenStudio
IEnumerator SwitchGameIE(string game, double beat, bool flash)
{
if(flash)
if (flash)
{
HeavenStudio.StaticCamera.instance.ToggleCanvasVisibility(false);
}
@ -774,8 +913,16 @@ namespace HeavenStudio
if (miniGame != null)
miniGame.OnGameSwitch(beat);
//before beat-based: yield return new WaitForSeconds(0.1f);
yield return new WaitForSeconds(Conductor.instance.pitchedSecPerBeat / 4);
while (beat + 0.25 > Conductor.instance.songPositionInBeats)
{
if (!Conductor.instance.isPlaying)
{
HeavenStudio.StaticCamera.instance.ToggleCanvasVisibility(true);
SetAmbientGlowToCurrentMinigameColor();
StopCoroutine(currentGameSwitchIE);
}
yield return null;
}
HeavenStudio.StaticCamera.instance.ToggleCanvasVisibility(true);
SetAmbientGlowToCurrentMinigameColor();
@ -823,6 +970,7 @@ namespace HeavenStudio
if (gameInfo.usesAssetBundle)
{
//game is packed in an assetbundle, load from that instead
// this is fucked!! figure out a way to make this async
return gameInfo.GetCommonAssetBundle().LoadAsset<GameObject>(name);
}
name = gameInfo.LoadableName;
@ -833,7 +981,7 @@ namespace HeavenStudio
public Minigames.Minigame GetGameInfo(string name)
{
return EventCaller.instance.minigames.Find(c => c.name == name);
return eventCaller.minigames.Find(c => c.name == name);
}
public void SetCurrentGame(string game, bool useMinigameColor = true)
@ -856,7 +1004,7 @@ namespace HeavenStudio
private void SetAmbientGlowToCurrentMinigameColor()
{
if (GetGameInfo(currentGame) != null)
if (GetGameInfo(currentGame) != null)
HeavenStudio.StaticCamera.instance.SetAmbientGlowColour(Colors.Hex2RGB(GetGameInfo(currentGame).color), true);
}

View file

@ -188,7 +188,10 @@ namespace HeavenStudio.Games.Loaders
resizable = true,
parameters = new List<Param>()
{
new Param("enable", true, "Enable"),
new Param("enable", true, "Enable", "", new List<Param.CollapseParam>()
{
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("side", new EntityTypes.Integer(0, 100, 30), "Side Trees", "How many trees per second?"),
new Param("speed", new EntityTypes.Float(-10, 10, 1), "Speed Multiplier"),
@ -750,7 +753,7 @@ namespace HeavenStudio.Games
public void ServeObject(double beat, double targetBeat, bool type)
{
BeatAction.New(gameObject, new List<BeatAction.Action>
BeatAction.New(this, new List<BeatAction.Action>
{
new BeatAction.Action(beat - 0.5, delegate
{
@ -812,12 +815,12 @@ namespace HeavenStudio.Games
public void ForthCountIn4Do(double beat, float length)
{
BeatAction.New(instance.gameObject, instance.ForthCountIn4Action(beat, length));
BeatAction.New(instance, instance.ForthCountIn4Action(beat, length));
}
public void ForthCountIn8Do(double beat, float length)
{
BeatAction.New(instance.gameObject, instance.ForthCountIn8Action(beat, length));
BeatAction.New(instance, instance.ForthCountIn8Action(beat, length));
}
private List<BeatAction.Action> ForthCountIn4Action(double beat, float length)
@ -902,7 +905,7 @@ namespace HeavenStudio.Games
public void ForthVoiceDo(double beat)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
instance.ForthVoiceAction(beat)
});
@ -1065,7 +1068,7 @@ namespace HeavenStudio.Games
tempCounts.Sort((x, y) => x.beat.CompareTo(y.beat));
BeatAction.New(instance.gameObject, tempCounts);
BeatAction.New(instance, tempCounts);
}
public override void OnPlay(double beat)
@ -1217,7 +1220,7 @@ namespace HeavenStudio.Games
if (!(silent || isBaBumBeat) || (isCatch && !silent))
SoundByte.PlayOneShotGame("airRally/nya_" + distanceString, beat, 1, 1, false, false, nyaOffsets[(int)DistanceAtBeat(beat)]);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat - 1, delegate
{
@ -1333,7 +1336,7 @@ namespace HeavenStudio.Games
MultiSound.Play(sounds.ToArray());
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -1397,7 +1400,7 @@ namespace HeavenStudio.Games
if (IsCatchBeat(caller.startBeat + caller.timer + 1))
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 1, delegate
{
@ -1441,7 +1444,7 @@ namespace HeavenStudio.Games
if (IsCatchBeat(caller.startBeat + caller.timer + 2))
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 2, delegate
{

View file

@ -70,7 +70,7 @@ namespace HeavenStudio.Games.Scripts_BoardMeeting
}
game.StopChairLoopSoundIfLastToStop();
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(Conductor.instance.songPositionInBeatsAsDouble + 1.5f, delegate { canBop = true; })
});

View file

@ -169,7 +169,7 @@ namespace HeavenStudio.Games
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
@ -192,7 +192,7 @@ namespace HeavenStudio.Games
new MultiSound.Sound("boardMeeting/three", beat + 1),
new MultiSound.Sound("boardMeeting/stopAll", beat + 2)
});
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { assistantAnim.DoScaledAnimationAsync("One", 0.5f); }),
new BeatAction.Action(beat + 1, delegate { assistantAnim.DoScaledAnimationAsync("Three", 0.5f); }),
@ -254,7 +254,7 @@ namespace HeavenStudio.Games
}));
}
stops.Add(new BeatAction.Action(beat + length * executiveCount + 0.5f, delegate { executivesCanBop = true; }));
BeatAction.New(instance.gameObject, stops);
BeatAction.New(instance, stops);
ScheduleInput(beat, length * (executiveCount - 1), InputType.STANDARD_DOWN, Just, Miss, Empty);
}
@ -295,7 +295,7 @@ namespace HeavenStudio.Games
executives[index].Spin(soundToPlay);
}));
}
BeatAction.New(instance.gameObject, rolls);
BeatAction.New(instance, rolls);
}
@ -402,7 +402,7 @@ namespace HeavenStudio.Games
}
SoundByte.PlayOneShotGame("boardMeeting/stopPlayer");
executives[executiveCount - 1].Stop();
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.timer + caller.startBeat + 1f, delegate
{
@ -436,7 +436,7 @@ namespace HeavenStudio.Games
executives[executiveCount - 1].Stop();
assistantAnim.DoScaledAnimationAsync("Stop", 0.5f);
SoundByte.PlayOneShotGame("boardMeeting/stopAllPlayer");
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.timer + caller.startBeat + 1f, delegate
{

View file

@ -73,7 +73,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleDS
}, forcePlay: true
);
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(sinkBeat, delegate { moving = false; }),
});

View file

@ -22,7 +22,10 @@ namespace HeavenStudio.Games.Loaders
resizable = true,
parameters = new List<Param>()
{
new Param("silent", false, "Mute Audio", "Whether the piano notes should be muted or not."),
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("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("note3", new EntityTypes.Integer(-24, 24, 4), "3rd note", "The number of semitones up or down this note should be pitched"),
@ -340,7 +343,7 @@ namespace HeavenStudio.Games
}
}));
}
BeatAction.New(instance.gameObject, actions);
BeatAction.New(instance, actions);
}
if (!autoLights && !shouldLights)
{
@ -467,7 +470,7 @@ namespace HeavenStudio.Games
public void MultiplePiano(double beat, float length, bool silent, int note1, int note2, int note3, int note4, int note5, int note6)
{
if (silent) return;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { PlayPiano(beat, length, note1); }),
new BeatAction.Action(beat + length, delegate { PlayPiano(beat + length, length, note2); }),

View file

@ -20,7 +20,10 @@ namespace HeavenStudio.Games.Loaders
parameters = new List<Param>()
{
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 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("endSmile", new EntityTypes.Float(2, 100), "End Smile Beat", "How many beats after the catch should the smile end?")
},
preFunction = delegate {var e = eventCaller.currentEntity; CatchyTune.PreDropFruit(e.beat, e["side"], e["smile"], false, e["endSmile"]); },
@ -32,7 +35,10 @@ namespace HeavenStudio.Games.Loaders
parameters = new List<Param>()
{
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 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("endSmile", new EntityTypes.Float(2, 100), "End Smile Beat", "How many beats after the catch should the smile end?")
},
preFunction = delegate {var e = eventCaller.currentEntity; CatchyTune.PreDropFruit(e.beat, e["side"], e["smile"], true, e["endSmile"]); },
@ -223,7 +229,7 @@ namespace HeavenStudio.Games
beat = beat - (isPineapple ? 2f : 1f);
if (GameManager.instance.currentGame == "catchyTune")
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(spawnBeat, delegate { if (instance != null) instance.DropFruit(beat, side, smile, isPineapple, endSmile); }),
});
@ -268,7 +274,7 @@ namespace HeavenStudio.Games
bopRight = whoBopsAuto == (int)WhoBops.Alalin || whoBopsAuto == (int)WhoBops.Both;
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{

View file

@ -148,7 +148,7 @@ namespace HeavenStudio.Games.Scripts_CatchyTune
// play near miss animation
anim.DoScaledAnimation("barely", barelyStart, isPineapple ? 2f : 1f);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(barelyStart + (isPineapple ? 2f : 1f), delegate { Destroy(this.gameObject); }),
});
@ -166,7 +166,7 @@ namespace HeavenStudio.Games.Scripts_CatchyTune
{
game.catchMiss(side, isPineapple);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + beatLength + (isPineapple ? 3f : 1.5f), delegate { Destroy(this.gameObject); }),
});

View file

@ -433,7 +433,7 @@ namespace HeavenStudio.Games
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
@ -476,7 +476,7 @@ namespace HeavenStudio.Games
cueBeat = beat;
cueLength = length - 1f;
if (!shouldSwitchColor) return;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length * 0.5f, delegate { shouldBeBlack = !shouldBeBlack; })
});
@ -523,7 +523,7 @@ namespace HeavenStudio.Games
}
MultiSound.Play(soundsToPlay.ToArray(), forcePlay: true);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -660,7 +660,7 @@ namespace HeavenStudio.Games
}
MultiSound.Play(soundsToPlay.ToArray(), forcePlay: true);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -836,7 +836,7 @@ namespace HeavenStudio.Games
break;
}
MultiSound.Play(soundsToPlay.ToArray(), forcePlay: true);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -1012,7 +1012,7 @@ namespace HeavenStudio.Games
soundsToPlay.Add(new MultiSound.Sound("cheerReaders/bookDiagonal", beat));
}
MultiSound.Play(soundsToPlay.ToArray(), forcePlay: true);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -1218,7 +1218,7 @@ namespace HeavenStudio.Games
break;
}
MultiSound.Play(soundsToPlay.ToArray(), forcePlay: true);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{

View file

@ -216,7 +216,7 @@ namespace HeavenStudio.Games
}
}
if (sounds.Count > 0) clapSounds = MultiSound.Play(sounds.ToArray());
if (actions.Count > 0) clapAction = BeatAction.New(this.gameObject, actions);
if (actions.Count > 0) clapAction = BeatAction.New(this, actions);
// prepare player input
ClappyTrioPlayer.QueueClap(beat, length * (Lion.Count - 1));
@ -249,7 +249,7 @@ namespace HeavenStudio.Games
bops.Add(new BeatAction.Action(spawnBeat, delegate { misses = 0; }));
}
}
if (bops.Count > 0) BeatAction.New(instance.gameObject, bops);
if (bops.Count > 0) BeatAction.New(instance, bops);
}
}

View file

@ -55,7 +55,10 @@ namespace HeavenStudio.Games.Loaders
{
new Param("threshold", new EntityTypes.Integer(1, 80, 8), "Threshold", "For each time the threshold is met a new plant will appear in the veggie bag."),
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 Param("force", false, "Force Amount of Collected Plants", "", new List<Param.CollapseParam>()
{
new Param.CollapseParam(x => (bool)x, new string[] { "forceAmount" })
}),
new Param("forceAmount", new EntityTypes.Integer(0, 1000, 0), "Force Amount")
}
}
@ -168,7 +171,7 @@ namespace HeavenStudio.Games
startBeat = inactiveStart + (stepsPassed * 2f);
// Cue the marching proper to begin when applicable.
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat - 0.25f, delegate { StartMarching(startBeat); })
});

View file

@ -279,7 +279,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp
if (!isMole)
{
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(pickedBeat + 0.5f, delegate { veggieSprite.sortingOrder = -1; }),
new BeatAction.Action(pickedBeat + pickTime, delegate { GameObject.Destroy(gameObject); })
@ -291,7 +291,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp
}
else
{
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(pickedBeat + pickTime, delegate { GameObject.Destroy(gameObject); })
});

View file

@ -294,7 +294,7 @@ namespace HeavenStudio.Games
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
@ -363,7 +363,7 @@ namespace HeavenStudio.Games
}
BeatAction.New(djYellow, new List<BeatAction.Action>()
BeatAction.New(djYellowScript, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -422,7 +422,7 @@ namespace HeavenStudio.Games
}
BeatAction.New(djYellow, new List<BeatAction.Action>()
BeatAction.New(djYellowScript, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.5f, delegate
{
@ -494,7 +494,7 @@ namespace HeavenStudio.Games
});
BeatAction.New(djYellow, new List<BeatAction.Action>()
BeatAction.New(djYellowScript, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { djYellow.GetComponent<Animator>().DoScaledAnimationAsync("Scratcho", 0.5f); }),
new BeatAction.Action(beat + .5f, delegate { djYellow.GetComponent<Animator>().DoScaledAnimationAsync("Scratcho2", 0.5f); }),

View file

@ -206,7 +206,7 @@ namespace HeavenStudio.Games.Scripts_DJSchool
FlashFX(false);
swiping = true;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { anim.Play("Swipe", 0, 0); }),
new BeatAction.Action(beat + 4f, delegate { swiping = false; }),
@ -226,7 +226,7 @@ namespace HeavenStudio.Games.Scripts_DJSchool
{
OnMissSwipeForPlayerInput(caller.timer + caller.startBeat + 1f);
SoundByte.PlayOneShotGame("djSchool/recordSwipe");
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { anim.Play("Swipe", 0, 0); }),
new BeatAction.Action(beat + 4f, delegate { swiping = false; }),
@ -254,7 +254,7 @@ namespace HeavenStudio.Games.Scripts_DJSchool
canBoo = false;
Invoke("EnableBoo", booSound.clip.length);
}
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.timer + caller.startBeat + 1f, delegate
{
@ -276,7 +276,7 @@ namespace HeavenStudio.Games.Scripts_DJSchool
//swiping = false;
mixer.audioMixer.FindSnapshot("Main").TransitionTo(.01f);
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{

View file

@ -55,7 +55,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
void Just(PlayerActionEvent caller, float state)
{
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(conductor.songPositionInBeatsAsDouble + 3f, delegate
{

View file

@ -187,7 +187,7 @@ namespace HeavenStudio.Games
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate { SingleBop(); })
});
@ -220,7 +220,7 @@ namespace HeavenStudio.Games
else if (weaselsHappy) weasels.Happy();
if (!forceNoLeaves)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(Conductor.instance.songPositionInBeatsAsDouble + 1f, delegate
{
@ -321,7 +321,7 @@ namespace HeavenStudio.Games
if (hit)
{
lastHitWeasel = Conductor.instance.songPositionInBeatsAsDouble;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat - (0.25f/3f), delegate { weasels.Hit(beat); }),
});
@ -329,7 +329,7 @@ namespace HeavenStudio.Games
else
{
lastHitWeasel = Conductor.instance.songPositionInBeatsAsDouble;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.25, delegate { weasels.Hide(beat + 0.25f); }),
});

View file

@ -48,7 +48,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
{
notHit = false;
anim.DoScaledAnimationAsync("WeaselsHide", 0.5f);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1.45f, delegate
{
@ -75,7 +75,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
{
notHit = false;
anim.DoScaledAnimationAsync("WeaselsHit", 0.5f);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 2f, delegate
{

View file

@ -63,7 +63,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
SoundByte.PlayOneShot("miss");
game.Kick(false);
GetComponent<SpriteRenderer>().sortingOrder = 8;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(conductor.songPositionInBeatsAsDouble + 4f, delegate
{
@ -73,7 +73,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
return;
}
Hit();
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(conductor.songPositionInBeatsAsDouble + 1f, delegate
{
@ -115,7 +115,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
}
}
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(conductor.songPositionInBeatsAsDouble + 5f, delegate
{

View file

@ -55,7 +55,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
void Just(PlayerActionEvent caller, float state)
{
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(conductor.songPositionInBeatsAsDouble + 3f, delegate
{
@ -89,7 +89,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
SoundByte.PlayOneShotGame("doubleDate/weasel_hide");
game.MissKick(pathStartBeat + 2.25f);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(conductor.songPositionInBeatsAsDouble + 4f, delegate
{

View file

@ -22,7 +22,7 @@ namespace HeavenStudio.Games.Scripts_DrummingPractice
{
game.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN, Just, Miss, Out);
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat+1f, delegate {
SoundByte.PlayOneShotGame("drummingPractice/drum");
@ -46,7 +46,7 @@ namespace HeavenStudio.Games.Scripts_DrummingPractice
private void Miss(PlayerActionEvent caller)
{
game.SetFaces(2);
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat+2f, delegate {
game.SetFaces(0);
@ -64,7 +64,7 @@ namespace HeavenStudio.Games.Scripts_DrummingPractice
if (!_hit)
{
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat+2f, delegate {
game.SetFaces(0);

View file

@ -39,10 +39,13 @@ namespace HeavenStudio.Games.Loaders
defaultLength = 0.5f,
parameters = new List<Param>()
{
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("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("type3", DrummingPractice.MiiType.Random, "Right Mii", "The Mii on the right"),
new Param("toggle", false, "Set All to Player", "Sets all Miis to the Player's Mii")
}
},
new GameAction("move npc drummers", "NPC Drummers Enter or Exit")
@ -179,7 +182,7 @@ namespace HeavenStudio.Games
moveAnim = exit ? "NPCDrummersExit" : "NPCDrummersEnter";
isMoving = true;
lastEase = (EasingFunction.Ease)ease;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length - 0.01f, delegate { isMoving = false; })
});
@ -192,7 +195,7 @@ namespace HeavenStudio.Games
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate { Bop(); })
});

View file

@ -400,7 +400,7 @@ namespace HeavenStudio.Games
goBopSpec = targetAuto == (int)IdolBopType.Both || targetAuto == (int)IdolBopType.Spectators;
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate { BopSingle(target); })
});
@ -494,7 +494,7 @@ namespace HeavenStudio.Games
idolAnimator.Play("IdolCrap" + GetPerformanceSuffix(), -1, 0);
break;
case (int)IdolAnimations.Call:
BeatAction.New(Arisa, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Arisa.GetComponent<Animator>().Play("IdolCall0" + GetPerformanceSuffix(), -1, 0); }),
new BeatAction.Action(beat + 0.75f, delegate { Arisa.GetComponent<Animator>().Play("IdolCall1" + GetPerformanceSuffix(), -1, 0); }),
@ -507,21 +507,21 @@ namespace HeavenStudio.Games
DoIdolJump(beat, length);
break;
case (int)IdolAnimations.BigCall:
BeatAction.New(Arisa, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Arisa.GetComponent<Animator>().Play("IdolBigCall0" + GetPerformanceSuffix(), -1, 0); }),
new BeatAction.Action(beat + length, delegate { Arisa.GetComponent<Animator>().Play("IdolBigCall1" + GetPerformanceSuffix(), -1, 0); }),
});
break;
case (int)IdolAnimations.Squat:
BeatAction.New(Arisa, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Arisa.GetComponent<Animator>().Play("IdolSquat0" + GetPerformanceSuffix(), -1, 0); }),
new BeatAction.Action(beat + length, delegate { Arisa.GetComponent<Animator>().Play("IdolSquat1" + GetPerformanceSuffix(), -1, 0); }),
});
break;
case (int)IdolAnimations.Wink:
BeatAction.New(Arisa, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Arisa.GetComponent<Animator>().Play("IdolWink0" + GetPerformanceSuffix(), -1, 0); }),
new BeatAction.Action(beat + length, delegate { Arisa.GetComponent<Animator>().Play("IdolWink1" + GetPerformanceSuffix(), -1, 0); }),
@ -573,7 +573,7 @@ namespace HeavenStudio.Games
idolJumpStartTime = beat;
//play anim
BeatAction.New(Arisa, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Arisa.GetComponent<Animator>().Play("IdolJump" + GetPerformanceSuffix(), -1, 0); }),
new BeatAction.Action(beat + 1f, delegate { Arisa.GetComponent<Animator>().Play("IdolLand" + GetPerformanceSuffix(), -1, 0); }),
@ -641,7 +641,7 @@ namespace HeavenStudio.Games
Prepare(beat + 5f);
Prepare(beat + 6f);
BeatAction.New(Arisa, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { DoIdolPeace();}),
new BeatAction.Action(beat + 1f, delegate { DoIdolPeace();}),
@ -691,7 +691,7 @@ namespace HeavenStudio.Games
Prepare(beat + 3f, 2);
Prepare(beat + 4f, 1);
BeatAction.New(Arisa, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { DoIdolCall(0, isBig); Blue.PlayAnimState("Beat"); Orange.PlayAnimState("Beat"); }),
new BeatAction.Action(beat + (isBig ? 1f : 0.75f), delegate { DoIdolCall(1, isBig); }),
@ -753,7 +753,7 @@ namespace HeavenStudio.Games
DisableSpecBop(beat, 3.75f);
PlayAnimationAll("FanBigReady", onlyOverrideBop: true);
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1.5f, delegate { PlayAnimationAll("FanBigReady", onlyOverrideBop: true); }),
new BeatAction.Action(beat + 2f, delegate { PlayAnimationAll("FanBigReady", onlyOverrideBop: true); }),
@ -846,7 +846,7 @@ namespace HeavenStudio.Games
}
// Jukebox.PlayOneShotGame("fanClub/play_clap", volume: 0.08f);
SoundByte.PlayOneShotGame("fanClub/crap_impact", pitch: UnityEngine.Random.Range(0.95f, 1.05f), volume: 0.1f);
BeatAction.New(Spectators[who], new List<BeatAction.Action>()
BeatAction.New(Spectators[who].GetComponent<NtrIdolFan>(), new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Spectators[who].GetComponent<Animator>().Play("FanClap", -1, 0); }),
new BeatAction.Action(beat + 0.1f, delegate { Spectators[who].GetComponent<Animator>().Play("FanFree", -1, 0); }),
@ -855,7 +855,7 @@ namespace HeavenStudio.Games
}
else
{
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { PlayAnimationAll("FanClap", true, true);}),
new BeatAction.Action(beat + 0.1f, delegate { PlayAnimationAll("FanFree", true, true);}),
@ -865,7 +865,7 @@ namespace HeavenStudio.Games
private void PlayLongClap(double beat)
{
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { PlayAnimationAll("FanClap", true, true);}),
new BeatAction.Action(beat + 1f, delegate { PlayAnimationAll("FanFree", true, true);}),
@ -874,7 +874,7 @@ namespace HeavenStudio.Games
private void PlayChargeClap(double beat)
{
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { PlayAnimationAll("FanClap", true, true);}),
new BeatAction.Action(beat + 0.1f, delegate { PlayAnimationAll("FanClapCharge", true, true);}),
@ -884,7 +884,7 @@ namespace HeavenStudio.Games
private void StartJump(int idx, double beat)
{
Spectators[idx].GetComponent<NtrIdolFan>().jumpStartTime = beat;
BeatAction.New(Spectators[idx], new List<BeatAction.Action>()
BeatAction.New(Spectators[idx].GetComponent<NtrIdolFan>(), new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Spectators[idx].GetComponent<Animator>().Play("FanJump", -1, 0);}),
new BeatAction.Action(beat + 1f, delegate { Spectators[idx].GetComponent<Animator>().Play("FanPrepare", -1, 0);}),
@ -934,7 +934,7 @@ namespace HeavenStudio.Games
goBopSpec = false;
// recreation of sub61
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { StartClapLoop(beat, 1);}),
@ -972,7 +972,7 @@ namespace HeavenStudio.Games
void StartClapLoop(double beat, int who)
{
BeatAction.New(Spectators[who], new List<BeatAction.Action>()
BeatAction.New(Spectators[who].GetComponent<NtrIdolFan>(), new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { PlayOneClap(beat, who); }),
new BeatAction.Action(beat + 0.5f, delegate { StartClapLoop(beat + 0.5f, who); }),

View file

@ -163,7 +163,7 @@ namespace HeavenStudio.Games.Scripts_FanClub
startJumpTime = beat;
//play anim
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
// new BeatAction.Action(beat, delegate { anim.Play("Jump", -1, 0); }),
new BeatAction.Action(beat + 1f, delegate { anim.Play("Land", -1, 0); }),
@ -197,14 +197,14 @@ namespace HeavenStudio.Games.Scripts_FanClub
DoIdolJump(beat);
break;
case (int) IdolAnimations.Squat:
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { anim.Play("Squat0", -1, 0); }),
new BeatAction.Action(beat + length, delegate { anim.Play("Squat1", -1, 0); }),
});
break;
case (int) IdolAnimations.Wink:
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { anim.Play("Wink0", -1, 0); }),
new BeatAction.Action(beat + length, delegate { anim.Play("Wink1", -1, 0); }),

View file

@ -196,7 +196,7 @@ namespace HeavenStudio.Games.Scripts_FanClub
clappingStartTime = cond.songPositionInBeatsAsDouble;
if (doCharge)
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(cond.songPositionInBeatsAsDouble + 0.1f, delegate {
if (PlayerInput.Pressing() || autoplayRelease > 0f)
@ -209,7 +209,7 @@ namespace HeavenStudio.Games.Scripts_FanClub
if (autoplayRelease > 0f && !doCharge)
{
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(cond.songPositionInBeatsAsDouble + autoplayRelease, delegate {
animator.Play("FanFree", -1, 0);

View file

@ -215,7 +215,7 @@ namespace HeavenStudio.Games
}
if (GameManager.instance.currentGame == "fireworks")
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -280,7 +280,7 @@ namespace HeavenStudio.Games
new MultiSound.Sound("fireworks/practiceHai", beat + 2),
}, forcePlay: true);
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1, delegate
{

View file

@ -40,7 +40,7 @@ namespace HeavenStudio.Games.Scripts_Fireworks
{
anim.DoScaledAnimationAsync("ExplodeBomb", 0.25f);
exploded = true;
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 3f, delegate { Destroy(gameObject); })
});

View file

@ -25,7 +25,7 @@ namespace HeavenStudio.Games.Loaders
new Param("dialogue", "REPLACE THIS", "Mistranslation Dialogue", "The line to use when messing up the translation"),
new Param("auto", true, "Auto Pass Turn")
},
defaultLength = 4f,
defaultLength = 3f,
resizable = true,
priority = 2,
},
@ -43,6 +43,7 @@ namespace HeavenStudio.Games.Loaders
new GameAction("alien turnover", "Pass Turn")
{
function = delegate { FirstContact.instance.PassTurnStandalone(eventCaller.currentEntity.beat); },
resizable = true,
},
new GameAction("alien success", "Success")
{
@ -250,7 +251,7 @@ namespace HeavenStudio.Games
translateFailTextbox.SetActive(false);
if (autoPassTurn)
{
AlienTurnOver(beat + interval, beat, beat + interval);
AlienTurnOver(beat + interval, beat, beat + interval, 1);
}
})
};
@ -269,7 +270,7 @@ namespace HeavenStudio.Games
AlienSpeakInactive(speakEventToCheck["spaceNum"]);
}
}
BeatAction.New(gameObject, queuedSpeaks);
BeatAction.New(this, queuedSpeaks);
}
public override void OnGameSwitch(double beat)
@ -387,11 +388,12 @@ namespace HeavenStudio.Games
public void PassTurnStandalone(double beat)
{
RiqEntity lastInterval = GetLastIntervalBeforeBeat(beat);
float length = EventCaller.GetAllInGameManagerList("firstContact", new string[] { "alien turnover" }).Find(x => x.beat == beat).length;
if (lastInterval == null) return;
AlienTurnOver(beat, lastInterval.beat, lastInterval.beat + lastInterval.length);
AlienTurnOver(beat, lastInterval.beat, lastInterval.beat + lastInterval.length, length);
}
private void AlienTurnOver(double beat, double intervalBeat, double endBeat)
private void AlienTurnOver(double beat, double intervalBeat, double endBeat, float length)
{
var inputs = GetAllSpeaksInBetweenBeat(intervalBeat, endBeat);
inputs.Sort((x, y) => x.beat.CompareTo(y.beat));
@ -399,10 +401,10 @@ namespace HeavenStudio.Games
{
var input = inputs[i];
double relativeBeat = input.beat - intervalBeat;
ScheduleInput(beat, 1 + relativeBeat, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, AlienTapping, AlienOnMiss, AlienEmpty);
ScheduleInput(beat, length + relativeBeat, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, AlienTapping, AlienOnMiss, AlienEmpty);
callDiagList.Add(input["dialogue"]);
}
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -411,7 +413,7 @@ namespace HeavenStudio.Games
alienTextbox.SetActive(false);
alien.Play("alien_point", 0, 0);
}),
new BeatAction.Action(beat + 0.5f, delegate
new BeatAction.Action(beat + (length / 2), delegate
{
alien.Play("alien_idle", 0, 0);
})
@ -448,7 +450,7 @@ namespace HeavenStudio.Games
MultiSound.Play(sound.ToArray());
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { alien.Play(animString, 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { alien.Play(animString, 0, 0); }),
@ -510,7 +512,7 @@ namespace HeavenStudio.Games
if (!stay)
{
BeatAction.New(missionControl, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length, delegate { missionControl.SetActive(false); }),
});

View file

@ -44,7 +44,7 @@ namespace HeavenStudio.Games.Scripts_FirstContact
SoundByte.PlayOneShotGame("firstContact/failContact");
}
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(.5f, delegate { anim.Play("translator_speak", 0, 0);}),
});
@ -53,7 +53,7 @@ namespace HeavenStudio.Games.Scripts_FirstContact
public void EhTranslation()
{
SoundByte.PlayOneShotGame("firstContact/slightlyFail");
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(.5f, delegate { anim.Play("translator_eh", 0, 0);}),
});

View file

@ -57,9 +57,15 @@ namespace HeavenStudio.Games.Loaders
parameters = new List<Param>()
{
new Param("uh", new EntityTypes.Integer(0, 3, 0), "Uh Count", "How many Uhs should Captain Tuck say after the flippers roll?"),
new Param("thatsIt", false, "That's it!", "Whether or not Captain Tuck should say -That's it!- on the final flipper roll."),
new Param("appreciation", FlipperFlop.AppreciationType.None, "Appreciation", "Which appreciation line should Captain Tuck say?"),
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("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.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?")
},
defaultLength = 4f,
@ -316,7 +322,7 @@ namespace HeavenStudio.Games
goBopTuck = whoBopsAuto == (int)WhoBops.CaptainTuck || whoBopsAuto == (int)WhoBops.Both;
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
@ -404,13 +410,13 @@ namespace HeavenStudio.Games
{
ScheduleInput(beat - 1, 1 + i, InputType.STANDARD_ALT_DOWN, JustFlipperRoll, MissFlipperRoll, Nothing);
queuedMovements.Add(beat + i);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i - 0.5f, delegate { moveLeft = flippers[0].left;})
});
foreach (var flipper in flippers)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate { flipper.Flip(roll, true);})
});
@ -442,7 +448,7 @@ namespace HeavenStudio.Games
soundToPlay = $"flipperFlop/count/flopNoise{noiseToPlay}";
if (thatsItBarberShop)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
@ -456,7 +462,7 @@ namespace HeavenStudio.Games
}
else
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i - 0.5f, delegate
{
@ -476,7 +482,7 @@ namespace HeavenStudio.Games
else
{
string failingSoundToPlay = $"flipperFlop/count/flopCountFail{flopCount}";
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate {
string voiceLine = soundToPlay;
@ -501,7 +507,7 @@ namespace HeavenStudio.Games
if (appreciation != (int)AppreciationType.None && uh == 0 && i + 1 == length)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i + 1f, delegate
{
@ -531,7 +537,7 @@ namespace HeavenStudio.Games
}
if (appreciation == (int)AppreciationType.None && uh == 0 && i + 1 == length)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length - 0.1f, delegate { missed = false; currentCaptainBop = CaptainTuckBopType.Normal; captainTuckFaceAnim.Play("CaptainTuckNeutralExpression", 0, 0); })
});
@ -553,7 +559,7 @@ namespace HeavenStudio.Games
ScheduleInput(beat - 1, 1 + i, InputType.STANDARD_DOWN, JustFlip, MissFlip, Nothing);
foreach (var flipper in flippers)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate { flipper.Flip(roll, true); CaptainTuckBop(); })
});
@ -568,7 +574,7 @@ namespace HeavenStudio.Games
string voiceLine = $"flipperFlop/uh{voiceLineIndex}";
string failVoiceLine = $"flipperFlop/uhfail{voiceLineIndex}";
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length + i, delegate {
string voiceLineToPlay = voiceLine;
@ -590,7 +596,7 @@ namespace HeavenStudio.Games
}),
});
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length + uh, delegate
{
@ -620,7 +626,7 @@ namespace HeavenStudio.Games
}
else if (uh > 0 && flopCount == 4)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length, delegate
{
@ -662,14 +668,14 @@ namespace HeavenStudio.Games
SoundByte.PlayOneShotGame("flipperFlop/appreciation/good");
if (heart)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { instance.captainTuckFaceAnim.DoScaledAnimationAsync("CaptainTuckBlushExpression", 0.5f); })
});
}
else
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { instance.captainTuckFaceAnim.DoScaledAnimationAsync("CaptainTuckSpeakExpression", 0.5f); })
});
@ -679,14 +685,14 @@ namespace HeavenStudio.Games
SoundByte.PlayOneShotGame("flipperFlop/appreciation/goodjob");
if (heart)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { instance.captainTuckFaceAnim.DoScaledAnimationAsync("CaptainTuckBlushExpression", 0.5f); })
});
}
else
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { instance.captainTuckFaceAnim.DoScaledAnimationAsync("CaptainTuckSpeakExpression", 1f); }),
new BeatAction.Action(beat + 0.5f, delegate { instance.captainTuckFaceAnim.DoScaledAnimationAsync("CaptainTuckSpeakExpression", 0.5f); })
@ -697,14 +703,14 @@ namespace HeavenStudio.Games
SoundByte.PlayOneShotGame("flipperFlop/appreciation/nice");
if (heart)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { instance.captainTuckFaceAnim.DoScaledAnimationAsync("CaptainTuckBlushExpression", 0.5f); })
});
}
else
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { instance.captainTuckFaceAnim.DoScaledAnimationAsync("CaptainTuckSpeakExpression", 0.5f); })
});
@ -714,14 +720,14 @@ namespace HeavenStudio.Games
SoundByte.PlayOneShotGame("flipperFlop/appreciation/welldone");
if (heart)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { instance.captainTuckFaceAnim.DoScaledAnimationAsync("CaptainTuckBlushExpression", 0.5f); })
});
}
else
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { instance.captainTuckFaceAnim.DoScaledAnimationAsync("CaptainTuckSpeakExpression", 1f); }),
new BeatAction.Action(beat + 0.5f, delegate { instance.captainTuckFaceAnim.DoScaledAnimationAsync("CaptainTuckSpeakExpression", 0.5f); })
@ -732,14 +738,14 @@ namespace HeavenStudio.Games
SoundByte.PlayOneShotGame("flipperFlop/appreciation/yes");
if (heart)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { instance.captainTuckFaceAnim.DoScaledAnimationAsync("CaptainTuckBlushExpression", 0.5f); })
});
}
else
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { instance.captainTuckFaceAnim.DoScaledAnimationAsync("CaptainTuckSpeakExpression", 0.5f); })
});
@ -764,14 +770,14 @@ namespace HeavenStudio.Games
ScheduleInput(beat, 3, InputType.STANDARD_DOWN, JustFlip, MissFlip, Nothing);
foreach (var flipper in flippers)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 2, delegate { flipper.Flip(false, true);}),
new BeatAction.Action(beat + 2.5f, delegate { flipper.Flip(false, true);}),
new BeatAction.Action(beat + 3, delegate { flipper.Flip(false, true);})
});
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 2, delegate {captainTuckAnim.DoScaledAnimationAsync("CaptainBop", 0.5f); }),
new BeatAction.Action(beat + 3, delegate {captainTuckAnim.DoScaledAnimationAsync("CaptainBop", 0.5f); }),
@ -886,7 +892,7 @@ namespace HeavenStudio.Games
}
}
BeatAction.New(instance.gameObject, speaks);
BeatAction.New(instance, speaks);
}
public static void FlipperRollVoiceLine(double beat, int amount, bool now)
@ -1037,7 +1043,7 @@ namespace HeavenStudio.Games
}
}
BeatAction.New(instance.gameObject, speaks);
BeatAction.New(instance, speaks);
}
public void JustFlip(PlayerActionEvent caller, float state)

View file

@ -42,7 +42,7 @@ namespace HeavenStudio.Games.Scripts_FlipperFlop
leftImpact.SetActive(true);
}
faceAnim.Play("FaceAngry", 0, 0);
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(Conductor.instance.songPositionInBeatsAsDouble + 0.1f, delegate { leftImpact.SetActive(false); rightImpact.SetActive(false); }),
new BeatAction.Action(Conductor.instance.songPositionInBeatsAsDouble + 0.3f, delegate { faceAnim.Play("FaceAnnoyed", 0, 0); })
@ -76,7 +76,7 @@ namespace HeavenStudio.Games.Scripts_FlipperFlop
canBlink = false;
SoundByte.PlayOneShotGame("flipperFlop/failgroan");
game.BumpIntoOtherSeal(!left);
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(Conductor.instance.songPositionInBeatsAsDouble + 0.3f, delegate { faceAnim.Play("FaceGoofy"); }),
});
@ -118,7 +118,7 @@ namespace HeavenStudio.Games.Scripts_FlipperFlop
SoundByte.PlayOneShotGame("flipperFlop/punch", -1, 1, 0.5f);
anim.DoScaledAnimationAsync(shouldReverse + "MissFlop" + leftOrRight, 0.5f);
game.BumpIntoOtherSeal(!left);
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(Conductor.instance.songPositionInBeatsAsDouble + 0.3f, delegate { faceAnim.Play("FaceGoofy"); }),
});

View file

@ -158,7 +158,7 @@ namespace HeavenStudio.Games
{
playerInstance.shouldBop = (autoBop || doesBop);
if (!autoBop && doesBop) {
BeatAction.New(gameObject, new List<BeatAction.Action>() {
BeatAction.New(this, new List<BeatAction.Action>() {
new BeatAction.Action(beat + length, delegate {
playerInstance.shouldBop = false;
})

View file

@ -199,7 +199,7 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
private void Miss(PlayerActionEvent caller)
{
SoundByte.PlayOneShot("forkLifter/disappointed");
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat+ 2.45f, delegate {
Destroy(this.gameObject);

View file

@ -77,7 +77,7 @@ namespace HeavenStudio.Games.Scripts_GleeClub
if (currentSound != null) SoundByte.KillLoop(currentSound, 0f);
SoundByte.PlayOneShotGame("gleeClub/LoudWailStart");
currentSound = SoundByte.PlayOneShotGame("gleeClub/LoudWailLoop", -1, currentPitch, 1f, true);
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(Conductor.instance.songPositionInBeatsAsDouble + 1f, delegate { UnYell(); })
});

View file

@ -29,7 +29,10 @@ namespace HeavenStudio.Games.Loaders
new Param("semiTones1", new EntityTypes.Integer(-24, 24, -1), "Semitones (Next)", "The number of semitones up or down this note should be pitched"),
new Param("semiTonesPlayer", new EntityTypes.Integer(-24, 24, 2), "Semitones (Player)", "The number of semitones up or down this note should be pitched"),
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 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("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("semiTonesMiddle2", new EntityTypes.Integer(-24, 24, 0), "Semitones (Repeat Middle)", "The number of semitones up or down this note should be pitched"),
@ -281,7 +284,7 @@ namespace HeavenStudio.Games
new MultiSound.Sound("gleeClub/togetherEN-04", beat + 2f, conductorPitch, 1, false, 0.02f),
});
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1.5f, delegate
{
@ -333,7 +336,7 @@ namespace HeavenStudio.Games
{
StartInterval(beat, length);
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { if (closeMouth != (int)MouthOpenClose.OnlyClose) leftChorusKid.currentPitch = pitch; leftChorusKid.StartSinging(); }),
new BeatAction.Action(beat + length, delegate { if (closeMouth != (int)MouthOpenClose.OnlyOpen) leftChorusKid.StopSinging(); }),
@ -371,7 +374,7 @@ namespace HeavenStudio.Games
float pitchLeft2 = SoundByte.GetPitchFromSemiTones(sing.semiTonesLeft2, true);
float pitchLeft3 = SoundByte.GetPitchFromSemiTones(sing.semiTonesLeft3, true);
float pitchMiddle2 = SoundByte.GetPitchFromSemiTones(sing.semiTonesMiddle2, true);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length + sing.startBeat, delegate
{
@ -438,7 +441,7 @@ namespace HeavenStudio.Games
{
missed = false;
if (!playerChorusKid.disappeared) ScheduleInput(beat, 1, InputType.STANDARD_DOWN, JustBaton, MissBaton, Out);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -473,7 +476,7 @@ namespace HeavenStudio.Games
public void ShowHeart(double beat)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{

View file

@ -948,7 +948,7 @@ namespace HeavenStudio.Games
{
int comboId = KarateManPot.GetNewCombo();
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { CreateItemInstance(beat, "Item00", 0, KarateManPot.ItemType.ComboPot1, comboId); }),
new BeatAction.Action(beat + 0.25f, delegate { CreateItemInstance(beat + 0.25f, "Item00", 0, KarateManPot.ItemType.ComboPot2, comboId); }),
@ -1160,7 +1160,7 @@ namespace HeavenStudio.Games
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{

View file

@ -276,7 +276,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public void ForceFailCombo(double beat)
{
if (inCombo) return;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Punch(1); inCombo = true; inComboId = -1; shouldComboId = -1;}),
new BeatAction.Action(beat + 0.25f, delegate { Punch(2); }),
@ -297,7 +297,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
{
wantKick = true;
unPrepareTime = double.MinValue;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate {
if (wantKick)

View file

@ -186,20 +186,20 @@ namespace HeavenStudio.Games.Scripts_KarateMan
break;
case ItemType.ComboPot2:
path = 1;
BeatAction.New(gameObject, new List<BeatAction.Action>() { new BeatAction.Action(startBeat + 1f, delegate { JoeComboSequence(); }) });
BeatAction.New(this, new List<BeatAction.Action>() { new BeatAction.Action(startBeat + 1f, delegate { JoeComboSequence(); }) });
break;
case ItemType.ComboPot3:
path = 2;
BeatAction.New(gameObject, new List<BeatAction.Action>() { new BeatAction.Action(startBeat + 1f, delegate { JoeComboSequence(); }) });
BeatAction.New(this, new List<BeatAction.Action>() { new BeatAction.Action(startBeat + 1f, delegate { JoeComboSequence(); }) });
break;
case ItemType.ComboPot4:
path = 3;
//if the button isn't held anymore make Joe spin
BeatAction.New(gameObject, new List<BeatAction.Action>() { new BeatAction.Action(startBeat + 1f, delegate { JoeComboSequence(); }) });
BeatAction.New(this, new List<BeatAction.Action>() { new BeatAction.Action(startBeat + 1f, delegate { JoeComboSequence(); }) });
break;
case ItemType.ComboPot5:
path = 4;
BeatAction.New(gameObject, new List<BeatAction.Action>() { new BeatAction.Action(startBeat + 1f, delegate { JoeComboSequence(); }) });
BeatAction.New(this, new List<BeatAction.Action>() { new BeatAction.Action(startBeat + 1f, delegate { JoeComboSequence(); }) });
break;
case ItemType.ComboBarrel:
OnHit = KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_ALT_UP, ComboEndJustOrNg, ComboEndThrough, ComboEndOut, CanComboEnd);
@ -711,7 +711,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
if (OnHitExpression == (int) KarateMan.KarateManFaces.Normal)
return;
var joe = KarateMan.instance.Joe;
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
BeatAction.New(joe, new List<BeatAction.Action>()
{
new BeatAction.Action(offset, delegate {
joe.SetFaceExpression(OnHitExpression);
@ -741,7 +741,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
status = FlyStatus.NG;
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Sad);
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
BeatAction.New(joe, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 2f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal);
@ -792,7 +792,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
ItemHitEffect();
}
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
BeatAction.New(joe, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 4f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Sad);
@ -811,7 +811,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
var joe = KarateMan.instance.Joe;
if (GameManager.instance.currentGame != "karateMan") return;
if (status != FlyStatus.Fly || gameObject == null) return;
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
BeatAction.New(joe, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 2f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise);
@ -862,7 +862,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
var joe = KarateMan.instance.Joe;
if (GameManager.instance.currentGame != "karateMan") return;
if (status != FlyStatus.Fly || gameObject == null) return;
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
BeatAction.New(joe, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 2f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise);
@ -919,7 +919,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
SoundByte.PlayOneShot("miss");
status = FlyStatus.NG;
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
BeatAction.New(joe, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 2f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Sad);
@ -959,7 +959,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
var joe = KarateMan.instance.Joe;
if (joe.GetComboId() != comboId || !joe.inCombo)
{
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
BeatAction.New(joe, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 2f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise);
@ -973,7 +973,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
else
{
joe.SetFaceExpression((int) KarateMan.KarateManFaces.VerySad);
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
BeatAction.New(joe, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 1.5f, delegate {
joe.inCombo = false;
@ -1007,7 +1007,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
status = FlyStatus.NG;
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Sad);
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
BeatAction.New(joe, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 2f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal);
@ -1030,7 +1030,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
var joe = KarateMan.instance.Joe;
if (GameManager.instance.currentGame != "karateMan") return;
if (status != FlyStatus.Fly || gameObject == null) return;
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
BeatAction.New(joe, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 2f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise);
@ -1065,7 +1065,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
SoundByte.PlayOneShot("miss");
status = FlyStatus.NG;
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
BeatAction.New(joe, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 1.25f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Sad);
@ -1096,7 +1096,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
{
if (GameManager.instance.currentGame != "karateMan") return;
if (status != FlyStatus.Fly || gameObject == null) return;
BeatAction.New(KarateMan.instance.Joe.gameObject, new List<BeatAction.Action>()
BeatAction.New(KarateMan.instance.Joe, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 2f, delegate {
KarateMan.instance.Joe.SetFaceExpression((int) KarateMan.KarateManFaces.VerySad);

View file

@ -62,10 +62,10 @@ namespace HeavenStudio.Games.Loaders
new GameAction("bgcolor", "Background Color")
{
function = delegate
function = delegate
{
var e = eventCaller.currentEntity;
Kitties.instance.BackgroundColor(e.beat, e.length, e["colorStart"], e["colorEnd"], e["ease"]);
Kitties.instance.BackgroundColor(e.beat, e.length, e["colorStart"], e["colorEnd"], e["ease"]);
},
defaultLength = 4,
resizable = true,
@ -77,9 +77,9 @@ namespace HeavenStudio.Games.Loaders
}
}
},
new List<string>() {"ctr", "normal"},
new List<string>() { "ctr", "normal" },
"ctrteppan", "en",
new List<string>() {}
new List<string>() { }
);
}
}
@ -130,23 +130,23 @@ namespace HeavenStudio.Games
new MultiSound.Sound("kitties/nya3", beat + 1.5f)
});
if(type == 3)
if (type == 3)
{
BeatAction.New(Cats[0], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Spawn(type, 0, isMice, isInverse, true, false);}),
new BeatAction.Action(beat + 2.5f, delegate { kitties[0].Play("FaceClap", 0, 0);}),
new BeatAction.Action(beat + 3f, delegate { kitties[0].Play("FaceClap", 0, 0);}),
});
BeatAction.New(Cats[1], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + .75f, delegate { Spawn(type, 1, isMice, isInverse, false, false);}),
new BeatAction.Action(beat + 2.5f, delegate { kitties[1].Play("FaceClap", 0, 0);}),
new BeatAction.Action(beat + 3f, delegate { kitties[1].Play("FaceClap", 0, 0);}),
});
BeatAction.New(Cats[2], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1.5f, delegate { Spawn(type, 2, isMice, isInverse, false, false);}),
new BeatAction.Action(beat + 1.5f, delegate { player.canClap = true;}),
@ -155,21 +155,21 @@ namespace HeavenStudio.Games
else if (!isMice)
{
BeatAction.New(Cats[0], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Spawn(type, 0, isMice, isInverse, true, false);}),
new BeatAction.Action(beat + 2.5f, delegate { kitties[0].Play("Clap1", 0, 0);}),
new BeatAction.Action(beat + 3f, delegate { kitties[0].Play("Clap2", 0, 0);}),
});
BeatAction.New(Cats[1], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + .75f, delegate { Spawn(type, 1, isMice, isInverse, false, false);}),
new BeatAction.Action(beat + 2.5f, delegate { kitties[1].Play("Clap1", 0, 0);}),
new BeatAction.Action(beat + 3f, delegate { kitties[1].Play("Clap2", 0, 0);}),
});
BeatAction.New(Cats[2], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1.5f, delegate { Spawn(type, 2, isMice, isInverse, false, false);}),
new BeatAction.Action(beat + 1.5f, delegate { player.canClap = true;}),
@ -178,21 +178,21 @@ namespace HeavenStudio.Games
}
else
{
BeatAction.New(Cats[0], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Spawn(type, 0, isMice, isInverse, true, false);}),
new BeatAction.Action(beat + 2.5f, delegate { kitties[0].Play("MiceClap1", 0, 0);}),
new BeatAction.Action(beat + 3f, delegate { kitties[0].Play("MiceClap2", 0, 0);}),
});
BeatAction.New(Cats[1], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + .75f, delegate { Spawn(type, 1, isMice, isInverse, false, false);}),
new BeatAction.Action(beat + 2.5f, delegate { kitties[1].Play("MiceClap1", 0, 0);}),
new BeatAction.Action(beat + 3f, delegate { kitties[1].Play("MiceClap2", 0, 0);}),
});
BeatAction.New(Cats[2], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1.5f, delegate { Spawn(type, 2, isMice, isInverse, false, false);}),
new BeatAction.Action(beat + 1.5f, delegate { player.canClap = true;}),
@ -202,7 +202,7 @@ namespace HeavenStudio.Games
if (!keepSpawned)
{
BeatAction.New(Cats[0], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 3.5f, delegate { RemoveCats(false);})
});
@ -221,7 +221,7 @@ namespace HeavenStudio.Games
new MultiSound.Sound("kitties/roll4", beat + 1.5f)
});
BeatAction.New(Cats[0], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { kitties[0].Play("RollStart", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { kitties[0].Play("RollStart", 0, 0); }),
@ -231,7 +231,7 @@ namespace HeavenStudio.Games
new BeatAction.Action(beat + 2.75f, delegate { kitties[0].Play("RollEnd", 0, 0); })
});
BeatAction.New(Cats[1], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { kitties[1].Play("RollStart", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { kitties[1].Play("RollStart", 0, 0); }),
@ -241,7 +241,7 @@ namespace HeavenStudio.Games
new BeatAction.Action(beat + 2.75f, delegate { kitties[1].Play("RollEnd", 0, 0); })
});
BeatAction.New(Cats[2], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { kitties[2].Play("RollStart", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { kitties[2].Play("RollStart", 0, 0); }),
@ -252,7 +252,7 @@ namespace HeavenStudio.Games
if (!keepSpawned)
{
BeatAction.New(Cats[0], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 3.5f, delegate { RemoveCats(false);})
});
@ -263,7 +263,7 @@ namespace HeavenStudio.Games
{
//if (!player.canClap)
// return;
player.ScheduleFish(beat);
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("kitties/fish1", beat + 2f),
@ -272,20 +272,20 @@ namespace HeavenStudio.Games
});
BeatAction.New(Cats[0], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { if (isInverted)
Fish.transform.localScale = new Vector3(-1f, 1f, 1f);
else
Fish.transform.localScale = new Vector3(1f, 1f, 1f); }),
new BeatAction.Action(beat, delegate { Fish.SetActive(true); }),
new BeatAction.Action(beat, delegate { Fish.SetActive(true); }),
new BeatAction.Action(beat, delegate { Fish.GetComponent<Animator>().DoScaledAnimationAsync("FishDangle", 0.5f); }),
new BeatAction.Action(beat + 2f, delegate { kitties[0].Play("FishNotice", 0, 0); }),
new BeatAction.Action(beat + 2.25f, delegate { kitties[1].Play("FishNotice2", 0, 0); }),
new BeatAction.Action(beat + 2.5f, delegate { kitties[2].Play("FishNotice3", 0, 0); })
});
BeatAction.New(Fish, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 4f, delegate { Fish.SetActive(false);})
});
@ -400,7 +400,7 @@ namespace HeavenStudio.Games
}
else
{
if(pos == 3)
if (pos == 3)
kitties[catNum].Play("FaceIdle", 0, 0);
else if (!isMice)
kitties[catNum].Play("Idle", 0, 0);
@ -429,12 +429,12 @@ namespace HeavenStudio.Games
}
else
Fish.SetActive(false);
player.canClap = false;
player.canClap = false;
}
public void InstantSpawn(bool isMice, bool isInverse, double beat, int pos)
{
BeatAction.New(Cats[0], new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Spawn(pos, 0, isMice, isInverse, true, true); }),
new BeatAction.Action(beat, delegate { Spawn(pos, 1, isMice, isInverse, true, true); }),

View file

@ -121,7 +121,10 @@ namespace HeavenStudio.Games.Loaders
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("toggle", true, "Stars Enabled", "Starfall Or No?"),
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("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("valC", new EntityTypes.Float(0.01f, 5f, 0.1f), "Back Star Fall Speed", "How fast the stars fall to the edge of the screen")
@ -402,7 +405,7 @@ namespace HeavenStudio.Games
rocketScript.InitBowlingPin(beat);
break;
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + beatOffset, delegate { rocketScript.Rise(); })
});

View file

@ -60,7 +60,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
new MultiSound.Sound("launchParty/rocket_note", beat + 2, pitches[2]),
}, forcePlay: true);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -86,7 +86,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
new MultiSound.Sound("launchParty/popper_note", beat + 1.66f, pitches[4]),
}, forcePlay: true);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -116,7 +116,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
new MultiSound.Sound("launchParty/bell_short", beat + 1.83f, pitches[6]),
}, forcePlay: true);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -154,7 +154,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
new MultiSound.Sound("launchParty/flute", beat + 1.83f, pitches[12]),
}, forcePlay: true);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -171,7 +171,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
{
number.SetActive(false);
anim.SetBool("CanRise", false);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate { GameObject.Destroy(gameObject); }),
});
@ -185,7 +185,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
SoundByte.PlayOneShotGame("launchParty/rocket_endBad");
string leftOrRight = (UnityEngine.Random.Range(1, 3) == 1) ? "Left" : "Right";
anim.Play("RocketBarely" + leftOrRight, 0, 0);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate { GameObject.Destroy(gameObject); }),
});
@ -203,7 +203,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
new MultiSound.Sound("launchParty/rocket_note", caller.startBeat + caller.timer, pitches[3]),
new MultiSound.Sound("launchParty/rocket_family", caller.startBeat + caller.timer),
}, forcePlay: true);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer, delegate { numberAnim.DoScaledAnimationAsync("CountImpact", 0.5f); }),
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate { GameObject.Destroy(gameObject); }),
@ -217,7 +217,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
{
number.SetActive(false);
anim.SetBool("CanRise", false);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate { GameObject.Destroy(gameObject); }),
});
@ -229,7 +229,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
anim.Play("RocketBarely" + leftOrRight, 0, 0);
SoundByte.PlayOneShotGame("launchParty/miss");
SoundByte.PlayOneShotGame("launchParty/rocket_endBad");
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate { GameObject.Destroy(gameObject); }),
});
@ -247,7 +247,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
new MultiSound.Sound("launchParty/popper_note", caller.startBeat + caller.timer, pitches[5]),
new MultiSound.Sound("launchParty/rocket_crackerblast", caller.startBeat + caller.timer),
}, forcePlay: true);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer, delegate { numberAnim.DoScaledAnimationAsync("CountImpact", 0.5f); }),
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate { GameObject.Destroy(gameObject); }),
@ -261,7 +261,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
{
number.SetActive(false);
anim.SetBool("CanRise", false);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate { GameObject.Destroy(gameObject); }),
});
@ -273,7 +273,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
anim.Play("RocketBarely" + leftOrRight, 0, 0);
SoundByte.PlayOneShotGame("launchParty/miss");
SoundByte.PlayOneShotGame("launchParty/rocket_endBad");
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate { GameObject.Destroy(gameObject); }),
});
@ -291,7 +291,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
new MultiSound.Sound("launchParty/bell_note", caller.startBeat + caller.timer, pitches[7]),
new MultiSound.Sound("launchParty/bell_blast", caller.startBeat + caller.timer, pitches[8]),
}, forcePlay: true);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer, delegate { numberAnim.DoScaledAnimationAsync("CountImpact", 0.5f); }),
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate { GameObject.Destroy(gameObject); }),
@ -305,7 +305,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
{
number.SetActive(false);
anim.SetBool("CanRise", false);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate { GameObject.Destroy(gameObject); }),
});
@ -317,7 +317,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
anim.Play("RocketBarely" + leftOrRight, 0, 0);
SoundByte.PlayOneShotGame("launchParty/miss");
SoundByte.PlayOneShotGame("launchParty/rocket_endBad");
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate { GameObject.Destroy(gameObject); }),
});
@ -336,7 +336,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
new MultiSound.Sound("launchParty/pin", caller.startBeat + caller.timer, pitches[14]),
new MultiSound.Sound("launchParty/rocket_bowling", caller.startBeat + caller.timer),
}, forcePlay: true);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer, delegate { numberAnim.DoScaledAnimationAsync("CountImpact", 0.5f); }),
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate { GameObject.Destroy(gameObject); }),
@ -349,7 +349,7 @@ namespace HeavenStudio.Games.Scripts_LaunchParty
SoundByte.PlayOneShotGame("launchParty/miss");
number.SetActive(false);
anim.Play("RocketMiss", 0, 0);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate { GameObject.Destroy(gameObject); }),
});

View file

@ -34,7 +34,10 @@ namespace HeavenStudio.Games.Loaders
preFunction = delegate {var e = eventCaller.currentEntity; Lockstep.Marching(e.beat, e["sound"], e["amount"], e["visual"]);},
parameters = new List<Param>()
{
new Param("sound", false, "Sound", "Hai if onbeat, ho if offbeat."),
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("amount", new EntityTypes.Integer(1, 50, 1), "Sound Amount", "How many sounds will play consecutively?"),
new Param("visual", true, "Background Visual")
},
@ -62,6 +65,14 @@ namespace HeavenStudio.Games.Loaders
new Param("visual", true, "Background Visual")
}
},
new GameAction("hai", "Hai")
{
preFunction = delegate { Lockstep.HaiSound(eventCaller.currentEntity.beat); }
},
new GameAction("ho", "Ho")
{
preFunction = delegate { Lockstep.HoSound(eventCaller.currentEntity.beat); }
},
new GameAction("set colours", "Set Colours")
{
function = delegate {var e = eventCaller.currentEntity; Lockstep.instance.SetBackgroundColours(e["colorA"], e["colorB"], e["objColA"], e["objColB"], e["objColC"]); },
@ -93,7 +104,10 @@ namespace HeavenStudio.Games.Loaders
preFunction = delegate {var e = eventCaller.currentEntity; Lockstep.Marching(e.beat, e["sound"], e["amount"], e["visual"], true, e.length);},
parameters = new List<Param>()
{
new Param("sound", false, "Sound", "Hai if onbeat, ho if offbeat."),
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("amount", new EntityTypes.Integer(1, 50, 1), "Sound Amount", "How many sounds will play consecutively?"),
new Param("visual", true, "Background Visual")
},
@ -231,6 +245,11 @@ namespace HeavenStudio.Games
bachEvents = EventCaller.GetAllInGameManagerList("lockstep", new string[] { "bach" });
}
private static bool ForceStepOnBeat(double beat)
{
return EventCaller.GetAllInGameManagerList("lockstep", new string[] { "marching" }).Find(x => beat >= x.beat && beat < x.beat + x.length) != null;
}
private void PersistColors(double beat)
{
var allEventsBeforeBeat = EventCaller.GetAllInGameManagerList("lockstep", new string[] { "" }).FindAll(x => x.beat < beat);
@ -391,7 +410,7 @@ namespace HeavenStudio.Games
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
@ -402,6 +421,16 @@ namespace HeavenStudio.Games
}
}
public static void HaiSound(double beat)
{
SoundByte.PlayOneShot("games/lockstep/hai", beat, 1, 1, false, null, 0.02314814814f);
}
public static void HoSound(double beat)
{
SoundByte.PlayOneShot("games/lockstep/ho", beat, 1, 1, false, null, 0.03086419753);
}
public static void OnbeatSwitchSound(double beat, int hais, bool sound)
{
if (sound)
@ -456,7 +485,7 @@ namespace HeavenStudio.Games
{
if (visual) ChangeBeatBackGroundColour(true);
}),
new BeatAction.Action(beat + 1.75f, delegate { if (!marchRecursing) MarchRecursive(beat + 2f); }),
new BeatAction.Action(beat + 1.75f, delegate { if (!marchRecursing && !ForceStepOnBeat(beat + 2f)) MarchRecursive(beat + 2f); }),
new BeatAction.Action(beat + 2f, delegate { if (visual) ChangeBeatBackGroundColour(false); }),
};
List<BeatAction.Action> actions = new();
@ -464,7 +493,7 @@ namespace HeavenStudio.Games
{
if (action.beat >= gameswitchBeat) actions.Add(action);
}
if (actions.Count > 0) BeatAction.New(instance.gameObject, actions);
if (actions.Count > 0) BeatAction.New(instance, actions);
}
public static void OffbeatSwitchSound(double beat, bool hoSound, bool sound)
@ -519,7 +548,7 @@ namespace HeavenStudio.Games
{
if (visual) ChangeBeatBackGroundColour(false);
}),
new BeatAction.Action(beat + 3.25f, delegate { if (!marchRecursing) MarchRecursive(beat + 3.5f); }),
new BeatAction.Action(beat + 3.25f, delegate { if (!marchRecursing && !ForceStepOnBeat(beat + 3.5)) MarchRecursive(beat + 3.5f); }),
new BeatAction.Action(beat + 3.5f, delegate { if (visual) ChangeBeatBackGroundColour(true); }),
};
List<BeatAction.Action> actions = new();
@ -527,7 +556,7 @@ namespace HeavenStudio.Games
{
if (action.beat >= gameswitchBeat) actions.Add(action);
}
if (actions.Count > 0) BeatAction.New(instance.gameObject, actions);
if (actions.Count > 0) BeatAction.New(instance, actions);
}
private struct QueuedMarch
@ -598,7 +627,7 @@ namespace HeavenStudio.Games
}));
ScheduleInput(stepBeat - 1, 1, InputType.STANDARD_DOWN, offBeat ? JustOff : JustOn, offBeat ? MissOff : MissOn, Nothing);
}
BeatAction.New(gameObject, steps);
BeatAction.New(this, steps);
}
private void StartMarching(double beat, bool sound, int amount, bool visual)
@ -607,7 +636,7 @@ namespace HeavenStudio.Games
bool offBeat = beat % 1 != 0;
if (visual)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { ChangeBeatBackGroundColour(offBeat); })
});
@ -632,7 +661,7 @@ namespace HeavenStudio.Games
bool offBeat = beat % 1 != 0;
bool bachOnBeat = BachOnBeat(beat);
ScheduleInput(beat - 1, 1, InputType.STANDARD_DOWN, offBeat ? JustOff : JustOn, offBeat ? MissOff : MissOn, Nothing);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{

View file

@ -277,7 +277,7 @@ namespace HeavenStudio.Games
if (Conductor.instance.isPlaying && !Conductor.instance.isPaused) {
if (queuedMarches.Count > 0) {
foreach (var march in queuedMarches) {
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() {
BeatAction.New(instance, new List<BeatAction.Action>() {
new BeatAction.Action(march, delegate {
ScheduleInput(march, 1f, InputType.STANDARD_DOWN, MarchHit, GenericMiss, Empty);
}),
@ -388,7 +388,7 @@ namespace HeavenStudio.Games
shouldClap = clap;
if (shouldBop) {
for (int i = 0; i < length; i++) {
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() {
BeatAction.New(instance, new List<BeatAction.Action>() {
new BeatAction.Action(beat + i, delegate {
foreach (var cadet in Cadets) cadet.DoScaledAnimationAsync(shouldClap ? "Clap" : "Bop", 0.5f);
CadetPlayer.DoScaledAnimationAsync(shouldClap ? "Clap" : "Bop", 0.5f);
@ -400,7 +400,7 @@ namespace HeavenStudio.Games
public void SargeAttention(double beat)
{
BeatAction.New(gameObject, new List<BeatAction.Action>() {
BeatAction.New(this, new List<BeatAction.Action>() {
new BeatAction.Action(beat + 0.25f, delegate { Sarge.DoScaledAnimationAsync("Talk", 0.5f);}),
});
}
@ -420,7 +420,7 @@ namespace HeavenStudio.Games
{
for (int i = 0; i < length; i++) {
ScheduleInput(beat + i - 0.2f, 0.2f, InputType.STANDARD_DOWN, MarchHit, GenericMiss, Empty);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() {
BeatAction.New(instance, new List<BeatAction.Action>() {
new BeatAction.Action(beat + i, delegate {
marchOtherCount++;
foreach (var cadet in Cadets) cadet.DoScaledAnimationAsync(marchOtherCount % 2 != 0 ? "MarchR" : "MarchL", 0.5f);
@ -432,7 +432,7 @@ namespace HeavenStudio.Games
public void PreMarch(double beat)
{
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1f, delegate {
foreach (var cadet in Cadets) cadet.DoScaledAnimationAsync("MarchL", 0.5f);
@ -447,7 +447,7 @@ namespace HeavenStudio.Games
HaltSound(beat);
ScheduleInput(beat, 1f, InputType.STANDARD_ALT_DOWN, HaltHit, GenericMiss, Empty);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Sarge.DoScaledAnimationAsync("Talk", 0.5f);}),
new BeatAction.Action(beat + 1f, delegate { foreach (var cadet in Cadets) cadet.DoScaledAnimationAsync("Halt", 0.5f);}),
@ -468,14 +468,14 @@ namespace HeavenStudio.Games
new MultiSound.Sound("marchingOrders/turnAction", beat + turnLength + 2f),
}, forcePlay: true);
BeatAction.New(gameObject, new List<BeatAction.Action>() {
BeatAction.New(this, new List<BeatAction.Action>() {
new BeatAction.Action(beat + turnLength + 2f,delegate {
if (shouldPoint) foreach (var cadet in Cadets) cadet.DoScaledAnimationAsync($"Point{(x ? "R" : "L")}", 0.5f);
foreach (var head in CadetHeads) head.DoScaledAnimationAsync($"Face{(x ? "R" : "L")}", 0.5f);
})
});
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Sarge.DoScaledAnimationAsync("Talk", 0.5f);}),
new BeatAction.Action(beat + turnLength + 1f, delegate { Sarge.DoScaledAnimationAsync("Talk", 0.5f);}),

View file

@ -155,7 +155,7 @@ namespace HeavenStudio.Games
bossBop = autoBop;
if (doesBop) {
for (int i = 0; i < length; i++) {
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() {
BeatAction.New(instance, new List<BeatAction.Action>() {
new BeatAction.Action(beat + i, delegate {
if (!BossAnim.IsPlayingAnimationName("BossCall") && !BossAnim.IsPlayingAnimationName("BossSignal")) {
BossAnim.DoScaledAnimationAsync(bossAnnoyed ? "BossMiss" : "Bop", 0.5f);
@ -178,7 +178,7 @@ namespace HeavenStudio.Games
SoundByte.PlayOneShotGame("meatGrinder/startSignal", beat - 1, forcePlay: true);
if (GameManager.instance.currentGame == "meatGrinder") {
BeatAction.New(MeatGrinder.instance.gameObject, new List<BeatAction.Action>() {
BeatAction.New(MeatGrinder.instance, new List<BeatAction.Action>() {
new BeatAction.Action(beat - 1, delegate {
MeatGrinder.instance.BossAnim.DoScaledAnimationAsync("BossSignal", 0.5f);
}),
@ -194,7 +194,7 @@ namespace HeavenStudio.Games
intervalStarted = true;
beatInterval = length;
BeatAction.New(gameObject, new List<BeatAction.Action>() {
BeatAction.New(this, new List<BeatAction.Action>() {
new BeatAction.Action(beat + length - 0.33f, delegate { PassTurn(beat); }),
});
}
@ -225,7 +225,7 @@ namespace HeavenStudio.Games
intervalStarted = false;
foreach (var input in queuedInputs)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(input + beatInterval , delegate {
MeatToss Meat = Instantiate(MeatBase, gameObject.transform).GetComponent<MeatToss>();

View file

@ -29,7 +29,7 @@ namespace HeavenStudio.Games.Scripts_MeatGrinder
{
game.ScheduleInput(startBeat, cueLength, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, Hit, Miss, Nothing);
BeatAction.New(gameObject, new List<BeatAction.Action>() {
BeatAction.New(this, new List<BeatAction.Action>() {
new BeatAction.Action(cueBased ? startBeat + 0.66f : cueLength + startBeat - 1 + 0.66f, delegate {
anim.DoScaledAnimationAsync(meatType+"Thrown", 0.32f);
}),

View file

@ -175,7 +175,7 @@ namespace HeavenStudio.Games
{
if (beat >= startBlippingBeat) {
double tempBeat = ((beat % 1 == 0.5) ? Mathf.Floor((float)beat) : Mathf.Round((float)beat)) + (startBlippingBeat % 1);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() {
BeatAction.New(instance, new List<BeatAction.Action>() {
new BeatAction.Action(tempBeat, delegate { man.RecursiveBlipping(tempBeat); })
});
startBlippingBeat = double.MaxValue;
@ -223,7 +223,7 @@ namespace HeavenStudio.Games
if (stopBlipping) instance.stopBlipping = true;
if (playDing) SoundByte.PlayOneShotGame("mrUpbeat/ding", beat: beat, forcePlay: true);
if (applause) SoundByte.PlayOneShot("applause", beat: beat);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() {
BeatAction.New(instance, new List<BeatAction.Action>() {
new BeatAction.Action(beat + 0.5, delegate {
instance.stopStepping = false;
instance.stopBlipping = false;
@ -255,7 +255,7 @@ namespace HeavenStudio.Games
metronomeAnim.DoScaledAnimationAsync("MetronomeGo" + dir, 0.5f);
SoundByte.PlayOneShotGame("mrUpbeat/metronome" + dir);
ScheduleInput(beat, 0.5f, InputType.STANDARD_DOWN, Success, Miss, Nothing);
BeatAction.New(gameObject, new List<BeatAction.Action>() {
BeatAction.New(this, new List<BeatAction.Action>() {
new BeatAction.Action(beat + 1, delegate { RecursiveStepping(beat + 1); })
});
stepIterate++;
@ -274,7 +274,7 @@ namespace HeavenStudio.Games
stepIterate++;
}));
}
BeatAction.New(gameObject, actions);
BeatAction.New(this, actions);
}
public static void Blipping(double beat, float length)

View file

@ -44,7 +44,7 @@ namespace HeavenStudio.Games.Scripts_MrUpbeat
if (shouldBlip) {
Blipping(beat);
}
BeatAction.New(gameObject, new List<BeatAction.Action>() {
BeatAction.New(this, new List<BeatAction.Action>() {
new BeatAction.Action(beat + 1, delegate { RecursiveBlipping(beat + 1); })
});
}

View file

@ -423,7 +423,7 @@ namespace HeavenStudio.Games
public void OneGoCue(double beat, Color firstColor)
{
BeatAction.New(gameObject, new List<BeatAction.Action>() {
BeatAction.New(this, new List<BeatAction.Action>() {
new BeatAction.Action(beat, delegate {
OneGiverAnim.DoScaledAnimationAsync("GiveIn", 0.5f);
// dumpling
@ -453,7 +453,7 @@ namespace HeavenStudio.Games
public void TwoTwoCue(double beat, Color firstColor, Color secondColor)
{
BeatAction.New(gameObject, new List<BeatAction.Action>() {
BeatAction.New(this, new List<BeatAction.Action>() {
new BeatAction.Action(beat-0.5f, delegate {
TwoGiverAnim.DoScaledAnimationAsync("GiveIn", 0.5f);
// first dumpling
@ -492,7 +492,7 @@ namespace HeavenStudio.Games
public void ThreeGoCue(double beat, Color firstColor, Color secondColor, Color thirdColor)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() {
BeatAction.New(instance, new List<BeatAction.Action>() {
new BeatAction.Action(beat, delegate {
// first in
ThreeGiverAnim.DoScaledAnimationAsync("GiveIn", 0.5f);

View file

@ -42,7 +42,10 @@ namespace HeavenStudio.Games.Loaders
},
resizable = true,
parameters = new List<Param>() {
new Param("shouldPrep", true, "Prepare?", "Plays a prepare animation before the cue."),
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("prepBeats", new EntityTypes.Float(0, 4, 1), "Prepare Beats", "How many beats before the cue does the octopus prepare?"),
},
preFunctionLength = 4f,
@ -79,7 +82,10 @@ namespace HeavenStudio.Games.Loaders
parameters = new List<Param>() {
new Param("forceBop", true, "Force Bop", "Forces a bop, even if an animation is playing."),
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 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("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."),
},
@ -101,7 +107,10 @@ namespace HeavenStudio.Games.Loaders
},
parameters = new List<Param>() {
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 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("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"),
},
@ -139,13 +148,22 @@ namespace HeavenStudio.Games.Loaders
OctopusMachine.instance.OctopusModifiers(e.beat, e["oct1x"], e["oct2x"], e["oct3x"], e["oct1y"], e["oct2y"], e["oct3y"], e["oct1"], e["oct2"], e["oct3"]);
},
parameters = new List<Param>() {
new Param("oct1", true, "Show Octopus 1", "Should the first octopus be enabled?"),
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("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("oct2", true, "Show Octopus 2", "Should the second octopus be enabled?"),
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("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("oct3", true, "Show Octopus 3", "Should the third octopus be enabled?"),
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("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"),
},
@ -260,7 +278,7 @@ namespace HeavenStudio.Games
if (GameManager.instance.currentGame != "octopusMachine") {
OctopusMachine.queuePrepare = true;
} else {
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() {
BeatAction.New(instance, new List<BeatAction.Action>() {
new BeatAction.Action(beat - prepBeats, delegate {
OctopusMachine.queuePrepare = true;
})
@ -397,7 +415,7 @@ namespace HeavenStudio.Games
intervalStartBeat = beat;
beatInterval = length;
intervalStarted = true;
BeatAction.New(gameObject, new List<BeatAction.Action>() {
BeatAction.New(this, new List<BeatAction.Action>() {
new BeatAction.Action(beat + length, delegate {
PassTurn(beat + length);
}),
@ -427,7 +445,7 @@ namespace HeavenStudio.Games
// thanks to ras for giving me this line of code
// i do NOT understand how it works
queuedInputs.Sort((s1, s2) => s1.beat.CompareTo(s2.beat));
BeatAction.New(gameObject, queuedInputs);
BeatAction.New(this, queuedInputs);
}
private void SqueezeHit(PlayerActionEvent caller, float state)

View file

@ -181,7 +181,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
if (action != (int) PajamaParty.SleepType.NoAwake)
seq.Add(new BeatAction.Action( beat + 7f, delegate { anim.DoScaledAnimationAsync("MonkeyAwake"); }));
BeatAction.New(Monkey, seq);
BeatAction.New(this, seq);
}
}
}

View file

@ -208,7 +208,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
else
{
anim.DoScaledAnimationAsync("MakoThrowOut", 0.5f);
BeatAction.New(Player, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(
beat + 0.5f,
@ -231,7 +231,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
charging = false;
canCharge = false;
canJump = false;
BeatAction.New(Player, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(
beat + 0.5f,
@ -366,7 +366,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
longSleep = true;
}
BeatAction.New(Player, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(
beat,
@ -418,7 +418,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
if (!longSleep)
{
BeatAction.New(Player, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(
caller.startBeat + 7f,

View file

@ -204,7 +204,7 @@ namespace HeavenStudio.Games
}
}));
}
BeatAction.New(gameObject, actions);
BeatAction.New(this, actions);
}
}
@ -218,7 +218,7 @@ namespace HeavenStudio.Games
new MultiSound.Sound("pajamaParty/three3", beat + 2f),
});
BeatAction.New(Bed, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(
beat,
@ -265,7 +265,7 @@ namespace HeavenStudio.Games
new MultiSound.Sound("pajamaParty/five5", beat + 2f)
});
BeatAction.New(Bed, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action( beat, delegate { JumpRow(4, beat); }),
new BeatAction.Action( beat + 0.5f, delegate { JumpRow(3, beat + 0.5f, 2); }),
@ -293,7 +293,7 @@ namespace HeavenStudio.Games
if (doSound)
PlayThrowSequenceSound(beat);
BeatAction.New(Mako.Player, new List<BeatAction.Action>()
BeatAction.New(Mako, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 2f, delegate { MonkeyCharge(beat + 2f); } ),
new BeatAction.Action(beat + 3f, delegate { MonkeyThrow(beat + 3f); } ),
@ -358,7 +358,7 @@ namespace HeavenStudio.Games
}
if (action == 1) return;
BeatAction.New(gameObject, new List<BeatAction.Action>() {
BeatAction.New(this, new List<BeatAction.Action>() {
new BeatAction.Action(deslumber, delegate {
Mako.anim.DoScaledAnimationAsync("MakoAwake", 0.5f);
SoundByte.PlayOneShotGame("pajamaParty/siestaDone");

View file

@ -17,11 +17,14 @@ namespace HeavenStudio.Games.Loaders
{
preFunction = delegate { var e = eventCaller.currentEntity; QuizShow.PreInterval(e.beat, e.length,
e["auto"], e["sound"], e["con"], e["visual"], e["audio"]); },
defaultLength = 8f,
defaultLength = 7f,
resizable = true,
parameters = new List<Param>()
{
new Param("auto", true, "Auto Pass Turn"),
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("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("visual", true, "Stopwatch (Visual)", "Should the stopwatch visually appear?"),
@ -60,7 +63,8 @@ namespace HeavenStudio.Games.Loaders
new Param("con", false, "Consecutive", "Disables everything that happens at the end of the interval if ticked on."),
new Param("visual", true, "Stopwatch (Visual)", "Should the stopwatch visually appear?"),
new Param("audio", QuizShow.ClockAudio.Both, "Stopwatch (Audio)", "Should the sounds of the stopwatch play?")
}
},
resizable = true
},
new GameAction("revealAnswer", "Reveal Answer")
{
@ -467,11 +471,11 @@ namespace HeavenStudio.Games
HostPressButton(inputBeat, isDpad);
}));
}
BeatAction.New(gameObject, actions);
BeatAction.New(this, actions);
if (autoPassTurn)
{
PassTurn(beat + interval, beat, interval, timeUpSound, consecutive, visualClock, audioClock);
PassTurn(beat + interval, beat, interval, timeUpSound, consecutive, visualClock, audioClock, 1);
}
}
@ -508,16 +512,17 @@ namespace HeavenStudio.Games
private void PassTurnStandalone(double beat, bool timeUpSound, bool consecutive, bool visualClock, int audioClock)
{
var lastInterval = GetLastIntervalBeforeBeat(beat);
float length = EventCaller.GetAllInGameManagerList("quizShow", new string[] { "passTurn" }).Find(x => x.beat == beat).length;
if (lastInterval != null)
{
PassTurn(beat, lastInterval.beat, lastInterval.length, timeUpSound, consecutive, visualClock, audioClock);
PassTurn(beat, lastInterval.beat, lastInterval.length, timeUpSound, consecutive, visualClock, audioClock, length);
}
}
private void PassTurn(double beat, double intervalBeat, float intervalLength, bool timeUpSound, bool consecutive, bool visualClock, int audioClock)
private void PassTurn(double beat, double intervalBeat, float intervalLength, bool timeUpSound, bool consecutive, bool visualClock, int audioClock, float length)
{
playerStartBeat = beat + 1;
playerLength = intervalLength;
playerStartBeat = beat + length - Conductor.instance.SecsToBeats(ngEarlyTime, Conductor.instance.GetBpmAtBeat(beat + length));
playerLength = intervalLength + (float)Conductor.instance.SecsToBeats(ngEarlyTime, Conductor.instance.GetBpmAtBeat(beat + length));
var relevantInputs = GetInputsBetweenBeat(intervalBeat, intervalBeat + intervalLength);
relevantInputs.Sort((x, y) => x.beat.CompareTo(y.beat));
@ -527,11 +532,11 @@ namespace HeavenStudio.Games
bool isDpad = relevantInputs[i].datamodel == "quizShow/dPad";
if (isDpad)
{
ScheduleAutoplayInput(beat, 1 + inputBeat, InputType.DIRECTION_DOWN, AutoplayDPad, Nothing, Nothing);
ScheduleAutoplayInput(beat, length + inputBeat, InputType.DIRECTION_DOWN, AutoplayDPad, Nothing, Nothing);
}
else
{
ScheduleAutoplayInput(beat, 1 + inputBeat, InputType.STANDARD_DOWN, AutoplayAButton, Nothing, Nothing);
ScheduleAutoplayInput(beat, length + inputBeat, InputType.STANDARD_DOWN, AutoplayAButton, Nothing, Nothing);
}
}
@ -573,10 +578,10 @@ namespace HeavenStudio.Games
if (visualClock)
{
spawnedTimer.gameObject.SetActive(true);
spawnedTimer.Init(beat + 1, intervalLength);
spawnedTimer.Init(beat + length, intervalLength);
}
}),
new BeatAction.Action(beat + 1 + intervalLength, delegate
new BeatAction.Action(beat + length + intervalLength, delegate
{
if (!consecutive)
{
@ -588,9 +593,9 @@ namespace HeavenStudio.Games
if (visualClock) Destroy(spawnedTimer.gameObject);
}
),
new BeatAction.Action(beat + 1 + intervalLength + timeUpBeat, delegate { if (timeUpSound && !consecutive) SoundByte.PlayOneShotGame("quizShow/timeUp"); }),
new BeatAction.Action(beat + length + intervalLength + timeUpBeat, delegate { if (timeUpSound && !consecutive) SoundByte.PlayOneShotGame("quizShow/timeUp"); }),
};
BeatAction.New(instance.gameObject, actions);
BeatAction.New(instance, actions);
}
void ContesteePressButton(bool dpad)
@ -672,7 +677,7 @@ namespace HeavenStudio.Games
public void RevealAnswer(double beat, float length)
{
blackOut.SetActive(true);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length, delegate
{

View file

@ -90,7 +90,7 @@ namespace HeavenStudio.Games.Scripts_RhythmRally
public void BounceFX(double bounceBeat)
{
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(bounceBeat, delegate
{

View file

@ -374,7 +374,7 @@ namespace HeavenStudio.Games
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
@ -500,7 +500,7 @@ namespace HeavenStudio.Games
{
if (speedChange == RallySpeed.Fast)
{
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 2f, delegate { Serve(beat + 2f, RallySpeed.Fast); })
});
@ -538,7 +538,7 @@ namespace HeavenStudio.Games
double beatToSpawn = beat + i;
servesToPerform.Add( new BeatAction.Action(beatToSpawn, delegate { Serve(beatToSpawn, RallySpeed.SuperFast); }) );
}
BeatAction.New(gameObject, servesToPerform);
BeatAction.New(this, servesToPerform);
}
}
}

View file

@ -111,7 +111,7 @@ namespace HeavenStudio.Games
backArm.Play("BackArmLift", 0, 0);
FrontArm.DoScaledAnimationAsync("ArmSlurp", 0.5f);
hasSlurped = true;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1f, delegate
{
@ -132,7 +132,7 @@ namespace HeavenStudio.Games
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
@ -153,7 +153,7 @@ namespace HeavenStudio.Games
new MultiSound.Sound("rhythmSomen/somen_woosh", beat + 1.5f),
});
BeatAction.New(Player, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { FarCrane.Play("Drop", -1, 0);}),
new BeatAction.Action(beat + 1.0f, delegate { FarCrane.Play("Open", -1, 0);}),
@ -172,7 +172,7 @@ namespace HeavenStudio.Games
new MultiSound.Sound("rhythmSomen/somen_woosh", beat + 1.5f),
});
BeatAction.New(Player, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { CloseCrane.Play("DropClose", -1, 0);}),
new BeatAction.Action(beat + 1.0f, delegate { CloseCrane.Play("OpenClose", -1, 0);}),
@ -193,7 +193,7 @@ namespace HeavenStudio.Games
new MultiSound.Sound("rhythmSomen/somen_woosh", beat + 1.5f),
});
BeatAction.New(Player, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { CloseCrane.Play("DropClose", -1, 0);}),
new BeatAction.Action(beat, delegate { FarCrane.Play("Drop", -1, 0);}),
@ -210,7 +210,7 @@ namespace HeavenStudio.Games
//Bell Sound lol
SoundByte.PlayOneShotGame("rhythmSomen/somen_bell");
BeatAction.New(Player, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { EffectExclam.Play("ExclamAppear", -1, 0);}),
});

View file

@ -26,7 +26,7 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
{
peekBeat = beat - 1;
peekRising = true;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length, delegate { peekBeat = beat + length; peekRising = false; shouldDelete = true; })
});

View file

@ -297,7 +297,7 @@ namespace HeavenStudio.Games
Hair hair = Instantiate(hairBase, transform).GetComponent<Hair>();
spawnedHairs.Add(hair);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -322,7 +322,7 @@ namespace HeavenStudio.Games
SoundByte.PlayOneShotGame("rhythmTweezers/longAppear", beat);
LongHair hair = Instantiate(longHairBase, transform).GetComponent<LongHair>();
spawnedLongs.Add(hair);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -417,7 +417,7 @@ namespace HeavenStudio.Games
Tweezers spawnedTweezers = Instantiate(Tweezers, transform);
spawnedTweezers.gameObject.SetActive(true);
spawnedTweezers.Init(beat, beat + length);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat - 0.25, delegate
{

View file

@ -235,7 +235,7 @@ namespace HeavenStudio.Games
SoundByte.PlayOneShotGame($"ringside/yell{UnityEngine.Random.Range(1, 7)}Raw");
SoundByte.PlayOneShotGame("ringside/barely");
wrestlerTransform.localScale = new Vector3(1.1f, 1.1f, 1f);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(cond.songPositionInBeatsAsDouble + 0.1f, delegate { wrestlerTransform.localScale = new Vector3(1f, 1f, 1f); }),
});
@ -301,7 +301,7 @@ namespace HeavenStudio.Games
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
@ -376,7 +376,7 @@ namespace HeavenStudio.Games
{
int currentQuestion = questionVariant;
if (currentQuestion == (int)QuestionVariant.Random) currentQuestion = UnityEngine.Random.Range(1, 4);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat - 0.5f, delegate { reporterAnim.DoScaledAnimationAsync("WubbaLubbaDubbaThatTrue", 0.4f); }),
});
@ -392,7 +392,7 @@ namespace HeavenStudio.Games
new MultiSound.Sound($"ringside/true{currentQuestion}", beat + 1f),
}, forcePlay: true);
ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, JustQuestion, Miss, Nothing);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.5f, delegate { reporterAnim.DoScaledAnimationAsync("ThatTrue", 0.5f); }),
new BeatAction.Action(beat + 1.5f, delegate { canBop = false; }),
@ -418,7 +418,7 @@ namespace HeavenStudio.Games
ScheduleInput(beat, 2.5f, InputType.STANDARD_DOWN, JustBigGuyFirst, MissBigGuyOne, Nothing);
ScheduleInput(beat, 3f, InputType.STANDARD_DOWN, JustBigGuySecond, MissBigGuyTwo, Nothing);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 2f, delegate { reporterAnim.Play("True", 0, 0); }),
new BeatAction.Action(beat + 2.25f, delegate { canBop = false; }),
@ -464,7 +464,7 @@ namespace HeavenStudio.Games
{
reporterShouldHeart = false;
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -496,7 +496,7 @@ namespace HeavenStudio.Games
{
if (newspaperBeats > 0)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 3f, delegate
{
@ -540,7 +540,7 @@ namespace HeavenStudio.Games
}
else
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 3.99f, delegate
{
@ -553,7 +553,7 @@ namespace HeavenStudio.Games
}
else
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 2.5f, delegate
{
@ -563,7 +563,7 @@ namespace HeavenStudio.Games
});
if (newspaperBeats > 0)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 3f, delegate
{
@ -684,7 +684,7 @@ namespace HeavenStudio.Games
SoundByte.PlayOneShotGame($"ringside/cough");
reporterAnim.Play("ExtendMiss", 0, 0);
SoundByte.PlayOneShotGame($"ringside/huhaudience{UnityEngine.Random.Range(0, 2)}");
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 0.5f, delegate { reporterAnim.Play("IdleMiss", 0, 0); }),
new BeatAction.Action(caller.startBeat + caller.timer + 0.9f, delegate { reporterAnim.Play("IdleReporter", 0, 0); }),
@ -699,7 +699,7 @@ namespace HeavenStudio.Games
wrestlerAnim.DoScaledAnimationAsync("Ye", 0.5f);
reporterAnim.Play("ExtendSmile", 0, 0);
SoundByte.PlayOneShotGame($"ringside/ye{UnityEngine.Random.Range(1, 4)}");
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 0.5f, delegate { SoundByte.PlayOneShotGame("ringside/yeCamera"); }),
new BeatAction.Action(caller.startBeat + caller.timer + 0.5f, delegate { FadeFlashColor(Color.white, new Color(1, 1, 1, 0), 0.5f); }),
@ -737,7 +737,7 @@ namespace HeavenStudio.Games
wrestlerAnim.DoScaledAnimationAsync("BigGuyTwo", 0.5f);
if (!missedBigGuy)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 0.5f, delegate { reporterAnim.Play("IdleReporter", 0, 0); }),
});
@ -746,7 +746,7 @@ namespace HeavenStudio.Games
{
reporterAnim.Play("ExtendMiss", 0, 0);
SoundByte.PlayOneShotGame($"ringside/huhaudience{UnityEngine.Random.Range(0, 2)}");
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 0.5f, delegate { reporterAnim.Play("IdleMiss", 0, 0); }),
new BeatAction.Action(caller.startBeat + caller.timer + 0.9f, delegate { reporterAnim.Play("IdleReporter", 0, 0); }),
@ -764,7 +764,7 @@ namespace HeavenStudio.Games
if (!missedBigGuy)
{
reporterAnim.Play("ExtendSmile", 0, 0);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 0.5f, delegate { SoundByte.PlayOneShotGame("ringside/musclesCamera"); }),
new BeatAction.Action(caller.startBeat + caller.timer + 0.5f, delegate { reporterAnim.Play("SmileReporter", 0, 0); }),
@ -777,7 +777,7 @@ namespace HeavenStudio.Games
else
{
reporterAnim.Play("ExtendMiss", 0, 0);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 0.5f, delegate { reporterAnim.Play("IdleMiss", 0, 0); }),
new BeatAction.Action(caller.startBeat + caller.timer + 0.9f, delegate { reporterAnim.Play("IdleReporter", 0, 0); }),
@ -796,7 +796,7 @@ namespace HeavenStudio.Games
SoundByte.PlayOneShotGame($"ringside/yell{UnityEngine.Random.Range(1, 7)}Raw");
reporterAnim.Play("IdleMiss", 0, 0);
SoundByte.PlayOneShotGame($"ringside/huhaudience{UnityEngine.Random.Range(0, 2)}");
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 0.1f, delegate { wrestlerTransform.localScale = new Vector3(1f, 1f, 1f); }),
});
@ -824,7 +824,7 @@ namespace HeavenStudio.Games
FadeFlashColor(Color.white, new Color(1, 1, 1, 0), 1f);
FadeBGColor(Color.black, defaultBGColorLight, 1f);
flashParticles.Play();
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 0.1f, delegate { wrestlerTransform.localScale = new Vector3(1f, 1f, 1f); }),
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate { SoundByte.PlayOneShotGame("ringside/poseCamera"); }),
@ -838,7 +838,7 @@ namespace HeavenStudio.Games
{
reporterAnim.Play("ExtendMiss", 0, 0);
SoundByte.PlayOneShotGame($"ringside/huhaudience{UnityEngine.Random.Range(0, 2)}");
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 0.5f, delegate { reporterAnim.Play("IdleMiss", 0, 0); }),
new BeatAction.Action(caller.startBeat + caller.timer + 0.9f, delegate { reporterAnim.Play("IdleReporter", 0, 0); }),
@ -854,7 +854,7 @@ namespace HeavenStudio.Games
{
reporterAnim.Play("ExtendMiss", 0, 0);
SoundByte.PlayOneShotGame($"ringside/huhaudience{UnityEngine.Random.Range(0, 2)}");
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 0.5f, delegate { reporterAnim.Play("IdleMiss", 0, 0); }),
new BeatAction.Action(caller.startBeat + caller.timer + 0.9f, delegate { reporterAnim.Play("IdleReporter", 0, 0); }),

View file

@ -623,7 +623,7 @@ namespace HeavenStudio.Games
cameraMoveBeat = beat + 2;
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 2, delegate
{
@ -678,7 +678,7 @@ namespace HeavenStudio.Games
targetCameraX = 0;
cameraMoveBeat = beat + 2;
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 2, delegate
{
@ -748,7 +748,7 @@ namespace HeavenStudio.Games
targetCameraX = 0;
cameraMoveBeat = beat + goToMiddleBeat;
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + goToMiddleBeat, delegate
{
@ -808,7 +808,7 @@ namespace HeavenStudio.Games
break;
}
}
BeatAction.New(instance.gameObject, actions);
BeatAction.New(instance, actions);
}
public static void PreInterval(double beat, float length, bool autoPassTurn, bool moveCamera, bool movePass)
@ -854,7 +854,7 @@ namespace HeavenStudio.Games
riffUsedBeats.Add(input.beat);
if (input.beat >= gameSwitchBeat)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(input.beat, delegate { Riff(input.beat, input.length, new int[]
{
@ -879,7 +879,7 @@ namespace HeavenStudio.Games
bendUsedBeats.Add(beat);
if (input.beat >= gameSwitchBeat)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(input.beat, delegate
{
@ -889,7 +889,7 @@ namespace HeavenStudio.Games
}
}
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -908,7 +908,7 @@ namespace HeavenStudio.Games
public void Riff(double beat, float length, int[] pitches, bool gleeClubJJ, int sampleJJ, int sampleTonesJJ, bool noRespond)
{
JJ.StrumStrings(gleeClubJJ, pitches, (PremadeSamples)sampleJJ, sampleTonesJJ, noRespond);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length, delegate { JJ.Mute(); })
});
@ -932,7 +932,7 @@ namespace HeavenStudio.Games
public void Bend(double beat, float length, int pitchJJ)
{
JJ.BendUp(pitchJJ);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length, delegate { JJ.BendDown(); })
});
@ -990,7 +990,7 @@ namespace HeavenStudio.Games
var relevantInputs = GrabAllInputsBetween(intervalStartBeat, intervalStartBeat + intervalLength);
if (relevantInputs.Count > 0)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat - 1, delegate
{

View file

@ -160,7 +160,7 @@ namespace HeavenStudio.Games
goBopChild = whoBopsAuto == (int)WhoBops.Children || whoBopsAuto == (int)WhoBops.Both;
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate { BopSingle(whoBops); })
});

View file

@ -19,7 +19,10 @@ namespace HeavenStudio.Games.Loaders
defaultLength = 4f,
parameters = new List<Param>()
{
new Param("high", false, "High", "Will they perform high jumps?"),
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("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?")
}
@ -30,7 +33,10 @@ namespace HeavenStudio.Games.Loaders
defaultLength = 3f,
parameters = new List<Param>()
{
new Param("high", false, "High", "Will they perform high jumps?"),
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("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?")
}
@ -41,7 +47,10 @@ namespace HeavenStudio.Games.Loaders
defaultLength = 3f,
parameters = new List<Param>()
{
new Param("high", false, "High", "Will they perform high jumps?"),
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("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?")
}
@ -52,7 +61,10 @@ namespace HeavenStudio.Games.Loaders
defaultLength = 2f,
parameters = new List<Param>()
{
new Param("high", false, "High", "Will they perform high jumps?"),
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("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?")
}
@ -344,7 +356,7 @@ namespace HeavenStudio.Games
float beatToJump = (float)allJumpEvents[currentJumpIndex].beat - (inJump ? 1 : 2);
SoundByte.PlayOneShotGame("seeSaw/prepareHigh", beatToJump);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beatToJump, delegate { see.SetState(inJump ? SeeSawGuy.JumpState.StartJumpIn : SeeSawGuy.JumpState.StartJump, beatToJump); see.canBop = false; })
});
@ -418,7 +430,7 @@ namespace HeavenStudio.Games
}
}));
}
BeatAction.New(instance.gameObject, bops);
BeatAction.New(instance, bops);
}
}
@ -484,7 +496,7 @@ namespace HeavenStudio.Games
{
saw.canBop = true;
SoundByte.PlayOneShotGame("seeSaw/otherLand", beat + 4);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 3.75f, delegate { see.canBop = true; }),
new BeatAction.Action(beat + 4, delegate { see.Land(SeeSawGuy.LandType.Normal, true); canPrepare = true;})
@ -544,7 +556,7 @@ namespace HeavenStudio.Games
saw.canBop = true;
float beatLength = see.ShouldEndJumpOut() ? 4 : 3;
SoundByte.PlayOneShotGame("seeSaw/otherLand", beat + beatLength);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + beatLength - 0.25f, delegate { see.canBop = true; }),
new BeatAction.Action(beat + beatLength, delegate { see.Land(SeeSawGuy.LandType.Normal, true); canPrepare = true;})
@ -604,7 +616,7 @@ namespace HeavenStudio.Games
saw.canBop = true;
float beatLength = see.ShouldEndJumpOut() ? 3 : 2;
SoundByte.PlayOneShotGame("seeSaw/otherLand", beat + beatLength);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + beatLength - 0.25f, delegate { see.canBop = true; }),
new BeatAction.Action(beat + beatLength, delegate { see.Land(SeeSawGuy.LandType.Normal, false); canPrepare = true; })
@ -663,7 +675,7 @@ namespace HeavenStudio.Games
{
saw.canBop = true;
SoundByte.PlayOneShotGame("seeSaw/otherLand", beat + 2);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1.75f, delegate { see.canBop = true; }),
new BeatAction.Action(beat + 2, delegate { see.Land(SeeSawGuy.LandType.Normal, false); canPrepare = true;})

View file

@ -142,6 +142,7 @@ namespace HeavenStudio.Games.Scripts_SeeSaw
transform.position = GetPathPositionFromBeat(currentPath, Math.Max(startBeat, currentBeat), startBeat);
break;
}
float newCamY = 0f;
if (!see && game.cameraMove)
{
switch (currentState)
@ -152,11 +153,11 @@ namespace HeavenStudio.Games.Scripts_SeeSaw
case JumpState.HighOutIn:
case JumpState.HighInOut:
case JumpState.HighInIn:
float newCamY = Math.Max(GetPathPositionFromBeat(cameraPath, Math.Max(startBeat, currentBeat), startBeat).y, 0);
gameTrans.localPosition = new Vector3(0, -newCamY, 0);
newCamY = Math.Max(GetPathPositionFromBeat(cameraPath, Math.Max(startBeat, currentBeat), startBeat).y, 0);
break;
}
}
gameTrans.localPosition = new Vector3(0, -newCamY, 0);
}
}
@ -171,7 +172,7 @@ namespace HeavenStudio.Games.Scripts_SeeSaw
dead = true;
anim.DoScaledAnimationAsync("Choke_" + (see ? "See" : "Saw") + "_Intro", 0.5f);
SoundByte.PlayOneShotGame("seeSaw/explosion" + (see ? "Black" : "White"), beat + length);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length - 1, delegate { invertAnim.DoScaledAnimationAsync("Invert", 0.5f); }),
new BeatAction.Action(beat + length, delegate { anim.DoScaledAnimationAsync("Explode", 0.5f); deathParticle.Play();})
@ -243,7 +244,7 @@ namespace HeavenStudio.Games.Scripts_SeeSaw
if (landType is not LandType.Barely)
{
string getUpAnim = "GetUp_" + landOut + typeOfLanding;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(Conductor.instance.songPositionInBeatsAsDouble + (getUpOut ? 1f : 0.5f), delegate { anim.DoScaledAnimationAsync(getUpAnim, 0.5f); })
});
@ -315,7 +316,7 @@ namespace HeavenStudio.Games.Scripts_SeeSaw
cameraPath.positions[0].duration = 2f;
anim.DoScaledAnimationAsync(miss ? "BadOut_SeeReact" : "Jump_OutOut_Start", 0.5f);
if (see) return;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1, delegate { anim.DoScaledAnimationAsync("Jump_OutOut_Transform", 0.5f); })
});
@ -327,7 +328,7 @@ namespace HeavenStudio.Games.Scripts_SeeSaw
cameraPath.positions[0].duration = 2f;
anim.DoScaledAnimationAsync(miss ? "BadOut_SeeReact" : "Jump_OutIn_Start", 0.5f);
if (see) return;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1, delegate { anim.DoScaledAnimationAsync("Jump_OutIn_Transform", 0.5f); })
});
@ -339,7 +340,7 @@ namespace HeavenStudio.Games.Scripts_SeeSaw
cameraPath.positions[0].duration = 1f;
anim.DoScaledAnimationAsync(miss ? "BadIn_SeeReact" : "Jump_InIn_Start", 0.5f);
if (see) return;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.5f, delegate { anim.DoScaledAnimationAsync("Jump_OutOut_Transform", 0.5f); })
});
@ -351,7 +352,7 @@ namespace HeavenStudio.Games.Scripts_SeeSaw
cameraPath.positions[0].duration = 1f;
anim.DoScaledAnimationAsync(miss ? "BadIn_SeeReact" : "Jump_InIn_Start", 0.5f);
if (see) return;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.5f, delegate { anim.DoScaledAnimationAsync("Jump_OutIn_Transform", 0.5f); })
});

View file

@ -195,7 +195,7 @@ namespace HeavenStudio.Games
{
ScheduleInput(beat, length * 7, InputType.STANDARD_DOWN, JustNoSlowDown, Miss, Out);
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length * 3, delegate { ForceReload(); })
});
@ -221,7 +221,7 @@ namespace HeavenStudio.Games
bowAnim.DoScaledAnimationAsync("BowRecoil", 0.25f);
hasArrowLoaded = false;
SoundByte.PlayOneShotGame("sneakySpirits/arrowMiss", -1, 2);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 3f, delegate {
if (GameManager.instance.currentGame == "sneakySpirits")
@ -242,7 +242,7 @@ namespace HeavenStudio.Games
GameObject spawnedGhost = Instantiate(ghostMissPrefab, transform);
spawnedGhost.SetActive(true);
spawnedGhost.GetComponent<Animator>().DoScaledAnimationAsync("GhostBarely", 0.5f);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 2f, delegate {
if (GameManager.instance.currentGame == "sneakySpirits")
@ -266,7 +266,7 @@ namespace HeavenStudio.Games
GameObject spawnedGhost = Instantiate(ghostMissPrefab, transform);
spawnedGhost.SetActive(true);
spawnedGhost.GetComponent<Animator>().DoScaledAnimationAsync("GhostBarely", 0.5f);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 2f, delegate {
if (GameManager.instance.currentGame == "sneakySpirits")
@ -313,14 +313,14 @@ namespace HeavenStudio.Games
slowTree.SetActive(true);
normalTree.SetActive(false);
Conductor.instance.SetMinigamePitch(0.25f);
Conductor.instance.SetMinigamePitch(1f, caller.startBeat + caller.timer + 1f);
}
doorAnim.DoScaledAnimationAsync("DoorOpen", 0.5f);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate
{
if (slowDown) Conductor.instance.SetMinigamePitch(1f);
doorAnim.DoScaledAnimationAsync("DoorClose", 0.5f);
slowRain.SetActive(false);
normalRain.SetActive(true);
@ -336,7 +336,7 @@ namespace HeavenStudio.Games
GameObject spawnedGhost = Instantiate(ghostMissPrefab, transform);
spawnedGhost.SetActive(true);
spawnedGhost.GetComponent<Animator>().DoScaledAnimationAsync("GhostMiss", 0.5f);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 1f, delegate {
if (GameManager.instance.currentGame == "sneakySpirits")

View file

@ -19,7 +19,7 @@ namespace HeavenStudio.Games.Scripts_SneakySpirits
public void Init(double spawnBeat, float length)
{
if (length == 0) length = 1;
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(spawnBeat, delegate { anim.DoScaledAnimationAsync("Move", (1 / length) * Conductor.instance.SongPitch); }),
new BeatAction.Action(spawnBeat + (length * 0.5f), delegate { anim.DoScaledAnimationAsync("MoveDown", (1 / length) * Conductor.instance.SongPitch); }),

View file

@ -283,7 +283,7 @@ namespace HeavenStudio.Games
{
if (!grampsLoopingAnim || !grampsSniffing) return;
spaceGrampsShouldBop = false;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -317,7 +317,7 @@ namespace HeavenStudio.Games
{
if (!grampsLoopingAnim || grampsSniffing) return;
spaceGrampsShouldBop = false;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.66666f , delegate
{
@ -412,7 +412,7 @@ namespace HeavenStudio.Games
if (grampsTurns) grampsCanBop = false;
ScheduleInput(beat, 1f, InputType.DIRECTION_RIGHT_DOWN, JustRight, RightMiss, Empty);
BeatAction.New(Player, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -481,7 +481,7 @@ namespace HeavenStudio.Games
if (grampsSits) grampsCanBop = false;
ScheduleInput(beat, 1f, InputType.DIRECTION_DOWN_DOWN, JustSit, SitMiss, Empty);
BeatAction.New(Player, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -556,7 +556,7 @@ namespace HeavenStudio.Games
if (grampsPunches) grampsCanBop = false;
ScheduleInput(beat, 1.5f, InputType.STANDARD_DOWN, JustPunch, PunchMiss, Empty);
BeatAction.New(Player, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -615,7 +615,7 @@ namespace HeavenStudio.Games
bops.Add(new BeatAction.Action(beat + i, delegate { GrampsBop(); }));
}
}
BeatAction.New(instance.gameObject, bops);
BeatAction.New(instance, bops);
}
}

View file

@ -62,7 +62,7 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
if (beatToKick < Conductor.instance.songPositionInBeatsAsDouble) beatToKick = ball.nextAnimBeat;
if (ball.state == Ball.State.HighKicked)
{
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beatToKick - 0.5f, delegate { Kick(true, true); }),
new BeatAction.Action(beatToKick, delegate { Toe(true); }),
@ -71,7 +71,7 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
}
else
{
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beatToKick, delegate { KickCheck(true, false, beatToKick); }),
});
@ -296,7 +296,7 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
HighKick(hit);
if (!player)
{
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + ball.GetAnimLength(Ball.State.Kicked), delegate { Kick(true, true); }),
new BeatAction.Action(beat + ball.GetAnimLength(Ball.State.Toe), delegate { Toe(true); }),
@ -309,7 +309,7 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
Kick(hit);
if (!player)
{
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + ball.GetAnimLength(Ball.State.Kicked), delegate { KickCheck(true, false, beat + ball.GetAnimLength(Ball.State.Kicked)); }),
});
@ -320,7 +320,7 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
Kick(hit);
if (!player)
{
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + ball.GetAnimLength(Ball.State.Kicked), delegate { KickCheck(true, false, beat + ball.GetAnimLength(Ball.State.Kicked)); }),
});

View file

@ -143,7 +143,7 @@ namespace HeavenStudio.Games.Scripts_Splashdown
{
anim.Play("Idle", 0, 0);
SetState(MovementState.JumpIntoWater, beat);
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.75, delegate
{
@ -171,7 +171,7 @@ namespace HeavenStudio.Games.Scripts_Splashdown
{
anim.DoScaledAnimationAsync(missed ? "DolphinMiss" : "Dolphin", 0.5f);
}
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1.75, delegate { Instantiate(splashPrefab, splashHolder).Init("BigSplash"); }),
new BeatAction.Action(beat + 2, delegate

View file

@ -178,7 +178,7 @@ namespace HeavenStudio.Games
player.JumpIntoWater(beat + length - 1);
}));
SoundByte.PlayOneShotGame("splashdown/start", beat + length - 0.25);
BeatAction.New(instance.gameObject, actions);
BeatAction.New(instance, actions);
}
public void GoDown(double beat, float length)
@ -196,7 +196,7 @@ namespace HeavenStudio.Games
SoundByte.PlayOneShotGame("splashdown/whistle", diveBeat);
SoundByte.PlayOneShotGame("splashdown/downOthers", diveBeat);
}
BeatAction.New(instance.gameObject, actions);
BeatAction.New(instance, actions);
SoundByte.PlayOneShotGame("splashdown/whistle", beat + (currentSynchrettes.Count * length));
ScheduleInput(beat, currentSynchrettes.Count * length, InputType.STANDARD_DOWN, JustDown, Out, Out);
}
@ -216,7 +216,7 @@ namespace HeavenStudio.Games
SoundByte.PlayOneShotGame("splashdown/whistle", diveBeat);
SoundByte.PlayOneShotGame("splashdown/upOthers", diveBeat);
}
BeatAction.New(instance.gameObject, actions);
BeatAction.New(instance, actions);
SoundByte.PlayOneShotGame("splashdown/whistle", beat + (currentSynchrettes.Count * length));
switch (appearType)
{
@ -249,7 +249,7 @@ namespace HeavenStudio.Games
SoundByte.PlayOneShotGame("splashdown/rollOthers", diveBeat + 1);
SoundByte.PlayOneShotGame("splashdown/splashOthers", diveBeat + 1.75);
}
BeatAction.New(instance.gameObject, actions);
BeatAction.New(instance, actions);
SoundByte.PlayOneShotGame("splashdown/yeah", beat + (currentSynchrettes.Count * length));
ScheduleInput(beat, currentSynchrettes.Count * length, InputType.STANDARD_UP, dolphin ? JustJump : JustJumpNoDolphin, Out, Out);
}
@ -258,7 +258,7 @@ namespace HeavenStudio.Games
{
if (IsIntroing()) return;
SoundByte.PlayOneShotGame("splashdown/together");
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 2, delegate
{
@ -295,7 +295,7 @@ namespace HeavenStudio.Games
{
if (IsIntroing()) return;
SoundByte.PlayOneShotGame("splashdown/togetherRemix9");
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1, delegate
{
@ -386,7 +386,7 @@ namespace HeavenStudio.Games
}
SoundByte.PlayOneShotGame("splashdown/rollPlayer", diveBeat + 1);
player.Jump(diveBeat);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(diveBeat + 1.75, delegate { crowdAnim.DoScaledAnimationAsync("CrowdCheer", 0.5f); }),
new BeatAction.Action(diveBeat + 4, delegate { crowdAnim.Play("CrowdIdle", 0, 0); })
@ -405,7 +405,7 @@ namespace HeavenStudio.Games
}
SoundByte.PlayOneShotGame("splashdown/rollPlayer", diveBeat + 1);
player.Jump(diveBeat, false, true);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(diveBeat + 1.75, delegate { crowdAnim.DoScaledAnimationAsync("CrowdCheer", 0.5f); }),
new BeatAction.Action(diveBeat + 4, delegate { crowdAnim.Play("CrowdIdle", 0, 0); })
@ -423,7 +423,7 @@ namespace HeavenStudio.Games
return;
}
player.Jump(diveBeat, false, true);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(diveBeat + 1.75, delegate { crowdAnim.DoScaledAnimationAsync("CrowdCheer", 0.5f); }),
new BeatAction.Action(diveBeat + 4, delegate { crowdAnim.Play("CrowdIdle", 0, 0); })

View file

@ -16,7 +16,7 @@ namespace HeavenStudio.Games.Loaders
new GameAction("beat intervals", "Start Interval")
{
preFunction = delegate {var e = eventCaller.currentEntity; Tambourine.PreInterval(e.beat, e.length, e["auto"]); },
defaultLength = 8f,
defaultLength = 7f,
resizable = true,
parameters = new List<Param>()
{
@ -37,7 +37,7 @@ namespace HeavenStudio.Games.Loaders
{
Tambourine.PrePassTurn(eventCaller.currentEntity.beat);
},
defaultLength = 1f,
resizable = true,
preFunctionLength = 1f
},
new GameAction("bop", "Bop")
@ -256,11 +256,11 @@ namespace HeavenStudio.Games
}
}
BeatAction.New(gameObject, actions);
BeatAction.New(this, actions);
if (autoPassTurn)
{
PassTurn(beat + interval, beat, interval);
PassTurn(beat + interval, beat, interval, 1);
}
}
@ -300,10 +300,11 @@ namespace HeavenStudio.Games
private void PassTurnStandalone(double beat)
{
var lastInterval = GetLastIntervalBeforeBeat(beat);
if (lastInterval != null) PassTurn(beat, lastInterval.beat, lastInterval.length);
float length = EventCaller.GetAllInGameManagerList("tambourine", new string[] { "pass turn" }).Find(x => x.beat == beat).length;
if (lastInterval != null) PassTurn(beat, lastInterval.beat, lastInterval.length, length);
}
private void PassTurn(double beat, double intervalBeat, float intervalLength)
private void PassTurn(double beat, double intervalBeat, float intervalLength, float length)
{
SoundByte.PlayOneShotGame($"tambourine/monkey/turnPass/{UnityEngine.Random.Range(1, 6)}", beat);
List<BeatAction.Action> actions = new()
@ -323,12 +324,12 @@ namespace HeavenStudio.Games
double inputBeat = relevantInputs[i].beat - intervalBeat;
actions.Add(new BeatAction.Action(inputBeat, delegate
{
if (isHit) ScheduleInput(beat + 1, inputBeat, InputType.STANDARD_ALT_DOWN, JustHit, Miss, Nothing);
else ScheduleInput(beat + 1, inputBeat, InputType.STANDARD_DOWN, JustShake, Miss, Nothing);
Bop(beat + 1 + inputBeat, 1, (int)WhoBops.Monkey, (int)WhoBops.None);
if (isHit) ScheduleInput(beat + length, inputBeat, InputType.STANDARD_ALT_DOWN, JustHit, Miss, Nothing);
else ScheduleInput(beat + length, inputBeat, InputType.STANDARD_DOWN, JustShake, Miss, Nothing);
Bop(beat + length + inputBeat, 1, (int)WhoBops.Monkey, (int)WhoBops.None);
}));
}
BeatAction.New(gameObject, actions);
BeatAction.New(this, actions);
}
public void Bop(double beat, float length, int whoBops, int whoBopsAuto)
@ -337,7 +338,7 @@ namespace HeavenStudio.Games
handsGoBop = whoBopsAuto == (int)WhoBops.Player || whoBopsAuto == (int)WhoBops.Both;
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
@ -376,7 +377,7 @@ namespace HeavenStudio.Games
new MultiSound.Sound("tambourine/player/turnPass/note3", beat + 0.3f),
}, forcePlay: true);
happyFace.SetActive(true);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 1, delegate { happyFace.SetActive(false); }),
});

View file

@ -56,7 +56,10 @@ namespace HeavenStudio.Games.Loaders
defaultLength = 1f,
parameters = new List<Param>()
{
new Param("toggle", true, "Scroll FX", "Will scroll"),
new Param("toggle", true, "Scroll FX", "Will scroll", new List<Param.CollapseParam>()
{
new Param.CollapseParam(x => (bool)x, new string[] { "flash", "m"})
}),
new Param("flash", true, "Flash FX", "Will flash to white"),
new Param("m", new EntityTypes.Float(0, 10, 1), "Speed Multiplier")
}
@ -256,7 +259,7 @@ namespace HeavenStudio.Games
{
actions.Add(new BeatAction.Action(beat + i, delegate { SingleBop(); }));
}
BeatAction.New(gameObject, actions);
BeatAction.New(this, actions);
}
}
@ -275,7 +278,7 @@ namespace HeavenStudio.Games
public void Tap(double beat)
{
canBop = false;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -305,7 +308,7 @@ namespace HeavenStudio.Games
public void DoubleTap(double beat)
{
canBop = false;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -344,7 +347,7 @@ namespace HeavenStudio.Games
public void TripleTap(double beat)
{
canBop = false;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -397,7 +400,7 @@ namespace HeavenStudio.Games
{
canBop = false;
jumpStartBeat = beat;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{

View file

@ -124,7 +124,7 @@ namespace HeavenStudio.Games.Scripts_TapTrial
anim.DoScaledAnimationAsync("PosePrepare_1", 0.5f);
state = TapState.TripleTap;
tripleTaps = 0;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.5, delegate
{

View file

@ -31,9 +31,15 @@ namespace HeavenStudio.Games.Loaders
resizable = true,
parameters = new List<Param>()
{
new Param("okay", true, "Okay Voice Line", "Whether or not the tappers should say -Okay!- after successfully tapping."),
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("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 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("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("noReady", false, "Mute Ready")
@ -219,7 +225,7 @@ namespace HeavenStudio.Games
foreach (var tap in queuedTaps)
{
Tapping(tap.beat, tap.length, tap.okay, tap.okayType, tap.animType, tap.popperBeats, tap.randomVoiceLine);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(tap.beat - 1.1f, delegate { prepareTap = true; }),
new BeatAction.Action(tap.beat, delegate { prepareTap = false; })
@ -346,7 +352,7 @@ namespace HeavenStudio.Games
for (int i = 0; i < length; i++)
{
TapTroupe.instance.ScheduleInput(beat - 1, 1 + i, InputType.STANDARD_DOWN, TapTroupe.instance.JustStep, TapTroupe.instance.MissStep, TapTroupe.instance.Nothing);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
@ -355,7 +361,7 @@ namespace HeavenStudio.Games
})
});
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat - 1, delegate
{
@ -382,7 +388,7 @@ namespace HeavenStudio.Games
if (GameManager.instance.currentGame == "tapTroupe")
{
TapTroupe.instance.Tapping(beat, length, okay, okayType, animType, popperBeats, randomVoiceLine);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat - 1.1f, delegate { prepareTap = true; }),
new BeatAction.Action(beat, delegate { prepareTap = false; })
@ -416,7 +422,7 @@ namespace HeavenStudio.Games
otherSoundToPlay = "other2";
beatToSpawn = Math.Ceiling(beat + i);
finalBeatToSpawn = beatToSpawn;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beatToSpawn - 0.3f, delegate { currentTapAnim = TapTroupeTapper.TapAnim.LastTap; shouldSwitchStep = false; }),
new BeatAction.Action(beatToSpawn, delegate { NPCTap(TapTroupeTapper.TapAnim.LastTap, true, false);}),
@ -426,7 +432,7 @@ namespace HeavenStudio.Games
else if (i + 1.5f >= actualLength)
{
soundToPlay = "tapvoice2";
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beatToSpawn - 0.3f, delegate { currentTapAnim = TapTroupeTapper.TapAnim.Tap; shouldSwitchStep = false; }),
new BeatAction.Action(beatToSpawn, delegate { NPCTap(TapTroupeTapper.TapAnim.Tap, true, false); })
@ -437,7 +443,7 @@ namespace HeavenStudio.Games
soundToPlay = "tapvoice1";
if (actualLength == 2.25f)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beatToSpawn - 0.3f, delegate { currentTapAnim = TapTroupeTapper.TapAnim.Tap; shouldSwitchStep = true; }),
new BeatAction.Action(beatToSpawn, delegate { NPCTap(TapTroupeTapper.TapAnim.Tap); })
@ -445,7 +451,7 @@ namespace HeavenStudio.Games
}
else
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beatToSpawn - 0.3f, delegate { currentTapAnim = TapTroupeTapper.TapAnim.Tap; shouldSwitchStep = false; }),
new BeatAction.Action(beatToSpawn, delegate { NPCTap(TapTroupeTapper.TapAnim.Tap, true, false); })
@ -459,7 +465,7 @@ namespace HeavenStudio.Games
{
if (actualLength == 3f)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beatToSpawn - 0.3f, delegate { currentTapAnim = TapTroupeTapper.TapAnim.Tap; shouldSwitchStep = true; }),
new BeatAction.Action(beatToSpawn, delegate { NPCTap(TapTroupeTapper.TapAnim.Tap); })
@ -467,7 +473,7 @@ namespace HeavenStudio.Games
}
else
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beatToSpawn - 0.3f, delegate { currentTapAnim = TapTroupeTapper.TapAnim.BamTapReady; shouldSwitchStep = true; }),
new BeatAction.Action(beatToSpawn, delegate { NPCTap(TapTroupeTapper.TapAnim.BamTapReady); })
@ -476,7 +482,7 @@ namespace HeavenStudio.Games
}
else if (i == 0)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beatToSpawn - 0.3f, delegate { currentTapAnim = TapTroupeTapper.TapAnim.BamReady; shouldSwitchStep = false; }),
new BeatAction.Action(beatToSpawn, delegate { NPCTap(TapTroupeTapper.TapAnim.BamReady, true, false); })
@ -485,7 +491,7 @@ namespace HeavenStudio.Games
else
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beatToSpawn - 0.3f, delegate { currentTapAnim = TapTroupeTapper.TapAnim.Bam; shouldSwitchStep = true; }),
new BeatAction.Action(beatToSpawn, delegate { NPCTap(TapTroupeTapper.TapAnim.Bam); }),
@ -534,7 +540,7 @@ namespace HeavenStudio.Games
okayOneVoiceLine = "A";
break;
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat - 1f, delegate
{
@ -593,7 +599,7 @@ namespace HeavenStudio.Games
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
@ -718,7 +724,7 @@ namespace HeavenStudio.Games
{
corner.ResetFace();
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 0.1f, delegate { if (playerTapper.transform.localScale.x != npcTappers[0].transform.localScale.x) playerTapper.dontSwitchNextStep = true; })
});

View file

@ -66,7 +66,7 @@ namespace HeavenStudio.Games.Scripts_TapTroupe
public void PartyPopper(double beat)
{
bodyAnim.Play("PartyPopperReady", 0, 0);
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { bodyAnim.Play("PartyPopper", 0, 0); }),
new BeatAction.Action(beat + 1f, delegate { bodyAnim.DoScaledAnimationAsync("PartyPopperPop", 0.25f); SoundByte.PlayOneShotGame("tapTroupe/popper"); popperEffect.Play(); }),

View file

@ -343,7 +343,7 @@ namespace HeavenStudio.Games
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
@ -412,7 +412,7 @@ namespace HeavenStudio.Games
crouchEndBeat = beat + length;
ScheduleInput(beat, 2f * actualLength, InputType.STANDARD_DOWN, JustCrouch, Nothing, Nothing);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
@ -555,7 +555,7 @@ namespace HeavenStudio.Games
}
player.canBop = true;
}));
BeatAction.New(instance.gameObject, posesToDo);
BeatAction.New(instance, posesToDo);
}
void JustCrouch(PlayerActionEvent caller, float state)

View file

@ -67,7 +67,7 @@ namespace HeavenStudio.Games.Scripts_TheDazzles
public void StartReleaseBox(double beat)
{
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(beat - 1f, delegate {if (holding) holdEffectAnim.DoScaledAnimationAsync("ReleaseBox", 0.25f);})
});

View file

@ -278,7 +278,7 @@ namespace HeavenStudio.Games
{
bops.Add(new BeatAction.Action(beat + i, delegate { SingleBop(); }));
}
BeatAction.New(instance.gameObject, bops);
BeatAction.New(instance, bops);
}
}
#endregion
@ -353,14 +353,14 @@ namespace HeavenStudio.Games
ScheduleInput(beat, length, GetInputTypeBasedOnCurrentReceiver(), JustHitBall, Miss, Empty);
if (passBallDict[beat + length].datamodel == "tossBoys/dual" || passBallDict[beat + length].datamodel == "tossBoys/lightning" || passBallDict[beat + length].datamodel == "tossBoys/blur")
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length - 1, delegate { DoSpecialBasedOnReceiver(beat + length - 1); })
});
}
else if (passBallDict[beat + length].datamodel == "tossBoys/pop")
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length - 1, delegate { GetCurrentReceiver().PopBallPrepare(); })
});
@ -368,7 +368,7 @@ namespace HeavenStudio.Games
}
else
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length, delegate { Miss(null); })
});
@ -436,7 +436,7 @@ namespace HeavenStudio.Games
}
if (passBallDict.ContainsKey(beat + currentEventLength) && passBallDict[beat + currentEventLength].datamodel == "tossBoys/pop")
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + currentEventLength - 1, delegate { GetCurrentReceiver().PopBallPrepare(); })
});
@ -488,7 +488,7 @@ namespace HeavenStudio.Games
};
if (passBallDict.ContainsKey(beat + length) && (passBallDict[beat + length].datamodel is "tossBoys/dual" or "tossBoys/lightning" or "tossBoys/blur"))
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length - 1, delegate { DoSpecialBasedOnReceiver(beat + length - 1); })
});
@ -543,7 +543,7 @@ namespace HeavenStudio.Games
};
if (passBallDict.ContainsKey(beat + length) && (passBallDict[beat + length].datamodel is "tossBoys/lightning" or "tossBoys/blur"))
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length - 1, delegate { DoSpecialBasedOnReceiver(beat + length - 1); })
});
@ -597,7 +597,7 @@ namespace HeavenStudio.Games
};
if (passBallDict.ContainsKey(beat + length) && (passBallDict[beat + length].datamodel is "tossBoys/dual" or "tossBoys/lightning" or "tossBoys/blur"))
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length - 1, delegate { DoSpecialBasedOnReceiver(beat + length - 1); })
});
@ -653,7 +653,7 @@ namespace HeavenStudio.Games
if (secondBeat == 0.25f) soundsToPlay.Add(new MultiSound.Sound("tossBoys/" + last + current + "Low" + 3, beat + 0.5f, 1, 1, false, thirdOffset));
if (passBallDict.ContainsKey(beat + length) && (passBallDict[beat + length].datamodel is "tossBoys/dual" or "tossBoys/blur"))
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length - 1, delegate { DoSpecialBasedOnReceiver(beat + length - 1); })
});

View file

@ -74,7 +74,7 @@ namespace HeavenStudio.Games.Scripts_TossBoys
public void ShowArrow(double startBeat, float length)
{
BeatAction.New(game.gameObject, new List<BeatAction.Action>(){
BeatAction.New(game, new List<BeatAction.Action>(){
new BeatAction.Action(startBeat, delegate { arrow.SetActive(true); }),
new BeatAction.Action(startBeat + length, delegate { arrow.SetActive(false); }),
});

View file

@ -267,7 +267,7 @@ namespace HeavenStudio.Games
return;
}
SoundByte.PlayOneShotGame("tramAndPauline/transformTram");
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 1, delegate
{
@ -286,7 +286,7 @@ namespace HeavenStudio.Games
return;
}
SoundByte.PlayOneShotGame("tramAndPauline/transformPauline");
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(caller.startBeat + caller.timer + 1, delegate
{

View file

@ -130,7 +130,7 @@ namespace HeavenStudio.Games
{
foreach (var input in queuedInputs)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(input.beat - 1f, delegate
{
@ -170,7 +170,7 @@ namespace HeavenStudio.Games
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
@ -194,7 +194,7 @@ namespace HeavenStudio.Games
{
if (GameManager.instance.currentGame == "trickClass")
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat - 1, delegate
{

View file

@ -199,7 +199,7 @@ namespace HeavenStudio.Games
private void PassTurn(double beat, CallAndResponseHandler crHandler)
{
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat - 0.25, delegate
{
@ -262,7 +262,7 @@ namespace HeavenStudio.Games
plant.createBeat = beat;
BeatAction.New(gameObject, new List<BeatAction.Action>()
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{

View file

@ -116,7 +116,7 @@ namespace HeavenStudio.Games.Scripts_WorkingDough
double beat = Conductor.instance.songPositionInBeats;
startBeat = beat;
game.playerImpact.SetActive(true);
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.1f, delegate { game.playerImpact.SetActive(false); }),
});
@ -153,7 +153,7 @@ namespace HeavenStudio.Games.Scripts_WorkingDough
}
bool hasGandw = false;
if (gandw != null) hasGandw = gandw.activeSelf;
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.9f, delegate { game.arrowSRRightPlayer.sprite = game.redArrowSprite; }),
new BeatAction.Action(beat + 1f, delegate { game.arrowSRRightPlayer.sprite = game.whiteArrowSprite; }),
@ -167,7 +167,7 @@ namespace HeavenStudio.Games.Scripts_WorkingDough
double beat = Conductor.instance.songPositionInBeats;
rightInput.Disable();
game.playerImpact.SetActive(true);
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.1f, delegate { game.playerImpact.SetActive(false); }),
});
@ -196,7 +196,7 @@ namespace HeavenStudio.Games.Scripts_WorkingDough
currentState = State.Miss;
startBeat = beat;
Update();
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
BeatAction.New(game, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.25f, delegate { game.missImpact.SetActive(true); }),
new BeatAction.Action(beat + 0.25f, delegate { SoundByte.PlayOneShotGame("workingDough/BallMiss"); }),

Some files were not shown because too many files have changed in this diff Show more