using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Drone.Command;
using EntityStates.Huntress;
using EntityStates.Huntress.HuntressWeapon;
using EntityStates.Mage;
using Faithful;
using Faithful.Shared;
using Faithful.Skills.Technician;
using Faithful.Skills.Temp;
using HG;
using HG.BlendableTypes;
using HarmonyLib;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using Newtonsoft.Json;
using On.EntityStates;
using On.EntityStates.Drone.Command;
using On.EntityStates.Huntress.HuntressWeapon;
using On.EntityStates.Mage;
using On.RoR2;
using On.RoR2.Items;
using On.RoR2.UI;
using On.RoR2.UI.LogBook;
using On.RoR2.UI.MainMenu;
using R2API;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.ContentManagement;
using RoR2.ExpansionManagement;
using RoR2.Hologram;
using RoR2.Navigation;
using RoR2.Networking;
using RoR2.Skills;
using RoR2.UI;
using RoR2.UI.MainMenu;
using TMPro;
using Unity;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
[assembly: AssemblyTitle("Faithful")]
[assembly: AssemblyProduct("Faithful")]
[assembly: AssemblyInformationalVersion("1.0.0+65ed4da0548071b8f67039db4f2acda3bad2e75d")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyCompany("Faithful")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace Faithful
{
internal static class Assets
{
public const string bundleName = "faithfulbundle";
public static AssetBundle assetBundle;
public static Material mageJetMaterial;
public static Material infusionGlassMaterial;
public static Material areaIndicatorIntersectionOnlyMaterial;
public static Material areaIndicatorRimMaterial;
public static Material artifactMaterial;
public static Material artifactShellExplosionIndicatorMaterial;
public static Material baubleTimestopSphereMaterial;
public static Material blueprintScreenMaterial;
public static Material blueprintsInvalidMaterial;
public static Material blueprintsOkMaterial;
public static Material bootShockwaveMaterial;
public static Material captainAirstrikeAltAreaIndicatorInnerMaterial;
public static Material captainAirstrikeAltAreaIndicatorOuterMaterial;
public static Material captainAirstrikeAreaIndicatorMaterial;
public static Material captainSupplyDropAreaIndicator2Material;
public static Material captainSupplyDropAreaIndicatorOuterMaterial;
public static Material chefAlwaysOnTopMaterial;
public static Material childStarCoreMaterial;
public static Material childStarGlowMaterial;
public static Material chipProjectileMaterial;
public static Material clayBubbleMaterial;
public static Material combinerEnergyFadeMaterial;
public static Material coreCage2Material;
public static Material defectiveUnitDenialSphereNoiseMaterial;
public static Material defectiveUnitDetonateSphereEnergyMaterial;
public static Material defectiveUnitDetonateSphereEnergyPersMaterial;
public static Material defectiveUnitDetonateSphereNoiseMaterial;
public static Material defectiveUnitDetonateSpherePulseMaterial;
public static Material defectiveUnitNullifySpherePulseMaterial;
public static Material droneBrokenGenericMaterial;
public static Material nullifierArmorMaterial;
public static Material nullifierGemPortalMaterial;
public static Material nullifierGemPortal3Material;
public static Material nullifierBlackholeZoneAreaIndicatorMaterial;
public static Material nullifierExplosionAreaIndicatorHardMaterial;
public static Material radarTowerAreaIndicatorMaterial;
public static Material shockDamageAuraGlassMaterial;
public static Material teamAreaIndicatorFullMonsterMaterial;
public static Material teamAreaIndicatorFullPlayerMaterial;
public static Material teamAreaIndicatorIntersectionMonsterMaterial;
public static Material teamAreaIndicatorIntersectionPlayerMaterial;
public static Material timeCrystalAreaIndicatorMaterial;
public static Material voidDeathBombAreaIndicatorBackMaterial;
public static Material voidDeathBombAreaIndicatorFrontMaterial;
public static Material voidSurvivorBlasterSphereAreaIndicatorMaterial;
public static Material voidSurvivorBlasterSphereAreaIndicatorCorruptedMaterial;
public static Material chestMaterial;
public static Wave[] mageJetWaves;
public static GameObject mageJetAkEventsPrefab;
public static GameObject radiusIndicatorPrefab;
public static GameObject pennonEffectPrefab;
public static GameObject matrixEffectPrefab;
public static GameObject matrixEffectLocalPrefab;
public static GameObject shrineUseEffectPrefab;
public static GameObject technicianArcPrefab;
public static GameObject technicianTrackingIndicatorPrefab;
public static PhysicMaterial ragdollMaterial;
public static DynamicBone scarfDynamicBone;
public static Sprite dronePingIcon;
public static Sprite inventoryPingIcon;
public static Sprite lootPingIcon;
public static Sprite shrinePingIcon;
public static Sprite teleporterPingIcon;
public static Sprite mysteryPingIcon;
public static Sprite chestInspectIcon;
public static Sprite droneInspectIcon;
public static Sprite lunarInspectIcon;
public static Sprite pillarInspectIcon;
public static Sprite printerInspectIcon;
public static Sprite radioScannerInspectIcon;
public static Sprite scapperInspectIcon;
public static Sprite shrineInspectIcon;
public static Sprite meridianInspectIcon;
public static Sprite voidInspectIcon;
public static Sprite mysteryInspectIcon;
public static Material chanceShrineSymbolMaterial;
public static ExpansionDef sotvDef;
public static ExpansionDef sotsDef;
private const string defaultModel = "temporalcubemesh";
private const string defaultIcon = "textemporalcubeicon";
private const string defaultConsumedIcon = "textemporalcubeconsumedicon";
private const string defaultBuffIcon = "texbufftemporalcube";
public static string AssetBundlePath => Path.Combine(Path.GetDirectoryName(Utils.pluginInfo.Location), "faithfulbundle");
public static void Init()
{
assetBundle = AssetBundle.LoadFromFile(AssetBundlePath);
if (Utils.verboseConsole)
{
string[] allAssetNames = assetBundle.GetAllAssetNames();
string[] array = allAssetNames;
foreach (string text in array)
{
Log.Debug("[ASSETS] - Loaded asset '" + text + "'");
}
}
FetchNeededRoR2Resources();
RiskOfOptionsWrapper.UpdateModIcon();
}
private static void FetchNeededRoR2Resources()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0370: Unknown result type (might be due to invalid IL or missing references)
//IL_0375: Unknown result type (might be due to invalid IL or missing references)
//IL_04ac: Unknown result type (might be due to invalid IL or missing references)
//IL_04c1: Unknown result type (might be due to invalid IL or missing references)
//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
//IL_04fb: Unknown result type (might be due to invalid IL or missing references)
//IL_055e: Unknown result type (might be due to invalid IL or missing references)
//IL_05a5: Unknown result type (might be due to invalid IL or missing references)
//IL_069e: Unknown result type (might be due to invalid IL or missing references)
//IL_06e5: Unknown result type (might be due to invalid IL or missing references)
//IL_072c: Unknown result type (might be due to invalid IL or missing references)
//IL_0773: Unknown result type (might be due to invalid IL or missing references)
//IL_07ba: Unknown result type (might be due to invalid IL or missing references)
//IL_0801: Unknown result type (might be due to invalid IL or missing references)
//IL_0811: Unknown result type (might be due to invalid IL or missing references)
//IL_0816: Unknown result type (might be due to invalid IL or missing references)
//IL_0898: Unknown result type (might be due to invalid IL or missing references)
//IL_08b8: Unknown result type (might be due to invalid IL or missing references)
//IL_093c: Unknown result type (might be due to invalid IL or missing references)
//IL_0983: Unknown result type (might be due to invalid IL or missing references)
//IL_09f3: Unknown result type (might be due to invalid IL or missing references)
//IL_0a3a: Unknown result type (might be due to invalid IL or missing references)
//IL_0a4a: Unknown result type (might be due to invalid IL or missing references)
//IL_0a4f: Unknown result type (might be due to invalid IL or missing references)
//IL_0ac6: Unknown result type (might be due to invalid IL or missing references)
//IL_0ae7: Unknown result type (might be due to invalid IL or missing references)
//IL_0b6e: Unknown result type (might be due to invalid IL or missing references)
//IL_0bb5: Unknown result type (might be due to invalid IL or missing references)
//IL_0c25: Unknown result type (might be due to invalid IL or missing references)
//IL_0c6c: Unknown result type (might be due to invalid IL or missing references)
//IL_0c7c: Unknown result type (might be due to invalid IL or missing references)
//IL_0c81: Unknown result type (might be due to invalid IL or missing references)
//IL_0cee: Unknown result type (might be due to invalid IL or missing references)
//IL_0d1c: Unknown result type (might be due to invalid IL or missing references)
//IL_0d4a: Unknown result type (might be due to invalid IL or missing references)
//IL_0d78: Unknown result type (might be due to invalid IL or missing references)
//IL_0d8d: Unknown result type (might be due to invalid IL or missing references)
//IL_0da2: Unknown result type (might be due to invalid IL or missing references)
//IL_0dc6: Unknown result type (might be due to invalid IL or missing references)
//IL_0e6c: Unknown result type (might be due to invalid IL or missing references)
//IL_0ea9: Unknown result type (might be due to invalid IL or missing references)
//IL_0f56: Unknown result type (might be due to invalid IL or missing references)
//IL_0f9d: Unknown result type (might be due to invalid IL or missing references)
//IL_105e: Unknown result type (might be due to invalid IL or missing references)
//IL_10e2: Unknown result type (might be due to invalid IL or missing references)
//IL_115c: Unknown result type (might be due to invalid IL or missing references)
//IL_11a3: Unknown result type (might be due to invalid IL or missing references)
//IL_11ea: Unknown result type (might be due to invalid IL or missing references)
//IL_1296: Unknown result type (might be due to invalid IL or missing references)
//IL_129b: Unknown result type (might be due to invalid IL or missing references)
//IL_12a4: Unknown result type (might be due to invalid IL or missing references)
//IL_12b4: Unknown result type (might be due to invalid IL or missing references)
//IL_12b9: Unknown result type (might be due to invalid IL or missing references)
//IL_1310: Unknown result type (might be due to invalid IL or missing references)
//IL_1368: Unknown result type (might be due to invalid IL or missing references)
//IL_1396: Unknown result type (might be due to invalid IL or missing references)
//IL_1451: Unknown result type (might be due to invalid IL or missing references)
//IL_1465: Unknown result type (might be due to invalid IL or missing references)
//IL_1497: Unknown result type (might be due to invalid IL or missing references)
//IL_14c9: Unknown result type (might be due to invalid IL or missing references)
//IL_14fb: Unknown result type (might be due to invalid IL or missing references)
//IL_152d: Unknown result type (might be due to invalid IL or missing references)
//IL_155f: Unknown result type (might be due to invalid IL or missing references)
//IL_1591: Unknown result type (might be due to invalid IL or missing references)
//IL_1618: Unknown result type (might be due to invalid IL or missing references)
//IL_164f: Unknown result type (might be due to invalid IL or missing references)
//IL_1669: Unknown result type (might be due to invalid IL or missing references)
//IL_166e: Unknown result type (might be due to invalid IL or missing references)
//IL_1697: Unknown result type (might be due to invalid IL or missing references)
//IL_169c: Unknown result type (might be due to invalid IL or missing references)
mageJetMaterial = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"aa5dbb90045bc694bb20ffb706507091").WaitForCompletion());
mageJetMaterial.SetTexture("_RemapTex", GetTexture("texRamp4T0NFire"));
infusionGlassMaterial = FetchAsset<Material>("RoR2/Base/Infusion/matInfusionGlass.mat");
areaIndicatorIntersectionOnlyMaterial = FetchAsset<Material>("RoR2/Base/Common/VFX/matAreaIndicatorIntersectionOnly.mat");
areaIndicatorRimMaterial = FetchAsset<Material>("RoR2/Base/Common/VFX/matAreaIndicatorRim.mat");
artifactMaterial = FetchAsset<Material>("RoR2/GlobalContent/matArtifact.mat");
artifactShellExplosionIndicatorMaterial = FetchAsset<Material>("RoR2/Base/artifactworld/matArtifactShellExplosionIndicator.mat");
baubleTimestopSphereMaterial = FetchAsset<Material>("RoR2/Base/SlowOnHit/matBaubleTimestopSphere.mat");
blueprintScreenMaterial = FetchAsset<Material>("RoR2/Junk/Misc/matBlueprintScreen.mat");
blueprintsInvalidMaterial = FetchAsset<Material>("RoR2/Base/Engi/matBlueprintsInvalid.mat");
blueprintsOkMaterial = FetchAsset<Material>("RoR2/Base/Engi/matBlueprintsOk.mat");
bootShockwaveMaterial = FetchAsset<Material>("RoR2/Base/FallBoots/matBootShockwave.mat");
captainAirstrikeAltAreaIndicatorInnerMaterial = FetchAsset<Material>("RoR2/Base/Captain/matCaptainAirstrikeAltAreaIndicatorInner.mat");
captainAirstrikeAltAreaIndicatorOuterMaterial = FetchAsset<Material>("RoR2/Base/Captain/matCaptainAirstrikeAltAreaIndicatorOuter.mat");
captainAirstrikeAreaIndicatorMaterial = FetchAsset<Material>("RoR2/Base/Captain/matCaptainAirstrikeAreaIndicator.mat");
captainSupplyDropAreaIndicator2Material = FetchAsset<Material>("RoR2/Base/Captain/matCaptainSupplyDropAreaIndicator2.mat");
captainSupplyDropAreaIndicatorOuterMaterial = FetchAsset<Material>("RoR2/Base/Captain/matCaptainSupplyDropAreaIndicatorOuter.mat");
chefAlwaysOnTopMaterial = FetchAsset<Material>("RoR2/DLC2/Chef/matChef_AlwaysOnTop.mat");
childStarCoreMaterial = FetchAsset<Material>("RoR2/DLC2/Child/matChildStarCore.mat");
childStarGlowMaterial = FetchAsset<Material>("RoR2/DLC2/Child/matChildStarGlow.mat");
chipProjectileMaterial = FetchAsset<Material>("RoR2/DLC3/SolusHeart/matChipProjectile.mat");
clayBubbleMaterial = FetchAsset<Material>("RoR2/Base/Clay/matClayBubble.mat");
combinerEnergyFadeMaterial = FetchAsset<Material>("RoR2/DLC3/DroneCombinerStation/matCombinerEnergyFade.mat");
coreCage2Material = FetchAsset<Material>("RoR2/DLC3/Items/MasterCore/matCoreCage2.mat");
defectiveUnitDenialSphereNoiseMaterial = FetchAsset<Material>("RoR2/DLC3/DefectiveUnit/matDefectiveUnitDenialSphereNoise.mat");
defectiveUnitDetonateSphereEnergyMaterial = FetchAsset<Material>("RoR2/DLC3/DefectiveUnit/matDefectiveUnitDetonateSphereEnergy.mat");
defectiveUnitDetonateSphereEnergyPersMaterial = FetchAsset<Material>("RoR2/DLC3/DefectiveUnit/matDefectiveUnitDetonateSphereEnergyPers.mat");
defectiveUnitDetonateSphereNoiseMaterial = FetchAsset<Material>("RoR2/DLC3/DefectiveUnit/matDefectiveUnitDetonateSphereNoise.mat");
defectiveUnitDetonateSpherePulseMaterial = FetchAsset<Material>("RoR2/DLC3/DefectiveUnit/matDefectiveUnitDetonateSpherePulse.mat");
defectiveUnitNullifySpherePulseMaterial = FetchAsset<Material>("RoR2/DLC3/DefectiveUnit/matDefectiveUnitNullifySpherePulse.mat");
droneBrokenGenericMaterial = FetchAsset<Material>("RoR2/Base/Drones/matDroneBrokenGeneric.mat");
nullifierArmorMaterial = FetchAsset<Material>("RoR2/Base/Nullifier/matNullifierArmor.mat");
nullifierGemPortalMaterial = FetchAsset<Material>("RoR2/Base/Nullifier/matNullifierGemPortal.mat");
nullifierGemPortal3Material = FetchAsset<Material>("RoR2/DLC1/Common/Void/matNullifierGemPortal3.mat");
nullifierBlackholeZoneAreaIndicatorMaterial = FetchAsset<Material>("RoR2/DLC1/Common/Void/matNullifierBlackholeZoneAreaIndicator.mat");
nullifierExplosionAreaIndicatorHardMaterial = FetchAsset<Material>("RoR2/Base/Nullifier/matNullifierExplosionAreaIndicatorHard.mat");
radarTowerAreaIndicatorMaterial = FetchAsset<Material>("RoR2/Base/RadarTower/matRadarTowerAreaIndicator.mat");
shockDamageAuraGlassMaterial = FetchAsset<Material>("RoR2/DLC3/Items/ShockDamageAura/matShockDamageAuraGlass.mat");
teamAreaIndicatorFullMonsterMaterial = FetchAsset<Material>("RoR2/Base/Common/matTeamAreaIndicatorFullMonster.mat");
teamAreaIndicatorFullPlayerMaterial = FetchAsset<Material>("RoR2/Base/Common/matTeamAreaIndicatorFullPlayer.mat");
teamAreaIndicatorIntersectionMonsterMaterial = FetchAsset<Material>("RoR2/Base/Common/matTeamAreaIndicatorIntersectionMonster.mat");
teamAreaIndicatorIntersectionPlayerMaterial = FetchAsset<Material>("RoR2/Base/Common/matTeamAreaIndicatorIntersectionPlayer.mat");
timeCrystalAreaIndicatorMaterial = FetchAsset<Material>("RoR2/Base/crystalworld/matTimeCrystalAreaIndicator.mat");
voidDeathBombAreaIndicatorBackMaterial = FetchAsset<Material>("RoR2/Base/Common/matVoidDeathBombAreaIndicatorBack.mat");
voidDeathBombAreaIndicatorFrontMaterial = FetchAsset<Material>("RoR2/Base/Common/matVoidDeathBombAreaIndicatorFront.mat");
voidSurvivorBlasterSphereAreaIndicatorMaterial = FetchAsset<Material>("RoR2/DLC1/VoidSurvivor/matVoidSurvivorBlasterSphereAreaIndicator.mat");
voidSurvivorBlasterSphereAreaIndicatorCorruptedMaterial = FetchAsset<Material>("RoR2/DLC1/VoidSurvivor/matVoidSurvivorBlasterSphereAreaIndicatorCorrupted.mat");
chestMaterial = FetchAsset<Material>("RoR2/Base/Chest1/matChest1.mat");
mageJetWaves = ((Component)Addressables.LoadAssetAsync<GameObject>((object)"92199783eae803f4095bc93685a5ee70").WaitForCompletion().GetComponent<Transform>()
.Find("ModelBase")
.Find("mdlMage")
.Find("MageArmature")
.Find("ROOT")
.Find("base")
.Find("stomach")
.Find("chest")
.Find("JetsOn")
.Find("Point Light")).GetComponent<FlickerLight>().sinWaves;
GameObject val = Object.Instantiate<GameObject>(((Component)Addressables.LoadAssetAsync<GameObject>((object)"92199783eae803f4095bc93685a5ee70").WaitForCompletion().transform.Find("ModelBase").Find("mdlMage").Find("MageArmature")
.Find("ROOT")
.Find("base")
.Find("stomach")
.Find("chest")
.Find("JetsOn")).gameObject);
mageJetAkEventsPrefab = PrefabAPI.InstantiateClone(val, "faithfulMageJetAkEvents", false);
Object.DestroyImmediate((Object)(object)val);
Object.DestroyImmediate((Object)(object)((Component)mageJetAkEventsPrefab.transform.Find("Fire")).gameObject);
Object.DestroyImmediate((Object)(object)((Component)mageJetAkEventsPrefab.transform.Find("Point Light")).gameObject);
Object.DestroyImmediate((Object)(object)((Component)mageJetAkEventsPrefab.transform.Find("JetsL")).gameObject);
Object.DestroyImmediate((Object)(object)((Component)mageJetAkEventsPrefab.transform.Find("JetsR")).gameObject);
Object.DestroyImmediate((Object)(object)((Component)mageJetAkEventsPrefab.transform.Find("FireRing")).gameObject);
mageJetAkEventsPrefab.transform.SetParent((Transform)null);
mageJetAkEventsPrefab.transform.position = Vector3.zero;
mageJetAkEventsPrefab.transform.localEulerAngles = Vector3.zero;
mageJetAkEventsPrefab.transform.localScale = Vector3.zero;
Object.DestroyImmediate((Object)(object)mageJetAkEventsPrefab.GetComponent<Rigidbody>());
GameObject val2 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"6b314230ed88f3c4b8d55cc64846854b").WaitForCompletion());
pennonEffectPrefab = PrefabAPI.InstantiateClone(val2, "faithfulLeadersPennonEffect", false);
Object.DestroyImmediate((Object)(object)val2);
((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("PulseEffect, Ring")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.5803921f, 0.22745098f, 61f / 85f));
((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("PulseEffect, Ring")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(0.5803921f, 0.22745098f, 61f / 85f));
((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("PulseEffect, Ring")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_RemapTex", GetTexture("texRampPennonBuff"));
((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("PulseEffect, Ring")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_MainTex", GetTexture("texIndicatorPennonMask"));
((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("PulseEffect, Ring")).GetComponent<ParticleSystemRenderer>()).material.mainTexture = GetTexture("texIndicatorPennonMask");
((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("ColoredLightShafts (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.1f, 0f, 2.6384087f));
((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("ColoredLightShafts (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(0.1f, 0f, 2.6384087f));
((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("FlarePerst_Ps (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.1f, 0f, 1f));
((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("FlarePerst_Ps (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(0.1f, 0f, 1f));
((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("SoftGlow")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.5803921f, 0.22745098f, 1f));
((Renderer)((Component)pennonEffectPrefab.transform.Find("Visual").Find("SoftGlow")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(0.5803921f, 0.22745098f, 1f));
GameObject val3 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"6b314230ed88f3c4b8d55cc64846854b").WaitForCompletion());
matrixEffectPrefab = PrefabAPI.InstantiateClone(val3, "faithfulTargetingMatrixEffect", false);
Object.DestroyImmediate((Object)(object)val3);
Material material = ((Renderer)((Component)matrixEffectPrefab.transform.Find("Visual").Find("PulseEffect, Ring")).GetComponent<ParticleSystemRenderer>()).material;
((Object)material).name = "matTargetingMatrixEffect";
material.SetFloat("_InvFade", 0f);
material.SetColor("_Color", new Color(1f, 0f, 0f));
material.SetColor("_TintColor", new Color(1f, 0f, 0f));
material.SetTexture("_RemapTex", GetTexture("texRampPennonBuff"));
material.SetTexture("_MainTex", GetTexture("texIndicatorMatrixMask"));
material.mainTexture = GetTexture("texIndicatorMatrixMask");
((Renderer)((Component)matrixEffectPrefab.transform.Find("Visual").Find("ColoredLightShafts (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(1f, 0f, 0f));
((Renderer)((Component)matrixEffectPrefab.transform.Find("Visual").Find("ColoredLightShafts (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(1f, 0f, 0f));
Object.DestroyImmediate((Object)(object)((Component)matrixEffectPrefab.transform.Find("Visual").Find("FlarePerst_Ps (1)")).gameObject);
((Renderer)((Component)matrixEffectPrefab.transform.Find("Visual").Find("SoftGlow")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(1f, 0f, 0f));
((Renderer)((Component)matrixEffectPrefab.transform.Find("Visual").Find("SoftGlow")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(1f, 0f, 0f));
GameObject val4 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"6b314230ed88f3c4b8d55cc64846854b").WaitForCompletion());
matrixEffectLocalPrefab = PrefabAPI.InstantiateClone(val4, "faithfulTargetingMatrixEffect", false);
Object.DestroyImmediate((Object)(object)val4);
Material material2 = ((Renderer)((Component)matrixEffectLocalPrefab.transform.Find("Visual").Find("PulseEffect, Ring")).GetComponent<ParticleSystemRenderer>()).material;
((Object)material2).name = "matTargetingMatrixLocalEffect";
material2.SetColor("_Color", new Color(1f, 0f, 0f));
material2.SetColor("_TintColor", new Color(1f, 0f, 0f));
material2.SetTexture("_RemapTex", GetTexture("texRampPennonBuff"));
material2.SetTexture("_MainTex", GetTexture("texIndicatorMatrixMask"));
material2.mainTexture = GetTexture("texIndicatorMatrixMask");
((Renderer)((Component)matrixEffectLocalPrefab.transform.Find("Visual").Find("ColoredLightShafts (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(1f, 0f, 0f));
((Renderer)((Component)matrixEffectLocalPrefab.transform.Find("Visual").Find("ColoredLightShafts (1)")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(1f, 0f, 0f));
Object.DestroyImmediate((Object)(object)((Component)matrixEffectLocalPrefab.transform.Find("Visual").Find("FlarePerst_Ps (1)")).gameObject);
((Renderer)((Component)matrixEffectLocalPrefab.transform.Find("Visual").Find("SoftGlow")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(1f, 0f, 0f));
((Renderer)((Component)matrixEffectLocalPrefab.transform.Find("Visual").Find("SoftGlow")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(1f, 0f, 0f));
GameObject val5 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"5ba295c0a3919a544939e6efe1ff17b3").WaitForCompletion());
radiusIndicatorPrefab = PrefabAPI.InstantiateClone(val5, "faithfulRadiusIndicator", false);
Object.DestroyImmediate((Object)(object)val5);
Object.DestroyImmediate((Object)(object)radiusIndicatorPrefab.GetComponent<NetworkedBodyAttachment>());
Object.DestroyImmediate((Object)(object)radiusIndicatorPrefab.GetComponent<NetworkIdentity>());
((Renderer)((Component)radiusIndicatorPrefab.transform.Find("Donut")).GetComponent<MeshRenderer>()).material.SetColor("_Color", Color.white);
((Renderer)((Component)radiusIndicatorPrefab.transform.Find("Donut")).GetComponent<MeshRenderer>()).material.SetColor("_TintColor", Color.white);
((Renderer)((Component)radiusIndicatorPrefab.transform.Find("Radius, Spherical")).GetComponent<MeshRenderer>()).material.SetColor("_Color", Color.white);
((Renderer)((Component)radiusIndicatorPrefab.transform.Find("Radius, Spherical")).GetComponent<MeshRenderer>()).material.SetColor("_TintColor", Color.white);
radiusIndicatorPrefab.transform.position = Vector3.zero;
radiusIndicatorPrefab.transform.eulerAngles = Vector3.zero;
radiusIndicatorPrefab.transform.localScale = new Vector3(1f, 1f, 1f);
radiusIndicatorPrefab.AddComponent<FaithfulRadiusIndicatorBehaviour>();
shrineUseEffectPrefab = FetchAsset<GameObject>("RoR2/Base/Common/VFX/ShrineUseEffect.prefab");
GameObject val6 = Object.Instantiate<GameObject>(FetchAsset<GameObject>("RoR2/Base/Engi/LaserEngiTurret.prefab"));
technicianArcPrefab = PrefabAPI.InstantiateClone(val6, "faithfulTechnicianArc", false);
Object.DestroyImmediate((Object)(object)val6);
((Component)technicianArcPrefab.transform.Find("LaserStart")).GetComponent<LineRenderer>().widthMultiplier = 3f;
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart")).GetComponent<LineRenderer>()).material.SetColor("_Color", new Color(0.9725f, 1f, 0.5373f));
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart")).GetComponent<LineRenderer>()).material.SetColor("_TintColor", new Color(0.9725f, 1f, 0.5373f));
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart")).GetComponent<LineRenderer>()).material.SetTexture("_RemapTex", GetTexture("texRampTechnician"));
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart")).GetComponent<LineRenderer>()).material.SetTexture("_Cloud2Tex", GetTexture("texLightningTechnician"));
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.9725f, 1f, 0.5373f));
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(0.9725f, 1f, 0.5373f));
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_MainTex", GetTexture("texTechnicianFlare"));
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_RemapTex", GetTexture("texRampTechnician"));
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("HitFlash")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.9725f, 1f, 0.5373f));
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("HitFlash")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_RemapTex", GetTexture("texRampTechnician"));
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("Ring, Bright")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.9725f, 1f, 0.5373f));
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserStart").Find("Ring, Bright")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_RemapTex", GetTexture("texRampTechnician"));
((Component)technicianArcPrefab.transform.Find("LaserStart").Find("Point light")).GetComponent<Light>().color = new Color(0.9725f, 1f, 0.5373f);
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserEnd").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_Color", new Color(0.9725f, 1f, 0.5373f));
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserEnd").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", new Color(0.9725f, 1f, 0.5373f));
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserEnd").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_MainTex", GetTexture("texTechnicianFlare"));
((Renderer)((Component)technicianArcPrefab.transform.Find("LaserEnd").Find("Flare")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_RemapTex", GetTexture("texRampTechnician"));
ParticleSystem component = ((Component)technicianArcPrefab.transform.Find("LaserEnd").Find("Flare")).GetComponent<ParticleSystem>();
MainModule main = component.main;
((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(4f);
GameObject val7 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"2c791c24593eab442b64bb8c822a4f01").WaitForCompletion());
technicianTrackingIndicatorPrefab = PrefabAPI.InstantiateClone(val7, "faithfulTechnicianTracker", false);
Object.DestroyImmediate((Object)(object)val7);
((Component)technicianTrackingIndicatorPrefab.transform.Find("Core Pip")).GetComponent<SpriteRenderer>().color = new Color(1f, 1f, 0.375f, 0.286f);
((Renderer)((Component)technicianTrackingIndicatorPrefab.transform.Find("Core Pip")).GetComponent<SpriteRenderer>()).sortingOrder = 1;
((Component)technicianTrackingIndicatorPrefab.transform.Find("Core, Dark")).GetComponent<SpriteRenderer>().color = new Color(0.5f, 0.5f, 0.25f, 0.953f);
technicianTrackingIndicatorPrefab.transform.Find("Holder").localScale = new Vector3(1f, 1f, 1f);
((Component)technicianTrackingIndicatorPrefab.transform.Find("Holder")).GetComponent<RotateAroundAxis>().reverse = true;
((Component)technicianTrackingIndicatorPrefab.transform.Find("Holder")).GetComponent<RotateAroundAxis>().fastRotationSpeed = 60f;
((Component)technicianTrackingIndicatorPrefab.transform.Find("Holder")).GetComponent<RotateAroundAxis>().slowRotationSpeed = 30f;
Object.DestroyImmediate((Object)(object)((Component)technicianTrackingIndicatorPrefab.transform.Find("Holder")).GetComponent<ObjectScaleCurve>());
GameObject[] array = Utils.FindChildrenWithTerm(technicianTrackingIndicatorPrefab.transform.Find("Holder"), "Nib Holder");
array[0].transform.localEulerAngles = Vector3.zero;
array[1].transform.localEulerAngles = Vector3.zero;
((Component)array[0].transform.Find("Nib")).transform.localPosition = new Vector3(0.22f, 0f, 0f);
((Component)array[1].transform.Find("Nib")).transform.localPosition = new Vector3(-0.22f, 0f, 0f);
((Component)array[0].transform.Find("Nib")).transform.localEulerAngles = new Vector3(0f, 0f, 90f);
((Component)array[1].transform.Find("Nib")).transform.localEulerAngles = new Vector3(0f, 0f, 270f);
((Component)array[0].transform.Find("Nib")).transform.localScale = new Vector3(0.15f, 0.15f, 1f);
((Component)array[1].transform.Find("Nib")).transform.localScale = new Vector3(0.15f, 0.15f, 1f);
((Component)array[0].transform.Find("Nib")).GetComponent<SpriteRenderer>().sprite = GetSprite("texCrosshairTrackerBracket");
((Component)array[1].transform.Find("Nib")).GetComponent<SpriteRenderer>().sprite = GetSprite("texCrosshairTrackerBracket");
((Component)array[0].transform.Find("Nib")).GetComponent<SpriteRenderer>().color = new Color(1f, 1f, 0.375f, 0.286f);
((Component)array[1].transform.Find("Nib")).GetComponent<SpriteRenderer>().color = new Color(1f, 1f, 0.375f, 0.286f);
Object.DestroyImmediate((Object)(object)array[2]);
ragdollMaterial = ((Component)Addressables.LoadAssetAsync<GameObject>((object)"64ee0a4463fdfdc41ac7a06c8f5f2f0f").WaitForCompletion().GetComponentInChildren<RagdollController>()
.bones[1]).GetComponent<Collider>().material;
scarfDynamicBone = Utils.FindChildByName(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/LunarSun/DisplaySunHeadNeck.prefab").WaitForCompletion().transform, "Bandage1").GetComponent<DynamicBone>();
dronePingIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texDroneIconOutlined.png");
inventoryPingIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texInventoryIconOutlined.png");
lootPingIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texLootIconOutlined.png");
shrinePingIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texShrineIconOutlined.png");
teleporterPingIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texTeleporterIconOutlined.png");
mysteryPingIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texMysteryIcon.png");
chestInspectIcon = FetchAsset<Sprite>("RoR2/Base/ChestIcon_1.png");
droneInspectIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texDroneIconOutlined.png");
lunarInspectIcon = FetchAsset<Sprite>("RoR2/Base/LunarIcon_1.png");
pillarInspectIcon = FetchAsset<Sprite>("RoR2/Base/PillarIcon.png");
printerInspectIcon = FetchAsset<Sprite>("RoR2/Base/PrinterIcon_1.png");
radioScannerInspectIcon = FetchAsset<Sprite>("RoR2/Base/RadioScannerIcon_2.png");
scapperInspectIcon = FetchAsset<Sprite>("RoR2/Base/ScrapperIcon.png");
shrineInspectIcon = FetchAsset<Sprite>("RoR2/Base/ShrineIcon.png");
meridianInspectIcon = FetchAsset<Sprite>("RoR2/DLC2/texColossusExpansionIcon.png");
voidInspectIcon = FetchAsset<Sprite>("RoR2/Base/VoidIcon_2.png");
mysteryInspectIcon = FetchAsset<Sprite>("RoR2/Base/Common/MiscIcons/texMysteryIcon.png");
chanceShrineSymbolMaterial = FetchAsset<Material>("RoR2/Base/ShrineChance/matShrineChanceSymbol.mat");
sotvDef = FetchAsset<ExpansionDef>("RoR2/DLC1/Common/DLC1.asset");
sotsDef = FetchAsset<ExpansionDef>("RoR2/DLC2/Common/DLC2.asset");
if (Utils.verboseConsole)
{
Log.Debug("[ASSETS] - Fetched all needed resources from RoR2 assets.");
}
}
public static string FindAsset(string _file)
{
_file = _file.ToLower();
string[] allAssetNames = assetBundle.GetAllAssetNames();
foreach (string text in allAssetNames)
{
if (text.ToLower().Contains(_file))
{
return text;
}
}
return null;
}
public static bool HasAsset(string _name)
{
string text = FindAsset(_name);
return text != null;
}
public static void LogRoR2Resources()
{
List<KeyValuePair<string, string>> list = new List<KeyValuePair<string, string>>();
LegacyResourcesAPI.GetAllPathGuidPairs(list);
foreach (KeyValuePair<string, string> item in list)
{
Log.Debug("[ASSETS] - Resource found: '" + item.Key + "' | GUID: " + item.Value);
}
}
public static void FindRoR2Resources(string _searchTerm)
{
List<KeyValuePair<string, string>> list = new List<KeyValuePair<string, string>>();
LegacyResourcesAPI.GetAllPathGuidPairs(list);
string text = "\n[ASSETS]\n====================\nAttempting to find resources with search term: '" + _searchTerm + "'\n--------------------";
bool flag = false;
foreach (KeyValuePair<string, string> item in list)
{
if (item.Key.ToUpper().Contains(_searchTerm.ToUpper()))
{
flag = true;
text = text + "\nResource found: '" + item.Key + "' | GUID: " + item.Value;
}
}
text += (flag ? "\n====================" : "\nNo resources found...\n====================");
Log.Info(text);
}
public static T FetchAsset<T>(string _path)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
return Addressables.LoadAssetAsync<T>((object)_path).WaitForCompletion();
}
public static Sprite GetIcon(string _name)
{
string text = _name + ".png";
string text2 = FindAsset(text);
if (text2 == null)
{
if (Utils.verboseConsole)
{
Log.Error("Requested asset '" + text + "' could not be found.");
}
_name = _name.ToLower();
return assetBundle.LoadAsset<Sprite>(_name.Contains("buff") ? FindAsset("texbufftemporalcube") : (_name.Contains("consumed") ? FindAsset("textemporalcubeconsumedicon") : FindAsset("textemporalcubeicon")));
}
return assetBundle.LoadAsset<Sprite>(text2);
}
public static GameObject GetCrosshair(string _crosshairName)
{
GameObject val = LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/" + _crosshairName + "Crosshair");
if ((Object)(object)val == (Object)null)
{
Log.Error("Crosshair '" + _crosshairName + "' could not be found - defaulting to standard crosshair.");
return LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/StandardCrosshair");
}
return val;
}
public static GameObject GetObject(string _name, string _default = null)
{
string text = _name + ".prefab";
string text2 = FindAsset(text);
if (text2 == null)
{
if (Utils.verboseConsole)
{
Log.Error("Requested asset '" + text + "' could not be found.");
}
if (_default != null)
{
return assetBundle.LoadAsset<GameObject>(_default);
}
return null;
}
return assetBundle.LoadAsset<GameObject>(text2);
}
public static Mesh GetMesh(string _name, string _default = null)
{
string text = _name + ".prefab";
string text2 = FindAsset(text);
GameObject val = null;
if (text2 == null)
{
if (Utils.verboseConsole)
{
Log.Error("Requested asset '" + text + "' could not be found.");
}
if (_default != null)
{
val = assetBundle.LoadAsset<GameObject>(_default);
}
}
else
{
val = assetBundle.LoadAsset<GameObject>(text2);
}
if ((Object)(object)val == (Object)null)
{
return null;
}
MeshFilter component = val.GetComponent<MeshFilter>();
if ((Object)(object)component == (Object)null)
{
Log.Error("[ASSETS] | Unable to get mesh for asset '" + text + "' - Mesh filter component not found!");
return null;
}
return component.sharedMesh;
}
public static GameObject GetModel(string _name)
{
return GetObject(_name, "temporalcubemesh");
}
public static Texture GetTexture(string _name)
{
string text = _name + ".png";
string text2 = FindAsset(text);
if (text2 == null)
{
Log.Error("Requested asset '" + text + "' could not be found.");
return null;
}
return assetBundle.LoadAsset<Texture>(text2);
}
public static Sprite GetSprite(string _name)
{
string text = _name + ".png";
string text2 = FindAsset(text);
if (text2 == null)
{
Log.Error("Requested asset '" + text + "' could not be found.");
return null;
}
return assetBundle.LoadAsset<Sprite>(text2);
}
public static Material GetMaterial(string _name)
{
string text = _name + ".mat";
string text2 = FindAsset(text);
if (text2 == null)
{
Log.Error("Requested asset '" + text + "' could not be found.");
return null;
}
return assetBundle.LoadAsset<Material>(text2);
}
public static Shader GetShader(string _name)
{
string text = _name + ".shader";
string text2 = FindAsset(text);
if (text2 == null)
{
Log.Error("Requested asset '" + text + "' could not be found.");
return null;
}
return assetBundle.LoadAsset<Shader>(text2);
}
public static Material GetShrineSymbolMaterial(Texture _texture, Color _colour)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
Material val = new Material(chanceShrineSymbolMaterial);
val.SetTexture("_MainTex", _texture);
val.SetColor("_TintColor", _colour);
return val;
}
public static GameObject GetClonedDopplegangerMaster(GameObject _bodyPrefab, string _masterName, string _masterToCopy)
{
GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/" + _masterToCopy + "MonsterMaster"), _masterName, true);
val.GetComponent<CharacterMaster>().bodyPrefab = _bodyPrefab;
ContentAddition.AddMaster(val);
return val;
}
}
internal delegate void Callback();
internal delegate void InHoldoutZoneCallback(CharacterBody _contained, HoldoutZoneController _zone);
internal delegate void OnHoldoutZoneStartCallback(HoldoutZoneController _zone);
internal delegate void OnHoldoutZoneCalcRadiusCallback(ref float _radius, HoldoutZoneController _zone);
internal delegate void StatsModCallback(int _count, StatHookEventArgs _stats);
internal delegate void OnIncomingDamageCallback(DamageInfo _report, CharacterMaster _attacker, CharacterMaster _victim);
internal delegate void OnHitEnemyCallback(DamageInfo _info, GameObject _victim);
internal delegate void OnTakeDamageProcessCallback(HealthComponent _healthComponent, DamageInfo _info);
internal delegate void DamageReportCallback(DamageReport _report);
internal delegate void OnAddBuffCallback(BuffIndex _buff, CharacterBody _character);
internal delegate void OnAddTimedBuffCallback(BuffDef _buff, ref float _duration, CharacterBody _character);
internal delegate void OnAddTimedBuffMaxStacksCallback(BuffDef _buff, ref float _duration, ref int _maxStacks, CharacterBody _character);
internal delegate void OnExtendTimedBuffsCallback(BuffDef _buff, ref float _duration, ref float _max, CharacterBody _character);
internal delegate void OnSetTimedBuffDurationCallback(BuffDef _buff, ref float _duration, bool _allStacks, CharacterBody _character);
internal delegate void OnInflictDamageOverTimeCallback(GameObject _victimObject, GameObject _attackerObject, DotIndex _dotIndex, float _duration, float _damageMultiplier, uint? _maxStacksFromAttacker);
internal delegate void OnInflictDamageOverTimeRefCallback(ref InflictDotInfo _inflictDotInfo);
internal delegate void OnTransferItemCallback(Inventory _inventory, ItemIndex _index, int _count);
internal delegate void OnTransferItemFloatCallback(Inventory _inventory, ItemIndex _index, float _count);
internal delegate void OnInventoryCallback(Inventory _inventory);
internal delegate void OnHealCallback(HealthComponent _healthComponent, ref float _amount, ref ProcChainMask _procChainMask, ref bool _nonRegen);
internal delegate void CharacterBodyCallback(CharacterBody _body);
internal delegate void OnPurchaseInteractionBeginCallback(PurchaseInteraction _shop, CharacterMaster _activator);
internal delegate bool OnPurchaseCanBeAffordedCallback(PurchaseInteraction _shop, CharacterMaster _activator);
internal delegate void InteractorCallback(Interactor _interactor);
internal delegate void FaithfulInteractorCallback(FaithfulInteractableBehaviour _behaviour, Interactor _interactor);
internal delegate void OnProcessJumpCallback(GenericCharacterMain _character);
internal delegate void PlayerToPlayerCallback(PlayerCharacterMasterController _player1, PlayerCharacterMasterController _player2);
internal delegate void PlayerHolderToPlayerCallback(int _count, PlayerCharacterMasterController _holder, PlayerCharacterMasterController _other);
internal delegate void AllyHolderToAllyCallback(int _count, CharacterMaster _holder, CharacterMaster _other);
internal delegate void GenericCharacterCallback(GenericCharacterMain _character);
internal delegate void SceneDirectorCallback(SceneDirector _director);
internal delegate void SceneExitControllerCallback(SceneExitController _exitController);
internal static class Behaviour
{
[CompilerGenerated]
private static class <>O
{
public static hook_Update <0>__HookHoldoutZoneControllerUpdate;
public static hook_Start <1>__HookHoldoutZoneControllerStart;
public static hook_Awake <2>__HookCharacterBodyAwake;
public static hook_Start <3>__HookCharacterBodyStart;
public static hook_AddBuff_BuffIndex <4>__HookAddBuffIndex;
public static hook_AddTimedBuff_BuffDef_float <5>__HookAddTimedBuffDef;
public static hook_AddTimedBuff_BuffDef_float_int <6>__HookAddTimedBuffDefMaxStacks;
public static hook_ExtendTimedBuffIfPresent_BuffDef_float_float <7>__HookExtendTimedBuffs;
public static hook_SetTimedBuffDurationIfPresent <8>__HookSetTimedBuffDuration;
public static hook_GiveItemPermanent_ItemIndex_int <9>__HookServerGiveItemPermanent;
public static hook_GiveItemTemp <10>__HookServerGiveItemTemporary;
public static hook_RemoveItem_ItemIndex_int <11>__HookServerRemoveItem;
public static hook_HandleInventoryChanged <12>__HookInventoryChanged;
public static hook_RpcItemAdded <13>__HookItemAdded;
public static hook_InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1 <14>__HookInflictDamageOverTime;
public static hook_InflictDot_refInflictDotInfo <15>__HookInflictDamageOverTimeRef;
public static hook_Awake <16>__HookHealthComponentAwake;
public static hook_Heal <17>__HookHeal;
public static hook_TakeDamageProcess <18>__HookTakeDamageProcess;
public static hook_RecalculateStats <19>__HookRecalculateStats;
public static hook_UpdateAllTemporaryVisualEffects <20>__HookUpdateVisualEffects;
public static hook_FixedUpdate <21>__HookCharacterBodyFixedUpdate;
public static hook_RollCrit <22>__HookCharacterBodyRollCrit;
public static hook_OnInteractionBegin <23>__HookPurchaseInteractionBegin;
public static hook_CanBeAffordedByInteractor <24>__HookPurchaseCanBeAfforded;
public static hook_ProcessJump <25>__HookProcessJump;
public static hook_FixedUpdate <26>__HookGenericCharacterFixedUpdate;
public static hook_SetState <27>__HookSceneExitControllerSetState;
public static hook_OnHitEnemy <28>__HookOnHitEnemy;
public static StatHookEventHandler <29>__HookStatsMod;
public static Action<DamageReport> <30>__HookOnDamageDealt;
public static Action<DamageReport> <31>__HookOnCharacterDeath;
public static Action<SceneDirector> <32>__HookPrePopulateScene;
}
private static bool enabled = false;
internal static GameObject characterBodyHelperPrefab;
private static List<Callback> updateCallbacks = new List<Callback>();
private static List<Callback> debugUpdateCallbacks = new List<Callback>();
private static List<Callback> fixedUpdateCallbacks = new List<Callback>();
private static List<Callback> debugFixedUpdateCallbacks = new List<Callback>();
private static List<InHoldoutZoneCallback> inHoldoutZoneCallbacks = new List<InHoldoutZoneCallback>();
private static List<OnHoldoutZoneStartCallback> onHoldoutZoneStartCallbacks = new List<OnHoldoutZoneStartCallback>();
private static List<OnHoldoutZoneCalcRadiusCallback> onHoldoutZoneCalcRadiusCallbacks = new List<OnHoldoutZoneCalcRadiusCallback>();
private static List<ItemStatsMod> itemStatsMods = new List<ItemStatsMod>();
private static List<BuffStatsMod> buffStatsMods = new List<BuffStatsMod>();
private static List<OnIncomingDamageCallback> onIncomingDamageCallbacks = new List<OnIncomingDamageCallback>();
private static List<OnHitEnemyCallback> onHitEnemyLateCallbacks = new List<OnHitEnemyCallback>();
private static List<OnTakeDamageProcessCallback> onTakeDamageProcessCallbacks = new List<OnTakeDamageProcessCallback>();
private static List<DamageReportCallback> onDamageDealtCallbacks = new List<DamageReportCallback>();
private static List<DamageReportCallback> onCharacterDeathCallbacks = new List<DamageReportCallback>();
private static List<OnAddBuffCallback> onAddBuffCallbacks = new List<OnAddBuffCallback>();
private static List<OnAddTimedBuffCallback> onAddTimedBuffCallbacks = new List<OnAddTimedBuffCallback>();
private static List<OnAddTimedBuffMaxStacksCallback> onAddTimedBuffMaxStacksCallbacks = new List<OnAddTimedBuffMaxStacksCallback>();
private static List<OnExtendTimedBuffsCallback> onExtendTimedBuffsCallbacks = new List<OnExtendTimedBuffsCallback>();
private static List<OnSetTimedBuffDurationCallback> onSetTimedBuffDurationCallbacks = new List<OnSetTimedBuffDurationCallback>();
private static List<OnInflictDamageOverTimeCallback> onInflictDamageOverTimeCallbacks = new List<OnInflictDamageOverTimeCallback>();
private static List<OnInflictDamageOverTimeRefCallback> onInflictDamageOverTimeRefCallbacks = new List<OnInflictDamageOverTimeRefCallback>();
private static List<OnTransferItemCallback> onGiveItemPermanentCallbacks = new List<OnTransferItemCallback>();
private static List<OnTransferItemCallback> onGiveItemPermanentLateCallbacks = new List<OnTransferItemCallback>();
private static List<OnTransferItemFloatCallback> onGiveItemTemporaryCallbacks = new List<OnTransferItemFloatCallback>();
private static List<OnTransferItemFloatCallback> onGiveItemTemporaryLateCallbacks = new List<OnTransferItemFloatCallback>();
private static List<OnTransferItemCallback> onRemoveItemCallbacks = new List<OnTransferItemCallback>();
private static List<OnInventoryCallback> onInventoryChangedCallbacks = new List<OnInventoryCallback>();
private static Dictionary<ItemDef, List<OnInventoryCallback>> onItemAddedCallbacks = new Dictionary<ItemDef, List<OnInventoryCallback>>();
private static List<OnHealCallback> onHealCallbacks = new List<OnHealCallback>();
private static List<CharacterBodyCallback> onCharacterBodyAwakeCallbacks = new List<CharacterBodyCallback>();
private static List<CharacterBodyCallback> onCharacterBodyStartCallbacks = new List<CharacterBodyCallback>();
private static List<CharacterBodyCallback> onRecalculateStatsCallbacks = new List<CharacterBodyCallback>();
private static List<CharacterBodyCallback> onUpdateVisualEffectsCallbacks = new List<CharacterBodyCallback>();
private static List<CharacterBodyCallback> onCharacterBodyFixedUpdateCallbacks = new List<CharacterBodyCallback>();
private static Dictionary<float, CharacterBodyCallback> onCharacterBodyTickCallbacks = new Dictionary<float, CharacterBodyCallback>();
private static List<OnPurchaseInteractionBeginCallback> onPurchaseInteractionBeginCallbacks = new List<OnPurchaseInteractionBeginCallback>();
private static List<OnPurchaseCanBeAffordedCallback> onPurchaseCanBeAffordedCallbacks = new List<OnPurchaseCanBeAffordedCallback>();
private static List<OnProcessJumpCallback> onProcessJumpCallbacks = new List<OnProcessJumpCallback>();
private static List<PlayerToPlayerCallback> playerToPlayerCallbacks = new List<PlayerToPlayerCallback>();
private static List<PlayerItemToPlayer> playerItemToPlayerCallbacks = new List<PlayerItemToPlayer>();
private static List<PlayerBuffToPlayer> playerBuffToPlayerCallbacks = new List<PlayerBuffToPlayer>();
private static List<AllyItemToAlly> allyItemToAllyCallbacks = new List<AllyItemToAlly>();
private static List<AllyBuffToAlly> allyBuffToAllyCallbacks = new List<AllyBuffToAlly>();
private static List<GenericCharacterCallback> genericCharacterFixedUpdateCallbacks = new List<GenericCharacterCallback>();
private static List<SceneDirectorCallback> onPrePopulateSceneCallbacks = new List<SceneDirectorCallback>();
private static List<SceneExitControllerCallback> onPreSceneExitCallbacks = new List<SceneExitControllerCallback>();
private static Dictionary<CharacterBody, int> critOverrideCounts = new Dictionary<CharacterBody, int>();
public static void Init()
{
CreatePrefabs();
Enable();
DebugLog("Behaviour initialised");
}
public static void Enable()
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Expected O, but got Unknown
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: 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_0093: Expected O, but got Unknown
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Expected O, but got Unknown
//IL_00ca: 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_00d5: Expected O, but got Unknown
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Expected O, but got Unknown
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Expected O, but got Unknown
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_0159: Expected O, but got Unknown
//IL_016f: Unknown result type (might be due to invalid IL or missing references)
//IL_0174: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Expected O, but got Unknown
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Expected O, but got Unknown
//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Expected O, but got Unknown
//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Expected O, but got Unknown
//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
//IL_01fe: Expected O, but got Unknown
//IL_0214: Unknown result type (might be due to invalid IL or missing references)
//IL_0219: Unknown result type (might be due to invalid IL or missing references)
//IL_021f: Expected O, but got Unknown
//IL_0235: Unknown result type (might be due to invalid IL or missing references)
//IL_023a: Unknown result type (might be due to invalid IL or missing references)
//IL_0240: Expected O, but got Unknown
//IL_0256: Unknown result type (might be due to invalid IL or missing references)
//IL_025b: Unknown result type (might be due to invalid IL or missing references)
//IL_0261: Expected O, but got Unknown
//IL_0277: Unknown result type (might be due to invalid IL or missing references)
//IL_027c: Unknown result type (might be due to invalid IL or missing references)
//IL_0282: Expected O, but got Unknown
//IL_0298: Unknown result type (might be due to invalid IL or missing references)
//IL_029d: Unknown result type (might be due to invalid IL or missing references)
//IL_02a3: Expected O, but got Unknown
//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
//IL_02be: Unknown result type (might be due to invalid IL or missing references)
//IL_02c4: Expected O, but got Unknown
//IL_02da: Unknown result type (might be due to invalid IL or missing references)
//IL_02df: Unknown result type (might be due to invalid IL or missing references)
//IL_02e5: Expected O, but got Unknown
//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0300: Unknown result type (might be due to invalid IL or missing references)
//IL_0306: Expected O, but got Unknown
//IL_031c: Unknown result type (might be due to invalid IL or missing references)
//IL_0321: Unknown result type (might be due to invalid IL or missing references)
//IL_0327: Expected O, but got Unknown
//IL_033d: Unknown result type (might be due to invalid IL or missing references)
//IL_0342: Unknown result type (might be due to invalid IL or missing references)
//IL_0348: Expected O, but got Unknown
//IL_035e: Unknown result type (might be due to invalid IL or missing references)
//IL_0363: Unknown result type (might be due to invalid IL or missing references)
//IL_0369: Expected O, but got Unknown
//IL_037f: Unknown result type (might be due to invalid IL or missing references)
//IL_0384: Unknown result type (might be due to invalid IL or missing references)
//IL_038a: Expected O, but got Unknown
//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
//IL_03ab: Expected O, but got Unknown
//IL_03c1: Unknown result type (might be due to invalid IL or missing references)
//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
//IL_03cc: Expected O, but got Unknown
//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
//IL_03e7: Unknown result type (might be due to invalid IL or missing references)
//IL_03ed: Expected O, but got Unknown
if (!enabled)
{
enabled = true;
object obj = <>O.<0>__HookHoldoutZoneControllerUpdate;
if (obj == null)
{
hook_Update val = HookHoldoutZoneControllerUpdate;
<>O.<0>__HookHoldoutZoneControllerUpdate = val;
obj = (object)val;
}
HoldoutZoneController.Update += (hook_Update)obj;
object obj2 = <>O.<1>__HookHoldoutZoneControllerStart;
if (obj2 == null)
{
hook_Start val2 = HookHoldoutZoneControllerStart;
<>O.<1>__HookHoldoutZoneControllerStart = val2;
obj2 = (object)val2;
}
HoldoutZoneController.Start += (hook_Start)obj2;
object obj3 = <>O.<2>__HookCharacterBodyAwake;
if (obj3 == null)
{
hook_Awake val3 = HookCharacterBodyAwake;
<>O.<2>__HookCharacterBodyAwake = val3;
obj3 = (object)val3;
}
CharacterBody.Awake += (hook_Awake)obj3;
object obj4 = <>O.<3>__HookCharacterBodyStart;
if (obj4 == null)
{
hook_Start val4 = HookCharacterBodyStart;
<>O.<3>__HookCharacterBodyStart = val4;
obj4 = (object)val4;
}
CharacterBody.Start += (hook_Start)obj4;
object obj5 = <>O.<4>__HookAddBuffIndex;
if (obj5 == null)
{
hook_AddBuff_BuffIndex val5 = HookAddBuffIndex;
<>O.<4>__HookAddBuffIndex = val5;
obj5 = (object)val5;
}
CharacterBody.AddBuff_BuffIndex += (hook_AddBuff_BuffIndex)obj5;
object obj6 = <>O.<5>__HookAddTimedBuffDef;
if (obj6 == null)
{
hook_AddTimedBuff_BuffDef_float val6 = HookAddTimedBuffDef;
<>O.<5>__HookAddTimedBuffDef = val6;
obj6 = (object)val6;
}
CharacterBody.AddTimedBuff_BuffDef_float += (hook_AddTimedBuff_BuffDef_float)obj6;
object obj7 = <>O.<6>__HookAddTimedBuffDefMaxStacks;
if (obj7 == null)
{
hook_AddTimedBuff_BuffDef_float_int val7 = HookAddTimedBuffDefMaxStacks;
<>O.<6>__HookAddTimedBuffDefMaxStacks = val7;
obj7 = (object)val7;
}
CharacterBody.AddTimedBuff_BuffDef_float_int += (hook_AddTimedBuff_BuffDef_float_int)obj7;
object obj8 = <>O.<7>__HookExtendTimedBuffs;
if (obj8 == null)
{
hook_ExtendTimedBuffIfPresent_BuffDef_float_float val8 = HookExtendTimedBuffs;
<>O.<7>__HookExtendTimedBuffs = val8;
obj8 = (object)val8;
}
CharacterBody.ExtendTimedBuffIfPresent_BuffDef_float_float += (hook_ExtendTimedBuffIfPresent_BuffDef_float_float)obj8;
object obj9 = <>O.<8>__HookSetTimedBuffDuration;
if (obj9 == null)
{
hook_SetTimedBuffDurationIfPresent val9 = HookSetTimedBuffDuration;
<>O.<8>__HookSetTimedBuffDuration = val9;
obj9 = (object)val9;
}
CharacterBody.SetTimedBuffDurationIfPresent += (hook_SetTimedBuffDurationIfPresent)obj9;
object obj10 = <>O.<9>__HookServerGiveItemPermanent;
if (obj10 == null)
{
hook_GiveItemPermanent_ItemIndex_int val10 = HookServerGiveItemPermanent;
<>O.<9>__HookServerGiveItemPermanent = val10;
obj10 = (object)val10;
}
Inventory.GiveItemPermanent_ItemIndex_int += (hook_GiveItemPermanent_ItemIndex_int)obj10;
object obj11 = <>O.<10>__HookServerGiveItemTemporary;
if (obj11 == null)
{
hook_GiveItemTemp val11 = HookServerGiveItemTemporary;
<>O.<10>__HookServerGiveItemTemporary = val11;
obj11 = (object)val11;
}
Inventory.GiveItemTemp += (hook_GiveItemTemp)obj11;
object obj12 = <>O.<11>__HookServerRemoveItem;
if (obj12 == null)
{
hook_RemoveItem_ItemIndex_int val12 = HookServerRemoveItem;
<>O.<11>__HookServerRemoveItem = val12;
obj12 = (object)val12;
}
Inventory.RemoveItem_ItemIndex_int += (hook_RemoveItem_ItemIndex_int)obj12;
object obj13 = <>O.<12>__HookInventoryChanged;
if (obj13 == null)
{
hook_HandleInventoryChanged val13 = HookInventoryChanged;
<>O.<12>__HookInventoryChanged = val13;
obj13 = (object)val13;
}
Inventory.HandleInventoryChanged += (hook_HandleInventoryChanged)obj13;
object obj14 = <>O.<13>__HookItemAdded;
if (obj14 == null)
{
hook_RpcItemAdded val14 = HookItemAdded;
<>O.<13>__HookItemAdded = val14;
obj14 = (object)val14;
}
Inventory.RpcItemAdded += (hook_RpcItemAdded)obj14;
object obj15 = <>O.<14>__HookInflictDamageOverTime;
if (obj15 == null)
{
hook_InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1 val15 = HookInflictDamageOverTime;
<>O.<14>__HookInflictDamageOverTime = val15;
obj15 = (object)val15;
}
DotController.InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1 += (hook_InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1)obj15;
object obj16 = <>O.<15>__HookInflictDamageOverTimeRef;
if (obj16 == null)
{
hook_InflictDot_refInflictDotInfo val16 = HookInflictDamageOverTimeRef;
<>O.<15>__HookInflictDamageOverTimeRef = val16;
obj16 = (object)val16;
}
DotController.InflictDot_refInflictDotInfo += (hook_InflictDot_refInflictDotInfo)obj16;
object obj17 = <>O.<16>__HookHealthComponentAwake;
if (obj17 == null)
{
hook_Awake val17 = HookHealthComponentAwake;
<>O.<16>__HookHealthComponentAwake = val17;
obj17 = (object)val17;
}
HealthComponent.Awake += (hook_Awake)obj17;
object obj18 = <>O.<17>__HookHeal;
if (obj18 == null)
{
hook_Heal val18 = HookHeal;
<>O.<17>__HookHeal = val18;
obj18 = (object)val18;
}
HealthComponent.Heal += (hook_Heal)obj18;
object obj19 = <>O.<18>__HookTakeDamageProcess;
if (obj19 == null)
{
hook_TakeDamageProcess val19 = HookTakeDamageProcess;
<>O.<18>__HookTakeDamageProcess = val19;
obj19 = (object)val19;
}
HealthComponent.TakeDamageProcess += (hook_TakeDamageProcess)obj19;
object obj20 = <>O.<19>__HookRecalculateStats;
if (obj20 == null)
{
hook_RecalculateStats val20 = HookRecalculateStats;
<>O.<19>__HookRecalculateStats = val20;
obj20 = (object)val20;
}
CharacterBody.RecalculateStats += (hook_RecalculateStats)obj20;
object obj21 = <>O.<20>__HookUpdateVisualEffects;
if (obj21 == null)
{
hook_UpdateAllTemporaryVisualEffects val21 = HookUpdateVisualEffects;
<>O.<20>__HookUpdateVisualEffects = val21;
obj21 = (object)val21;
}
CharacterBody.UpdateAllTemporaryVisualEffects += (hook_UpdateAllTemporaryVisualEffects)obj21;
object obj22 = <>O.<21>__HookCharacterBodyFixedUpdate;
if (obj22 == null)
{
hook_FixedUpdate val22 = HookCharacterBodyFixedUpdate;
<>O.<21>__HookCharacterBodyFixedUpdate = val22;
obj22 = (object)val22;
}
CharacterBody.FixedUpdate += (hook_FixedUpdate)obj22;
object obj23 = <>O.<22>__HookCharacterBodyRollCrit;
if (obj23 == null)
{
hook_RollCrit val23 = HookCharacterBodyRollCrit;
<>O.<22>__HookCharacterBodyRollCrit = val23;
obj23 = (object)val23;
}
CharacterBody.RollCrit += (hook_RollCrit)obj23;
object obj24 = <>O.<23>__HookPurchaseInteractionBegin;
if (obj24 == null)
{
hook_OnInteractionBegin val24 = HookPurchaseInteractionBegin;
<>O.<23>__HookPurchaseInteractionBegin = val24;
obj24 = (object)val24;
}
PurchaseInteraction.OnInteractionBegin += (hook_OnInteractionBegin)obj24;
object obj25 = <>O.<24>__HookPurchaseCanBeAfforded;
if (obj25 == null)
{
hook_CanBeAffordedByInteractor val25 = HookPurchaseCanBeAfforded;
<>O.<24>__HookPurchaseCanBeAfforded = val25;
obj25 = (object)val25;
}
PurchaseInteraction.CanBeAffordedByInteractor += (hook_CanBeAffordedByInteractor)obj25;
object obj26 = <>O.<25>__HookProcessJump;
if (obj26 == null)
{
hook_ProcessJump val26 = HookProcessJump;
<>O.<25>__HookProcessJump = val26;
obj26 = (object)val26;
}
GenericCharacterMain.ProcessJump += (hook_ProcessJump)obj26;
object obj27 = <>O.<26>__HookGenericCharacterFixedUpdate;
if (obj27 == null)
{
hook_FixedUpdate val27 = HookGenericCharacterFixedUpdate;
<>O.<26>__HookGenericCharacterFixedUpdate = val27;
obj27 = (object)val27;
}
GenericCharacterMain.FixedUpdate += (hook_FixedUpdate)obj27;
object obj28 = <>O.<27>__HookSceneExitControllerSetState;
if (obj28 == null)
{
hook_SetState val28 = HookSceneExitControllerSetState;
<>O.<27>__HookSceneExitControllerSetState = val28;
obj28 = (object)val28;
}
SceneExitController.SetState += (hook_SetState)obj28;
object obj29 = <>O.<28>__HookOnHitEnemy;
if (obj29 == null)
{
hook_OnHitEnemy val29 = HookOnHitEnemy;
<>O.<28>__HookOnHitEnemy = val29;
obj29 = (object)val29;
}
GlobalEventManager.OnHitEnemy += (hook_OnHitEnemy)obj29;
object obj30 = <>O.<29>__HookStatsMod;
if (obj30 == null)
{
StatHookEventHandler val30 = HookStatsMod;
<>O.<29>__HookStatsMod = val30;
obj30 = (object)val30;
}
RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj30;
GlobalEventManager.onServerDamageDealt += HookOnDamageDealt;
GlobalEventManager.onCharacterDeathGlobal += HookOnCharacterDeath;
SceneDirector.onPrePopulateSceneServer += HookPrePopulateScene;
}
}
public static void Disable()
{
//IL_0028: 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_0033: Expected O, but got Unknown
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected O, but got Unknown
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Expected O, but got Unknown
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Expected O, but got Unknown
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Expected O, but got Unknown
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Expected O, but got Unknown
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Expected O, but got Unknown
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_011a: Expected O, but got Unknown
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Expected O, but got Unknown
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_015c: Expected O, but got Unknown
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_017d: Expected O, but got Unknown
//IL_0193: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_019e: Expected O, but got Unknown
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
//IL_01bf: Expected O, but got Unknown
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_01da: Unknown result type (might be due to invalid IL or missing references)
//IL_01e0: Expected O, but got Unknown
//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0201: Expected O, but got Unknown
//IL_0217: Unknown result type (might be due to invalid IL or missing references)
//IL_021c: Unknown result type (might be due to invalid IL or missing references)
//IL_0222: Expected O, but got Unknown
//IL_0238: Unknown result type (might be due to invalid IL or missing references)
//IL_023d: Unknown result type (might be due to invalid IL or missing references)
//IL_0243: Expected O, but got Unknown
//IL_0259: Unknown result type (might be due to invalid IL or missing references)
//IL_025e: Unknown result type (might be due to invalid IL or missing references)
//IL_0264: Expected O, but got Unknown
//IL_027a: Unknown result type (might be due to invalid IL or missing references)
//IL_027f: Unknown result type (might be due to invalid IL or missing references)
//IL_0285: Expected O, but got Unknown
//IL_029b: Unknown result type (might be due to invalid IL or missing references)
//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
//IL_02a6: Expected O, but got Unknown
//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
//IL_02c7: Expected O, but got Unknown
//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
//IL_02e8: Expected O, but got Unknown
//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0303: Unknown result type (might be due to invalid IL or missing references)
//IL_0309: Expected O, but got Unknown
//IL_031f: Unknown result type (might be due to invalid IL or missing references)
//IL_0324: Unknown result type (might be due to invalid IL or missing references)
//IL_032a: Expected O, but got Unknown
//IL_0340: Unknown result type (might be due to invalid IL or missing references)
//IL_0345: Unknown result type (might be due to invalid IL or missing references)
//IL_034b: Expected O, but got Unknown
//IL_0361: Unknown result type (might be due to invalid IL or missing references)
//IL_0366: Unknown result type (might be due to invalid IL or missing references)
//IL_036c: Expected O, but got Unknown
//IL_0382: Unknown result type (might be due to invalid IL or missing references)
//IL_0387: Unknown result type (might be due to invalid IL or missing references)
//IL_038d: Expected O, but got Unknown
if (enabled)
{
enabled = false;
object obj = <>O.<0>__HookHoldoutZoneControllerUpdate;
if (obj == null)
{
hook_Update val = HookHoldoutZoneControllerUpdate;
<>O.<0>__HookHoldoutZoneControllerUpdate = val;
obj = (object)val;
}
HoldoutZoneController.Update -= (hook_Update)obj;
object obj2 = <>O.<1>__HookHoldoutZoneControllerStart;
if (obj2 == null)
{
hook_Start val2 = HookHoldoutZoneControllerStart;
<>O.<1>__HookHoldoutZoneControllerStart = val2;
obj2 = (object)val2;
}
HoldoutZoneController.Start -= (hook_Start)obj2;
object obj3 = <>O.<2>__HookCharacterBodyAwake;
if (obj3 == null)
{
hook_Awake val3 = HookCharacterBodyAwake;
<>O.<2>__HookCharacterBodyAwake = val3;
obj3 = (object)val3;
}
CharacterBody.Awake -= (hook_Awake)obj3;
object obj4 = <>O.<3>__HookCharacterBodyStart;
if (obj4 == null)
{
hook_Start val4 = HookCharacterBodyStart;
<>O.<3>__HookCharacterBodyStart = val4;
obj4 = (object)val4;
}
CharacterBody.Start -= (hook_Start)obj4;
object obj5 = <>O.<4>__HookAddBuffIndex;
if (obj5 == null)
{
hook_AddBuff_BuffIndex val5 = HookAddBuffIndex;
<>O.<4>__HookAddBuffIndex = val5;
obj5 = (object)val5;
}
CharacterBody.AddBuff_BuffIndex -= (hook_AddBuff_BuffIndex)obj5;
object obj6 = <>O.<5>__HookAddTimedBuffDef;
if (obj6 == null)
{
hook_AddTimedBuff_BuffDef_float val6 = HookAddTimedBuffDef;
<>O.<5>__HookAddTimedBuffDef = val6;
obj6 = (object)val6;
}
CharacterBody.AddTimedBuff_BuffDef_float -= (hook_AddTimedBuff_BuffDef_float)obj6;
object obj7 = <>O.<6>__HookAddTimedBuffDefMaxStacks;
if (obj7 == null)
{
hook_AddTimedBuff_BuffDef_float_int val7 = HookAddTimedBuffDefMaxStacks;
<>O.<6>__HookAddTimedBuffDefMaxStacks = val7;
obj7 = (object)val7;
}
CharacterBody.AddTimedBuff_BuffDef_float_int -= (hook_AddTimedBuff_BuffDef_float_int)obj7;
object obj8 = <>O.<7>__HookExtendTimedBuffs;
if (obj8 == null)
{
hook_ExtendTimedBuffIfPresent_BuffDef_float_float val8 = HookExtendTimedBuffs;
<>O.<7>__HookExtendTimedBuffs = val8;
obj8 = (object)val8;
}
CharacterBody.ExtendTimedBuffIfPresent_BuffDef_float_float -= (hook_ExtendTimedBuffIfPresent_BuffDef_float_float)obj8;
object obj9 = <>O.<8>__HookSetTimedBuffDuration;
if (obj9 == null)
{
hook_SetTimedBuffDurationIfPresent val9 = HookSetTimedBuffDuration;
<>O.<8>__HookSetTimedBuffDuration = val9;
obj9 = (object)val9;
}
CharacterBody.SetTimedBuffDurationIfPresent -= (hook_SetTimedBuffDurationIfPresent)obj9;
object obj10 = <>O.<9>__HookServerGiveItemPermanent;
if (obj10 == null)
{
hook_GiveItemPermanent_ItemIndex_int val10 = HookServerGiveItemPermanent;
<>O.<9>__HookServerGiveItemPermanent = val10;
obj10 = (object)val10;
}
Inventory.GiveItemPermanent_ItemIndex_int -= (hook_GiveItemPermanent_ItemIndex_int)obj10;
object obj11 = <>O.<11>__HookServerRemoveItem;
if (obj11 == null)
{
hook_RemoveItem_ItemIndex_int val11 = HookServerRemoveItem;
<>O.<11>__HookServerRemoveItem = val11;
obj11 = (object)val11;
}
Inventory.RemoveItem_ItemIndex_int -= (hook_RemoveItem_ItemIndex_int)obj11;
object obj12 = <>O.<12>__HookInventoryChanged;
if (obj12 == null)
{
hook_HandleInventoryChanged val12 = HookInventoryChanged;
<>O.<12>__HookInventoryChanged = val12;
obj12 = (object)val12;
}
Inventory.HandleInventoryChanged -= (hook_HandleInventoryChanged)obj12;
object obj13 = <>O.<13>__HookItemAdded;
if (obj13 == null)
{
hook_RpcItemAdded val13 = HookItemAdded;
<>O.<13>__HookItemAdded = val13;
obj13 = (object)val13;
}
Inventory.RpcItemAdded -= (hook_RpcItemAdded)obj13;
object obj14 = <>O.<14>__HookInflictDamageOverTime;
if (obj14 == null)
{
hook_InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1 val14 = HookInflictDamageOverTime;
<>O.<14>__HookInflictDamageOverTime = val14;
obj14 = (object)val14;
}
DotController.InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1 -= (hook_InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1)obj14;
object obj15 = <>O.<15>__HookInflictDamageOverTimeRef;
if (obj15 == null)
{
hook_InflictDot_refInflictDotInfo val15 = HookInflictDamageOverTimeRef;
<>O.<15>__HookInflictDamageOverTimeRef = val15;
obj15 = (object)val15;
}
DotController.InflictDot_refInflictDotInfo -= (hook_InflictDot_refInflictDotInfo)obj15;
object obj16 = <>O.<16>__HookHealthComponentAwake;
if (obj16 == null)
{
hook_Awake val16 = HookHealthComponentAwake;
<>O.<16>__HookHealthComponentAwake = val16;
obj16 = (object)val16;
}
HealthComponent.Awake -= (hook_Awake)obj16;
object obj17 = <>O.<17>__HookHeal;
if (obj17 == null)
{
hook_Heal val17 = HookHeal;
<>O.<17>__HookHeal = val17;
obj17 = (object)val17;
}
HealthComponent.Heal -= (hook_Heal)obj17;
object obj18 = <>O.<18>__HookTakeDamageProcess;
if (obj18 == null)
{
hook_TakeDamageProcess val18 = HookTakeDamageProcess;
<>O.<18>__HookTakeDamageProcess = val18;
obj18 = (object)val18;
}
HealthComponent.TakeDamageProcess -= (hook_TakeDamageProcess)obj18;
object obj19 = <>O.<19>__HookRecalculateStats;
if (obj19 == null)
{
hook_RecalculateStats val19 = HookRecalculateStats;
<>O.<19>__HookRecalculateStats = val19;
obj19 = (object)val19;
}
CharacterBody.RecalculateStats -= (hook_RecalculateStats)obj19;
object obj20 = <>O.<20>__HookUpdateVisualEffects;
if (obj20 == null)
{
hook_UpdateAllTemporaryVisualEffects val20 = HookUpdateVisualEffects;
<>O.<20>__HookUpdateVisualEffects = val20;
obj20 = (object)val20;
}
CharacterBody.UpdateAllTemporaryVisualEffects -= (hook_UpdateAllTemporaryVisualEffects)obj20;
object obj21 = <>O.<21>__HookCharacterBodyFixedUpdate;
if (obj21 == null)
{
hook_FixedUpdate val21 = HookCharacterBodyFixedUpdate;
<>O.<21>__HookCharacterBodyFixedUpdate = val21;
obj21 = (object)val21;
}
CharacterBody.FixedUpdate -= (hook_FixedUpdate)obj21;
object obj22 = <>O.<23>__HookPurchaseInteractionBegin;
if (obj22 == null)
{
hook_OnInteractionBegin val22 = HookPurchaseInteractionBegin;
<>O.<23>__HookPurchaseInteractionBegin = val22;
obj22 = (object)val22;
}
PurchaseInteraction.OnInteractionBegin -= (hook_OnInteractionBegin)obj22;
object obj23 = <>O.<24>__HookPurchaseCanBeAfforded;
if (obj23 == null)
{
hook_CanBeAffordedByInteractor val23 = HookPurchaseCanBeAfforded;
<>O.<24>__HookPurchaseCanBeAfforded = val23;
obj23 = (object)val23;
}
PurchaseInteraction.CanBeAffordedByInteractor -= (hook_CanBeAffordedByInteractor)obj23;
object obj24 = <>O.<25>__HookProcessJump;
if (obj24 == null)
{
hook_ProcessJump val24 = HookProcessJump;
<>O.<25>__HookProcessJump = val24;
obj24 = (object)val24;
}
GenericCharacterMain.ProcessJump -= (hook_ProcessJump)obj24;
object obj25 = <>O.<26>__HookGenericCharacterFixedUpdate;
if (obj25 == null)
{
hook_FixedUpdate val25 = HookGenericCharacterFixedUpdate;
<>O.<26>__HookGenericCharacterFixedUpdate = val25;
obj25 = (object)val25;
}
GenericCharacterMain.FixedUpdate -= (hook_FixedUpdate)obj25;
object obj26 = <>O.<28>__HookOnHitEnemy;
if (obj26 == null)
{
hook_OnHitEnemy val26 = HookOnHitEnemy;
<>O.<28>__HookOnHitEnemy = val26;
obj26 = (object)val26;
}
GlobalEventManager.OnHitEnemy -= (hook_OnHitEnemy)obj26;
object obj27 = <>O.<29>__HookStatsMod;
if (obj27 == null)
{
StatHookEventHandler val27 = HookStatsMod;
<>O.<29>__HookStatsMod = val27;
obj27 = (object)val27;
}
RecalculateStatsAPI.GetStatCoefficients -= (StatHookEventHandler)obj27;
GlobalEventManager.onServerDamageDealt -= HookOnDamageDealt;
GlobalEventManager.onCharacterDeathGlobal -= HookOnCharacterDeath;
SceneDirector.onPrePopulateSceneServer -= HookPrePopulateScene;
}
}
private static void CreatePrefabs()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
GameObject val = new GameObject("temp GO");
val.AddComponent<NetworkIdentity>();
characterBodyHelperPrefab = PrefabAPI.InstantiateClone(val, "faithfulCharacterBodyHelper");
Object.Destroy((Object)(object)val);
characterBodyHelperPrefab.AddComponent<FaithfulCharacterBodyBehaviour>();
characterBodyHelperPrefab.AddComponent<FaithfulTJetpackBehaviour>();
characterBodyHelperPrefab.AddComponent<FaithfulLeadersPennonBehaviour>();
characterBodyHelperPrefab.AddComponent<FaithfulLongshotGeodeBehaviour>();
characterBodyHelperPrefab.AddComponent<FaithfulTargetingMatrixBehaviour>();
characterBodyHelperPrefab.AddComponent<FaithfulHermitsShawlBehaviour>();
}
public static void Update()
{
foreach (Callback updateCallback in updateCallbacks)
{
updateCallback();
}
if (!Utils.debugMode)
{
return;
}
foreach (Callback debugUpdateCallback in debugUpdateCallbacks)
{
debugUpdateCallback();
}
}
public static void FixedUpdate()
{
foreach (Callback fixedUpdateCallback in fixedUpdateCallbacks)
{
fixedUpdateCallback();
}
if (Utils.debugMode)
{
foreach (Callback debugFixedUpdateCallback in debugFixedUpdateCallbacks)
{
debugFixedUpdateCallback();
}
}
PlayerOnPlayerFixedUpdate();
AllyOnAllyFixedUpdate();
}
public static void OverrideCritCheck(CharacterBody _body, int _count = 1)
{
if (critOverrideCounts.ContainsKey(_body))
{
critOverrideCounts[_body] += _count;
}
else
{
critOverrideCounts.Add(_body, _count);
}
}
public static void AddUpdateCallback(Callback _callback, bool _debugOnly = false)
{
if (_debugOnly)
{
debugUpdateCallbacks.Add(_callback);
}
else
{
updateCallbacks.Add(_callback);
}
}
public static void AddFixedUpdateCallback(Callback _callback, bool _debugOnly = false)
{
if (_debugOnly)
{
debugFixedUpdateCallbacks.Add(_callback);
}
else
{
fixedUpdateCallbacks.Add(_callback);
}
}
public static void AddStatsMod(Item _item, StatsModCallback _callback)
{
itemStatsMods.Add(new ItemStatsMod(_item, _callback));
DebugLog("Added stat mods for '" + _item.token + "' item");
}
public static void AddStatsMod(Buff _buff, StatsModCallback _callback)
{
buffStatsMods.Add(new BuffStatsMod(_buff, _callback));
DebugLog("Added stat mods for '" + _buff.token + "' buff");
}
public static void AddInHoldoutZoneCallback(InHoldoutZoneCallback _callback)
{
inHoldoutZoneCallbacks.Add(_callback);
DebugLog("Added in Holdout Zone behaviour");
}
public static void AddOnHoldoutZoneStartCallback(OnHoldoutZoneStartCallback _callback)
{
onHoldoutZoneStartCallbacks.Add(_callback);
DebugLog("Added on Holdout Zone start behaviour");
}
public static void AddOnHoldoutZoneCalcRadiusCallback(OnHoldoutZoneCalcRadiusCallback _callback)
{
onHoldoutZoneCalcRadiusCallbacks.Add(_callback);
DebugLog("Added on Holdout Zone calc radius behaviour");
}
public static void AddPlayerToPlayerCallback(PlayerToPlayerCallback _callback)
{
playerToPlayerCallbacks.Add(_callback);
DebugLog("Added Player to Player behaviour");
}
public static void AddPlayerToPlayerCallback(Item _requiredItem, PlayerHolderToPlayerCallback _callback)
{
playerItemToPlayerCallbacks.Add(new PlayerItemToPlayer(_requiredItem, _callback));
DebugLog("Added Player to Player behaviour");
}
public static void AddPlayerToPlayerCallback(Buff _requiredBuff, PlayerHolderToPlayerCallback _callback)
{
playerBuffToPlayerCallbacks.Add(new PlayerBuffToPlayer(_requiredBuff, _callback));
DebugLog("Added Player to Player behaviour");
}
public static void AddAllyToAllyCallback(Item _requiredItem, AllyHolderToAllyCallback _callback)
{
allyItemToAllyCallbacks.Add(new AllyItemToAlly(_requiredItem, _callback));
DebugLog("Added Ally to Ally behaviour");
}
public static void AddAllyToAllyCallback(Buff _requiredBuff, AllyHolderToAllyCallback _callback)
{
allyBuffToAllyCallbacks.Add(new AllyBuffToAlly(_requiredBuff, _callback));
DebugLog("Added Ally to Ally behaviour");
}
public static void AddOnIncomingDamageCallback(OnIncomingDamageCallback _callback)
{
onIncomingDamageCallbacks.Add(_callback);
DebugLog("Added On Incoming Damage behaviour");
}
public static void AddOnHitEnemyLateCallback(OnHitEnemyCallback _callback)
{
onHitEnemyLateCallbacks.Add(_callback);
DebugLog("Added On Hit Enemy Late behaviour");
}
public static void AddOnTakeDamageProcessCallback(OnTakeDamageProcessCallback _callback)
{
onTakeDamageProcessCallbacks.Add(_callback);
DebugLog("Added On Take Damage Process behaviour");
}
public static void AddOnDamageDealtCallback(DamageReportCallback _callback)
{
onDamageDealtCallbacks.Add(_callback);
DebugLog("Added On Damage Dealt behaviour");
}
public static void AddOnCharacterDeathCallback(DamageReportCallback _callback)
{
onCharacterDeathCallbacks.Add(_callback);
DebugLog("Added On Character Death behaviour");
}
public static void AddOnAddBuffCallback(OnAddBuffCallback _callback)
{
onAddBuffCallbacks.Add(_callback);
DebugLog("Added On Add Buff behaviour");
}
public static void AddOnAddTimedBuffCallback(OnAddTimedBuffCallback _callback)
{
onAddTimedBuffCallbacks.Add(_callback);
DebugLog("Added On Add Timed Buff behaviour");
}
public static void AddOnAddTimedBuffMaxStacksCallback(OnAddTimedBuffMaxStacksCallback _callback)
{
onAddTimedBuffMaxStacksCallbacks.Add(_callback);
DebugLog("Added On Add Timed Buff Max Stacks behaviour");
}
public static void AddOnExtendTimedBuffsCallback(OnExtendTimedBuffsCallback _callback)
{
onExtendTimedBuffsCallbacks.Add(_callback);
DebugLog("Added On Extend Timed Buffs behaviour");
}
public static void AddOnSetTimedBuffDurationCallback(OnSetTimedBuffDurationCallback _callback)
{
onSetTimedBuffDurationCallbacks.Add(_callback);
DebugLog("Added On Set Timed Buff Duration behaviour");
}
public static void AddOnInflictDamageOverTimeCallback(OnInflictDamageOverTimeCallback _callback)
{
onInflictDamageOverTimeCallbacks.Add(_callback);
DebugLog("Added On Inflict Damage Over Time behaviour");
}
public static void AddOnInflictDamageOverTimeRefCallback(OnInflictDamageOverTimeRefCallback _callback)
{
onInflictDamageOverTimeRefCallbacks.Add(_callback);
DebugLog("Added On Inflict Damage Over Time Ref behaviour");
}
public static void AddServerOnGiveItemPermanentCallback(OnTransferItemCallback _callback)
{
onGiveItemPermanentCallbacks.Add(_callback);
DebugLog("Added On Give Item Permanent behaviour");
}
public static void AddServerOnGiveItemPermanentLateCallback(OnTransferItemCallback _callback)
{
onGiveItemPermanentLateCallbacks.Add(_callback);
DebugLog("Added On Give Item Permanent Late behaviour");
}
public static void AddServerOnGiveItemTemporaryCallback(OnTransferItemFloatCallback _callback)
{
onGiveItemTemporaryCallbacks.Add(_callback);
DebugLog("Added On Give Item Temporary behaviour");
}
public static void AddServerOnGiveItemTemporaryLateCallback(OnTransferItemFloatCallback _callback)
{
onGiveItemTemporaryLateCallbacks.Add(_callback);
DebugLog("Added On Give Item Temporary Late behaviour");
}
public static void AddServerOnRemoveItemCallback(OnTransferItemCallback _callback)
{
onRemoveItemCallbacks.Add(_callback);
DebugLog("Added On Remove Item behaviour");
}
public static void AddOnInventoryChangedCallback(OnInventoryCallback _callback)
{
onInventoryChangedCallbacks.Add(_callback);
DebugLog("Added On Inventory Changed behaviour");
}
public static void RemoveOnInventoryChangedCallback(OnInventoryCallback _callback)
{
onInventoryChangedCallbacks.Remove(_callback);
DebugLog("Removed On Inventory Changed behaviour");
}
public static void AddOnItemAddedCallback(ItemDef _itemDef, OnInventoryCallback _callback)
{
if (onItemAddedCallbacks.ContainsKey(_itemDef))
{
onItemAddedCallbacks[_itemDef].Add(_callback);
}
else
{
onItemAddedCallbacks[_itemDef] = new List<OnInventoryCallback> { _callback };
}
DebugLog("Added On Item Added behaviour");
}
public static void RemoveOnItemAddedCallback(ItemDef _itemDef, OnInventoryCallback _callback)
{
if (onItemAddedCallbacks.ContainsKey(_itemDef))
{
onItemAddedCallbacks[_itemDef].Remove(_callback);
if (onItemAddedCallbacks[_itemDef].Count == 0)
{
onItemAddedCallbacks.Remove(_itemDef);
}
DebugLog("Removed On Item Added behaviour");
}
}
public static void AddOnHealCallback(OnHealCallback _callback)
{
onHealCallbacks.Add(_callback);
DebugLog("Added On Heal behaviour");
}
public static void AddOnCharacterBodyAwakeCallback(CharacterBodyCallback _callback)
{
onCharacterBodyAwakeCallbacks.Add(_callback);
DebugLog("Added On Character Body Awake behaviour");
}
public static void AddOnCharacterBodyStartCallback(CharacterBodyCallback _callback)
{
onCharacterBodyStartCallbacks.Add(_callback);
DebugLog("Added On Character Body Start behaviour");
}
public static void AddOnRecalculateStatsCallback(CharacterBodyCallback _callback)
{
onRecalculateStatsCallbacks.Add(_callback);
DebugLog("Added On Recalculate Stats behaviour");
}
public static void AddOnUpdateVisualEffectsCallback(CharacterBodyCallback _callback)
{
onUpdateVisualEffectsCallbacks.Add(_callback);
DebugLog("Added On Update Visual Effects behaviour");
}
public static void AddOnCharacterBodyFixedUpdateCallback(CharacterBodyCallback _callback)
{
onCharacterBodyFixedUpdateCallbacks.Add(_callback);
DebugLog("Added On Character Body Fixed Update behaviour");
}
public static void RemoveOnCharacterBodyFixedUpdateCallback(CharacterBodyCallback _callback)
{
onCharacterBodyFixedUpdateCallbacks.Remove(_callback);
DebugLog("Removed On Character Body Fixed Update behaviour");
}
public static void AddOnCharacterBodyTickCallback(float _tickRate, CharacterBodyCallback _callback)
{
onCharacterBodyTickCallbacks.Add(_tickRate, _callback);
DebugLog("Added On Character Body Tick behaviour");
}
public static void AddOnPurchaseInteractionBeginCallback(OnPurchaseInteractionBeginCallback _callback)
{
onPurchaseInteractionBeginCallbacks.Add(_callback);
DebugLog("Added On Purchase Interaction Begin behaviour");
}
public static void AddOnPurchaseCanBeAffordedCallback(OnPurchaseCanBeAffordedCallback _callback)
{
onPurchaseCanBeAffordedCallbacks.Add(_callback);
DebugLog("Added On Purchase Can Be Afforded behaviour");
}
public static void AddOnProcessJumpCallback(OnProcessJumpCallback _callback)
{
onProcessJumpCallbacks.Add(_callback);
DebugLog("Added On Process Jump behaviour");
}
public static void AddGenericCharacterFixedUpdateCallback(GenericCharacterCallback _callback)
{
genericCharacterFixedUpdateCallbacks.Add(_callback);
DebugLog("Added Generic Character Fixed Update behaviour");
}
public static void AddOnPrePopulateSceneCallback(SceneDirectorCallback _callback)
{
onPrePopulateSceneCallbacks.Add(_callback);
DebugLog("Added On Pre-Populate Scene behaviour");
}
public static void AddOnPreSceneExitCallback(SceneExitControllerCallback _callback)
{
onPreSceneExitCallbacks.Add(_callback);
DebugLog("Added On Pre-Scene Exit behaviour");
}
private static void PlayerOnPlayerFixedUpdate()
{
List<PlayerCharacterMasterController> players = Utils.GetPlayers();
foreach (PlayerCharacterMasterController item in players)
{
foreach (PlayerItemToPlayer playerItemToPlayerCallback in playerItemToPlayerCallbacks)
{
playerItemToPlayerCallback.Process(item, players);
}
foreach (PlayerBuffToPlayer playerBuffToPlayerCallback in playerBuffToPlayerCallbacks)
{
playerBuffToPlayerCallback.Process(item, players);
}
foreach (PlayerCharacterMasterController item2 in players)
{
if ((Object)(object)item == (Object)(object)item2)
{
continue;
}
foreach (PlayerToPlayerCallback playerToPlayerCallback in playerToPlayerCallbacks)
{
playerToPlayerCallback(item, item2);
}
}
}
}
private static void AllyOnAllyFixedUpdate()
{
List<CharacterMaster> charactersForTeam = Utils.GetCharactersForTeam((TeamIndex)1);
foreach (CharacterMaster item in charactersForTeam)
{
foreach (AllyItemToAlly allyItemToAllyCallback in allyItemToAllyCallbacks)
{
allyItemToAllyCallback.Process(item, charactersForTeam);
}
foreach (AllyBuffToAlly allyBuffToAllyCallback in allyBuffToAllyCallbacks)
{
allyBuffToAllyCallback.Process(item, charactersForTeam);
}
}
}
private static void HookStatsMod(CharacterBody _body, StatHookEventArgs _stats)
{
foreach (ItemStatsMod itemStatsMod in itemStatsMods)
{
itemStatsMod.Process(_body, _stats);
}
foreach (BuffStatsMod buffStatsMod in buffStatsMods)
{
buffStatsMod.Process(_body, _stats);
}
}
private static void HookHoldoutZoneControllerUpdate(orig_Update orig, HoldoutZoneController self)
{
CharacterBody[] characterBodiesInHoldoutZone = Utils.GetCharacterBodiesInHoldoutZone(self);
CharacterBody[] array = characterBodiesInHoldoutZone;
foreach (CharacterBody contained in array)
{
foreach (InHoldoutZoneCallback inHoldoutZoneCallback in inHoldoutZoneCallbacks)
{
inHoldoutZoneCallback(contained, self);
}
}
orig.Invoke(self);
}
private static void HookHoldoutZoneControllerStart(orig_Start orig, HoldoutZoneController self)
{
FaithfulHoldoutZoneBehaviour faithfulHoldoutZoneBehaviour = ((Component)self).gameObject.AddComponent<FaithfulHoldoutZoneBehaviour>();
faithfulHoldoutZoneBehaviour.Init(onHoldoutZoneCalcRadiusCallbacks);
foreach (OnHoldoutZoneStartCallback onHoldoutZoneStartCallback in onHoldoutZoneStartCallbacks)
{
onHoldoutZoneStartCallback(self);
}
orig.Invoke(self);
}
private static void HookCharacterBodyAwake(orig_Awake orig, CharacterBody self)
{
orig.Invoke(self);
foreach (CharacterBodyCallback onCharacterBodyAwakeCallback in onCharacterBodyAwakeCallbacks)
{
onCharacterBodyAwakeCallback(self);
}
}
private static void HookCharacterBodyStart(orig_Start orig, CharacterBody self)
{
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
if (NetworkServer.active && (Object)(object)self.master != (Object)null)
{
GameObject val = Object.Instantiate<GameObject>(characterBodyHelperPrefab);
NetworkServer.Spawn(val);
FaithfulCharacterBodyBehaviour component = val.GetComponent<FaithfulCharacterBodyBehaviour>();
component.NetworkcharacterID = ((Component)self).GetComponent<NetworkIdentity>().netId;
foreach (KeyValuePair<float, CharacterBodyCallback> onCharacterBodyTickCallback in onCharacterBodyTickCallbacks)
{
component.AddTickBehaviour(onCharacterBodyTickCallback.Value, onCharacterBodyTickCallback.Key);
}
}
orig.Invoke(self);
foreach (CharacterBodyCallback onCharacterBodyStartCallback in onCharacterBodyStartCallbacks)
{
onCharacterBodyStartCallback(self);
}
}
private static void HookAddBuffIndex(orig_AddBuff_BuffIndex orig, CharacterBody self, BuffIndex buffType)
{
//IL_0019: 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)
foreach (OnAddBuffCallback onAddBuffCallback in onAddBuffCallbacks)
{
onAddBuffCallback(buffType, self);
}
orig.Invoke(self, buffType);
}
private static void HookAddTimedBuffDef(orig_AddTimedBuff_BuffDef_float orig, CharacterBody self, BuffDef buffDef, float duration)
{
foreach (OnAddTimedBuffCallback onAddTimedBuffCallback in onAddTimedBuffCallbacks)
{
onAddTimedBuffCallback(buffDef, ref duration, self);
}
orig.Invoke(self, buffDef, duration);
}
private static void HookAddTimedBuffDefMaxStacks(orig_AddTimedBuff_BuffDef_float_int orig, CharacterBody self, BuffDef buffDef, float duration, int maxStacks)
{
foreach (OnAddTimedBuffMaxStacksCallback onAddTimedBuffMaxStacksCallback in onAddTimedBuffMaxStacksCallbacks)
{
onAddTimedBuffMaxStacksCallback(buffDef, ref duration, ref maxSta