internal static bool Prefix(LaserCutter __instance) { if (__instance.fxControl != null && !__instance.fxIsPlaying) { float repeatRate = Stats.LaserCutterData.RandomizeIntensityRepeatRate; #if Subnautica int i = Player.main.IsUnderwater() ? 1 : 0; __instance.fxControl.Play(i); __instance.fxIsPlaying = true; __instance.fxLight.enabled = true; __instance.InvokeRepeating("RandomizeIntensity", 0f, repeatRate); __instance.totalTimeActive = 0f; #elif BelowZero int i = Player.main.IsUnderwater() ? 1 : 0; if (MiscSettings.flashes) { __instance.fxControl.Play(i); __instance.fxLight.enabled = true; } __instance.fxControl.Play(3); __instance.fxIsPlaying = true; __instance.InvokeRepeating("RandomizeIntensity", 0f, repeatRate); __instance.totalTimeActive = 0f; #endif } return(false); }
public static bool Prefix(LaserCutter __instance) { if (__instance.fxControl != null) { __instance.fxLight.enabled = false; __instance.laserCutSound.Play(); __instance.fxControl.Stop(); // todo: Remove initial sparks from "start Animation" } return(false); }
internal static void PostFix(LaserCutter __instance) { if (Guard.IsGamePaused()) { return; } float min = Stats.LaserCutterData.MinRandomIntensity; float max = Stats.LaserCutterData.MaxRandomIntensity; __instance.lightIntensity = UnityEngine.Random.Range(min, max); }
// Token: 0x06000025 RID: 37 RVA: 0x00002EEC File Offset: 0x000010EC public static bool Prefix(LaserCutter __instance) { SkinnedMeshRenderer[] allComponentsInChildren = __instance.GetAllComponentsInChildren <SkinnedMeshRenderer>(); SkinnedMeshRenderer[] allComponentsInChildren2 = __instance.GetAllComponentsInChildren <SkinnedMeshRenderer>(); foreach (SkinnedMeshRenderer skinnedMeshRenderer in allComponentsInChildren) { bool flag = skinnedMeshRenderer.name.Contains("Laser_cutter_geo"); if (flag) { skinnedMeshRenderer.material.color = new Color32(Convert.ToByte(MainPatch.config.laservalue), Convert.ToByte(MainPatch.config.lasergvalue), Convert.ToByte(MainPatch.config.laserbvalue), 1); } } return(true); }
/// <summary> /// Returns the max random intensity. /// </summary> /// <param name="laserCutter"></param> /// <returns></returns> public static float GetMaxRandomIntensity(this LaserCutter laserCutter) => MaxRandomIntensity;
/// <summary> /// Sets the light bar color. /// </summary> /// <param name="laserCutter"></param> /// <param name="newColor"></param> public static void SetLightbarColor(this LaserCutter laserCutter, Color newColor) => laserCutter.lightbarColor = newColor;
/// <summary> /// Returns the light bar color. /// </summary> /// <param name="laserCutter"></param> /// <returns></returns> public static Color GetLightbarColor(this LaserCutter laserCutter) => laserCutter.lightbarColor;
/// <summary> /// Reduces the light intensity. /// </summary> /// <param name="laserCutter"></param> /// <param name="amount">Amount to reduce by.</param> public static void ReduceLightIntensity(this LaserCutter laserCutter, float amount) => laserCutter.lightIntensity -= amount;
/// <summary> /// Gets the light intensity. /// </summary> /// <param name="laserCutter"></param> /// <returns></returns> public static float GetLightIntensity(this LaserCutter laserCutter) => laserCutter.lightIntensity;
/// <summary> /// Sets the current cutting target. /// </summary> /// <param name="laserCutter"></param> /// <param name="newTarget"></param> public static void SetActiveCuttingTarget(this LaserCutter laserCutter, Sealed newTarget) => laserCutter.activeCuttingTarget = newTarget;
/// <summary> /// Gets the current cutting target. /// </summary> /// <param name="laserCutter"></param> /// <returns></returns> public static Sealed GetActiveCuttingTarget(this LaserCutter laserCutter) => laserCutter.activeCuttingTarget;
/// <summary> /// Reduces the amount of health removed per weld. /// </summary> /// <param name="laserCutter"></param> /// <param name="amount">Amount to reduce by.</param> public static void ReduceHealthPerWeld(this LaserCutter laserCutter, float amount) => laserCutter.healthPerWeld -= amount;
/// <summary> /// Returns the amount of health removed per weld. /// </summary> /// <param name="laserCutter"></param> /// <returns></returns> public static float GetHealthPerWeld(this LaserCutter laserCutter) => laserCutter.healthPerWeld;
/// <summary> /// Returns whether or not Laser Cutter Effects are playing. /// </summary> /// <param name="laserCutter"></param> /// <returns></returns> public static bool IsFxPlaying(this LaserCutter laserCutter) => laserCutter.fxIsPlaying;
/// <summary> /// Reduces the minimum random intensity. /// </summary> /// <param name="laserCutter"></param> /// <param name="amount">Amount to reduce by.</param> public static void ReduceMinRandomIntensity(this LaserCutter laserCutter, float amount) => MinRandomIntensity -= amount;
/// <summary> /// Raises the max random intensity. /// </summary> /// <param name="laserCutter"></param> /// <param name="amount">Amount to raise by.</param> public static void RaiseMaxRandomIntensity(this LaserCutter laserCutter, float amount) => MaxRandomIntensity += amount;