49 lines
1.1 KiB
C#
49 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.LogInfo("Doing scalet open vent");
|
|
comp.OpenVentClientRpc();
|
|
}
|
|
|
|
setActive = false;
|
|
}
|
|
|
|
}
|
|
}
|