using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; using Alexandria.ItemAPI; using Alexandria.Misc; using Alexandria.SoundAPI; using Alexandria.VisualAPI; using BepInEx; using Dungeonator; using Gungeon; using GungeonCOTL.active_items; using GungeonCOTL.custom_class_data; using GungeonCOTL.passive_items; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Mod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Mod")] [assembly: AssemblyCopyright("Copyright © 2020")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("d6d7a494-722e-4763-959b-c2d6b6a42b01")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class CustomLightningChainEnemiesModifierAOE : BraveBehaviour { [CompilerGenerated] private sealed class d__28 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public AIActor damagedTarget; public CustomLightningChainEnemiesModifierAOE <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__28(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.m_damagedEnemies.Add(damagedTarget); <>2__current = (object)new WaitForSeconds(<>4__this.damageCooldown); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.m_damagedEnemies.Remove(damagedTarget); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public GameObject LinkVFXPrefab; public CoreDamageTypes damageTypes; public bool RequiresSameProjectileClass; public float maximumLinkDistance; public bool usesStaticDamageStat = true; public float damagePerHit; public float damageScale; public float damageCooldown = 0.1f; public List sfxPath = new List(); [NonSerialized] public bool DamagesEnemies = true; [NonSerialized] public bool PlaysSFX = true; [Header("Dispersal")] public bool UsesDispersalParticles; [ShowInInspectorIf("UsesDispersalParticles", false)] public float DispersalDensity = 3f; [ShowInInspectorIf("UsesDispersalParticles", false)] public float DispersalMinCoherency = 0.2f; [ShowInInspectorIf("UsesDispersalParticles", false)] public float DispersalMaxCoherency = 1f; [ShowInInspectorIf("UsesDispersalParticles", false)] public GameObject DispersalParticleSystemPrefab; private Projectile m_frameLinkProjectile; private tk2dTiledSprite m_extantLink; private bool m_hasSetBlackBullet; private ParticleSystem m_dispersalParticles; private HashSet m_damagedEnemies = new HashSet(); private void Start() { if ((Object)(object)((BraveBehaviour)this).projectile != (Object)null) { Projectile projectile = ((BraveBehaviour)this).projectile; projectile.OnHitEnemy = (Action)Delegate.Combine(projectile.OnHitEnemy, new Action(HandleHitEnemy)); } } private void HandleHitEnemy(Projectile proj, SpeculativeRigidbody enemyRigidbody, bool fatal) { if ((Object)(object)enemyRigidbody == (Object)null) { return; } AIActor val = null; if ((Object)(object)((BraveBehaviour)enemyRigidbody).aiActor != (Object)null) { val = ((BraveBehaviour)enemyRigidbody).aiActor; } else { if (!((Object)(object)((Component)enemyRigidbody).GetComponentInParent() != (Object)null)) { return; } val = ((Component)enemyRigidbody).GetComponentInParent(); } List list = ChainEnemies(val); if (PlaysSFX) { HelpfulMethods.PlayRandomSFX(((Component)val).gameObject, sfxPath); } if (!usesStaticDamageStat) { damagePerHit = proj.baseData.damage * damageScale; } if (list.Count > 0) { UpdateLinkChain(list); } } public void updateSFXList(string[] newSFXList) { foreach (string item in newSFXList) { sfxPath.Add(item); } } public override void OnDestroy() { ClearLink(); ((BraveBehaviour)this).OnDestroy(); } private void Update() { m_frameLinkProjectile = null; } private void UpdateLinkChain(List chain) { //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) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) Vector2 unitCenter = ((BraveBehaviour)((BraveBehaviour)this).projectile).specRigidbody.UnitCenter; foreach (AIActor item in chain) { Vector2 unitCenter2 = ((BraveBehaviour)item).specRigidbody.UnitCenter; GameObject val = SpawnManager.SpawnVFX(LinkVFXPrefab, true); tk2dTiledSprite component = val.GetComponent(); ((BraveBehaviour)component).transform.position = Vector2.op_Implicit(unitCenter); Vector2 val2 = unitCenter2 - unitCenter; float num = BraveMathCollege.Atan2Degrees(((Vector2)(ref val2)).normalized); int num2 = Mathf.RoundToInt(((Vector2)(ref val2)).magnitude / 0.0625f); component.dimensions = new Vector2((float)num2, component.dimensions.y); ((BraveBehaviour)component).transform.rotation = Quaternion.Euler(0f, 0f, num); ((tk2dBaseSprite)component).UpdateZDepth(); Object.Destroy((Object)(object)val, 0.25f); if (!m_damagedEnemies.Contains(item)) { ((BraveBehaviour)item).healthHaver.ApplyDamage(damagePerHit, Vector2.zero, "Cultivation of Spirit", damageTypes, (DamageCategory)0, false, (PixelCollider)null, false); if (!UsesDispersalParticles) { } } } } private void DoDispersalParticles(Vector2 posStart, Vector2 posEnd) { //IL_0006: 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_0018: Invalid comparison between Unknown and I4 //IL_004d: 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_0076: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) if ((int)GameManager.Options.ShaderQuality != 0 && (int)GameManager.Options.ShaderQuality != 3) { if (!Object.op_Implicit((Object)(object)m_dispersalParticles)) { m_dispersalParticles = GlobalDispersalParticleManager.GetSystemForPrefab(DispersalParticleSystemPrefab); } int num = Mathf.Max(Mathf.CeilToInt(Vector2.Distance(posStart, posEnd) * DispersalDensity), 1); for (int i = 0; i < num; i++) { float num2 = (float)i / (float)num; Vector3 val = Vector3.Lerp(Vector2.op_Implicit(posStart), Vector2.op_Implicit(posEnd), num2); val += Vector3.back; float num3 = Mathf.PerlinNoise(val.x / 3f, val.y / 3f); Vector3 val2 = Quaternion.Euler(0f, 0f, num3 * 360f) * Vector3.right; Vector3 val3 = Vector3.Lerp(val2, Random.insideUnitSphere, Random.Range(DispersalMinCoherency, DispersalMaxCoherency)); EmitParams val4 = default(EmitParams); ((EmitParams)(ref val4)).position = val; ((EmitParams)(ref val4)).velocity = val3 * m_dispersalParticles.startSpeed; ((EmitParams)(ref val4)).startSize = m_dispersalParticles.startSize; ((EmitParams)(ref val4)).startLifetime = m_dispersalParticles.startLifetime; ((EmitParams)(ref val4)).startColor = Color32.op_Implicit(m_dispersalParticles.startColor); EmitParams val5 = val4; m_dispersalParticles.Emit(val5, 1); } } } private IEnumerator HandleDamageCooldown(AIActor damagedTarget) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__28(0) { <>4__this = this, damagedTarget = damagedTarget }; } private void ClearLink() { if ((Object)(object)m_extantLink != (Object)null) { SpawnManager.Despawn(((Component)m_extantLink).gameObject); m_extantLink = null; } } private List ChainEnemies(AIActor firstEnemy) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) List list = new List(); float num = maximumLinkDistance * maximumLinkDistance; foreach (AIActor allEnemy in StaticReferenceManager.AllEnemies) { if (!((Object)(object)allEnemy == (Object)null) && Object.op_Implicit((Object)(object)((BraveBehaviour)allEnemy).healthHaver) && !((BraveBehaviour)allEnemy).healthHaver.IsDead && allEnemy.IsNormalEnemy && allEnemy.HasBeenEngaged && !((object)allEnemy).Equals((object?)firstEnemy)) { Vector2 val = ((GameActor)allEnemy).CenterPosition - ((GameActor)firstEnemy).CenterPosition; float sqrMagnitude = ((Vector2)(ref val)).sqrMagnitude; if (sqrMagnitude < num) { list.Add(allEnemy); } } } return list; } } [Serializable] public class GameActorCrippleEffect : GameActorEffect { public float CrippleAmount; public float CrippleDuration; public bool ShouldVanishOnDeath(GameActor actor) { if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).healthHaver) && ((BraveBehaviour)actor).healthHaver.IsBoss) { return false; } if (actor is AIActor && ((AIActor)((actor is AIActor) ? actor : null)).IsSignatureEnemy) { return false; } return true; } public override void OnEffectApplied(GameActor actor, RuntimeGameActorEffectData effectData, float partialAmount = 1f) { if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).aiShooter)) { ((BraveBehaviour)actor).aiShooter.AimTimeScale = CrippleAmount; } if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).behaviorSpeculator)) { ((BraveBehaviour)actor).behaviorSpeculator.CooldownScale = CrippleAmount; } if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).bulletBank)) { ((BraveBehaviour)actor).bulletBank.TimeScale = CrippleAmount; } } public override void OnEffectRemoved(GameActor actor, RuntimeGameActorEffectData effectData) { if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).aiShooter)) { ((BraveBehaviour)actor).aiShooter.AimTimeScale = 1f; } if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).behaviorSpeculator)) { ((BraveBehaviour)actor).behaviorSpeculator.CooldownScale = 1f; } if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).bulletBank)) { ((BraveBehaviour)actor).bulletBank.TimeScale = 1f; } tk2dSpriteAnimator spriteAnimator = ((BraveBehaviour)actor).spriteAnimator; if (Object.op_Implicit((Object)(object)spriteAnimator) && Object.op_Implicit((Object)(object)((BraveBehaviour)actor).aiAnimator) && spriteAnimator.CurrentClip != null && !spriteAnimator.IsPlaying(spriteAnimator.CurrentClip)) { ((BraveBehaviour)actor).aiAnimator.PlayUntilFinished(((BraveBehaviour)actor).spriteAnimator.CurrentClip.name, false, (string)null, -1f, true); } } } public class OnPreDamagedPassiveItem : PassiveItem { [CompilerGenerated] private sealed class d__13 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerController player; public OnPreDamagedPassiveItem <>4__this; private Material 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = SpriteOutlineManager.GetOutlineMaterial(((BraveBehaviour)((PassiveItem)<>4__this).Owner).sprite); if (<>4__this.triggersGlow && Object.op_Implicit((Object)(object)5__1)) { 5__1.SetColor("_OverrideColor", <>4__this.outlineColor); } <>2__current = (object)new WaitForSeconds(<>4__this.effectDuration); <>1__state = 1; return true; case 1: <>1__state = -1; if (<>4__this.triggersGlow && Object.op_Implicit((Object)(object)5__1)) { 5__1.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public float procChance = 0.1f; public bool triggerBlank = false; public bool playsSFX = false; public List sfxPath = new List(); public bool triggersInvulnerability = false; public bool triggersOutline = false; public Color outlineColor = new Color(0f, 0f, 0f); public bool triggersGlow = false; public float effectDuration = 1f; public override void Pickup(PlayerController player) { if (!base.m_pickedUp) { ((PassiveItem)this).Pickup(player); HealthHaver healthHaver = ((BraveBehaviour)player).healthHaver; healthHaver.ModifyDamage = (Action)Delegate.Combine(healthHaver.ModifyDamage, new Action(HandleEffect)); } } public void updateSFXList(string[] newSFXList) { foreach (string item in newSFXList) { sfxPath.Add(item); } } public void setProcChance(float newProcChance) { procChance = newProcChance; } private void HandleEffect(HealthHaver source, ModifyDamageEventArgs args) { if (args == EventArgs.Empty || args.ModifiedDamage <= 0f || !source.IsVulnerable) { return; } float value = Random.value; if (value <= procChance && Object.op_Implicit((Object)(object)base.m_owner) && !((GameActor)base.m_owner).IsFalling) { if (playsSFX && sfxPath.Count > 0) { HelpfulMethods.PlayRandomSFX(((Component)((PassiveItem)this).Owner).gameObject, sfxPath); } if (triggersInvulnerability) { PlayerController component = ((Component)source).GetComponent(); source.TriggerInvulnerabilityPeriod(effectDuration); } if (triggerBlank) { base.m_owner.ForceBlank(25f, 0.5f, false, true, (Vector2?)null, true, -1f); } if (triggersOutline) { ((MonoBehaviour)((PassiveItem)this).Owner).StartCoroutine(TriggerVisualEffect(((PassiveItem)this).Owner)); } args.ModifiedDamage = 0f; } } private IEnumerator TriggerVisualEffect(PlayerController player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { <>4__this = this, player = player }; } public override DebrisObject Drop(PlayerController player) { DebrisObject val = ((PassiveItem)this).Drop(player); OnPreDamagedPassiveItem component = ((Component)val).GetComponent(); HealthHaver healthHaver = ((BraveBehaviour)player).healthHaver; healthHaver.ModifyDamage = (Action)Delegate.Remove(healthHaver.ModifyDamage, new Action(HandleEffect)); ((PassiveItem)component).m_pickedUpThisRun = true; return val; } public override void OnDestroy() { if (Object.op_Implicit((Object)(object)base.m_owner)) { HealthHaver healthHaver = ((BraveBehaviour)base.m_owner).healthHaver; healthHaver.ModifyDamage = (Action)Delegate.Remove(healthHaver.ModifyDamage, new Action(HandleEffect)); } ((PassiveItem)this).OnDestroy(); } } public class TieredPassiveItem : PassiveItem { public bool isTieredPassiveItem = true; public int itemTier; public string TierGroupIdentifier = ""; } public class CustomLightningChainEnemiesModifier : BraveBehaviour { [CompilerGenerated] private sealed class d__27 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public AIActor damagedTarget; public CustomLightningChainEnemiesModifier <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__27(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.m_damagedEnemies.Add(damagedTarget); <>2__current = (object)new WaitForSeconds(<>4__this.damageCooldown); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.m_damagedEnemies.Remove(damagedTarget); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public GameObject LinkVFXPrefab; public CoreDamageTypes damageTypes; public bool RequiresSameProjectileClass; public float maximumLinkDistance; public float damagePerHit; public float damageCooldown = 0.1f; public float maxLinkCount; public List sfxPath = new List(); [NonSerialized] public bool DamagesEnemies = true; [NonSerialized] public bool PlaysSFX = true; [Header("Dispersal")] public bool UsesDispersalParticles; [ShowInInspectorIf("UsesDispersalParticles", false)] public float DispersalDensity = 3f; [ShowInInspectorIf("UsesDispersalParticles", false)] public float DispersalMinCoherency = 0.2f; [ShowInInspectorIf("UsesDispersalParticles", false)] public float DispersalMaxCoherency = 1f; [ShowInInspectorIf("UsesDispersalParticles", false)] public GameObject DispersalParticleSystemPrefab; private Projectile m_frameLinkProjectile; private tk2dTiledSprite m_extantLink; private bool m_hasSetBlackBullet; private ParticleSystem m_dispersalParticles; private HashSet m_damagedEnemies = new HashSet(); private void Start() { if ((Object)(object)((BraveBehaviour)this).projectile != (Object)null) { Projectile projectile = ((BraveBehaviour)this).projectile; projectile.OnHitEnemy = (Action)Delegate.Combine(projectile.OnHitEnemy, new Action(HandleHitEnemy)); } } private void HandleHitEnemy(Projectile proj, SpeculativeRigidbody enemyRigidbody, bool fatal) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)enemyRigidbody == (Object)null) { return; } AIActor val = null; if ((Object)(object)((BraveBehaviour)enemyRigidbody).aiActor != (Object)null) { val = ((BraveBehaviour)enemyRigidbody).aiActor; } else { if (!((Object)(object)((Component)enemyRigidbody).GetComponentInParent() != (Object)null)) { return; } val = ((Component)enemyRigidbody).GetComponentInParent(); } List list = ChainEnemies(((GameActor)val).CenterPosition); if (PlaysSFX) { HelpfulMethods.PlayRandomSFX(((Component)val).gameObject, sfxPath); } if (list.Count > 0) { UpdateLinkChain(list); } } public void updateSFXList(string[] newSFXList) { foreach (string item in newSFXList) { sfxPath.Add(item); } } public override void OnDestroy() { ClearLink(); ((BraveBehaviour)this).OnDestroy(); } private void Update() { m_frameLinkProjectile = null; } private void UpdateLinkChain(List chain) { //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) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) Vector2 val = ((BraveBehaviour)((BraveBehaviour)this).projectile).specRigidbody.UnitCenter; foreach (AIActor item in chain) { Vector2 unitCenter = ((BraveBehaviour)item).specRigidbody.UnitCenter; GameObject val2 = SpawnManager.SpawnVFX(LinkVFXPrefab, true); tk2dTiledSprite component = val2.GetComponent(); ((BraveBehaviour)component).transform.position = Vector2.op_Implicit(val); Vector2 val3 = unitCenter - val; float num = BraveMathCollege.Atan2Degrees(((Vector2)(ref val3)).normalized); int num2 = Mathf.RoundToInt(((Vector2)(ref val3)).magnitude / 0.0625f); component.dimensions = new Vector2((float)num2, component.dimensions.y); ((BraveBehaviour)component).transform.rotation = Quaternion.Euler(0f, 0f, num); ((tk2dBaseSprite)component).UpdateZDepth(); Object.Destroy((Object)(object)val2, 0.25f); if (!m_damagedEnemies.Contains(item)) { ((BraveBehaviour)item).healthHaver.ApplyDamage(damagePerHit, Vector2.zero, "Chain Lightning", damageTypes, (DamageCategory)0, false, (PixelCollider)null, false); m_damagedEnemies.Add(item); if (UsesDispersalParticles) { DoDispersalParticles(val, unitCenter); } } val = unitCenter; } } private void DoDispersalParticles(Vector2 posStart, Vector2 posEnd) { //IL_0006: 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_0018: Invalid comparison between Unknown and I4 //IL_004d: 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_0076: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) if ((int)GameManager.Options.ShaderQuality != 0 && (int)GameManager.Options.ShaderQuality != 3) { if (!Object.op_Implicit((Object)(object)m_dispersalParticles)) { m_dispersalParticles = GlobalDispersalParticleManager.GetSystemForPrefab(DispersalParticleSystemPrefab); } int num = Mathf.Max(Mathf.CeilToInt(Vector2.Distance(posStart, posEnd) * DispersalDensity), 1); for (int i = 0; i < num; i++) { float num2 = (float)i / (float)num; Vector3 val = Vector3.Lerp(Vector2.op_Implicit(posStart), Vector2.op_Implicit(posEnd), num2); val += Vector3.back; float num3 = Mathf.PerlinNoise(val.x / 3f, val.y / 3f); Vector3 val2 = Quaternion.Euler(0f, 0f, num3 * 360f) * Vector3.right; Vector3 val3 = Vector3.Lerp(val2, Random.insideUnitSphere, Random.Range(DispersalMinCoherency, DispersalMaxCoherency)); EmitParams val4 = default(EmitParams); ((EmitParams)(ref val4)).position = val; ((EmitParams)(ref val4)).velocity = val3 * m_dispersalParticles.startSpeed; ((EmitParams)(ref val4)).startSize = m_dispersalParticles.startSize; ((EmitParams)(ref val4)).startLifetime = m_dispersalParticles.startLifetime; ((EmitParams)(ref val4)).startColor = Color32.op_Implicit(m_dispersalParticles.startColor); EmitParams val5 = val4; m_dispersalParticles.Emit(val5, 1); } } } private IEnumerator HandleDamageCooldown(AIActor damagedTarget) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__27(0) { <>4__this = this, damagedTarget = damagedTarget }; } private void ClearLink() { if ((Object)(object)m_extantLink != (Object)null) { SpawnManager.Despawn(((Component)m_extantLink).gameObject); m_extantLink = null; } } private List ChainEnemies(Vector2 startPos) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) List list = new List(); HashSet hashSet = new HashSet(); Vector2 val = startPos; for (int i = 0; (float)i < maxLinkCount; i++) { AIActor val2 = null; float num = maximumLinkDistance * maximumLinkDistance; foreach (AIActor allEnemy in StaticReferenceManager.AllEnemies) { if (!((Object)(object)allEnemy == (Object)null) && Object.op_Implicit((Object)(object)((BraveBehaviour)allEnemy).healthHaver) && !((BraveBehaviour)allEnemy).healthHaver.IsDead && allEnemy.IsNormalEnemy && allEnemy.HasBeenEngaged && !hashSet.Contains(allEnemy)) { Vector2 val3 = ((GameActor)allEnemy).CenterPosition - val; float sqrMagnitude = ((Vector2)(ref val3)).sqrMagnitude; if (sqrMagnitude < num) { val2 = allEnemy; num = sqrMagnitude; } } } if ((Object)(object)val2 != (Object)null) { list.Add(val2); hashSet.Add(val2); val = ((GameActor)val2).CenterPosition; continue; } break; } return list; } } namespace LootTableAPI { internal static class LootTableTools { public static GenericLootTable CreateLootTable(List includedLootTables = null, DungeonPrerequisite[] prerequisites = null) { //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) //IL_001d: Expected O, but got Unknown GenericLootTable val = ScriptableObject.CreateInstance(); val.defaultItemDrops = new WeightedGameObjectCollection { elements = new List() }; if (prerequisites != null) { val.tablePrerequisites = prerequisites; } else { val.tablePrerequisites = (DungeonPrerequisite[])(object)new DungeonPrerequisite[0]; } if (includedLootTables != null) { val.includedLootTables = includedLootTables; } else { val.includedLootTables = new List(); } return val; } public static void AddItemToPool(this GenericLootTable lootTable, PickupObject po, float weight = 1f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown WeightedGameObjectCollection defaultItemDrops = lootTable.defaultItemDrops; WeightedGameObject val = new WeightedGameObject(); val.pickupId = po.PickupObjectId; val.weight = weight; val.rawGameObject = ((Component)po).gameObject; val.forceDuplicatesPossible = false; val.additionalPrerequisites = (DungeonPrerequisite[])(object)new DungeonPrerequisite[0]; defaultItemDrops.Add(val); } public static void AddItemToPool(this GenericLootTable lootTable, int poID, float weight = 1f) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown PickupObject byId = PickupObjectDatabase.GetById(poID); WeightedGameObjectCollection defaultItemDrops = lootTable.defaultItemDrops; WeightedGameObject val = new WeightedGameObject(); val.pickupId = byId.PickupObjectId; val.weight = weight; val.rawGameObject = ((Component)byId).gameObject; val.forceDuplicatesPossible = false; val.additionalPrerequisites = (DungeonPrerequisite[])(object)new DungeonPrerequisite[0]; defaultItemDrops.Add(val); } } } namespace GungeonCOTL { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("Ricky2148.etg.GungeonCOTL", "Gungeon Cult of the Lamb", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string ITEM_PREFIX = "gungeoncotl"; public const string GUID = "Ricky2148.etg.GungeonCOTL"; public const string NAME = "Gungeon Cult of the Lamb"; public const string VERSION = "1.0.0"; public const string TEXT_COLOR = "#690709"; internal static Harmony _Harmony; public void Start() { ETGModMainBehaviour.WaitForGameManagerStart((Action)GMStart); } public void GMStart(GameManager g) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown Assets.SetupSpritesFromAssembly(Assembly.GetExecutingAssembly(), "LOLItems/Resources/weapon_sprites"); SoundManager.LoadSoundbanksFromAssembly((Assembly)null); _Harmony = new Harmony("Ricky2148.etg.GungeonCOTL"); CrownUpgradeResurrection.Init(); CrownUpgradeDarknessWithin.Init(); AscendGunRitual.Init(); SacrificeOfTheGun.Init(); FeastingRitual.Init(); RitualOfEnrichment.Init(); RiteOfWrath.Init(); DoctrineOfMaterialism.Init(); DoctrineOfSin.Init(); DoctrineOfSustenance.Init(); DoctrineOfLawAndOrder.Init(); HeartOfTheFaithful1.Init(); HeartOfTheFaithful2.Init(); HeartOfTheFaithful3.Init(); HeartOfTheFaithful4.Init(); HeartOfTheFaithful5.Init(); HeartOfTheFaithful6.Init(); MightOfTheDevout1.Init(); MightOfTheDevout2.Init(); MightOfTheDevout3.Init(); MightOfTheDevout4.Init(); MightOfTheDevout5.Init(); MightOfTheDevout6.Init(); RedCrown.Init(); GungeonCOTLSynergies.Init(); Log("Gungeon Cult of the Lamb v1.0.0 started successfully.", "#690709"); } public static void Log(string text, string color = "#FF007F") { ETGModConsole.Log((object)("" + text + ""), false); } } public static class GungeonCOTLSynergies { private static int _NUM_SYNERGIES = Enum.GetNames(typeof(Synergy)).Length; public static List _Synergies = Enumerable.Repeat((CustomSynergyType)0, _NUM_SYNERGIES).ToList(); public static List _SynergyNames = Enumerable.Repeat(null, _NUM_SYNERGIES).ToList(); public static List _SynergyEnums = new List(Enum.GetNames(typeof(Synergy))); public static List _SynergyIds = Enumerable.Repeat(0, _NUM_SYNERGIES).ToList(); public static void InitEnums() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _SynergyNames.Count; i++) { _Synergies[i] = _SynergyEnums[i].ExtendEnum(); } } public static T ExtendEnum(this string s) where T : Enum { return ETGModCompatibility.ExtendEnum("gungeoncotl".ToUpper(), s); } public static void Init() { NewSynergy(GungeonCOTL.Synergy.HEARTOFTHEFAITHFUL_TWO, "Heart of the Faithful II", new string[2] { IName(HeartOfTheFaithful1.ItemName), IName(HeartOfTheFaithful2.ItemName) }); NewSynergy(GungeonCOTL.Synergy.HEARTOFTHEFAITHFUL_THREE, "Heart of the Faithful III", new string[2] { IName(HeartOfTheFaithful2.ItemName), IName(HeartOfTheFaithful3.ItemName) }); NewSynergy(GungeonCOTL.Synergy.HEARTOFTHEFAITHFUL_FOUR, "Heart of the Faithful IV", new string[2] { IName(HeartOfTheFaithful3.ItemName), IName(HeartOfTheFaithful4.ItemName) }); NewSynergy(GungeonCOTL.Synergy.HEARTOFTHEFAITHFUL_FIVE, "Heart of the Faithful V", new string[2] { IName(HeartOfTheFaithful4.ItemName), IName(HeartOfTheFaithful5.ItemName) }); NewSynergy(GungeonCOTL.Synergy.HEARTOFTHEFAITHFUL_SIX, "Heart of the Faithful VI", new string[2] { IName(HeartOfTheFaithful5.ItemName), IName(HeartOfTheFaithful6.ItemName) }); NewSynergy(GungeonCOTL.Synergy.MIGHTOFTHEDEVOUT_TWO, "Might of the Devout II", new string[2] { IName(MightOfTheDevout1.ItemName), IName(MightOfTheDevout2.ItemName) }); NewSynergy(GungeonCOTL.Synergy.MIGHTOFTHEDEVOUT_THREE, "Might of the Devout III", new string[2] { IName(MightOfTheDevout2.ItemName), IName(MightOfTheDevout3.ItemName) }); NewSynergy(GungeonCOTL.Synergy.MIGHTOFTHEDEVOUT_FOUR, "Might of the Devout IV", new string[2] { IName(MightOfTheDevout3.ItemName), IName(MightOfTheDevout4.ItemName) }); NewSynergy(GungeonCOTL.Synergy.MIGHTOFTHEDEVOUT_FIVE, "Might of the Devout V", new string[2] { IName(MightOfTheDevout4.ItemName), IName(MightOfTheDevout5.ItemName) }); NewSynergy(GungeonCOTL.Synergy.MIGHTOFTHEDEVOUT_SIX, "Might of the Devout VI", new string[2] { IName(MightOfTheDevout5.ItemName), IName(MightOfTheDevout6.ItemName) }); } private static AdvancedSynergyEntry NewSynergy(Synergy synergy, string name, string[] mandatory, string[] optional = null, bool ignoreLichEyeBullets = false) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) AdvancedSynergyEntry result = RegisterSynergy(_Synergies[(int)synergy], name, mandatory.ToList(), optional?.ToList(), ignoreLichEyeBullets); _SynergyNames[(int)synergy] = name; _SynergyIds[(int)synergy] = GameManager.Instance.SynergyManager.synergies.Length - 1; return result; } public static AdvancedSynergyEntry RegisterSynergy(CustomSynergyType synergy, string name, List mandatoryConsoleIDs, List optionalConsoleIDs = null, bool ignoreLichEyeBullets = false) { //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Expected O, but got Unknown List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); foreach (string mandatoryConsoleID in mandatoryConsoleIDs) { PickupObject val = Game.Items[mandatoryConsoleID]; if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Component)val).GetComponent())) { list2.Add(val.PickupObjectId); } else if (Object.op_Implicit((Object)(object)val) && (Object.op_Implicit((Object)(object)((Component)val).GetComponent()) || Object.op_Implicit((Object)(object)((Component)val).GetComponent()))) { list.Add(val.PickupObjectId); } } if (optionalConsoleIDs != null) { foreach (string optionalConsoleID in optionalConsoleIDs) { PickupObject val2 = Game.Items[optionalConsoleID]; if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Component)val2).GetComponent())) { list4.Add(val2.PickupObjectId); } else if (Object.op_Implicit((Object)(object)val2) && (Object.op_Implicit((Object)(object)((Component)val2).GetComponent()) || Object.op_Implicit((Object)(object)((Component)val2).GetComponent()))) { list3.Add(val2.PickupObjectId); } } } string text = "#" + ETGMod.ToID(name).ToUpperInvariant(); Databases.Strings.Synergy.Set(text, name); AdvancedSynergyEntry val3 = new AdvancedSynergyEntry { NameKey = text, MandatoryItemIDs = list, MandatoryGunIDs = list2, OptionalItemIDs = list3, OptionalGunIDs = list4, bonusSynergies = new List { synergy }, statModifiers = new List(), IgnoreLichEyeBullets = ignoreLichEyeBullets }; int num = GameManager.Instance.SynergyManager.synergies.Length; Array.Resize(ref GameManager.Instance.SynergyManager.synergies, num + 1); GameManager.Instance.SynergyManager.synergies[num] = val3; return val3; } private static string IName(string itemName) { return "gungeoncotl:" + ETGMod.ToID(itemName); } public static CustomSynergyType Synergy(this Synergy synergy) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _Synergies[(int)synergy]; } public static string SynergyName(this Synergy synergy) { return _SynergyNames[(int)synergy]; } public static bool HasSynergy(this PlayerController player, Synergy synergy) { return player.ActiveExtraSynergies.Contains(_SynergyIds[(int)synergy]); } } public enum Synergy { HEARTOFTHEFAITHFUL_TWO, HEARTOFTHEFAITHFUL_THREE, HEARTOFTHEFAITHFUL_FOUR, HEARTOFTHEFAITHFUL_FIVE, HEARTOFTHEFAITHFUL_SIX, MIGHTOFTHEDEVOUT_TWO, MIGHTOFTHEDEVOUT_THREE, MIGHTOFTHEDEVOUT_FOUR, MIGHTOFTHEDEVOUT_FIVE, MIGHTOFTHEDEVOUT_SIX } } namespace GungeonCOTL.weapons { internal class BasicGun : GunBehaviour { public static int ID; private bool HasReloaded; public static void Add() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) Gun val = Databases.Items.NewGun("Basic Gun", "jpxfrd"); Game.Items.Rename("outdated_gun_mods:basic_gun", "kp:basic_gun"); ((Component)val).gameObject.AddComponent(); GunExt.SetShortDescription((PickupObject)(object)val, "Impressionable"); GunExt.SetLongDescription((PickupObject)(object)val, "A gun left unfinished and abandoned by its creator. It still has great potential."); GunExt.SetAnimationFPS(val, val.shootAnimation, 24); GunExt.SetAnimationFPS(val, val.reloadAnimation, 24); PickupObject byId = PickupObjectDatabase.GetById(59); GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false); val.gunHandedness = (GunHandedness)0; val.barrelOffset.localPosition = new Vector3(1f, 0.5625f, 0f); val.DefaultModule.ammoCost = 1; val.DefaultModule.angleVariance = 30f; val.DefaultModule.shootStyle = (ShootStyle)0; val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0; val.reloadTime = 1.1f; val.DefaultModule.cooldownTime = 0.2f; val.DefaultModule.numberOfShotsInClip = 27; val.SetBaseMaxAmmo(250); val.DefaultModule.ammoType = (AmmoType)14; val.DefaultModule.customAmmoType = "mega"; ((PickupObject)val).quality = (ItemQuality)(-100); Projectile val2 = Object.Instantiate(val.DefaultModule.projectiles[0]); ((Component)val2).gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject); Object.DontDestroyOnLoad((Object)(object)val2); val.DefaultModule.projectiles[0] = val2; val2.baseData.damage = 5f; val2.baseData.speed = 50f; ((BraveBehaviour)val2).transform.parent = val.barrelOffset; Databases.Items.Add(val, (tk2dSpriteCollectionData)null, "ANY"); ID = ((PickupObject)val).PickupObjectId; } public override void OnPostFired(PlayerController player, Gun gun) { gun.PreventNormalFireAudio = true; AkSoundEngine.PostEvent("Play_WPN_smileyrevolver_shot_01", ((Component)this).gameObject); } public override void Update() { if (Object.op_Implicit((Object)(object)base.gun.CurrentOwner)) { if (!base.gun.PreventNormalFireAudio) { base.gun.PreventNormalFireAudio = true; } if (!base.gun.IsReloading && !HasReloaded) { HasReloaded = true; } } } public override void OnReloadPressed(PlayerController player, Gun gun, bool bSOMETHING) { if (gun.IsReloading && HasReloaded) { HasReloaded = false; AkSoundEngine.PostEvent("Stop_WPN_All", ((Component)this).gameObject); ((GunBehaviour)this).OnReloadPressed(player, gun, bSOMETHING); AkSoundEngine.PostEvent("Play_WPN_SAA_reload_01", ((Component)this).gameObject); } } } } namespace GungeonCOTL.tarot_card_items { internal class TheHeartsTarotCard { } } namespace GungeonCOTL.passive_items { internal class CrownUpgradeDarknessWithin : OnDamagedPassiveItem { [CompilerGenerated] private sealed class d__13 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public AIActor enemy; public float initialTimeDelay; public CrownUpgradeDarknessWithin <>4__this; private GameObject 5__1; private tk2dSprite 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(initialTimeDelay); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = Object.Instantiate(DiseasedHeartVFXEffect, Vector2Extensions.ToVector3ZUp(((BraveBehaviour)enemy).specRigidbody.UnitBottomCenter, 0f) + vfxOffset, Quaternion.identity); 5__2 = 5__1.GetComponent(); if ((Object)(object)5__2 != (Object)null) { ((tk2dBaseSprite)5__2).HeightOffGround = 10f; ((tk2dBaseSprite)5__2).UpdateZDepth(); tk2dSprite obj = 5__2; ((tk2dBaseSprite)obj).scale = ((tk2dBaseSprite)obj).scale * Mathf.Max(1f, 1f + (((BraveBehaviour)enemy).specRigidbody.UnitDimensions.x - 1f) / 2f); } 5__1.GetComponent().anchorAIActor = enemy; 5__1.GetComponent().offset = vfxOffset + new Vector3(0f, ((BraveBehaviour)enemy).specRigidbody.HitboxPixelCollider.UnitDimensions.y); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; case 2: <>1__state = -1; if ((Object)(object)enemy != (Object)null && (Object)(object)((BraveBehaviour)enemy).healthHaver != (Object)null && ((BraveBehaviour)enemy).healthHaver.IsVulnerable) { ((BraveBehaviour)enemy).healthHaver.ApplyDamage(DarknessWithinDamage, Vector2.zero, "darkness_within_diseased_heart_damage", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false); HelpfulMethods.PlayRandomSFX(((Component)enemy).gameObject, sfxList); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static string ItemName = "Crown Upgrade Darkness Within"; private static float DarknessWithinDamage = 15f; private static List DiseasedHeartVFXPath = new List { "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_001", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_002", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_003", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_004", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_005", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_006", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_007", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_008", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_009", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_010", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_011", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_012", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_013", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_014", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_015", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_016", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_017", "GungeonCOTL/Resources/vfxs/diseased_heart_vfx/badheart_018", "GungeonCOTL/Resources/one_off_sprites/blank_sprite" }; private static GameObject DiseasedHeartVFXEffect; public static Vector3 vfxOffset = new Vector3(-0.0625f, 0.375f, 0f); private static List sfxList = new List { "punchy_blessed_choir1", "punchy_blessed_choir2", "punchy_blessed_choir3", "punchy_blessed_choir4", "punchy_blessed_choir5", "punchy_blessed_choir6" }; private GameObject activeVFXObject; public static int ID; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0046: 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_0088: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/darkness_within_pixelart_sprite"; GameObject val = new GameObject(itemName); CrownUpgradeDarknessWithin crownUpgradeDarknessWithin = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "Blackened Heart"; string text3 = "Deal damage to all enemies every time you take damage.\n\nBearing the sins of your followers has caused your heart and soul to become blackened with darkness. It leaks out with ill will and lashes out against any who harm them.\n"; ItemBuilder.SetupItem((PickupObject)(object)crownUpgradeDarknessWithin, text2, text3, "gungeoncotl"); ((PickupObject)crownUpgradeDarknessWithin).quality = (ItemQuality)(-50); GunExt.SetName((PickupObject)(object)crownUpgradeDarknessWithin, "Darkness Within"); ((PickupObject)crownUpgradeDarknessWithin).CanBeDropped = false; ID = ((PickupObject)crownUpgradeDarknessWithin).PickupObjectId; DiseasedHeartVFXEffect = VFXBuilder.CreateVFX("diseased_heart_vfx_effect", DiseasedHeartVFXPath, 12, new IntVector2(0, 0), (Anchor)4, false, 0f, -1f, (Color?)Color.cyan, (WrapMode)2, true); VFXAnchorModule orAddComponent = GameObjectExtensions.GetOrAddComponent(DiseasedHeartVFXEffect); } public override void Pickup(PlayerController player) { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown if (!((PassiveItem)this).m_pickedUpThisRun) { if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } AkSoundEngine.PostEvent("crown_upgrade_pickup", ((Component)player).gameObject); activeVFXObject = VFXPlayerCOTL.PlayCrownUpgradeEffectOnActor(player); ((MonoBehaviour)player).StartCoroutine(VFXPlayerCOTL.HardCodedCrownUpgradeEffectSFXPlayer(player)); } ((OnDamagedPassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); ((BraveBehaviour)player).healthHaver.OnDamaged += new OnDamagedEvent(OnPlayerDamaged); } public override void DisableEffect(PlayerController player) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } if ((Object)(object)player != (Object)null) { ((BraveBehaviour)player).healthHaver.OnDamaged -= new OnDamagedEvent(OnPlayerDamaged); } } private void DoBlankDamage(PlayerController player) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) if (player.CurrentRoom == null) { return; } List activeEnemies = player.CurrentRoom.GetActiveEnemies((ActiveEnemyType)0); if (activeEnemies == null) { return; } foreach (AIActor item in activeEnemies) { if ((Object)(object)item != (Object)null && (Object)(object)((BraveBehaviour)item).healthHaver != (Object)null && ((BraveBehaviour)item).healthHaver.IsVulnerable) { ((BraveBehaviour)item).healthHaver.ApplyDamage(DarknessWithinDamage, Vector2.zero, "darkness_within_blank_damage", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false); } } } private void OnPlayerDamaged(float resultValue, float maxValue, CoreDamageTypes damageTypes, DamageCategory damageCategory, Vector2 damageDirection) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) activeVFXObject = Object.Instantiate(VFXPlayerCOTL.DarknessWithinActivationEffectVFX, Vector2.op_Implicit(((GameActor)((PassiveItem)this).Owner).CenterPosition), Quaternion.identity); HelpfulMethods.PlayRandomSFX(((Component)((PassiveItem)this).Owner).gameObject, sfxList); if (((PassiveItem)this).Owner.CurrentRoom == null) { return; } List activeEnemies = ((PassiveItem)this).Owner.CurrentRoom.GetActiveEnemies((ActiveEnemyType)0); if (activeEnemies == null) { return; } float num = 0f; foreach (AIActor item in activeEnemies) { ((MonoBehaviour)item).StartCoroutine(DelayDamage(item, num)); num += 0.1f; } } private IEnumerator DelayDamage(AIActor enemy, float initialTimeDelay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { <>4__this = this, enemy = enemy, initialTimeDelay = initialTimeDelay }; } } internal class CrownUpgradeResurrection : PassiveItem { [CompilerGenerated] private sealed class d__10 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerController player; public CrownUpgradeResurrection <>4__this; private Color 5__1; private Color 5__2; private Material 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Expected O, but got Unknown //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!((BraveBehaviour)player).healthHaver.IsAlive) { <>4__this.hasRevived = true; ((BraveBehaviour)player).healthHaver.TriggerInvulnerabilityPeriod(ReviveDuration + 0.1f); ((BraveBehaviour)player).healthHaver.ForceSetCurrentHealth(1f); player.CurrentInputState = (PlayerInputState)1; ((BraveBehaviour)player).healthHaver.OnPreDeath -= <>4__this.Resurrection; 5__1 = ((BraveBehaviour)player).sprite.color; 5__2 = ((BraveBehaviour)((GameActor)player).CurrentGun).sprite.color; ((BraveBehaviour)player).sprite.color = ExtendedColours.maroon; ((BraveBehaviour)((GameActor)player).CurrentGun).sprite.color = ExtendedColours.maroon; 5__3 = SpriteOutlineManager.GetOutlineMaterial(((BraveBehaviour)player).sprite); if (Object.op_Implicit((Object)(object)5__3)) { 5__3.SetColor("_OverrideColor", new Color(31.500002f, 2.1000001f, 2.7f)); } AkSoundEngine.PostEvent("resurrection", ((Component)player).gameObject); <>2__current = (object)new WaitForSeconds(ReviveDuration); <>1__state = 1; return true; } break; case 1: <>1__state = -1; ((BraveBehaviour)player).sprite.color = 5__1; ((BraveBehaviour)((GameActor)player).CurrentGun).sprite.color = 5__2; if (Object.op_Implicit((Object)(object)5__3)) { 5__3.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); } player.DoGhostBlank(); player.CurrentInputState = (PlayerInputState)0; ((BraveBehaviour)player).healthHaver.PreventAllDamage = false; if (ConsumedOnUse) { player.RemovePassiveItem(ID); } 5__3 = null; break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static string ItemName = "Crown Upgrade Resurrection"; private static bool ConsumedOnUse = false; private static float ReviveDuration = 1.3f; private bool hasRevived = false; private GameObject activeVFXObject; public static int ID; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/resurrection_pixelart_sprite"; GameObject val = new GameObject(itemName); CrownUpgradeResurrection crownUpgradeResurrection = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "Another Try"; string text3 = "Revives the player with 1 heart.\n\n\"Death is of little consequence. Rise once more, vessel of mine.\"\n\nHarness the power to defy death once after lengthy and devoted worship.\n"; ItemBuilder.SetupItem((PickupObject)(object)crownUpgradeResurrection, text2, text3, "gungeoncotl"); ((PickupObject)crownUpgradeResurrection).quality = (ItemQuality)(-50); GunExt.SetName((PickupObject)(object)crownUpgradeResurrection, "Resurrection"); ((PickupObject)crownUpgradeResurrection).CanBeDropped = false; ID = ((PickupObject)crownUpgradeResurrection).PickupObjectId; } public override void Pickup(PlayerController player) { if (!base.m_pickedUpThisRun) { if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } AkSoundEngine.PostEvent("crown_upgrade_pickup", ((Component)player).gameObject); activeVFXObject = VFXPlayerCOTL.PlayCrownUpgradeEffectOnActor(player); ((MonoBehaviour)player).StartCoroutine(VFXPlayerCOTL.HardCodedCrownUpgradeEffectSFXPlayer(player)); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); ((BraveBehaviour)player).healthHaver.OnPreDeath += Resurrection; } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } if ((Object)(object)player != (Object)null) { ((BraveBehaviour)player).healthHaver.OnPreDeath -= Resurrection; } } private void Resurrection(Vector2 DeathPositon) { if (!hasRevived) { PlayerController owner = ((PassiveItem)this).Owner; if (owner != null) { ((MonoBehaviour)owner).StartCoroutine(ReviveCoroutine(owner)); } } } private IEnumerator ReviveCoroutine(PlayerController player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { <>4__this = this, player = player }; } } internal class DoctrineOfLawAndOrder : PassiveItem { public static string ItemName = "Doctrine of Law And Order"; public float percentageHealthReduction = 0.1f; private GameObject activeVFXObject; public static int ID; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/doctrine_of_law_and_order_pixelart_sprite"; GameObject val = new GameObject(itemName); DoctrineOfLawAndOrder doctrineOfLawAndOrder = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "OBEY"; string text3 = "Decreases hp of all enemies by 10%\n\n\"Teach them the true meaning of obedience.\"\n\nManipulate the justice system to instill fear into the bulletkin. From now on, they're quicker to give up on their lives.\n"; ItemBuilder.SetupItem((PickupObject)(object)doctrineOfLawAndOrder, text2, text3, "gungeoncotl"); GunExt.SetName((PickupObject)(object)doctrineOfLawAndOrder, "Doctrine of Law & Order"); ((PickupObject)doctrineOfLawAndOrder).quality = (ItemQuality)(-50); ((PickupObject)doctrineOfLawAndOrder).CanBeDropped = false; ID = ((PickupObject)doctrineOfLawAndOrder).PickupObjectId; } public override void Pickup(PlayerController player) { if (!base.m_pickedUpThisRun) { if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } AkSoundEngine.PostEvent("doctrine_piece", ((Component)player).gameObject); activeVFXObject = VFXPlayerCOTL.PlayDoctrineEffectOnActor(player); } if (!base.m_pickedUp) { ((PassiveItem)this).Pickup(player); AIActor.HealthModifier *= Mathf.Clamp01(1f - percentageHealthReduction); } Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public override DebrisObject Drop(PlayerController player) { Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } DebrisObject val = ((PassiveItem)this).Drop(player); ((PassiveItem)((Component)val).GetComponent()).m_pickedUpThisRun = true; AIActor.HealthModifier /= Mathf.Clamp01(1f - percentageHealthReduction); return val; } } internal class DoctrineOfMaterialism : PassiveItem { public static string ItemName = "Doctrine of Materialism"; private int NumItemsPurchased = 0; private static float DiscountIncPerStack = 0.05f; private GameObject activeVFXObject; public static int ID; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/doctrine_of_materialism_pixelart_sprite"; GameObject val = new GameObject(itemName); DoctrineOfMaterialism doctrineOfMaterialism = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "CONSUME"; string text3 = "Each purchase decreases current shop prices by 5%\n\n\"Preach on the value of earthly goods.\"\n\nWith each purchase made, making your next purchase gets easier.\n"; ItemBuilder.SetupItem((PickupObject)(object)doctrineOfMaterialism, text2, text3, "gungeoncotl"); ((PickupObject)doctrineOfMaterialism).quality = (ItemQuality)(-50); ((PickupObject)doctrineOfMaterialism).CanBeDropped = false; ID = ((PickupObject)doctrineOfMaterialism).PickupObjectId; } public override void Pickup(PlayerController player) { if (!base.m_pickedUpThisRun) { if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } AkSoundEngine.PostEvent("doctrine_piece", ((Component)player).gameObject); activeVFXObject = VFXPlayerCOTL.PlayDoctrineEffectOnActor(player); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); if ((Object)(object)player != (Object)null) { player.OnItemPurchased += ShopItemPurchased; } } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } if ((Object)(object)player != (Object)null) { player.OnItemPurchased -= ShopItemPurchased; } } public void ShopItemPurchased(PlayerController player, ShopItemController itemController) { ItemBuilder.RemovePassiveStatModifier((PickupObject)(object)this, (StatType)13); NumItemsPurchased++; float num = Mathf.Pow(1f - DiscountIncPerStack, (float)NumItemsPurchased); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)this, (StatType)13, num, (ModifyMethod)1); VolleyRebuildHelpers.RecalculateStatsWithoutRebuildingGunVolleys(player.stats, player); } } internal class DoctrineOfSin : PassiveItem { public static string ItemName = "Doctrine of Sin"; private static float CurseToGive = 2f; public bool ChestSpawned = false; private GameObject activeVFXObject; public static int ID; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/doctrine_of_sin_pixelart_sprite"; GameObject val = new GameObject(itemName); DoctrineOfSin doctrineOfSin = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "INDULGE"; string text3 = "Summons a free chest in exchange for +2 curse\n\n\"Give in to your sinful desires and embrace your filthy nature.\"\n\nDespite what others may say, the reward you received appears worth it to you\n"; ItemBuilder.SetupItem((PickupObject)(object)doctrineOfSin, text2, text3, "gungeoncotl"); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)doctrineOfSin, (StatType)14, CurseToGive, (ModifyMethod)0); ((PickupObject)doctrineOfSin).quality = (ItemQuality)(-50); ((PickupObject)doctrineOfSin).CanBeDropped = false; ID = ((PickupObject)doctrineOfSin).PickupObjectId; } public override void Pickup(PlayerController player) { if (!base.m_pickedUpThisRun) { if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } AkSoundEngine.PostEvent("doctrine_piece", ((Component)player).gameObject); activeVFXObject = VFXPlayerCOTL.PlayDoctrineEffectOnActor(player); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); if (!ChestSpawned) { SpawnSinChest(); } } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } } private void SpawnSinChest() { //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) GameManager instance = GameManager.Instance; if ((Object)(object)((instance != null) ? instance.PrimaryPlayer : null) == (Object)null) { Plugin.Log("Player doesn't exist!"); return; } RoomHandler currentRoom = GameManager.Instance.PrimaryPlayer.CurrentRoom; if (currentRoom != null) { GameManager instance2 = GameManager.Instance; RewardManager val = ((instance2 != null) ? instance2.RewardManager : null); int num = Random.Range(0, 99); Plugin.Log($"randVal: {num}"); int num2 = num; int num3 = num2; Chest val2 = ((num3 < 5) ? ((num3 >= 1) ? val?.Synergy_Chest : val?.Rainbow_Chest) : ((num3 >= 30) ? val?.S_Chest : val?.A_Chest)); val2.overrideMimicChance = 0f; val2.IsLocked = false; IntVector2 bestRewardLocation = currentRoom.GetBestRewardLocation(new IntVector2(2, 1), (RewardLocationStyle)1, true); Chest val3 = Chest.Spawn(val2, bestRewardLocation + IntVector2.Zero, currentRoom, false); ChestSpawned = true; } } } internal class DoctrineOfSustenance : PassiveItem { public static string ItemName = "Doctrine of Sustenance"; public float ChanceToImproveHealing = 0.15f; public float HealingImprovedBy = 0.5f; public GameObject OnImprovedHealingVFX; public float ChanceToGainMoney = 0.15f; public int MoneyGiven = 15; private static float timeDelay = 0.15f; private static float timeDelayRandRatio = 0.5f; private static List moneySFXList = new List { "pop_1", "pop_2", "pop_3", "pop_4", "pop_5", "pop_6", "pop_7" }; public float ChanceToGainAmmo = 0.15f; public float AmmoRestorePercentage = 0.15f; private GameObject activeVFXObject; public static int ID; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/doctrine_of_sustenance_pixelart_sprite"; GameObject val = new GameObject(itemName); DoctrineOfSustenance doctrineOfSustenance = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "DEVOUR"; string text3 = "Every heal has a chance to heal more, give casings, or restore ammo.\n\n\"Instruct them on the liturgies surrounding their daily bread.\"\n\nLearn how to be more thankful for the crops which feed you. Every meal makes you grateful.\n"; ItemBuilder.SetupItem((PickupObject)(object)doctrineOfSustenance, text2, text3, "gungeoncotl"); ref GameObject onImprovedHealingVFX = ref doctrineOfSustenance.OnImprovedHealingVFX; PickupObject byId = PickupObjectDatabase.GetById(259); onImprovedHealingVFX = ((HealingReceivedModificationItem)((byId is HealingReceivedModificationItem) ? byId : null)).OnImprovedHealingVFX; ((PickupObject)doctrineOfSustenance).quality = (ItemQuality)(-50); ((PickupObject)doctrineOfSustenance).CanBeDropped = false; ID = ((PickupObject)doctrineOfSustenance).PickupObjectId; } public override void Pickup(PlayerController player) { if (!base.m_pickedUpThisRun) { if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } AkSoundEngine.PostEvent("doctrine_piece", ((Component)player).gameObject); activeVFXObject = VFXPlayerCOTL.PlayDoctrineEffectOnActor(player); } if (!base.m_pickedUp) { HealthHaver healthHaver = ((BraveBehaviour)player).healthHaver; healthHaver.ModifyHealing = (Action)Delegate.Combine(healthHaver.ModifyHealing, new Action(ModifyIncomingHealing)); ((PassiveItem)this).Pickup(player); } Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public override DebrisObject Drop(PlayerController player) { Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } DebrisObject val = ((PassiveItem)this).Drop(player); HealthHaver healthHaver = ((BraveBehaviour)player).healthHaver; healthHaver.ModifyHealing = (Action)Delegate.Remove(healthHaver.ModifyHealing, new Action(ModifyIncomingHealing)); ((PassiveItem)((Component)val).GetComponent()).m_pickedUpThisRun = true; return val; } public override void OnDestroy() { if (base.m_pickedUp) { HealthHaver healthHaver = ((BraveBehaviour)base.m_owner).healthHaver; healthHaver.ModifyHealing = (Action)Delegate.Combine(healthHaver.ModifyHealing, new Action(ModifyIncomingHealing)); } ((PassiveItem)this).OnDestroy(); } private void ModifyIncomingHealing(HealthHaver source, ModifyHealingEventArgs args) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) float value = Random.value; if (args != EventArgs.Empty && value < ChanceToImproveHealing) { if ((Object)(object)OnImprovedHealingVFX != (Object)null) { ((GameActor)((Component)source).GetComponent()).PlayEffectOnActor(OnImprovedHealingVFX, Vector3.zero, true, false, false); } args.ModifiedHealing += HealingImprovedBy; } else if (args != EventArgs.Empty && value < ChanceToImproveHealing + ChanceToGainMoney) { ((MonoBehaviour)((PassiveItem)this).Owner).StartCoroutine(HelpfulMethods.SpawnMoney(((PassiveItem)this).Owner, MoneyGiven, timeDelay, randSpawn: true, timeDelayRandRatio, playSFX: true, moneySFXList)); } else if (args != EventArgs.Empty && value < ChanceToImproveHealing + ChanceToGainMoney + ChanceToGainAmmo) { HelpfulMethods.RestorePercentAmmo(((PassiveItem)this).Owner, AmmoRestorePercentage); } } } internal class HeartOfTheFaithful4 : TieredPassiveItem { public static string ItemName = "Heart of the Faithful IV"; private static float HealthStat = 4f; public static int ID; public static bool isHeartOfTheFaithful = true; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/heart_of_the_faithful_4_pixelart_sprite"; GameObject val = new GameObject(itemName); HeartOfTheFaithful4 heartOfTheFaithful = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "+Defense"; string text3 = "+4 Heart\nImmense strength of faith from your followers increase your defenses greatly.\n"; ItemBuilder.SetupItem((PickupObject)(object)heartOfTheFaithful, text2, text3, "gungeoncotl"); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)heartOfTheFaithful, (StatType)3, HealthStat, (ModifyMethod)0); ((PickupObject)heartOfTheFaithful).quality = (ItemQuality)(-100); heartOfTheFaithful.itemTier = 4; heartOfTheFaithful.TierGroupIdentifier = "heart_of_the_faithful_tiered_item"; ((PickupObject)heartOfTheFaithful).CanBeDropped = false; ID = ((PickupObject)heartOfTheFaithful).PickupObjectId; } public override void Pickup(PlayerController player) { if (!((PassiveItem)this).m_pickedUpThisRun) { AkSoundEngine.PostEvent("tarot_rune_draw", ((Component)player).gameObject); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void Update() { if ((Object)(object)((PassiveItem)this).Owner != (Object)null && ((PassiveItem)this).Owner.HasSynergy(Synergy.HEARTOFTHEFAITHFUL_FOUR)) { ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful1.ID); ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful2.ID); ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful3.ID); } ((PassiveItem)this).Update(); } } internal class HeartOfTheFaithful5 : TieredPassiveItem { public static string ItemName = "Heart of the Faithful V"; private static float HealthStat = 5f; public static int ID; public static bool isHeartOfTheFaithful = true; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/heart_of_the_faithful_5_pixelart_sprite"; GameObject val = new GameObject(itemName); HeartOfTheFaithful5 heartOfTheFaithful = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "+Defense"; string text3 = "+5 Heart\nInsane strength of faith from your followers drastically increase your defenses.\n"; ItemBuilder.SetupItem((PickupObject)(object)heartOfTheFaithful, text2, text3, "gungeoncotl"); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)heartOfTheFaithful, (StatType)3, HealthStat, (ModifyMethod)0); ((PickupObject)heartOfTheFaithful).quality = (ItemQuality)(-100); heartOfTheFaithful.itemTier = 5; heartOfTheFaithful.TierGroupIdentifier = "heart_of_the_faithful_tiered_item"; ((PickupObject)heartOfTheFaithful).CanBeDropped = false; ID = ((PickupObject)heartOfTheFaithful).PickupObjectId; } public override void Pickup(PlayerController player) { if (!((PassiveItem)this).m_pickedUpThisRun) { AkSoundEngine.PostEvent("tarot_rune_draw", ((Component)player).gameObject); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void Update() { if ((Object)(object)((PassiveItem)this).Owner != (Object)null && ((PassiveItem)this).Owner.HasSynergy(Synergy.HEARTOFTHEFAITHFUL_FIVE)) { ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful1.ID); ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful2.ID); ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful3.ID); ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful4.ID); } ((PassiveItem)this).Update(); } } internal class HeartOfTheFaithful6 : TieredPassiveItem { public static string ItemName = "Heart of the Faithful VI"; private static float HealthStat = 6f; public static int ID; public static bool isHeartOfTheFaithful = true; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/heart_of_the_faithful_6_pixelart_sprite"; GameObject val = new GameObject(itemName); HeartOfTheFaithful6 heartOfTheFaithful = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "+Defense"; string text3 = "+6 Heart\nComplete and absolute faith from your followers bestows you defense on par with the gods.\n"; ItemBuilder.SetupItem((PickupObject)(object)heartOfTheFaithful, text2, text3, "gungeoncotl"); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)heartOfTheFaithful, (StatType)3, HealthStat, (ModifyMethod)0); ((PickupObject)heartOfTheFaithful).quality = (ItemQuality)(-100); heartOfTheFaithful.itemTier = 6; heartOfTheFaithful.TierGroupIdentifier = "heart_of_the_faithful_tiered_item"; ((PickupObject)heartOfTheFaithful).CanBeDropped = false; ID = ((PickupObject)heartOfTheFaithful).PickupObjectId; } public override void Pickup(PlayerController player) { if (!((PassiveItem)this).m_pickedUpThisRun) { AkSoundEngine.PostEvent("tarot_rune_draw", ((Component)player).gameObject); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void Update() { if ((Object)(object)((PassiveItem)this).Owner != (Object)null && ((PassiveItem)this).Owner.HasSynergy(Synergy.HEARTOFTHEFAITHFUL_SIX)) { ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful1.ID); ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful2.ID); ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful3.ID); ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful4.ID); ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful5.ID); } ((PassiveItem)this).Update(); } } internal class HeartOfTheFaithful3 : TieredPassiveItem { public static string ItemName = "Heart of the Faithful III"; private static float HealthStat = 3f; public static int ID; public static bool isHeartOfTheFaithful = true; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/heart_of_the_faithful_3_pixelart_sprite"; GameObject val = new GameObject(itemName); HeartOfTheFaithful3 heartOfTheFaithful = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "+Defense"; string text3 = "+3 Heart\nFurther increased strength of faith from your followers increase your defenses even further.\n"; ItemBuilder.SetupItem((PickupObject)(object)heartOfTheFaithful, text2, text3, "gungeoncotl"); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)heartOfTheFaithful, (StatType)3, HealthStat, (ModifyMethod)0); ((PickupObject)heartOfTheFaithful).quality = (ItemQuality)(-100); heartOfTheFaithful.itemTier = 3; heartOfTheFaithful.TierGroupIdentifier = "heart_of_the_faithful_tiered_item"; ((PickupObject)heartOfTheFaithful).CanBeDropped = false; ID = ((PickupObject)heartOfTheFaithful).PickupObjectId; } public override void Pickup(PlayerController player) { if (!((PassiveItem)this).m_pickedUpThisRun) { AkSoundEngine.PostEvent("tarot_rune_draw", ((Component)player).gameObject); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void Update() { if ((Object)(object)((PassiveItem)this).Owner != (Object)null && ((PassiveItem)this).Owner.HasSynergy(Synergy.HEARTOFTHEFAITHFUL_THREE)) { ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful1.ID); ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful2.ID); } ((PassiveItem)this).Update(); } } internal class HeartOfTheFaithful2 : TieredPassiveItem { public static string ItemName = "Heart of the Faithful II"; private static float HealthStat = 2f; public static int ID; public static bool isHeartOfTheFaithful = true; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/heart_of_the_faithful_2_pixelart_sprite"; GameObject val = new GameObject(itemName); HeartOfTheFaithful2 heartOfTheFaithful = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "+Defense"; string text3 = "+2 Heart\nIncreased strength of faith from your followers increase your defenses further.\n"; ItemBuilder.SetupItem((PickupObject)(object)heartOfTheFaithful, text2, text3, "gungeoncotl"); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)heartOfTheFaithful, (StatType)3, HealthStat, (ModifyMethod)0); ((PickupObject)heartOfTheFaithful).quality = (ItemQuality)(-100); heartOfTheFaithful.itemTier = 2; heartOfTheFaithful.TierGroupIdentifier = "heart_of_the_faithful_tiered_item"; ((PickupObject)heartOfTheFaithful).CanBeDropped = false; ID = ((PickupObject)heartOfTheFaithful).PickupObjectId; } public override void Pickup(PlayerController player) { if (!((PassiveItem)this).m_pickedUpThisRun) { AkSoundEngine.PostEvent("tarot_rune_draw", ((Component)player).gameObject); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void Update() { if ((Object)(object)((PassiveItem)this).Owner != (Object)null && ((PassiveItem)this).Owner.HasSynergy(Synergy.HEARTOFTHEFAITHFUL_TWO)) { ((PassiveItem)this).Owner.RemovePassiveItem(HeartOfTheFaithful1.ID); } ((PassiveItem)this).Update(); } } internal class HeartOfTheFaithful1 : TieredPassiveItem { public static string ItemName = "Heart of the Faithful I"; private static float HealthStat = 1f; public static int ID; public static bool isHeartOfTheFaithful = true; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/heart_of_the_faithful_1_pixelart_sprite"; GameObject val = new GameObject(itemName); HeartOfTheFaithful1 heartOfTheFaithful = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "+Defense"; string text3 = "+1 Heart\nStrength of faith from your followers increase your defenses.\n"; ItemBuilder.SetupItem((PickupObject)(object)heartOfTheFaithful, text2, text3, "gungeoncotl"); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)heartOfTheFaithful, (StatType)3, HealthStat, (ModifyMethod)0); ((PickupObject)heartOfTheFaithful).quality = (ItemQuality)(-100); heartOfTheFaithful.itemTier = 1; heartOfTheFaithful.TierGroupIdentifier = "heart_of_the_faithful_tiered_item"; ((PickupObject)heartOfTheFaithful).CanBeDropped = false; ID = ((PickupObject)heartOfTheFaithful).PickupObjectId; } public override void Pickup(PlayerController player) { if (!((PassiveItem)this).m_pickedUpThisRun) { AkSoundEngine.PostEvent("tarot_rune_draw", ((Component)player).gameObject); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); } } internal class MightOfTheDevout3 : TieredPassiveItem { public static string ItemName = "Might of the Devout III"; private static float DamageStat = 1.3f; public static int ID; public static bool isMightOfTheDevout = true; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/might_of_the_devout_3_pixelart_sprite"; GameObject val = new GameObject(itemName); MightOfTheDevout3 mightOfTheDevout = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "+Power"; string text3 = "1.3x damage\nFurther increased strength of devotion from your followers increase your power even further.\n"; ItemBuilder.SetupItem((PickupObject)(object)mightOfTheDevout, text2, text3, "gungeoncotl"); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)mightOfTheDevout, (StatType)5, DamageStat, (ModifyMethod)1); ((PickupObject)mightOfTheDevout).quality = (ItemQuality)(-100); mightOfTheDevout.itemTier = 3; mightOfTheDevout.TierGroupIdentifier = "might_of_the_devout_tiered_item"; ((PickupObject)mightOfTheDevout).CanBeDropped = false; ID = ((PickupObject)mightOfTheDevout).PickupObjectId; } public override void Pickup(PlayerController player) { if (!((PassiveItem)this).m_pickedUpThisRun) { AkSoundEngine.PostEvent("tarot_rune_draw", ((Component)player).gameObject); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void Update() { if ((Object)(object)((PassiveItem)this).Owner != (Object)null && ((PassiveItem)this).Owner.HasSynergy(Synergy.MIGHTOFTHEDEVOUT_THREE)) { ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout1.ID); ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout2.ID); } ((PassiveItem)this).Update(); } } internal class MightOfTheDevout4 : TieredPassiveItem { public static string ItemName = "Might of the Devout IV"; private static float DamageStat = 1.4f; public static int ID; public static bool isMightOfTheDevout = true; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/might_of_the_devout_4_pixelart_sprite"; GameObject val = new GameObject(itemName); MightOfTheDevout4 mightOfTheDevout = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "+Power"; string text3 = "1.4x damage\nImmense strength of devotion from your followers increase your power greatly.\n"; ItemBuilder.SetupItem((PickupObject)(object)mightOfTheDevout, text2, text3, "gungeoncotl"); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)mightOfTheDevout, (StatType)5, DamageStat, (ModifyMethod)1); ((PickupObject)mightOfTheDevout).quality = (ItemQuality)(-100); mightOfTheDevout.itemTier = 4; mightOfTheDevout.TierGroupIdentifier = "might_of_the_devout_tiered_item"; ((PickupObject)mightOfTheDevout).CanBeDropped = false; ID = ((PickupObject)mightOfTheDevout).PickupObjectId; } public override void Pickup(PlayerController player) { if (!((PassiveItem)this).m_pickedUpThisRun) { AkSoundEngine.PostEvent("tarot_rune_draw", ((Component)player).gameObject); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void Update() { if ((Object)(object)((PassiveItem)this).Owner != (Object)null && ((PassiveItem)this).Owner.HasSynergy(Synergy.MIGHTOFTHEDEVOUT_FOUR)) { ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout1.ID); ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout2.ID); ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout3.ID); } ((PassiveItem)this).Update(); } } internal class MightOfTheDevout6 : TieredPassiveItem { public static string ItemName = "Might of the Devout VI"; private static float DamageStat = 1.75f; public static int ID; public static bool isMightOfTheDevout = true; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/might_of_the_devout_6_pixelart_sprite"; GameObject val = new GameObject(itemName); MightOfTheDevout6 mightOfTheDevout = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "+Power"; string text3 = "1.75x damage\nComplete and absolute devotion from your followers bestows you power on par with the gods.\n"; ItemBuilder.SetupItem((PickupObject)(object)mightOfTheDevout, text2, text3, "gungeoncotl"); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)mightOfTheDevout, (StatType)5, DamageStat, (ModifyMethod)1); ((PickupObject)mightOfTheDevout).quality = (ItemQuality)(-100); mightOfTheDevout.itemTier = 6; mightOfTheDevout.TierGroupIdentifier = "might_of_the_devout_tiered_item"; ((PickupObject)mightOfTheDevout).CanBeDropped = false; ID = ((PickupObject)mightOfTheDevout).PickupObjectId; } public override void Pickup(PlayerController player) { if (!((PassiveItem)this).m_pickedUpThisRun) { AkSoundEngine.PostEvent("tarot_rune_draw", ((Component)player).gameObject); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void Update() { if ((Object)(object)((PassiveItem)this).Owner != (Object)null && ((PassiveItem)this).Owner.HasSynergy(Synergy.MIGHTOFTHEDEVOUT_SIX)) { ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout1.ID); ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout2.ID); ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout3.ID); ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout4.ID); ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout5.ID); } ((PassiveItem)this).Update(); } } internal class MightOfTheDevout5 : TieredPassiveItem { public static string ItemName = "Might of the Devout V"; private static float DamageStat = 1.5f; public static int ID; public static bool isMightOfTheDevout = true; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/might_of_the_devout_5_pixelart_sprite"; GameObject val = new GameObject(itemName); MightOfTheDevout5 mightOfTheDevout = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "+Power"; string text3 = "1.5x damage\nInsane strength of devotion from your followers drastically increase your power.\n"; ItemBuilder.SetupItem((PickupObject)(object)mightOfTheDevout, text2, text3, "gungeoncotl"); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)mightOfTheDevout, (StatType)5, DamageStat, (ModifyMethod)1); ((PickupObject)mightOfTheDevout).quality = (ItemQuality)(-100); mightOfTheDevout.itemTier = 5; mightOfTheDevout.TierGroupIdentifier = "might_of_the_devout_tiered_item"; ((PickupObject)mightOfTheDevout).CanBeDropped = false; ID = ((PickupObject)mightOfTheDevout).PickupObjectId; } public override void Pickup(PlayerController player) { if (!((PassiveItem)this).m_pickedUpThisRun) { AkSoundEngine.PostEvent("tarot_rune_draw", ((Component)player).gameObject); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void Update() { if ((Object)(object)((PassiveItem)this).Owner != (Object)null && ((PassiveItem)this).Owner.HasSynergy(Synergy.MIGHTOFTHEDEVOUT_FIVE)) { ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout1.ID); ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout2.ID); ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout3.ID); ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout4.ID); } ((PassiveItem)this).Update(); } } internal class MightOfTheDevout2 : TieredPassiveItem { public static string ItemName = "Might of the Devout II"; private static float DamageStat = 1.2f; public static int ID; public static bool isMightOfTheDevout = true; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/might_of_the_devout_2_pixelart_sprite"; GameObject val = new GameObject(itemName); MightOfTheDevout2 mightOfTheDevout = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "+Power"; string text3 = "1.2x damage\nIncreased strength of devotion from your followers increase your power further.\n"; ItemBuilder.SetupItem((PickupObject)(object)mightOfTheDevout, text2, text3, "gungeoncotl"); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)mightOfTheDevout, (StatType)5, DamageStat, (ModifyMethod)1); ((PickupObject)mightOfTheDevout).quality = (ItemQuality)(-100); mightOfTheDevout.itemTier = 2; mightOfTheDevout.TierGroupIdentifier = "might_of_the_devout_tiered_item"; ((PickupObject)mightOfTheDevout).CanBeDropped = false; ID = ((PickupObject)mightOfTheDevout).PickupObjectId; } public override void Pickup(PlayerController player) { if (!((PassiveItem)this).m_pickedUpThisRun) { AkSoundEngine.PostEvent("tarot_rune_draw", ((Component)player).gameObject); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void Update() { if ((Object)(object)((PassiveItem)this).Owner != (Object)null && ((PassiveItem)this).Owner.HasSynergy(Synergy.MIGHTOFTHEDEVOUT_TWO)) { ((PassiveItem)this).Owner.RemovePassiveItem(MightOfTheDevout1.ID); } ((PassiveItem)this).Update(); } } internal class MightOfTheDevout1 : TieredPassiveItem { public static string ItemName = "Might of the Devout I"; private static float DamageStat = 1.1f; public static int ID; public static bool isMightOfTheDevout = true; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/might_of_the_devout_1_pixelart_sprite"; GameObject val = new GameObject(itemName); MightOfTheDevout1 mightOfTheDevout = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "+Power"; string text3 = "1.1x damage\nStrength of devotion from your followers increase your power.\n"; ItemBuilder.SetupItem((PickupObject)(object)mightOfTheDevout, text2, text3, "gungeoncotl"); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)mightOfTheDevout, (StatType)5, DamageStat, (ModifyMethod)1); ((PickupObject)mightOfTheDevout).quality = (ItemQuality)(-100); ((PickupObject)mightOfTheDevout).CanBeDropped = false; mightOfTheDevout.itemTier = 1; mightOfTheDevout.TierGroupIdentifier = "might_of_the_devout_tiered_item"; ((PickupObject)mightOfTheDevout).CanBeDropped = false; ID = ((PickupObject)mightOfTheDevout).PickupObjectId; } public override void Pickup(PlayerController player) { if (!((PassiveItem)this).m_pickedUpThisRun) { AkSoundEngine.PostEvent("tarot_rune_draw", ((Component)player).gameObject); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); } } internal class RedCrown : PassiveItem { [CompilerGenerated] private sealed class d__32 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public List items; public RedCrown <>4__this; private int 5__1; private int 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__32(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_008c: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } 5__1 = 0; while (5__1 < items.Count) { if (!Object.op_Implicit((Object)(object)items[5__1])) { 5__2 = 0; while (5__2 < items.Count) { if (5__1 != 5__2) { LootEngine.DoDefaultItemPoof(Vector2.op_Implicit(((BraveBehaviour)items[5__2]).transform.position), false, true); Object.Destroy((Object)(object)((Component)items[5__2]).gameObject); } 5__2++; } if (Object.op_Implicit((Object)(object)<>4__this)) { Plugin.Log("chose an item"); AkSoundEngine.PostEvent("select_upgrade_loop_stop", ((Component)((PassiveItem)<>4__this).Owner).gameObject); if ((Object)(object)<>4__this.activeVFXObject != (Object)null) { Object.Destroy((Object)(object)<>4__this.activeVFXObject); } <>4__this.UpdateChoices(); } return false; } 5__1++; } <>2__current = null; <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__25 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerController player; public RedCrown <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__25(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if ((Object)(object)<>4__this.redCrownVFXObject != (Object)null) { Object.Destroy((Object)(object)<>4__this.redCrownVFXObject); } <>4__this.redCrownVFXObject = VFXPlayerCOTL.PlayBlackfireEffectOnActor(player); <>2__current = (object)new WaitForSeconds(7f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)<>4__this.redCrownVFXObject != (Object)null) { Object.Destroy((Object)(object)<>4__this.redCrownVFXObject); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__27 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public RedCrown <>4__this; private bool 5__1; private List 5__2; private List 5__3; private Vector3 5__4; private Bounds 5__5; private float 5__6; private float 5__7; private int 5__8; private PickupObject 5__9; private tk2dSprite 5__10; private GameObject 5__11; private Transform 5__12; private Vector3 5__13; private tk2dSprite 5__14; private NotePassiveItem 5__15; private float 5__16; private float 5__17; private float 5__18; private int 5__19; private float 5__20; private Vector3 5__21; private int 5__22; private float 5__23; private Vector3 5__24; private float 5__25; private Vector2 5__26; private Vector3 5__27; private int 5__28; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__27(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; 5__9 = null; 5__10 = null; 5__11 = null; 5__12 = null; 5__14 = null; 5__15 = null; <>1__state = -2; } private bool MoveNext() { //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_0073: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_0599: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05ea: Unknown result type (might be due to invalid IL or missing references) //IL_05cd: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = true; 5__2 = new List(); 5__3 = new List(); 5__4 = Vector3.zero; if (5__1) { 5__5 = ((BraveBehaviour)<>4__this).sprite.GetBounds(); 5__4 = ((BraveBehaviour)<>4__this).transform.position + ((Bounds)(ref 5__5)).extents; 5__8 = 0; while (5__8 < <>4__this.choices.Count) { 5__9 = <>4__this.choices[5__8]; 5__10 = ((Component)5__9).GetComponent(); if ((Object)(object)5__10 == (Object)null) { 5__10 = ((Component)5__9).GetComponentInChildren(); } 5__11 = new GameObject("VFX_Chest_Item"); 5__12 = 5__11.transform; 5__13 = Vector3.zero; if ((Object)(object)5__10 != (Object)null) { 5__14 = tk2dSprite.AddComponent(5__11, ((tk2dBaseSprite)5__10).Collection, ((tk2dBaseSprite)5__10).spriteId); ((tk2dBaseSprite)5__14).HeightOffGround = 2f; 5__15 = ((Component)5__10).GetComponent(); if ((Object)(object)5__15 != (Object)null && 5__15.ResourcefulRatNoteIdentifier >= 0) { ((tk2dBaseSprite)5__14).SetSprite(5__15.GetAppropriateSpriteName(false)); } SpriteOutlineManager.AddOutlineToSprite((tk2dBaseSprite)(object)5__14, Color.white, 0.5f, 0f, (OutlineType)0); Bounds bounds = ((tk2dBaseSprite)5__11.GetComponent()).GetBounds(); 5__13 = -BraveUtility.QuantizeVector(((Bounds)(ref bounds)).extents); ((tk2dBaseSprite)5__14).UpdateZDepth(); 5__14 = null; 5__15 = null; } 5__12.position = 5__4 + 5__13; 5__2.Add(5__12); 5__3.Add(5__13); 5__9 = null; 5__10 = null; 5__11 = null; 5__12 = null; 5__8++; } 5__6 = 1f; 5__7 = 0f; goto IL_063d; } goto IL_0655; case 1: <>1__state = -1; goto IL_063d; case 2: { <>1__state = -1; 5__28 = 0; while (5__28 < 5__2.Count) { Object.Destroy((Object)(object)((Component)5__2[5__28]).gameObject); 5__28++; } return false; } IL_0655: <>4__this.SpewChoicesOntoGround(5__2); <>2__current = null; <>1__state = 2; return true; IL_063d: if (5__7 < 5__6) { 5__7 += BraveTime.DeltaTime * 1.5f; 5__16 = Mathf.Clamp01(5__7 / 5__6); 5__17 = <>4__this.spawnCurve.Evaluate(5__16); 5__18 = Mathf.SmoothStep(0f, 1f, 5__16); if (5__2.Count <= 4) { 5__19 = 0; while (5__19 < 5__2.Count) { 5__20 = ((5__2.Count != 1) ? (-1f + 2f / (float)(5__2.Count - 1) * (float)5__19) : 0f); 5__20 = 5__20 * ((float)5__2.Count / 2f) * 1f; 5__21 = 5__4 + 5__3[5__19] + new Vector3(Mathf.Lerp(0f, 5__20, 5__18), 5__17, -2.5f); if (<>4__this.CheckPresentedItemTheoreticalPosition(5__21, 5__3[5__19])) { 5__21 = 5__2[5__19].position; } 5__2[5__19].position = 5__21; 5__19++; } } else { 5__22 = 0; while (5__22 < 5__2.Count) { 5__23 = 360f / (float)5__2.Count; 5__24 = Quaternion.Euler(0f, 0f, 5__23 * (float)5__22) * Vector3.right; 5__25 = 3f; Vector2 val = Vector3Extensions.XY(5__24); 5__26 = ((Vector2)(ref val)).normalized * 5__25; 5__27 = 5__4 + 5__3[5__22] + new Vector3(0f, 5__17, -2.5f) + Vector2Extensions.ToVector3ZUp(Vector2.Lerp(Vector2.zero, 5__26, 5__18), 0f); if (<>4__this.CheckPresentedItemTheoreticalPosition(5__27, 5__3[5__22])) { 5__27 = 5__2[5__22].position; } 5__2[5__22].position = 5__27; 5__22++; } } <>2__current = null; <>1__state = 1; return true; } goto IL_0655; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static string ItemName = "Red Crown"; public float DevotionExpTracker = 0f; public float DevotionCurrentThreshold = 1000f; public int NumOfDivineInspirations = 0; public List DevotionExpThresholdList = new List { 500f, 750f, 1000f, 1250f, 1500f, 1750f, 2000f, 2250f, 2500f, 2750f, 3000f }; private static int CapNumDivineInspirations = 22; private Vector3 DivineInspirationChoiceDecisionLocation = Vector3.zero; private static List possibleChoiceTable = new List { PickupObjectDatabase.GetById(HeartOfTheFaithful1.ID), PickupObjectDatabase.GetById(MightOfTheDevout1.ID), PickupObjectDatabase.GetById(AscendGunRitual.ID), PickupObjectDatabase.GetById(SacrificeOfTheGun.ID), PickupObjectDatabase.GetById(FeastingRitual.ID), PickupObjectDatabase.GetById(RitualOfEnrichment.ID), PickupObjectDatabase.GetById(RiteOfWrath.ID), PickupObjectDatabase.GetById(DoctrineOfMaterialism.ID), PickupObjectDatabase.GetById(DoctrineOfSin.ID), PickupObjectDatabase.GetById(DoctrineOfSustenance.ID), PickupObjectDatabase.GetById(DoctrineOfLawAndOrder.ID) }; private bool tierTwoActivated = false; private static List tierTwoPossibleChoiceTable = new List { PickupObjectDatabase.GetById(CrownUpgradeDarknessWithin.ID), PickupObjectDatabase.GetById(CrownUpgradeResurrection.ID) }; private static List tierTwoHeartOfTheFaithfulList = new List { PickupObjectDatabase.GetById(HeartOfTheFaithful1.ID), PickupObjectDatabase.GetById(HeartOfTheFaithful2.ID), PickupObjectDatabase.GetById(HeartOfTheFaithful3.ID), PickupObjectDatabase.GetById(HeartOfTheFaithful4.ID), PickupObjectDatabase.GetById(HeartOfTheFaithful5.ID), PickupObjectDatabase.GetById(HeartOfTheFaithful6.ID) }; private static List tierTwoMightOfTheDevoutList = new List { PickupObjectDatabase.GetById(MightOfTheDevout1.ID), PickupObjectDatabase.GetById(MightOfTheDevout2.ID), PickupObjectDatabase.GetById(MightOfTheDevout3.ID), PickupObjectDatabase.GetById(MightOfTheDevout4.ID), PickupObjectDatabase.GetById(MightOfTheDevout5.ID), PickupObjectDatabase.GetById(MightOfTheDevout6.ID) }; private static List availableChoicesPool = new List(); public List choices = new List(); public AnimationCurve spawnCurve = new AnimationCurve(); public Vector2 choicesSpawnLocation; private static List VFXSpritePath = new List { "GungeonCOTL/Resources/vfxs/divine_intervention_vfx/aureole_aura_001", "GungeonCOTL/Resources/vfxs/divine_intervention_vfx/aureole_aura_002", "GungeonCOTL/Resources/vfxs/divine_intervention_vfx/aureole_aura_003", "GungeonCOTL/Resources/vfxs/divine_intervention_vfx/aureole_aura_004", "GungeonCOTL/Resources/vfxs/divine_intervention_vfx/aureole_aura_005", "GungeonCOTL/Resources/vfxs/divine_intervention_vfx/aureole_aura_006", "GungeonCOTL/Resources/vfxs/divine_intervention_vfx/aureole_aura_007", "GungeonCOTL/Resources/vfxs/divine_intervention_vfx/aureole_aura_008" }; private static GameObject EffectVFX; private GameObject activeVFXObject; private GameObject redCrownVFXObject; public static int ID; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0051: 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_007a: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/passive_item_sprites/red_crown_alt_pixelart_sprite"; GameObject val = new GameObject(itemName); RedCrown redCrown = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "Bear the Crown"; string text3 = "Gain EXP from killing enemies. Level up and get rewards via Divine Inspiration.\n\n\"Take the Red Crown which I once wore. With it you shall command the loyalty of Gungeoneers and strike fear into the hearts of bulletkin.\"\n\n -The One Who Waits\n"; ItemBuilder.SetupItem((PickupObject)(object)redCrown, text2, text3, "gungeoncotl"); EffectVFX = VFXBuilder.CreateVFX("divine_intervention_vfx", VFXSpritePath, 10, new IntVector2(0, 0), (Anchor)4, false, 0f, -1f, (Color?)Color.cyan, (WrapMode)0, false); ((PickupObject)redCrown).quality = (ItemQuality)4; ((PickupObject)redCrown).CanBeDropped = false; ID = ((PickupObject)redCrown).PickupObjectId; availableChoicesPool.AddRange(possibleChoiceTable); } public override void Pickup(PlayerController player) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_0070: 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_0091: Unknown result type (might be due to invalid IL or missing references) if (!base.m_pickedUpThisRun) { if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } AkSoundEngine.PostEvent("red_crown_pickup", ((Component)player).gameObject); activeVFXObject = VFXPlayerCOTL.PlayBlackfireEffectOnActor(player); Vector2 unitBottomLeft = ((BraveBehaviour)player).specRigidbody.UnitBottomLeft; Vector2 unitBottomRight = ((BraveBehaviour)player).specRigidbody.UnitBottomRight; HelpfulMethods.DoRandomParticleBurst(15, Vector2.op_Implicit(unitBottomLeft), Vector2.op_Implicit(unitBottomRight), 1f, 1f, 0.2f, 4f, ExtendedColours.carrionRed, (SparksType)1); } ((PassiveItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); if (NumOfDivineInspirations > DevotionExpThresholdList.Count) { NumOfDivineInspirations = DevotionExpThresholdList.Count; } DevotionCurrentThreshold = DevotionExpThresholdList[NumOfDivineInspirations]; Plugin.Log($"DevotionExpTracker: {DevotionExpTracker}, CurrentThreshold: {DevotionCurrentThreshold}, InspirationCount: {NumOfDivineInspirations}"); player.OnAnyEnemyReceivedDamage = (Action)Delegate.Combine(player.OnAnyEnemyReceivedDamage, new Action(KillEnemyCount)); DisplayTables(); } public override void DisableEffect(PlayerController player) { ((PassiveItem)this).DisableEffect(player); Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } if ((Object)(object)player != (Object)null) { player.OnAnyEnemyReceivedDamage = (Action)Delegate.Remove(player.OnAnyEnemyReceivedDamage, new Action(KillEnemyCount)); } } private void KillEnemyCount(float damage, bool fatal, HealthHaver enemyHealth) { if (Object.op_Implicit((Object)(object)enemyHealth) && fatal && (Object)(object)((BraveBehaviour)enemyHealth).aiActor != (Object)null) { float num = 0f; num = ((!enemyHealth.IsBoss && !enemyHealth.IsSubboss) ? ((BraveBehaviour)((BraveBehaviour)enemyHealth).aiActor).healthHaver.GetMaxHealth() : (((BraveBehaviour)((BraveBehaviour)enemyHealth).aiActor).healthHaver.GetMaxHealth() * 0.25f)); DevotionExpTracker += num; if (DevotionExpTracker >= DevotionCurrentThreshold) { TriggerDivineInspiration(); } } } private IEnumerator PlayRedCrownVFX(PlayerController player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__25(0) { <>4__this = this, player = player }; } private void TriggerDivineInspiration() { //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) DevotionExpTracker = 0f; DevotionCurrentThreshold = 1E+10f; if (NumOfDivineInspirations < CapNumDivineInspirations) { NumOfDivineInspirations++; } else { PlayerController owner = ((PassiveItem)this).Owner; owner.OnAnyEnemyReceivedDamage = (Action)Delegate.Remove(owner.OnAnyEnemyReceivedDamage, new Action(KillEnemyCount)); Plugin.Log("No more divine inspirations\n\n\n\n\n\n\n\n\n\n\n\n"); } DevotionCurrentThreshold = DevotionExpThresholdList[Math.Min(DevotionExpThresholdList.Count - 1, NumOfDivineInspirations)]; Plugin.Log($"DevotionExpTracker: {DevotionExpTracker}, CurrentThreshold: {DevotionCurrentThreshold}, InspirationCount: {NumOfDivineInspirations}"); if (NumOfDivineInspirations >= 6 && !tierTwoActivated) { availableChoicesPool.AddRange(tierTwoPossibleChoiceTable); tierTwoActivated = true; } choicesSpawnLocation = ((GameActor)((PassiveItem)this).Owner).CenterPosition; choices = GenerateChoices(Math.Min(3, availableChoicesPool.Count)); AkSoundEngine.PostEvent("select_upgrade", ((Component)((PassiveItem)this).Owner).gameObject); AkSoundEngine.PostEvent("select_upgrade_loop", ((Component)((PassiveItem)this).Owner).gameObject); activeVFXObject = ((GameActor)((PassiveItem)this).Owner).PlayEffectOnActor(EffectVFX, new Vector3(1.0625f, 1.25f, -2f), true, false, false); tk2dSprite component = activeVFXObject.GetComponent(); if ((Object)(object)component != (Object)null) { ((tk2dBaseSprite)component).HeightOffGround = -5f; ((tk2dBaseSprite)component).UpdateZDepth(); } ((MonoBehaviour)((PassiveItem)this).Owner).StartCoroutine(PresentItem()); } private IEnumerator PresentItem() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__27(0) { <>4__this = this }; } private void SpewChoicesOntoGround(List spawnTransforms) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 0; i < choices.Count; i++) { List list2 = new List(); list2.Add(((Component)choices[i]).gameObject); List list3 = LootEngine.SpewLoot(list2, spawnTransforms[i].position); list.AddRange(list3); for (int j = 0; j < list3.Count; j++) { if (Object.op_Implicit((Object)(object)list3[j])) { list3[j].PreventFallingInPits = true; } if (!((Object)(object)((Component)list3[j]).GetComponent() != (Object)null) && !((Object)(object)((Component)list3[j]).GetComponent() != (Object)null) && (Object)(object)((BraveBehaviour)list3[j]).specRigidbody != (Object)null) { ((BraveBehaviour)list3[j]).specRigidbody.CollideWithOthers = false; DebrisObject val = list3[j]; val.OnTouchedGround = (Action)Delegate.Combine(val.OnTouchedGround, new Action(BecomeViableItem)); } } } ((MonoBehaviour)GameManager.Instance.Dungeon).StartCoroutine(HandleRainbowRunLootProcessing(list)); } private bool CheckPresentedItemTheoreticalPosition(Vector3 targetPosition, Vector3 objectOffset) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) Vector3 pos = targetPosition - new Vector3(objectOffset.x * 2f, 0f, 0f); Vector3 pos2 = targetPosition - new Vector3(0f, objectOffset.y * 2f, 0f); Vector3 pos3 = targetPosition - new Vector3(objectOffset.x * 2f, objectOffset.y * 2f, 0f); if (!CheckCellValidForItemSpawn(targetPosition) || !CheckCellValidForItemSpawn(pos) || !CheckCellValidForItemSpawn(pos2) || !CheckCellValidForItemSpawn(pos3)) { return true; } return false; } private bool CheckCellValidForItemSpawn(Vector3 pos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) IntVector2 val = Vector3Extensions.IntXY(pos, (VectorConversions)0); Dungeon dungeon = GameManager.Instance.Dungeon; if (!dungeon.data.CheckInBoundsAndValid(val) || dungeon.CellIsPit(pos) || dungeon.data.isTopWall(val.x, val.y)) { return false; } if (dungeon.data.isWall(val.x, val.y) && !dungeon.data.isFaceWallLower(val.x, val.y)) { return false; } return true; } protected void BecomeViableItem(DebrisObject debris) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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) debris.OnTouchedGround = (Action)Delegate.Remove(debris.OnTouchedGround, new Action(BecomeViableItem)); debris.OnGrounded = (Action)Delegate.Remove(debris.OnGrounded, new Action(BecomeViableItem)); ((BraveBehaviour)debris).specRigidbody.CollideWithOthers = true; Vector2 val = Vector2.zero; val = ((BraveBehaviour)debris).sprite.WorldCenter - choicesSpawnLocation; debris.ClearVelocity(); debris.ApplyVelocity(((Vector2)(ref val)).normalized * 2f); } private IEnumerator HandleRainbowRunLootProcessing(List items) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__32(0) { <>4__this = this, items = items }; } private void UpdateChoices() { foreach (PassiveItem passiveItem in ((PassiveItem)this).Owner.passiveItems) { foreach (PickupObject item in availableChoicesPool) { if (item.PickupObjectId != ((PickupObject)passiveItem).PickupObjectId) { continue; } Plugin.Log("removing item: " + item.EncounterNameOrDisplayName); if ((Object)(object)((Component)item).GetComponent() != (Object)null) { TieredPassiveItem component = ((Component)item).GetComponent(); Plugin.Log("is tiered passive item: " + component.TierGroupIdentifier); if (component.TierGroupIdentifier.Equals("heart_of_the_faithful_tiered_item") && component.itemTier < tierTwoHeartOfTheFaithfulList.Count) { availableChoicesPool.Add(tierTwoHeartOfTheFaithfulList[component.itemTier]); } else if (component.TierGroupIdentifier.Equals("might_of_the_devout_tiered_item") && component.itemTier < tierTwoMightOfTheDevoutList.Count) { availableChoicesPool.Add(tierTwoMightOfTheDevoutList[component.itemTier]); } } availableChoicesPool.Remove(item); break; } } foreach (PlayerItem activeItem in ((PassiveItem)this).Owner.activeItems) { foreach (PickupObject item2 in availableChoicesPool) { if (item2.PickupObjectId == ((PickupObject)activeItem).PickupObjectId) { Plugin.Log("removing item: " + item2.EncounterNameOrDisplayName); availableChoicesPool.Remove(item2); break; } } } } private List GenerateChoices(int count) { choices.Clear(); List list = new List(availableChoicesPool); for (int i = 0; i < count; i++) { int index = Random.Range(0, list.Count); choices.Add(list[index]); list.RemoveAt(index); } return choices; } private void DisplayTables() { Plugin.Log("\navailable choices pool"); foreach (PickupObject item in availableChoicesPool) { Plugin.Log($"{availableChoicesPool.IndexOf(item)}: {item.EncounterNameOrDisplayName}"); } } } } namespace GungeonCOTL.custom_class_data { internal class AdvancedPlayerOrbitalItem : PassiveItem { public PlayerOrbital OrbitalPrefab; public PlayerOrbitalFollower OrbitalFollowerPrefab; public bool HasUpgradeSynergy; public CustomSynergyType UpgradeSynergy; public GameObject UpgradeOrbitalPrefab; public GameObject UpgradeOrbitalFollowerPrefab; public bool CanBeMimicked; public DamageTypeModifier[] modifiers; public DamageTypeModifier[] synergyModifiers; public bool BreaksUponContact; public bool BreaksUponOwnerDamage; public GameObject BreakVFX; protected GameObject m_extantOrbital; protected bool m_synergyUpgradeActive; public bool HasAdvancedUpgradeSynergy; public string AdvancedUpgradeSynergy; public GameObject AdvancedUpgradeOrbitalPrefab; public GameObject AdvancedUpgradeOrbitalFollowerPrefab; public List advancedSynergyModifiers = new List(); protected bool m_advancedSynergyUpgradeActive; private void CreateOrbital(PlayerController owner) { //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown GameObject val = ((!((Object)(object)OrbitalPrefab != (Object)null)) ? ((Component)OrbitalFollowerPrefab).gameObject : ((Component)OrbitalPrefab).gameObject); if (HasUpgradeSynergy && m_synergyUpgradeActive) { val = ((!((Object)(object)UpgradeOrbitalPrefab != (Object)null)) ? UpgradeOrbitalFollowerPrefab.gameObject : UpgradeOrbitalPrefab.gameObject); } if (HasAdvancedUpgradeSynergy && m_advancedSynergyUpgradeActive) { val = ((!((Object)(object)AdvancedUpgradeOrbitalPrefab != (Object)null)) ? AdvancedUpgradeOrbitalFollowerPrefab.gameObject : AdvancedUpgradeOrbitalPrefab.gameObject); } m_extantOrbital = PlayerOrbitalItem.CreateOrbital(owner, val, (Object)(object)OrbitalFollowerPrefab != (Object)null, (PlayerOrbitalItem)null); if (BreaksUponContact && Object.op_Implicit((Object)(object)m_extantOrbital)) { SpeculativeRigidbody component = m_extantOrbital.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { SpeculativeRigidbody val2 = component; val2.OnRigidbodyCollision = (OnRigidbodyCollisionDelegate)Delegate.Combine((Delegate?)(object)val2.OnRigidbodyCollision, (Delegate?)new OnRigidbodyCollisionDelegate(HandleBreakOnCollision)); } } if (BreaksUponOwnerDamage && Object.op_Implicit((Object)(object)owner)) { owner.OnReceivedDamage += HandleBreakOnOwnerDamage; } OnOrbitalCreated(m_extantOrbital); } public static GameObject CreateOrbital(PlayerController owner, GameObject targetOrbitalPrefab, bool isFollower, PlayerOrbitalItem sourceItem = null) { //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) GameObject val = Object.Instantiate(targetOrbitalPrefab, ((BraveBehaviour)owner).transform.position, Quaternion.identity); if (!isFollower) { PlayerOrbital component = val.GetComponent(); component.Initialize(owner); component.SourceItem = sourceItem; } else { PlayerOrbitalFollower component2 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.Initialize(owner); } } return val; } public virtual void OnOrbitalCreated(GameObject orbital) { } private void HandleBreakOnOwnerDamage(PlayerController arg1) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)this)) { if (Object.op_Implicit((Object)(object)BreakVFX) && Object.op_Implicit((Object)(object)m_extantOrbital) && Object.op_Implicit((Object)(object)m_extantOrbital.GetComponentInChildren())) { SpawnManager.SpawnVFX(BreakVFX, Vector2Extensions.ToVector3ZisY(((tk2dBaseSprite)m_extantOrbital.GetComponentInChildren()).WorldCenter, 0f), Quaternion.identity); } if (Object.op_Implicit((Object)(object)base.m_owner)) { base.m_owner.RemovePassiveItem(((PickupObject)this).PickupObjectId); base.m_owner.OnReceivedDamage -= HandleBreakOnOwnerDamage; } Object.Destroy((Object)(object)((Component)this).gameObject); } } private void HandleBreakOnCollision(CollisionData rigidbodyCollision) { if (Object.op_Implicit((Object)(object)base.m_owner)) { base.m_owner.RemovePassiveItem(((PickupObject)this).PickupObjectId); } Object.Destroy((Object)(object)((Component)this).gameObject); } public void DecoupleOrbital() { m_extantOrbital = null; if (BreaksUponOwnerDamage && Object.op_Implicit((Object)(object)base.m_owner)) { base.m_owner.OnReceivedDamage -= HandleBreakOnOwnerDamage; } } private void DestroyOrbital() { if (Object.op_Implicit((Object)(object)m_extantOrbital)) { if (BreaksUponOwnerDamage && Object.op_Implicit((Object)(object)base.m_owner)) { base.m_owner.OnReceivedDamage -= HandleBreakOnOwnerDamage; } Object.Destroy((Object)(object)m_extantOrbital.gameObject); m_extantOrbital = null; } } public override void Update() { //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) ((PassiveItem)this).Update(); if (HasAdvancedUpgradeSynergy) { if (m_advancedSynergyUpgradeActive && (!Object.op_Implicit((Object)(object)base.m_owner) || !CustomSynergies.PlayerHasActiveSynergy(base.m_owner, AdvancedUpgradeSynergy))) { if (Object.op_Implicit((Object)(object)base.m_owner)) { for (int i = 0; i < advancedSynergyModifiers.Count; i++) { ((BraveBehaviour)base.m_owner).healthHaver.damageTypeModifiers.Remove(advancedSynergyModifiers[i]); } } m_advancedSynergyUpgradeActive = false; DestroyOrbital(); if (Object.op_Implicit((Object)(object)base.m_owner)) { CreateOrbital(base.m_owner); } } else if (!m_advancedSynergyUpgradeActive && Object.op_Implicit((Object)(object)base.m_owner) && CustomSynergies.PlayerHasActiveSynergy(base.m_owner, AdvancedUpgradeSynergy)) { m_advancedSynergyUpgradeActive = true; DestroyOrbital(); if (Object.op_Implicit((Object)(object)base.m_owner)) { CreateOrbital(base.m_owner); } for (int j = 0; j < advancedSynergyModifiers.Count; j++) { ((BraveBehaviour)base.m_owner).healthHaver.damageTypeModifiers.Add(advancedSynergyModifiers[j]); } } } if (!HasUpgradeSynergy) { return; } if (m_synergyUpgradeActive && (!Object.op_Implicit((Object)(object)base.m_owner) || !base.m_owner.HasActiveBonusSynergy(UpgradeSynergy, false))) { if (Object.op_Implicit((Object)(object)base.m_owner)) { for (int k = 0; k < synergyModifiers.Length; k++) { ((BraveBehaviour)base.m_owner).healthHaver.damageTypeModifiers.Remove(synergyModifiers[k]); } } m_synergyUpgradeActive = false; DestroyOrbital(); if (Object.op_Implicit((Object)(object)base.m_owner)) { CreateOrbital(base.m_owner); } } else if (!m_synergyUpgradeActive && Object.op_Implicit((Object)(object)base.m_owner) && base.m_owner.HasActiveBonusSynergy(UpgradeSynergy, false)) { m_synergyUpgradeActive = true; DestroyOrbital(); if (Object.op_Implicit((Object)(object)base.m_owner)) { CreateOrbital(base.m_owner); } for (int l = 0; l < synergyModifiers.Length; l++) { ((BraveBehaviour)base.m_owner).healthHaver.damageTypeModifiers.Add(synergyModifiers[l]); } } } public override void Pickup(PlayerController player) { ((PassiveItem)this).Pickup(player); player.OnNewFloorLoaded = (Action)Delegate.Combine(player.OnNewFloorLoaded, new Action(HandleNewFloor)); for (int i = 0; i < modifiers.Length; i++) { ((BraveBehaviour)player).healthHaver.damageTypeModifiers.Add(modifiers[i]); } CreateOrbital(player); } private void HandleNewFloor(PlayerController obj) { DestroyOrbital(); CreateOrbital(obj); } public override DebrisObject Drop(PlayerController player) { DestroyOrbital(); player.OnNewFloorLoaded = (Action)Delegate.Remove(player.OnNewFloorLoaded, new Action(HandleNewFloor)); for (int i = 0; i < modifiers.Length; i++) { ((BraveBehaviour)player).healthHaver.damageTypeModifiers.Remove(modifiers[i]); } for (int j = 0; j < synergyModifiers.Length; j++) { ((BraveBehaviour)player).healthHaver.damageTypeModifiers.Remove(synergyModifiers[j]); } return ((PassiveItem)this).Drop(player); } public override void OnDestroy() { if ((Object)(object)base.m_owner != (Object)null) { PlayerController owner = base.m_owner; owner.OnNewFloorLoaded = (Action)Delegate.Remove(owner.OnNewFloorLoaded, new Action(HandleNewFloor)); for (int i = 0; i < modifiers.Length; i++) { ((BraveBehaviour)base.m_owner).healthHaver.damageTypeModifiers.Remove(modifiers[i]); } for (int j = 0; j < synergyModifiers.Length; j++) { ((BraveBehaviour)base.m_owner).healthHaver.damageTypeModifiers.Remove(synergyModifiers[j]); } base.m_owner.OnReceivedDamage -= HandleBreakOnOwnerDamage; } DestroyOrbital(); ((PassiveItem)this).OnDestroy(); } } public enum Items { MagicLamp = 0, Winchester = 1, Thompson = 2, Screecher = 3, StickyCrossbow = 4, Awp = 5, Zorgun = 6, Barrel = 7, Bow = 8, DuelingPistol = 9, MegaDouser = 10, Crossbow = 12, Thunderclap = 13, BeeHive = 14, Ak47 = 15, YariLauncher = 16, HeckBlaster = 17, Blooper = 18, GrenadeLauncher = 19, Moonscraper = 20, Bsg = 21, ShadesRevolver = 22, DungeonEagle = 23, DartGun = 24, M1 = 25, NailGun = 26, LightGun = 27, Mailbox = 28, Vertebraek47 = 29, M1911 = 30, Klobbe = 31, VoidMarshal = 32, TearJerker = 33, SmileysRevolver = 35, Megahand = 36, SeriousCannon = 37, Magnum = 38, Rpg = 39, FreezeRay = 40, Heroine = 41, TrankGun = 42, MachinePistol = 43, SkullSpitter = 45, Jolter = 47, SniperRifle = 49, Saa = 50, RegularShotgun = 51, CrescentCrossbow = 52, AuGun = 53, LaserRifle = 54, VoidShotgun = 55, _38Special = 56, AlienSidearm = 57, VoidCoreAssaultRifle = 58, HegemonyRifle = 59, DemonHead = 60, BundleOfWands = 61, Colt1851 = 62, Medkit = 63, PotionOfLeadSkin = 64, KnifeShield = 65, ProximityMine = 66, Key = 67, Casing = 68, BulletTime = 69, Unknown2 = 70, Decoy = 71, BubbleShield = 72, HalfHeart = 73, _50Casing = 74, EyeJewel = 76, SupplyDrop = 77, Ammo = 78, Makarov = 79, BudgetRevolver = 80, Deck4rd = 81, ElephantGun = 82, UnfinishedGun = 83, VulcanCannon = 84, Heart = 85, MarineSidearm = 86, GammaRay = 87, RobotsRightHand = 88, RogueSpecial = 89, EyeOfTheBeholster = 90, H4mmer = 91, Stinger = 92, OldGoldie = 93, Mac10 = 94, Akey47 = 95, M16 = 96, Polaris = 97, Patriot = 98, RustySidearm = 99, UnicornHorn = 100, Scope = 102, Ration = 104, FortunesFavor = 105, Jetpack = 106, RaidenCoil = 107, Bomb = 108, IceBomb = 109, MagicSweet = 110, HeavyBullets = 111, CartographersRing = 112, RocketPoweredBullets = 113, BionicLeg = 114, Ballot = 115, AmmoSynthesizer = 116, Eyepatch = 118, Metronome = 119, Armor = 120, Disintegrator = 121, Blunderbuss = 122, PulseCannon = 123, Cactus = 124, FlameHand = 125, Shotbow = 126, Junk = 127, RubeAdyneMk2 = 128, Com4nd0 = 129, Glacier = 130, UtilityBelt = 131, RingOfMiserlyProtection = 132, Backpack = 133, AmmoBelt = 134, CogOfBattle = 135, C4 = 136, Map = 137, Honeycomb = 138, MasterOfUnlocking = 140, RubeAdynePrototype = 142, ShotgunFullOfHate = 143, WitchPistol = 145, Dragunfire = 146, PlaceableKey = 147, Lies = 148, FaceMelter = 149, TShirtCannon = 150, TheMembrane = 151, TheKiln = 152, ShockRifle = 153, Trashcannon = 154, Singularity = 155, LaserLotus = 156, BigIron = 157, AmuletOfThePitLord = 158, GundromedaStrain = 159, GunknightHelmet = 160, GunknightGreaves = 161, GunknightGauntlet = 162, GunknightArmor = 163, HeartSynthesizer = 164, OiledCylinder = 165, ShelletonKey = 166, BloodyEye = 167, DoubleVision = 168, BlackHoleGun = 169, IceCube = 170, GhostBullets = 172, PileOfSouls = 173, PotionOfGunFriendship = 174, Tangler = 175, GungeonAnt = 176, AlienEngine = 177, Crestfaller = 178, ProtonBackpack = 179, Grasschopper = 180, WinchesterRifle = 181, GreyMauser = 182, SerManuelsRevolver = 183, TheJudge = 184, MachineFist = 186, DisarmingPersonality = 187, RollingEye = 190, RingOfFireResistance = 191, BugBoots = 193, FossilizedGun = 196, PeaShooter = 197, GunslingersAshes = 198, LuxinCannon = 199, CharmedBow = 200, PortableTurret = 201, SawedOff = 202, Cigarettes = 203, IrradiatedLead = 204, PoisonVial = 205, CharmHorn = 206, PlaguePistol = 207, Plunger = 208, SenseOfDirection = 209, Gunbow = 210, BallisticBoots = 212, LichyTriggerFinger = 213, CoinCrown = 214, Box = 216, OldKnightsShield = 219, TutorialAk47 = 221, OldKnightsHelm = 222, Cold45 = 223, Blank = 224, IceBreaker = 225, Wristbow = 227, Particulator = 228, HegemonyCarbine = 229, Helix = 230, GildedHydra = 231, SpaceFriend = 232, IbombCompanionApp = 234, AgedBell = 237, DuctTape = 239, Crutch = 240, Scattershot = 241, NapalmStrike = 242, InfuriatingNote1 = 243, InfuriatingNote2 = 244, InfuriatingNote3 = 245, InfuriatingNote4 = 246, InfuriatingNote5 = 247, InfuriatingNote6 = 248, Owl = 249, GrapplingHook = 250, PrizePistol = 251, AirStrike = 252, GungeonPepper = 253, RingOfChestFriendship = 254, AncientHerosBandana = 255, HeavyBoots = 256, Broccoli = 258, Antibody = 259, PinkGuonStone = 260, WhiteGuonStone = 262, OrangeGuonStone = 263, ClearGuonStone = 264, OldKnightsFlask = 267, RedGuonStone = 269, BlueGuonStone = 270, RiddleOfLead = 271, IronCoin = 272, LaserSight = 273, DarkMarker = 274, FlareGun = 275, Spice = 276, FatBullets = 277, FrostBullets = 278, SuperHotWatch = 279, DrumClip = 280, GungeonBlueprint = 281, HomingBullets = 284, BloodBrooch = 285, _1Bullets = 286, BackupGun = 287, BouncyBullets = 288, SevenLeafClover = 289, Sunglasses = 290, Meatbun = 291, MolotovLauncher = 292, MimicToothNecklace = 293, RingOfMimicFriendship = 294, HotLead = 295, MetashopBreachItemOld = 296, HegemonyCredit = 297, ShockRounds = 298, SuperSpaceTurtlesGun = 299, Dog = 300, SuperSpaceTurtle = 301, BulletThatCanKillThePast = 303, ExplosiveRounds = 304, OldCrest = 305, EscapeRope = 306, WaxWings = 307, ClusterMine = 308, CloranthyRing = 309, FairyWings = 310, Clone = 311, BlastHelmet = 312, MonsterBlood = 313, Nanomachines = 314, Gunboots = 315, GnawedKey = 316, R2g2 = 318, Ticket = 320, GoldAmmolet = 321, LodestoneAmmolet = 322, AngryBullets = 323, ChaosAmmolet = 325, Number2 = 326, Corsair = 327, ChargeShot = 328, ZillaShotgun = 329, TheEmperor = 330, ScienceCannon = 331, LilBomber = 332, Mutation = 333, WindUpGun = 334, Silencer = 335, Pitchfork = 336, CompositeGun = 337, Gunther = 338, Mahoguny = 339, LowerCaseR = 340, Buzzkill = 341, UraniumAmmolet = 342, CopperAmmolet = 343, FrostAmmolet = 344, Fightsabre = 345, Huntsman = 346, Shotgrub = 347, PrimePrimer = 348, PlanarLead = 349, ObsidianShellCasing = 350, ArcaneGunpowder = 351, ShadowBullets = 352, EnragingPhoto = 353, MilitaryTraining = 354, ChromesteelAssaultRifle = 355, TrustyLockpicks = 356, CatClaw = 357, Railgun = 358, CompressedAirTank = 359, Snakemaker = 360, BulletBore = 362, TrickGun = 363, HeartOfIce = 364, MassShotgun = 365, Molotov = 366, HuntersJournal = 367, ElTigre = 368, BaitLauncher = 369, PrototypeRailgun = 370, RcRocket = 372, AlphaBullets = 373, OmegaBullets = 374, EasyReloadBullets = 375, BrickBreaker = 376, Excaliber = 377, Derringer = 378, ShotgunFullOfLove = 379, BetrayersShield = 380, TripleCrossbow = 381, Sling = 382, FlashRay = 383, Phoenix = 384, Hexagun = 385, FrostGiant = 387, CobaltHammer = 390, CellKey = 392, Anvillain = 393, MineCutter = 394, StaffOfFirepower = 395, TableTechSight = 396, TableTechMoney = 397, TableTechRocket = 398, TableTechRage = 399, TableTechBlanks = 400, Gungine = 401, Snowballer = 402, MeltedRock = 403, Siren = 404, Rattler = 406, SixthChamber = 407, BustedTelevision = 409, BatteryBullets = 410, CoolantLeak = 411, FriendshipCookie = 412, HerosSword = 413, LiveAmmo = 414, ReplacementArm = 415, Balloon = 416, Blasphemy = 417, TrorcBreachItem = 418, HeartHolster = 421, HeartLunchbox = 422, HeartLocket = 423, HeartBottle = 424, HeartPurse = 425, ShotgaCola = 426, ShotgunCoffee = 427, GooptonBreachItem = 429, LiquidValkyrie = 431, JarOfBees = 432, StuffedStar = 433, BulletIdol = 434, Mustache = 435, BloodiedScarf = 436, MuscleRelaxant = 437, ExplosiveDecoy = 438, BracketKey = 439, RubyBracelet = 440, EmeraldBracelet = 441, Badge = 442, BigBoy = 443, Trident = 444, TheScrambler = 445, ShieldOfTheMaiden = 447, Boomerang = 448, TeleporterPrototype = 449, ArmorSynthesizer = 450, Pig = 451, Sponge = 452, GasMask = 453, HazmatSuit = 454, RingOfTriggers = 456, ArmorOfThorns = 457, RingOfEtherealForm = 458, ChaffGrenade = 460, BlankCompanionsRing = 461, SmokeBomb = 462, RingOfTheResourcefulRat = 463, Shellegun = 464, TableTechStun = 465, GreenGuonStone = 466, MasterRound5 = 467, MasterRound3 = 468, MasterRound1 = 469, MasterRound4 = 470, MasterRound2 = 471, GummyGun = 472, HiddenCompartment = 473, AbyssalTentacle = 474, QuadLaser = 475, MicrotransactionGun = 476, Origuni = 477, Banana = 478, SuperMeatGun = 479, MakeshiftCannon = 480, Camera = 481, Gunzheng = 482, Tetrominator = 483, Devolver = 484, Orange = 485, TreadnaughtCannon = 486, BookOfChestAnatomy = 487, RingOfChestVampirism = 488, GunSoul = 489, BrickOfCash = 490, Wingman = 491, Wolf = 492, BriefcaseOfCash = 493, GalacticMedalOfValor = 494, Unity = 495, MetashopBreachItemGun = 497, ElderBlank = 499, HipHolster = 500, MetashopBreachItemItem = 501, HmAbsolutionRockets = 502, Bullet = 503, HyperLightBlaster = 504, MagnumWickedSister = 505, ReallySpecialLute = 506, Starpew = 507, DuelingLaser = 508, Jk47 = 510, _3rdPartyController = 511, Shell = 512, Poxcannon = 513, DirectionalPad = 514, MourningStar = 515, TripleGun = 516, TripleGunForm2 = 517, TripleGunForm3 = 518, CombinedRifle = 519, BalloonGun = 520, ChanceBullets = 521, StoutBullets = 523, Bloody9mm = 524, LamentConfigurum = 525, SpringheelBoots = 526, CharmingRounds = 527, ZombieBullets = 528, BattleStandard = 529, RemoteBullets = 530, FlakBullets = 531, GildedBullets = 532, MagicBullets = 533, RealCoolBow = 535, Relodestone = 536, VorpalGun = 537, SilverBullets = 538, BoxingGlove = 539, GlassCannon = 540, Casey = 541, StrafeGun = 542, ThePredator = 543, Ac15Unarmored = 544, Ac15 = 545, Windgunner = 546, KnightsGun = 550, CrownOfGuns = 551, Bottle = 558, TheFatLine = 562, TheExotic = 563, FullMetalJacket = 564, GlassGuonStone = 565, RadGun = 566, RollBomb = 567, HelixBullets = 568, ChaosBullets = 569, YellowChamber = 570, CursedBullets = 571, ChickenFlute = 572, ChestTeleporter = 573, WoodenBlasphemy = 574, DougBreachItem = 575, RobotsLeftHand = 576, TurboGun = 577, Sprun = 578, BlankBullets = 579, Junkan = 580, VoidCoreCannon = 593, MoonlightTiara = 594, LifeOrb = 595, Teapot = 596, MrAccretionJr = 597, StoneDome = 598, BubbleBlaster = 599, PartialAmmo = 600, BigShotgun = 601, Gunner = 602, LameyGun = 603, Slinger = 604, LootBag = 605, ClownMask = 607, MutationNeoTechYo = 608, RubeAdyneRubensteinsMonster = 609, WoodBeam = 610, Ak47IslandForme = 611, HeroineWaveBeam = 612, HeroineIceBeam = 613, HeroinePlasmaBeam = 614, HeroineHyberBeam = 615, CaseyCarefulIteration = 616, MegahandQuickBoomerang = 617, MegahandTimeStopper = 618, MegahandMetalBlade = 619, MegahandLeafShield = 620, MegahandAtomicFire = 621, MegahandBubbleLead = 622, MegahandAirShooter = 623, MegahandCrashBomber = 624, Drill = 625, Elimentaler = 626, PlatinumBullets = 627, Bumbullets = 630, HoleyGrail = 631, Turkey = 632, TableTechShotgun = 633, CrisisStone = 634, Snowballets = 636, WeirdEgg = 637, DevolverRounds = 638, VorpalBullets = 640, GoldJunk = 641, Daruma = 643, PortableTableDevice = 644, TurtleProblem = 645, ChamberGun = 647, TanglerFullCircle = 648, UppercaseR = 649, PaydayWinchester = 650, RogueSpecialAlt = 651, BudgetRevolverAlt = 652, GunPiece = 654, HungryBullets = 655, KrullerGlaive = 656, ChamberGunOubliette = 657, ChamberGunForge = 658, ChamberGunHollow = 659, ChamberGunProper = 660, OrbitalBullets = 661, PartiallyEatenCheese = 662, ResourcefulSack = 663, BabyGoodMimic = 664, MachoBrace = 665, TableTechHeat = 666, RatBoots = 667, EnemyElimentaler = 668, HighDragunfire = 670, GammaRayBetaRay = 671, ElephantGunTheElephantInTheRoom = 672, MachinePistolPistolMachine = 673, PeaShooterPeaCannon = 674, DuelingPistolDualingPistol = 675, LaserRifleLaserLightShow = 676, DragunfireKalibreath = 677, BlunderbussBlunderbrace = 678, SnowballerSnowballShotgun = 679, ExcaliberArmoredCorps = 680, _38SpecialDetectiveMode = 681, PlaguePistolPandemicPistol = 682, ThunderclapAlistairsLadder = 683, M1M1MultiTool = 684, ThompsonFutureGangster = 685, CorsairBlackFlag = 686, CrestfallerFiveOclockSomewhere = 687, BananaFruitsAndVegetables = 688, AbyssalTentacleKalibersGrip = 689, KlobbeKlobberingTime = 690, MolotovLauncherSpecialReserve = 691, NailGunNailedIt = 692, GunbowShowAcrossTheBow = 693, BigIronIronSlug = 694, HyperLightBlasterHardLight = 695, AlienSidearmChiefMaster = 696, ShockRifleBatteryPowered = 697, FlameHandMaximizeSpell = 698, HegemonyRifleHegemonySpecialForces = 699, CactusCactusFlower = 700, LuxinCannonNoxinCannon = 701, FaceMelterAlternativeRock = 702, BeeHiveApiary = 703, TrashcannonRecyclingBin = 704, FlashRaySaviorOfTheUniverse = 705, FlareGunFiringWithFlair = 706, VulcanCannonNotQuiteAsMini = 707, HelixDoubleDoubleHelix = 708, BarrelLikeShootingFish = 709, FreezeRayIceCap = 710, LightGunPeripheralVision = 711, RaidenCoilRaiden = 712, MoonscraperDoubleMoon7 = 713, LaserLotusLotusBloom = 714, H4mmerHammerAndNail = 715, AwpArcticWarfare = 716, BulletBoreCerebralBros = 717, PolarisSquareBrace = 718, LilBomberKingBomber = 719, ProtonBackpackElectronPack = 720, JolterHeavyJolt = 721, PitchforkPitchPerfect = 722, Com4nd0CommammoBelt = 723, HegemonyCarbineRubyCarbine = 724, TearJerkerUnknown = 725, Akey47AkeyBreaky = 726, RatKey = 727, GunderfuryLv50 = 728, GunderfuryLv60 = 729, GunderfuryLv40 = 730, GunderfuryLv30 = 731, GunderfuryLv10 = 732, GunderfuryLv20 = 733, MimicGun = 734, Serpent = 735, PhoenixPhoenixUp = 736, BetrayersShieldBetrayersLies = 737, LowerCaseRUnknown = 738, GungeonAntGreatQueenAnt = 739, BuzzkillNotSoSawedOff = 740, TearJerkerWrathOfTheBlam = 741, AlienEngineContrail = 742, RadGunKungFuHippieRappinSurfer = 743, OriguniParchmental = 744, IceBreakerGunderlord = 745, TurtineGun = 747, SunlightJavelin = 748, ShotbowSecondAccident = 749, DungeonEagleDontHootTheMessenger = 750, BigGun = 751, WestBroNomesRevolver = 752, WestBroTucosRevolver = 753, WestBroAngelsRevolver = 754, Evolver = 755, EvolverSponge = 756, EvolverFlatworm = 757, EvolverSnail = 758, EvolverFrog = 759, EvolverDragon = 760, HighKaliber = 761, FinishedGun = 762, ChamberGunHell = 763, ChamberGunAbbey = 806, ChamberGunMines = 807, ChamberGunRatLair = 808, MarineSidearmAlt = 809, RustySidearmAlt = 810, DartGunAlt = 811, RobotsRightHandAlt = 812, BlasphemyAlt = 813, MagazineRack = 814, LichsEyeBullets = 815, TrankGunINeedScissors = 816, CatBulletKingThrone = 817, BabyGoodShelleton = 818, GlassCannonSteelSkin = 819, ShadowClone = 820, Scouter = 821, KatanaBullets = 822, ChamberGunRNG = 823 } public enum StatTypesEnum { MovementSpeed, RateOfFire, Accuracy, Health, Coolness, Damage, ProjectileSpeed, AdditionalGunCapacity, AdditionalItemCapacity, AmmoCapacityMultiplier, ReloadSpeed, AdditionalShotPiercing, KnockbackMultiplier, GlobalPriceMultiplier, Curse, PlayerBulletScale, AdditionalClipCapacityMultiplier, AdditionalShotBounces, AdditionalBlanksPerFloor, ShadowBulletChance, ThrownGunDamage, DodgeRollDamage, DamageToBosses, EnemyProjectileSpeedMultiplier, ExtremeShadowBulletChance, ChargeAmountMultiplier, RangeMultiplier, DodgeRollDistanceMultiplier, DodgeRollSpeedMultiplier, TarnisherClipCapacityMultiplier, MoneyMultiplierFromEnemies } public static class ShaderBase { public static readonly string[] Shaders = new string[152] { "Brave_Alpha Mask Mood Renderer", "Brave_AmmonomiconSpriteListShader", "Brave_BlendEmissiveMaskedCutout", "Brave_BraveTilesetWallColorEmissiveCutout", "Brave_BurnableSprite", "Brave_CameraEffects_BossCardEffect", "Brave_CameraEffects_DepthToColor", "Brave_CameraEffects_Pixelator_FinalFade", "Brave_CameraEffects_Pixelator_VignetteFade", "Brave_CameraEffects_UpsideDownEffect", "Brave_CameraEffects_Vignette", "Brave_CutoutEmissiveGodrayExperimental", "Brave_DebrisPitfallShader", "Brave_DebugLines", "Brave_DepthMask", "Brave_DisplacerBeast", "Brave_Effects_Curse Pot Circle", "Brave_Effects_CutoutPortalInternalTilted", "Brave_Effects_InterdimensionalHorrorPortal", "Brave_Effects_PartialDesaturationEffect", "Brave_Effects_PixelFog", "Brave_Effects_Scanlines", "Brave_Effects_SimpleCameraMask", "Brave_Effects_SimpleStencilMask", "Brave_Effects_SimplicityDerivativeShader", "Brave_Effects_Starnest_Replacement_Cheap", "Brave_Effects_StencilMask", "Brave_Effects_StencilMasked", "Brave_Effects_TitleFog", "Brave_Effects_TitleInk", "Brave_Effects_TitleSky", "Brave_Effects_TitleWaterShader", "Brave_Enemy Projectile Emissive UV Scroll", "Brave_Enemy Projectile Emissive", "Brave_GhostEnemy", "Brave_GoopShader", "Brave_GungeonTilemapFloorReflection", "Brave_HueShift", "Brave_Internal_AdditiveDimensionFog", "Brave_Internal_Black", "Brave_Internal_DarkPortalShader", "Brave_Internal_DistortionLine", "Brave_Internal_DistortionRadius", "Brave_Internal_DistortionWave", "Brave_Internal_DownwellAfterImage", "Brave_Internal_DragunTest", "Brave_Internal_EeveeOutline", "Brave_Internal_EndTimesEnvironmentShader", "Brave_Internal_FinalGunRoom_BG_01", "Brave_Internal_FinalGunRoom_BG_02", "Brave_Internal_GammaGamma", "Brave_Internal_GBuffer_Custom_DragunSpotlight", "Brave_Internal_GBuffer_LightMask", "Brave_Internal_GBuffer_LightMaskCombiner", "Brave_Internal_GBuffer_LightRenderer", "Brave_Internal_GBuffer_LightRenderer_Coronal", "Brave_Internal_GBuffer_LightRenderer_Fast", "Brave_Internal_Glitch", "Brave_Internal_GlitchEevee", "Brave_Internal_GlitchUnlit", "Brave_Internal_GlitterPassAdditive", "Brave_Internal_HighPriestAfterImage", "Brave_Internal_HologramShader", "Brave_Internal_PartialCopy", "Brave_Internal_PhotographBurn", "Brave_Internal_PhotographDissolve", "Brave_Internal_PitSpirits", "Brave_Internal_RadialDesaturateAndDarken", "Brave_Internal_RadiusIndicatorEffect", "Brave_Internal_RainbowChestShader", "Brave_Internal_RatFloorShader", "Brave_Internal_RatMazeTransition", "Brave_Internal_SimpleAlphaFadeUnlit", "Brave_Internal_SimpleBraveOutlineSpriteMask", "Brave_Internal_SimpleSpriteMask", "Brave_Internal_SimpleSpriteMaskSwitch", "Brave_Internal_SimpleSpriteMaskUnpixelated", "Brave_Internal_SimpleSpriteUnmask", "Brave_Internal_SinglePassOutline", "Brave_Internal_SpaceFogShader", "Brave_Internal_StarNest_Derivative", "Brave_Internal_WallMirror", "Brave_Internal_WorldDecay", "Brave_ItemSpecific_LootGlintAdditivePass", "Brave_ItemSpecific_LootGlintCutout", "Brave_ItemSpecific_MetalSkinLayerShader", "Brave_ItemSpecific_MetalSkinShader", "Brave_LitBlendUber", "Brave_LitCutoutUber", "Brave_LitCutoutUber_ColorEmissive", "Brave_LitCutoutUberPhantom", "Brave_LitTk2dCustomFalloff", "Brave_LitTk2dCustomFalloffCutout", "Brave_LitTk2dCustomFalloffHigherQueue", "Brave_LitTk2dCustomFalloffTilted", "Brave_LitTk2dCustomFalloffTiltedCutout", "Brave_LitTk2dCustomFalloffTiltedCutoutEmissive", "Brave_LitTk2dCustomFalloffTiltedCutoutEmissiveMapped", "Brave_LitTk2dCustomFalloffTiltedCutoutEmissiveVertexColor", "Brave_LitTk2dCustomFalloffTiltedCutoutFast", "Brave_LitTk2dCustomFalloffTiltedCutoutFastPixelShadow", "Brave_LitTk2dCustomFalloffTiltedCutoutFastPixelShadowPalette", "Brave_LitTk2dCustomFalloffTintable", "Brave_LitTk2dCustomFalloffTintableTilted", "Brave_LitTk2dCustomFalloffTintableTiltedCutout", "Brave_LitTk2dCustomFalloffTintableTiltedCutoutEmissive", "Brave_LitTk2dCustomFalloffTintableTiltedEmissive", "Brave_LitTk2dPaletteFalloffTintableTilted", "Brave_MagicCircle", "Brave_MeduziWaterCaustics", "Brave_Particles_Additive", "Brave_PitCaustics", "Brave_PlayerPalettized", "Brave_PlayerShader", "Brave_PlayerShaderEevee", "Brave_PlayerShaderNoStencil", "Brave_ReflectionOnly", "Brave_SimpleTextureAlphaFade", "Brave_Special_Rat Blender", "Brave_TilemapClampCutout", "Brave_Tinted Multiply (Double)", "Brave_Unity Transparent Cutout", "Brave_UnlitTintableCutoutColorEmissive", "Brave_UnlitTintableCutoutEmissive", "Cloud_ShaderForge_ShadowCaster", "Cloud_ShaderForge_Standard", "Custom_AmmonomiconPageShader", "Custom_AmmonomiconTransitionPageShader", "Custom_Caster Renderer Foyer", "Custom_Caster Renderer", "Custom_Shadow_Distance Intense", "Custom_Shadow_Distance", "Kvant_Tunnel_Surface_02", "Sonic Ether_Particles_Additive", "tk2d_AdditiveVertexColor", "tk2d_BlendVertexColor", "tk2d_BlendVertexColorAlphaTintableTilted", "tk2d_BlendVertexColorAlphaTintableTiltedHigherQueue", "tk2d_BlendVertexColorFadeRange", "tk2d_BlendVertexColorTilted", "tk2d_BlendVertexColorTintable", "tk2d_BlendVertexColorTintableTilted", "tk2d_BlendVertexColorUnlitTilted", "tk2d_CutoutVertexColor", "tk2d_CutoutVertexColorTilted", "tk2d_CutoutVertexColorTiltedDistorting", "tk2d_CutoutVertexColorTiltedGonner", "tk2d_CutoutVertexColorTintable", "tk2d_CutoutVertexColorTintableTilted", "tk2d_LitBlendVertexColor", "tk2d_LitCutoutVertexColor", "tk2d_SpriteOutlineCutout" }; } public static class ItemHelper { public static PickupObject Get(Items i) { return PickupObjectDatabase.GetById((int)i); } } public class ExtendedColours { public static Color carrionRed = new Color(0.6901961f, 0.015686275f, 0.015686275f); public static Color pink = new Color(0.9490196f, 0.45490196f, 0.88235295f); public static Color paleYellow = new Color(0.9490196f, 14f / 15f, 0.5803922f); public static Color lime = new Color(37f / 85f, 84f / 85f, 1f / 85f); public static Color brown = new Color(0.47843137f, 0.2784314f, 0.0627451f); public static Color orange = new Color(0.9411765f, 32f / 51f, 0.08627451f); public static Color vibrantOrange = new Color(1f, 48f / 85f, 0.16078432f); public static Color purple = new Color(57f / 85f, 0.08627451f, 0.9411765f); public static Color skyblue = new Color(26f / 51f, 46f / 51f, 1f); public static Color honeyYellow = new Color(1f, 0.7058824f, 6f / 85f); public static Color maroon = new Color(0.4117647f, 0.02745098f, 3f / 85f); public static Color veryDarkRed = new Color(0.2784314f, 0.015686275f, 1f / 85f); public static Color plaguePurple = new Color(0.9490196f, 0.6313726f, 1f); public static Color darkBrown = new Color(0.2901961f, 0.08627451f, 1f / 51f); public static Color pastelPurple = new Color(31f / 85f, 0.29411766f, 76f / 85f); public static Color silver = new Color(64f / 85f, 64f / 85f, 64f / 85f); public static Color dodgerBlue = new Color(0.11764706f, 48f / 85f, 1f); } public class EasyTrailBullet : BraveBehaviour { public Texture _gradTexture; private Projectile proj; public Vector2 TrailPos; public Color BaseColor; public Color StartColor; public Color EndColor; public float LifeTime; public float StartWidth; public float EndWidth; public EasyTrailBullet() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) TrailPos = Vector2.op_Implicit(new Vector3(0f, 0f, 0f)); BaseColor = Color.red; StartColor = Color.red; EndColor = Color.white; LifeTime = 1f; StartWidth = 1f; EndWidth = 0f; } public void Start() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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) proj = ((BraveBehaviour)this).projectile; GameObject val = ETGMod.AddChild(((Component)((BraveBehaviour)this).projectile).gameObject, "trail object", new Type[0]); val.transform.position = ((BraveBehaviour)((BraveBehaviour)this).projectile).transform.position; val.transform.localPosition = Vector2.op_Implicit(TrailPos); TrailRenderer val2 = val.AddComponent(); ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val2).receiveShadows = false; Material val3 = new Material(Shader.Find("Sprites/Default")); val3.mainTexture = _gradTexture; ((Renderer)val2).material = val3; val2.minVertexDistance = 0.1f; val3.SetColor("_Color", BaseColor); val2.startColor = StartColor; val2.endColor = EndColor; val2.time = LifeTime; val2.startWidth = StartWidth; val2.endWidth = EndWidth; } } public class EasyTrailMisc : BraveBehaviour { public Texture _gradTexture; private GameObject gameobject; public Vector2 TrailPos; public Color BaseColor; public Color StartColor; public Color EndColor; public float LifeTime; public float StartWidth; public float EndWidth; public EasyTrailMisc() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) TrailPos = Vector2.op_Implicit(new Vector3(0f, 0f, 0f)); BaseColor = Color.red; StartColor = Color.red; EndColor = Color.white; LifeTime = 1f; StartWidth = 1f; EndWidth = 0f; } public void Start() { //IL_0031: 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_0048: 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_007a: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) gameobject = ((Component)this).gameObject; GameObject val = ETGMod.AddChild(((Component)this).gameObject, "trail object", new Type[0]); val.transform.position = ((BraveBehaviour)this).transform.position; val.transform.localPosition = Vector2.op_Implicit(TrailPos); TrailRenderer val2 = val.AddComponent(); ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val2).receiveShadows = false; Material val3 = new Material(Shader.Find("Sprites/Default")); val3.mainTexture = _gradTexture; ((Renderer)val2).material = val3; val2.minVertexDistance = 0.1f; val3.SetColor("_Color", BaseColor); val2.startColor = StartColor; val2.endColor = EndColor; val2.time = LifeTime; val2.startWidth = StartWidth; val2.endWidth = EndWidth; } } public class RicochetProjectileModule : BraveBehaviour { public HashSet visited = new HashSet(); public bool isRicocheting = false; public float ricochetDamageScale; public float ricochetSpeedScale; public int ricochetRange; public void Awake() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown SpeculativeRigidbody specRigidbody = ((BraveBehaviour)this).specRigidbody; specRigidbody.OnRigidbodyCollision = (OnRigidbodyCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody.OnRigidbodyCollision, (Delegate?)new OnRigidbodyCollisionDelegate(HasntPierced)); Projectile projectile = ((BraveBehaviour)this).projectile; projectile.OnHitEnemy = (Action)Delegate.Combine(projectile.OnHitEnemy, new Action(OnHitEnemy)); } public void HasntPierced(CollisionData data) { if (data != null && !((Object)(object)data.MyRigidbody == (Object)null) && (Object)(object)((BraveBehaviour)data.MyRigidbody).projectile != (Object)null) { ((BraveBehaviour)data.MyRigidbody).projectile.m_hasPierced = false; } } public void OnHitEnemy(Projectile proj, SpeculativeRigidbody enemy, bool fatal) { //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) if (!isRicocheting) { isRicocheting = true; ProjectileData baseData = proj.baseData; baseData.damage *= ricochetDamageScale; ProjectileData baseData2 = proj.baseData; baseData2.speed *= ricochetSpeedScale; proj.baseData.force = 0f; proj.baseData.range = 999f; proj.UpdateSpeed(); } if ((Object)(object)enemy == (Object)null) { return; } AIActor targetEnemy = null; if ((Object)(object)((BraveBehaviour)enemy).aiActor != (Object)null) { targetEnemy = ((BraveBehaviour)enemy).aiActor; } else { if (!((Object)(object)((Component)enemy).GetComponentInParent() != (Object)null)) { return; } targetEnemy = ((Component)enemy).GetComponentInParent(); } if (!((Object)(object)targetEnemy != (Object)null)) { return; } RicochetProjectileModule component = ((Component)proj).GetComponent(); if (!((Object)(object)((Component)proj).GetComponent() != (Object)null) || ((Component)proj).GetComponent().penetration <= 0 || targetEnemy.ParentRoom == null || targetEnemy.ParentRoom.GetActiveEnemies((ActiveEnemyType)0) == null) { return; } AIActor val = null; float num = ricochetRange * ricochetRange; List list = targetEnemy.ParentRoom.GetActiveEnemies((ActiveEnemyType)0).FindAll((AIActor x) => (Object)(object)x != (Object)null && (Object)(object)x != (Object)(object)targetEnemy && x.HasBeenEngaged && (Object)(object)((BraveBehaviour)x).healthHaver != (Object)null && ((BraveBehaviour)x).healthHaver.IsVulnerable); foreach (AIActor item in list) { if (!((Component)proj).GetComponent().visited.Contains(item) && item.IsNormalEnemy) { Vector2 val2 = ((GameActor)item).CenterPosition - ((GameActor)targetEnemy).CenterPosition; float sqrMagnitude = ((Vector2)(ref val2)).sqrMagnitude; if (sqrMagnitude < num) { val = item; num = sqrMagnitude; } } } if ((Object)(object)val != (Object)null) { Vector2 val3 = ((GameActor)val).CenterPosition - ((BraveBehaviour)proj).specRigidbody.UnitCenter; proj.SendInDirection(val3, false, true); component.visited.Add(((BraveBehaviour)enemy).aiActor); } else { proj.ForceDestruction(); } } } public class TrueWallPiercingRounds : MonoBehaviour { private PlayerController projOwner; private Projectile m_projectile; public bool isInWall = false; private void Start() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown m_projectile = ((Component)this).GetComponent(); if (m_projectile.Owner is PlayerController) { ref PlayerController reference = ref projOwner; GameActor owner = m_projectile.Owner; reference = (PlayerController)(object)((owner is PlayerController) ? owner : null); } SpeculativeRigidbody specRigidbody = ((BraveBehaviour)m_projectile).specRigidbody; m_projectile.BulletScriptSettings.surviveRigidbodyCollisions = true; m_projectile.BulletScriptSettings.surviveTileCollisions = true; m_projectile.pierceMinorBreakables = true; ((BraveBehaviour)m_projectile).specRigidbody.OnPreTileCollision = (OnPreTileCollisionDelegate)Delegate.Combine((Delegate?)(object)((BraveBehaviour)m_projectile).specRigidbody.OnPreTileCollision, (Delegate?)new OnPreTileCollisionDelegate(OnPreCollisionTile)); ((BraveBehaviour)m_projectile).specRigidbody.OnPreRigidbodyCollision = (OnPreRigidbodyCollisionDelegate)Delegate.Combine((Delegate?)(object)((BraveBehaviour)m_projectile).specRigidbody.OnPreRigidbodyCollision, (Delegate?)new OnPreRigidbodyCollisionDelegate(OnPreCollision)); } private void OnPreCollisionTile(SpeculativeRigidbody myRigidBody, PixelCollider myPixelCollider, Tile tile, PixelCollider tilePixelCollider) { PhysicsEngine.SkipCollision = true; isInWall = true; } private void OnPreCollision(SpeculativeRigidbody myRigidbody, PixelCollider myPixelCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherPixelCollider) { if (!Object.op_Implicit((Object)(object)((BraveBehaviour)otherRigidbody).aiActor) && !Object.op_Implicit((Object)(object)((BraveBehaviour)otherRigidbody).minorBreakable) && !Object.op_Implicit((Object)(object)((BraveBehaviour)otherRigidbody).projectile)) { PhysicsEngine.SkipCollision = true; } } private void Update() { keepTrackOfInWallState(); } private void keepTrackOfInWallState() { //IL_0036: 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) if (isInWall) { if (!((BraveBehaviour)m_projectile).specRigidbody.HasTriggerCollisions) { isInWall = false; } } else if (Vector3Extensions.GetAbsoluteRoom(m_projectile.LastPosition) != null && Vector3Extensions.GetAbsoluteRoom(m_projectile.LastPosition) != projOwner.CurrentRoom) { m_projectile.DieInAir(false, true, true, false); } } } public class VFXAnchorOnGunModule : MonoBehaviour { public Gun gun; public Vector3 offset; private void LateUpdate() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)gun != (Object)null) { ((Component)this).gameObject.transform.position = Vector2Extensions.ToVector3ZUp(((BraveBehaviour)gun).sprite.WorldCenter, 0f) + offset; ((tk2dBaseSprite)((Component)this).gameObject.GetComponent()).UpdateZDepth(); if ((Object)(object)gun.CurrentOwner == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } } public class VFXAnchorModule : MonoBehaviour { public AIActor anchorAIActor; public Vector3 offset; private void LateUpdate() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)anchorAIActor != (Object)null) { ((Component)this).gameObject.transform.position = Vector2Extensions.ToVector3ZUp(((BraveBehaviour)anchorAIActor).specRigidbody.UnitBottomCenter, 0f) + offset; ((tk2dBaseSprite)((Component)this).gameObject.GetComponent()).UpdateZDepth(); if (!((BraveBehaviour)anchorAIActor).healthHaver.IsAlive) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } } public static class HelpfulMethods { [CompilerGenerated] private sealed class d__3 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public EmitRegionStyle emitStyle; public float numPerSecond; public float duration; public PlayerController player; public float angleVariance; public float magnitudeVariance; public float? startSize; public float? startLifetime; public Color? startColor; public SparksType systemType; private float 5__1; private float 5__2; private int 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0f; 5__2 = 0f; break; case 1: <>1__state = -1; break; } if (5__1 < duration) { 5__1 += BraveTime.DeltaTime; 5__2 += numPerSecond * BraveTime.DeltaTime; if (5__2 > 1f) { 5__3 = Mathf.FloorToInt(5__2); DoRandomParticleBurst(5__3, Vector2Extensions.ToVector3ZUp(((BraveBehaviour)player).sprite.WorldBottomLeft, 0f), Vector2Extensions.ToVector3ZUp(((BraveBehaviour)player).sprite.WorldTopRight, 0f), angleVariance, magnitudeVariance, startSize, startLifetime, startColor, systemType); } 5__2 %= 1f; <>2__current = null; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__11 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerController player; public int count; public float spawnDelay; public bool randSpawn; public float randRatio; public bool playSFX; public List SFXList; private float 5__1; private int 5__2; private Vector3 5__3; private float 5__4; private Vector2 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = spawnDelay; 5__2 = 0; goto IL_0178; case 1: <>1__state = -1; 5__2++; goto IL_0178; case 2: { <>1__state = -1; return false; } IL_0178: if (5__2 < count) { 5__3 = Vector2.op_Implicit(((BraveBehaviour)player).specRigidbody.UnitDimensions); 5__4 = (5__3.x + 5__3.y) / 2f; 5__5 = Vector2.op_Implicit(new Vector3(5__4 * Random.Range(-3f, 3f), 5__4 * Random.Range(-3f, 3f) + -1f)); LootEngine.SpawnCurrency(((BraveBehaviour)player).specRigidbody.UnitBottomCenter + 5__5, 1, false); if (playSFX) { PlayRandomSFX(((Component)player).gameObject, SFXList); } if (randSpawn) { 5__1 = spawnDelay * Random.Range(1f - randRatio, 1f + randRatio); } <>2__current = (object)new WaitForSeconds(5__1); <>1__state = 1; return true; } <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__12 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerController player; public int count; public float spawnDelay; public bool randSpawn; public float randRatio; public bool playSFX; public List SFXList; public int casingValue; private float 5__1; private int 5__2; private Vector3 5__3; private float 5__4; private Vector2 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = spawnDelay; 5__2 = 0; goto IL_019c; case 1: <>1__state = -1; 5__2++; goto IL_019c; case 2: { <>1__state = -1; return false; } IL_019c: if (5__2 < count) { 5__3 = Vector2.op_Implicit(((BraveBehaviour)player).specRigidbody.UnitDimensions); 5__4 = (5__3.x + 5__3.y) / 2f; 5__5 = RandomPointInDonut(Vector2.zero, 5__4 * 3f, 5__4 * 5f, 1.3f); 5__5.y -= 0.5f; LootEngine.SpawnCurrency(((BraveBehaviour)player).specRigidbody.UnitBottomCenter + 5__5, casingValue, false); if (playSFX && SFXList != null && SFXList.Count > 0) { PlayRandomSFX(((Component)player).gameObject, SFXList); } if (randSpawn) { 5__1 = spawnDelay * Random.Range(1f - randRatio, 1f + randRatio); } <>2__current = (object)new WaitForSeconds(5__1); <>1__state = 1; return true; } <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static string[,] FloorNames = new string[10, 2] { { "tt_castle", "Keep of the Lead Lord / Floor 1" }, { "tt_sewer", "Oubliette / Floor 1.5" }, { "tt5", "Gungeon Proper / Floor 2" }, { "tt_cathedral", "Abbey of the True Gun / Floor 2.5" }, { "tt_mines", "Black Powder Mine / Floor 3" }, { "ss_resourcefulrat", "Resourceful Rat's Lair / Floor 3.5" }, { "tt_catacombs", "Hollow / Floor 4" }, { "tt_nakatomi", "R&G Dept / Floor 4.5" }, { "tt_forge", "Forge / Floor 5" }, { "tt_bullethell", "Bullet Hell / Floor 6" } }; public static float GetFloorDamageScale() { return GameManager.Instance.GetLastLoadedLevelDefinition().dungeonSceneName switch { "tt_castle" => 1f, "tt_sewer" => 1.25f, "tt5" => 1.25f, "tt_cathedral" => 1.5f, "tt_mines" => 1.5f, "ss_resourcefulrat" => 1.75f, "tt_catacombs" => 1.75f, "tt_nakatomi" => 2f, "tt_forge" => 2f, "tt_bullethell" => 2.25f, _ => 0f, }; } public static void DoRandomParticleBurst(int num, Vector3 minPosition, Vector3 maxPosition, float angleVariance, float magnitudeVariance, float? startSize = null, float? startLifetime = null, Color? startColor = null, SparksType systemType = 0) { //IL_000e: 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_0018: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = default(Vector3); for (int i = 0; i < num; i++) { Vector3 val = Vector2.op_Implicit(MathsAndLogicHelper.DegreeToVector2(BraveUtility.RandomAngle())); ((Vector3)(ref val2))..ctor(Random.Range(minPosition.x, maxPosition.x), Random.Range(minPosition.y, maxPosition.y), Random.Range(minPosition.z, maxPosition.z)); Vector3 val3 = Quaternion.Euler(0f, 0f, Random.Range(0f - angleVariance, angleVariance)) * (((Vector3)(ref val)).normalized * Random.Range(((Vector3)(ref val)).magnitude - magnitudeVariance, ((Vector3)(ref val)).magnitude + magnitudeVariance)); GlobalSparksDoer.DoSingleParticle(val2, val3, startSize, startLifetime, startColor, systemType); } } public static void EmitFromAttachedPlayer(EmitRegionStyle emitStyle, float numPerSecond, float duration, PlayerController player, float angleVariance, float magnitudeVariance, float? startSize = null, float? startLifetime = null, Color? startColor = null, SparksType systemType = 0) { //IL_0006: 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) ((MonoBehaviour)GameUIRoot.Instance).StartCoroutine(HandleEmitFromAttachedPlayer(emitStyle, numPerSecond, duration, player, angleVariance, magnitudeVariance, startSize, startLifetime, startColor, systemType)); } public static IEnumerator HandleEmitFromAttachedPlayer(EmitRegionStyle emitStyle, float numPerSecond, float duration, PlayerController player, float angleVariance, float magnitudeVariance, float? startSize = null, float? startLifetime = null, Color? startColor = null, SparksType systemType = 0) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { emitStyle = emitStyle, numPerSecond = numPerSecond, duration = duration, player = player, angleVariance = angleVariance, magnitudeVariance = magnitudeVariance, startSize = startSize, startLifetime = startLifetime, startColor = startColor, systemType = systemType }; } public static float GetFloorPriceMod() { return GameManager.Instance.GetLastLoadedLevelDefinition().priceMultiplier; } public static void PlayRandomSFX(GameObject gameObject, string[] sfxList) { Random random = new Random(); int num = random.Next(sfxList.Length); string text = sfxList[num]; AkSoundEngine.PostEvent(text, gameObject); } public static void PlayRandomSFX(GameObject gameObject, List sfxList) { Random random = new Random(); int index = random.Next(sfxList.Count); string text = sfxList[index]; AkSoundEngine.PostEvent(text, gameObject); } public static float GetFloorValue() { string dungeonSceneName = GameManager.Instance.GetLastLoadedLevelDefinition().dungeonSceneName; for (int i = 0; i < FloorNames.GetLength(0); i++) { string text = FloorNames[i, 0]; if (dungeonSceneName == text) { return text switch { "tt_castle" => 1f, "tt_sewer" => 1.5f, "tt5" => 2f, "tt_cathedral" => 2.5f, "tt_mines" => 3f, "ss_resourcefulrat" => 3.5f, "tt_catacombs" => 4f, "tt_nakatomi" => 4.5f, "tt_forge" => 5f, "tt_bullethell" => 6f, _ => 0f, }; } } return 0f; } public static List GetResourceFrames(this string baseString, int length) { List list = new List(length); for (int i = 1; i <= length; i++) { list.Add($"{baseString}_{i:D3}"); } return list; } public static void CustomNotification(string header, string text, tk2dBaseSprite sprite = null, NotificationColor? color = null) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (sprite == null) { sprite = GameUIRoot.Instance.notificationController.notificationObjectSprite; } GameUIRoot.Instance.notificationController.DoCustomNotification(header, text, sprite.Collection, sprite.spriteId, color.GetValueOrDefault((NotificationColor)2), false, false); } public static IEnumerator SpawnMoney(PlayerController player, int count, float spawnDelay, bool randSpawn = false, float randRatio = 0f, bool playSFX = false, List SFXList = null) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { player = player, count = count, spawnDelay = spawnDelay, randSpawn = randSpawn, randRatio = randRatio, playSFX = playSFX, SFXList = SFXList }; } public static IEnumerator SpawnMoneyInDonut(PlayerController player, int count, float spawnDelay, bool randSpawn = false, float randRatio = 0f, bool playSFX = false, List SFXList = null, int casingValue = 1) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { player = player, count = count, spawnDelay = spawnDelay, randSpawn = randSpawn, randRatio = randRatio, playSFX = playSFX, SFXList = SFXList, casingValue = casingValue }; } public static Vector2 RandomPointInDonut(Vector2 center, float innerRadius, float outerRadius, float xStretch = 1f, float yStretch = 1f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) float num = Random.Range(0f, (float)Math.PI * 2f); float num2 = Mathf.Sqrt(Random.value); float num3 = innerRadius + num2 * (outerRadius - innerRadius); return center + new Vector2(num3 * xStretch * Mathf.Cos(num), num3 * yStretch * Mathf.Sin(num)); } public static void RestorePercentAmmo(PlayerController source, float ammoRestorePercent) { for (int i = 0; i < source.inventory.AllGuns.Count; i++) { Gun val = source.inventory.AllGuns[i]; if (!val.InfiniteAmmo && val.CanGainAmmo) { int num = Mathf.CeilToInt((float)val.AdjustedMaxAmmo * ammoRestorePercent); val.GainAmmo(num); } } } public static void AddItemToSynergy(this PickupObject obj, CustomSynergyType type) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) AddItemToSynergy(type, obj.PickupObjectId); } public static void AddItemToSynergy(CustomSynergyType type, int id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) AdvancedSynergyEntry[] synergies = GameManager.Instance.SynergyManager.synergies; foreach (AdvancedSynergyEntry val in synergies) { if (!val.bonusSynergies.Contains(type) || !((Object)(object)PickupObjectDatabase.GetById(id) != (Object)null)) { continue; } PickupObject byId = PickupObjectDatabase.GetById(id); if (byId is Gun) { if (val.OptionalGunIDs != null) { val.OptionalGunIDs.Add(id); continue; } val.OptionalGunIDs = new List { id }; } else if (val.OptionalItemIDs != null) { val.OptionalItemIDs.Add(id); } else { val.OptionalItemIDs = new List { id }; } } } } public static class VFXPlayerCOTL { [CompilerGenerated] private sealed class d__15 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerController player; private List 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Expected O, but got Unknown //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Expected O, but got Unknown //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Expected O, but got Unknown //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Expected O, but got Unknown //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = new List { "pop_1", "pop_2", "pop_3", "pop_4", "pop_5", "pop_6", "pop_7" }; <>2__current = (object)new WaitForSeconds(2f / 3f); <>1__state = 1; return true; case 1: <>1__state = -1; HelpfulMethods.PlayRandomSFX(((Component)player).gameObject, 5__1); <>2__current = (object)new WaitForSeconds(1f / 15f); <>1__state = 2; return true; case 2: <>1__state = -1; HelpfulMethods.PlayRandomSFX(((Component)player).gameObject, 5__1); <>2__current = (object)new WaitForSeconds(0.4666667f); <>1__state = 3; return true; case 3: <>1__state = -1; HelpfulMethods.PlayRandomSFX(((Component)player).gameObject, 5__1); <>2__current = (object)new WaitForSeconds(4f / 15f); <>1__state = 4; return true; case 4: <>1__state = -1; HelpfulMethods.PlayRandomSFX(((Component)player).gameObject, 5__1); <>2__current = (object)new WaitForSeconds(0.20000002f); <>1__state = 5; return true; case 5: <>1__state = -1; HelpfulMethods.PlayRandomSFX(((Component)player).gameObject, 5__1); <>2__current = (object)new WaitForSeconds(4f / 15f); <>1__state = 6; return true; case 6: <>1__state = -1; HelpfulMethods.PlayRandomSFX(((Component)player).gameObject, 5__1); <>2__current = (object)new WaitForSeconds(0.20000002f); <>1__state = 7; return true; case 7: <>1__state = -1; HelpfulMethods.PlayRandomSFX(((Component)player).gameObject, 5__1); <>2__current = (object)new WaitForSeconds(8f / 15f); <>1__state = 8; return true; case 8: <>1__state = -1; HelpfulMethods.PlayRandomSFX(((Component)player).gameObject, 5__1); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static List DoctrineVFXSpritePath = new List { "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_001", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_002", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_003", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_004", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_005", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_006", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_007", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_008", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_009", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_010", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_011", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_012", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_013", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_014", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_015", "GungeonCOTL/Resources/vfxs/doctrine_vfx/commandment_aura_016", "GungeonCOTL/Resources/one_off_sprites/blank_sprite" }; private static GameObject DoctrineEffectVFX = VFXBuilder.CreateVFX("doctrine_vfx", DoctrineVFXSpritePath, 11, new IntVector2(0, 0), (Anchor)4, false, 0f, -1f, (Color?)Color.cyan, (WrapMode)2, true); private static List RedCrownVFXSpritePath = new List { "GungeonCOTL/Resources/vfxs/red_crown_activation_vfx/blackfire_aura_001", "GungeonCOTL/Resources/vfxs/red_crown_activation_vfx/blackfire_aura_002", "GungeonCOTL/Resources/vfxs/red_crown_activation_vfx/blackfire_aura_003", "GungeonCOTL/Resources/vfxs/red_crown_activation_vfx/blackfire_aura_004", "GungeonCOTL/Resources/vfxs/red_crown_activation_vfx/blackfire_aura_005", "GungeonCOTL/Resources/vfxs/red_crown_activation_vfx/blackfire_aura_006", "GungeonCOTL/Resources/vfxs/red_crown_activation_vfx/blackfire_aura_007", "GungeonCOTL/Resources/vfxs/red_crown_activation_vfx/blackfire_aura_008", "GungeonCOTL/Resources/vfxs/red_crown_activation_vfx/blackfire_aura_009", "GungeonCOTL/Resources/vfxs/red_crown_activation_vfx/blackfire_aura_010", "GungeonCOTL/Resources/vfxs/red_crown_activation_vfx/blackfire_aura_011", "GungeonCOTL/Resources/vfxs/red_crown_activation_vfx/blackfire_aura_012" }; private static GameObject RedCrownEffectVFX = VFXBuilder.CreateVFX("red_crown_activation_vfx", RedCrownVFXSpritePath, 8, new IntVector2(0, 0), (Anchor)4, false, 0f, -1f, (Color?)Color.cyan, (WrapMode)0, true); private static List BlackfireVFXSpritePath = "GungeonCOTL/Resources/vfxs/blackfire_fadeaway_vfx/blackfire_aura".GetResourceFrames(41); private static GameObject BlackfireEffectVFX = VFXBuilder.CreateVFX("blackfire_fadeaway_vfx", BlackfireVFXSpritePath, 8, new IntVector2(0, 0), (Anchor)4, false, 0f, -1f, (Color?)Color.cyan, (WrapMode)2, true); private static List RitualActivationVFXSpritePath = "GungeonCOTL/Resources/vfxs/ritual_activation_vfx/pentacle_aura".GetResourceFrames(71); private static GameObject RitualActivationEffectVFX = VFXBuilder.CreateVFX("ritual_activation_vfx", RitualActivationVFXSpritePath, 15, new IntVector2(0, 0), (Anchor)4, false, 0f, -1f, (Color?)Color.cyan, (WrapMode)2, true); private static List CrownUpgradeVFXSpritePath = "GungeonCOTL/Resources/vfxs/crown_upgrade_vfx/upgrade_aura".GetResourceFrames(45); private static GameObject CrownUpgradeEffectVFX = VFXBuilder.CreateVFX("crown_upgrade_vfx", CrownUpgradeVFXSpritePath, 15, new IntVector2(0, 0), (Anchor)4, false, 0f, -1f, (Color?)Color.cyan, (WrapMode)2, true); private static List SacrificeEventVFXSpritePath = "GungeonCOTL/Resources/vfxs/sacrifice_event_vfx/sacrifice_aura".GetResourceFrames(21); private static GameObject SacrificeEventEffectVFX = VFXBuilder.CreateVFX("sacrifice_event_vfx", SacrificeEventVFXSpritePath, 15, new IntVector2(0, 0), (Anchor)4, false, 0f, -1f, (Color?)Color.cyan, (WrapMode)0, true); private static List DarknessWithinActivationVFXSpritePath = "GungeonCOTL/Resources/vfxs/darkness_within_activation_vfx/smokeBurstSmall".GetResourceFrames(11); public static GameObject DarknessWithinActivationEffectVFX = VFXBuilder.CreateVFX("darkness_within_activation_effect_vfx", DarknessWithinActivationVFXSpritePath, 15, new IntVector2(0, 0), (Anchor)4, false, 0f, -1f, (Color?)Color.cyan, (WrapMode)2, true); public static GameObject PlayDoctrineEffectOnActor(PlayerController player, bool attached = true, bool alreadyMiddleCenter = false, bool useHitbox = false) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(1.25f, 2.75f, 0f); GameObject val2 = ((GameActor)player).PlayEffectOnActor(DoctrineEffectVFX, val, attached, alreadyMiddleCenter, useHitbox); tk2dSprite component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { ((tk2dBaseSprite)component).HeightOffGround = 1f; ((tk2dBaseSprite)component).UpdateZDepth(); } return val2; } public static GameObject PlayRedCrownEffectOnActor(PlayerController player, bool attached = true, bool alreadyMiddleCenter = false, bool useHitbox = false) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0.6875f, 2.25f, 0f); GameObject val2 = ((GameActor)player).PlayEffectOnActor(RedCrownEffectVFX, val, attached, alreadyMiddleCenter, useHitbox); tk2dSprite component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { ((tk2dBaseSprite)component).HeightOffGround = -3f; ((tk2dBaseSprite)component).UpdateZDepth(); ((tk2dBaseSprite)component).usesOverrideMaterial = true; ((BraveBehaviour)component).renderer.material.shader = ShaderCache.Acquire("Brave/Internal/SimpleAlphaFadeUnlit"); ((BraveBehaviour)component).renderer.material.SetFloat("_Fade", 0.7f); } return val2; } public static GameObject PlayBlackfireEffectOnActor(PlayerController player, bool attached = true, bool alreadyMiddleCenter = false, bool useHitbox = false) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0.6875f, 2.25f, 0f); GameObject val2 = ((GameActor)player).PlayEffectOnActor(BlackfireEffectVFX, val, attached, alreadyMiddleCenter, useHitbox); tk2dSprite component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { ((tk2dBaseSprite)component).HeightOffGround = -3f; ((tk2dBaseSprite)component).UpdateZDepth(); ((tk2dBaseSprite)component).usesOverrideMaterial = true; ((BraveBehaviour)component).renderer.material.shader = ShaderCache.Acquire("Brave/Internal/SimpleAlphaFadeUnlit"); ((BraveBehaviour)component).renderer.material.SetFloat("_Fade", 0.85f); } return val2; } public static GameObject PlayRitualActivationEffectOnActor(PlayerController player, bool attached = true, bool alreadyMiddleCenter = false, bool useHitbox = false) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) AkSoundEngine.PostEvent("pentacle_synced_audio", ((Component)player).gameObject); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(1.125f, 1.75f, 0f); GameObject val2 = ((GameActor)player).PlayEffectOnActor(RitualActivationEffectVFX, val, attached, alreadyMiddleCenter, useHitbox); tk2dSprite component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { ((tk2dBaseSprite)component).HeightOffGround = 2f; ((tk2dBaseSprite)component).UpdateZDepth(); } return val2; } public static GameObject PlayCrownUpgradeEffectOnActor(PlayerController player, bool attached = true, bool alreadyMiddleCenter = false, bool useHitbox = false) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(4f, 3.75f, 0f); GameObject val2 = ((GameActor)player).PlayEffectOnActor(CrownUpgradeEffectVFX, val, attached, alreadyMiddleCenter, useHitbox); tk2dSprite component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { ((tk2dBaseSprite)component).HeightOffGround = 2f; ((tk2dBaseSprite)component).UpdateZDepth(); } return val2; } public static IEnumerator HardCodedCrownUpgradeEffectSFXPlayer(PlayerController player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0) { player = player }; } public static GameObject PlaySacrificeEventEffectOnActor(PlayerController player, bool attached = true, bool alreadyMiddleCenter = false, bool useHitbox = false) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(2f, 2f, -2f); GameObject val2 = ((GameActor)player).PlayEffectOnActor(SacrificeEventEffectVFX, val, attached, alreadyMiddleCenter, useHitbox); tk2dSprite component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { ((tk2dBaseSprite)component).HeightOffGround = -2f; ((tk2dBaseSprite)component).UpdateZDepth(); } return val2; } public static GameObject PlaySacrificeEventEffectOnGun(Gun gun) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_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_008a: 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) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 0f, -2f); GameObject val2 = Object.Instantiate(SacrificeEventEffectVFX, Vector2Extensions.ToVector3ZUp(((BraveBehaviour)gun).sprite.WorldCenter, 0f) + val, Quaternion.identity); tk2dSprite component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { ((tk2dBaseSprite)component).HeightOffGround = -2f; ((tk2dBaseSprite)component).UpdateZDepth(); } VFXAnchorOnGunModule vFXAnchorOnGunModule = val2.AddComponent(); vFXAnchorOnGunModule.gun = gun; vFXAnchorOnGunModule.offset = val + new Vector3(0f, 0f); return val2; } public static GameObject PlayDarknessWithinActivationEffectOnActor(PlayerController player, bool attached = true, bool alreadyMiddleCenter = false, bool useHitbox = false) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 0f, 0f); GameObject val2 = ((GameActor)player).PlayEffectOnActor(DarknessWithinActivationEffectVFX, val, attached, alreadyMiddleCenter, useHitbox); tk2dSprite component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { ((tk2dBaseSprite)component).HeightOffGround = 2f; ((tk2dBaseSprite)component).UpdateZDepth(); } return val2; } } } namespace GungeonCOTL.active_items { internal class debugItem : PlayerItem { [CompilerGenerated] private sealed class d__13 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public List items; public debugItem <>4__this; private int 5__1; private int 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; Plugin.Log("handle rainbow run loot processing"); break; case 1: <>1__state = -1; break; } Plugin.Log("looping rainbow loot"); 5__1 = 0; while (5__1 < items.Count) { if (!Object.op_Implicit((Object)(object)items[5__1])) { 5__2 = 0; while (5__2 < items.Count) { if (5__1 != 5__2) { LootEngine.DoDefaultItemPoof(Vector2.op_Implicit(((BraveBehaviour)items[5__2]).transform.position), false, true); Object.Destroy((Object)(object)((Component)items[5__2]).gameObject); } 5__2++; } if (Object.op_Implicit((Object)(object)<>4__this)) { LootEngine.SpawnBowlerNote(GameManager.Instance.RewardManager.BowlerNotePostRainbow, <>4__this.choicesSpawnLocation + new Vector2(1f, 1.5f), Vector3Extensions.GetAbsoluteRoom(<>4__this.choicesSpawnLocation), true); } return false; } 5__1++; } <>2__current = null; <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public debugItem <>4__this; private bool 5__1; private List 5__2; private List 5__3; private Vector3 5__4; private Bounds 5__5; private float 5__6; private float 5__7; private int 5__8; private PickupObject 5__9; private tk2dSprite 5__10; private GameObject 5__11; private Transform 5__12; private Vector3 5__13; private tk2dSprite 5__14; private NotePassiveItem 5__15; private float 5__16; private float 5__17; private float 5__18; private int 5__19; private float 5__20; private Vector3 5__21; private int 5__22; private float 5__23; private Vector3 5__24; private float 5__25; private Vector2 5__26; private Vector3 5__27; private int 5__28; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; 5__9 = null; 5__10 = null; 5__11 = null; 5__12 = null; 5__14 = null; 5__15 = null; <>1__state = -2; } private bool MoveNext() { //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_0073: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_0599: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05ea: Unknown result type (might be due to invalid IL or missing references) //IL_05cd: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = true; 5__2 = new List(); 5__3 = new List(); 5__4 = Vector3.zero; if (5__1) { 5__5 = ((BraveBehaviour)<>4__this).sprite.GetBounds(); 5__4 = ((BraveBehaviour)<>4__this).transform.position + ((Bounds)(ref 5__5)).extents; 5__8 = 0; while (5__8 < <>4__this.choices.Count) { 5__9 = <>4__this.choices[5__8]; 5__10 = ((Component)5__9).GetComponent(); if ((Object)(object)5__10 == (Object)null) { 5__10 = ((Component)5__9).GetComponentInChildren(); } 5__11 = new GameObject("VFX_Chest_Item"); 5__12 = 5__11.transform; 5__13 = Vector3.zero; if ((Object)(object)5__10 != (Object)null) { 5__14 = tk2dSprite.AddComponent(5__11, ((tk2dBaseSprite)5__10).Collection, ((tk2dBaseSprite)5__10).spriteId); ((tk2dBaseSprite)5__14).HeightOffGround = 2f; 5__15 = ((Component)5__10).GetComponent(); if ((Object)(object)5__15 != (Object)null && 5__15.ResourcefulRatNoteIdentifier >= 0) { ((tk2dBaseSprite)5__14).SetSprite(5__15.GetAppropriateSpriteName(false)); } SpriteOutlineManager.AddOutlineToSprite((tk2dBaseSprite)(object)5__14, Color.white, 0.5f, 0f, (OutlineType)0); Bounds bounds = ((tk2dBaseSprite)5__11.GetComponent()).GetBounds(); 5__13 = -BraveUtility.QuantizeVector(((Bounds)(ref bounds)).extents); ((tk2dBaseSprite)5__14).UpdateZDepth(); 5__14 = null; 5__15 = null; } 5__12.position = 5__4 + 5__13; 5__2.Add(5__12); 5__3.Add(5__13); 5__9 = null; 5__10 = null; 5__11 = null; 5__12 = null; 5__8++; } 5__6 = 1f; 5__7 = 0f; goto IL_063d; } goto IL_0655; case 1: <>1__state = -1; goto IL_063d; case 2: { <>1__state = -1; 5__28 = 0; while (5__28 < 5__2.Count) { Plugin.Log("destroying items?"); Object.Destroy((Object)(object)((Component)5__2[5__28]).gameObject); 5__28++; } return false; } IL_0655: <>4__this.SpewChoicesOntoGround(5__2); <>2__current = null; <>1__state = 2; return true; IL_063d: if (5__7 < 5__6) { 5__7 += BraveTime.DeltaTime * 1.5f; 5__16 = Mathf.Clamp01(5__7 / 5__6); 5__17 = <>4__this.spawnCurve.Evaluate(5__16); 5__18 = Mathf.SmoothStep(0f, 1f, 5__16); if (5__2.Count <= 4) { 5__19 = 0; while (5__19 < 5__2.Count) { 5__20 = ((5__2.Count != 1) ? (-1f + 2f / (float)(5__2.Count - 1) * (float)5__19) : 0f); 5__20 = 5__20 * ((float)5__2.Count / 2f) * 1f; 5__21 = 5__4 + 5__3[5__19] + new Vector3(Mathf.Lerp(0f, 5__20, 5__18), 5__17, -2.5f); if (<>4__this.CheckPresentedItemTheoreticalPosition(5__21, 5__3[5__19])) { 5__21 = 5__2[5__19].position; } 5__2[5__19].position = 5__21; 5__19++; } } else { 5__22 = 0; while (5__22 < 5__2.Count) { 5__23 = 360f / (float)5__2.Count; 5__24 = Quaternion.Euler(0f, 0f, 5__23 * (float)5__22) * Vector3.right; 5__25 = 3f; Vector2 val = Vector3Extensions.XY(5__24); 5__26 = ((Vector2)(ref val)).normalized * 5__25; 5__27 = 5__4 + 5__3[5__22] + new Vector3(0f, 5__17, -2.5f) + Vector2Extensions.ToVector3ZUp(Vector2.Lerp(Vector2.zero, 5__26, 5__18), 0f); if (<>4__this.CheckPresentedItemTheoreticalPosition(5__27, 5__3[5__22])) { 5__27 = 5__2[5__22].position; } 5__2[5__22].position = 5__27; 5__22++; } } <>2__current = null; <>1__state = 1; return true; } goto IL_0655; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public List choices = new List { PickupObjectDatabase.GetById(CrownUpgradeResurrection.ID), PickupObjectDatabase.GetById(CrownUpgradeDarknessWithin.ID) }; public AnimationCurve spawnCurve = new AnimationCurve(); public Vector2 choicesSpawnLocation; public static int ID; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) string text = "Debug Item"; string text2 = "GungeonCOTL/Resources/example_item_sprite"; GameObject val = new GameObject(text); debugItem debugItem2 = val.AddComponent(); ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null); string text3 = "idk"; string text4 = "idk"; ItemBuilder.SetupItem((PickupObject)(object)debugItem2, text3, text4, "gungeoncotl"); ItemBuilder.SetCooldownType((PlayerItem)(object)debugItem2, (CooldownType)0, 1f); ((PlayerItem)debugItem2).consumable = false; ((PlayerItem)debugItem2).usableDuringDodgeRoll = true; ((PickupObject)debugItem2).quality = (ItemQuality)(-100); ((PickupObject)debugItem2).CanBeDropped = false; ID = ((PickupObject)debugItem2).PickupObjectId; } public override void Pickup(PlayerController player) { ((PlayerItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public DebrisObject Drop(PlayerController player) { Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); return ((PlayerItem)this).Drop(player, 4f); } public override void DoEffect(PlayerController player) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) choicesSpawnLocation = ((GameActor)player).CenterPosition; float statValue = player.stats.GetStatValue((StatType)14); float baseStatValue = player.stats.GetBaseStatValue((StatType)14); Plugin.Log($"curse stat: {statValue} | base curse stat:{baseStatValue}"); StatModifier item = StatModifier.Create((StatType)14, (ModifyMethod)0, 1.3f); player.ownerlessStatModifiers.Add(item); Plugin.Log($"curse stat: {statValue} | base curse stat:{baseStatValue}"); } private IEnumerator PresentItem() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this }; } private void SpewChoicesOntoGround(List spawnTransforms) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) Plugin.Log("spew choices onto ground"); List list = new List(); for (int i = 0; i < choices.Count; i++) { List list2 = new List(); list2.Add(((Component)choices[i]).gameObject); List list3 = LootEngine.SpewLoot(list2, spawnTransforms[i].position); list.AddRange(list3); for (int j = 0; j < list3.Count; j++) { if (Object.op_Implicit((Object)(object)list3[j])) { list3[j].PreventFallingInPits = true; } if (!((Object)(object)((Component)list3[j]).GetComponent() != (Object)null) && !((Object)(object)((Component)list3[j]).GetComponent() != (Object)null) && (Object)(object)((BraveBehaviour)list3[j]).specRigidbody != (Object)null) { ((BraveBehaviour)list3[j]).specRigidbody.CollideWithOthers = false; DebrisObject val = list3[j]; val.OnTouchedGround = (Action)Delegate.Combine(val.OnTouchedGround, new Action(BecomeViableItem)); } } } if (Vector3Extensions.GetAbsoluteRoom(choicesSpawnLocation) == GameManager.Instance.Dungeon.data.Entrance) { ((MonoBehaviour)GameManager.Instance.Dungeon).StartCoroutine(HandleRainbowRunLootProcessing(list)); } } private bool CheckPresentedItemTheoreticalPosition(Vector3 targetPosition, Vector3 objectOffset) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) Vector3 pos = targetPosition - new Vector3(objectOffset.x * 2f, 0f, 0f); Vector3 pos2 = targetPosition - new Vector3(0f, objectOffset.y * 2f, 0f); Vector3 pos3 = targetPosition - new Vector3(objectOffset.x * 2f, objectOffset.y * 2f, 0f); if (!CheckCellValidForItemSpawn(targetPosition) || !CheckCellValidForItemSpawn(pos) || !CheckCellValidForItemSpawn(pos2) || !CheckCellValidForItemSpawn(pos3)) { return true; } return false; } private bool CheckCellValidForItemSpawn(Vector3 pos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) IntVector2 val = Vector3Extensions.IntXY(pos, (VectorConversions)0); Dungeon dungeon = GameManager.Instance.Dungeon; if (!dungeon.data.CheckInBoundsAndValid(val) || dungeon.CellIsPit(pos) || dungeon.data.isTopWall(val.x, val.y)) { return false; } if (dungeon.data.isWall(val.x, val.y) && !dungeon.data.isFaceWallLower(val.x, val.y)) { return false; } return true; } protected void BecomeViableItem(DebrisObject debris) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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) Plugin.Log("become viable item"); debris.OnTouchedGround = (Action)Delegate.Remove(debris.OnTouchedGround, new Action(BecomeViableItem)); debris.OnGrounded = (Action)Delegate.Remove(debris.OnGrounded, new Action(BecomeViableItem)); ((BraveBehaviour)debris).specRigidbody.CollideWithOthers = true; Vector2 val = Vector2.zero; val = ((BraveBehaviour)debris).sprite.WorldCenter - choicesSpawnLocation; debris.ClearVelocity(); debris.ApplyVelocity(((Vector2)(ref val)).normalized * 2f); } private IEnumerator HandleRainbowRunLootProcessing(List items) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { <>4__this = this, items = items }; } } internal class AscendGunRitual : PlayerItem { public static string ItemName = "Ascend Gun Ritual"; private static float DamageStat = 1.15f; private static float RateOfFireStat = 1.15f; private static float ReloadStat = 0.75f; private static float Accuracy = 0.75f; private static float ProjectileSpeedStat = 1.5f; private static float ClipAndAmmoCapacityStat = 1.2f; private static float ChargeAmountStat = 1.5f; private static float RangeMultiplier = 1.2f; private GameObject activeVFXObject; public static int ID; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/active_item_sprites/ascend_gun_ritual_alt_pixelart_sprite"; GameObject val = new GameObject(itemName); AscendGunRitual ascendGunRitual = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "Bestow Divine Power"; string text3 = "Upgrades your current weapon with various buffs\n\nAscends a weapon to the heavens, granting it divine strength and knowledge. No matter how much you pry, the weapon will never tell you what knowledge it received.\n\nInitial item use starts the ritual. Press the item use button again while holding the weapon you wish to select. If you try to activate the ritual on a starter weapon, it will cancel the ritual without being consumed.\n"; ItemBuilder.SetupItem((PickupObject)(object)ascendGunRitual, text2, text3, "gungeoncotl"); ItemBuilder.SetCooldownType((PlayerItem)(object)ascendGunRitual, (CooldownType)3, 100f); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)ascendGunRitual, (StatType)8, 1f, (ModifyMethod)0); ((PlayerItem)ascendGunRitual).consumable = false; ((PlayerItem)ascendGunRitual).consumableOnActiveUse = false; ((PlayerItem)ascendGunRitual).usableDuringDodgeRoll = false; ((PickupObject)ascendGunRitual).quality = (ItemQuality)(-50); ((PickupObject)ascendGunRitual).CanBeDropped = false; ID = ((PickupObject)ascendGunRitual).PickupObjectId; } public override void Pickup(PlayerController player) { if (!base.m_pickedUpThisRun) { if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } AkSoundEngine.PostEvent("ritual_pickup", ((Component)player).gameObject); activeVFXObject = VFXPlayerCOTL.PlayRitualActivationEffectOnActor(player); } ((PlayerItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); player.GunChanged += ReattachSacrificeVFX; player.OnNewFloorLoaded = (Action)Delegate.Combine(player.OnNewFloorLoaded, new Action(ResetRitual)); } public DebrisObject Drop(PlayerController player) { Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); player.GunChanged -= ReattachSacrificeVFX; player.OnNewFloorLoaded = (Action)Delegate.Remove(player.OnNewFloorLoaded, new Action(ResetRitual)); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } return ((PlayerItem)this).Drop(player, 4f); } public override void DoEffect(PlayerController player) { ((PlayerItem)this).DoEffect(player); ((PlayerItem)this).IsCurrentlyActive = true; AkSoundEngine.PostEvent("sacrifice_start", ((Component)player).gameObject); AkSoundEngine.PostEvent("sacrifice_loop", ((Component)player).gameObject); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } activeVFXObject = VFXPlayerCOTL.PlaySacrificeEventEffectOnGun(((GameActor)player).CurrentGun); } private void ReattachSacrificeVFX(Gun previous, Gun current, bool newGun) { if (((PlayerItem)this).IsCurrentlyActive) { activeVFXObject.GetComponent().gun = current; } } public override void DoActiveEffect(PlayerController player) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Invalid comparison between Unknown and I4 if ((Object)(object)player == (Object)null || (Object)(object)((GameActor)player).CurrentGun == (Object)null) { return; } if ((int)((PickupObject)((GameActor)player).CurrentGun).quality == -50) { ResetRitual(player); return; } ((PlayerItem)this).DoActiveEffect(player); ItemBuilder.AddCurrentGunStatModifier(((GameActor)player).CurrentGun, (StatType)5, DamageStat, (ModifyMethod)1); ItemBuilder.AddCurrentGunStatModifier(((GameActor)player).CurrentGun, (StatType)1, RateOfFireStat, (ModifyMethod)1); ItemBuilder.AddCurrentGunStatModifier(((GameActor)player).CurrentGun, (StatType)10, ReloadStat, (ModifyMethod)1); ItemBuilder.AddCurrentGunStatModifier(((GameActor)player).CurrentGun, (StatType)2, Accuracy, (ModifyMethod)1); ItemBuilder.AddCurrentGunStatModifier(((GameActor)player).CurrentGun, (StatType)6, ProjectileSpeedStat, (ModifyMethod)1); ItemBuilder.AddCurrentGunStatModifier(((GameActor)player).CurrentGun, (StatType)16, ClipAndAmmoCapacityStat, (ModifyMethod)1); ItemBuilder.AddCurrentGunStatModifier(((GameActor)player).CurrentGun, (StatType)9, ClipAndAmmoCapacityStat, (ModifyMethod)1); ItemBuilder.AddCurrentGunStatModifier(((GameActor)player).CurrentGun, (StatType)25, ChargeAmountStat, (ModifyMethod)1); ItemBuilder.AddCurrentGunStatModifier(((GameActor)player).CurrentGun, (StatType)26, RangeMultiplier, (ModifyMethod)1); VolleyRebuildHelpers.RecalculateStatsWithoutRebuildingGunVolleys(player.stats, player); AkSoundEngine.PostEvent("ascend_start", ((Component)player).gameObject); AkSoundEngine.PostEvent("sacrifice_loop_stop", ((Component)player).gameObject); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } ((PlayerItem)this).IsCurrentlyActive = false; player.RemoveActiveItem(ID); } private void ResetRitual(PlayerController player) { AkSoundEngine.PostEvent("sacrifice_loop_stop", ((Component)player).gameObject); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } ((PlayerItem)this).IsCurrentlyActive = false; } } internal class FeastingRitual : HealPlayerItem { public static string ItemName = "Feasting Ritual"; private static StatModifier ownerlessCurseModifier = StatModifier.Create((StatType)14, (ModifyMethod)0, 1f); private GameObject activeVFXObject; public static int ID; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/active_item_sprites/feasting_ritual_pixelart_sprite_corpse"; GameObject val = new GameObject(itemName); FeastingRitual feastingRitual = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "yum..."; string text3 = "Fully heals the player and +1 curse on use\n\nA freshly prepared c*r**e, cooked and seasoned to perfection. It tastes really good, however each bite makes you feel more and more guilty.\n"; ItemBuilder.SetupItem((PickupObject)(object)feastingRitual, text2, text3, "gungeoncotl"); ItemBuilder.SetCooldownType((PlayerItem)(object)feastingRitual, (CooldownType)3, 100f); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)feastingRitual, (StatType)8, 1f, (ModifyMethod)0); ref GameObject healVFX = ref ((HealPlayerItem)feastingRitual).healVFX; PickupObject byId = PickupObjectDatabase.GetById(291); healVFX = ((HealPlayerItem)((byId is HealPlayerItem) ? byId : null)).healVFX; ((HealPlayerItem)feastingRitual).healingAmount = 30f; ((PlayerItem)feastingRitual).consumable = true; ((PlayerItem)feastingRitual).usableDuringDodgeRoll = false; ((PickupObject)feastingRitual).quality = (ItemQuality)(-50); ((PickupObject)feastingRitual).CanBeDropped = false; ID = ((PickupObject)feastingRitual).PickupObjectId; } public override void Pickup(PlayerController player) { if (!((PlayerItem)this).m_pickedUpThisRun) { if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } AkSoundEngine.PostEvent("ritual_pickup", ((Component)player).gameObject); activeVFXObject = VFXPlayerCOTL.PlayRitualActivationEffectOnActor(player); } ((HealPlayerItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public DebrisObject Drop(PlayerController player) { Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } return ((PlayerItem)this).Drop(player, 4f); } public override bool CanBeUsed(PlayerController player) { if ((double)((BraveBehaviour)player).healthHaver.GetCurrentHealthPercentage() >= 1.0) { return false; } return ((HealPlayerItem)this).CanBeUsed(player); } public override void DoEffect(PlayerController player) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) ((BraveBehaviour)player).healthHaver.ApplyHealing(((HealPlayerItem)this).GetHealingAmount(player)); if ((Object)(object)base.healVFX != (Object)null) { ((GameActor)player).PlayEffectOnActor(base.healVFX, Vector3.zero, true, false, false); } AkSoundEngine.PostEvent("feasting_ritual_activation", ((Component)this).gameObject); player.ownerlessStatModifiers.Add(ownerlessCurseModifier); } } internal class RiteOfWrath : PlayerItem { [CompilerGenerated] private sealed class d__18 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerController player; public float duration; public RiteOfWrath <>4__this; private Color 5__1; private Material 5__2; private float 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; player.ownerlessStatModifiers.Add(ownerlessDamageModifier); player.ownerlessStatModifiers.Add(ownerlessRateOfFireModifier); VolleyRebuildHelpers.RecalculateStatsWithoutRebuildingGunVolleys(player.stats, player); AkSoundEngine.PostEvent("wrath_activation", ((Component)player).gameObject); 5__1 = ((BraveBehaviour)player).sprite.color; ((BraveBehaviour)player).sprite.color = ExtendedColours.maroon; 5__2 = SpriteOutlineManager.GetOutlineMaterial(((BraveBehaviour)player).sprite); if (Object.op_Implicit((Object)(object)5__2)) { 5__2.SetColor("_OverrideColor", new Color(42f, 2.8f, 3.6000001f)); } 5__3 = 0f; break; case 1: <>1__state = -1; break; } if (5__3 < duration) { 5__3 += BraveTime.DeltaTime; if (5__2.GetColor("_OverrideColor") != new Color(42f, 2.8f, 3.6000001f)) { 5__2.SetColor("_OverrideColor", new Color(42f, 2.8f, 3.6000001f)); } if (<>4__this.activeParticleEmitter == null) { <>4__this.activeParticleEmitter = ((MonoBehaviour)player).StartCoroutine(HelpfulMethods.HandleEmitFromAttachedPlayer((EmitRegionStyle)0, 5f, duration - 5__3, player, 1f, 1f, 0.15f, 3f, ExtendedColours.maroon, (SparksType)1)); } if (5__3 > duration / 4f * 3f && !<>4__this.ThirdCurseGiven) { player.ownerlessStatModifiers.Add(ownerlessCurseModifier); VolleyRebuildHelpers.RecalculateStatsWithoutRebuildingGunVolleys(player.stats, player); <>4__this.ThirdCurseGiven = true; } else if (5__3 > duration / 4f * 2f && !<>4__this.SecondCurseGiven) { player.ownerlessStatModifiers.Add(ownerlessCurseModifier); VolleyRebuildHelpers.RecalculateStatsWithoutRebuildingGunVolleys(player.stats, player); <>4__this.SecondCurseGiven = true; } else if (5__3 > duration / 4f * 1f && !<>4__this.FirstCurseGiven) { player.ownerlessStatModifiers.Add(ownerlessCurseModifier); VolleyRebuildHelpers.RecalculateStatsWithoutRebuildingGunVolleys(player.stats, player); <>4__this.FirstCurseGiven = true; } <>2__current = null; <>1__state = 1; return true; } player.ownerlessStatModifiers.Remove(ownerlessDamageModifier); player.ownerlessStatModifiers.Remove(ownerlessRateOfFireModifier); player.ownerlessStatModifiers.Add(ownerlessCurseModifier); VolleyRebuildHelpers.RecalculateStatsWithoutRebuildingGunVolleys(player.stats, player); AkSoundEngine.PostEvent("wrath_activation", ((Component)player).gameObject); ((BraveBehaviour)player).sprite.color = 5__1; if (Object.op_Implicit((Object)(object)5__2)) { 5__2.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static string ItemName = "Rite of Wrath"; private static float WrathDamageStat = 2f; private static StatModifier ownerlessDamageModifier = StatModifier.Create((StatType)5, (ModifyMethod)1, 2f); private static float WrathRateOfFireStat = 1.25f; private static StatModifier ownerlessRateOfFireModifier = StatModifier.Create((StatType)1, (ModifyMethod)1, 1.25f); private static float WrathCurseStat = 4f; private static float WrathDuration = 1200f; private static StatModifier ownerlessCurseModifier = StatModifier.Create((StatType)14, (ModifyMethod)0, 0.75f); private bool FirstCurseGiven = false; private bool SecondCurseGiven = false; private bool ThirdCurseGiven = false; private GameObject activeVFXObject; private Coroutine activeParticleEmitter; public static int ID; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/active_item_sprites/rite_of_wrath_nobrown_pixelart_sprite"; GameObject val = new GameObject(itemName); RiteOfWrath riteOfWrath = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "RAGE!!!"; string text3 = "Grants a powerful buff for a duration. Gain permanent curse throughout the duration.\n\nUnleash your innate desires for havoc and violence. Allow yourself to be consumed by the thirst for WRATH! Pay no heed to the consequences of these actions.\n"; ItemBuilder.SetupItem((PickupObject)(object)riteOfWrath, text2, text3, "gungeoncotl"); ItemBuilder.SetCooldownType((PlayerItem)(object)riteOfWrath, (CooldownType)3, 100f); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)riteOfWrath, (StatType)8, 1f, (ModifyMethod)0); ((PlayerItem)riteOfWrath).consumable = false; ((PlayerItem)riteOfWrath).consumableOnActiveUse = false; ((PlayerItem)riteOfWrath).usableDuringDodgeRoll = false; ((PickupObject)riteOfWrath).quality = (ItemQuality)(-50); ((PickupObject)riteOfWrath).CanBeDropped = false; ID = ((PickupObject)riteOfWrath).PickupObjectId; } public override void Pickup(PlayerController player) { if (!base.m_pickedUpThisRun) { if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } AkSoundEngine.PostEvent("ritual_pickup", ((Component)player).gameObject); activeVFXObject = VFXPlayerCOTL.PlayRitualActivationEffectOnActor(player); } ((PlayerItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public DebrisObject Drop(PlayerController player) { Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } return ((PlayerItem)this).Drop(player, 4f); } public override void DoEffect(PlayerController player) { ((PlayerItem)this).DoEffect(player); ((MonoBehaviour)player).StartCoroutine(ApplyWrathBuff(player, WrathDuration)); player.RemoveActiveItem(ID); } private IEnumerator ApplyWrathBuff(PlayerController player, float duration) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0) { <>4__this = this, player = player, duration = duration }; } } internal class SacrificeOfTheGun : PlayerItem { public static string ItemName = "Sacrifice of the Gun"; private GameObject activeVFXObject; private static StatModifier ownerlessCurseModifier = StatModifier.Create((StatType)14, (ModifyMethod)0, 1f); public static int ID; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/active_item_sprites/sacrifice_of_the_gun_alt_pixelart_sprite"; GameObject val = new GameObject(itemName); SacrificeOfTheGun sacrificeOfTheGun = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "to appease the Gods"; string text3 = "Sacrifice your current gun and obtains a new weapon of higher rarity. +1 Curse on use\n\nSacrifices a weapon to the gods in honor of their benevolence. In return, they shall reward you accordingly. Many devout weapons are happy to give their lives for the good of us all, or so they say...\n\nInitial item use starts the ritual. Press the item use button again while holding the weapon you wish to select. If you try to activate the ritual on a starter, excluded, or special rarity weapon, it will cancel the ritual without being consumed.\n"; ItemBuilder.SetupItem((PickupObject)(object)sacrificeOfTheGun, text2, text3, "gungeoncotl"); ItemBuilder.SetCooldownType((PlayerItem)(object)sacrificeOfTheGun, (CooldownType)3, 100f); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)sacrificeOfTheGun, (StatType)8, 1f, (ModifyMethod)0); ((PlayerItem)sacrificeOfTheGun).consumable = false; ((PlayerItem)sacrificeOfTheGun).consumableOnActiveUse = false; ((PlayerItem)sacrificeOfTheGun).usableDuringDodgeRoll = false; ((PickupObject)sacrificeOfTheGun).quality = (ItemQuality)(-50); ((PickupObject)sacrificeOfTheGun).CanBeDropped = false; ((PickupObject)sacrificeOfTheGun).CanBeDropped = false; ID = ((PickupObject)sacrificeOfTheGun).PickupObjectId; } public override void Pickup(PlayerController player) { if (!base.m_pickedUpThisRun) { if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } AkSoundEngine.PostEvent("ritual_pickup", ((Component)player).gameObject); activeVFXObject = VFXPlayerCOTL.PlayRitualActivationEffectOnActor(player); } ((PlayerItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); player.GunChanged += ReattachSacrificeVFX; player.OnNewFloorLoaded = (Action)Delegate.Combine(player.OnNewFloorLoaded, new Action(ResetRitual)); } public DebrisObject Drop(PlayerController player) { Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); player.GunChanged -= ReattachSacrificeVFX; player.OnNewFloorLoaded = (Action)Delegate.Remove(player.OnNewFloorLoaded, new Action(ResetRitual)); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } return ((PlayerItem)this).Drop(player, 4f); } public override void DoEffect(PlayerController player) { ((PlayerItem)this).DoEffect(player); ((PlayerItem)this).IsCurrentlyActive = true; AkSoundEngine.PostEvent("sacrifice_start", ((Component)player).gameObject); AkSoundEngine.PostEvent("sacrifice_loop", ((Component)player).gameObject); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } activeVFXObject = VFXPlayerCOTL.PlaySacrificeEventEffectOnGun(((GameActor)player).CurrentGun); } private void ReattachSacrificeVFX(Gun previous, Gun current, bool newGun) { if (((PlayerItem)this).IsCurrentlyActive) { activeVFXObject.GetComponent().gun = current; } } public override void DoActiveEffect(PlayerController player) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Invalid comparison between Unknown and I4 //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Invalid comparison between Unknown and I4 //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Invalid comparison between Unknown and I4 //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Expected I4, but got Unknown //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected I4, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected I4, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected I4, but got Unknown //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || (Object)(object)((GameActor)player).CurrentGun == (Object)null) { return; } if ((int)((PickupObject)((GameActor)player).CurrentGun).quality == -100 || (int)((PickupObject)((GameActor)player).CurrentGun).quality == -50) { ResetRitual(player); return; } ((PlayerItem)this).DoActiveEffect(player); Gun currentGun = ((GameActor)player).CurrentGun; ItemQuality quality = ((PickupObject)currentGun).quality; DebrisObject val = player.ForceDropGun(currentGun); Object.Destroy((Object)(object)((Component)val).gameObject); Random random = new Random(); if ((int)quality == 5) { PickupObject randomGunOfQualities = (PickupObject)(object)PickupObjectDatabase.GetRandomGunOfQualities(random, new List(), (ItemQuality[])(object)new ItemQuality[1] { (ItemQuality)(int)quality }); PickupObject randomPassiveOfQualities = (PickupObject)(object)PickupObjectDatabase.GetRandomPassiveOfQualities(new Random(random.Next()), new List(), (ItemQuality[])(object)new ItemQuality[2] { (ItemQuality)(int)quality, (ItemQuality)(int)quality }); LootEngine.SpewLoot(((Component)randomGunOfQualities).gameObject, Vector2.op_Implicit(((GameActor)player).CenterPosition + new Vector2(-2f, 0f))); LootEngine.SpewLoot(((Component)randomPassiveOfQualities).gameObject, Vector2.op_Implicit(((GameActor)player).CenterPosition + new Vector2(2f, 0f))); } else { PickupObject randomGunOfQualities2 = (PickupObject)(object)PickupObjectDatabase.GetRandomGunOfQualities(random, new List(), (ItemQuality[])(object)new ItemQuality[1] { (ItemQuality)(quality + 1) }); LootEngine.SpewLoot(((Component)randomGunOfQualities2).gameObject, Vector2.op_Implicit(((GameActor)player).CenterPosition)); } AkSoundEngine.PostEvent("sacrifice_gun_activated", ((Component)player).gameObject); AkSoundEngine.PostEvent("sacrifice_loop_stop", ((Component)player).gameObject); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } player.ownerlessStatModifiers.Add(ownerlessCurseModifier); VolleyRebuildHelpers.RecalculateStatsWithoutRebuildingGunVolleys(player.stats, player); ((PlayerItem)this).IsCurrentlyActive = false; player.RemoveActiveItem(ID); } private void ResetRitual(PlayerController player) { AkSoundEngine.PostEvent("sacrifice_loop_stop", ((Component)player).gameObject); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } ((PlayerItem)this).IsCurrentlyActive = false; } } internal class RitualOfEnrichment : PlayerItem { [CompilerGenerated] private sealed class d__19 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerController player; public int count; public float spawnDelay; public bool randSpawn; public float randRatio; public bool playSFX; public List SFXList; private float 5__1; private int 5__2; private Vector3 5__3; private float 5__4; private Vector2 5__5; private float 5__6; private int 5__7; private float <>s__8; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = spawnDelay; 5__2 = 0; goto IL_0223; case 1: <>1__state = -1; 5__2++; goto IL_0223; case 2: { <>1__state = -1; return false; } IL_0223: if (5__2 < count) { 5__3 = Vector2.op_Implicit(((BraveBehaviour)player).specRigidbody.UnitDimensions); 5__4 = (5__3.x + 5__3.y) / 2f; 5__5 = HelpfulMethods.RandomPointInDonut(Vector2.zero, 5__4 * 3f, 5__4 * 5f, 1.3f); 5__5.y -= 0.5f; 5__6 = Random.value; 5__7 = 1; float num = 5__6; <>s__8 = num; if (!(<>s__8 < 0.05f)) { if (!(<>s__8 < 0.1f)) { if (!(<>s__8 < 0.2f)) { if (<>s__8 < 0.4f) { 5__7 = 3; } else { 5__7 = 1; } } else { 5__7 = 8; } } else { 5__7 = 12; } } else { 5__7 = 25; } LootEngine.SpawnCurrency(((BraveBehaviour)player).specRigidbody.UnitBottomCenter + 5__5, 5__7, false); if (playSFX && SFXList != null && SFXList.Count > 0) { HelpfulMethods.PlayRandomSFX(((Component)player).gameObject, SFXList); } if (randSpawn) { 5__1 = spawnDelay * Random.Range(1f - randRatio, 1f + randRatio); } <>2__current = (object)new WaitForSeconds(5__1); <>1__state = 1; return true; } <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static string ItemName = "Ritual of Enrichment"; private static int MoneyGiven = 50; private static float timeDelay = 0.05f; private static float timeDelayRandRatio = 0.4f; private static List moneySFXList = new List { "pop_1", "pop_2", "pop_3", "pop_4", "pop_5", "pop_6", "pop_7" }; private static List BronzeEnrichmentActivationVFXSpritePath = "GungeonCOTL/Resources/vfxs/casing_vanish_vfxs/casingVanish_bronze/casingVanish".GetResourceFrames(62); private static GameObject BronzeEnrichmentActivationVFX; private static List SilverEnrichmentActivationVFXSpritePath = "GungeonCOTL/Resources/vfxs/casing_vanish_vfxs/casingVanish_silver/casingVanish".GetResourceFrames(62); private static GameObject SilverEnrichmentActivationVFX; private static List GoldEnrichmentActivationVFXSpritePath = "GungeonCOTL/Resources/vfxs/casing_vanish_vfxs/casingVanish_gold/casingVanish".GetResourceFrames(62); private static GameObject GoldEnrichmentActivationVFX; private static List MixEnrichmentActivationVFXSpritePath = "GungeonCOTL/Resources/vfxs/casing_vanish_vfxs/casingVanish_mix/casingVanish".GetResourceFrames(62); private static GameObject MixEnrichmentActivationVFX; private GameObject activeVFXObject; public static int ID; public static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) string itemName = ItemName; string text = "GungeonCOTL/Resources/active_item_sprites/ritual_of_enrichment_pixelart_sprite"; GameObject val = new GameObject(itemName); RitualOfEnrichment ritualOfEnrichment = val.AddComponent(); ItemBuilder.AddSpriteToObject(itemName, text, val, (Assembly)null); string text2 = "received a donation!"; string text3 = "Command your followers to \"donate\" their casings for the gods. You assure them that the funds will go towards all things divine.\n\nsomehow it ends up in your pockets...\n"; ItemBuilder.SetupItem((PickupObject)(object)ritualOfEnrichment, text2, text3, "gungeoncotl"); ItemBuilder.SetCooldownType((PlayerItem)(object)ritualOfEnrichment, (CooldownType)3, 100f); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)ritualOfEnrichment, (StatType)8, 1f, (ModifyMethod)0); ((PlayerItem)ritualOfEnrichment).consumable = false; ((PlayerItem)ritualOfEnrichment).consumableOnActiveUse = false; ((PlayerItem)ritualOfEnrichment).usableDuringDodgeRoll = false; ((PickupObject)ritualOfEnrichment).quality = (ItemQuality)(-50); ((PickupObject)ritualOfEnrichment).CanBeDropped = false; ID = ((PickupObject)ritualOfEnrichment).PickupObjectId; BronzeEnrichmentActivationVFX = VFXBuilder.CreateVFX("bronze_enrichment_activation_vfx", BronzeEnrichmentActivationVFXSpritePath, 18, new IntVector2(0, 0), (Anchor)4, false, 0f, -1f, (Color?)Color.cyan, (WrapMode)2, true); SilverEnrichmentActivationVFX = VFXBuilder.CreateVFX("Silver_enrichment_activation_vfx", SilverEnrichmentActivationVFXSpritePath, 18, new IntVector2(0, 0), (Anchor)4, false, 0f, -1f, (Color?)Color.cyan, (WrapMode)2, true); GoldEnrichmentActivationVFX = VFXBuilder.CreateVFX("Gold_enrichment_activation_vfx", GoldEnrichmentActivationVFXSpritePath, 18, new IntVector2(0, 0), (Anchor)4, false, 0f, -1f, (Color?)Color.cyan, (WrapMode)2, true); MixEnrichmentActivationVFX = VFXBuilder.CreateVFX("Mix_enrichment_activation_vfx", MixEnrichmentActivationVFXSpritePath, 18, new IntVector2(0, 0), (Anchor)4, false, 0f, -1f, (Color?)Color.cyan, (WrapMode)2, true); } public override void Pickup(PlayerController player) { if (!base.m_pickedUpThisRun) { if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } AkSoundEngine.PostEvent("ritual_pickup", ((Component)player).gameObject); activeVFXObject = VFXPlayerCOTL.PlayRitualActivationEffectOnActor(player); } ((PlayerItem)this).Pickup(player); Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName); } public DebrisObject Drop(PlayerController player) { Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName); if ((Object)(object)activeVFXObject != (Object)null) { Object.Destroy((Object)(object)activeVFXObject); } return ((PlayerItem)this).Drop(player, 4f); } public override void DoEffect(PlayerController player) { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) ((PlayerItem)this).DoEffect(player); float num = Mathf.Pow(Random.value, Mathf.Max(1f, player.stats.GetStatValue((StatType)4) / 4f + 1f)); float num2 = num; float num3 = num2; if (!(num3 < 0.03f)) { if (!(num3 < 0.15f)) { if (num3 < 0.4f) { ((MonoBehaviour)player).StartCoroutine(HelpfulMethods.SpawnMoneyInDonut(player, (int)((float)MoneyGiven * 1.5f), timeDelay, randSpawn: true, timeDelayRandRatio, playSFX: true, moneySFXList)); ((GameActor)player).PlayEffectOnActor(SilverEnrichmentActivationVFX, new Vector3(1.1875f, 1.5625f, 1f), true, false, false); } else { ((MonoBehaviour)player).StartCoroutine(HelpfulMethods.SpawnMoneyInDonut(player, MoneyGiven, timeDelay, randSpawn: true, timeDelayRandRatio, playSFX: true, moneySFXList)); ((GameActor)player).PlayEffectOnActor(BronzeEnrichmentActivationVFX, new Vector3(1.1875f, 1.5625f, 1f), true, false, false); } } else { ((MonoBehaviour)player).StartCoroutine(HelpfulMethods.SpawnMoneyInDonut(player, (int)((float)MoneyGiven * 2.5f), timeDelay * 0.8f, randSpawn: true, timeDelayRandRatio, playSFX: true, moneySFXList)); ((GameActor)player).PlayEffectOnActor(MixEnrichmentActivationVFX, new Vector3(1.1875f, 1.5625f, 1f), true, false, false); } } else { ((MonoBehaviour)player).StartCoroutine(HelpfulMethods.SpawnMoneyInDonut(player, (int)((float)MoneyGiven * 5f), timeDelay * 0.6f, randSpawn: true, timeDelayRandRatio, playSFX: true, moneySFXList)); ((GameActor)player).PlayEffectOnActor(GoldEnrichmentActivationVFX, new Vector3(1.1875f, 1.5625f, 1f), true, false, false); } AkSoundEngine.PostEvent("enrichment_activation", ((Component)player).gameObject); player.RemoveActiveItem(ID); } public static IEnumerator SpawnRandomCasingsInDonut(PlayerController player, int count, float spawnDelay, bool randSpawn = false, float randRatio = 0f, bool playSFX = false, List SFXList = null) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0) { player = player, count = count, spawnDelay = spawnDelay, randSpawn = randSpawn, randRatio = randRatio, playSFX = playSFX, SFXList = SFXList }; } } }