using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CommonAPI;
using CommonAPI.Phone;
using CrewBoomAPI;
using DG.Tweening;
using Microsoft.CodeAnalysis;
using Reptile;
using SlopCrew.API;
using SlopCrew.Server.XmasEvent;
using TMPro;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.UI;
using Winterland.Common;
using Winterland.Common.Challenge;
using Winterland.Common.Phone;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("Winterland.Common")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Common code for Millenium Winterland.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d57e729790290875d5daaef4022962c64d26f632")]
[assembly: AssemblyProduct("Winterland.Common")]
[assembly: AssemblyTitle("Winterland.Common")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.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;
}
}
}
internal class EffectSpawner : MonoBehaviour
{
public GameObject prefab;
public string prefabAssetBundle;
public string prefabAssetPath;
public float playbackSpeed = 1f;
public bool spawnParentedToMe = true;
private bool spawnNextFrame;
private void Awake()
{
if ((Object)(object)prefab == (Object)null)
{
prefab = Core.Instance.Assets.LoadAssetFromBundle<GameObject>(prefabAssetBundle, prefabAssetPath);
}
}
private void OnEnable()
{
TreeController componentInParent = ((Component)this).GetComponentInParent<TreeController>();
if ((Object)(object)componentInParent == (Object)null || !componentInParent.IsFastForwarding)
{
spawnNextFrame = true;
}
}
private void OnDisable()
{
spawnNextFrame = false;
}
private void FixedUpdate()
{
if (spawnNextFrame)
{
spawnNextFrame = false;
SpawnEffect();
}
}
private void SpawnEffect()
{
//IL_0034: 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_0060: Unknown result type (might be due to invalid IL or missing references)
GameObject val;
if (spawnParentedToMe)
{
val = Object.Instantiate<GameObject>(prefab, ((Component)this).transform);
}
else
{
val = Object.Instantiate<GameObject>(prefab);
val.transform.position = ((Component)this).transform.position;
val.transform.rotation = ((Component)this).transform.rotation;
val.transform.localScale = ((Component)this).transform.localScale;
}
Animation anim = val.GetComponent<OneOffVisualEffect>().anim;
anim[((Object)anim.clip).name].speed = playbackSpeed;
}
}
internal class SetAnimatorParameters : MonoBehaviour
{
[SerializeField]
private Animator animator;
[SerializeField]
private List<string> boolsToSet = new List<string>();
private void OnValidate()
{
if ((Object)(object)animator == (Object)null)
{
animator = ((Component)this).GetComponent<Animator>();
}
}
private void Awake()
{
setParams();
}
private void OnEnable()
{
setParams();
}
private void setParams()
{
foreach (string item in boolsToSet)
{
animator.SetBoolString(item, true);
}
}
}
internal class GiftConveyorBelt : MonoBehaviour
{
public GameObject GiftLogicPrefab;
public float spawnMinInterval = 0.5f;
public float spawnMaxInterval = 0.75f;
public float spawnMinYRot = -45f;
public float spawnMaxYRot = 45f;
public float spawnMinScale = 0.7f;
public float spawnMaxScale = 1.3f;
private Coroutine animCoro;
public Transform waypointParent;
public Transform[] waypoints;
public float movementSpeed;
public Transform giftVisualsPrefabParent;
public Transform[] giftVisualsPrefabs;
private float[] timeBetweenWaypoints;
public float[] TimeBetweenWaypoints => timeBetweenWaypoints;
private void OnValidate()
{
waypoints = TransformExtentions.GetAllChildren(waypointParent);
giftVisualsPrefabs = TransformExtentions.GetAllChildren(giftVisualsPrefabParent);
}
private void Awake()
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
timeBetweenWaypoints = new float[waypoints.Length - 1];
for (int i = 0; i < waypoints.Length - 1; i++)
{
timeBetweenWaypoints[i] = Vector3.Distance(waypoints[i].position, waypoints[i + 1].position) / movementSpeed;
}
Transform[] array = waypoints;
for (int j = 0; j < array.Length; j++)
{
Object.Destroy((Object)(object)array[j].GetChild(0));
}
GiftLogicPrefab.SetActive(false);
((Component)waypointParent).gameObject.SetActive(false);
((Component)giftVisualsPrefabParent).gameObject.SetActive(false);
}
private void OnEnable()
{
animCoro = ((MonoBehaviour)this).StartCoroutine(Animation());
}
private void OnDisable()
{
if (animCoro != null)
{
((MonoBehaviour)this).StopCoroutine(animCoro);
animCoro = null;
}
}
private IEnumerator Animation()
{
while (true)
{
yield return (object)new WaitForSeconds(Random.Range(spawnMinInterval, spawnMaxInterval));
GameObject obj = Object.Instantiate<GameObject>(GiftLogicPrefab);
GiftConveyorBeltGift component = obj.GetComponent<GiftConveyorBeltGift>();
obj.SetActive(true);
component.Init(this, ((Component)giftVisualsPrefabs[Random.Range(0, giftVisualsPrefabs.Length)]).gameObject, Random.Range(spawnMinYRot, spawnMaxYRot), new Vector3(Random.Range(spawnMinScale, spawnMaxScale), Random.Range(spawnMinScale, spawnMaxScale), Random.Range(spawnMinScale, spawnMaxScale)));
}
}
}
internal class GiftConveyorBeltGift : MonoBehaviour
{
public Transform GiftParent;
public float simulatePhysicsXSecondsAfterLastWaypoint;
private GiftConveyorBelt belt;
private uint lastWaypointIndex;
private float timeSinceLastWaypoint;
private bool finishedWaypoints;
public void Init(GiftConveyorBelt belt, GameObject giftPrefab, float yRot, Vector3 scale)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: 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_004e: Unknown result type (might be due to invalid IL or missing references)
this.belt = belt;
Object.Instantiate<GameObject>(giftPrefab, GiftParent).SetActive(true);
Vector3 localEulerAngles = ((Component)GiftParent).transform.localEulerAngles;
localEulerAngles.y = yRot;
((Component)GiftParent).transform.localEulerAngles = localEulerAngles;
((Component)GiftParent).transform.localScale = scale;
}
private void Update()
{
if (!finishedWaypoints)
{
moveAlongWaypoints();
}
}
private void moveAlongWaypoints()
{
//IL_00ad: 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_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
timeSinceLastWaypoint += Time.deltaTime;
while (timeSinceLastWaypoint > belt.TimeBetweenWaypoints[lastWaypointIndex])
{
timeSinceLastWaypoint -= belt.TimeBetweenWaypoints[lastWaypointIndex];
lastWaypointIndex++;
if (lastWaypointIndex >= belt.waypoints.Length - 1)
{
finishWaypoints();
return;
}
}
float num = timeSinceLastWaypoint / belt.TimeBetweenWaypoints[lastWaypointIndex];
((Component)this).transform.position = Vector3.Lerp(belt.waypoints[lastWaypointIndex].position, belt.waypoints[lastWaypointIndex + 1].position, num);
((Component)this).transform.rotation = Quaternion.Lerp(belt.waypoints[lastWaypointIndex].rotation, belt.waypoints[lastWaypointIndex + 1].rotation, num);
}
private void finishWaypoints()
{
//IL_0048: 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_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
finishedWaypoints = true;
if (simulatePhysicsXSecondsAfterLastWaypoint == 0f)
{
Object.Destroy((Object)(object)((Component)this).gameObject);
return;
}
Rigidbody component = ((Component)this).GetComponent<Rigidbody>();
component.isKinematic = false;
Vector3 val = belt.waypoints[belt.waypoints.Length - 1].position - belt.waypoints[belt.waypoints.Length - 2].position;
component.velocity = ((Vector3)(ref val)).normalized * belt.movementSpeed;
((MonoBehaviour)this).StartCoroutine(DestroySelfAfterDelay(simulatePhysicsXSecondsAfterLastWaypoint));
}
private IEnumerator DestroySelfAfterDelay(float delay)
{
yield return (object)new WaitForSeconds(delay);
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
internal class TimelineScrubber
{
private PlayableDirector director;
private bool started;
private float percent;
public TimelineScrubber(PlayableDirector director)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Invalid comparison between Unknown and I4
this.director = director;
if ((int)director.timeUpdateMode != 3)
{
Debug.LogError((object)("TimelineScrubber instantiated for a PlayableDirector that's not in manual mode: " + ((Object)((Component)director).gameObject).name));
}
}
public void ResetTimeline()
{
director.Stop();
director.time = 0.0;
started = false;
}
public void SetPercentComplete(float newPercent)
{
if (!started || newPercent < percent)
{
started = true;
initializeTimelineToPosition(getTimeForPercent(newPercent));
}
else
{
advanceTimelineToPosition(getTimeForPercent(newPercent));
}
percent = newPercent;
}
private void initializeTimelineToPosition(float position)
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
director.Stop();
director.Play();
PlayableGraph playableGraph = director.playableGraph;
((PlayableGraph)(ref playableGraph)).Evaluate();
playableGraph = director.playableGraph;
((PlayableGraph)(ref playableGraph)).Evaluate(position);
}
private void advanceTimelineToPosition(float position)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Invalid comparison between Unknown and I4
//IL_002c: 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)
float num = position - (float)director.time;
if (!(num <= 0f) && (int)director.state == 1)
{
PlayableGraph playableGraph = director.playableGraph;
((PlayableGraph)(ref playableGraph)).Evaluate(num);
}
}
private float getTimeForPercent(float percent)
{
return (float)director.duration * percent;
}
}
namespace Winterland.Common
{
[ExecuteAlways]
public class AmbientOverride : MonoBehaviour
{
public static AmbientOverride Instance;
public bool Night;
[HideInInspector]
public Color AdditiveSkyColor = Color.black;
[Header("How fast additive sky colors fade to black (Fireworks)")]
public float AdditiveSkyColorLerpSpeed = 5f;
[HideInInspector]
public bool DayNightCycleModEnabled = true;
[Header("Skybox texture. Leave this set to nothing to keep the original stage skybox.")]
public Texture Skybox;
public Color LightColor = Color.white;
public Color ShadowColor = Color.black;
[HideInInspector]
public Color CurrentLightColor = Color.white;
[HideInInspector]
public Color CurrentShadowColor = Color.black;
[HideInInspector]
public AmbientOverrideTrigger CurrentAmbientTrigger;
private Color oldLightColor = Color.white;
private Color oldShadowColor = Color.black;
private float currentTimer;
private float currentTransitionDuration = 1f;
private AmbientManager sun;
private void Update()
{
//IL_000d: 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)
if (Application.isEditor)
{
Shader.SetGlobalColor("LightColor", LightColor);
Shader.SetGlobalColor("ShadowColor", ShadowColor);
}
else
{
ReptileUpdate();
}
void ReptileUpdate()
{
//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_0073: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: 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_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: 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_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: 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_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
//IL_0166: Unknown result type (might be due to invalid IL or missing references)
//IL_016d: 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_0178: Unknown result type (might be due to invalid IL or missing references)
//IL_017f: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Unknown result type (might be due to invalid IL or missing references)
//IL_018a: Unknown result type (might be due to invalid IL or missing references)
//IL_018f: Unknown result type (might be due to invalid IL or missing references)
currentTimer += Core.dt;
if (currentTimer > currentTransitionDuration)
{
currentTimer = currentTransitionDuration;
}
float num = 1f;
if (currentTransitionDuration > 0f)
{
num = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f).Evaluate(currentTimer / currentTransitionDuration);
}
Color lightColor = LightColor;
Color shadowColor = ShadowColor;
if ((Object)(object)CurrentAmbientTrigger != (Object)null)
{
lightColor = CurrentAmbientTrigger.LightColor;
shadowColor = CurrentAmbientTrigger.ShadowColor;
}
CurrentLightColor = Color.op_Implicit(Vector4.Lerp(Color.op_Implicit(oldLightColor), Color.op_Implicit(lightColor), num));
CurrentShadowColor = Color.op_Implicit(Vector4.Lerp(Color.op_Implicit(oldShadowColor), Color.op_Implicit(shadowColor), num));
AdditiveSkyColor = Color.op_Implicit(Vector4.Lerp(Color.op_Implicit(AdditiveSkyColor), Color.op_Implicit(Color.black), AdditiveSkyColorLerpSpeed * Core.dt));
if ((Object)(object)CurrentAmbientTrigger == (Object)null)
{
float num2 = 0f - (AdditiveSkyColor.r + AdditiveSkyColor.g + AdditiveSkyColor.b) / 3f * 0.5f + 1f;
CurrentShadowColor *= num2;
CurrentLightColor *= num2;
CurrentLightColor += AdditiveSkyColor;
}
}
}
public void AddSkyLight(Color color)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
AdditiveSkyColor += color * 0.7f;
}
private void LateUpdate()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)sun == (Object)null) && !DayNightCycleModEnabled)
{
Light component = ((Component)sun).GetComponent<Light>();
component.color = Color.white;
component.shadowStrength = 1f;
}
}
public void TransitionAmbient(AmbientOverrideTrigger trigger)
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)CurrentAmbientTrigger != (Object)(object)trigger)
{
CurrentAmbientTrigger = trigger;
currentTimer = 0f;
currentTransitionDuration = trigger.TransitionDuration;
oldLightColor = CurrentLightColor;
oldShadowColor = CurrentShadowColor;
DayNightCycleModEnabled = trigger.EnableDayLightCycleMod;
}
}
public void StopAmbient(AmbientOverrideTrigger trigger)
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)trigger == (Object)(object)CurrentAmbientTrigger)
{
CurrentAmbientTrigger = null;
currentTimer = 0f;
currentTransitionDuration = trigger.TransitionDuration;
oldLightColor = CurrentLightColor;
oldShadowColor = CurrentShadowColor;
DayNightCycleModEnabled = true;
}
}
public void Refresh()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: 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_0051: Unknown result type (might be due to invalid IL or missing references)
oldLightColor = LightColor;
oldShadowColor = ShadowColor;
if ((Object)(object)Skybox != (Object)null)
{
RenderSettings.skybox.mainTexture = Skybox;
}
AmbientManager val = Object.FindObjectOfType<AmbientManager>();
if ((Object)(object)val != (Object)null)
{
((Component)val).transform.rotation = ((Component)this).transform.rotation;
}
((Behaviour)((Component)val).GetComponent<LensFlare>()).enabled = !Night;
}
private void Awake()
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
Instance = this;
Refresh();
Light component = ((Component)Object.FindObjectOfType<AmbientManager>()).GetComponent<Light>();
Light component2 = ((Component)this).GetComponent<Light>();
component.color = component2.color;
if ((Object)(object)component2 != (Object)null)
{
Object.Destroy((Object)(object)component2);
}
}
private void OnDestroy()
{
Instance = null;
}
}
public class AmbientOverrideTrigger : MonoBehaviour
{
public Color LightColor = Color.white;
public Color ShadowColor = Color.black;
public float TransitionDuration = 2f;
[Header("If this is set to false, they Day and Night cycle mod won't take effect while you're in this ambient.")]
public bool EnableDayLightCycleMod = true;
private void OnTriggerEnter(Collider other)
{
Player val = ((Component)other).GetComponent<Player>();
if ((Object)(object)val == (Object)null)
{
val = ((Component)other).GetComponentInParent<Player>();
}
if ((Object)(object)val == (Object)null)
{
val = ((Component)other).GetComponentInChildren<Player>();
}
if (!((Object)(object)val == (Object)null) && !val.isAI)
{
AmbientOverride.Instance.TransitionAmbient(this);
}
}
private void OnTriggerExit(Collider other)
{
Player val = ((Component)other).GetComponent<Player>();
if ((Object)(object)val == (Object)null)
{
val = ((Component)other).GetComponentInParent<Player>();
}
if ((Object)(object)val == (Object)null)
{
val = ((Component)other).GetComponentInChildren<Player>();
}
if (!((Object)(object)val == (Object)null) && !val.isAI)
{
AmbientOverride.Instance.StopAmbient(this);
}
}
}
public class Arcade : MonoBehaviour
{
public Texture2D MapPinTexture;
private MapPin pin;
private void Awake()
{
ArcadeManager.Instance.RegisterArcade(this);
}
private void MakePin()
{
Mapcontroller instance = Mapcontroller.Instance;
pin = instance.CreatePin((PinType)5);
pin.AssignGameplayEvent(((Component)this).gameObject);
pin.InitMapPin((PinType)0);
pin.OnPinEnable();
((Renderer)((Component)pin).GetComponentInChildren<MeshRenderer>()).material.mainTexture = (Texture)(object)MapPinTexture;
}
private void Start()
{
MakePin();
UpdateAvailability();
}
public void UpdateAvailability()
{
((Component)this).gameObject.SetActive(WinterProgress.Instance.LocalProgress.ArcadeUnlocked);
if ((Object)(object)pin != (Object)null)
{
if (WinterProgress.Instance.LocalProgress.ArcadeUnlocked)
{
pin.EnablePin();
}
else
{
pin.DisablePin();
}
}
}
}
public class ArcadeManager : MonoBehaviour
{
public List<Arcade> Arcades = new List<Arcade>();
public static ArcadeManager Instance { get; private set; }
private void Awake()
{
Instance = this;
}
public void RegisterArcade(Arcade arcade)
{
Arcades.Add(arcade);
}
public void UpdateArcades()
{
foreach (Arcade arcade in Arcades)
{
arcade.UpdateAvailability();
}
}
}
public class BindGameObjectActive : MonoBehaviour
{
[Header("When the GameObject referenced here is disabled, I will get disabled as well, and viceversa.")]
public GameObject BoundGameObject;
private void Awake()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
Core.OnAlwaysUpdate += new OnUpdateHandler(CoreUpdate);
}
private void CoreUpdate()
{
if (BoundGameObject.activeInHierarchy && !((Component)this).gameObject.activeSelf)
{
((Component)this).gameObject.SetActive(true);
}
else if (!BoundGameObject.activeInHierarchy && ((Component)this).gameObject.activeSelf)
{
((Component)this).gameObject.SetActive(false);
}
}
private void OnDestroy()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
Core.OnAlwaysUpdate -= new OnUpdateHandler(CoreUpdate);
}
}
public enum BrcCharacter
{
None = -1,
Vinyl,
Frank,
Coil,
Red,
Tryce,
Bel,
Rave,
DotExeMember,
Solace,
DjCyber,
EclipseMember,
DevilTheoryMember,
FauxWithBoostPack,
FleshPrince,
Irene,
Felix,
OldHeadMember,
Base,
Jet,
Mesh,
FuturismMember,
Rise,
Shine,
FauxWithoutBoostPack,
DotExeBoss,
FelixWithCyberHead
}
public class BuiltToy : MonoBehaviour
{
public Toys Toy;
private Material material;
private static int GraffitiTextureProperty = Shader.PropertyToID("_Graffiti");
private void Awake()
{
Renderer componentInChildren = ((Component)this).GetComponentInChildren<Renderer>();
material = componentInChildren.sharedMaterial;
}
public void SetGraffiti(GraffitiArt graffiti)
{
material.SetTexture(GraffitiTextureProperty, graffiti.graffitiMaterial.mainTexture);
}
}
public class CameraSequenceAction : SequenceAction
{
[Header("Leave this on None to keep the current camera.")]
public CameraRegisterer Camera;
public override void Run(bool immediate)
{
base.Run(immediate);
if (!immediate && (Object)(object)Camera != (Object)null)
{
((CustomSequence)Sequence).SetCamera(((Component)Camera).gameObject);
}
}
}
public class CameraZoomZone : MonoBehaviour
{
public bool ChangeCameraPosition;
public float CameraDragDistanceDefault = 1f;
public float CameraDragDistanceMax = 1f;
public float CameraHeight = 2f;
public bool ChangeCameraFOV;
public float CameraFOV = 40f;
private void OnTriggerEnter(Collider other)
{
Player val = ((Component)other).GetComponent<Player>();
if ((Object)(object)val == (Object)null)
{
val = ((Component)other).GetComponentInParent<Player>();
}
if (!((Object)(object)val == (Object)null) && !val.isAI)
{
WinterPlayer winterPlayer = WinterPlayer.Get(val);
if (!((Object)(object)winterPlayer == (Object)null))
{
winterPlayer.CurrentCameraZoomZone = this;
}
}
}
private void OnTriggerExit(Collider other)
{
Player val = ((Component)other).GetComponent<Player>();
if ((Object)(object)val == (Object)null)
{
val = ((Component)other).GetComponentInParent<Player>();
}
if (!((Object)(object)val == (Object)null) && !val.isAI)
{
WinterPlayer winterPlayer = WinterPlayer.Get(val);
if (!((Object)(object)winterPlayer == (Object)null) && (Object)(object)winterPlayer.CurrentCameraZoomZone == (Object)(object)this)
{
winterPlayer.CurrentCameraZoomZone = null;
}
}
}
}
public enum Condition
{
None,
HasWantedLevel,
CollectedAllToyLines,
CollectedSomeToyLines,
ArcadeBestTimeSet
}
public class CustomCharacterSelectSpot : MonoBehaviour
{
public string GUID;
private static GameObject Source;
private void Reset()
{
GUID = Guid.NewGuid().ToString();
}
private void Awake()
{
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)Source == (Object)null)
{
Source = ((Component)Object.FindObjectOfType<CharacterSelectSpot>()).gameObject;
}
GameObject obj = Object.Instantiate<GameObject>(Source, ((Component)this).transform);
obj.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity);
((AProgressable)obj.GetComponent<CharacterSelectSpot>()).uid = GUID;
((Component)obj.transform.Find("mesh")).gameObject.SetActive(false);
}
}
[ExecuteAlways]
public class CustomNPC : MonoBehaviour
{
[Header("General")]
[SerializeField]
private string guid = "";
public bool CreateMapPin;
public ChallengeLevel Challenge;
public string Name = "";
public bool PlacePlayerAtSnapPosition = true;
public bool LookAt = true;
public bool FixStupidFBXLookAtRotation;
public bool ShowRep;
public int MaxDialogueLevel = 1;
[HideInInspector]
public int CurrentDialogueLevel;
private EventDrivenInteractable interactable;
private DialogueBranch[] dialogueBranches;
private Transform head;
private const float MaxHeadYaw = 75f;
private const float MaxHeadPitch = 60f;
private const float LookAtDuration = 2f;
private const float LookAtSpeed = 4f;
private float currentLookAtAmount;
private float lookAtTimer;
private Player lookAtTarget;
private bool isLookingAt;
public Guid GUID
{
get
{
return Guid.Parse(guid);
}
set
{
guid = value.ToString();
}
}
private void Reset()
{
if (Application.isEditor)
{
((Component)this).gameObject.layer = 19;
GUID = Guid.NewGuid();
}
}
private void Start()
{
Mapcontroller instance = Mapcontroller.Instance;
if (CreateMapPin)
{
MapPin obj = instance.CreatePin((PinType)2);
obj.AssignGameplayEvent(((Component)this).gameObject);
obj.InitMapPin((PinType)2);
obj.OnPinEnable();
}
}
private void Awake()
{
if (!Application.isEditor)
{
ReptileAwake();
}
void ReptileAwake()
{
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Expected O, but got Unknown
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Expected O, but got Unknown
CurrentDialogueLevel = 0;
dialogueBranches = OrderedComponent.GetComponentsOrdered<DialogueBranch>(((Component)this).gameObject);
interactable = ((Component)this).gameObject.AddComponent<EventDrivenInteractable>();
interactable.OnInteract = Interact;
interactable.OnGetLookAtPos = GetLookAtPos;
((CustomInteractable)interactable).PlacePlayerAtSnapPosition = PlacePlayerAtSnapPosition;
((CustomInteractable)interactable).ShowRep = ShowRep;
((CustomInteractable)interactable).LookAt = LookAt;
head = TransformExtentions.FindRecursive(((Component)this).transform, "head");
Core.OnUpdate += new OnUpdateHandler(OnUpdate);
Core.OnLateUpdate += new OnLateUpdateHandler(OnLateUpdate);
DeserializeNPC();
}
}
private void OnUpdate()
{
if (isLookingAt)
{
currentLookAtAmount += 4f * Core.dt;
lookAtTimer -= Core.dt;
if (lookAtTimer <= 0f)
{
lookAtTimer = 0f;
isLookingAt = false;
}
}
else
{
currentLookAtAmount -= 4f * Core.dt;
}
currentLookAtAmount = Mathf.Clamp(currentLookAtAmount, 0f, 1f);
}
private void OnLateUpdate()
{
UpdateHeadTransform();
}
private void OnTriggerStay(Collider other)
{
Player val = ((Component)other).GetComponentInChildren<Player>();
if ((Object)(object)val == (Object)null)
{
val = ((Component)other).GetComponentInParent<Player>();
}
if (!((Object)(object)val == (Object)null) && !val.isAI)
{
StartLookAt(val);
}
}
private void UpdateHeadTransform()
{
//IL_0073: 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_007e: 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)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: 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_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: 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_00b5: 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_00be: 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_00c4: 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_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_015c: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)lookAtTarget == (Object)null || (Object)(object)head == (Object)null)
{
return;
}
CharacterVisual characterVisual = lookAtTarget.characterVisual;
if ((Object)(object)characterVisual == (Object)null)
{
return;
}
Transform transform = characterVisual.head;
if (!((Object)(object)head == (Object)null))
{
if (characterVisual.VFX.phone.activeSelf)
{
transform = characterVisual.VFX.phone.transform;
}
Vector3 val = head.position - transform.position;
Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up);
Vector3 eulerAngles = ((Quaternion)(ref val2)).eulerAngles;
val2 = Quaternion.LookRotation(-((Component)this).transform.forward, Vector3.up);
Vector3 eulerAngles2 = ((Quaternion)(ref val2)).eulerAngles;
float num = Mathf.DeltaAngle(eulerAngles.y, eulerAngles2.y);
float num2 = Mathf.DeltaAngle(eulerAngles.x, eulerAngles2.x);
eulerAngles.y = eulerAngles2.y - Mathf.Clamp(num, -75f, 75f);
eulerAngles.x = eulerAngles2.x - Mathf.Clamp(num2, -60f, 60f);
if (FixStupidFBXLookAtRotation)
{
eulerAngles.z -= 90f;
}
((Component)head).transform.rotation = Quaternion.Lerp(((Component)head).transform.rotation, Quaternion.Euler(eulerAngles), currentLookAtAmount);
}
}
private void StartLookAt(Player player)
{
if (!((Object)(object)player.characterVisual == (Object)null))
{
lookAtTarget = player;
lookAtTimer = 2f;
isLookingAt = true;
}
}
private void DeserializeNPC()
{
SerializedNPC nPCProgress = WinterProgress.Instance.LocalProgress.GetNPCProgress(this);
if (nPCProgress != null)
{
CurrentDialogueLevel = nPCProgress.DialogueLevel;
}
}
private void OnDestroy()
{
if (!Application.isEditor)
{
ReptileDestroy();
return;
}
DialogueBranch[] components = ((Component)this).GetComponents<DialogueBranch>();
for (int i = 0; i < components.Length; i++)
{
Object.DestroyImmediate((Object)(object)components[i]);
}
void ReptileDestroy()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Expected O, but got Unknown
Core.OnUpdate -= new OnUpdateHandler(OnUpdate);
Core.OnLateUpdate -= new OnLateUpdateHandler(OnLateUpdate);
}
}
public void AddDialogueLevel(int dialogueLevelToAdd)
{
CurrentDialogueLevel += dialogueLevelToAdd;
CurrentDialogueLevel = Mathf.Clamp(CurrentDialogueLevel, 0, MaxDialogueLevel);
}
public Vector3 GetLookAtPos()
{
//IL_001f: 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)
if (Object.op_Implicit((Object)(object)head))
{
return head.position;
}
return ((Component)this).transform.position;
}
public void Interact(Player player)
{
Sequence sequence = null;
DialogueBranch[] array = dialogueBranches;
foreach (DialogueBranch dialogueBranch in array)
{
if (dialogueBranch.Test(this))
{
sequence = dialogueBranch.Sequence;
break;
}
}
if (!((Object)(object)sequence == (Object)null))
{
StartSequence(sequence);
}
}
public void StartSequence(Sequence sequence)
{
SequenceWrapper customSequence = sequence.GetCustomSequence(this);
if (customSequence != null)
{
((CustomInteractable)interactable).StartEnteringSequence((CustomSequence)(object)customSequence, sequence.HidePlayer, true, false, true, true, sequence.Skippable, true, false);
}
}
}
public class CustomToilet : MonoBehaviour
{
private static GameObject Source;
private void Awake()
{
//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)
if ((Object)(object)Source == (Object)null)
{
Source = ((Component)Object.FindObjectOfType<PublicToilet>()).gameObject;
}
Object.Instantiate<GameObject>(Source, ((Component)this).transform).transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity);
}
}
public class DebugUI : MonoBehaviour
{
private class DebugMenu
{
public string Name;
public Action OnGUI;
}
private const int Width = 400;
private const int Height = 1200;
private List<DebugMenu> debugMenus = new List<DebugMenu>();
private bool show = true;
private DebugMenu currentDebugMenu;
public static DebugUI Instance { get; private set; }
public static void Create(bool enabled)
{
//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_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Expected O, but got Unknown
if (!((Object)(object)Instance != (Object)null))
{
GameObject val = new GameObject("Winterland Debug UI");
val.SetActive(enabled);
Instance = val.AddComponent<DebugUI>();
Object.DontDestroyOnLoad((Object)val);
}
}
public void RegisterMenu(string name, Action onDebugUI)
{
DebugMenu item = new DebugMenu
{
Name = name,
OnGUI = onDebugUI
};
debugMenus.Add(item);
}
private void OnGUI()
{
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
Cursor.visible = true;
Cursor.lockState = (CursorLockMode)0;
GUILayout.BeginArea(new Rect(0f, 0f, 400f, 1200f));
GUILayout.BeginVertical(GUI.skin.box, Array.Empty<GUILayoutOption>());
GUILayout.BeginVertical(GUI.skin.box, Array.Empty<GUILayoutOption>());
GUILayout.BeginVertical("Debug UI", GUI.skin.box, Array.Empty<GUILayoutOption>());
GUILayout.Space(20f);
try
{
if (GUILayout.Button("Show/Hide", Array.Empty<GUILayoutOption>()))
{
show = !show;
}
if (!show)
{
return;
}
if (currentDebugMenu != null)
{
if (GUILayout.Button("Back", Array.Empty<GUILayoutOption>()))
{
currentDebugMenu = null;
}
else
{
currentDebugMenu.OnGUI();
}
return;
}
foreach (DebugMenu debugMenu in debugMenus)
{
if (GUILayout.Button(debugMenu.Name, Array.Empty<GUILayoutOption>()))
{
currentDebugMenu = debugMenu;
}
}
}
finally
{
GUILayout.EndVertical();
GUILayout.EndVertical();
GUILayout.EndVertical();
GUILayout.EndArea();
}
}
}
[ExecuteAlways]
public class DialogBlock : OrderedComponent
{
public enum SpeakerMode
{
None,
NPC,
Text
}
[HideInInspector]
public DialogSequenceAction Owner;
public SpeakerMode Speaker = SpeakerMode.NPC;
[HideInInspector]
public string SpeakerName = "???";
public string Text = "...";
[Header("Random clips to play when the character says this line.")]
public AudioClip[] AudioClips;
protected override void OnValidate()
{
base.OnValidate();
if (Application.isEditor)
{
((Object)this).hideFlags = (HideFlags)2;
}
}
private void Awake()
{
if (Application.isEditor && (Object)(object)((Component)this).GetComponent<DialogSequenceAction>() == (Object)null)
{
Object.DestroyImmediate((Object)(object)this);
}
}
public override bool IsPeer(Component other)
{
DialogBlock dialogBlock = other as DialogBlock;
if ((Object)(object)dialogBlock == (Object)null)
{
return false;
}
if ((Object)(object)dialogBlock.Owner == (Object)(object)Owner)
{
return true;
}
return false;
}
private void Start()
{
if (Application.isEditor && (Object)(object)Owner == (Object)null)
{
Object.DestroyImmediate((Object)(object)this);
}
}
}
public class DialogSequenceAction : CameraSequenceAction
{
public enum DialogType
{
Normal,
YesNah
}
[Header("Type of dialog. Can make a branching question.")]
public DialogType Type;
[HideInInspector]
public string YesTarget = "";
[HideInInspector]
public string NahTarget = "";
[Header("Random clips to play when the character starts talking.")]
public AudioClip[] AudioClips;
public override void Run(bool immediate)
{
//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
//IL_01f8: Expected O, but got Unknown
base.Run(immediate);
if (immediate)
{
return;
}
if (AudioClips != null && AudioClips.Length != 0)
{
AudioManager audioManager = Core.Instance.AudioManager;
AudioClip val = AudioClips[Random.Range(0, AudioClips.Length)];
audioManager.PlayNonloopingSfx(audioManager.audioSources[5], val, audioManager.mixerGroups[5], 0f);
}
DialogBlock[] array = (from block in OrderedComponent.GetComponentsOrdered<DialogBlock>(((Component)this).gameObject)
where (Object)(object)block.Owner == (Object)(object)this
select block).ToArray();
List<CustomDialogue> list = new List<CustomDialogue>();
for (int i = 0; i < array.Length; i++)
{
DialogBlock dialog = array[i];
string text = dialog.Text;
text = text.Replace("$TOYS_LEFT", (ToyLineManager.Instance.ToyLines.Count - WinterProgress.Instance.LocalProgress.ToyLinesCollected).ToString());
text = text.Replace("$LOCALGIFTS", WinterProgress.Instance.LocalProgress.Gifts.ToString());
text = text.Replace("$GLOBALGIFTS", TreeController.Instance.TargetProgress.totalGiftsCollected.ToString());
if ((Object)(object)NPC != (Object)null && (Object)(object)NPC.Challenge != (Object)null)
{
string newValue = ChallengeUI.SecondsToMMSS(NPC.Challenge.Timer);
string newValue2 = ChallengeUI.SecondsToMMSS(NPC.Challenge.BestTime);
if (NPC.Challenge.BestTime == 0f)
{
newValue2 = "Not set";
}
text = text.Replace("$ARCADE_LASTTIME", newValue);
text = text.Replace("$ARCADE_BESTTIME", newValue2);
}
CustomDialogue customDialog = new CustomDialogue(dialog.SpeakerName, text, (CustomDialogue)null);
list.Add(customDialog);
if (dialog.Speaker == DialogBlock.SpeakerMode.None)
{
customDialog.CharacterName = "";
}
if (dialog.Speaker == DialogBlock.SpeakerMode.NPC)
{
customDialog.CharacterName = NPC.Name;
}
if (i > 0)
{
CustomDialogue val2 = list[i - 1];
if (val2 != null)
{
val2.NextDialogue = customDialog;
}
}
CustomDialogue obj = customDialog;
obj.OnDialogueBegin = (Action)Delegate.Combine(obj.OnDialogueBegin, (Action)delegate
{
if (dialog.AudioClips != null && dialog.AudioClips.Length != 0)
{
AudioManager audioManager2 = Core.Instance.AudioManager;
AudioClip val3 = dialog.AudioClips[Random.Range(0, dialog.AudioClips.Length)];
audioManager2.PlayNonloopingSfx(audioManager2.audioSources[5], val3, audioManager2.mixerGroups[5], 0f);
}
});
if (i < array.Length - 1)
{
continue;
}
CustomDialogue obj2 = customDialog;
obj2.OnDialogueBegin = (Action)Delegate.Combine(obj2.OnDialogueBegin, (Action)delegate
{
if (Type == DialogType.YesNah)
{
((CustomSequence)Sequence).RequestYesNoPrompt();
}
});
CustomDialogue obj3 = customDialog;
obj3.OnDialogueEnd = (Action)Delegate.Combine(obj3.OnDialogueEnd, (Action)delegate
{
if (Type == DialogType.YesNah)
{
SequenceAction actionByName = Sequence.Sequence.GetActionByName(YesTarget);
SequenceAction actionByName2 = Sequence.Sequence.GetActionByName(NahTarget);
if (customDialog.AnsweredYes)
{
if ((Object)(object)actionByName == (Object)null)
{
Finish(immediate);
}
else
{
actionByName.Run(immediate);
}
}
else if ((Object)(object)actionByName2 == (Object)null)
{
Finish(immediate);
}
else
{
actionByName2.Run(immediate);
}
}
else
{
Finish(immediate);
}
});
}
if (list.Count > 0)
{
((CustomSequence)Sequence).StartDialogue(list[0], 0.9f);
}
}
}
[ExecuteAlways]
public class DialogueBranch : OrderedComponent
{
public Sequence Sequence;
public WinterObjective RequiredObjective;
public Condition Condition;
public int MinimumDialogueLevel;
protected override void OnValidate()
{
base.OnValidate();
if (Application.isEditor)
{
((Object)this).hideFlags = (HideFlags)2;
}
}
public override bool IsPeer(Component other)
{
return other is DialogueBranch;
}
public bool Test(CustomNPC npc)
{
if (npc.CurrentDialogueLevel < MinimumDialogueLevel)
{
return false;
}
switch (Condition)
{
case Condition.HasWantedLevel:
if (!WantedManager.instance.Wanted)
{
return false;
}
break;
case Condition.CollectedAllToyLines:
if (!ToyLineManager.Instance.GetCollectedAllToyLines())
{
return false;
}
break;
case Condition.CollectedSomeToyLines:
if (ToyLineManager.Instance.GetCollectedAllToyLines() || WinterProgress.Instance.LocalProgress.ToyLinesCollected == 0)
{
return false;
}
break;
case Condition.ArcadeBestTimeSet:
if ((Object)(object)npc.Challenge == (Object)null)
{
return false;
}
if (npc.Challenge.BestTime == 0f)
{
return false;
}
break;
}
if ((Object)(object)RequiredObjective != (Object)null && ((Object)WinterProgress.Instance.LocalProgress.Objective).name != ((Object)RequiredObjective).name)
{
return false;
}
return true;
}
}
public class EndSequenceAction : SequenceAction
{
public override void Run(bool immediate)
{
base.Run(immediate);
if (!immediate)
{
((CustomSequence)Sequence).ExitSequence(0.9f);
}
}
}
public class FallenSnowController : MonoBehaviour
{
public float MinimumSpeedForSnowParticles = 5f;
public GameObject SnowFootstepParticlesPrefab;
public Action OnUpdate;
public Action OnUpdateOneShot;
private const string CameraPositionProp = "CameraPosition";
private const string DepthHalfRadiusProp = "DepthHalfRadius";
private const string DepthTextureProp = "DepthTexture";
[SerializeField]
private float clearRate = 0.033f;
[SerializeField]
private float clearStrength = 0.1f;
[SerializeField]
private float updateRate = 0.016f;
[SerializeField]
private float depthRadiusHalf = 100f;
[SerializeField]
private RenderTexture depthRenderTexture;
[SerializeField]
private Texture2D holeTexture;
[SerializeField]
private float gridSize = 10f;
private RenderTexture backBufferRenderTexture;
private Texture2D clearTexture;
private Vector2 cameraPosition = Vector2.zero;
private float currentUpdateTime;
private float currentClearTime;
public static FallenSnowController Instance { get; private set; }
private void ProcessRenderTextureDraws()
{
RenderTexture.active = depthRenderTexture;
GL.PushMatrix();
GL.LoadPixelMatrix(0f, depthRadiusHalf * 2f, depthRadiusHalf * 2f, 0f);
OnUpdateOneShot?.Invoke();
OnUpdate?.Invoke();
GL.PopMatrix();
RenderTexture.active = null;
OnUpdateOneShot = null;
}
public void DrawHole(Vector2 worldPosition, float size, float strength)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: 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_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: 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_003d: 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_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: 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)
Vector2 depthPositionAt = GetDepthPositionAt(worldPosition);
depthPositionAt.y = 0f - depthPositionAt.y + depthRadiusHalf * 2f;
depthPositionAt -= new Vector2(size * 0.5f, size * 0.5f);
Graphics.DrawTexture(new Rect(depthPositionAt.x, depthPositionAt.y, size, size), (Texture)(object)holeTexture, new Rect(0f, 0f, 1f, 1f), 0, 0, 0, 0, new Color(1f, 1f, 1f, strength), (Material)null, -1);
}
private Vector2 GetDepthPositionAt(Vector2 position)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//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_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_001f: Unknown result type (might be due to invalid IL or missing references)
Vector2 val = cameraPosition - new Vector2(depthRadiusHalf, depthRadiusHalf);
return position - val;
}
private void Awake()
{
//IL_000d: 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_003b: Expected O, but got Unknown
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
RenderTexture.active = depthRenderTexture;
GL.Clear(true, true, Color.black);
RenderTexture.active = null;
backBufferRenderTexture = Object.Instantiate<RenderTexture>(depthRenderTexture);
clearTexture = new Texture2D(1, 1);
clearTexture.SetPixel(0, 0, Color.black);
clearTexture.Apply();
Instance = this;
Shader.SetGlobalFloat("DepthHalfRadius", depthRadiusHalf);
Shader.SetGlobalTexture("DepthTexture", (Texture)(object)depthRenderTexture);
}
private void TransformTexture(Vector2 previousCameraPosition, Vector2 currentCameraPosition)
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: 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_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: 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_004b: 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_0093: 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_00a3: 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)
Graphics.Blit((Texture)(object)depthRenderTexture, backBufferRenderTexture);
Vector2 val = (currentCameraPosition - previousCameraPosition) / (depthRadiusHalf * 2f) * new Vector2((float)((Texture)depthRenderTexture).width, (float)((Texture)depthRenderTexture).height);
val.x = 0f - val.x;
RenderTexture.active = depthRenderTexture;
GL.PushMatrix();
GL.LoadPixelMatrix(0f, (float)((Texture)depthRenderTexture).width, (float)((Texture)depthRenderTexture).height, 0f);
GL.Clear(true, true, Color.black);
Graphics.DrawTexture(new Rect(val.x, val.y, (float)((Texture)depthRenderTexture).width, (float)((Texture)depthRenderTexture).height), (Texture)(object)backBufferRenderTexture);
GL.PopMatrix();
RenderTexture.active = null;
}
private void Update()
{
//IL_0008: 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_0063: 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_006b: 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_0043: 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_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
//IL_0188: Unknown result type (might be due to invalid IL or missing references)
//IL_018d: 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_017c: Unknown result type (might be due to invalid IL or missing references)
Vector2 val = default(Vector2);
((Vector2)(ref val))..ctor(((Component)this).transform.position.x, ((Component)this).transform.position.z);
Camera currentCamera = WorldHandler.instance.CurrentCamera;
if ((Object)(object)currentCamera != (Object)null)
{
((Vector2)(ref val))..ctor(((Component)currentCamera).transform.position.x, ((Component)currentCamera).transform.position.z);
}
Vector2 val2 = cameraPosition;
val.x = Mathf.Floor(val.x / gridSize) * gridSize;
val.y = Mathf.Floor(val.y / gridSize) * gridSize;
currentUpdateTime += Core.dt;
currentClearTime += Core.dt;
float num = Mathf.Floor(currentClearTime / clearRate);
for (int i = 0; (float)i < num; i++)
{
OnUpdateOneShot = (Action)Delegate.Combine(OnUpdateOneShot, (Action)delegate
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
Graphics.DrawTexture(new Rect(0f, 0f, depthRadiusHalf * 2f, depthRadiusHalf * 2f), (Texture)(object)clearTexture, new Rect(0f, 0f, 1f, 1f), 0, 0, 0, 0, new Color(1f, 1f, 1f, clearStrength), (Material)null, -1);
});
}
float num2 = Mathf.Floor(currentUpdateTime / updateRate);
for (int j = 0; (float)j < num2; j++)
{
ProcessRenderTextureDraws();
}
currentUpdateTime -= num2 * updateRate;
currentClearTime -= num * clearRate;
cameraPosition = val;
if (val != val2)
{
TransformTexture(val2, val);
}
Shader.SetGlobalVector("CameraPosition", Vector4.op_Implicit(cameraPosition));
}
private void OnDestroy()
{
Object.Destroy((Object)(object)clearTexture);
Object.Destroy((Object)(object)backBufferRenderTexture);
}
}
public class FallingSnowBlocker : MonoBehaviour
{
private void Awake()
{
Collider[] componentsInChildren = ((Component)this).GetComponentsInChildren<Collider>();
FallingSnowController[] array = Object.FindObjectsOfType<FallingSnowController>(true);
foreach (FallingSnowController fallingSnowController in array)
{
Collider[] array2 = componentsInChildren;
foreach (Collider trigger in array2)
{
fallingSnowController.AddKillTrigger(trigger);
}
}
}
}
public class FallingSnowController : MonoBehaviour
{
[Tooltip("How much to move the particles upwards when you look up. To make it look like the particles are coming from higher up.")]
[SerializeField]
private float heightOffsetWhenLookingUp = 10f;
[Tooltip("Size of the snow chunk grid. Make this match the size of the emitter.")]
[SerializeField]
private float gridSize = 50f;
[SerializeField]
private GameObject snowEmitter;
[Tooltip("Amount of adjacent snow chunks to create around the camera. Probably best left at 1 as it increases the number of chunks exponentially.")]
[SerializeField]
private int amountAroundCamera = 1;
private Dictionary<Vector2, GameObject> particles;
private Stack<GameObject> particlePool;
private List<GameObject> allParticles;
private void Awake()
{
particles = new Dictionary<Vector2, GameObject>();
particlePool = new Stack<GameObject>();
allParticles = new List<GameObject>();
int num = 1 + amountAroundCamera * 2;
int num2 = num * num;
AddToPool(snowEmitter);
allParticles.Add(snowEmitter);
for (int i = 1; i < num2; i++)
{
GameObject val = Object.Instantiate<GameObject>(snowEmitter);
AddToPool(val);
allParticles.Add(val);
}
}
public void AddKillTrigger(Collider trigger)
{
//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)
foreach (GameObject allParticle in allParticles)
{
ParticleSystem[] componentsInChildren = allParticle.GetComponentsInChildren<ParticleSystem>(true);
if (componentsInChildren != null)
{
ParticleSystem[] array = componentsInChildren;
for (int i = 0; i < array.Length; i++)
{
TriggerModule trigger2 = array[i].trigger;
((TriggerModule)(ref trigger2)).AddCollider((Component)(object)trigger);
}
}
}
}
private void AddToPool(GameObject instance)
{
instance.transform.parent = ((Component)this).transform;
particlePool.Push(instance);
}
private GameObject GetFromPool()
{
return particlePool.Pop();
}
private Vector2 GridSnapPosition(Vector3 position)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
float num = Mathf.Floor(position.x / gridSize) * gridSize;
float num2 = Mathf.Floor(position.z / gridSize) * gridSize;
return new Vector2(num, num2);
}
private bool InRange(Vector2 position, Vector2 position2)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: 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)
float num = Mathf.Abs(position.x - position2.x);
float num2 = Mathf.Abs(position.y - position2.y);
if (num > (float)amountAroundCamera * gridSize || num2 > (float)amountAroundCamera * gridSize)
{
return false;
}
return true;
}
private void Update()
{
//IL_001b: 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_002b: 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_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: 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_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)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: 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_0063: 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_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: 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_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: 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_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_01b3: 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_01e1: Unknown result type (might be due to invalid IL or missing references)
//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0205: Unknown result type (might be due to invalid IL or missing references)
Camera currentCamera = WorldHandler.instance.CurrentCamera;
if ((Object)(object)currentCamera == (Object)null)
{
return;
}
Vector3 val = ((Component)currentCamera).transform.forward - Vector3.Project(((Component)currentCamera).transform.forward, Vector3.up);
Vector3 normalized = ((Vector3)(ref val)).normalized;
Vector3 position = ((Component)currentCamera).transform.position + normalized * gridSize;
Vector2 val2 = GridSnapPosition(position);
float y = ((Component)currentCamera).transform.position.y;
float num = Mathf.Max(0f, Vector3.Dot(((Component)currentCamera).transform.forward, Vector3.up));
y += heightOffsetWhenLookingUp * num;
Dictionary<Vector2, GameObject> dictionary = new Dictionary<Vector2, GameObject>();
foreach (KeyValuePair<Vector2, GameObject> particle in particles)
{
if (!InRange(particle.Key, val2))
{
AddToPool(particle.Value);
continue;
}
particle.Value.transform.position = new Vector3(particle.Value.transform.position.x, y, particle.Value.transform.position.z);
dictionary[particle.Key] = particle.Value;
}
particles = dictionary;
Vector2 val3 = default(Vector2);
for (int i = -amountAroundCamera; i <= amountAroundCamera; i++)
{
for (int j = -amountAroundCamera; j <= amountAroundCamera; j++)
{
((Vector2)(ref val3))..ctor(val2.x + (float)i * gridSize, val2.y + (float)j * gridSize);
if (!particles.ContainsKey(val3))
{
GameObject fromPool = GetFromPool();
fromPool.transform.position = new Vector3(val3.x + gridSize * 0.5f, y, val3.y + gridSize * 0.5f);
particles[val3] = fromPool;
}
}
}
}
}
public class FauxHead : MonoBehaviour
{
[SerializeField]
private float timeIdleToConsiderGrounded = 0.2f;
[SerializeField]
private float maximumDistanceTravelledToConsiderGrounded = 0.05f;
private float lastMovedHeight;
private float currentTimeIdle;
[SerializeField]
private LayerMask groundMask;
[SerializeField]
private float groundRayLength = 0.5f;
[SerializeField]
private float kickCooldownInSeconds = 0.5f;
private float currentKickCooldown;
private int currentJuggles;
private Rigidbody body;
private bool onGround;
private void Awake()
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
body = ((Component)this).GetComponent<Rigidbody>();
lastMovedHeight = ((Component)this).transform.position.y;
}
private void OnTriggerStay(Collider other)
{
if (((Component)other).gameObject.layer != 18 || currentKickCooldown > 0f)
{
return;
}
Player val = ((Component)other).GetComponentInParent<Player>();
if ((Object)(object)val == (Object)null)
{
val = ((Component)other).GetComponentInChildren<Player>();
}
if ((Object)(object)val == (Object)null || val.isAI)
{
return;
}
FauxJuggleUI fauxJuggleUI = WinterUI.Instance?.FauxJuggleUI;
if (!((Object)(object)fauxJuggleUI == (Object)null))
{
currentKickCooldown = kickCooldownInSeconds;
currentJuggles++;
currentTimeIdle = 0f;
if (currentJuggles >= 2)
{
fauxJuggleUI.UpdateCounter(currentJuggles);
}
}
}
private void FixedUpdate()
{
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: 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_0055: 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)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
currentKickCooldown -= Core.dt;
if (currentKickCooldown < 0f)
{
currentKickCooldown = 0f;
}
if (currentKickCooldown <= 0f)
{
RaycastHit val = default(RaycastHit);
if (Physics.Raycast(new Ray(((Component)this).transform.position, Vector3.down), ref val, groundRayLength, LayerMask.op_Implicit(groundMask), (QueryTriggerInteraction)1))
{
onGround = true;
if (Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref val)).collider).GetComponent<Player>()))
{
onGround = false;
}
}
else
{
onGround = false;
}
}
else
{
onGround = false;
}
if (onGround)
{
currentTimeIdle = 0f;
}
if (Mathf.Abs(((Component)this).transform.position.y - lastMovedHeight) > maximumDistanceTravelledToConsiderGrounded)
{
currentTimeIdle = 0f;
lastMovedHeight = ((Component)this).transform.position.y;
}
else
{
currentTimeIdle += Core.dt;
if (currentTimeIdle > timeIdleToConsiderGrounded)
{
onGround = true;
}
}
if (onGround)
{
currentJuggles = 0;
FauxJuggleUI fauxJuggleUI = WinterUI.Instance?.FauxJuggleUI;
if ((Object)(object)fauxJuggleUI != (Object)null && onGround && fauxJuggleUI.CurrentJuggleAmount > 0)
{
fauxJuggleUI.EndJuggle();
}
}
}
}
public class FauxJuggleUI : MonoBehaviour
{
[HideInInspector]
public int CurrentJuggleAmount;
[SerializeField]
private TextMeshProUGUI counterLabel;
[SerializeField]
private TextMeshProUGUI highScoreLabel;
[SerializeField]
private float highScoreLabelGrowSize = 5f;
[SerializeField]
private float highScoreLabelAnimationDuration = 0.5f;
[SerializeField]
private float highScoreLabelDisplayDuration = 2f;
private float highScoreLabelDefaultSize;
private float counterLabelDefaultSize;
public bool Visible
{
get
{
return ((Component)this).gameObject.activeSelf;
}
set
{
if (value && !((Component)this).gameObject.activeSelf)
{
((Component)this).gameObject.SetActive(true);
}
else if (!value && ((Component)this).gameObject.activeSelf)
{
((Component)this).gameObject.SetActive(false);
}
}
}
private void Awake()
{
Visible = false;
highScoreLabelDefaultSize = ((TMP_Text)highScoreLabel).fontSize;
counterLabelDefaultSize = ((TMP_Text)counterLabel).fontSize;
}
public void EndJuggle()
{
((MonoBehaviour)this).StopAllCoroutines();
ILocalProgress localProgress = WinterProgress.Instance.LocalProgress;
if (CurrentJuggleAmount > localProgress.FauxJuggleHighScore)
{
localProgress.FauxJuggleHighScore = CurrentJuggleAmount;
localProgress.Save();
UpdateHighScoreLabelNew();
((MonoBehaviour)this).StartCoroutine(PlayHighScoreAnimation());
}
((MonoBehaviour)this).StartCoroutine(PlayCounterAnimation());
((MonoBehaviour)this).StartCoroutine(PlayDisableUIAnimation());
CurrentJuggleAmount = 0;
}
private void UpdateHighScoreLabel()
{
ILocalProgress localProgress = WinterProgress.Instance.LocalProgress;
((TMP_Text)highScoreLabel).text = $"High score: {localProgress.FauxJuggleHighScore}";
}
private void UpdateHighScoreLabelNew()
{
ILocalProgress localProgress = WinterProgress.Instance.LocalProgress;
((TMP_Text)highScoreLabel).text = $"High score: {localProgress.FauxJuggleHighScore}(NEW!)";
}
public void UpdateCounter(int number)
{
((MonoBehaviour)this).StopAllCoroutines();
Visible = true;
UpdateHighScoreLabel();
((TMP_Text)highScoreLabel).fontSize = highScoreLabelDefaultSize;
CurrentJuggleAmount = number;
((TMP_Text)counterLabel).text = CurrentJuggleAmount.ToString();
}
private IEnumerator PlayDisableUIAnimation()
{
yield return (object)new WaitForSeconds(highScoreLabelDisplayDuration);
Visible = false;
}
private IEnumerator PlayHighScoreAnimation()
{
float animationTimer = 0f;
AnimationCurve animationCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
while (animationTimer < highScoreLabelDisplayDuration)
{
animationTimer += Core.dt;
float num = animationCurve.Evaluate(Mathf.Min(1f, animationTimer / highScoreLabelAnimationDuration));
((TMP_Text)highScoreLabel).fontSize = highScoreLabelDefaultSize + highScoreLabelGrowSize * num;
yield return null;
}
}
private IEnumerator PlayCounterAnimation()
{
float animationTimer = 0f;
AnimationCurve animationCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
while (animationTimer < highScoreLabelDisplayDuration)
{
animationTimer += Core.dt;
float num = animationCurve.Evaluate(Mathf.Min(1f, animationTimer / highScoreLabelAnimationDuration));
((TMP_Text)counterLabel).fontSize = counterLabelDefaultSize + highScoreLabelGrowSize * num;
yield return null;
}
}
}
public class Firework : MonoBehaviour
{
public Color LightColor = Color.white;
private ParticleSystem particleSystem;
private void Awake()
{
particleSystem = ((Component)this).GetComponent<ParticleSystem>();
if ((Object)(object)particleSystem != (Object)null)
{
particleSystem.Stop();
}
}
public void Launch()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
AmbientOverride.Instance.AddSkyLight(LightColor);
if (!((Object)(object)particleSystem == (Object)null))
{
particleSystem.Stop();
particleSystem.Play();
}
}
}
public class FireworkDebugUI : MonoBehaviour
{
public static FireworkDebugUI Instance { get; private set; }
public static void Create()
{
//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_0028: Expected O, but got Unknown
if (!((Object)(object)Instance != (Object)null))
{
GameObject val = new GameObject("Winterland FireworkDebugUI");
Instance = val.AddComponent<FireworkDebugUI>();
Object.DontDestroyOnLoad((Object)val);
}
}
private void Awake()
{
DebugUI.Instance.RegisterMenu("Fireworks", OnDebugUI);
}
private void OnDebugUI()
{
GUILayout.Label("Fireworks", Array.Empty<GUILayoutOption>());
FireworkHolder instance = FireworkHolder.Instance;
if (!((Object)(object)instance == (Object)null))
{
if (GUILayout.Button("Launch Fireworks Locally", Array.Empty<GUILayoutOption>()))
{
instance.Launch();
}
if (GUILayout.Button("Broadcast Fireworks", Array.Empty<GUILayoutOption>()))
{
instance.BroadcastLaunch();
}
if (GUILayout.Button("Simulate fireworks received", Array.Empty<GUILayoutOption>()))
{
instance.DispatchReceivedLaunch();
}
}
}
}
public class FireworkHandplantTrigger : MonoBehaviour
{
}
public class FireworkHolder : MonoBehaviour
{
public static FireworkHolder Instance;
[HideInInspector]
public DateTime LastTriggeredFireworks;
public float CooldownSeconds = 30f;
public float TimeForFirstLaunch = 0.4f;
public float MinimumTimeBetweenLaunches = 1f;
public float MaximumTimeBetweenLaunches = 2f;
public AudioClip FireworkSFX;
public int FireworkAmount = 10;
private Firework[] fireworks;
private const string PacketID = "Xmas-Client-Fireworks";
private void Awake()
{
if (!((Object)(object)Instance != (Object)null))
{
Instance = this;
fireworks = ((Component)this).GetComponentsInChildren<Firework>(true);
if (WinterNetworking.SlopCrewInstalled)
{
SlopCrewStep();
}
}
void SlopCrewStep()
{
APIManager.API.OnCustomPacketReceived += CustomPacketReceived;
}
}
private void CustomPacketReceived(uint playerid, string packetid, byte[] data)
{
if (!(packetid != "Xmas-Client-Fireworks"))
{
DispatchReceivedLaunch();
}
}
private void OnDestroy()
{
if ((Object)(object)Instance == (Object)(object)this)
{
Instance = null;
}
if (WinterNetworking.SlopCrewInstalled)
{
SlopCrewStep();
}
void SlopCrewStep()
{
APIManager.API.OnCustomPacketReceived -= CustomPacketReceived;
}
}
public void Launch()
{
AudioManager audioManager = Core.Instance.AudioManager;
audioManager.PlayNonloopingSfx(audioManager.audioSources[3], FireworkSFX, audioManager.mixerGroups[3], 0f);
((MonoBehaviour)this).StartCoroutine(LaunchCoroutine(TimeForFirstLaunch));
((MonoBehaviour)this).StartCoroutine(LaunchCoroutine(TimeForFirstLaunch + 0.5f));
}
public bool DispatchReceivedLaunch()
{
DateTime now = DateTime.Now;
if ((now - LastTriggeredFireworks).TotalSeconds <= (double)CooldownSeconds)
{
return false;
}
LastTriggeredFireworks = now;
Launch();
return true;
}
public void BroadcastLaunch()
{
if (DispatchReceivedLaunch() && WinterNetworking.SlopCrewInstalled)
{
SlopCrewStep();
}
static void SlopCrewStep()
{
APIManager.API.SendCustomPacket("Xmas-Client-Fireworks", new byte[0]);
}
}
private IEnumerator LaunchCoroutine(float delay)
{
List<Firework> potentialFireworks = fireworks.ToList();
yield return (object)new WaitForSeconds(delay);
for (int i = 0; i < FireworkAmount; i++)
{
float num = Random.Range(MinimumTimeBetweenLaunches, MaximumTimeBetweenLaunches);
int index = Random.Range(0, potentialFireworks.Count);
Firework firework = potentialFireworks[index];
potentialFireworks.RemoveAt(index);
firework.Launch();
yield return (object)new WaitForSeconds(num);
}
}
}
public class GiftPile : MonoBehaviour
{
public int MinimumGiftAmount = 1;
private void Awake()
{
GiftPileManager.Instance.RegisterPile(this);
}
private void Start()
{
UpdateAvailability();
}
public void UpdateAvailability()
{
((Component)this).gameObject.SetActive(WinterProgress.Instance.LocalProgress.Gifts >= MinimumGiftAmount);
}
}
public class GiftPileManager : MonoBehaviour
{
public List<GiftPile> GiftPiles = new List<GiftPile>();
public static GiftPileManager Instance { get; private set; }
private void Awake()
{
Instance = this;
}
public void RegisterPile(GiftPile giftPile)
{
GiftPiles.Add(giftPile);
}
public void UpdatePiles()
{
foreach (GiftPile giftPile in GiftPiles)
{
giftPile.UpdateAvailability();
}
}
}
public static class GUILayoutUtility
{
private class HorizontalDisposable : IDisposable
{
public void Dispose()
{
GUILayout.EndHorizontal();
}
}
private class VerticalDisposable : IDisposable
{
public void Dispose()
{
GUILayout.EndVertical();
}
}
public static IDisposable Horizontal(params GUILayoutOption[] options)
{
GUILayout.BeginHorizontal(options);
return new HorizontalDisposable();
}
public static IDisposable Vertical(params GUILayoutOption[] options)
{
GUILayout.BeginVertical(options);
return new VerticalDisposable();
}
public static IDisposable Horizontal()
{
throw new NotImplementedException();
}
}
public interface IGlobalProgress
{
public delegate void OnGlobalStageChangedHandler();
XmasServerEventStatePacket State { get; }
event OnGlobalStageChangedHandler OnGlobalStateChanged;
}
public class WritableGlobalProgress : IGlobalProgress
{
public XmasServerEventStatePacket State { get; private set; }
public event IGlobalProgress.OnGlobalStageChangedHandler OnGlobalStateChanged;
public void SetState(XmasServerEventStatePacket state)
{
State = state;
this.OnGlobalStateChanged?.Invoke();
}
}
public interface ILocalProgress
{
int CurrentPhaseGifts { get; set; }
int CurrentPhase { get; set; }
WinterObjective Objective { get; set; }
int Gifts { get; set; }
int FauxJuggleHighScore { get; set; }
int ToyLinesCollected { get; }
bool ArcadeUnlocked { get; set; }
TimeOfDayController.TimesOfDay TimeOfDay { get; set; }
bool SingleplayerUpdateNew { get; set; }
void InitializeNew();
void Save();
void Load();
void SetNPCDirty(CustomNPC npc);
SerializedNPC GetNPCProgress(CustomNPC npc);
void SetToyLineCollected(Guid guid, bool collected);
bool IsToyLineCollected(Guid guid);
void SetChallengeBestTime(ChallengeLevel challenge, float bestTime);
float GetChallengeBestTime(ChallengeLevel challenge);
void UpdateTree(bool reset = false);
}
public class JumpSequenceAction : SequenceAction
{
[Header("Target action to jump to.")]
public string Target = "";
public override void Run(bool immediate)
{
base.Run(immediate);
SequenceAction actionByName = Sequence.Sequence.GetActionByName(Target);
if ((Object)(object)actionByName != (Object)null)
{
actionByName.Run(immediate);
}
else
{
Finish(immediate);
}
}
}
public class LocalProgress : ILocalProgress
{
private const byte Version = 6;
private string savePath;
private Dictionary<Guid, SerializedNPC> npcs;
private HashSet<Guid> collectedToyLines;
private Dictionary<string, float> challengeBestTimes;
public int CurrentPhaseGifts { get; set; }
public int CurrentPhase { get; set; }
public WinterObjective Objective { get; set; }
public int Gifts { get; set; }
public int FauxJuggleHighScore { get; set; }
public int ToyLinesCollected => collectedToyLines.Count;
public bool ArcadeUnlocked { get; set; }
public TimeOfDayController.TimesOfDay TimeOfDay { get; set; }
public bool SingleplayerUpdateNew { get; set; }
public LocalProgress()
{
InitializeNew();
}
public void UpdateTree(bool reset = false)
{
if ((Object)(object)TreeController.Instance == (Object)null)
{
return;
}
if (CurrentPhase < TreeController.Instance.treePhases.Length - 1)
{
int goalForPhase = SingleplayerPhases.GetGoalForPhase(CurrentPhase);
if (CurrentPhaseGifts >= goalForPhase)
{
CurrentPhase++;
CurrentPhaseGifts = 0;
}
}
MakeState();
if (reset)
{
TreeController.Instance.ResetToTarget();
}
}
public void MakeState()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Expected O, but got Unknown
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Expected O, but got Unknown
XmasServerEventStatePacket val = new XmasServerEventStatePacket();
for (int i = 0; i <= CurrentPhase; i++)
{
XmasPhase val2 = new XmasPhase();
val2.Active = false;
if (i == CurrentPhase)
{
val2.Active = true;
}
else
{
val2.GiftsCollected = 1u;
}
val2.GiftsGoal = 1u;
val.Phases.Add(val2);
}
(WinterProgress.Instance.GlobalProgress as SingleplayerGlobalProgress).SetState(val);
}
public void InitializeNew()
{
npcs = new Dictionary<Guid, SerializedNPC>();
collectedToyLines = new HashSet<Guid>();
challengeBestTimes = new Dictionary<string, float>();
Gifts = 0;
FauxJuggleHighScore = 0;
ArcadeUnlocked = false;
Objective = ObjectiveDatabase.StartingObjective;
savePath = Path.Combine(Paths.ConfigPath, "MilleniumWinterland/localprogress.mwp");
TimeOfDay = TimeOfDayController.TimesOfDay.Night;
SingleplayerUpdateNew = true;
CurrentPhase = 0;
CurrentPhaseGifts = 0;
}
public void Save()
{
using MemoryStream memoryStream = new MemoryStream();
using (BinaryWriter writer = new BinaryWriter(memoryStream))
{
Write(writer);
}
CustomStorage.Instance.WriteFile(memoryStream.ToArray(), savePath);
}
public void SetNPCDirty(CustomNPC npc)
{
npcs[npc.GUID] = new SerializedNPC(npc);
}
public void SetToyLineCollected(Guid guid, bool collected)
{
if (collected)
{
collectedToyLines.Add(guid);
}
else
{
collectedToyLines.Remove(guid);
}
}
public bool IsToyLineCollected(Guid guid)
{
return collectedToyLines.Contains(guid);
}
public SerializedNPC GetNPCProgress(CustomNPC npc)
{
if (!npcs.TryGetValue(npc.GUID, out var value))
{
return null;
}
return value;
}
public void Load()
{
if (!File.Exists(savePath))
{
Debug.Log((object)"No Winterland save to load, starting a new game.");
return;
}
using FileStream input = File.Open(savePath, FileMode.Open);
using BinaryReader reader = new BinaryReader(input);
try
{
Read(reader);
}
catch (Exception arg)
{
Debug.LogError((object)$"Failed to load Winterland save!{Environment.NewLine}{arg}");
}
}
private void Write(BinaryWriter writer)
{
writer.Write((byte)6);
writer.Write(((Object)Objective).name);
writer.Write(npcs.Count);
foreach (SerializedNPC value in npcs.Values)
{
value.Write(writer);
}
writer.Write(Gifts);
writer.Write(collectedToyLines.Count);
foreach (Guid collectedToyLine in collectedToyLines)
{
writer.Write(collectedToyLine.ToString());
}
writer.Write(FauxJuggleHighScore);
writer.Write(ArcadeUnlocked);
writer.Write(challengeBestTimes.Count);
foreach (KeyValuePair<string, float> challengeBestTime in challengeBestTimes)
{
writer.Write(challengeBestTime.Key);
writer.Write(challengeBestTime.Value);
}
writer.Write((int)TimeOfDay);
writer.Write(SingleplayerUpdateNew);
writer.Write(CurrentPhase);
writer.Write(CurrentPhaseGifts);
}
private void Read(BinaryReader reader)
{
npcs.Clear();
byte b = reader.ReadByte();
if (b > 6)
{
Debug.LogError((object)$"Attemped to read a Winterland save that's too new (version {b}), current version is {(byte)6}.");
return;
}
WinterObjective objective = ObjectiveDatabase.GetObjective(reader.ReadString());
if ((Object)(object)objective != (Object)null)
{
Objective = objective;
}
else
{
Objective = ObjectiveDatabase.StartingObjective;
}
if (b > 0)
{
int num = reader.ReadInt32();
for (int i = 0; i < num; i++)
{
SerializedNPC serializedNPC = new SerializedNPC(reader);
if (serializedNPC.GUID != Guid.Empty)
{
npcs[serializedNPC.GUID] = serializedNPC;
}
}
}
if (b > 1)
{
Gifts = reader.ReadInt32();
int num2 = reader.ReadInt32();
for (int j = 0; j < num2; j++)
{
Guid guid = Guid.Parse(reader.ReadString());
SetToyLineCollected(guid, collected: true);
}
}
if (b > 2)
{
FauxJuggleHighScore = reader.ReadInt32();
}
if (b > 3)
{
ArcadeUnlocked = reader.ReadBoolean();
int num3 = reader.ReadInt32();
for (int k = 0; k < num3; k++)
{
string key = reader.ReadString();
challengeBestTimes[key] = reader.ReadSingle();
}
}
if (b > 4)
{
TimeOfDay = (TimeOfDayController.TimesOfDay)reader.ReadInt32();
SingleplayerUpdateNew = reader.ReadBoolean();
}
if (b > 5)
{
CurrentPhase = reader.ReadInt32();
CurrentPhaseGifts = reader.ReadInt32();
}
}
public void SetChallengeBestTime(ChallengeLevel challenge, float bestTime)
{
challengeBestTimes[challenge.GUID] = bestTime;
}
public float GetChallengeBestTime(ChallengeLevel challenge)
{
if (challengeBestTimes.TryGetValue(challenge.GUID, out var value))
{
return value;
}
return 0f;
}
}
public class LocalProgressDebugUI : MonoBehaviour
{
public static LocalProgressDebugUI Instance { get; private set; }
public static void Create()
{
//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_0028: Expected O, but got Unknown
if (!((Object)(object)Instance != (Object)null))
{
GameObject val = new GameObject("Winterland LocalProgressDebugUI");
Instance = val.AddComponent<LocalProgressDebugUI>();
Object.DontDestroyOnLoad((Object)val);
}
}
private void Awake()
{
DebugUI.Instance.RegisterMenu("Local Progress", OnDebugUI);
}
private void OnDebugUI()
{
ILocalProgress localProgress = WinterProgress.Instance.LocalProgress;
ToyLineManager instance = ToyLineManager.Instance;
if (localProgress != null)
{
GUILayout.Label("Local Progress", Array.Empty<GUILayoutOption>());
GUILayout.Label("Using " + localProgress.GetType().Name, Array.Empty<GUILayoutOption>());
GUILayout.Label($"[ILocalProgress] Gifts wrapped: {localProgress.Gifts}", Array.Empty<GUILayoutOption>());
GUILayout.Label($"[ILocalProgress] Faux head juggle high score: {localProgress.FauxJuggleHighScore}", Array.Empty<GUILayoutOption>());
GUILayout.Label("[ILocalProgress] Current objective: " + ((Object)localProgress.Objective).name, Array.Empty<GUILayoutOption>());
if (GUILayout.Button("Reset Progress", Array.Empty<GUILayoutOption>()))
{
localProgress.InitializeNew();
localProgress.Save();
}
}
if (!((Object)(object)instance != (Object)null))
{
return;
}
GUILayout.Label("Toy Line Manager", Array.Empty<GUILayoutOption>());
GUILayout.Label($"[ToyLineManager] Collected all Toy Lines: {instance.GetCollectedAllToyLines()}", Array.Empty<GUILayoutOption>());
GUILayout.Label($"[ToyLineManager] Toy Lines in this stage: {instance.ToyLines.Count}", Array.Empty<GUILayoutOption>());
if (GUILayout.Button("Respawn Toy Lines", Array.Empty<GUILayoutOption>()))
{
instance.RespawnAllToyLines();
}
if (!GUILayout.Button("Collect all Toy Lines", Array.Empty<GUILayoutOption>()))
{
return;
}
foreach (ToyLine toyLine in instance.ToyLines)
{
toyLine.Collect();
}
}
}
public class MaterialReplacer : MonoBehaviour
{
public string NameOfMaterialToReplace;
public Material ReplacementMaterial;
public bool UseBRCShader;
public ShaderNames BRCShaderName = (ShaderNames)1;
private void Start()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
if (UseBRCShader)
{
ReplacementMaterial.shader = AssetAPI.GetShader(BRCShaderName);
}
Renderer[] array = Object.FindObjectsOfType<Renderer>();
foreach (Renderer val in array)
{
if (!val.sharedMaterials.Any((Material x) => (Object)(object)x != (Object)null && ((Object)x).name == NameOfMaterialToReplace))
{
continue;
}
Material[] array2 = (Material[])(object)new Material[val.sharedMaterials.Length];
for (int j = 0; j < val.sharedMaterials.Length; j++)
{
Material val2 = val.sharedMaterials[j];
if ((Object)(object)val2 != (Object)null && ((Object)val2).name == NameOfMaterialToReplace)
{
array2[j] = ReplacementMaterial;
}
else
{
array2[j] = val2;
}
}
val.sharedMaterials = array2;
}
}
}
public class Moon : MonoBehaviour
{
private void Update()
{
//IL_0031: 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_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
Camera currentCamera = WorldHandler.instance.currentCamera;
if (!((Object)(object)currentCamera == (Object)null))
{
AmbientOverride instance = AmbientOverride.Instance;
if (!((Object)(object)instance == (Object)null))
{
((Component)this).transform.position = ((Component)currentCamera).transform.position;
((Component)this).transform.rotation = Quaternion.LookRotation(-((Component)instance).transform.forward);
}
}
}
}
public class NotificationSequenceAction : SequenceAction
{
[Header("Text to show in this UI Notification.")]
public string NotificationText = "";
public override void Run(bool immediate)
{
base.Run(immediate);
Core.Instance.UIManager.ShowNotification(NotificationText, Array.Empty<string>());
Finish(immediate);
}
}
public static class ObjectiveDatabase
{
public static WinterObjective StartingObjective;
private static Dictionary<string, WinterObjective> ObjectiveByName;
public static void Initialize(AssetBundle bundle)
{
ObjectiveByName = new Dictionary<string, WinterObjective>();
WinterObjective[] array = bundle.LoadAllAssets<WinterObjective>();
foreach (WinterObjective winterObjective in array)
{
ObjectiveByName[((Object)winterObjective).name] = winterObjective;
if (winterObjective.StartingObjective)
{
StartingObjective = winterObjective;
}
}
}
public static WinterObjective GetObjective(string objectiveName)
{
if (ObjectiveByName.TryGetValue(objectiveName, out var value))
{
return value;
}
return null;
}
}
public abstract class OrderedComponent : MonoBehaviour
{
[HideInInspector]
public int Order = -1;
public virtual bool IsPeer(Component other)
{
if (((object)other).GetType() == ((object)this).GetType())
{
return true;
}
return false;
}
protected virtual void OnValidate()
{
if (Order < 0 || GetOrderCollision(Order))
{
Order = GetHighestOrder() + 1;
}
}
public void SetHighestOrder()
{
Order = GetHighestOrder() + 1;
}
public OrderedComponent MoveUp()
{
OrderedComponent firstComponentAbove = GetFirstComponentAbove(Order);
if ((Object)(object)firstComponentAbove != (Object)null)
{
int order = Order;
Order = firstComponentAbove.Order;
firstComponentAbove.Order = order;
}
return firstComponentAbove;
}
public OrderedComponent MoveDown()
{
OrderedComponent firstComponentBelow = GetFirstComponentBelow(Order);
if ((Object)(object)firstComponentBelow != (Object)null)
{
int order = Order;
Order = firstComponentBelow.Order;
firstComponentBelow.Order = order;
}
return firstComponentBelow;
}
private OrderedComponent GetFirstComponentAbove(int order)
{
OrderedComponent[] componentsAbove = GetComponentsAbove(order);
OrderedComponent orderedComponent = null;
OrderedComponent[] array = componentsAbove;
foreach (OrderedComponent orderedComponent2 in array)
{
if ((Object)(object)orderedComponent == (Object)null)
{
orderedComponent = orderedComponent2;
}
else if (orderedComponent2.Order > orderedComponent.Order)
{
orderedComponent = orderedComponent2;
}
}
return orderedComponent;
}
private OrderedComponent GetFirstComponentBelow(int order)
{
OrderedComponent[] componentsBelow = GetComponentsBelow(order);
OrderedComponent orderedComponent = null;
OrderedComponent[] array = componentsBelow;
foreach (OrderedComponent orderedComponent2 in array)
{
if ((Object)(object)orderedComponent == (Object)null)
{
orderedComponent = orderedComponent2;
}
else if (orderedComponent2.Order < orderedComponent.Order)
{
orderedComponent = orderedComponent2;
}
}
return orderedComponent;
}
private OrderedComponent[] GetComponentsAbove(int order)
{
return (from x in ((Component)this).gameObject.GetComponents<OrderedComponent>()
where x.Order < order && IsPeer((Component)(object)x)
select x).ToArray();
}
private OrderedComponent[] GetComponentsBelow(int order)
{
return (from x in ((Component)this).gameObject.GetComponents<OrderedComponent>()
where x.Order > order && IsPeer((Component)(object)x)
select x).ToArray();
}
private int GetHighestOrder()
{
IEnumerable<OrderedComponent> enumerable = from x in ((Component)this).gameObject.GetComponents<OrderedComponent>()
where IsPeer((Component)(object)x)
select x;
int num = -1;
foreach (OrderedComponent item in enumerable)
{
if (item.Order > num)
{
num = item.Order;
}
}
return num;
}
private bool GetOrderCollision(int order)
{
return ((Component)this).gameObject.GetComponents<OrderedComponent>().Any((OrderedComponent x) => x.Order == order && IsPeer((Component)(object)x) && (Object)(object)x != (Object)(object)this);
}
public static T[] GetComponentsOrdered<T>(GameObject gameObject, Func<T, bool> predicate = null) where T : OrderedComponent
{
T[] source = gameObject.GetComponents<T>();
if (predicate != null)
{
source = source.Where(predicate).ToArray();
}
List<T> list = source.ToList();
list.Sort((T x, T y) => x.Order - y.Order);
return list.ToArray();
}
}
[RequireComponent(typeof(SnowSinker))]
[RequireComponent(typeof(Rigidbody))]
public class PhysicsSnowSinker : MonoBehaviour
{
public LayerMask Mask;
public float RayDistance = 1f;
private SnowSinker snowSinker;
private Rigidbody body;
private void Awake()
{
snowSinker = ((Component)this).GetComponent<SnowSinker>();
body = ((Component)this).GetComponent<Rigidbody>();
}
private void FixedUpdate()
{
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: 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_0038: Unknown result type (might be due to invalid IL or missing references)
RaycastHit val = default(RaycastHit);
if (body.isKinematic)
{
snowSinker.Enabled = false;
}
else if (Physics.Raycast(new Ray(((Component)this).transform.position, Vector3.down), ref val, RayDistance, LayerMask.op_Implicit(Mask), (QueryTriggerInteraction)1))
{
bool flag = true;
if ((Object)(object)((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponent<Rigidbody>() != (Object)null)
{
flag = false;
}
if (flag)
{
snowSinker.Enabled = true;
}
else
{
snowSinker.Enabled = false;
}
}
else
{
snowSinker.Enabled = false;
}
}
}
public class PickupRotation : MonoBehaviour
{
[SerializeField]
private Vector3 rotationSpeed;
private void Update()
{
//IL_0007: 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)
((Component)this).transform.Rotate(rotationSpeed * Time.deltaTime, (Space)0);
}
}
public class PlayerCollisionUtility
{
public static Player GetPlayer(Collider other, bool includeAI = false)
{
Player val = ((Component)other).GetComponent<Player>();
if ((Object)(object)val == (Object)null)
{
val = ((Component)other).GetComponentInParent<Player>();
}
if ((Object)(object)val == (Object)null)
{
val = ((Component)other).GetComponentInChildren<Player>();
}
if (!includeAI && val.isAI)
{
return null;
}
return val;
}
}
public class PlayTimelineOnObjective : GameplayEvent
{
public WinterObjective RequiredObjective;
public WinterObjective ObjectiveToSet;
public PlayableDirector Director;
public string Music = "MusicTrack_Hwbouths";
private void OnPostInitialization()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
StageManager.OnStagePostInitialization -= new OnStageInitializedDelegate(OnPostInitialization);
ILocalProgress localProgress = WinterProgress.Instance.LocalProgress;
if (((Object)localProgress.Objective).name == ((Object)RequiredObjective).name)
{
localProgress.Objective = ObjectiveToSet;
localProgress.Save();
if (!string.IsNullOrEmpty(Music))
{
MusicTrack val = Core.Instance.Assets.LoadAssetFromBundle<MusicTrack>("coreassets", Music);
if ((Object)(object)val != (Object)null)
{
IMusicPlayer musicPlayer = Core.Instance.BaseModule.StageManager.musicPlayer;
musicPlayer.AddAndBufferAsCurrentTrack(val);
musicPlayer.AttemptStartCurrentTrack();
}
}
SequenceHandler.instance.StartEnteringSequence(Director, (GameplayEvent)(object)this, true, true, true, true, true, (ProgressObject)null, true, false, (Battle)null, false);
}
else
{
ShowNewStuffNotification();
}
}
public override void Awake()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
StageManager.OnStagePostInitialization += new OnStageInitializedDelegate(OnPostInitialization);
}
public override void ExitSequence(PlayableDirector sequence, bool invokeEvent = true, bool restartCurrentEncounter = false)
{
((GameplayEvent)this).ExitSequence(sequence, invokeEvent, restartCurrentEncounter);
ShowNewStuffNotification();
}
private void ShowNewStuffNotification()
{
ILocalProgress localProgress = WinterProgress.Instance.LocalProgress;
if (localProgress.SingleplayerUpdateNew)
{
Core.Instance.UIManager.ShowNotification("Check out the new Winterland app on your phone to set things up to your liking!", Array.Empty<string>());
localProgress.SingleplayerUpdateNew = false;
localProgress.Save();
}
}
public override void OnDestroy()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
StageManager.OnStagePostInitialization -= new OnStageInitializedDelegate(OnPostInitialization);
}
}
pub