Skip to content

Commit

Permalink
Merge pull request #10 from Govorunb/main
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexejhero authored Sep 7, 2023
2 parents 0894493 + 1d00413 commit f07b2dc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion SCHIZO/Creatures/Ermfish/ErmfishLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Between the ears there is a single antenna-like organ that emits a faint radio-s
unlockPopup = unlockSprite
});

List<LootDistributionData.BiomeData> biomes = new();
List<LootDistributionData.BiomeData> biomes = new();
foreach (BiomeType biome in Enum.GetValues(typeof(BiomeType)).Cast<BiomeType>())
{
biomes.Add(new LootDistributionData.BiomeData { biome = biome, count = 1, probability = 0.025f });
Expand Down
13 changes: 13 additions & 0 deletions SCHIZO/Creatures/Ermfish/ErmfishPatches.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Linq;
using HarmonyLib;
using Nautilus.Handlers;
using UnityEngine;

namespace SCHIZO.Creatures.Ermfish;
Expand Down Expand Up @@ -103,4 +104,16 @@ public static void PlayErmfishHurtSound(LiveMixin __instance, DamageInfo inDamag
if (!pickupable || !ErmfishLoader.ErmfishTechTypes.Contains(pickupable.GetTechType())) return;
ErmfishLoader.HurtSounds.Play(__instance.GetComponent<FMOD_CustomEmitter>());
}

[HarmonyPatch(typeof(KnownTech), nameof(KnownTech.Initialize))]
[HarmonyPostfix]
public static void FixErmfishAnalysisTech()
{
if (KnownTech.analysisTech is null) return;

KnownTech.AnalysisTech tech = KnownTech.analysisTech.FirstOrDefault(tech => tech.techType == ModItems.Ermfish);
if (tech is null) return;
tech.unlockMessage = KnownTechHandler.DefaultUnlockData.NewCreatureDiscoveredMessage;
tech.unlockSound = KnownTechHandler.DefaultUnlockData.NewCreatureDiscoveredSound;
}
}
2 changes: 1 addition & 1 deletion SCHIZO/Events/ErmCon/ErmConEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected override bool ShouldStartEvent()
// If a Queen Erm cannot be located or designated, the swarm becomes distressed, and seeks the nearest intelligent(?) being capable of designating the Queen for the swarm.
// It is not currently known whether Ermfish swarm behaviors change if deprived of their Queen for too long.
// Everyone who has so far been resourceful enough to survive on 4546B has displayed sufficient sensibility in choosing not to test that theory.
int ermsInRange = PhysicsHelpers.ObjectsInRange(CongregationTarget, SearchRadius)
int ermsInRange = PhysicsHelpers.ObjectsInRange(gameObject, SearchRadius)
.OfTechType(ErmfishLoader.ErmfishTechTypes)
.Count();
if (ermsInRange < MinAttendance)
Expand Down

0 comments on commit f07b2dc

Please sign in to comment.