using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CamVisuals;
using Dissonance;
using GameNetcodeStuff;
using HarmonyLib;
using JigglePhysics;
using Microsoft.CodeAnalysis;
using ModelReplacement;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("sylvunny modelswap")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("sylvunny modelswap")]
[assembly: AssemblyTitle("sylvunny modelswap")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
}
namespace CamVisuals
{
[BepInPlugin("MRCameraVisualsSylvunny", "Sylvunny", "1.3.1")]
public class CameraVisuals : BaseUnityPlugin
{
private readonly Harmony harmony = new Harmony("CameraVisualsSylvunny");
private static GameObject gameObject;
private static CameraVisuals Instance;
public static Vector3 baseSize;
public static ManualLogSource mls;
private static bool usingCameraVisuals;
private static bool terminalDisable;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
mls = ((BaseUnityPlugin)this).Logger;
harmony.PatchAll(typeof(CameraVisuals));
mls.LogInfo((object)"CAMERA HEIGHTS LOADED");
}
public static void DetectCamera(PlayerControllerB player)
{
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
gameObject = ((Component)player).gameObject;
Transform val = gameObject.transform.Find("ScavengerModel").Find("metarig").Find("CameraContainer");
if ((Object)(object)val != (Object)null)
{
GameObject val2 = ((Component)val).gameObject;
if (Object.op_Implicit((Object)(object)gameObject.GetComponent<MRSYLVUNNY>()) && !usingCameraVisuals)
{
Transform obj = gameObject.transform.Find("ScavengerModel").Find("metarig").Find("CameraContainer")
.Find("MainCamera")
.Find("HUDHelmetPosition");
obj.localPosition += new Vector3(0f, 0.005f, 0f);
gameObject.transform.localScale = new Vector3(1f, 1.185f, 1f);
usingCameraVisuals = true;
}
}
else
{
mls.LogInfo((object)"Child GameObject not found.");
}
}
public static void StopUsingModel()
{
usingCameraVisuals = false;
}
[HarmonyPatch(typeof(Terminal), "BeginUsingTerminal")]
[HarmonyPostfix]
public static void DetectCamera2()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
baseSize = ((Component)localPlayerController).gameObject.transform.localScale;
if (!terminalDisable && usingCameraVisuals)
{
Transform obj = gameObject.transform.Find("ScavengerModel").Find("metarig").Find("CameraContainer")
.Find("MainCamera");
obj.localPosition += new Vector3(0f, -0.31f, -0.018f);
terminalDisable = true;
}
}
[HarmonyPatch(typeof(Terminal), "QuitTerminal")]
[HarmonyPostfix]
public static void ResetCamera()
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
if (terminalDisable && usingCameraVisuals)
{
Transform obj = gameObject.transform.Find("ScavengerModel").Find("metarig").Find("CameraContainer")
.Find("MainCamera");
obj.localPosition -= new Vector3(0f, -0.31f, -0.018f);
terminalDisable = false;
}
}
}
}
namespace ModelReplacement
{
public class MRSYLVUNNY : BodyReplacementBase
{
private PlayerControllerB player;
private SkinnedMeshRenderer skinnedMeshRenderer;
private SkinnedMeshRenderer skinnedMeshRenderer2;
private static bool usingCameraVisuals;
private float time = 0f;
private string EyeShape1 = "LowerLidRaiserL";
private string EyeShape2 = "lowerBlinkL";
private string EyeShape3 = "EBAllLowerL";
private string EyeShape4 = "UpeerLidLowerL";
private string EyeShape5 = "EBInnerLowererL";
private string EyeShape6 = "EBOuterLowererL";
private string CheekShape = "CheekRaiser1L";
private string MouthShape1 = "UppeLipRaiser";
private string MouthShape2 = "SmirkL";
private string MouthShape3 = "CornerLowerL";
private string MouthShape4 = "LowerLipLower";
private string MouthShape5 = "MouthOpenL";
private string MouthShape6 = "StrecherL";
private string MouthShape7 = "bite1L";
private int eye1;
private int eye2;
private int eye3;
private int eye4;
private int eye5;
private int eye6;
private int cheek;
private int mouth1;
private int mouth2;
private int mouth3;
private int mouth4;
private int mouth5;
private int mouth6;
private int mouth7;
private string fitShapeName = "fit";
private string armShapeName = "ArmsMuscles";
private string breastShapeName1 = "Breastsize";
private string breastShapeName2 = "Breastflatten";
private string breastShapeName3 = "BreastSmall";
private string breastShapeName4 = "BreastsizeSUIT";
private string buttShapeName = "Buttsize";
private string hipsShapeName = "widehips";
private string legsShapeName = "Legsize";
private string bellyShapeName = "Pregnant";
private string waistShapeName = "waist1";
private string slimShapeName = "slim";
private string canonShapeName = "cannonSlim2";
private string fluffShapeName = "flufback";
private int fit;
private int arm;
private int breast1;
private int breast2;
private int breast3;
private int breast4;
private int butt;
private int hips;
private int legs;
private int belly;
private int waist;
private int slim;
private int canon;
private int fluff;
private float fitValue = Plugin.fitModifier.Value;
private float armValue = Plugin.armMuscleModifier.Value;
private float breastValue = Plugin.breastModifier.Value;
private float buttValue = Plugin.buttModifier.Value;
private float hipValue = Plugin.hipsModifier.Value;
private float legValue = Plugin.legsModifier.Value;
private float bellyValue = Plugin.bellyModifier.Value;
private float waistValue = Plugin.waistModifier.Value;
private float slimValue = Plugin.slimModifier.Value;
private float canonValue = Plugin.canonModifier.Value;
private float fluffValue = Plugin.fluffModifier.Value;
private SkinnedMeshRenderer[] Renderers;
private SkinnedMeshRenderer[] deadRenderers;
private SkinnedMeshRenderer[] viewModelRenderers;
private JiggleRigBuilder[] jiggleBones;
protected override GameObject LoadAssetsAndReturnModel()
{
string text = "sylvunny";
return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
}
protected override void Start()
{
((BodyReplacementBase)this).Start();
player = ((BodyReplacementBase)this).controller;
GameObject gameObject = ((Component)base.replacementModel.transform.Find("Bodys.dmx")).gameObject;
GameObject gameObject2 = ((Component)base.replacementModel.transform.Find("hand supportE")).gameObject;
if ((Object)(object)skinnedMeshRenderer == (Object)null)
{
skinnedMeshRenderer = gameObject.GetComponent<SkinnedMeshRenderer>();
}
if ((Object)(object)skinnedMeshRenderer2 == (Object)null)
{
skinnedMeshRenderer2 = gameObject2.GetComponent<SkinnedMeshRenderer>();
}
GameObject gameObject3 = ((Component)player).gameObject;
Transform val = gameObject3.transform.Find("ScavengerModel").Find("metarig").Find("CameraContainer");
if ((Object)(object)val != (Object)null)
{
GameObject gameObject4 = ((Component)val).gameObject;
if (!usingCameraVisuals)
{
usingCameraVisuals = true;
Task.Delay(50).ContinueWith(delegate
{
CameraVisuals.DetectCamera(player);
});
}
}
else
{
CameraVisuals.mls.LogInfo((object)"Child GameObject not found.");
}
Plugin.usingModel = true;
Plugin.stopBlink = false;
Plugin.stopMouth = false;
Renderers = base.replacementModel.GetComponentsInChildren<SkinnedMeshRenderer>();
jiggleBones = base.replacementModel.GetComponentsInChildren<JiggleRigBuilder>();
if (ModelReplacementAPI.EnforceViewModelGeneration.Value)
{
viewModelRenderers = base.replacementViewModel.GetComponentsInChildren<SkinnedMeshRenderer>();
}
fitValue = Mathf.Clamp(fitValue, 0f, 100f);
armValue = Mathf.Clamp(armValue, 0f, 100f);
breastValue = Mathf.Clamp(breastValue, -100f, 200f);
buttValue = Mathf.Clamp(buttValue, 0f, 100f);
hipValue = Mathf.Clamp(hipValue, 0f, 100f);
legValue = Mathf.Clamp(legValue, 0f, 100f);
bellyValue = Mathf.Clamp(bellyValue, 0f, 100f);
waistValue = Mathf.Clamp(waistValue, 0f, 100f);
slimValue = Mathf.Clamp(slimValue, 0f, 100f);
canonValue = Mathf.Clamp(canonValue, 0f, 100f);
fluffValue = Mathf.Clamp(fluffValue, 0f, 100f);
eye1 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(EyeShape1);
eye2 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(EyeShape2);
eye3 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(EyeShape3);
eye4 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(EyeShape4);
eye5 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(EyeShape5);
eye6 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(EyeShape6);
cheek = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(CheekShape);
mouth1 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(MouthShape1);
mouth2 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(MouthShape2);
mouth3 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(MouthShape3);
mouth4 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(MouthShape4);
mouth5 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(MouthShape5);
mouth6 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(MouthShape6);
mouth7 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(MouthShape7);
fit = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(fitShapeName);
arm = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(armShapeName);
breast1 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(breastShapeName1);
breast2 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(breastShapeName2);
breast3 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(breastShapeName3);
breast4 = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(breastShapeName4);
butt = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(buttShapeName);
hips = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(hipsShapeName);
legs = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(legsShapeName);
belly = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(bellyShapeName);
waist = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(waistShapeName);
slim = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(slimShapeName);
canon = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(canonShapeName);
fluff = skinnedMeshRenderer2.sharedMesh.GetBlendShapeIndex(fluffShapeName);
if (!Plugin.TMEPatch)
{
Renderers[0].SetBlendShapeWeight(eye1, 0f);
Renderers[0].SetBlendShapeWeight(eye2, 0f);
Renderers[0].SetBlendShapeWeight(eye3, 0f);
Renderers[0].SetBlendShapeWeight(eye4, 0f);
Renderers[0].SetBlendShapeWeight(eye5, 0f);
Renderers[0].SetBlendShapeWeight(eye6, 0f);
Renderers[0].SetBlendShapeWeight(cheek, 0f);
Renderers[0].SetBlendShapeWeight(mouth1, 0f);
Renderers[0].SetBlendShapeWeight(mouth2, 0f);
Renderers[0].SetBlendShapeWeight(mouth3, 0f);
Renderers[0].SetBlendShapeWeight(mouth4, 0f);
Renderers[0].SetBlendShapeWeight(mouth5, 0f);
Renderers[0].SetBlendShapeWeight(mouth6, 0f);
Renderers[0].SetBlendShapeWeight(mouth7, 0f);
}
Renderers[0].SetBlendShapeWeight(fit, fitValue);
Renderers[0].SetBlendShapeWeight(arm, armValue);
Renderers[0].SetBlendShapeWeight(butt, buttValue);
Renderers[0].SetBlendShapeWeight(hips, hipValue);
Renderers[0].SetBlendShapeWeight(legs, legValue);
Renderers[0].SetBlendShapeWeight(belly, bellyValue);
Renderers[0].SetBlendShapeWeight(waist, waistValue);
Renderers[0].SetBlendShapeWeight(slim, slimValue);
Renderers[0].SetBlendShapeWeight(canon, canonValue);
Renderers[2].SetBlendShapeWeight(fluff, fluffValue);
if (ModelReplacementAPI.EnforceViewModelGeneration.Value)
{
viewModelRenderers[2].SetBlendShapeWeight(fluff, fluffValue);
}
if (breastValue >= 0f)
{
float num = Mathf.Clamp(breastValue, 0f, 100f);
Renderers[0].SetBlendShapeWeight(breast1, num);
if (breastValue > 100f)
{
Renderers[0].SetBlendShapeWeight(breast4, breastValue - 100f);
}
}
else if (breastValue < 0f)
{
Renderers[0].SetBlendShapeWeight(breast2, 0f - breastValue);
Renderers[0].SetBlendShapeWeight(breast3, 0f - breastValue * 0.4f);
if (breastValue <= -70f)
{
((Behaviour)jiggleBones[7]).enabled = false;
((Behaviour)jiggleBones[8]).enabled = false;
}
else
{
((Behaviour)jiggleBones[7]).enabled = true;
((Behaviour)jiggleBones[8]).enabled = true;
}
}
if (breastValue <= 100f)
{
Renderers[0].SetBlendShapeWeight(breast4, 0f);
}
if (Plugin.fluffEnable.Value)
{
((Renderer)Renderers[2]).enabled = true;
if (ModelReplacementAPI.EnforceViewModelGeneration.Value)
{
((Renderer)viewModelRenderers[2]).enabled = true;
}
}
else if (!Plugin.fluffEnable.Value)
{
((Renderer)Renderers[2]).enabled = false;
if (ModelReplacementAPI.EnforceViewModelGeneration.Value)
{
((Renderer)viewModelRenderers[2]).enabled = false;
}
}
if (Plugin.EmoteAudio.Value)
{
AudioClip randomAudio = Assets.SSpawn.GetRandomAudio(StartOfRound.Instance.randomMapSeed);
((BodyReplacementBase)this).controller.movementAudio.PlayOneShot(randomAudio, 0.4f);
}
}
protected override void OnDamageTaken(bool dead)
{
((BodyReplacementBase)this).OnDamageTaken(dead);
if (!Plugin.TMEPatch)
{
Plugin.stopMouth = true;
Plugin.stopBlink = true;
((MonoBehaviour)this).StartCoroutine(Hurt());
}
if (Plugin.EmoteAudio.Value)
{
AudioClip randomAudio = Assets.SHurt.GetRandomAudio(StartOfRound.Instance.randomMapSeed);
((BodyReplacementBase)this).controller.movementAudio.PlayOneShot(randomAudio, 0.9f);
}
}
protected override void OnDeath()
{
((BodyReplacementBase)this).OnDeath();
Plugin.stopMouth = true;
Plugin.stopBlink = true;
deadRenderers = base.replacementDeadBody.GetComponentsInChildren<SkinnedMeshRenderer>();
if (!Plugin.TMEPatch)
{
deadRenderers[0].SetBlendShapeWeight(eye2, 100f);
deadRenderers[0].SetBlendShapeWeight(eye3, 100f);
deadRenderers[0].SetBlendShapeWeight(mouth3, 70f);
deadRenderers[0].SetBlendShapeWeight(mouth5, 35f);
deadRenderers[0].SetBlendShapeWeight(eye1, 0f);
deadRenderers[0].SetBlendShapeWeight(eye4, 0f);
deadRenderers[0].SetBlendShapeWeight(eye5, 0f);
deadRenderers[0].SetBlendShapeWeight(eye6, 0f);
deadRenderers[0].SetBlendShapeWeight(cheek, 0f);
deadRenderers[0].SetBlendShapeWeight(mouth1, 0f);
deadRenderers[0].SetBlendShapeWeight(mouth2, 0f);
deadRenderers[0].SetBlendShapeWeight(mouth4, 0f);
deadRenderers[0].SetBlendShapeWeight(mouth6, 0f);
deadRenderers[0].SetBlendShapeWeight(mouth7, 0f);
}
if ((Object)(object)base.replacementDeadBody.GetComponent<AudioSource>() == (Object)null)
{
base.replacementDeadBody.AddComponent<AudioSource>();
}
if (Plugin.EmoteAudio.Value)
{
AudioClip randomAudio = Assets.SDie.GetRandomAudio(StartOfRound.Instance.randomMapSeed);
AudioSource component = base.replacementDeadBody.GetComponent<AudioSource>();
component.PlayOneShot(randomAudio, 0.5f);
}
deadRenderers[0].SetBlendShapeWeight(fit, fitValue);
deadRenderers[0].SetBlendShapeWeight(arm, armValue);
deadRenderers[0].SetBlendShapeWeight(butt, buttValue);
deadRenderers[0].SetBlendShapeWeight(hips, hipValue);
deadRenderers[0].SetBlendShapeWeight(legs, legValue);
deadRenderers[0].SetBlendShapeWeight(belly, bellyValue);
deadRenderers[0].SetBlendShapeWeight(waist, waistValue);
deadRenderers[0].SetBlendShapeWeight(slim, slimValue);
deadRenderers[0].SetBlendShapeWeight(canon, canonValue);
if (breastValue >= 0f)
{
float num = Mathf.Clamp(breastValue, 0f, 100f);
deadRenderers[0].SetBlendShapeWeight(breast1, num);
if (breastValue > 100f)
{
deadRenderers[0].SetBlendShapeWeight(breast4, breastValue - 100f);
}
}
else if (breastValue < 0f)
{
deadRenderers[0].SetBlendShapeWeight(breast2, 0f - breastValue);
deadRenderers[0].SetBlendShapeWeight(breast3, 0f - breastValue * 0.4f);
}
if (breastValue <= 100f)
{
deadRenderers[0].SetBlendShapeWeight(breast4, 0f);
}
if (Plugin.fluffEnable.Value)
{
((Renderer)deadRenderers[2]).enabled = true;
}
else if (!Plugin.fluffEnable.Value)
{
((Renderer)deadRenderers[2]).enabled = false;
}
}
protected override void AddModelScripts()
{
((BodyReplacementBase)this).AddModelScripts();
GameObject gameObject = ((Component)base.replacementModel.transform.Find("Bodys.dmx")).gameObject;
Blinking blinking = gameObject.AddComponent(typeof(Blinking)) as Blinking;
blinking.player = ((BodyReplacementBase)this).controller;
JawSync jawSync = gameObject.AddComponent(typeof(JawSync)) as JawSync;
jawSync.player = ((BodyReplacementBase)this).controller;
jawSync.init();
}
protected override void OnEmoteStart(int emoteId)
{
((BodyReplacementBase)this).OnEmoteStart(emoteId);
switch (emoteId)
{
case 1:
if (!Plugin.TMEPatch)
{
Plugin.stopMouth = true;
Plugin.stopBlink = true;
Renderers[0].SetBlendShapeWeight(eye1, 100f);
Renderers[0].SetBlendShapeWeight(cheek, 60f);
Renderers[0].SetBlendShapeWeight(mouth1, 60f);
Renderers[0].SetBlendShapeWeight(mouth2, 70f);
Renderers[0].SetBlendShapeWeight(mouth4, 40f);
Renderers[0].SetBlendShapeWeight(eye3, 0f);
Renderers[0].SetBlendShapeWeight(eye4, 0f);
Renderers[0].SetBlendShapeWeight(eye5, 0f);
Renderers[0].SetBlendShapeWeight(mouth5, 0f);
if (Plugin.EmoteAudio.Value)
{
AudioClip randomAudio2 = Assets.SDance.GetRandomAudio(StartOfRound.Instance.randomMapSeed);
((BodyReplacementBase)this).controller.movementAudio.PlayOneShot(randomAudio2, 0.5f);
}
}
break;
case 2:
if (!Plugin.TMEPatch)
{
Plugin.stopMouth = true;
Plugin.stopBlink = true;
Renderers[0].SetBlendShapeWeight(eye3, 100f);
Renderers[0].SetBlendShapeWeight(eye4, 40f);
Renderers[0].SetBlendShapeWeight(eye5, 100f);
Renderers[0].SetBlendShapeWeight(mouth1, 50f);
Renderers[0].SetBlendShapeWeight(mouth5, 70f);
Renderers[0].SetBlendShapeWeight(eye1, 0f);
Renderers[0].SetBlendShapeWeight(cheek, 0f);
Renderers[0].SetBlendShapeWeight(mouth2, 0f);
Renderers[0].SetBlendShapeWeight(mouth4, 0f);
if (Plugin.EmoteAudio.Value)
{
AudioClip randomAudio = Assets.SPoint.GetRandomAudio(StartOfRound.Instance.randomMapSeed);
((BodyReplacementBase)this).controller.movementAudio.PlayOneShot(randomAudio, 0.5f);
}
}
break;
}
}
protected override void OnEmoteEnd()
{
((BodyReplacementBase)this).OnEmoteEnd();
if (!Plugin.TMEPatch)
{
Renderers[0].SetBlendShapeWeight(eye1, 0f);
Renderers[0].SetBlendShapeWeight(eye3, 0f);
Renderers[0].SetBlendShapeWeight(eye4, 0f);
Renderers[0].SetBlendShapeWeight(eye5, 0f);
Renderers[0].SetBlendShapeWeight(cheek, 0f);
Renderers[0].SetBlendShapeWeight(mouth1, 0f);
Renderers[0].SetBlendShapeWeight(mouth2, 0f);
Renderers[0].SetBlendShapeWeight(mouth4, 0f);
Renderers[0].SetBlendShapeWeight(mouth5, 0f);
Plugin.stopMouth = false;
Plugin.stopBlink = false;
}
}
protected override void OnDestroy()
{
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
GameObject gameObject = ((Component)player).gameObject;
if (usingCameraVisuals)
{
Plugin.usingModel = false;
CameraVisuals.StopUsingModel();
gameObject.transform.Find("ScavengerModel").Find("metarig").Find("CameraContainer")
.Find("MainCamera")
.Find("HUDHelmetPosition")
.localPosition = new Vector3(0.01f, -0.048f, -0.063f);
gameObject.transform.localScale = new Vector3(1f, 1f, 1f);
usingCameraVisuals = false;
}
((BodyReplacementBase)this).OnDestroy();
}
private IEnumerator Hurt()
{
Renderers[0].SetBlendShapeWeight(eye1, 100f);
Renderers[0].SetBlendShapeWeight(eye3, 100f);
Renderers[0].SetBlendShapeWeight(eye4, 40f);
Renderers[0].SetBlendShapeWeight(eye6, 100f);
Renderers[0].SetBlendShapeWeight(mouth1, 60f);
Renderers[0].SetBlendShapeWeight(mouth3, 20f);
Renderers[0].SetBlendShapeWeight(mouth6, 30f);
Renderers[0].SetBlendShapeWeight(mouth7, 60f);
Renderers[0].SetBlendShapeWeight(cheek, 60f);
yield return (object)new WaitForSeconds(0.4f);
Renderers[0].SetBlendShapeWeight(eye1, 0f);
Renderers[0].SetBlendShapeWeight(eye3, 0f);
Renderers[0].SetBlendShapeWeight(eye4, 0f);
Renderers[0].SetBlendShapeWeight(eye6, 0f);
Renderers[0].SetBlendShapeWeight(mouth1, 0f);
Renderers[0].SetBlendShapeWeight(mouth3, 0f);
Renderers[0].SetBlendShapeWeight(mouth6, 0f);
Renderers[0].SetBlendShapeWeight(mouth7, 0f);
Renderers[0].SetBlendShapeWeight(cheek, 0f);
Plugin.stopMouth = false;
Plugin.stopBlink = false;
yield return null;
}
}
public class Blinking : MonoBehaviour
{
public PlayerControllerB player;
private SkinnedMeshRenderer skinnedMeshRenderer;
private string blendShapeName = "Blink1L";
private float minBlinkInterval = 5f;
private float maxBlinkInterval = 8f;
private float blinkSpeed = 1100f;
private float nextBlinkTime;
private bool isBlinking = false;
private float blinkWeight = 0f;
private void Start()
{
if ((Object)(object)skinnedMeshRenderer == (Object)null)
{
skinnedMeshRenderer = ((Component)this).GetComponent<SkinnedMeshRenderer>();
}
skinnedMeshRenderer.SetBlendShapeWeight(skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(blendShapeName), 0f);
nextBlinkTime = Time.time + Random.Range(minBlinkInterval, maxBlinkInterval);
}
private void Update()
{
if (!player.isPlayerDead && Time.time >= nextBlinkTime && !isBlinking)
{
((MonoBehaviour)this).StartCoroutine(DoBlink());
}
}
private IEnumerator DoBlink()
{
isBlinking = true;
while (blinkWeight < 100f && !Plugin.stopBlink)
{
blinkWeight += blinkSpeed * Time.deltaTime;
blinkWeight = Mathf.Clamp(blinkWeight, 0f, 100f);
skinnedMeshRenderer.SetBlendShapeWeight(skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(blendShapeName), blinkWeight);
yield return null;
}
yield return (object)new WaitForSeconds(0.04f);
while (blinkWeight > 0f && !Plugin.stopBlink)
{
blinkWeight -= blinkSpeed * Time.deltaTime;
blinkWeight = Mathf.Clamp(blinkWeight, 0f, 100f);
skinnedMeshRenderer.SetBlendShapeWeight(skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(blendShapeName), blinkWeight);
yield return null;
}
isBlinking = false;
nextBlinkTime = Time.time + Random.Range(minBlinkInterval, maxBlinkInterval);
}
}
public class JawSync : MonoBehaviour
{
public PlayerControllerB player;
private float maxOpen1 = 49f;
private float maxOpen2 = 64f;
private float maxOpen3 = 68f;
private SkinnedMeshRenderer skinnedMeshRenderer;
private float sensibility = 100f * Plugin.voiceSensitivity.Value;
protected VoicePlayerState voice;
private string blendShapeName1 = "StrecherL";
private string blendShapeName2 = "SmirkL";
private string blendShapeName3 = "MouthOpenL";
public void Start()
{
if ((Object)(object)skinnedMeshRenderer == (Object)null)
{
skinnedMeshRenderer = ((Component)this).GetComponent<SkinnedMeshRenderer>();
}
}
private void Update()
{
if ((Object)(object)StartOfRound.Instance.voiceChatModule == (Object)null)
{
return;
}
if (voice == null)
{
init();
}
if (voice != null && !Plugin.stopMouth)
{
float num = 0f;
float num2 = 0f;
float num3 = 0f;
if (voice.IsSpeaking)
{
num = (player.isPlayerDead ? 0f : Mathf.Clamp(voice.Amplitude * sensibility, 0f, maxOpen1));
num2 = (player.isPlayerDead ? 0f : Mathf.Clamp(voice.Amplitude * sensibility, 0f, maxOpen2));
num3 = (player.isPlayerDead ? 0f : Mathf.Clamp(voice.Amplitude * sensibility, 0f, maxOpen3));
}
skinnedMeshRenderer.SetBlendShapeWeight(skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(blendShapeName1), num);
skinnedMeshRenderer.SetBlendShapeWeight(skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(blendShapeName2), num2);
skinnedMeshRenderer.SetBlendShapeWeight(skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(blendShapeName3), num3);
}
}
public void init()
{
StartOfRound.Instance.RefreshPlayerVoicePlaybackObjects();
voice = player.voicePlayerState;
if (voice == null && (Object)(object)player == (Object)(object)StartOfRound.Instance.localPlayerController)
{
voice = StartOfRound.Instance.voiceChatModule.FindPlayer(StartOfRound.Instance.voiceChatModule.LocalPlayerName);
}
}
}
[BepInPlugin("com.wintermantis.sylvunny", "SylvunnyModel", "1.3.1")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
public static bool TMEPatch;
public static bool usingModel;
public static bool stopBlink;
public static bool stopMouth;
public static ConfigFile config;
public static ConfigEntry<float> voiceSensitivity { get; private set; }
public static ConfigEntry<string> suitNamesToEnableModel { get; private set; }
public static ConfigEntry<bool> enableResetter { get; private set; }
public static ConfigEntry<bool> EmoteAudio { get; private set; }
public static ConfigEntry<float> fitModifier { get; private set; }
public static ConfigEntry<float> armMuscleModifier { get; private set; }
public static ConfigEntry<float> breastModifier { get; private set; }
public static ConfigEntry<float> buttModifier { get; private set; }
public static ConfigEntry<float> hipsModifier { get; private set; }
public static ConfigEntry<float> legsModifier { get; private set; }
public static ConfigEntry<float> bellyModifier { get; private set; }
public static ConfigEntry<float> fluffModifier { get; private set; }
public static ConfigEntry<float> waistModifier { get; private set; }
public static ConfigEntry<float> slimModifier { get; private set; }
public static ConfigEntry<float> canonModifier { get; private set; }
public static ConfigEntry<bool> fluffEnable { get; private set; }
private static void InitConfig()
{
voiceSensitivity = config.Bind<float>("Voice Sensitivity", "Sensitivity Value", 10f, "Sensitivity of Sylvunny's Jaw. Number from 5 to 20");
suitNamesToEnableModel = config.Bind<string>("Suits to Replace Settings", "Suits to enable Model for", "Sylvunny", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
enableResetter = config.Bind<bool>("Misc", "Enable Resetter on every suit", true, "Enable the Camera Visual Resetter for every other suit. You should probably only use this if you are not resetting correctly.");
EmoteAudio = config.Bind<bool>("Misc", "Enable emote audio clips", true, "Plays audio when performing vanilla emotes or when taking damage. Will only work on emotes if the TME Patch is disabled.");
fitModifier = config.Bind<float>("Body", "Fitness Modifier", 0f, "Modifier of Sylvunny's fitness. Number from 0 to 100.");
armMuscleModifier = config.Bind<float>("Body", "Arm Muscle Modifier", 0f, "Modifier of Sylvunny's muscles. Number from 0 to 100.");
breastModifier = config.Bind<float>("Body", "Breast Modifier", 0f, "Modifier of Sylvunny's breast size. Number from -100 to 200.");
buttModifier = config.Bind<float>("Body", "Butt Modifier", 0f, "Modifier of Sylvunny's butt size. Number from 0 to 100.");
hipsModifier = config.Bind<float>("Body", "Hips Modifier", 0f, "Modifier of Sylvunny's hip size. Number from 0 to 100.");
legsModifier = config.Bind<float>("Body", "Legs Modifier", 0f, "Modifier of Sylvunny's leg size. Number from 0 to 100.");
bellyModifier = config.Bind<float>("Body", "Belly Modifier", 0f, "Modifier of Sylvunny's belly size. Number from 0 to 100.");
waistModifier = config.Bind<float>("Body", "Waist Modifier", 0f, "Modifier of Sylvunny's waist size. Number from 0 to 100.");
slimModifier = config.Bind<float>("Body", "Slim Modifier", 0f, "Modifier of Sylvunny's slimness. Number from 0 to 100.");
canonModifier = config.Bind<float>("Body", "Canon Slim Modifier", 0f, "Modifier to make Sylvunny more accurate to original Lopunny. Number from 0 to 100. Recommended that every other torso blendshape is set to 0 while using this.");
fluffModifier = config.Bind<float>("Body", "Wrist Fluff Modifier", 0f, "Modifier of Sylvunny's wrist fluff. Number from 0 to 100.");
fluffEnable = config.Bind<bool>("Body", "Wrist Fluff Enabler", true, "Enable Sylvunny's wrist fluff.");
}
private void Awake()
{
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Expected O, but got Unknown
config = ((BaseUnityPlugin)this).Config;
InitConfig();
Assets.PopulateAssets();
string[] array = suitNamesToEnableModel.Value.Split(',');
string[] array2 = array;
string[] array3 = array2;
foreach (string text in array3)
{
ModelReplacementAPI.RegisterSuitModelReplacement(text, typeof(MRSYLVUNNY));
}
if (ModelReplacementAPI.tooManyEmotesPresent)
{
TMEPatch = true;
((BaseUnityPlugin)this).Logger.LogWarning((object)"TooManyEmotes was found, automatically applying compatibility patch.");
}
else
{
((BaseUnityPlugin)this).Logger.LogWarning((object)"TooManyEmotes not found, disabling compatibility patch.");
TMEPatch = false;
}
Harmony val = new Harmony("com.wintermantis.sylvunny");
val.PatchAll();
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin com.wintermantis.sylvunny is loaded!");
}
}
public static class Assets
{
public class RandomAudioClip
{
private List<AudioClip> clipList = new List<AudioClip>();
public AudioClip GetRandomAudio(int seed)
{
Random random = new Random();
int num = random.Next(clipList.Count);
Console.WriteLine($"Get audio N {clipList.Count} > {num}");
return clipList[num];
}
public void AddAudio(string name)
{
AudioClip audioClipFromName = GetAudioClipFromName(name);
if ((Object)(object)audioClipFromName != (Object)null)
{
clipList.Add(audioClipFromName);
}
else
{
Console.WriteLine("clip " + name + " null");
}
}
}
public static string mainAssetBundleName = "sylvunnybundle";
public static AssetBundle MainAssetBundle = null;
public static RandomAudioClip SSpawn = new RandomAudioClip();
public static RandomAudioClip SDance = new RandomAudioClip();
public static RandomAudioClip SPoint = new RandomAudioClip();
public static RandomAudioClip SHurt = new RandomAudioClip();
public static RandomAudioClip SDie = new RandomAudioClip();
private static string GetAssemblyName()
{
return Assembly.GetExecutingAssembly().GetName().Name.Replace(" ", "_");
}
public static void PopulateAssets()
{
if ((Object)(object)MainAssetBundle == (Object)null)
{
Console.WriteLine(GetAssemblyName() + "." + mainAssetBundleName);
using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetAssemblyName() + "." + mainAssetBundleName);
MainAssetBundle = AssetBundle.LoadFromStream(stream);
}
SSpawn.AddAudio("Sylveon");
SDance.AddAudio("Sylveon_Happy");
SPoint.AddAudio("Sylveon_Angry");
SPoint.AddAudio("Sylveon_Noise2");
SHurt.AddAudio("sylv2");
SDie.AddAudio("Sylveon_Hurt");
}
public static AudioClip GetAudioClipFromName(string name)
{
Object obj = MainAssetBundle.LoadAsset(name);
return (AudioClip)(object)((obj is AudioClip) ? obj : null);
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}