Merge branch 'LumberPerson' of https://github.com/iloveoatmeal2022/HeavenStudio into LumberPerson

This commit is contained in:
ev 2024-02-23 15:19:07 -05:00
commit 3deae53ed3
2 changed files with 31 additions and 9 deletions

View file

@ -16,7 +16,7 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
[SerializeField] private float _zoomInPower = 4f;
private bool _rested = false;
private bool _restSound = true;
private LumBEARjack.RestSoundChoice _restSound;
private float _cameraPointZFrom;
private EasingFunction.Function _cameraFunc = EasingFunction.GetEasingFunction(EasingFunction.Ease.EaseOutBounce);
@ -62,15 +62,29 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
_anim.DoScaledAnimationAsync("BeastBop", 0.5f);
}
public void Rest(bool instant, bool sound)
public void Rest(bool instant, LumBEARjack.RestSoundChoice sound)
{
_anim.DoScaledAnimationAsync("BeastRest", 0.5f, instant ? 1 : 0);
_rested = true;
_restSound = sound;
}
public void RestSound()
{
if (_restSound) SoundByte.PlayOneShotGame("lumbearjack/sigh" + (Random.Range(1, 3) == 1 ? "A" : "B"));
switch (_restSound)
{
case LumBEARjack.RestSoundChoice.Random:
SoundByte.PlayOneShotGame("lumbearjack/sigh" + (Random.Range(1, 3) == 1 ? "A" : "B"));
break;
case LumBEARjack.RestSoundChoice.restA:
SoundByte.PlayOneShotGame("lumbearjack/sighA");
break;
case LumBEARjack.RestSoundChoice.restB:
SoundByte.PlayOneShotGame("lumbearjack/sighB");
break;
default:
break;
}
}
private Coroutine _currentZoomCo;

View file

@ -115,13 +115,13 @@ namespace HeavenStudio.Games.Loaders
function = delegate
{
var e = eventCaller.currentEntity;
LumBEARjack.instance.RestBear(e["instant"], e["sound"]);
LumBEARjack.instance.RestBear(e["instant"], (LumBEARjack.RestSoundChoice)e["sound"]);
},
defaultLength = 4,
defaultLength = 3,
parameters = new()
{
new("instant", false, "Instant"),
new("sound", true, "Sound")
new("sound", LumBEARjack.RestSoundChoice.Random, "Sound")
}
},
@ -207,6 +207,14 @@ namespace HeavenStudio.Games
public class LumBEARjack : Minigame
{
public enum RestSoundChoice
{
Random,
restA,
restB,
NoSound
}
public enum SmallType
{
log,
@ -916,11 +924,11 @@ namespace HeavenStudio.Games
{
if (bgCats < beforeBgCats)
{
_bgCats[i].Activate(beat, length, bgCats >= i, instant || !(i > bgCats && i <= beforeBgCats), dance, instant);
_bgCats[i].Activate(beat, length, bgCats >= i, instant || !(i > bgCats && i <= beforeBgCats), dance, instant || i <= bgCats);
}
else if (bgCats > beforeBgCats)
{
_bgCats[i].Activate(beat, length, bgCats >= i, instant || !(i > beforeBgCats && i <= bgCats), dance, instant);
_bgCats[i].Activate(beat, length, bgCats >= i, instant || !(i > beforeBgCats && i <= bgCats), dance, instant || i <= beforeBgCats);
}
else
{
@ -1034,7 +1042,7 @@ namespace HeavenStudio.Games
#region Misc
public void RestBear(bool instant, bool sound)
public void RestBear(bool instant, RestSoundChoice sound)
{
_bear.Rest(instant, sound);
}