Decompiled source of Rulers of the Red Plane v0.1.8
plugins/RulersOfTheRedPlane.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using HG; using HG.Reflection; using IEye.RRP.ItemTiers; using IEye.RRP.Orbs; using MSU; using MSU.Config; using MonoMod.RuntimeDetour; using On.RoR2; using R2API; using R2API.Networking; using R2API.ScriptableObjects; using R2API.Utils; using RoR2; using RoR2.Achievements.Artifacts; using RoR2.ContentManagement; using RoR2.ExpansionManagement; using RoR2.Items; using RoR2.Networking; using RoR2.Orbs; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Rulers of the Red Plan")] [assembly: AssemblyDescription("Gaming")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Rulers of the Red Plane")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: AssemblyFileVersion("0.0.1.0")] [assembly: OptIn] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.1.0")] [module: UnverifiableCode] namespace EntityStates.Wlurm { public class SpawnState : BaseState { private float stopwatch; public static float duration = 4f; public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).PlayAnimation("Body", "Spawn", "Spawn.playbackRate", duration, 0f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); stopwatch += Time.fixedDeltaTime; if (stopwatch > duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class Laser : BaseSkillState { public static GameObject laserProjectile; public static GameObject[] tentacleEnds; public static float duration; public static float baseTimeBetweenShots; private float timer; private float timeBetweenShots; private Animator animator; private int tentacleAmount; public override void OnEnter() { ((BaseState)this).OnEnter(); timeBetweenShots = baseTimeBetweenShots / ((BaseState)this).attackSpeedStat; animator = ((EntityState)this).GetModelAnimator(); tentacleAmount = tentacleEnds.Length; } public override void FixedUpdate() { timer += Time.fixedDeltaTime; if (timer >= timeBetweenShots) { Transform transform = tentacleEnds[Random.Range(0, tentacleAmount)].transform; FireProjectile(transform); } ((EntityState)this).FixedUpdate(); } public void FireProjectile(Transform location) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Util.GetEnemyEasyTarget(((EntityState)this).characterBody, ((BaseState)this).GetAimRay(), 60f, 180f); } } } namespace IEye.RRP { internal class RRPLog { private static ManualLogSource logger; public static void Fatal(object data, [CallerLineNumber] int i = 0, [CallerMemberName] string member = "") { Log((LogLevel)1, data, i, member); } public static void Error(object data, [CallerLineNumber] int i = 0, [CallerMemberName] string member = "") { Log((LogLevel)2, data, i, member); } public static void Warning(object data, [CallerLineNumber] int i = 0, [CallerMemberName] string member = "") { Log((LogLevel)4, data, i, member); } public static void Message(object data, [CallerLineNumber] int i = 0, [CallerMemberName] string member = "") { Log((LogLevel)8, data, i, member); } public static void Info(object data, [CallerLineNumber] int i = 0, [CallerMemberName] string member = "") { Log((LogLevel)16, data, i, member); } public static void Debug(object data, [CallerLineNumber] int i = 0, [CallerMemberName] string member = "") { Log((LogLevel)32, data, i, member); } private static void Log(LogLevel level, object data, int i, string member) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) LogRuntime(level, data, i, member); } private static void LogEditor(LogLevel level, object data, int i, string member) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between Unknown and I4 if ((int)level <= 4) { if (level - 1 > 1) { if ((int)level == 4) { Debug.LogWarning((object)Format(data, i, member)); } } else { Debug.LogError((object)Format(data, i, member)); } } else if ((int)level == 8 || (int)level == 16 || (int)level == 32) { Debug.Log((object)Format(data, i, member)); } } private static void LogRuntime(LogLevel level, object data, int i, string member) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) object obj = ((((Enum)level).HasFlag((Enum)(object)(LogLevel)4) || ((Enum)level).HasFlag((Enum)(object)(LogLevel)2) || ((Enum)level).HasFlag((Enum)(object)(LogLevel)1)) ? Format(data, i, member) : data); logger.Log(level, obj); } public static string Format(object data, int i, string member) { return $"{data} | Line={i} : Member={member}"; } internal RRPLog(ManualLogSource logger_) { logger = logger_; } } public class AnimatorDebugger : MonoBehaviour { private Animator animator; private int pitchIndex; private int yawIndex; public void Start() { animator = ((Component)this).GetComponent<Animator>(); pitchIndex = animator.GetLayerIndex("AimPitch"); yawIndex = animator.GetLayerIndex("AimYaw"); } public void Update() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) RRPLog.Message("aimYawCycle is " + animator.GetFloat("aimYawCycle"), 21, "Update"); RRPLog.Message("aimPitchCycle is " + animator.GetFloat("aimPitchCycle"), 22, "Update"); AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(yawIndex); RRPLog.Message("aimYawCycle State is " + ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).shortNameHash, 23, "Update"); RRPLog.Message("real aimYawCycle is " + Animator.StringToHash("YawControl"), 24, "Update"); } } public abstract class RRPArtifact : IArtifactContentPiece, IContentPiece<ArtifactDef>, IContentPiece, IContentPackModifier { public NullableRef<ArtifactAssetCollection> assetCollection { get; private set; } public NullableRef<ArtifactCode> artifactCode { get; protected set; } public ArtifactDef artifactDef { get; protected set; } NullableRef<ArtifactCode> IArtifactContentPiece.artifactCode => artifactCode; ArtifactDef IContentPiece<ArtifactDef>.asset => artifactDef; public abstract RRPAssetRequest LoadAssetRequest(); public abstract void Initialize(); public abstract bool IsAvailable(ContentPack contentPack); public virtual IEnumerator LoadContentAsync() { RRPAssetRequest request = LoadAssetRequest(); request.StartLoad(); while (!request.isComplete) { yield return null; } if (request.boxedAsset is ArtifactAssetCollection artifactAssetCollection) { assetCollection = NullableRef<ArtifactAssetCollection>.op_Implicit(artifactAssetCollection); artifactDef = artifactAssetCollection.artifactDef; artifactCode = NullableRef<ArtifactCode>.op_Implicit(artifactAssetCollection.artifactCode); yield break; } Object boxedAsset = request.boxedAsset; ArtifactDef val = (ArtifactDef)(object)((boxedAsset is ArtifactDef) ? boxedAsset : null); if (val != null) { artifactDef = val; } else { RRPLog.Error($"Invalid AssetRequest {request.assetName} of type {((object)request.boxedAsset).GetType()}", 65, "LoadContentAsync"); } } public abstract void OnArtifactDisabled(); public abstract void OnArtifactEnabled(); public void ModifyContentPack(ContentPack contentPack) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (NullableRef<ArtifactAssetCollection>.op_Implicit(assetCollection)) { ContentUtil.AddContentFromAssetCollection(contentPack, (AssetCollection)(object)NullableRef<ArtifactAssetCollection>.op_Implicit(assetCollection)); } } } public abstract class RRPInteractable : IInteractableContentPiece, IGameObjectContentPiece<IInteractable>, IContentPiece<GameObject>, IContentPiece, IContentPackModifier { public InteractableAssetCollection AssetCollection { get; private set; } public InteractableCardProvider CardProvider { get; protected set; } IInteractable IGameObjectContentPiece<IInteractable>.component => InteractablePrefab.GetComponent<IInteractable>(); GameObject IContentPiece<GameObject>.asset => InteractablePrefab; public GameObject InteractablePrefab { get; protected set; } public abstract RRPAssetRequest<InteractableAssetCollection> AssetRequest { get; } NullableRef<InteractableCardProvider> IInteractableContentPiece.cardProvider => NullableRef<InteractableCardProvider>.op_Implicit(CardProvider); public abstract void Initialize(); public abstract bool IsAvailable(ContentPack contentPack); public virtual IEnumerator LoadContentAsync() { RRPAssetRequest<InteractableAssetCollection> request = AssetRequest; request.StartLoad(); while (!request.isComplete) { yield return null; } AssetCollection = request.asset; CardProvider = AssetCollection.interactableCardProvider; InteractablePrefab = AssetCollection.interactablePrefab; } public void ModifyContentPack(ContentPack contentPack) { ContentUtil.AddContentFromAssetCollection(contentPack, (AssetCollection)(object)AssetCollection); } } public abstract class RRPItem : IItemContentPiece, IContentPiece<ItemDef>, IContentPiece, IContentPackModifier { public ItemAssetCollection AssetCollection { get; private set; } public NullableRef<List<GameObject>> ItemDisplayPrefabs { get; protected set; } = NullableRef<List<GameObject>>.op_Implicit(new List<GameObject>()); public ItemDef ItemDef { get; protected set; } ItemDef IContentPiece<ItemDef>.asset => ItemDef; NullableRef<List<GameObject>> IItemContentPiece.itemDisplayPrefabs => ItemDisplayPrefabs; public abstract RRPAssetRequest AssetRequest { get; } public abstract void Initialize(); public abstract bool IsAvailable(ContentPack contentPack); public virtual IEnumerator LoadContentAsync() { RRPAssetRequest request = AssetRequest; request.StartLoad(); while (!request.isComplete) { yield return null; } if (request.boxedAsset is ItemAssetCollection assetCollection) { AssetCollection = assetCollection; ItemDef = AssetCollection.itemDef; ItemDisplayPrefabs = NullableRef<List<GameObject>>.op_Implicit(AssetCollection.itemDisplayPrefabs); yield break; } Object boxedAsset = request.boxedAsset; ItemDef val = (ItemDef)(object)((boxedAsset is ItemDef) ? boxedAsset : null); if (val != null) { ItemDef = val; } else { RRPLog.Error("Invalid AssetRequest " + NullableRef<string>.op_Implicit(request.assetName) + " of type " + ((object)request.boxedAsset).GetType(), 47, "LoadContentAsync"); } } public virtual void ModifyContentPack(ContentPack contentPack) { if (Object.op_Implicit((Object)(object)AssetCollection)) { ContentUtil.AddContentFromAssetCollection(contentPack, (AssetCollection)(object)AssetCollection); } } } public abstract class RRPItemTier : IItemTierContentPiece, IContentPiece<ItemTierDef>, IContentPiece, IContentPackModifier { public ItemTierAssetCollection AssetCollection { get; private set; } public NullableRef<SerializableColorCatalogEntry> colorIndex { get; protected set; } public NullableRef<SerializableColorCatalogEntry> darkColorIndex { get; protected set; } public GameObject pickupDisplayVFX { get; protected set; } public List<ItemIndex> itemsWithThisTier { get; set; } = new List<ItemIndex>(); public List<PickupIndex> availableTierDropList { get; set; } = new List<PickupIndex>(); ItemTierDef IContentPiece<ItemTierDef>.asset => ItemTierDef; public ItemTierDef ItemTierDef { get; protected set; } public abstract RRPAssetRequest<ItemTierAssetCollection> AssetRequest { get; } public abstract void Initialize(); public abstract bool IsAvailable(ContentPack contentPack); public virtual IEnumerator LoadContentAsync() { RRPAssetRequest<ItemTierAssetCollection> request = AssetRequest; request.StartLoad(); while (!request.isComplete) { yield return null; } AssetCollection = request.asset; ItemTierDef = AssetCollection.itemTierDef; if (Object.op_Implicit((Object)(object)AssetCollection.colorIndex)) { colorIndex = NullableRef<SerializableColorCatalogEntry>.op_Implicit(AssetCollection.colorIndex); } if (Object.op_Implicit((Object)(object)AssetCollection.darkColorIndex)) { darkColorIndex = NullableRef<SerializableColorCatalogEntry>.op_Implicit(AssetCollection.darkColorIndex); } pickupDisplayVFX = AssetCollection.pickupDisplayVFX; } public void ModifyContentPack(ContentPack contentPack) { ContentUtil.AddContentFromAssetCollection(contentPack, (AssetCollection)(object)AssetCollection); } } public abstract class RRPMonster : IMonsterContentPiece, ICharacterContentPiece, IGameObjectContentPiece<CharacterBody>, IContentPiece<GameObject>, IContentPiece, IContentPackModifier { public NullableRef<MonsterCardProvider> CardProvider { get; protected set; } public NullableRef<DirectorCardHolderExtended> DissonanceCard { get; protected set; } public MonsterAssetCollection AssetCollection { get; private set; } public NullableRef<GameObject> masterPrefab { get; protected set; } NullableRef<DirectorCardHolderExtended> IMonsterContentPiece.dissonanceCard => DissonanceCard; CharacterBody IGameObjectContentPiece<CharacterBody>.component => CharacterPrefab.GetComponent<CharacterBody>(); NullableRef<MonsterCardProvider> IMonsterContentPiece.cardProvider => CardProvider; GameObject IContentPiece<GameObject>.asset => CharacterPrefab; public GameObject CharacterPrefab { get; private set; } public abstract RRPAssetRequest<MonsterAssetCollection> AssetRequest { get; } public abstract void Initialize(); public abstract bool IsAvailable(ContentPack contentPack); public virtual IEnumerator LoadContentAsync() { RRPAssetRequest<MonsterAssetCollection> request = AssetRequest; request.StartLoad(); while (!request.isComplete) { yield return null; } AssetCollection = request.asset; CharacterPrefab = AssetCollection.bodyPrefab; masterPrefab = NullableRef<GameObject>.op_Implicit(AssetCollection.masterPrefab); CardProvider = NullableRef<MonsterCardProvider>.op_Implicit(AssetCollection.monsterCardProvider); DissonanceCard = NullableRef<DirectorCardHolderExtended>.op_Implicit(AssetCollection.dissonanceCardHolder); } public virtual void ModifyContentPack(ContentPack contentPack) { ContentUtil.AddContentFromAssetCollection(contentPack, (AssetCollection)(object)AssetCollection); } } public abstract class RRPScene : ISceneContentPiece, IContentPiece<SceneDef>, IContentPiece, IContentPackModifier { public SceneAssetCollection assetCollection { get; private set; } public abstract RRPAssetRequest<SceneAssetCollection> assetRequest { get; } NullableRef<MusicTrackDef> ISceneContentPiece.mainTrack => NullableRef<MusicTrackDef>.op_Implicit(mainTrack); NullableRef<MusicTrackDef> ISceneContentPiece.bossTrack => NullableRef<MusicTrackDef>.op_Implicit(bossTrack); public MusicTrackDef mainTrack { get; protected set; } public MusicTrackDef bossTrack { get; protected set; } public NullableRef<Texture2D> bazaarTextureBase { get; protected set; } SceneDef IContentPiece<SceneDef>.asset => sceneDef; public SceneDef sceneDef { get; protected set; } public virtual float? weightRelativeToSiblings { get; protected set; } = 1f; public virtual bool? preLoop { get; protected set; } = true; public virtual bool? postLoop { get; protected set; } = true; public abstract void Initialize(); public abstract bool IsAvailable(ContentPack contentPack); public virtual IEnumerator LoadContentAsync() { RRPAssetRequest<SceneAssetCollection> request = assetRequest; request.StartLoad(); while (!request.isComplete) { yield return null; } assetCollection = request.asset; sceneDef = assetCollection.sceneDef; if (Object.op_Implicit((Object)(object)mainTrack)) { mainTrack = NullableRef<MusicTrackDef>.op_Implicit(assetCollection.mainTrack); } if (Object.op_Implicit((Object)(object)bossTrack)) { bossTrack = NullableRef<MusicTrackDef>.op_Implicit(assetCollection.bossTrack); } weightRelativeToSiblings = assetCollection.stageWeightRelativeToSiblings; preLoop = assetCollection.appearsPreLoop; postLoop = assetCollection.appearsPostLoop; } public virtual void ModifyContentPack(ContentPack contentPack) { ContentUtil.AddContentFromAssetCollection(contentPack, (AssetCollection)(object)assetCollection); } public virtual void OnServerStageComplete(Stage stage) { } public virtual void OnServerStageBegin(Stage stage) { } } public enum RRPBundle { Invalid, All, Main, Base, Artifacts, Interactables, Items, StreamedScene, Indev } public class RRPAssets { private const string ASSET_BUNDLE_FOLDER_NAME = "assetbundles"; private const string MAIN = "rrpmain"; private const string BASE = "rrpbase"; private const string ARTIFACTS = "rrpartifacts"; private const string EQUIPS = "rrpequipments"; private const string INTERACTS = "rrpinteractables"; private const string ITEMS = "rrpitems"; private const string MONSTERS = "rrpmonsters"; private const string VANILLA = "rrpvanilla"; private const string STAGES = "rrpstages"; private const string INDEV = "rrpindev"; private const string SHARED = "rrpshared"; private static Dictionary<RRPBundle, AssetBundle> _assetBundles = new Dictionary<RRPBundle, AssetBundle>(); private static AssetBundle[] _streamedSceneBundles = Array.Empty<AssetBundle>(); private static Action _onRRPAssetsInitialized; private static string AssetBundleFolderPath => Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)RRPMain.instance).Info.Location), "assetbundles"); public static event Action onRRPAssetsInitialized { add { _onRRPAssetsInitialized = (Action)Delegate.Remove(_onRRPAssetsInitialized, value); _onRRPAssetsInitialized = (Action)Delegate.Combine(_onRRPAssetsInitialized, value); } remove { _onRRPAssetsInitialized = (Action)Delegate.Remove(_onRRPAssetsInitialized, value); } } public static AssetBundle GetAssetBundle(RRPBundle bundle) { if (bundle == RRPBundle.All || bundle == RRPBundle.Invalid || bundle == RRPBundle.StreamedScene) { return null; } return _assetBundles[bundle]; } public static TAsset LoadAsset<TAsset>(string name, RRPBundle bundle) where TAsset : Object { if (bundle == RRPBundle.All) { return FindAsset<TAsset>(name); } return _assetBundles[bundle].LoadAsset<TAsset>(name); } public static RRPAssetRequest<TAsset> LoadAssetAsync<TAsset>(string name, RRPBundle bundle) where TAsset : Object { return new RRPAssetRequest<TAsset>(name, bundle); } public static TAsset[] LoadAllAssets<TAsset>(RRPBundle bundle) where TAsset : Object { if (bundle == RRPBundle.All) { return FindAssets<TAsset>(); } return _assetBundles[bundle].LoadAllAssets<TAsset>(); } public static RRPAssetRequest<TAsset> LoadAllAssetsAsync<TAsset>(RRPBundle bundle) where TAsset : Object { return new RRPAssetRequest<TAsset>(bundle); } internal static IEnumerator Initialize() { RRPLog.Info("Initializing Assets...", 181, "Initialize"); IEnumerator loadRoutine = LoadAssetBundles(); while (!MSUtil.IsDone(loadRoutine)) { yield return null; } RRPLog.Info("Initializing Shader Swap...", 190, "Initialize"); ParallelMultiStartCoroutine multiStartCoroutine = new ParallelMultiStartCoroutine(); multiStartCoroutine.Add((Func<IEnumerator>)SwapShaders); multiStartCoroutine.Add((Func<IEnumerator>)SwapAddressableShaders); multiStartCoroutine.Start(); while (!MSUtil.IsDone((IEnumerator)multiStartCoroutine)) { yield return null; } RRPLog.Info("Invoking onRRPAssetsInitialized...", 202, "Initialize"); _onRRPAssetsInitialized?.Invoke(); } private static IEnumerator LoadAssetBundles() { ParallelMultiStartCoroutine helper = new ParallelMultiStartCoroutine(); List<(string path, RRPBundle bundleEnum, AssetBundle loadedBundle)> pathsAndBundles = new List<(string, RRPBundle, AssetBundle)>(); string[] assetBundlePaths = GetAssetBundlePaths(); for (int i = 0; i < assetBundlePaths.Length; i++) { string text = assetBundlePaths[i]; helper.Add<List<(string, RRPBundle, AssetBundle)>, string, int, int>((Func<List<(string, RRPBundle, AssetBundle)>, string, int, int, IEnumerator>)LoadFromPath, pathsAndBundles, text, i, assetBundlePaths.Length); } helper.Start(); while (!MSUtil.IsDone((IEnumerator)helper)) { yield return null; } foreach (var item3 in pathsAndBundles) { RRPBundle item = item3.bundleEnum; AssetBundle item2 = item3.loadedBundle; if (item == RRPBundle.StreamedScene) { ArrayUtils.ArrayAppend<AssetBundle>(ref _streamedSceneBundles, ref item2); } else { _assetBundles[item] = item2; } } } private static IEnumerator LoadFromPath(List<(string path, RRPBundle bundleEnum, AssetBundle loadedBundle)> list, string path, int index, int totalPaths) { RRPBundle? rrpbundle = Path.GetFileName(path) switch { "rrpmain" => RRPBundle.Main, "rrpitems" => RRPBundle.Items, "rrpbase" => RRPBundle.Base, "rrpartifacts" => RRPBundle.Artifacts, "rrpinteractables" => RRPBundle.Interactables, "rrpindev" => RRPBundle.Indev, "rrpstages" => RRPBundle.StreamedScene, _ => RRPBundle.StreamedScene, }; AssetBundleCreateRequest request = AssetBundle.LoadFromFileAsync(path); while (!((AsyncOperation)request).isDone) { yield return null; } AssetBundle assetBundle = request.assetBundle; if (!Object.op_Implicit((Object)(object)assetBundle)) { throw new FileLoadException("AssetBundle.LoadFromFile did not return an asset bundle. (Path=" + path + ")"); } if (rrpbundle == RRPBundle.StreamedScene) { if (!assetBundle.isStreamedSceneAssetBundle) { throw new Exception("AssetBundle in specified path is not a streamed scene bundle, but its file name was not found in the Switch statement. have you forgotten to setup the enum and file name in your assets class? (Path=" + path + ")"); } list.Add((path, RRPBundle.StreamedScene, assetBundle)); } else { list.Add((path, rrpbundle.Value, assetBundle)); } } private static string[] GetAssetBundlePaths() { return (from filePath in Directory.GetFiles(AssetBundleFolderPath) where !filePath.EndsWith(".manifest") select filePath).ToArray(); } private static IEnumerator SwapShaders() { RRPLog.Info("Swapping Stubbed Shaders", 304, "SwapShaders"); return ShaderUtil.SwapStubbedShadersAsync(_assetBundles.Values.ToArray()); } private static IEnumerator SwapAddressableShaders() { return ShaderUtil.LoadAddressableMaterialShadersAsync(_assetBundles.Values.ToArray()); } private static TAsset FindAsset<TAsset>(string name) where TAsset : Object { TAsset val = default(TAsset); foreach (KeyValuePair<RRPBundle, AssetBundle> assetBundle in _assetBundles) { assetBundle.Deconstruct(out var key, out var value); RRPBundle rRPBundle = key; val = value.LoadAsset<TAsset>(name); if (Object.op_Implicit((Object)(object)val)) { break; } } return val; } private static TAsset[] FindAssets<TAsset>() where TAsset : Object { List<TAsset> list = new List<TAsset>(); foreach (var (_, val2) in _assetBundles) { list.AddRange(val2.LoadAllAssets<TAsset>()); } return list.ToArray(); } } public abstract class RRPAssetRequest { private RRPBundle _targetBundle; private NullableRef<string> _assetName; protected IEnumerator internalCoroutine; protected string assetTypeName; public abstract Object boxedAsset { get; } public abstract IEnumerable<Object> boxedAssets { get; } public RRPBundle targetBundle => _targetBundle; public NullableRef<string> assetName => _assetName; public bool singleAssetLoad { get; private set; } public bool isComplete { get { if (internalCoroutine == null) { StartLoad(); } return !internalCoroutine.MoveNext(); } } public void StartLoad() { if (singleAssetLoad) { internalCoroutine = LoadSingleAsset(); } else { internalCoroutine = LoadMultipleAsset(); } } protected abstract IEnumerator LoadSingleAsset(); protected abstract IEnumerator LoadMultipleAsset(); public RRPAssetRequest(string assetName, RRPBundle bundleEnum) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) _assetName = NullableRef<string>.op_Implicit(assetName); _targetBundle = bundleEnum; singleAssetLoad = true; assetTypeName = "UnityEngine.Object"; } public RRPAssetRequest(RRPBundle bundleEnum) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) _assetName = NullableRef<string>.op_Implicit(string.Empty); _targetBundle = bundleEnum; singleAssetLoad = false; assetTypeName = "UnityEngine.Object"; } } public class RRPAssetRequest<TAsset> : RRPAssetRequest where TAsset : Object { private TAsset _asset; private List<TAsset> _assets; public override Object boxedAsset => (Object)(object)_asset; public TAsset asset => _asset; public override IEnumerable<Object> boxedAssets => (IEnumerable<Object>)_assets; public IEnumerable<TAsset> assets => _assets; protected override IEnumerator LoadSingleAsset() { AssetBundleRequest request = RRPAssets.GetAssetBundle(base.targetBundle).LoadAssetAsync<TAsset>(NullableRef<string>.op_Implicit(base.assetName)); while (!((AsyncOperation)request).isDone) { yield return null; } _asset = (TAsset)(object)request.asset; } protected override IEnumerator LoadMultipleAsset() { _assets.Clear(); if (base.targetBundle == RRPBundle.All) { foreach (RRPBundle value in Enum.GetValues(typeof(RRPBundle))) { if (value != RRPBundle.All && value != 0 && value != RRPBundle.StreamedScene) { AssetBundleRequest request2 = RRPAssets.GetAssetBundle(value).LoadAllAssetsAsync<TAsset>(); while (!((AsyncOperation)request2).isDone) { yield return null; } _assets.AddRange(request2.allAssets.OfType<TAsset>()); } } } else { AssetBundleRequest request2 = RRPAssets.GetAssetBundle(base.targetBundle).LoadAllAssetsAsync<TAsset>(); while (!((AsyncOperation)request2).isDone) { yield return null; } _assets.AddRange(request2.allAssets.OfType<TAsset>()); } } internal RRPAssetRequest(string name, RRPBundle bundle) : base(name, bundle) { assetTypeName = typeof(TAsset).Name; } internal RRPAssetRequest(RRPBundle bundle) : base(bundle) { _assets = new List<TAsset>(); assetTypeName = typeof(TAsset).Name; } } public class RRPConfig { public const string PREFIX = "RRP."; internal const string IDMain = "RRP.Main"; internal const string IDItem = "RRP.Items"; internal const string IDInteractable = "RRP.Interactables"; internal const string IDItemTier = "RRP.Item Tier"; internal static ConfigFactory configFactory { get; private set; } public static ConfigFile ConfigMain { get; private set; } public static ConfigFile ConfigItem { get; private set; } public static ConfigFile ConfigInteractable { get; private set; } public static ConfigFile ConfigItemTier { get; private set; } internal RRPConfig(BaseUnityPlugin bup) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown configFactory = new ConfigFactory(bup, true); ConfigMain = configFactory.CreateConfigFile("RRP.Main", true); ConfigItem = configFactory.CreateConfigFile("RRP.Items", true); ConfigInteractable = configFactory.CreateConfigFile("RRP.Interactables", true); ConfigItemTier = configFactory.CreateConfigFile("RRP.Item Tier", true); } } public static class SoundBankManager { public static string soundBankDirectory => Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)RRPMain.instance).Info.Location), "soundbanks"); public static void Init() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) new Hook((MethodBase)Reflection.GetMethodCached(typeof(AkSoundEngineInitialization), "InitializeSoundEngine"), Reflection.GetMethodCached(typeof(SoundBankManager), "AddBanks")); } private static bool AddBanks(Func<AkSoundEngineInitialization, bool> orig, AkSoundEngineInitialization self) { bool result = orig(self); LoadBanks(); return result; } private static void LoadBanks() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) AkSoundEngine.AddBasePath(soundBankDirectory); uint num = default(uint); AkSoundEngine.LoadFilePackage("RRP_Soundbank.pck", ref num); uint num2 = default(uint); AkSoundEngine.LoadBank("RRP_Soundbank", ref num2); } } public class RRPContent : IContentPackProvider { public static class Artifacts { public static ArtifactDef Loop; } public static class Items { public static ItemDef FourDimensionalDagger; public static ItemDef IntrospectiveInsect; public static ItemDef PoisonIvy; public static ItemDef Strawberry; public static ItemDef DoubleSidedSword; public static ItemDef Leech; public static ItemDef AgressiveInsect; public static ItemDef AdrenalineFrenzy; public static ItemDef FocusedHemorrhage; public static ItemDef PredatorySavagery; public static ItemDef BloodyIvy; public static ItemDef SacrificialHelper; public static ItemDef Kamikaze; } public static class Scenes { public static SceneDef ProvidenceGarden; } public static class Buffs { public static BuffDef InsectPoison; public static BuffDef InsectBloody; public static BuffDef AdrenalineOnGettingHit; public static BuffDef AdrenalineOnKill; public static BuffDef PredatoryRush; public static BuffDef IvyPower; public static BuffDef IvyBlight; } public static class ItemTierDefs { public static ItemTierDef Sacrificial; } internal static ParallelMultiStartCoroutine _parallelPreLoadDispatchers; private static Func<IEnumerator>[] _loadDispatchers; internal static ParallelMultiStartCoroutine _parallelPostLoadDispatchers; private static Action[] _fieldAssignDispatchers; public string identifier => "com.I_Eye.RulersOfTheRedPlane"; public static ReadOnlyContentPack readOnlyContentPack => new ReadOnlyContentPack(RRPContentPack); internal static ContentPack RRPContentPack { get; } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { IEnumerator enumerator2 = RRPAssets.Initialize(); while (enumerator2.MoveNext()) { yield return null; } _parallelPreLoadDispatchers.Start(); while (!MSUtil.IsDone((IEnumerator)_parallelPreLoadDispatchers)) { yield return null; } for (int i = 0; i < _loadDispatchers.Length; i++) { args.ReportProgress(Util.Remap((float)(i + 1), 0f, (float)_loadDispatchers.Length, 0.1f, 0.2f)); enumerator2 = _loadDispatchers[i](); while (enumerator2?.MoveNext() ?? false) { yield return null; } } _parallelPostLoadDispatchers.Start(); while (!MSUtil.IsDone((IEnumerator)_parallelPostLoadDispatchers)) { yield return null; } for (int j = 0; j < _fieldAssignDispatchers.Length; j++) { args.ReportProgress(Util.Remap((float)(j + 1), 0f, (float)_fieldAssignDispatchers.Length, 0.95f, 0.99f)); _fieldAssignDispatchers[j](); } } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(RRPContentPack, args.output); args.ReportProgress(1f); yield return null; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } private void AddSelf(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } private static IEnumerator LoadFromAssetBundles() { RRPLog.Info("Populating EntityStateTypes array...", 75, "LoadFromAssetBundles"); RRPContentPack.entityStateTypes.Clear(); RRPContentPack.entityStateTypes.Add((from type in typeof(RRPContent).Assembly.GetTypes() where typeof(EntityState).IsAssignableFrom(type) select type).ToArray()); RRPLog.Info("Populating EntityStateConfiguration array...", 79, "LoadFromAssetBundles"); RRPAssetRequest<EntityStateConfiguration> escRequest = new RRPAssetRequest<EntityStateConfiguration>(RRPBundle.All); escRequest.StartLoad(); while (!escRequest.isComplete) { yield return null; } RRPContentPack.entityStateConfigurations.Clear(); RRPContentPack.entityStateConfigurations.Add(escRequest.assets.ToArray()); RRPLog.Info("Populating EffectDefs array...", 86, "LoadFromAssetBundles"); RRPAssetRequest<GameObject> gameObjectRequest = new RRPAssetRequest<GameObject>(RRPBundle.All); gameObjectRequest.StartLoad(); while (!gameObjectRequest.isComplete) { yield return null; } RRPContentPack.effectDefs.Clear(); RRPContentPack.effectDefs.Add(gameObjectRequest.assets.Where((GameObject go) => Object.op_Implicit((Object)(object)go.GetComponent<EffectComponent>())).Select((Func<GameObject, EffectDef>)((GameObject go) => new EffectDef(go))).ToArray()); RRPLog.Info("Calling AsyncAssetLoad Attribute Methods...", 93, "LoadFromAssetBundles"); ParallelMultiStartCoroutine asyncAssetLoadCoroutines = AsyncAssetLoadAttribute.CreateCoroutineForMod((BaseUnityPlugin)(object)RRPMain.instance); asyncAssetLoadCoroutines.Start(); while (!MSUtil.IsDone((IEnumerator)asyncAssetLoadCoroutines)) { yield return null; } } private IEnumerator AddRRPExpansionDef() { RRPAssetRequest<ExpansionDef> expansionRequest = RRPAssets.LoadAssetAsync<ExpansionDef>("RRPExpansionDef", RRPBundle.Main); expansionRequest.StartLoad(); while (!expansionRequest.isComplete) { yield return null; } ContentUtil.AddSingle<ExpansionDef>(RRPContentPack.expansionDefs, expansionRequest.asset); } internal RRPContent() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(AddSelf); RRPAssets.onRRPAssetsInitialized += delegate { _parallelPreLoadDispatchers.Add((Func<IEnumerator>)AddRRPExpansionDef); }; } static RRPContent() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown RRPContentPack = new ContentPack(); _parallelPreLoadDispatchers = new ParallelMultiStartCoroutine(); _parallelPostLoadDispatchers = new ParallelMultiStartCoroutine(); RRPMain main = RRPMain.instance; _loadDispatchers = new Func<IEnumerator>[7] { delegate { ItemModule.AddProvider((BaseUnityPlugin)(object)main, ContentUtil.CreateGenericContentPieceProvider<ItemDef>((BaseUnityPlugin)(object)main, RRPContentPack)); return ItemModule.InitializeItems((BaseUnityPlugin)(object)main); }, delegate { ItemTierModule.AddProvider((BaseUnityPlugin)(object)main, ContentUtil.CreateGenericContentPieceProvider<ItemTierDef>((BaseUnityPlugin)(object)main, RRPContentPack)); return ItemTierModule.InitializeTiers((BaseUnityPlugin)(object)main); }, delegate { CharacterModule.AddProvider((BaseUnityPlugin)(object)main, ContentUtil.CreateGameObjectGenericContentPieceProvider<CharacterBody>((BaseUnityPlugin)(object)main, RRPContentPack)); return CharacterModule.InitializeCharacters((BaseUnityPlugin)(object)main); }, delegate { ArtifactModule.AddProvider((BaseUnityPlugin)(object)main, ContentUtil.CreateGenericContentPieceProvider<ArtifactDef>((BaseUnityPlugin)(object)main, RRPContentPack)); return ArtifactModule.InitializeArtifacts((BaseUnityPlugin)(object)main); }, delegate { SceneModule.AddProvider((BaseUnityPlugin)(object)main, ContentUtil.CreateGenericContentPieceProvider<SceneDef>((BaseUnityPlugin)(object)main, RRPContentPack)); return SceneModule.InitializeScenes((BaseUnityPlugin)(object)main); }, delegate { InteractableModule.AddProvider((BaseUnityPlugin)(object)main, ContentUtil.CreateGameObjectGenericContentPieceProvider<IInteractable>((BaseUnityPlugin)(object)main, RRPContentPack)); return InteractableModule.InitializeInteractables((BaseUnityPlugin)(object)main); }, LoadFromAssetBundles }; _fieldAssignDispatchers = new Action[5] { delegate { ContentUtil.PopulateTypeFields<ItemDef>(typeof(Items), RRPContentPack.itemDefs); }, delegate { ContentUtil.PopulateTypeFields<ItemTierDef>(typeof(ItemTierDefs), RRPContentPack.itemTierDefs); }, delegate { ContentUtil.PopulateTypeFields<ArtifactDef>(typeof(Artifacts), RRPContentPack.artifactDefs); }, delegate { ContentUtil.PopulateTypeFields<BuffDef>(typeof(Buffs), RRPContentPack.buffDefs); }, delegate { ContentUtil.PopulateTypeFields<SceneDef>(typeof(Scenes), RRPContentPack.sceneDefs); } }; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.I_Eye.RulersOfTheRedPlane", "Rulers of the Red Plane", "0.1.7")] public class RRPMain : BaseUnityPlugin { public const string GUID = "com.I_Eye.RulersOfTheRedPlane"; public const string MODNAME = "Rulers of the Red Plane"; public const string VERSION = "0.1.7"; public static RRPMain instance; public static PluginInfo pluginInfo; private void Awake() { instance = this; pluginInfo = ((BaseUnityPlugin)this).Info; new RRPLog(((BaseUnityPlugin)this).Logger); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Logger created"); new RRPConfig((BaseUnityPlugin)(object)this); ((BaseUnityPlugin)this).Logger.LogInfo((object)"About to do content"); new RRPContent(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"RRP loading for MSU 2.0"); LanguageFileLoader.AddLanguageFilesFromMod((BaseUnityPlugin)(object)this, "languages"); } private void Start() { SoundBankManager.Init(); } } [CreateAssetMenu(fileName = "ArtifactAssetCollection", menuName = "RRP/AssetCollections/ArtifactAssetCollection")] public class ArtifactAssetCollection : ExtendedAssetCollection { public ArtifactCode artifactCode; public ArtifactDef artifactDef; } [CreateAssetMenu(fileName = "BodyAssetCollection", menuName = "RRP/AssetCollections/BodyAssetCollection")] public class BodyAssetCollection : ExtendedAssetCollection { public GameObject bodyPrefab; public GameObject masterPrefab; } public class ExtendedAssetCollection : AssetCollection { } [CreateAssetMenu(fileName = "InteractableAssetCollection", menuName = "RRP/AssetCollections/InteractableAssetCollection")] public class InteractableAssetCollection : ExtendedAssetCollection { public GameObject interactablePrefab; public InteractableCardProvider interactableCardProvider; } [CreateAssetMenu(fileName = "ItemAssetCollection", menuName = "RRP/AssetCollections/ItemAssetCollection")] public class ItemAssetCollection : ExtendedAssetCollection { public List<GameObject> itemDisplayPrefabs; public ItemDef itemDef; } [CreateAssetMenu(fileName = "ItemTierAssetCollection", menuName = "RRP/AssetCollections/ItemTierAssetCollection")] public class ItemTierAssetCollection : ExtendedAssetCollection { public SerializableColorCatalogEntry colorIndex; public SerializableColorCatalogEntry darkColorIndex; public GameObject pickupDisplayVFX; public ItemTierDef itemTierDef; } [CreateAssetMenu(fileName = "MonsterAssetCollection", menuName = "RRP/AssetCollections/MonsterAssetCollection")] public class MonsterAssetCollection : BodyAssetCollection { public MonsterCardProvider monsterCardProvider; public DirectorCardHolderExtended dissonanceCardHolder; } [CreateAssetMenu(fileName = "SceneAssetCollection", menuName = "RRP/AssetCollections/SceneAssetCollection")] public class SceneAssetCollection : ExtendedAssetCollection { public SceneDef sceneDef; public NullableRef<MusicTrackDef> mainTrack; public NullableRef<MusicTrackDef> bossTrack; [Header("Stage Registration Metadata")] public float stageWeightRelativeToSiblings; public bool appearsPreLoop; public bool appearsPostLoop; } } namespace IEye.RRP.Unlocks.Artifacts { public sealed class LoopUnlockable : BaseObtainArtifactAchievement { public override ArtifactDef artifactDef => RRPContent.Artifacts.Loop; } } namespace IEye.RRP.Scenes { public sealed class ProvidenceGarden : RRPScene { public override RRPAssetRequest<SceneAssetCollection> assetRequest => RRPAssets.LoadAssetAsync<SceneAssetCollection>("acProvidenceGarden", RRPBundle.Indev); public static MusicTrackDef musicBoss { get; } = Addressables.LoadAssetAsync<MusicTrackDef>((object)"RoR2/Base/Common/muSong23.asset").WaitForCompletion(); public static MusicTrackDef musicReg { get; } = Addressables.LoadAssetAsync<MusicTrackDef>((object)"RoR2/Base/Common/muFULLSong19.asset").WaitForCompletion(); public override void Initialize() { base.sceneDef.mainTrack = musicReg; base.sceneDef.bossTrack = musicBoss; Stage.onStageStartGlobal += Stage_onStageStartGlobal; } private void Stage_onStageStartGlobal(Stage obj) { if ((Object)(object)obj.sceneDef == (Object)(object)base.sceneDef) { SceneDirector.onPostPopulateSceneServer += SceneDirector_onPostPopulateSceneServer; } } private void SceneDirector_onPostPopulateSceneServer(SceneDirector obj) { } public override bool IsAvailable(ContentPack contentPack) { return false; } } } namespace IEye.RRP.Items { public class Kamikaze : RRPItem { public sealed class Behavior : BaseItemBodyBehavior, IOnKilledServerReceiver { private GameObject explodeOnDeathPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ExplodeOnDeath/WilloWispDelay.prefab").WaitForCompletion(); [ItemDefAssociation] private static ItemDef GetItemDef() { return RRPContent.Items.Kamikaze; } public void OnKilledServer(DamageReport damageReport) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; if (Object.op_Implicit((Object)(object)damageReport.victim)) { val = ((Component)damageReport.victim).transform.position; } DelayBlast component = Object.Instantiate<GameObject>(explodeOnDeathPrefab, val, Quaternion.identity).GetComponent<DelayBlast>(); float num = 4f + 2.5f * (float)(base.stack - 1); float baseDamage = Util.OnKillProcDamage(damageReport.victimBody.damage, num); if (Object.op_Implicit((Object)(object)component)) { component.position = val; component.baseDamage = baseDamage; component.baseForce = 2000f; component.bonusForce = Vector3.up * 1000f; component.radius = 25f + (float)(base.stack - 1); component.attacker = ((Component)damageReport.victim).gameObject; component.inflictor = ((Component)damageReport.victim).gameObject; component.crit = Util.CheckRoll(damageReport.victimBody.crit, damageReport.victimMaster); component.maxTimer = 1f; component.damageColorIndex = (DamageColorIndex)3; component.falloffModel = (FalloffModel)1; } } } public override RRPAssetRequest AssetRequest => RRPAssets.LoadAssetAsync<ItemAssetCollection>("acKamikaze", RRPBundle.Items); public override void Initialize() { } public override bool IsAvailable(ContentPack contentPack) { return false; } } public class SacrificialHelper : RRPItem { public sealed class Behavior : BaseItemBodyBehavior, IOnKilledOtherServerReceiver { private int num1; private int num1Bloody; private int num1KillCount; private bool count1Going; private int num2; private int num2Bloody; private int num2KillCount; private bool count2Going; private int num3one; private int num3two; private int num3Bloody; private int num3KillCount; private bool count3Going; private int num4; private int num4Bloody; private int num4KillCount; private bool count4Going; [ItemDefAssociation] private static ItemDef GetItemDef() { return RRPContent.Items.SacrificialHelper; } private void Start() { ((BaseItemBodyBehavior)this).body.onInventoryChanged += CheckForSacrifice; CheckForSacrifice(); if (num1 > 0 && num1Bloody > 0) { ((MonoBehaviour)this).StartCoroutine(SacrificeItem(1)); } if (num2 > 0 && num2Bloody > 0) { ((MonoBehaviour)this).StartCoroutine(SacrificeItem(2)); } if (num3one > 0 && num3two > 0 && num3Bloody > 0) { ((MonoBehaviour)this).StartCoroutine(SacrificeItem(3)); } if (num4 > 0 && num4Bloody > 0) { ((MonoBehaviour)this).StartCoroutine(SacrificeItem(4)); } } private void CheckForSacrifice() { num1 = ((BaseItemBodyBehavior)this).body.inventory.GetItemCount(RRPContent.Items.IntrospectiveInsect); num1Bloody = ((BaseItemBodyBehavior)this).body.inventory.GetItemCount(RRPContent.Items.AgressiveInsect); num2 = ((BaseItemBodyBehavior)this).body.inventory.GetItemCount(Items.SprintBonus); num2Bloody = ((BaseItemBodyBehavior)this).body.inventory.GetItemCount(RRPContent.Items.AdrenalineFrenzy); num3one = ((BaseItemBodyBehavior)this).body.inventory.GetItemCount(Items.BleedOnHit); num3two = ((BaseItemBodyBehavior)this).body.inventory.GetItemCount(RRPContent.Items.FourDimensionalDagger); num3Bloody = ((BaseItemBodyBehavior)this).body.inventory.GetItemCount(RRPContent.Items.FocusedHemorrhage); num4 = ((BaseItemBodyBehavior)this).body.inventory.GetItemCount(Items.AttackSpeedOnCrit); num4Bloody = ((BaseItemBodyBehavior)this).body.inventory.GetItemCount(RRPContent.Items.PredatorySavagery); if (num1 > 0 && num1Bloody > 0 && !count1Going) { ((MonoBehaviour)this).StartCoroutine(SacrificeItem(1)); } if (num2 > 0 && num2Bloody > 0 && !count2Going) { ((MonoBehaviour)this).StartCoroutine(SacrificeItem(2)); } if (num3one > 0 && num3two > 0 && num3Bloody > 0 && !count3Going) { ((MonoBehaviour)this).StartCoroutine(SacrificeItem(3)); } if (num4 > 0 && num4Bloody > 0 && !count4Going) { ((MonoBehaviour)this).StartCoroutine(SacrificeItem(4)); } } public void OnKilledOtherServer(DamageReport report) { if (num1 > 0 && num1Bloody > 0) { num1KillCount++; } if (num2 > 0 && num2Bloody > 0) { num2KillCount++; } if (num3one > 0 && num3two > 0 && num3Bloody > 0) { num3KillCount++; } if (num4 > 0 && num4Bloody > 0) { num4KillCount++; } } private IEnumerator SacrificeItem(int num) { int numSacrifice = calcSacrifices(); RRPLog.Message("Starting Sacrifice, int = " + num + " and kills needed = " + numSacrifice, 185, "SacrificeItem"); switch (num) { case 1: count1Going = true; yield return (object)new WaitUntil((Func<bool>)(() => num1KillCount == numSacrifice)); ((BaseItemBodyBehavior)this).body.inventory.GiveItem(RRPContent.Items.AgressiveInsect, 1); ((BaseItemBodyBehavior)this).body.inventory.RemoveItem(RRPContent.Items.IntrospectiveInsect, 1); SacrificeChat(RRPContent.Items.IntrospectiveInsect, RRPContent.Items.AgressiveInsect); count1Going = false; num1KillCount = 0; CheckForSacrifice(); break; case 2: count2Going = true; yield return (object)new WaitUntil((Func<bool>)(() => num2KillCount == numSacrifice)); ((BaseItemBodyBehavior)this).body.inventory.GiveItem(RRPContent.Items.AdrenalineFrenzy, 1); ((BaseItemBodyBehavior)this).body.inventory.RemoveItem(Items.SprintBonus, 1); SacrificeChat(Items.SprintBonus, RRPContent.Items.AdrenalineFrenzy); count2Going = false; num2KillCount = 0; CheckForSacrifice(); break; case 3: count3Going = true; yield return (object)new WaitUntil((Func<bool>)(() => num3KillCount == numSacrifice)); ((BaseItemBodyBehavior)this).body.inventory.GiveItem(RRPContent.Items.FocusedHemorrhage, 2); ((BaseItemBodyBehavior)this).body.inventory.RemoveItem(Items.BleedOnHit, 1); ((BaseItemBodyBehavior)this).body.inventory.RemoveItem(RRPContent.Items.FourDimensionalDagger, 1); SacrificeChat(Items.BleedOnHit, RRPContent.Items.FourDimensionalDagger, RRPContent.Items.FocusedHemorrhage); num3KillCount = 0; count3Going = false; CheckForSacrifice(); break; case 4: count4Going = true; yield return (object)new WaitUntil((Func<bool>)(() => num4KillCount == numSacrifice)); ((BaseItemBodyBehavior)this).body.inventory.GiveItem(RRPContent.Items.PredatorySavagery, 1); ((BaseItemBodyBehavior)this).body.inventory.RemoveItem(Items.AttackSpeedOnCrit, 1); SacrificeChat(Items.AttackSpeedOnCrit, RRPContent.Items.PredatorySavagery); num4KillCount = 0; count4Going = false; CheckForSacrifice(); break; } } private int calcSacrifices() { float difficultyCoefficient = Run.instance.difficultyCoefficient; int num = (int)(Sacrificial.multiplier * difficultyCoefficient); if (num > Sacrificial.cap) { return Sacrificial.cap; } return num; } private void SacrificeChat(ItemDef one, ItemDef two) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) CharacterMasterNotificationQueue.SendTransformNotification(((BaseItemBodyBehavior)this).body.master, one.itemIndex, two.itemIndex, (TransformationType)0); } private void SacrificeChat(ItemDef one, ItemDef two, ItemDef three) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) CharacterMasterNotificationQueue.SendTransformNotification(((BaseItemBodyBehavior)this).body.master, one.itemIndex, three.itemIndex, (TransformationType)0); CharacterMasterNotificationQueue.SendTransformNotification(((BaseItemBodyBehavior)this).body.master, two.itemIndex, three.itemIndex, (TransformationType)0); } } public override RRPAssetRequest AssetRequest => RRPAssets.LoadAssetAsync<ItemAssetCollection>("acHelper", RRPBundle.Items); public override void Initialize() { } public override bool IsAvailable(ContentPack contentPack) { return true; } } public class DoubleSidedSword : RRPItem { public sealed class Behavior : BaseItemBodyBehavior, IOnTakeDamageServerReceiver { private SphereSearch search; public float baseRange = radiusBase; [ItemDefAssociation] private static ItemDef GetItemDef() { return RRPContent.Items.DoubleSidedSword; } public void OnTakeDamageServer(DamageReport report) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Invalid comparison between Unknown and I4 //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) if (!(report.damageInfo.procCoefficient > 0f) || !((object)(DotIndex)(ref report.damageInfo.dotIndex)).Equals((object)(DotIndex)(-1)) || (int)report.damageInfo.damageType.damageType == 66) { return; } HealthComponent victim = report.victim; InflictDotInfo val = default(InflictDotInfo); val.attackerObject = ((Component)victim).gameObject; val.victimObject = ((Component)victim).gameObject; val.dotIndex = (DotIndex)0; val.duration = duration * report.damageInfo.procCoefficient; val.damageMultiplier = damage * playerCoef * (float)base.stack * 0.01f; InflictDotInfo val2 = val; DotController.InflictDot(ref val2); HealthComponent[] array = PickNextTarget(report.victimBody.corePosition, victim); if (array != null) { HealthComponent[] array2 = array; foreach (HealthComponent val3 in array2) { val = default(InflictDotInfo); val.attackerObject = ((Component)victim).gameObject; val.victimObject = ((Component)val3).gameObject; val.dotIndex = (DotIndex)0; val.duration = duration * report.damageInfo.procCoefficient; val.damageMultiplier = damage * (float)base.stack; InflictDotInfo val4 = val; DotController.InflictDot(ref val4); } } } public HealthComponent[] PickNextTarget(Vector3 position, HealthComponent currentVictim) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) if (search == null) { search = new SphereSearch(); } float num = baseRange; if (Object.op_Implicit((Object)(object)currentVictim) && Object.op_Implicit((Object)(object)currentVictim.body)) { num += currentVictim.body.radius; } TeamMask val = TeamMask.AllExcept((TeamIndex)1); search.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; search.radius = num; search.origin = position; search.queryTriggerInteraction = (QueryTriggerInteraction)0; search.RefreshCandidates(); search.FilterCandidatesByHurtBoxTeam(val); search.FilterCandidatesByDistinctHurtBoxEntities(); HurtBox[] hurtBoxes = search.GetHurtBoxes(); HealthComponent[] array = (HealthComponent[])(object)new HealthComponent[hurtBoxes.Length]; for (int i = 0; i < hurtBoxes.Length; i++) { array[i] = hurtBoxes[i].healthComponent; } if (array.Length == 0 || array == null) { return null; } return array; } } private const string token = "RRP_ITEM_DOUBLESWORD_DESC"; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Base radius for bleed effect(default 50m).")] [FormatToken("RRP_ITEM_DOUBLESWORD_DESC", 0)] public static int radiusBase = 50; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Damage Coefficient for bleed damage(default 2).")] [FormatToken(/*Could not decode attribute arguments.*/)] public static float damage = 2f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Duration of bleed(default 3).")] [FormatToken("RRP_ITEM_DOUBLESWORD_DESC", 2)] public static float duration = 3f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Percentage of base damage done to the player(default 20%).")] [FormatToken("RRP_ITEM_DOUBLESWORD_DESC", 3)] public static float playerCoef = 20f; public override RRPAssetRequest AssetRequest => RRPAssets.LoadAssetAsync<ItemAssetCollection>("acDoubleSword", RRPBundle.Items); public override void Initialize() { } public override bool IsAvailable(ContentPack contentPack) { return true; } } public class AdrenalineFrenzy : RRPItem { public sealed class Behavior : BaseItemBodyBehavior, IOnTakeDamageServerReceiver, IOnKilledOtherServerReceiver { [ItemDefAssociation] private static ItemDef GetItemDef() { return RRPContent.Items.AdrenalineFrenzy; } private void Start() { if (((BaseItemBodyBehavior)this).body.inventory.GetItemCount(RRPContent.Items.SacrificialHelper) == 0) { ((BaseItemBodyBehavior)this).body.inventory.GiveItem(RRPContent.Items.SacrificialHelper, 1); } } public void OnKilledOtherServer(DamageReport report) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Invalid comparison between Unknown and I4 //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (report.damageInfo.procCoefficient > 0f && ((object)(DotIndex)(ref report.damageInfo.dotIndex)).Equals((object)(DotIndex)(-1)) && (int)report.damageInfo.damageType.damageType != 66) { report.attacker.GetComponent<CharacterBody>().AddTimedBuffAuthority(RRPContent.Buffs.AdrenalineOnKill.buffIndex, killSpeedDuration); } } public void OnTakeDamageServer(DamageReport report) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Invalid comparison between Unknown and I4 //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (report.damageInfo.procCoefficient > 0f && ((object)(DotIndex)(ref report.damageInfo.dotIndex)).Equals((object)(DotIndex)(-1)) && (int)report.damageInfo.damageType.damageType != 66) { ((Component)report.victim).GetComponent<CharacterBody>().AddTimedBuffAuthority(RRPContent.Buffs.AdrenalineOnGettingHit.buffIndex, onHitSpeedDuration); } } } public sealed class OnKillBehavior : BaseBuffBehaviour, IBodyStatArgModifier { [BuffDefAssociation] private static BuffDef GetBuffDef() { return RRPContent.Buffs.AdrenalineOnKill; } public void ModifyStatArguments(StatHookEventArgs args) { if (((BaseBuffBehaviour)this).hasAnyStacks) { int itemCount = ((BaseBuffBehaviour)this).characterBody.inventory.GetItemCount(RRPContent.Items.AdrenalineFrenzy); args.sprintSpeedAdd += (killSpeed / 100f + killSpeedStack / 100f * (float)(itemCount - 1)) * (float)((BaseBuffBehaviour)this).buffCount; } } } public sealed class OnHitBehavior : BaseBuffBehaviour, IBodyStatArgModifier { [BuffDefAssociation] private static BuffDef GetBuffDef() { return RRPContent.Buffs.AdrenalineOnGettingHit; } public void ModifyStatArguments(StatHookEventArgs args) { if (((BaseBuffBehaviour)this).hasAnyStacks) { int itemCount = ((BaseBuffBehaviour)this).characterBody.inventory.GetItemCount(RRPContent.Items.AdrenalineFrenzy); args.moveSpeedMultAdd += (onHitSpeed / 100f + onHitSpeedStack / 100f * (float)(itemCount - 1)) * (float)((BaseBuffBehaviour)this).buffCount; } } } public const string token = "RRP_ITEM_ADRFRENZY_DESC"; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Base percentage speed added on kill(default 6%).")] [FormatToken("RRP_ITEM_ADRFRENZY_DESC", 0)] public static float killSpeed = 6f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Base percentage speed added on kill per stack(default 4%).")] [FormatToken("RRP_ITEM_ADRFRENZY_DESC", 1)] public static float killSpeedStack = 4f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Base time for on kill speed boost(default 10s).")] [FormatToken("RRP_ITEM_ADRFRENZY_DESC", 2)] public static float killSpeedDuration = 10f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Base percentage speed added on getting hit(default 12%).")] [FormatToken("RRP_ITEM_ADRFRENZY_DESC", 3)] public static float onHitSpeed = 12f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Base percentage speed added on getting hit per stack(default(7%).")] [FormatToken("RRP_ITEM_ADRFRENZY_DESC", 4)] public static float onHitSpeedStack = 7f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Base time for on getting hit speed boost(default 8s).")] [FormatToken("RRP_ITEM_ADRFRENZY_DESC", 5)] public static float onHitSpeedDuration = 8f; public override RRPAssetRequest AssetRequest => RRPAssets.LoadAssetAsync<ItemAssetCollection>("acFrenzy", RRPBundle.Items); public override void Initialize() { } public override bool IsAvailable(ContentPack contentPack) { return true; } } public class AgressiveInsect : RRPItem { public sealed class Behavior : BaseItemBodyBehavior, IOnDamageDealtServerReceiver, IOnTakeDamageServerReceiver { [ItemDefAssociation] private static ItemDef GetItemDef() { return RRPContent.Items.AgressiveInsect; } private void Start() { if (((BaseItemBodyBehavior)this).body.inventory.GetItemCount(RRPContent.Items.SacrificialHelper) == 0) { ((BaseItemBodyBehavior)this).body.inventory.GiveItem(RRPContent.Items.SacrificialHelper, 1); } } public void OnDamageDealtServer(DamageReport damageReport) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)damageReport.victimBody) && damageReport.victimBody.GetBuffCount(RRPContent.Buffs.InsectBloody) > 0 && !((ProcChainMask)(ref damageReport.damageInfo.procChainMask)).HasProc(basedProc)) { SpawnMissile(damageReport); } } private void SpawnMissile(DamageReport damageReport) { //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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) float num = (float)(bloodyInsectExtraDamage * base.stack) / 100f; DamageInfo damageInfo = damageReport.damageInfo; AgressiveInsectMissileOrb agressiveInsectMissileOrb = new AgressiveInsectMissileOrb(); ((Orb)agressiveInsectMissileOrb).origin = ((BaseItemBodyBehavior)this).body.aimOrigin; ((GenericDamageOrb)agressiveInsectMissileOrb).damageValue = Util.OnHitProcDamage(damageInfo.damage, damageReport.attackerBody.damage, num); ((GenericDamageOrb)agressiveInsectMissileOrb).isCrit = damageInfo.crit; ((GenericDamageOrb)agressiveInsectMissileOrb).teamIndex = damageReport.attackerTeamIndex; ((GenericDamageOrb)agressiveInsectMissileOrb).attacker = damageInfo.attacker; ((GenericDamageOrb)agressiveInsectMissileOrb).procChainMask = damageInfo.procChainMask; ((ProcChainMask)(ref ((GenericDamageOrb)agressiveInsectMissileOrb).procChainMask)).AddProc(basedProc); ((GenericDamageOrb)agressiveInsectMissileOrb).procCoefficient = 0.2f; ((GenericDamageOrb)agressiveInsectMissileOrb).damageColorIndex = (DamageColorIndex)2; HurtBox mainHurtBox = damageReport.victimBody.mainHurtBox; if (Object.op_Implicit((Object)(object)mainHurtBox)) { ((Orb)agressiveInsectMissileOrb).target = mainHurtBox; OrbManager.instance.AddOrb((Orb)(object)agressiveInsectMissileOrb); } } private void applyPoision(CharacterBody cb) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (cb.GetBuffCount(RRPContent.Buffs.InsectBloody) > 0) { cb.RemoveOldestTimedBuff(RRPContent.Buffs.InsectBloody.buffIndex); } cb.AddTimedBuffAuthority(RRPContent.Buffs.InsectBloody.buffIndex, duration * (float)base.stack); } public void OnTakeDamageServer(DamageReport report) { if (report == null) { return; } GameObject attacker = report.attacker; if (Object.op_Implicit((Object)(object)attacker)) { CharacterBody component = attacker.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && report.damageInfo.procCoefficient > 0f) { applyPoision(component); } } } } public sealed class BloodBehavior : BaseBuffBehaviour { [BuffDefAssociation] private static BuffDef GetBuffDef() { return RRPContent.Buffs.InsectBloody; } } public const string token = "RRP_ITEM_AGROINSECT_DESC"; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Duration of the insect blood debuff(default 8s)")] [FormatToken("RRP_ITEM_AGROINSECT_DESC", 0)] public static float duration = 8f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Percent damage per orb per stack(default 25%)")] [FormatToken("RRP_ITEM_AGROINSECT_DESC", 1)] public static int bloodyInsectExtraDamage = 25; private static readonly ProcType basedProc = (ProcType)382143; public override RRPAssetRequest AssetRequest => RRPAssets.LoadAssetAsync<ItemAssetCollection>("acAInsect", RRPBundle.Items); public override void Initialize() { } public override bool IsAvailable(ContentPack contentPack) { return true; } } public class BloodlustIvy : RRPItem { public sealed class Behavior : BaseItemBodyBehavior, IOnDamageInflictedServerReceiver { public static float damageNeeded; public static float healthTracker; private SphereSearch search; private List<HealthComponent> healthComponents; public float baseRange = distanceNeeded; [ItemDefAssociation] private static ItemDef GetItemDef() { return RRPContent.Items.BloodyIvy; } private void Explode() { foreach (HealthComponent item in PickNextTarget(((BaseItemBodyBehavior)this).body.healthComponent)) { NetworkingHelpers.ApplyDot(item, ((Component)((BaseItemBodyBehavior)this).body).gameObject, (DotIndex)4, 10f, 1.5f); } damageNeeded = ((BaseItemBodyBehavior)this).body.healthComponent.fullCombinedHealth * (percentHealthCoef / 100f); } public void OnDamageInflictedServer(DamageReport damageReport) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Distance(damageReport.victimBody.transform.position, ((BaseItemBodyBehavior)this).body.transform.position) <= distanceNeeded) { healthTracker += damageReport.damageDealt; } if (healthTracker >= damageNeeded) { Explode(); } } public List<HealthComponent> PickNextTarget(HealthComponent currentVictim) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) if (search == null) { search = new SphereSearch(); } float num = baseRange; if (Object.op_Implicit((Object)(object)currentVictim) && Object.op_Implicit((Object)(object)currentVictim.body)) { num += currentVictim.body.radius; } TeamMask val = TeamMask.AllExcept((TeamIndex)1); search.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; search.radius = num; search.origin = currentVictim.body.corePosition; search.queryTriggerInteraction = (QueryTriggerInteraction)0; search.RefreshCandidates(); search.FilterCandidatesByHurtBoxTeam(val); search.FilterCandidatesByDistinctHurtBoxEntities(); HurtBox[] hurtBoxes = search.GetHurtBoxes(); healthComponents = new List<HealthComponent>(); HurtBox[] array = hurtBoxes; foreach (HurtBox val2 in array) { if ((Object)(object)val2.healthComponent != (Object)(object)currentVictim) { healthComponents.Add(val2.healthComponent); } } if (healthComponents.Count == 0) { return null; } return healthComponents; } } private const string token = "RRP_ITEM_BLOODIVY_DESC"; public static float percentHealthCoef = 15f; public static float distanceNeeded = 20f; public override RRPAssetRequest AssetRequest => RRPAssets.LoadAssetAsync<ItemAssetCollection>("acBloodIvy", RRPBundle.Items); public override void Initialize() { } public override bool IsAvailable(ContentPack contentPack) { return false; } } public class FocusedHemorrhage : RRPItem { public sealed class Behavior : BaseItemBodyBehavior, IOnDamageDealtServerReceiver { [ItemDefAssociation] private static ItemDef GetItemDef() { return RRPContent.Items.FocusedHemorrhage; } public void OnDamageDealtServer(DamageReport report) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) if (report.damageInfo.procCoefficient == 0f) { return; } _ = report.attackerBody.teamComponent.teamIndex; if (Util.CheckRoll(percentChance * report.damageInfo.procCoefficient, report.attackerBody.master)) { HealthComponent victim = report.victim; InflictDotInfo val = default(InflictDotInfo); val.attackerObject = report.attacker; val.victimObject = ((Component)victim).gameObject; val.dotIndex = (DotIndex)6; val.duration = report.damageInfo.procCoefficient * duration; val.damageMultiplier = 1f + percentDamageOver / 100f; InflictDotInfo val2 = val; for (int i = 0; i < (base.stack - 1) / 2 + 1; i++) { DotController.InflictDot(ref val2); } } } private void Start() { if (((BaseItemBodyBehavior)this).body.inventory.GetItemCount(RRPContent.Items.SacrificialHelper) == 0) { ((BaseItemBodyBehavior)this).body.inventory.GiveItem(RRPContent.Items.SacrificialHelper, 1); } } } public const string token = "RRP_ITEM_FHEMORRHAGE_DESC"; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Chance on hit to apply Hemorrhage(default 10%).")] [FormatToken("RRP_ITEM_FHEMORRHAGE_DESC", 0)] public static float percentChance = 10f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Added to damage multiplier(default 35%).")] public static float percentDamageOver = 35f; [FormatToken("RRP_ITEM_FHEMORRHAGE_DESC", 1)] public static float percentDamage = 100f + percentDamageOver; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Duration of Hemorrhage(default 10s).")] [FormatToken("RRP_ITEM_FHEMORRHAGE_DESC", 2)] public static float duration = 10f; public override RRPAssetRequest AssetRequest => RRPAssets.LoadAssetAsync<ItemAssetCollection>("acFocusHemorrhage", RRPBundle.Items); public override void Initialize() { } public override bool IsAvailable(ContentPack contentPack) { return true; } } public class Leech : RRPItem { public sealed class Behavior : BaseItemBodyBehavior, IOnTakeDamageServerReceiver, IOnKilledOtherServerReceiver { [ItemDefAssociation] private static ItemDef GetItemDef() { return RRPContent.Items.Leech; } public void OnTakeDamageServer(DamageReport report) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Invalid comparison between Unknown and I4 //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) if (report.damageInfo.procCoefficient > 0f && ((object)(DotIndex)(ref report.damageInfo.dotIndex)).Equals((object)(DotIndex)(-1)) && (int)report.damageInfo.damageType.damageType != 66) { InflictDotInfo val = default(InflictDotInfo); val.victimObject = ((Component)report.victim).gameObject; val.attackerObject = ((Component)report.victim).gameObject; val.dotIndex = (DotIndex)0; val.duration = 2f * report.damageInfo.procCoefficient; val.damageMultiplier = 1f; val.totalDamage = report.damageDealt / 6f; InflictDotInfo val2 = val; DotController.InflictDot(ref val2); } } public void OnKilledOtherServer(DamageReport report) { if (Random.Range(0f, 100f) < 10f) { ((BaseItemBodyBehavior)this).body.inventory.RemoveItem(RRPContent.Items.Leech, 1); } } } private const string token = "RRP_ITEM_LEECH_DESC"; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Chance for this item to proc per stack(default 15%).")] [FormatToken("RRP_ITEM_LEECH_DESC", 0)] public static float percentChance = 15f; public override RRPAssetRequest AssetRequest => RRPAssets.LoadAssetAsync<ItemAssetCollection>("acLeech", RRPBundle.Items); public override void Initialize() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown HealthComponent.Heal += new hook_Heal(HealthComponent_Heal); } private float HealthComponent_Heal(orig_Heal orig, HealthComponent self, float amount, ProcChainMask procChainMask, bool nonRegen) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)self.body.inventory)) { amount /= (float)(self.body.inventory.GetItemCount(RRPContent.Items.Leech) + 1); } return orig.Invoke(self, amount, procChainMask, nonRegen); } public override bool IsAvailable(ContentPack contentPack) { return false; } } public class PredatorySavagery : RRPItem { public sealed class Behavior : BaseItemBodyBehavior, IOnDamageDealtServerReceiver, IOnKilledOtherServerReceiver { [ItemDefAssociation] private static ItemDef GetItemDef() { return RRPContent.Items.PredatorySavagery; } public void OnDamageDealtServer(DamageReport report) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (Util.CheckRoll(hitChance * report.damageInfo.procCoefficient, report.attackerMaster)) { RRPLog.Message("Roll passed", 73, "OnDamageDealtServer"); report.attackerBody.AddTimedBuffAuthority(RRPContent.Buffs.PredatoryRush.buffIndex, report.damageInfo.procCoefficient * (duration + stackDuration * (float)base.stack)); } } public void OnKilledOtherServer(DamageReport report) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (Util.CheckRoll(killChance, report.attackerMaster)) { report.attackerBody.AddTimedBuffAuthority(RRPContent.Buffs.PredatoryRush.buffIndex, duration + stackDuration * (float)(base.stack - 1)); } } private void Start() { if (((BaseItemBodyBehavior)this).body.inventory.GetItemCount(RRPContent.Items.SacrificialHelper) == 0) { ((BaseItemBodyBehavior)this).body.inventory.GiveItem(RRPContent.Items.SacrificialHelper, 1); } } } public sealed class SavageBehavior : BaseBuffBehaviour, IBodyStatArgModifier, IOnTakeDamageServerReceiver { [BuffDefAssociation] private static BuffDef GetBuffDef() { return RRPContent.Buffs.PredatoryRush; } public void ModifyStatArguments(StatHookEventArgs args) { if (((BaseBuffBehaviour)this).hasAnyStacks) { int itemCount = ((BaseBuffBehaviour)this).characterBody.inventory.GetItemCount(RRPContent.Items.PredatorySavagery); args.damageMultAdd += damage / 100f * (float)itemCount; if (cooldownReduction * (float)itemCount < 50f) { args.cooldownMultAdd -= cooldownReduction / 100f * (float)itemCount; } else { args.cooldownMultAdd -= 0.5f; } args.armorAdd += (float)(armor * itemCount); args.jumpPowerMultAdd += jumpMult / 100f; args.critAdd += critChance; args.critDamageMultAdd += critDamage / 100f * (float)itemCount; } } public void OnTakeDamageServer(DamageReport damageReport) { } } public const string token = "RRP_ITEM_PREDATORY_DESC"; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Armor with rush per stack(default 15).")] [FormatToken("RRP_ITEM_PREDATORY_DESC", 0)] public static int armor = 15; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Percent damage increase per stack(default 15%).")] [FormatToken("RRP_ITEM_PREDATORY_DESC", 1)] public static float damage = 15f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Pecent global cooldown reduction per stack(default 5%)(caps at 50%).")] [FormatToken("RRP_ITEM_PREDATORY_DESC", 2)] public static float cooldownReduction = 5f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Added percentage jump force(regardless of stack)(default 35%).")] [FormatToken("RRP_ITEM_PREDATORY_DESC", 3)] public static float jumpMult = 35f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Added crit damage per stack(default 10%).")] [FormatToken("RRP_ITEM_PREDATORY_DESC", 4)] public static float critDamage = 10f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Added crit chance(regardless of stack)(default 6%).")] [FormatToken("RRP_ITEM_PREDATORY_DESC", 5)] public static float critChance = 6f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Base duration of the rush(default 10s).")] [FormatToken("RRP_ITEM_PREDATORY_DESC", 6)] public static float duration = 10f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Duration added on stack(default 3s).")] [FormatToken("RRP_ITEM_PREDATORY_DESC", 7)] public static float stackDuration = 3f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Percent chance of rush on hit(default 2%).")] [FormatToken("RRP_ITEM_PREDATORY_DESC", 8)] public static float hitChance = 2f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Percent chance of rush on kill(default 5%).")] [FormatToken("RRP_ITEM_PREDATORY_DESC", 9)] public static float killChance = 5f; public override RRPAssetRequest AssetRequest => RRPAssets.LoadAssetAsync<ItemAssetCollection>("acSavagery", RRPBundle.Items); public override void Initialize() { } public override bool IsAvailable(ContentPack contentPack) { return true; } } public class FourDimensionalDagger : RRPItem { public sealed class Behavior : BaseItemBodyBehavior, IOnDamageDealtServerReceiver { private SphereSearch search; private HealthComponent selected; public float baseRange = radiusBase; [ItemDefAssociation] private static ItemDef GetItemDef() { return RRPContent.Items.FourDimensionalDagger; } public void OnDamageDealtServer(DamageReport report) { //IL_002c: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00f2: Unknown result type (might be due to invalid IL or missing references) if (report.damageInfo.procCoefficient == 0f) { return; } HealthComponent victim = report.victim; GameObject attacker = report.attacker; _ = report.attackerBody.teamComponent.teamIndex; if (((ProcChainMask)(ref report.damageInfo.procChainMask)).HasProc((ProcType)5)) { return; } ProcChainMask procChainMask = report.damageInfo.procChainMask; ((ProcChainMask)(ref procChainMask)).AddProc((ProcType)5); if (Util.CheckRoll(report.damageInfo.procCoefficient * percentChance * (float)base.stack, report.attackerBody.master)) { HealthComponent val = PickNextTarget(report.victimBody.corePosition, victim); if (!((Object)(object)val == (Object)null)) { InflictDotInfo val2 = default(InflictDotInfo); val2.attackerObject = attacker; val2.victimObject = ((Component)val).gameObject; val2.dotIndex = (DotIndex)0; val2.duration = report.damageInfo.procCoefficient * duration; val2.damageMultiplier = 1f; InflictDotInfo val3 = val2; RRPLog.Message("Before inflict", 72, "OnDamageDealtServer"); DotController.InflictDot(ref val3); } } } public HealthComponent PickNextTarget(Vector3 position, HealthComponent currentVictim) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) if (search == null) { search = new SphereSearch(); } float num = baseRange; if (Object.op_Implicit((Object)(object)currentVictim) && Object.op_Implicit((Object)(object)currentVictim.body)) { num += currentVictim.body.radius; } TeamMask val = TeamMask.AllExcept((TeamIndex)1); search.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; search.radius = num + (float)(radiusIncrease * (base.stack - 1)); search.origin = position; search.queryTriggerInteraction = (QueryTriggerInteraction)0; search.RefreshCandidates(); search.FilterCandidatesByHurtBoxTeam(val); search.FilterCandidatesByDistinctHurtBoxEntities(); HurtBox[] hurtBoxes = search.GetHurtBoxes(); List<HealthComponent> list = new List<HealthComponent>(); HurtBox[] array = hurtBoxes; foreach (HurtBox val2 in array) { if ((Object)(object)val2.healthComponent != (Object)(object)currentVictim) { list.Add(val2.healthComponent); } } if (list.Count != 0) { selected = list[Random.Range(0, list.Count)]; return selected; } return null; } } private const string token = "RRP_ITEM_FOURDIMENSIONALDAGGER_DESC"; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Chance for this item to proc per stack(default 15%).")] [FormatToken("RRP_ITEM_FOURDIMENSIONALDAGGER_DESC", 0)] public static float percentChance = 15f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Base search radius(default 25m).")] [FormatToken("RRP_ITEM_FOURDIMENSIONALDAGGER_DESC", 1)] public static int radiusBase = 25; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Added search radius per stack past 1(default 5m).")] [FormatToken("RRP_ITEM_FOURDIMENSIONALDAGGER_DESC", 2)] public static int radiusIncrease = 5; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Duration of the bleed in second(default 3s).")] public static float duration = 3f; public override RRPAssetRequest AssetRequest => RRPAssets.LoadAssetAsync<ItemAssetCollection>("ac4DDagger", RRPBundle.Items); public override void Initialize() { } public override bool IsAvailable(ContentPack contentPack) { return true; } } public class IntrospectiveInsect : RRPItem { public sealed class Behavior : BaseItemBodyBehavior, IOnTakeDamageServerReceiver, IOnDamageDealtServerReceiver { [ItemDefAssociation] private static ItemDef GetItemDef() { return RRPContent.Items.IntrospectiveInsect; } public void OnDamageDealtServer(DamageReport damageReport) { if (damageReport == null) { return; } CharacterBody victimBody = damageReport.victimBody; if (!Object.op_Implicit((Object)(object)victimBody)) { return; } GameObject gameObject = ((Component)victimBody).gameObject; if (victimBody.GetBuffCount(RRPContent.Buffs.InsectPoison) > 0) { HitCounter hitCounter = default(HitCounter); if (!gameObject.TryGetComponent<HitCounter>(ref hitCounter)) { hitCounter = gameObject.AddComponent<HitCounter>(); } hitCounter.AddHit(); if (hitCounter.CheckForHeal()) { victimBody.RemoveBuff(RRPContent.Buffs.InsectPoison); SpawnOrb(damageReport, victimBody); } } } private static void SpawnOrb(DamageReport damageReport, CharacterBody victimBody) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) HealOrb val = new HealOrb(); ((Orb)val).origin = victimBody.aimOrigin; val.healValue = damageReport.attackerBody.maxHealth * (insectHealAmount / 100f); HurtBox mainHurtBox = damageReport.attackerBody.mainHurtBox; if (Object.op_Implicit((Object)(object)mainHurtBox)) { ((Orb)val).target = mainHurtBox; OrbManager.instance.AddOrb((Orb)(object)val); } } public void OnTakeDamageServer(DamageReport report) { if (report == null) { return; } GameObject attacker = report.attacker; if (Object.op_Implicit((Object)(object)attacker)) { CharacterBody component = attacker.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && report.damageInfo.procCoefficient > 0f) { applyPoision(component); } } } private void applyPoision(CharacterBody cb) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (cb.GetBuffCount(RRPContent.Buffs.InsectPoison) > 0) { cb.RemoveOldestTimedBuff(RRPContent.Buffs.InsectPoison.buffIndex); } cb.AddTimedBuffAuthority(RRPContent.Buffs.InsectPoison.buffIndex, (float)duration); } } public class HitCounter : MonoBehaviour { private int hitNumber; public void AddHit() { hitNumber++; } public void ResetHit() { hitNumber = 0; } public bool CheckForHeal() { if (hitNumber == hitsNeeded) { ResetHit(); return true; } return false; } } public sealed class BuffBehavior : BaseBuffBehaviour, IBodyStatArgModifier { [BuffDefAssociation] private static BuffDef GetBuffDef() { return RRPContent.Buffs.InsectPoison; } public void ModifyStatArguments(StatHookEventArgs args) { if (((BaseBuffBehaviour)this).hasAnyStacks) { args.attackSpeedReductionMultAdd += insectAttackSpeed / 100f; args.moveSpeedReductionMultAdd += insectMoveSpeed / 100f; } } } public const string token = "RRP_ITEM_INTROINSECT_DESC"; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Duration of the insect posion per stack(default 7s)")] [FormatToken("RRP_ITEM_INTROINSECT_DESC", 0)] public static int duration = 7; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Percentage of attack speed slow(default 50%)")] [FormatToken("RRP_ITEM_INTROINSECT_DESC", 1)] public static float insectAttackSpeed = 50f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Percentage of movement speed slow(default 50%)")] [FormatToken("RRP_ITEM_INTROINSECT_DESC", 2)] public static float insectMoveSpeed = 50f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Percent life restored on hitting enemies per stack(default 10%)")] [FormatToken("RRP_ITEM_INTROINSECT_DESC", 3)] public static float insectHealAmount = 10f; [RiskOfOptionsConfigureField("RRP.Items", configDescOverride = "Hits needed to heal(default 5)")] [FormatToken("RRP_ITEM_INTROINSECT_DESC", 4)] public static int hitsNeeded = 5; public override RRPAssetRequest AssetRequest => RRPAssets.LoadAssetAsync<ItemAssetCollection>("acIInsect", RRPBundle.Items); public override void Initialize() { } public override bool IsAvailable(ContentPack contentPack) { return true; } } public class PoisonIvy : RRPItem { public sealed class Behavior : BaseItemBodyBehavior { private bool isRunning; private GameObject effect = RRPAssets.LoadAsset<GameObject>("PoisionIvyEffect", RRPBundle.Items); private SphereSearch search; private List<HealthComponent> healthComponents; public float baseRange = distance; [ItemDefAssociation] private static ItemDef GetItemDef() { return RRPContent.Items.PoisonIvy; } private void Update() { if (isRunning || ((BaseItemBodyBehavior)this).body.activeBuffsListCount < buffsNeeded) { return; } int num = 0; BuffIndex[] activeBuffsList = ((BaseItemBodyBehavior)this).body.activeBuffsList; for (int i = 0; i < activeBuffsList.Length; i++) { if (!BuffCatalog.GetBuffDef(activeBuffsList[i]).isDebuff) { num++; } } if (num >= buffsNeeded) { applyPoision(PickNextTargets(((BaseItemBodyBehavior)this).body.healthComponent)); isRunning = true; ((MonoBehaviour)this).StartCoroutine(waitCoroutine()); } } private IEnumerator waitCoroutine() { yield return (object)new WaitForSeconds(waitTime); isRunning = false; } public void applyPoision(List<HealthComponent> targets) { //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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown EffectManager.SpawnEffect(effect, new EffectData { origin = ((BaseItemBodyBehavior)this).body.corePosition, rotation = Quaternion.identity, scale = distance }, true); if (targets == null) { return; } foreach (HealthComponent target in targets) { NetworkingHelpers.ApplyDot(target, ((Component)((BaseItemBodyBehavior)this).body).gameObject, (DotIndex)4, baseDuration + ((float)base.stack - 1f * stackDuration), 1f); } } public List<HealthComponent> PickNextTargets(HealthComponent playerHealthComp) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) if (search == null) { search = new SphereSearch(); } float num = baseRange; if (Object.op_Implicit((Object)(object)playerHealthComp) && Object.op_Implicit((Object)(object)playerHealthComp.body)) { num += playerHealthComp.body.radius; } TeamMask val = TeamMask.AllExcept((TeamIndex)1); search.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; search.radius = num; search.origin = playerHealthComp.body.corePosition; search.queryTriggerInteraction = (QueryTriggerInteraction)0; search.RefreshCandidates(); search.FilterCandidatesByHurtBoxTeam(val); search.FilterCandidatesByDistinctHurtBoxEntities(); HurtBox[] hurtBoxes = search.GetHurtBoxes(); healthComponents = new List<HealthComponent>(); HurtBox[] array = hurtBoxes; foreach (HurtBox val2 in array) { if ((Object)(object)val2.healthComponent != (Object)(object)playerHealthComp) { healthComponents.Add(val2.healthComponent); } } if (healthComponents.Count == 0) { return null; } return healthComponents; } } public sealed class BlightBehavior : BaseBuffBehaviour, IOnDamageDealtServerReceiver { [BuffDefAssociation] private static BuffDef GetBuffDef() { return RRPContent.Buffs.IvyBlight; } public void OnDamageDealtServer(DamageReport damageReport) { if (((BaseBuffBehaviour)this).hasAnyStacks && Util.CheckRoll(15f, ((BaseBuffBehaviour)this).characterBody.master)) { NetworkingHelpers.ApplyDot(damageReport.victim, ((Component)((BaseBuffBehaviour)this).characterBody).gameObject, (DotIndex)5, 4f, 0.75f); } } } public sealed class PowerBehavior : BaseBuffBehaviour, IBodyStatArgModifier { [BuffDefAssociation] private static BuffDef GetBuffDef() { return RRPContent.Buffs.IvyPower; } public void ModifyStatArguments(StatHookEventArgs args) { if (((BaseBuffBehaviour)this).hasAnyStacks) { args.damageMultAdd += 20f; args.critDamageMultAdd += 25f; args.attackSpeedMultAdd += 20f; } } } private const string token = "RRP_ITEM_IVY_DESC"; public static int buffsNeeded = 2; public static float distance = 15f; public static float baseDuration = 5f; public static float stackDuration = 2f; public static float waitTime = 10f; public override RRPAssetRequest AssetRequest => RRPAssets.LoadAssetAsync<ItemAssetCollection>("acPoisonIvy", RRPBundle.Items); public override void Initialize() { } public override bool IsAvailable(ContentPack contentPack) { return false; } } public class InnerPiece : RRPItem { public sealed class Behavior : BaseItemBodyBehavior, IBodyStatArgModifier { private bool isGood = true; private int numDebuff; public void Update() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Invalid comparison between Unknown and I4 //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) numDebuff = 0; BuffIndex[] debuffBuffIndices = BuffCatalog.debuffBuffIndices; foreach (BuffIndex val in debuffBuffIndices) { if (((BaseItemBodyBehavior