Randomness for height changes

This commit is contained in:
Rapandrasmus 2023-06-22 00:35:50 +02:00
parent 6c0d780576
commit dcc1d656b8
2 changed files with 9 additions and 6 deletions

View file

@ -28,7 +28,9 @@ namespace HeavenStudio.Games.Loaders
{
parameters = new List<Param>()
{
new Param("value", new EntityTypes.Integer(-10, 10, 1), "Height Units")
new Param("value", new EntityTypes.Integer(-10, 10, 1), "Height Units"),
new Param("rmin", new EntityTypes.Integer(-10, 10, 0), "Random Units (Minimum)"),
new Param("rmax", new EntityTypes.Integer(-10, 10, 0), "Random Units (Maximum)"),
}
}
});
@ -48,7 +50,7 @@ namespace HeavenStudio.Games
[NonSerialized] public double countInBeat = -1;
[Header("Curves")]
[SerializeField] SuperCurveObject.Path[] jumpPaths;
[NonSerialized] public Dictionary<double, RiqEntity> platformHeightChanges = new Dictionary<double, RiqEntity>();
[NonSerialized] public Dictionary<double, int> platformHeightChanges = new Dictionary<double, int>();
new void OnDrawGizmos()
{
@ -80,13 +82,14 @@ namespace HeavenStudio.Games
List<RiqEntity> heightEvents = EventCaller.GetAllInGameManagerList("nightWalkAgb", new string[] { "height" });
foreach (var height in heightEvents)
{
int randomValue = UnityEngine.Random.Range(height["rmin"], height["rmax"]);
if (platformHeightChanges.ContainsKey(height.beat))
{
platformHeightChanges[height.beat]["value"] += height["value"];
platformHeightChanges[height.beat] += height["value"] + randomValue;
}
else
{
platformHeightChanges.Add(height.beat, height);
platformHeightChanges.Add(height.beat, height["value"] + randomValue);
}
}
}

View file

@ -34,13 +34,13 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
if (game == null) game = AgbNightWalk.instance;
if (game.platformHeightChanges.ContainsKey(hitBeat))
{
handler.defaultHeightUnits += game.platformHeightChanges[hitBeat]["value"];
handler.defaultHeightUnits += game.platformHeightChanges[hitBeat];
}
lastAdditionalHeightInUnits = handler.defaultHeightUnits;
additionalHeight = handler.defaultHeightUnits * handler.heightAmount;
if (game.platformHeightChanges.ContainsKey(hitBeat + 1))
{
additionalHeightInUnits = lastAdditionalHeightInUnits + game.platformHeightChanges[hitBeat + 1]["value"];
additionalHeightInUnits = lastAdditionalHeightInUnits + game.platformHeightChanges[hitBeat + 1];
}
else
{