Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of PhreelVariants v1.0.0
plugins/PhreelVariants/PhreelVariants.dll
Decompiled 2 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Assassin2; using EntityStates.EngiTurret.EngiTurretWeapon; using EntityStates.GolemMonster; using EntityStates.Mage.Weapon; using EntityStates.MajorConstruct.Weapon; using HG; using HG.Reflection; using MSU; using Microsoft.CodeAnalysis; using On; using On.EntityStates.Assassin2; using On.EntityStates.MajorConstruct.Weapon; using On.RoR2; using On.RoR2.Projectile; using RoR2; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.Projectile; using RoR2BepInExPack.GameAssetPathsBetter; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using VAPI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("PhreelVariants")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+c988079955e49d627ea90ee7f89be9a0c0585f20")] [assembly: AssemblyProduct("PhreelVariants")] [assembly: AssemblyTitle("PhreelVariants")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace PhreelVariants { [Flags] internal enum Band { None = 0, Kjaro = 1, Runald = 2, Singularity = 4 } internal readonly struct Dot { internal readonly DotIndex index; internal readonly float duration; internal readonly uint? maxStacks; internal Dot(DotIndex index, float duration, uint? maxStacks = null) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) this.index = index; this.duration = duration; this.maxStacks = maxStacks; } } internal sealed class Attack { internal int shots = 1; internal float spread; internal float projectileSpeed; internal float projectileLift; internal float beamScale = 1f; internal float range; internal Dot[] dots = Array.Empty<Dot>(); internal bool dotWhileAttached; internal bool attackWhileCloaked; internal bool tarOnHit; internal float deathBlastDamage; internal float deathBlastRadius; internal bool lob; internal SkillSlot[] disabledSlots = Array.Empty<SkillSlot>(); internal (string from, Type to)[] stateSwaps = Array.Empty<(string, Type)>(); internal (string alias, string child)[] childAliases = Array.Empty<(string, string)>(); internal string aimFrom; internal string impactProjectile; internal float impactInterval; internal string projectileSwap; internal string[] impactStates = Array.Empty<string>(); internal Band band; internal float fogRadius; internal string extraProjectile; internal int extraShots = 1; internal float extraInterval; internal float extraDamage; internal float extraSpread = 20f; internal Color? extraTint; internal float blindRadius; internal string summonVariant; internal string guardMaster; internal int guards; internal Attack Merge(Attack other) { return new Attack { shots = Mathf.Max(shots, other.shots), spread = Mathf.Max(spread, other.spread), projectileSpeed = Mathf.Max(projectileSpeed, other.projectileSpeed), projectileLift = Mathf.Max(projectileLift, other.projectileLift), beamScale = Mathf.Max(beamScale, other.beamScale), range = Mathf.Max(range, other.range), dots = dots.Concat(other.dots).ToArray(), dotWhileAttached = (dotWhileAttached || other.dotWhileAttached), attackWhileCloaked = (attackWhileCloaked || other.attackWhileCloaked), tarOnHit = (tarOnHit || other.tarOnHit), deathBlastDamage = Mathf.Max(deathBlastDamage, other.deathBlastDamage), deathBlastRadius = Mathf.Max(deathBlastRadius, other.deathBlastRadius), lob = (lob || other.lob), disabledSlots = disabledSlots.Union(other.disabledSlots).ToArray(), stateSwaps = stateSwaps.Union(other.stateSwaps).ToArray(), childAliases = childAliases.Union(other.childAliases).ToArray(), aimFrom = (aimFrom ?? other.aimFrom), impactProjectile = (impactProjectile ?? other.impactProjectile), impactInterval = ((impactProjectile != null) ? impactInterval : other.impactInterval), projectileSwap = (projectileSwap ?? other.projectileSwap), impactStates = impactStates.Union(other.impactStates).ToArray(), band = (band | other.band), fogRadius = Mathf.Max(fogRadius, other.fogRadius), extraProjectile = (extraProjectile ?? other.extraProjectile), extraShots = ((extraProjectile != null) ? extraShots : other.extraShots), extraInterval = ((extraProjectile != null) ? extraInterval : other.extraInterval), extraDamage = ((extraProjectile != null) ? extraDamage : other.extraDamage), extraSpread = ((extraProjectile != null) ? extraSpread : other.extraSpread), extraTint = ((extraProjectile != null) ? extraTint : other.extraTint), blindRadius = Mathf.Max(blindRadius, other.blindRadius), summonVariant = (summonVariant ?? other.summonVariant), guardMaster = (guardMaster ?? other.guardMaster), guards = Mathf.Max(guards, other.guards) }; } } internal sealed class AttackTweaks : MonoBehaviour { internal Attack attack; internal float cloakShotTimer; internal float lastImpactTime = float.NegativeInfinity; private float attachedDotTimer; private float extraTimer; private float auraTimer; private void Start() { if (NetworkServer.active && attack.guards > 0) { Attacks.SummonGuards(((Component)this).GetComponent<CharacterBody>(), attack); } } private void FixedUpdate() { if (!NetworkServer.active) { return; } CharacterBody component = ((Component)this).GetComponent<CharacterBody>(); if (attack.extraProjectile != null && (extraTimer -= Time.fixedDeltaTime) <= 0f) { extraTimer = attack.extraInterval; Attacks.FireExtra(component, attack); } if ((attack.blindRadius > 0f || attack.fogRadius > 0f) && (auraTimer -= Time.fixedDeltaTime) <= 0f) { auraTimer = 0.5f; if (attack.blindRadius > 0f) { Attacks.Blind(component, attack.blindRadius); } if (attack.fogRadius > 0f) { Attacks.Fog(component, attack.fogRadius, auraTimer); } } if (!attack.dotWhileAttached || (attachedDotTimer -= Time.fixedDeltaTime) > 0f) { return; } attachedDotTimer = 0.5f; EntityStateMachine val = EntityStateMachine.FindByCustomName(((Component)this).gameObject, "Body"); object obj = (Object.op_Implicit((Object)(object)val) ? val.state : null); object? obj2 = obj?.GetType().GetField("riddenBody")?.GetValue(obj); CharacterBody val2 = (CharacterBody)((obj2 is CharacterBody) ? obj2 : null); if (val2 != null && Object.op_Implicit((Object)(object)val2)) { Dot[] dots = attack.dots; foreach (Dot dot in dots) { Attacks.ApplyDot(((Component)val2).gameObject, ((Component)this).gameObject, dot); } } } } internal sealed class AttackBodyModifier : IVariantBodyModifier, IValidatable, ICloneable { internal Attack attack; public IDisposable ModifyBody(CharacterBody body) { AttackTweaks component = ((Component)body).GetComponent<AttackTweaks>(); if (Object.op_Implicit((Object)(object)component)) { component.attack = component.attack.Merge(attack); } else { ((Component)body).gameObject.AddComponent<AttackTweaks>().attack = attack; } ChildLocator val = ((Object.op_Implicit((Object)(object)body.modelLocator) && Object.op_Implicit((Object)(object)body.modelLocator.modelTransform)) ? ((Component)body.modelLocator.modelTransform).GetComponent<ChildLocator>() : null); if (attack.aimFrom != null && Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.FindChild(attack.aimFrom))) { body.aimOriginTransform = val.FindChild(attack.aimFrom); } if (attack.fogRadius > 0f) { Attacks.AddDome(body, attack.fogRadius); } return null; } public void Validate() { } public object Clone() { return new AttackBodyModifier { attack = attack }; } } internal sealed class AttackAIModifier : IVariantMasterModifier, IValidatable, ICloneable { internal Attack attack; public IDisposable ModifyMaster(CharacterMaster master) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Invalid comparison between Unknown and I4 AISkillDriver[] components = ((Component)master).GetComponents<AISkillDriver>(); foreach (AISkillDriver val in components) { if (attack.disabledSlots.Contains(val.skillSlot)) { val.minDistance = float.PositiveInfinity; } else if (attack.range > 0f && (int)val.skillSlot != -1 && val.maxDistance > 20f) { val.maxDistance = attack.range; } if (attack.range > 0f && val.minDistance > attack.range && !float.IsPositiveInfinity(val.minDistance)) { val.minDistance = attack.range; } } return null; } public void Validate() { } public object Clone() { return new AttackAIModifier { attack = attack }; } } internal static class Attacks { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_FindChildIndex_string <>9__6_0; public static hook_SetState <>9__6_1; public static hook_DetonateServer <>9__6_2; public static hook_OnProjectileImpact <>9__6_3; public static hook_Start <>9__6_4; public static Action<MasterSummonReport> <>9__6_5; public static Action<SpawnResult> <>9__6_6; public static hook_FireProjectile_FireProjectileInfo <>9__6_7; public static hook_TakeDamage <>9__6_8; public static Action<DamageReport> <>9__6_9; public static hook_FixedUpdate <>9__6_10; public static hook_UpdateMaterials <>9__6_11; public static hook_OnEnter <>9__6_12; public static hook_ModifyBullet <>9__6_13; internal int <Init>b__6_0(orig_FindChildIndex_string orig, ChildLocator self, string childName) { int num = orig.Invoke(self, childName); CharacterModel val = default(CharacterModel); AttackTweaks attackTweaks = default(AttackTweaks); if (num != -1 || !((Component)self).TryGetComponent<CharacterModel>(ref val) || !Object.op_Implicit((Object)(object)val.body) || !((Component)val.body).TryGetComponent<AttackTweaks>(ref attackTweaks)) { return num; } (string, string)[] childAliases = attackTweaks.attack.childAliases; for (int i = 0; i < childAliases.Length; i++) { var (text, text2) = childAliases[i]; if (text == childName) { return orig.Invoke(self, text2); } } return num; } internal void <Init>b__6_1(orig_SetState orig, EntityStateMachine self, EntityState newState) { AttackTweaks attackTweaks = default(AttackTweaks); if (newState != null && ((Component)self).TryGetComponent<AttackTweaks>(ref attackTweaks)) { string fullName = ((object)newState).GetType().FullName; CharacterBody body = default(CharacterBody); if (NetworkServer.active && attackTweaks.attack.band != Band.None && attackTweaks.attack.impactStates.Contains(fullName) && ((Component)self).TryGetComponent<CharacterBody>(ref body)) { BandBurst(body, attackTweaks.attack.band); } (string, Type)[] stateSwaps = attackTweaks.attack.stateSwaps; for (int i = 0; i < stateSwaps.Length; i++) { var (text, type) = stateSwaps[i]; if (fullName == text) { newState = EntityStateCatalog.InstantiateState(type); break; } } } orig.Invoke(self, newState); } internal void <Init>b__6_2(orig_DetonateServer orig, ProjectileExplosion self) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) string text = ImpactProjectile(self.projectileController); if (text == null) { orig.Invoke(self); return; } self.fireChildren = false; orig.Invoke(self); SpawnImpactProjectile(text, self.projectileController.owner, ((Component)self).transform.position, self.projectileDamage); } internal void <Init>b__6_3(orig_OnProjectileImpact orig, ProjectileSingleTargetImpact self, ProjectileImpactInfo impactInfo) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) bool alive = self.alive; orig.Invoke(self, impactInfo); string text = ((NetworkServer.active && alive && !self.alive) ? ImpactProjectile(self.projectileController) : null); if (text != null) { SpawnImpactProjectile(text, self.projectileController.owner, impactInfo.estimatedPointOfImpact, self.projectileDamage); } } internal void <Init>b__6_4(orig_Start orig, ProjectileController self) { //IL_0084: Unknown result type (might be due to invalid IL or missing references) AttackTweaks attackTweaks = default(AttackTweaks); if (Object.op_Implicit((Object)(object)self.owner) && self.owner.TryGetComponent<AttackTweaks>(ref attackTweaks) && attackTweaks.attack.extraTint.HasValue && ((Object)self).name.StartsWith(((Object)Load(attackTweaks.attack.extraProjectile)).name)) { self.ghostAssetOrDirectReference.LoadAsync(); GameObject val = self.ghostAssetOrDirectReference.WaitForCompletion(); if (Object.op_Implicit((Object)(object)val)) { self.ghostAssetOrDirectReference.directRef = TintedGhost(val, attackTweaks.attack.extraTint.Value); } } orig.Invoke(self); } internal void <Init>b__6_5(MasterSummonReport report) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GiveSummonVariant(report.masterSummon.summonerBodyObject, ((Component)report.summonMasterInstance).gameObject); } internal void <Init>b__6_6(SpawnResult result) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (result.success && result.spawnRequest != null) { GiveSummonVariant(result.spawnRequest.summonerBodyObject, result.spawnedInstance); } } internal void <Init>b__6_7(orig_FireProjectile_FireProjectileInfo orig, ProjectileManager self, FireProjectileInfo info) { //IL_0000: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) AttackTweaks attackTweaks = default(AttackTweaks); Attack attack = ((Object.op_Implicit((Object)(object)info.owner) && info.owner.TryGetComponent<AttackTweaks>(ref attackTweaks)) ? attackTweaks.attack : null); if (attack == null) { orig.Invoke(self, info); return; } if (attack.projectileSwap != null) { info.projectilePrefab = Load(attack.projectileSwap); } if (attack.projectileSpeed > 0f && !UsesGravity(info.projectilePrefab)) { ((FireProjectileInfo)(ref info)).speedOverride = attack.projectileSpeed; } ref Vector3 position = ref info.position; position += Vector3.up * attack.projectileLift; if (attack.lob) { Lob(ref info); } Quaternion rotation = info.rotation; for (int i = 0; i < attack.shots; i++) { if (attack.spread > 0f) { info.rotation = Util.QuaternionSafeLookRotation(Util.ApplySpread(rotation * Vector3.forward, 0f, attack.spread, 1f, 1f, 0f, 0f)); } orig.Invoke(self, info); } } internal void <Init>b__6_8(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { orig.Invoke(self, damageInfo); AttackTweaks attackTweaks = default(AttackTweaks); if (Object.op_Implicit((Object)(object)damageInfo.attacker) && damageInfo.attacker.TryGetComponent<AttackTweaks>(ref attackTweaks) && !attackTweaks.attack.dotWhileAttached && self.alive) { Dot[] dots = attackTweaks.attack.dots; foreach (Dot dot in dots) { ApplyDot(((Component)self).gameObject, damageInfo.attacker, dot); } } AttackTweaks attackTweaks2 = default(AttackTweaks); if (Object.op_Implicit((Object)(object)damageInfo.attacker) && damageInfo.attacker.TryGetComponent<AttackTweaks>(ref attackTweaks2) && attackTweaks2.attack.tarOnHit && self.alive && Object.op_Implicit((Object)(object)self.body)) { self.body.AddTimedBuff(Buffs.ClayGoo, 5f); } } internal void <Init>b__6_9(DamageReport report) { //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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown CharacterBody victimBody = report.victimBody; AttackTweaks attackTweaks = default(AttackTweaks); if (Object.op_Implicit((Object)(object)victimBody) && ((Component)victimBody).TryGetComponent<AttackTweaks>(ref attackTweaks) && !(attackTweaks.attack.deathBlastRadius <= 0f)) { new BlastAttack { attacker = ((Component)victimBody).gameObject, inflictor = ((Component)victimBody).gameObject, teamIndex = report.victimTeamIndex, position = victimBody.corePosition, radius = attackTweaks.attack.deathBlastRadius, baseDamage = victimBody.damage * attackTweaks.attack.deathBlastDamage, procCoefficient = 0f, falloffModel = (FalloffModel)0 }.Fire(); EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/OmniEffect/OmniExplosionVFXQuick"), new EffectData { origin = victimBody.corePosition, scale = attackTweaks.attack.deathBlastRadius }, true); } } internal void <Init>b__6_10(orig_FixedUpdate orig, Hide self) { orig.Invoke(self); AttackTweaks attackTweaks = default(AttackTweaks); if (((EntityState)self).isAuthority && ((Component)((EntityState)self).outer).TryGetComponent<AttackTweaks>(ref attackTweaks) && attackTweaks.attack.attackWhileCloaked && ((EntityState)self).characterBody.hasCloakBuff) { attackTweaks.cloakShotTimer -= Time.fixedDeltaTime; if (!(attackTweaks.cloakShotTimer > 0f)) { attackTweaks.cloakShotTimer = 1f; ThrowCloakedShuriken(((EntityState)self).characterBody); } } } internal void <Init>b__6_11(orig_UpdateMaterials orig, CharacterModel self) { orig.Invoke(self); VariantDefs.ColorRamp colorRamp = default(VariantDefs.ColorRamp); if (((Component)self).TryGetComponent<VariantDefs.ColorRamp>(ref colorRamp) && (!Object.op_Implicit((Object)(object)self.body) || !self.body.isElite)) { colorRamp.Apply(self); } } internal void <Init>b__6_12(orig_OnEnter orig, FireLaser self) { AttackTweaks attackTweaks = default(AttackTweaks); if (((Component)((EntityState)self).outer).TryGetComponent<AttackTweaks>(ref attackTweaks) && attackTweaks.attack.beamScale != 1f && Object.op_Implicit((Object)(object)((FireBeam)self).laserPrefab)) { ((FireBeam)self).laserPrefab = ScaledBeam(((FireBeam)self).laserPrefab, attackTweaks.attack.beamScale); } orig.Invoke(self); } internal void <Init>b__6_13(orig_ModifyBullet orig, FireLaser self, BulletAttack bullet) { orig.Invoke(self, bullet); AttackTweaks attackTweaks = default(AttackTweaks); if (((Component)((EntityState)self).outer).TryGetComponent<AttackTweaks>(ref attackTweaks) && attackTweaks.attack.beamScale != 1f) { bullet.radius = Mathf.Max(bullet.radius, 1f) * attackTweaks.attack.beamScale; bullet.smartCollision = true; } } } private static readonly Dictionary<GameObject, GameObject> scaledBeams = new Dictionary<GameObject, GameObject>(); private static readonly Dictionary<(GameObject, Color), GameObject> tintedGhosts = new Dictionary<(GameObject, Color), GameObject>(); private static readonly Dictionary<string, GameObject> loaded = new Dictionary<string, GameObject>(); private static Transform prefabHolder; private static ThrowShuriken shuriken; internal static GameObject Load(string key) { //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) if (loaded.TryGetValue(key, out var value)) { return value; } value = Addressables.LoadAssetAsync<GameObject>((object)key).WaitForCompletion(); if (!Object.op_Implicit((Object)(object)value)) { Log.Error("Couldn't load asset " + key, "D:\\Games\\LostItems\\phreelvariants\\PhreelVariants\\Attacks.cs", "Load", 194); } return loaded[key] = value; } internal static void Init() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //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_0043: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_0134: 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_013f: Expected O, but got Unknown //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Expected O, but got Unknown //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Expected O, but got Unknown //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Expected O, but got Unknown object obj = <>c.<>9__6_0; if (obj == null) { hook_FindChildIndex_string val = delegate(orig_FindChildIndex_string orig, ChildLocator self, string childName) { int num = orig.Invoke(self, childName); CharacterModel val12 = default(CharacterModel); AttackTweaks attackTweaks = default(AttackTweaks); if (num != -1 || !((Component)self).TryGetComponent<CharacterModel>(ref val12) || !Object.op_Implicit((Object)(object)val12.body) || !((Component)val12.body).TryGetComponent<AttackTweaks>(ref attackTweaks)) { return num; } (string, string)[] childAliases = attackTweaks.attack.childAliases; for (int i = 0; i < childAliases.Length; i++) { var (text, text2) = childAliases[i]; if (text == childName) { return orig.Invoke(self, text2); } } return num; }; <>c.<>9__6_0 = val; obj = (object)val; } ChildLocator.FindChildIndex_string += (hook_FindChildIndex_string)obj; object obj2 = <>c.<>9__6_1; if (obj2 == null) { hook_SetState val2 = delegate(orig_SetState orig, EntityStateMachine self, EntityState newState) { AttackTweaks attackTweaks = default(AttackTweaks); if (newState != null && ((Component)self).TryGetComponent<AttackTweaks>(ref attackTweaks)) { string fullName = ((object)newState).GetType().FullName; CharacterBody body = default(CharacterBody); if (NetworkServer.active && attackTweaks.attack.band != Band.None && attackTweaks.attack.impactStates.Contains(fullName) && ((Component)self).TryGetComponent<CharacterBody>(ref body)) { BandBurst(body, attackTweaks.attack.band); } (string, Type)[] stateSwaps = attackTweaks.attack.stateSwaps; for (int i = 0; i < stateSwaps.Length; i++) { var (text, type) = stateSwaps[i]; if (fullName == text) { newState = EntityStateCatalog.InstantiateState(type); break; } } } orig.Invoke(self, newState); }; <>c.<>9__6_1 = val2; obj2 = (object)val2; } EntityStateMachine.SetState += (hook_SetState)obj2; object obj3 = <>c.<>9__6_2; if (obj3 == null) { hook_DetonateServer val3 = delegate(orig_DetonateServer orig, ProjectileExplosion self) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) string text = ImpactProjectile(self.projectileController); if (text == null) { orig.Invoke(self); } else { self.fireChildren = false; orig.Invoke(self); SpawnImpactProjectile(text, self.projectileController.owner, ((Component)self).transform.position, self.projectileDamage); } }; <>c.<>9__6_2 = val3; obj3 = (object)val3; } ProjectileExplosion.DetonateServer += (hook_DetonateServer)obj3; object obj4 = <>c.<>9__6_3; if (obj4 == null) { hook_OnProjectileImpact val4 = delegate(orig_OnProjectileImpact orig, ProjectileSingleTargetImpact self, ProjectileImpactInfo impactInfo) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) bool alive = self.alive; orig.Invoke(self, impactInfo); string text = ((NetworkServer.active && alive && !self.alive) ? ImpactProjectile(self.projectileController) : null); if (text != null) { SpawnImpactProjectile(text, self.projectileController.owner, impactInfo.estimatedPointOfImpact, self.projectileDamage); } }; <>c.<>9__6_3 = val4; obj4 = (object)val4; } ProjectileSingleTargetImpact.OnProjectileImpact += (hook_OnProjectileImpact)obj4; object obj5 = <>c.<>9__6_4; if (obj5 == null) { hook_Start val5 = delegate(orig_Start orig, ProjectileController self) { //IL_0084: Unknown result type (might be due to invalid IL or missing references) AttackTweaks attackTweaks = default(AttackTweaks); if (Object.op_Implicit((Object)(object)self.owner) && self.owner.TryGetComponent<AttackTweaks>(ref attackTweaks) && attackTweaks.attack.extraTint.HasValue && ((Object)self).name.StartsWith(((Object)Load(attackTweaks.attack.extraProjectile)).name)) { self.ghostAssetOrDirectReference.LoadAsync(); GameObject val12 = self.ghostAssetOrDirectReference.WaitForCompletion(); if (Object.op_Implicit((Object)(object)val12)) { self.ghostAssetOrDirectReference.directRef = TintedGhost(val12, attackTweaks.attack.extraTint.Value); } } orig.Invoke(self); }; <>c.<>9__6_4 = val5; obj5 = (object)val5; } ProjectileController.Start += (hook_Start)obj5; MasterSummon.onServerMasterSummonGlobal += delegate(MasterSummonReport report) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GiveSummonVariant(report.masterSummon.summonerBodyObject, ((Component)report.summonMasterInstance).gameObject); }; SpawnCard.onSpawnedServerGlobal += delegate(SpawnResult result) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (result.success && result.spawnRequest != null) { GiveSummonVariant(result.spawnRequest.summonerBodyObject, result.spawnedInstance); } }; object obj6 = <>c.<>9__6_7; if (obj6 == null) { hook_FireProjectile_FireProjectileInfo val6 = delegate(orig_FireProjectile_FireProjectileInfo orig, ProjectileManager self, FireProjectileInfo info) { //IL_0000: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) AttackTweaks attackTweaks = default(AttackTweaks); Attack attack = ((Object.op_Implicit((Object)(object)info.owner) && info.owner.TryGetComponent<AttackTweaks>(ref attackTweaks)) ? attackTweaks.attack : null); if (attack == null) { orig.Invoke(self, info); } else { if (attack.projectileSwap != null) { info.projectilePrefab = Load(attack.projectileSwap); } if (attack.projectileSpeed > 0f && !UsesGravity(info.projectilePrefab)) { ((FireProjectileInfo)(ref info)).speedOverride = attack.projectileSpeed; } ref Vector3 position = ref info.position; position += Vector3.up * attack.projectileLift; if (attack.lob) { Lob(ref info); } Quaternion rotation = info.rotation; for (int i = 0; i < attack.shots; i++) { if (attack.spread > 0f) { info.rotation = Util.QuaternionSafeLookRotation(Util.ApplySpread(rotation * Vector3.forward, 0f, attack.spread, 1f, 1f, 0f, 0f)); } orig.Invoke(self, info); } } }; <>c.<>9__6_7 = val6; obj6 = (object)val6; } ProjectileManager.FireProjectile_FireProjectileInfo += (hook_FireProjectile_FireProjectileInfo)obj6; object obj7 = <>c.<>9__6_8; if (obj7 == null) { hook_TakeDamage val7 = delegate(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { orig.Invoke(self, damageInfo); AttackTweaks attackTweaks = default(AttackTweaks); if (Object.op_Implicit((Object)(object)damageInfo.attacker) && damageInfo.attacker.TryGetComponent<AttackTweaks>(ref attackTweaks) && !attackTweaks.attack.dotWhileAttached && self.alive) { Dot[] dots = attackTweaks.attack.dots; foreach (Dot dot in dots) { ApplyDot(((Component)self).gameObject, damageInfo.attacker, dot); } } AttackTweaks attackTweaks2 = default(AttackTweaks); if (Object.op_Implicit((Object)(object)damageInfo.attacker) && damageInfo.attacker.TryGetComponent<AttackTweaks>(ref attackTweaks2) && attackTweaks2.attack.tarOnHit && self.alive && Object.op_Implicit((Object)(object)self.body)) { self.body.AddTimedBuff(Buffs.ClayGoo, 5f); } }; <>c.<>9__6_8 = val7; obj7 = (object)val7; } HealthComponent.TakeDamage += (hook_TakeDamage)obj7; GlobalEventManager.onCharacterDeathGlobal += delegate(DamageReport report) { //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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown CharacterBody victimBody = report.victimBody; AttackTweaks attackTweaks = default(AttackTweaks); if (Object.op_Implicit((Object)(object)victimBody) && ((Component)victimBody).TryGetComponent<AttackTweaks>(ref attackTweaks) && !(attackTweaks.attack.deathBlastRadius <= 0f)) { new BlastAttack { attacker = ((Component)victimBody).gameObject, inflictor = ((Component)victimBody).gameObject, teamIndex = report.victimTeamIndex, position = victimBody.corePosition, radius = attackTweaks.attack.deathBlastRadius, baseDamage = victimBody.damage * attackTweaks.attack.deathBlastDamage, procCoefficient = 0f, falloffModel = (FalloffModel)0 }.Fire(); EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/OmniEffect/OmniExplosionVFXQuick"), new EffectData { origin = victimBody.corePosition, scale = attackTweaks.attack.deathBlastRadius }, true); } }; object obj8 = <>c.<>9__6_10; if (obj8 == null) { hook_FixedUpdate val8 = delegate(orig_FixedUpdate orig, Hide self) { orig.Invoke(self); AttackTweaks attackTweaks = default(AttackTweaks); if (((EntityState)self).isAuthority && ((Component)((EntityState)self).outer).TryGetComponent<AttackTweaks>(ref attackTweaks) && attackTweaks.attack.attackWhileCloaked && ((EntityState)self).characterBody.hasCloakBuff) { attackTweaks.cloakShotTimer -= Time.fixedDeltaTime; if (!(attackTweaks.cloakShotTimer > 0f)) { attackTweaks.cloakShotTimer = 1f; ThrowCloakedShuriken(((EntityState)self).characterBody); } } }; <>c.<>9__6_10 = val8; obj8 = (object)val8; } Hide.FixedUpdate += (hook_FixedUpdate)obj8; object obj9 = <>c.<>9__6_11; if (obj9 == null) { hook_UpdateMaterials val9 = delegate(orig_UpdateMaterials orig, CharacterModel self) { orig.Invoke(self); VariantDefs.ColorRamp colorRamp = default(VariantDefs.ColorRamp); if (((Component)self).TryGetComponent<VariantDefs.ColorRamp>(ref colorRamp) && (!Object.op_Implicit((Object)(object)self.body) || !self.body.isElite)) { colorRamp.Apply(self); } }; <>c.<>9__6_11 = val9; obj9 = (object)val9; } CharacterModel.UpdateMaterials += (hook_UpdateMaterials)obj9; object obj10 = <>c.<>9__6_12; if (obj10 == null) { hook_OnEnter val10 = delegate(orig_OnEnter orig, FireLaser self) { AttackTweaks attackTweaks = default(AttackTweaks); if (((Component)((EntityState)self).outer).TryGetComponent<AttackTweaks>(ref attackTweaks) && attackTweaks.attack.beamScale != 1f && Object.op_Implicit((Object)(object)((FireBeam)self).laserPrefab)) { ((FireBeam)self).laserPrefab = ScaledBeam(((FireBeam)self).laserPrefab, attackTweaks.attack.beamScale); } orig.Invoke(self); }; <>c.<>9__6_12 = val10; obj10 = (object)val10; } FireLaser.OnEnter += (hook_OnEnter)obj10; object obj11 = <>c.<>9__6_13; if (obj11 == null) { hook_ModifyBullet val11 = delegate(orig_ModifyBullet orig, FireLaser self, BulletAttack bullet) { orig.Invoke(self, bullet); AttackTweaks attackTweaks = default(AttackTweaks); if (((Component)((EntityState)self).outer).TryGetComponent<AttackTweaks>(ref attackTweaks) && attackTweaks.attack.beamScale != 1f) { bullet.radius = Mathf.Max(bullet.radius, 1f) * attackTweaks.attack.beamScale; bullet.smartCollision = true; } }; <>c.<>9__6_13 = val11; obj11 = (object)val11; } FireLaser.ModifyBullet += (hook_ModifyBullet)obj11; } internal static void ApplyDot(GameObject victim, GameObject attacker, Dot dot) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) BuffDef val = DotController.GetDotDef(dot.index)?.associatedBuff; CharacterBody val2 = default(CharacterBody); if (dot.maxStacks != 1 || !Object.op_Implicit((Object)(object)val) || !victim.TryGetComponent<CharacterBody>(ref val2) || !val2.HasBuff(val)) { DotController.InflictDot(victim, attacker, (HurtBox)null, dot.index, dot.duration, 1f, dot.maxStacks); } } private static CharacterBody Enemy(CharacterBody body) { BaseAI val = ((Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.master)) ? ((Component)body.master).GetComponent<BaseAI>() : null); if (!Object.op_Implicit((Object)(object)val)) { return null; } return val.currentEnemy.characterBody; } internal static void FireExtra(CharacterBody body, Attack attack) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_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) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_00d4: 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) CharacterBody val = Enemy(body); if (Object.op_Implicit((Object)(object)val)) { GameObject val2 = Load(attack.extraProjectile); for (int i = 0; i < attack.extraShots; i++) { Vector3 val3 = ((attack.extraShots > 1) ? (Quaternion.Euler(0f, 360f / (float)attack.extraShots * (float)i, 0f) * Vector3.forward * 2f) : Vector3.zero); Vector3 val4 = body.corePosition + Vector3.up * (body.radius + 1.5f) + val3; Vector3 val5 = val.corePosition - val4; Vector3 val6 = Util.ApplySpread(((Vector3)(ref val5)).normalized, 0f, attack.extraSpread, 1f, 1f, 0f, 0f); ProjectileManager.instance.FireProjectile(val2, val4, Util.QuaternionSafeLookRotation(val6), ((Component)body).gameObject, body.damage * attack.extraDamage, 0f, Util.CheckRoll(body.crit, body.master), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); } } } private static IEnumerable<CharacterBody> NonAlliesNear(CharacterBody body, float radius) { //IL_0020: 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) TeamIndex team = body.teamComponent.teamIndex; return CharacterBody.readOnlyInstancesList.Where(delegate(CharacterBody other) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Invalid comparison between Unknown and I4 //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)other) && other.teamComponent.teamIndex != team && (int)other.teamComponent.teamIndex != -1) { Vector3 val = other.corePosition - body.corePosition; return ((Vector3)(ref val)).sqrMagnitude < radius * radius; } return false; }).ToArray(); } internal static void Blind(CharacterBody body, float radius) { foreach (CharacterBody item in NonAlliesNear(body, radius)) { item.AddTimedBuff(Buffs.Blinded, 10f); } } internal static void AddDome(CharacterBody body, float radius) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)0); Object.Destroy((Object)(object)obj.GetComponent<Collider>()); obj.transform.SetParent(body.transform, false); obj.transform.localScale = Vector3.one * radius * 2f; obj.GetComponent<Renderer>().sharedMaterials = (Material[])(object)new Material[2] { Addressables.LoadAssetAsync<Material>((object)RoR2_DLC1_VoidCamp.matVoidCampSphereSubtle_mat).WaitForCompletion(), Addressables.LoadAssetAsync<Material>((object)RoR2_DLC1_VoidCamp.matVoidCampSphereBackface_mat).WaitForCompletion() }; } internal static void Fog(CharacterBody body, float radius, float interval) { //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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown foreach (CharacterBody item in NonAlliesNear(body, radius)) { item.AddTimedBuff(Buffs.VoidFogMild, interval + 0.5f); item.healthComponent.TakeDamage(new DamageInfo { damage = item.healthComponent.fullCombinedHealth * 0.025f * interval, position = item.corePosition, damageType = DamageTypeCombo.op_Implicit((DamageType)66), damageColorIndex = (DamageColorIndex)9, procCoefficient = 0f }); } } private static string ImpactProjectile(ProjectileController projectile) { AttackTweaks attackTweaks = default(AttackTweaks); if (!Object.op_Implicit((Object)(object)projectile) || !Object.op_Implicit((Object)(object)projectile.owner) || !projectile.owner.TryGetComponent<AttackTweaks>(ref attackTweaks) || attackTweaks.attack.impactProjectile == null) { return null; } if (Time.time - attackTweaks.lastImpactTime < attackTweaks.attack.impactInterval) { return null; } attackTweaks.lastImpactTime = Time.time; return attackTweaks.attack.impactProjectile; } private static void SpawnImpactProjectile(string key, GameObject owner, Vector3 position, ProjectileDamage source) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) ProjectileManager.instance.FireProjectile(Load(key), position, Quaternion.identity, owner, Object.op_Implicit((Object)(object)source) ? source.damage : 0f, 0f, Object.op_Implicit((Object)(object)source) && source.crit, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); } private static void BandBurst(CharacterBody body, Band band) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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_0110: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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_015c: 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_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) Vector3 footPosition = body.footPosition; bool flag = Util.CheckRoll(body.crit, body.master); if ((band & Band.Kjaro) != Band.None) { ProjectileManager.instance.FireProjectile(Load(RoR2_Base_ElementalRings.FireTornado_prefab), footPosition, Quaternion.identity, ((Component)body).gameObject, body.damage * 3f, 0f, flag, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); } if ((band & Band.Singularity) != Band.None) { ProjectileManager.instance.FireProjectile(Load(RoR2_DLC1_ElementalRingVoid.ElementalRingVoidBlackHole_prefab), footPosition, Quaternion.identity, ((Component)body).gameObject, body.damage, 0f, flag, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); } if ((band & Band.Runald) == 0) { return; } EffectManager.SpawnEffect(Load(RoR2_Base_ElementalRings.IceRingExplosion_prefab), new EffectData { origin = footPosition, scale = 8f }, true); HitPoint[] hitPoints = new BlastAttack { attacker = ((Component)body).gameObject, inflictor = ((Component)body).gameObject, teamIndex = body.teamComponent.teamIndex, position = footPosition, radius = 8f, baseDamage = body.damage * 2.5f, crit = flag, procCoefficient = 0f, falloffModel = (FalloffModel)0, damageColorIndex = (DamageColorIndex)3 }.Fire().hitPoints; foreach (HitPoint val in hitPoints) { if (Object.op_Implicit((Object)(object)val.hurtBox) && Object.op_Implicit((Object)(object)val.hurtBox.healthComponent) && Object.op_Implicit((Object)(object)val.hurtBox.healthComponent.body)) { val.hurtBox.healthComponent.body.AddTimedBuff(Buffs.Slow80, 3f); } } } internal static void SummonGuards(CharacterBody body, Attack attack) { //IL_0036: 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) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00a7: Unknown result type (might be due to invalid IL or missing references) GameObject val = MasterCatalog.FindMasterPrefab(attack.guardMaster); if (Object.op_Implicit((Object)(object)val)) { for (int i = 0; i < attack.guards; i++) { Vector3 val2 = Quaternion.Euler(0f, 360f / (float)attack.guards * (float)i, 0f) * Vector3.forward * (body.radius + 6f) + Vector3.up * 4f; new MasterSummon { masterPrefab = val, position = body.corePosition + val2, rotation = Quaternion.identity, summonerBodyObject = ((Component)body).gameObject, ignoreTeamMemberLimit = true, useAmbientLevel = true }.Perform(); } } } private static void GiveSummonVariant(GameObject summoner, GameObject summon) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) AttackTweaks attackTweaks = default(AttackTweaks); if (Object.op_Implicit((Object)(object)summoner) && Object.op_Implicit((Object)(object)summon) && summoner.TryGetComponent<AttackTweaks>(ref attackTweaks) && attackTweaks.attack.summonVariant != null && Content.defsByName.TryGetValue(attackTweaks.attack.summonVariant, out var value)) { VAPIUtils.TransformSpawnedInstanceIntoVariant(new TransformSpawnedInstanceIntoVariantArgs { spawnedInstance = summon, preassignedVariantDefs = (CharacterVariantDef[])(object)new CharacterVariantDef[1] { value } }); } } private static void ThrowCloakedShuriken(CharacterBody body) { //IL_0040: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown CharacterBody val = Enemy(body); if (Object.op_Implicit((Object)(object)val)) { if (shuriken == null) { shuriken = (ThrowShuriken)EntityStateCatalog.InstantiateState(typeof(ThrowShuriken)); } ProjectileManager.instance.FireProjectile(((GenericProjectileBaseState)shuriken).projectilePrefab, body.aimOrigin, Util.QuaternionSafeLookRotation(val.corePosition - body.aimOrigin), ((Component)body).gameObject, body.damage * ((GenericProjectileBaseState)shuriken).damageCoefficient, ((GenericProjectileBaseState)shuriken).force, Util.CheckRoll(body.crit, body.master), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); } } private static bool UsesGravity(GameObject projectile) { Rigidbody val = default(Rigidbody); if (projectile.TryGetComponent<Rigidbody>(ref val)) { return val.useGravity; } return false; } private static void Lob(ref FireProjectileInfo info) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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) CharacterBody val = Enemy(info.owner.GetComponent<CharacterBody>()); if (Object.op_Implicit((Object)(object)val)) { Vector3 val2 = val.footPosition - info.position; val2.y = 0f; float num = Mathf.Max(3f, ((Vector3)(ref val2)).magnitude / 60f); Vector3 val3 = Trajectory.CalculateInitialVelocityFromTime(info.position, val.footPosition, num, 0f, float.PositiveInfinity); info.rotation = Util.QuaternionSafeLookRotation(val3); ((FireProjectileInfo)(ref info)).speedOverride = ((Vector3)(ref val3)).magnitude; ((FireProjectileInfo)(ref info)).fuseOverride = num + 2f; } } private static GameObject ScaledBeam(GameObject source, float scale) { //IL_0024: 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) if (scaledBeams.TryGetValue(source, out var value)) { return value; } value = Object.Instantiate<GameObject>(source, PrefabHolder()); Transform transform = value.transform; transform.localScale *= scale; LineRenderer[] componentsInChildren = value.GetComponentsInChildren<LineRenderer>(true); foreach (LineRenderer obj in componentsInChildren) { obj.widthMultiplier *= scale; } return scaledBeams[source] = value; } private static GameObject TintedGhost(GameObject source, Color tint) { //IL_0006: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (tintedGhosts.TryGetValue((source, tint), out var value)) { return value; } value = Object.Instantiate<GameObject>(source, PrefabHolder()); Renderer[] componentsInChildren = value.GetComponentsInChildren<Renderer>(true); foreach (Renderer val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val.sharedMaterial)) { Material val2 = Object.Instantiate<Material>(val.sharedMaterial); if (val2.HasProperty("_RemapTex")) { val2.SetTexture("_RemapTex", (Texture)(object)VariantDefs.FlameTintModifier.Ramp(tint)); } if (val2.HasProperty("_TintColor")) { val2.SetColor("_TintColor", tint); } val.sharedMaterial = val2; } } Light[] componentsInChildren2 = value.GetComponentsInChildren<Light>(true); for (int i = 0; i < componentsInChildren2.Length; i++) { componentsInChildren2[i].color = tint; } return tintedGhosts[(source, tint)] = value; } private static Transform PrefabHolder() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)prefabHolder)) { prefabHolder = new GameObject("PhreelVariantsPrefabs").transform; ((Component)prefabHolder).gameObject.SetActive(false); Object.DontDestroyOnLoad((Object)(object)((Component)prefabHolder).gameObject); } return prefabHolder; } } internal sealed class Flamethrower : BaseState { private const float maxDistance = 20f; private const float totalDamageCoefficient = 3f; private static Flamethrower mage; private Transform effect; private float duration; private float tickTimer; private float tickDamage; public override void OnEnter() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown ((BaseState)this).OnEnter(); if (mage == null) { mage = (Flamethrower)EntityStateCatalog.InstantiateState(typeof(Flamethrower)); } duration = mage.baseFlamethrowerDuration; tickDamage = 3f / Mathf.Ceil(duration * mage.tickFrequency); if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { ((EntityState)this).characterBody.SetAimTimer(duration + 1f); } Transform val = ((BaseState)this).FindModelChild("Mouth"); if (Object.op_Implicit((Object)(object)val)) { effect = Object.Instantiate<GameObject>(Attacks.Load(RoR2_Base_Drones.DroneFlamethrowerEffect_prefab), val).transform; EntityState.Destroy((Object)(object)((Component)effect).GetComponent<DestroyOnTimer>()); ScaleParticleSystemDuration val2 = default(ScaleParticleSystemDuration); if (((Component)effect).TryGetComponent<ScaleParticleSystemDuration>(ref val2)) { val2.newDuration = duration; } } Util.PlaySound(Flamethrower.startAttackSoundString, ((EntityState)this).gameObject); } public override void FixedUpdate() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0112: 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_0128: 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_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); Ray aimRay = ((BaseState)this).GetAimRay(); if (Object.op_Implicit((Object)(object)effect)) { effect.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction); } if (((EntityState)this).isAuthority && (tickTimer -= ((EntityState)this).GetDeltaTime()) <= 0f) { tickTimer = 1f / mage.tickFrequency / base.attackSpeedStat; new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, damage = tickDamage * base.damageStat, force = Flamethrower.force, muzzleName = "Mouth", hitEffectPrefab = Flamethrower.impactEffectPrefab, isCrit = ((BaseState)this).RollCrit(), radius = Flamethrower.radius, falloffModel = (FalloffModel)0, stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask, procCoefficient = Flamethrower.procCoefficientPerTick, maxDistance = 20f, smartCollision = true, damageType = DamageTypeCombo.op_Implicit((DamageType)(Util.CheckRoll(Flamethrower.ignitePercentChance, ((EntityState)this).characterBody.master) ? 128 : 0)) }.Fire(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { Util.PlaySound(Flamethrower.endAttackSoundString, ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)effect)) { EntityState.Destroy((Object)(object)((Component)effect).gameObject); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } internal sealed class Content : IContentPackProvider { internal static readonly Dictionary<string, CharacterVariantDef> defsByName = new Dictionary<string, CharacterVariantDef>(); private readonly ContentPack contentPack = new ContentPack(); private ReadOnlyArray<ContentPackLoadInfo> peers; public string identifier => "Phreel.PhreelVariants"; public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.entityStateTypes.Add(new Type[1] { typeof(Flamethrower) }); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { peers = args.peerLoadInfos; ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { List<CharacterVariantDef> list = new List<CharacterVariantDef>(); VariantDefs.Variant[] all = VariantData.all; foreach (VariantDefs.Variant variant in all) { GameObject val = FindBody(variant.body); if (Object.op_Implicit((Object)(object)val)) { try { CharacterVariantDef val2 = VariantDefs.Build(variant, val) ?? throw new Exception("VAPI couldn't build it, see its error above"); list.Add(val2); defsByName[variant.name] = val2; } catch (Exception arg) { Log.Error($"Skipping {variant.name}: {arg}", "D:\\Games\\LostItems\\phreelvariants\\PhreelVariants\\Content.cs", "FinalizeAsync", 54); } } } all = VariantData.all; foreach (VariantDefs.Variant variant2 in all) { if (variant2.splitsInto != null && defsByName.TryGetValue(variant2.name, out var value) && defsByName.TryGetValue(variant2.splitsInto, out var value2)) { GupVariantHelper.AddGupVariantRelation(value, value2, value2); } } Log.Info($"Added {list.Count} of {VariantData.all.Length} variants, the rest target enemies that aren't loaded", "D:\\Games\\LostItems\\phreelvariants\\PhreelVariants\\Content.cs", "FinalizeAsync", 60); if (list.Count > 0) { VariantPack val3 = new VariantPack("Phreel.PhreelVariants.PHREEL_PACK", "PHREEL_PACK_NAME", "PHREEL_PACK_NAME", "PHREEL_PACK_DESC", LoadIcon("icon.png"), (BaseUnityPlugin)(object)Main.Instance, (ConfigFile)null, ((BaseUnityPlugin)Main.Instance).Config, false); val3.characterVariantDefs.Add(list.ToArray()); VariantPackManager.AddVariantPack(val3); } args.ReportProgress(1f); yield break; } private GameObject FindBody(string name) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < peers.Length; i++) { GameObject val = ((ReadOnlyContentPack)(ref ((ContentPackLoadInfo)peers[i]).previousContentPack)).bodyPrefabs.Find(name); if (Object.op_Implicit((Object)(object)val)) { return val; } } return null; } private static Sprite LoadIcon(string fileName) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, File.ReadAllBytes(Path.Combine(Main.PluginDirectory, fileName))); return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); } } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } private static string getLogPrefix(string callerPath, string callerMemberName, int callerLineNumber) { int num = callerPath.LastIndexOf("PhreelVariants"); if (num >= 0) { callerPath = callerPath.Substring(num + "PhreelVariants".Length + 1); } return $"{callerPath}:{callerLineNumber} ({callerMemberName}) "; } internal static void Error(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogError((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Error_NoCallerPrefix(object data) { _logSource.LogError(data); } internal static void Fatal(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogFatal((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Fatal_NoCallerPrefix(object data) { _logSource.LogFatal(data); } internal static void Info(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogInfo((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Info_NoCallerPrefix(object data) { _logSource.LogInfo(data); } internal static void Message(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogMessage((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Message_NoCallerPrefix(object data) { _logSource.LogMessage(data); } internal static void Warning(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogWarning((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Warning_NoCallerPrefix(object data) { _logSource.LogWarning(data); } } [BepInPlugin("Phreel.PhreelVariants", "PhreelVariants", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Main : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static CollectContentPackProvidersDelegate <>9__12_0; internal void <Awake>b__12_0(AddContentPackProviderDelegate add) { add.Invoke((IContentPackProvider)(object)new Content()); } } public const string PluginGUID = "Phreel.PhreelVariants"; public const string PluginAuthor = "Phreel"; public const string PluginName = "PhreelVariants"; public const string PluginVersion = "1.0.0"; internal static Main Instance { get; private set; } public static string PluginDirectory { get; private set; } public void Awake() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown Instance = this; Log.Init(((BaseUnityPlugin)this).Logger); PluginDirectory = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); LanguageFileLoader.AddLanguageFilesFromMod((BaseUnityPlugin)(object)this, "languages"); Attacks.Init(); object obj = <>c.<>9__12_0; if (obj == null) { CollectContentPackProvidersDelegate val = delegate(AddContentPackProviderDelegate add) { add.Invoke((IContentPackProvider)(object)new Content()); }; <>c.<>9__12_0 = val; obj = (object)val; } ContentManager.collectContentPackProviders += (CollectContentPackProvidersDelegate)obj; } } internal static class VariantData { private static readonly Keyframe[] LowHealthUse = (Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 0f, 0f, 0f), new Keyframe(1f, 0.7464f, 2f, 2f) }; private static readonly VariantDefs.VariantItems ColossalItems = new VariantDefs.VariantItems { items = new(string, int)[3] { ("Knurl", 4), ("Seed", 10), ("BarrierOnOverHeal", 20) } }; private static readonly VariantDefs.VariantItems CorruptedItems = new VariantDefs.VariantItems { items = new(string, int)[2] { ("RandomDamageZone", 3), ("ShieldOnly", 1) }, equipment = "Meteor", useChance = LowHealthUse }; private static readonly VariantDefs.VariantItems CrazedItems = new VariantDefs.VariantItems { items = new(string, int)[3] { ("SecondarySkillMagazine", 4), ("UtilitySkillMagazine", 1), ("SecondaryCDR", 30) } }; private static readonly VariantDefs.VariantItems HavocItems = new VariantDefs.VariantItems { items = new(string, int)[2] { ("Plus1Crit", 100), ("AttackSpeedOnCrit", 2) }, equipment = "TeamWarCry", useChance = LowHealthUse }; private static readonly VariantDefs.VariantItems JuggernautItems = new VariantDefs.VariantItems { items = new(string, int)[4] { ("Knurl", 4), ("HealWhileSafe", 3), ("RepeatHeal", 1), ("Medkit", 1) }, equipment = "CommandMissile", useChance = LowHealthUse, buffs = new(string, int, float)[1] { ("bdLunarShell", 1, 2f) } }; private static readonly VariantDefs.VariantItems NeverdieItems = new VariantDefs.VariantItems { items = new(string, int)[2] { ("ExtraLife", 2), ("ArmorPlate", 1) }, equipment = "Fruit", useChance = LowHealthUse }; private static readonly VariantDefs.VariantItems NocturneItems = new VariantDefs.VariantItems { items = new(string, int)[2] { ("GlobalCDR", 75), ("ArmorReductionOnHit", 1) } }; private static readonly VariantDefs.VariantItems PredatoryItems = new VariantDefs.VariantItems { items = new(string, int)[2] { ("SprintOutOfCombat", 2), ("Hoof", 2) }, equipment = "Tonic", useChance = LowHealthUse }; private static readonly VariantDefs.VariantItems PrimalItems = new VariantDefs.VariantItems { items = new(string, int)[2] { ("Plus1Crit", 100), ("CooldownOnCrit", 1) } }; private static readonly VariantDefs.Stats ColossalStats = new VariantDefs.Stats(1.5f, 0.6f, 0.75f, 1f, 1.2f, 25f); private static readonly string[] SwiftImpacts = new string[3] { "EntityStates.Swift.Stuck", "EntityStates.Swift.SwiftElevate", "EnemiesReturns.ModdedEntityStates.Swift.Dive.DiveEnd" }; internal static readonly VariantDefs.Variant[] all = HifuSet("Sentinel", "BlueBody").Concat(HifuSet("ClayGuardsman", "CloudburstGuardsmanBody")).Concat(new VariantDefs.Variant[43] { new VariantDefs.Variant("Phreel_ColossalCoilGolem", "CoilGolemBody", "PHREEL_VARIANT_COLOSSAL", 4f) { stats = ColossalStats, scale = 2.5f, inventory = ColossalItems, ramp = new Color(0.7f, 0.65f, 0.55f) }, new VariantDefs.Variant("Phreel_FoundingColossus", "ER_ColossusBody", "PHREEL_VARIANT_FOUNDING", 4f) { stats = new VariantDefs.Stats(1.5f, 0.6f, 0.6f, 2.5f, 1f, 0f), scale = 4f }, new VariantDefs.Variant("Phreel_MysticSanctumWisp", "SanctumWispBody", "PHREEL_VARIANT_MYSTIC", 4f) { stats = new VariantDefs.Stats(1.25f, 1f, 2f, 1f, 1f, 0f), scale = 1.5f, ramp = new Color(0.25f, 1f, 0.35f), flames = true }, new VariantDefs.Variant("Phreel_MachinegunBlindPest", "FlyingVerminBody", "PHREEL_VARIANT_MACHINEGUN", 4f) { stats = new VariantDefs.Stats(1f, 1f, 5f, 0.25f, 1f, 0f), inventory = new VariantDefs.VariantItems { items = new(string, int)[1] { ("PrimaryCDR", 95) } } }, new VariantDefs.Variant("Phreel_ShotgunBlindPest", "FlyingVerminBody", "PHREEL_VARIANT_SHOTGUN", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 0.5f, 1f, 0f), attack = new Attack { shots = 6, spread = 12f } }, new VariantDefs.Variant("Phreel_DeadshotBlindPest", "FlyingVerminBody", "PHREEL_VARIANT_DEADSHOT", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), scale = 0.6f, ramp = Color.white, attack = new Attack { projectileSpeed = 400f, range = 9999f } }, new VariantDefs.Variant("Phreel_RapidfireLynxDeadeye", "LynxArcherBody", "PHREEL_VARIANT_RAPIDFIRE", 4f) { stats = new VariantDefs.Stats(1f, 1f, 4f, 0.5f, 1f, 0f), inventory = new VariantDefs.VariantItems { items = new(string, int)[1] { ("GlobalCDR", 85) } } }, new VariantDefs.Variant("Phreel_9000IotaConstruct", "MajorConstructBody", "PHREEL_VARIANT_9000", 1f) { suffix = true, stats = new VariantDefs.Stats(1f, 1f, 1f, 4f, 1f, 0f), attack = new Attack { beamScale = 9f } }, new VariantDefs.Variant("Phreel_MortarDwarfMushrum", "DwarfMushrumBody", "PHREEL_VARIANT_MORTAR", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), scale = 1.5f, ramp = new Color(0.65f, 0.82f, 1f), attack = new Attack { lob = true, range = 9999f, disabledSlots = (SkillSlot[])(object)new SkillSlot[1] { (SkillSlot)2 } } }, new VariantDefs.Variant("Phreel_AquaticSandCrab", "ER_SandCrabBody", "PHREEL_VARIANT_AQUATIC", 4f) { stats = new VariantDefs.Stats(1f, 1.4f, 1f, 1f, 1f, 0f), scale = 0.3f, ramp = new Color(0.25f, 0.6f, 1f), inventory = new VariantDefs.VariantItems { items = new(string, int)[1] { ("SecondaryCDR", 85) } }, attack = new Attack { projectileLift = 1.5f } }, new VariantDefs.Variant("Phreel_CarpetbomberClayApothecary", "ClayGrenadierBody", "PHREEL_VARIANT_CARPETBOMBER", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 0.5f, 1f, 0f), scale = 1.3f, ramp = new Color(0.9f, 0.55f, 0.35f), attack = new Attack { shots = 6, spread = 10f, range = 9999f } }, new VariantDefs.Variant("Phreel_CausticClayMonger", "ClayMongerBody", "PHREEL_VARIANT_CAUSTIC", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), scale = 1.2f, ramp = new Color(0.45f, 0.8f, 0.4f), attack = new Attack { dots = new Dot[1] { new Dot((DotIndex)4, 2f) } } }, new VariantDefs.Variant("Phreel_MachinegunCrimsonRaptor", "ChickenBody", "PHREEL_VARIANT_MACHINEGUN", 4f) { stats = new VariantDefs.Stats(1f, 1f, 5f, 0.2f, 1f, 0f), scale = 0.8f, ramp = new Color(0.65f, 0.7f, 0.8f), inventory = new VariantDefs.VariantItems { items = new(string, int)[1] { ("GlobalCDR", 95) } }, attack = new Attack { shots = 3, spread = 4f } }, new VariantDefs.Variant("Phreel_MachinegunArcherBug", "ER_ArcherBugBody", "PHREEL_VARIANT_MACHINEGUN", 4f) { stats = new VariantDefs.Stats(1f, 1f, 5f, 0.3f, 1f, 0f), scale = 0.8f, ramp = new Color(0.65f, 0.7f, 0.8f), inventory = new VariantDefs.VariantItems { items = new(string, int)[1] { ("GlobalCDR", 95) } } }, new VariantDefs.Variant("Phreel_MachinegunAcidBug", "AcidBugBody", "PHREEL_VARIANT_MACHINEGUN", 4f) { stats = new VariantDefs.Stats(1f, 1f, 5f, 0.3f, 1f, 0f), scale = 0.8f, ramp = new Color(0.65f, 0.7f, 0.8f), inventory = new VariantDefs.VariantItems { items = new(string, int)[1] { ("GlobalCDR", 95) } } }, new VariantDefs.Variant("Phreel_ShinobiAssassin", "Assassin2Body", "PHREEL_VARIANT_SHINOBI", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), scale = 0.85f, ramp = new Color(0.5f, 0.35f, 0.75f), attack = new Attack { projectileSpeed = 200f, attackWhileCloaked = true } }, new VariantDefs.Variant("Phreel_ExplosiveThqwarp", "TickBody", "PHREEL_VARIANT_EXPLOSIVE", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), scale = 1.2f, ramp = new Color(0.85f, 0.25f, 0.2f), attack = new Attack { deathBlastDamage = 8f, deathBlastRadius = 10f } }, new VariantDefs.Variant("Phreel_CausticLivelyPot", "PotMobileMonsterBody", "PHREEL_VARIANT_CAUSTIC", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), ramp = new Color(0.3f, 0.6f, 0.3f), attack = new Attack { dots = new Dot[1] { new Dot((DotIndex)4, 2f, 1u) } } }, new VariantDefs.Variant("Phreel_PiercingLivelyPot", "PotMobileMonsterBody", "PHREEL_VARIANT_PIERCING", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), ramp = new Color(0.75f, 0.2f, 0.25f), attack = new Attack { dots = new Dot[1] { new Dot((DotIndex)0, 2f, 3u) } } }, new VariantDefs.Variant("Phreel_SimulacrumLivelyPot", "PotMobileMonsterBody", "PHREEL_VARIANT_SIMULACRUM", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), scale = 0.5f, ramp = new Color(0.55f, 0.3f, 0.8f), attack = new Attack { dots = new Dot[1] { new Dot((DotIndex)8, 3f, 1u) } } }, new VariantDefs.Variant("Phreel_VenomousThqwarp", "TickBody", "PHREEL_VARIANT_VENOMOUS", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), scale = 1.1f, ramp = new Color(0.55f, 0.75f, 0.25f), attack = new Attack { dots = new Dot[1] { new Dot((DotIndex)4, 2f, 1u) }, dotWhileAttached = true } }, new VariantDefs.Variant("Phreel_PlagueThqwarp", "TickBody", "PHREEL_VARIANT_PLAGUE", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), scale = 1.1f, ramp = new Color(0.45f, 0.3f, 0.6f), attack = new Attack { dots = new Dot[1] { new Dot((DotIndex)5, 2f, 1u) }, dotWhileAttached = true } }, new VariantDefs.Variant("Phreel_SimulacrumThqwarp", "TickBody", "PHREEL_VARIANT_SIMULACRUM", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), scale = 0.7f, ramp = new Color(0.55f, 0.3f, 0.8f), attack = new Attack { dots = new Dot[1] { new Dot((DotIndex)8, 3f, 1u) }, dotWhileAttached = true } }, new VariantDefs.Variant("Phreel_TarredGorp", "GorpBody", "PHREEL_VARIANT_TARRED", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1.1f, 1f, 0f), ramp = new Color(0.4f, 0.32f, 0.25f), attack = new Attack { tarOnHit = true }, splitsInto = "Phreel_TarredGip" }, new VariantDefs.Variant("Phreel_TarredGip", "GipBody", "PHREEL_VARIANT_TARRED", 0f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1.1f, 1f, 0f), ramp = new Color(0.4f, 0.32f, 0.25f), attack = new Attack { tarOnHit = true } }, new VariantDefs.Variant("Phreel_DriedSandCrab", "ER_SandCrabBody", "PHREEL_VARIANT_DRIED", 4f) { stats = new VariantDefs.Stats(1f, 1.5f, 2f, 1f, 1f, 0f), scale = 0.6f, ramp = Color.white, attack = new Attack { disabledSlots = (SkillSlot[])(object)new SkillSlot[1] { (SkillSlot)1 } } }, LaserNode("VoidBarnacleBody"), LaserNode("VoidBarnacleNoCastBody"), new VariantDefs.Variant("Phreel_SoulReaperBathylopod", "DemineurBody", "PHREEL_VARIANT_SOULREAPER", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), ramp = new Color(0.3f, 0.75f, 0.8f), attack = new Attack { extraProjectile = RoR2_Base_Gravekeeper.GravekeeperTrackingFireball_prefab, extraShots = 3, extraInterval = 6f, extraDamage = 0.6f, extraTint = new Color(0.3f, 1f, 1f) } }, new VariantDefs.Variant("Phreel_FlamethrowerCrimsonRaptor", "ChickenBody", "PHREEL_VARIANT_FLAMETHROWER", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), ramp = new Color(0.9f, 0.45f, 0.2f), attack = new Attack { stateSwaps = new(string, Type)[1] { ("RiftTitansMod.SkillStates.Chicken.Shoot", typeof(Flamethrower)) }, range = 20f } }, new VariantDefs.Variant("Phreel_LunarFlameCrimsonRaptor", "ChickenBody", "PHREEL_VARIANT_LUNARFLAME", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1.5f, 1f, 1f, 0f), scale = 0.85f, ramp = new Color(0.35f, 0.55f, 1f), attack = new Attack { dots = new Dot[1] { new Dot((DotIndex)2, 3f, 1u) } } }, new VariantDefs.Variant("Phreel_LunarFlameDwarfMushrum", "DwarfMushrumBody", "PHREEL_VARIANT_LUNARFLAME", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1.5f, 1f, 1f, 0f), scale = 0.85f, ramp = new Color(0.35f, 0.55f, 1f), attack = new Attack { impactProjectile = RoR2_Base_LunarExploder.LunarExploderProjectileDotZone_prefab } }, new VariantDefs.Variant("Phreel_BerserkerRiftHerald", "HeraldBody", "PHREEL_VARIANT_BERSERKER", 4f) { stats = new VariantDefs.Stats(0.5f, 2f, 2f, 1f, 1f, 0f), scale = 0.5f, ramp = new Color(0.85f, 0.25f, 0.22f) }, new VariantDefs.Variant("Phreel_OtherworldlyMotherMushrum", "RisingTides_MushSupporterBody", "PHREEL_VARIANT_OTHERWORLDLY", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), ramp = new Color(0.6f, 0.35f, 0.85f), attack = new Attack { fogRadius = 20f } }, new VariantDefs.Variant("Phreel_GravitationalGreaterWisp", "GreaterWispBody", "PHREEL_VARIANT_GRAVITATIONAL", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), ramp = new Color(0.45f, 0.3f, 0.7f), attack = new Attack { impactProjectile = RoR2_DLC1_ElementalRingVoid.ElementalRingVoidBlackHole_prefab, impactInterval = 4f } }, new VariantDefs.Variant("Phreel_GravitationalLunarGolem", "LunarGolemBody", "PHREEL_VARIANT_GRAVITATIONAL", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), ramp = new Color(0.45f, 0.3f, 0.7f), attack = new Attack { impactProjectile = RoR2_DLC1_ElementalRingVoid.ElementalRingVoidBlackHole_prefab, impactInterval = 4f } }, new VariantDefs.Variant("Phreel_RailshotImp", "ImpBody", "PHREEL_VARIANT_RAILSHOT", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), ramp = new Color(0.4f, 0.6f, 0.85f), attack = new Attack { extraProjectile = RoR2_DLC1_Railgunner.RailgunnerPistolProjectile_prefab, extraShots = 3, extraInterval = 3f, extraDamage = 0.5f, extraSpread = 3f } }, new VariantDefs.Variant("Phreel_RailshotImpOverlord", "ImpBossBody", "PHREEL_VARIANT_RAILSHOT", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), ramp = new Color(0.4f, 0.6f, 0.85f), attack = new Attack { projectileSwap = RoR2_DLC1_Railgunner.RailgunnerPistolProjectile_prefab } }, new VariantDefs.Variant("Phreel_ImperialAssassin", "Assassin2Body", "PHREEL_VARIANT_IMPERIAL", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), ramp = new Color(0.85f, 0.7f, 0.3f), attack = new Attack { projectileSwap = RoR2_Base_Merc.EvisProjectile_prefab } }, new VariantDefs.Variant("Phreel_BlackoutWayfarer", "LampBossBody", "PHREEL_VARIANT_BLACKOUT", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), ramp = new Color(0.2f, 0.2f, 0.22f), attack = new Attack { blindRadius = 25f, summonVariant = "Phreel_BlackoutFollower" } }, new VariantDefs.Variant("Phreel_BlackoutFollower", "LampBody", "PHREEL_VARIANT_BLACKOUT", 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), ramp = new Color(0.2f, 0.2f, 0.22f), attack = new Attack { blindRadius = 10f } }, new VariantDefs.Variant("Phreel_CathedralBrassMonolith", "BodyBrassMonolith", "PHREEL_VARIANT_CATHEDRAL", 1f) { stats = new VariantDefs.Stats(2f, 0.6f, 0.6f, 3f, 1f, 0f), scale = 2f, ramp = new Color(0.8f, 0.62f, 0.3f), attack = new Attack { guardMaster = "BellMaster", guards = 6, summonVariant = "Phreel_CathedralBell" } }, new VariantDefs.Variant("Phreel_CathedralBell", "BellBody", "PHREEL_VARIANT_CATHEDRAL", 0f) { stats = new VariantDefs.Stats(1.5f, 1f, 1f, 1.5f, 1f, 0f), scale = 1.5f, ramp = new Color(0.8f, 0.62f, 0.3f) } }).Concat(Swifts("Phreel_Runalds", "PHREEL_VARIANT_RUNALDS", Band.Runald, new Color(0.45f, 0.75f, 0.95f))) .Concat(Swifts("Phreel_Kjaros", "PHREEL_VARIANT_KJAROS", Band.Kjaro, new Color(0.9f, 0.4f, 0.2f))) .Concat(Swifts("Phreel_Singularity", "PHREEL_VARIANT_SINGULARITY", Band.Singularity, new Color(0.55f, 0.3f, 0.8f))) .ToArray(); private static VariantDefs.Variant LaserNode(string body) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) VariantDefs.Variant variant = new VariantDefs.Variant("Phreel_LaserNode" + body, body, "PHREEL_VARIANT_LASERNODE", 4f); variant.stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f); variant.ramp = new Color(0.8f, 0.35f, 0.3f); variant.attack = new Attack { stateSwaps = new(string, Type)[1] { ("EntityStates.VoidBarnacle.Weapon.ChargeFire", typeof(ChargeLaser)) }, childAliases = new(string, string)[1] { ("MuzzleLaser", "MuzzleMouth") }, aimFrom = "MuzzleMouth" }; return variant; } private static VariantDefs.Variant Swift(string name, string body, string token, Band band, Color ramp) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) return new VariantDefs.Variant(name + body, body, token, 4f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 1f, 1f, 0f), ramp = ramp, attack = new Attack { impactStates = SwiftImpacts, band = band } }; } private static IEnumerable<VariantDefs.Variant> Swifts(string name, string token, Band band, Color ramp) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) return new string[2] { "SwiftBody", "ER_SwiftBody" }.Select((string body) => Swift(name, body, token, band, ramp)); } private static VariantDefs.Variant[] HifuSet(string enemy, string body) { //IL_0055: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) return new VariantDefs.Variant[9] { new VariantDefs.Variant("Phreel_Colossal" + enemy, body, "PHREEL_VARIANT_COLOSSAL", 4f) { stats = ColossalStats, scale = 2.5f, inventory = ColossalItems, ramp = new Color(0.7f, 0.65f, 0.55f) }, new VariantDefs.Variant("Phreel_Corrupted" + enemy, body, "PHREEL_VARIANT_CORRUPTED", 1f) { alwaysSprint = true, stats = new VariantDefs.Stats(1.25f, 1f, 0.75f, 1f, 1f, 10f), scale = 1.25f, inventory = CorruptedItems, ramp = new Color(0.46f, 0.34f, 0.85f) }, new VariantDefs.Variant("Phreel_Crazed" + enemy, body, "PHREEL_VARIANT_CRAZED", 5f) { stats = new VariantDefs.Stats(1f, 1f, 1.5f, 0.75f, 1f, 10f), inventory = CrazedItems, ramp = new Color(0.85f, 0.6f, 0.31f) }, new VariantDefs.Variant("Phreel_Havoc" + enemy, body, "PHREEL_VARIANT_HAVOC", 2.5f) { stats = new VariantDefs.Stats(0.75f, 1.25f, 1.25f, 0.75f, 1f, 0f), scale = 1.25f, inventory = HavocItems, ramp = new Color(0.75f, 0.47f, 0.85f) }, new VariantDefs.Variant("Phreel_Juggernaut" + enemy, body, "PHREEL_VARIANT_JUGGERNAUT", 2.5f) { stats = new VariantDefs.Stats(1.25f, 1f, 1f, 0.2f, 1f, 20f), scale = 1.5f, inventory = JuggernautItems, ramp = new Color(0.33f, 0.85f, 0.69f) }, new VariantDefs.Variant("Phreel_Neverdie" + enemy, body, "PHREEL_VARIANT_NEVERDIE", 1f) { unique = true, stats = new VariantDefs.Stats(0.4f, 1f, 1f, 1f, 1f, 20f), scale = 1.25f, inventory = NeverdieItems, ramp = new Color(0.53f, 0.34f, 0.85f) }, new VariantDefs.Variant("Phreel_Nocturne" + enemy, body, "PHREEL_VARIANT_NOCTURNE", 3f) { stats = new VariantDefs.Stats(1f, 1f, 1f, 0.75f, 1f, 0f), scale = 0.6f, inventory = NocturneItems, ramp = new Color(0.85f, 0.25f, 0.22f) }, new VariantDefs.Variant("Phreel_Predatory" + enemy, body, "PHREEL_VARIANT_PREDATORY", 6f) { stats = new VariantDefs.Stats(0.75f, 1f, 1f, 1f, 1f, 0f), scale = 0.6f, inventory = PredatoryItems, ramp = new Color(0.85f, 0.5f, 0.6f) }, new VariantDefs.Variant("Phreel_Primal" + enemy, body, "PHREEL_VARIANT_PRIMAL", 3.5f) { unstable = true, stats = new VariantDefs.Stats(0.75f, 1.25f, 1.25f, 0.5f, 1f, 0f), scale = 1.5f, inventory = PrimalItems, ramp = new Color(0.85f, 0.65f, 0.64f) } }; } } internal static class VariantDefs { internal readonly struct Stats { internal readonly float health; internal readonly float moveSpeed; internal readonly float attackSpeed; internal readonly float damage; internal readonly float armorMultiplier; internal readonly float armorBonus; internal Stats(float health, float moveSpeed, float attackSpeed, float damage, float armorMultiplier, float armorBonus) { this.health = health; this.moveSpeed = moveSpeed; this.attackSpeed = attackSpeed; this.damage = damage; this.armorMultiplier = armorMultiplier; this.armorBonus = armorBonus; } } internal sealed class VariantItems { internal (string name, int count)[] items = Array.Empty<(string, int)>(); internal string equipment; internal Keyframe[] useChance; internal (string name, int count, float duration)[] buffs = Array.Empty<(string, int, float)>(); } internal sealed class Variant { internal readonly string name; internal readonly string body; internal readonly string nameToken; internal readonly float spawnRate; internal bool unique; internal bool un