Merge branch 'LumberPerson' of https://github.com/iloveoatmeal2022/HeavenStudio into LumberPerson
This commit is contained in:
commit
6dc9aad7c4
|
|
@ -11,12 +11,12 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
|
||||||
private LumBEARjack.BigType _type;
|
private LumBEARjack.BigType _type;
|
||||||
private PlayerActionEvent _cutActionEvent;
|
private PlayerActionEvent _cutActionEvent;
|
||||||
|
|
||||||
public void Init(LBJBear bear, double beat, double length, LumBEARjack.BigType type)
|
public void Init(LBJBear bear, double beat, double length, LumBEARjack.BigType type, double startUpBeat = -1)
|
||||||
{
|
{
|
||||||
_bear = bear;
|
_bear = bear;
|
||||||
_type = type;
|
_type = type;
|
||||||
|
|
||||||
LumBEARjack.instance.ScheduleInput(beat, length / 4 * 2, Minigame.InputAction_BasicPress, JustHit, Miss, Blank);
|
if (startUpBeat <= beat + (length / 4 * 2)) LumBEARjack.instance.ScheduleInput(beat, length / 4 * 2, Minigame.InputAction_BasicPress, JustHit, Miss, Blank);
|
||||||
_cutActionEvent = LumBEARjack.instance.ScheduleInput(beat, length / 4 * 3, Minigame.InputAction_BasicPress, JustCut, Miss, Blank);
|
_cutActionEvent = LumBEARjack.instance.ScheduleInput(beat, length / 4 * 3, Minigame.InputAction_BasicPress, JustCut, Miss, Blank);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
|
||||||
private LumBEARjack.HugeType _type;
|
private LumBEARjack.HugeType _type;
|
||||||
private PlayerActionEvent[] _soundsToDeleteIfMiss = new PlayerActionEvent[3];
|
private PlayerActionEvent[] _soundsToDeleteIfMiss = new PlayerActionEvent[3];
|
||||||
|
|
||||||
public void Init(LBJBear bear, double beat, double length, LumBEARjack.HugeType type)
|
public void Init(LBJBear bear, double beat, double length, LumBEARjack.HugeType type, double startUpBeat = -1)
|
||||||
{
|
{
|
||||||
_bear = bear;
|
_bear = bear;
|
||||||
_type = type;
|
_type = type;
|
||||||
|
|
||||||
LumBEARjack.instance.ScheduleInput(beat, length / 6 * 2, Minigame.InputAction_BasicPress, JustHit1, Miss, Blank);
|
if (startUpBeat <= beat + (length / 6 * 2)) LumBEARjack.instance.ScheduleInput(beat, length / 6 * 2, Minigame.InputAction_BasicPress, JustHit1, Miss, Blank);
|
||||||
_soundsToDeleteIfMiss[0] = LumBEARjack.instance.ScheduleInput(beat, length / 6 * 3, Minigame.InputAction_BasicPress, JustHit2, Miss, Blank);
|
if (startUpBeat <= beat + (length / 6 * 3)) _soundsToDeleteIfMiss[0] = LumBEARjack.instance.ScheduleInput(beat, length / 6 * 3, Minigame.InputAction_BasicPress, JustHit2, Miss, Blank);
|
||||||
_soundsToDeleteIfMiss[1] = LumBEARjack.instance.ScheduleInput(beat, length / 6 * 4, Minigame.InputAction_BasicPress, JustHit3, Miss, Blank);
|
if (startUpBeat <= beat + (length / 6 * 4)) _soundsToDeleteIfMiss[1] = LumBEARjack.instance.ScheduleInput(beat, length / 6 * 4, Minigame.InputAction_BasicPress, JustHit3, Miss, Blank);
|
||||||
_soundsToDeleteIfMiss[2] = LumBEARjack.instance.ScheduleInput(beat, length / 6 * 5, Minigame.InputAction_BasicPress, JustCut, Miss, Blank);
|
_soundsToDeleteIfMiss[2] = LumBEARjack.instance.ScheduleInput(beat, length / 6 * 5, Minigame.InputAction_BasicPress, JustCut, Miss, Blank);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
|
||||||
private LBJBear _bear;
|
private LBJBear _bear;
|
||||||
private LumBEARjack.SmallType _type;
|
private LumBEARjack.SmallType _type;
|
||||||
|
|
||||||
public void Init(LBJBear bear, double beat, double length, LumBEARjack.SmallType type)
|
public void Init(LBJBear bear, double beat, double length, LumBEARjack.SmallType type, double startUpBeat = -1)
|
||||||
{
|
{
|
||||||
_bear = bear;
|
_bear = bear;
|
||||||
_type = type;
|
_type = type;
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
preFunction = delegate
|
preFunction = delegate
|
||||||
{
|
{
|
||||||
var e = eventCaller.currentEntity;
|
var e = eventCaller.currentEntity;
|
||||||
|
if (!e["sound"]) return;
|
||||||
LumBEARjack.SmallObjectSound(e.beat, e.length, (LumBEARjack.SmallType)e["type"]);
|
LumBEARjack.SmallObjectSound(e.beat, e.length, (LumBEARjack.SmallType)e["type"]);
|
||||||
},
|
},
|
||||||
function = delegate
|
function = delegate
|
||||||
|
|
@ -35,7 +36,8 @@ namespace HeavenStudio.Games.Loaders
|
||||||
defaultLength = 3,
|
defaultLength = 3,
|
||||||
parameters = new()
|
parameters = new()
|
||||||
{
|
{
|
||||||
new("type", LumBEARjack.SmallType.log, "Type")
|
new("type", LumBEARjack.SmallType.log, "Type"),
|
||||||
|
new("sound", true, "Cue Sound")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new("big", "Big Object")
|
new("big", "Big Object")
|
||||||
|
|
@ -43,6 +45,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
preFunction = delegate
|
preFunction = delegate
|
||||||
{
|
{
|
||||||
var e = eventCaller.currentEntity;
|
var e = eventCaller.currentEntity;
|
||||||
|
if (!e["sound"]) return;
|
||||||
LumBEARjack.BigObjectSound(e.beat, e.length, (LumBEARjack.BigType)e["type"]);
|
LumBEARjack.BigObjectSound(e.beat, e.length, (LumBEARjack.BigType)e["type"]);
|
||||||
},
|
},
|
||||||
function = delegate
|
function = delegate
|
||||||
|
|
@ -53,7 +56,8 @@ namespace HeavenStudio.Games.Loaders
|
||||||
defaultLength = 4,
|
defaultLength = 4,
|
||||||
parameters = new()
|
parameters = new()
|
||||||
{
|
{
|
||||||
new("type", LumBEARjack.BigType.log, "Type")
|
new("type", LumBEARjack.BigType.log, "Type"),
|
||||||
|
new("sound", true, "Cue Sound")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new("huge", "Huge Object")
|
new("huge", "Huge Object")
|
||||||
|
|
@ -61,6 +65,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
preFunction = delegate
|
preFunction = delegate
|
||||||
{
|
{
|
||||||
var e = eventCaller.currentEntity;
|
var e = eventCaller.currentEntity;
|
||||||
|
if (!e["sound"]) return;
|
||||||
LumBEARjack.HugeObjectSound(e.beat, e.length, (LumBEARjack.HugeType)e["type"]);
|
LumBEARjack.HugeObjectSound(e.beat, e.length, (LumBEARjack.HugeType)e["type"]);
|
||||||
},
|
},
|
||||||
function = delegate
|
function = delegate
|
||||||
|
|
@ -71,9 +76,83 @@ namespace HeavenStudio.Games.Loaders
|
||||||
defaultLength = 6,
|
defaultLength = 6,
|
||||||
parameters = new()
|
parameters = new()
|
||||||
{
|
{
|
||||||
new("type", LumBEARjack.HugeType.log, "Type")
|
new("type", LumBEARjack.HugeType.log, "Type"),
|
||||||
|
new("sound", true, "Cue Sound")
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
new("sigh", "Sigh")
|
||||||
|
{
|
||||||
|
preFunction = delegate
|
||||||
|
{
|
||||||
|
SoundByte.PlayOneShotGame("lumbearjack/sigh" + (UnityEngine.Random.Range(1, 3) == 1 ? "A" : "B"), eventCaller.currentEntity.beat, 1, 1, false, true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Stretchable Objects
|
||||||
|
|
||||||
|
new("smallS", "Small Object (Stretchable)")
|
||||||
|
{
|
||||||
|
preFunction = delegate
|
||||||
|
{
|
||||||
|
var e = eventCaller.currentEntity;
|
||||||
|
if (!e["sound"]) return;
|
||||||
|
LumBEARjack.SmallObjectSound(e.beat, e.length, (LumBEARjack.SmallType)e["type"]);
|
||||||
|
},
|
||||||
|
function = delegate
|
||||||
|
{
|
||||||
|
var e = eventCaller.currentEntity;
|
||||||
|
LumBEARjack.instance.SpawnSmallObject(e.beat, e.length, (LumBEARjack.SmallType)e["type"]);
|
||||||
|
},
|
||||||
|
defaultLength = 3,
|
||||||
|
parameters = new()
|
||||||
|
{
|
||||||
|
new("type", LumBEARjack.SmallType.log, "Type"),
|
||||||
|
new("sound", true, "Cue Sound")
|
||||||
|
},
|
||||||
|
resizable = true
|
||||||
|
},
|
||||||
|
new("bigS", "Big Object (Stretchable)")
|
||||||
|
{
|
||||||
|
preFunction = delegate
|
||||||
|
{
|
||||||
|
var e = eventCaller.currentEntity;
|
||||||
|
if (!e["sound"]) return;
|
||||||
|
LumBEARjack.BigObjectSound(e.beat, e.length, (LumBEARjack.BigType)e["type"]);
|
||||||
|
},
|
||||||
|
function = delegate
|
||||||
|
{
|
||||||
|
var e = eventCaller.currentEntity;
|
||||||
|
LumBEARjack.instance.SpawnBigObject(e.beat, e.length, (LumBEARjack.BigType)e["type"]);
|
||||||
|
},
|
||||||
|
defaultLength = 4,
|
||||||
|
parameters = new()
|
||||||
|
{
|
||||||
|
new("type", LumBEARjack.BigType.log, "Type"),
|
||||||
|
new("sound", true, "Cue Sound")
|
||||||
|
},
|
||||||
|
resizable = true
|
||||||
|
},
|
||||||
|
new("hugeS", "Huge Object (Stretchable)")
|
||||||
|
{
|
||||||
|
preFunction = delegate
|
||||||
|
{
|
||||||
|
var e = eventCaller.currentEntity;
|
||||||
|
if (!e["sound"]) return;
|
||||||
|
LumBEARjack.HugeObjectSound(e.beat, e.length, (LumBEARjack.HugeType)e["type"]);
|
||||||
|
},
|
||||||
|
function = delegate
|
||||||
|
{
|
||||||
|
var e = eventCaller.currentEntity;
|
||||||
|
LumBEARjack.instance.SpawnHugeObject(e.beat, e.length, (LumBEARjack.HugeType)e["type"]);
|
||||||
|
},
|
||||||
|
defaultLength = 6,
|
||||||
|
parameters = new()
|
||||||
|
{
|
||||||
|
new("type", LumBEARjack.HugeType.log, "Type"),
|
||||||
|
new("sound", true, "Cue Sound")
|
||||||
|
},
|
||||||
|
resizable = true
|
||||||
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -133,121 +212,158 @@ namespace HeavenStudio.Games
|
||||||
|
|
||||||
#region Spawn Objects
|
#region Spawn Objects
|
||||||
|
|
||||||
public void SpawnSmallObject(double beat, double length, SmallType type)
|
public void SpawnSmallObject(double beat, double length, SmallType type, double startUpBeat = -1)
|
||||||
{
|
{
|
||||||
BeatAction.New(this, new()
|
BeatAction.New(this, new()
|
||||||
{
|
{
|
||||||
new(beat + (length / 3), delegate
|
new(beat + (length / 3), delegate
|
||||||
{
|
{
|
||||||
LBJSmallObject spawnedObject = Instantiate(_smallObjectPrefab, transform);
|
LBJSmallObject spawnedObject = Instantiate(_smallObjectPrefab, transform);
|
||||||
spawnedObject.Init(_bear, beat, length, type);
|
spawnedObject.Init(_bear, beat, length, type, startUpBeat);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SpawnBigObject(double beat, double length, BigType type)
|
public void SpawnBigObject(double beat, double length, BigType type, double startUpBeat = -1)
|
||||||
{
|
{
|
||||||
BeatAction.New(this, new()
|
BeatAction.New(this, new()
|
||||||
{
|
{
|
||||||
new(beat + (length / 4), delegate
|
new(beat + (length / 4), delegate
|
||||||
{
|
{
|
||||||
LBJBigObject spawnedObject = Instantiate(_bigObjectPrefab, transform);
|
LBJBigObject spawnedObject = Instantiate(_bigObjectPrefab, transform);
|
||||||
spawnedObject.Init(_bear, beat, length, type);
|
spawnedObject.Init(_bear, beat, length, type, startUpBeat);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SpawnHugeObject(double beat, double length, HugeType type)
|
public void SpawnHugeObject(double beat, double length, HugeType type, double startUpBeat = -1)
|
||||||
{
|
{
|
||||||
BeatAction.New(this, new()
|
BeatAction.New(this, new()
|
||||||
{
|
{
|
||||||
new(beat + (length / 6), delegate
|
new(beat + (length / 6), delegate
|
||||||
{
|
{
|
||||||
LBJHugeObject spawnedObject = Instantiate(_hugeObjectPrefab, transform);
|
LBJHugeObject spawnedObject = Instantiate(_hugeObjectPrefab, transform);
|
||||||
spawnedObject.Init(_bear, beat, length, type);
|
spawnedObject.Init(_bear, beat, length, type, startUpBeat);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region StartUp Methods
|
||||||
|
|
||||||
|
public override void OnGameSwitch(double beat)
|
||||||
|
{
|
||||||
|
PersistObjects(beat);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnPlay(double beat)
|
||||||
|
{
|
||||||
|
PersistObjects(beat);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PersistObjects(double beat)
|
||||||
|
{
|
||||||
|
List<RiqEntity> allEligibleEvents = EventCaller.GetAllInGameManagerList("lumbearjack", new string[] { "small", "big", "huge", "smallS", "bigS", "hugeS" }).FindAll(x => x.beat < beat && x.beat + x.length > beat);
|
||||||
|
|
||||||
|
for (int i = 0; i < allEligibleEvents.Count; i++)
|
||||||
|
{
|
||||||
|
var e = allEligibleEvents[i];
|
||||||
|
|
||||||
|
switch (e.datamodel.Split(1))
|
||||||
|
{
|
||||||
|
case "small":
|
||||||
|
case "smallS":
|
||||||
|
SmallObjectSound(e.beat, e.length, (SmallType)e["type"], beat);
|
||||||
|
SpawnSmallObject(e.beat, e.length, (SmallType)e["type"], beat);
|
||||||
|
break;
|
||||||
|
case "big":
|
||||||
|
case "bigS":
|
||||||
|
BigObjectSound(e.beat, e.length, (BigType)e["type"], beat);
|
||||||
|
SpawnBigObject(e.beat, e.length, (BigType)e["type"], beat);
|
||||||
|
break;
|
||||||
|
case "huge":
|
||||||
|
case "hugeS":
|
||||||
|
HugeObjectSound(e.beat, e.length, (HugeType)e["type"], beat);
|
||||||
|
SpawnHugeObject(e.beat, e.length, (HugeType)e["type"], beat);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region PreSounds
|
#region PreSounds
|
||||||
|
|
||||||
public static void SmallObjectSound(double beat, float length, SmallType type)
|
public static void SmallObjectSound(double beat, float length, SmallType type, double startUpBeat = -1)
|
||||||
{
|
{
|
||||||
switch (type)
|
List<MultiSound.Sound> sounds = new();
|
||||||
|
if (beat >= startUpBeat) sounds.Add(new("lumbearjack/readyVoice", beat));
|
||||||
|
if (beat + (length / 3) >= startUpBeat)
|
||||||
{
|
{
|
||||||
case SmallType.bat:
|
switch (type)
|
||||||
case SmallType.log:
|
{
|
||||||
MultiSound.Play(new MultiSound.Sound[]
|
case SmallType.bat:
|
||||||
{
|
case SmallType.log:
|
||||||
new("lumbearjack/readyVoice", beat),
|
sounds.Add(new("lumbearjack/smallLogPut", beat + (length / 3)));
|
||||||
new("lumbearjack/smallLogPut", beat + (length / 3))
|
break;
|
||||||
}, true, true);
|
case SmallType.can:
|
||||||
break;
|
sounds.Add(new("lumbearjack/canPut", beat + (length / 3)));
|
||||||
case SmallType.can:
|
break;
|
||||||
MultiSound.Play(new MultiSound.Sound[]
|
case SmallType.broom:
|
||||||
{
|
sounds.Add(new("lumbearjack/broomPut", beat + (length / 3)));
|
||||||
new("lumbearjack/readyVoice", beat),
|
break;
|
||||||
new("lumbearjack/canPut", beat + (length / 3))
|
default:
|
||||||
}, true, true);
|
break;
|
||||||
break;
|
}
|
||||||
case SmallType.broom:
|
|
||||||
MultiSound.Play(new MultiSound.Sound[]
|
|
||||||
{
|
|
||||||
new("lumbearjack/readyVoice", beat),
|
|
||||||
new("lumbearjack/broomPut", beat + (length / 3))
|
|
||||||
}, true, true);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sounds.Count > 0) MultiSound.Play(sounds.ToArray(), true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void BigObjectSound(double beat, float length, BigType type)
|
public static void BigObjectSound(double beat, float length, BigType type, double startUpBeat = -1)
|
||||||
{
|
{
|
||||||
switch (type)
|
List<MultiSound.Sound> sounds = new();
|
||||||
|
if (beat >= startUpBeat) sounds.Add(new("lumbearjack/readyVoice", beat));
|
||||||
|
if (beat + (length / 4) >= startUpBeat)
|
||||||
{
|
{
|
||||||
case BigType.log:
|
switch (type)
|
||||||
MultiSound.Play(new MultiSound.Sound[]
|
{
|
||||||
{
|
case BigType.log:
|
||||||
new("lumbearjack/readyVoice", beat),
|
sounds.Add(new("lumbearjack/bigLogPut", beat + (length / 4)));
|
||||||
new("lumbearjack/bigLogPut", beat + (length / 4))
|
break;
|
||||||
}, true, true);
|
default:
|
||||||
break;
|
break;
|
||||||
default:
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sounds.Count > 0) MultiSound.Play(sounds.ToArray(), true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void HugeObjectSound(double beat, float length, HugeType type)
|
public static void HugeObjectSound(double beat, float length, HugeType type, double startUpBeat = -1)
|
||||||
{
|
{
|
||||||
switch (type)
|
List<MultiSound.Sound> sounds = new();
|
||||||
|
|
||||||
|
if (beat >= startUpBeat) sounds.Add(new("lumbearjack/readyVoice", beat));
|
||||||
|
if (beat + (length / 6) >= startUpBeat)
|
||||||
{
|
{
|
||||||
case HugeType.log:
|
switch (type)
|
||||||
MultiSound.Play(new MultiSound.Sound[]
|
{
|
||||||
{
|
case HugeType.log:
|
||||||
new("lumbearjack/readyVoice", beat),
|
sounds.Add(new("lumbearjack/hugeLogPut", beat + (length / 6)));
|
||||||
new("lumbearjack/hugeLogPut", beat + (length / 6))
|
break;
|
||||||
}, true, true);
|
case HugeType.freezer:
|
||||||
break;
|
sounds.Add(new("lumbearjack/freezerPut", beat + (length / 6)));
|
||||||
case HugeType.freezer:
|
break;
|
||||||
MultiSound.Play(new MultiSound.Sound[]
|
case HugeType.peach:
|
||||||
{
|
sounds.Add(new("lumbearjack/peachPut", beat + (length / 6)));
|
||||||
new("lumbearjack/readyVoice", beat),
|
break;
|
||||||
new("lumbearjack/freezerPut", beat + (length / 6))
|
default:
|
||||||
}, true, true);
|
break;
|
||||||
break;
|
}
|
||||||
case HugeType.peach:
|
|
||||||
MultiSound.Play(new MultiSound.Sound[]
|
|
||||||
{
|
|
||||||
new("lumbearjack/readyVoice", beat),
|
|
||||||
new("lumbearjack/peachPut", beat + (length / 6))
|
|
||||||
}, true, true);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sounds.Count > 0) MultiSound.Play(sounds.ToArray(), true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
||||||
|
|
@ -18,5 +18,8 @@ MonoBehaviour:
|
||||||
_disableAutoReloadInBackground: 0
|
_disableAutoReloadInBackground: 0
|
||||||
ImportedScriptPaths:
|
ImportedScriptPaths:
|
||||||
- Assets/Scripts/Games/LumBEARjack/LBJHugeObject.cs
|
- Assets/Scripts/Games/LumBEARjack/LBJHugeObject.cs
|
||||||
|
- Assets/Scripts/Games/LumBEARjack/LumBEARjack.cs
|
||||||
|
- Assets/Scripts/Games/LumBEARjack/LBJBigObject.cs
|
||||||
|
- Assets/Scripts/Games/LumBEARjack/LBJSmallObject.cs
|
||||||
PathsToSkipImportEvent: []
|
PathsToSkipImportEvent: []
|
||||||
PathsToIgnoreOverwriteSettingOnAttribute: []
|
PathsToIgnoreOverwriteSettingOnAttribute: []
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue