Skip to content

Commit

Permalink
1.4.1 - Color coding N2, and fixed a patching bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Cattlesquat committed Dec 22, 2020
1 parent d7dc2ba commit 3ed7701
Show file tree
Hide file tree
Showing 11 changed files with 111 additions and 12 deletions.
47 changes: 44 additions & 3 deletions DeathRun/DeathRun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class DeathRun
public static void Patch()
{
CattleLogger.setModName(modName);
CattleLogger.PatchStart("1.3.5");
CattleLogger.PatchStart("1.4.1");

try
{
Expand Down Expand Up @@ -525,9 +525,36 @@ public static void Patch()
new Ingredient(TechType.Magnetite, 1)
}
}
}
},
{
TechType.MedicalCabinet,
new TechData
{
craftAmount = 1,
Ingredients = new List<Ingredient>
{
new Ingredient(TechType.ComputerChip, 1),
new Ingredient(TechType.FiberMesh, 4),
new Ingredient(TechType.Silver, 1),
new Ingredient(TechType.Titanium, 1)
}
}
},
//{
//TechType.Fabricator,
// new TechData
// {
// craftAmount = 1,
// Ingredients = new List<Ingredient>
// {
// new Ingredient(TechType.Titanium, 1),
// new Ingredient(TechType.Gold, 1),
// new Ingredient(TechType.JeweledDiskPiece, 1)
// }
// }
//}
};
}
}
else if (Config.HARD.Equals(DeathRun.config.builderCosts))
{
CattleLogger.Message("Hard Habitat");
Expand All @@ -546,6 +573,20 @@ public static void Patch()
new Ingredient(TechType.Lithium, 1),
}
}
},
{
TechType.MedicalCabinet,
new TechData
{
craftAmount = 1,
Ingredients = new List<Ingredient>
{
new Ingredient(TechType.ComputerChip, 1),
new Ingredient(TechType.FiberMesh, 3),
new Ingredient(TechType.Silver, 1),
new Ingredient(TechType.Titanium, 1)
}
}
}
};
}
Expand Down
7 changes: 5 additions & 2 deletions DeathRun/DeathRunUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,15 @@ public static string sayBriefTime(TimeSpan time, bool noDays)
public static List<String> tips = new List<String>() { "How long can YOU survive?",
"Did you know eating raw bladderfish yields oxygen?",
"First aid kits also purge nitrogen.",
"Eating some native fish purges nitrogen.",
"Eating certain kinds of native fish purges nitrogen.",
"Speak softly, but carry a floating pump.",
"Never stop moving - those things bite!",
"Keep your food and water topped up: it heals you!",
"The more Death Run settings you use - the higher your score!",
"Survive longer? Higher score. Win fastest? Highest Score."
"Survive longer? Higher score. Win fastest? Highest Score.",
"Hold a fish in your hand: many enemies will bite it instead of you!",
"Famous Last Words: I'll just leave my pump here for a minute.",
"You swim faster when you aren't holding something."
};


