using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using SideLoader;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("AssetBrowser")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.5.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Asset Browser")]
[assembly: AssemblyTitle("AssetBrowser")]
[assembly: AssemblyVersion("1.5.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace AssetBrowser
{
[BepInPlugin("com.wrango.assetbrowser", "Asset Browser", "1.5.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class AssetBrowserPlugin : BaseUnityPlugin
{
private enum Mode
{
Sound,
VFX,
Projectile,
Blast,
Animation
}
public const string GUID = "com.wrango.assetbrowser";
public const string NAME = "Asset Browser";
public const string VERSION = "1.5.0";
internal static ManualLogSource Log;
internal static AssetBrowserPlugin Instance;
private ConfigEntry<bool> m_enabled;
private ConfigEntry<float> m_autoStopSeconds;
private ConfigEntry<KeyboardShortcut> m_keyNext;
private ConfigEntry<KeyboardShortcut> m_keyPrev;
private ConfigEntry<KeyboardShortcut> m_keyJumpForward;
private ConfigEntry<KeyboardShortcut> m_keyJumpBack;
private ConfigEntry<KeyboardShortcut> m_keyReplay;
private ConfigEntry<KeyboardShortcut> m_keyNextGroup;
private ConfigEntry<KeyboardShortcut> m_keyPrevGroup;
private ConfigEntry<KeyboardShortcut> m_keyKeep;
private ConfigEntry<KeyboardShortcut> m_keyToggleMode;
private ConfigEntry<KeyboardShortcut> m_keyStop;
private ConfigEntry<int> m_jumpSize;
private ConfigEntry<float> m_projectileLifespan;
private ConfigEntry<float> m_projectileForce;
private ConfigEntry<Vector3> m_vfxPosition;
private ConfigEntry<Vector3> m_projPosition;
private ConfigEntry<Vector3> m_blastPosition;
private ConfigEntry<bool> m_enableAnimations;
private ConfigEntry<bool> m_allowHarmfulAnimations;
private ConfigEntry<string> m_filter;
private const float PreviewBlastRadius = 3f;
private static readonly string[] Groups = new string[7] { "SFX", "ENV", "UI", "FT", "BGM", "LOC", "CS" };
private readonly Dictionary<string, List<Sounds>> m_byGroup = new Dictionary<string, List<Sounds>>();
private int m_groupIndex;
private int m_soundIndex;
private SplitableSoundSource m_playing;
private Sounds m_playingSound;
private float m_stopAt = -1f;
private bool m_wroteKeeperHeader;
private const int ModeCount = 5;
private Mode m_mode;
private int m_vfxIndex;
private readonly List<VFXPrefabs> m_vfxList = new List<VFXPrefabs>();
private GameObject m_vfxInstance;
private int m_blastIndex;
private readonly List<BlastPrefabs> m_blastList = new List<BlastPrefabs>();
private int m_animIndex;
private readonly List<SpellCastType> m_animList = new List<SpellCastType>();
private int m_vfxTotal;
private int m_projTotal;
private int m_blastTotal;
private int m_animTotal;
private readonly Dictionary<string, int> m_groupTotals = new Dictionary<string, int>();
private bool m_animPlaying;
private static readonly SpellCastType[] HarmfulAnimations;
private const int FirstAttackCast = 500;
private ShootBlast m_blaster;
private GameObject m_blasterObject;
private int m_projIndex;
private readonly List<ProjectilePrefabs> m_projList = new List<ProjectilePrefabs>();
private GameObject m_projInstance;
private ShootProjectile m_shooter;
private GameObject m_shooterObject;
private List<Sounds> Current => m_byGroup[Groups[m_groupIndex]];
private static string KeeperPath => Path.Combine(Paths.BepInExRootPath, "AssetBrowserKept.txt");
private bool FilterActive
{
get
{
if (m_filter != null)
{
return !string.IsNullOrEmpty(m_filter.Value);
}
return false;
}
}
private void BindConfig()
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Expected O, but got Unknown
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Expected O, but got Unknown
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Expected O, but got Unknown
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Expected O, but got Unknown
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_0164: Expected O, but got Unknown
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: Expected O, but got Unknown
//IL_0257: Unknown result type (might be due to invalid IL or missing references)
//IL_0261: Expected O, but got Unknown
//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
//IL_02b5: Expected O, but got Unknown
//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
//IL_02fb: Expected O, but got Unknown
//IL_0320: Unknown result type (might be due to invalid IL or missing references)
//IL_0346: Unknown result type (might be due to invalid IL or missing references)
//IL_0350: Expected O, but got Unknown
//IL_0375: Unknown result type (might be due to invalid IL or missing references)
//IL_039b: Unknown result type (might be due to invalid IL or missing references)
//IL_03a5: Expected O, but got Unknown
//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
//IL_042c: Unknown result type (might be due to invalid IL or missing references)
//IL_0464: Unknown result type (might be due to invalid IL or missing references)
//IL_0493: Unknown result type (might be due to invalid IL or missing references)
//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
//IL_04f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0520: Unknown result type (might be due to invalid IL or missing references)
//IL_054f: Unknown result type (might be due to invalid IL or missing references)
//IL_057b: Unknown result type (might be due to invalid IL or missing references)
m_enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Master switch", true, new ConfigDescription("Turn off to ignore every hotkey without uninstalling.", (AcceptableValueBase)null, new object[1]
{
new ConfigurationManagerAttributes
{
Order = 60
}
}));
m_autoStopSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Auto-stop seconds", 5f, new ConfigDescription("Cut a playing sound after this many seconds.", (AcceptableValueBase)null, new object[1]
{
new ConfigurationManagerAttributes
{
Order = 40
}
}));
m_enableAnimations = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enable animations", false, new ConfigDescription("Include ANIMATION in the browse cycle. Off by default: animations play on your own character.", (AcceptableValueBase)null, new object[1]
{
new ConfigurationManagerAttributes
{
Order = 55
}
}));
m_allowHarmfulAnimations = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Allow harmful animations", false, new ConfigDescription("Un-hide the animations that do something real (WARNING: DeathIndirect kills you).", (AcceptableValueBase)null, new object[1]
{
new ConfigurationManagerAttributes
{
Order = 54
}
}));
m_allowHarmfulAnimations.SettingChanged += delegate
{
BuildAnimationList();
};
m_filter = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Filter", "", new ConfigDescription("Browse only assets whose name contains this text. Case-insensitive. Cleared when the game restarts.", (AcceptableValueBase)null, new object[1]
{
new ConfigurationManagerAttributes
{
Order = 58
}
}));
if (!string.IsNullOrEmpty(m_filter.Value))
{
Log.LogMessage((object)("Cleared the Filter left over from the last session (\"" + m_filter.Value + "\")."));
m_filter.Value = "";
}
m_filter.SettingChanged += delegate
{
RebuildAll();
};
m_enableAnimations.SettingChanged += delegate
{
if (!m_enableAnimations.Value && m_mode == Mode.Animation)
{
StopEverything();
m_mode = Mode.Sound;
}
};
m_jumpSize = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Jump size", 25, new ConfigDescription("How many entries the jump keys skip.", (AcceptableValueBase)null, new object[1]
{
new ConfigurationManagerAttributes
{
Order = 50
}
}));
m_projectileLifespan = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Projectile lifespan", 5f, new ConfigDescription("How many seconds a previewed projectile flies before it expires. Blasts share it.", (AcceptableValueBase)null, new object[1]
{
new ConfigurationManagerAttributes
{
Order = 30
}
}));
m_projectileForce = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Projectile force", 20f, new ConfigDescription("Launch speed for previewed projectiles.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 60f), new object[1]
{
new ConfigurationManagerAttributes
{
Order = 20
}
}));
m_vfxPosition = ((BaseUnityPlugin)this).Config.Bind<Vector3>("General", "VFX position", Vector3.zero, new ConfigDescription("Offset from your character. Matches Position on an SL_EffectTransform. Some prefabs re-anchor themselves to you and ignore it.", (AcceptableValueBase)null, new object[1]
{
new ConfigurationManagerAttributes
{
Order = 12
}
}));
m_projPosition = ((BaseUnityPlugin)this).Config.Bind<Vector3>("General", "Projectile position", new Vector3(0f, 1.5f, 0f), new ConfigDescription("Where the projectile leaves you. Y 1.5 is chest height, so the shot clears your body. Matches LocalPositionAdd in SL_ShootProjectile.", (AcceptableValueBase)null, new object[1]
{
new ConfigurationManagerAttributes
{
Order = 11
}
}));
m_blastPosition = ((BaseUnityPlugin)this).Config.Bind<Vector3>("General", "Blast position", new Vector3(0f, 1f, 2f), new ConfigDescription("Where the blast is centred relative to you. Z 2 puts it in front of you rather than on top of you. Matches LocalPositionAdd in SL_ShootBlast.", (AcceptableValueBase)null, new object[1]
{
new ConfigurationManagerAttributes
{
Order = 10
}
}));
m_keyNext = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "Next", new KeyboardShortcut((KeyCode)274, Array.Empty<KeyCode>()), "Next entry.");
m_keyPrev = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "Previous", new KeyboardShortcut((KeyCode)273, Array.Empty<KeyCode>()), "Previous entry.");
m_keyJumpForward = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "Jump forward", new KeyboardShortcut((KeyCode)274, (KeyCode[])(object)new KeyCode[1] { (KeyCode)305 }), "Skip forward by the jump size.");
m_keyJumpBack = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "Jump back", new KeyboardShortcut((KeyCode)273, (KeyCode[])(object)new KeyCode[1] { (KeyCode)305 }), "Skip back by the jump size.");
m_keyReplay = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "Replay", new KeyboardShortcut((KeyCode)277, Array.Empty<KeyCode>()), "Play the current entry again.");
m_keyNextGroup = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "Next group", new KeyboardShortcut((KeyCode)275, Array.Empty<KeyCode>()), "Next sound group.");
m_keyPrevGroup = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "Previous group", new KeyboardShortcut((KeyCode)276, Array.Empty<KeyCode>()), "Previous sound group.");
m_keyKeep = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "Keep", new KeyboardShortcut((KeyCode)279, Array.Empty<KeyCode>()), "Write the current entry to the log as a line ready to paste into an XML.");
m_keyToggleMode = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "Switch mode", new KeyboardShortcut((KeyCode)278, Array.Empty<KeyCode>()), "Cycle SOUND -> VFX -> PROJECTILE -> BLAST, and ANIMATION (if enabled).");
m_keyStop = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "Stop", new KeyboardShortcut((KeyCode)127, Array.Empty<KeyCode>()), "Clear any lingering asset.");
}
internal void Awake()
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
Instance = this;
Log = ((BaseUnityPlugin)this).Logger;
BindConfig();
BuildSoundGroups();
BuildVFXList();
try
{
new Harmony("com.wrango.assetbrowser").PatchAll(typeof(AssetBrowserPlugin).Assembly);
}
catch (Exception ex)
{
Log.LogError((object)("Harmony patching failed - projectile previews will not fly: " + ex));
}
Log.LogMessage((object)"Asset Browser 1.5.0 loaded. Keys are rebindable in the config.");
string[] groups = Groups;
foreach (string text in groups)
{
Log.LogMessage((object)(" " + text + ": " + CountLabel(m_byGroup[text].Count, m_groupTotals[text], "sounds")));
}
Log.LogMessage((object)(" VFX: " + CountLabel(m_vfxList.Count, m_vfxTotal, "prefabs")));
Log.LogMessage((object)(" Projectiles: " + CountLabel(m_projList.Count, m_projTotal, "prefabs")));
Log.LogMessage((object)(" Blasts: " + CountLabel(m_blastList.Count, m_blastTotal, "prefabs")));
}
internal void Update()
{
if (m_stopAt > 0f && Time.time >= m_stopAt)
{
StopCurrentSound();
}
if (m_enabled.Value)
{
if (Pressed(m_keyJumpForward))
{
Step(m_jumpSize.Value);
}
else if (Pressed(m_keyJumpBack))
{
Step(-m_jumpSize.Value);
}
else if (Pressed(m_keyNext))
{
Step(1);
}
else if (Pressed(m_keyPrev))
{
Step(-1);
}
else if (Pressed(m_keyReplay))
{
Play();
}
else if (Pressed(m_keyNextGroup))
{
StepGroup(1);
}
else if (Pressed(m_keyPrevGroup))
{
StepGroup(-1);
}
else if (Pressed(m_keyKeep))
{
Keep();
}
else if (Pressed(m_keyToggleMode))
{
ToggleMode();
}
else if (Pressed(m_keyStop))
{
StopEverything();
}
}
}
private static bool Pressed(ConfigEntry<KeyboardShortcut> key)
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
if (key != null)
{
KeyboardShortcut value = key.Value;
return ((KeyboardShortcut)(ref value)).IsDown();
}
return false;
}
private static int Wrap(int index, int delta, int count)
{
return ((index + delta) % count + count) % count;
}
private void Step(int delta)
{
if (m_mode == Mode.VFX)
{
if (m_vfxList.Count != 0)
{
m_vfxIndex = Wrap(m_vfxIndex, delta, m_vfxList.Count);
Play();
}
return;
}
if (m_mode == Mode.Projectile)
{
if (m_projList.Count != 0)
{
m_projIndex = Wrap(m_projIndex, delta, m_projList.Count);
Play();
}
return;
}
if (m_mode == Mode.Blast)
{
if (m_blastList.Count != 0)
{
m_blastIndex = Wrap(m_blastIndex, delta, m_blastList.Count);
Play();
}
return;
}
if (m_mode == Mode.Animation)
{
if (m_animList.Count != 0)
{
m_animIndex = Wrap(m_animIndex, delta, m_animList.Count);
Play();
}
return;
}
List<Sounds> current = Current;
if (current.Count != 0)
{
m_soundIndex = Wrap(m_soundIndex, delta, current.Count);
Play();
}
}
private void StepGroup(int delta)
{
if (m_mode != Mode.Sound)
{
return;
}
for (int i = 0; i < Groups.Length; i++)
{
m_groupIndex = Wrap(m_groupIndex, delta, Groups.Length);
if (Current.Count > 0)
{
break;
}
}
m_soundIndex = 0;
Notify("== " + Groups[m_groupIndex] + " == " + CountLabel(Current.Count, GroupTotal(), "sounds"));
Play();
}
private unsafe void Play()
{
//IL_0057: 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_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
if (m_mode == Mode.VFX)
{
PlayVFX();
return;
}
if (m_mode == Mode.Projectile)
{
PlayProjectile();
return;
}
if (m_mode == Mode.Blast)
{
PlayBlast();
return;
}
if (m_mode == Mode.Animation)
{
PlayAnimation();
return;
}
List<Sounds> current = Current;
if (current.Count != 0)
{
Sounds val = current[m_soundIndex];
string text = "[" + (m_soundIndex + 1) + "/" + current.Count + "] " + ((object)(*(Sounds*)(&val))/*cast due to .constrained prefix*/).ToString();
StopCurrentSound();
Character val2 = LocalPlayer();
if (Object.op_Implicit((Object)(object)val2) && (Object)(object)Global.AudioManager != (Object)null)
{
m_playing = Global.AudioManager.PlaySoundAtPosition(val, ((Component)val2).transform, 0f, 1f, 1f, 1f, 1f);
m_playingSound = val;
m_stopAt = Time.time + m_autoStopSeconds.Value;
text += ClipLength(m_playing);
}
Notify(text);
Log.LogMessage((object)text);
}
}
private static string BlastShape(BlastPrefabs prefabEnum)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
try
{
GameObject blastPrefab = SL_ShootBlast.GetBlastPrefab(prefabEnum);
if (!Object.op_Implicit((Object)(object)blastPrefab))
{
return "";
}
Blast component = blastPrefab.GetComponent<Blast>();
if ((Object)(object)component == (Object)null)
{
return "";
}
return ((object)component).GetType().Name switch
{
"Blast" => "",
"ConeBlast" => " (cone)",
"LanternConeBlast" => " (cone, lantern)",
"BlastGround" => " (ground)",
"LingeringBlast" => " (lingering)",
"CircularBlast" => " (circular)",
"BlastTurret" => " (turret)",
"BlastDelayedHits" => " (delayed hits)",
"ActivationBlast" => " (activation)",
"BlastNoPhysics" => " (no physics)",
"BlastNoPhysicsMaxTarget" => " (no physics, max target)",
_ => " (" + ((object)component).GetType().Name + ")",
};
}
catch
{
return "";
}
}
private static string ClipLength(SplitableSoundSource source)
{
if ((Object)(object)source == (Object)null)
{
return "";
}
AudioSource[] componentsInChildren = ((Component)source).GetComponentsInChildren<AudioSource>(true);
if (componentsInChildren == null || componentsInChildren.Length == 0)
{
return "";
}
float num = 0f;
float num2 = float.MaxValue;
int num3 = 0;
AudioSource[] array = componentsInChildren;
foreach (AudioSource val in array)
{
if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.clip))
{
num3++;
if (val.clip.length > num)
{
num = val.clip.length;
}
if (val.clip.length < num2)
{
num2 = val.clip.length;
}
}
}
if (num3 == 0)
{
return "";
}
string text = " (" + num.ToString("0.00") + "s";
if (num3 > 1 && num - num2 > 0.01f)
{
text = text + ", longest of " + num3;
}
return text + ")";
}
private void StopCurrentSound()
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)m_playing == (Object)null))
{
if ((Object)(object)Global.AudioManager != (Object)null)
{
Global.AudioManager.StopSound(m_playingSound, m_playing, 0.15f, false);
}
m_playing = null;
m_stopAt = -1f;
}
}
private void Keep()
{
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
//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_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
//IL_0140: 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_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_017f: Unknown result type (might be due to invalid IL or missing references)
//IL_021d: Unknown result type (might be due to invalid IL or missing references)
//IL_0222: Unknown result type (might be due to invalid IL or missing references)
//IL_0242: Unknown result type (might be due to invalid IL or missing references)
//IL_0247: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
//IL_01c1: 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_01eb: Unknown result type (might be due to invalid IL or missing references)
if (m_mode == Mode.VFX)
{
if (m_vfxList.Count != 0)
{
Kept("<VFXPrefab>" + ((object)m_vfxList[m_vfxIndex]/*cast due to .constrained prefix*/).ToString() + "</VFXPrefab> (or <StartVFX>" + ((object)m_vfxList[m_vfxIndex]/*cast due to .constrained prefix*/).ToString() + "</StartVFX>)", ((object)m_vfxList[m_vfxIndex]/*cast due to .constrained prefix*/).ToString());
}
}
else if (m_mode == Mode.Projectile)
{
if (m_projList.Count != 0)
{
Kept("<BaseProjectile>" + ((object)m_projList[m_projIndex]/*cast due to .constrained prefix*/).ToString() + "</BaseProjectile>", ((object)m_projList[m_projIndex]/*cast due to .constrained prefix*/).ToString());
}
}
else if (m_mode == Mode.Blast)
{
if (m_blastList.Count != 0)
{
Kept("<BaseBlast>" + ((object)m_blastList[m_blastIndex]/*cast due to .constrained prefix*/).ToString() + "</BaseBlast>" + BlastShape(m_blastList[m_blastIndex]), ((object)m_blastList[m_blastIndex]/*cast due to .constrained prefix*/).ToString());
}
}
else if (m_mode == Mode.Animation)
{
if (m_animList.Count != 0)
{
Kept("<Animation>" + ((object)m_animList[m_animIndex]/*cast due to .constrained prefix*/).ToString() + "</Animation> (SL_PlayAnimation, or CastType on an item)", ((object)m_animList[m_animIndex]/*cast due to .constrained prefix*/).ToString());
}
}
else
{
List<Sounds> current = Current;
if (current.Count != 0)
{
Kept("<Sounds>" + ((object)current[m_soundIndex]/*cast due to .constrained prefix*/).ToString() + "</Sounds>", ((object)current[m_soundIndex]/*cast due to .constrained prefix*/).ToString());
}
}
}
private void Kept(string line, string name)
{
Log.LogMessage((object)("KEEP " + line));
AppendKeeper(line);
Notify("Kept: " + name);
}
private void AppendKeeper(string line)
{
try
{
if (!m_wroteKeeperHeader)
{
m_wroteKeeperHeader = true;
string text = "# " + DateTime.Now.ToString("dd-MM-yy HH:mm") + Environment.NewLine;
if (File.Exists(KeeperPath) && new FileInfo(KeeperPath).Length > 0)
{
text = Environment.NewLine + text;
}
File.AppendAllText(KeeperPath, text);
}
File.AppendAllText(KeeperPath, line + Environment.NewLine);
}
catch (Exception ex)
{
Log.LogWarning((object)("Could not write the keeper to " + KeeperPath + " - " + ex.Message));
}
}
private static bool IsHarmful(SpellCastType type)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Invalid comparison between I4 and Unknown
for (int i = 0; i < HarmfulAnimations.Length; i++)
{
if ((int)HarmfulAnimations[i] == (int)type)
{
return true;
}
}
return false;
}
private void BuildVFXList()
{
//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_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//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_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_013a: 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)
m_vfxList.Clear();
m_projList.Clear();
m_blastList.Clear();
m_vfxTotal = 0;
m_projTotal = 0;
m_blastTotal = 0;
foreach (VFXPrefabs value in Enum.GetValues(typeof(VFXPrefabs)))
{
if ((int)value != 0)
{
m_vfxTotal++;
if (Matches(((object)value/*cast due to .constrained prefix*/).ToString()))
{
m_vfxList.Add(value);
}
}
}
foreach (ProjectilePrefabs value2 in Enum.GetValues(typeof(ProjectilePrefabs)))
{
if ((int)value2 != 0)
{
m_projTotal++;
if (Matches(((object)value2/*cast due to .constrained prefix*/).ToString()))
{
m_projList.Add(value2);
}
}
}
foreach (BlastPrefabs value3 in Enum.GetValues(typeof(BlastPrefabs)))
{
if ((int)value3 != 0)
{
m_blastTotal++;
if (Matches(((object)value3/*cast due to .constrained prefix*/).ToString()))
{
m_blastList.Add(value3);
}
}
}
if (m_vfxIndex >= m_vfxList.Count)
{
m_vfxIndex = 0;
}
if (m_projIndex >= m_projList.Count)
{
m_projIndex = 0;
}
if (m_blastIndex >= m_blastList.Count)
{
m_blastIndex = 0;
}
BuildAnimationList();
}
private void BuildSoundGroups()
{
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
string[] groups = Groups;
foreach (string key in groups)
{
if (m_byGroup.ContainsKey(key))
{
m_byGroup[key].Clear();
}
else
{
m_byGroup[key] = new List<Sounds>();
}
m_groupTotals[key] = 0;
}
foreach (Sounds value in Enum.GetValues(typeof(Sounds)))
{
string text = ((object)value/*cast due to .constrained prefix*/).ToString();
groups = Groups;
foreach (string text2 in groups)
{
if (text.StartsWith(text2 + "_", StringComparison.Ordinal))
{
m_groupTotals[text2]++;
if (Matches(text))
{
m_byGroup[text2].Add(value);
}
break;
}
}
}
if (m_soundIndex >= Current.Count)
{
m_soundIndex = 0;
}
}
private bool Matches(string name)
{
if (!FilterActive)
{
return true;
}
return name.IndexOf(m_filter.Value, StringComparison.OrdinalIgnoreCase) >= 0;
}
private int GroupTotal()
{
if (!m_groupTotals.TryGetValue(Groups[m_groupIndex], out var value))
{
return 0;
}
return value;
}
private string CountLabel(int shown, int total, string noun)
{
if (!FilterActive)
{
return shown + " " + noun;
}
return shown + " of " + total + " " + noun + " match \"" + m_filter.Value + "\"";
}
private void RebuildAll()
{
StopEverything();
BuildSoundGroups();
BuildVFXList();
m_vfxIndex = 0;
m_projIndex = 0;
m_blastIndex = 0;
m_animIndex = 0;
m_soundIndex = 0;
for (int i = 0; i < Groups.Length; i++)
{
if (Current.Count != 0)
{
break;
}
m_groupIndex = Wrap(m_groupIndex, 1, Groups.Length);
}
int num = m_vfxList.Count + m_projList.Count + m_blastList.Count + m_animList.Count;
string[] groups = Groups;
foreach (string key in groups)
{
num += m_byGroup[key].Count;
}
if (!FilterActive)
{
Log.LogMessage((object)"Filter cleared - browsing everything again.");
Notify("Filter cleared");
return;
}
if (num == 0)
{
Log.LogWarning((object)("Filter \"" + m_filter.Value + "\" matches NOTHING. Every mode is empty and the browse keys will do nothing until you clear it."));
Notify("Filter \"" + m_filter.Value + "\" matches nothing");
return;
}
Log.LogMessage((object)("Filter \"" + m_filter.Value + "\": " + num + " assets match."));
Notify("Filter \"" + m_filter.Value + "\" - " + num + " match");
}
private void BuildAnimationList()
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Invalid comparison between Unknown and I4
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
bool flag = m_allowHarmfulAnimations != null && m_allowHarmfulAnimations.Value;
m_animList.Clear();
m_animTotal = 0;
foreach (SpellCastType value in Enum.GetValues(typeof(SpellCastType)))
{
if ((int)value != -1 && (flag || !IsHarmful(value)))
{
m_animTotal++;
if (Matches(((object)value/*cast due to .constrained prefix*/).ToString()))
{
m_animList.Add(value);
}
}
}
if (m_animIndex >= m_animList.Count)
{
m_animIndex = 0;
}
}
private void ToggleMode()
{
for (int i = 0; i < 5; i++)
{
m_mode = (Mode)((int)(m_mode + 1) % 5);
if (m_mode != Mode.Animation || m_enableAnimations.Value)
{
break;
}
}
StopEverything();
switch (m_mode)
{
case Mode.VFX:
Notify("== VFX == " + CountLabel(m_vfxList.Count, m_vfxTotal, "prefabs"));
break;
case Mode.Projectile:
Notify("== PROJECTILE == " + CountLabel(m_projList.Count, m_projTotal, "prefabs"));
break;
case Mode.Blast:
Notify("== BLAST == " + CountLabel(m_blastList.Count, m_blastTotal, "prefabs"));
break;
case Mode.Animation:
Notify("== ANIMATION == " + CountLabel(m_animList.Count, m_animTotal, "casts") + (m_allowHarmfulAnimations.Value ? ", harmful included" : ""));
break;
default:
Notify("== SOUND == " + Groups[m_groupIndex] + ", " + CountLabel(Current.Count, GroupTotal(), "sounds"));
break;
}
Play();
}
private unsafe void PlayAnimation()
{
//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_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Invalid comparison between Unknown and I4
//IL_00bd: 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)
if (m_animList.Count == 0)
{
return;
}
Character val = LocalPlayer();
if (Object.op_Implicit((Object)(object)val))
{
SpellCastType val2 = m_animList[m_animIndex];
string text = "[" + (m_animIndex + 1) + "/" + m_animList.Count + "] " + ((object)(*(SpellCastType*)(&val2))/*cast due to .constrained prefix*/).ToString();
ClearAnimation();
if ((int)val2 >= 500)
{
val.ForceCastSpell(val2, ((Component)val).gameObject, (SpellCastModifier)2, 0, -1f);
text += " (weapon attack)";
}
else if (!val.CastSpell(val2, ((Component)val).gameObject, (SpellCastModifier)0, 0, -1f))
{
text += " (refused)";
}
m_animPlaying = true;
Notify(text);
Log.LogMessage((object)text);
}
}
private void ClearAnimation()
{
if (m_animPlaying)
{
m_animPlaying = false;
Character val = LocalPlayer();
if (Object.op_Implicit((Object)(object)val))
{
val.ForceCancel(true, true);
}
}
}
private void StopEverything()
{
StopCurrentSound();
ClearVFX();
ClearProjectile();
ClearBlast();
ClearAnimation();
}
private void ClearVFX()
{
if (Object.op_Implicit((Object)(object)m_vfxInstance))
{
VFXSystem component = m_vfxInstance.GetComponent<VFXSystem>();
if (Object.op_Implicit((Object)(object)component))
{
component.Stop();
}
Object.Destroy((Object)(object)m_vfxInstance);
m_vfxInstance = null;
}
}
private unsafe void PlayVFX()
{
//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_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
if (m_vfxList.Count == 0)
{
return;
}
ClearVFX();
VFXPrefabs val = m_vfxList[m_vfxIndex];
string text = "[" + (m_vfxIndex + 1) + "/" + m_vfxList.Count + "] " + ((object)(*(VFXPrefabs*)(&val))/*cast due to .constrained prefix*/).ToString();
Character val2 = LocalPlayer();
GameObject vfxSystem = SL_PlayVFX.GetVfxSystem(val);
if (Object.op_Implicit((Object)(object)val2) && vfxSystem != null)
{
m_vfxInstance = Object.Instantiate<GameObject>(vfxSystem);
m_vfxInstance.transform.SetParent(((Component)val2).transform);
UnityEngineExtensions.ResetLocal(m_vfxInstance.transform, true);
m_vfxInstance.transform.localPosition = m_vfxPosition.Value;
m_vfxInstance.SetActive(true);
VFXSystem component = m_vfxInstance.GetComponent<VFXSystem>();
if (!Object.op_Implicit((Object)(object)component))
{
Log.LogMessage((object)(text + " (no VFXSystem component)"));
return;
}
component.Play(val2, (Character)null);
}
else if (vfxSystem == null)
{
Log.LogMessage((object)(text + " (prefab not found)"));
return;
}
Notify(text);
Log.LogMessage((object)text);
}
private void Notify(string message)
{
Character val = LocalPlayer();
if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.CharacterUI))
{
val.CharacterUI.ShowInfoNotification(message);
}
}
private static Character LocalPlayer()
{
if (!Object.op_Implicit((Object)(object)CharacterManager.Instance))
{
return null;
}
foreach (Character value in CharacterManager.Instance.Characters.Values)
{
if (Object.op_Implicit((Object)(object)value) && value.IsLocalPlayer)
{
return value;
}
}
return null;
}
private void ClearBlast()
{
if (Object.op_Implicit((Object)(object)m_blasterObject))
{
Object.Destroy((Object)(object)m_blasterObject);
m_blasterObject = null;
m_blaster = null;
}
}
private unsafe void PlayBlast()
{
//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_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Expected O, but got Unknown
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: 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_0102: 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_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: 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_011a: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: 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_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_0142: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
//IL_0168: Unknown result type (might be due to invalid IL or missing references)
//IL_016f: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_017d: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_018f: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
if (m_blastList.Count == 0)
{
return;
}
ClearBlast();
BlastPrefabs val = m_blastList[m_blastIndex];
string text = "[" + (m_blastIndex + 1) + "/" + m_blastList.Count + "] " + ((object)(*(BlastPrefabs*)(&val))/*cast due to .constrained prefix*/).ToString() + BlastShape(val);
Character val2 = LocalPlayer();
if (Object.op_Implicit((Object)(object)val2))
{
m_blasterObject = new GameObject("AssetBrowserBlaster");
m_blasterObject.transform.SetParent(((Component)val2).transform, false);
m_blasterObject.transform.localPosition = Vector3.zero;
m_blaster = m_blasterObject.AddComponent<ShootBlast>();
((SL_Effect)new SL_ShootBlast
{
SyncType = (SyncTypes)2,
CastPosition = (CastPositionType)0,
LocalPositionAdd = m_blastPosition.Value,
NoAim = true,
TargetType = (TargetTypes)0,
TransformName = "BlasterTransform",
BaseBlast = val,
Radius = 3f,
RefreshTime = 0f,
BlastLifespan = m_projectileLifespan.Value,
InstantiatedAmount = 1,
Interruptible = false,
MaxHitTargetCount = 1,
AffectHitTargetCenter = false,
HitOnShoot = false,
IgnoreShooter = true,
IgnoreStop = false,
NoTargetForwardMultiplier = 1f,
ParentToShootTransform = false,
UseTargetCharacterPositionType = false,
DontPlayHitSound = false,
FXIsWorld = false,
PlaySounOnRefresh = false,
DelayFirstShoot = 0f,
PlayFXOnRefresh = false,
EffectBehaviour = (EditBehaviours)2,
BlastEffects = (SL_EffectTransform[])(object)new SL_EffectTransform[0]
}).ApplyToComponent<ShootBlast>(m_blaster);
try
{
((Shooter)m_blaster).Setup((Factions[])(object)new Factions[1], m_blasterObject.transform);
((Effect)m_blaster).Affect(val2);
}
catch (Exception ex)
{
text += ((ex is NullReferenceException) ? " (cannot preview: needs an owning character)" : (" (cannot preview: " + ex.GetType().Name + ")"));
}
Notify(text);
Log.LogMessage((object)text);
}
}
private void ClearProjectile()
{
if (Object.op_Implicit((Object)(object)m_projInstance))
{
Object.Destroy((Object)(object)m_projInstance);
m_projInstance = null;
}
if (Object.op_Implicit((Object)(object)m_shooterObject))
{
Object.Destroy((Object)(object)m_shooterObject);
m_shooterObject = null;
m_shooter = null;
}
}
private unsafe void PlayProjectile()
{
//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_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Expected O, but got Unknown
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: 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_00e6: 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_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: 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_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: 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_0146: 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_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_0189: Unknown result type (might be due to invalid IL or missing references)
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01b0: 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_01c6: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0203: Unknown result type (might be due to invalid IL or missing references)
//IL_0204: Unknown result type (might be due to invalid IL or missing references)
//IL_0209: Unknown result type (might be due to invalid IL or missing references)
//IL_020e: Unknown result type (might be due to invalid IL or missing references)
//IL_0219: 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_022f: Unknown result type (might be due to invalid IL or missing references)
//IL_0231: Unknown result type (might be due to invalid IL or missing references)
//IL_0236: Unknown result type (might be due to invalid IL or missing references)
if (m_projList.Count == 0)
{
return;
}
ClearProjectile();
ProjectilePrefabs baseProjectile = m_projList[m_projIndex];
string text = "[" + (m_projIndex + 1) + "/" + m_projList.Count + "] " + ((object)(*(ProjectilePrefabs*)(&baseProjectile))/*cast due to .constrained prefix*/).ToString();
Character val = LocalPlayer();
if (Object.op_Implicit((Object)(object)val))
{
m_shooterObject = new GameObject("AssetBrowserShooter");
m_shooterObject.transform.SetParent(((Component)val).transform, false);
m_shooter = m_shooterObject.AddComponent<ShootProjectile>();
m_shooterObject.transform.localPosition = Vector3.zero;
((SL_Effect)new SL_ShootProjectile
{
SyncType = (SyncTypes)2,
CastPosition = (CastPositionType)0,
LocalPositionAdd = m_projPosition.Value,
NoAim = false,
TargetType = (TargetTypes)0,
TransformName = "ShooterTransform",
BaseProjectile = baseProjectile,
InstantiatedAmount = 1,
Lifespan = m_projectileLifespan.Value,
LateShootTime = 0.1f,
Unblockable = false,
EffectsOnlyIfHitCharacter = false,
EndMode = (EndLifeMode)0,
DisableOnHit = true,
IgnoreShooterCollision = true,
TargetingMode = (TargetMode)0,
TargetCountPerProjectile = 1,
TargetRange = 0f,
AutoTarget = false,
AutoTargetMaxAngle = 360f,
AutoTargetRange = 5f,
ProjectileForce = m_projectileForce.Value,
DefenseLength = 3f,
DefenseRange = 3f,
TrailEnabled = false,
TrailTime = 0.075f,
LightIntensityFade = new Vector2(10f, 2f),
PointOffset = Vector3.zero,
AddDirection = Vector3.zero,
AddRotationForce = Vector3.zero,
YMagnitudeAffect = 0f,
YMagnitudeForce = 0f,
CameraAddYDirection = 0f,
EffectBehaviour = (EditBehaviours)2,
ProjectileEffects = (SL_EffectTransform[])(object)new SL_EffectTransform[0]
}).ApplyToComponent<ShootProjectile>(m_shooter);
((Shooter)m_shooter).Setup((Factions[])(object)new Factions[1], m_shooterObject.transform);
Projectile_Shoot_KeepAlive.PreviewShotPending = true;
try
{
((Effect)m_shooter).Affect(val);
}
finally
{
Projectile_Shoot_KeepAlive.PreviewShotPending = false;
}
if (Object.op_Implicit((Object)(object)m_shooter.BaseProjectile))
{
m_projInstance = ((Component)m_shooter.BaseProjectile).gameObject;
}
Notify(text);
Log.LogMessage((object)text);
}
}
static AssetBrowserPlugin()
{
SpellCastType[] array = new SpellCastType[6];
RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
HarmfulAnimations = (SpellCastType[])(object)array;
}
}
internal sealed class ConfigurationManagerAttributes
{
public int? Order;
}
[HarmonyPatch(typeof(Projectile), "Shoot")]
public class Projectile_Shoot_KeepAlive
{
internal static bool PreviewShotPending;
private static readonly FieldRef<Projectile, bool> FirstUpdate = AccessTools.FieldRefAccess<Projectile, bool>("m_firstUpdate");
[HarmonyPostfix]
public static void Postfix(Projectile __instance)
{
if (PreviewShotPending && Object.op_Implicit((Object)(object)__instance))
{
FirstUpdate.Invoke(__instance) = false;
if (!((Component)__instance).gameObject.activeSelf)
{
((Component)__instance).gameObject.SetActive(true);
}
}
}
}
}