SDM_LethalCompany_Mod/ScarletMansion/ScarletMansion/GamePatch/EnemyVentPatch.cs
LadyAliceMargatroid 523e7ed898 Added BrachTileBoost system
Added the new coilhead behaviour to the knight
Added treasure room puzzle for bedroom
Changed many LogInfo into LogDebug
Removed jank animator override stuff (no offense)
Changed how treasure rooms lock their doors to work in multiplayer
Removed basement scripts
2024-08-19 02:44:15 -07:00

48 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using HarmonyLib;
namespace ScarletMansion.GamePatch {
[HarmonyPatch(typeof(EnemyVent))]
public class EnemyVentPatch {
/*
[HarmonyPostfix]
[HarmonyPatch("BeginVentSFX")]
public static void BeginVentSFXPatch(ref EnemyVent __instance){
var comp = __instance.GetComponent<ScarletVent>();
if (comp) {
comp.BeginVentSFX();
}
}
*/
public static bool setActive = false;
[HarmonyPrefix]
[HarmonyPatch("OpenVentClientRpc")]
public static void OpenVentClientRpcPatchPre(ref EnemyVent __instance){
setActive = true;
}
[HarmonyPostfix]
[HarmonyPatch("OpenVentClientRpc")]
public static void OpenVentClientRpcPatchPost(ref EnemyVent __instance){
if (setActive == false) return;
var comp = __instance.GetComponent<ScarletVent>();
if (comp) {
Plugin.logger.LogDebug("Doing scalet open vent");
comp.OpenVentClientRpc();
}
setActive = false;
}
}
}