Expand Down
15 changes: 15 additions & 0 deletions DeathRun/NMBehaviours/BendsHUDController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,37 @@ public static void SetDepth(int safeDepth, float n2percent)
{
if (main == null)
return;

if ((n2percent >= 100) && (safeDepth >= 10))
{
main.n2Depth.text = safeDepth + "m";

main.n2Depth.color = Color.white;
if (!Player.main.IsSwimming())
{
main.n2Depth.text += " *";
}
else if (DeathRun.saveData.nitroSave.atPipe)
{
main.n2Depth.text += " P*";
main.n2Depth.color = Color.cyan;
}

int depth = (int)Ocean.main.GetDepthOf(Player.main.gameObject);
if (depth < safeDepth)
{
main.n2Depth.color = Color.red;
} else if (depth < safeDepth + 3)
{
main.n2Depth.color = Color.yellow;
}

}
else
{
main.n2Depth.text = Mathf.RoundToInt(n2percent) + "%";

main.n2Depth.color = Color.white;
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions DeathRun/Patchers/BreathingPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ public static bool PlayReachSurfaceSound(WaterAmbience __instance)
return true;
}

// If we're at a pipe so we can actually breathe, treat it normally.
if (DeathRun.saveData.nitroSave.atPipe)
{
return true;
}

// Smoke choke sounds in unbreathable atmosphere
PlayerDamageSounds s = Player.main.gameObject.GetComponent<PlayerDamageSounds>();
if (s != null) {
Expand Down
24 changes: 24 additions & 0 deletions DeathRun/Patchers/EscapePodPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,15 @@ public static void Postfix()
blinkOn = !blinkOn;
}

bool radioWorks = false;
if (EscapePod.main.radioSpawner != null && EscapePod.main.radioSpawner.spawnedObj != null)
{
LiveMixin component = EscapePod.main.radioSpawner.spawnedObj.GetComponent<LiveMixin>();
if (component && component.IsFullHealth()) {
radioWorks = true;
}
}

if (damaged)
{
string content = Language.main.Get("IntroEscapePod3Content");
Expand All @@ -468,6 +477,11 @@ public static void Postfix()
content = content.Replace("Flotation Devices: DEPLOYED", "Flotation Devices: " + (blinkOn ? "FAILED" : ""));
}

if (radioWorks)
{
content = content.Replace("Radio: OFFLINE", "Radio: INCOMING ONLY");
}

if (!Config.NORMAL.Equals(DeathRun.config.creatureAggression))
{
content = content.Replace("Uncharted ocean planet 4546B", "Planet 4546B: HOSTILE FAUNA");
Expand Down Expand Up @@ -502,6 +516,11 @@ public static void Postfix()
{
string content = Language.main.Get("IntroEscapePod4Content");

if (!radioWorks)
{
content = content.Replace("Incoming radio communication: ONLINE", "Incoming radio communication: OFFLINE");
}

if (!Config.BASIC_GAME.Equals(DeathRun.config.startLocation))
{
content = content.Replace("Flotation Devices: DEPLOYED", "Flotation Devices: FAILED");
Expand All @@ -515,6 +534,11 @@ public static void Postfix()
}
}

if (BreathingPatcher.isSurfaceAirPoisoned())
{
content = content.Replace("Oxygen/nitrogen atmosphere", "Atmosphere: requires filtration");
}

string bonus = "";

if (DeathRunUtils.isExplosionClockRunning())
Expand Down
2 changes: 1 addition & 1 deletion DeathRun/Patchers/PlayerPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ internal class PlayerUnfreezeStatsPatcher
* Player.UnfreezeStats - a way to detect when the "respawning after death" process is complete
*/
[HarmonyPostfix]
public static void Postfix(DamageType damageType)
public static void Postfix()
{
DeathRun.playerIsDead = false;
}
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.3.5.0")]
[assembly: AssemblyFileVersion("1.3.5.0")]
[assembly: AssemblyVersion("1.4.1.0")]
[assembly: AssemblyFileVersion("1.4.1.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.3.5 - by Cattlesquat "standing on the shoulders of giants"
DEATH RUN - 1.4.1 - 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 Down Expand Up @@ -27,6 +27,11 @@ Turns Subnautica into a "roguelike" where everything is harder and the only real
• 1.3 - Normal (non-sinking) Escape Pod start supported
• 1.3 - (Fixes) Better mod stability when returning to main menu
-------------------------------------------------------------------------------------------------------------
• 1.4 - Improved the Deco/Nitrogen meter with color coding.
• 1.4 - Gradually adding to "Tips" section
• 1.4 - (Fixes) Various bugfixes
-------------------------------------------------------------------------------------------------------------


:: GENERAL OTHER STUFF ::
• Option to make water murky
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.3.5",
"Version": "1.4.1",
"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.3.5 - by Cattlesquat "standing on the shoulders of giants"
DEATH RUN - 1.4.1 - 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 Down Expand Up @@ -27,6 +27,11 @@ Turns Subnautica into a "roguelike" where everything is harder and the only real
• 1.3 - Normal (non-sinking) Escape Pod start supported
• 1.3 - (Fixes) Better mod stability when returning to main menu
-------------------------------------------------------------------------------------------------------------
• 1.4 - Improved the Deco/Nitrogen meter with color coding.
• 1.4 - Gradually adding to "Tips" section
• 1.4 - (Fixes) Various bugfixes
-------------------------------------------------------------------------------------------------------------


:: GENERAL OTHER STUFF ::
• Option to make water murky
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.3.5",
"Version": "1.4.1",
"Enable": true,
"AssemblyName": "DeathRun.dll",
"EntryMethod": "DeathRun.DeathRun.Patch",
Expand Down

0 comments on commit 3ed7701

Please sign in to comment.