Skip to content

Commit

Permalink
1.9.7 - Aurora Chernobyl. Nitrogen 'hard' improvements. Battery scori…
Browse files Browse the repository at this point in the history
…ng. More Cyclops scans required
  • Loading branch information
Cattlesquat committed Jan 20, 2021
1 parent 7421ea6 commit b7aa658
Show file tree
Hide file tree
Showing 12 changed files with 195 additions and 34 deletions.
12 changes: 10 additions & 2 deletions DeathRun/DeathRun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions DeathRun/DeathRunConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,11 @@ public int countDeathRunBonuses()
bonuses += 2;
}

if (EXORBITANT.Equals(batteryCosts))
{
bonuses++;
}

if (MURK_DARK.Equals(murkiness))
{
bonuses++;
Expand Down
7 changes: 4 additions & 3 deletions DeathRun/DeathRunUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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 ()
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 14 additions & 0 deletions DeathRun/Patchers/BreathingPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion DeathRun/Patchers/NitroLevPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
46 changes: 45 additions & 1 deletion DeathRun/Patchers/PlayerPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -66,6 +67,8 @@ public void setDefaults()
toldSeamothCosts = false;
toldExosuitCosts = false;
seaGlideExpended = false;
backgroundRads = 0;
fixedRadiation = 0;
}
}

Expand Down Expand Up @@ -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
Expand Down
121 changes: 100 additions & 21 deletions DeathRun/Patchers/RadiationPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions DeathRun/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
7 changes: 6 additions & 1 deletion DeathRun/ReadMe.txt
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion DeathRun/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 6 additions & 1 deletion QMods/DeathRun/ReadMe.txt
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion QMods/DeathRun/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b7aa658

Please sign in to comment.