1
0
Fork 0

Compare commits

..

3 Commits

Author SHA1 Message Date
ivan tkachenko 2e938dfc8d Release v13.37.9001 2025-08-05 05:10:48 +03:00
ivan tkachenko 1ffdd5d97e Add spawn rate patch to make the event more likely 2025-08-05 05:10:21 +03:00
ivan tkachenko 276fbbec22 Clean up mention of removed config option "Enable Color Animations"
Amends 2a28a36a69
2025-08-05 05:10:11 +03:00
3 changed files with 40 additions and 19 deletions

View File

@ -1,10 +1,11 @@
# Changelog
## MuzikaGromche 13.37.9001
## MuzikaGromche 13.37.9001 - Chromaberrated Edition
- Fixed more missing flickering behaviours for some animators controllers.
- Fixed some powered lights not fully turning off or flickering when there are multiple Light components per container.
- Improved performance by pre-loading certain assets at the start of round instead of at a timing-critical frame update.
- Added an opt-in config option to increase certain spawn rate to experience content of this mod more often.
## MuzikaGromche 13.37.1337 - Photosensitivity Warning Edition

View File

@ -9,9 +9,14 @@ namespace MuzikaGromche
{
const string JesterEnemyName = "Jester";
// If set to null, do not override spawn chances. Otherwise, it is an index of Jester in RoundManager.currentLevel.Enemies
static int? JesterEnemyIndex = null;
static float? SpawnTime = null;
// GetRandomWeightedIndex is not only called from AssignRandomEnemyToVent,
// so in order to differentiate it from other calls, prefix assigns these
// global variables, and postfix cleans them up.
// If set to null, do not override spawn chances.
// Otherwise, it is an index of Jester in RoundManager.currentLevel.Enemies
static int? EnemyIndex = null;
static float SpawnTime = 0f;
[HarmonyPatch(nameof(RoundManager.AssignRandomEnemyToVent))]
[HarmonyPrefix]
@ -28,7 +33,7 @@ namespace MuzikaGromche
return;
}
JesterEnemyIndex = index;
EnemyIndex = index;
SpawnTime = spawnTime;
}
@ -36,32 +41,46 @@ namespace MuzikaGromche
[HarmonyPostfix]
static void AssignRandomEnemyToVentPostfix(RoundManager __instance, EnemyVent vent, float spawnTime)
{
JesterEnemyIndex = null;
SpawnTime = null;
EnemyIndex = null;
SpawnTime = 0f;
}
[HarmonyPatch(nameof(RoundManager.GetRandomWeightedIndex))]
[HarmonyPostfix]
static void GetRandomWeightedIndexPostfix(RoundManager __instance, ref int[] weights, ref System.Random randomSeed)
[HarmonyPrefix]
static void GetRandomWeightedIndexPostfix(RoundManager __instance, int[] weights, System.Random randomSeed)
{
if (JesterEnemyIndex is int index && SpawnTime is float spawnTime)
if (EnemyIndex is int index)
{
if (__instance.EnemyCannotBeSpawned(index))
{
return;
}
var minMultiplierTime = 3 * __instance.timeScript.lengthOfHours;
var maxMultiplierTime = 7 * __instance.timeScript.lengthOfHours;
var normalizedMultiplierTime = Math.Clamp((spawnTime - minMultiplierTime) / (maxMultiplierTime - minMultiplierTime), 0f, 1f);
// 0 == 6:00 AM
// 60 == 7:00 AM
// 100 == 7:40 AM (Cycle #1)
// 120 == 8:00 AM
// 180 == 9:00 AM (Cycle #2)
// 300 == 11:00 AM (Cycle #3)
// 420 == 1:00 PM (Cycle #4)
// 540 == 3:00 PM (Cycle #5)
// 660 ~= 5:00 PM
// 780 ~= 7:00 PM
// 900 ~= 9:00 PM
// 1020 ~= 11:00 PM
// 1080 == 12:00 AM
const float minMultiplierTime = 200f; // 9:20 AM
const float maxMultiplierTime = 500f; // 2:00 PM
var normalizedMultiplierTime = Mathf.Clamp((SpawnTime - minMultiplierTime) / (maxMultiplierTime - minMultiplierTime), 0f, 1f);
// Start slowly, then escalate it quickly
normalizedMultiplierTime = Easing.InCubic.Eval(normalizedMultiplierTime);
// TODO: Try Expo function instead of Lerp?
var minMultiplier = Mathf.Max(1, __instance.minEnemiesToSpawn);
var maxMultiplier = 9 + __instance.minEnemiesToSpawn;
const float minMultiplier = 1f;
const float maxMultiplier = 15f;
var multiplier = Mathf.Lerp(minMultiplier, maxMultiplier, normalizedMultiplierTime);
var newWeight = (int)(weights[index] * multiplier);
Debug.Log($"{nameof(MuzikaGromche)} Overriding Jester spawn weight {weights[index]} * {multiplier} => {newWeight}");
var newWeight = Mathf.FloorToInt(weights[index] * multiplier);
Debug.Log($"{nameof(MuzikaGromche)} {nameof(SpawnRatePatch)} Overriding spawn weight[{index}] {weights[index]} * {multiplier} => {newWeight} for t={SpawnTime}");
weights[index] = newWeight;
}
}

View File

@ -17,10 +17,11 @@ Speaking of dependencies, [`V70PoweredLights_Fix`] is not strictly required, but
Configuration integrates with [`LethalConfig`] mod.
If you are just trying out this mod for the first time, or want to experience it more often, consider toggling ON the "Override Spawn Rates" config entry. Otherwise it might take a frustratingly long time to find out what you need to find out.
Track selection options are only configurable by host player and only while orbiting.
Any player can change their personal preferences locally.
- If you experience severe lags, try disabling color animations in config.
- If you are playing with a Bluetooth headset, adjust Audio Offset to -0.2 seconds.
- Display Lyrics toggle: show lyrics in a popup whenever player hears music.