From b7aa658a115299a026538a0d07b0d16ae2e134e1 Mon Sep 17 00:00:00 2001 From: Brian Reynolds Date: Tue, 19 Jan 2021 22:43:10 -0500 Subject: [PATCH] 1.9.7 - Aurora Chernobyl. Nitrogen 'hard' improvements. Battery scoring. More Cyclops scans required --- DeathRun/DeathRun.cs | 12 ++- DeathRun/DeathRunConfig.cs | 5 ++ DeathRun/DeathRunUtils.cs | 7 +- DeathRun/Patchers/BreathingPatcher.cs | 14 +++ DeathRun/Patchers/NitroLevPatcher.cs | 2 +- DeathRun/Patchers/PlayerPatcher.cs | 46 +++++++++- DeathRun/Patchers/RadiationPatcher.cs | 121 +++++++++++++++++++++----- DeathRun/Properties/AssemblyInfo.cs | 4 +- DeathRun/ReadMe.txt | 7 +- DeathRun/mod.json | 2 +- QMods/DeathRun/ReadMe.txt | 7 +- QMods/DeathRun/mod.json | 2 +- 12 files changed, 195 insertions(+), 34 deletions(-) diff --git a/DeathRun/DeathRun.cs b/DeathRun/DeathRun.cs index 02274e2..b0eb68c 100644 --- a/DeathRun/DeathRun.cs +++ b/DeathRun/DeathRun.cs @@ -658,7 +658,11 @@ public static void Patch() PDAHandler.EditFragmentsToScan(TechType.Seaglide, 4); PDAHandler.EditFragmentsToScan(TechType.Seamoth, 12); - PDAHandler.EditFragmentsToScan(TechType.Exosuit, 7); + PDAHandler.EditFragmentsToScan(TechType.ExosuitFragment, 7); + PDAHandler.EditFragmentsToScan(TechType.CyclopsBridgeFragment, 5); + PDAHandler.EditFragmentsToScan(TechType.CyclopsDockingBayFragment, 5); + PDAHandler.EditFragmentsToScan(TechType.CyclopsEngineFragment, 5); + PDAHandler.EditFragmentsToScan(TechType.CyclopsHullFragment, 5); PDAHandler.EditFragmentsToScan(TechType.Beacon, 4); PDAHandler.EditFragmentsToScan(TechType.Gravsphere, 4); @@ -684,7 +688,11 @@ public static void Patch() PDAHandler.EditFragmentsToScan(TechType.Seaglide, 3); PDAHandler.EditFragmentsToScan(TechType.Seamoth, 8); - PDAHandler.EditFragmentsToScan(TechType.Exosuit, 6); + PDAHandler.EditFragmentsToScan(TechType.ExosuitFragment, 6); + PDAHandler.EditFragmentsToScan(TechType.CyclopsBridgeFragment, 4); + PDAHandler.EditFragmentsToScan(TechType.CyclopsDockingBayFragment, 4); + PDAHandler.EditFragmentsToScan(TechType.CyclopsEngineFragment, 4); + PDAHandler.EditFragmentsToScan(TechType.CyclopsHullFragment, 4); PDAHandler.EditFragmentsToScan(TechType.Beacon, 3); PDAHandler.EditFragmentsToScan(TechType.Gravsphere, 3); diff --git a/DeathRun/DeathRunConfig.cs b/DeathRun/DeathRunConfig.cs index f130a02..d97273a 100644 --- a/DeathRun/DeathRunConfig.cs +++ b/DeathRun/DeathRunConfig.cs @@ -352,6 +352,11 @@ public int countDeathRunBonuses() bonuses += 2; } + if (EXORBITANT.Equals(batteryCosts)) + { + bonuses++; + } + if (MURK_DARK.Equals(murkiness)) { bonuses++; diff --git a/DeathRun/DeathRunUtils.cs b/DeathRun/DeathRunUtils.cs index 708d218..4603234 100644 --- a/DeathRun/DeathRunUtils.cs +++ b/DeathRun/DeathRunUtils.cs @@ -20,7 +20,7 @@ namespace DeathRun public class DeathRunUtils { - public const string VERSION = "1.9.5"; + public const string VERSION = "1.9.7"; public static CenterText[] centerMessages = new CenterText[] { new CenterText(250f, true), @@ -229,7 +229,8 @@ public static string sayBriefTime(TimeSpan time, bool noDays) "Repair your Escape Pod for better power generation!", "You swim faster when on the surface.", "Enemies only chase you if they can SEE you.", - "Hugging the ground helps hide from enemies (and Crash Fish blasts)" + "Hugging the ground helps hide from enemies (and Crash Fish blasts)", + "Aurora is easier to explore AFTER you repair its radiation leaks." }; public static void InitHighScores () @@ -285,7 +286,7 @@ public static void ShowHighScores(bool should) } highScoreLabel.setAlign(TextAnchor.MiddleCenter); - highScoreLabel.ShowMessage("Death Run 1.9.5 - Best Scores"); + highScoreLabel.ShowMessage("Death Run 1.9.7 - Best Scores"); highScoreTag.setAlign(TextAnchor.MiddleCenter); int pick; diff --git a/DeathRun/Patchers/BreathingPatcher.cs b/DeathRun/Patchers/BreathingPatcher.cs index b8e36d8..3496bb9 100644 --- a/DeathRun/Patchers/BreathingPatcher.cs +++ b/DeathRun/Patchers/BreathingPatcher.cs @@ -34,6 +34,20 @@ private static bool isAirPoisoned(Player player) if (player.IsInside() || player.precursorOutOfWater) return false; float depth = Ocean.main.GetDepthOf(player.gameObject); if (depth > 5) return false; + + // After repairing radiation leaks, when inside the Aurora. + if (LeakingRadiation.main != null) + { + if (LeakingRadiation.main.GetNumLeaks() == 0) + { + string LDBiome = TerrainDebugGUI.main.CalculateRawBiome(Player.main); + if (LDBiome.Contains("CrashedShip_Interior")) + { + return false; + } + } + } + return true; } diff --git a/DeathRun/Patchers/NitroLevPatcher.cs b/DeathRun/Patchers/NitroLevPatcher.cs index 9ca050b..ef531f2 100644 --- a/DeathRun/Patchers/NitroLevPatcher.cs +++ b/DeathRun/Patchers/NitroLevPatcher.cs @@ -178,7 +178,7 @@ public static bool Prefix (ref NitrogenLevel __instance) baselineSafe = (depth < 0) ? 0 : depth * 3 / 4; // At any given depth our safe equilibrium gradually approaches 3/4 of current depth } else { - baselineSafe = (depth < 0) ? 0 : depth / 2; // At any given depth our safe equilibrium gradually approaches 1/2 of current depth + baselineSafe = ((depth < 0) || !isSwimming) ? 0 : depth / 2; // At any given depth our safe equilibrium gradually approaches 1/2 of current depth } // Better dissipation when we're breathing through a pipe, or in a vehicle/base, or riding Seaglide, or wearing Rebreather diff --git a/DeathRun/Patchers/PlayerPatcher.cs b/DeathRun/Patchers/PlayerPatcher.cs index 6c702e3..feeba13 100644 --- a/DeathRun/Patchers/PlayerPatcher.cs +++ b/DeathRun/Patchers/PlayerPatcher.cs @@ -32,7 +32,8 @@ public class PlayerSaveData public bool toldSeamothCosts { get; set; } public bool toldExosuitCosts { get; set; } public bool seaGlideExpended { get; set; } - + public float backgroundRads { get; set; } + public float fixedRadiation { get; set; } public PlayerSaveData() { @@ -66,6 +67,8 @@ public void setDefaults() toldSeamothCosts = false; toldExosuitCosts = false; seaGlideExpended = false; + backgroundRads = 0; + fixedRadiation = 0; } } @@ -644,6 +647,47 @@ public static void Postfix() + [HarmonyPatch(typeof(Player))] + [HarmonyPatch("UpdateRadiationSound")] + internal class PlayerUpdateRadiationSoundPatcher + { + /** + * Player.UpdateRadiationSound -- give some radiation sounds when we're exploring the ship + */ + [HarmonyPrefix] + public static bool Prefix() + { + float rads = Player.main.radiationAmount; + + float backgroundRads = DeathRun.saveData.playerSave.backgroundRads; + + if (backgroundRads >= 0.4f) + { + //backgroundRads /= 2; + if (backgroundRads > rads) + { + rads = backgroundRads; + } + } + + if (Player.main.fmodIndexIntensity < 0) + { + Player.main.fmodIndexIntensity = Player.main.radiateSound.GetParameterIndex("intensity"); + } + if (rads > 0f) + { + Player.main.radiateSound.Play(); + Player.main.radiateSound.SetParameterValue(Player.main.fmodIndexIntensity, rads); + return false; + } + Player.main.radiateSound.Stop(); + + return false; + } + } + + + [HarmonyPatch(typeof(Player))] [HarmonyPatch("UpdateMotorMode")] internal class PlayerUpdateMotorModePatcher diff --git a/DeathRun/Patchers/RadiationPatcher.cs b/DeathRun/Patchers/RadiationPatcher.cs index d3d53b1..2e58aa3 100644 --- a/DeathRun/Patchers/RadiationPatcher.cs +++ b/DeathRun/Patchers/RadiationPatcher.cs @@ -220,49 +220,128 @@ public class RadiationFXPatcher { const float MINIMUM_AMOUNT_NORMAL = 0.1f; const float MINIMUM_AMOUNT_SHIP = 0.2f; - const float MINIMUM_AMOUNT_ON_SHIP = 0.3f; - const float MINIMUM_AMOUNT_DEEP_SHIP = 0.4f; - const float MINIMUM_AMOUNT_REACTOR = 0.5f; + + const float FIX_PERIOD = 5; [HarmonyPrefix] private static bool Update(RadiationsScreenFXController __instance) { if ((Player.main == null) || (LeakingRadiation.main == null)) { + DeathRun.saveData.playerSave.backgroundRads = 0; return true; } - float distance = (Player.main.transform.position - LeakingRadiation.main.transform.position).magnitude; + Vector3 reactorRoom = new Vector3(873.7f, 2.9f, -1.7f); + float distance = (Player.main.transform.position - reactorRoom).magnitude; //LeakingRadiation.main.transform.position float backgroundRads; - if (distance <= 50) - { - backgroundRads = MINIMUM_AMOUNT_REACTOR; - } - else if (distance <= 150) - { - backgroundRads = MINIMUM_AMOUNT_DEEP_SHIP; - } - else if (distance <= 250) - { - backgroundRads = MINIMUM_AMOUNT_ON_SHIP; - } - else if (RadiationUtils.isInShipsRadiation(Player.main.transform)) + string LDBiome = TerrainDebugGUI.main.CalculateRawBiome(Player.main); + string PlayerBiome = Player.main.GetBiomeString(); + + //ErrorMessage.AddMessage("LDBiome=" + LDBiome + " PlayerBiome=" + PlayerBiome); + + + if (RadiationUtils.isInShipsRadiation(Player.main.transform)) { backgroundRads = MINIMUM_AMOUNT_SHIP; - } + } else if (RadiationUtils.isInAnyRadiation(Player.main.transform)) { backgroundRads = MINIMUM_AMOUNT_NORMAL; - } + } else { backgroundRads = 0; } + DeathRun.saveData.playerSave.backgroundRads = backgroundRads; + + // In the moments right after we fix the leaks, the visible radiation fades back a bit. + float fixFactor = 1.0f; + if (LeakingRadiation.main.GetNumLeaks() == 0) + { + if (DeathRun.saveData.playerSave.fixedRadiation == 0) + { + DeathRun.saveData.playerSave.fixedRadiation = DayNightCycle.main.timePassedAsFloat; + } + else if (DayNightCycle.main.timePassedAsFloat > DeathRun.saveData.playerSave.fixedRadiation + FIX_PERIOD) + { + fixFactor = 0.0f; + } + else + { + fixFactor = 1 - ((DayNightCycle.main.timePassedAsFloat - DeathRun.saveData.playerSave.fixedRadiation) / FIX_PERIOD); + } + } + + // If we're inside the ship (or near it), and radiation leaks aren't fixed yet, we show quite a bit more radiation effects + if (fixFactor > 0) + { + if (LDBiome.Contains("CrashedShip")) { + if (LDBiome.Contains("Interior_Power") && !LDBiome.Contains("Corridor")) + { + if (Player.main.IsSwimming()) + { + backgroundRads = 2.0f; + } + else + { + backgroundRads = 1.6f; + } + } + else if (LDBiome.Contains("PowerCorridor")) + { + if (distance <= 32) + { + backgroundRads = 1.4f; + } + else + { + backgroundRads = 1.2f; + } + } + else if (LDBiome.Contains("Elevator") || LDBiome.Contains("Locker") || LDBiome.Contains("Seamoth")) + { + backgroundRads = 1.0f; + } + else if (LDBiome.Contains("Exo") || LDBiome.Contains("Living") || LDBiome.Contains("Cargo")) + { + backgroundRads = 0.8f; + } + else if (LDBiome.Contains("Entrance_03") || LDBiome.Contains("Entrance_01_01")) + { + backgroundRads = 0.7f; + } + else if (LDBiome.Contains("THallway_Lower") || LDBiome.Contains("Entrance_01")) + { + backgroundRads = 0.6f; + } + else if (LDBiome.Contains("THallway") || LDBiome.Contains("Entrance")) + { + backgroundRads = 0.5f; + } + else if (PlayerBiome.Contains("crashedShip") || PlayerBiome.Contains("generatorRoom")) + { + backgroundRads = 0.4f; + } + else if (PlayerBiome.Contains("CrashZone") || PlayerBiome.Contains("crashZone")) + { + backgroundRads = 0.3f; + } + } + + backgroundRads = backgroundRads * fixFactor; + if (backgroundRads > DeathRun.saveData.playerSave.backgroundRads) + { + DeathRun.saveData.playerSave.backgroundRads = backgroundRads; + } + } + + //ErrorMessage.AddMessage("Dist=" + distance + " Rads=" + backgroundRads + " Leaks="+ LeakingRadiation.main.GetNumLeaks()); //CattleLogger.Message("start = " + LeakingRadiation.main.kStartRadius); //CattleLogger.Message("max = " + LeakingRadiation.main.kMaxRadius); - + float rads = Mathf.Max(Player.main.radiationAmount, backgroundRads); // If Player is naturally in at least our minimum display amount, just run normal method. @@ -280,7 +359,7 @@ private static bool Update(RadiationsScreenFXController __instance) __instance.animTime -= Time.deltaTime / __instance.fadeDuration; } __instance.animTime = Mathf.Clamp01(__instance.animTime); - __instance.fx.noiseFactor = backgroundRads/2 * __instance.radiationMultiplier + __instance.minRadiation * __instance.animTime; + __instance.fx.noiseFactor = rads * __instance.radiationMultiplier + __instance.minRadiation * __instance.animTime; if (__instance.fx.noiseFactor > 0f && !__instance.fx.enabled) { __instance.fx.enabled = true; diff --git a/DeathRun/Properties/AssemblyInfo.cs b/DeathRun/Properties/AssemblyInfo.cs index fefea78..1aa4a38 100644 --- a/DeathRun/Properties/AssemblyInfo.cs +++ b/DeathRun/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.9.5.0")] -[assembly: AssemblyFileVersion("1.9.5.0")] +[assembly: AssemblyVersion("1.9.7.0")] +[assembly: AssemblyFileVersion("1.9.7.0")] diff --git a/DeathRun/ReadMe.txt b/DeathRun/ReadMe.txt index b0277b6..52a5db4 100644 --- a/DeathRun/ReadMe.txt +++ b/DeathRun/ReadMe.txt @@ -1,4 +1,4 @@ -DEATH RUN - 1.9.5 - by Cattlesquat "standing on the shoulders of giants" +DEATH RUN - 1.9.7 - by Cattlesquat "standing on the shoulders of giants" Turns Subnautica into a "roguelike" where everything is harder and the only real question is how LONG you can survive. @@ -19,6 +19,11 @@ Turns Subnautica into a "roguelike" where everything is harder and the only real • Vehicles and the Habitat Builder much more expensive ------------------------------------------------------------------------------------------------------------- +• 1.9.7 - Aurora interior is more Chernobyl-ish before repair, but AFTER repair the air inside it works again +• 1.9.7 - Nitrogen/Bends on "Hard" level falls toward 0 when you go inside a base/vehicle +• 1.9.7 - Setting Batteries to "Worse than Deathrun" gives appropriate scoring credit +• 1.9.7 - Scans Required for Cyclops fragments increased (5 of each type on Death Run, 4 of each type on Hard) +• 1.9.6 - Fix # scans for Prawn that I apparently broke a few builds back • 1.9.5 - Copper batteries can be "recycled" in the Fabricator -- three batteries returns 2 copper. • 1.9.5 - First Aid Kits used to purge oxygen are still consumed even if health is 100% • 1.9.4 - "Alternative" Death Run Vehicles costs wasn't giving proper scoring credit. diff --git a/DeathRun/mod.json b/DeathRun/mod.json index 6e67327..984afaa 100644 --- a/DeathRun/mod.json +++ b/DeathRun/mod.json @@ -2,7 +2,7 @@ "Id": "DeathRun", "DisplayName": "DeathRun", "Author": "Cattlesquat", - "Version": "1.9.5", + "Version": "1.9.6", "Enable": true, "AssemblyName": "DeathRun.dll", "EntryMethod": "DeathRun.DeathRun.Patch", diff --git a/QMods/DeathRun/ReadMe.txt b/QMods/DeathRun/ReadMe.txt index b0277b6..52a5db4 100644 --- a/QMods/DeathRun/ReadMe.txt +++ b/QMods/DeathRun/ReadMe.txt @@ -1,4 +1,4 @@ -DEATH RUN - 1.9.5 - by Cattlesquat "standing on the shoulders of giants" +DEATH RUN - 1.9.7 - by Cattlesquat "standing on the shoulders of giants" Turns Subnautica into a "roguelike" where everything is harder and the only real question is how LONG you can survive. @@ -19,6 +19,11 @@ Turns Subnautica into a "roguelike" where everything is harder and the only real • Vehicles and the Habitat Builder much more expensive ------------------------------------------------------------------------------------------------------------- +• 1.9.7 - Aurora interior is more Chernobyl-ish before repair, but AFTER repair the air inside it works again +• 1.9.7 - Nitrogen/Bends on "Hard" level falls toward 0 when you go inside a base/vehicle +• 1.9.7 - Setting Batteries to "Worse than Deathrun" gives appropriate scoring credit +• 1.9.7 - Scans Required for Cyclops fragments increased (5 of each type on Death Run, 4 of each type on Hard) +• 1.9.6 - Fix # scans for Prawn that I apparently broke a few builds back • 1.9.5 - Copper batteries can be "recycled" in the Fabricator -- three batteries returns 2 copper. • 1.9.5 - First Aid Kits used to purge oxygen are still consumed even if health is 100% • 1.9.4 - "Alternative" Death Run Vehicles costs wasn't giving proper scoring credit. diff --git a/QMods/DeathRun/mod.json b/QMods/DeathRun/mod.json index 6e67327..984afaa 100644 --- a/QMods/DeathRun/mod.json +++ b/QMods/DeathRun/mod.json @@ -2,7 +2,7 @@ "Id": "DeathRun", "DisplayName": "DeathRun", "Author": "Cattlesquat", - "Version": "1.9.5", + "Version": "1.9.6", "Enable": true, "AssemblyName": "DeathRun.dll", "EntryMethod": "DeathRun.DeathRun.Patch",