mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 13:37:40 +02:00
Fixes and a couple new features here and there (#616)
* i love the blue bear * launch party beginning * fork lifter fixes * whiff strum guitar + snekky * rockers score miss fix * splashdown tweak * auto dispense and inactive dispense iteration 1 * fixed some auto dispense bugs * another small fix * auto dispense + miss stuff * fixed mr game and watch being slow boy * no log * monk fix * bg launch aprt * coint oss layer thing * tap troupe and double date fixes * fixing spaceball line * extended cheer reaers bg * upbeat constant * fixed uglyness * Gomenasai * fix lines 2 * tram and pauline new sprite --------- Co-authored-by: ev <85412919+evdial@users.noreply.github.com> Co-authored-by: minenice55 <star.elementa@gmail.com>
This commit is contained in:
@ -39,16 +39,12 @@ namespace HeavenStudio.Games.Loaders
|
||||
},
|
||||
new GameAction("stretchEmotion", "Emotion")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; if (e["instant"] || e["type"] == (int)BlueBear.EmotionStretchType.NoEmotion) BlueBear.instance.SetEmotion(e.beat, e["type"]); },
|
||||
function = delegate { var e = eventCaller.currentEntity; if (BlueBear.IsInstantEmotion(e["type"])) BlueBear.instance.SetEmotion(e.beat, e["type"]); },
|
||||
defaultLength = 4,
|
||||
resizable = true,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("type", BlueBear.EmotionStretchType.NoEmotion, "Emotion", "Which emotion should the blue bear use?", new()
|
||||
{
|
||||
new((x, _) => (int)x != (int)BlueBear.EmotionStretchType.NoEmotion, new string[] { "instant" })
|
||||
}),
|
||||
new Param("instant", false, "Instant"),
|
||||
new Param("type", BlueBear.EmotionStretchType.NoEmotion, "Emotion", "Which emotion should the blue bear use?"),
|
||||
}
|
||||
},
|
||||
new GameAction("wind", "Wind")
|
||||
@ -109,7 +105,16 @@ namespace HeavenStudio.Games
|
||||
LookUp = 0,
|
||||
Smile = 1,
|
||||
StartCrying = 2,
|
||||
ClosedEyes = 3,
|
||||
SmileInstant = 4,
|
||||
CryingInstant
|
||||
}
|
||||
|
||||
public static bool IsInstantEmotion(int emotion)
|
||||
{
|
||||
return emotion is (int)EmotionStretchType.NoEmotion or (int)EmotionStretchType.ClosedEyes or (int)EmotionStretchType.SmileInstant or (int)EmotionStretchType.CryingInstant;
|
||||
}
|
||||
|
||||
public enum StoryType
|
||||
{
|
||||
Date,
|
||||
@ -367,21 +372,27 @@ namespace HeavenStudio.Games
|
||||
|
||||
private void HandleEmotions(double beat)
|
||||
{
|
||||
_allEmotionsStretch = EventCaller.GetAllInGameManagerList("blueBear", new string[] { "stretchEmotion" }).FindAll(x => !(x["instant"] || x["type"] == (int)EmotionStretchType.NoEmotion));
|
||||
if (_allEmotionsStretch.Count == 0) return;
|
||||
UpdateEmotions();
|
||||
var allEmosBeforeBeat = _allEmotionsStretch.FindAll(x => x.beat < beat);
|
||||
if (allEmosBeforeBeat.Count != 0)
|
||||
_allEmotionsStretch = EventCaller.GetAllInGameManagerList("blueBear", new string[] { "stretchEmotion" }).FindAll(x => !IsInstantEmotion(x["type"]));
|
||||
if (_allEmotionsStretch.Count != 0)
|
||||
{
|
||||
if ((EmotionStretchType)allEmosBeforeBeat[^1]["type"] == EmotionStretchType.StartCrying)
|
||||
UpdateEmotions();
|
||||
var allEmosBeforeBeat = _allEmotionsStretch.FindAll(x => x.beat < beat);
|
||||
if (allEmosBeforeBeat.Count != 0)
|
||||
{
|
||||
headAndBodyAnim.DoScaledAnimationAsync("CryIdle", 0.5f);
|
||||
}
|
||||
else if ((EmotionStretchType)allEmosBeforeBeat[^1]["type"] == EmotionStretchType.Smile)
|
||||
{
|
||||
headAndBodyAnim.DoScaledAnimationAsync("SmileIdle", 0.5f);
|
||||
if ((EmotionStretchType)allEmosBeforeBeat[^1]["type"] == EmotionStretchType.StartCrying)
|
||||
{
|
||||
headAndBodyAnim.DoScaledAnimationAsync("CryIdle", 0.5f);
|
||||
}
|
||||
else if ((EmotionStretchType)allEmosBeforeBeat[^1]["type"] == EmotionStretchType.Smile)
|
||||
{
|
||||
headAndBodyAnim.DoScaledAnimationAsync("SmileIdle", 0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
var allSetEmotionsBeforeBeat = EventCaller.GetAllInGameManagerList("blueBear", new string[] { "stretchEmotion" }).FindAll(x => IsInstantEmotion(x["type"]) && x.beat < beat);
|
||||
if (allSetEmotionsBeforeBeat.Count == 0) return;
|
||||
var lastEvent = allSetEmotionsBeforeBeat[^1];
|
||||
SetEmotion(lastEvent.beat, lastEvent["type"]);
|
||||
}
|
||||
|
||||
public override void OnPlay(double beat)
|
||||
@ -497,7 +508,7 @@ namespace HeavenStudio.Games
|
||||
|
||||
private bool _wantMouthOpen = false;
|
||||
|
||||
public void SetEmotion(double beat, int emotion, bool ableToStopSmile = true)
|
||||
public void SetEmotion(double beat, int emotion)
|
||||
{
|
||||
_emotionCancelledBeat = beat;
|
||||
_wantMouthOpen = false;
|
||||
@ -507,14 +518,14 @@ namespace HeavenStudio.Games
|
||||
case (int)EmotionStretchType.NoEmotion:
|
||||
headAndBodyAnim.DoScaledAnimationAsync("Idle", 0.5f);
|
||||
break;
|
||||
case (int)EmotionStretchType.LookUp:
|
||||
case (int)EmotionStretchType.ClosedEyes:
|
||||
headAndBodyAnim.DoScaledAnimationAsync("EyesClosed", 0.5f);
|
||||
break;
|
||||
case (int)EmotionStretchType.StartCrying:
|
||||
case (int)EmotionStretchType.CryingInstant:
|
||||
headAndBodyAnim.DoScaledAnimationAsync("CryIdle", 0.5f);
|
||||
crying = true;
|
||||
break;
|
||||
case (int)EmotionStretchType.Smile:
|
||||
case (int)EmotionStretchType.SmileInstant:
|
||||
headAndBodyAnim.DoScaledAnimationAsync("SmileIdle", 0.5f);
|
||||
break;
|
||||
default:
|
||||
|
@ -92,6 +92,8 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
|
||||
|
||||
public void Early()
|
||||
{
|
||||
player.Stab(null);
|
||||
|
||||
GameObject pea = new GameObject();
|
||||
|
||||
pea.transform.parent = player.early.transform;
|
||||
@ -124,6 +126,8 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
|
||||
|
||||
public void Late()
|
||||
{
|
||||
player.Stab(null);
|
||||
|
||||
GameObject pea = new GameObject();
|
||||
pea.transform.parent = player.late.transform;
|
||||
pea.transform.localScale = Vector2.one;
|
||||
@ -161,18 +165,23 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
|
||||
|
||||
private void Just(PlayerActionEvent caller, float state)
|
||||
{
|
||||
if (state >= 1f) {
|
||||
if (state >= 1f)
|
||||
{
|
||||
Late();
|
||||
} else if (state <= -1f) {
|
||||
}
|
||||
else if (state <= -1f)
|
||||
{
|
||||
Early();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
Hit();
|
||||
}
|
||||
}
|
||||
|
||||
private void Miss(PlayerActionEvent caller)
|
||||
{
|
||||
SoundByte.PlayOneShot("forkLifter/disappointed");
|
||||
SoundByte.PlayOneShotGame("forkLifter/disappointed");
|
||||
BeatAction.New(game, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(startBeat+ 2.45f, delegate {
|
||||
|
@ -1,15 +1,7 @@
|
||||
using HeavenStudio.Util;
|
||||
using HeavenStudio.Common;
|
||||
using JetBrains.Annotations;
|
||||
using Starpelly.Transformer;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using static HeavenStudio.EntityTypes;
|
||||
using Jukebox;
|
||||
|
||||
namespace HeavenStudio.Games.Loaders
|
||||
@ -115,30 +107,6 @@ namespace HeavenStudio.Games.Loaders
|
||||
new Param("ease", Util.EasingFunction.Ease.Linear, "Ease", "Which ease should the Launch Pad use?")
|
||||
}
|
||||
},
|
||||
new GameAction("toggleStars", "Toggle Falling Stars")
|
||||
{
|
||||
function = delegate {var e = eventCaller.currentEntity; LaunchParty.instance.CreateParticles(e.beat, e["toggle"], e["valA"], e["valB"], e["valC"]);},
|
||||
defaultLength = 0.5f,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
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")
|
||||
}
|
||||
},
|
||||
new GameAction("scrollSpeed", "Change Scroll Speed")
|
||||
{
|
||||
function = delegate {var e = eventCaller.currentEntity; LaunchParty.instance.UpdateScrollSpeed(e["speed"]); },
|
||||
defaultLength = 0.5f,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("speed", new EntityTypes.Float(0, 100, 0.5f), "Scroll Speed", "How fast will the background scroll down?"),
|
||||
}
|
||||
}
|
||||
},
|
||||
new List<string>() {"rvl", "normal"},
|
||||
"rvlrocket", "en",
|
||||
@ -160,14 +128,11 @@ namespace HeavenStudio.Games
|
||||
[SerializeField] GameObject bowlingPin;
|
||||
|
||||
[Header("Components")]
|
||||
[SerializeField] ParticleSystem fallingStars;
|
||||
[SerializeField] ParticleSystem fallingStarsBack;
|
||||
[SerializeField] Transform launchPad;
|
||||
[SerializeField] Transform launchPadRotatable;
|
||||
[SerializeField] Transform spawnPad;
|
||||
[SerializeField] Scroll scrollScript;
|
||||
[SerializeField] Animator lensFlareAnim;
|
||||
public Animator launchPadSpriteAnim;
|
||||
[SerializeField] private SpriteRenderer _bgWhiteOverlay;
|
||||
|
||||
[Header("Variables")]
|
||||
private float currentRotBeat;
|
||||
@ -200,9 +165,11 @@ namespace HeavenStudio.Games
|
||||
|
||||
private int currentRotIndex;
|
||||
|
||||
private List<RiqEntity> allPosEvents = new List<RiqEntity>();
|
||||
private List<RiqEntity> allPosEvents = new();
|
||||
|
||||
private List<RiqEntity> allRotEvents = new List<RiqEntity>();
|
||||
private List<RiqEntity> allRotEvents = new();
|
||||
|
||||
private List<RiqEntity> _allOverlayEvents = new();
|
||||
|
||||
public static LaunchParty instance;
|
||||
|
||||
@ -218,33 +185,16 @@ namespace HeavenStudio.Games
|
||||
void Awake()
|
||||
{
|
||||
instance = this;
|
||||
lensFlareAnim.Play("Flashing", 0, 0);
|
||||
var posEvents = EventCaller.GetAllInGameManagerList("launchParty", new string[] { "posMove" });
|
||||
List<RiqEntity> tempPosEvents = new List<RiqEntity>();
|
||||
for (int i = 0; i < posEvents.Count; i++)
|
||||
{
|
||||
if (posEvents[i].beat + posEvents[i].beat >= Conductor.instance.songPositionInBeatsAsDouble)
|
||||
{
|
||||
tempPosEvents.Add(posEvents[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
allPosEvents = tempPosEvents;
|
||||
public override void OnGameSwitch(double beat)
|
||||
{
|
||||
HandleLaunchPadMoveEvents(beat);
|
||||
}
|
||||
|
||||
var rotEvents = EventCaller.GetAllInGameManagerList("launchParty", new string[] { "rotMove" });
|
||||
List<RiqEntity> tempRotEvents = new List<RiqEntity>();
|
||||
for (int i = 0; i < rotEvents.Count; i++)
|
||||
{
|
||||
if (rotEvents[i].beat + rotEvents[i].beat >= Conductor.instance.songPositionInBeatsAsDouble)
|
||||
{
|
||||
tempRotEvents.Add(rotEvents[i]);
|
||||
}
|
||||
}
|
||||
|
||||
allRotEvents = tempRotEvents;
|
||||
|
||||
UpdateLaunchPadPos();
|
||||
UpdateLaunchPadRot();
|
||||
public override void OnPlay(double beat)
|
||||
{
|
||||
HandleLaunchPadMoveEvents(beat);
|
||||
}
|
||||
|
||||
void Update()
|
||||
@ -261,6 +211,31 @@ namespace HeavenStudio.Games
|
||||
queuedRockets.Clear();
|
||||
}
|
||||
}
|
||||
LaunchPadPositionAndRotationUpdate(cond);
|
||||
}
|
||||
|
||||
private void UpdateOverlay(Conductor cond)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#region Launch Pad Position and Rotation
|
||||
|
||||
private void HandleLaunchPadMoveEvents(double beat)
|
||||
{
|
||||
var posEvents = EventCaller.GetAllInGameManagerList("launchParty", new string[] { "posMove" });
|
||||
allPosEvents = posEvents;
|
||||
|
||||
var rotEvents = EventCaller.GetAllInGameManagerList("launchParty", new string[] { "rotMove" });
|
||||
allRotEvents = rotEvents;
|
||||
|
||||
UpdateLaunchPadPos();
|
||||
UpdateLaunchPadRot();
|
||||
LaunchPadPositionAndRotationUpdate(Conductor.instance);
|
||||
}
|
||||
|
||||
private void LaunchPadPositionAndRotationUpdate(Conductor cond)
|
||||
{
|
||||
if (allPosEvents.Count > 0)
|
||||
{
|
||||
if (currentPosIndex < allPosEvents.Count && currentPosIndex >= 0)
|
||||
@ -335,11 +310,6 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateScrollSpeed(float speed)
|
||||
{
|
||||
scrollScript.scrollSpeedY = speed * -1;
|
||||
}
|
||||
|
||||
private void UpdateLaunchPadPos()
|
||||
{
|
||||
if (currentPosIndex < allPosEvents.Count && currentPosIndex >= 0)
|
||||
@ -364,6 +334,10 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Rockets
|
||||
|
||||
public void SpawnRocket(double beat, float beatOffset, RocketType type, List<int> notes)
|
||||
{
|
||||
GameObject rocketToSpawn = rocket;
|
||||
@ -506,30 +480,7 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateParticles(double beat, bool toggle, float starDensity, float starSpeed, float starSpeedBack)
|
||||
{
|
||||
ParticleSystem.EmissionModule emm;
|
||||
ParticleSystem.EmissionModule emm2;
|
||||
switch (toggle)
|
||||
{
|
||||
case true:
|
||||
var emmrate = fallingStars.velocityOverLifetime;
|
||||
var emmrate2 = fallingStarsBack.velocityOverLifetime;
|
||||
emmrate.speedModifier = starSpeed;
|
||||
emmrate2.speedModifier = starSpeedBack;
|
||||
emm = fallingStars.emission;
|
||||
emm2 = fallingStarsBack.emission;
|
||||
emm.rateOverTime = starDensity * 6f;
|
||||
emm2.rateOverTime = starDensity * 6f;
|
||||
fallingStars.Play();
|
||||
fallingStarsBack.Play();
|
||||
break;
|
||||
default:
|
||||
fallingStars.Stop();
|
||||
fallingStarsBack.Stop();
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,6 @@
|
||||
using HeavenStudio.Util;
|
||||
using JetBrains.Annotations;
|
||||
using Starpelly.Transformer;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using static HeavenStudio.EntityTypes;
|
||||
|
||||
namespace HeavenStudio.Games.Scripts_LaunchParty
|
||||
{
|
||||
|
@ -623,7 +623,7 @@ namespace HeavenStudio.Games
|
||||
&& PlayerInput.GetIsAction(InputAction_FlickRelease) && !IsExpectingInputNow(InputAction_FlickRelease))
|
||||
{
|
||||
// todo: strum
|
||||
Soshi.UnHold();
|
||||
Soshi.StrumStringsLast(false, false, true);
|
||||
}
|
||||
if (PlayerInput.GetIsAction(InputAction_BasicRelease))
|
||||
{
|
||||
@ -783,11 +783,11 @@ namespace HeavenStudio.Games
|
||||
});
|
||||
RockersInput riffComp = Instantiate(rockerInputRef, transform);
|
||||
riffComp.Init(false, new int[6], beat, 3, (PremadeSamples)SoshiSamples[0], SoshiPitches[0]);
|
||||
ScheduleInput(beat, 4, InputAction_BasicPress, JustMute, MuteMiss, Empty);
|
||||
ScheduleAutoplayInput(beat, 4, InputAction_BasicPress, JustMute, MuteMiss, Empty);
|
||||
|
||||
RockersInput riffComp2 = Instantiate(rockerInputRef, transform);
|
||||
riffComp2.Init(false, new int[6], beat, 4.5f, (PremadeSamples)SoshiSamples[1], SoshiPitches[1]);
|
||||
ScheduleInput(beat, 5.5f, InputAction_BasicPress, JustMute, MuteMiss, Empty);
|
||||
ScheduleAutoplayInput(beat, 5.5f, InputAction_BasicPress, JustMute, MuteMiss, Empty);
|
||||
|
||||
RockersInput riffComp3 = Instantiate(rockerInputRef, transform);
|
||||
riffComp3.Init(false, new int[6], beat, 6, (PremadeSamples)SoshiSamples[2], SoshiPitches[2]);
|
||||
@ -795,7 +795,7 @@ namespace HeavenStudio.Games
|
||||
|
||||
RockersInput riffComp4 = Instantiate(rockerInputRef, transform);
|
||||
riffComp4.Init(false, new int[6], beat, 7, (PremadeSamples)SoshiSamples[3], SoshiPitches[3], true);
|
||||
ScheduleInput(beat, 10, InputAction_BasicPress, JustMute, MuteMiss, Empty);
|
||||
ScheduleAutoplayInput(beat, 10, InputAction_BasicPress, JustMute, MuteMiss, Empty);
|
||||
}
|
||||
|
||||
public void TogetherPrepare(double beat, bool cmon, bool muteSound, float muteBeat, float goToMiddleBeat, bool moveCamera)
|
||||
@ -846,7 +846,8 @@ namespace HeavenStudio.Games
|
||||
RockersInput riffComp = Instantiate(rockerInputRef, transform);
|
||||
riffComp.Init(e["gcS"], new int[6] { e["1S"], e["2S"], e["3S"], e["4S"], e["5S"], e["6S"] }, beat, e.beat - beat,
|
||||
(PremadeSamples)e["sampleS"], e["pitchSampleS"]);
|
||||
ScheduleInput(beat, e.beat - beat + e.length, InputAction_BasicPress, JustMute, MuteMiss, Empty);
|
||||
if (e.length <= 0.5f) ScheduleInput(beat, e.beat - beat + e.length, InputAction_BasicPress, JustMute, MuteMiss, Empty);
|
||||
else ScheduleAutoplayInput(beat, e.beat - beat + e.length, InputAction_BasicPress, JustMute, MuteMiss, Empty);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -866,7 +867,8 @@ namespace HeavenStudio.Games
|
||||
RockersInput riffComp = Instantiate(rockerInputRef, transform);
|
||||
riffComp.Init(e["gcS"], new int[6] { e["1S"], e["2S"], e["3S"], e["4S"], e["5S"], e["6S"] }, beat, e.beat - beat,
|
||||
(PremadeSamples)e["sampleS"], e["pitchSampleS"], true);
|
||||
ScheduleInput(beat, e.beat - beat + e.length, InputAction_BasicPress, JustMute, MuteMiss, Empty);
|
||||
if (e.length <= 0.5f) ScheduleInput(beat, e.beat - beat + e.length, InputAction_BasicPress, JustMute, MuteMiss, Empty);
|
||||
else ScheduleAutoplayInput(beat, e.beat - beat + e.length, InputAction_BasicPress, JustMute, MuteMiss, Empty);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -99,9 +99,21 @@ namespace HeavenStudio.Games.Scripts_Rockers
|
||||
}
|
||||
}
|
||||
|
||||
private bool lastGleeClub = false;
|
||||
private Rockers.PremadeSamples lastSample;
|
||||
private int lastSampleTones;
|
||||
|
||||
public void StrumStringsLast(bool disableStrumEffect = false, bool jump = false, bool barely = false)
|
||||
{
|
||||
StrumStrings(lastGleeClub, lastPitches, lastSample, lastSampleTones, disableStrumEffect, jump, barely);
|
||||
}
|
||||
|
||||
public void StrumStrings(bool gleeClub, int[] pitches, Rockers.PremadeSamples sample, int sampleTones, bool disableStrumEffect = false, bool jump = false, bool barely = false)
|
||||
{
|
||||
if (strumming) return;
|
||||
lastGleeClub = gleeClub;
|
||||
lastSample = sample;
|
||||
lastSampleTones = sampleTones;
|
||||
muted = false;
|
||||
strumming = true;
|
||||
StopSounds();
|
||||
|
@ -317,10 +317,6 @@ namespace HeavenStudio.Games
|
||||
tempEvents.Remove(jump);
|
||||
}
|
||||
allJumpEvents = tempEvents;
|
||||
foreach (var jump in allJumpEvents)
|
||||
{
|
||||
Debug.Log(jump.beat);
|
||||
}
|
||||
}
|
||||
|
||||
private void PersistColor(double beat)
|
||||
|
@ -199,13 +199,13 @@ namespace HeavenStudio.Games
|
||||
{
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
new MultiSound.Sound("sneakySpirits/moving", beat, 1f, volume1 * 0.01f),
|
||||
new MultiSound.Sound("sneakySpirits/moving", beat + length, 1f, volume2 * 0.01f),
|
||||
new MultiSound.Sound("sneakySpirits/moving", beat + length * 2, 1f, volume3 * 0.01f),
|
||||
new MultiSound.Sound("sneakySpirits/moving", beat + length * 3, 1f, volume4 * 0.01f),
|
||||
new MultiSound.Sound("sneakySpirits/moving", beat + length * 4, 1f, volume5 * 0.01f),
|
||||
new MultiSound.Sound("sneakySpirits/moving", beat + length * 5, 1f, volume6 * 0.01f),
|
||||
new MultiSound.Sound("sneakySpirits/moving", beat + length * 6, 1f, volume7 * 0.01f),
|
||||
new MultiSound.Sound("sneakySpirits/moving", beat, 1f, volume1 * 0.01f, false, 0.019),
|
||||
new MultiSound.Sound("sneakySpirits/moving", beat + length, 1f, volume2 * 0.01f, false, 0.019),
|
||||
new MultiSound.Sound("sneakySpirits/moving", beat + length * 2, 1f, volume3 * 0.01f, false, 0.019),
|
||||
new MultiSound.Sound("sneakySpirits/moving", beat + length * 3, 1f, volume4 * 0.01f, false, 0.019),
|
||||
new MultiSound.Sound("sneakySpirits/moving", beat + length * 4, 1f, volume5 * 0.01f, false, 0.019),
|
||||
new MultiSound.Sound("sneakySpirits/moving", beat + length * 5, 1f, volume6 * 0.01f, false, 0.019),
|
||||
new MultiSound.Sound("sneakySpirits/moving", beat + length * 6, 1f, volume7 * 0.01f, false, 0.019),
|
||||
}, forcePlay: true);
|
||||
}
|
||||
|
||||
|
@ -384,6 +384,7 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
|
||||
// queue normal kick input
|
||||
nextHit = game.ScheduleInput(caller.startBeat + caller.timer, ball.GetAnimLength(Ball.State.Kicked), SpaceSoccer.InputAction_BasicPress, KickJust, Miss, Out);
|
||||
}
|
||||
game.hitBeats.Add(caller.startBeat + caller.timer);
|
||||
}
|
||||
|
||||
private void Miss(PlayerActionEvent caller)
|
||||
@ -407,6 +408,7 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
|
||||
Toe(true);
|
||||
nextHit = game.ScheduleInput(caller.startBeat, 3f, SpaceSoccer.InputAction_BasicPress, KickJust, Miss, Out);
|
||||
ball.canKick = false;
|
||||
game.hitBeats.Add(caller.startBeat + caller.timer);
|
||||
}
|
||||
|
||||
private void ToePrepareJust(PlayerActionEvent caller, float state)
|
||||
|
@ -13,12 +13,17 @@ namespace HeavenStudio.Games.Loaders
|
||||
{
|
||||
new GameAction("ball dispense", "Ball Dispense")
|
||||
{
|
||||
function = delegate { SpaceSoccer.instance.Dispense(eventCaller.currentEntity.beat, !eventCaller.currentEntity["toggle"], false, eventCaller.currentEntity["down"]); },
|
||||
function = delegate { var e = eventCaller.currentEntity; SpaceSoccer.instance.Dispense(e.beat, !e["toggle"], false, e["down"], e["auto"], e["interval"]); },
|
||||
defaultLength = 2f,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("toggle", false, "Disable Sound", "Disables the dispense sound"),
|
||||
new Param("down", false, "Down Sound", "Will the Down sound be played?")
|
||||
new Param("down", false, "Down Sound", "Will the Down sound be played?"),
|
||||
new Param("auto", true, "Auto Redispense", "", new()
|
||||
{
|
||||
new((x, _) => (bool)x, new string[] { "interval" })
|
||||
}),
|
||||
new("interval", new EntityTypes.Integer(2, 20, 2), "Redispense Interval")
|
||||
},
|
||||
inactiveFunction = delegate
|
||||
{
|
||||
@ -163,6 +168,7 @@ namespace HeavenStudio.Games
|
||||
using HeavenStudio.Common;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.UI;
|
||||
using System;
|
||||
|
||||
public class SpaceSoccer : Minigame
|
||||
{
|
||||
@ -214,6 +220,12 @@ namespace HeavenStudio.Games
|
||||
float yScrollMultiplier = 0.3f;
|
||||
[SerializeField] private float xBaseSpeed = 1;
|
||||
[SerializeField] private float yBaseSpeed = 1;
|
||||
|
||||
private List<double> _highKickToeBeats = new();
|
||||
private List<double> _stopBeats = new();
|
||||
|
||||
[NonSerialized] public List<double> hitBeats = new();
|
||||
|
||||
#region Space Kicker Position Easing
|
||||
float easeBeat;
|
||||
float easeLength;
|
||||
@ -234,6 +246,11 @@ namespace HeavenStudio.Games
|
||||
instance = this;
|
||||
colorStart = defaultBGColor;
|
||||
colorEnd = defaultBGColor;
|
||||
var allHighKickToeEvents = EventCaller.GetAllInGameManagerList("spaceSoccer", new string[] { "high kick-toe!" });
|
||||
foreach (var e in allHighKickToeEvents)
|
||||
{
|
||||
_highKickToeBeats.Add(e.beat);
|
||||
}
|
||||
}
|
||||
|
||||
new void OnDrawGizmos()
|
||||
@ -276,6 +293,31 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnBeatPulse(double beat)
|
||||
{
|
||||
if (!ballDispensed) return;
|
||||
|
||||
double offsetBeat = beat + (lastDispensedBeat % 1);
|
||||
|
||||
if (_stopBeats.Exists(x => offsetBeat >= x) || offsetBeat < lastDispensedBeat + 2) return;
|
||||
|
||||
if (_highKickToeBeats.Exists(x => offsetBeat >= x + 1 && offsetBeat < x + 3))
|
||||
{
|
||||
if (_highKickToeBeats.Exists(x => offsetBeat == x + 2) && !IsExpectingInputNow(InputAction_FlickRelease))
|
||||
{
|
||||
if (hitBeats.Exists(x => x == offsetBeat - 0.5)) return;
|
||||
ScoreMiss();
|
||||
Debug.Log("Miss toe");
|
||||
}
|
||||
}
|
||||
else if (!IsExpectingInputNow(InputAction_BasicPress))
|
||||
{
|
||||
if (hitBeats.Exists(x => offsetBeat == x)) return;
|
||||
ScoreMiss();
|
||||
Debug.Log("Miss");
|
||||
}
|
||||
}
|
||||
|
||||
public void StopBall(bool stop)
|
||||
{
|
||||
foreach (var kicker in kickers)
|
||||
@ -329,12 +371,12 @@ namespace HeavenStudio.Games
|
||||
continue;
|
||||
}
|
||||
bool isOnGameSwitchBeat = entity.beat == beat;
|
||||
Debug.Log(isOnGameSwitchBeat);
|
||||
Dispense(entity.beat, isOnGameSwitchBeat && !entity["toggle"], false, isOnGameSwitchBeat && entity["down"]);
|
||||
Dispense(entity.beat, isOnGameSwitchBeat && !entity["toggle"], false, isOnGameSwitchBeat && entity["down"], entity["auto"], entity["interval"]);
|
||||
break;
|
||||
}
|
||||
|
||||
PersistColor(beat);
|
||||
AddStopEvents(beat);
|
||||
}
|
||||
|
||||
public SuperCurveObject.Path GetPath(string name)
|
||||
@ -349,6 +391,8 @@ namespace HeavenStudio.Games
|
||||
return default(SuperCurveObject.Path);
|
||||
}
|
||||
|
||||
#region VisualInterpolation
|
||||
|
||||
public void UpdateScrollSpeed(float scrollSpeedX, float scrollSpeedY)
|
||||
{
|
||||
xScrollMultiplier = scrollSpeedX;
|
||||
@ -452,10 +496,35 @@ namespace HeavenStudio.Games
|
||||
kickers.Add(spawnedKicker);
|
||||
kickerHolder.gameObject.SetActive(true);
|
||||
}
|
||||
if (ballDispensed) Dispense(lastDispensedBeat, false, true);
|
||||
if (ballDispensed) Dispense(lastDispensedBeat, false, true, false, false);
|
||||
}
|
||||
|
||||
public void Dispense(double beat, bool playSound = true, bool ignorePlayer = false, bool playDown = false)
|
||||
#endregion
|
||||
|
||||
public void Dispense(double beat, bool playSound = true, bool ignorePlayer = false, bool playDown = false, bool autoDispense = true, int autoInterval = 2)
|
||||
{
|
||||
DispenseExec(beat, playSound, ignorePlayer, playDown);
|
||||
|
||||
if (!autoDispense) return;
|
||||
|
||||
DispenseRecursion(beat + 2, autoInterval);
|
||||
}
|
||||
|
||||
private void DispenseRecursion(double beat, int interval)
|
||||
{
|
||||
double dispenseBeat = beat + interval;
|
||||
if (_stopBeats.Exists(x => dispenseBeat + 2 >= x)) return;
|
||||
BeatAction.New(this, new()
|
||||
{
|
||||
new(dispenseBeat, delegate
|
||||
{
|
||||
if (!_highKickToeBeats.Exists(x => dispenseBeat + 2 > x && dispenseBeat + 2 < x + 3)) DispenseExec(dispenseBeat);
|
||||
DispenseRecursion(dispenseBeat + 2, interval);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
private void DispenseExec(double beat, bool playSound = true, bool ignorePlayer = false, bool playDown = false)
|
||||
{
|
||||
if (!ballDispensed) lastDispensedBeat = beat;
|
||||
ballDispensed = true;
|
||||
@ -496,6 +565,15 @@ namespace HeavenStudio.Games
|
||||
}, forcePlay:true);
|
||||
}
|
||||
|
||||
private void AddStopEvents(double beat)
|
||||
{
|
||||
var allStopEvents = EventCaller.GetAllInGameManagerList("spaceSoccer", new string[] { "stopBall" }).FindAll(x => x.beat >= beat);
|
||||
foreach (var e in allStopEvents)
|
||||
{
|
||||
_stopBeats.Add(e.beat);
|
||||
}
|
||||
}
|
||||
|
||||
private double colorStartBeat = -1;
|
||||
private float colorLength = 0f;
|
||||
private Color colorStart; //obviously put to the default color of the game
|
||||
@ -550,6 +628,7 @@ namespace HeavenStudio.Games
|
||||
public override void OnPlay(double beat)
|
||||
{
|
||||
PersistColor(beat);
|
||||
AddStopEvents(beat);
|
||||
}
|
||||
}
|
||||
}
|
@ -269,12 +269,12 @@ namespace HeavenStudio.Games
|
||||
}));
|
||||
SoundByte.PlayOneShotGame("splashdown/yeah", diveBeat);
|
||||
SoundByte.PlayOneShotGame("splashdown/jumpOthers", diveBeat);
|
||||
SoundByte.PlayOneShotGame("splashdown/rollOthers", diveBeat + 1);
|
||||
if (dolphin) SoundByte.PlayOneShotGame("splashdown/rollOthers", diveBeat + 1);
|
||||
SoundByte.PlayOneShotGame("splashdown/splashOthers", diveBeat + 1.75);
|
||||
}
|
||||
BeatAction.New(instance, actions);
|
||||
SoundByte.PlayOneShotGame("splashdown/yeah", beat + (currentSynchrettes.Count * length));
|
||||
ScheduleInput(beat, currentSynchrettes.Count * length, InputAction_FlickRelease, dolphin ? JustJump : JustJumpNoDolphin, Out, Out);
|
||||
ScheduleInput(beat, currentSynchrettes.Count * length, InputAction_FlickRelease, dolphin ? JustJump : JustJumpNoRollSound, Out, Out);
|
||||
}
|
||||
|
||||
public void TogetherJump(double beat, bool alleyoop)
|
||||
@ -416,25 +416,6 @@ namespace HeavenStudio.Games
|
||||
});
|
||||
}
|
||||
|
||||
private void JustJumpNoDolphin(PlayerActionEvent caller, float state)
|
||||
{
|
||||
double diveBeat = caller.timer + caller.startBeat;
|
||||
SoundByte.PlayOneShotGame("splashdown/jumpPlayer");
|
||||
SoundByte.PlayOneShotGame("splashdown/splashPlayer", diveBeat + 1.75);
|
||||
if (state >= 1f || state <= -1f)
|
||||
{
|
||||
player.Jump(diveBeat, true, true);
|
||||
return;
|
||||
}
|
||||
SoundByte.PlayOneShotGame("splashdown/rollPlayer", diveBeat + 1);
|
||||
player.Jump(diveBeat, false, true);
|
||||
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); })
|
||||
});
|
||||
}
|
||||
|
||||
private void JustJumpNoRollSound(PlayerActionEvent caller, float state)
|
||||
{
|
||||
double diveBeat = caller.timer + caller.startBeat;
|
||||
|
@ -16,13 +16,23 @@ namespace HeavenStudio.Games.Loaders
|
||||
{
|
||||
new GameAction("dispense", "Dispense")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; TossBoys.instance.Dispense(e.beat, e.length, e["who"], e["call"]); },
|
||||
function = delegate { var e = eventCaller.currentEntity; TossBoys.instance.Dispense(e.beat, e.length, e["who"], e["auto"], e["interval"], e["ignore"], e["callAuto"], true, e["call"]); },
|
||||
inactiveFunction = delegate { var e = eventCaller.currentEntity; TossBoys.DispenseSound(e.beat, e["who"], e["call"]); },
|
||||
defaultLength = 2f,
|
||||
resizable = true,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("who", TossBoys.KidChoice.Akachan, "Receiver", "Who will receive the ball?"),
|
||||
new Param("call", false, "Name Call", "Should the other kids than the receiver call their name?")
|
||||
new Param("call", false, "Name Call", "Should the other kids than the receiver call their name?"),
|
||||
|
||||
//auto dispense stuff
|
||||
new Param("auto", true, "Auto Redispense", "", new()
|
||||
{
|
||||
new((x, _) => (bool)x, new string[] { "interval", "ignore", "callAuto" })
|
||||
}),
|
||||
new Param("interval", new EntityTypes.Integer(1, 20, 2), "Redispense Interval", "Based on passes and not beats"),
|
||||
new Param("ignore", true, "Ignore Special Passes"),
|
||||
new Param("callAuto", false, "Name Call On Redispense")
|
||||
}
|
||||
},
|
||||
new GameAction("pass", "Normal Toss")
|
||||
@ -235,6 +245,7 @@ namespace HeavenStudio.Games
|
||||
colorStart = defaultBGColor;
|
||||
colorEnd = defaultBGColor;
|
||||
SetupBopRegion("tossBoys", "bop", "auto");
|
||||
SetPassBallEvents();
|
||||
}
|
||||
|
||||
new void OnDrawGizmos()
|
||||
@ -339,6 +350,17 @@ namespace HeavenStudio.Games
|
||||
public override void OnGameSwitch(double beat)
|
||||
{
|
||||
PersistColor(beat);
|
||||
HandleDispenses(beat);
|
||||
}
|
||||
|
||||
private void HandleDispenses(double beat)
|
||||
{
|
||||
var allRelevantDispenses = EventCaller.GetAllInGameManagerList("tossBoys", new string[] { "dispense" }).FindAll(x => x.beat < beat && x.beat + x.length >= beat);
|
||||
if (allRelevantDispenses.Count == 0) return;
|
||||
|
||||
var e = allRelevantDispenses[^1];
|
||||
|
||||
Dispense(e.beat, e.length, e["who"], e["auto"], e["interval"], e["ignore"], e["callAuto"], false, e["call"]);
|
||||
}
|
||||
|
||||
#region Bop
|
||||
@ -363,13 +385,112 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void Dispense(double beat, float length, int who, bool call)
|
||||
public static void DispenseSound(double beat, int who, bool call)
|
||||
{
|
||||
SoundByte.PlayOneShotGame("tossBoys/ballStart" + GetColorBasedOnTossKid((WhichTossKid)who, true), beat, forcePlay: true);
|
||||
if (!call) return;
|
||||
double callBeat = beat;
|
||||
switch (who)
|
||||
{
|
||||
case (int)WhichTossKid.Akachan:
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
new MultiSound.Sound("tossBoys/blueRedHigh1", callBeat),
|
||||
new MultiSound.Sound("tossBoys/yellowRedHigh1", callBeat),
|
||||
new MultiSound.Sound("tossBoys/blueRedHigh2", callBeat + 0.25f),
|
||||
new MultiSound.Sound("tossBoys/yellowRedHigh2", callBeat + 0.25f),
|
||||
new MultiSound.Sound("tossBoys/blueRedHigh3", callBeat + 0.5f),
|
||||
new MultiSound.Sound("tossBoys/yellowRedHigh3", callBeat + 0.5f),
|
||||
}, forcePlay: true);
|
||||
break;
|
||||
case (int)WhichTossKid.Aokun:
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
new MultiSound.Sound("tossBoys/redBlueHigh1", callBeat),
|
||||
new MultiSound.Sound("tossBoys/yellowBlueHigh1", callBeat),
|
||||
new MultiSound.Sound("tossBoys/redBlueHigh2", callBeat + 0.5f),
|
||||
new MultiSound.Sound("tossBoys/yellowBlueHigh2", callBeat + 0.5f),
|
||||
}, forcePlay: true);
|
||||
break;
|
||||
case (int)WhichTossKid.Kiiyan:
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
new MultiSound.Sound("tossBoys/redYellowHigh1", callBeat),
|
||||
new MultiSound.Sound("tossBoys/blueYellowHigh1", callBeat),
|
||||
new MultiSound.Sound("tossBoys/redYellowHigh2", callBeat + 0.5f),
|
||||
new MultiSound.Sound("tossBoys/blueYellowHigh2", callBeat + 0.5f),
|
||||
}, forcePlay: true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispense(double beat, float length, int who, bool auto, int autoInterval, bool ignoreSpecial, bool callAuto, bool playSound, bool call)
|
||||
{
|
||||
if (playSound) DispenseSound(beat, who, call);
|
||||
DispenseExec(beat, length, who, false, "");
|
||||
if (auto && passBallDict.TryGetValue(beat + length, out var e))
|
||||
{
|
||||
if (e.datamodel == "tossBoys/blur")
|
||||
{
|
||||
DispenseRecursion(beat + length, -1, autoInterval, ignoreSpecial, callAuto, (int)WhichTossKid.None, who, false, e.length, true, true, e.datamodel);
|
||||
}
|
||||
else DispenseRecursion(beat + length, -1, autoInterval, ignoreSpecial, callAuto, e["who"], who, false, e.length, IsSpecialEvent(e.datamodel), false, e.datamodel);
|
||||
}
|
||||
}
|
||||
|
||||
public void DispenseRecursion(double beat, int index, int interval, bool ignore, bool call, int curReceiver, int previousReceiver, bool isBlur, float currentLength, bool isSpecial, bool shouldForce, string eventDatamodel)
|
||||
{
|
||||
if (index % interval == 0 && !isBlur && !(ignore && isSpecial))
|
||||
{
|
||||
double dispenseBeat = beat - 2;
|
||||
BeatAction.New(this, new()
|
||||
{
|
||||
new(dispenseBeat, delegate
|
||||
{
|
||||
if (currentBall != null) return;
|
||||
DispenseSound(dispenseBeat, curReceiver, call);
|
||||
DispenseExec(dispenseBeat, 2, curReceiver, shouldForce, eventDatamodel);
|
||||
})
|
||||
});
|
||||
}
|
||||
if (!isBlur && !(ignore && isSpecial)) index++;
|
||||
|
||||
var tempLastReceiver = previousReceiver;
|
||||
var lastLength = isBlur ? 1 : currentLength;
|
||||
previousReceiver = curReceiver;
|
||||
var nextIsSpecial = isSpecial;
|
||||
|
||||
var blurSet = isBlur;
|
||||
var nextForce = false;
|
||||
if (passBallDict.TryGetValue(beat + lastLength, out var e))
|
||||
{
|
||||
if (e.datamodel == "tossBoys/pop") return;
|
||||
curReceiver = e["who"];
|
||||
blurSet = e.datamodel == "tossBoys/blur";
|
||||
currentLength = e.length;
|
||||
nextIsSpecial = IsSpecialEvent(e.datamodel);
|
||||
eventDatamodel = e.datamodel;
|
||||
}
|
||||
else
|
||||
{
|
||||
curReceiver = tempLastReceiver;
|
||||
nextForce = true;
|
||||
}
|
||||
// let's not do a stack overflow, alright?
|
||||
BeatAction.New(this, new()
|
||||
{
|
||||
new(beat + lastLength - 2, delegate { DispenseRecursion(beat + lastLength, index, interval, ignore, call, curReceiver, previousReceiver, blurSet, currentLength, nextIsSpecial, nextForce, eventDatamodel); })
|
||||
});
|
||||
}
|
||||
|
||||
public void DispenseExec(double beat, float length, int who, bool forcePass, string eventDatamodel)
|
||||
{
|
||||
if (currentBall != null) return;
|
||||
SetPassBallEvents();
|
||||
SetReceiver(who);
|
||||
GetCurrentReceiver().ShowArrow(beat, length - 1);
|
||||
SoundByte.PlayOneShotGame("tossBoys/ballStart" + GetColorBasedOnTossKid(currentReceiver, true));
|
||||
|
||||
hatchAnim.Play("HatchOpen", 0, 0);
|
||||
currentBall = Instantiate(ballPrefab, transform);
|
||||
currentBall.gameObject.SetActive(true);
|
||||
@ -388,50 +509,10 @@ namespace HeavenStudio.Games
|
||||
break;
|
||||
}
|
||||
|
||||
if (call)
|
||||
{
|
||||
double callBeat = beat;
|
||||
switch (who)
|
||||
{
|
||||
case (int)WhichTossKid.Akachan:
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
new MultiSound.Sound("tossBoys/blueRedHigh1", callBeat),
|
||||
new MultiSound.Sound("tossBoys/yellowRedHigh1", callBeat),
|
||||
new MultiSound.Sound("tossBoys/blueRedHigh2", callBeat + 0.25f),
|
||||
new MultiSound.Sound("tossBoys/yellowRedHigh2", callBeat + 0.25f),
|
||||
new MultiSound.Sound("tossBoys/blueRedHigh3", callBeat + 0.5f),
|
||||
new MultiSound.Sound("tossBoys/yellowRedHigh3", callBeat + 0.5f),
|
||||
});
|
||||
break;
|
||||
case (int)WhichTossKid.Aokun:
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
new MultiSound.Sound("tossBoys/redBlueHigh1", callBeat),
|
||||
new MultiSound.Sound("tossBoys/yellowBlueHigh1", callBeat),
|
||||
new MultiSound.Sound("tossBoys/redBlueHigh2", callBeat + 0.5f),
|
||||
new MultiSound.Sound("tossBoys/yellowBlueHigh2", callBeat + 0.5f),
|
||||
});
|
||||
break;
|
||||
case (int)WhichTossKid.Kiiyan:
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
new MultiSound.Sound("tossBoys/redYellowHigh1", callBeat),
|
||||
new MultiSound.Sound("tossBoys/blueYellowHigh1", callBeat),
|
||||
new MultiSound.Sound("tossBoys/redYellowHigh2", callBeat + 0.5f),
|
||||
new MultiSound.Sound("tossBoys/blueYellowHigh2", callBeat + 0.5f),
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (passBallDict.ContainsKey(beat + length))
|
||||
{
|
||||
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")
|
||||
if (IsSpecialEvent(passBallDict[beat + length].datamodel))
|
||||
{
|
||||
BeatAction.New(instance, new List<BeatAction.Action>()
|
||||
{
|
||||
@ -448,6 +529,26 @@ namespace HeavenStudio.Games
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (forcePass)
|
||||
{
|
||||
ScheduleInput(beat, length, GetInputTypeBasedOnCurrentReceiver(), JustHitBall, Miss, Empty);
|
||||
if (IsSpecialEvent(eventDatamodel))
|
||||
{
|
||||
BeatAction.New(instance, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat + length - 1, delegate { DoSpecialBasedOnReceiver(beat + length - 1); })
|
||||
});
|
||||
}
|
||||
else if (eventDatamodel == "tossBoys/pop")
|
||||
{
|
||||
currentBall.willBePopped = true;
|
||||
if (PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch)
|
||||
BeatAction.New(instance, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat + length - 1, delegate { GetCurrentReceiver().PopBallPrepare(); })
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BeatAction.New(instance, new List<BeatAction.Action>()
|
||||
@ -461,36 +562,32 @@ namespace HeavenStudio.Games
|
||||
{
|
||||
passBallDict.Clear();
|
||||
var passBallEvents = EventCaller.GetAllInGameManagerList("tossBoys", new string[] { "pass", "dual", "pop", "high", "lightning", "blur" });
|
||||
for (int i = 0; i < passBallEvents.Count; i++)
|
||||
for (int i = 0; i < passBallEvents.Count; i++)
|
||||
{
|
||||
if (passBallEvents[i].beat >= Conductor.instance.songPositionInBeatsAsDouble)
|
||||
{
|
||||
if (passBallDict.ContainsKey(passBallEvents[i].beat)) continue;
|
||||
passBallDict.Add(passBallEvents[i].beat, passBallEvents[i]);
|
||||
}
|
||||
if (passBallDict.ContainsKey(passBallEvents[i].beat)) continue;
|
||||
passBallDict.Add(passBallEvents[i].beat, passBallEvents[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void DeterminePass(double beat, bool barely)
|
||||
private void DeterminePassValues(double beat)
|
||||
{
|
||||
var tempLastReceiver = lastReceiver;
|
||||
lastReceiver = currentReceiver;
|
||||
if (passBallDict.TryGetValue(beat, out var receiver))
|
||||
{
|
||||
currentReceiver = (WhichTossKid)receiver["who"];
|
||||
if (receiver.datamodel != "tossBoys/blur") currentReceiver = (WhichTossKid)receiver["who"];
|
||||
currentPassType = receiver.datamodel;
|
||||
currentEventLength = receiver.length;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
RiqEntity spawnedEntity = new RiqEntity();
|
||||
spawnedEntity.DynamicData.Add("who", (int)tempLastReceiver);
|
||||
spawnedEntity.datamodel = currentPassType;
|
||||
passBallDict.Add(beat, spawnedEntity);
|
||||
*/
|
||||
currentReceiver = tempLastReceiver;
|
||||
}
|
||||
}
|
||||
|
||||
void DeterminePass(double beat, bool barely)
|
||||
{
|
||||
DeterminePassValues(beat);
|
||||
switch (currentPassType)
|
||||
{
|
||||
case "tossBoys/pass":
|
||||
@ -508,14 +605,7 @@ namespace HeavenStudio.Games
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (barely)
|
||||
{
|
||||
currentBall.anim.DoScaledAnimationAsync("WiggleBall", 0.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
currentBall.anim.DoScaledAnimationAsync("Hit", 0.5f);
|
||||
}
|
||||
currentBall.anim.DoScaledAnimationAsync(barely ? "WiggleBall" : "Hit", 0.5f);
|
||||
if (passBallDict.ContainsKey(beat + currentEventLength) && passBallDict[beat + currentEventLength].datamodel == "tossBoys/pop")
|
||||
{
|
||||
currentBall.willBePopped = true;
|
||||
@ -1048,6 +1138,7 @@ namespace HeavenStudio.Games
|
||||
Destroy(currentBall.gameObject);
|
||||
currentBall = null;
|
||||
SoundByte.PlayOneShotGame("tossBoys/misshit");
|
||||
if (caller != null) DeterminePassValues(caller.startBeat + caller.timer);
|
||||
}
|
||||
|
||||
void Empty(PlayerActionEvent caller) { }
|
||||
@ -1110,7 +1201,7 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
|
||||
string GetColorBasedOnTossKid(WhichTossKid tossKid, bool capital)
|
||||
public static string GetColorBasedOnTossKid(WhichTossKid tossKid, bool capital)
|
||||
{
|
||||
switch (tossKid)
|
||||
{
|
||||
@ -1162,6 +1253,24 @@ namespace HeavenStudio.Games
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsSpecialEvent(string e)
|
||||
{
|
||||
bool b = false;
|
||||
|
||||
switch (e)
|
||||
{
|
||||
case "tossBoys/dual":
|
||||
case "tossBoys/lightning":
|
||||
case "tossBoys/blur":
|
||||
b = true; break;
|
||||
default:
|
||||
return b;
|
||||
}
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -367,9 +367,12 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
}),
|
||||
new BeatAction.Action(beat, delegate
|
||||
{
|
||||
if (gandwHasEntered && !bgDisabled) gandwAnim.Play("MrGameAndWatchLeverDown", 0, 0);
|
||||
}),
|
||||
new BeatAction.Action(beat + 1, delegate
|
||||
{
|
||||
if (gandwHasEntered && !bgDisabled) gandwAnim.Play("MrGameAndWatchLeverDown", 0, 0);
|
||||
if (beat + 1 > GetLastIntervalBeforeBeat(beat + 1).beat + GetLastIntervalBeforeBeat(beat + 1).length)
|
||||
{
|
||||
ballTransporterLeftNPC.GetComponent<Animator>().Play("BallTransporterLeftClose", 0, 0);
|
||||
|
Reference in New Issue
Block a user