using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("V3_TEXTURE")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("V3_TEXTURE")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d9c61d32-4871-4a87-927d-6aea07791200")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Player_V3;
[BepInPlugin("com.lazurut.ultrakill.player_v3", "PLAYER V3", "10.0.4")]
public class Plugin : BaseUnityPlugin
{
[CompilerGenerated]
private sealed class <BundleIntroSequence>d__20 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public Plugin <>4__this;
private string <bundlePath>5__1;
private AssetBundleCreateRequest <req>5__2;
private string[] <scenePaths>5__3;
private string <scenePath>5__4;
private AsyncOperation <sceneOp>5__5;
private string[] <>s__6;
private int <>s__7;
private string <sp>5__8;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <BundleIntroSequence>d__20(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<bundlePath>5__1 = null;
<req>5__2 = null;
<scenePaths>5__3 = null;
<scenePath>5__4 = null;
<sceneOp>5__5 = null;
<>s__6 = null;
<sp>5__8 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_034b: Unknown result type (might be due to invalid IL or missing references)
//IL_0355: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<bundlePath>5__1 = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)<>4__this).Info.Location), "Lazurut-PLAYER_V3", "v3_bundle_scene");
if (!File.Exists(<bundlePath>5__1))
{
Log.LogError((object)("[Player_V3] Bundle not found: " + <bundlePath>5__1));
Log.LogWarning((object)"[Player_V3] Skipping intro → target scene.");
<>2__current = LoadSceneAsync("b3e7f2f8052488a45b35549efb98d902");
<>1__state = 1;
return true;
}
Log.LogInfo((object)("[Player_V3] Loading bundle: " + <bundlePath>5__1));
<req>5__2 = AssetBundle.LoadFromFileAsync(<bundlePath>5__1);
<>2__current = <req>5__2;
<>1__state = 2;
return true;
case 1:
<>1__state = -1;
return false;
case 2:
<>1__state = -1;
_introBundle = <req>5__2.assetBundle;
if ((Object)(object)_introBundle == (Object)null)
{
Log.LogError((object)"[Player_V3] Bundle load failed.");
<>2__current = LoadSceneAsync("b3e7f2f8052488a45b35549efb98d902");
<>1__state = 3;
return true;
}
<scenePaths>5__3 = _introBundle.GetAllScenePaths();
if (<scenePaths>5__3 == null || <scenePaths>5__3.Length == 0)
{
Log.LogError((object)"[Player_V3] Bundle has no scenes.");
_introBundle.Unload(false);
_introBundle = null;
<>2__current = LoadSceneAsync("b3e7f2f8052488a45b35549efb98d902");
<>1__state = 4;
return true;
}
<scenePath>5__4 = <scenePaths>5__3[0];
<>s__6 = <scenePaths>5__3;
for (<>s__7 = 0; <>s__7 < <>s__6.Length; <>s__7++)
{
<sp>5__8 = <>s__6[<>s__7];
if (Path.GetFileNameWithoutExtension(<sp>5__8).Equals("v3_bundle_scene", StringComparison.OrdinalIgnoreCase))
{
<scenePath>5__4 = <sp>5__8;
break;
}
<sp>5__8 = null;
}
<>s__6 = null;
Log.LogInfo((object)("[Player_V3] Loading intro scene: " + <scenePath>5__4));
<sceneOp>5__5 = SceneManager.LoadSceneAsync(<scenePath>5__4, (LoadSceneMode)0);
if (<sceneOp>5__5 == null)
{
Log.LogError((object)"[Player_V3] LoadSceneAsync returned null.");
_introBundle.Unload(false);
_introBundle = null;
<>2__current = LoadSceneAsync("b3e7f2f8052488a45b35549efb98d902");
<>1__state = 5;
return true;
}
<>2__current = <sceneOp>5__5;
<>1__state = 6;
return true;
case 3:
<>1__state = -1;
return false;
case 4:
<>1__state = -1;
return false;
case 5:
<>1__state = -1;
return false;
case 6:
<>1__state = -1;
Log.LogInfo((object)$"[Player_V3] Intro running — {7f}s...");
<>2__current = (object)new WaitForSeconds(7f);
<>1__state = 7;
return true;
case 7:
<>1__state = -1;
Log.LogInfo((object)"[Player_V3] Intro done → target scene.");
_introBundle.Unload(false);
_introBundle = null;
<>2__current = LoadSceneAsync("b3e7f2f8052488a45b35549efb98d902");
<>1__state = 8;
return true;
case 8:
<>1__state = -1;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <LoadSceneAsync>d__21 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public string sceneName;
private AsyncOperation <op>5__1;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <LoadSceneAsync>d__21(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<op>5__1 = null;
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<op>5__1 = SceneManager.LoadSceneAsync(sceneName, (LoadSceneMode)0);
if (<op>5__1 == null)
{
Log.LogError((object)("[Player_V3] Cannot load '" + sceneName + "'. Add it to Build Settings."));
return false;
}
<>2__current = <op>5__1;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
Log.LogInfo((object)("[Player_V3] '" + sceneName + "' loaded."));
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <RepeatReplaceForTargetScene>d__42 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public Plugin <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <RepeatReplaceForTargetScene>d__42(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Expected O, but got Unknown
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Expected O, but got Unknown
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(0.5f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
SetupPlayer();
ReplaceSceneWide();
ReplaceCanvasUI();
ReplaceRightArmTexture();
ReplaceUIText();
AddFireSimpleToArmRed();
<>2__current = (object)new WaitForSeconds(0.5f);
<>1__state = 2;
return true;
case 2:
<>1__state = -1;
SetupPlayer();
ReplaceSceneWide();
ReplaceCanvasUI();
ReplaceRightArmTexture();
ReplaceUIText();
AddFireSimpleToArmRed();
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 3;
return true;
case 3:
<>1__state = -1;
SetupPlayer();
ReplaceSceneWide();
ReplaceCanvasUI();
ReplaceRightArmTexture();
ReplaceUIText();
AddFireSimpleToArmRed();
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <RepeatReplaceV2ToV1>d__43 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public Plugin <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <RepeatReplaceV2ToV1>d__43(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Expected O, but got Unknown
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Expected O, but got Unknown
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(0.5f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
ReplaceV2ToV1SceneWide();
ReplaceRightArmTexture();
ReplaceUIText();
AddFireSimpleToArmRed();
<>2__current = (object)new WaitForSeconds(0.5f);
<>1__state = 2;
return true;
case 2:
<>1__state = -1;
ReplaceV2ToV1SceneWide();
ReplaceRightArmTexture();
ReplaceUIText();
AddFireSimpleToArmRed();
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 3;
return true;
case 3:
<>1__state = -1;
ReplaceV2ToV1SceneWide();
ReplaceRightArmTexture();
ReplaceUIText();
AddFireSimpleToArmRed();
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <ReplaceAfterFrame>d__22 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public string sceneName;
public Plugin <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ReplaceAfterFrame>d__22(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<>2__current = null;
<>1__state = 2;
return true;
case 2:
<>1__state = -1;
SetupPlayer();
ReplaceOnV1Model();
HandleV1Combined();
ReplaceSceneWide();
ReplaceRightArmTexture();
ReplaceUIText();
DuplicateCoins();
AddFireSimpleToArmRed();
if (sceneName == "36abcaae9708abc4d9e89e6ec73a2846")
{
Log.LogInfo((object)"[Player_V3] V2→V1 scene.");
ReplaceV2ToV1SceneWide();
((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.RepeatReplaceV2ToV1());
}
if (sceneName == "b3e7f2f8052488a45b35549efb98d902")
{
Log.LogInfo((object)"[Player_V3] Target scene.");
ReplaceCanvasUI();
((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.RepeatReplaceForTargetScene());
}
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
internal static ManualLogSource Log;
internal static string TextureFolderPath;
internal static string VideoFolderPath;
private const string BUNDLE_FOLDER = "Lazurut-PLAYER_V3";
private const string BUNDLE_FILE = "v3_bundle_scene";
private const string BUNDLE_SCENE = "v3_bundle_scene";
private const float INTRO_DURATION = 7f;
private static AssetBundle _introBundle;
private const string TARGET_SCENE = "b3e7f2f8052488a45b35549efb98d902";
private const string V2_TO_V1_SCENE = "36abcaae9708abc4d9e89e6ec73a2846";
private const string SPLASH_SCENE = "241a6a8caec7a13438a5ee786040de32";
private const string REPLACEMENT_VIDEO = "0001-0250.webm";
internal static readonly Dictionary<string, string> V1ModelTextureMap = new Dictionary<string, string>
{
{ "v1colour_tex", "v3colour_tex" },
{ "v1_wingcolour_tex", "v3_wingcolour_tex" }
};
internal static readonly Dictionary<string, string> SceneTextureMap = new Dictionary<string, string>
{
{ "v2_armtex", "v3_armtex" },
{ "T_Feedbacker", "T_FireArm" },
{ "T_GreenArm", "T_PurpleArm" },
{ "TextmodeV1", "TextmodeV3" },
{ "TextmodeV1Arm1", "TextmodeV3Arm1" },
{ "TextmodeV1Arm2", "TextmodeV3Arm2" },
{ "TextmodeV1Wings", "TextmodeV3Wings" },
{ "TextmodeCircuit", "V3TextmodeCircuit" },
{ "TextmodeLogo", "TextmodeLogoV3" }
};
internal static readonly Dictionary<string, string> TextmodeUIMap = new Dictionary<string, string>
{
{ "TextmodeV1", "TextmodeV3" },
{ "TextmodeV1Arm1", "TextmodeV3Arm1" },
{ "TextmodeV1Arm2", "TextmodeV3Arm2" },
{ "TextmodeV1Wings", "TextmodeV3Wings" },
{ "TextmodeCircuit", "V3TextmodeCircuit" },
{ "TextmodeLogo", "TextmodeLogoV3" }
};
internal static readonly Dictionary<string, string> V2ToV1TextureMap = new Dictionary<string, string>
{
{ "v2colour_tex", "v1colour_tex" },
{ "v2_wingcolour_tex", "v1_wingcolour_tex" },
{ "v2_wingcolour_tex 3", "v1_wingcolour_tex" },
{ "v2_wingcolour_tex 2", "v1_wingcolour_tex" },
{ "v2_wingcolour_tex 1", "v1_wingcolour_tex" }
};
internal static readonly Dictionary<string, Texture2D> LoadedTextures = new Dictionary<string, Texture2D>();
private static readonly (string from, string to)[] UITextReplacements = new(string, string)[7]
{
("Find\u00a0a weapon", "liquidation V1"),
("Find a weapon", "liquidation V1"),
("Findа weapon", "liquidation V1"),
("Hell is Full", "THIS SCUM WILL BE DESTROYED"),
("(2112.08.06)", "(2112.09.13)"),
("V1", "V3"),
("v1", "v3")
};
private void Awake()
{
Log = ((BaseUnityPlugin)this).Logger;
VideoFolderPath = (TextureFolderPath = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location));
Log.LogInfo((object)("[Player_V3] Texture folder: " + TextureFolderPath));
if (!Directory.Exists(TextureFolderPath))
{
Log.LogError((object)("[Player_V3] Folder not found: " + TextureFolderPath));
return;
}
PreloadTextures(V1ModelTextureMap);
PreloadTextures(SceneTextureMap);
PreloadTextures(TextmodeUIMap);
PreloadTextures(V2ToV1TextureMap);
SceneManager.sceneLoaded += OnSceneLoaded;
Log.LogInfo((object)"[Player_V3] Mod loaded! X=light | R=black hole | Wall=remap A/D→W/S");
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
Log.LogInfo((object)("[Player_V3] Scene: " + ((Scene)(ref scene)).name));
if (IsIntroScene(scene))
{
Log.LogInfo((object)"[Player_V3] Bundle intro scene — skipping patch.");
}
else if (((Scene)(ref scene)).name == "241a6a8caec7a13438a5ee786040de32")
{
Log.LogInfo((object)"[Player_V3] Splash intercepted — starting bundle intro.");
((MonoBehaviour)this).StartCoroutine(BundleIntroSequence());
}
else
{
((MonoBehaviour)this).StartCoroutine(ReplaceAfterFrame(((Scene)(ref scene)).name));
}
}
private static bool IsIntroScene(Scene scene)
{
return ((Scene)(ref scene)).name == "v3_bundle_scene" || Path.GetFileNameWithoutExtension(((Scene)(ref scene)).path).Equals("v3_bundle_scene", StringComparison.OrdinalIgnoreCase);
}
[IteratorStateMachine(typeof(<BundleIntroSequence>d__20))]
private IEnumerator BundleIntroSequence()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <BundleIntroSequence>d__20(0)
{
<>4__this = this
};
}
[IteratorStateMachine(typeof(<LoadSceneAsync>d__21))]
private static IEnumerator LoadSceneAsync(string sceneName)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <LoadSceneAsync>d__21(0)
{
sceneName = sceneName
};
}
[IteratorStateMachine(typeof(<ReplaceAfterFrame>d__22))]
private IEnumerator ReplaceAfterFrame(string sceneName)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ReplaceAfterFrame>d__22(0)
{
<>4__this = this,
sceneName = sceneName
};
}
public static void SetupPlayer()
{
//IL_0043: 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_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: 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_0185: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
GameObject val = GameObject.FindWithTag("Player") ?? FindObject("Player");
if ((Object)(object)val == (Object)null)
{
Log.LogWarning((object)"[Player_V3] Player not found.");
return;
}
Transform transform = val.transform;
if (Mathf.Abs(transform.localScale.x - 1.5f) > 0.01f)
{
transform.localScale *= 1.5f;
}
if ((Object)(object)val.GetComponent<V3LightController>() == (Object)null)
{
val.AddComponent<V3LightController>();
}
if ((Object)(object)val.GetComponent<V3BlackHoleSpawner>() == (Object)null)
{
val.AddComponent<V3BlackHoleSpawner>();
}
if ((Object)(object)val.GetComponent<V3WallMovement>() == (Object)null)
{
val.AddComponent<V3WallMovement>();
}
Transform[] componentsInChildren = val.GetComponentsInChildren<Transform>(true);
foreach (Transform val2 in componentsInChildren)
{
if (!(((Object)val2).name != "v1_mdl"))
{
if (Mathf.Abs(val2.localScale.x - 1.5f) > 0.01f)
{
val2.localScale *= 1.5f;
}
ApplyToGameObject(((Component)val2).gameObject, V1ModelTextureMap);
break;
}
}
Transform[] componentsInChildren2 = val.GetComponentsInChildren<Transform>(true);
foreach (Transform val3 in componentsInChildren2)
{
if (!(((Object)val3).name != "v1_combined"))
{
if (Mathf.Abs(val3.localScale.x - 1.3f) > 0.01f)
{
val3.localScale *= 1.3f;
}
ApplyToGameObject(((Component)val3).gameObject, SceneTextureMap);
break;
}
}
}
public static void AddFireSimpleToArmRed()
{
//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)
GameObject val = GameObject.Find("Arm Red(Clone)");
if ((Object)(object)val == (Object)null)
{
Scene activeScene = SceneManager.GetActiveScene();
GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects();
foreach (GameObject val2 in rootGameObjects)
{
val = FindInChildrenByName(val2.transform, "Arm Red(Clone)");
if ((Object)(object)val != (Object)null)
{
break;
}
}
}
if ((Object)(object)val == (Object)null)
{
return;
}
Type type = null;
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
foreach (Assembly assembly in assemblies)
{
type = assembly.GetType("FireSimple");
if (type != null)
{
break;
}
Type[] types = assembly.GetTypes();
foreach (Type type2 in types)
{
if (type2.Name == "FireSimple")
{
type = type2;
break;
}
}
if (type != null)
{
break;
}
}
if (type == null)
{
Log.LogWarning((object)"[Player_V3] Type 'FireSimple' not found.");
}
else if ((Object)(object)val.GetComponent(type) == (Object)null)
{
val.AddComponent(type);
Log.LogInfo((object)"[Player_V3] FireSimple added to 'Arm Red(Clone)'.");
}
}
private static GameObject FindInChildrenByName(Transform parent, string n)
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Expected O, but got Unknown
if (((Object)parent).name == n)
{
return ((Component)parent).gameObject;
}
foreach (Transform item in parent)
{
Transform parent2 = item;
GameObject val = FindInChildrenByName(parent2, n);
if ((Object)(object)val != (Object)null)
{
return val;
}
}
return null;
}
public static void DuplicateCoins()
{
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: 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_00f0: Unknown result type (might be due to invalid IL or missing references)
List<GameObject> list = new List<GameObject>();
GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>();
foreach (GameObject val in array)
{
if (((Object)val).name == "Coin(Clone)")
{
Scene scene = val.scene;
if (((Scene)(ref scene)).IsValid())
{
list.Add(val);
}
}
}
if (list.Count == 0)
{
Log.LogWarning((object)"[Player_V3] No Coins found.");
return;
}
int num = 0;
Vector3 val2 = default(Vector3);
foreach (GameObject item in list)
{
for (int j = 0; j < 5; j++)
{
float num2 = (float)j * 72f * ((float)Math.PI / 180f);
((Vector3)(ref val2))..ctor(Mathf.Cos(num2) * 1.5f, 0f, Mathf.Sin(num2) * 1.5f);
GameObject val3 = Object.Instantiate<GameObject>(item, item.transform.position + val2, item.transform.rotation, item.transform.parent);
((Object)val3).name = "Coin";
val3.SetActive(true);
num++;
}
}
Log.LogInfo((object)$"[Player_V3] Coins: {list.Count} → +{num}.");
}
public static void ReplaceV2ToV1SceneWide()
{
int num = 0;
Renderer[] array = Object.FindObjectsOfType<Renderer>(true);
foreach (Renderer val in array)
{
Material[] sharedMaterials = val.sharedMaterials;
bool flag = false;
for (int j = 0; j < sharedMaterials.Length; j++)
{
if (ApplyToMaterial(sharedMaterials[j], V2ToV1TextureMap))
{
num++;
flag = true;
}
}
if (flag)
{
val.sharedMaterials = sharedMaterials;
}
}
Log.LogInfo((object)$"[Player_V3] V2→V1: {num}");
}
public static void ReplaceRightArmTexture()
{
if (!LoadedTextures.TryGetValue("T_Feedbacker", out var value))
{
Log.LogWarning((object)"[Player_V3] T_FireArm not cached.");
return;
}
GameObject val = FindObject("RightArm");
if ((Object)(object)val == (Object)null)
{
return;
}
int num = 0;
Renderer[] componentsInChildren = val.GetComponentsInChildren<Renderer>(true);
foreach (Renderer val2 in componentsInChildren)
{
Material[] sharedMaterials = val2.sharedMaterials;
bool flag = false;
for (int j = 0; j < sharedMaterials.Length; j++)
{
if ((Object)(object)sharedMaterials[j] == (Object)null)
{
continue;
}
string[] texturePropertyNames = sharedMaterials[j].GetTexturePropertyNames();
foreach (string text in texturePropertyNames)
{
if (!((Object)(object)sharedMaterials[j].GetTexture(text) == (Object)null))
{
sharedMaterials[j].SetTexture(text, (Texture)(object)value);
flag = true;
num++;
}
}
}
if (flag)
{
val2.sharedMaterials = sharedMaterials;
}
}
Log.LogInfo((object)$"[Player_V3] RightArm: {num}");
}
public static void ReplaceUIText()
{
int num = 0;
Text[] array = Object.FindObjectsOfType<Text>(true);
foreach (Text val in array)
{
string text = ApplyTextReplacements(val.text);
if (text != val.text)
{
val.text = text;
num++;
}
}
TMP_Text[] array2 = Object.FindObjectsOfType<TMP_Text>(true);
foreach (TMP_Text val2 in array2)
{
string text2 = ApplyTextReplacements(val2.text);
if (text2 != val2.text)
{
val2.text = text2;
num++;
}
}
Log.LogInfo((object)$"[Player_V3] UI texts: {num}");
}
private static string ApplyTextReplacements(string text)
{
if (string.IsNullOrEmpty(text))
{
return text;
}
(string, string)[] uITextReplacements = UITextReplacements;
for (int i = 0; i < uITextReplacements.Length; i++)
{
(string, string) tuple = uITextReplacements[i];
string item = tuple.Item1;
string item2 = tuple.Item2;
text = text.Replace(item, item2);
}
return text;
}
public static void ReplaceCanvasUI()
{
//IL_0118: 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)
int num = 0;
RawImage[] array = Object.FindObjectsOfType<RawImage>(true);
foreach (RawImage val in array)
{
if (!((Object)(object)val.texture == (Object)null) && TextmodeUIMap.ContainsKey(((Object)val.texture).name) && LoadedTextures.TryGetValue(((Object)val.texture).name, out var value))
{
val.texture = (Texture)(object)value;
num++;
}
}
Image[] array2 = Object.FindObjectsOfType<Image>(true);
foreach (Image val2 in array2)
{
Sprite sprite = val2.sprite;
if (!((Object)(object)((sprite != null) ? sprite.texture : null) == (Object)null) && TextmodeUIMap.ContainsKey(((Object)val2.sprite.texture).name) && LoadedTextures.TryGetValue(((Object)val2.sprite.texture).name, out var value2))
{
val2.sprite = Sprite.Create(value2, new Rect(0f, 0f, (float)((Texture)value2).width, (float)((Texture)value2).height), new Vector2(0.5f, 0.5f));
num++;
}
}
Log.LogInfo((object)$"[Player_V3] Canvas UI: {num}");
}
public static void ReplaceOnV1Model()
{
GameObject val = FindObject("v1_mdl");
if ((Object)(object)val == (Object)null)
{
Log.LogWarning((object)"[Player_V3] v1_mdl not found.");
}
else
{
ApplyToGameObject(val, V1ModelTextureMap);
}
}
public static void HandleV1Combined()
{
GameObject val = FindObject("v1_combined");
if ((Object)(object)val == (Object)null)
{
Log.LogWarning((object)"[Player_V3] v1_combined not found.");
}
else
{
ApplyToGameObject(val, SceneTextureMap);
}
}
public static void ReplaceSceneWide()
{
int num = 0;
Renderer[] array = Object.FindObjectsOfType<Renderer>(true);
foreach (Renderer val in array)
{
Material[] sharedMaterials = val.sharedMaterials;
bool flag = false;
for (int j = 0; j < sharedMaterials.Length; j++)
{
if (ApplyToMaterial(sharedMaterials[j], SceneTextureMap))
{
num++;
flag = true;
}
}
if (flag)
{
val.sharedMaterials = sharedMaterials;
}
}
Log.LogInfo((object)$"[Player_V3] Scene-wide: {num}");
}
public static void ApplyToGameObject(GameObject go, Dictionary<string, string> map)
{
int num = 0;
Renderer[] componentsInChildren = go.GetComponentsInChildren<Renderer>(true);
foreach (Renderer val in componentsInChildren)
{
Material[] sharedMaterials = val.sharedMaterials;
bool flag = false;
for (int j = 0; j < sharedMaterials.Length; j++)
{
if (ApplyToMaterial(sharedMaterials[j], map))
{
num++;
flag = true;
}
}
if (flag)
{
val.sharedMaterials = sharedMaterials;
}
}
Log.LogInfo((object)$"[Player_V3] [{((Object)go).name}]: {num}");
}
public static bool ApplyToMaterial(Material mat, Dictionary<string, string> map)
{
if ((Object)(object)mat == (Object)null)
{
return false;
}
bool result = false;
string[] texturePropertyNames = mat.GetTexturePropertyNames();
foreach (string text in texturePropertyNames)
{
Texture texture = mat.GetTexture(text);
if (!((Object)(object)texture == (Object)null) && map.ContainsKey(((Object)texture).name) && LoadedTextures.TryGetValue(((Object)texture).name, out var value))
{
mat.SetTexture(text, (Texture)(object)value);
result = true;
}
}
return result;
}
public static GameObject FindObject(string targetName)
{
//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)
GameObject val = GameObject.Find(targetName);
if ((Object)(object)val != (Object)null)
{
return val;
}
Scene activeScene = SceneManager.GetActiveScene();
GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects();
foreach (GameObject val2 in rootGameObjects)
{
GameObject val3 = FindInChildren(val2.transform, targetName);
if ((Object)(object)val3 != (Object)null)
{
return val3;
}
}
return null;
}
private static GameObject FindInChildren(Transform parent, string n)
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Expected O, but got Unknown
if (((Object)parent).name == n)
{
return ((Component)parent).gameObject;
}
foreach (Transform item in parent)
{
Transform parent2 = item;
GameObject val = FindInChildren(parent2, n);
if ((Object)(object)val != (Object)null)
{
return val;
}
}
return null;
}
private static void PreloadTextures(Dictionary<string, string> map)
{
string[] array = new string[3] { ".png", ".jpg", ".jpeg" };
foreach (KeyValuePair<string, string> item in map)
{
if (LoadedTextures.ContainsKey(item.Key))
{
continue;
}
bool flag = false;
string[] array2 = array;
foreach (string text in array2)
{
string path = Path.Combine(TextureFolderPath, item.Value + text);
if (File.Exists(path))
{
Texture2D val = LoadPNG(path);
if ((Object)(object)val != (Object)null)
{
((Object)val).name = item.Value;
LoadedTextures[item.Key] = val;
Log.LogInfo((object)("[Player_V3] OK " + item.Key + " → " + item.Value + text));
flag = true;
}
break;
}
}
if (!flag)
{
Log.LogWarning((object)("[Player_V3] MISS " + item.Value));
}
}
}
public static Texture2D LoadPNG(string path)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
byte[] array = File.ReadAllBytes(path);
Texture2D val = new Texture2D(2, 2, (TextureFormat)4, true);
if (ImageConversion.LoadImage(val, array))
{
val.Apply(true, false);
return val;
}
Log.LogError((object)("[Player_V3] Decode failed: " + path));
return null;
}
[IteratorStateMachine(typeof(<RepeatReplaceForTargetScene>d__42))]
private IEnumerator RepeatReplaceForTargetScene()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <RepeatReplaceForTargetScene>d__42(0)
{
<>4__this = this
};
}
[IteratorStateMachine(typeof(<RepeatReplaceV2ToV1>d__43))]
private IEnumerator RepeatReplaceV2ToV1()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <RepeatReplaceV2ToV1>d__43(0)
{
<>4__this = this
};
}
}
[RequireComponent(typeof(Collider))]
public class V3WallMovement : MonoBehaviour
{
private const float SPEED = 8f;
private int _wallContacts = 0;
private CharacterController _cc;
private Rigidbody _rb;
private bool OnWall => _wallContacts > 0;
private void Awake()
{
_cc = ((Component)this).GetComponent<CharacterController>();
_rb = ((Component)this).GetComponent<Rigidbody>();
}
private void OnCollisionEnter(Collision col)
{
if (col.gameObject.CompareTag("Wall"))
{
_wallContacts++;
Plugin.Log.LogInfo((object)$"[V3WallMovement] Wall contact enter. Total: {_wallContacts}");
}
}
private void OnCollisionExit(Collision col)
{
if (col.gameObject.CompareTag("Wall"))
{
_wallContacts = Mathf.Max(0, _wallContacts - 1);
Plugin.Log.LogInfo((object)$"[V3WallMovement] Wall contact exit. Total: {_wallContacts}");
}
}
private void Update()
{
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: 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_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
if (!OnWall)
{
return;
}
bool key = Input.GetKey((KeyCode)97);
bool key2 = Input.GetKey((KeyCode)100);
if (!key && !key2)
{
return;
}
float num = (key ? 1f : (-1f));
Vector3 forward = ((Component)this).transform.forward;
forward.y = 0f;
if (!(((Vector3)(ref forward)).sqrMagnitude < 0.001f))
{
((Vector3)(ref forward)).Normalize();
Vector3 val = forward * (num * 8f * Time.deltaTime);
if ((Object)(object)_cc != (Object)null && ((Collider)_cc).enabled)
{
_cc.Move(val);
return;
}
if ((Object)(object)_rb != (Object)null && !_rb.isKinematic)
{
_rb.velocity = new Vector3(val.x / Time.deltaTime, _rb.velocity.y, val.z / Time.deltaTime);
return;
}
Transform transform = ((Component)this).transform;
transform.position += val;
}
}
}
public class V3LightController : MonoBehaviour
{
private Light _pointLight;
private void Update()
{
if (Input.GetKeyDown((KeyCode)120))
{
if ((Object)(object)_pointLight == (Object)null)
{
CreateLight();
}
else
{
ToggleLight();
}
}
}
private void CreateLight()
{
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Expected O, but got Unknown
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
Transform val = null;
Transform[] componentsInChildren = ((Component)this).GetComponentsInChildren<Transform>(true);
foreach (Transform val2 in componentsInChildren)
{
if (((Object)val2).name == "v1_mdl")
{
val = val2;
break;
}
}
Transform val3 = (((Object)(object)val != (Object)null) ? val : ((Component)this).transform);
GameObject val4 = new GameObject("Player_V3_PointLight");
val4.transform.SetParent(val3, false);
val4.transform.localPosition = Vector3.zero;
_pointLight = val4.AddComponent<Light>();
_pointLight.type = (LightType)2;
_pointLight.color = Color.green;
_pointLight.range = 200f;
_pointLight.renderMode = (LightRenderMode)1;
((Behaviour)_pointLight).enabled = true;
Plugin.Log.LogInfo((object)("[Player_V3] Light on '" + ((Object)val3).name + "'."));
}
private void ToggleLight()
{
((Behaviour)_pointLight).enabled = !((Behaviour)_pointLight).enabled;
Plugin.Log.LogInfo((object)("[Player_V3] Light: " + (((Behaviour)_pointLight).enabled ? "ON" : "OFF")));
}
}
public class V3BlackHoleSpawner : MonoBehaviour
{
private static readonly string[] Candidates = new string[1] { "Black Hole Projectile" };
private static readonly string[] Prefixes = new string[4] { "", "Prefabs/", "Projectiles/", "Prefabs/Projectiles/" };
private static GameObject _prefab;
private const float COOLDOWN = 0.5f;
private const float SPEED = 30f;
private float _lastFire = -999f;
private void Update()
{
if (Input.GetKeyDown((KeyCode)114) && !(Time.time - _lastFire < 0.5f))
{
_lastFire = Time.time;
TrySpawn();
}
}
private void TrySpawn()
{
//IL_0089: 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_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: 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_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
if (!HookArmPresent())
{
Plugin.Log.LogWarning((object)"[V3BlackHole] Hook Arm missing — blocked.");
return;
}
if ((Object)(object)_prefab == (Object)null)
{
_prefab = FindPrefab();
}
if ((Object)(object)_prefab == (Object)null)
{
Plugin.Log.LogWarning((object)"[V3BlackHole] Prefab not found.");
return;
}
Camera main = Camera.main;
Vector3 val = (((Object)(object)main != (Object)null) ? ((Component)main).transform.forward : ((Component)this).transform.forward);
Vector3 val2 = (((Object)(object)main != (Object)null) ? (((Component)main).transform.position + val * 2f) : (((Component)this).transform.position + val * 2f));
GameObject val3 = Object.Instantiate<GameObject>(_prefab, val2, Quaternion.LookRotation(val));
Rigidbody component = val3.GetComponent<Rigidbody>();
if ((Object)(object)component != (Object)null && !component.isKinematic)
{
component.velocity = val * 30f;
}
MonoBehaviour[] components = val3.GetComponents<MonoBehaviour>();
foreach (MonoBehaviour val4 in components)
{
if (!((Object)(object)val4 == (Object)null))
{
FieldInfo field = ((object)val4).GetType().GetField("owner", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (!(field == null))
{
field.SetValue(val4, 1);
break;
}
}
}
Plugin.Log.LogInfo((object)$"[V3BlackHole] Spawned at {val2}");
}
private static bool HookArmPresent()
{
//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)
if ((Object)(object)GameObject.Find("Hook Arm") != (Object)null)
{
return true;
}
GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>();
foreach (GameObject val in array)
{
if (((Object)val).name == "Hook Arm")
{
Scene scene = val.scene;
if (((Scene)(ref scene)).IsValid())
{
return true;
}
}
}
return false;
}
private static GameObject FindPrefab()
{
string[] prefixes = Prefixes;
foreach (string text in prefixes)
{
string[] candidates = Candidates;
foreach (string text2 in candidates)
{
GameObject val = Resources.Load<GameObject>(text + text2);
if ((Object)(object)val != (Object)null)
{
return val;
}
}
}
string[] candidates2 = Candidates;
foreach (string text3 in candidates2)
{
GameObject val2 = GameObject.Find(text3);
if (!((Object)(object)val2 == (Object)null))
{
GameObject val3 = Object.Instantiate<GameObject>(val2);
((Object)val3).name = text3;
val3.SetActive(false);
Object.DontDestroyOnLoad((Object)(object)val3);
return val3;
}
}
GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>();
foreach (GameObject val4 in array)
{
string[] candidates3 = Candidates;
foreach (string b in candidates3)
{
if (string.Equals(((Object)val4).name, b, StringComparison.OrdinalIgnoreCase))
{
return val4;
}
}
}
return null;
}
}
internal static class PluginInfo
{
internal const string PLUGIN_GUID = "com.lazurut.ultrakill.player_v3";
internal const string PLUGIN_NAME = "PLAYER V3";
internal const string PLUGIN_VERSION = "10.0.4";
}