From 14fb79a6cd97c55b76370d3e57a2f7082024384d Mon Sep 17 00:00:00 2001
From: SokyranTheDragon <36712560+SokyranTheDragon@users.noreply.github.com>
Date: Sun, 20 Oct 2024 02:40:16 +0200
Subject: [PATCH] Update Alpha mods (#485)
- Removed the System RNG from all related mods, as they all replaced it with Verse RNG
- This means that Alpha Mythology patch was removed, as it's no longer needed
- Removed current map usage from Alpha Memes, as the mod no longer uses it in an unsafe manner/fixed the code using it to check all maps
---
Source/Mods/AlphaAnimals.cs | 25 -------------------------
Source/Mods/AlphaBiomes.cs | 7 -------
Source/Mods/AlphaMemes.cs | 25 -------------------------
Source/Mods/AlphaMythology.cs | 14 --------------
4 files changed, 71 deletions(-)
delete mode 100644 Source/Mods/AlphaMythology.cs
diff --git a/Source/Mods/AlphaAnimals.cs b/Source/Mods/AlphaAnimals.cs
index b3827ba4..3db1cdd4 100644
--- a/Source/Mods/AlphaAnimals.cs
+++ b/Source/Mods/AlphaAnimals.cs
@@ -24,31 +24,6 @@ public AlphaAnimals(ModContentPack mod)
{
LongEventHandler.ExecuteWhenFinished(LatePatch);
- #region RNG
-
- {
- var rngFixConstructors = new[]
- {
- "AlphaBehavioursAndEvents.DeathActionWorker_ExplodeAndSpawnEggs",
- "AlphaBehavioursAndEvents.Hediff_Crushing",
-
- // Ocular plant conversion
- "AlphaBehavioursAndEvents.Gas_Ocular",
- };
-
- PatchingUtilities.PatchSystemRandCtor(rngFixConstructors, false);
-
- var fixSystemRngMethods = new[]
- {
- "AlphaBehavioursAndEvents.Ability_SpawnOnRadius:Cast",
- "AlphaBehavioursAndEvents.CompCreateOcularPlants:CompTick",
- "AlphaBehavioursAndEvents.CompCreateOcularPlants:ConvertRandomPlantInRadius",
- };
- PatchingUtilities.PatchSystemRand(fixSystemRngMethods, false);
- }
-
- #endregion
-
#region MP unsafe method patching
// Only apply if VFE-I2 is inactive.
diff --git a/Source/Mods/AlphaBiomes.cs b/Source/Mods/AlphaBiomes.cs
index cc7433be..ffdd4a27 100644
--- a/Source/Mods/AlphaBiomes.cs
+++ b/Source/Mods/AlphaBiomes.cs
@@ -30,13 +30,6 @@ public AlphaBiomes(ModContentPack mod)
"AlphaBiomes.GameCondition_AcidRain:DoCellSteadyEffects",
};
- var systemRngFixConstructor = new[]
- {
- "AlphaBiomes.CompGasProducer",
- "AlphaBiomes.HediffComp_GangreneWounds",
- }.Select(x => AccessTools.DeclaredConstructor(AccessTools.TypeByName(x)));
-
- PatchingUtilities.PatchSystemRand(systemRngFixConstructor, false);
PatchingUtilities.PatchPushPopRand(rngFixMethods);
}
diff --git a/Source/Mods/AlphaMemes.cs b/Source/Mods/AlphaMemes.cs
index 526a4b42..a5f51b3c 100644
--- a/Source/Mods/AlphaMemes.cs
+++ b/Source/Mods/AlphaMemes.cs
@@ -37,21 +37,6 @@ public AlphaMemes(ModContentPack mod)
LongEventHandler.ExecuteWhenFinished(LatePatch);
MpCompatPatchLoader.LoadPatch(this);
- #region RNG
-
- {
- PatchingUtilities.PatchSystemRand("AlphaMemes.AlphaMemes_DamageWorker_AddInjury_Apply_Patch:SendHistoryIfMelee", false);
- PatchingUtilities.PatchPushPopRand("AlphaMemes.RitualBehaviorWorker_FuneralFramework:TryExecuteOn");
- PatchingUtilities.PatchSystemRandCtor("AlphaMemes.CompAbilityOcularConversion");
- // The following method is seeded, so it should be fine
- // If not, then patching it as well should fix it
- //"AlphaMemes.GameComponent_RandomMood:GameComponentTick",
-
- // Need to push/pop for RNG used in interface.
- }
-
- #endregion
-
#region Gizmos
{
@@ -90,16 +75,6 @@ public AlphaMemes(ModContentPack mod)
#endregion
- #region Current map
-
- {
- // Current map usage
- var type = AccessTools.TypeByName("AlphaMemes.AlphaMemesIdeo_Notify_Patches");
- PatchingUtilities.ReplaceCurrentMapUsage(AccessTools.Inner(type, "FuneralFramework_Ideo_MemberCorpseDestroyed"), "Prefix");
- }
-
- #endregion
-
#region Funeral ritual dialog
{
diff --git a/Source/Mods/AlphaMythology.cs b/Source/Mods/AlphaMythology.cs
deleted file mode 100644
index 56a1b07e..00000000
--- a/Source/Mods/AlphaMythology.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using Verse;
-
-namespace Multiplayer.Compat
-{
- /// Alpha Mythology by Sarg Bjornson
- ///
- ///
- [MpCompatFor("sarg.magicalmenagerie")]
- public class AlphaMythology
- {
- public AlphaMythology(ModContentPack mod)
- => PatchingUtilities.PatchSystemRandCtor("AnimalBehaviours.DeathActionWorker_ExplodeAndSpawnEggs");
- }
-}
\ No newline at end of file