Skip to content

Commit

Permalink
Updated Alpha mods (#454)
Browse files Browse the repository at this point in the history
Alpha Animals:
- Fix errors due to patches to `CompAbilityOcularConversion`
  - The type was removed, causing the patches to fail
- Remove Push/Pop RNG patches
  - I've added them when I originally started working on MP, thinking they were needed - they aren't (and I've tested to make sure)

Alpha Genes:
- Added a note about safe (seeded) System.Random call
  - This matches the note in Alpha Memes
  - The type didn't exist when MP patch for it was last updated, so I didn't include a note back then

Alpha Mechs:
- Removed current map usage patches
  - The issue was fixed in Alpha Mechs (juanosarg/AlphaMechs#3)

Alpha Memes:
- Added patch for `CompAbilityOcularConversion`
  - This type was likely moved here from Alpha Animals

From my testing, it didn't seem like other Alpha mods didn't need updates.
  • Loading branch information
SokyranTheDragon authored Aug 8, 2024
1 parent ff27a11 commit 2a7594e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 17 deletions.
11 changes: 0 additions & 11 deletions Source/Mods/AlphaAnimals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,11 @@ public AlphaBehavioursAndEvents(ModContentPack mod)
"AlphaBehavioursAndEvents.Hediff_Crushing",

// Ocular plant conversion
"AlphaBehavioursAndEvents.CompAbilityOcularConversion",
"AlphaBehavioursAndEvents.Gas_Ocular",
};

PatchingUtilities.PatchSystemRandCtor(rngFixConstructors, false);

var rngFixMethods = new[] //System.Random fixes
{
"AlphaBehavioursAndEvents.Hediff_Crushing:RandomFilthGenerator",

// Ocular plant conversion
"AlphaBehavioursAndEvents.CompAbilityOcularConversion:Apply",
"AlphaBehavioursAndEvents.Gas_Ocular:Tick",
};
PatchingUtilities.PatchPushPopRand(rngFixMethods);

var fixSystemRngMethods = new[]
{
"AlphaBehavioursAndEvents.Ability_SpawnOnRadius:Cast",
Expand Down
3 changes: 3 additions & 0 deletions Source/Mods/AlphaGenes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public AlphaGenes(ModContentPack mod)
PatchingUtilities.PatchSystemRandCtor("AlphaGenes.CompAbilityOcularConversion", false);
PatchingUtilities.PatchSystemRand("AlphaGenes.CompInsanityBlast:Apply", false);
PatchingUtilities.PatchSystemRand("AlphaGenes.HediffComp_Parasites:Hatch", false);
// The following method is seeded, so it should be fine
// If not, then patching it as well should fix it
//"AlphaGenes.GameComponent_RandomMood:GameComponentTick",
}

// Abilities
Expand Down
6 changes: 0 additions & 6 deletions Source/Mods/AlphaMechs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ public class AlphaMechs
{
public AlphaMechs(ModContentPack mod)
{
// Fix the mod using Find.CurrentMap instead of parent.Map - in both cases it creates new lord job on current (instead of parent) map
// Change mech to a vanilla one if the mod mechanoid is disabled
PatchingUtilities.ReplaceCurrentMapUsage("AlphaMechs.CompChangeDef:CompTick");
// Hediff runs out and mech turns back hostile
PatchingUtilities.ReplaceCurrentMapUsage("AlphaMechs.HediffComp_DeleteAfterTime:CompPostTick");

// Gizmos
MP.RegisterSyncMethod(AccessTools.DeclaredMethod("AlphaMechs.Pawn_HemogenVat:EjectContents"));
}
Expand Down
1 change: 1 addition & 0 deletions Source/Mods/AlphaMemes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public AlphaMemes(ModContentPack mod)
{
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",
Expand Down

0 comments on commit 2a7594e

Please sign in to comment.