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.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using NineSolsAPI; using RCGFSM.Projectiles; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; using _2_Art._2_Character.HoHoYee.DummyPlayer; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("2dFX")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CustomSols")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Example Mod")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+6bffb4c240d7c0d601a4c5eadd1387a0e41c9856")] [assembly: AssemblyProduct("CustomSols")] [assembly: AssemblyTitle("CustomSols")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace CustomSols { public class AssetLoader { private static string assetFolder; public static readonly Dictionary cachePlayerSprites = new Dictionary(); public static readonly Dictionary cacheMenuLogoSprites = new Dictionary(); public static readonly Dictionary cacheTalismanBallSprites = new Dictionary(); public static readonly Dictionary cacheParrySprites = new Dictionary(); public static readonly Dictionary cacheSwordSprites = new Dictionary(); public static readonly Dictionary cacheBowSprites = new Dictionary(); public static readonly Dictionary cacheFooSprites = new Dictionary(); public static readonly Dictionary cacheOnlyOneSprites = new Dictionary(); public static readonly Dictionary cacheUISprites = new Dictionary(); public static readonly Dictionary cacheYingZhaoSprites = new Dictionary(); public static readonly Dictionary cacheHitSparkSprites = new Dictionary(); public static readonly Dictionary cacheAtlasTextures = new Dictionary(); public static readonly Dictionary all = new Dictionary(); public static Color? normalHpColor = null; public static Color? internalHpColor = null; public static Color? expRingOuterColor = null; public static Color? expRingInnerColor = null; public static Color? RageBarColor = null; public static Color? RageBarFrameColor = null; public static Color? ArrowLineBColor = null; public static Color? ArrowGlowColor = null; public static Color? ChiBallLeftLineColor = null; public static Color? ButterflyRightLineColor = null; public static Color? CoreCColor = null; public static Color? CoreDColor = null; public static Color? UCCharging1Color = null; public static Color? UCCharging2Color = null; public static Color? UCSuccess1Color = null; public static Color? UCSuccess2Color = null; public static Color? AirParryColor = null; public static Color? UCParryColor = null; public static Color? DashColor = null; public static Color? PerfectParryColor = null; public static Color? ImperfectParryColor = null; public static Color? SwordCharingCirlceColor = null; public static Color? SwordCharingAbsorbColor = null; public static Color? SwordCharingGlowColor = null; public static Color? ParticlesFooColor = null; public static Color? FooLightColor = null; public static Color? DrawFooBallColor1 = null; public static Color? DrawFooBallColor2 = null; public static Color? DrawFooBallColor3 = null; public static Color? DrawFooBallColor4 = null; public static Color? DrawFooBallColor5 = null; public static Color? DrawFooLightColor = null; public static Color? DrawFooBottomLightColor = null; public static Color? HitSparkColor = null; public static Vector3? NormalArrowLv1Pos = null; public static Vector3? NormalArrowLv2Pos = null; public static Vector3? NormalArrowLv3Pos = null; private static Func Selector(Func f) { return f; } public static void Init() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_0146: 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_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: 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_0254: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) all.Clear(); ColorFieldNull(); assetFolder = Path.Combine(Path.Combine(Paths.ConfigPath, "CustomSols"), CustomSols.currSkinFolder ?? "Default"); if (!Directory.Exists(assetFolder)) { return; } foreach (KeyValuePair, Vector2, float, Func)> item5 in new Dictionary, Vector2, float, Func)> { { "MenuLogo", (cacheMenuLogoSprites, new Vector2(0.5f, 0f), 8f, (Func)null) }, { "Player", (cachePlayerSprites, new Vector2(0.5f, 0f), 8f, Selector(delegate(string filename) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00b6: 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_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_0120: 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_0155: 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) if (filename.StartsWith("SavePointPowerToYee")) { return (new Vector2(0.5f, 0.5f), Vector4.zero, (float?)null); } if (filename.StartsWith("Effect_HoHoYee_Parry_Sky")) { return (new Vector2(0.5f, 0.5f), Vector4.zero, (float?)null); } if (filename.StartsWith("HoHoYee_JumpKickEFFECT")) { return (new Vector2(0.5f, 0.5f), Vector4.zero, (float?)null); } if (filename.StartsWith("EFFECT_HoHoYee_ChargingAttack_impact")) { return (new Vector2(0.5f, 0.5f), Vector4.zero, (float?)null); } if (filename.StartsWith("HoHoYee_Drone")) { return (new Vector2(0.5f, 0.5f), Vector4.zero, (float?)null); } if (Regex.IsMatch(filename, "^HoHoYee_Dash\\d")) { return (new Vector2(0.5f, 0.5f), Vector4.zero, (float?)null); } return Regex.IsMatch(filename, "^HoHoYee_TurnAround\\d") ? new(Vector2, Vector4, float?)?((new Vector2(0.5f, 0.5f), Vector4.zero, (float?)null)) : null; })) }, { "TalismanBall", (cacheTalismanBallSprites, new Vector2(0.18f, -1.2f), 8f, (Func)null) }, { "Parry", (cacheParrySprites, new Vector2(0.5f, 0f), 8f, (Func)((string filename) => (!filename.StartsWith("ParrySparkAccurate")) ? null : new(Vector2, Vector4, float?)?((new Vector2(0.5f, 0.5f), Vector4.zero, (float?)null)))) }, { "Sword", (cacheSwordSprites, new Vector2(0.5f, 0.5f), 8f, (Func)null) }, { "Bow", (cacheBowSprites, new Vector2(0.5f, 0.5f), 8f, (Func)delegate(string filename) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) if (filename.StartsWith("Lv1光束")) { return (new Vector2(0f, 0.5f), new Vector4(212f, 0f, 212f, 0f), (float?)null); } if (filename.StartsWith("Lv2光束")) { return (new Vector2(0f, 0.5f), new Vector4(220f, 0f, 220f, 0f), (float?)null); } if (filename.StartsWith("Lv3光束")) { return (new Vector2(0f, 0.5f), new Vector4(240f, 0f, 205f, 0f), (float?)null); } if (filename.Equals("circle_mask")) { return (new Vector2(0.5f, 0.5f), new Vector4(240f, 0f, 205f, 0f), (float?)100f); } return filename.Equals("ExplosionCenter") ? new(Vector2, Vector4, float?)?((new Vector2(0.5f, 0.5f), new Vector4(240f, 0f, 205f, 0f), (float?)100f)) : null; }) }, { "Foo", (cacheFooSprites, new Vector2(0.5f, 0.5f), 8f, (Func)null) }, { "PlayerSpriteAllUseThis", (cacheOnlyOneSprites, new Vector2(0.5f, 0f), 8f, (Func)null) }, { "UI", (cacheUISprites, new Vector2(0.5f, 0.5f), 8f, (Func)delegate(string filename) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0225: 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) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) if (filename.StartsWith("ChiBallLeftLine")) { return (new Vector2(0.5f, 0.5f), Vector4.zero, (float?)2f); } if (filename.StartsWith("ButterflyRightLine")) { return (new Vector2(0.5f, 0.5f), Vector4.zero, (float?)2f); } if (filename.Equals("ArrowLineA")) { return (new Vector2(0f, 0.5f), new Vector4(94f, 0f, 125f, 0f), (float?)2f); } if (filename.StartsWith("Arrow")) { return (new Vector2(0.5f, 0.5f), Vector4.zero, (float?)1f); } if (filename.StartsWith("ParryBalls")) { return (new Vector2(0.5f, 0.5f), Vector4.zero, (float?)2f); } if (filename.StartsWith("Line_V")) { return (new Vector2(0.5f, 0.5f), new Vector4(9f, 5f, 9f, 5f), (float?)2f); } if (filename.StartsWith("CoreB_fill")) { return (new Vector2(0.5f, 0.5f), Vector4.zero, (float?)2f); } if (filename.StartsWith("Icon_Blood")) { return (new Vector2(0.5f, 0.5f), Vector4.zero, (float?)2f); } if (filename.StartsWith("Icon_BloodEmpty")) { return (new Vector2(0.5f, 0.5f), Vector4.zero, (float?)2f); } if (filename.StartsWith("CoreC")) { return (new Vector2(0.5f, 0.5f), Vector4.zero, (float?)2f); } return filename.StartsWith("CoreD") ? new(Vector2, Vector4, float?)?((new Vector2(0.5f, 0.5f), Vector4.zero, (float?)2f)) : new(Vector2, Vector4, float?)?((new Vector2(0.5f, 0.5f), Vector4.zero, (float?)8f)); }) }, { "YingZhao", (cacheYingZhaoSprites, new Vector2(0.5f, 0.5f), 8f, (Func)null) }, { "HitSpark", (cacheHitSparkSprites, new Vector2(0.5f, 0.5f), 8f, (Func)null) } }) { item5.Deconstruct(out var key, out var value); (Dictionary, Vector2, float, Func) tuple = value; string path = key; Dictionary item = tuple.Item1; Vector2 item2 = tuple.Item2; float item3 = tuple.Item3; Func item4 = tuple.Item4; string text = Path.Combine(assetFolder, path); if (Directory.Exists(text)) { LoadSpritesSync(text, item, item2, item3, item4); } else { item.Clear(); } } string text2 = Path.Combine(assetFolder, "Atlas"); if (Directory.Exists(text2)) { LoadAtlasSync(text2); } else { cacheAtlasTextures.Clear(); } LoadConfigs(); } private static void LoadConfigs() { string path = Path.Combine(assetFolder, "skinConfig.json"); if (!File.Exists(path)) { return; } try { MainConfig mainConfig = JsonConvert.DeserializeObject(File.ReadAllText(path)); if (mainConfig != null) { ColorConfig colors = mainConfig.Colors; TrySetColor(ref normalHpColor, colors.NormalHpColor); TrySetColor(ref internalHpColor, colors.InternalHpColor); TrySetColor(ref expRingOuterColor, colors.ExpRingOuterColor); TrySetColor(ref expRingInnerColor, colors.ExpRingInnerColor); TrySetColor(ref RageBarColor, colors.RageBarColor); TrySetColor(ref RageBarFrameColor, colors.RageBarFrameColor); TrySetColor(ref ArrowLineBColor, colors.ArrowLineBColor); TrySetColor(ref ArrowGlowColor, colors.ArrowGlowColor); TrySetColor(ref ChiBallLeftLineColor, colors.ChiBallLeftLineColor); TrySetColor(ref ButterflyRightLineColor, colors.ButterflyRightLineColor); TrySetColor(ref CoreCColor, colors.CoreCColor); TrySetColor(ref CoreDColor, colors.CoreDColor); TrySetColor(ref DashColor, colors.DashColor); TrySetColor(ref PerfectParryColor, colors.PerfectParryColor); TrySetColor(ref ImperfectParryColor, colors.ImperfectParryColor); TrySetColor(ref SwordCharingCirlceColor, colors.SwordCharingCirlceColor); TrySetColor(ref SwordCharingAbsorbColor, colors.SwordCharingAbsorbColor); TrySetColor(ref SwordCharingGlowColor, colors.SwordCharingGlowColor); TrySetColor(ref ParticlesFooColor, colors.ParticlesFooColor); TrySetColor(ref FooLightColor, colors.FooLightColor); TrySetColor(ref DrawFooBallColor1, colors.DrawFooBallColor1); TrySetColor(ref DrawFooBallColor2, colors.DrawFooBallColor2); TrySetColor(ref DrawFooBallColor3, colors.DrawFooBallColor3); TrySetColor(ref DrawFooBallColor4, colors.DrawFooBallColor4); TrySetColor(ref DrawFooBallColor5, colors.DrawFooBallColor5); TrySetColor(ref DrawFooLightColor, colors.DrawFooLightColor); TrySetColor(ref DrawFooBottomLightColor, colors.DrawFooBottomLightColor); TrySetColor(ref HitSparkColor, colors.HitSparkColor); ParryConfig parry = mainConfig.Parry; TrySetColor(ref UCCharging1Color, parry.UCCharging1Color); TrySetColor(ref UCCharging2Color, parry.UCCharging2Color); TrySetColor(ref UCSuccess1Color, parry.UCSuccess1Color); TrySetColor(ref UCSuccess2Color, parry.UCSuccess2Color); TrySetColor(ref AirParryColor, parry.AirParryColor); TrySetColor(ref UCParryColor, parry.UCParryColor); BowConfig bow = mainConfig.Bow; TrySetVector3(ref NormalArrowLv1Pos, bow.NormalArrowLv1); TrySetVector3(ref NormalArrowLv2Pos, bow.NormalArrowLv2); TrySetVector3(ref NormalArrowLv3Pos, bow.NormalArrowLv3); } } catch (Exception ex) { ToastManager.Toast((object)("Config Load Error: " + ex.Message)); } } private static void LoadAtlasSync(string folder) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown cacheAtlasTextures.Clear(); string[] files; try { files = Directory.GetFiles(folder, "*.png", SearchOption.TopDirectoryOnly); } catch { return; } string[] array = files; foreach (string path in array) { try { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(path); byte[] array2 = File.ReadAllBytes(path); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (ImageConversion.LoadImage(val, array2)) { ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; ((Object)val).name = fileNameWithoutExtension; val.Apply(); cacheAtlasTextures[fileNameWithoutExtension] = val; } else { Object.Destroy((Object)(object)val); } } catch (Exception ex) { ToastManager.Toast((object)("Atlas Load Error " + Path.GetFileName(path) + ": " + ex.Message)); } } } public static Texture2D GetAtlas(string name) { if (cacheAtlasTextures.TryGetValue(name, out Texture2D value)) { return value; } return null; } private static void LoadSpritesSync(string folder, Dictionary cache, Vector2 defaultPivot, float defaultPpu, Func pivotBorderSelector = null) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) cache.Clear(); string[] files; try { files = Directory.GetFiles(folder, "*.png", SearchOption.TopDirectoryOnly); } catch { return; } string[] array = files; foreach (string obj2 in array) { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(obj2); Vector2 pivot = defaultPivot; Vector4 border = default(Vector4); float pixelsPerUnit = defaultPpu; if (pivotBorderSelector != null) { (Vector2, Vector4, float?)? tuple = pivotBorderSelector(fileNameWithoutExtension); if (tuple.HasValue) { pivot = tuple.Value.Item1; border = tuple.Value.Item2; pixelsPerUnit = tuple.Value.Item3.GetValueOrDefault(defaultPpu); } } Sprite val = LoadSprite(obj2, pivot, pixelsPerUnit, border); if ((Object)(object)val != (Object)null) { cache[fileNameWithoutExtension] = val; all[fileNameWithoutExtension] = val; } } } public static string[] GetAllDirectories(string directory) { try { return Directory.GetDirectories(directory, "*", SearchOption.TopDirectoryOnly); } catch { return Array.Empty(); } } public static Sprite LoadSprite(string file, Vector2 pivot, float pixelsPerUnit, Vector4 border = default(Vector4)) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) try { byte[] array = File.ReadAllBytes(file); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (ImageConversion.LoadImage(val, array)) { ((Texture)val).wrapMode = (TextureWrapMode)1; string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(file); Sprite obj = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), pivot, pixelsPerUnit, 0u, (SpriteMeshType)0, border); ((Object)obj).name = fileNameWithoutExtension; return obj; } Object.Destroy((Object)(object)val); return null; } catch (Exception ex) { ToastManager.Toast((object)("Error loading " + Path.GetFileName(file) + ": " + ex.Message)); return null; } } private static void TrySetVector3(ref Vector3? field, float[] vectorArray) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (vectorArray != null && vectorArray.Length == 3) { field = new Vector3(vectorArray[0], vectorArray[1], vectorArray[2]); } } private static void TrySetColor(ref Color? field, string hexColor) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) Color value = default(Color); if (!string.IsNullOrWhiteSpace(hexColor) && hexColor != "#" && ColorUtility.TryParseHtmlString(hexColor, ref value)) { field = value; } } private static void ColorFieldNull() { normalHpColor = null; internalHpColor = null; expRingOuterColor = null; expRingInnerColor = null; RageBarColor = null; RageBarFrameColor = null; ArrowLineBColor = null; ArrowGlowColor = null; ChiBallLeftLineColor = null; ButterflyRightLineColor = null; CoreCColor = null; CoreDColor = null; HitSparkColor = null; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("CustomSols", "CustomSols", "1.0.0")] public class CustomSols : BaseUnityPlugin { private Harmony harmony; private Dictionary cachedSpriteRenderers = new Dictionary(); private static bool isAssetsLoaded = false; public ConfigEntry openFolder; public ConfigEntry isToastPlayerSprite; public ConfigEntry isToastPlayerDummySprite; public ConfigEntry isToastDialogue; private ConfigEntry spriteDelaySecond; private ConfigEntry reloadShortcut; private ConfigEntry skins; public static string currSkinFolder = ""; private string basePath = ""; private int currentSpriteIndex = 1; private float spriteChangeTimer; public static bool arrowInit = false; public static bool arrowInit2 = false; private static string playerSpriteName = ""; private static string playerDummySpriteName = ""; private static readonly int TintColorID = Shader.PropertyToID("_TintColor"); private static readonly int MainTexID = Shader.PropertyToID("_MainTex"); public static SpriteRenderer? CurrentDummyRenderer = null; public static List DummyRenderers = new List(); private Dictionary> groupedRenderers = new Dictionary>(); private ParticleSystemRenderer? _cachedUCSuccess; private ParticleSystemRenderer? _cachedUCCharging; private List _cachedTalismanBalls = new List(); private bool _talismanSearched; private Dictionary _spriteMappingCache = new Dictionary(); private int _cleanupCounter; public static readonly HashSet bowSpritePaths = new HashSet { "GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/PlayerSprite/Yee_Skill/HoHoYee_Archery/Bow", "GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/PlayerSprite/Yee_Skill/HoHoYee_Archery/Bow/Bow_A" }; public static readonly HashSet swordSpritePaths = new HashSet { "HoHoYee_AttackA_PoolObject_Variant(Clone)/Sprite", "HoHoYee_AttackB_PoolObject_Variant(Clone)/Sprite", "HoHoYee_AttackC ThirdAttack Effect(Clone)/Sprite", "Yee 氣刃 chi blade(Clone)/Projectile FSM/FSM Animator/View/Sprite", "HoHoYee_AttackC ThirdAttack 劍氣玉 Effect(Clone)/Sprite", "GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/Effect_Attack/ChargeAttack/ChargeAttackSprite", "HoHoYee_Charging 蓄力攻擊特效(Clone)/ChargeAttackSprite", "HoHoYee_Charging 蓄力攻擊特效(Clone)/Super Charge Ability/childNode/ChargeAttackSprite" }; public static CustomSols instance { get; private set; } = null; private void Awake() { instance = this; Log.Init(((BaseUnityPlugin)this).Logger); RCGLifeCycle.DontDestroyForever(((Component)this).gameObject); harmony = Harmony.CreateAndPatchAll(typeof(CustomSols).Assembly, (string)null); SetupConfig(); KeybindManager.Add((MonoBehaviour)(object)this, (Action)Reload, (Func)(() => reloadShortcut.Value)); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin CustomSols is loaded!"); } private void Start() { InitializeAssets(); SceneManager.sceneLoaded += OnSceneLoaded; } private void InitializeAssets() { isAssetsLoaded = false; _spriteMappingCache.Clear(); _cachedUCSuccess = null; _cachedUCCharging = null; _cachedTalismanBalls.Clear(); _talismanSearched = false; AssetLoader.Init(); if (!(currSkinFolder == "Default")) { isAssetsLoaded = true; CacheSpriteRenderers(); ChangeMenuLogo(); ChangeUIChiBall(); ImPerfectParry(); HitSpark(); SwordOnce(); InitializeBowSprites(); UpdateExpRing(); UpdateHpBar(); UpdatePotion(); UpdateLineA(); UpdateEightGua(); UpdateArrowLine(); UpdateRightLine(); UpdateArrowBullet(); YingZhaoOnce(); AirParryColor(); FooColorOnce(); } } private void FooColorOnce() { //IL_0028: 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_00bb: Unknown result type (might be due to invalid IL or missing references) string key = "GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/PlayerSprite/Effect_Foo/FOO/Foo1/Light"; if (cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value) && AssetLoader.FooLightColor.HasValue) { value.color = AssetLoader.FooLightColor.Value; } string key2 = "GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/PlayerSprite/Effect_Foo/DrawFoo/Light"; if (cachedSpriteRenderers.TryGetValue(key2, out SpriteRenderer value2) && AssetLoader.DrawFooLightColor.HasValue) { value2.color = AssetLoader.DrawFooLightColor.Value; } if (!AssetLoader.ParticlesFooColor.HasValue) { return; } ParticleSystemRenderer[] array = Object.FindObjectsOfType(true); foreach (ParticleSystemRenderer val in array) { if (((Object)val).name == "Particles_Foo" && ((Object)((Renderer)val).material).name == "YeeDrone (Instance)") { ((Renderer)val).material.color = AssetLoader.ParticlesFooColor.Value; } } } private void LateUpdate() { if (isToastPlayerSprite.Value) { Player i = Player.i; object obj; if (i == null) { obj = null; } else { SpriteRenderer playerSprite = i.PlayerSprite; obj = ((playerSprite != null) ? playerSprite.sprite : null); } Sprite val = (Sprite)obj; if ((Object)(object)val != (Object)null) { CheckAndToast(val, ref playerSpriteName); } } if (isToastPlayerDummySprite.Value) { SpriteRenderer? currentDummyRenderer = CurrentDummyRenderer; Sprite val2 = ((currentDummyRenderer != null) ? currentDummyRenderer.sprite : null); if ((Object)(object)val2 != (Object)null) { CheckAndToast(val2, ref playerDummySpriteName, "Dummy: "); } } if (isAssetsLoaded) { RendererReplace(); PlayerSprite(); AirParry(); UCParryColor(); PerfectParry(); Dash(); AirJump(); UCAroundEffect(); UCSuccess(); UCCharging(); TalismanBall(); Foo(); Sword(); FooColor(); UpdateHeartSprite(); UpdateArrowIcon(); UpdateArrowColor(); UpdateButterflySprite(); } } private void FooColor() { //IL_0028: 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) string key = "GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/PlayerSprite/Effect_Foo/DrawFoo/BottomLight"; if (cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value) && AssetLoader.DrawFooBottomLightColor.HasValue) { value.color = AssetLoader.DrawFooBottomLightColor.Value; } for (int i = 1; i <= 5; i++) { string key2 = $"GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/PlayerSprite/Effect_Foo/FooDots/D{i}/FooDot ({i})/JENG/Ball"; if (cachedSpriteRenderers.TryGetValue(key2, out SpriteRenderer value2)) { Color? colorByIndex = GetColorByIndex(i); if (colorByIndex.HasValue) { value2.color = colorByIndex.Value; } } } } private Color? GetColorByIndex(int index) { return index switch { 1 => AssetLoader.DrawFooBallColor1, 2 => AssetLoader.DrawFooBallColor2, 3 => AssetLoader.DrawFooBallColor3, 4 => AssetLoader.DrawFooBallColor4, 5 => AssetLoader.DrawFooBallColor5, _ => null, }; } private void CheckAndToast(Sprite sprite, ref string cachedName, string prefix = "") { if (!((Object)(object)sprite == (Object)null)) { string name = ((Object)sprite).name; if (cachedName != name) { cachedName = name; ToastManager.Toast((object)(prefix + name)); } } } private void ChangeMenuLogo() { if (!isAssetsLoaded || AssetLoader.cacheMenuLogoSprites == null || AssetLoader.cacheMenuLogoSprites.Count == 0) { return; } GameObject val = GameObject.Find("MenuLogic/MainMenuLogic/Providers/MenuUIPanel/Logo"); if ((Object)(object)val != (Object)null) { Image component = val.GetComponent(); if (component != null && AssetLoader.cacheMenuLogoSprites.TryGetValue("9sLOGO_1", out Sprite value)) { component.sprite = value; } } } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { _cachedUCSuccess = null; _cachedUCCharging = null; _cachedTalismanBalls.Clear(); _spriteMappingCache.Clear(); _talismanSearched = false; CacheSpriteRenderers(); ChangeMenuLogo(); ChangeUIChiBall(); ImPerfectParry(); HitSpark(); SwordOnce(); InitializeBowSprites(); UpdateExpRing(); UpdateHpBar(); UpdatePotion(); UpdateLineA(); UpdateEightGua(); UpdateArrowLine(); UpdateRightLine(); UpdateArrowBullet(); YingZhaoOnce(); AirParryColor(); FooColorOnce(); arrowInit = false; arrowInit2 = false; } private void SetupConfig() { //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Expected O, but got Unknown openFolder = ((BaseUnityPlugin)this).Config.Bind("Folder", "Open CustomSols Folder", false, ""); isToastPlayerSprite = ((BaseUnityPlugin)this).Config.Bind("", "Toast Player Sprite Name", false, ""); isToastPlayerDummySprite = ((BaseUnityPlugin)this).Config.Bind("", "Toast Player Dummy Sprite Name", false, ""); isToastDialogue = ((BaseUnityPlugin)this).Config.Bind("", "Toast Dialogue Character", false, ""); spriteDelaySecond = ((BaseUnityPlugin)this).Config.Bind("Sprite Delay Second", "PlayerSpriteAllUseThis Sprite Delay Second", 0.12f, ""); reloadShortcut = ((BaseUnityPlugin)this).Config.Bind("Shortcut", "Reload Shortcut", new KeyboardShortcut((KeyCode)104, (KeyCode[])(object)new KeyCode[1] { (KeyCode)306 }), ""); basePath = Path.Combine(Paths.ConfigPath, "CustomSols"); skins = ((BaseUnityPlugin)this).Config.Bind("Skin List", "Select Skin", (string)null, new ConfigDescription("", (AcceptableValueBase)(object)new AcceptableValueList(AssetLoader.GetAllDirectories(basePath).Select(Path.GetFileName).ToArray()), Array.Empty())); currSkinFolder = skins.Value ?? "Default"; skins.SettingChanged += delegate { currSkinFolder = skins.Value; InitializeAssets(); }; openFolder.SettingChanged += delegate { Process.Start(basePath); }; } private void CacheSpriteRenderers() { groupedRenderers.Clear(); cachedSpriteRenderers.Clear(); SpriteRenderer[] array = Object.FindObjectsOfType(true); foreach (SpriteRenderer val in array) { if (!((Object)(object)val == (Object)null)) { if (!DummyRenderers.Contains(val)) { DummyRenderers.Add(val); } string gameObjectPath = GetGameObjectPath(((Component)val).gameObject); if (!groupedRenderers.ContainsKey(gameObjectPath)) { groupedRenderers[gameObjectPath] = new List(); } groupedRenderers[gameObjectPath].Add(val); string key = gameObjectPath; int num = 2; while (cachedSpriteRenderers.ContainsKey(key)) { key = $"{gameObjectPath}_{num}"; num++; } cachedSpriteRenderers[key] = val; } } } public static string GetGameObjectPath(GameObject obj) { string text = ((Object)obj).name; Transform val = obj.transform; while ((Object)(object)val.parent != (Object)null) { val = val.parent; text = ((Object)val).name + "/" + text; } return text; } private void RendererReplace() { _cleanupCounter++; if (_cleanupCounter > 100) { DummyRenderers.RemoveAll((SpriteRenderer r) => (Object)(object)r == (Object)null); _cleanupCounter = 0; } foreach (SpriteRenderer dummyRenderer in DummyRenderers) { if ((Object)(object)dummyRenderer == (Object)null) { continue; } Sprite sprite = dummyRenderer.sprite; if ((Object)(object)sprite == (Object)null) { continue; } if (_spriteMappingCache.TryGetValue(sprite, out Sprite value)) { if ((Object)(object)sprite != (Object)(object)value) { dummyRenderer.sprite = value; } continue; } string name = ((Object)sprite).name; if (AssetLoader.all.TryGetValue(name, out Sprite value2)) { _spriteMappingCache[sprite] = value2; _spriteMappingCache[value2] = value2; dummyRenderer.sprite = value2; } else { _spriteMappingCache[sprite] = sprite; } } } private void ChangeUIChiBall() { if (AssetLoader.cacheUISprites == null || AssetLoader.cacheUISprites.Count == 0) { return; } string[] array = new string[5] { "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/ParryCharge/ParryBalls/ParryPoint/BG/Rotate/Fill", "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/ParryCharge/ParryBalls/ParryPoint (5)/BG/Rotate/Fill", "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/ParryCharge/ParryBalls/ParryPoint (6)/BG/Rotate/Fill", "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/ParryCharge/ParryBalls/ParryPoint (7)/BG/Rotate/Fill", "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/ParryCharge/ParryBalls/ParryPoint (8)/BG/Rotate/Fill" }; if (!AssetLoader.cacheUISprites.TryGetValue("ParryBalls", out Sprite value)) { return; } string[] array2 = array; foreach (string key in array2) { if (cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value2)) { value2.sprite = value; } } } private void HitSpark() { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if (AssetLoader.cacheHitSparkSprites == null || AssetLoader.cacheHitSparkSprites.Count <= 0) { return; } ParticleSystemRenderer[] array = Object.FindObjectsOfType(true); foreach (ParticleSystemRenderer val in array) { if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).transform.parent == (Object)null) && ((Object)((Component)val).transform.parent).name == "YeeEffect_Attack Hit Enemy(Clone)" && (Object)(object)((Renderer)val).material != (Object)null) { if (AssetLoader.cacheHitSparkSprites.TryGetValue("Hit Enemy", out Sprite value) && (Object)(object)value != (Object)null && (Object)(object)value.texture != (Object)null) { ((Renderer)val).material.SetTexture(MainTexID, (Texture)(object)value.texture); } if (AssetLoader.HitSparkColor.HasValue) { ((Renderer)val).material.color = AssetLoader.HitSparkColor.Value; } } } } private void ImPerfectParry() { //IL_0115: Unknown result type (might be due to invalid IL or missing references) if ((AssetLoader.cacheParrySprites == null || AssetLoader.cacheParrySprites.Count <= 0) && !AssetLoader.ImperfectParryColor.HasValue) { return; } Shader val = Shader.Find("Legacy Shaders/Particles/Alpha Blended"); ParticleSystemRenderer[] array = Object.FindObjectsOfType(true); foreach (ParticleSystemRenderer val2 in array) { if ((Object)(object)val2 == (Object)null || (Object)(object)((Component)val2).transform.parent == (Object)null || !(((Object)((Component)val2).transform.parent).name == "YeeParryEffect_Not Accurate(Clone)")) { continue; } Material[] materials = ((Renderer)val2).materials; if (materials == null || materials.Length <= 1) { continue; } Material val3 = materials[1]; if (!((Object)(object)val3 == (Object)null)) { if ((Object)(object)val != (Object)null) { val3.shader = val; } if (AssetLoader.cacheParrySprites.TryGetValue("imPerfect", out Sprite value) && (Object)(object)value != (Object)null && (Object)(object)value.texture != (Object)null) { val3.SetTexture(MainTexID, (Texture)(object)value.texture); } if (AssetLoader.ImperfectParryColor.HasValue) { val3.SetColor(TintColorID, AssetLoader.ImperfectParryColor.Value); } ((Renderer)val2).materials = materials; } } } private void PerfectParry() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) if ((AssetLoader.cacheParrySprites == null || AssetLoader.cacheParrySprites.Count <= 0) && !AssetLoader.PerfectParryColor.HasValue) { return; } string key = "YeeParryEffectAccurate_Green(Clone)/ParrySparkAccurate0"; if (!groupedRenderers.TryGetValue(key, out List value)) { return; } foreach (SpriteRenderer item in value) { ApplyParrySprite(item); if (AssetLoader.PerfectParryColor.HasValue) { item.color = AssetLoader.PerfectParryColor.Value; } } } private void ApplyParrySprite(SpriteRenderer renderer) { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Invalid comparison between Unknown and I4 //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)renderer == (Object)null || (Object)(object)renderer.sprite == (Object)null) { return; } Sprite value2; if (_spriteMappingCache.TryGetValue(renderer.sprite, out Sprite value)) { if ((Object)(object)renderer.sprite != (Object)(object)value) { renderer.sprite = value; } } else if (AssetLoader.cacheParrySprites.TryGetValue(((Object)renderer.sprite).name, out value2)) { _spriteMappingCache[renderer.sprite] = value2; renderer.sprite = value2; } else { _spriteMappingCache[renderer.sprite] = renderer.sprite; } float num = (((int)((Actor)Player.i).Facing == -1) ? 180f : 0f); ((Component)renderer).transform.rotation = Quaternion.Euler(0f, num, 0f); } private void AirParry() { if (AssetLoader.cachePlayerSprites != null && AssetLoader.cachePlayerSprites.Count != 0 && cachedSpriteRenderers.TryGetValue("GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/PlayerSprite/AbilityChecker/Ability 識破/Effect_TAICHIParry_Air/Effect_JumpFeet", out SpriteRenderer value) && AssetLoader.cachePlayerSprites.TryGetValue(((Object)value.sprite).name, out Sprite value2)) { value.sprite = value2; } } private void Dash() { if (AssetLoader.all == null || AssetLoader.all.Count == 0) { return; } string key = "Effect_Roll Dodge AfterImage(Clone)/Effect_HoHoYee_AirJump0"; if (!groupedRenderers.TryGetValue(key, out List value)) { return; } foreach (SpriteRenderer item in value) { ApplyToRenderer(item); } } private void ApplyToRenderer(SpriteRenderer renderer) { if ((Object)(object)renderer == (Object)null || (Object)(object)renderer.sprite == (Object)null) { return; } if (_spriteMappingCache.TryGetValue(renderer.sprite, out Sprite value)) { if ((Object)(object)renderer.sprite != (Object)(object)value) { renderer.sprite = value; } return; } string name = ((Object)renderer.sprite).name; if (AssetLoader.all.TryGetValue(name, out Sprite value2)) { _spriteMappingCache[renderer.sprite] = value2; _spriteMappingCache[value2] = value2; renderer.sprite = value2; } else { _spriteMappingCache[renderer.sprite] = renderer.sprite; } } private void AirJump() { if (AssetLoader.cachePlayerSprites == null || AssetLoader.cachePlayerSprites.Count == 0) { return; } string key = "Effect_AirJump(Clone)/Effect_HoHoYee_AirJump0"; if (!groupedRenderers.TryGetValue(key, out List value)) { return; } foreach (SpriteRenderer item in value) { ApplyAirJumpSprite(item); } } private void ApplyAirJumpSprite(SpriteRenderer renderer) { if ((Object)(object)renderer == (Object)null || (Object)(object)renderer.sprite == (Object)null) { return; } Sprite value2; if (_spriteMappingCache.TryGetValue(renderer.sprite, out Sprite value)) { if ((Object)(object)renderer.sprite != (Object)(object)value) { renderer.sprite = value; } } else if (AssetLoader.cachePlayerSprites.TryGetValue(((Object)renderer.sprite).name, out value2)) { _spriteMappingCache[renderer.sprite] = value2; renderer.sprite = value2; } else { _spriteMappingCache[renderer.sprite] = renderer.sprite; } } private void UCAroundEffect() { if (AssetLoader.cacheParrySprites != null && AssetLoader.cacheParrySprites.Count != 0 && cachedSpriteRenderers.TryGetValue("GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/PlayerSprite/Effect_TAICHIParry/Effect_ParryCounterAttack0", out SpriteRenderer value) && AssetLoader.cacheParrySprites.TryGetValue(((Object)value.sprite).name, out Sprite value2)) { value.sprite = value2; } } private void UCSuccess() { UpdateParticleEffect("GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/PlayerSprite/Effect_TAICHIParry/P_Charging", ref _cachedUCSuccess, AssetLoader.UCSuccess1Color, AssetLoader.UCSuccess2Color, "UCSuccess", "UCSuccess2"); } private void UCCharging() { UpdateParticleEffect("GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/PlayerSprite/Effect_TAICHIParry/P_Charging C", ref _cachedUCCharging, AssetLoader.UCCharging1Color, AssetLoader.UCCharging2Color, "UCCharging", "UCCharging2"); } private void UpdateParticleEffect(string path, ref ParticleSystemRenderer cachedRenderer, Color? color1, Color? color2, string spriteKey1, string spriteKey2) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (AssetLoader.cacheParrySprites == null) { return; } if ((Object)(object)cachedRenderer == (Object)null) { GameObject val = GameObject.Find(path); if ((Object)(object)val == (Object)null) { return; } cachedRenderer = val.GetComponent(); ParticleSystem component = val.GetComponent(); if (color1.HasValue && (Object)(object)component != (Object)null) { MainModule main = component.main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color1.Value); } if (color2.HasValue && ((Renderer)cachedRenderer).sharedMaterials.Length > 1) { ((Renderer)cachedRenderer).materials[1].SetColor(TintColorID, color2.Value); } } if ((Object)(object)cachedRenderer != (Object)null) { Material[] materials = ((Renderer)cachedRenderer).materials; if (AssetLoader.cacheParrySprites.TryGetValue(spriteKey1, out Sprite value)) { materials[0].SetTexture(MainTexID, (Texture)(object)value.texture); } if (materials.Length > 1 && AssetLoader.cacheParrySprites.TryGetValue(spriteKey2, out Sprite value2)) { materials[1].SetTexture(MainTexID, (Texture)(object)value2.texture); } } } private void TalismanBall() { if (AssetLoader.cacheTalismanBallSprites == null) { return; } if (!_talismanSearched) { GameObject val = GameObject.Find("GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/PlayerSprite/Effect_Foo"); if ((Object)(object)val != (Object)null && val.activeSelf) { for (int i = 1; i <= 5; i++) { Transform obj = val.transform.Find($"FooDots/D{i}/FooDot ({i})/JENG/Ball"); SpriteRenderer val2 = ((obj != null) ? ((Component)obj).GetComponent() : null); if ((Object)(object)val2 != (Object)null) { _cachedTalismanBalls.Add(val2); } } _talismanSearched = true; } } foreach (SpriteRenderer cachedTalismanBall in _cachedTalismanBalls) { if ((Object)(object)cachedTalismanBall != (Object)null && (Object)(object)cachedTalismanBall.sprite != (Object)null && AssetLoader.cacheTalismanBallSprites.TryGetValue(((Object)cachedTalismanBall.sprite).name, out Sprite value)) { cachedTalismanBall.sprite = value; } } } private void PlayerSprite() { Dictionary cacheOnlyOneSprites = AssetLoader.cacheOnlyOneSprites; Dictionary cachePlayerSprites = AssetLoader.cachePlayerSprites; if ((Object)(object)Player.i?.PlayerSprite == (Object)null || (Object)(object)Player.i.PlayerSprite.sprite == (Object)null) { return; } Sprite sprite = Player.i.PlayerSprite.sprite; if (cacheOnlyOneSprites != null && cacheOnlyOneSprites.Count > 0) { spriteChangeTimer += Time.deltaTime; if (!cacheOnlyOneSprites.TryGetValue(currentSpriteIndex.ToString(), out var value)) { return; } Player.i.PlayerSprite.sprite = value; if (spriteChangeTimer >= spriteDelaySecond.Value) { currentSpriteIndex++; if (!cacheOnlyOneSprites.ContainsKey(currentSpriteIndex.ToString())) { currentSpriteIndex = 1; } spriteChangeTimer = 0f; } } else { if (cachePlayerSprites == null || cachePlayerSprites.Count <= 0) { return; } if (_spriteMappingCache.TryGetValue(sprite, out Sprite value2)) { if ((Object)(object)sprite != (Object)(object)value2) { Player.i.PlayerSprite.sprite = value2; } return; } string name = ((Object)sprite).name; if (cachePlayerSprites.TryGetValue(name, out var value3)) { _spriteMappingCache[sprite] = value3; _spriteMappingCache[value3] = value3; Player.i.PlayerSprite.sprite = value3; } else { _spriteMappingCache[sprite] = sprite; } } } private void InitializeBowSprites() { //IL_00c8: 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_012e: Unknown result type (might be due to invalid IL or missing references) if (AssetLoader.cacheBowSprites == null || AssetLoader.cacheBowSprites.Count == 0) { return; } foreach (string bowSpritePath in bowSpritePaths) { if (cachedSpriteRenderers.TryGetValue(bowSpritePath, out SpriteRenderer value) && AssetLoader.cacheBowSprites.TryGetValue(((Object)value.sprite).name, out Sprite value2)) { value.sprite = value2; } } GameObject[] array = Object.FindObjectsOfType(true); foreach (GameObject val in array) { if (((Object)val).name.StartsWith("NormalArrow Shoot 穿雲 Lv")) { if (((Object)val).name.StartsWith("NormalArrow Shoot 穿雲 Lv1")) { val.transform.Find("光束").localPosition = AssetLoader.NormalArrowLv1Pos.Value; } if (((Object)val).name.StartsWith("NormalArrow Shoot 穿雲 Lv2")) { val.transform.Find("光束").localPosition = AssetLoader.NormalArrowLv2Pos.Value; } if (((Object)val).name.StartsWith("NormalArrow Shoot 穿雲 Lv3")) { val.transform.Find("光束").localPosition = AssetLoader.NormalArrowLv3Pos.Value; } UpdateBowSprite(val, "光束"); UpdateBowSprite(val, "NormalArrow"); UpdateBowSprite(val, "NormalArrow/ChasingArrowLight"); } else if (((Object)val).name.StartsWith("ExplodingArrow Shooter 爆破發射器 Lv")) { UpdateBowSprite(val, "Exploding Arrow/ExplodingArrow/ExplodingArrow"); UpdateBowSprite(val, "Exploding Arrow/ExplodingArrow/ChasingArrowLight"); UpdateBowSprite(val, "Exploding Arrow/EnergyBall/Core"); } else if (((Object)val).name.StartsWith("Explosion Damage 爆破箭 閃電 lv")) { Transform obj = val.transform.Find("ATTACK/Core"); SpriteRenderer val2 = ((obj != null) ? ((Component)obj).GetComponent() : null); if ((Object)(object)val2 != (Object)null && (Object)(object)val2.sprite != (Object)null && AssetLoader.cacheBowSprites.TryGetValue("ExplosionCenter", out Sprite value3)) { val2.sprite = value3; } } else if (((Object)val).name.StartsWith("Chasing Arrow Shooter 飛天御劍 lv")) { for (int j = 1; j <= 2; j++) { UpdateBowSprite(val, $"Circle Shooter/Arrow ({j})/ChasingArrow /ChasingArrowLight"); UpdateBowSprite(val, $"Circle Shooter/Arrow ({j})/ChasingArrow /Parent 刺/刺/刺"); UpdateBowSprite(val, $"Circle Shooter/Arrow ({j})/ChasingArrow /Parent 刺/刺 (1)/刺"); } } } } public static void UpdateBowSprite(GameObject parent, string childPath) { if (!((Object)(object)parent == (Object)null)) { Transform obj = parent.transform.Find(childPath); SpriteRenderer val = ((obj != null) ? ((Component)obj).GetComponent() : null); if ((Object)(object)val != (Object)null && (Object)(object)val.sprite != (Object)null && AssetLoader.cacheBowSprites.TryGetValue(((Object)val.sprite).name, out Sprite value)) { val.sprite = value; } } } private void Sword() { if (AssetLoader.cacheSwordSprites == null || AssetLoader.cacheSwordSprites.Count == 0) { return; } foreach (string swordSpritePath in swordSpritePaths) { if (!groupedRenderers.TryGetValue(swordSpritePath, out List value)) { continue; } foreach (SpriteRenderer item in value) { ApplyToRenderer(item); } } } private void SwordOnce() { //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) bool flag = AssetLoader.cacheSwordSprites != null && AssetLoader.cacheSwordSprites.Count > 0; if (!flag && !AssetLoader.SwordCharingCirlceColor.HasValue && !AssetLoader.SwordCharingAbsorbColor.HasValue && !AssetLoader.SwordCharingGlowColor.HasValue) { return; } GameObject val = GameObject.Find("GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/ChargeAttackParticle"); if ((Object)(object)val == (Object)null) { Resources.FindObjectsOfTypeAll(); return; } Transform transform = val.transform; string[] array = new string[5] { "P_PowerCharged/F1", "P_PowerCharged/F2", "P_PowerCharged/F3", "P_PowerCharged/F4", "P_PowerCharged/F5" }; foreach (string text in array) { Transform val2 = transform.Find(text); if ((Object)(object)val2 != (Object)null) { ParticleSystemRenderer component = ((Component)val2).GetComponent(); if (flag && AssetLoader.cacheSwordSprites.TryGetValue("FooSmokeGlow", out Sprite value)) { ((Renderer)component).materials[1].SetTexture("_MainTex", (Texture)(object)value.texture); } if (AssetLoader.SwordCharingCirlceColor.HasValue) { ((Renderer)component).materials[1].color = AssetLoader.SwordCharingCirlceColor.Value; } } } Transform val3 = transform.Find("P_PowerCharging/P_hit"); if ((Object)(object)val3 != (Object)null) { ParticleSystemRenderer component2 = ((Component)val3).GetComponent(); if (flag && AssetLoader.cacheSwordSprites.TryGetValue("bubbletrail", out Sprite value2)) { ((Renderer)component2).materials[1].SetTexture("_MainTex", (Texture)(object)value2.texture); } if (AssetLoader.SwordCharingAbsorbColor.HasValue) { ((Renderer)component2).materials[1].color = AssetLoader.SwordCharingAbsorbColor.Value; } } Transform val4 = transform.Find("Glow"); if ((Object)(object)val4 != (Object)null && AssetLoader.SwordCharingGlowColor.HasValue) { ((Renderer)((Component)val4).GetComponent()).material.color = AssetLoader.SwordCharingGlowColor.Value; } } private void Foo() { if (AssetLoader.cacheFooSprites == null || AssetLoader.cacheFooSprites.Count == 0) { return; } foreach (var (key, key2) in new Dictionary { { "FooPrefab Deposit(Clone)/Foo Charm Deposit/Animator(StartShouldDisable)/Effect_Foo/FOO", "Effect_Foo4" }, { "FooPrefab Deposit(Clone)/Foo Charm Deposit/Animator(StartShouldDisable)/流派/一氣貫通/Effect_一氣貫通/FOO", "Effect_Foo3" }, { "FooPrefab Deposit(Clone)/Foo Charm Deposit/Animator(StartShouldDisable)/流派/行雲流水/Effect_行雲流水/FOO", "Effect_Foo3" }, { "FooPrefab Deposit(Clone)/Foo Charm Deposit/Animator(StartShouldDisable)/流派/收放自如/Effect_收放自如/FOO", "Effect_Foo3" } }) { if (cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value) && AssetLoader.cacheFooSprites.TryGetValue(key2, out Sprite value2)) { value.sprite = value2; } } for (int i = 1; i <= 5; i++) { string key3 = $"FooExplode(Clone)/LV{i}/SpriteHolder"; if (cachedSpriteRenderers.TryGetValue(key3, out SpriteRenderer value3) && (Object)(object)value3.sprite != (Object)null && AssetLoader.cacheFooSprites.TryGetValue(((Object)value3.sprite).name, out Sprite value4)) { value3.sprite = value4; } } if (cachedSpriteRenderers.TryGetValue("Effect_FooAttack0(Clone)/Effect_FooAttackHit", out SpriteRenderer value5) && AssetLoader.cacheFooSprites.TryGetValue(((Object)value5.sprite).name, out Sprite value6)) { value5.sprite = value6; } } private void YingZhaoOnce() { if (cachedSpriteRenderers.TryGetValue("A2_S5_ BossHorseman_GameLevel/Room/StealthGameMonster_SpearHorseMan/MonsterCore/Animator(Proxy)/Animator/SpearHorseMan/DDS/SpearHorseMan_HorseBodyD/SpearHorseMan_HorseBody_A", out SpriteRenderer value) && AssetLoader.cacheYingZhaoSprites.TryGetValue(((Object)value.sprite).name, out Sprite value2)) { value.sprite = value2; } if (cachedSpriteRenderers.TryGetValue("A2_S5_ BossHorseman_GameLevel/Room/StealthGameMonster_SpearHorseMan/MonsterCore/Animator(Proxy)/Animator/SpearHorseMan/DDS/SpearHorseMan_HorseBodyD/SpearHorseMan_HorseBody_A/bone_1/bone_2/SpearHorseMan_HorseBody_B", out SpriteRenderer value3) && AssetLoader.cacheYingZhaoSprites.TryGetValue(((Object)value3.sprite).name, out Sprite value4)) { value3.sprite = value4; } } private void YingZhao() { if (AssetLoader.cacheYingZhaoSprites != null && AssetLoader.cacheYingZhaoSprites.Count != 0) { if (cachedSpriteRenderers.TryGetValue("A2_S5_ BossHorseman_GameLevel/Room/StealthGameMonster_SpearHorseMan/MonsterCore/Animator(Proxy)/Animator/SpearHorseMan/DDS/Body_Attack_D (F)", out SpriteRenderer value) && AssetLoader.cacheYingZhaoSprites.TryGetValue(((Object)value.sprite).name, out Sprite value2)) { value.sprite = value2; } if (cachedSpriteRenderers.TryGetValue("A2_S5_ BossHorseman_GameLevel/Room/StealthGameMonster_SpearHorseMan/MonsterCore/Animator(Proxy)/Animator/SpearHorseMan/DDS/SpearHorseMan_HorseBodyD", out SpriteRenderer value3) && AssetLoader.cacheYingZhaoSprites.TryGetValue(((Object)value3.sprite).name, out Sprite value4)) { value3.sprite = value4; } if (cachedSpriteRenderers.TryGetValue("A2_S5_ BossHorseman_GameLevel/Room/StealthGameMonster_SpearHorseMan/MonsterCore/Animator(Proxy)/Animator/SpearHorseMan/DDS/EFFECT/SlashA", out SpriteRenderer value5) && AssetLoader.cacheYingZhaoSprites.TryGetValue(((Object)value5.sprite).name, out Sprite value6)) { value5.sprite = value6; } } } private void UpdateHeartSprite() { if (AssetLoader.cacheUISprites != null && AssetLoader.cacheUISprites.Count != 0) { string key = "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/EXP_RING/HUD_Heart/Heart"; if (cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value) && (Object)(object)value.sprite != (Object)null && AssetLoader.cacheUISprites.TryGetValue(((Object)value.sprite).name, out Sprite value2)) { value.sprite = value2; } } } private void UpdateArrowIcon() { if (AssetLoader.cacheUISprites != null && AssetLoader.cacheUISprites.Count != 0) { string key = "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftDown/Bow UI Area/ItemSelection/CurrentItemPanel spr/ItemPic"; if (cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value) && (Object)(object)value.sprite != (Object)null && AssetLoader.cacheUISprites.TryGetValue(((Object)value.sprite).name, out Sprite value2)) { value.sprite = value2; } } } private void UpdateArrowColor() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) if ((AssetLoader.cacheUISprites == null || AssetLoader.cacheUISprites.Count <= 0) && !AssetLoader.ArrowGlowColor.HasValue && !AssetLoader.RageBarFrameColor.HasValue && !AssetLoader.RageBarColor.HasValue) { return; } if (cachedSpriteRenderers.TryGetValue("GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftDown/Bow UI Area/ItemSelection/CurrentItemPanel spr/Glow", out SpriteRenderer value) && AssetLoader.ArrowGlowColor.HasValue) { value.color = AssetLoader.ArrowGlowColor.Value; } AssetLoader.cacheUISprites.TryGetValue("BlockOutline", out Sprite value2); AssetLoader.cacheUISprites.TryGetValue("Block", out Sprite value3); if ((Object)(object)value2 == (Object)null && (Object)(object)value3 == (Object)null) { return; } for (int i = 0; i <= 7; i++) { string obj = ((i == 0) ? "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftDown/Bow UI Area/RageUI renderer/slots/RagePart_spr" : string.Format("{0}RagePart_spr ({1})", "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftDown/Bow UI Area/RageUI renderer/slots/", i)); string key = obj + "/RageBar Frame"; string key2 = obj + "/RageBar"; if (cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value4) && AssetLoader.RageBarFrameColor.HasValue) { value4.color = AssetLoader.RageBarFrameColor.Value; } if (cachedSpriteRenderers.TryGetValue(key2, out SpriteRenderer value5) && AssetLoader.RageBarColor.HasValue) { value5.color = AssetLoader.RageBarColor.Value; } } } private void UpdateButterflySprite() { if (AssetLoader.cacheUISprites == null || AssetLoader.cacheUISprites.Count == 0) { return; } string[] array = new string[3] { "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/RightDown/Butterfly_UIHintPanel/TESLA BUTTERFlY/Butterfly/Butterfly", "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/RightDown/Butterfly_UIHintPanel/TESLA BUTTERFlY/Butterfly/ButterflyIcon Color", "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/RightDown/Butterfly_UIHintPanel/TESLA BUTTERFlY/Butterfly/ButterflyIcon" }; foreach (string key in array) { if (cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value) && (Object)(object)value.sprite != (Object)null && (Object)(object)value.sprite != (Object)null && AssetLoader.cacheUISprites.TryGetValue(((Object)value.sprite).name, out Sprite value2) && (Object)(object)value.sprite != (Object)null && AssetLoader.cacheUISprites.TryGetValue(((Object)value.sprite).name, out Sprite _)) { value.sprite = value2; } } } private void UpdateExpRing() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if ((AssetLoader.cacheUISprites != null && AssetLoader.cacheUISprites.Count > 0) || AssetLoader.expRingOuterColor.HasValue || AssetLoader.expRingInnerColor.HasValue) { string key = "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/EXP_RING/CoreB(ExpUILogic)"; if (AssetLoader.expRingOuterColor.HasValue && cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value) && AssetLoader.expRingOuterColor.HasValue) { value.color = AssetLoader.expRingOuterColor.Value; } string key2 = "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/EXP_RING/CoreB(ExpUILogic)/BarFill"; if (AssetLoader.expRingInnerColor.HasValue && cachedSpriteRenderers.TryGetValue(key2, out SpriteRenderer value2) && AssetLoader.expRingInnerColor.HasValue) { value2.color = AssetLoader.expRingInnerColor.Value; } } } private void UpdateHpBar() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) if (AssetLoader.cacheUISprites != null && ((AssetLoader.cacheUISprites != null && AssetLoader.cacheUISprites.Count > 0) || AssetLoader.normalHpColor.HasValue || AssetLoader.internalHpColor.HasValue)) { string key = "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/HealthBarBase/HealthBar/BG renderer/Health"; if (AssetLoader.normalHpColor.HasValue && cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value) && AssetLoader.normalHpColor.HasValue) { value.color = AssetLoader.normalHpColor.Value; } string key2 = "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/HealthBarBase/HealthBar/BG renderer/RecoverableHealth"; if (AssetLoader.internalHpColor.HasValue && cachedSpriteRenderers.TryGetValue(key2, out SpriteRenderer value2) && AssetLoader.internalHpColor.HasValue) { value2.color = AssetLoader.internalHpColor.Value; } } } private void UpdatePotion() { if (AssetLoader.cacheUISprites == null || AssetLoader.cacheUISprites.Count == 0) { return; } Sprite value; Sprite val = (AssetLoader.cacheUISprites.TryGetValue("Icon_BloodEmpty", out value) ? value : null); Sprite value2; Sprite val2 = (AssetLoader.cacheUISprites.TryGetValue("Icon_Blood", out value2) ? value2 : null); if ((Object)(object)val == (Object)null && (Object)(object)val2 == (Object)null) { return; } for (int i = 0; i <= 7; i++) { string obj = ((i == 0) ? "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/Potion/PotionIMG" : string.Format("{0}PotionIMG ({1})", "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/Potion/", i)); string text = obj + "/GameObject"; GameObject val3 = GameObject.Find(obj); if (!((Object)(object)val3 != (Object)null)) { continue; } SpriteRenderer component = val3.GetComponent(); if ((Object)(object)component != (Object)null) { component.sprite = val; } GameObject val4 = GameObject.Find(text); if ((Object)(object)val4 != (Object)null) { SpriteRenderer component2 = val4.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.sprite = val2; } } } } private void UpdateLineA() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) string key = "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/ParryCharge/LineA"; if (cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value)) { if (AssetLoader.cacheUISprites.TryGetValue("ChiBallLeftLine", out Sprite value2)) { value.sprite = value2; } if (AssetLoader.ChiBallLeftLineColor.HasValue) { value.color = AssetLoader.ChiBallLeftLineColor.Value; } } } private void UpdateEightGua() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) string key = "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/EXP_RING/CoreC"; if (cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value)) { if (AssetLoader.cacheUISprites.TryGetValue("CoreC", out Sprite value2)) { value.sprite = value2; } if (AssetLoader.CoreCColor.HasValue) { value.color = AssetLoader.CoreCColor.Value; } } string key2 = "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftTop/EXP_RING/CoreD"; if (cachedSpriteRenderers.TryGetValue(key2, out SpriteRenderer value3)) { if (AssetLoader.cacheUISprites.TryGetValue("CoreD", out Sprite value4)) { value3.sprite = value4; } if (AssetLoader.CoreDColor.HasValue) { value3.color = AssetLoader.CoreDColor.Value; } } } private void UpdateArrowLine() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) string key = "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftDown/Bow UI Area/RageUI renderer/ArrowLineB (1)"; if (cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value)) { if (AssetLoader.cacheUISprites.TryGetValue("ArrowLineA", out Sprite value2)) { value.sprite = value2; } if (AssetLoader.ArrowLineBColor.HasValue) { value.color = AssetLoader.ArrowLineBColor.Value; } } } private void UpdateRightLine() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) string key = "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/RightDown/Butterfly_UIHintPanel/LineA"; if (cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value)) { if (AssetLoader.cacheUISprites.TryGetValue("ButterflyRightLine", out Sprite value2)) { value.sprite = value2; } if (AssetLoader.ButterflyRightLineColor.HasValue) { value.color = AssetLoader.ButterflyRightLineColor.Value; } } } private void AirParryColor() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) string key = "GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/PlayerSprite/AbilityChecker/Ability 識破/Effect_TAICHIParry_Air/YeeParryBlink/BlinkLight"; if (AssetLoader.AirParryColor.HasValue && cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value) && AssetLoader.AirParryColor.HasValue) { value.color = AssetLoader.AirParryColor.Value; } } private void UCParryColor() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) string key = "GameCore(Clone)/RCG LifeCycle/PPlayer/RotateProxy/SpriteHolder/PlayerSprite/Effect_TAICHIParry/YeeParryBlink/BlinkLight"; if (AssetLoader.UCParryColor.HasValue && cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value) && AssetLoader.UCParryColor.HasValue) { value.color = AssetLoader.UCParryColor.Value; } } private void UpdateArrowBullet() { Sprite value; Sprite val = (AssetLoader.cacheUISprites.TryGetValue("BlockOutline", out value) ? value : null); Sprite value2; Sprite val2 = (AssetLoader.cacheUISprites.TryGetValue("Block", out value2) ? value2 : null); if ((Object)(object)val == (Object)null && (Object)(object)val2 == (Object)null) { return; } for (int i = 0; i <= 7; i++) { string obj = ((i == 0) ? "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftDown/Bow UI Area/RageUI renderer/slots/RagePart_spr" : string.Format("{0}RagePart_spr ({1})", "GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/HideUIAbilityCheck/[Activate] PlayerUI Folder/PlayerInGameUI renderer/LeftDown/Bow UI Area/RageUI renderer/slots/", i)); string key = obj + "/RageBar Frame"; string key2 = obj + "/RageBar"; if (cachedSpriteRenderers.TryGetValue(key, out SpriteRenderer value3)) { value3.sprite = val; } if (cachedSpriteRenderers.TryGetValue(key2, out SpriteRenderer value4)) { value4.sprite = val2; } } } private void Reload() { _cachedUCSuccess = null; _cachedUCCharging = null; _cachedTalismanBalls.Clear(); _talismanSearched = false; _spriteMappingCache.Clear(); InitializeAssets(); ChangeMenuLogo(); ChangeUIChiBall(); ImPerfectParry(); HitSpark(); SwordOnce(); InitializeBowSprites(); UpdateExpRing(); UpdateHpBar(); UpdatePotion(); UpdateLineA(); UpdateEightGua(); UpdateArrowLine(); UpdateRightLine(); UpdateArrowBullet(); FooColorOnce(); } private void OnDestroy() { harmony.UnpatchSelf(); } } internal static class Log { private static ManualLogSource? logSource; internal static void Init(ManualLogSource logSource) { Log.logSource = logSource; } internal static void Debug(object data) { ManualLogSource? obj = logSource; if (obj != null) { obj.LogDebug(data); } } internal static void Error(object data) { ManualLogSource? obj = logSource; if (obj != null) { obj.LogError(data); } } internal static void Fatal(object data) { ManualLogSource? obj = logSource; if (obj != null) { obj.LogFatal(data); } } internal static void Info(object data) { ManualLogSource? obj = logSource; if (obj != null) { obj.LogInfo(data); } } internal static void Message(object data) { ManualLogSource? obj = logSource; if (obj != null) { obj.LogMessage(data); } } internal static void Warning(object data) { ManualLogSource? obj = logSource; if (obj != null) { obj.LogWarning(data); } } } public class MainConfig { public ColorConfig Colors { get; set; } = new ColorConfig(); public ParryConfig Parry { get; set; } = new ParryConfig(); public BowConfig Bow { get; set; } = new BowConfig(); } public class ColorConfig { public string NormalHpColor { get; set; } = string.Empty; public string InternalHpColor { get; set; } = string.Empty; public string ExpRingOuterColor { get; set; } = string.Empty; public string ExpRingInnerColor { get; set; } = string.Empty; public string RageBarColor { get; set; } = string.Empty; public string RageBarFrameColor { get; set; } = string.Empty; public string ArrowLineBColor { get; set; } = string.Empty; public string ArrowGlowColor { get; set; } = string.Empty; public string ChiBallLeftLineColor { get; set; } = string.Empty; public string ButterflyRightLineColor { get; set; } = string.Empty; public string CoreCColor { get; set; } = string.Empty; public string CoreDColor { get; set; } = string.Empty; public string DashColor { get; set; } = string.Empty; public string PerfectParryColor { get; set; } = string.Empty; public string ImperfectParryColor { get; set; } = string.Empty; public string SwordCharingCirlceColor { get; set; } = string.Empty; public string SwordCharingAbsorbColor { get; set; } = string.Empty; public string SwordCharingGlowColor { get; set; } = string.Empty; public string ParticlesFooColor { get; set; } = string.Empty; public string FooLightColor { get; set; } = string.Empty; public string DrawFooBallColor1 { get; set; } = string.Empty; public string DrawFooBallColor2 { get; set; } = string.Empty; public string DrawFooBallColor3 { get; set; } = string.Empty; public string DrawFooBallColor4 { get; set; } = string.Empty; public string DrawFooBallColor5 { get; set; } = string.Empty; public string DrawFooLightColor { get; set; } = string.Empty; public string DrawFooBottomLightColor { get; set; } = string.Empty; public string HitSparkColor { get; set; } = string.Empty; } public class ParryConfig { public string UCCharging1Color { get; set; } = string.Empty; public string UCCharging2Color { get; set; } = string.Empty; public string UCSuccess1Color { get; set; } = string.Empty; public string UCSuccess2Color { get; set; } = string.Empty; public string AirParryColor { get; set; } = string.Empty; public string UCParryColor { get; set; } = string.Empty; } public class BowConfig { public float[] NormalArrowLv1 { get; set; } = new float[3]; public float[] NormalArrowLv2 { get; set; } = new float[3]; public float[] NormalArrowLv3 { get; set; } = new float[3]; } [HarmonyPatch] public class Patches { private static Dictionary instanceAtlasMapping = new Dictionary(); [HarmonyPatch(typeof(PlayerArrowProjectileFollower), "Update")] [HarmonyPrefix] private static bool HookArrow(PlayerArrowProjectileFollower __instance) { if (AssetLoader.cacheBowSprites == null || AssetLoader.cacheBowSprites.Count == 0) { return true; } string[] array = new string[3] { "Projectile FSM/FSM Animator/View/ChasingArrow /ChasingArrowLight", "Projectile FSM/FSM Animator/View/ChasingArrow /Parent 刺/刺/刺", "Projectile FSM/FSM Animator/View/ChasingArrow /Parent 刺/刺 (1)/刺" }; foreach (string text in array) { Transform obj = ((Component)__instance).transform.Find(text); SpriteRenderer val = ((obj != null) ? ((Component)obj).GetComponent() : null); if ((Object)(object)val != (Object)null && AssetLoader.cacheBowSprites.TryGetValue(((Object)val.sprite).name, out Sprite value)) { val.sprite = value; } } return true; } [HarmonyPatch(typeof(PoolManager), "Borrow", new Type[] { typeof(PoolObject), typeof(Vector3), typeof(Quaternion), typeof(Transform), typeof(Action) })] [HarmonyPostfix] public static void Postfix(ref PoolObject __result, PoolObject prefab, Vector3 position, Quaternion rotation, Transform parent = null, Action handler = null) { if (!CustomSols.arrowInit || !CustomSols.arrowInit2) { if (((Object)prefab).name == "ExplodingArrow Shooter 爆破發射器 Lv3") { GameObject gameObject = ((Component)__result).gameObject; CustomSols.UpdateBowSprite(gameObject, "Exploding Arrow/ExplodingArrow/ExplodingArrow"); CustomSols.UpdateBowSprite(gameObject, "Exploding Arrow/ExplodingArrow/ChasingArrowLight"); CustomSols.UpdateBowSprite(gameObject, "Exploding Arrow/EnergyBall/Core"); CustomSols.arrowInit = true; } if (((Object)prefab).name == "Explosion Damage 爆破箭 閃電 lv3") { CustomSols.UpdateBowSprite(((Component)__result).gameObject, "ATTACK/Core"); CustomSols.arrowInit2 = true; } } } [HarmonyPostfix] [HarmonyPatch(typeof(Player), "SetPlayerView")] private static void CatchCutsceneDummy(bool active) { if (!active) { if ((Object)(object)Player.i == (Object)null || (Object)(object)Player.i.replacePlayer == (Object)null) { return; } SpriteRenderer componentInChildren = ((Component)((Component)Player.i.replacePlayer).transform.parent).GetComponentInChildren(true); if (Object.op_Implicit((Object)(object)componentInChildren)) { if (!CustomSols.DummyRenderers.Contains(componentInChildren)) { CustomSols.DummyRenderers.Add(componentInChildren); } CustomSols.CurrentDummyRenderer = componentInChildren; } } else { CustomSols.CurrentDummyRenderer = null; } } private static void AddToDummyList(SpriteRenderer renderer) { if ((Object)(object)renderer != (Object)null && !CustomSols.DummyRenderers.Contains(renderer)) { CustomSols.DummyRenderers.Add(renderer); } } [HarmonyPostfix] [HarmonyPatch(typeof(_2dxFX_Twist), "OnEnable")] private static void CatchRootDummy(_2dxFX_Twist __instance) { AddToDummyList(((Component)((Component)__instance).transform).GetComponentInChildren(true)); } [HarmonyPostfix] [HarmonyPatch(typeof(ScaleFollowByPlayerFacing), "OnEnable")] private static void CatchElevatorDummy(ScaleFollowByPlayerFacing __instance) { AddToDummyList(((Component)((Component)__instance).transform).GetComponentInChildren(true)); } [HarmonyPostfix] [HarmonyPatch(typeof(_2dxFX_NewTeleportation2), "OnEnable")] private static void CatchLevelUpDummy(_2dxFX_NewTeleportation2 __instance) { AddToDummyList(((Component)((Component)__instance).transform).GetComponentInChildren(true)); } [HarmonyPostfix] [HarmonyPatch(typeof(_2dxFX_GoldFX), "OnEnable")] private static void CatchHealDummy(_2dxFX_GoldFX __instance) { SpriteRenderer[] componentsInChildren = ((Component)((Component)__instance).transform.parent).GetComponentsInChildren(true); if (componentsInChildren == null || componentsInChildren.Length == 0) { return; } SpriteRenderer[] array = componentsInChildren; foreach (SpriteRenderer item in array) { if (!CustomSols.DummyRenderers.Contains(item)) { CustomSols.DummyRenderers.Add(item); } } } [HarmonyPostfix] [HarmonyPatch(typeof(_2dxFX_ColorRGB), "OnEnable")] private static void CatchSprite(_2dxFX_ColorRGB __instance) { if ((Object)(object)__instance == (Object)null) { return; } SpriteRenderer[] componentsInChildren = ((Component)(((Object)(object)((Component)__instance).transform.parent != (Object)null) ? ((Component)__instance).transform.parent : ((Component)__instance).transform)).GetComponentsInChildren(true); if (componentsInChildren == null || componentsInChildren.Length == 0) { return; } if (CustomSols.DummyRenderers == null) { CustomSols.DummyRenderers = new List(); } SpriteRenderer[] array = componentsInChildren; foreach (SpriteRenderer item in array) { if (!CustomSols.DummyRenderers.Contains(item)) { CustomSols.DummyRenderers.Add(item); } } } [HarmonyPostfix] [HarmonyPatch(typeof(DialogueCharacter), "OnEnable")] private static void DialogueCharacter_OnEnable_Patch(DialogueCharacter __instance) { string name = ((Object)__instance).name; string text = ""; if (name.Contains("_")) { text = name.Split('_')[1].Split(' ', '(')[0]; } if (CustomSols.instance.isToastDialogue.Value) { ToastManager.Toast((object)text); } if (!string.IsNullOrEmpty(text)) { Texture2D atlas = AssetLoader.GetAtlas("Portrait_" + text); if ((Object)(object)atlas != (Object)null) { ApplyAtlasToRoot(((Component)__instance).gameObject, atlas, resetUV: false); } } } private static void ApplyAtlasToRoot(GameObject root, Texture2D atlas, bool resetUV) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) SpriteRenderer[] componentsInChildren = root.GetComponentsInChildren(true); MaterialPropertyBlock val = new MaterialPropertyBlock(); SpriteRenderer[] array = componentsInChildren; foreach (SpriteRenderer obj in array) { ((Renderer)obj).GetPropertyBlock(val); val.SetTexture("_MainTex", (Texture)(object)atlas); val.SetTexture("_Texture", (Texture)(object)atlas); if (resetUV) { val.SetVector("_MainTex_ST", new Vector4(1f, 1f, 0f, 0f)); } ((Renderer)obj).SetPropertyBlock(val); } } [HarmonyPostfix] [HarmonyPatch(typeof(DialogueAnswerManager), "DisplayAnswers")] private static void DialogueAnswerManager_DisplayAnswers_Patch(DialogueAnswerManager __instance) { try { GameObject val = GameObject.Find("GameCore(Clone)/RCG LifeCycle/UIManager/GameplayUICamera/Always Canvas/DialoguePlayer(KeepThisEnable)/UIControlGroup_AnswerPanels/AnswerPanel(Manga)/PlayerFrame/Portrait_Yi"); if (!((Object)(object)val == (Object)null)) { Texture2D atlas = AssetLoader.GetAtlas("Portrait_Yee"); if ((Object)(object)atlas != (Object)null) { ApplyAtlasToRoot(val, atlas, resetUV: true); } } } catch (Exception ex) { Debug.LogError((object)("Yi 替換出錯: " + ex.Message)); } } [HarmonyPostfix] [HarmonyPatch(typeof(PhoneCharacter), "Update")] private static void PhoneCharacter_Update_Patch(PhoneCharacter __instance) { int instanceID = ((Object)__instance).GetInstanceID(); if (!instanceAtlasMapping.TryGetValue(instanceID, out Texture2D value)) { string name = ((Object)__instance).name; string text = ""; if (name.Contains("_")) { text = name.Split('_')[1].Split(' ', '(')[0]; } if (!string.IsNullOrEmpty(text) && !AssetLoader.cacheAtlasTextures.TryGetValue(text, out value)) { value = AssetLoader.GetAtlas("Portrait_" + text); AssetLoader.cacheAtlasTextures[text] = value; } instanceAtlasMapping[instanceID] = value; } if ((Object)(object)value != (Object)null) { ApplyAtlasToRoot(((Component)__instance).gameObject, value, resetUV: false); } } [HarmonyPostfix] [HarmonyPatch(typeof(PhoneCharacter), "EnterLevelReset")] private static void PhoneCharacter_EnterLevelReset_Patch(PhoneCharacter __instance) { if (CustomSols.instance.isToastDialogue.Value) { string name = ((Object)__instance).name; string text = ""; if (name.Contains("_")) { text = name.Split('_')[1].Split(' ', '(')[0]; } if (!string.IsNullOrEmpty(text)) { ToastManager.Toast((object)text); } } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "CustomSols"; public const string PLUGIN_NAME = "CustomSols"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }