Decompiled source of GungeonCOTL v1.0.0
GungeonCOTL.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.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 <HandleDamageCooldown>d__28 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public AIActor damagedTarget; public CustomLightningChainEnemiesModifierAOE <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <HandleDamageCooldown>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<string> sfxPath = new List<string>(); [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<AIActor> m_damagedEnemies = new HashSet<AIActor>(); private void Start() { if ((Object)(object)((BraveBehaviour)this).projectile != (Object)null) { Projectile projectile = ((BraveBehaviour)this).projectile; projectile.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(projectile.OnHitEnemy, new Action<Projectile, SpeculativeRigidbody, bool>(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<AIActor>() != (Object)null)) { return; } val = ((Component)enemyRigidbody).GetComponentInParent<AIActor>(); } List<AIActor> 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<AIActor> 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<tk2dTiledSprite>(); ((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 <HandleDamageCooldown>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<AIActor> 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<AIActor> list = new List<AIActor>(); 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 <TriggerVisualEffect>d__13 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerController player; public OnPreDamagedPassiveItem <>4__this; private Material <mat>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <TriggerVisualEffect>d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <mat>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; <mat>5__1 = SpriteOutlineManager.GetOutlineMaterial(((BraveBehaviour)((PassiveItem)<>4__this).Owner).sprite); if (<>4__this.triggersGlow && Object.op_Implicit((Object)(object)<mat>5__1)) { <mat>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)<mat>5__1)) { <mat>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<string> sfxPath = new List<string>(); 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<HealthHaver, ModifyDamageEventArgs>)Delegate.Combine(healthHaver.ModifyDamage, new Action<HealthHaver, ModifyDamageEventArgs>(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<PlayerController>(); 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 <TriggerVisualEffect>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<OnPreDamagedPassiveItem>(); HealthHaver healthHaver = ((BraveBehaviour)player).healthHaver; healthHaver.ModifyDamage = (Action<HealthHaver, ModifyDamageEventArgs>)Delegate.Remove(healthHaver.ModifyDamage, new Action<HealthHaver, ModifyDamageEventArgs>(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<HealthHaver, ModifyDamageEventArgs>)Delegate.Remove(healthHaver.ModifyDamage, new Action<HealthHaver, ModifyDamageEventArgs>(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 <HandleDamageCooldown>d__27 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public AIActor damagedTarget; public CustomLightningChainEnemiesModifier <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <HandleDamageCooldown>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<string> sfxPath = new List<string>(); [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<AIActor> m_damagedEnemies = new HashSet<AIActor>(); private void Start() { if ((Object)(object)((BraveBehaviour)this).projectile != (Object)null) { Projectile projectile = ((BraveBehaviour)this).projectile; projectile.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(projectile.OnHitEnemy, new Action<Projectile, SpeculativeRigidbody, bool>(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<AIActor>() != (Object)null)) { return; } val = ((Component)enemyRigidbody).GetComponentInParent<AIActor>(); } List<AIActor> 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<AIActor> 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<tk2dTiledSprite>(); ((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 <HandleDamageCooldown>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<AIActor> 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<AIActor> list = new List<AIActor>(); HashSet<AIActor> hashSet = new HashSet<AIActor>(); 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<GenericLootTable> 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<GenericLootTable>(); val.defaultItemDrops = new WeightedGameObjectCollection { elements = new List<WeightedGameObject>() }; 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<GenericLootTable>(); } 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<GameManager>)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)("<color=" + color + ">" + text + "</color>"), false); } } public static class GungeonCOTLSynergies { private static int _NUM_SYNERGIES = Enum.GetNames(typeof(Synergy)).Length; public static List<CustomSynergyType> _Synergies = Enumerable.Repeat<CustomSynergyType>((CustomSynergyType)0, _NUM_SYNERGIES).ToList(); public static List<string> _SynergyNames = Enumerable.Repeat<string>(null, _NUM_SYNERGIES).ToList(); public static List<string> _SynergyEnums = new List<string>(Enum.GetNames(typeof(Synergy))); public static List<int> _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<CustomSynergyType>(); } } public static T ExtendEnum<T>(this string s) where T : Enum { return ETGModCompatibility.ExtendEnum<T>("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<string> mandatoryConsoleIDs, List<string> 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<int> list = new List<int>(); List<int> list2 = new List<int>(); List<int> list3 = new List<int>(); List<int> list4 = new List<int>(); 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<Gun>())) { list2.Add(val.PickupObjectId); } else if (Object.op_Implicit((Object)(object)val) && (Object.op_Implicit((Object)(object)((Component)val).GetComponent<PlayerItem>()) || Object.op_Implicit((Object)(object)((Component)val).GetComponent<PassiveItem>()))) { 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<Gun>())) { list4.Add(val2.PickupObjectId); } else if (Object.op_Implicit((Object)(object)val2) && (Object.op_Implicit((Object)(object)((Component)val2).GetComponent<PlayerItem>()) || Object.op_Implicit((Object)(object)((Component)val2).GetComponent<PassiveItem>()))) { 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<CustomSynergyType> { synergy }, statModifiers = new List<StatModifier>(), 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<BasicGun>(); 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<Projectile>(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 <DelayDamage>d__13 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public AIActor enemy; public float initialTimeDelay; public CrownUpgradeDarknessWithin <>4__this; private GameObject <vfxObject>5__1; private tk2dSprite <sprite>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DelayDamage>d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <vfxObject>5__1 = null; <sprite>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; <vfxObject>5__1 = Object.Instantiate<GameObject>(DiseasedHeartVFXEffect, Vector2Extensions.ToVector3ZUp(((BraveBehaviour)enemy).specRigidbody.UnitBottomCenter, 0f) + vfxOffset, Quaternion.identity); <sprite>5__2 = <vfxObject>5__1.GetComponent<tk2dSprite>(); if ((Object)(object)<sprite>5__2 != (Object)null) { ((tk2dBaseSprite)<sprite>5__2).HeightOffGround = 10f; ((tk2dBaseSprite)<sprite>5__2).UpdateZDepth(); tk2dSprite obj = <sprite>5__2; ((tk2dBaseSprite)obj).scale = ((tk2dBaseSprite)obj).scale * Mathf.Max(1f, 1f + (((BraveBehaviour)enemy).specRigidbody.UnitDimensions.x - 1f) / 2f); } <vfxObject>5__1.GetComponent<VFXAnchorModule>().anchorAIActor = enemy; <vfxObject>5__1.GetComponent<VFXAnchorModule>().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<string> DiseasedHeartVFXPath = new List<string> { "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<string> sfxList = new List<string> { "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<CrownUpgradeDarknessWithin>(); 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<VFXAnchorModule>(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<AIActor> 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<GameObject>(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<AIActor> 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 <DelayDamage>d__13(0) { <>4__this = this, enemy = enemy, initialTimeDelay = initialTimeDelay }; } } internal class CrownUpgradeResurrection : PassiveItem { [CompilerGenerated] private sealed class <ReviveCoroutine>d__10 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerController player; public CrownUpgradeResurrection <>4__this; private Color <originalPlayerColor>5__1; private Color <originalGunColor>5__2; private Material <mat>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ReviveCoroutine>d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <mat>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; <originalPlayerColor>5__1 = ((BraveBehaviour)player).sprite.color; <originalGunColor>5__2 = ((BraveBehaviour)((GameActor)player).CurrentGun).sprite.color; ((BraveBehaviour)player).sprite.color = ExtendedColours.maroon; ((BraveBehaviour)((GameActor)player).CurrentGun).sprite.color = ExtendedColours.maroon; <mat>5__3 = SpriteOutlineManager.GetOutlineMaterial(((BraveBehaviour)player).sprite); if (Object.op_Implicit((Object)(object)<mat>5__3)) { <mat>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 = <originalPlayerColor>5__1; ((BraveBehaviour)((GameActor)player).CurrentGun).sprite.color = <originalGunColor>5__2; if (Object.op_Implicit((Object)(object)<mat>5__3)) { <mat>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); } <mat>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<CrownUpgradeResurrection>(); 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 <ReviveCoroutine>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<DoctrineOfLawAndOrder>(); 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<DoctrineOfLawAndOrder>()).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<DoctrineOfMaterialism>(); 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<DoctrineOfSin>(); 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<string> moneySFXList = new List<string> { "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<DoctrineOfSustenance>(); 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<HealthHaver, ModifyHealingEventArgs>)Delegate.Combine(healthHaver.ModifyHealing, new Action<HealthHaver, ModifyHealingEventArgs>(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<HealthHaver, ModifyHealingEventArgs>)Delegate.Remove(healthHaver.ModifyHealing, new Action<HealthHaver, ModifyHealingEventArgs>(ModifyIncomingHealing)); ((PassiveItem)((Component)val).GetComponent<HealingReceivedModificationItem>()).m_pickedUpThisRun = true; return val; } public override void OnDestroy() { if (base.m_pickedUp) { HealthHaver healthHaver = ((BraveBehaviour)base.m_owner).healthHaver; healthHaver.ModifyHealing = (Action<HealthHaver, ModifyHealingEventArgs>)Delegate.Combine(healthHaver.ModifyHealing, new Action<HealthHaver, ModifyHealingEventArgs>(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<PlayerController>()).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<HeartOfTheFaithful4>(); 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<HeartOfTheFaithful5>(); 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<HeartOfTheFaithful6>(); 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<HeartOfTheFaithful3>(); 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<HeartOfTheFaithful2>(); 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<HeartOfTheFaithful1>(); 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<MightOfTheDevout3>(); 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<MightOfTheDevout4>(); 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_pickedUpThisRu