using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using ChaosMod.Events;
using ChaosMod.UI;
using HarmonyLib;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UnityEngine.Video;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("ChaosMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ChaosMod")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("8da1cd7b-300c-4747-ac63-98141c78df4b")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ChaosMod
{
[BepInPlugin("nachariah.whiteknuckle.chaosmod", "ChaosMod", "1.0.3")]
public class Plugin : BaseUnityPlugin
{
public const string pluginGuid = "nachariah.whiteknuckle.chaosmod";
public const string pluginVersion = "1.0.3";
private void Awake()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
((BaseUnityPlugin)this).Logger.LogInfo((object)"[ChaosMod] Patching...");
Harmony val = new Harmony("nachariah.whiteknuckle.chaosmod");
val.PatchAll();
EventManager.LoadBundle();
EventManager.FillList();
SceneManager.sceneLoaded += OnSceneLoaded;
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
if (((Scene)(ref scene)).name == "Game-Main")
{
CommandConsole.hasCheated = true;
CL_GameManager.gamemode.allowAchievements = false;
CL_GameManager.gamemode.allowCheatedScores = false;
Main.GameStart();
if ((Object)(object)EntityHolder.buddy == (Object)null)
{
EntityHolder.SetVariables();
}
}
else if (((Scene)(ref scene)).name == "Main-Menu")
{
ChaosUI.CreateMainMenuText();
}
}
}
public static class Main
{
private static bool active = false;
public static bool hardMode = false;
private static float timeMax = 5f;
private static float timeLeft;
public static void MainUpdate()
{
if (active)
{
if (hardMode)
{
timeLeft -= Time.deltaTime * 3f;
}
else
{
timeLeft -= Time.deltaTime;
}
if (timeLeft < 0f)
{
EventManager.RandomEvent();
timeLeft = timeMax;
}
float timer = timeLeft / timeMax;
ChaosUI.instance.SetTimer(timer);
}
}
private static void StartChaos()
{
hardMode = CL_GameManager.IsHardmode();
timeLeft = timeMax;
ChaosUI.ShowUI();
active = true;
}
public static void GameStart()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
if (active)
{
active = false;
}
Scene activeScene = SceneManager.GetActiveScene();
if (((Scene)(ref activeScene)).name == "Game-Main")
{
StartChaos();
}
}
}
}
namespace ChaosMod.UI
{
public class ChaosUI : MonoBehaviour
{
public static ChaosUI instance;
public TMP_FontAsset ticketingFont = null;
private GameObject canvasObj;
private RectTransform bgRect;
private RectTransform fillRect;
private RectTransform listRoot;
private readonly List<EventEntry> entries = new List<EventEntry>();
public static void ShowUI()
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
if ((Object)(object)instance == (Object)null)
{
GameObject val = new GameObject("ChaosTimer");
instance = val.AddComponent<ChaosUI>();
instance.CreateUI();
}
}
private void CreateUI()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Expected O, but got Unknown
//IL_0093: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Expected O, but got Unknown
//IL_0158: Unknown result type (might be due to invalid IL or missing references)
//IL_019e: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
//IL_01ca: 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_01e6: Unknown result type (might be due to invalid IL or missing references)
//IL_01f4: 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)
//IL_0215: Unknown result type (might be due to invalid IL or missing references)
//IL_021c: Expected O, but got Unknown
//IL_0252: Unknown result type (might be due to invalid IL or missing references)
//IL_026d: Unknown result type (might be due to invalid IL or missing references)
//IL_0288: Unknown result type (might be due to invalid IL or missing references)
//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
//IL_02be: Unknown result type (might be due to invalid IL or missing references)
canvasObj = new GameObject();
canvasObj.transform.parent = ((Component)this).transform;
Canvas val = canvasObj.AddComponent<Canvas>();
val.renderMode = (RenderMode)0;
val.sortingOrder = 999;
canvasObj.AddComponent<CanvasScaler>().uiScaleMode = (ScaleMode)1;
GameObject val2 = new GameObject("Background");
val2.transform.parent = canvasObj.transform;
Image val3 = val2.AddComponent<Image>();
((Graphic)val3).color = new Color(0f, 0f, 0f, 0.3f);
bgRect = ((Graphic)val3).rectTransform;
bgRect.anchorMin = Vector2.zero;
bgRect.anchorMax = Vector2.right;
bgRect.pivot = Vector2.right / 2f;
bgRect.sizeDelta = new Vector2(0f, 4f);
bgRect.anchoredPosition = new Vector2(0f, 0f);
GameObject val4 = new GameObject("Background");
val4.transform.parent = val2.transform;
Image val5 = val4.AddComponent<Image>();
((Graphic)val5).color = new Color(1f, 1f, 1f, 0.6f);
val5.type = (Type)3;
val5.fillMethod = (FillMethod)0;
val5.fillOrigin = 0;
val5.fillAmount = 0f;
fillRect = ((Graphic)val5).rectTransform;
fillRect.anchorMin = Vector2.zero;
fillRect.anchorMax = Vector2.up;
fillRect.pivot = Vector2.up / 2f;
RectTransform obj = fillRect;
Rect rect = bgRect.rect;
obj.sizeDelta = new Vector2(((Rect)(ref rect)).width, 0f);
fillRect.anchoredPosition = Vector2.zero;
GameObject val6 = new GameObject("EventList");
val6.transform.SetParent(canvasObj.transform, false);
listRoot = val6.AddComponent<RectTransform>();
listRoot.anchorMin = new Vector2(1f, 0f);
listRoot.anchorMax = new Vector2(1f, 0f);
listRoot.pivot = new Vector2(1f, 0f);
listRoot.sizeDelta = new Vector2(100f, 0f);
listRoot.anchoredPosition = new Vector2(-4f, 25f);
ticketingFont = FindTicketingFont();
}
public void SetTimer(float value)
{
//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_004e: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)fillRect == (Object)null) && !((Object)(object)bgRect == (Object)null))
{
value = Mathf.Clamp01(value);
Rect rect = bgRect.rect;
float width = ((Rect)(ref rect)).width;
fillRect.sizeDelta = new Vector2(width * value, 0f);
}
}
public void AddEntry(string name, float time)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Expected O, but got Unknown
if (!((Object)(object)listRoot == (Object)null))
{
GameObject val = new GameObject(name);
val.transform.SetParent((Transform)(object)listRoot, false);
EventEntry eventEntry = val.AddComponent<EventEntry>();
eventEntry.Wake(name, time, this);
entries.Insert(0, eventEntry);
RepositionEntries();
}
}
public void RemoveEntry(EventEntry entry)
{
if (entries.Remove(entry))
{
RepositionEntries();
}
}
private void RepositionEntries()
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
float num = 0f;
for (int i = 0; i < entries.Count; i++)
{
entries[i].SetTargetPosition(new Vector2(0f, num));
num += entries[i].Height + 6f;
}
}
private static TMP_FontAsset FindTicketingFont()
{
TMP_FontAsset[] array = Resources.FindObjectsOfTypeAll<TMP_FontAsset>();
foreach (TMP_FontAsset val in array)
{
if (((Object)val).name == "Ticketing SDF")
{
return val;
}
}
Debug.LogWarning((object)"[Chaos - UI] Ticketing SDF font not found");
return null;
}
public static void CreateMainMenuText()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_0017: 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)
//IL_0057: Expected O, but got Unknown
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: 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_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("Canvas");
val.transform.SetParent(new GameObject("ChaosVersion").transform, false);
Canvas val2 = val.AddComponent<Canvas>();
val2.renderMode = (RenderMode)0;
val2.sortingOrder = 0;
val.AddComponent<CanvasScaler>().uiScaleMode = (ScaleMode)1;
GameObject val3 = new GameObject("StatusText");
val3.transform.SetParent(val.transform, false);
TMP_Text val4 = (TMP_Text)(object)val3.AddComponent<TextMeshProUGUI>();
val4.text = "CHAOS MOD v1.0.3";
val4.fontSize = 14f;
((Graphic)val4).color = Color.white;
val4.alignment = (TextAlignmentOptions)260;
TMP_FontAsset val5 = FindTicketingFont();
if ((Object)(object)val5 != (Object)null)
{
val4.font = val5;
}
RectTransform rectTransform = val4.rectTransform;
rectTransform.anchorMin = new Vector2(1f, 1f);
rectTransform.anchorMax = new Vector2(1f, 1f);
rectTransform.pivot = new Vector2(1f, 1f);
rectTransform.anchoredPosition = new Vector2(-5f, -30f);
rectTransform.sizeDelta = new Vector2(250f, 30f);
}
}
public class EventEntry : MonoBehaviour
{
private ChaosUI owner;
private RectTransform rect;
private RectTransform timerFill;
private TextMeshProUGUI label;
private bool awake = false;
private float timeLeft = 20f;
private float eventTimer = 0f;
private float eventTimerMax = 0f;
private Vector2 targetPos;
private float height = 18f;
public float Height => height;
public void Wake(string name, float time, ChaosUI ownerUI)
{
owner = ownerUI;
awake = true;
eventTimerMax = time;
eventTimer = time;
CreateEntryUI(name);
}
private void CreateEntryUI(string name)
{
//IL_0018: 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_003a: 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_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Expected O, but got Unknown
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: 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_0179: Expected O, but got Unknown
//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0214: Unknown result type (might be due to invalid IL or missing references)
//IL_0224: Unknown result type (might be due to invalid IL or missing references)
//IL_022b: Expected O, but got Unknown
//IL_025f: Unknown result type (might be due to invalid IL or missing references)
//IL_027d: Unknown result type (might be due to invalid IL or missing references)
//IL_028e: Unknown result type (might be due to invalid IL or missing references)
//IL_029f: Unknown result type (might be due to invalid IL or missing references)
//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
rect = ((Component)this).gameObject.AddComponent<RectTransform>();
rect.anchorMin = Vector2.one;
rect.anchorMax = Vector2.one;
rect.pivot = Vector2.one;
rect.sizeDelta = new Vector2(350f, height);
rect.anchoredPosition = Vector2.zero;
GameObject val = new GameObject("Text");
val.transform.SetParent(((Component)this).transform, false);
label = val.AddComponent<TextMeshProUGUI>();
((TMP_Text)label).text = name;
if ((Object)(object)owner.ticketingFont != (Object)null)
{
((TMP_Text)label).font = owner.ticketingFont;
}
((TMP_Text)label).fontSize = 10f;
((TMP_Text)label).alignment = (TextAlignmentOptions)4100;
((Graphic)label).color = Color.white;
RectTransform rectTransform = ((TMP_Text)label).rectTransform;
rectTransform.anchorMin = Vector2.zero;
rectTransform.anchorMax = Vector2.one;
rectTransform.offsetMin = new Vector2(6f, 2f);
rectTransform.offsetMax = new Vector2(-12f, -2f);
if (eventTimerMax > 0f)
{
GameObject val2 = new GameObject("Timer");
val2.transform.SetParent(((Component)this).transform, false);
Image val3 = val2.AddComponent<Image>();
((Graphic)val3).color = new Color(0f, 0f, 0f, 0.6f);
RectTransform rectTransform2 = ((Graphic)val3).rectTransform;
rectTransform2.anchorMin = Vector2.right;
rectTransform2.anchorMax = Vector2.one;
rectTransform2.pivot = new Vector2(1f, 0.5f);
rectTransform2.sizeDelta = new Vector2(8f, 0f);
rectTransform2.anchoredPosition = new Vector2(-2f, 0f);
GameObject val4 = new GameObject("Fill");
val4.transform.SetParent(val2.transform, false);
Image val5 = val4.AddComponent<Image>();
((Graphic)val5).color = new Color(1f, 1f, 1f, 0.6f);
timerFill = ((Graphic)val5).rectTransform;
timerFill.anchorMin = Vector2.zero;
timerFill.anchorMax = Vector2.right;
timerFill.pivot = Vector2.right / 2f;
RectTransform obj = timerFill;
Rect val6 = rectTransform2.rect;
obj.sizeDelta = new Vector2(0f, ((Rect)(ref val6)).height);
timerFill.anchoredPosition = Vector2.zero;
}
}
public void SetTargetPosition(Vector2 pos)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
targetPos = pos;
}
private void Update()
{
//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_00e4: 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_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
if (awake)
{
if (timeLeft > 0f)
{
timeLeft -= Time.deltaTime;
}
if (eventTimer > 0f)
{
eventTimer -= Time.deltaTime;
}
if ((Object)(object)timerFill != (Object)null && eventTimerMax > 0f)
{
float num = Mathf.Clamp01(eventTimer / eventTimerMax);
Rect val = rect.rect;
float num2 = ((Rect)(ref val)).height;
timerFill.sizeDelta = new Vector2(0f, num2 * num);
}
rect.anchoredPosition = Vector2.Lerp(rect.anchoredPosition, targetPos, Time.deltaTime * 12f);
if (timeLeft <= 0f && eventTimer <= 0f)
{
owner.RemoveEntry(this);
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
}
}
}
namespace ChaosMod.Patches
{
[HarmonyPatch(typeof(ENT_Player), "Update")]
public static class ENT_Player_Update_Patch
{
[HarmonyPostfix]
private static void Postfix(ENT_Player __instance)
{
Main.MainUpdate();
}
}
[HarmonyPatch(typeof(ENT_Player), "OnControllerColliderHit")]
public static class ENT_Player_Hit_Patch
{
[HarmonyPostfix]
private static void Postfix(ENT_Player __instance, ControllerColliderHit hit)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Expected O, but got Unknown
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Expected O, but got Unknown
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Expected O, but got Unknown
if ((Object)(object)hit.gameObject.GetComponent<PirateAI>() != (Object)null)
{
DeathType val = new DeathType();
val.deathText = "DEAD MEN TELL NO TALES";
CL_GameManager.gMan.deathTypes[0] = val;
EventManager.PlayAudio((AudioClip)EventManager.prefabs["ShipCollide"], 0.85f);
((GameEntity)__instance).Kill("");
}
else if ((Object)(object)hit.gameObject.GetComponent<TrainAI>() != (Object)null)
{
DeathType val2 = new DeathType();
val2.deathText = "TOO MUCH OLD SPICE";
CL_GameManager.gMan.deathTypes[0] = val2;
EventManager.PlayAudio((AudioClip)EventManager.prefabs["TrainHit"], 0.75f, 0.9f);
((GameEntity)__instance).Kill("");
}
}
}
}
namespace ChaosMod.Events
{
public class EventManager : MonoBehaviour
{
private static List<Event> Events = new List<Event>();
public static Dictionary<string, Object> prefabs = new Dictionary<string, Object>();
public static AssetBundle chaosBundle = null;
public static void FillList()
{
Events.Clear();
Events.Add(default(Event).SetEntry("Perk Overdose", 0f, PerkOverdose));
Events.Add(default(Event).SetEntry("Bloodbug Infestation", 0f, BloodbugHorde));
Events.Add(default(Event).SetEntry("House M.D.", 30f, SpawnHouseMD));
Events.Add(default(Event).SetEntry("Random Perk", 0f, RandomPerk));
Events.Add(default(Event).SetEntry("Random Item", 0f, RandomItem));
Events.Add(default(Event).SetEntry("You are playing in IRON KNUCKLE mode. No perks for you!", 0f, IronKnuckle));
Events.Add(default(Event).SetEntry("Jumpscare!", 0f, Jumpscare));
Events.Add(default(Event).SetEntry("It's Turbo Time!", 0f, TurboTime));
Events.Add(default(Event).SetEntry("FEAST MODE ACTIVATED", 20f, FeastMode));
Events.Add(default(Event).SetEntry("Roach Rain", 20f, SkyDiamonds));
Events.Add(default(Event).SetEntry("Yarr Harr", 0f, PirateShip));
Events.Add(default(Event).SetEntry("Yahoo!", 0f, PlayerLaunch));
Events.Add(default(Event).SetEntry("Will you be my buddy?", 0f, SpawnBuddies));
Events.Add(default(Event).SetEntry("Moving Day", 0f, SpawnFurniture));
Events.Add(default(Event).SetEntry("Old Spice Train", 0f, OldSpiceTrain));
Events.Add(default(Event).SetEntry("Advertisement", 4f, JoeBiden));
Events.Add(default(Event).SetEntry("The Red Carpet", 0f, RedCarpet));
}
public static void RandomEvent()
{
if ((Object)(object)chaosBundle == (Object)null)
{
LoadBundle();
}
if (Events.Count == 0)
{
FillList();
}
Event @event = Events[Random.Range(0, Events.Count)];
ChaosUI.instance.AddEntry(@event.name, @event.time);
if (@event.action != null)
{
@event.action();
}
}
public static void LoadBundle()
{
string location = Assembly.GetExecutingAssembly().Location;
string directoryName = Path.GetDirectoryName(location);
string text = Path.Combine(directoryName, "chaosassets");
if (!File.Exists(text))
{
Debug.LogError((object)("[ChaosMod] AssetBundle not found: " + text));
return;
}
chaosBundle = AssetBundle.LoadFromFile(text);
if ((Object)(object)chaosBundle == (Object)null)
{
Debug.LogError((object)"[ChaosMod] Failed to load ChaosMod AssetBundle - Make sure it's in the same folder as the .dll file and it's named 'chaosassets'");
return;
}
Debug.Log((object)"[ChaosMod] AssetBundle Loaded!");
prefabs["House"] = (Object)(object)chaosBundle.LoadAsset<GameObject>("House");
prefabs["Jumpscare"] = (Object)(object)chaosBundle.LoadAsset<GameObject>("Jumpscare");
prefabs["TurboTime"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("TurboTime");
prefabs["FeastMode"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("FeastMode");
prefabs["SkyDiamonds"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("SkyDiamonds");
prefabs["PirateShip"] = (Object)(object)chaosBundle.LoadAsset<GameObject>("PirateShip");
prefabs["ShipCollide"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("ShipCollide");
prefabs["Yahoo"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("Yahoo");
prefabs["Train"] = (Object)(object)chaosBundle.LoadAsset<GameObject>("Train");
prefabs["OldSpice1"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("OldSpice1");
prefabs["OldSpice2"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("OldSpice2");
prefabs["OldSpice3"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("OldSpice3");
prefabs["TrainHit"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("TrainHit");
prefabs["JoeBiden"] = (Object)(object)chaosBundle.LoadAsset<GameObject>("JoeBiden");
}
public static void PlayAudio(AudioClip clip, float distortion = 0f, float volume = 1f)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Expected O, but got Unknown
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)clip == (Object)null))
{
GameObject val = new GameObject(((Object)clip).name);
val.transform.position = ((Component)ENT_Player.playerObject).transform.position;
AudioSource val2 = val.AddComponent<AudioSource>();
val2.clip = clip;
val2.volume = volume;
if (distortion > 0f)
{
AudioDistortionFilter val3 = val.AddComponent<AudioDistortionFilter>();
val3.distortionLevel = distortion;
}
val2.Play();
Object.Destroy((Object)(object)val, clip.length);
}
}
private static void PerkOverdose()
{
Perk val = CL_AssetManager.GetFullCombinedAssetDatabase().perkAssets[Random.Range(0, CL_AssetManager.GetFullCombinedAssetDatabase().perkAssets.Count)];
for (int i = 0; i < 10; i++)
{
ENT_Player.GetPlayer().AddPerk(val, 1);
}
}
private static void BloodbugHorde()
{
for (int i = 0; i < 10; i++)
{
CL_GameManager.gMan.SpawnEntity(new string[1] { "denizen_bloodbug" });
}
}
private static void SpawnHouseMD()
{
//IL_0010: 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_002e: 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)
//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_004c: Expected O, but got Unknown
GameObject val = Object.Instantiate<GameObject>((GameObject)prefabs["House"], ((Component)Camera.main).transform.position + ((Component)Camera.main).transform.forward * 10f, Quaternion.identity);
Shader val2 = Shader.Find("Unlit/Unlit Transparent Color");
if ((Object)(object)val2 == (Object)null)
{
Debug.LogError((object)"[ChaosMod] Could not find game shader!");
return;
}
Renderer[] componentsInChildren = val.GetComponentsInChildren<Renderer>();
foreach (Renderer val3 in componentsInChildren)
{
Material[] materials = val3.materials;
foreach (Material val4 in materials)
{
val4.shader = val2;
}
}
AudioSource component = val.GetComponent<AudioSource>();
((Component)component).gameObject.AddComponent<AudioDistortionFilter>().distortionLevel = 0.1f;
val.AddComponent<HouseAI>();
}
private static void RandomPerk()
{
ENT_Player.GetPlayer().AddPerk(CL_AssetManager.GetFullCombinedAssetDatabase().perkAssets[Random.Range(0, CL_AssetManager.GetFullCombinedAssetDatabase().perkAssets.Count)], 1);
}
private static void RandomItem()
{
//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)
Object.Instantiate<GameObject>(CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs[Random.Range(0, CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs.Count)], ((Component)ENT_Player.playerObject).transform.position, Quaternion.identity);
}
private static void IronKnuckle()
{
ENT_Player.GetPlayer().RemoveAllPerks();
}
private static void Jumpscare()
{
//IL_0010: 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_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Expected O, but got Unknown
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Object.Instantiate<GameObject>((GameObject)prefabs["Jumpscare"], ((Component)ENT_Player.playerObject).transform.position, Quaternion.identity);
Transform transform = val.transform;
transform.localScale *= 6f;
VideoPlayer componentInChildren = val.GetComponentInChildren<VideoPlayer>();
componentInChildren.Play();
Renderer component = val.GetComponent<Renderer>();
component.material.shader = chaosBundle.LoadAsset<Shader>("VideoOverlay");
val.AddComponent<VideoOverlayThinker>();
Object.Destroy((Object)(object)val, 0.25f);
}
private static void TurboTime()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
//IL_002a: 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)
PlayAudio((AudioClip)prefabs["TurboTime"], 0.1f);
((GameEntity)ENT_Player.playerObject).AddForce(Vector3.up * 30f, "");
}
private static void FeastMode()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Expected O, but got Unknown
PlayAudio((AudioClip)prefabs["FeastMode"], 0.05f);
GameObject val = new GameObject();
val.AddComponent<FeastModeThinker>();
}
private static void SkyDiamonds()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Expected O, but got Unknown
PlayAudio((AudioClip)prefabs["SkyDiamonds"], 0.05f);
GameObject val = new GameObject();
val.AddComponent<RoachRain>();
}
private static void PirateShip()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Expected O, but got Unknown
//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_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)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Object.Instantiate<GameObject>((GameObject)prefabs["PirateShip"]);
val.transform.position = ((Component)ENT_Player.GetPlayer()).transform.position + Vector3.up * 400f;
val.AddComponent<PirateAI>();
Renderer[] componentsInChildren = val.GetComponentsInChildren<Renderer>(true);
Renderer[] array = componentsInChildren;
foreach (Renderer val2 in array)
{
Material[] materials = val2.materials;
foreach (Material val3 in materials)
{
val3.EnableKeyword("_EMISSION");
val3.SetColor("_EmissionColor", Color.white * 0.75f);
}
}
}
private static void PlayerLaunch()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
//IL_0034: 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_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
PlayAudio((AudioClip)prefabs["Yahoo"], 0.2f);
((GameEntity)ENT_Player.playerObject).AddForce(((Component)ENT_Player.GetPlayer()).transform.forward * 7f + Vector3.up * 2f, "");
}
private static void SpawnBuddies()
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
Vector3 position = ((Component)ENT_Player.GetPlayer()).transform.position;
if ((Object)(object)EntityHolder.buddy == (Object)null)
{
EntityHolder.SetVariables();
}
float num = 6f;
if (Main.hardMode)
{
num = 15f;
}
for (int i = 0; (float)i < num; i++)
{
GameObject val = Object.Instantiate<GameObject>(EntityHolder.buddy, ((Component)CL_EventManager.currentLevel).transform);
float num2 = 2f;
if (Random.value > 0.5f)
{
num2 = 0f - num2;
}
val.transform.position = position + new Vector3(Random.Range(-3f, 3f), num2, Random.Range(-3f, 3f));
}
}
private static void SpawnFurniture()
{
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
if (EntityHolder.propList.Count == 0)
{
EntityHolder.SetVariables();
}
float num = 15f;
if (Main.hardMode)
{
num = 30f;
}
for (int i = 0; (float)i < num; i++)
{
GameObject val = Object.Instantiate<GameObject>(EntityHolder.propList[Random.Range(0, EntityHolder.propList.Count - 1)], ((Component)CL_EventManager.currentLevel).transform);
float num2 = Random.Range(1f, 3f);
float num3 = Random.Range(1f, 3f);
if (Random.value > 0.5f)
{
num2 = 0f - num2;
}
if (Random.value > 0.5f)
{
num3 = 0f - num3;
}
val.transform.position = ((Component)ENT_Player.GetPlayer()).transform.position + new Vector3(num2, 0f, num3);
}
}
private static void OldSpiceTrain()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Expected O, but got Unknown
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//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_002a: 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_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: 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)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: 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_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_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: 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_00ae: 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_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Expected O, but got Unknown
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Object.Instantiate<GameObject>((GameObject)prefabs["Train"]);
Vector2 insideUnitCircle = Random.insideUnitCircle;
Vector2 normalized = ((Vector2)(ref insideUnitCircle)).normalized;
Vector3 val2 = new Vector3(normalized.x, 0f, normalized.y);
Vector3 normalized2 = ((Vector3)(ref val2)).normalized;
val.transform.position = ((Component)ENT_Player.GetPlayer()).transform.position + Vector3.up / 2f + normalized2 * 200f;
val.transform.rotation = Quaternion.LookRotation(-normalized2, Vector3.up) * Quaternion.Euler(-90f, 0f, 0f);
Renderer[] components = ((Component)val.transform).GetComponents<Renderer>();
Renderer[] array = components;
foreach (Renderer val3 in array)
{
Material[] materials = val3.materials;
foreach (Material val4 in materials)
{
val4.EnableKeyword("_EMISSION");
val4.SetColor("_EmissionColor", Color.red * 1f);
}
}
AudioSource component = val.GetComponent<AudioSource>();
component.clip = (AudioClip)prefabs["OldSpice" + Random.Range(1, 4)];
val.AddComponent<AudioDistortionFilter>().distortionLevel = 0.85f;
component.Play();
val.AddComponent<TrainAI>();
GameObject gameObject = ((Component)val.transform.GetChild(0)).gameObject;
gameObject.AddComponent<TerryAI>();
Shader shader = Shader.Find("Unlit/Unlit Transparent Color");
Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>();
foreach (Renderer val5 in componentsInChildren)
{
Material[] materials2 = val5.materials;
foreach (Material val6 in materials2)
{
val6.shader = shader;
}
}
}
private static void JoeBiden()
{
//IL_0010: 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_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Expected O, but got Unknown
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Object.Instantiate<GameObject>((GameObject)prefabs["JoeBiden"], ((Component)ENT_Player.playerObject).transform.position, Quaternion.identity);
Transform transform = val.transform;
transform.localScale *= 5f;
VideoPlayer componentInChildren = val.GetComponentInChildren<VideoPlayer>();
componentInChildren.Play();
Renderer component = val.GetComponent<Renderer>();
component.material.shader = chaosBundle.LoadAsset<Shader>("VideoOverlay");
val.AddComponent<VideoOverlayThinker>();
Object.Destroy((Object)(object)val, 4f);
}
private static void RedCarpet()
{
//IL_0039: 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)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)EntityHolder.explosiveRoach == (Object)null)
{
EntityHolder.SetVariables();
}
Transform transform = ((Component)ENT_Player.GetPlayer()).transform;
for (float num = -4f; num < 4f; num += 1f)
{
for (float num2 = -4f; num2 < 4f; num2 += 1f)
{
Object.Instantiate<GameObject>(EntityHolder.explosiveRoach, transform.position + transform.forward + new Vector3(num / 4f, -0.5f, num2 / 4f), Quaternion.identity, ((Component)CL_EventManager.currentLevel).transform);
}
}
}
}
public struct Event
{
public string name;
public float time;
public Action action;
public Event SetEntry(string name, float time, Action action)
{
this.name = name;
this.time = time;
this.action = action;
return this;
}
}
public class HouseAI : MonoBehaviour
{
private float timeLeft = 30f;
private void Update()
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: 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_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: 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_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: 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_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = ((Component)Camera.main).transform.position - ((Component)this).transform.position;
((Vector3)(ref val)).Normalize();
((Component)this).transform.rotation = Quaternion.LookRotation(val, Vector3.up) * Quaternion.Euler(90f, 0f, 0f);
if (Main.hardMode)
{
val *= 3f;
}
Transform transform = ((Component)this).transform;
transform.position += val * 3f * Mathf.Clamp(Vector3.Distance(((Component)this).transform.position, ((Component)Camera.main).transform.position) / 20f, 1f, 10f) * Time.deltaTime;
timeLeft -= Time.deltaTime;
if (timeLeft <= 0f)
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
}
public class VideoOverlayThinker : MonoBehaviour
{
private void LateUpdate()
{
//IL_0025: 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)
//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_0058: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)Camera.main == (Object)null))
{
((Component)this).transform.position = ((Component)Camera.main).transform.position + ((Component)Camera.main).transform.forward * 8f;
Vector3 val = ((Component)Camera.main).transform.position - ((Component)this).transform.position;
((Component)this).transform.rotation = Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up) * Quaternion.Euler(90f, 0f, 0f);
}
}
}
public class FeastModeThinker : MonoBehaviour
{
private float timeLeft = 20f;
private float nextTick = 20f;
private static Transform player;
private static GameObject beans;
private static GameObject bar;
private void Awake()
{
if ((Object)(object)player == (Object)null)
{
player = ((Component)ENT_Player.GetPlayer()).gameObject.transform;
}
if (!((Object)(object)beans == (Object)null) && !((Object)(object)bar == (Object)null))
{
return;
}
for (int i = 0; i < CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs.Count; i++)
{
if (((Object)CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs[i]).name.ToLower() == "item_beans")
{
beans = CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs[i];
}
else if (((Object)CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs[i]).name.ToLower() == "item_food_bar")
{
bar = CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs[i];
}
}
}
private void Update()
{
if (nextTick >= timeLeft)
{
DropFood();
nextTick -= 0.35f;
}
timeLeft -= Time.deltaTime;
if (timeLeft <= 0f)
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
private void DropFood()
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
GameObject val = beans;
if (Random.value > 0.75f)
{
val = bar;
}
GameObject val2 = Object.Instantiate<GameObject>(val);
val2.transform.position = player.position + new Vector3(Random.Range(-2f, 2f), -1f, Random.Range(-2f, 2f));
val2.transform.parent = ((Component)CL_EventManager.currentLevel).transform;
}
}
public class RoachRain : MonoBehaviour
{
private float timeLeft = 20f;
private float nextTick = 20f;
private static Transform player;
private static GameObject roach;
private void Awake()
{
if ((Object)(object)player == (Object)null)
{
player = ((Component)ENT_Player.GetPlayer()).gameObject.transform;
}
if (!((Object)(object)roach == (Object)null))
{
return;
}
for (int i = 0; i < CL_AssetManager.GetFullCombinedAssetDatabase().entityPrefabs.Count; i++)
{
if (((Object)CL_AssetManager.GetFullCombinedAssetDatabase().entityPrefabs[i]).name.ToLower() == "denizen_roach_platinum")
{
roach = CL_AssetManager.GetFullCombinedAssetDatabase().entityPrefabs[i];
break;
}
}
}
private void Update()
{
//IL_002d: 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_005a: Unknown result type (might be due to invalid IL or missing references)
if (nextTick >= timeLeft)
{
GameObject val = Object.Instantiate<GameObject>(roach);
val.transform.position = player.position + new Vector3(Random.Range(-5f, 5f), 8f, Random.Range(-5f, 5f));
val.transform.parent = ((Component)CL_EventManager.currentLevel).transform;
nextTick -= 0.15f;
}
timeLeft -= Time.deltaTime;
if (timeLeft <= 0f)
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
}
public class PirateAI : MonoBehaviour
{
public static Transform player;
private bool pDead = false;
private AudioSource song = null;
private void Awake()
{
if ((Object)(object)player == (Object)null)
{
player = ((Component)ENT_Player.GetPlayer()).transform;
}
song = ((Component)this).gameObject.GetComponent<AudioSource>();
}
private void Update()
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: 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_002f: 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_0081: 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_009d: 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: Expected O, but got Unknown
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Expected O, but got Unknown
//IL_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_0147: 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_0160: Unknown result type (might be due to invalid IL or missing references)
if (Main.hardMode)
{
Transform transform = ((Component)this).transform;
transform.position -= Vector3.up * 50f * Time.deltaTime;
}
else
{
Transform transform2 = ((Component)this).transform;
transform2.position -= Vector3.up * 30f * Time.deltaTime;
}
float num = player.position.y - ((Component)this).transform.position.y;
if (Vector3.Distance(player.position, ((Component)this).transform.position) < 2.5f && !pDead)
{
pDead = true;
DeathType val = new DeathType();
val.deathText = "DEAD MEN TELL NO TALES";
CL_GameManager.gMan.deathTypes[0] = val;
((GameEntity)ENT_Player.GetPlayer()).Kill("");
EventManager.PlayAudio((AudioClip)EventManager.prefabs["ShipCollide"], 0.85f);
}
if (num < -50f)
{
((Component)this).transform.position = new Vector3(player.position.x, ((Component)this).transform.position.y, player.position.z);
}
if (num > 400f && (Object)(object)song != (Object)null && song.volume > 0f)
{
AudioSource obj = song;
obj.volume -= Time.deltaTime / 4f;
}
if (num > 800f)
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
}
public class TrainAI : MonoBehaviour
{
private static Transform player;
private AudioSource song = null;
private Vector3 dir = Vector3.up;
private bool pDead = false;
private bool passed = false;
private void Awake()
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: 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_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: 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)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)player == (Object)null)
{
player = ((Component)ENT_Player.GetPlayer()).transform;
}
song = ((Component)((Component)this).transform).GetComponent<AudioSource>();
Vector3 val = player.position + Vector3.up / 2f - ((Component)this).transform.position;
dir = ((Vector3)(ref val)).normalized;
}
private void Update()
{
//IL_0044: 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_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: 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_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_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_012c: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Expected O, but got Unknown
//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
//IL_01b9: Expected O, but got Unknown
//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0201: Unknown result type (might be due to invalid IL or missing references)
//IL_020b: Unknown result type (might be due to invalid IL or missing references)
//IL_0210: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: Unknown result type (might be due to invalid IL or missing references)
//IL_0220: Unknown result type (might be due to invalid IL or missing references)
//IL_0225: Unknown result type (might be due to invalid IL or missing references)
//IL_0229: Unknown result type (might be due to invalid IL or missing references)
//IL_023e: Unknown result type (might be due to invalid IL or missing references)
//IL_0243: Unknown result type (might be due to invalid IL or missing references)
if (Main.hardMode)
{
Transform transform = ((Component)this).transform;
transform.position += dir * 75f * Time.deltaTime;
}
else
{
Transform transform2 = ((Component)this).transform;
transform2.position += dir * 50f * Time.deltaTime;
}
((Component)this).transform.rotation = Quaternion.LookRotation(dir, Vector3.up) * Quaternion.Euler(-90f, 0f, 0f);
float num = Vector3.Distance(((Component)this).transform.position, player.position + Vector3.up / 2f);
if (!pDead && !passed)
{
((Component)((Component)this).transform).GetComponent<AudioDistortionFilter>().distortionLevel = Mathf.Clamp(num / 1000f, 0f, 0.2f) + 0.75f;
}
if (Vector3.Distance(((Component)this).transform.position + Vector3.up / 2f, player.position) < 1.5f && !pDead && !((GameEntity)ENT_Player.GetPlayer()).IsDead())
{
pDead = true;
DeathType val = new DeathType();
val.deathText = "TOO MUCH OLD SPICE";
CL_GameManager.gMan.deathTypes[0] = val;
EventManager.PlayAudio((AudioClip)EventManager.prefabs["TrainHit"], 0.75f, 0.9f);
song.volume = 0.75f;
((GameEntity)ENT_Player.GetPlayer()).Kill("");
}
if (num > 40f && !passed)
{
Vector3 val2 = player.position + Vector3.up / 2f - ((Component)this).transform.position;
val2.y /= 2f;
dir = ((Vector3)(ref val2)).normalized;
}
else
{
passed = true;
}
if (num > 40f && passed && (Object)(object)song != (Object)null && song.volume > 0f)
{
AudioDistortionFilter component = ((Component)((Component)this).transform).GetComponent<AudioDistortionFilter>();
component.distortionLevel -= Time.deltaTime / 5f;
}
if (num > 600f)
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
}
public class TerryAI : MonoBehaviour
{
private void Update()
{
//IL_0011: 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_0021: 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_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
((Component)this).transform.rotation = Quaternion.LookRotation(((Component)Camera.main).transform.position - ((Component)this).transform.position, Vector3.up) * Quaternion.Euler(90f, 0f, 0f);
}
}
public static class EntityHolder
{
public static GameObject buddy = null;
public static GameObject explosiveRoach = null;
public static List<GameObject> propList = new List<GameObject>();
public static void SetVariables()
{
foreach (GameObject entityPrefab in CL_AssetManager.GetFullCombinedAssetDatabase().entityPrefabs)
{
if (((Object)entityPrefab).name.ToLower() == "denizen_drone_buddy")
{
buddy = entityPrefab;
}
if (((Object)entityPrefab).name.ToLower() == "denizen_roach_explosive")
{
explosiveRoach = entityPrefab;
}
if (((Object)entityPrefab).name.ToLower().Contains("prop_"))
{
propList.Add(entityPrefab);
}
}
}
}
}