using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using IL.RoR2;
using IL.RoR2.Stats;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour.HookGen;
using On.RoR2;
using On.RoR2.Items;
using On.RoR2.Projectile;
using On.RoR2.UI;
using On.RoR2.UI.LogBook;
using On.RoR2.UI.MainMenu;
using RoR2;
using RoR2.ContentManagement;
using RoR2.ExpansionManagement;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Stats;
using RoR2.UI;
using RoR2.UI.MainMenu;
using SimpleJSON;
using TMPro;
using TPDespair.ZetAspects.Compat;
using TPDespair.ZetAspects.Items;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Networking;
using UnityEngine.Rendering.PostProcessing;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ZetAspects")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ZetAspects")]
[assembly: AssemblyTitle("ZetAspects")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace TPDespair.ZetAspects
{
public static class AspectPacks
{
public static void Init()
{
AspectPack aspectPack = new AspectPack();
aspectPack.identifier = "RiskOfRain";
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectWhite",
FindEquipmentDef = () => Equipment.AffixWhite,
itemName = "ZetAspectWhite",
displayPriority = 2500,
BaseIcon = () => Catalog.Sprites.AffixWhite,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectWhite.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixWhite = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixWhite = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectBlue",
FindEquipmentDef = () => Equipment.AffixBlue,
itemName = "ZetAspectBlue",
displayPriority = 2501,
BaseIcon = () => Catalog.Sprites.AffixBlue,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectBlue.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixBlue = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixBlue = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectRed",
FindEquipmentDef = () => Equipment.AffixRed,
itemName = "ZetAspectRed",
displayPriority = 2502,
BaseIcon = () => Catalog.Sprites.AffixRed,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectRed.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixRed = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixRed = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectHaunted",
FindEquipmentDef = () => Equipment.AffixHaunted,
itemName = "ZetAspectHaunted",
displayPriority = 7500,
BaseIcon = () => Catalog.Sprites.AffixHaunted,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectHaunted.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixHaunted = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixHaunted = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectPoison",
FindEquipmentDef = () => Equipment.AffixPoison,
itemName = "ZetAspectPoison",
displayPriority = 7501,
BaseIcon = () => Catalog.Sprites.AffixPoison,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectPoison.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixPoison = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixPoison = buffDef;
},
bodyBlacklist = new List<string> { "UrchinTurretBody", "AspectAbilitiesMalachiteUrchinOrbitalBody" }
},
new AspectDef
{
identifier = "ZetAspectLunar",
FindEquipmentDef = () => Equipment.AffixLunar,
itemName = "ZetAspectLunar",
displayPriority = 7550,
BaseIcon = () => Catalog.Sprites.AffixLunar,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectLunar.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixLunar = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixLunar = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectEarth",
equipmentName = "EliteEarthEquipment",
itemName = "ZetAspectEarth",
displayPriority = 2525,
BaseIcon = () => Catalog.Sprites.AffixEarth,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectEarth.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixEarth = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixEarth = buffDef;
},
bodyBlacklist = new List<string> { "AffixEarthHealerBody" }
},
new AspectDef
{
identifier = "ZetAspectVoid",
equipmentName = "EliteVoidEquipment",
itemName = "ZetAspectVoid",
displayPriority = 12500,
disableDisplayOnDeath = true,
copyEquipmentPrefab = false,
BaseIcon = () => Catalog.Sprites.AffixVoid,
OutlineIcon = () => Configuration.AspectVoidContagiousItem.Value ? Catalog.Sprites.OutlineVoid : Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectVoid.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixVoid = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixVoid = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectAurelionite",
FindEquipmentDef = () => Equipment.EliteAurelioniteEquipment,
itemName = "ZetAspectAurelionite",
displayPriority = 3750,
BaseIcon = () => Catalog.Sprites.AffixAurelionite,
OutlineIcon = () => Catalog.AspectVoidContagious ? Catalog.Sprites.OutlineVoid : Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectAurelionite.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixAurelionite = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixAurelionite = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectBead",
FindEquipmentDef = () => Equipment.EliteBeadEquipment,
itemName = "ZetAspectBead",
displayPriority = 7560,
BaseIcon = () => Catalog.Sprites.AffixBead,
OutlineIcon = () => Catalog.AspectVoidContagious ? Catalog.Sprites.OutlineVoid : Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectBead.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixBead = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixBead = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectCollective",
FindEquipmentDef = () => Equipment.EliteCollectiveEquipment,
itemName = "ZetAspectCollective",
displayPriority = 1,
BaseIcon = delegate
{
Sprite baseSprite = Catalog.TryUseSprite(Equipment.EliteCollectiveEquipment.pickupIconSprite);
return Catalog.TrimSpriteEdge(baseSprite, 8, 24);
},
OutlineIcon = () => Catalog.AspectVoidContagious ? Catalog.Sprites.OutlineVoid : Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectCollective.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixCollective = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixCollective = buffDef;
}
}
};
aspectPack.PostInit = delegate
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: 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)
Catalog.mithrixBodyIndex = BodyCatalog.FindBodyIndex("BrotherBody");
Catalog.voidlingBodyIndex = BodyCatalog.FindBodyIndex("VoidRaidCrabBody");
Catalog.artifactShellBodyIndex = BodyCatalog.FindBodyIndex("ArtifactShellBody");
Catalog.goldenTitanBodyIndex = BodyCatalog.FindBodyIndex("TitanGoldBody");
BuffDef affixHauntedRecipient = Buffs.AffixHauntedRecipient;
affixHauntedRecipient.buffColor = Color.white;
affixHauntedRecipient.iconSprite = Catalog.Sprites.HauntCloak;
};
AspectPackDefOf.RiskOfRain = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "SpikeStrip";
aspectPack.dependency = "com.groovesalad.GrooveSaladSpikestripContent";
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectPlated",
equipmentName = "EQUIPMENT_AFFIXPLATED",
itemName = "ZetAspectPlated",
displayPriority = 3000,
BaseIcon = () => Catalog.Sprites.AffixPlated,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectPlated.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixPlated = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixPlated = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectWarped",
equipmentName = "EQUIPMENT_AFFIXWARPED",
itemName = "ZetAspectWarped",
displayPriority = 3001,
BaseIcon = () => Catalog.Sprites.AffixWarped,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectWarped.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixWarped = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixWarped = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectVeiled",
equipmentName = "EQUIPMENT_AFFIXVEILED",
itemName = "ZetAspectVeiled",
displayPriority = 3002,
BaseIcon = () => Catalog.Sprites.AffixVeiled,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectVeiled.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixVeiled = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixVeiled = buffDef;
},
Promoter = (CharacterBody body) => (IEnumerable<BuffIndex>)(object)(body.HasBuff(Catalog.veiledBuffer) ? new BuffIndex[1] { (BuffIndex)(int)Buffs.Cloak.buffIndex } : null),
OnRefresh = delegate(CharacterBody body)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
if (body.HasBuff(Catalog.veiledBuffer))
{
body.AddTimedBuff(Buffs.Cloak, 5f);
}
},
OnExpire = delegate(CharacterBody body)
{
//IL_0007: 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)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < 2; i++)
{
if (body.HasBuff(Catalog.veiledBuffer))
{
body.RemoveBuff(Catalog.veiledBuffer);
}
}
if (body.HasBuff(Buffs.Cloak))
{
body.ClearTimedBuffs(Buffs.Cloak);
}
if (body.HasBuff(BuffDefOf.ZetElusive))
{
body.SetBuffCount(BuffDefOf.ZetElusive.buffIndex, 0);
}
}
},
new AspectDef
{
identifier = "ZetAspectAragonite",
equipmentName = "EQUIPMENT_AFFIXARAGONITE",
itemName = "ZetAspectAragonite",
displayPriority = 9000,
BaseIcon = () => Catalog.Sprites.AffixAragonite,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectAragonite.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixAragonite = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixAragonite = buffDef;
}
}
};
aspectPack.PostInit = delegate
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)EquipDefOf.AffixVeiled != (Object)null)
{
EliteBuffManager.MonitorBuff(Buffs.Cloak.buffIndex);
EliteBuffManager.MonitorTriggered += delegate(EliteBuffManager manager, BuffIndex buffIndex)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: 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)
if (buffIndex == Buffs.Cloak.buffIndex && ((ItemBehavior)manager).body.HasBuff(BuffDefOf.AffixVeiled))
{
manager.AddBuffToRefresh(BuffDefOf.AffixVeiled.buffIndex);
}
};
}
};
AspectPackDefOf.SpikeStrip = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "GoldenCoastPlus";
aspectPack.CustomDependency = () => Catalog.PluginLoaded("com.Skell.GoldenCoastPlus") || Catalog.PluginLoaded("com.Phreel.GoldenCoastPlusRevived");
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectGold",
equipmentName = "EliteGoldEquipment",
itemName = "ZetAspectGold",
displayPriority = 500,
copyEquipmentPrefab = false,
BaseIcon = () => Catalog.Sprites.AffixGold,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectGold.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixGold = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixGold = buffDef;
}
}
};
AspectPackDefOf.GoldenCoastPlus = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "Aetherium";
aspectPack.dependency = "com.KomradeSpectre.Aetherium";
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectSanguine",
equipmentName = "AETHERIUM_ELITE_EQUIPMENT_AFFIX_SANGUINE",
itemName = "ZetAspectSanguine",
displayPriority = 7000,
BaseIcon = () => Catalog.Sprites.AffixSanguine,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectSanguine.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixSanguine = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixSanguine = buffDef;
}
}
};
AspectPackDefOf.Aetherium = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "Bubbet";
aspectPack.dependency = "bubbet.bubbetsitems";
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectSepia",
equipmentName = "EquipmentDefSepiaElite",
itemName = "ZetAspectSepia",
buffName = "BuffDefSepia",
displayPriority = 750,
copyEquipmentPrefab = false,
BaseIcon = () => Catalog.Sprites.AffixSepia,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectSepia.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixSepia = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixSepia = buffDef;
}
}
};
aspectPack.PostInit = delegate
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
BuffDef affixSepia = BuffDefOf.AffixSepia;
if (Object.op_Implicit((Object)(object)affixSepia))
{
affixSepia.buffColor = Color.white;
affixSepia.iconSprite = Catalog.Sprites.SepiaElite;
}
};
AspectPackDefOf.Bubbet = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "WarWisp";
aspectPack.dependency = "com.PopcornFactory.WispMod";
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectNullifier",
equipmentName = "WARFRAMEWISP_ELITE_EQUIPMENT_AFFIX_NULLIFIER",
itemName = "ZetAspectNullifier",
displayPriority = 6500,
BaseIcon = () => Catalog.Sprites.AffixNullifier,
OutlineIcon = () => Catalog.Sprites.OutlineNull,
SetupTokens = ZetAspectNullifier.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixNullifier = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixNullifier = buffDef;
}
}
};
AspectPackDefOf.WarWisp = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "Blighted";
aspectPack.dependency = "com.Moffein.BlightedElites";
aspectPack.alwaysValidate = true;
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectBlighted",
equipmentName = "AffixBlightedMoffein",
itemName = "ZetAspectBlighted",
displayPriority = 15000,
BaseIcon = () => Catalog.Sprites.AffixBlighted,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectBlighted.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixBlighted = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixBlighted = buffDef;
}
}
};
aspectPack.PostInit = delegate
{
if (Configuration.BlightedHooks.Value)
{
Blighted.LateSetup();
}
};
AspectPackDefOf.Blighted = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "GOTCE";
aspectPack.dependency = "com.TheBestAssociatedLargelyLudicrousSillyheadGroup.GOTCE";
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectBackup",
equipmentName = "ELITE_EQUIPMENT_BACKUP",
itemName = "ZetAspectBackup",
displayPriority = 1000,
BaseIcon = () => Catalog.Sprites.AffixBackup,
OutlineIcon = () => Catalog.Sprites.OutlineCracked,
SetupTokens = ZetAspectBackup.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixBackup = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixBackup = buffDef;
}
}
};
aspectPack.PostInit = delegate
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Invalid comparison between Unknown and I4
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: 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)
BuffIndex val6 = BuffCatalog.FindBuffIndex("Backuped");
if ((int)val6 != -1)
{
BuffDefOf.BackupDebuff = BuffCatalog.GetBuffDef(val6);
}
BuffDef backupDebuff = BuffDefOf.BackupDebuff;
if (Object.op_Implicit((Object)(object)backupDebuff))
{
backupDebuff.buffColor = Color.white;
backupDebuff.iconSprite = Catalog.Sprites.BackupDebuff;
}
};
AspectPackDefOf.GOTCE = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "Thalasso";
aspectPack.dependency = "com.jt_hehe.Thalassophobia";
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectPurity",
equipmentName = "THALASSOPHOBIA_ELITE_EQUIPMENT_AFFIX_PURE",
itemName = "ZetAspectPurity",
displayPriority = 3500,
copyEquipmentPrefab = false,
BaseIcon = () => Catalog.Sprites.AffixPurity,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectPurity.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixPurity = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixPurity = buffDef;
}
}
};
AspectPackDefOf.Thalasso = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "RisingTides";
aspectPack.dependency = "com.themysticsword.risingtides";
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectBarrier",
equipmentName = "RisingTides_AffixBarrier",
itemName = "ZetAspectBarrier",
displayPriority = 10250,
BaseIcon = () => Catalog.Sprites.AffixBarrier,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectBarrier.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixBarrier = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixBarrier = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectBlackHole",
equipmentName = "RisingTides_AffixBlackHole",
itemName = "ZetAspectBlackHole",
displayPriority = 10000,
BaseIcon = () => Catalog.Sprites.AffixBlackHole,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectBlackHole.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixBlackHole = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixBlackHole = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectMoney",
equipmentName = "RisingTides_AffixMoney",
itemName = "ZetAspectMoney",
displayPriority = 4501,
BaseIcon = () => Catalog.Sprites.AffixMoney,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectMoney.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixMoney = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixMoney = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectNight",
equipmentName = "RisingTides_AffixNight",
itemName = "ZetAspectNight",
displayPriority = 4500,
BaseIcon = () => Catalog.Sprites.AffixNight,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectNight.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixNight = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixNight = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectWater",
equipmentName = "RisingTides_AffixWater",
itemName = "ZetAspectWater",
displayPriority = 10001,
BaseIcon = () => Catalog.Sprites.AffixWater,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectWater.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixWater = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixWater = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectRealgar",
equipmentName = "RisingTides_AffixImpPlane",
itemName = "ZetAspectRealgar",
displayPriority = 10002,
BaseIcon = () => Catalog.Sprites.AffixRealgar,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectRealgar.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixRealgar = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixRealgar = buffDef;
}
}
};
aspectPack.PostInit = delegate
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Invalid comparison between Unknown and I4
//IL_0027: 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_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Invalid comparison between Unknown and I4
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
BuffIndex val5 = BuffCatalog.FindBuffIndex("RisingTides_NightSpeedBoost");
if ((int)val5 != -1)
{
BuffDefOf.NightSpeed = BuffCatalog.GetBuffDef(val5);
}
val5 = BuffCatalog.FindBuffIndex("RisingTides_NightReducedVision");
if ((int)val5 != -1)
{
BuffDefOf.NightBlind = BuffCatalog.GetBuffDef(val5);
}
};
AspectPackDefOf.RisingTides = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "NemRisingTides";
aspectPack.dependency = "prodzpod.NemesisRisingTides";
aspectPack.alwaysValidate = true;
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectBuffered",
FindEquipmentDef = delegate
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Invalid comparison between Unknown and I4
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
NemRisingTides.PrepareEquipmentCheck();
EquipmentIndex val4 = EquipmentCatalog.FindEquipmentIndex("NemesisRisingTides_AffixBuffered");
return ((int)val4 != -1 && NemRisingTides.GetBufferedEnabled()) ? EquipmentCatalog.GetEquipmentDef(val4) : null;
},
itemName = "ZetAspectBuffered",
displayPriority = 4000,
BaseIcon = () => Catalog.Sprites.AffixBuffered,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectBuffered.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixBuffered = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixBuffered = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectOppressive",
FindEquipmentDef = delegate
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Invalid comparison between Unknown and I4
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
NemRisingTides.PrepareEquipmentCheck();
EquipmentIndex val3 = EquipmentCatalog.FindEquipmentIndex("NemesisRisingTides_AffixOppressive");
return ((int)val3 != -1 && NemRisingTides.GetOppressiveEnabled()) ? EquipmentCatalog.GetEquipmentDef(val3) : null;
},
itemName = "ZetAspectOppressive",
displayPriority = 11000,
BaseIcon = () => Catalog.Sprites.AffixOppressive,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectOppressive.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixOppressive = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixOppressive = buffDef;
}
}
};
AspectPackDefOf.NemRisingTides = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "MoreElites";
aspectPack.CustomDependency = () => Catalog.PluginLoaded("com.Nuxlar.MoreElites") || Catalog.PluginLoaded("com.score.MoreElites");
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectEmpowering",
equipmentName = "AffixEmpowering",
itemName = "ZetAspectEmpowering",
displayPriority = 1501,
BaseIcon = () => Catalog.Sprites.AffixBuffing,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectEmpowering.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixEmpowering = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixEmpowering = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectFrenzied",
equipmentName = "AffixFrenziedNuxlar",
itemName = "ZetAspectFrenzied",
displayPriority = 1500,
BaseIcon = () => Catalog.Sprites.AffixFrenzied,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectFrenzied.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixFrenzied = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixFrenzied = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectVolatile",
equipmentName = "AffixVolatile",
itemName = "ZetAspectVolatile",
displayPriority = 1502,
BaseIcon = () => Catalog.Sprites.AffixVolatile,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectVolatile.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixVolatile = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixVolatile = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectEcho",
equipmentName = "AffixEcho",
itemName = "ZetAspectEcho",
displayPriority = 8000,
BaseIcon = () => Catalog.Sprites.AffixEcho,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectEcho.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixEcho = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixEcho = buffDef;
},
AllowAffix = (CharacterBody body, Inventory inventory) => (Object)(object)inventory != (Object)null && inventory.GetItemCountEffective(Catalog.summonedEcho) == 0,
PreBuffGrant = delegate(CharacterBody body, Inventory inventory)
{
body.AddTimedBuff(BuffDefOf.ZetEchoPrimer, 0.1f);
return false;
}
}
};
AspectPackDefOf.MoreElites = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "EliteVariety";
aspectPack.dependency = "com.themysticsword.elitevariety";
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectArmor",
equipmentName = "EliteVariety_AffixArmored",
itemName = "ZetAspectArmor",
displayPriority = 5001,
BaseIcon = () => Catalog.Sprites.AffixArmored,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectArmor.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixArmored = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixArmored = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectBanner",
equipmentName = "EliteVariety_AffixBuffing",
itemName = "ZetAspectBanner",
displayPriority = 5100,
BaseIcon = () => Catalog.Sprites.AffixBuffing,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectBanner.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixBuffing = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixBuffing = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectImpale",
equipmentName = "EliteVariety_AffixImpPlane",
itemName = "ZetAspectImpale",
displayPriority = 9500,
BaseIcon = () => Catalog.Sprites.AffixImpPlane,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectImpale.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixImpPlane = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixImpPlane = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectGolden",
equipmentName = "EliteVariety_AffixPillaging",
itemName = "ZetAspectGolden",
displayPriority = 5000,
BaseIcon = () => Catalog.Sprites.AffixPillaging,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectGolden.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixPillaging = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixPillaging = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectCyclone",
equipmentName = "EliteVariety_AffixSandstorm",
itemName = "ZetAspectCyclone",
displayPriority = 5200,
BaseIcon = () => Catalog.Sprites.AffixSandstorm,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectCyclone.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixSandstorm = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixSandstorm = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectTinker",
equipmentName = "EliteVariety_AffixTinkerer",
itemName = "ZetAspectTinker",
displayPriority = 5250,
BaseIcon = () => Catalog.Sprites.AffixTinkerer,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectTinker.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixTinkerer = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixTinkerer = buffDef;
},
bodyBlacklist = new List<string> { "EliteVariety_TinkererDroneBody" }
}
};
aspectPack.PostInit = delegate
{
//IL_001c: 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_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: 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_0033: Invalid comparison between Unknown and I4
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
if (Configuration.EliteVarietyHooks.Value)
{
EliteVariety.LateSetup();
}
Catalog.tinkerDroneBodyIndex = BodyCatalog.FindBodyIndex("EliteVariety_TinkererDroneBody");
BuffIndex val2 = BuffCatalog.FindBuffIndex("EliteVariety_SandstormBlind");
if ((int)val2 != -1)
{
BuffDefOf.SandBlind = BuffCatalog.GetBuffDef(val2);
}
};
AspectPackDefOf.EliteVariety = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "Augmentum";
aspectPack.dependency = "com.BrandonRosa.Augmentum";
aspectPack.alwaysValidate = true;
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectAdaptive",
equipmentName = "BRANS_ELITE_EQUIPMENT_AFFIX_ADAPTIVE",
itemName = "ZetAspectAdaptive",
displayPriority = 6000,
BaseIcon = () => Catalog.Sprites.AffixAdaptive,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectAdaptive.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixAdaptive = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixAdaptive = buffDef;
}
}
};
aspectPack.PostInit = delegate
{
//IL_0029: 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_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
if (Configuration.AugmentumHooks.Value)
{
Augmentum.LateSetup();
}
if (Augmentum.DeactivateAdaptiveDrop)
{
ItemIndex val = ItemCatalog.FindItemIndex("ITEM_ZETAFFIX_ADAPTIVE");
ItemDef itemDef = ItemCatalog.GetItemDef(val);
if ((Object)(object)itemDef != (Object)null)
{
Logger.Warn("Augmentum AspectPack PostInit - Deactivating : " + ((Object)itemDef).name);
if ((Object)(object)itemDef._itemTierDef == (Object)(object)Catalog.BossItemTier && ItemCatalog.tier3ItemList.Contains(itemDef.itemIndex))
{
ItemCatalog.tier3ItemList.Remove(itemDef.itemIndex);
}
itemDef.tier = (ItemTier)5;
Catalog.AssignDepricatedTier(itemDef, (ItemTier)5);
itemDef.hidden = true;
if (itemDef.DoesNotContainTag((ItemTag)9))
{
ItemTag[] array = itemDef.tags;
int num = array.Length;
Array.Resize(ref array, num + 1);
array[num] = (ItemTag)9;
itemDef.tags = array;
}
}
}
};
AspectPackDefOf.Augmentum = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "Sandswept";
aspectPack.dependency = "com.TeamSandswept.Sandswept";
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectMotivator",
equipmentName = "ELITE_EQUIPMENT_MOTIVATING",
itemName = "ZetAspectMotivator",
displayPriority = 5750,
BaseIcon = () => Catalog.Sprites.AffixMotivator,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectMotivator.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixMotivator = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixMotivator = buffDef;
}
},
new AspectDef
{
identifier = "ZetAspectOsmium",
equipmentName = "ELITE_EQUIPMENT_OSMIUM",
itemName = "ZetAspectOsmium",
displayPriority = 13000,
BaseIcon = () => Catalog.Sprites.AffixOsmium,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectOsmium.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixOsmium = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixOsmium = buffDef;
}
}
};
AspectPackDefOf.Sandswept = aspectPack.Register();
aspectPack = new AspectPack();
aspectPack.identifier = "Starstorm";
aspectPack.dependency = "com.TeamMoonstorm";
aspectPack.alwaysValidate = true;
aspectPack.aspectDefs = new List<AspectDef>
{
new AspectDef
{
identifier = "ZetAspectEmpyrean",
equipmentName = "AffixEmpyrean",
itemName = "ZetAspectEmpyrean",
displayPriority = 18000,
BaseIcon = () => Catalog.Sprites.AffixEmpyrean,
OutlineIcon = () => Catalog.Sprites.OutlineStandard,
SetupTokens = ZetAspectEmpyrean.SetupTokens,
RefEquipmentDef = delegate(EquipmentDef equipmentDef)
{
EquipDefOf.AffixEmpyrean = equipmentDef;
},
RefBuffDef = delegate(BuffDef buffDef)
{
BuffDefOf.AffixEmpyrean = buffDef;
}
}
};
aspectPack.PostInit = delegate
{
if (Configuration.StarstormHooks.Value)
{
Starstorm.LateSetup();
}
};
AspectPackDefOf.Starstorm = aspectPack.Register();
}
}
public enum PopState
{
None = 0,
Equip = 1,
Buff = 2,
Item = 4,
Replace = 8,
Populated = 0x10
}
public static class FlagExt
{
public static void SetFlag(this ref PopState flag, PopState other)
{
flag |= other;
}
public static bool CheckFlag(this PopState flag, PopState other)
{
return (flag & other) != 0;
}
}
public class AspectDef
{
public string identifier = "";
public AspectPack pack;
public EquipmentDef equipmentDef;
public BuffDef buffDef;
public ItemDef itemDef;
public string equipmentName = "";
public string buffName = "";
public string itemName = "";
public Func<EquipmentDef> FindEquipmentDef;
public Func<BuffDef> FindBuffDef;
public Func<ItemDef> FindItemDef;
public Action<EquipmentDef> RefEquipmentDef;
public Action<BuffDef> RefBuffDef;
public Action<ItemDef> RefItemDef;
public Func<Sprite> BaseIcon;
public Func<Sprite> OutlineIcon;
public bool copyEquipmentPrefab = true;
public int displayPriority = 1;
public bool disableDisplayOnDeath = false;
public Action SetupTokens;
public List<string> bodyBlacklist = new List<string>();
public List<BodyIndex> blacklistedIndexes = new List<BodyIndex>();
public Func<CharacterBody, Inventory, bool> AllowAffix;
public Func<CharacterBody, Inventory, bool> PreBuffGrant;
public Func<CharacterBody, IEnumerable<BuffIndex>> Promoter;
public Action<CharacterBody> OnApplied;
public Action<CharacterBody> OnRefresh;
public Action<CharacterBody> OnExpire;
public bool invalid = false;
public ConfigEntry<float> DropWeight;
public bool PackPopulated
{
get
{
if (pack != null)
{
return pack.Populated;
}
return false;
}
}
public bool PackEnabled
{
get
{
if (pack != null)
{
return pack.Enabled;
}
return false;
}
}
internal void CreateDropWeightConfig(ConfigFile config)
{
DropWeight = config.Bind<float>("0b-DropWeight", "aspectDropWeight" + identifier, 1f, "Drop chance multiplier for " + identifier);
}
}
public class AspectPack
{
public string identifier = "";
public string dependency = "";
public List<string> dependencies = new List<string>();
public Func<bool> CustomDependency = () => true;
public bool alwaysValidate = false;
public Action PostInit;
private int _enabled = -1;
private PopState PopState = PopState.None;
public List<AspectDef> aspectDefs = new List<AspectDef>();
public bool Enabled
{
get
{
if (_enabled == -1)
{
if (dependency == "")
{
if (dependencies.Count == 0)
{
_enabled = (CustomDependency() ? 1 : 0);
}
else
{
foreach (string dependency in dependencies)
{
if (!Catalog.PluginLoaded(dependency))
{
_enabled = 0;
return false;
}
}
_enabled = 1;
}
}
else
{
_enabled = (Catalog.PluginLoaded(this.dependency) ? 1 : 0);
}
}
return _enabled == 1;
}
}
public bool Populated => PopState.CheckFlag(PopState.Populated);
public AspectPack Register()
{
Catalog.aspectPacks.Add(this);
foreach (AspectDef aspectDef in aspectDefs)
{
Catalog.aspectDefs.Add(aspectDef);
}
return this;
}
internal void Entrada()
{
if (Enabled)
{
AssignPack();
PopulateEquipment();
PopulateItems();
ValidateDefs();
DisableInactiveItems();
ApplyIcons();
}
else if (alwaysValidate)
{
AssignPack();
PopulateEquipment();
PopulateItems();
ValidateDefs();
DisableInactiveItems();
}
}
internal void Init()
{
if (Enabled)
{
PopulateEquipment();
PopulateBuffs();
PopulateItems();
ValidateDefs();
DisableInactiveItems();
ResolveBlacklist();
CopyExpansionReq();
CopyModelPrefabs();
ApplyIcons();
EquipmentColor();
SetupTokens();
if (DropHooks.CanObtainEquipment())
{
EquipmentEntries(shown: true);
}
ItemEntries(DropHooks.CanObtainItem());
FillEqualities();
PopState.SetFlag(PopState.Populated);
}
else if (alwaysValidate)
{
PopulateEquipment();
PopulateItems();
ValidateDefs();
DisableInactiveItems();
}
}
internal void Finale()
{
if (Populated)
{
ItemEntries(shown: true);
EquipmentEntries(shown: false);
}
}
private void AssignPack()
{
foreach (AspectDef aspectDef in aspectDefs)
{
aspectDef.pack = this;
}
}
private void PopulateEquipment()
{
//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_005a: Invalid comparison between Unknown and I4
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
if (PopState.CheckFlag(PopState.Equip))
{
return;
}
foreach (AspectDef aspectDef in aspectDefs)
{
EquipmentDef val = null;
if (aspectDef.equipmentName != "")
{
EquipmentIndex val2 = EquipmentCatalog.FindEquipmentIndex(aspectDef.equipmentName);
if ((int)val2 != -1)
{
val = EquipmentCatalog.GetEquipmentDef(val2);
}
if (!Object.op_Implicit((Object)(object)val))
{
Logger.Warn("Failed to find EquipmentDef named : " + aspectDef.equipmentName);
}
}
if (!Object.op_Implicit((Object)(object)val))
{
val = aspectDef.FindEquipmentDef?.Invoke();
}
if (Object.op_Implicit((Object)(object)val))
{
aspectDef.equipmentDef = val;
aspectDef.RefEquipmentDef?.Invoke(val);
}
if (!Object.op_Implicit((Object)(object)aspectDef.equipmentDef))
{
aspectDef.invalid = true;
Logger.Warn("Failed to find EquipmentDef for : " + aspectDef.identifier);
}
}
PopState.SetFlag(PopState.Equip);
}
private void PopulateBuffs()
{
//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_005a: Invalid comparison between Unknown and I4
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
if (PopState.CheckFlag(PopState.Buff))
{
return;
}
foreach (AspectDef aspectDef in aspectDefs)
{
BuffDef val = null;
if (aspectDef.buffName != "")
{
BuffIndex val2 = BuffCatalog.FindBuffIndex(aspectDef.buffName);
if ((int)val2 != -1)
{
val = BuffCatalog.GetBuffDef(val2);
}
if (!Object.op_Implicit((Object)(object)val))
{
Logger.Warn("Failed to find BuffDef named : " + aspectDef.buffName);
}
}
if (!Object.op_Implicit((Object)(object)val))
{
val = aspectDef.FindBuffDef?.Invoke();
}
if (!Object.op_Implicit((Object)(object)val) && (Object)(object)aspectDef.equipmentDef != (Object)null)
{
val = aspectDef.equipmentDef.passiveBuffDef;
if (!Object.op_Implicit((Object)(object)val))
{
Logger.Error("EquipmentDef of " + aspectDef.identifier + " does not have a passiveBuffDef!");
}
}
if (Object.op_Implicit((Object)(object)val))
{
aspectDef.buffDef = val;
aspectDef.RefBuffDef?.Invoke(val);
}
if (!Object.op_Implicit((Object)(object)aspectDef.buffDef))
{
aspectDef.invalid = true;
Logger.Warn("Failed to find BuffDef for : " + aspectDef.identifier);
}
}
PopState.SetFlag(PopState.Buff);
}
private void PopulateItems()
{
//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_005a: Invalid comparison between Unknown and I4
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
if (PopState.CheckFlag(PopState.Item))
{
return;
}
foreach (AspectDef aspectDef in aspectDefs)
{
ItemDef val = null;
if (aspectDef.itemName != "")
{
ItemIndex val2 = ItemCatalog.FindItemIndex(aspectDef.itemName);
if ((int)val2 != -1)
{
val = ItemCatalog.GetItemDef(val2);
}
if (!Object.op_Implicit((Object)(object)val))
{
Logger.Warn("Failed to find ItemDef named : " + aspectDef.itemName);
}
}
if (!Object.op_Implicit((Object)(object)val))
{
val = aspectDef.FindItemDef?.Invoke();
}
if (Object.op_Implicit((Object)(object)val))
{
aspectDef.itemDef = val;
aspectDef.RefItemDef?.Invoke(val);
}
if (!Object.op_Implicit((Object)(object)aspectDef.itemDef))
{
aspectDef.invalid = true;
Logger.Warn("Failed to find ItemDef for : " + aspectDef.identifier);
}
}
PopState.SetFlag(PopState.Item);
}
private void ValidateDefs()
{
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Invalid comparison between Unknown and I4
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Invalid comparison between Unknown and I4
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Invalid comparison between Unknown and I4
if ((PopState & (PopState)7) == 0)
{
Logger.Warn("Tried to ValidateDefs of " + identifier + " but nothing is populated!");
return;
}
foreach (AspectDef aspectDef in aspectDefs)
{
if (PopState.CheckFlag(PopState.Equip))
{
if (Object.op_Implicit((Object)(object)aspectDef.equipmentDef))
{
if ((int)aspectDef.equipmentDef.equipmentIndex == -1)
{
aspectDef.invalid = true;
Logger.Warn(aspectDef.identifier + " : associated EquipmentIndex is [none]!");
}
}
else
{
aspectDef.invalid = true;
Logger.Warn(aspectDef.identifier + " : associated Equipment is null!");
}
}
if (PopState.CheckFlag(PopState.Buff))
{
if (Object.op_Implicit((Object)(object)aspectDef.buffDef))
{
if ((int)aspectDef.buffDef.buffIndex == -1)
{
aspectDef.invalid = true;
Logger.Warn(aspectDef.identifier + " : associated BuffIndex is [none]!");
}
}
else
{
aspectDef.invalid = true;
Logger.Warn(aspectDef.identifier + " : associated Buff is null!");
}
}
if (!PopState.CheckFlag(PopState.Item))
{
continue;
}
if (Object.op_Implicit((Object)(object)aspectDef.itemDef))
{
if ((int)aspectDef.itemDef.itemIndex == -1)
{
aspectDef.invalid = true;
Logger.Warn(aspectDef.identifier + " : associated ItemIndex is [none]!");
}
}
else
{
aspectDef.invalid = true;
Logger.Warn(aspectDef.identifier + " : associated Item is null!");
}
}
}
private void DisableInactiveItems()
{
foreach (AspectDef aspectDef in aspectDefs)
{
if (aspectDef.invalid)
{
DeactivateItem(aspectDef);
aspectDef.RefEquipmentDef?.Invoke(null);
aspectDef.RefBuffDef?.Invoke(null);
aspectDef.RefItemDef?.Invoke(null);
}
}
}
private void ResolveBlacklist()
{
//IL_0047: 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_0051: Invalid comparison between Unknown and I4
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
foreach (AspectDef aspectDef in aspectDefs)
{
if (aspectDef.bodyBlacklist.Count <= 0)
{
continue;
}
foreach (string item in aspectDef.bodyBlacklist)
{
BodyIndex val = BodyCatalog.FindBodyIndex(item);
if ((int)val != -1)
{
aspectDef.blacklistedIndexes.Add(val);
}
}
}
}
private void CopyExpansionReq()
{
foreach (AspectDef aspectDef in aspectDefs)
{
CopyExpansion(aspectDef);
}
}
private void CopyModelPrefabs()
{
foreach (AspectDef aspectDef in aspectDefs)
{
CopyModelPrefab(aspectDef);
}
}
private void ApplyIcons()
{
if (PopState.CheckFlag(PopState.Replace))
{
return;
}
foreach (AspectDef aspectDef in aspectDefs)
{
SetupIcons(aspectDef);
}
PopState.SetFlag(PopState.Replace);
}
private void EquipmentColor()
{
foreach (AspectDef aspectDef in aspectDefs)
{
if (Object.op_Implicit((Object)(object)aspectDef.equipmentDef))
{
ColorEquipmentDroplet(aspectDef.equipmentDef);
}
}
}
private void SetupTokens()
{
foreach (AspectDef aspectDef in aspectDefs)
{
aspectDef.SetupTokens?.Invoke();
}
}
internal void ItemEntries(bool shown)
{
foreach (AspectDef aspectDef in aspectDefs)
{
SetItemState(aspectDef, shown);
}
}
internal void EquipmentEntries(bool shown)
{
foreach (AspectDef aspectDef in aspectDefs)
{
SetEquipmentState(aspectDef, shown);
}
}
internal void FillEqualities()
{
if ((PopState & (PopState)7) == (PopState)7)
{
foreach (AspectDef aspectDef in aspectDefs)
{
if (!aspectDef.invalid)
{
CreateEquality(aspectDef);
}
}
return;
}
Logger.Error("Tried to FillEqualities for : " + identifier + " but defs have not been fully validated!");
Logger.Warn("---- PopState: " + PopState);
}
private static void DeactivateItem(AspectDef aspectDef)
{
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
ItemDef itemDef = aspectDef.itemDef;
if (!Object.op_Implicit((Object)(object)itemDef))
{
Logger.Warn("Tried to disable ItemDef of " + aspectDef.identifier + " but it is null!");
return;
}
if (Catalog.disabledItemIndexes.Contains(itemDef.itemIndex))
{
Logger.Warn(((Object)itemDef).name + " : is already disabled!");
}
Logger.Warn("Deactivating : " + ((Object)itemDef).name);
if ((Object)(object)itemDef._itemTierDef == (Object)(object)Catalog.BossItemTier && ItemCatalog.tier3ItemList.Contains(itemDef.itemIndex))
{
ItemCatalog.tier3ItemList.Remove(itemDef.itemIndex);
}
itemDef.tier = (ItemTier)5;
Catalog.AssignDepricatedTier(itemDef, (ItemTier)5);
itemDef.hidden = true;
if (itemDef.DoesNotContainTag((ItemTag)9))
{
ItemTag[] array = itemDef.tags;
int num = array.Length;
Array.Resize(ref array, num + 1);
array[num] = (ItemTag)9;
itemDef.tags = array;
}
if (!Catalog.disabledItemIndexes.Contains(itemDef.itemIndex))
{
Catalog.disabledItemIndexes.Add(itemDef.itemIndex);
}
}
private static void CopyExpansion(AspectDef aspectDef)
{
if (Object.op_Implicit((Object)(object)aspectDef.equipmentDef) && Object.op_Implicit((Object)(object)aspectDef.itemDef))
{
aspectDef.itemDef.requiredExpansion = aspectDef.equipmentDef.requiredExpansion;
return;
}
Logger.Warn("Could not copy expansion requirement for " + aspectDef.identifier);
LogNullInfo(aspectDef);
}
private static void CopyModelPrefab(AspectDef aspectDef)
{
if (Object.op_Implicit((Object)(object)aspectDef.equipmentDef) && Object.op_Implicit((Object)(object)aspectDef.itemDef))
{
if (aspectDef.copyEquipmentPrefab)
{
CopyEquipmentPrefab(aspectDef.itemDef, aspectDef.equipmentDef);
}
else
{
CopyItemPrefab(aspectDef.itemDef, aspectDef.equipmentDef);
}
return;
}
if (aspectDef.copyEquipmentPrefab)
{
Logger.Warn("Could not copy model prefab [EQUIP] --> [ITEM] for : " + aspectDef.identifier);
}
else
{
Logger.Warn("Could not copy model prefab [ITEM] --> [EQUIP] for : " + aspectDef.identifier);
}
LogNullInfo(aspectDef);
}
private static void LogNullInfo(AspectDef aspectDef)
{
if (!Object.op_Implicit((Object)(object)aspectDef.equipmentDef) && !Object.op_Implicit((Object)(object)aspectDef.itemDef))
{
Logger.Warn("---- EquipmentDef and ItemDef is null!");
}
else if (!Object.op_Implicit((Object)(object)aspectDef.itemDef))
{
Logger.Warn("---- ItemDef is null!");
}
else if (!Object.op_Implicit((Object)(object)aspectDef.itemDef))
{
Logger.Warn("---- EquipmentDef is null!");
}
}
private static void CopyEquipmentPrefab(ItemDef itemDef, EquipmentDef equipDef)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
itemDef.pickupModelPrefab = equipDef.pickupModelPrefab;
PickupDef pickupDef = PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(itemDef.itemIndex));
pickupDef.displayPrefab = equipDef.pickupModelPrefab;
}
private static void CopyItemPrefab(ItemDef itemDef, EquipmentDef equipDef)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
equipDef.pickupModelPrefab = itemDef.pickupModelPrefab;
PickupDef pickupDef = PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(equipDef.equipmentIndex));
pickupDef.displayPrefab = itemDef.pickupModelPrefab;
}
private static void SetupIcons(AspectDef aspectDef)
{
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_021a: Unknown result type (might be due to invalid IL or missing references)
//IL_0228: Unknown result type (might be due to invalid IL or missing references)
//IL_022d: Unknown result type (might be due to invalid IL or missing references)
Sprite val = null;
Sprite val2 = ((aspectDef.OutlineIcon != null) ? aspectDef.OutlineIcon() : null);
if (aspectDef.BaseIcon != null)
{
try
{
val = aspectDef.BaseIcon();
}
catch (Exception data)
{
Logger.Error("Failed getting BaseIcon for: " + aspectDef.identifier);
Logger.Error(data);
val = Catalog.Sprites.AffixUnknown;
}
}
if ((Object)(object)val != (Object)null && (((Texture)val.texture).width != 128 || ((Texture)val.texture).height != 128))
{
Logger.Warn("BaseIcon MUST be 128x128, Resizing BaseIcon for " + aspectDef.identifier);
val = Catalog.TryUseSprite(val);
}
if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val2))
{
EquipmentDef equipmentDef = aspectDef.equipmentDef;
if (Object.op_Implicit((Object)(object)equipmentDef))
{
Color32 outlineColor = (aspectDef.equipmentDef.isLunar ? new Color32((byte)100, (byte)225, (byte)250, byte.MaxValue) : new Color32((byte)250, (byte)150, (byte)50, byte.MaxValue));
equipmentDef.pickupIconSprite = Catalog.CreateAspectSprite(val, val2, outlineColor);
PickupDef pickupDef = PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(equipmentDef.equipmentIndex));
pickupDef.iconSprite = equipmentDef.pickupIconSprite;
pickupDef.iconTexture = (Texture)(object)equipmentDef.pickupIconSprite.texture;
}
ItemDef itemDef = aspectDef.itemDef;
if (Object.op_Implicit((Object)(object)itemDef))
{
Color32 outlineColor2 = (Configuration.AspectRedTier.Value ? new Color32((byte)230, (byte)70, (byte)60, byte.MaxValue) : new Color32((byte)225, (byte)250, (byte)40, byte.MaxValue));
if (Catalog.AsHighlander)
{
((Color32)(ref outlineColor2))..ctor((byte)225, (byte)220, (byte)165, byte.MaxValue);
}
if ((Object)(object)val2 == (Object)(object)Catalog.Sprites.OutlineVoid)
{
((Color32)(ref outlineColor2))..ctor(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
}
itemDef.pickupIconSprite = Catalog.CreateAspectSprite(val, val2, outlineColor2);
PickupDef pickupDef2 = PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(itemDef.itemIndex));
pickupDef2.iconSprite = itemDef.pickupIconSprite;
pickupDef2.iconTexture = (Texture)(object)itemDef.pickupIconSprite.texture;
}
}
else
{
Logger.Warn("SetupIcons failed for : " + aspectDef.identifier);
if ((Object)(object)val == (Object)null)
{
Logger.Warn("---- BaseSprite is null!");
}
if ((Object)(object)val2 == (Object)null)
{
Logger.Warn("---- OutlineSprite is null!");
}
}
}
private static void ColorEquipmentDroplet(EquipmentDef equipDef)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: 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_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)
equipDef.isBoss = true;
equipDef.colorIndex = (ColorIndex)24;
PickupDef pickupDef = PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(equipDef.equipmentIndex));
pickupDef.isBoss = true;
if (Object.op_Implicit((Object)(object)Catalog.BossDropletPrefab))
{
pickupDef.dropletDisplayPrefab = Catalog.BossDropletPrefab;
}
pickupDef.baseColor = new Color(0.9f, 0.7f, 0.75f);
pickupDef.darkColor = new Color(0.9f, 0.7f, 0.75f);
}
private static void SetItemState(AspectDef aspectDef, bool shown)
{
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Invalid comparison between Unknown and I4
ItemDef itemDef = aspectDef.itemDef;
if (!Object.op_Implicit((Object)(object)itemDef))
{
Logger.Warn("Tried to set ItemState of " + aspectDef.identifier + " but it is null!");
return;
}
if (!Catalog.aspectItemIndexes.Contains(itemDef.itemIndex))
{
Catalog.aspectItemIndexes.Add(itemDef.itemIndex);
}
if (itemDef.hidden)
{
return;
}
if ((Object)(object)itemDef == (Object)(object)ItemDefOf.ZetAspectVoid && Configuration.AspectVoidContagiousItem.Value)
{
if (!shown)
{
itemDef.tier = (ItemTier)5;
}
else
{
itemDef.tier = (ItemTier)(Configuration.AspectRedTier.Value ? 8 : 9);
}
}
else if (!shown)
{
itemDef.tier = (ItemTier)5;
}
else
{
itemDef._itemTierDef = (Configuration.AspectRedTier.Value ? Catalog.RedItemTier : Catalog.BossItemTier);
}
if (Catalog.AsHighlander && (int)Catalog.highlanderTier != 1000 && ((Object)(object)itemDef._itemTierDef == (Object)(object)Catalog.BossItemTier || (Object)(object)itemDef._itemTierDef == (Object)(object)Catalog.RedItemTier))
{
itemDef._itemTierDef = Catalog.HighlanderItemTier;
}
}
private static void SetEquipmentState(AspectDef aspectDef, bool canDrop)
{
//IL_0039: 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)
EquipmentDef equipmentDef = aspectDef.equipmentDef;
if (!Object.op_Implicit((Object)(object)equipmentDef))
{
Logger.Warn("Tried to set EquipmentState of " + aspectDef.identifier + " but it is null!");
return;
}
if (!Catalog.aspectEquipIndexes.Contains(equipmentDef.equipmentIndex))
{
Catalog.aspectEquipIndexes.Add(equipmentDef.equipmentIndex);
}
equipmentDef.canDrop = canDrop;
}
private static void CreateEquality(AspectDef aspectDef)
{
//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_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0147: Unknown result type (might be due to invalid IL or missing references)
//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
//IL_021c: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
//IL_023d: Unknown result type (might be due to invalid IL or missing references)
//IL_0272: Unknown result type (might be due to invalid IL or missing references)
//IL_0277: Unknown result type (might be due to invalid IL or missing references)
//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
//IL_0257: Unknown result type (might be due to invalid IL or missing references)
//IL_025d: Unknown result type (might be due to invalid IL or missing references)
//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
//IL_0317: Unknown result type (might be due to invalid IL or missing references)
//IL_031c: Unknown result type (might be due to invalid IL or missing references)
//IL_0361: Unknown result type (might be due to invalid IL or missing references)
//IL_0366: Unknown result type (might be due to invalid IL or missing references)
//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0302: Unknown result type (might be due to invalid IL or missing references)
//IL_0387: Unknown result type (might be due to invalid IL or missing references)
//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
EquipmentDef equipmentDef = aspectDef.equipmentDef;
BuffDef buffDef = aspectDef.buffDef;
ItemDef itemDef = aspectDef.itemDef;
string[] obj = new string[6]
{
"CreateEquality : ",
Object.op_Implicit((Object)(object)equipmentDef) ? ((Object)equipmentDef).name : "null",
" , ",
null,
null,
null
};
object obj2;
BuffIndex buffIndex;
if (!Object.op_Implicit((Object)(object)buffDef))
{
obj2 = "null";
}
else
{
buffIndex = buffDef.buffIndex;
obj2 = "[" + ((object)(BuffIndex)(ref buffIndex)).ToString() + "] " + ((Object)buffDef).name;
}
obj[3] = (string)obj2;
obj[4] = " , ";
obj[5] = (Object.op_Implicit((Object)(object)itemDef) ? ((Object)itemDef).name : "null");
Logger.Info(string.Concat(obj));
if (!Object.op_Implicit((Object)(object)itemDef))
{
Logger.Warn("CreateEquality called for : " + aspectDef.identifier + " but its associated item is null!");
}
else if (Catalog.disabledItemIndexes.Contains(itemDef.itemIndex))
{
Logger.Warn("CreateEquality called for disabled aspect : " + aspectDef.identifier);
}
else if (Object.op_Implicit((Object)(object)equipmentDef) && Object.op_Implicit((Object)(object)buffDef))
{
if (!Catalog.aspectBuffIndexes.Contains(buffDef.buffIndex))
{
Catalog.aspectBuffIndexes.Add(buffDef.buffIndex);
}
if (aspectDef.Promoter != null && !Catalog.aspectsWithPromoters.Contains(aspectDef))
{
Catalog.aspectsWithPromoters.Add(aspectDef);
Logger.Info("Registered promoter: " + aspectDef.identifier);
}
if (!Catalog.buffToAspect.ContainsKey(buffDef.buffIndex))
{
Catalog.buffToAspect.Add(buffDef.buffIndex, aspectDef);
}
else
{
buffIndex = buffDef.buffIndex;
Logger.Warn("buffToAspect already contains key for : [" + ((object)(BuffIndex)(ref buffIndex)).ToString() + "] - " + ((Object)buffDef).name);
Logger.Warn("---- current aspect : " + aspectDef.identifier);
Logger.Warn("---- associated aspect : " + Catalog.buffToAspect[buffDef.buffIndex].identifier);
}
if (!Catalog.buffToItem.ContainsKey(buffDef.buffIndex))
{
Catalog.buffToItem.Add(buffDef.buffIndex, itemDef.itemIndex);
}
else
{
buffIndex = buffDef.buffIndex;
Logger.Warn("buffToItem already contains key for : [" + ((object)(BuffIndex)(ref buffIndex)).ToString() + "] - " + ((Object)buffDef).name);
Logger.Warn("---- current item : " + ((Object)itemDef).name);
Logger.Warn("---- associated item : " + ((Object)ItemCatalog.GetItemDef(Catalog.buffToItem[buffDef.buffIndex])).name);
}
if (!Catalog.buffToEquip.ContainsKey(buffDef.buffIndex))
{
Catalog.buffToEquip.Add(buffDef.buffIndex, equipmentDef.equipmentIndex);
}
else
{
buffIndex = buffDef.buffIndex;
Logger.Warn("buffToEquip already contains key for : [" + ((object)(BuffIndex)(ref buffIndex)).ToString() + "] - " + ((Object)buffDef).name);
Logger.Warn("---- current equipment : " + ((Object)equipmentDef).name);
Logger.Warn("---- associated equipment : " + ((Object)EquipmentCatalog.GetEquipmentDef(Catalog.buffToEquip[buffDef.buffIndex])).name);
}
if (!Catalog.equipToItem.ContainsKey(equipmentDef.equipmentIndex))
{
Catalog.equipToItem.Add(equipmentDef.equipmentIndex, itemDef.itemIndex);
return;
}
Logger.Warn("equipToItem already contains key for : " + ((Object)equipmentDef).name);
Logger.Warn("---- current item : " + ((Object)itemDef).name);
Logger.Warn("---- associated item : " + ((Object)ItemCatalog.GetItemDef(Catalog.equipToItem[equipmentDef.equipmentIndex])).name);
}
}
}
public static class Catalog
{
public static class Sprites
{
public static Sprite OutlineStandard;
public static Sprite OutlineVoid;
public static Sprite OutlineNull;
public static Sprite OutlineCracked;
public static Sprite AffixUnknown;
public static Sprite AffixWhite;
public static Sprite AffixBlue;
public static Sprite AffixRed;
public static Sprite AffixHaunted;
public static Sprite AffixPoison;
public static Sprite AffixLunar;
public static Sprite AffixEarth;
public static Sprite AffixVoid;
public static Sprite AffixAurelionite;
public static Sprite AffixBead;
public static Sprite AffixPlated;
public static Sprite AffixWarped;
public static Sprite AffixVeiled;
public static Sprite AffixAragonite;
public static Sprite AffixGold;
public static Sprite AffixSanguine;
public static Sprite AffixSepia;
public static Sprite SepiaElite;
public static Sprite AffixNullifier;
public static Sprite AffixBlighted;
public static Sprite AffixBackup;
public static Sprite BackupDebuff;
public static Sprite AffixPurity;
public static Sprite AffixBarrier;
public static Sprite AffixBlackHole;
public static Sprite AffixMoney;
public static Sprite AffixNight;
public static Sprite AffixWater;
public static Sprite AffixRealgar;
public static Sprite AffixBuffered;
public static Sprite AffixOppressive;
public static Sprite AffixBuffing;
public static Sprite AffixFrenzied;
public static Sprite AffixVolatile;
public static Sprite AffixEcho;
public static Sprite AffixArmored;
public static Sprite AffixBuffing_EV;
public static Sprite AffixImpPlane;
public static Sprite AffixPillaging;
public static Sprite AffixSandstorm;
public static Sprite AffixTinkerer;
public static Sprite AffixAdaptive;
public static Sprite AffixMotivator;
public static Sprite AffixOsmium;
public static Sprite AffixEmpyrean;
public static Sprite HauntCloak;
public static Sprite ZetHeadHunter;
public static Sprite ZetSapped;
public static Sprite ZetShredded;
public static Sprite ZetPoached;
public static Sprite ZetSepiaBlind;
public static Sprite ZetElusive;
public static Sprite ZetWarped;
public static void Load()
{
OutlineStandard = Assets.LoadAsset<Sprite>("Assets/Icons/texOutlineWhite.png");
OutlineVoid = Assets.LoadAsset<Sprite>("Assets/Icons/texOutlineVoid.png");
AffixUnknown = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixUnknown.png");
AffixWhite = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixWhite.png");
AffixBlue = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBlue.png");
AffixRed = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixRed.png");
AffixHaunted = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixHaunted.png");
AffixPoison = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixPoison.png");
AffixLunar = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixLunar.png");
AffixEarth = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixEarth.png");
AffixVoid = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixVoid.png");
AffixAurelionite = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixAurelionite.png");
AffixBead = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBead.png");
if (AspectPackDefOf.SpikeStrip.Enabled)
{
AffixPlated = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixPlated.png");
AffixWarped = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixWarped.png");
AffixVeiled = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixVeiled.png");
AffixAragonite = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixAragonite.png");
ZetElusive = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffElusive.png");
ZetWarped = LegacyResourcesAPI.Load<BuffDef>("BuffDefs/Slow80").iconSprite;
}
if (AspectPackDefOf.GoldenCoastPlus.Enabled)
{
AffixGold = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixPillaging.png");
}
if (AspectPackDefOf.Aetherium.Enabled)
{
AffixSanguine = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixSanguine.png");
}
if (AspectPackDefOf.Bubbet.Enabled)
{
AffixSepia = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixSepia.png");
SepiaElite = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffAffixSepia.png");
ZetSepiaBlind = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffSepiaBlind.png");
}
if (AspectPackDefOf.WarWisp.Enabled)
{
OutlineNull = Assets.LoadAsset<Sprite>("Assets/Icons/texNullOutlineWhite.png");
AffixNullifier = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixNullifier.png");
}
AffixBlighted = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBlighted.png");
if (AspectPackDefOf.GOTCE.Enabled)
{
OutlineCracked = Assets.LoadAsset<Sprite>("Assets/Icons/texCrackedOutlineWhite.png");
AffixBackup = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBackup.png");
BackupDebuff = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffNoSecondary.png");
}
if (AspectPackDefOf.Thalasso.Enabled)
{
AffixPurity = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixPurity.png");
}
if (AspectPackDefOf.RisingTides.Enabled)
{
AffixBarrier = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBarrier.png");
AffixBlackHole = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBlackHole.png");
AffixMoney = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixArmored.png");
AffixNight = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixNight.png");
AffixWater = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixWater.png");
AffixRealgar = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixImpPlane.png");
}
AffixBuffered = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBuffered.png");
AffixOppressive = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixOppressive.png");
if (AspectPackDefOf.MoreElites.Enabled)
{
AffixBuffing = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBuffing.png");
AffixFrenzied = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixFrenzied.png");
AffixVolatile = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixVolatile.png");
AffixEcho = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixEcho.png");
}
if (AspectPackDefOf.EliteVariety.Enabled)
{
AffixArmored = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixArmored.png");
AffixBuffing_EV = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixBuffing.png");
AffixImpPlane = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixImpPlane.png");
AffixPillaging = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixPillaging.png");
AffixSandstorm = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixSandstorm.png");
AffixTinkerer = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixTinkerer.png");
}
if (AspectPackDefOf.Augmentum.Enabled)
{
AffixAdaptive = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixAdaptive.png");
}
if (AspectPackDefOf.Sandswept.Enabled)
{
AffixMotivator = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixMotivator.png");
AffixOsmium = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixOsmium.png");
}
AffixEmpyrean = Assets.LoadAsset<Sprite>("Assets/Icons/texAffixEmpyrean.png");
HauntCloak = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffHauntCloak.png");
ZetHeadHunter = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffHeadHunter.png");
ZetSapped = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffSapped.png");
ZetShredded = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffShredded.png");
ZetPoached = Assets.LoadAsset<Sprite>("Assets/Icons/texBuffPoached.png");
}
}
public static class Prefabs
{
public static GameObject AffixVoid;
public static GameObject AffixSepia;
public static GameObject AffixPure;
public static GameObject AffixGold;
public static void Load()
{
AffixVoid = Assets.LoadAsset<GameObject>("Assets/Prefabs/prefabAffixVoid.prefab");
AffixVoid.AddComponent<ModelPanelParameters>();
if (AspectPackDefOf.Bubbet.Enabled)
{
AffixSepia = Assets.LoadAsset<GameObject>("Assets/Prefabs/prefabAffixSepia.prefab");
AffixSepia.AddComponent<ModelPanelParameters>();
}
if (AspectPackDefOf.Thalasso.Enabled)
{
AffixPure = Assets.LoadAsset<GameObject>("Assets/Prefabs/prefabAffixPure.prefab");
AffixPure.AddComponent<ModelPanelParameters>();
}
if (AspectPackDefOf.GoldenCoastPlus.Enabled)
{
AffixGold = Assets.LoadAsset<GameObject>("Assets/Prefabs/prefabAffixGold.prefab");
AffixGold.AddComponent<ModelPanelParameters>();
}
}
}
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static hook_Init <>9__102_0;
public static hook_RebuildPickupGroups <>9__104_0;
public static hook_Init <>9__105_0;
public static hook_BuildStaticData <>9__106_0;
public static hook_OnEnter <>9__107_0;
public static hook_CanSelectItemEntry <>9__108_0;
public static hook_CanSelectEquipmentEntry <>9__109_0;
internal void <SetupItemTransformations>b__102_0(orig_Init orig)
{
//IL_0030: 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)
List<Pair> list = ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem].ToList();
foreach (ItemDef transformableAspectItemDef in transformableAspectItemDefs)
{
list.Add(new Pair
{
itemDef1 = transformableAspectItemDef,
itemDef2 = ItemDefOf.ZetAspectVoid
});
Logger.Info("Successfully added aspect transformation for " + ((Object)transformableAspectItemDef).name);
}
ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = list.ToArray();
orig.Invoke();
}
internal void <OnTransmuteManagerInit>b__104_0(orig_RebuildPickupGroups orig)
{
try
{
PreInitValidation();
}
catch (Exception data)
{
Logger.Error(data);
}
orig.Invoke();
}
internal void <OnRuleCatalogInit>b__105_0(orig_Init orig)
{
try
{
PreInitValidation();
}
catch (Exception data)
{
Logger.Error(data);
}
orig.Invoke();
}
internal void <OnLogBookInit>b__106_0(orig_BuildStaticData orig)
{
try
{
SetupCatalog();
}
catch (Exception data)
{
Logger.Warn("Failed To Setup Catalog!");
Logger.Error(data);
}
orig.Invoke();
}
internal void <OnMainMenuEnter>b__107_0(orig_OnEnter orig, BaseMainMenuScreen self, MainMenuController controller)
{
orig.Invoke(self, controller);
try
{
OnMenuEnteredFirstTime();
}
catch (Exception data)
{
Logger.Error(data);
}
}
internal bool <ItemEntrySelectableHook>b__108_0(orig_CanSelectItemEntry orig, ItemDef itemDef, Dictionary<ExpansionDef, bool> expAva)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)itemDef) && aspectItemIndexes.Contains(itemDef.itemIndex))
{
if (Configuration.LogbookHideItem.Value)
{
return false;
}
if (DropHooks.CanObtainItem() && HasRequiredExpansion(itemDef.requiredExpansion, expAva) && !disabledItemIndexes.Contains(itemDef.itemIndex))
{
return true;
}
return false;
}
return orig.Invoke(itemDef, expAva);
}
internal bool <EquipmentEntrySelectableHook>b__109_0(orig_CanSelectEquipmentEntry orig, EquipmentDef equipDef, Dictionary<ExpansionDef, bool> expAva)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: 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_005e: Invalid comparison between Unknown and I4
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)equipDef) && aspectEquipIndexes.Contains(equipDef.equipmentIndex))
{
if (Configuration.LogbookHideEquipment.Value)
{
return false;
}
if (DropHooks.CanObtainEquipment() && HasRequiredExpansion(equipDef.requiredExpansion, expAva))
{
ItemIndex val = ItemizeEliteEquipment(equipDef.equipmentIndex);
if ((int)val != -1 && !disabledItemIndexes.Contains(val))
{
return true;
}
}
return false;
}
return orig.Invoke(equipDef, expAva);
}
}
public static AssetBundle Assets;
public static bool menuVisited = false;
public static bool setupComplete = false;
public static bool setupIntermediate = false;
public static bool setupCompat = false;
public static BindingFlags Flags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
public static Dictionary<BuffIndex, ItemIndex> buffToItem = new Dictionary<BuffIndex, ItemIndex>();
public static Dictionary<BuffIndex, EquipmentIndex> buffToEquip = new Dictionary<BuffIndex, EquipmentIndex>();
public static Dictionary<EquipmentIndex, ItemIndex> equipToItem = new Dictionary<EquipmentIndex, ItemIndex>();
public static List<ItemIndex> disabledItemIndexes = new List<ItemIndex>();
public static List<ItemIndex> aspectItemIndexes = new List<ItemIndex>();
public static List<BuffIndex> aspectBuffIndexes = new List<BuffIndex>();
public static List<EquipmentIndex> aspectEquipIndexes = new List<EquipmentIndex>();
public static List<ItemDef> transformableAspectItemDefs = new List<ItemDef>();
public static List<AspectPack> aspectPacks = new List<AspectPack>();
public static List<AspectDef> aspectDefs = new List<AspectDef>();
public static Dictionary<BuffIndex, AspectDef> buffToAspect = new Dictionary<BuffIndex, AspectDef>();
public static List<AspectDef> aspectsWithPromoters = new List<AspectDef>();
internal static ItemTierDef BossItemTier;
internal static ItemTierDef RedItemTier;
internal static GameObject WhiteAspectPrefab;
internal static GameObject BossDropletPrefab;
internal static GameObject LightningStakePrefab;
internal static GameObject RejectTextPrefab;
internal static GameObject CommandCubePrefab;
internal static GameObject SmokeBombMiniPrefab;
public static int barrierDecayMode = 0;
public static bool lateHooksDone = false;
public static bool appliedVoidBearFix = false;
public static bool limitChillStacks = false;
public static bool borboFrostBlade = false;
public static bool shieldJump = false;
public static bool aspectAbilities = false;
public static bool immuneHealth = false;
public static bool altIceActive = false;
public static bool nemBarrier = false;
public static bool dropWeightsAvailable = false;
public static EffectDef RejectTextDef;
public static ArtifactIndex diluvianArtifactIndex = (ArtifactIndex)(-1);
public static BodyIndex mithrixBodyIndex = (BodyIndex)(-1);
public static BodyIndex voidlingBodyIndex = (BodyIndex)(-1);
public static BodyIndex artifactShellBodyIndex = (BodyIndex)(-1);
public static BodyIndex goldenTitanBodyIndex = (BodyIndex)(-1);
public static BodyIndex tinkerDroneBodyIndex = (BodyIndex)(-1);
public static BuffIndex altSlow80 = (BuffIndex)(-1);
public static BuffIndex antiGrav = (BuffIndex)(-1);
public static BuffIndex rageAura = (BuffIndex)(-1);
public static BuffIndex veiledBuffer = (BuffIndex)(-1);
public static BuffIndex veiledCooldown = (BuffIndex)(-1);
public static BuffIndex nullifierRecipient = (BuffIndex)(-1);
public static BuffIndex waterInvuln = (BuffIndex)(-1);
public static BuffIndex reactorInvuln = (BuffIndex)(-1);
public static BuffIndex lampBuff = (BuffIndex)(-1);
public static ItemIndex summonedEcho = (ItemIndex)(-1);
public static ItemTier lunarVoidTier = (ItemTier)1000;
public static ItemTier highlanderTier = (ItemTier)1000;
public static DeployableSlot tinkerDeploySlot = (DeployableSlot)0;
public static DotIndex impaleDotIndex = (DotIndex)(-1);
private static ItemTierDef _HighlanderTier;
private static int _HighlanderState = -1;
public static bool ChillCanStack => Buffs.Slow80.canStack;
public static ItemTierDef HighlanderItemTier
{
get
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Invalid comparison between Unknown and I4
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)_HighlanderTier == (Object)null)
{
if ((int)highlanderTier == 1000)
{
Logger.Warn("Checking ItemTierCatalog for : Highlander");
ItemTierDef val = ItemTierCatalog.FindTierDef("Highlander");
if (Object.op_Implicit((Object)(object)val))
{
Logger.Warn("ItemTierDef Highlander Found!");
highlanderTier = val.tier;
}
}
_HighlanderTier = ItemTierCatalog.GetItemTierDef(highlanderTier);
}
return _HighlanderTier;
}
}
public static bool AsHighlander
{
get
{
if (_HighlanderState == -1)
{
Logger.Warn("Checking for mod : ZetAspectHighlander");
if (PluginLoaded("prodzpod.ZetAspectHighlander"))
{
_HighlanderState = 1;
Logger.Warn("ZetAspectHighlander Found!");
}
else
{
_HighlanderState = 0;
}
}
return _HighlanderState == 1;
}
}
public static ItemTierDef AspectItemTier => Configuration.AspectRedTier.Value ? RedItemTier : BossItemTier;
public static bool AspectVoidContagious => Configuration.AspectVoidContagiousItem.Value;
public static Sprite CreateAspectSprite(Sprite baseSprite, Sprite outlineSprite)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
return CreateAspectSprite(baseSprite, outlineSprite, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue));
}
public static Sprite CreateAspectSprite(Sprite baseSprite, Sprite outlineSprite, Color32 outlineColor)
{
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Expected O, but got Unknown
//IL_012c: 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_004e: 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_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
Color32[] pixels = baseSprite.texture.GetPixels32();
Color32[] pixels2 = outlineSprite.texture.GetPixels32();
for (int i = 0; i < pixels2.Length; i++)
{
if (pixels2[i].a > 11)
{
pixels2[i].r = (byte)(pixels2[i].r * outlineColor.r / 255);
pixels2[i].g = (byte)(pixels2[i].g * outlineColor.g / 255);
pixels2[i].b = (byte)(pixels2[i].b * outlineColor.b / 255);
pixels2[i].a = (byte)(pixels2[i].a * outlineColor.a / 255);
pixels[i] = pixels2[i];
}
}
Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false);
val.SetPixels32(pixels);
val.Apply();
return Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f), 25f);
}
public static Sprite TrimSpriteEdge(Sprite baseSprite, int trim, int brCorner)
{
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Expected O, but got Unknown
//IL_00de: 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_0067: 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_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)
int width = ((Texture)baseSprite.texture).width;
int height = ((Texture)baseSprite.texture).height;
Color32 val = default(Color32);
((Color32)(ref val))..ctor((byte)0, (byte)0, (byte)0, (byte)0);
Color32[] pixels = baseSprite.texture.GetPixels32();
for (int i = 0; i < pixels.Length; i++)
{
int num = i % width;
int num2 = i / width;
if (num < trim || num > width - trim || num2 < trim || num2 > height - trim)
{
pixels[i] = val;
}
else if (width - 1 - num + num2 <= brCorner)
{
pixels[i] = val;
}
}
Texture2D val2 = new Texture2D(128, 128, (TextureFormat)4, false);
val2.SetPixels32(pixels);
val2.Apply();
return Sprite.Create(val2, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f), 25f);
}
public static Sprite TryUseSprite(Sprite sprite)
{
//IL_000f: 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_0061: 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)
if (((Texture)sprite.texture).isReadable)
{
Rect textureRect = sprite.textureRect;
if (((Rect)(ref textureRect)).width == 128f && ((Texture)sprite.texture).height == 128)
{
return sprite;
}
}
Texture2D val = DuplicateTexture(sprite.texture);
return Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f), 25f);
}
public static Texture2D DuplicateTexture(Texture2D source)
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Expected O, but got Unknown
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
RenderTexture temporary = RenderTexture.GetTemporary(128, 128, 0, (RenderTextureFormat)7, (RenderTextureReadWrite)0);
Graphics.Blit((Texture)(object)source, temporary);
RenderTexture active = RenderTexture.active;
RenderTexture.active = temporary;
Texture2D val = new Texture2D(128, 128);
val.ReadPixels(new Rect(0f, 0f, 128f, 128f), 0, 0);
val.Apply();
RenderTexture.active = active;
RenderTexture.ReleaseTemporary(temporary);
return val;
}
public static ItemIndex GetAspectItemIndex(BuffIndex buffIndex)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
if (buffToItem.ContainsKey(buffIndex))
{
return buffToItem[buffIndex];
}
return (ItemIndex)(-1);
}
public static EquipmentIndex GetAspectEquipIndex(BuffIndex buffIndex)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
if (buffToEquip.ContainsKey(buffIndex))
{
return buffToEquip[buffIndex];
}
return (EquipmentIndex)(-1);
}
public static ItemIndex ItemizeEliteEquipment(EquipmentIndex equipIndex)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
if (equipToItem.ContainsKey(equipIndex))
{
return equipToItem[equipIndex];
}
return (ItemIndex)(-1);
}
public static AspectDef GetAspectDef(BuffIndex buffIndex)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
if (buffToAspect.ContainsKey(buffIndex))
{
return buffToAspect[buffIndex];
}
return null;
}
public static float GetStackMagnitude(CharacterBody self, BuffDef buffDef)
{
//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_0096: Unknown result type (might be due to invalid IL or missing references)
float num = 0f;
Inventory inventory = self.inventory;
if (Object.op_Implicit((Object)(object)inventory))
{
num = CountAspectEquipment(inventory, buffDef);
if (num > 0f && self.isPlayerControlled)
{
num *= Mathf.Max(1f, Configuration.AspectEquipmentEffect.Value);
}
num += (float)inventory.GetItemCountEffective(GetAspectItemIndex(buffDef.buffIndex));
}
foreach (IAspectProvider provider in EliteBuffManager.Providers)
{
float num2 = provider.StackCount(self);
if (num2 > 0f && provider.HasAspect(self, buffDef.buffIndex))
{
num += num2;
}
}
return Mathf.Max(1f, num);
}
public static bool HasAspectFromProviders(CharacterBody body, BuffDef buffDef)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
foreach (IAspectProvider provider in EliteBuffManager.Providers)
{
if (provider.HasAspect(body, buffDef.buffIndex))
{
return true;
}
}
return false;
}
public static bool HasAspectFromProviders(CharacterBody body, BuffIndex buffIndex)
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
foreach (IAspectProvider provider in EliteBuffManager.Providers)
{
if (provider.HasAspect(body, buffIndex))
{
return true;
}
}
return false;
}
public static bool HasAspectItemOrEquipment(Inventory inventory, BuffDef buffDef)
{
if (CountAspectEquipment(inventory, buffDef) > 0)
{
return true;
}
if (HasAspectItem(inventory, buffDef))
{
return true;
}
return false;
}
public static bool HasAspectItemOrEquipment(Inventory inventory, BuffIndex buffIndex)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
if (CountAspectEquipment(inventory, buffIndex) > 0)
{
return true;
}
if (HasAspectItem(inventory, buffIndex))
{
return true;
}
return false;
}
public static bool HasAspectItemOrEquipment(Inventory inventory, ItemDef itemDef, EquipmentDef equipDef)
{
//IL_002a: 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_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)itemDef) && inventory.GetItemCountEffective(itemDef) > 0)
{
return true;
}
if (Object.op_Implicit((Object)(object)equipDef))
{
EquipmentIndex equipmentIndex = equipDef.equipmentIndex;
if (inventory.currentEquipmentIndex == equipmentIndex)
{
return true;
}
if (inventory.alternateEquipmentIndex == equipmentIndex)
{
return true;
}
}
return false;
}
p