splashdown spawn tweaked
This commit is contained in:
parent
050cbc241d
commit
370f08648c
|
|
@ -1049,11 +1049,11 @@ namespace HeavenStudio.Games
|
||||||
SetDistance(distanceEvent.beat, distanceEvent["type"], distanceEvent["ease"]);
|
SetDistance(distanceEvent.beat, distanceEvent["type"], distanceEvent["ease"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wantStartRally >= beat && IsRallyBeat(wantStartRally))
|
if (wantStartRally >= beat && IsRallyBeat(wantStartRally) && wantStartRally < nextGameSwitchBeatGlobal)
|
||||||
{
|
{
|
||||||
StartRally(wantStartRally);
|
StartRally(wantStartRally);
|
||||||
}
|
}
|
||||||
else if (wantStartBaBum >= beat && IsBaBumBeat(wantStartBaBum))
|
else if (wantStartBaBum >= beat && IsBaBumBeat(wantStartBaBum) && wantStartBaBum < nextGameSwitchBeatGlobal)
|
||||||
{
|
{
|
||||||
StartBaBumBumBum(wantStartBaBum, wantCount, wantAlt);
|
StartBaBumBumBum(wantStartBaBum, wantCount, wantAlt);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,10 +124,10 @@ namespace HeavenStudio.Games.Scripts_Splashdown
|
||||||
Instantiate(splashPrefab, splashHolder).Init("Appearsplash");
|
Instantiate(splashPrefab, splashHolder).Init("Appearsplash");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GoDown()
|
public void GoDown(bool splash = true)
|
||||||
{
|
{
|
||||||
SetState(MovementState.Dive, startBeat);
|
SetState(MovementState.Dive, startBeat);
|
||||||
Instantiate(splashPrefab, splashHolder).Init("GodownSplash");
|
if (splash) Instantiate(splashPrefab, splashHolder).Init("GodownSplash");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Bop()
|
public void Bop()
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
},
|
},
|
||||||
new GameAction("amount", "Synchrette Amount")
|
new GameAction("amount", "Synchrette Amount")
|
||||||
{
|
{
|
||||||
function = delegate { Splashdown.instance.SpawnSynchrettes(eventCaller.currentEntity["amount"]); },
|
function = delegate { Splashdown.instance.SpawnSynchrettes(eventCaller.currentEntity["amount"], eventCaller.currentEntity.beat); },
|
||||||
defaultLength = 0.5f,
|
defaultLength = 0.5f,
|
||||||
parameters = new List<Param>()
|
parameters = new List<Param>()
|
||||||
{
|
{
|
||||||
|
|
@ -93,6 +93,7 @@ namespace HeavenStudio.Games
|
||||||
|
|
||||||
private List<NtrSynchrette> currentSynchrettes = new List<NtrSynchrette>();
|
private List<NtrSynchrette> currentSynchrettes = new List<NtrSynchrette>();
|
||||||
private NtrSynchrette player;
|
private NtrSynchrette player;
|
||||||
|
private double _gameSwitchBeat = -1;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
|
|
@ -100,6 +101,18 @@ namespace HeavenStudio.Games
|
||||||
SpawnSynchrettes(3);
|
SpawnSynchrettes(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void OnGameSwitch(double beat)
|
||||||
|
{
|
||||||
|
_gameSwitchBeat = beat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnPlay(double beat)
|
||||||
|
{
|
||||||
|
var events = EventCaller.GetAllInGameManagerList("gameManager", new string[] { "switchGame" }).FindAll(x => x.beat < beat);
|
||||||
|
if (events.Count == 0) return;
|
||||||
|
_gameSwitchBeat = events[^1].beat;
|
||||||
|
}
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
var cond = Conductor.instance;
|
var cond = Conductor.instance;
|
||||||
|
|
@ -125,7 +138,7 @@ namespace HeavenStudio.Games
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SpawnSynchrettes(int amount)
|
public void SpawnSynchrettes(int amount, double beat = -1)
|
||||||
{
|
{
|
||||||
if (currentSynchrettes.Count > 0)
|
if (currentSynchrettes.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
@ -137,13 +150,20 @@ namespace HeavenStudio.Games
|
||||||
}
|
}
|
||||||
if (player != null) Destroy(player.gameObject);
|
if (player != null) Destroy(player.gameObject);
|
||||||
float startPos = -((amount / 2) * synchretteDistance) + ((amount % 2 == 0) ? synchretteDistance / 2 : 0);
|
float startPos = -((amount / 2) * synchretteDistance) + ((amount % 2 == 0) ? synchretteDistance / 2 : 0);
|
||||||
|
bool shouldGoDown = false;
|
||||||
|
if (beat >= 0)
|
||||||
|
{
|
||||||
|
var inputEvents = EventCaller.GetAllInGameManagerList("splashdown", new string[] { "dive", "appear", "jump", "together", "togetherR9" }).FindAll(x => x.beat < beat && x.beat >= _gameSwitchBeat);
|
||||||
|
if (inputEvents.Count > 0) shouldGoDown = inputEvents[^1].datamodel == "splashdown/dive";
|
||||||
|
}
|
||||||
for (int i = 0; i < amount; i++)
|
for (int i = 0; i < amount; i++)
|
||||||
{
|
{
|
||||||
NtrSynchrette spawnedSynchrette = Instantiate(synchrettePrefab, synchretteHolder);
|
NtrSynchrette spawnedSynchrette = Instantiate(synchrettePrefab, synchretteHolder);
|
||||||
spawnedSynchrette.transform.localPosition = new Vector3(startPos + (synchretteDistance * i), spawnedSynchrette.transform.localPosition.y, 0);
|
spawnedSynchrette.transform.localPosition = new Vector3(startPos + (synchretteDistance * i), spawnedSynchrette.transform.localPosition.y, 0);
|
||||||
if (i < amount - 1) currentSynchrettes.Add(spawnedSynchrette);
|
if (i < amount - 1) currentSynchrettes.Add(spawnedSynchrette);
|
||||||
else player = spawnedSynchrette;
|
else player = spawnedSynchrette;
|
||||||
|
|
||||||
|
if (shouldGoDown) spawnedSynchrette.GoDown(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue