Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of ChristmasTree v0.1.0
BepInEx/plugins/ChristmasTreeV81/ChristmasTreeMod.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using ChristmasTreeMod; using ChristmasTreeMod.NetcodePatcher; using GameNetcodeStuff; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ChristmasTreeMod")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.1.0.0")] [assembly: AssemblyInformationalVersion("0.1.0")] [assembly: AssemblyProduct("ChristmasTreeMod")] [assembly: AssemblyTitle("ChristmasTreeMod")] [assembly: AssemblyVersion("0.1.0.0")] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ChristmasTreeMod { [BepInPlugin("fbjb.christmastree.v81", "Christmas Tree V81", "0.1.0")] [BepInDependency("evaisa.lethallib", "1.2.0")] public sealed class Plugin : BaseUnityPlugin { public const string Guid = "fbjb.christmastree.v81"; public const string Version = "0.1.0"; private AssetBundle bundle; private void Awake() { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown try { Type[] types = typeof(Plugin).Assembly.GetTypes(); for (int i = 0; i < types.Length; i++) { MethodInfo[] methods = types[i].GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.IsDefined(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false)) { methodInfo.Invoke(null, null); } } } int value = ((BaseUnityPlugin)this).Config.Bind<int>("Spawning", "Weight", 30, new ConfigDescription("Indoor spawn weight on all supported moons; this is not a percentage. 0 disables natural spawning.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10000), Array.Empty<object>())).Value; bool value2 = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "VerboseLogs", false, "Log state changes and missed-attack growth. Restart to apply.").Value; string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "christmastreeassets"); bundle = AssetBundle.LoadFromFile(text); if ((Object)(object)bundle == (Object)null) { throw new InvalidOperationException("Cannot load AssetBundle: " + text); } EnemyType val = bundle.LoadAsset<EnemyType>("assets/圣诞树/v81/christmastreev81.asset"); if ((Object)(object)val == (Object)null || (Object)(object)val.enemyPrefab == (Object)null) { throw new InvalidOperationException("Bundle is missing EnemyType or enemyPrefab."); } ChristmasTreeAI component = val.enemyPrefab.GetComponent<ChristmasTreeAI>(); if ((Object)(object)component == (Object)null || ((object)component).GetType().Assembly != typeof(Plugin).Assembly) { throw new InvalidOperationException("Prefab script is not bound to ChristmasTreeMod.dll."); } if ((Object)(object)val.enemyPrefab.GetComponent<NetworkObject>() == (Object)null || !component.ValidateSetup()) { throw new InvalidOperationException("Enemy prefab validation failed."); } component.verboseLogs = value2; Utilities.FixMixerGroups(val.enemyPrefab); NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab); TerminalNode val2 = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val2).name = "ChristmasTreeInfo"; val2.creatureName = "ChristmasTree"; val2.clearPreviousText = true; val2.maxCharactersToType = 35; val2.displayText = "CHRISTMAS TREE\n\nA floating creature disguised as festive decoration. It fires two tentacles. Missed attacks become longer and faster until it catches someone. Break all four binding tentacles to free its victim.\n\n"; Enemies.RegisterEnemy(val, value, (LevelTypes)(-1), val2, (TerminalKeyword)null); ((BaseUnityPlugin)this).Logger.LogInfo((object)(string.Format("Registered ChristmasTree: DLL={0}, LethalLib=1.2.0+, weight={1}, ", "0.1.0", value) + $"length={component.tentacleLength}, speed={component.extensionSpeed}, hover={component.hoverHeight}, bundle={text}")); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("Christmas Tree registration failed: " + ex)); ((Behaviour)this).enabled = false; } } } [DisallowMultipleComponent] [RequireComponent(typeof(NetworkObject), typeof(NavMeshAgent))] public sealed class ChristmasTreeAI : EnemyAI { [Header("V81 / authored prefab references")] public Transform leftAttackOrigin; public Transform rightAttackOrigin; public ChristmasTreeTentacleVisual leftAttack; public ChristmasTreeTentacleVisual rightAttack; public ChristmasTreeTentacleHitbox[] restraints = new ChristmasTreeTentacleHitbox[4]; public AudioSource music; public AudioClip attackClip; public AudioClip restrainClip; public AudioClip breakClip; public ChristmasTreeIdleMotion[] idleMotion; [Header("悬浮 / Hover")] [Tooltip("距导航地面的悬浮高度(米)。模型、眼睛、发射点和身体判定一起升降;不改变导航根和开门检测。")] [Min(0f)] public float hoverHeight = 0.45f; [Tooltip("Prefab 内的 HoverRoot;不要指定 EnemyAI 根节点。")] public Transform hoverRoot; [Header("Playtest settings / use identical prefab on all peers")] [Min(0f)] public float patrolSpeed = 5f; [Min(0f)] public float chaseSpeed = 7.5f; [Min(1f)] public int awarenessRange = 16; [Range(1f, 180f)] public float viewHalfAngle = 60f; [Min(0.1f)] public float attackDistance = 4.5f; [Tooltip("基础触手长度;每轮双触手落空后临时 +1 米,抓住玩家后重置。")] [Min(0.1f)] public float tentacleLength = 11f; [Tooltip("基础伸出速度;每轮双触手落空后临时乘 1.1,抓住玩家后重置。")] [Min(0.1f)] public float extensionSpeed = 8f; [Min(0.1f)] public float retractionSpeed = 12f; [Min(0f)] public float windupSeconds = 0.35f; [Min(0.1f)] public float attackCooldown = 2f; [Min(1f)] public int damagePerSecond = 5; [Range(1f, 255f)] public int tentacleHealth = 2; [Min(1f)] public float dormantSeconds = 180f; public bool verboseLogs; private readonly NetworkVariable<ChristmasTreeSnapshot> snapshot = new NetworkVariable<ChristmasTreeSnapshot>(new ChristmasTreeSnapshot { VictimId = ulong.MaxValue }, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly AISearchRoutine patrol = new AISearchRoutine { searchWidth = 30f, randomized = true }; private readonly RaycastHit[] sweepHits = (RaycastHit[])(object)new RaycastHit[64]; private readonly Collider[] overlapHits = (Collider[])(object)new Collider[32]; private readonly float[] tipLengths = new float[2]; private readonly bool[] tipFinished = new bool[2]; private int attackCollisionMask; private readonly Dictionary<ulong, uint> receivedHitSequences = new Dictionary<ulong, uint>(); private PlayerControllerB[] visiblePlayers; private PlayerControllerB victim; private Vector3 lastSeenPosition; private Vector3 victimStartPosition; private double nextNearbyScan; private double nextAttackAt; private double nextDamageAt; private double lastSeenAt; private double nextPitchAt; private bool ready; private bool cancelling; private bool tearingDown; private bool claimedMove; private bool claimedHindrance; private uint outgoingHitSequence; private uint damageSequence; private uint lastDamageSequence; private uint lastDamageRevision; private ChristmasTreeState shownState = (ChristmasTreeState)255; private uint shownHealth; private uint locallyCancelledRevision = uint.MaxValue; private ChristmasTreeState State => (ChristmasTreeState)base.currentBehaviourStateIndex; private double Now { get { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((NetworkBehaviour)this).NetworkManager != (Object)null)) { return Time.timeAsDouble; } NetworkTime serverTime = ((NetworkBehaviour)this).NetworkManager.ServerTime; return ((NetworkTime)(ref serverTime)).Time; } } private bool Authority { get { if (ready && ((NetworkBehaviour)this).IsSpawned && ((NetworkBehaviour)this).IsServer && ((NetworkBehaviour)this).IsOwner) { return !base.isEnemyDead; } return false; } } public int ConsecutiveMisses => snapshot.Value.MissedAttacks; public float CurrentTentacleLength => snapshot.Value.EffectiveLength(tentacleLength); public float CurrentExtensionSpeed => snapshot.Value.EffectiveSpeed(extensionSpeed); private void ApplyHoverHeight() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)hoverRoot == (Object)null) && !((Object)(object)hoverRoot == (Object)(object)((Component)this).transform)) { Vector3 localPosition = hoverRoot.localPosition; localPosition.y = Mathf.Max(0f, hoverHeight); if (hoverRoot.localPosition != localPosition) { hoverRoot.localPosition = localPosition; } } } private void OnValidate() { ApplyHoverHeight(); } private static EnemyBehaviourState[] CreateStates() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown string[] names = Enum.GetNames(typeof(ChristmasTreeState)); EnemyBehaviourState[] array = (EnemyBehaviourState[])(object)new EnemyBehaviourState[names.Length]; for (int i = 0; i < names.Length; i++) { array[i] = new EnemyBehaviourState { name = names[i] }; } return array; } private void Reset() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown base.enemyBehaviourStates = CreateStates(); base.agent = ((Component)this).GetComponent<NavMeshAgent>(); base.currentSearch = new AISearchRoutine(); } public override void Awake() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown if ((Object)(object)RoundManager.Instance == (Object)null) { Debug.LogError((object)"[ChristmasTree] Run through the LC launch scene and spawn after hosting a round.", (Object)(object)this); ((Behaviour)this).enabled = false; } else { ((EnemyAI)this).Awake(); base.currentSearch = new AISearchRoutine(); } } public override void Start() { if (!((Behaviour)this).enabled) { return; } if (!ValidateSetup()) { ((Behaviour)this).enabled = false; return; } ApplyHoverHeight(); ((EnemyAI)this).Start(); attackCollisionMask = StartOfRound.Instance.collidersAndRoomMaskAndDefault | StartOfRound.Instance.playersMask; for (int i = 0; i < restraints.Length; i++) { restraints[i].Bind(this, i); } leftAttack.Hide(); rightAttack.Hide(); ready = true; ApplySnapshot(snapshot.Value); if (((NetworkBehaviour)this).IsServer) { nextNearbyScan = Now; ChangeState(ChristmasTreeState.Patrol); } if ((Object)(object)music != (Object)null && (Object)(object)music.clip != (Object)null) { music.Play(); } } [ContextMenu("V81/Validate references")] public bool ValidateSetup() { //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) bool flag = (Object)(object)base.enemyType != (Object)null && (Object)(object)base.eye != (Object)null && (Object)(object)base.creatureSFX != (Object)null && (Object)(object)((Component)this).GetComponent<NavMeshAgent>() != (Object)null && (Object)(object)leftAttackOrigin != (Object)null && (Object)(object)rightAttackOrigin != (Object)null && (Object)(object)leftAttack != (Object)null && (Object)(object)rightAttack != (Object)null && (Object)(object)leftAttack.visual != (Object)null && (Object)(object)rightAttack.visual != (Object)null && base.enemyBehaviourStates != null && base.enemyBehaviourStates.Length == 7 && restraints != null && restraints.Length == 4; if (flag) { for (int i = 0; i < 7; i++) { flag &= base.enemyBehaviourStates[i] != null; } HashSet<ChristmasTreeTentacleHitbox> hashSet = new HashSet<ChristmasTreeTentacleHitbox>(); ChristmasTreeTentacleHitbox[] array = restraints; foreach (ChristmasTreeTentacleHitbox christmasTreeTentacleHitbox in array) { flag &= (Object)(object)christmasTreeTentacleHitbox != (Object)null && hashSet.Add(christmasTreeTentacleHitbox) && (Object)(object)christmasTreeTentacleHitbox.segment != (Object)null && (Object)(object)((Component)christmasTreeTentacleHitbox.segment).transform == (Object)(object)((Component)christmasTreeTentacleHitbox).transform && (Object)(object)christmasTreeTentacleHitbox.segment.visual != (Object)null && ((Component)christmasTreeTentacleHitbox).gameObject.layer == 19; } flag &= ((Component)this).transform.lossyScale == Vector3.one; flag &= !base.enemyType.disableAnimatorWhenFar || (Object)(object)base.creatureAnimator != (Object)null; flag &= ((Component)this).GetComponentsInChildren<NetworkObject>(true).Length == 1; flag &= extensionSpeed > 0f && retractionSpeed > 0f && tentacleLength > 0f && windupSeconds >= 0f; flag &= (Object)(object)hoverRoot != (Object)null && (Object)(object)hoverRoot != (Object)(object)((Component)this).transform && hoverRoot.IsChildOf(((Component)this).transform); } if (!flag) { Debug.LogError((object)"[ChristmasTree] Invalid prefab: check EnemyType, Eye, SFX, seven states, two attack visuals, four distinct layer-19 hitboxes (segment on same object), root scale=1 and a single NetworkObject. See 编辑器测试说明.md.", (Object)(object)this); } else { Debug.Log((object)"[ChristmasTree] Prefab references validated (not a gameplay test).", (Object)(object)this); } return flag; } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); NetworkVariable<ChristmasTreeSnapshot> obj = snapshot; obj.OnValueChanged = (OnValueChangedDelegate<ChristmasTreeSnapshot>)(object)Delegate.Combine((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate<ChristmasTreeSnapshot>(OnSnapshotChanged)); if (ready) { ApplySnapshot(snapshot.Value); } } private void OnSnapshotChanged(ChristmasTreeSnapshot before, ChristmasTreeSnapshot after) { if (ready) { ApplySnapshot(after); } } private void ApplySnapshot(ChristmasTreeSnapshot data) { if (!((NetworkBehaviour)this).IsServer && base.currentBehaviourStateIndex != (int)data.State) { ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient((int)data.State); } PlayerControllerB val = ((data.State == ChristmasTreeState.Restrain && data.Revision != locallyCancelledRevision) ? FindPlayer(data.VictimId) : null); if ((Object)(object)victim != (Object)(object)val) { ReleaseLocalPlayer(); victim = val; if ((Object)(object)victim != (Object)null && ((Object)(object)victim.inAnimationWithEnemy == (Object)null || (Object)(object)victim.inAnimationWithEnemy == (Object)(object)this)) { victim.inAnimationWithEnemy = (EnemyAI)(object)this; base.inSpecialAnimationWithPlayer = victim; if (((NetworkBehaviour)victim).IsOwner) { claimedMove = !victim.disableMoveInput; victim.disableMoveInput = true; PlayerControllerB obj = victim; obj.isMovementHindered++; claimedHindrance = true; } } } if ((Object)(object)music != (Object)null) { music.pitch = ((data.Pitch > 0f) ? data.Pitch : 0.7f); } if (shownState != data.State) { shownState = data.State; if (data.State == ChristmasTreeState.Attack) { PlayEffect(attackClip); } if (data.State == ChristmasTreeState.Restrain) { PlayEffect(restrainClip); } if (idleMotion != null) { ChristmasTreeIdleMotion[] array = idleMotion; foreach (ChristmasTreeIdleMotion christmasTreeIdleMotion in array) { if ((Object)(object)christmasTreeIdleMotion != (Object)null) { christmasTreeIdleMotion.SetResting(data.State == ChristmasTreeState.Dormant || data.State == ChristmasTreeState.Stunned); } } } } if (shownHealth != data.TentacleHealth && data.State == ChristmasTreeState.Restrain) { if (shownHealth > data.TentacleHealth) { PlayEffect(breakClip); } shownHealth = data.TentacleHealth; } else { shownHealth = data.TentacleHealth; } } public override void Update() { ApplyHoverHeight(); if (!ready || !((NetworkBehaviour)this).IsSpawned) { return; } ((EnemyAI)this).Update(); if (!Authority) { return; } if (State != ChristmasTreeState.Dormant && (base.stunNormalizedTimer >= 0f || base.stunnedIndefinitely > 0)) { if (State != ChristmasTreeState.Stunned) { ChangeState(ChristmasTreeState.Stunned); } return; } if (State == ChristmasTreeState.Stunned) { nextAttackAt = Now + 3.0; ChangeState(ChristmasTreeState.Patrol); } if (State == ChristmasTreeState.Dormant && Now >= snapshot.Value.EndsAt) { ChangeState(ChristmasTreeState.Patrol); } if (State == ChristmasTreeState.Restrain) { TickRestraint(); } if (Now >= nextPitchAt) { nextPitchAt = Now + 5.0; ChristmasTreeSnapshot value = snapshot.Value; value.Pitch = ((State == ChristmasTreeState.Chase) ? Random.Range(0.9f, 1.05f) : ((State == ChristmasTreeState.Attack || State == ChristmasTreeState.Restrain) ? Random.Range(1.35f, 1.5f) : Random.Range(0.6f, 0.75f))); snapshot.Value = value; } } public override void DoAIInterval() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) if (!Authority) { return; } if (!base.ventAnimationFinished) { ((EnemyAI)this).DoAIInterval(); return; } if (State != ChristmasTreeState.Dormant && (base.stunNormalizedTimer >= 0f || base.stunnedIndefinitely > 0)) { if (State != ChristmasTreeState.Stunned) { ChangeState(ChristmasTreeState.Stunned); } ((EnemyAI)this).DoAIInterval(); return; } if (State == ChristmasTreeState.Patrol || State == ChristmasTreeState.Investigate || State == ChristmasTreeState.Chase) { PlayerControllerB val = FindVisiblePlayer(); if ((Object)(object)val != (Object)null) { lastSeenPosition = ((Component)val).transform.position; lastSeenAt = Now; base.targetPlayer = val; if (State != ChristmasTreeState.Chase) { ChangeState(ChristmasTreeState.Chase); } } if (State == ChristmasTreeState.Chase) { if ((Object)(object)val == (Object)null) { BeginInvestigation(lastSeenPosition); } else if (Now >= nextAttackAt && Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position) <= Mathf.Min(attackDistance, CurrentTentacleLength)) { BeginAttack(val); } else { ((EnemyAI)this).SetMovingTowardsTargetPlayer(val); } } else if (State == ChristmasTreeState.Investigate) { if (Now - lastSeenAt > 8.0 || (!base.agent.pathPending && base.agent.remainingDistance <= 0.8f)) { ChangeState(ChristmasTreeState.Patrol); } } else if (Now >= nextNearbyScan) { nextNearbyScan = Now + 0.25; PlayerControllerB val2 = FindNearbyPlayer(); if ((Object)(object)val2 != (Object)null) { BeginInvestigation(((Component)val2).transform.position); } } if (State == ChristmasTreeState.Patrol && !patrol.inProgress && base.allAINodes.Length != 0) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, patrol); } } ((EnemyAI)this).DoAIInterval(); } private PlayerControllerB FindVisiblePlayer() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; if (visiblePlayers == null || visiblePlayers.Length != allPlayerScripts.Length) { visiblePlayers = (PlayerControllerB[])(object)new PlayerControllerB[allPlayerScripts.Length]; } int allPlayersInLineOfSightNonAlloc = ((EnemyAI)this).GetAllPlayersInLineOfSightNonAlloc(visiblePlayers, viewHalfAngle, awarenessRange, (Transform)null, attackDistance + 0.5f, -1); PlayerControllerB result = null; float num = float.MaxValue; for (int i = 0; i < allPlayersInLineOfSightNonAlloc; i++) { PlayerControllerB val = visiblePlayers[i]; Vector3 val2 = ((Component)val).transform.position - ((Component)this).transform.position; float num2 = ((Vector3)(ref val2)).sqrMagnitude; if ((Object)(object)val == (Object)(object)base.targetPlayer) { num2 *= 0.8f; } if (num2 < num) { result = val; num = num2; } } return result; } private PlayerControllerB FindNearbyPlayer() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB result = null; float num = awarenessRange * awarenessRange; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!((Object)(object)val == (Object)null) && ((EnemyAI)this).PlayerIsTargetable(val, false, false, true)) { Vector3 val2 = ((Component)val).transform.position - ((Component)this).transform.position; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude < num) { result = val; num = sqrMagnitude; } } } return result; } private void BeginInvestigation(Vector3 position) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) ChangeState(ChristmasTreeState.Investigate); lastSeenAt = Now; lastSeenPosition = position; if (!((EnemyAI)this).SetDestinationToPosition(position, true)) { ChangeState(ChristmasTreeState.Patrol); } } public override void DetectNoise(Vector3 position, float loudness, int timesPlayedInOneSpot = 0, int noiseID = 0) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (Authority && base.ventAnimationFinished && State == ChristmasTreeState.Patrol && !(loudness < 0.25f) && !(Vector3.Distance(((Component)this).transform.position, position) > (float)awarenessRange)) { BeginInvestigation(position); } } private void ChangeState(ChristmasTreeState next) { if (Authority) { ((EnemyAI)this).StopSearch(base.currentSearch, false); base.movingTowardsTargetPlayer = false; base.moveTowardsDestination = next == ChristmasTreeState.Chase; NavMeshAgent agent = base.agent; float speed; switch (next) { default: speed = 0f; break; case ChristmasTreeState.Patrol: case ChristmasTreeState.Investigate: speed = patrolSpeed; break; case ChristmasTreeState.Chase: speed = chaseSpeed; break; } agent.speed = speed; if (((Behaviour)base.agent).enabled && base.agent.isOnNavMesh) { base.agent.ResetPath(); } if (State == ChristmasTreeState.Restrain && next != ChristmasTreeState.Restrain) { ReleaseLocalPlayer(); } ((EnemyAI)this).SwitchToBehaviourState((int)next); ChristmasTreeSnapshot value = snapshot.Value; value.State = next; value.Revision++; value.StartedAt = Now; value.EndsAt = ((next == ChristmasTreeState.Dormant) ? (Now + (double)dormantSeconds) : 0.0); value.VictimId = ulong.MaxValue; value.TentacleHealth = 0u; value.LeftStopLength = (value.RightStopLength = -1f); value.LeftReturnAt = (value.RightReturnAt = 0.0); float pitch; switch (next) { default: pitch = 0.7f; break; case ChristmasTreeState.Attack: case ChristmasTreeState.Restrain: pitch = 1.4f; break; case ChristmasTreeState.Chase: pitch = 1f; break; } value.Pitch = pitch; snapshot.Value = value; if (verboseLogs) { Debug.Log((object)$"[ChristmasTree {((NetworkBehaviour)this).NetworkObjectId}] t={Now:F3} {next}, revision {value.Revision}", (Object)(object)this); } } } private void BeginAttack(PlayerControllerB player) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) ChangeState(ChristmasTreeState.Attack); Vector3 val = ((Component)player).transform.position - ((Component)this).transform.position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude > 0.001f) { ((Component)this).transform.rotation = Quaternion.LookRotation(val); } ChristmasTreeSnapshot value = snapshot.Value; value.LeftOrigin = leftAttackOrigin.position; value.RightOrigin = rightAttackOrigin.position; Vector3 val2 = ((Component)player).transform.position + Vector3.up * 1.1f; Vector3 val3 = val2 - value.LeftOrigin; value.LeftDirection = ((Vector3)(ref val3)).normalized; val3 = val2 - value.RightOrigin; value.RightDirection = ((Vector3)(ref val3)).normalized; value.AttackMaxLength = value.EffectiveLength(tentacleLength); value.AttackExtendSpeed = value.EffectiveSpeed(extensionSpeed); value.EndsAt = Now + (double)windupSeconds + (double)(value.AttackMaxLength / value.AttackExtendSpeed) + (double)(value.AttackMaxLength / retractionSpeed); snapshot.Value = value; for (int i = 0; i < 2; i++) { tipFinished[i] = false; tipLengths[i] = 0f; } } private void FixedUpdate() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) if (!Authority || State != ChristmasTreeState.Attack || base.stunNormalizedTimer >= 0f || base.stunnedIndefinitely > 0) { return; } ChristmasTreeSnapshot value = snapshot.Value; float num = Mathf.Clamp((float)(Now - value.StartedAt - (double)windupSeconds) * value.AttackExtendSpeed, 0f, value.AttackMaxLength); if (num <= 0f) { return; } for (int i = 0; i < 2; i++) { if (tipFinished[i]) { continue; } Vector3 origin = ((i == 0) ? value.LeftOrigin : value.RightOrigin); Vector3 direction = ((i == 0) ? value.LeftDirection : value.RightDirection); if (SweepTip(origin, direction, tipLengths[i], num, out var player, out var stoppedLength)) { tipFinished[i] = true; tipLengths[i] = stoppedLength; if ((Object)(object)player != (Object)null) { BindPlayer(player); return; } StartTentacleReturn(i, stoppedLength); } else { tipLengths[i] = num; } if (!tipFinished[i] && num >= value.AttackMaxLength) { tipFinished[i] = true; StartTentacleReturn(i, value.AttackMaxLength); } } ChristmasTreeSnapshot value2 = snapshot.Value; if (tipFinished[0] && tipFinished[1] && value2.AttackLength(left: true, Now, windupSeconds, retractionSpeed) <= 0.005f && value2.AttackLength(left: false, Now, windupSeconds, retractionSpeed) <= 0.005f) { value2.CompleteMissedAttack(); snapshot.Value = value2; if (verboseLogs) { Debug.Log((object)$"[ChristmasTree {((NetworkBehaviour)this).NetworkObjectId}] Miss #{value2.MissedAttacks}: next length={CurrentTentacleLength:F2}m, speed={CurrentExtensionSpeed:F2}m/s", (Object)(object)this); } nextAttackAt = Now + (double)attackCooldown; ChangeState(ChristmasTreeState.Patrol); } } private void StartTentacleReturn(int side, float length) { ChristmasTreeSnapshot value = snapshot.Value; if (side == 0) { value.LeftStopLength = length; value.LeftReturnAt = Now; } else { value.RightStopLength = length; value.RightReturnAt = Now; } snapshot.Value = value; } private bool SweepTip(Vector3 origin, Vector3 direction, float before, float after, out PlayerControllerB player, out float stoppedLength) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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) player = null; stoppedLength = after; int num = attackCollisionMask; Vector3 val = origin + direction * before; int num2 = Physics.OverlapSphereNonAlloc(val, 0.18f, overlapHits, num, (QueryTriggerInteraction)2); for (int i = 0; i < num2; i++) { if (ValidTipCollider(overlapHits[i], out var player2)) { stoppedLength = before; if ((Object)(object)player2 == (Object)null) { player = null; return true; } player = player2; } } if ((Object)(object)player != (Object)null) { return true; } int num3 = Physics.SphereCastNonAlloc(val, 0.18f, direction, sweepHits, Mathf.Max(0f, after - before), num, (QueryTriggerInteraction)2); float num4 = float.MaxValue; for (int j = 0; j < num3; j++) { if (!(((RaycastHit)(ref sweepHits[j])).distance >= num4) && ValidTipCollider(((RaycastHit)(ref sweepHits[j])).collider, out var player3)) { num4 = ((RaycastHit)(ref sweepHits[j])).distance; player = player3; stoppedLength = before + num4; } } return num4 != float.MaxValue; } private bool ValidTipCollider(Collider other, out PlayerControllerB player) { player = null; if ((Object)(object)other == (Object)null || ((Component)other).transform.IsChildOf(((Component)this).transform)) { return false; } PlayerControllerB componentInParent = ((Component)other).GetComponentInParent<PlayerControllerB>(); if ((Object)(object)componentInParent != (Object)null) { if ((Object)(object)((Component)other).gameObject != (Object)(object)((Component)componentInParent).gameObject || ((Component)other).gameObject.layer != 3) { return false; } if (!((EnemyAI)this).PlayerIsTargetable(componentInParent, false, false, true) || componentInParent.inSpecialInteractAnimation || componentInParent.isClimbingLadder) { return false; } player = componentInParent; return true; } return !other.isTrigger; } private void BindPlayer(PlayerControllerB player) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (((EnemyAI)this).PlayerIsTargetable(player, false, false, true)) { ChangeState(ChristmasTreeState.Restrain); victimStartPosition = ((Component)player).transform.position; nextDamageAt = Now + 1.0; damageSequence = 0u; receivedHitSequences.Clear(); ChristmasTreeSnapshot value = snapshot.Value; value.VictimId = player.playerClientId; value.MissedAttacks = 0; for (int i = 0; i < 4; i++) { value.SetHealth(i, tentacleHealth); } snapshot.Value = value; } } private void TickRestraint() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)victim == (Object)null || victim.isPlayerDead || !victim.isPlayerControlled || !victim.isInsideFactory || (Object)(object)victim.inAnimationWithEnemy != (Object)(object)this || Vector3.Distance(victimStartPosition, ((Component)victim).transform.position) > 15f) { nextAttackAt = Now + (double)attackCooldown; ChangeState(ChristmasTreeState.Patrol); } else if (Now >= nextDamageAt) { nextDamageAt = Now + 1.0; DamageVictimClientRpc(snapshot.Value.Revision, ++damageSequence, victim.playerClientId, damagePerSecond); } } [ClientRpc] private void DamageVictimClientRpc(uint revision, uint sequence, ulong playerId, int damage) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3212984185u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, revision); BytePacker.WriteValueBitPacked(val, sequence); BytePacker.WriteValueBitPacked(val, playerId); BytePacker.WriteValueBitPacked(val, damage); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3212984185u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = FindPlayer(playerId); if (!((Object)(object)val3 == (Object)null) && ((NetworkBehaviour)val3).IsOwner && !val3.isPlayerDead && !((Object)(object)val3.inAnimationWithEnemy != (Object)(object)this) && snapshot.Value.State == ChristmasTreeState.Restrain && snapshot.Value.Revision == revision && (lastDamageRevision != revision || sequence > lastDamageSequence)) { lastDamageRevision = revision; lastDamageSequence = sequence; val3.DamagePlayer(damage, true, true, (CauseOfDeath)6, 0, false, default(Vector3)); } } } public bool SubmitTentacleHit(int slot, int force, PlayerControllerB attacker, int hitID) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) if (!ready || !((NetworkBehaviour)this).IsSpawned || snapshot.Value.State != ChristmasTreeState.Restrain || slot < 0 || slot > 3 || snapshot.Value.Health(slot) <= 0) { return false; } HitTentacleServerRpc(snapshot.Value.Revision, slot, force, attacker.playerClientId, ++outgoingHitSequence, hitID); return true; } [ServerRpc(RequireOwnership = false)] private void HitTentacleServerRpc(uint revision, int slot, int force, ulong attackerId, uint sequence, int hitID, ServerRpcParams rpc = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(526229241u, rpc, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, revision); BytePacker.WriteValueBitPacked(val, slot); BytePacker.WriteValueBitPacked(val, force); BytePacker.WriteValueBitPacked(val, attackerId); BytePacker.WriteValueBitPacked(val, sequence); BytePacker.WriteValueBitPacked(val, hitID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 526229241u, rpc, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!Authority || State != ChristmasTreeState.Restrain || revision != snapshot.Value.Revision || slot < 0 || slot > 3 || force <= 0 || snapshot.Value.Health(slot) == 0) { return; } PlayerControllerB val2 = FindPlayer(attackerId); if ((Object)(object)val2 == (Object)null || ((NetworkBehaviour)val2).OwnerClientId != rpc.Receive.SenderClientId || val2.isPlayerDead || !val2.isPlayerControlled || (receivedHitSequences.TryGetValue(((NetworkBehaviour)val2).OwnerClientId, out var value) && sequence <= value)) { return; } Vector3 position = ((Component)val2.gameplayCamera).transform.position; Vector3 position2 = ((Component)restraints[slot]).transform.position; if (!(Vector3.Distance(position, position2) > 16f) && !Physics.Linecast(position, position2, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { receivedHitSequences[((NetworkBehaviour)val2).OwnerClientId] = sequence; ChristmasTreeSnapshot value2 = snapshot.Value; value2.SetHealth(slot, value2.Health(slot) - force); snapshot.Value = value2; if (value2.TentacleHealth == 0) { ChangeState(ChristmasTreeState.Dormant); } } } public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 1f, PlayerControllerB setStunnedByPlayer = null) { ((EnemyAI)this).SetEnemyStunned(setToStunned, setToStunTime, setStunnedByPlayer); if (Authority && State != ChristmasTreeState.Dormant && State != ChristmasTreeState.Stunned && base.stunNormalizedTimer >= 0f) { ChangeState(ChristmasTreeState.Stunned); } } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (Authority && base.enemyType.canDie && !base.isEnemyDead && force > 0) { base.enemyHP -= force; if (base.enemyHP <= 0) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); } } } public override void OnCollideWithPlayer(Collider other) { } public override void CancelSpecialAnimationWithPlayer() { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) if (cancelling) { return; } cancelling = true; PlayerControllerB val = victim; locallyCancelledRevision = snapshot.Value.Revision; ReleaseLocalPlayer(); if (!tearingDown && ((NetworkBehaviour)this).IsSpawned && ready && snapshot.Value.State == ChristmasTreeState.Restrain) { if (((NetworkBehaviour)this).IsServer) { nextAttackAt = Now + (double)attackCooldown; ChangeState(ChristmasTreeState.Patrol); } else if ((Object)(object)val != (Object)null && ((NetworkBehaviour)val).IsOwner) { CancelRestraintServerRpc(snapshot.Value.Revision); } } ((EnemyAI)this).CancelSpecialAnimationWithPlayer(); cancelling = false; } [ServerRpc(RequireOwnership = false)] private void CancelRestraintServerRpc(uint revision, ServerRpcParams rpc = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2081340769u, rpc, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, revision); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2081340769u, rpc, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (Authority && State == ChristmasTreeState.Restrain && revision == snapshot.Value.Revision && !((Object)(object)victim == (Object)null) && ((NetworkBehaviour)victim).OwnerClientId == rpc.Receive.SenderClientId) { nextAttackAt = Now + (double)attackCooldown; ChangeState(ChristmasTreeState.Patrol); } } } private void ReleaseLocalPlayer() { if ((Object)(object)victim != (Object)null) { bool flag = (Object)(object)victim.inAnimationWithEnemy == (Object)(object)this; if (((NetworkBehaviour)victim).IsOwner) { if (claimedMove && (flag || (Object)(object)victim.inAnimationWithEnemy == (Object)null)) { victim.disableMoveInput = false; } if (claimedHindrance) { victim.isMovementHindered = Mathf.Max(0, victim.isMovementHindered - 1); } } if (flag) { victim.inAnimationWithEnemy = null; } } claimedMove = (claimedHindrance = false); victim = null; base.inSpecialAnimationWithPlayer = null; } private void LateUpdate() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) if (!ready || !((NetworkBehaviour)this).IsSpawned) { return; } ChristmasTreeSnapshot value = snapshot.Value; if (value.State == ChristmasTreeState.Restrain && (Object)(object)victim == (Object)null && value.Revision != locallyCancelledRevision) { ApplySnapshot(value); } if (value.State == ChristmasTreeState.Attack) { float num = value.AttackLength(left: true, Now, windupSeconds, retractionSpeed); float num2 = value.AttackLength(left: false, Now, windupSeconds, retractionSpeed); leftAttack.ShowSegment(value.LeftOrigin, value.LeftOrigin + value.LeftDirection * num); rightAttack.ShowSegment(value.RightOrigin, value.RightOrigin + value.RightDirection * num2); } else { leftAttack.Hide(); rightAttack.Hide(); } for (int i = 0; i < 4; i++) { if (value.State != ChristmasTreeState.Restrain || (Object)(object)victim == (Object)null || value.Health(i) == 0) { restraints[i].SetVisible(visible: false); continue; } float num3 = 45f + (float)i * 90f; Vector3 val = Quaternion.Euler(0f, num3, 0f) * Vector3.forward * 0.65f; Vector3 val2 = ((Component)victim).transform.position + val + Vector3.up * 0.45f; restraints[i].Place(val2, val2 + Vector3.up * 1.1f); } } private static PlayerControllerB FindPlayer(ulong id) { if (id == ulong.MaxValue || (Object)(object)StartOfRound.Instance == (Object)null) { return null; } PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if ((Object)(object)val != (Object)null && val.playerClientId == id) { return val; } } return null; } private void PlayEffect(AudioClip clip) { if (!((Object)(object)clip == (Object)null) && !((Object)(object)base.creatureSFX == (Object)null)) { base.creatureSFX.PlayOneShot(clip); if ((Object)(object)StartOfRound.Instance != (Object)null) { WalkieTalkie.TransmitOneShotAudio(base.creatureSFX, clip, 1f); } } } public override void OnNetworkDespawn() { tearingDown = true; NetworkVariable<ChristmasTreeSnapshot> obj = snapshot; obj.OnValueChanged = (OnValueChangedDelegate<ChristmasTreeSnapshot>)(object)Delegate.Remove((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate<ChristmasTreeSnapshot>(OnSnapshotChanged)); ReleaseLocalPlayer(); if (ready) { leftAttack.Hide(); rightAttack.Hide(); ChristmasTreeTentacleHitbox[] array = restraints; for (int i = 0; i < array.Length; i++) { array[i].SetVisible(visible: false); } ((EnemyAI)this).StopSearch(base.currentSearch, true); } if ((Object)(object)music != (Object)null) { music.Stop(); } ((NetworkBehaviour)this).OnNetworkDespawn(); } public override void OnDestroy() { tearingDown = true; ReleaseLocalPlayer(); NetworkVariable<ChristmasTreeSnapshot> obj = snapshot; obj.OnValueChanged = (OnValueChangedDelegate<ChristmasTreeSnapshot>)(object)Delegate.Remove((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate<ChristmasTreeSnapshot>(OnSnapshotChanged)); if ((Object)(object)RoundManager.Instance != (Object)null) { ((EnemyAI)this).OnDestroy(); } } protected override void __initializeVariables() { if (snapshot == null) { throw new Exception("ChristmasTreeAI.snapshot cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)snapshot).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)snapshot, "snapshot"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)snapshot); ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3212984185u, new RpcReceiveHandler(__rpc_handler_3212984185), "DamageVictimClientRpc"); ((NetworkBehaviour)this).__registerRpc(526229241u, new RpcReceiveHandler(__rpc_handler_526229241), "HitTentacleServerRpc"); ((NetworkBehaviour)this).__registerRpc(2081340769u, new RpcReceiveHandler(__rpc_handler_2081340769), "CancelRestraintServerRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3212984185(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { uint revision = default(uint); ByteUnpacker.ReadValueBitPacked(reader, ref revision); uint sequence = default(uint); ByteUnpacker.ReadValueBitPacked(reader, ref sequence); ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); int damage = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref damage); target.__rpc_exec_stage = (__RpcExecStage)1; ((ChristmasTreeAI)(object)target).DamageVictimClientRpc(revision, sequence, playerId, damage); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_526229241(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { uint revision = default(uint); ByteUnpacker.ReadValueBitPacked(reader, ref revision); int slot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slot); int force = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref force); ulong attackerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref attackerId); uint sequence = default(uint); ByteUnpacker.ReadValueBitPacked(reader, ref sequence); int hitID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitID); ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((ChristmasTreeAI)(object)target).HitTentacleServerRpc(revision, slot, force, attackerId, sequence, hitID, server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2081340769(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { uint revision = default(uint); ByteUnpacker.ReadValueBitPacked(reader, ref revision); ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((ChristmasTreeAI)(object)target).CancelRestraintServerRpc(revision, server); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ChristmasTreeAI"; } } [DisallowMultipleComponent] public sealed class ChristmasTreeIdleMotion : MonoBehaviour { [Tooltip("Explicit visual bone/eye references. Never put the EnemyAI root here.")] public Transform[] joints; public Vector3 axis = Vector3.forward; [Range(0f, 45f)] public float amplitude = 12f; [Min(0f)] public float frequency = 0.8f; public float phaseStep = 0.7f; public float phaseOffset; private Quaternion[] rotations; private bool resting; private void Awake() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (joints == null) { joints = (Transform[])(object)new Transform[0]; } rotations = (Quaternion[])(object)new Quaternion[joints.Length]; for (int i = 0; i < joints.Length; i++) { if ((Object)(object)joints[i] != (Object)null) { rotations[i] = joints[i].localRotation; } } } public void SetResting(bool value) { resting = value; } private void LateUpdate() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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) for (int i = 0; i < joints.Length; i++) { if (!((Object)(object)joints[i] == (Object)null)) { float num = (resting ? 0f : (Mathf.Sin(Time.time * frequency * MathF.PI * 2f - (float)i * phaseStep + phaseOffset) * amplitude)); joints[i].localRotation = rotations[i] * Quaternion.AngleAxis(num, axis); } } } } public enum ChristmasTreeState : byte { Patrol, Investigate, Chase, Attack, Restrain, Dormant, Stunned } public struct ChristmasTreeSnapshot : INetworkSerializable, IEquatable<ChristmasTreeSnapshot> { public ChristmasTreeState State; public uint Revision; public ulong VictimId; public uint TentacleHealth; public double StartedAt; public double EndsAt; public float Pitch; public int MissedAttacks; public float AttackMaxLength; public float AttackExtendSpeed; public float LeftStopLength; public float RightStopLength; public double LeftReturnAt; public double RightReturnAt; public Vector3 LeftOrigin; public Vector3 RightOrigin; public Vector3 LeftDirection; public Vector3 RightDirection; public int Health(int slot) { return (int)((TentacleHealth >> slot * 8) & 0xFF); } public float EffectiveLength(float baseLength) { return baseLength + (float)MissedAttacks; } public float EffectiveSpeed(float baseSpeed) { return baseSpeed * Mathf.Pow(1.1f, (float)MissedAttacks); } public void CompleteMissedAttack() { if (State == ChristmasTreeState.Attack) { MissedAttacks++; } } public void SetHealth(int slot, int value) { int num = slot * 8; TentacleHealth = (TentacleHealth & (uint)(~(255 << num))) | (uint)(Mathf.Clamp(value, 0, 255) << num); } public unsafe void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) ((BufferSerializer<ChristmasTreeState>*)(&serializer))->SerializeValue<ChristmasTreeState>(ref State, default(ForEnums)); ((BufferSerializer<uint>*)(&serializer))->SerializeValue<uint>(ref Revision, default(ForPrimitives)); ((BufferSerializer<ulong>*)(&serializer))->SerializeValue<ulong>(ref VictimId, default(ForPrimitives)); ((BufferSerializer<uint>*)(&serializer))->SerializeValue<uint>(ref TentacleHealth, default(ForPrimitives)); ((BufferSerializer<double>*)(&serializer))->SerializeValue<double>(ref StartedAt, default(ForPrimitives)); ((BufferSerializer<double>*)(&serializer))->SerializeValue<double>(ref EndsAt, default(ForPrimitives)); ((BufferSerializer<float>*)(&serializer))->SerializeValue<float>(ref Pitch, default(ForPrimitives)); ((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref MissedAttacks, default(ForPrimitives)); ((BufferSerializer<float>*)(&serializer))->SerializeValue<float>(ref AttackMaxLength, default(ForPrimitives)); ((BufferSerializer<float>*)(&serializer))->SerializeValue<float>(ref AttackExtendSpeed, default(ForPrimitives)); ((BufferSerializer<float>*)(&serializer))->SerializeValue<float>(ref LeftStopLength, default(ForPrimitives)); ((BufferSerializer<float>*)(&serializer))->SerializeValue<float>(ref RightStopLength, default(ForPrimitives)); ((BufferSerializer<double>*)(&serializer))->SerializeValue<double>(ref LeftReturnAt, default(ForPrimitives)); ((BufferSerializer<double>*)(&serializer))->SerializeValue<double>(ref RightReturnAt, default(ForPrimitives)); serializer.SerializeValue(ref LeftOrigin); serializer.SerializeValue(ref RightOrigin); serializer.SerializeValue(ref LeftDirection); serializer.SerializeValue(ref RightDirection); } public bool Equals(ChristmasTreeSnapshot other) { //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) if (State == other.State && Revision == other.Revision && VictimId == other.VictimId && TentacleHealth == other.TentacleHealth && StartedAt.Equals(other.StartedAt) && EndsAt.Equals(other.EndsAt) && Pitch.Equals(other.Pitch) && MissedAttacks == other.MissedAttacks && AttackMaxLength.Equals(other.AttackMaxLength) && AttackExtendSpeed.Equals(other.AttackExtendSpeed) && LeftStopLength.Equals(other.LeftStopLength) && RightStopLength.Equals(other.RightStopLength) && LeftReturnAt.Equals(other.LeftReturnAt) && RightReturnAt.Equals(other.RightReturnAt) && ((Vector3)(ref LeftOrigin)).Equals(other.LeftOrigin) && ((Vector3)(ref RightOrigin)).Equals(other.RightOrigin) && ((Vector3)(ref LeftDirection)).Equals(other.LeftDirection)) { return ((Vector3)(ref RightDirection)).Equals(other.RightDirection); } return false; } public float AttackLength(bool left, double now, float windup, float returnSpeed) { float num = (left ? LeftStopLength : RightStopLength); if (num >= 0f) { return Mathf.Max(0f, num - (float)Math.Max(0.0, now - (left ? LeftReturnAt : RightReturnAt)) * returnSpeed); } return Mathf.Clamp((float)(now - StartedAt - (double)windup) * AttackExtendSpeed, 0f, AttackMaxLength); } } [DisallowMultipleComponent] [RequireComponent(typeof(CapsuleCollider))] public sealed class ChristmasTreeTentacleHitbox : EnemyAICollisionDetect, IHittable { [Range(0f, 3f)] public int slot; public ChristmasTreeTentacleVisual segment; [Min(0.01f)] public float hitRadius = 0.36f; private ChristmasTreeAI tree; private CapsuleCollider hitCollider; private int submittedFrame = -1; public void Bind(ChristmasTreeAI owner, int index) { tree = owner; base.mainScript = (EnemyAI)(object)owner; slot = index; hitCollider = ((Component)this).GetComponent<CapsuleCollider>(); ((Collider)hitCollider).isTrigger = true; hitCollider.direction = 2; hitCollider.radius = hitRadius; base.canCollideWithEnemies = false; base.alwaysAllowHitting = true; SetVisible(visible: false); } public void Place(Vector3 start, Vector3 end) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)hitCollider == (Object)null) && !((Object)(object)segment == (Object)null)) { segment.ShowSegment(start, end); float num = Vector3.Distance(start, end); hitCollider.height = Mathf.Max(hitRadius * 2f, num); hitCollider.center = new Vector3(0f, 0f, num * 0.5f); ((Collider)hitCollider).enabled = true; } } public void SetVisible(bool visible) { if ((Object)(object)hitCollider != (Object)null) { ((Collider)hitCollider).enabled = visible; } if (!visible && (Object)(object)segment != (Object)null) { segment.Hide(); } } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { if ((Object)(object)tree == (Object)null || (Object)(object)hitCollider == (Object)null || !((Collider)hitCollider).enabled || force <= 0 || (Object)(object)playerWhoHit == (Object)null || !((NetworkBehaviour)playerWhoHit).IsOwner) { return false; } if (submittedFrame == Time.frameCount) { return false; } submittedFrame = Time.frameCount; return tree.SubmitTentacleHit(slot, force, playerWhoHit, hitID); } } [DisallowMultipleComponent] public sealed class ChristmasTreeTentacleVisual : MonoBehaviour { [Tooltip("Mesh/bones child; authored from local z=0 toward +Z. Never assign the tree root.")] public Transform visual; [Min(0.01f)] public float modelLength = 1f; [Tooltip("Ordered root-to-tip bones. Visual motion only; the attack tip remains on the server's cast line.")] public Transform[] waveBones; [Min(0f)] public float waveAmplitude = 0.1f; [Min(0f)] public float waveFrequency = 5f; public float wavePhase; private Vector3[] bonePositions; private Vector3 authoredScale; private bool initialized; private void Initialize() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if (initialized || (Object)(object)visual == (Object)null) { return; } authoredScale = visual.localScale; if (waveBones != null) { bonePositions = (Vector3[])(object)new Vector3[waveBones.Length]; for (int i = 0; i < waveBones.Length; i++) { if ((Object)(object)waveBones[i] != (Object)null) { bonePositions[i] = ((Component)this).transform.InverseTransformPoint(waveBones[i].position); } } } initialized = true; } public void ShowSegment(Vector3 start, Vector3 end) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) Initialize(); if (initialized) { Vector3 val = end - start; float magnitude = ((Vector3)(ref val)).magnitude; ((Component)visual).gameObject.SetActive(magnitude > 0.005f); if (!(magnitude <= 0.005f)) { ((Component)this).transform.SetPositionAndRotation(start, Quaternion.LookRotation(val / magnitude)); Vector3 localScale = authoredScale; localScale.z *= magnitude / modelLength; visual.localScale = localScale; ApplyWave(magnitude); } } } private void ApplyWave(float length) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) if (bonePositions == null || waveBones.Length < 2) { return; } float num = Time.time * waveFrequency * MathF.PI * 2f + wavePhase; for (int i = 0; i < waveBones.Length; i++) { if (!((Object)(object)waveBones[i] == (Object)null)) { float num2 = (float)i / (float)(waveBones.Length - 1); Vector3 val = bonePositions[i]; val.z *= length / modelLength; float num3 = Mathf.Sin(num2 * MathF.PI) * Mathf.Min(1f, length); val.x += Mathf.Sin(num - num2 * MathF.PI * 4f) * waveAmplitude * num3; val.y += Mathf.Cos(num - num2 * MathF.PI * 4f) * waveAmplitude * 0.5f * num3; waveBones[i].position = ((Component)this).transform.TransformPoint(val); } } } public void Hide() { if ((Object)(object)visual != (Object)null) { ((Component)visual).gameObject.SetActive(false); } } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedINetworkSerializable<ChristmasTreeSnapshot>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<ChristmasTreeSnapshot>(); } } } namespace ChristmasTreeMod.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }