using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Alexandria.ItemAPI;
using Alexandria.SoundAPI;
using BepInEx;
using Dungeonator;
using Microsoft.CodeAnalysis;
using UnityEngine;
[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 CustomLightningChainEnemiesModifier : BraveBehaviour
{
[CompilerGenerated]
private sealed class <HandleDamageCooldown>d__25 : 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__25(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 = 8f;
public float damagePerHit = 5f;
public float damageCooldown = 1f;
public float maxLinkCount = 5f;
public string vfxPath = "statikk_shiv_lightning_SFX";
[NonSerialized]
public bool DamagesEnemies = 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_0028: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)enemyRigidbody == (Object)null) && !((Object)(object)((BraveBehaviour)enemyRigidbody).aiActor == (Object)null))
{
AIActor aiActor = ((BraveBehaviour)enemyRigidbody).aiActor;
List<AIActor> list = ChainEnemies(((GameActor)aiActor).CenterPosition);
AkSoundEngine.PostEvent(vfxPath, ((Component)aiActor).gameObject);
if (list.Count > 0)
{
list.Insert(0, aiActor);
UpdateLinkChain(list);
}
}
}
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_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: 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_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: 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);
if (UsesDispersalParticles)
{
DoDispersalParticles(val, unitCenter);
}
((MonoBehaviour)GameManager.Instance).StartCoroutine(HandleDamageCooldown(item));
}
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__25(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 LOLItems
{
public class HelpfulMethods
{
public string[,] FloorNames = new string[10, 2]
{
{ "tt_castle", "Keep of the Lead Lord / Floor 1" },
{ "tt_sewer", "Oubliette / Floor 1.5" },
{ "tt5", "Gungeon Proper / Floor 2" },
{ "tt_cathedral", "Abbey of the True Gun / Floor 2.5" },
{ "tt_mines", "Black Powder Mine / Floor 3" },
{ "ss_resourcefulrat", "Resourceful Rat's Lair / Floor 3.5" },
{ "tt_catacombs", "Hollow / Floor 4" },
{ "tt_nakatomi", "R&G Dept / Floor 4.5" },
{ "tt_forge", "Forge / Floor 5" },
{ "tt_bullethell", "Bullet Hell / Floor 6" }
};
public float GetFloorValue()
{
string dungeonSceneName = GameManager.Instance.GetLastLoadedLevelDefinition().dungeonSceneName;
for (int i = 0; i < FloorNames.GetLength(0); i++)
{
string text = FloorNames[i, 0];
if (dungeonSceneName == text)
{
return text switch
{
"tt_castle" => 1f,
"tt_sewer" => 1.5f,
"tt5" => 2f,
"tt_cathedral" => 2.5f,
"tt_mines" => 3f,
"ss_resourcefulrat" => 3.5f,
"tt_catacombs" => 4f,
"tt_nakatomi" => 4.5f,
"tt_forge" => 5f,
"tt_bullethell" => 6f,
_ => 0f,
};
}
}
return 0f;
}
}
public class Muramana : PassiveItem
{
private static float DamageStat = 1.2f;
private static float ClipAndAmmoIncrease = 1.5f;
private static float MuramanaShockBaseDamage = 5f;
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_0072: Unknown result type (might be due to invalid IL or missing references)
string text = "Muramana";
string text2 = "LOLItems/Resources/passive_item_sprites/muramana_item_sprite";
GameObject val = new GameObject(text);
Muramana muramana = val.AddComponent<Muramana>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "The Peak of Swordsmithing";
string text4 = "A blade forged by Masamune and wielded by the worthy, the Manamune's true power has been unlocked.";
ItemBuilder.SetupItem((PickupObject)(object)muramana, text3, text4, "LOLItems");
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)muramana, (StatType)5, DamageStat, (ModifyMethod)1);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)muramana, (StatType)16, ClipAndAmmoIncrease, (ModifyMethod)1);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)muramana, (StatType)9, ClipAndAmmoIncrease, (ModifyMethod)1);
((PickupObject)muramana).quality = (ItemQuality)(-100);
((PickupObject)muramana).ShouldBeExcludedFromShops = true;
}
public override void Pickup(PlayerController player)
{
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up Muramana");
player.PostProcessProjectile += MuramanaShock;
}
public override void DisableEffect(PlayerController player)
{
((PassiveItem)this).DisableEffect(player);
Plugin.Log("Player dropped or got rid of Muramana");
player.PostProcessProjectile -= MuramanaShock;
}
private void MuramanaShock(Projectile proj, float f)
{
GameActor owner = proj.Owner;
PlayerController player = (PlayerController)(object)((owner is PlayerController) ? owner : null);
if (player == null)
{
return;
}
Gun currentGun = ((GameActor)player).CurrentGun;
if (currentGun == null)
{
return;
}
proj.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(proj.OnHitEnemy, (Action<Projectile, SpeculativeRigidbody, bool>)delegate(Projectile projHit, SpeculativeRigidbody enemy, bool fatal)
{
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)enemy != (Object)null && (Object)(object)((BraveBehaviour)enemy).healthHaver != (Object)null)
{
float num = Mathf.Max(0f, (player.stats.GetStatValue((StatType)16) - 1f) / 5f);
float num2 = Mathf.Max(0f, (player.stats.GetStatValue((StatType)9) - 1f) / 5f);
float num3 = Mathf.Max(1f, 1f + num + num2);
float num4 = Mathf.Max(1f, MuramanaShockBaseDamage * num3);
((BraveBehaviour)enemy).healthHaver.ApplyDamage(num4, Vector2.zero, "muramana_shock_damage", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
}
});
}
}
internal class SunfireAegis : AuraItem
{
private static float HealthStat = 1f;
private static float HealthToGive = 1f;
private static float ArmorStat = 1f;
private bool hasGainedArmor = false;
private static float ImmolateBaseDamage = 0f;
private static float ImmolateDamagePerHeart = 1.5f;
private static float ImmolateBaseRadius = 2f;
private static float ImmolateRadiusPerHeart = 1f;
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_005b: Unknown result type (might be due to invalid IL or missing references)
string text = "Sunfire Aegis";
string text2 = "LOLItems/Resources/passive_item_sprites/sunfire_aegis_item_sprite";
GameObject val = new GameObject(text);
SunfireAegis sunfireAegis = val.AddComponent<SunfireAegis>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "Radiates Heat";
string text4 = "The golden armor glows with a warmth not unlike the sun. Appears to have been blessed by the gods to burn the wicked around it.\n";
ItemBuilder.SetupItem((PickupObject)(object)sunfireAegis, text3, text4, "LOLItems");
((AuraItem)sunfireAegis).AuraRadius = ImmolateBaseRadius;
((AuraItem)sunfireAegis).DamagePerSecond = ImmolateBaseDamage;
((PickupObject)sunfireAegis).quality = (ItemQuality)4;
}
public override void Pickup(PlayerController player)
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Expected O, but got Unknown
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up Sunfire Aegis");
((BraveBehaviour)player).healthHaver.OnHealthChanged += new OnHealthChangedEvent(UpdateImmolateStats);
((BraveBehaviour)player).healthHaver.SetHealthMaximum(((BraveBehaviour)player).healthHaver.GetMaxHealth() + HealthStat, (float?)HealthToGive, false);
HealthToGive = 0f;
if (!hasGainedArmor)
{
HealthHaver healthHaver = ((BraveBehaviour)player).healthHaver;
healthHaver.Armor += ArmorStat;
}
hasGainedArmor = true;
}
public override void DisableEffect(PlayerController player)
{
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Expected O, but got Unknown
((PassiveItem)this).DisableEffect(player);
Plugin.Log("Player dropped or got rid of Sunfire Aegis");
((BraveBehaviour)player).healthHaver.SetHealthMaximum(((BraveBehaviour)player).healthHaver.GetMaxHealth() - HealthStat, (float?)null, false);
((BraveBehaviour)player).healthHaver.OnHealthChanged -= new OnHealthChangedEvent(UpdateImmolateStats);
}
private void UpdateImmolateStats(float oldHealth, float newHealth)
{
base.DamagePerSecond = newHealth * ImmolateDamagePerHeart;
base.AuraRadius = ImmolateBaseRadius + newHealth * ImmolateRadiusPerHeart;
((PassiveItem)this).Update();
}
}
public class BladeOfTheRuinedKing : PassiveItem
{
private bool shouldApplySlow = false;
private static float DamageStat = 1.25f;
private static float RateOfFireStat = 1.2f;
private static float PercentCurrentHealthStat = 0.12f;
private static float slowPercent = 0.5f;
private static float slowDuration = 3f;
public static void Init()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Expected O, but got Unknown
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
string text = "Blade of the Ruined King";
string text2 = "LOLItems/Resources/passive_item_sprites/blade_of_the_ruined_king_item_sprite";
GameObject val = new GameObject(text);
BladeOfTheRuinedKing bladeOfTheRuinedKing = val.AddComponent<BladeOfTheRuinedKing>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "\"The mist devours all!\"";
string text4 = "No price is too great.\nNo atrocity beyond my reach.\nFor her, I will do anything.\n\n- King of Camavor\n";
ItemBuilder.SetupItem((PickupObject)(object)bladeOfTheRuinedKing, text3, text4, "LOLItems");
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)bladeOfTheRuinedKing, (StatType)5, DamageStat, (ModifyMethod)1);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)bladeOfTheRuinedKing, (StatType)1, RateOfFireStat, (ModifyMethod)1);
((PickupObject)bladeOfTheRuinedKing).quality = (ItemQuality)5;
}
public override void Pickup(PlayerController player)
{
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up Blade of the Ruined King");
player.OnReloadedGun = (Action<PlayerController, Gun>)Delegate.Combine(player.OnReloadedGun, new Action<PlayerController, Gun>(OnGunReloaded));
shouldApplySlow = true;
player.PostProcessProjectile += OnPostProcessProjectile;
}
public override void DisableEffect(PlayerController player)
{
Plugin.Log("Player dropped or got rid of Blade of the Ruined King");
player.OnReloadedGun = (Action<PlayerController, Gun>)Delegate.Remove(player.OnReloadedGun, new Action<PlayerController, Gun>(OnGunReloaded));
player.PostProcessProjectile -= OnPostProcessProjectile;
shouldApplySlow = false;
}
private void OnGunReloaded(PlayerController player, Gun gun)
{
shouldApplySlow = true;
}
private void OnPostProcessProjectile(Projectile proj, float f)
{
if (shouldApplySlow)
{
ApplySlowEffect(proj);
shouldApplySlow = false;
}
proj.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(proj.OnHitEnemy, (Action<Projectile, SpeculativeRigidbody, bool>)delegate(Projectile projHit, SpeculativeRigidbody enemy, bool fatal)
{
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)enemy != (Object)null && (Object)(object)((BraveBehaviour)enemy).aiActor != (Object)null)
{
float currentHealth = ((BraveBehaviour)enemy).healthHaver.GetCurrentHealth();
float num = Mathf.Max(1f, currentHealth * PercentCurrentHealthStat);
if (((BraveBehaviour)enemy).healthHaver.IsBoss || ((BraveBehaviour)enemy).healthHaver.IsSubboss)
{
num *= 0.25f;
}
((BraveBehaviour)enemy).healthHaver.ApplyDamage(num, Vector2.zero, "botrk_current_health_damage", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
}
});
}
private void ApplySlowEffect(Projectile projectile)
{
//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_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Expected O, but got Unknown
GameActorSpeedEffect slowEffect = new GameActorSpeedEffect
{
duration = slowDuration,
effectIdentifier = "botrk_slow",
resistanceType = (EffectResistanceType)3,
AppliesOutlineTint = true,
OutlineTintColor = Color.cyan,
SpeedMultiplier = slowPercent
};
projectile.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(projectile.OnHitEnemy, (Action<Projectile, SpeculativeRigidbody, bool>)delegate(Projectile projHit, SpeculativeRigidbody enemy, bool fatal)
{
if ((Object)(object)enemy != (Object)null && (Object)(object)((BraveBehaviour)enemy).aiActor != (Object)null)
{
((GameActor)((BraveBehaviour)enemy).aiActor).ApplyEffect((GameActorEffect)(object)slowEffect, 1f, (Projectile)null);
}
});
}
}
public class ExamplePassive : PassiveItem
{
public static void Register()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Expected O, but got Unknown
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
string text = "Example Item Name";
string text2 = "LOLItems/Resources/example_item_sprite";
GameObject val = new GameObject(text);
ExamplePassive examplePassive = val.AddComponent<ExamplePassive>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "Example Short Desc.";
string text4 = "1234567890123456789012345678901234567890123456789012345678901234567890\n\n---------------------------------------------------------------------------\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\n...........................................................................\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
ItemBuilder.SetupItem((PickupObject)(object)examplePassive, text3, text4, "example");
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)examplePassive, (StatType)3, 1f, (ModifyMethod)0);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)examplePassive, (StatType)4, 1f, (ModifyMethod)0);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)examplePassive, (StatType)1, 1.5f, (ModifyMethod)1);
((PickupObject)examplePassive).quality = (ItemQuality)(-100);
}
public override void Pickup(PlayerController player)
{
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up " + ((PickupObject)this).itemName);
}
public override void DisableEffect(PlayerController player)
{
Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).itemName);
}
}
internal class ExperimentalHexplate : PassiveItem
{
[CompilerGenerated]
private sealed class <ApplyOverdriveBuff>d__13 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public PlayerController player;
public ExperimentalHexplate <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ApplyOverdriveBuff>d__13(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Expected O, but got Unknown
//IL_011a: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>4__this.isOverdriveActive = true;
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)<>4__this, (StatType)1, OverdriveRateOfFireStat, (ModifyMethod)1);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)<>4__this, (StatType)0, overdriveMovementSpeedStat, (ModifyMethod)1);
player.stats.RecalculateStats(player, false, false);
AkSoundEngine.PostEvent("experimental_hexplate_passive_triggered_SFX", ((Component)player).gameObject);
AkSoundEngine.PostEvent("experimental_hexplate_passive_effect_SFX", ((Component)player).gameObject);
<>2__current = (object)new WaitForSeconds(OverdriveDuration);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
ItemBuilder.RemovePassiveStatModifier((PickupObject)(object)<>4__this, (StatType)1);
ItemBuilder.RemovePassiveStatModifier((PickupObject)(object)<>4__this, (StatType)0);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)<>4__this, (StatType)1, RateOfFireStat, (ModifyMethod)1);
player.stats.RecalculateStats(player, false, false);
<>2__current = (object)new WaitForSeconds(OverdriveCooldown - OverdriveDuration);
<>1__state = 2;
return true;
case 2:
<>1__state = -1;
<>4__this.isOverdriveActive = false;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private static float DamageStat = 1.1f;
private static float RateOfFireStat = 1.1f;
private static float HealthStat = 1f;
private static float HealthToGive = 1f;
private static float OverdriveDuration = 8f;
private static float OverdriveCooldown = 30f;
private static float OverdriveRateOfFireStat = 1.5f;
private static float overdriveMovementSpeedStat = 1.25f;
private bool isOverdriveActive = false;
public static void Init()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Expected O, but got Unknown
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
string text = "Experimental Hexplate";
string text2 = "LOLItems/Resources/passive_item_sprites/experimental_hexplate_item_sprite";
GameObject val = new GameObject(text);
ExperimentalHexplate experimentalHexplate = val.AddComponent<ExperimentalHexplate>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "Ethically Questionable";
string text4 = "This strange piece of armor appears to be mechanically equipped to help the user enhance their physical abilities. It never passed testing phase for a reason.\n";
ItemBuilder.SetupItem((PickupObject)(object)experimentalHexplate, text3, text4, "LOLItems");
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)experimentalHexplate, (StatType)5, DamageStat, (ModifyMethod)1);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)experimentalHexplate, (StatType)1, RateOfFireStat, (ModifyMethod)1);
((PickupObject)experimentalHexplate).quality = (ItemQuality)4;
}
public override void Pickup(PlayerController player)
{
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up Experimental Hexplate");
((BraveBehaviour)player).healthHaver.SetHealthMaximum(((BraveBehaviour)player).healthHaver.GetMaxHealth() + HealthStat, (float?)HealthToGive, false);
HealthToGive = 0f;
player.OnUsedPlayerItem += OnPlayerItemUsed;
}
public override void DisableEffect(PlayerController player)
{
((PassiveItem)this).DisableEffect(player);
Plugin.Log("Player dropped or got rid of Experimental Hexplate");
((BraveBehaviour)player).healthHaver.SetHealthMaximum(((BraveBehaviour)player).healthHaver.GetMaxHealth() - HealthStat, (float?)null, false);
player.OnUsedPlayerItem -= OnPlayerItemUsed;
}
private void OnPlayerItemUsed(PlayerController player, PlayerItem item)
{
if (!isOverdriveActive)
{
((MonoBehaviour)this).StartCoroutine(ApplyOverdriveBuff(player));
}
}
private IEnumerator ApplyOverdriveBuff(PlayerController player)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ApplyOverdriveBuff>d__13(0)
{
<>4__this = this,
player = player
};
}
}
internal class GuardianAngel : PassiveItem
{
[CompilerGenerated]
private sealed class <ReviveCoroutine>d__8 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public PlayerController player;
public GuardianAngel <>4__this;
private Color <originalColor>5__1;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ReviveCoroutine>d__8(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//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_00b0: 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_00e0: Expected O, but got Unknown
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
((BraveBehaviour)player).healthHaver.TriggerInvulnerabilityPeriod(4f);
((BraveBehaviour)player).healthHaver.ForceSetCurrentHealth(((BraveBehaviour)player).healthHaver.GetMaxHealth() / 2f);
player.CurrentInputState = (PlayerInputState)1;
((BraveBehaviour)player).healthHaver.OnPreDeath -= <>4__this.Rebirth;
<originalColor>5__1 = ((BraveBehaviour)player).sprite.color;
((BraveBehaviour)player).sprite.color = Color.yellow;
AkSoundEngine.PostEvent("guardian_angel_passive_SFX", ((Component)GameManager.Instance).gameObject);
<>2__current = (object)new WaitForSeconds(4f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
((BraveBehaviour)player).sprite.color = <originalColor>5__1;
player.ForceBlank(25f, 0.5f, false, true, (Vector2?)null, true, -1f);
player.CurrentInputState = (PlayerInputState)0;
((BraveBehaviour)player).healthHaver.PreventAllDamage = false;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private static float DamageStat = 1.25f;
private static float ArmorStat = 2f;
private bool hasGainedArmor = false;
private bool hasRevived = false;
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_0053: Unknown result type (might be due to invalid IL or missing references)
string text = "Guardian Angel";
string text2 = "LOLItems/Resources/passive_item_sprites/guardian_angel_item_sprite";
GameObject val = new GameObject(text);
GuardianAngel guardianAngel = val.AddComponent<GuardianAngel>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "\"Heroes never die!\"";
string text4 = "A blade imbued with the hope of a cult who believed in rebirth. You almost feel like you could defy even death with it in hand.\n";
ItemBuilder.SetupItem((PickupObject)(object)guardianAngel, text3, text4, "LOLItems");
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)guardianAngel, (StatType)5, DamageStat, (ModifyMethod)1);
((PickupObject)guardianAngel).quality = (ItemQuality)5;
}
public override void Pickup(PlayerController player)
{
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up Guardian Angel");
if (!hasGainedArmor)
{
HealthHaver healthHaver = ((BraveBehaviour)player).healthHaver;
healthHaver.Armor += ArmorStat;
}
hasGainedArmor = true;
((BraveBehaviour)player).healthHaver.OnPreDeath += Rebirth;
}
public override void DisableEffect(PlayerController player)
{
((PassiveItem)this).DisableEffect(player);
Plugin.Log("Player dropped or got rid of Guardian Angel");
((BraveBehaviour)player).healthHaver.OnPreDeath -= Rebirth;
}
private void Rebirth(Vector2 DeathPositon)
{
if (!hasRevived)
{
PlayerController owner = ((PassiveItem)this).Owner;
if (owner != null)
{
hasRevived = true;
((MonoBehaviour)owner).StartCoroutine(ReviveCoroutine(owner));
}
}
}
private IEnumerator ReviveCoroutine(PlayerController player)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ReviveCoroutine>d__8(0)
{
<>4__this = this,
player = player
};
}
}
internal class Hubris : PassiveItem
{
private int eminenceCount = 0;
private float eminenceDamageIncrease = 0.002f;
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_0045: Unknown result type (might be due to invalid IL or missing references)
string text = "Hubris";
string text2 = "LOLItems/Resources/passive_item_sprites/hubris_item_sprite";
GameObject val = new GameObject(text);
Hubris hubris = val.AddComponent<Hubris>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "A symbol of victory";
string text4 = "A congratulatory laurel wreath gifted to the victor. With each triumph, one's strength increases. Legends speak of a statue that manifests once you reach the pinnacle of victory.\n";
ItemBuilder.SetupItem((PickupObject)(object)hubris, text3, text4, "LOLItems");
((PickupObject)hubris).quality = (ItemQuality)4;
}
public override void Pickup(PlayerController player)
{
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up Hubris");
player.OnKilledEnemy += KillEnemyCount;
}
public override void DisableEffect(PlayerController player)
{
((PassiveItem)this).DisableEffect(player);
Plugin.Log("Player dropped or got rid of Hubris");
player.OnKilledEnemy -= KillEnemyCount;
}
private void KillEnemyCount(PlayerController player)
{
ItemBuilder.RemovePassiveStatModifier((PickupObject)(object)this, (StatType)5);
eminenceCount++;
float num = (float)eminenceCount * eminenceDamageIncrease;
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)this, (StatType)5, 1f + num, (ModifyMethod)1);
player.stats.RecalculateStats(player, false, false);
}
}
internal class KrakenSlayer : PassiveItem
{
private int bringItDownCount = 0;
private float bringItDownDamage = 20f;
private static float bringItDownDamageScale = 0.25f;
private static float DamageStat = 1.25f;
private static float RateOfFireStat = 1.25f;
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_0063: Unknown result type (might be due to invalid IL or missing references)
string text = "Kraken Slayer";
string text2 = "LOLItems/Resources/passive_item_sprites/kraken_slayer_item_sprite";
GameObject val = new GameObject(text);
KrakenSlayer krakenSlayer = val.AddComponent<KrakenSlayer>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "The Ultimate fishing tool";
string text4 = "A fishing tool passed down through generations. It's said that the original user felled a kraken with it and freed the seas from its terror.\n";
ItemBuilder.SetupItem((PickupObject)(object)krakenSlayer, text3, text4, "LOLItems");
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)krakenSlayer, (StatType)5, DamageStat, (ModifyMethod)1);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)krakenSlayer, (StatType)1, RateOfFireStat, (ModifyMethod)1);
((PickupObject)krakenSlayer).quality = (ItemQuality)5;
}
public override void Pickup(PlayerController player)
{
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up Kraken Slayer");
player.PostProcessProjectile += OnPostProcessProjectile;
player.OnReloadedGun = (Action<PlayerController, Gun>)Delegate.Combine(player.OnReloadedGun, new Action<PlayerController, Gun>(OnGunReloaded));
}
public override void DisableEffect(PlayerController player)
{
((PassiveItem)this).DisableEffect(player);
Plugin.Log("Player dropped or got rid of Kraken Slayer");
player.PostProcessProjectile -= OnPostProcessProjectile;
player.OnReloadedGun = (Action<PlayerController, Gun>)Delegate.Remove(player.OnReloadedGun, new Action<PlayerController, Gun>(OnGunReloaded));
bringItDownCount = 0;
}
public float GetFloorDamageScale()
{
return GameManager.Instance.GetLastLoadedLevelDefinition().dungeonSceneName switch
{
"tt_castle" => 1f,
"tt_sewer" => 1.25f,
"tt5" => 1.25f,
"tt_cathedral" => 1.5f,
"tt_mines" => 1.5f,
"ss_resourcefulrat" => 1.75f,
"tt_catacombs" => 1.75f,
"tt_nakatomi" => 2f,
"tt_forge" => 2f,
"tt_bullethell" => 2.25f,
_ => 0f,
};
}
private void OnPostProcessProjectile(Projectile proj, float f)
{
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
bringItDownCount++;
if (bringItDownCount < 3)
{
return;
}
((BraveBehaviour)proj).sprite.color = Color.Lerp(((BraveBehaviour)proj).sprite.color, Color.cyan, 0.7f);
AkSoundEngine.PostEvent("kraken_slayer_passive_SFX", ((Component)proj).gameObject);
proj.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(proj.OnHitEnemy, (Action<Projectile, SpeculativeRigidbody, bool>)delegate(Projectile projHit, SpeculativeRigidbody enemy, bool fatal)
{
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)enemy != (Object)null && (Object)(object)((BraveBehaviour)enemy).aiActor != (Object)null)
{
float num = 0.75f * (1f - ((BraveBehaviour)enemy).healthHaver.GetCurrentHealthPercentage());
float num2 = bringItDownDamage * (1f + num) * GetFloorDamageScale();
if (((BraveBehaviour)enemy).healthHaver.IsBoss || ((BraveBehaviour)enemy).healthHaver.IsSubboss)
{
num2 *= 0.25f;
}
Plugin.Log($"Bring it down damage dealt: {num2}");
((BraveBehaviour)enemy).healthHaver.ApplyDamage(num2, Vector2.zero, "kraken_slayer_bring_it_down_damage", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
}
});
bringItDownCount = 0;
}
private void OnGunReloaded(PlayerController player, Gun gun)
{
bringItDownCount = 0;
}
}
internal class LiandrysTorment : PassiveItem
{
[CompilerGenerated]
private sealed class <ApplyTormentEffect>d__12 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public AIActor enemy;
public LiandrysTorment <>4__this;
private float <elapsed>5__1;
private float <dotTickInterval>5__2;
private float <tormentDamageToDeal>5__3;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ApplyTormentEffect>d__12(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected O, but got Unknown
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<elapsed>5__1 = 0f;
<dotTickInterval>5__2 = 0.5f;
<>2__current = (object)new WaitForSeconds(0.25f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
break;
case 2:
<>1__state = -1;
<elapsed>5__1 += <dotTickInterval>5__2;
break;
}
if (<elapsed>5__1 < TormentDuration && (Object)(object)enemy != (Object)null && (Object)(object)((BraveBehaviour)enemy).healthHaver != (Object)null && ((BraveBehaviour)enemy).healthHaver.IsAlive)
{
<tormentDamageToDeal>5__3 = ((BraveBehaviour)enemy).healthHaver.GetMaxHealth() * TormentPercentHealthDamage * <dotTickInterval>5__2 * 0f;
if (((BraveBehaviour)enemy).healthHaver.IsBoss || ((BraveBehaviour)enemy).healthHaver.IsSubboss)
{
<tormentDamageToDeal>5__3 *= 0.25f;
}
((BraveBehaviour)enemy).healthHaver.ApplyDamage(<tormentDamageToDeal>5__3, Vector2.zero, "liandrys_max_health_burn_tick", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
Plugin.Log($"Applying Liandry's torment damage: {<tormentDamageToDeal>5__3} to {((GameActor)((BraveBehaviour)enemy).aiActor).ActorName}");
Plugin.Log($"Elapsed time: {<elapsed>5__1} seconds");
<>2__current = (object)new WaitForSeconds(<dotTickInterval>5__2);
<>1__state = 2;
return true;
}
<>4__this.TormentAffectedEnemies.Remove(enemy);
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private static float DamageStat = 1.15f;
private static float HealthStat = 1f;
private static float HealthToGive = 1f;
private static float TormentPercentHealthDamage = 0.03f;
private static float TormentDuration = 3f;
private Dictionary<AIActor, Coroutine> TormentAffectedEnemies = new Dictionary<AIActor, Coroutine>();
private static Gun phoenix;
private static GameActorFireEffect TormentBurnEffect;
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_0053: Unknown result type (might be due to invalid IL or missing references)
string text = "Liandry's Torment";
string text2 = "LOLItems/Resources/passive_item_sprites/liandrys_torment_item_sprite";
GameObject val = new GameObject(text);
LiandrysTorment liandrysTorment = val.AddComponent<LiandrysTorment>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "Cursed Mask";
string text4 = "Once belonged to a theatre company and used as a prop in their most infamous act. Rumors claim that each run of the act needed new actors since one actor always died mysteriously. \nSomething tells you that this mask was connected to these incidents.\n";
ItemBuilder.SetupItem((PickupObject)(object)liandrysTorment, text3, text4, "LOLItems");
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)liandrysTorment, (StatType)5, DamageStat, (ModifyMethod)1);
((PickupObject)liandrysTorment).quality = (ItemQuality)4;
}
public override void Pickup(PlayerController player)
{
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up Liandry's Torment");
((BraveBehaviour)player).healthHaver.SetHealthMaximum(((BraveBehaviour)player).healthHaver.GetMaxHealth() + HealthStat, (float?)HealthToGive, false);
HealthToGive = 0f;
player.PostProcessProjectile += OnPostProcessProjectile;
}
public override void DisableEffect(PlayerController player)
{
((PassiveItem)this).DisableEffect(player);
Plugin.Log("Player dropped or got rid of Liandry's Torment");
((BraveBehaviour)player).healthHaver.SetHealthMaximum(((BraveBehaviour)player).healthHaver.GetMaxHealth() - HealthStat, (float?)null, false);
player.PostProcessProjectile -= OnPostProcessProjectile;
}
private void OnPostProcessProjectile(Projectile proj, float f)
{
proj.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(proj.OnHitEnemy, (Action<Projectile, SpeculativeRigidbody, bool>)delegate(Projectile projHit, SpeculativeRigidbody enemy, bool fatal)
{
if ((Object)(object)enemy != (Object)null && (Object)(object)((BraveBehaviour)enemy).aiActor != (Object)null)
{
AIActor aiActor = ((BraveBehaviour)enemy).aiActor;
((GameActorHealthEffect)TormentBurnEffect).DamagePerSecondToEnemies = ((BraveBehaviour)aiActor).healthHaver.GetMaxHealth() * TormentPercentHealthDamage;
if (((BraveBehaviour)aiActor).healthHaver.IsBoss || ((BraveBehaviour)aiActor).healthHaver.IsSubboss)
{
GameActorFireEffect tormentBurnEffect = TormentBurnEffect;
((GameActorHealthEffect)tormentBurnEffect).DamagePerSecondToEnemies = ((GameActorHealthEffect)tormentBurnEffect).DamagePerSecondToEnemies * 0.25f;
}
((GameActor)aiActor).ApplyEffect((GameActorEffect)(object)TormentBurnEffect, 1f, (Projectile)null);
}
});
}
private IEnumerator ApplyTormentEffect(AIActor enemy)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ApplyTormentEffect>d__12(0)
{
<>4__this = this,
enemy = enemy
};
}
static LiandrysTorment()
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Expected O, but got Unknown
PickupObject byId = PickupObjectDatabase.GetById(99);
phoenix = (Gun)(object)((byId is Gun) ? byId : null);
TormentBurnEffect = new GameActorFireEffect
{
duration = TormentDuration,
DamagePerSecondToEnemies = 0f,
effectIdentifier = "liandrys_torment_burn",
ignitesGoops = false,
FlameVfx = phoenix.DefaultModule.projectiles[0].fireEffect.FlameVfx
};
}
}
public class Manamune : PassiveItem
{
private static float DamageStat = 1.1f;
private static float ManaflowIncreaseMax = 0.5f;
private static float ManaflowIncrementValue = 0.05f;
private static float ManaflowIncrementKillReq = 25f;
private static float MuramanaShockBaseDamage = 5f;
private float CurrentManaflowKillCount = 0f;
private int ManaflowStackCount = 0;
public static void Init()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Expected O, but got Unknown
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
string text = "Manamune";
string text2 = "LOLItems/Resources/passive_item_sprites/manamune_item_sprite";
string text3 = "LOLItems/Resources/passive_item_sprites/muramana_item_sprite";
GameObject val = new GameObject(text);
Manamune manamune = val.AddComponent<Manamune>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
tk2dBaseSprite sprite = ((BraveBehaviour)manamune).sprite;
tk2dSpriteCollectionData collection = sprite.collection;
SpriteBuilder.AddSpriteToCollection(text3, collection, (Assembly)null);
string text4 = "from the Greatest Swordsmith";
string text5 = "Created by the Greatest Swordsmith, Masamune, this sword increases the wielder's capacity for battle.\n\nLegends hint at the blade's true strength being sealed away.";
ItemBuilder.SetupItem((PickupObject)(object)manamune, text4, text5, "LOLItems");
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)manamune, (StatType)5, DamageStat, (ModifyMethod)1);
((PickupObject)manamune).quality = (ItemQuality)4;
}
public override void Pickup(PlayerController player)
{
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up Manamune");
player.OnKilledEnemy += ManaflowStack;
}
public override void DisableEffect(PlayerController player)
{
((PassiveItem)this).DisableEffect(player);
Plugin.Log("Player dropped or got rid of Manamune");
player.OnKilledEnemy -= ManaflowStack;
player.PostProcessProjectile -= MuramanaShock;
}
private void ManaflowStack(PlayerController player)
{
CurrentManaflowKillCount += 1f;
if (CurrentManaflowKillCount >= ManaflowIncrementKillReq)
{
CurrentManaflowKillCount = 0f;
ItemBuilder.RemovePassiveStatModifier((PickupObject)(object)this, (StatType)16);
ItemBuilder.RemovePassiveStatModifier((PickupObject)(object)this, (StatType)9);
ManaflowStackCount++;
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)this, (StatType)16, 1f + ManaflowIncrementValue * (float)ManaflowStackCount, (ModifyMethod)1);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)this, (StatType)9, 1f + ManaflowIncrementValue * (float)ManaflowStackCount, (ModifyMethod)1);
player.stats.RecalculateStats(player, false, false);
if ((float)ManaflowStackCount * ManaflowIncrementValue >= ManaflowIncreaseMax)
{
UpgradeToMuramana(player);
}
}
}
private void UpgradeToMuramana(PlayerController player)
{
player.OnKilledEnemy -= ManaflowStack;
player.RemovePassiveItem(((PickupObject)this).PickupObjectId);
PickupObject byName = PickupObjectDatabase.GetByName("Muramana");
PassiveItem val = (PassiveItem)(object)((byName is PassiveItem) ? byName : null);
if ((Object)(object)val != (Object)null)
{
player.AcquirePassiveItem(val);
player.PostProcessProjectile += MuramanaShock;
Plugin.Log("Manamune has been upgraded to Muramana");
}
else
{
Plugin.Log("Muramana not found in the database!");
}
}
private void MuramanaShock(Projectile proj, float f)
{
GameActor owner = proj.Owner;
PlayerController player = (PlayerController)(object)((owner is PlayerController) ? owner : null);
if (player == null)
{
return;
}
Gun currentGun = ((GameActor)player).CurrentGun;
if (currentGun == null)
{
return;
}
proj.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(proj.OnHitEnemy, (Action<Projectile, SpeculativeRigidbody, bool>)delegate(Projectile projHit, SpeculativeRigidbody enemy, bool fatal)
{
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)enemy != (Object)null && (Object)(object)((BraveBehaviour)enemy).healthHaver != (Object)null)
{
float num = Mathf.Max(0f, (player.stats.GetStatValue((StatType)16) - 1f) / 5f);
float num2 = Mathf.Max(0f, (player.stats.GetStatValue((StatType)9) - 1f) / 5f);
float num3 = Mathf.Max(1f, 1f + num + num2);
float num4 = Mathf.Max(1f, MuramanaShockBaseDamage * num3);
((BraveBehaviour)enemy).healthHaver.ApplyDamage(num4, Vector2.zero, "muramana_shock_damage", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
}
});
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("Ricky2148.etg.LOLItems", "League of legends Items", "1.0.2")]
public class Plugin : BaseUnityPlugin
{
public const string GUID = "Ricky2148.etg.LOLItems";
public const string NAME = "League of legends Items";
public const string VERSION = "1.0.2";
public const string TEXT_COLOR = "#FF007F";
public void Start()
{
ETGModMainBehaviour.WaitForGameManagerStart((Action<GameManager>)GMStart);
}
public void GMStart(GameManager g)
{
BladeOfTheRuinedKing.Init();
ExamplePassive.Register();
ExperimentalHexplate.Init();
GuardianAngel.Init();
GuinsoosRageblade.Init();
Hubris.Init();
KrakenSlayer.Init();
LiandrysTorment.Init();
Manamune.Init();
Muramana.Init();
StatikkShiv.Init();
Stridebreaker.Init();
SunfireAegis.Init();
Thornmail.Init();
ZhonyasHourglass.Init();
SoundManager.LoadSoundbanksFromAssembly((Assembly)null);
Log("League of legends Items v1.0.2 started successfully.");
}
public static void Log(string text, string color = "#FF007F")
{
ETGModConsole.Log((object)("<color=" + color + ">" + text + "</color>"), false);
}
}
public class GuinsoosRageblade : PassiveItem
{
[CompilerGenerated]
private sealed class <FirePhantomProjectileDelayed>d__8 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public Projectile proj;
public GuinsoosRageblade <>4__this;
private PlayerController <player>5__1;
private float <baseDelayRatio>5__2;
private float <gunRateOfFire>5__3;
private float <delay>5__4;
private Projectile <phantomHit>5__5;
private ProjectileData <newData>5__6;
private Vector2 <direction>5__7;
private float <angle>5__8;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <FirePhantomProjectileDelayed>d__8(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<player>5__1 = null;
<phantomHit>5__5 = null;
<newData>5__6 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Expected O, but got Unknown
//IL_01bf: 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_01ce: Unknown result type (might be due to invalid IL or missing references)
//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0206: Unknown result type (might be due to invalid IL or missing references)
//IL_020b: Unknown result type (might be due to invalid IL or missing references)
//IL_020e: Unknown result type (might be due to invalid IL or missing references)
//IL_0213: Unknown result type (might be due to invalid IL or missing references)
//IL_025a: Unknown result type (might be due to invalid IL or missing references)
//IL_026c: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
{
<>1__state = -1;
if ((Object)(object)proj == (Object)null || (Object)(object)proj.Owner == (Object)null)
{
return false;
}
ref PlayerController reference = ref <player>5__1;
GameActor owner = proj.Owner;
reference = (PlayerController)(object)((owner is PlayerController) ? owner : null);
<baseDelayRatio>5__2 = 0.3f;
<gunRateOfFire>5__3 = ((GameActor)<player>5__1).CurrentGun.DefaultModule.cooldownTime;
<delay>5__4 = Mathf.Max(<gunRateOfFire>5__3 * <baseDelayRatio>5__2, 0.01f);
<delay>5__4 = Mathf.Ceil(<delay>5__4 * 100f) / 100f;
<>2__current = (object)new WaitForSeconds(<delay>5__4);
<>1__state = 1;
return true;
}
case 1:
{
<>1__state = -1;
<phantomHit>5__5 = Object.Instantiate<Projectile>(proj);
<newData>5__6 = new ProjectileData();
<newData>5__6.damage = proj.baseData.damage;
<newData>5__6.speed = proj.baseData.speed;
<newData>5__6.range = proj.baseData.range;
<newData>5__6.force = proj.baseData.force;
<phantomHit>5__5.baseData = <newData>5__6;
<phantomHit>5__5.Owner = proj.Owner;
<phantomHit>5__5.Shooter = proj.Shooter;
((BraveBehaviour)<phantomHit>5__5).sprite.color = Color.Lerp(((BraveBehaviour)proj).sprite.color, Color.red, 0.7f);
((BraveBehaviour)<phantomHit>5__5).transform.position = ((GameActor)<player>5__1).CurrentGun.barrelOffset.position;
Vector2 lastVelocity = proj.LastVelocity;
<direction>5__7 = ((Vector2)(ref lastVelocity)).normalized;
<angle>5__8 = Mathf.Atan2(<direction>5__7.y, <direction>5__7.x) * 57.29578f;
((BraveBehaviour)<phantomHit>5__5).transform.rotation = Quaternion.Euler(0f, 0f, <angle>5__8);
<phantomHit>5__5.SendInDirection(<direction>5__7, true, true);
return false;
}
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private int phantomHitCount = 0;
private static float DamageStat = 1.25f;
private static float RateOfFireStat = 1.2f;
public static void Init()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Expected O, but got Unknown
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
string text = "Guinsoo's Rageblade";
string text2 = "LOLItems/Resources/passive_item_sprites/guinsoos_rageblade_item_sprite";
GameObject val = new GameObject(text);
GuinsoosRageblade guinsoosRageblade = val.AddComponent<GuinsoosRageblade>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "*not affiliated with Kratos*";
string text4 = "Forged in the foulest depths of the Void. These blades increase one's capacity for rage and destruction. Perhaps you should not wield them.\n";
ItemBuilder.SetupItem((PickupObject)(object)guinsoosRageblade, text3, text4, "LOLItems");
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)guinsoosRageblade, (StatType)5, DamageStat, (ModifyMethod)1);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)guinsoosRageblade, (StatType)1, RateOfFireStat, (ModifyMethod)1);
((PickupObject)guinsoosRageblade).quality = (ItemQuality)5;
}
public override void Pickup(PlayerController player)
{
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up Guinsoo's Rageblade");
player.PostProcessProjectile += OnPostProcessProjectile;
player.OnReloadedGun = (Action<PlayerController, Gun>)Delegate.Combine(player.OnReloadedGun, new Action<PlayerController, Gun>(OnGunReloaded));
}
public override void DisableEffect(PlayerController player)
{
Plugin.Log("Player dropped or got rid of Guinsoo's Rageblade");
player.PostProcessProjectile -= OnPostProcessProjectile;
phantomHitCount = 0;
player.OnReloadedGun = (Action<PlayerController, Gun>)Delegate.Remove(player.OnReloadedGun, new Action<PlayerController, Gun>(OnGunReloaded));
}
private void OnPostProcessProjectile(Projectile proj, float f)
{
phantomHitCount++;
if (phantomHitCount >= 3)
{
GameActor owner = proj.Owner;
PlayerController val = (PlayerController)(object)((owner is PlayerController) ? owner : null);
phantomHitCount = 0;
((MonoBehaviour)val).StartCoroutine(FirePhantomProjectileDelayed(proj));
}
}
private void OnGunReloaded(PlayerController player, Gun gun)
{
phantomHitCount = 0;
}
private IEnumerator FirePhantomProjectileDelayed(Projectile proj)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <FirePhantomProjectileDelayed>d__8(0)
{
<>4__this = this,
proj = proj
};
}
}
internal class Redemption : TargetedAttackPlayerItem
{
private static float HealthStat = 1f;
private static float HealthToGive = 1f;
private static float InterventionPercentMaxHealth = 10f;
private static float InterventionHealAmount = 0.5f;
private static float InterventionActivationRange = 10f;
private static float InterventionEffectRadius = 5f;
private static float InterventionCooldown = 90f;
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_006f: Unknown result type (might be due to invalid IL or missing references)
string text = "Redemption";
string text2 = "LOLItems/Resources/passive_item_sprites/redemption_item_sprite";
GameObject val = new GameObject(text);
Redemption redemption = val.AddComponent<Redemption>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "Break their stride.";
string text4 = "Increases health, damage, and fire rate. Active attacks in a circle around the player, slowing enemies hit and dealing set damage.";
ItemBuilder.SetupItem((PickupObject)(object)redemption, text3, text4, "LOLItems");
ItemBuilder.SetCooldownType((PlayerItem)(object)redemption, (CooldownType)0, InterventionCooldown);
((PlayerItem)redemption).consumable = false;
((TargetedAttackPlayerItem)redemption).minDistance = 0f;
((TargetedAttackPlayerItem)redemption).maxDistance = InterventionActivationRange;
((PickupObject)redemption).quality = (ItemQuality)4;
}
public override void Pickup(PlayerController player)
{
((PlayerItem)this).Pickup(player);
Plugin.Log("Player picked up Redemption");
((BraveBehaviour)player).healthHaver.SetHealthMaximum(((BraveBehaviour)player).healthHaver.GetMaxHealth() + HealthStat, (float?)HealthToGive, false);
HealthToGive = 0f;
}
public DebrisObject Drop(PlayerController player)
{
Plugin.Log("Player dropped or got rid of Redemption");
((BraveBehaviour)player).healthHaver.SetHealthMaximum(((BraveBehaviour)player).healthHaver.GetMaxHealth() - HealthStat, (float?)null, false);
return ((PlayerItem)this).Drop(player, 4f);
}
public override void DoEffect(PlayerController player)
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
((PlayerItem)this).IsCurrentlyActive = true;
base.m_currentUser = player;
PickupObject byId = PickupObjectDatabase.GetById(462);
GameObject reticleQuad = ((TargetedAttackPlayerItem)((byId is TargetedAttackPlayerItem) ? byId : null)).reticleQuad;
base.m_extantReticleQuad = reticleQuad.GetComponent<tk2dBaseSprite>();
base.m_currentAngle = BraveMathCollege.Atan2Degrees(Vector3Extensions.XY(base.m_currentUser.unadjustedAimPoint) - ((GameActor)base.m_currentUser).CenterPosition);
base.m_currentDistance = 5f;
((TargetedAttackPlayerItem)this).UpdateReticlePosition();
((BraveBehaviour)this).spriteAnimator.Play("Activate");
}
public override void DoActiveEffect(PlayerController user)
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_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_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Expected O, but got Unknown
if (Object.op_Implicit((Object)(object)user) && user.CurrentRoom != null)
{
Vector2 val = Vector2.op_Implicit(((Component)base.m_extantReticleQuad).gameObject.transform.position + new Vector3(0f, 0.25f));
if (Object.op_Implicit((Object)(object)base.m_extantReticleQuad))
{
Object.Destroy((Object)(object)((Component)base.m_extantReticleQuad).gameObject);
}
((PlayerItem)this).IsCurrentlyActive = true;
AkSoundEngine.PostEvent("Play_OBJ_computer_boop_01", ((Component)user).gameObject);
Exploder.Explode(Vector2.op_Implicit(val), new ExplosionData
{
damage = 40f,
damageRadius = 5f,
doDamage = true,
doForce = true,
force = 25f,
debrisForce = 10f,
preventPlayerForce = true,
doScreenShake = true,
playDefaultSFX = true
}, Vector2.zero, (Action)null, false, (CoreDamageTypes)0, false);
((PlayerItem)this).IsCurrentlyActive = false;
user.DropActiveItem((PlayerItem)(object)this, 4f, false);
}
}
}
internal class StatikkShiv : PassiveItem
{
private static float DamageStat = 1.2f;
private static float RateOfFireStat = 1.1f;
private int ElectroSparkShotCount = 3;
private static float ElectroSparkDamage = 5f;
private static float ElectroSparkChainCount = 5f;
private static float ElectroSparkChainRange = 5f;
public static void Init()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Expected O, but got Unknown
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
string text = "Statikk Shiv";
string text2 = "LOLItems/Resources/passive_item_sprites/statikk_shiv_item_sprite";
GameObject val = new GameObject(text);
StatikkShiv statikkShiv = val.AddComponent<StatikkShiv>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "*shocks you*";
string text4 = "Supposed to be a replica of Zeus's Lightning Bolt.\njust a shiv with a taser\n";
ItemBuilder.SetupItem((PickupObject)(object)statikkShiv, text3, text4, "LOLItems");
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)statikkShiv, (StatType)5, DamageStat, (ModifyMethod)1);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)statikkShiv, (StatType)1, RateOfFireStat, (ModifyMethod)1);
((PickupObject)statikkShiv).quality = (ItemQuality)4;
}
public override void Pickup(PlayerController player)
{
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up Statikk Shiv");
player.PostProcessProjectile += OnPostProcessProjectile;
player.OnReloadedGun = (Action<PlayerController, Gun>)Delegate.Combine(player.OnReloadedGun, new Action<PlayerController, Gun>(ResetElectroSpark));
ElectroSparkShotCount = 3;
}
public override void DisableEffect(PlayerController player)
{
((PassiveItem)this).DisableEffect(player);
Plugin.Log("Player dropped or got rid of Statikk Shiv");
player.PostProcessProjectile -= OnPostProcessProjectile;
player.OnReloadedGun = (Action<PlayerController, Gun>)Delegate.Remove(player.OnReloadedGun, new Action<PlayerController, Gun>(ResetElectroSpark));
}
private void OnPostProcessProjectile(Projectile proj, float f)
{
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
GameActor owner = proj.Owner;
PlayerController val = (PlayerController)(object)((owner is PlayerController) ? owner : null);
if (val != null)
{
Gun currentGun = ((GameActor)val).CurrentGun;
if (currentGun != null && ElectroSparkShotCount > 0)
{
PickupObject byId = PickupObjectDatabase.GetById(298);
ComplexProjectileModifier val2 = (ComplexProjectileModifier)(object)((byId is ComplexProjectileModifier) ? byId : null);
CustomLightningChainEnemiesModifier orAddComponent = GameObjectExtensions.GetOrAddComponent<CustomLightningChainEnemiesModifier>(((Component)proj).gameObject);
orAddComponent.LinkVFXPrefab = val2.ChainLightningVFX;
orAddComponent.damageTypes = (CoreDamageTypes)64;
orAddComponent.maximumLinkDistance = ElectroSparkChainRange;
orAddComponent.damagePerHit = ElectroSparkDamage;
orAddComponent.maxLinkCount = ElectroSparkChainCount;
orAddComponent.DispersalDensity = 5f;
orAddComponent.DispersalMaxCoherency = 0.7f;
orAddComponent.DispersalMinCoherency = 0.3f;
orAddComponent.UsesDispersalParticles = false;
orAddComponent.vfxPath = "statikk_shiv_lightning_SFX";
ElectroSparkShotCount--;
}
}
}
private void ResetElectroSpark(PlayerController player, Gun gun)
{
ElectroSparkShotCount = 3;
}
}
internal class Stridebreaker : PlayerItem
{
private static float DamageStat = 1.1f;
private static float RateOfFireStat = 1.1f;
private static float HealthStat = 1f;
private static float HealthToGive = 1f;
private static float slowPercent = 0.3f;
private static float slowDuration = 3f;
private static float ShockwaveDamage = 10f;
private static float ShockwaveRadius = 6f;
private static float ShockwaveCooldown = 15f;
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_007c: Unknown result type (might be due to invalid IL or missing references)
string text = "Stridebreaker";
string text2 = "LOLItems/Resources/passive_item_sprites/stridebreaker_item_sprite";
GameObject val = new GameObject(text);
Stridebreaker stridebreaker = val.AddComponent<Stridebreaker>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "\"No more cages!\"";
string text4 = "A set of chains that appears to have been used as a weapon. The chains feel cold to the touch and seem to instill a feeling of rebellion within you.\n";
ItemBuilder.SetupItem((PickupObject)(object)stridebreaker, text3, text4, "LOLItems");
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)stridebreaker, (StatType)5, DamageStat, (ModifyMethod)1);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)stridebreaker, (StatType)1, RateOfFireStat, (ModifyMethod)1);
ItemBuilder.SetCooldownType((PlayerItem)(object)stridebreaker, (CooldownType)0, ShockwaveCooldown);
((PlayerItem)stridebreaker).consumable = false;
((PlayerItem)stridebreaker).usableDuringDodgeRoll = true;
((PickupObject)stridebreaker).quality = (ItemQuality)4;
}
public override void Pickup(PlayerController player)
{
((PlayerItem)this).Pickup(player);
Plugin.Log("Player picked up Stridebreaker");
((BraveBehaviour)player).healthHaver.SetHealthMaximum(((BraveBehaviour)player).healthHaver.GetMaxHealth() + HealthStat, (float?)HealthToGive, false);
HealthToGive = 0f;
}
public DebrisObject Drop(PlayerController player)
{
Plugin.Log("Player dropped or got rid of Stridebreaker");
((BraveBehaviour)player).healthHaver.SetHealthMaximum(((BraveBehaviour)player).healthHaver.GetMaxHealth() - HealthStat, (float?)null, false);
ItemBuilder.RemovePassiveStatModifier((PickupObject)(object)this, (StatType)5);
ItemBuilder.RemovePassiveStatModifier((PickupObject)(object)this, (StatType)1);
player.stats.RecalculateStats(player, false, false);
return ((PlayerItem)this).Drop(player, 4f);
}
public override void DoEffect(PlayerController player)
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: 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_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: 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)
//IL_0135: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: Expected O, but got Unknown
//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_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_0194: 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_01c6: Unknown result type (might be due to invalid IL or missing references)
AkSoundEngine.PostEvent("stridebreaker_active_SFX", ((Component)player).gameObject);
GameObject effect = ((Gun)PickupObjectDatabase.GetById(417)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects[0].effects[0].effect;
if ((Object)(object)effect != (Object)null)
{
GameObject val = Object.Instantiate<GameObject>(effect, Vector2.op_Implicit(((GameActor)player).CenterPosition), Quaternion.identity);
val.SetActive(true);
tk2dSprite component = val.GetComponent<tk2dSprite>();
if ((Object)(object)component != (Object)null)
{
((tk2dBaseSprite)component).HeightOffGround = 3f;
((tk2dBaseSprite)component).scale = new Vector3(8f, 8f, 1f);
((tk2dBaseSprite)component).color = new Color(0.6f, 0.6f, 0.6f);
((tk2dBaseSprite)component).UpdateZDepth();
}
tk2dSpriteAnimator component2 = val.GetComponent<tk2dSpriteAnimator>();
if ((Object)(object)component2 != (Object)null)
{
component2.Play();
}
}
GameActorSpeedEffect val2 = new GameActorSpeedEffect
{
duration = slowDuration,
effectIdentifier = "stridebreaker_active_slow",
resistanceType = (EffectResistanceType)3,
AppliesOutlineTint = true,
OutlineTintColor = Color.gray,
SpeedMultiplier = slowPercent
};
foreach (AIActor activeEnemy in player.CurrentRoom.GetActiveEnemies((ActiveEnemyType)0))
{
if ((Object)(object)activeEnemy != (Object)null && (Object)(object)((BraveBehaviour)activeEnemy).healthHaver != (Object)null && ((BraveBehaviour)activeEnemy).healthHaver.IsVulnerable)
{
float num = Vector2.Distance(((GameActor)player).CenterPosition, ((GameActor)activeEnemy).CenterPosition);
if (num <= ShockwaveRadius)
{
((BraveBehaviour)activeEnemy).healthHaver.ApplyDamage(ShockwaveDamage, Vector2.zero, "Stridebreaker", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
((GameActor)activeEnemy).ApplyEffect((GameActorEffect)(object)val2, 1f, (Projectile)null);
AkSoundEngine.PostEvent("stridebreaker_active_hit_SFX", ((Component)player).gameObject);
}
}
}
}
}
internal class Thornmail : PassiveItem
{
private static float HealthStat = 1f;
private static float HealthToGive = 1f;
private static float ArmorStat = 1f;
private bool hasGainedArmor = false;
private static float ThornsDamage = 30f;
private static float ThornsRadius = 10f;
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_0045: Unknown result type (might be due to invalid IL or missing references)
string text = "Thornmail";
string text2 = "LOLItems/Resources/passive_item_sprites/thornmail_item_sprite";
GameObject val = new GameObject(text);
Thornmail thornmail = val.AddComponent<Thornmail>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "social distancing";
string text4 = "Armor with spikes. Spikes hurt. Don't touch wearer, spikes will hurt. Spikes on armor. Armor under spikes. Armor hurts. Because spikes hurt. Don't touch armor. Armor hurts.\n";
ItemBuilder.SetupItem((PickupObject)(object)thornmail, text3, text4, "LOLItems");
((PickupObject)thornmail).quality = (ItemQuality)4;
}
public override void Pickup(PlayerController player)
{
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Expected O, but got Unknown
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up Thornmail");
((BraveBehaviour)player).healthHaver.SetHealthMaximum(((BraveBehaviour)player).healthHaver.GetMaxHealth() + HealthStat, (float?)HealthToGive, false);
HealthToGive = 0f;
if (!hasGainedArmor)
{
HealthHaver healthHaver = ((BraveBehaviour)player).healthHaver;
healthHaver.Armor += ArmorStat;
}
hasGainedArmor = true;
((BraveBehaviour)player).healthHaver.OnDamaged += new OnDamagedEvent(OnPlayerDamaged);
}
public override void DisableEffect(PlayerController player)
{
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Expected O, but got Unknown
((PassiveItem)this).DisableEffect(player);
Plugin.Log("Player dropped or got rid of Thornmail");
((BraveBehaviour)player).healthHaver.SetHealthMaximum(((BraveBehaviour)player).healthHaver.GetMaxHealth() - HealthStat, (float?)null, false);
((BraveBehaviour)player).healthHaver.OnDamaged -= new OnDamagedEvent(OnPlayerDamaged);
}
private void DoBlankDamage(PlayerController player)
{
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
if (player.CurrentRoom == null)
{
return;
}
foreach (AIActor activeEnemy in player.CurrentRoom.GetActiveEnemies((ActiveEnemyType)0))
{
if ((Object)(object)activeEnemy != (Object)null && (Object)(object)((BraveBehaviour)activeEnemy).healthHaver != (Object)null && ((BraveBehaviour)activeEnemy).healthHaver.IsVulnerable)
{
float num = Vector2.Distance(((GameActor)player).CenterPosition, ((GameActor)activeEnemy).CenterPosition);
if (num <= ThornsRadius)
{
((BraveBehaviour)activeEnemy).healthHaver.ApplyDamage(ThornsDamage, Vector2.zero, "Blank Damage", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
}
}
}
}
private void OnPlayerDamaged(float resultValue, float maxValue, CoreDamageTypes damageTypes, DamageCategory damageCategory, Vector2 damageDirection)
{
PlayerController owner = ((PassiveItem)this).Owner;
owner.ForceBlank(25f, 0.5f, false, true, (Vector2?)null, true, -1f);
DoBlankDamage(owner);
}
}
internal class ZhonyasHourglass : PlayerItem
{
[CompilerGenerated]
private sealed class <StasisCoroutine>d__8 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public PlayerController player;
public ZhonyasHourglass <>4__this;
private Color <originalColor>5__1;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <StasisCoroutine>d__8(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Expected O, but got Unknown
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
((BraveBehaviour)player).healthHaver.TriggerInvulnerabilityPeriod(StasisDuration);
player.CurrentInputState = (PlayerInputState)1;
<originalColor>5__1 = ((BraveBehaviour)player).sprite.color;
((BraveBehaviour)player).sprite.color = Color.yellow;
AkSoundEngine.PostEvent("zhonyas_hourglass_activation_SFX", ((Component)GameManager.Instance).gameObject);
<>2__current = (object)new WaitForSeconds(StasisDuration);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
((BraveBehaviour)player).sprite.color = <originalColor>5__1;
player.ForceBlank(25f, 0.5f, false, true, (Vector2?)null, true, -1f);
player.CurrentInputState = (PlayerInputState)0;
((BraveBehaviour)player).healthHaver.PreventAllDamage = false;
AkSoundEngine.PostEvent("zhonyas_hourglass_ending_SFX", ((Component)GameManager.Instance).gameObject);
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private static float ArmorStat = 2f;
private bool hasGainedArmor = false;
private static float StasisDuration = 2.5f;
private static float StasisCooldown = 120f;
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 text = "Zhonya's Hourglass";
string text2 = "LOLItems/Resources/passive_item_sprites/zhonyas_hourglass_item_sprite";
GameObject val = new GameObject(text);
ZhonyasHourglass zhonyasHourglass = val.AddComponent<ZhonyasHourglass>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "Borrowed Time";
string text4 = "A sand stopwatch that allows the user to suspend their life for a few moments. It's believed that a pharaoh used it to reminisce his last moments during his empire's fall.\n";
ItemBuilder.SetupItem((PickupObject)(object)zhonyasHourglass, text3, text4, "LOLItems");
ItemBuilder.SetCooldownType((PlayerItem)(object)zhonyasHourglass, (CooldownType)0, StasisCooldown);
((PlayerItem)zhonyasHourglass).consumable = false;
((PlayerItem)zhonyasHourglass).usableDuringDodgeRoll = true;
((PickupObject)zhonyasHourglass).quality = (ItemQuality)4;
}
public override void Pickup(PlayerController player)
{
((PlayerItem)this).Pickup(player);
Plugin.Log("Player picked up Zhonya's Hourglass");
if (!hasGainedArmor)
{
HealthHaver healthHaver = ((BraveBehaviour)player).healthHaver;
healthHaver.Armor += ArmorStat;
}
hasGainedArmor = true;
}
public DebrisObject Drop(PlayerController player)
{
Plugin.Log("Player dropped or got rid of Guardian Angel");
return ((PlayerItem)this).Drop(player, 4f);
}
public override void DoEffect(PlayerController player)
{
((MonoBehaviour)player).StartCoroutine(StasisCoroutine(player));
}
private IEnumerator StasisCoroutine(PlayerController player)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <StasisCoroutine>d__8(0)
{
<>4__this = this,
player = player
};
}
}
}