Decompiled source of HolyRepoSkillsFix v1.1.9
BepInEx/plugins/JP_RepoHolySkills.dll
Decompiled an hour ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; 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 BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using JP_RepoHolySkills.GlobalMananger; using JP_RepoHolySkills.MapToolControllerCustoms; using JP_RepoHolySkills.Patches; using JP_RepoHolySkills.Player; using JP_RepoHolySkills.SkillSelector; using JP_RepoHolySkills.Skills; using Photon.Pun; using TMPro; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyCompany("JP_RepoHolySkills")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.1.5.0")] [assembly: AssemblyInformationalVersion("1.1.5+d82aedec3bc0197f0984a3f480680a6d8b234fe7")] [assembly: AssemblyProduct("RepoHolySkills")] [assembly: AssemblyTitle("JP_RepoHolySkills")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.5.0")] [module: UnverifiableCode] public static class ClassModConstants { public const string HOLY_AURA_ASSET = "HolyAura"; public const string HOLY_AURA_BUFF_ASSET = "HolyAuraBuff"; public const string HOLY_AURA_ICON_ASSET = "HolyAuraIcon"; public const string HOLY_AURA_SFX_ASSET = "HolyAuraSFX"; public const string HEAL_SKILL = "HealSkill"; public const string HEAL_SKILL_ICON = "HealSkillIcon"; public const string HEAL_SKILL_SFX = "HealSkillSFX"; public const string HEAL_REVIVE_SKILL = "HealReviveSkill"; public const string HEAL_REVIVE_SKILL_SFX = "HealReviveSkillSFX"; public const string HOLY_WALL = "HolyWall"; public const string HOLY_WALL_SFX = "HolyWallSFX"; public const string HOLY_WALL_ICON = "HolyWallIcon"; public const string SELECT_SKILL_UI = "SelectSkillUI"; public const int HAUL_TIER_INCREMENT = 500000; public const int PLAYER_LAYER = 11; public static readonly string[] HOLY_WAR_CRIES = new string[5] { "For the Emperor!", "Glory to His name!", "Burn the heretics!", "The Emperor wills it!", "Purge in His light!" }; public static readonly string[] HEAL_WAR_CRIES = new string[6] { "The Emperor restores us!", "His will strengthens us!", "Rise by His grace!", "No wound shall stop us!", "His mercy heals you!", "The Emperor protects!" }; public static readonly string[] HOLY_WALL_WAR_CRIES = new string[10] { "The Emperor’s shield holds!", "His light is our wall!", "None shall pass!", "Stand firm in His name!", "The righteous endure!", "Faith is our fortress!", "His will is our shield!", "This ground is sacred!", "Let them break upon us!", "The Emperor defends!" }; public static readonly string HolyAuraDescription = "Grants <b><color=#00FF00>+40% movement speed</color></b> and <b><color=#00FF00>2% stamina regen/sec</color></b> based on the caster’s max stamina to all players within range.\r\nRegen increases by <b><color=#00FF00>+2%</color></b> for each nearby player.\r\n<b>Duration:</b> <b><color=#FFD700>4 seconds</color></b>\r\n<b>Cooldown:</b> <b><color=#FF5555>90 seconds</color></b>"; public static readonly string HealDescription = "Restores <b><color=#00FF00>10 HP</color></b> to all nearby allies and grants <b><color=#00FF00>2% HP regen/sec</color></b> based on the caster’s max health.\r\nRegen increases by <b><color=#00FF00>+3%</color></b> for each nearby player.\r\n<b>Duration:</b> <b><color=#FFD700>3 seconds</color></b>\r\n<b>Cooldown:</b> <b><color=#FF5555>3 minutes</color></b>"; public static readonly string HolyWallDescription = "Summons a <b><color=#00FF00>holy barrier</color></b> that blocks movement.\r\n<b>Duration:</b> <b><color=#FFD700>3 seconds</color></b>\r\n<b>Cooldown:</b> <b><color=#FF5555>90 seconds</color></b>"; public static readonly string[] HolyAuraTierDescriptions = new string[4] { "<b><color=#FFFFFF>Cast radius <color=#00FF00>doubled</color></color></b>\r\n<size=80%><b><color=#00FFFF>Requires 500,000 total haul extracted</color></b></size>", "<b><color=#FFFFFF>Stamina regen increased from <color=#00FF00>2%</color> to <color=#00FF00>4%</color></color></b>\r\n<size=80%><b><color=#00FFFF>Requires 1,000,000 total haul extracted</color></b></size>", "<b><color=#FFFFFF>Sprint duration increased from <color=#00FF00>4</color> to <color=#00FF00>8</color> seconds</color></b>\r\n<size=80%><b><color=#00FFFF>Requires 1,500,000 total haul extracted</color></b></size>", "<b><color=#FFFFFF>Regen duration increased from <color=#00FF00>4</color> to <color=#00FF00>8</color> seconds</color></b>\r\n<size=80%><b><color=#00FFFF>Requires 2,000,000 total haul extracted</color></b></size>" }; public static readonly string[] HealSkillTierDescriptions = new string[5] { "<b><color=#FFFFFF>Base heal increased from <color=#00FF00>10</color> to <color=#00FF00>20</color></color></b>\r\n<size=80%><b><color=#00FFFF>Requires 500,000 total haul extracted</color></b></size>", "<b><color=#FFFFFF>Healing radius <color=#00FF00>doubled</color></color></b>\r\n<size=80%><b><color=#00FFFF>Requires 1,000,000 total haul extracted</color></b></size>", "<b><color=#FFFFFF>Heal regen increased from <color=#00FF00>2%</color> to <color=#00FF00>4%</color></color></b>\r\n<size=80%><b><color=#00FFFF>Requires 1,500,000 total haul extracted</color></b></size>", "<b><color=#FFFFFF>Regen duration increased from <color=#00FF00>3</color> to <color=#00FF00>6</color> seconds</color></b>\r\n<size=80%><b><color=#00FFFF>Requires 2,000,000 total haul extracted</color></b></size>", "<b><color=#FFFFFF><color=#00FF00>Can revive</color> all nearby allies once per game</color></b>\r\n<size=80%><b><color=#00FFFF>Requires 2,500,000 total haul extracted</color></b></size>" }; public static readonly string[] HolyWallSkillTierDescriptions = new string[4] { "<b><color=#FFFFFF>Wall size increased by <color=#00FF00>2x</color></color></b>\r\n<size=80%><b><color=#00FFFF>Requires 500,000 total haul extracted</color></b></size>", "<b><color=#FFFFFF>Duration increased from <color=#00FF00>3</color> to <color=#00FF00>6</color> seconds</color></b>\r\n<size=80%><b><color=#00FFFF>Requires 1,000,000 total haul extracted</color></b></size>", "<b><color=#FFFFFF><color=#00FF00>20%</color> chance to spawn a stun grenade</color></b>\r\n<size=80%><b><color=#00FFFF>Requires 1,500,000 total haul extracted</color></b></size>", "<b><color=#FFFFFF><color=#00FF00>20%</color> chance to spawn a stun mine</color></b>\r\n<size=80%><b><color=#00FFFF>Requires 2,000,000 total haul extracted</color></b></size>" }; } namespace JP_RepoHolySkills { public class CombinedPrefabPool : IPunPrefabPool { private IPunPrefabPool basePool; private Dictionary<string, GameObject> moddedPrefabs = new Dictionary<string, GameObject>(); public CombinedPrefabPool(IPunPrefabPool basePool) { this.basePool = basePool; } public void AddModdedPrefab(string key, GameObject prefab) { if (!moddedPrefabs.ContainsKey(key)) { if ((Object)(object)prefab != (Object)null && (Object)(object)prefab.GetComponentInChildren<PhotonView>() == (Object)null) { Plugin.Logger.LogInfo((object)("CombinedPrefabPool: Prefab '" + key + "' missing PhotonView. Adding it now.")); prefab.AddComponent<PhotonView>(); } moddedPrefabs.Add(key, prefab); Plugin.Logger.LogInfo((object)("CombinedPrefabPool: Prefab '" + key + "' added to modded pool.")); } } public Dictionary<string, GameObject> GetModdedPrefabs() { return moddedPrefabs; } public GameObject Instantiate(string prefabId, Vector3 position, Quaternion rotation) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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) Plugin.Logger.LogInfo((object)("CombinedPrefabPool: Instantiate called for '" + prefabId + "'.")); if (moddedPrefabs.TryGetValue(prefabId, out var value)) { Plugin.Logger.LogInfo((object)("CombinedPrefabPool: Found modded prefab for '" + prefabId + "'. Instantiating...")); GameObject obj = Object.Instantiate<GameObject>(value, position, rotation); obj.SetActive(false); return obj; } Plugin.Logger.LogInfo((object)("CombinedPrefabPool: '" + prefabId + "' not found in modded prefabs. Delegating to base pool.")); return basePool.Instantiate(prefabId, position, rotation); } public void Destroy(GameObject gameObject) { basePool.Destroy(gameObject); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "JP_RepoHolySkills"; public const string PLUGIN_NAME = "RepoHolySkills"; public const string PLUGIN_VERSION = "1.1.5"; } [BepInPlugin("JP_RepoHolySkills", "RepoHolySkills", "1.1.8")] public class Plugin : BaseUnityPlugin { public const string VERSION = "v1.1.8"; private readonly Harmony harmony = new Harmony("JP_RepoHolySkills"); public static Plugin Instance; public static ManualLogSource Logger; public static Dictionary<string, GameObject> AssetManager; public static ConfigEntry<KeyboardShortcut> SkillPageHotkey; public static ConfigEntry<KeyboardShortcut> ActivateSkillHotkey; public ConfigEntry<string> holyWarCriesConfig; public ConfigEntry<string> healWarCriesConfig; public ConfigEntry<string> holyWallWarCriesConfig; public ConfigEntry<bool> enableWarCriesConfig; public GameObject stunGrenadePrefab; public GameObject shockwaveGrenadePrefab; public bool isInDebugMode; private void Awake() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown Logger = ((BaseUnityPlugin)this).Logger; Logger.LogInfo((object)"!!! RepoHolySkills VERSION v1.1.8 IS LOADING !!!"); Logger.LogInfo((object)"Plugin JP_RepoHolySkills is loaded!"); if ((Object)Instance == (Object)null) { Instance = this; Logger.LogInfo((object)"Plugin: Instance set successfully."); } else { Logger.LogWarning((object)"Plugin: Multiple Plugin instances detected."); } SetupUserConfig(); string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); Logger.LogInfo((object)("Plugin: DLL directory is " + directoryName)); string text = Path.Combine(directoryName, "jp_repoholyskillsprefabs"); AssetBundle val = AssetBundle.LoadFromFile(text); AssetManager = new Dictionary<string, GameObject>(); if ((Object)val == (Object)null) { Logger.LogError((object)("Plugin: Unable to load asset bundle from " + text)); } else { Logger.LogInfo((object)"Plugin: Asset bundle loaded successfully."); } if ((Object)(object)val != (Object)null) { GameObject value = LoadAssetFromAssetBundleAndLogInfo<GameObject>(val, "HolyAura"); GameObject value2 = LoadAssetFromAssetBundleAndLogInfo<GameObject>(val, "HolyAuraBuff"); GameObject value3 = LoadAssetFromAssetBundleAndLogInfo<GameObject>(val, "HolyAuraIcon"); GameObject value4 = LoadAssetFromAssetBundleAndLogInfo<GameObject>(val, "HolyAuraSFX"); GameObject value5 = LoadAssetFromAssetBundleAndLogInfo<GameObject>(val, "HealSkillIcon"); GameObject value6 = LoadAssetFromAssetBundleAndLogInfo<GameObject>(val, "HealSkillSFX"); GameObject value7 = LoadAssetFromAssetBundleAndLogInfo<GameObject>(val, "HealSkill"); GameObject value8 = LoadAssetFromAssetBundleAndLogInfo<GameObject>(val, "HealReviveSkill"); GameObject value9 = LoadAssetFromAssetBundleAndLogInfo<GameObject>(val, "HealReviveSkillSFX"); GameObject value10 = LoadAssetFromAssetBundleAndLogInfo<GameObject>(val, "HolyWall"); GameObject value11 = LoadAssetFromAssetBundleAndLogInfo<GameObject>(val, "HolyWallSFX"); GameObject value12 = LoadAssetFromAssetBundleAndLogInfo<GameObject>(val, "HolyWallIcon"); GameObject value13 = LoadAssetFromAssetBundleAndLogInfo<GameObject>(val, "SelectSkillUI"); AssetManager.Add("HolyAura", value); AssetManager.Add("HolyAuraBuff", value2); AssetManager.Add("HolyAuraIcon", value3); AssetManager.Add("HolyAuraSFX", value4); AssetManager.Add("HealSkill", value7); AssetManager.Add("HealSkillIcon", value5); AssetManager.Add("HealSkillSFX", value6); AssetManager.Add("HealReviveSkill", value8); AssetManager.Add("HealReviveSkillSFX", value9); AssetManager.Add("HolyWall", value10); AssetManager.Add("HolyWallIcon", value12); AssetManager.Add("HolyWallSFX", value11); AssetManager.Add("SelectSkillUI", value13); Logger.LogInfo((object)"Plugin: AssetManager populated successfully."); } else { Logger.LogError((object)"Plugin: AssetManager NOT populated because AssetBundle is null."); } harmony.PatchAll(typeof(PlayerControllerPatch)); harmony.PatchAll(typeof(MapToolControllerPatch)); harmony.PatchAll(typeof(ExtractionPointPatch)); harmony.PatchAll(typeof(PlayerAvatarPatch)); harmony.PatchAll(typeof(GameManagerPatch)); Logger.LogInfo((object)"Plugin: All Harmony patches applied successfully."); Logger.LogInfo((object)"Plugin: Awake completed."); } private void SetupUserConfig() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) SkillPageHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keybinds", "OpenSkillSelectionPage", new KeyboardShortcut((KeyCode)112, Array.Empty<KeyCode>()), "The key used to open the skill selection page. Use Unity KeyCode names: https://docs.unity3d.com/ScriptReference/KeyCode.html"); Logger.LogInfo((object)$"Config: SkillPageHotkey bound to {SkillPageHotkey.Value}"); ActivateSkillHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keybinds", "ActivateSkill", new KeyboardShortcut((KeyCode)114, Array.Empty<KeyCode>()), "The key used to activate the currently selected skill. Use Unity KeyCode names: https://docs.unity3d.com/ScriptReference/KeyCode.html"); Logger.LogInfo((object)$"Config: ActivateSkillHotkey bound to {ActivateSkillHotkey.Value}"); enableWarCriesConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("WarCries", "EnableWarCries", true, "Set to false to disable war cries entirely."); Logger.LogInfo((object)$"Config: WarCries enabled = {enableWarCriesConfig.Value}"); holyWarCriesConfig = ((BaseUnityPlugin)this).Config.Bind<string>("WarCries", "HolyWarCries", JoinDefaultsWarcries(ClassModConstants.HOLY_WAR_CRIES), "List of war cries shouted when casting holy aura (comma-separated)"); Logger.LogInfo((object)("Config: Loaded HolyWarCries = [" + holyWarCriesConfig.Value + "]")); healWarCriesConfig = ((BaseUnityPlugin)this).Config.Bind<string>("WarCries", "HealWarCries", JoinDefaultsWarcries(ClassModConstants.HEAL_WAR_CRIES), "List of war cries shouted when casting healing (comma-separated)"); Logger.LogInfo((object)("Config: Loaded HealWarCries = [" + healWarCriesConfig.Value + "]")); holyWallWarCriesConfig = ((BaseUnityPlugin)this).Config.Bind<string>("WarCries", "HolyWallWarCries", JoinDefaultsWarcries(ClassModConstants.HOLY_WALL_WAR_CRIES), "List of war cries shouted when casting holy wall (comma-separated)"); Logger.LogInfo((object)("Config: Loaded HolyWallWarCries = [" + holyWallWarCriesConfig.Value + "]")); } private static string JoinDefaultsWarcries(string[] array) { return string.Join(",", array); } private static void NetcodeWeaver() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); for (int i = 0; i < types.Length; i++) { MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } Logger.LogInfo((object)"Plugin: NetcodeWeaver executed."); } private T LoadAssetFromAssetBundleAndLogInfo<T>(AssetBundle bundle, string assetName) where T : Object { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown T val = bundle.LoadAsset<T>(assetName); if ((Object)val == (Object)null) { Logger.LogError((object)("Plugin: " + assetName + " asset failed to load.")); return val; } Logger.LogInfo((object)("Plugin: " + assetName + " asset successfully loaded.")); return val; } } public class TimedDestroyer : MonoBehaviourPun { public float lifeTime = 10f; private void Start() { ((MonoBehaviour)this).StartCoroutine(SelfDestruct()); } private IEnumerator SelfDestruct() { yield return (object)new WaitForSeconds(lifeTime); if (((MonoBehaviourPun)this).photonView.IsMine) { PhotonNetwork.Destroy(((Component)this).gameObject); } } } public class Utility { public static GameObject FindSkillTierContainer(int index) { return GameObject.Find($"SkillTier{index}Container"); } public static GameObject FindSkillTierDescription(int index) { return GameObject.Find($"SkillTier{index}Description"); } public static void SetSkillTierContainerColor(int index, Color newColor) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) GameObject val = FindSkillTierContainer(index); if ((Object)val != (Object)null) { Image component = val.GetComponent<Image>(); if ((Object)component != (Object)null) { ((Graphic)component).color = newColor; } else { Debug.LogWarning((object)$"SkillTier{index}Container does not have an Image component."); } } else { Debug.LogWarning((object)$"SkillTier{index}Container not found in the scene."); } } public static void SetSkillTierContainerText(int index, string newText) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown GameObject val = FindSkillTierContainer(index); if ((Object)val != (Object)null) { TextMeshProUGUI component = val.GetComponent<TextMeshProUGUI>(); if ((Object)component != (Object)null) { ((TMP_Text)component).text = newText; } else { Debug.LogWarning((object)$"SkillTier{index}Container does not have a TextMeshProUGUI component."); } } else { Debug.LogWarning((object)$"SkillTier{index}Container not found in the scene."); } } public static string FormatTotalExtractedHaul(int haulAmount) { string text = haulAmount.ToString("N0"); return "<b><color=#FFFFFF>Total Extracted Haul:</color> <color=#00FFFF>" + text + "</color></b>"; } public static void UpdateTotalExtractedHaulText(int extractedHaul) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown GameObject val = GameObject.Find("SkillTotalHaulText"); if ((Object)val != (Object)null) { TextMeshProUGUI component = val.GetComponent<TextMeshProUGUI>(); if ((Object)component != (Object)null) { ((TMP_Text)component).text = FormatTotalExtractedHaul(extractedHaul); } } } public static void TriggerWarCry(ConfigEntry<bool> enableWarCries, ConfigEntry<string> warCriesConfig, string context, Color textColor, ChatManager chatManager) { //IL_00ca: Unknown result type (might be due to invalid IL or missing references) if (!enableWarCries.Value) { Plugin.Logger.LogInfo((object)(context + ": War cries are disabled via config. Skipping trigger.")); return; } string[] array = (from s in warCriesConfig.Value.Split(',') select s.Trim() into s where !string.IsNullOrEmpty(s) select s).ToArray(); if (array.Length == 0) { Plugin.Logger.LogWarning((object)(context + ": No war cries found in config. Aborting trigger.")); return; } int num = Random.Range(0, array.Length); string text = array[num]; Plugin.Logger.LogInfo((object)(context + ": Selected war cry: " + text)); chatManager.PossessChatScheduleStart(10); chatManager.PossessChat((PossessChatID)3, text, 1.5f, textColor, 0f, false, 0, (UnityEvent)null); chatManager.PossessChatScheduleEnd(); } } } namespace JP_RepoHolySkills.Skills { public class HealSkill : MonoBehaviour { public int baseHealAmount = 10; public float healRange = 4.5f; public float healthRegenPercentage = 0.02f; public float regenDuration = 3f; public GameObject healIconInstance; public Color healUICooldownStartColor = new Color(1f, 1f, 1f, 0f); public Color healUICooldownEndColor = Color.white; public Color healUIColor = new Color(0f, 1f, 0f, 1f); public float cooldownDuration = 180f; private PhotonView pv; private float nextHealTime; private bool isUIInitialized; private const string CANVAS_NAME = "Game Hud"; private const int UI_LAYER = 5; private static readonly Vector3 UI_SCALE = new Vector3(13f, 13f, 13f); private const float UI_VERTICAL_OFFSET = 40f; private const float SOUND_VOLUME = 0.2f; private const int BASE_HEAL_UPGRADE_THRESHOLD = 500000; private const int DOUBLE_HEAL_RADIUS_THRESHOLD = 1000000; private const int HEAL_REGEN_INCREASE_THRESHOLD = 1500000; private const int REGEN_DURATION_INCREASE_THRESHOLD = 2000000; private const int REVIVAL_THRESHOLD = 2500000; private void Start() { pv = ((Component)this).GetComponent<PhotonView>(); Plugin.Logger.LogInfo((object)"HealSkill: Started."); if (Plugin.Instance.isInDebugMode) { cooldownDuration = 1f; } } private void Update() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (ShouldProcessInput() && JPSkill_GlobalManager.Instance.selectedSkill == SelectableSkills.Heal) { SetupUIIfNeeded(); UpdateCooldownUI(); KeyboardShortcut value = Plugin.ActivateSkillHotkey.Value; if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey) && Time.time >= nextHealTime) { ActivateHealSkill(); } } } private void UpdateCooldownUI() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) if ((Object)healIconInstance == (Object)null) { return; } SpriteRenderer component = healIconInstance.GetComponent<SpriteRenderer>(); if (!((Object)component == (Object)null)) { if (Time.time < nextHealTime) { float num = cooldownDuration; float num2 = nextHealTime - Time.time; float num3 = 1f - num2 / num; component.color = Color.Lerp(healUICooldownStartColor, healUICooldownEndColor, num3); } else { component.color = healUIColor; } } } private bool ShouldProcessInput() { if (!SemiFunc.RunIsLevel() || !pv.IsMine) { return false; } if (IsChatActive()) { return false; } return true; } private bool IsChatActive() { FieldInfo field = typeof(ChatManager).GetField("chatActive", BindingFlags.Instance | BindingFlags.NonPublic); if (field == null) { return false; } return (bool)field.GetValue(ChatManager.instance); } private void SetupUIIfNeeded() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown if (JPSkill_GlobalManager.Instance.selectedSkill == SelectableSkills.Heal && (Object)healIconInstance == (Object)null) { Plugin.Logger.LogInfo((object)"HealSkill: Rendering Heal UI for selected Heal skill."); RenderHealUI(); } } private void ActivateHealSkill() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown Plugin.Logger.LogInfo((object)"HealSkill: Activated by local player."); nextHealTime = Time.time + cooldownDuration; Utility.TriggerWarCry(Plugin.Instance.enableWarCriesConfig, Plugin.Instance.healWarCriesConfig, "HealSkill", new Color(0.5f, 1f, 0.5f, 1f), ChatManager.instance); pv.RPC("PlayHealSkillSFX_RPC", (RpcTarget)0, new object[1] { ((Component)this).transform.position }); ComputeEffectiveValues(out var effectiveBaseHeal, out var effectiveHealRange, out var effectiveRegenPercentage, out var effectiveRegenDuration, out var allowRevival, out var healParticleScaleMultiplier); pv.RPC("PlayHealSkillParticles_RPC", (RpcTarget)0, new object[2] { ((Component)this).transform.position, healParticleScaleMultiplier }); Plugin.Logger.LogInfo((object)"HealSkill: SFX and particle effects triggered."); int num = CountAdditionalPlayers(effectiveHealRange); ProcessRevival(effectiveHealRange, allowRevival); float num2 = 1f + (float)num * 0.03f; Plugin.Logger.LogInfo((object)$"HealSkill: Healing multiplier is {num2} ({num} additional players in range)."); ProcessHealing(effectiveHealRange, effectiveBaseHeal, num2, effectiveRegenPercentage, effectiveRegenDuration); if ((Object)healIconInstance == (Object)null) { Plugin.Logger.LogWarning((object)"HealSkill: healIconInstance is null; UI feedback might be missing."); } } private void ComputeEffectiveValues(out int effectiveBaseHeal, out float effectiveHealRange, out float effectiveRegenPercentage, out float effectiveRegenDuration, out bool allowRevival, out float healParticleScaleMultiplier) { int savedExtractionHaul = JPSkill_GlobalManager.Instance.savedExtractionHaul; effectiveBaseHeal = ((savedExtractionHaul >= 500000) ? 20 : baseHealAmount); effectiveHealRange = ((savedExtractionHaul >= 1000000) ? (healRange * 2f) : healRange); effectiveRegenPercentage = ((savedExtractionHaul >= 1500000) ? 0.04f : healthRegenPercentage); effectiveRegenDuration = ((savedExtractionHaul >= 2000000) ? 6f : regenDuration); allowRevival = savedExtractionHaul >= 2500000; healParticleScaleMultiplier = ((savedExtractionHaul >= 1000000) ? 2f : 1f); } private int CountAdditionalPlayers(float effectiveHealRange) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0043: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) int num = 0; foreach (PlayerAvatar item in SemiFunc.PlayerGetAll()) { if (!((Object)item == (Object)null) && !((Object)((Component)item).gameObject == (Object)((Component)this).gameObject) && Vector3.Distance(((Component)this).transform.position, ((Component)item).transform.position) <= effectiveHealRange) { FieldInfo field = typeof(PlayerAvatar).GetField("deadSet", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null && !(bool)field.GetValue(item)) { num++; } } } return num; } private void ProcessRevival(float effectiveHealRange, bool allowRevival) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0055: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown if (!allowRevival) { Plugin.Logger.LogInfo((object)"HealSkill ProcessRevival: Resurrection not allowed at this extraction haul level."); return; } Plugin.Logger.LogInfo((object)$"HealSkill ProcessRevival: Starting search for dead players within range {effectiveHealRange}."); PlayerDeathHead[] array = Object.FindObjectsOfType<PlayerDeathHead>(); foreach (PlayerDeathHead val in array) { if ((Object)val == (Object)null) { continue; } float num = Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position); PlayerAvatar playerAvatar = val.playerAvatar; if (num <= effectiveHealRange && (Object)playerAvatar != (Object)null) { FieldInfo field = typeof(PlayerAvatar).GetField("deadSet", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null && (bool)field.GetValue(playerAvatar)) { Plugin.Logger.LogInfo((object)("HealSkill ProcessRevival: Requesting revive for '" + ((Object)playerAvatar).name + "' via MasterClient.")); pv.RPC("RequestRevivePlayer_RPC", (RpcTarget)2, new object[1] { playerAvatar.photonView.ViewID }); } } } } [PunRPC] public void RequestRevivePlayer_RPC(int targetViewID) { if (!PhotonNetwork.IsMasterClient) { return; } PhotonView val = PhotonView.Find(targetViewID); if ((Object)(object)val != (Object)null) { PlayerAvatar component = ((Component)val).GetComponent<PlayerAvatar>(); if ((Object)(object)component != (Object)null) { Plugin.Logger.LogInfo((object)("HealSkill Host: Reviving player '" + ((Object)component).name + "'. Ensuring GameObject is active.")); ((Component)component).gameObject.SetActive(true); component.Revive(false); pv.RPC("PlayHealReviveParticles_RPC", (RpcTarget)0, new object[1] { targetViewID }); pv.RPC("PlayHealReviveSFX_RPC", (RpcTarget)0, Array.Empty<object>()); } } } private void ProcessHealing(float effectiveHealRange, int effectiveBaseHeal, float healingMultiplier, float effectiveRegenPercentage, float effectiveRegenDuration) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown foreach (PlayerAvatar item in SemiFunc.PlayerGetAll()) { if ((Object)item == (Object)null) { Plugin.Logger.LogWarning((object)"HealSkill: Encountered a null player avatar. Skipping."); continue; } float num = Vector3.Distance(((Component)this).transform.position, ((Component)item).transform.position); Plugin.Logger.LogInfo((object)$"HealSkill: Checking '{((Object)item).name}' at distance {num:F2}."); if (num > effectiveHealRange) { Plugin.Logger.LogInfo((object)$"HealSkill: '{((Object)item).name}' is outside the effective heal range ({effectiveHealRange}). Skipping."); continue; } PlayerHealth component = ((Component)item).GetComponent<PlayerHealth>(); if ((Object)component == (Object)null) { Plugin.Logger.LogWarning((object)("HealSkill: '" + ((Object)item).name + "' has no PlayerHealth component. Skipping.")); continue; } Plugin.Logger.LogInfo((object)("HealSkill: Found PlayerHealth for '" + ((Object)item).name + "'.")); FieldInfo field = typeof(PlayerHealth).GetField("maxHealth", BindingFlags.Instance | BindingFlags.NonPublic); if (field == null) { Plugin.Logger.LogWarning((object)("HealSkill: 'maxHealth' field not found in PlayerHealth for '" + ((Object)item).name + "'. Skipping.")); continue; } int num2 = (int)field.GetValue(component); Plugin.Logger.LogInfo((object)$"HealSkill: '{((Object)item).name}' max health is {num2}."); PlayerControllerCustom component2 = ((Component)item).GetComponent<PlayerControllerCustom>(); if ((Object)component2 == (Object)null) { Plugin.Logger.LogWarning((object)("HealSkill: No PlayerControllerCustom component found on '" + ((Object)item).name + "'. Skipping.")); continue; } FieldInfo field2 = typeof(PlayerAvatar).GetField("deadSet", BindingFlags.Instance | BindingFlags.NonPublic); if (field2 == null) { Plugin.Logger.LogWarning((object)("HealSkill: 'deadSet' field not found in PlayerAvatar for '" + ((Object)item).name + "'. Skipping.")); } else if (!(bool)field2.GetValue(item)) { int num3 = (int)((float)effectiveBaseHeal * healingMultiplier); Plugin.Logger.LogInfo((object)$"HealSkill: Healing '{((Object)item).name}' with {num3} health (base: {effectiveBaseHeal}, multiplier: {healingMultiplier})."); component2.StartOwnerHealRPC(num3); int num4 = (int)((float)num2 * effectiveRegenPercentage); Plugin.Logger.LogInfo((object)$"HealSkill: Starting health regeneration for '{((Object)item).name}' with {num4} health over {effectiveRegenDuration} seconds."); component2.StartOwnerRPCHealthRegen(num4, effectiveRegenDuration); } } } [PunRPC] public void PlayHealReviveParticles_RPC(int targetViewID) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown PhotonView val = PhotonView.Find(targetViewID); if ((Object)val == (Object)null) { Plugin.Logger.LogWarning((object)"HealSkill: Could not find player for heal revive particles."); return; } GameObject gameObject = ((Component)val).gameObject; Vector3 position = gameObject.transform.position; if (Plugin.AssetManager.TryGetValue("HealReviveSkill", out var value)) { Plugin.Logger.LogInfo((object)$"HealSkill: Spawning revive particle effect at {position}."); GameObject val2 = Object.Instantiate<GameObject>(value, position, Quaternion.identity); Plugin.Logger.LogInfo((object)$"HealSkill: Revive particles spawned for '{((Object)gameObject).name}' at {val2.transform.position}."); val2.transform.SetParent(gameObject.transform, true); Object.Destroy((Object)val2, 5f); } else { Plugin.Logger.LogWarning((object)"HealSkill: HealReviveSkill particle asset not found!"); } } [PunRPC] public void PlayHealReviveSFX_RPC() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (Plugin.AssetManager.TryGetValue("HealReviveSkillSFX", out var value)) { AudioSource component = value.GetComponent<AudioSource>(); if ((Object)component != (Object)null) { component.volume = 0.2f; } Object.Instantiate<GameObject>(value, ((Component)this).transform.position, Quaternion.identity); Plugin.Logger.LogInfo((object)"HealSkill: Heal Revive Skill SFX played."); } else { Plugin.Logger.LogWarning((object)"HealSkill: HealReviveSkillSFX asset not found!"); } } [PunRPC] public void PlayHealSkillSFX_RPC(Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) PlayHealSkillSFX(position); } public void PlayHealSkillSFX(Vector3 position) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_004c: Unknown result type (might be due to invalid IL or missing references) if (Plugin.AssetManager.TryGetValue("HealSkillSFX", out var value)) { AudioSource component = value.GetComponent<AudioSource>(); if ((Object)component != (Object)null) { component.volume = 0.2f; } Object.Instantiate<GameObject>(value, position, Quaternion.identity); Plugin.Logger.LogInfo((object)("HealSkill: HealSkillSFX played at position " + ((object)position).ToString())); } else { Plugin.Logger.LogWarning((object)"HealSkill: HealSkillSFX asset not found!"); } } [PunRPC] public void PlayHealSkillParticles_RPC(Vector3 position, float scaleMultiplier) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) PlayHealSkillParticles(position, scaleMultiplier); } public void PlayHealSkillParticles(Vector3 position, float scaleMultiplier) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (Plugin.AssetManager.TryGetValue("HealSkill", out var value)) { Transform transform = Object.Instantiate<GameObject>(value, position, Quaternion.identity).transform; transform.localScale *= scaleMultiplier; Plugin.Logger.LogInfo((object)("HealSkill: HealSkillParticles played at position " + ((object)position).ToString() + " with scale multiplier " + scaleMultiplier)); } else { Plugin.Logger.LogWarning((object)"HealSkill: HealSkillParticles asset not found!"); } } public void RenderHealUI() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0047: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_0123: Unknown result type (might be due to invalid IL or missing references) if (Plugin.AssetManager.TryGetValue("HealSkillIcon", out var value)) { GameObject val = GameObject.Find("Game Hud"); if ((Object)val == (Object)null) { Plugin.Logger.LogWarning((object)"HealSkill: 'Game Hud' canvas not found!"); return; } healIconInstance = Object.Instantiate<GameObject>(value, ((Component)this).transform.position, Quaternion.identity); healIconInstance.layer = 5; healIconInstance.transform.localScale = UI_SCALE; healIconInstance.transform.SetParent(val.transform, false); Rect rect = val.GetComponent<RectTransform>().rect; float num = ((Rect)(ref rect)).height / 2f; healIconInstance.transform.localPosition = new Vector3(0f, 40f - num, 0f); ManualLogSource logger = Plugin.Logger; Vector3 localPosition = healIconInstance.transform.localPosition; logger.LogInfo((object)("HealSkill: Heal UI rendered on canvas at position " + ((object)localPosition).ToString())); SpriteRenderer component = healIconInstance.GetComponent<SpriteRenderer>(); if ((Object)component != (Object)null) { component.color = healUIColor; Plugin.Logger.LogInfo((object)"SpawnHolyWallUI: UI color set to wallUIColor."); } else { Plugin.Logger.LogWarning((object)"SpawnHolyWallUI: No SpriteRenderer found on Holy Wall UI prefab."); } } else { Plugin.Logger.LogWarning((object)"HealSkill: HealSkillIcon asset not found!"); } } } public class HolyAuraSkill : MonoBehaviour { public float sprintBoostMultiplier = 1.4f; public int auraFinalScaleValue = 8; public float auraExpansionTime = 0.3f; public float sprintBoostDuration = 4f; public float staminaRegenDuration = 4f; public float staminaRegenPercentage = 0.02f; public float auraCooldownDuration = 90f; public float baseAuraRange = 6.6f; public GameObject auraIconInstance; public Color auraUICooldownStartColor = new Color(1f, 1f, 1f, 0f); public Color auraUICooldownEndColor = Color.white; public Color auraUIColor = new Color(0f, 1f, 0f, 1f); private PhotonView pv; private const string CANVAS_NAME = "Game Hud"; private const int UI_LAYER = 5; private static readonly Vector3 UI_SCALE = new Vector3(13f, 13f, 13f); private const float UI_VERTICAL_OFFSET = 40f; private static readonly Vector3 BUFF_PARTICLES_OFFSET = new Vector3(0f, 1f, 0f); private const float SOUND_VOLUME = 0.2f; private bool isAuraOnCooldown; private float currentAuraCooldown; private bool hasUIBeenSetup; private void Start() { Plugin.Logger.LogInfo((object)"HolyAuraSkill Start: Initializing skill."); isAuraOnCooldown = false; pv = ((Component)this).GetComponent<PhotonView>(); if (Plugin.Instance.isInDebugMode) { auraCooldownDuration = 1f; } Plugin.Logger.LogInfo((object)"HolyAuraSkill Start: Initialization complete."); } private void Update() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (ShouldProcessInput() && JPSkill_GlobalManager.Instance.selectedSkill == SelectableSkills.HolyAura) { SetupUIIfNeeded(); KeyboardShortcut value = Plugin.ActivateSkillHotkey.Value; if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey) && !isAuraOnCooldown) { ActivateAuraSkill(); } } } private bool ShouldProcessInput() { if (!SemiFunc.RunIsLevel() || !pv.IsMine) { return false; } if (IsChatActive()) { return false; } return true; } private bool IsChatActive() { FieldInfo field = typeof(ChatManager).GetField("chatActive", BindingFlags.Instance | BindingFlags.NonPublic); if (field == null) { return false; } return (bool)field.GetValue(ChatManager.instance); } private void SetupUIIfNeeded() { if (JPSkill_GlobalManager.Instance.selectedSkill == SelectableSkills.HolyAura && !hasUIBeenSetup) { Plugin.Logger.LogInfo((object)"HolyAuraSkill Update: HolyAura skill selected; setting up UI."); SpawnAuraUI(); } } private void ActivateAuraSkill() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) Plugin.Logger.LogInfo((object)"HolyAuraSkill Update: R key pressed, activating Holy Aura skill."); isAuraOnCooldown = true; pv.RPC("ActivateAuraSFX_RPC", (RpcTarget)0, new object[1] { ((Component)this).transform.position }); ((MonoBehaviour)this).StartCoroutine(AuraCooldownCount()); Utility.TriggerWarCry(Plugin.Instance.enableWarCriesConfig, Plugin.Instance.holyWarCriesConfig, "HolyAura", new Color(1f, 0.85f, 0.45f, 1f), ChatManager.instance); float num = (((float)JPSkill_GlobalManager.Instance.savedExtractionHaul >= 500000f) ? 2f : 1f); pv.RPC("ExpandAura_RPC", (RpcTarget)0, new object[2] { ((Component)this).transform.position, num }); Plugin.Logger.LogInfo((object)("HolyAuraSkill Update: ExpandAura_RPC called with scale multiplier " + num + ".")); ApplyBuffsToPlayers(); } private void ApplyBuffsToPlayers() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_006c: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) float num = JPSkill_GlobalManager.Instance.savedExtractionHaul; float num2 = baseAuraRange; if (num >= 500000f) { num2 *= 2f; } int num3 = 0; List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); foreach (PlayerAvatar item in list) { if (!((Object)item == (Object)null) && !((Object)((Component)item).gameObject == (Object)((Component)this).gameObject) && Vector3.Distance(((Component)this).transform.position, ((Component)item).transform.position) <= num2) { FieldInfo field = typeof(PlayerAvatar).GetField("deadSet", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null && !(bool)field.GetValue(item)) { num3++; } } } float num4 = ((num >= 1000000f) ? 0.04f : 0.02f) + (float)num3 * 0.02f; float duration = ((num >= 1500000f) ? 8f : sprintBoostDuration); float duration2 = ((num >= 2000000f) ? 8f : staminaRegenDuration); Plugin.Logger.LogInfo((object)$"HolyAuraSkill: {num3} additional players in range; effective regen percentage is {num4 * 100f}%."); foreach (PlayerAvatar item2 in list) { if ((Object)item2 == (Object)null) { Plugin.Logger.LogWarning((object)"HolyAuraSkill: Encountered null player avatar. Skipping."); continue; } if (Vector3.Distance(((Component)this).transform.position, ((Component)item2).transform.position) > num2) { Plugin.Logger.LogInfo((object)$"HolyAuraSkill: '{((Object)item2).name}' is outside the effective aura range ({num2}). Skipping."); continue; } Plugin.Logger.LogInfo((object)("HolyAuraSkill: Applying buffs to '" + ((Object)item2).name + "'.")); PlayerControllerCustom component = ((Component)item2).GetComponent<PlayerControllerCustom>(); _ = ((Component)item2).GetComponent<PhotonView>().ViewID; component.StartOwnerRPCSprintBoost(sprintBoostMultiplier, duration); component.StartOwnerRPCRegenStamina(PlayerController.instance.EnergyStart * num4, duration2); } } public void SpawnAuraUI() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) Plugin.Logger.LogInfo((object)"SpawnAuraUI: Setting up Holy Aura UI."); hasUIBeenSetup = true; if (Plugin.AssetManager.TryGetValue("HolyAuraIcon", out var value)) { GameObject val = GameObject.Find("Game Hud"); if ((Object)val == (Object)null) { Plugin.Logger.LogWarning((object)"SpawnAuraUI: 'Game Hud' canvas not found!"); return; } auraIconInstance = Object.Instantiate<GameObject>(value, ((Component)this).transform.position, Quaternion.identity); auraIconInstance.layer = 5; auraIconInstance.transform.localScale = UI_SCALE; auraIconInstance.transform.SetParent(val.transform, false); Rect rect = val.GetComponent<RectTransform>().rect; float num = ((Rect)(ref rect)).height / 2f; auraIconInstance.transform.localPosition = new Vector3(0f, 40f - num, 0f); ManualLogSource logger = Plugin.Logger; Vector3 localPosition = auraIconInstance.transform.localPosition; logger.LogInfo((object)("SpawnAuraUI: Holy Aura UI added to canvas at position: " + ((object)localPosition).ToString())); if (!isAuraOnCooldown) { SpriteRenderer component = auraIconInstance.GetComponent<SpriteRenderer>(); if ((Object)component != (Object)null) { component.color = auraUIColor; Plugin.Logger.LogInfo((object)"SpawnAuraUI: UI color set to auraUIColor."); } else { Plugin.Logger.LogWarning((object)"SpawnAuraUI: No SpriteRenderer found on Holy Aura UI prefab."); } } } else { Plugin.Logger.LogWarning((object)"SpawnAuraUI: Holy Aura icon asset not found!"); } } private IEnumerator AuraCooldownCount() { Plugin.Logger.LogInfo((object)"AuraCooldownCount: Cooldown started."); currentAuraCooldown = 0f; SpriteRenderer auraSprite = auraIconInstance.GetComponent<SpriteRenderer>(); auraSprite.color = Color.white; while (currentAuraCooldown < auraCooldownDuration) { Color color = Color.Lerp(auraUICooldownStartColor, auraUICooldownEndColor, currentAuraCooldown / auraCooldownDuration); auraSprite.color = color; currentAuraCooldown += Time.deltaTime; yield return null; } auraSprite.color = auraUIColor; isAuraOnCooldown = false; Plugin.Logger.LogInfo((object)"AuraCooldownCount: Cooldown finished. UI color reset."); } [PunRPC] private void ActivateAuraSFX_RPC(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) Plugin.Logger.LogInfo((object)("ActivateAuraSFX_RPC: Called at position " + ((object)position).ToString())); ActivateAuraSFX(position); } private void ActivateAuraSFX(Vector3 position) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_004c: Unknown result type (might be due to invalid IL or missing references) if (Plugin.AssetManager.TryGetValue("HolyAuraSFX", out var value)) { AudioSource component = value.GetComponent<AudioSource>(); if ((Object)component != (Object)null) { component.volume = 0.2f; } Object.Instantiate<GameObject>(value, position, Quaternion.identity); Plugin.Logger.LogInfo((object)("ActivateAuraSFX: Sound effect instantiated at " + ((object)position).ToString())); } else { Plugin.Logger.LogWarning((object)"ActivateAuraSFX: Holy Aura SFX asset not found!"); } } [PunRPC] public void ExpandAura_RPC(Vector3 position, float scaleMultiplier) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) Plugin.Logger.LogInfo((object)("ExpandAura_RPC: Spawning Holy Aura effect at " + ((object)position).ToString() + " with scale multiplier " + scaleMultiplier)); if (Plugin.AssetManager.TryGetValue("HolyAura", out var value)) { ((MonoBehaviour)this).StartCoroutine(ExpandAuraEffect(value, position, scaleMultiplier)); } else { Plugin.Logger.LogWarning((object)"ExpandAura_RPC: Holy Aura asset not found!"); } } private IEnumerator ExpandAuraEffect(GameObject auraPrefab, Vector3 position, float scaleMultiplier) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Plugin.Logger.LogInfo((object)"ExpandAuraEffect: Instantiating Holy Aura effect."); GameObject spawnedAura = Object.Instantiate<GameObject>(auraPrefab, position, Quaternion.identity); float elapsed = 0f; Vector3 initialScale = Vector3.zero; Vector3 targetScale = new Vector3((float)auraFinalScaleValue, (float)auraFinalScaleValue, (float)auraFinalScaleValue) * scaleMultiplier; while (elapsed < auraExpansionTime) { spawnedAura.transform.localScale = Vector3.Lerp(initialScale, targetScale, elapsed / auraExpansionTime); elapsed += Time.deltaTime; yield return null; } spawnedAura.transform.localScale = targetScale; Plugin.Logger.LogInfo((object)("ExpandAuraEffect: Final scale set to " + ((object)targetScale).ToString())); ParticleSystem component = spawnedAura.GetComponent<ParticleSystem>(); float num; if (!((Object)component != (Object)null)) { num = 1.5f; } else { MainModule main = component.main; num = ((MainModule)(ref main)).duration + 1.5f; } float num2 = num; Plugin.Logger.LogInfo((object)("ExpandAuraEffect: Waiting " + num2 + " seconds before destroying the aura effect.")); yield return (object)new WaitForSeconds(num2); Plugin.Logger.LogInfo((object)"ExpandAuraEffect: Destroying Holy Aura effect."); if ((Object)spawnedAura != (Object)null) { Object.Destroy((Object)spawnedAura); } } [PunRPC] public void SpawnAuraBuffParticles_RPC(int avatarViewID) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) PhotonView val = PhotonView.Find(avatarViewID); if ((Object)val != (Object)null) { GameObject gameObject = ((Component)val).gameObject; if (Plugin.AssetManager.TryGetValue("HolyAuraBuff", out var value)) { Vector3 val2 = gameObject.transform.position + BUFF_PARTICLES_OFFSET; Quaternion identity = Quaternion.identity; Object.Instantiate<GameObject>(value, val2, identity); Object.Instantiate<GameObject>(value, val2, identity, gameObject.transform); Plugin.Logger.LogInfo((object)$"SpawnAuraBuffParticles_RPC: Buff particles spawned and attached to '{((Object)gameObject).name}' (ViewID: {avatarViewID})."); } else { Plugin.Logger.LogWarning((object)"SpawnAuraBuffParticles_RPC: Buff particles asset not found!"); } } else { Plugin.Logger.LogWarning((object)("SpawnAuraBuffParticles_RPC: Avatar with ViewID " + avatarViewID + " not found.")); } } } public class HolyWallSkill : MonoBehaviour { public PhotonView photonView; public float skillDuration = 3f; public float cooldownDuration = 180f; public GameObject holyWallIconInstance; public Color wallUICooldownStartColor = new Color(1f, 1f, 1f, 0f); public Color wallUICooldownEndColor = Color.white; public Color wallUIColor = new Color(0f, 1f, 0f, 1f); private const string CANVAS_NAME = "Game Hud"; private const int UI_LAYER = 5; private static readonly Vector3 UI_SCALE = new Vector3(13f, 13f, 13f); private const float UI_VERTICAL_OFFSET = 40f; private float nextWallTime; private bool wallUISetup; private const float GRENADE_SPAWN_CHANCE = 0.2f; private const float MINE_SPAWN_CHANCE = 0.2f; private const float FORWARD_OFFSET = 2f; private const float UP_OFFSET = 1f; private const float ADDITIONAL_SPAWN_DISTANCE = 1f; private const float EXTRACTION_THRESHOLD_SCALE = 500000f; private const float EXTRACTION_THRESHOLD_DURATION = 1000000f; private const float EXTRACTION_THRESHOLD_GRENADE = 1500000f; private const float EXTRACTION_THRESHOLD_MINE = 2000000f; private void Start() { Plugin.Logger.LogInfo((object)"HolyWallSkill: Initializing skill."); photonView = ((Component)this).GetComponent<PhotonView>(); nextWallTime = 0f; wallUISetup = false; if (Plugin.Instance.isInDebugMode) { cooldownDuration = 1f; } Plugin.Logger.LogInfo((object)"HolyWallSkill: Initialization complete."); } private void Update() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (!CanActivateSkill() || JPSkill_GlobalManager.Instance.selectedSkill != 0) { return; } SetupUIIfNeeded(); UpdateCooldownUI(); if (Time.time >= nextWallTime) { KeyboardShortcut value = Plugin.ActivateSkillHotkey.Value; if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey)) { ActivateHolyWallSkill(); } } } private void UpdateCooldownUI() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) if ((Object)holyWallIconInstance == (Object)null) { return; } SpriteRenderer component = holyWallIconInstance.GetComponent<SpriteRenderer>(); if (!((Object)component == (Object)null)) { if (Time.time < nextWallTime) { float num = cooldownDuration; float num2 = nextWallTime - Time.time; float num3 = 1f - num2 / num; component.color = Color.Lerp(wallUICooldownStartColor, wallUICooldownEndColor, num3); } else { component.color = wallUIColor; } } } private bool CanActivateSkill() { if (!SemiFunc.RunIsLevel() || !photonView.IsMine) { return false; } return !(bool)typeof(ChatManager).GetField("chatActive", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ChatManager.instance); } private void SetupUIIfNeeded() { if (JPSkill_GlobalManager.Instance.selectedSkill == SelectableSkills.HolyWall && !wallUISetup) { SpawnHolyWallUI(); } } public void SpawnHolyWallUI() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0139: Unknown result type (might be due to invalid IL or missing references) Plugin.Logger.LogInfo((object)"SpawnHolyWallUI: Setting up Holy Wall UI."); wallUISetup = true; if (Plugin.AssetManager.TryGetValue("HolyWallIcon", out var value)) { GameObject val = GameObject.Find("Game Hud"); if ((Object)val == (Object)null) { Plugin.Logger.LogWarning((object)"SpawnHolyWallUI: 'Game Hud' canvas not found!"); return; } holyWallIconInstance = Object.Instantiate<GameObject>(value, ((Component)this).transform.position, Quaternion.identity); holyWallIconInstance.layer = 5; holyWallIconInstance.transform.localScale = UI_SCALE; holyWallIconInstance.transform.SetParent(val.transform, false); Rect rect = val.GetComponent<RectTransform>().rect; float num = ((Rect)(ref rect)).height / 2f; holyWallIconInstance.transform.localPosition = new Vector3(0f, 40f - num, 0f); ManualLogSource logger = Plugin.Logger; Vector3 localPosition = holyWallIconInstance.transform.localPosition; logger.LogInfo((object)("SpawnHolyWallUI: Holy Wall UI added at position: " + ((object)localPosition).ToString())); SpriteRenderer component = holyWallIconInstance.GetComponent<SpriteRenderer>(); if ((Object)component != (Object)null) { component.color = wallUIColor; Plugin.Logger.LogInfo((object)"SpawnHolyWallUI: UI color set to wallUIColor."); } else { Plugin.Logger.LogWarning((object)"SpawnHolyWallUI: No SpriteRenderer found on Holy Wall UI prefab."); } } else { Plugin.Logger.LogWarning((object)"SpawnHolyWallUI: Holy Wall icon asset not found!"); } } private void ActivateHolyWallSkill() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) Plugin.Logger.LogInfo((object)"HolyWallSkill: F key pressed, activating Holy Wall skill locally."); if ((Object)(object)JPSkill_GlobalManager.Instance != (Object)null) { JPSkill_GlobalManager.Instance.EnsurePrefabPool(); } nextWallTime = Time.time + cooldownDuration; PlayHolyWallSFX(); if (!Plugin.AssetManager.TryGetValue("HolyWall", out var _)) { Plugin.Logger.LogWarning((object)"HolyWallSkill: Holy Wall asset not found locally!"); } Vector3 val = ((Component)this).transform.position + ((Component)this).transform.forward * 2f + Vector3.up * 1f; Quaternion rotation = ((Component)this).transform.rotation; float effectiveDuration = GetEffectiveDuration(); float scaleMultiplier = GetScaleMultiplier(); Plugin.Logger.LogInfo((object)"HolyWallSkill: Sending RequestHolyWallSpawn to MasterClient."); photonView.RPC("RequestHolyWallSpawn", (RpcTarget)2, new object[4] { val, rotation, effectiveDuration, scaleMultiplier }); TryRequestGrenadeSpawn(); TryRequestMineSpawn(); Utility.TriggerWarCry(Plugin.Instance.enableWarCriesConfig, Plugin.Instance.holyWallWarCriesConfig, "HolyWallSkill", new Color(0.5f, 0.7f, 1f, 1f), ChatManager.instance); } [PunRPC] public void RequestHolyWallSpawn(Vector3 spawnPos, Quaternion spawnRot, float duration, float scaleMultiplier) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) if (!PhotonNetwork.IsMasterClient) { return; } Plugin.Logger.LogInfo((object)$"HolyWallSkill: MasterClient received spawn request at {spawnPos}."); if ((Object)(object)JPSkill_GlobalManager.Instance != (Object)null) { JPSkill_GlobalManager.Instance.EnsurePrefabPool(); } GameObject val = PhotonNetwork.Instantiate("HolyWall", spawnPos, spawnRot, (byte)0, (object[])null); if ((Object)(object)val != (Object)null) { Vector3 localScale = val.transform.localScale; localScale.x *= scaleMultiplier; localScale.y *= scaleMultiplier; PhotonView componentInChildren = val.GetComponentInChildren<PhotonView>(); if ((Object)(object)componentInChildren != (Object)null) { photonView.RPC("SetHolyWallScale_RPC", (RpcTarget)0, new object[2] { componentInChildren.ViewID, localScale }); } val.AddComponent<TimedDestroyer>().lifeTime = duration; if ((Object)(object)val.GetComponent<NavMeshObstacle>() == (Object)null) { NavMeshObstacle obj = val.AddComponent<NavMeshObstacle>(); obj.carving = true; obj.size = new Vector3(1f, 2f, 0.1f); } Plugin.Logger.LogInfo((object)"HolyWallSkill: Holy Wall successfully instantiated and configured by MasterClient."); } } private void PlayHolyWallSFX() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (Plugin.AssetManager.TryGetValue("HolyWallSFX", out var value)) { AudioSource component = value.GetComponent<AudioSource>(); if ((Object)component != (Object)null) { component.volume = 0.2f; } Object.Instantiate<GameObject>(value, ((Component)this).transform.position, Quaternion.identity); Plugin.Logger.LogInfo((object)"HolyWallSkill: Holy Wall SFX played."); } else { Plugin.Logger.LogWarning((object)"HolyWallSkill: HolyWallSFX asset not found!"); } } private void AdjustHolyWallScale(GameObject spawnedWall) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) float scaleMultiplier = GetScaleMultiplier(); Vector3 localScale = spawnedWall.transform.localScale; localScale.x *= scaleMultiplier; localScale.y *= scaleMultiplier; PhotonView componentInChildren = spawnedWall.GetComponentInChildren<PhotonView>(); if ((Object)(object)componentInChildren != (Object)null) { int viewID = componentInChildren.ViewID; photonView.RPC("SetHolyWallScale_RPC", (RpcTarget)0, new object[2] { viewID, localScale }); } else { Plugin.Logger.LogError((object)"HolyWallSkill: Spawned wall is missing PhotonView! Scale sync will fail."); } if ((Object)(object)spawnedWall.GetComponent<NavMeshObstacle>() == (Object)null) { NavMeshObstacle obj = spawnedWall.AddComponent<NavMeshObstacle>(); obj.carving = true; obj.size = new Vector3(1f, 2f, 0.1f); Plugin.Logger.LogInfo((object)"HolyWallSkill: NavMeshObstacle added to Holy Wall."); } Plugin.Logger.LogInfo((object)$"HolyWallSkill: Holy Wall instantiated at {spawnedWall.transform.position} with scale multiplier: {scaleMultiplier}."); } private float GetScaleMultiplier() { if (!(GetPlayerExtractionHaul() >= 500000f)) { return 1.5f; } return 2f; } private float GetPlayerExtractionHaul() { return JPSkill_GlobalManager.Instance.savedExtractionHaul; } private float GetEffectiveDuration() { if (!(GetPlayerExtractionHaul() >= 1000000f)) { return skillDuration; } return 6f; } private void TryRequestGrenadeSpawn() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (GetPlayerExtractionHaul() >= 1500000f) { if (Random.value <= 0.2f) { Vector3 val = ((Component)this).transform.position + ((Component)this).transform.forward * 1f + Vector3.up * 1f; Quaternion rotation = ((Component)this).transform.rotation; photonView.RPC("RequestGrenadeSpawn", (RpcTarget)2, new object[2] { val, rotation }); Plugin.Logger.LogInfo((object)"HolyWallSkill: Grenade spawn requested."); } else { Plugin.Logger.LogInfo((object)"HolyWallSkill: Grenade spawn chance failed."); } } else { Plugin.Logger.LogInfo((object)"HolyWallSkill: Extraction haul below threshold for grenade spawn."); } } private void TryRequestMineSpawn() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (GetPlayerExtractionHaul() >= 2000000f) { if (Random.value <= 0.2f) { Vector3 val = ((Component)this).transform.position + ((Component)this).transform.forward * 1f + Vector3.up * 1f; Quaternion rotation = ((Component)this).transform.rotation; photonView.RPC("RequestMineSpawn", (RpcTarget)2, new object[2] { val, rotation }); Plugin.Logger.LogInfo((object)"HolyWallSkill: Mine spawn requested."); } else { Plugin.Logger.LogInfo((object)"HolyWallSkill: Mine spawn chance failed."); } } else { Plugin.Logger.LogInfo((object)"HolyWallSkill: Extraction haul below threshold for mine spawn."); } } [PunRPC] public void RequestGrenadeSpawn(Vector3 spawnPos, Quaternion spawnRot) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (PhotonNetwork.IsMasterClient) { PhotonNetwork.Instantiate("Items/Item Grenade Stun", spawnPos, spawnRot, (byte)0, (object[])null); ManualLogSource logger = Plugin.Logger; object arg = spawnPos; Quaternion val = spawnRot; logger.LogInfo((object)$"HolyWallSkill: Grenade spawned at {arg} with rotation {((Quaternion)(ref val)).eulerAngles}"); } } [PunRPC] public void RequestMineSpawn(Vector3 spawnPos, Quaternion spawnRot) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (PhotonNetwork.IsMasterClient) { PhotonNetwork.Instantiate("Items/Item Mine Stun", spawnPos, spawnRot, (byte)0, (object[])null); ManualLogSource logger = Plugin.Logger; object arg = spawnPos; Quaternion val = spawnRot; logger.LogInfo((object)$"HolyWallSkill: Mine spawned at {arg} with rotation {((Quaternion)(ref val)).eulerAngles}"); } } [PunRPC] private void SetHolyWallScale_RPC(int spawnedWallViewID, Vector3 newScale) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) PhotonView val = PhotonView.Find(spawnedWallViewID); if ((Object)(object)val != (Object)null && (Object)(object)((Component)val).gameObject != (Object)null) { ((Component)val).gameObject.transform.localScale = newScale; Plugin.Logger.LogInfo((object)"HolyWallSkill: Scale updated for Holy Wall via RPC."); } else { Plugin.Logger.LogWarning((object)"HolyWallSkill: Holy Wall not found for scaling update!"); } } } } namespace JP_RepoHolySkills.SkillSelector { public enum SelectableSkills { HolyWall, HolyAura, Heal, None } public class SkillSelectorController : MonoBehaviour { public string currentSkillDescription = ""; public bool hasSetupSkillUI; public bool isSelectSkillUIShowing; private GameObject spawnedSelectSkillUI; public static SkillSelectorController Instance; private void Awake() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown if ((Object)Instance == (Object)null) { Instance = this; Plugin.Logger.LogInfo((object)"SkillSelectorController Awake: Instance set successfully."); } else { Plugin.Logger.LogWarning((object)"SkillSelectorController Awake: Duplicate instance detected!"); } } private void Start() { Plugin.Logger.LogInfo((object)"SkillSelectorController Start: Initializing Skill Selector UI."); SetupSelectSkillUI(); } private void Update() { //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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown if ((bool)typeof(ChatManager).GetField("chatActive", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ChatManager.instance) || SemiFunc.RunIsLevel() || SemiFunc.RunIsShop()) { return; } Utility.UpdateTotalExtractedHaulText(JPSkill_GlobalManager.Instance.savedExtractionHaul); KeyboardShortcut value = Plugin.SkillPageHotkey.Value; if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey)) { Plugin.Logger.LogInfo((object)"SkillSelectorController Update: P key pressed to toggle Skill Selector UI."); if ((Object)spawnedSelectSkillUI == (Object)null) { Plugin.Logger.LogWarning((object)"SkillSelectorController Update: spawnedSelectSkillUI is null. Attempting to reinitialize UI."); hasSetupSkillUI = false; SetupSelectSkillUI(); } if ((Object)spawnedSelectSkillUI != (Object)null) { if (isSelectSkillUIShowing) { Plugin.Logger.LogInfo((object)"SkillSelectorController Update: Hiding Skill Selector UI."); spawnedSelectSkillUI.SetActive(false); } else { Plugin.Logger.LogInfo((object)"SkillSelectorController Update: Showing Skill Selector UI."); spawnedSelectSkillUI.SetActive(true); AutoSelectSkillUI(); } isSelectSkillUIShowing = !isSelectSkillUIShowing; } else { Plugin.Logger.LogError((object)"SkillSelectorController Update: Failed to initialize Skill Selector UI; spawnedSelectSkillUI is still null."); } } if (isSelectSkillUIShowing) { HandleSkillSeletorMenuInput(); } } public void HandleSkillSeletorMenuInput() { if (Input.GetKeyDown((KeyCode)49)) { SelectHolyAuraSkill(); } else if (Input.GetKeyDown((KeyCode)50)) { SelectHealSkill(); } else if (Input.GetKeyDown((KeyCode)51)) { SelectHolyWallSkill(); } } private void AutoSelectSkillUI() { if (JPSkill_GlobalManager.Instance.selectedSkill == SelectableSkills.HolyAura) { SelectHolyAuraSkill(); } else if (JPSkill_GlobalManager.Instance.selectedSkill == SelectableSkills.Heal) { SelectHealSkill(); } else if (JPSkill_GlobalManager.Instance.selectedSkill == SelectableSkills.HolyWall) { SelectHolyWallSkill(); } } private void SelectHolyAuraSkill() { Plugin.Logger.LogInfo((object)"SkillSelectorController: Alpha1 pressed - Selecting HolyAura skill."); JPSkill_GlobalManager.Instance.selectedSkill = SelectableSkills.HolyAura; currentSkillDescription = ClassModConstants.HolyAuraDescription; SetSkillPointers(auraEnabled: true, healEnabled: false, wallEnabled: false); UpdateSkillDescriptionText(currentSkillDescription); ClearSkillTierDescriptions(5); UpdateSkillTierContainers(5); UpdateSkillTierDescriptions(ClassModConstants.HolyAuraTierDescriptions); } private void SelectHealSkill() { Plugin.Logger.LogInfo((object)"SkillSelectorController: Alpha2 pressed - Selecting Heal skill."); JPSkill_GlobalManager.Instance.selectedSkill = SelectableSkills.Heal; currentSkillDescription = ClassModConstants.HealDescription; SetSkillPointers(auraEnabled: false, healEnabled: true, wallEnabled: false); UpdateSkillDescriptionText(currentSkillDescription); ClearSkillTierDescriptions(5); UpdateSkillTierContainers(5); UpdateSkillTierDescriptions(ClassModConstants.HealSkillTierDescriptions); } private void SelectHolyWallSkill() { Plugin.Logger.LogInfo((object)"SkillSelectorController: Alpha3 pressed - Selecting Holy Wall skill."); JPSkill_GlobalManager.Instance.selectedSkill = SelectableSkills.HolyWall; currentSkillDescription = ClassModConstants.HolyWallDescription; SetSkillPointers(auraEnabled: false, healEnabled: false, wallEnabled: true); UpdateSkillDescriptionText(currentSkillDescription); ClearSkillTierDescriptions(5); UpdateSkillTierContainers(5); UpdateSkillTierDescriptions(ClassModConstants.HolyWallSkillTierDescriptions); } private void SetSkillPointers(bool auraEnabled, bool healEnabled, bool wallEnabled) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown GameObject val = GameObject.Find("HolyAuraPointer"); if ((Object)val != (Object)null) { RawImage component = val.GetComponent<RawImage>(); if ((Object)component != (Object)null) { ((Behaviour)component).enabled = auraEnabled; } } else { Plugin.Logger.LogWarning((object)"HolyAuraPointer not found."); } GameObject val2 = GameObject.Find("HealPointer"); if ((Object)val2 != (Object)null) { RawImage component2 = val2.GetComponent<RawImage>(); if ((Object)component2 != (Object)null) { ((Behaviour)component2).enabled = healEnabled; } } else { Plugin.Logger.LogWarning((object)"HealPointer not found."); } GameObject val3 = GameObject.Find("HolyWallPointer"); if ((Object)val3 != (Object)null) { RawImage component3 = val3.GetComponent<RawImage>(); if ((Object)component3 != (Object)null) { ((Behaviour)component3).enabled = wallEnabled; } } else { Plugin.Logger.LogWarning((object)"HolyWallPointer not found."); } } private void UpdateSkillDescriptionText(string description) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown GameObject val = GameObject.Find("JP_SkillDescriptionText"); if ((Object)val != (Object)null) { TextMeshProUGUI component = val.GetComponent<TextMeshProUGUI>(); if ((Object)component != (Object)null) { ((TMP_Text)component).text = description; } else { Plugin.Logger.LogWarning((object)"JP_SkillDescriptionText does not have a TextMeshProUGUI component."); } } else { Plugin.Logger.LogWarning((object)"JP_SkillDescriptionText not found."); } } private void ClearSkillTierDescriptions(int numberOfTiers) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown for (int i = 1; i <= numberOfTiers; i++) { GameObject val = Utility.FindSkillTierDescription(i); if ((Object)val != (Object)null) { TextMeshProUGUI component = val.GetComponent<TextMeshProUGUI>(); if ((Object)component != (Object)null) { ((TMP_Text)component).text = ""; Plugin.Logger.LogInfo((object)$"SkillTier{i}Description text cleared."); } else { Plugin.Logger.LogWarning((object)$"SkillTier{i}Description GameObject does not have a TextMeshProUGUI component."); } } else { Plugin.Logger.LogWarning((object)$"SkillTier{i}Description not found in the scene."); } } } private void UpdateSkillTierContainers(int numberOfTiers) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) for (int i = 1; i <= numberOfTiers; i++) { if (JPSkill_GlobalManager.Instance.savedExtractionHaul >= i * 500000) { Utility.SetSkillTierContainerColor(i, new Color(0.5235849f, 1f, 0.5453033f, 0.3921569f)); } else { Utility.SetSkillTierContainerColor(i, new Color(1f, 1f, 1f, 0.4f)); } } } private void UpdateSkillTierDescriptions(string[] descriptions) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown for (int i = 1; i <= descriptions.Length; i++) { GameObject val = Utility.FindSkillTierDescription(i); if ((Object)val != (Object)null) { TextMeshProUGUI component = val.GetComponent<TextMeshProUGUI>(); if ((Object)component != (Object)null) { ((TMP_Text)component).text = ""; ((TMP_Text)component).text = descriptions[i - 1]; Plugin.Logger.LogInfo((object)$"SkillTier{i}Description text set successfully."); } else { Plugin.Logger.LogWarning((object)$"SkillTier{i}Description GameObject does not have a TextMeshProUGUI component."); } } else { Plugin.Logger.LogWarning((object)$"SkillTier{i}Description not found in the scene."); } } } public void SetupSelectSkillUI() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) if (hasSetupSkillUI && (Object)spawnedSelectSkillUI != (Object)null) { Plugin.Logger.LogInfo((object)"SkillSelectorController: SetupSelectSkillUI already executed. Skipping."); return; } hasSetupSkillUI = true; Plugin.Logger.LogInfo((object)"SkillSelectorController: Setting up Skill Selector UI."); if (Plugin.AssetManager.TryGetValue("SelectSkillUI", out var value)) { GameObject val = GameObject.Find("Game Hud"); if ((Object)val == (Object)null) { Plugin.Logger.LogWarning((object)"SkillSelectorController: 'Game Hud' canvas not found."); return; } spawnedSelectSkillUI = Object.Instantiate<GameObject>(value, ((Component)this).transform.position, Quaternion.identity); spawnedSelectSkillUI.SetActive(false); spawnedSelectSkillUI.layer = 5; spawnedSelectSkillUI.transform.SetParent(val.transform, false); Rect rect = val.GetComponent<RectTransform>().rect; float width = ((Rect)(ref rect)).width; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(width - width / 2f - 150f, -30f, 0f); spawnedSelectSkillUI.transform.localPosition = val2; ManualLogSource logger = Plugin.Logger; Vector3 val3 = val2; logger.LogInfo((object)("SkillSelectorController: UI setup complete, added to canvas at local position " + ((object)val3).ToString())); } else { Plugin.Logger.LogWarning((object)"SkillSelectorController: SELECT_SKILL_UI asset not found in AssetManager!"); } } } } namespace JP_RepoHolySkills.Player { internal class PlayerControllerCustom : MonoBehaviour { public PhotonView photonView; public HealSkill healSkill; public HolyAuraSkill holyAuraSkill; public HolyWallSkill holyWallSkill; public Coroutine boostSprintCoroutine; public Coroutine staminaRegenCoroutine; public Coroutine healthRegenCoroutine; public PlayerHealth playerHealth; private void Start() { Plugin.Logger.LogInfo((object)"PlayerControllerCustom: Start called."); photonView = ((Component)this).GetComponent<PhotonView>(); playerHealth = ((Component)this).GetComponent<PlayerHealth>(); healSkill = ((Component)this).gameObject.AddComponent<HealSkill>(); Plugin.Logger.LogInfo((object)"PlayerControllerCustom: HealSkill component added."); holyAuraSkill = ((Component)this).gameObject.AddComponent<HolyAuraSkill>(); Plugin.Logger.LogInfo((object)"PlayerControllerCustom: HolyAuraSkill component added."); holyWallSkill = ((Component)this).gameObject.AddComponent<HolyWallSkill>(); Plugin.Logger.LogInfo((object)"PlayerControllerCustom: HolyWallSkill component added."); } private void Update() { if (SemiFunc.RunIsLevel()) { _ = photonView.IsMine; } } public void StartOwnerRPCSprintBoost(float speedModifier, float duration) { Plugin.Logger.LogInfo((object)$"PlayerControllerCustom: Requesting sprint boost with modifier {speedModifier} for {duration} seconds."); photonView.RPC("StartSprintBoostCoroutine_RPC", photonView.Owner, new object[2] { speedModifier, duration }); } [PunRPC] private void StartSprintBoostCoroutine_RPC(float speedModifier, float duration) { Plugin.Logger.LogInfo((object)"PlayerControllerCustom: Starting sprint boost coroutine RPC."); StartBoostSprintCoroutine(speedModifier, duration); } private void StartBoostSprintCoroutine(float speedModifier, float duration) { if (boostSprintCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(boostSprintCoroutine); Plugin.Logger.LogInfo((object)"PlayerControllerCustom: Stopped existing sprint boost coroutine."); } boostSprintCoroutine = ((MonoBehaviour)this).StartCoroutine(BoostSprint(speedModifier, duration)); } private IEnumerator BoostSprint(float speedModifier, float duration) { FieldInfo field = typeof(PlayerController).GetField("playerName", BindingFlags.Instance | BindingFlags.NonPublic); FieldInfo field2 = typeof(PlayerController).GetField("playerOriginalSprintSpeed", BindingFlags.Instance | BindingFlags.NonPublic); FieldInfo field3 = typeof(PlayerController).GetField("playerOriginalMoveSpeed", BindingFlags.Instance | BindingFlags.NonPublic); string playerName = (string)field.GetValue(PlayerController.instance); float originalSprint = (float)field2.GetValue(PlayerController.instance); float originalMove = (float)field3.GetValue(PlayerController.instance); Plugin.Logger.LogInfo((object)$"{playerName}: Sprint boost starting. Original Walk: {PlayerController.instance.MoveSpeed}, Original Sprint: {PlayerController.instance.SprintSpeed}"); float num = PlayerController.instance.MoveSpeed * speedModifier; float num2 = PlayerController.instance.SprintSpeed * speedModifier; Plugin.Logger.LogInfo((object)$"{playerName}: New Walk: {num}, New Sprint: {num2}"); PlayerController.instance.MoveSpeed = num; PlayerController.instance.SprintSpeed = num2; yield return (object)new WaitForSeconds(duration); PlayerController.instance.MoveSpeed = originalMove; PlayerController.instance.SprintSpeed = originalSprint; Plugin.Logger.LogInfo((object)$"{playerName}: Sprint boost ended. Speeds reset to Walk: {PlayerController.instance.MoveSpeed}, Sprint: {PlayerController.instance.SprintSpeed}"); } [PunRPC] private void SyncMoveSpeed(float walkSpeed, float sprintSpeed) { PlayerController.instance.MoveSpeed = walkSpeed; PlayerController.instance.SprintSpeed = sprintSpeed; Plugin.Logger.LogInfo((object)$"PlayerControllerCustom: Synchronized move speeds: Walk = {walkSpeed}, Sprint = {sprintSpeed}"); } public void StartOwnerRPCRegenStamina(float regenAmount, float duration) { Plugin.Logger.LogInfo((object)$"PlayerControllerCustom: Requesting stamina regeneration: {regenAmount} per tick for {duration} seconds."); photonView.RPC("StartRegenStamina_RPC", photonView.Owner, new object[2] { regenAmount, duration }); } [PunRPC] private void StartRegenStamina_RPC(float regenAmount, float duration) { Plugin.Logger.LogInfo((object)"PlayerControllerCustom: Starting stamina regen RPC."); StartRegenStaminaCoroutine(regenAmount, duration); } private void StartRegenStaminaCoroutine(float regenAmount, float duration) { if (staminaRegenCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(staminaRegenCoroutine); Plugin.Logger.LogInfo((object)"PlayerControllerCustom: Stopped existing stamina regen coroutine."); } staminaRegenCoroutine = ((MonoBehaviour)this).StartCoroutine(RegenStamina(regenAmount, duration)); } private IEnumerator RegenStamina(float regenAmount, float duration) { float elapsedTime = 0f; float tickInterval = 1f; while (elapsedTime < duration) { PlayerController.instance.EnergyCurrent = Mathf.Min(PlayerController.instance.EnergyCurrent + regenAmount, PlayerController.instance.EnergyStart); Plugin.Logger.LogInfo((object)$"PlayerControllerCustom: Regenerating stamina. Current: {PlayerController.instance.EnergyCurrent}"); elapsedTime += tickInterval; yield return (object)new WaitForSeconds(tickInterval); } } public void StartOwnerRPCHealthRegen(int regenAmount, float duration) { Plugin.Logger.LogInfo((object)$"PlayerControllerCustom: Requesting health regeneration: {regenAmount} per tick for {duration} seconds."); photonView.RPC("StartHealthRegen_RPC", photonView.Owner, new object[2] { regenAmount, duration }); } [PunRPC] private void StartHealthRegen_RPC(int regenAmount, float duration) { Plugin.Logger.LogInfo((object)"PlayerControllerCustom: Starting health regen RPC."); StartHealthRegenCoroutine(regenAmount, duration); } private void StartHealthRegenCoroutine(int regenAmount, float duration) { if (healthRegenCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(healthRegenCoroutine); Plugin.Logger.LogInfo((object)"PlayerControllerCustom: Stopped existing health regen coroutine."); } healthRegenCoroutine = ((MonoBehaviour)this).StartCoroutine(RegenHealth(regenAmount, duration)); } private IEnumerator RegenHealth(int regenAmount, float duration) { FieldInfo healthField = typeof(PlayerHealth).GetField("health", BindingFlags.Instance | BindingFlags.NonPublic); int num = (int)healthField.GetValue(playerHealth); Plugin.Logger.LogInfo((object)$"PlayerControllerCustom: Initial health is {num}."); float elapsedTime = 0f; float tickInterval = 1f; while (elapsedTime < duration) { playerHealth.Heal(regenAmount, true); int num2 = (int)healthField.GetValue(playerHealth); Plugin.Logger.LogInfo((object)$"PlayerControllerCustom: Health regenerated to {num2}."); photonView.RPC("SyncHealth", (RpcTarget)4, new object[1] { num2 }); elapsedTime += tickInterval; yield return (object)new WaitForSeconds(tickInterval); } } public void StartOwnerHealRPC(int amount) { Plugin.Logger.LogInfo((object)$"PlayerControllerCustom: Requesting heal of {amount} HP."); photonView.RPC("Heal_RPC", photonView.Owner, new object[1] { amount }); } [PunRPC] private void Heal_RPC(int amount) { Plugin.Logger.LogInfo((object)$"PlayerControllerCustom: Heal_RPC received with amount {amount}."); Heal(amount); } public void Heal(int amount) { playerHealth.Heal(amount, true); FieldInfo field = typeof(PlayerHealth).GetField("health", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { int num = (int)field.GetValue(playerHealth); photonView.RPC("SyncHealth", (RpcTarget)4, new object[1] { num }); Plugin.Logger.LogInfo((object)$"PlayerControllerCustom: Healed. Updated health is {num}."); } else { Plugin.Logger.LogWarning((object)"PlayerControllerCustom: Field 'health' not found on PlayerHealth."); } } [PunRPC] private void SyncHealth(int updatedHealth) { FieldInfo field = typeof(PlayerHealth).GetField("health", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(playerHealth, updatedHealth); Plugin.Logger.LogInfo((object)$"PlayerControllerCustom: Synchronized health to {updatedHealth}."); } else { Plugin.Logger.LogWarning((object)"PlayerControllerCustom: Field 'health' not found on PlayerHealth in SyncHealth RPC."); } } } } namespace JP_RepoHolySkills.Patches { [HarmonyPatch(typeof(ExtractionPoint))] internal class ExtractionPointPatch { [HarmonyPatch("StateComplete")] [HarmonyPrefix] public static void StateComplete(ExtractionPoint __instance) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown if (SemiFunc.RunIsShop()) { return; } FieldInfo field = typeof(ExtractionPoint).GetField("stateStart", BindingFlags.Instance | BindingFlags.NonPublic); if (field == null || !(bool)field.GetValue(__instance)) { return; } FieldInfo field2 = typeof(ExtractionPoint).GetField("extractionHaul", BindingFlags.Instance | BindingFlags.NonPublic); if (field2 == null) { return; } int nu