-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
33 lines (26 loc) · 913 Bytes
/
Plugin.cs
File metadata and controls
33 lines (26 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using BepInEx;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
namespace SpitterChicken;
[BepInPlugin("mathmoth.spitterchicken", "SpitterChicken", "1.0.0")]
public class Plugin : BasePlugin
{
public override void Load()
{
Harmony.CreateAndPatchAll(typeof(InfectionSpitterPatch), "mathmoth");
Log.LogInfo("SpitterChicken by Mathmoth is loaded!");
}
}
internal static class InfectionSpitterPatch
{
[HarmonyPatch(typeof(InfectionSpitter), "TryPlaySound")]
[HarmonyPrefix]
public static bool Prefix(ref uint id, bool dontPlayTooOften, float dontPlayTooOftenDelay, ref bool __result, object __instance) {
//3124402583 corresponds to the soundId of INFECTION_SPITTER_SPIT
if (id == 3124402583) {
//1256202815 corresponds to the soundId of the chicken spitter in the soundbank
id = 1256202815;
}
return true;
}
}