using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using GunsOPlenty.Data;
using GunsOPlenty.Stuff;
using GunsOPlenty.Utils;
using GunsOPlenty.Weapons;
using HarmonyLib;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using ULTRAKILL.Cheats;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("UK_ProofOfConcept")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UK_ProofOfConcept")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("0d16883d-19af-4817-beb6-a11debe20732")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
public class BeeThing : MonoBehaviour
{
private Vector3 startPos;
private Vector3 crazyPos;
public float factor = 0.5f;
public float bound = 36f;
public float speed = 5f;
public float deathTimer = 15f;
public float startTime;
public GameObject target;
public EnemyIdentifier targetEid;
public EnemyColliderDetector ecd;
public GameObject sourceWeapon;
private void Start()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
startPos = ((Component)this).transform.position;
crazyPos = startPos;
ecd = ((Component)this).gameObject.AddComponent<EnemyColliderDetector>();
if ((Object)(object)ecd == (Object)null)
{
Debug.Log((object)"Nabit");
}
UpdateTargeter();
DamageUpdate();
startTime = Time.time;
speed = 15f;
}
public void Die()
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
if (speed > 150f)
{
Object.Instantiate<GameObject>(PrefabBox.boom, ((Component)this).transform.position, Quaternion.identity);
}
Object.Destroy((Object)(object)((Component)this).gameObject);
}
public void DamageUpdate()
{
//IL_00b1: 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)
if (ecd.hitList.Count() > 0)
{
for (int i = 0; i < ecd.hitList.Count(); i++)
{
if ((Object)(object)ecd.hitList[i] != (Object)null && !ecd.hitList[i].dead)
{
GameObject val = ecd.GetLimbs(ecd.hitList[i])[Random.Range(0, ecd.GetLimbs(ecd.hitList[i]).Count - 1)];
ecd.hitList[i].DeliverDamage(val, Vector3.zero, val.transform.position, 0.2f, false, 0f, sourceWeapon, false);
}
}
}
((MonoBehaviour)this).Invoke("DamageUpdate", 0.2f);
}
public void UpdateTargeter()
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
float num = 1E+10f;
GameObject[] array = GameObject.FindGameObjectsWithTag("Enemy");
if (array.Length != 0)
{
for (int i = 0; i < array.Length; i++)
{
EnemyIdentifier component = array[i].GetComponent<EnemyIdentifier>();
if (!((Object)(object)component == (Object)null) && !component.dead && !component.blessed)
{
Vector3 val = array[i].transform.position - ((Component)this).transform.position;
float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude;
if (sqrMagnitude < num)
{
num = sqrMagnitude;
targetEid = component;
}
}
}
}
if (num >= 1E+10f)
{
target = null;
targetEid = null;
}
else
{
EnemyIdentifierIdentifier[] componentsInChildren = ((Component)targetEid).GetComponentsInChildren<EnemyIdentifierIdentifier>();
target = ((Component)componentsInChildren[Random.Range(0, componentsInChildren.Length)]).gameObject;
}
((MonoBehaviour)this).Invoke("UpdateTargeter", 0.25f);
}
private void FixedUpdate()
{
//IL_0002: 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_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_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: 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_003f: 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_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_0064: 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_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
crazyPos += GOPUtils.RandPos((bound + speed * 0.8f) * Time.deltaTime);
if ((Object)(object)target != (Object)null)
{
Vector3 val = crazyPos;
Vector3 val2 = target.transform.position - ((Component)this).transform.position;
crazyPos = val + ((Vector3)(ref val2)).normalized * (speed * Time.deltaTime);
}
float num = Mathf.Pow(factor, Time.deltaTime * speed);
((Component)this).transform.position = Vector3.Lerp(crazyPos, ((Component)this).transform.position, num);
if (Time.time - startTime > 1000f || speed > 200f)
{
Die();
}
}
private Vector3 RandomVec3(float min, float max)
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
float num = Random.Range(min, max);
float num2 = Random.Range(min, max);
float num3 = Random.Range(min, max);
return new Vector3(num, num2, num3);
}
}
public class Generator : MonoBehaviour
{
public GameObject fred;
public GameObject sourceWeapon;
public List<GameObject> freds = new List<GameObject>();
private Vector3 startPos;
private float lifeTimer;
private float speed = 1f;
public float rotVel = 15f;
private float startTime;
public float deathTime;
private float spawnLoopTime;
private bool firstDeath;
private EnemyColliderDetector ecd;
private void Start()
{
//IL_0019: 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)
deathTime = 30f;
firstDeath = true;
startPos = ((Component)this).transform.position;
((MonoBehaviour)this).Invoke("SpawnLoop", 1.5f);
ecd = ((Component)this).gameObject.AddComponent<EnemyColliderDetector>();
if ((Object)(object)ecd == (Object)null)
{
Debug.Log((object)"Dang");
}
startTime = Time.time;
spawnLoopTime = Time.time;
}
public void SpawnLoop()
{
if (freds.Count < 10)
{
SpawnFred();
}
for (int i = 0; i < freds.Count; i++)
{
if ((Object)(object)freds[i] == (Object)null)
{
freds.Remove(freds[i]);
}
}
((MonoBehaviour)this).Invoke("SpawnLoop", 2.5f - rotVel * 0.0008f);
}
public void Die()
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
Object.Destroy((Object)(object)((Component)this).gameObject);
if (rotVel > 2000f)
{
Object.Instantiate<GameObject>(PrefabBox.superBoom, ((Component)this).transform.position, Quaternion.identity);
}
for (int i = 0; i < freds.Count; i++)
{
freds[i].GetComponent<BeeThing>().Die();
}
freds.Clear();
}
private void FixedUpdate()
{
//IL_0029: 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_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: 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_005f: Unknown result type (might be due to invalid IL or missing references)
((Component)this).transform.Rotate(0f, rotVel * Time.deltaTime, 0f, (Space)1);
((Component)this).transform.position = Vector3.Lerp(startPos + Vector3.up, startPos + Vector3.down, 0.5f + Mathf.Sin(lifeTimer) / 2f);
lifeTimer += Time.deltaTime;
if (NoWeaponCooldown.NoCooldown)
{
startTime = Time.time;
}
if ((Time.time - startTime > deathTime || rotVel > 2880f) && firstDeath)
{
firstDeath = false;
Die();
}
}
private void SpawnFred()
{
//IL_000c: 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)
GameObject val = Object.Instantiate<GameObject>(fred, ((Component)this).transform.position, Quaternion.identity);
val.GetComponent<BeeThing>().sourceWeapon = sourceWeapon;
val.GetComponent<BeeThing>().speed = 15f + rotVel * 0.1f;
freds.Add(val);
}
}
namespace GunsOPlenty
{
internal class PluginInfo
{
public const string Name = "Guns O' Plenty";
public const string GUID = "ironfarm.uk.shooty.shooty";
public const string Version = "0.2.0";
}
[BepInPlugin("ironfarm.uk.shooty.shooty", "Guns O' Plenty", "0.2.0")]
public class Plugin : BaseUnityPlugin
{
private Harmony harmony = new Harmony("ironfarm.uk.shooty.shooty");
private bool firstTime = true;
public void Awake()
{
}
public void Start()
{
ConfigManager.Setup();
AssetHandler.LoadBundle();
if (AssetHandler.bundleLoaded)
{
AssetHandler.CreateCustomPrefabs();
WeaponHandler.SetupWeapons();
harmony.PatchAll(typeof(WeaponPatch));
harmony.PatchAll(typeof(StylePatch));
}
if (ConfigManager.StartupCheck.value)
{
SceneManager.activeSceneChanged += Startup;
}
}
public void Update()
{
}
private void Startup(Scene before, Scene after)
{
if (!(SceneHelper.CurrentScene == "Main Menu") || !firstTime)
{
return;
}
if (ConfigManager.StartupCheck.value)
{
if (AssetHandler.bundleLoaded)
{
MonoSingleton<HMRPlus>.Instance.SendHudMessageEffect("Guns O' Plenty <grad=rainbow>Successfully</grad> Loaded!", 0f, 4f, silent: false, 0.5f);
}
else
{
MonoSingleton<HMRPlus>.Instance.SendHudMessageEffect("Guns O' Plenty <grad=crimson>Failed</grad> to Load!", 0f, 4f, silent: false, 0.5f);
}
}
firstTime = false;
}
}
}
namespace GunsOPlenty.Stuff
{
public abstract class GOPWeapon
{
public virtual GameObject Asset { get; protected set; }
public virtual GameObject LoadedAsset { get; protected set; }
public virtual int Slot { get; set; }
public virtual string Name { get; protected set; }
public virtual bool IsSetup { get; protected set; }
public virtual bool ShouldHave { get; set; }
public abstract void Setup();
public void UnSetup()
{
Debug.Log((object)("UnSetting Up " + Name));
Asset = null;
LoadedAsset = null;
IsSetup = false;
}
public void SetSlot(int newSlot)
{
Slot = newSlot;
}
public void Create(Transform transform)
{
LoadedAsset = Object.Instantiate<GameObject>(Asset, transform);
}
}
public class StylePatch
{
[HarmonyPatch(typeof(LeaderboardController), "SubmitCyberGrindScore")]
[HarmonyPrefix]
public static bool no(LeaderboardController __instance)
{
if (WeaponHandler.isCheating)
{
Debug.Log((object)"no");
return false;
}
return true;
}
[HarmonyPatch(typeof(LeaderboardController), "SubmitLevelScore")]
[HarmonyPrefix]
public static bool nope(LeaderboardController __instance)
{
if (WeaponHandler.isCheating)
{
Debug.Log((object)"nope");
return false;
}
return true;
}
[HarmonyPatch(typeof(LeaderboardController), "SubmitFishSize")]
[HarmonyPrefix]
public static bool notevenfish(LeaderboardController __instance)
{
if (WeaponHandler.isCheating)
{
Debug.Log((object)"not even fish");
return false;
}
return true;
}
[HarmonyPatch(typeof(StyleHUD), "Start")]
[HarmonyPostfix]
public static void AddStyleToDict(StyleHUD __instance)
{
}
[HarmonyPatch(typeof(StyleCalculator), "HitCalculator")]
[HarmonyPostfix]
public static void SpecialProjectileStyles(StyleCalculator __instance, string hitter, string enemyType, string hitLimb, bool dead, EnemyIdentifier eid = null, GameObject sourceWeapon = null)
{
if (!(hitter == "coin shot"))
{
return;
}
__instance.enemiesShot = true;
if (dead)
{
if (enemyType == "spider")
{
__instance.AddPoints(100, "ultrakill.bigkill", eid, sourceWeapon);
}
else
{
__instance.AddPoints(50, "ultrakill.kill", eid, sourceWeapon);
}
__instance.gc.AddKill();
}
else
{
__instance.AddPoints(5, "", eid, sourceWeapon);
}
}
}
public static class WeaponHandler
{
private static List<GOPWeapon> weapons = new List<GOPWeapon>();
public static GameObject thingy;
private static GameObject initObj;
public static bool isCheating = false;
public static void AddWeapons()
{
}
public static void SetupWeapons()
{
ChargeManager.Setup();
Debug.Log((object)"Setting up weapon");
weapons.Add(new FunnyGun());
weapons.Add(new GoldenGun());
weapons.Add(new TestCube());
foreach (GOPWeapon weapon in weapons)
{
if (!weapon.IsSetup)
{
weapon.Setup();
}
}
}
public static void RemoveWeapons()
{
foreach (GOPWeapon weapon in weapons)
{
foreach (List<GameObject> slot in MonoSingleton<GunControl>.Instance.slots)
{
foreach (GameObject item in slot)
{
if ((Object)(object)item == (Object)(object)weapon.LoadedAsset)
{
slot.Remove(item);
}
}
}
}
foreach (List<GameObject> slot2 in MonoSingleton<GunControl>.Instance.slots)
{
if (slot2.Count == 0)
{
MonoSingleton<GunControl>.Instance.slots.Remove(slot2);
}
}
weapons.Clear();
}
public static void AddWeaponsToInventoy()
{
isCheating = false;
foreach (GOPWeapon weapon in weapons)
{
switch (weapon.Name)
{
case "Funny Gun :D":
weapon.ShouldHave = ConfigManager.FunGunEnable.value;
weapon.Slot = ConfigManager.FunGunSlot.value;
isCheating |= ConfigManager.FunGunEnable.value;
break;
case "Golden Shotgun":
weapon.ShouldHave = ConfigManager.GoldenGunEnable.value;
weapon.Slot = ConfigManager.GoldenGunSlot.value;
isCheating |= ConfigManager.GoldenGunEnable.value;
break;
case "Test Cube":
weapon.ShouldHave = ConfigManager.TestCubeEnable.value;
weapon.Slot = ConfigManager.TestCubeSlot.value;
isCheating |= ConfigManager.TestCubeEnable.value;
break;
default:
Debug.Log((object)"ummm dafuq?");
break;
}
if (weapon.ShouldHave)
{
weapon.Create(((Component)MonoSingleton<GunControl>.Instance).transform);
MonoSingleton<GunControl>.Instance.shud.weaponFreshness.Add(weapon.LoadedAsset, 10f);
weapon.LoadedAsset.SetActive(false);
int count = MonoSingleton<GunControl>.Instance.slots.Count;
if (weapon.Slot > count)
{
for (int i = 0; i < weapon.Slot - count; i++)
{
MonoSingleton<GunControl>.Instance.slots.Add(new List<GameObject>());
}
}
MonoSingleton<GunControl>.Instance.slots[weapon.Slot - 1].Add(weapon.LoadedAsset);
}
MonoSingleton<GunControl>.Instance.UpdateWeaponList(true);
}
}
public static void AddStyle()
{
foreach (GOPWeapon weapon in weapons)
{
AddToStyleDict(weapon.LoadedAsset);
}
}
public static void AddToStyleDict(GameObject obj)
{
if ((Object)(object)obj != (Object)null && !MonoSingleton<StyleHUD>.Instance.weaponFreshness.ContainsKey(obj))
{
MonoSingleton<StyleHUD>.Instance.weaponFreshness.Add(obj, 10f);
Debug.Log((object)(((Object)obj).name + " has been added to dictionary"));
}
else if (MonoSingleton<StyleHUD>.Instance.weaponFreshness.ContainsKey(obj))
{
Debug.Log((object)(((Object)obj).name + " is already in dictionary"));
}
else
{
Debug.Log((object)(((Object)obj).name + " isn't real"));
}
}
}
public static class WeaponPatch
{
[HarmonyPatch(typeof(GunControl), "Start")]
[HarmonyPostfix]
public static void AddGuns(GunControl __instance)
{
WeaponHandler.AddWeaponsToInventoy();
}
[HarmonyPatch(typeof(StyleHUD), "Update")]
[HarmonyPostfix]
public static void UpdateStyleWithGOP(StyleHUD __instance)
{
if (!MonoSingleton<StyleHUD>.Instance.idNameDict.ContainsKey("ultrakill.moneyshot"))
{
MonoSingleton<StyleHUD>.Instance.idNameDict.Add("ultrakill.moneyshot", "<color=#ffb700>MONEY SHOT</color>");
}
if (!MonoSingleton<StyleHUD>.Instance.freshnessDecayMultiplierDict.ContainsKey("ultrakill.moneyshot"))
{
MonoSingleton<StyleHUD>.Instance.freshnessDecayMultiplierDict.Add("ultrakill.moneyshot", 0f);
}
}
[HarmonyPatch(typeof(GunControl), "UpdateWeaponList")]
[HarmonyPrefix]
public static void PreUpdateWithGOP(GunControl __instance)
{
}
[HarmonyPatch(typeof(GunControl), "UpdateWeaponList")]
[HarmonyPostfix]
public static void UpdateWithGOP(GunControl __instance)
{
}
}
}
namespace GunsOPlenty.Weapons
{
public class FireArea : MonoBehaviour
{
private EnemyColliderDetector ecd;
public GameObject sourceWeapon;
public List<Generator> genlist = new List<Generator>();
public List<BeeThing> beelist = new List<BeeThing>();
public void Start()
{
ecd = ((Component)this).gameObject.AddComponent<EnemyColliderDetector>();
if ((Object)(object)ecd == (Object)null)
{
Debug.Log((object)"Dang");
}
SlowUpdate();
}
public void SlowUpdate()
{
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Invalid comparison between Unknown and I4
//IL_014b: 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_0110: 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)
if (!((Collider)((Component)this).GetComponent<CapsuleCollider>()).enabled)
{
ClearStuff();
}
float num = MonoSingleton<StyleHUD>.Instance.currentMeter + (float)MonoSingleton<StyleHUD>.Instance.rankIndex * 1500f;
for (int i = 0; i < ecd.hitList.Count; i++)
{
if ((Object)(object)ecd.hitList[i] != (Object)null && !ecd.hitList[i].dead)
{
Flammable componentInChildren = ((Component)ecd.hitList[i]).GetComponentInChildren<Flammable>();
if ((Object)(object)componentInChildren != (Object)null)
{
componentInChildren.Burn(5f, true);
}
GameObject val = ecd.GetLimbs(ecd.hitList[i])[Random.Range(0, ecd.GetLimbs(ecd.hitList[i]).Count - 1)];
if ((int)ecd.hitList[i].enemyType == 6)
{
ecd.hitList[i].DeliverDamage(val, Vector3.zero, val.transform.position, 0.25f, false, 0f, sourceWeapon, false);
}
else
{
ecd.hitList[i].DeliverDamage(val, Vector3.zero, val.transform.position, 1f, false, 0f, sourceWeapon, false);
}
}
}
if (genlist.Count > 0)
{
for (int j = 0; j < genlist.Count; j++)
{
if (NoWeaponCooldown.NoCooldown)
{
genlist[j].rotVel += 80f;
}
else
{
genlist[j].rotVel += 50f + num * 0.0025f;
}
}
}
if (beelist.Count > 0)
{
for (int k = 0; k < beelist.Count; k++)
{
if (NoWeaponCooldown.NoCooldown)
{
beelist[k].speed += 55f;
}
else
{
beelist[k].speed += 25f + num * 0.0025f;
}
}
}
if (NoWeaponCooldown.NoCooldown)
{
((MonoBehaviour)this).Invoke("SlowUpdate", 0.07f);
}
else
{
((MonoBehaviour)this).Invoke("SlowUpdate", 0.25f - num * 1.5E-05f);
}
}
private void OnTriggerEnter(Collider other)
{
Enter(other);
}
private void OnTriggerExit(Collider other)
{
Exit(other);
}
private void OnTriggerEnter(Collision other)
{
Exit(other.collider);
}
private void OnTriggerExit(Collision other)
{
Exit(other.collider);
}
private void Enter(Collider other)
{
Generator componentInParent = ((Component)((Component)other).transform).GetComponentInParent<Generator>();
BeeThing componentInParent2 = ((Component)((Component)other).transform).GetComponentInParent<BeeThing>();
if ((Object)(object)componentInParent != (Object)null)
{
genlist.Add(componentInParent);
}
if ((Object)(object)componentInParent2 != (Object)null)
{
beelist.Add(componentInParent2);
}
}
private void Exit(Collider other)
{
Generator componentInParent = ((Component)((Component)other).transform).GetComponentInParent<Generator>();
BeeThing componentInParent2 = ((Component)((Component)other).transform).GetComponentInParent<BeeThing>();
if ((Object)(object)componentInParent != (Object)null && genlist.Contains(componentInParent))
{
genlist.Remove(componentInParent);
}
if ((Object)(object)componentInParent2 != (Object)null && beelist.Contains(componentInParent2))
{
beelist.Remove(componentInParent2);
}
}
public void ClearStuff()
{
ecd.ClearStuff();
genlist.Clear();
beelist.Clear();
}
private void OnDisable()
{
ClearStuff();
}
}
public class TestCubeSoul : MonoBehaviour
{
private WeaponIcon weaponIcon;
private WeaponIdentifier wid;
private WeaponPos wpos;
private GameObject shootPoint;
private bool isFireOn;
private GameObject firePartObj;
private GameObject bubblePartObj;
private ParticleSystem firePart;
private ParticleSystem bubblePart;
private Light fireLight;
private CameraFrustumTargeter targeter;
private AudioSource gunTipAud;
private GameObject thingyObj;
private Generator thingy;
private string[] fireNames = new string[4] { "FlameThrower", "EpicThrower", "BubbleThrower", "EpicBubbleThrower" };
private GameObject fireArea;
private CapsuleCollider fireAreaCol;
public bool isFireEpic;
private CoinShot coinShotComp;
private Color color = Color.red;
private List<Color> randGrad = new List<Color>();
private void Start()
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
targeter = MonoSingleton<CameraFrustumTargeter>.instance;
wid = ((Component)this).gameObject.GetComponent<WeaponIdentifier>();
weaponIcon = ((Component)this).gameObject.AddComponent<WeaponIcon>();
wpos = ((Component)this).gameObject.AddComponent<WeaponPos>();
wpos.defaultPos = new Vector3(0.8836f, -0.9345f, 1.4161f);
wpos.middlePos = new Vector3(0f, -0.9345f, 1.4161f);
if ((Object)(object)weaponIcon.weaponDescriptor == (Object)null)
{
weaponIcon.weaponDescriptor = ScriptableObject.CreateInstance<WeaponDescriptor>();
weaponIcon.weaponDescriptor.variationColor = (WeaponVariant)2;
weaponIcon.weaponDescriptor.icon = AssetHandler.LoadAsset<Sprite>("Trollface");
weaponIcon.weaponDescriptor.glowIcon = weaponIcon.weaponDescriptor.icon;
}
shootPoint = ((Component)this).gameObject.DescendantByName("ShootPoint");
shootPoint.layer = 0;
fireArea = ((Component)this).gameObject.DescendantByName("FireArea");
fireArea.layer = 0;
fireArea.AddComponent<FireArea>();
fireArea.GetComponent<FireArea>().sourceWeapon = ((Component)this).gameObject;
fireAreaCol = fireArea.GetComponent<CapsuleCollider>();
((Collider)fireAreaCol).enabled = false;
ChangeFireAreaSize(15f);
isFireEpic = ConfigManager.TestCubeEpicFire.value;
if (wid.delay > 0f)
{
string[] array = fireNames;
foreach (string text in array)
{
GameObject val = shootPoint.DescendantByName(text + "(Clone)");
if ((Object)(object)val != (Object)null)
{
Object.Destroy((Object)(object)val);
}
}
}
gunTipAud = shootPoint.GetComponent<AudioSource>();
if (isFireEpic)
{
firePartObj = Object.Instantiate<GameObject>(EffectBox.epicFire, shootPoint.transform);
bubblePartObj = Object.Instantiate<GameObject>(EffectBox.epicBubble, shootPoint.transform);
}
else
{
firePartObj = Object.Instantiate<GameObject>(EffectBox.fire, shootPoint.transform);
bubblePartObj = Object.Instantiate<GameObject>(EffectBox.bubble, shootPoint.transform);
}
firePart = firePartObj.GetComponent<ParticleSystem>();
bubblePart = bubblePartObj.GetComponent<ParticleSystem>();
firePartObj.TryGetComponent<Light>(ref fireLight);
TurnFireOff();
thingy = null;
}
public void OnEnable()
{
TurnFireOff();
if ((Object)(object)thingy != (Object)null)
{
thingy.deathTime = 30f;
}
}
public void OnDisable()
{
if ((Object)(object)thingy != (Object)null)
{
thingy.deathTime = 5f;
}
}
public void Update()
{
float num = MonoSingleton<StyleHUD>.Instance.currentMeter + (float)MonoSingleton<StyleHUD>.Instance.rankIndex * 1500f;
if (NoWeaponCooldown.NoCooldown)
{
gunTipAud.pitch = 1.7f;
}
else
{
gunTipAud.pitch = 0.5f + num * 0.0001f;
}
if (MonoSingleton<InputManager>.Instance.InputSource.Fire1.IsPressed && ((Component)MonoSingleton<GunControl>.Instance).GetComponent<GunControl>().activated && !GameStateManager.Instance.PlayerInputLocked)
{
((MonoBehaviour)this).Invoke("TurnFireOn", wid.delay);
}
else
{
((MonoBehaviour)this).Invoke("TurnFireOff", wid.delay);
}
if (MonoSingleton<InputManager>.Instance.InputSource.Fire2.WasPerformedThisFrame && ((Component)MonoSingleton<GunControl>.Instance).GetComponent<GunControl>().activated && !GameStateManager.Instance.PlayerInputLocked && wid.delay == 0f)
{
((MonoBehaviour)this).Invoke("CreateThing", wid.delay);
}
}
public void TurnFireOn()
{
if (MonoSingleton<UnderwaterController>.Instance.inWater)
{
if (!bubblePart.isEmitting)
{
bubblePart.Play();
firePart.Stop();
gunTipAud.clip = AssetHandler.LoadAsset<AudioClip>("BubbleThrowerBubble");
gunTipAud.time = Random.Range(0f, 2.5f);
gunTipAud.Play();
}
ChangeFireAreaSize(15f);
}
else
{
if (!firePart.isEmitting)
{
firePart.Play();
bubblePart.Stop();
gunTipAud.clip = AssetHandler.LoadAsset<AudioClip>("FlameThrowerFire");
gunTipAud.time = Random.Range(0f, 2.5f);
gunTipAud.Play();
}
ChangeFireAreaSize(25f);
}
isFireOn = true;
if ((Object)(object)fireLight != (Object)null)
{
((Behaviour)fireLight).enabled = true;
}
((Collider)fireAreaCol).enabled = true;
}
public void TurnFireOff()
{
firePart.Stop();
bubblePart.Stop();
gunTipAud.Stop();
isFireOn = false;
if ((Object)(object)fireLight != (Object)null)
{
((Behaviour)fireLight).enabled = false;
}
((Collider)fireAreaCol).enabled = false;
fireArea.GetComponent<FireArea>().ClearStuff();
}
public void CreateThing()
{
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)thingy == (Object)null)
{
thingyObj = Object.Instantiate<GameObject>(AssetHandler.generator, ((Component)this).transform.position, Quaternion.identity);
thingyObj.TryGetComponent<Generator>(ref thingy);
thingy.sourceWeapon = ((Component)this).gameObject;
}
else
{
Object.Instantiate<GameObject>(PrefabBox.harmlessBoom, ((Component)thingy).transform.position, Quaternion.identity);
thingy.Die();
thingy = null;
Object.Destroy((Object)(object)thingyObj);
}
}
public void ChangeFireAreaSize(float height, float radius = 1f)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
fireAreaCol.height = height;
fireAreaCol.center = new Vector3(0f, height / 2f, 0f);
fireAreaCol.radius = radius;
}
}
public class TestCube : GOPWeapon
{
public override GameObject Asset { get; protected set; }
public override int Slot { get; set; }
public override string Name { get; protected set; }
public override bool IsSetup { get; protected set; }
public override bool ShouldHave { get; set; }
public override void Setup()
{
Debug.Log((object)"Setting up Test Cube");
if ((Object)(object)Asset == (Object)null)
{
Asset = AssetHandler.LoadAsset<GameObject>("TestCube Prefab");
}
if ((Object)(object)Asset != (Object)null && !IsSetup)
{
Name = "Test Cube";
Slot = ConfigManager.TestCubeSlot.value;
Asset.AddComponent<TestCubeSoul>();
MeshRenderer val = default(MeshRenderer);
foreach (GameObject item in Asset.DescendantsList())
{
if (item.TryGetComponent<MeshRenderer>(ref val))
{
((Renderer)val).material.shader = ShaderBox.vertexlit_emissive;
}
}
IsSetup = true;
}
else
{
Debug.Log((object)"Test Cube Didn't load");
Name = "Test Cube is NULL";
Slot = -1;
}
}
}
public class FunnyGunSoul : MonoBehaviour
{
private float fireDelay = 1f;
private float fireTime;
private float fireMult = 1f;
private float fireMultTime;
private float fireMultDelay = 0.1f;
private GameObject gunBarrel;
private GameObject rocket = PrefabBox.rocket;
private GameObject grenade = PrefabBox.grenade;
private GameObject beam = PrefabBox.beam;
private GameObject coin = PrefabBox.coin;
private GameObject cannonball = PrefabBox.cannonball;
private GameObject gutterbeam = PrefabBox.gutterbeam;
private GameObject camObj;
private Camera cam;
private CameraController cc;
private GunControl gc;
private Animator anim;
private CameraFrustumTargeter targeter;
private AudioSource gunBarrelAud;
private WeaponIcon weaponIcon;
private WeaponPos wpos;
private WeaponIdentifier wid;
private void Start()
{
//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_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_011a: Unknown result type (might be due to invalid IL or missing references)
cam = ((Component)MonoSingleton<CameraController>.Instance).GetComponent<Camera>();
gc = ((Component)MonoSingleton<GunControl>.Instance).GetComponent<GunControl>();
camObj = ((Component)cam).gameObject;
cc = MonoSingleton<CameraController>.Instance;
gunBarrel = ((Component)this).gameObject.DescendantByName("ShootPoint");
gunBarrelAud = gunBarrel.GetComponent<AudioSource>();
anim = ((Component)this).GetComponent<Animator>();
targeter = MonoSingleton<CameraFrustumTargeter>.instance;
wid = ((Component)this).gameObject.GetComponent<WeaponIdentifier>();
weaponIcon = ((Component)this).gameObject.AddComponent<WeaponIcon>();
wpos = ((Component)this).gameObject.AddComponent<WeaponPos>();
wpos.defaultPos = new Vector3(0.731f, -0.3491f, 1.2509f);
wpos.middlePos = new Vector3(0f, -0.3491f, 1.2509f);
if ((Object)(object)weaponIcon.weaponDescriptor == (Object)null)
{
weaponIcon.weaponDescriptor = ScriptableObject.CreateInstance<WeaponDescriptor>();
weaponIcon.weaponDescriptor.variationColor = (WeaponVariant)0;
weaponIcon.weaponDescriptor.icon = AssetHandler.LoadAsset<Sprite>("Trollface");
weaponIcon.weaponDescriptor.glowIcon = weaponIcon.weaponDescriptor.icon;
}
gunBarrelAud.clip = null;
RetreiveCharges();
}
private void OnEnable()
{
gunBarrelAud.Stop();
RetreiveCharges();
}
private void RetreiveCharges()
{
fireDelay = ChargeManager.funGun.fireDelay;
fireTime = ChargeManager.funGun.fireTime;
fireMult = ChargeManager.funGun.fireMult;
fireMultTime = ChargeManager.funGun.fireMultTime;
fireMultDelay = ChargeManager.funGun.fireMultDelay;
}
private void StoreCharges()
{
ChargeManager.funGun.fireDelay = fireDelay;
ChargeManager.funGun.fireTime = fireTime;
ChargeManager.funGun.fireMult = fireMult;
ChargeManager.funGun.fireMultTime = fireMultTime;
ChargeManager.funGun.fireMultDelay = fireMultDelay;
}
private void Update()
{
if (NoWeaponCooldown.NoCooldown)
{
fireMult = 100f;
}
fireTime += Time.deltaTime * fireMult;
fireMultTime += Time.deltaTime;
if (MonoSingleton<InputManager>.Instance.InputSource.Fire1.IsPressed && gc.activated && !GameStateManager.Instance.PlayerInputLocked)
{
((MonoBehaviour)this).Invoke("Shoot", wid.delay);
}
else if (MonoSingleton<InputManager>.Instance.InputSource.Fire2.IsPressed && gc.activated && !GameStateManager.Instance.PlayerInputLocked)
{
((MonoBehaviour)this).Invoke("Ball", wid.delay);
}
else if (fireMultDelay < fireMultTime)
{
fireMult *= 0.9f;
fireMultTime = 0f;
}
if (fireMult > 100f)
{
fireMult = 100f;
}
if (fireMult < 1f)
{
fireMult = 1f;
}
if (wid.delay == 0f)
{
StoreCharges();
}
}
public void Shoot()
{
//IL_0076: 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_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: 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_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: 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_0118: 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)
if (fireDelay < fireTime || NoWeaponCooldown.NoCooldown)
{
anim.SetTrigger("Shoot");
gunBarrelAud.clip = AssetHandler.LoadAsset<AudioClip>("FunShoot");
gunBarrelAud.pitch = 0.75f + fireMult * 0.02f;
gunBarrelAud.Play();
GameObject val = Object.Instantiate<GameObject>(beam, gunBarrel.transform.position, ((Component)cc).transform.rotation * GOPUtils.RandRot(fireMult / 100f));
val.GetComponent<RevolverBeam>();
val.GetComponent<RevolverBeam>().damage = 0.5f;
if (Object.op_Implicit((Object)(object)targeter.CurrentTarget) && targeter.IsAutoAimed)
{
Transform transform = val.transform;
Bounds bounds = targeter.CurrentTarget.bounds;
transform.LookAt(((Bounds)(ref bounds)).center);
Transform transform2 = val.transform;
transform2.rotation *= GOPUtils.RandRot(fireMult / 100f);
}
fireTime = 0f;
fireMult += 0.5f;
}
}
public void Ball()
{
//IL_007c: 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_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_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_0104: 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_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
if (fireDelay * 2.75f < fireTime || NoWeaponCooldown.NoCooldown)
{
anim.SetTrigger("Shoot");
gunBarrelAud.clip = AssetHandler.LoadAsset<AudioClip>("FunBall");
gunBarrelAud.pitch = 0.5f + fireMult * 0.02f;
gunBarrelAud.Play();
Rigidbody component = Object.Instantiate<GameObject>(cannonball, gunBarrel.transform.position + gunBarrel.transform.forward * 1f, ((Component)cc).transform.rotation).GetComponent<Rigidbody>();
if (Object.op_Implicit((Object)(object)targeter.CurrentTarget) && targeter.IsAutoAimed)
{
Transform transform = ((Component)component).transform;
Bounds bounds = targeter.CurrentTarget.bounds;
transform.LookAt(((Bounds)(ref bounds)).center);
}
component.AddForce(((Component)component).transform.forward * (2f * fireMult + 50f), (ForceMode)2);
fireTime = 0f;
fireMult -= 1.25f + fireMult * 0.05f;
if (fireMultDelay < fireMultTime)
{
fireMult *= 0.9f;
fireMultTime = 0f;
}
}
}
}
public class FunnyGun : GOPWeapon
{
public override GameObject Asset { get; protected set; }
public override int Slot { get; set; }
public override string Name { get; protected set; }
public override bool IsSetup { get; protected set; }
public override bool ShouldHave { get; set; }
public override void Setup()
{
Debug.Log((object)"Setting up Fun Gun");
if ((Object)(object)Asset == (Object)null)
{
Asset = AssetHandler.LoadAsset<GameObject>("Fun Gun Prefab");
}
if ((Object)(object)Asset != (Object)null && !IsSetup)
{
Name = "Funny Gun :D";
Slot = ConfigManager.FunGunSlot.value;
Asset.AddComponent<FunnyGunSoul>();
MeshRenderer val = default(MeshRenderer);
SkinnedMeshRenderer val2 = default(SkinnedMeshRenderer);
foreach (GameObject item in Asset.DescendantsList())
{
if (item.TryGetComponent<MeshRenderer>(ref val))
{
((Renderer)val).material.shader = ShaderBox.vertexlit_emissive;
}
else if (item.TryGetComponent<SkinnedMeshRenderer>(ref val2))
{
((Renderer)val2).material.shader = ShaderBox.vertexlit_emissive;
}
}
IsSetup = true;
}
else
{
Debug.Log((object)"Fun Gun Didn't load");
Name = "Fun Gun is NULL";
Slot = -1;
}
}
}
public class GoldenGunSoul : MonoBehaviour
{
private int maxShots = 32;
private float spread = 30f;
private int shots = 16;
private int damage;
private bool gunReady = true;
private int pumps;
private bool shouldFire1;
private bool shouldFire2;
private GameObject gunTip;
private GameObject rocket = PrefabBox.rocket;
private GameObject grenade = PrefabBox.grenade;
private GameObject beam = PrefabBox.beam;
private GameObject coin = PrefabBox.coin;
private GameObject camObj;
private GameObject coinShot;
private CoinShot coinShotComp;
private Coin coinComp;
private Camera cam;
private CameraController cc;
private GunControl gc;
private Animator anim;
private AudioSource gunTipAud;
private AudioSource pumpAud;
private AudioSource triggerAud;
private CameraFrustumTargeter targeter;
private WeaponIcon weaponIcon;
private WeaponIdentifier wid;
private WeaponPos wpos;
private void Start()
{
//IL_0140: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_015f: Unknown result type (might be due to invalid IL or missing references)
//IL_0164: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
cam = ((Component)MonoSingleton<CameraController>.Instance).GetComponent<Camera>();
gc = ((Component)MonoSingleton<GunControl>.Instance).GetComponent<GunControl>();
camObj = ((Component)cam).gameObject;
cc = MonoSingleton<CameraController>.Instance;
coinShot = AssetHandler.coinShot;
coinShotComp = coinShot.GetComponent<CoinShot>();
coinShotComp.sourceWeapon = ((Component)this).gameObject;
coinShotComp.ignoreCoins = true;
gunTip = ((Component)this).gameObject.DescendantByName("ShootPoint");
gunTipAud = gunTip.GetComponent<AudioSource>();
pumpAud = ((Component)this).gameObject.DescendantByName("Shotgun_Pump").GetComponent<AudioSource>();
triggerAud = ((Component)this).gameObject.DescendantByName("Shotgun_Trigger").GetComponent<AudioSource>();
targeter = MonoSingleton<CameraFrustumTargeter>.instance;
anim = ((Component)this).gameObject.DescendantByName("golden_shotgun").GetComponent<Animator>();
wid = ((Component)this).gameObject.GetComponent<WeaponIdentifier>();
weaponIcon = ((Component)this).gameObject.AddComponent<WeaponIcon>();
wpos = ((Component)this).gameObject.AddComponent<WeaponPos>();
wpos.defaultPos = new Vector3(0.6129f, -1.5981f, 1.5654f);
wpos.middlePos = new Vector3(-0.08f, -1.5981f, 1.5654f);
if ((Object)(object)weaponIcon.weaponDescriptor == (Object)null)
{
weaponIcon.weaponDescriptor = ScriptableObject.CreateInstance<WeaponDescriptor>();
weaponIcon.weaponDescriptor.variationColor = (WeaponVariant)3;
weaponIcon.weaponDescriptor.icon = AssetHandler.LoadAsset<Sprite>("Trollface");
weaponIcon.weaponDescriptor.glowIcon = weaponIcon.weaponDescriptor.icon;
}
pumps = ChargeManager.goldenGun.pumps;
}
private void Update()
{
if (NoWeaponCooldown.NoCooldown)
{
shouldFire1 = MonoSingleton<InputManager>.Instance.InputSource.Fire1.IsPressed;
shouldFire2 = MonoSingleton<InputManager>.Instance.InputSource.Fire2.IsPressed;
}
else
{
shouldFire1 = MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasPerformedThisFrame;
shouldFire2 = MonoSingleton<InputManager>.Instance.InputSource.Fire2.WasPerformedThisFrame;
}
if (shouldFire1 && gc.activated && !GameStateManager.Instance.PlayerInputLocked)
{
((MonoBehaviour)this).Invoke("Shoot", wid.delay);
}
if (shouldFire2 && gc.activated && !GameStateManager.Instance.PlayerInputLocked)
{
((MonoBehaviour)this).Invoke("Pump", wid.delay);
}
}
public void Shoot()
{
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_0192: Unknown result type (might be due to invalid IL or missing references)
//IL_019c: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
//IL_01bb: 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_01d0: Unknown result type (might be due to invalid IL or missing references)
//IL_01db: Unknown result type (might be due to invalid IL or missing references)
//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
//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_0223: Unknown result type (might be due to invalid IL or missing references)
//IL_0234: Unknown result type (might be due to invalid IL or missing references)
//IL_023f: Unknown result type (might be due to invalid IL or missing references)
//IL_0244: Unknown result type (might be due to invalid IL or missing references)
if (!gunReady)
{
return;
}
gunReady = false;
triggerAud.clip = AssetHandler.LoadAsset<AudioClip>("Click");
triggerAud.Play();
if (pumps > 0)
{
anim.SetTrigger("Shoot");
gunTipAud.clip = AssetHandler.LoadAsset<AudioClip>("ShotgunBoom");
gunTipAud.pitch = Random.Range(1.4f, 1.6f);
gunTipAud.Play();
switch (pumps)
{
case 1:
shots = 15;
spread = 20f;
coinShotComp.power = 1f;
break;
case 2:
shots = 10;
spread = 10f;
coinShotComp.power = 1.5f;
break;
case 3:
shots = 5;
spread = 5f;
coinShotComp.power = 3f;
break;
case 4:
shots = 1;
spread = 0f;
coinShotComp.power = 15f;
break;
default:
shots = 1;
spread = 0f;
coinShotComp.power = 15 + pumps - 4;
break;
}
for (int i = 0; i < shots; i++)
{
GameObject val = Object.Instantiate<GameObject>(coinShot, ((Component)cam).transform.position + ((Component)cam).transform.forward * 0.1f - ((Component)cam).transform.up * 0.1f, ((Component)cam).transform.rotation * GOPUtils.RandRot(spread));
if (Object.op_Implicit((Object)(object)targeter.CurrentTarget) && targeter.IsAutoAimed)
{
Transform transform = val.transform;
Bounds bounds = targeter.CurrentTarget.bounds;
transform.LookAt(((Bounds)(ref bounds)).center);
Transform transform2 = val.transform;
transform2.rotation *= GOPUtils.RandRot(spread);
}
}
pumps = 0;
coinShotComp.power = 1f;
}
else
{
anim.SetTrigger("EmptyShoot");
}
}
public void Pump()
{
if (gunReady)
{
gunReady = false;
if (pumps >= 3)
{
anim.SetTrigger("BigReload");
}
else
{
anim.SetTrigger("Reload");
}
}
}
public void ReadyGun()
{
gunReady = true;
}
public void PumpGun()
{
if (pumps >= 3)
{
pumpAud.clip = AssetHandler.LoadAsset<AudioClip>("BigCha");
pumpAud.pitch = 1f;
pumpAud.Play();
}
else
{
pumpAud.clip = AssetHandler.LoadAsset<AudioClip>("Cha");
pumpAud.pitch = 1f - (float)pumps * 0.08f;
pumpAud.Play();
}
}
public void UnpumpGun()
{
if (pumps >= 3)
{
pumpAud.clip = AssetHandler.LoadAsset<AudioClip>("BigChing");
pumpAud.pitch = 1f;
pumpAud.Play();
}
else
{
pumpAud.clip = AssetHandler.LoadAsset<AudioClip>("Ching");
pumpAud.pitch = 1f - (float)pumps * 0.08f;
pumpAud.Play();
}
pumps++;
if (wid.delay == 0f)
{
ChargeManager.goldenGun.pumps = pumps;
}
}
private void OnEnable()
{
pumps = ChargeManager.goldenGun.pumps;
}
private void OnDisable()
{
ChargeManager.goldenGun.pumps = 0;
}
}
public class GoldenGun : GOPWeapon
{
public override GameObject Asset { get; protected set; }
public override int Slot { get; set; }
public override string Name { get; protected set; }
public override bool IsSetup { get; protected set; }
public override bool ShouldHave { get; set; }
public override void Setup()
{
Debug.Log((object)"Setting up Golden Gun");
if ((Object)(object)Asset == (Object)null)
{
Asset = AssetHandler.LoadAsset<GameObject>("Golden Gun Prefab");
}
if ((Object)(object)Asset != (Object)null && !IsSetup)
{
Name = "Golden Shotgun";
Slot = ConfigManager.GoldenGunSlot.value;
Asset.AddComponent<GoldenGunSoul>();
MeshRenderer val = default(MeshRenderer);
foreach (GameObject item in Asset.DescendantsList())
{
if (item.TryGetComponent<MeshRenderer>(ref val))
{
((Renderer)val).material.shader = ShaderBox.vertexlit_emissive;
}
}
IsSetup = true;
}
else
{
Debug.Log((object)"Golden Shotgun Didn't load");
Name = "Golden Shotgun is NULL";
Slot = -1;
}
}
}
public class GoldenGunAnim : MonoBehaviour
{
private GoldenGunSoul soul;
private void Start()
{
soul = ((Component)this).GetComponentInParent<GoldenGunSoul>();
}
public void ReadyGun()
{
soul.ReadyGun();
}
public void PumpGun()
{
soul.PumpGun();
}
public void UnpumpGun()
{
soul.UnpumpGun();
}
}
public class CoinShot : MonoBehaviour
{
public Coin coin;
public float power = 1f;
private GameObject coinPref = PrefabBox.coin;
public GameObject sourceWeapon;
public bool ignoreCoins = true;
private LayerMask lmask;
private RaycastHit hit;
private EnemyIdentifier eid;
private void Start()
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: 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_0045: 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)
coin = coinPref.GetComponent<Coin>();
lmask = coin.lmask;
lmask = LayerMask.op_Implicit(LayerMask.op_Implicit(lmask) | GOPUtils.NameToLayerBit("Limb"));
lmask = LayerMask.op_Implicit(LayerMask.op_Implicit(lmask) | GOPUtils.NameToLayerBit("BigCorpse"));
Shoot();
((MonoBehaviour)this).Invoke("Death", 1f);
}
private void Death()
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
private void Update()
{
}
private void Shoot()
{
//IL_0006: 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_0022: 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_02da: Unknown result type (might be due to invalid IL or missing references)
//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: 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_028f: Unknown result type (might be due to invalid IL or missing references)
//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
//IL_02c0: 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_00c3: 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_008e: 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_009e: 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_01fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_020c: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: 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_021f: Unknown result type (might be due to invalid IL or missing references)
//IL_022a: Unknown result type (might be due to invalid IL or missing references)
bool flag = Physics.Raycast(((Component)this).transform.position, ((Component)this).transform.forward, ref hit, float.PositiveInfinity, LayerMask.op_Implicit(lmask));
LineRenderer component = coin.SpawnBeam().GetComponent<LineRenderer>();
component.SetPosition(0, ((Component)this).transform.position);
int num = 0;
if (flag && ignoreCoins)
{
Coin val = null;
RaycastHit val2 = hit;
do
{
if (((Component)((RaycastHit)(ref val2)).transform).gameObject.TryGetComponent<Coin>(ref val))
{
flag = Physics.Raycast(((RaycastHit)(ref val2)).point + ((Component)this).transform.forward, ((Component)this).transform.forward, ref val2, float.PositiveInfinity, LayerMask.op_Implicit(lmask));
if (!flag)
{
break;
}
num++;
continue;
}
hit = val2;
break;
}
while (num <= 20);
}
if (flag)
{
Transform transform = ((RaycastHit)(ref hit)).transform;
GameObject gameObject = ((Component)transform).gameObject;
GameObject val3 = Object.Instantiate<GameObject>(coinPref, ((RaycastHit)(ref hit)).point - ((Component)this).transform.forward, Quaternion.identity);
val3.GetComponent<Coin>().power = power;
if (gameObject.CompareTag("Enemy") || gameObject.CompareTag("Body") || gameObject.CompareTag("Limb") || gameObject.CompareTag("EndLimb") || gameObject.CompareTag("Head"))
{
EnemyIdentifierIdentifier componentInParent = ((Component)((RaycastHit)(ref hit)).transform).GetComponentInParent<EnemyIdentifierIdentifier>();
eid = componentInParent.eid;
if (Object.op_Implicit((Object)(object)eid) && !eid.dead)
{
eid.hitter = "coin shot";
if (!eid.hitterWeapons.Contains("coin shot"))
{
eid.hitterWeapons.Add("coin shot");
}
EnemyIdentifier obj = eid;
Vector3 val4 = transform.position - ((Component)this).transform.position;
obj.DeliverDamage(gameObject, ((Vector3)(ref val4)).normalized * 10000f, ((RaycastHit)(ref hit)).point, power, false, 1f, sourceWeapon, false);
if (power >= 10f)
{
MonoSingleton<StyleHUD>.Instance.AddPoints((int)(10f * power), "ultrakill.moneyshot", sourceWeapon, eid, -1, "", "");
}
}
}
component.SetPosition(1, ((RaycastHit)(ref hit)).point);
Rigidbody component2 = val3.GetComponent<Rigidbody>();
component2.velocity = Vector3.zero;
component2.AddForce(Vector3.up * 25f, (ForceMode)2);
new GameObject().AddComponent<CoinCollector>().coin = val3;
}
else
{
component.SetPosition(1, ((Component)this).transform.position + ((Component)this).transform.forward * 1000f);
}
}
}
}
namespace GunsOPlenty.Utils
{
public static class ChargeManager
{
public struct FunGun
{
public float fireTime;
public float fireDelay;
public float fireMult;
public float fireMultTime;
public float fireMultDelay;
}
public struct GoldenGun
{
public int pumps;
}
public static FunGun funGun;
public static GoldenGun goldenGun;
public static void Setup()
{
funGun.fireDelay = 1f;
funGun.fireTime = 0f;
funGun.fireMult = 1f;
funGun.fireMultTime = 0f;
funGun.fireMultDelay = 0.1f;
goldenGun.pumps = 0;
}
}
public static class ConfigManager
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static BoolValueChangeEventDelegate <>9__9_0;
public static BoolValueChangeEventDelegate <>9__9_1;
public static BoolValueChangeEventDelegate <>9__9_2;
internal void <Setup>b__9_0(BoolValueChangeEvent e)
{
((ConfigField)FunGunSlot).hidden = !e.value;
}
internal void <Setup>b__9_1(BoolValueChangeEvent e)
{
((ConfigField)GoldenGunSlot).hidden = !e.value;
}
internal void <Setup>b__9_2(BoolValueChangeEvent e)
{
((ConfigField)TestCubeSlot).hidden = !e.value;
((ConfigField)TestCubeEpicFire).hidden = !e.value;
}
}
public static PluginConfigurator config;
public static BoolField FunGunEnable;
public static BoolField GoldenGunEnable;
public static BoolField TestCubeEnable;
public static IntField FunGunSlot;
public static IntField GoldenGunSlot;
public static IntField TestCubeSlot;
public static BoolField StartupCheck;
public static BoolField TestCubeEpicFire;
public static void Setup()
{
//IL_0025: 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_004b: Expected O, but got Unknown
//IL_005c: 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_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Expected O, but got Unknown
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Expected O, but got Unknown
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Expected O, but got Unknown
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Expected O, but got Unknown
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Expected O, but got Unknown
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Expected O, but got Unknown
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Expected O, but got Unknown
//IL_017e: Unknown result type (might be due to invalid IL or missing references)
//IL_0183: Unknown result type (might be due to invalid IL or missing references)
//IL_0189: Expected O, but got Unknown
//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
//IL_01b2: Expected O, but got Unknown
//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_01db: Expected O, but got Unknown
config = PluginConfigurator.Create("Guns O' Plenty", "ironfarm.uk.shooty.shooty");
new ConfigHeader(config.rootPanel, "<color=white>-General Settings-</color>", 24);
StartupCheck = new BoolField(config.rootPanel, "Startup Load Check", "field.startupcheck", true, true);
new ConfigHeader(config.rootPanel, "<color=white>-Gun Settings-</color>", 24);
new ConfigHeader(config.rootPanel, "<color=red>Mission Reload Required For Changes To Appear</color>", 14);
FunGunEnable = new BoolField(config.rootPanel, "Enable Funny Gun", "field.fungunenable", true, true);
FunGunSlot = new IntField(config.rootPanel, "Funny Gun Slot", "field.fungunslot", 7, 1, 69, true, true);
GoldenGunEnable = new BoolField(config.rootPanel, "Enable Golden Gun", "field.goldengunenable", true, true);
GoldenGunSlot = new IntField(config.rootPanel, "Golden Gun Slot", "field.goldengunslot", 7, 1, 69, true, true);
TestCubeEnable = new BoolField(config.rootPanel, "Enable Test Cube", "field.testcubeenable", false, true);
TestCubeSlot = new IntField(config.rootPanel, "Test Cube Slot", "field.testcubeslot", 8, 1, 69, true, true);
TestCubeEpicFire = new BoolField(config.rootPanel, "make fire epic", "field.testcubefireisepic", false, true);
BoolField funGunEnable = FunGunEnable;
object obj = <>c.<>9__9_0;
if (obj == null)
{
BoolValueChangeEventDelegate val = delegate(BoolValueChangeEvent e)
{
((ConfigField)FunGunSlot).hidden = !e.value;
};
<>c.<>9__9_0 = val;
obj = (object)val;
}
funGunEnable.onValueChange += (BoolValueChangeEventDelegate)obj;
BoolField goldenGunEnable = GoldenGunEnable;
object obj2 = <>c.<>9__9_1;
if (obj2 == null)
{
BoolValueChangeEventDelegate val2 = delegate(BoolValueChangeEvent e)
{
((ConfigField)GoldenGunSlot).hidden = !e.value;
};
<>c.<>9__9_1 = val2;
obj2 = (object)val2;
}
goldenGunEnable.onValueChange += (BoolValueChangeEventDelegate)obj2;
BoolField testCubeEnable = TestCubeEnable;
object obj3 = <>c.<>9__9_2;
if (obj3 == null)
{
BoolValueChangeEventDelegate val3 = delegate(BoolValueChangeEvent e)
{
((ConfigField)TestCubeSlot).hidden = !e.value;
((ConfigField)TestCubeEpicFire).hidden = !e.value;
};
<>c.<>9__9_2 = val3;
obj3 = (object)val3;
}
testCubeEnable.onValueChange += (BoolValueChangeEventDelegate)obj3;
FunGunEnable.TriggerValueChangeEvent();
GoldenGunEnable.TriggerValueChangeEvent();
TestCubeEnable.TriggerValueChangeEvent();
string text = Path.Combine(Path.Combine(GOPUtils.ModDir(), "Data"), "icon.png");
config.SetIconWithURL("file://" + text);
}
public static bool CheatCheck()
{
return FunGunEnable.value | GoldenGunEnable.value | TestCubeEnable.value;
}
}
public class EnemyColliderDetector : MonoBehaviour
{
public List<EnemyIdentifier> hitList = new List<EnemyIdentifier>();
private List<EnemyIdentifier> toRemove = new List<EnemyIdentifier>();
private List<float> hitTimes = new List<float>();
private List<int> limbCount = new List<int>();
private List<List<GameObject>> limbs = new List<List<GameObject>>();
public float checkHitListFreq = 0.5f;
private void Start()
{
CheckHitList();
}
public void CheckHitList()
{
if (hitList.Count > 0)
{
for (int i = 0; i < hitList.Count; i++)
{
if ((Object)(object)hitList[i] == (Object)null || hitList[i].dead)
{
toRemove.Add(hitList[i]);
}
}
}
if (toRemove.Count > 0)
{
for (int j = 0; j < toRemove.Count; j++)
{
List<int> list = limbCount;
int index = hitList.IndexOf(toRemove[j]);
list[index]--;
if (limbCount[index] <= 0)
{
hitTimes.RemoveAt(index);
limbCount.RemoveAt(index);
limbs.RemoveAt(index);
hitList.Remove(toRemove[j]);
}
}
toRemove.Clear();
}
((MonoBehaviour)this).Invoke("CheckHitList", checkHitListFreq);
}
private void OnTriggerEnter(Collider other)
{
Enter(other);
}
private void OnTriggerExit(Collider other)
{
Exit(other);
}
private void OnTriggerEnter(Collision other)
{
Exit(other.collider);
}
private void OnTriggerExit(Collision other)
{
Exit(other.collider);
}
private void Enter(Collider other)
{
if (((Component)other).gameObject.layer != 10 && ((Component)other).gameObject.layer != 11 && ((Component)other).gameObject.layer != 12 && ((Component)other).gameObject.layer != 20)
{
return;
}
EnemyIdentifierIdentifier componentInParent = ((Component)((Component)other).transform).GetComponentInParent<EnemyIdentifierIdentifier>();
if (!((Object)(object)componentInParent != (Object)null) || !((Object)(object)componentInParent.eid != (Object)null) || componentInParent.eid.dead)
{
return;
}
if (!hitList.Contains(componentInParent.eid))
{
hitList.Add(componentInParent.eid);
hitTimes.Add(1f);
limbCount.Add(1);
limbs.Add(new List<GameObject>());
limbs[hitList.IndexOf(componentInParent.eid)].Add(((Component)componentInParent).gameObject);
_ = ((Behaviour)this).enabled;
}
else
{
limbCount[hitList.IndexOf(componentInParent.eid)]++;
if (!limbs[hitList.IndexOf(componentInParent.eid)].Contains(((Component)componentInParent).gameObject))
{
limbs[hitList.IndexOf(componentInParent.eid)].Add(((Component)componentInParent).gameObject);
}
}
}
private void Exit(Collider other)
{
if (((Component)other).gameObject.layer != 10 && ((Component)other).gameObject.layer != 11 && ((Component)other).gameObject.layer != 12 && ((Component)other).gameObject.layer != 20)
{
return;
}
EnemyIdentifierIdentifier componentInParent = ((Component)((Component)other).transform).GetComponentInParent<EnemyIdentifierIdentifier>();
if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.eid != (Object)null && hitList.Contains(componentInParent.eid))
{
List<int> list = limbCount;
int index = hitList.IndexOf(componentInParent.eid);
list[index]--;
if (limbs[hitList.IndexOf(componentInParent.eid)].Contains(((Component)componentInParent).gameObject))
{
limbs[hitList.IndexOf(componentInParent.eid)].Remove(((Component)componentInParent).gameObject);
}
if (limbCount[index] <= 0)
{
hitTimes.RemoveAt(index);
limbCount.RemoveAt(index);
limbs.RemoveAt(index);
hitList.Remove(componentInParent.eid);
}
}
}
public List<GameObject> GetLimbs(EnemyIdentifier eid)
{
if (limbs.Count > 0 && hitList.Contains(eid))
{
return limbs[hitList.IndexOf(eid)];
}
return null;
}
public void ClearStuff()
{
if (hitList.Count > 0)
{
hitTimes.Clear();
limbCount.Clear();
limbs.Clear();
hitList.Clear();
}
}
private void OnDisable()
{
ClearStuff();
}
}
public class HMRPlus : MonoSingleton<HMRPlus>
{
private string message;
private string newMessage;
private float duration;
private float startTime;
private float gradOffset;
private float gradFactor;
private bool silent;
private bool effectLoop;
public void Start()
{
}
public void Update()
{
//IL_0079: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
if (effectLoop)
{
float t = (Time.time - startTime) * gradFactor + gradOffset;
newMessage = message;
newMessage = newMessage.Replace('$', '\n');
newMessage = newMessage.Replace("</grad>", "</color>");
newMessage = newMessage.Replace("<grad=rainbow>", "<color=#" + GOPUtils.ColorToHexString(GOPUtils.LerpColorArrayNorm(GOPUtils.RainbowGrad, t)) + ">");
newMessage = newMessage.Replace("<grad=crimson>", "<color=#" + GOPUtils.ColorToHexString(GOPUtils.LerpColorArrayNorm(GOPUtils.CrimsonGrad, t)) + ">");
newMessage = newMessage.Replace("<grad=fire>", "<color=#" + GOPUtils.ColorToHexString(GOPUtils.LerpColorArrayNorm(GOPUtils.FireGrad, t)) + ">");
MonoSingleton<HudMessageReceiver>.Instance.text.text = newMessage;
}
}
public void Done()
{
((Behaviour)MonoSingleton<HudMessageReceiver>.Instance.text).enabled = false;
((Behaviour)MonoSingleton<HudMessageReceiver>.Instance.img).enabled = false;
effectLoop = false;
}
public void SendHudMessageEffect(string message, float delay, float duration = 5f, bool silent = true, float gradFactor = 1f, float gradOffset = 0f)
{
this.message = message;
this.duration = duration;
this.silent = silent;
this.gradFactor = gradFactor;
this.gradOffset = gradOffset;
((MonoBehaviour)this).Invoke("ShowHudMessageEffect", delay);
}
public void SendHudMessage(string message, float delay, float duration = 5f, bool silent = true)
{
this.message = message;
this.duration = duration;
this.silent = silent;
((MonoBehaviour)this).Invoke("ShowHudMessage", delay);
}
private void ShowHudMessage()
{
MonoSingleton<HudMessageReceiver>.Instance.text.text = message;
MonoSingleton<HudMessageReceiver>.Instance.text.text = MonoSingleton<HudMessageReceiver>.Instance.text.text.Replace('$', '\n');
((Behaviour)MonoSingleton<HudMessageReceiver>.Instance.text).enabled = true;
((Behaviour)MonoSingleton<HudMessageReceiver>.Instance.img).enabled = true;
MonoSingleton<HudMessageReceiver>.Instance.hoe.Force();
if (!silent)
{
MonoSingleton<HudMessageReceiver>.Instance.aud.Play();
}
((MonoBehaviour)MonoSingleton<HudMessageReceiver>.Instance).CancelInvoke("Done");
effectLoop = false;
((MonoBehaviour)this).CancelInvoke("Done");
((MonoBehaviour)this).Invoke("Done", duration);
}
private void ShowHudMessageEffect()
{
MonoSingleton<HudMessageReceiver>.Instance.text.text = "";
((Behaviour)MonoSingleton<HudMessageReceiver>.Instance.text).enabled = true;
((Behaviour)MonoSingleton<HudMessageReceiver>.Instance.img).enabled = true;
MonoSingleton<HudMessageReceiver>.Instance.hoe.Force();
if (!silent)
{
MonoSingleton<HudMessageReceiver>.Instance.aud.Play();
}
((MonoBehaviour)MonoSingleton<HudMessageReceiver>.Instance).CancelInvoke("Done");
effectLoop = true;
startTime = Time.time;
((MonoBehaviour)this).CancelInvoke("Done");
((MonoBehaviour)this).Invoke("Done", duration);
}
}
public static class GOPUtils
{
public static Color[] RainbowGrad = (Color[])(object)new Color[6]
{
new Color(1f, 0f, 0f),
new Color(1f, 1f, 0f),
new Color(0f, 1f, 0f),
new Color(0f, 1f, 1f),
new Color(0f, 0f, 1f),
new Color(1f, 0f, 1f)
};
public static Color[] FireGrad = (Color[])(object)new Color[4]
{
new Color(1f, 0f, 0f),
new Color(1f, 0.8f, 0f),
new Color(1f, 0f, 0f),
new Color(1f, 0.5f, 0f)
};
public static Color[] CrimsonGrad = (Color[])(object)new Color[2]
{
new Color(0.85f, 0f, 0f),
new Color(0.15f, 0f, 0f)
};
public static Color[] DarkBlueGrad = (Color[])(object)new Color[2]
{
HexToColor("#373B44"),
HexToColor("#4286f4")
};
private static List<GameObject> descendants = new List<GameObject>();
public static Color HexToColor(string hex)
{
//IL_0002: 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)
Color result = default(Color);
ColorUtility.TryParseHtmlString(hex, ref result);
return result;
}
public static Color LerpColorArray(Color[] grad, float t)
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
float num = t % (float)grad.Length;
return Color.Lerp(grad[(int)Math.Floor(num)], grad[(int)Math.Ceiling(num) % grad.Length], num - (float)(int)Math.Floor(num));
}
public static Color LerpColorArrayNorm(Color[] grad, float t)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
return LerpColorArray(grad, t * (float)grad.Length);
}
public static string IntsToHexString(int r, int g, int b)
{
string text = ((r >= 16) ? r.ToString("X") : ("0" + r.ToString("X")));
string text2 = ((g >= 16) ? g.ToString("X") : ("0" + g.ToString("X")));
string text3 = ((b >= 16) ? b.ToString("X") : ("0" + b.ToString("X")));
return text + text2 + text3;
}
public static string ColorToHexString(Color color)
{
//IL_0000: 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_001a: Unknown result type (might be due to invalid IL or missing references)
return IntsToHexString((int)(color.r * 255f), (int)(color.g * 255f), (int)(color.b * 255f));
}
public static string ModDir()
{
return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
}
public static string ModPath()
{
return Assembly.GetExecutingAssembly().Location;
}
public static Quaternion RandRot(float x, float y, float z)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
return Quaternion.Euler(Random.Range(0f - x, x), Random.Range(0f - y, y), Random.Range(0f - z, z));
}
public static Quaternion RandRot(float range)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
return Quaternion.Euler(Random.Range(0f - range, range), Random.Range(0f - range, range), Random.Range(0f - range, range));
}
public static Vector3 RandPos(float x, float y, float z)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
return new Vector3(Random.Range(0f - x, x), Random.Range(0f - y, y), Random.Range(0f - z, z));
}
public static Vector3 RandPos(float range)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
return new Vector3(Random.Range(0f - range, range), Random.Range(0f - range, range), Random.Range(0f - range, range));
}
public static GameObject DescendantByName(this GameObject from, string name)
{
_ = from.transform.childCount;
_ = 0;
for (int i = 0; i < from.transform.childCount; i++)
{
GameObject gameObject = ((Component)from.transform.GetChild(i)).gameObject;
if (((Object)gameObject).name == name)
{
return gameObject;
}
GameObject val = gameObject.DescendantByName(name);
if ((Object)(object)val != (Object)null)
{
return val;
}
}
return null;
}
private static void GatherDescendants(this GameObject from)
{
for (int i = 0; i < from.transform.childCount; i++)
{
descendants.Add(((Component)from.transform.GetChild(i)).gameObject);
((Component)from.transform.GetChild(i)).gameObject.GatherDescendants();
}
}
public static List<GameObject> DescendantsList(this GameObject from)
{
if (descendants.Count > 0)
{
descendants.Clear();
}
from.GatherDescendants();
return descendants;
}
public static List<string> LayerMaskNames(LayerMask lmask)
{
List<string> list = new List<string>();
int num = 1;
for (int i = 0; i < 32; i++)
{
if ((((LayerMask)(ref lmask)).value & num) > 0)
{
list.Add(LayerMask.LayerToName(i));
}
num *= 2;
}
return list;
}
public static int NameToLayerBit(string name)
{
int num = LayerMask.NameToLayer(name);
if (num > -1)
{
return (int)Math.Pow(2.0, num);
}
return num;
}
}
}
namespace GunsOPlenty.Data
{
public static class AssetHandler
{
public static AssetBundle bundle;
public static bool bundleLoaded;
public static GameObject coinShot;
public static GameObject generator;
public static GameObject beething;
public static void LoadBundle()
{
if (bundleLoaded)
{
Debug.Log((object)"Bundle already loaded");
return;
}
bundle = AssetBundle.LoadFromFile(Path.Combine(Path.Combine(GOPUtils.ModDir(), "Data"), "gop_assets"));
if ((Object)(object)bundle != (Object)null)
{
Debug.Log((object)"Bundle successfully loaded");
bundleLoaded = true;
}
else
{
Debug.Log((object)"Bundle failed to loaded");
bundleLoaded = false;
}
}
public static T LoadAsset<T>(string name) where T : Object
{
if (!bundleLoaded)
{
Debug.Log((object)"Bundle is not loaded");
return default(T);
}
T val = bundle.LoadAsset<T>(name);
if ((Object)(object)val == (Object)null)
{
Debug.Log((object)(name + " didn't load"));
}
return val;
}
public static void UnloadBundle()
{
if (!bundleLoaded)
{
Debug.Log((object)"Bundle already unloaded");
return;
}
Debug.Log((object)"Bundle succesfully unloaded");
bundle.Unload(true);
bundle = null;
}
public static void CreateCustomPrefabs()
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
coinShot = AssetHandler.LoadAsset<GameObject>("Testo");
((Object)coinShot).name = "Coin Shot";
coinShot.AddComponent<CoinShot>();
LayerMask.op_Implicit(0);
generator = AssetHandler.LoadAsset<GameObject>("Test Thing");
MeshRenderer val = default(MeshRenderer);
foreach (GameObject item in generator.DescendantsList())
{
if (item.TryGetComponent<MeshRenderer>(ref val))
{
((Renderer)val).material.shader = ShaderBox.vertexlit;
item.AddComponent<OutdoorsChecker>();
}
}
beething = AssetHandler.LoadAsset<GameObject>("Test Creature");
MeshRenderer val2 = default(MeshRenderer);
foreach (GameObject item2 in beething.DescendantsList())
{
if (item2.TryGetComponent<MeshRenderer>(ref val2))
{
((Renderer)val2).material.shader = ShaderBox.vertexlit;
item2.AddComponent<OutdoorsChecker>();
}
}
EffectBox.fire = AssetHandler.LoadAsset<GameObject>("FlameThrower");
EffectBox.epicFire = AssetHandler.LoadAsset<GameObject>("EpicThrower");
EffectBox.bubble = AssetHandler.LoadAsset<GameObject>("BubbleThrower");
EffectBox.epicBubble = AssetHandler.LoadAsset<GameObject>("EpicBubbleThrower");
}
}
public static class PrefabBox
{
public static GameObject boom = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Attacks and Projectiles/Explosions/Explosion.prefab").WaitForCompletion();
public static GameObject bigBoom = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Attacks and Projectiles/Explosions/Explosion Big.prefab").WaitForCompletion();
public static GameObject superBoom = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Attacks and Projectiles/Explosions/Explosion Super.prefab").WaitForCompletion();
public static GameObject harmlessBoom = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Attacks and Projectiles/Explosions/Explosion Rocket Harmless.prefab").WaitForCompletion();
public static GameObject beam = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Attacks and Projectiles/Hitscan Beams/Revolver Beam.prefab").WaitForCompletion();
public static GameObject coin = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Attacks and Projectiles/Coin.prefab").WaitForCompletion();
public static GameObject grenade = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Attacks and Projectiles/Grenade.prefab").WaitForCompletion();
public static GameObject rocket = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Attacks and Projectiles/Rocket.prefab").WaitForCompletion();
public static GameObject cannonball = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Attacks and Projectiles/Cannonball.prefab").WaitForCompletion();
public static GameObject progHomingExpl = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Attacks and Projectiles/Projectile Homing Explosive.prefab").WaitForCompletion();
public static GameObject gutterbeam = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Attacks and Projectiles/Hitscan Beams/Gutterman Beam.prefab").WaitForCompletion();
public static GameObject gutterRocket = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Attacks and Projectiles/RocketEnemy.prefab").WaitForCompletion();
}
public static class ShaderBox
{
public static Shader vertexlit = Addressables.LoadAssetAsync<Shader>((object)"Assets/Shaders/Main/ULTRAKILL-vertexlit.shader").WaitForCompletion();
public static Shader psx_abient = Addressables.LoadAssetAsync<Shader>((object)"Assets/Shaders/Main/ULTRAKILL-unlit-ambient.shader").WaitForCompletion();
public static Shader vertexlit_emissive = Addressables.LoadAssetAsync<Shader>((object)"Assets/Shaders/Main/ULTRAKILL-vertexlit-emissive.shader").WaitForCompletion();
}
public static class EffectBox
{
public static GameObject fire;
public static GameObject epicFire;
public static GameObject bubble;
public static GameObject epicBubble;
}
public static class WhyDoesGettingAddressableNamesAtRuntimeHaveToBeSoHard
{
public static async void GetAddressKeys()
{
}
}
}