using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
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.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using Nautilus.Configuration;
using Nautilus.Items;
using On.RoR2;
using R2API;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.ExpansionManagement;
using RoR2.Orbs;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
[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("Nautilus")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+8657424a41174f939904886d0b3cfaedf8404302")]
[assembly: AssemblyProduct("Nautilus")]
[assembly: AssemblyTitle("Nautilus")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace Nautilus
{
public class Compat
{
private static bool? _riskOfOptions;
public static bool RiskOfOptions
{
get
{
if (!_riskOfOptions.HasValue)
{
_riskOfOptions = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");
}
return _riskOfOptions.Value;
}
}
}
internal static class Log
{
private static ManualLogSource _logSource;
internal static void Init(ManualLogSource logSource)
{
_logSource = logSource;
}
internal static void Debug(object data)
{
_logSource.LogDebug(data);
}
internal static void Error(object data)
{
_logSource.LogError(data);
}
internal static void Fatal(object data)
{
_logSource.LogFatal(data);
}
internal static void Info(object data)
{
_logSource.LogInfo(data);
}
internal static void Message(object data)
{
_logSource.LogMessage(data);
}
internal static void Warning(object data)
{
_logSource.LogWarning(data);
}
}
[BepInPlugin("com.Hex3.Nautilus", "Nautilus", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class Main : BaseUnityPlugin
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static hook_OnMainMenuControllerInitialized <>9__7_0;
internal void <Awake>b__7_0(orig_OnMainMenuControllerInitialized orig, RoR2Application self)
{
ItemInit.FormatDescriptions();
orig.Invoke(self);
}
}
public const string NAUTILUS_GUID = "com.Hex3.Nautilus";
public const string NAUTILUS_NAME = "Nautilus";
public const string NAUTILUS_VER = "1.0.0";
public static Main Instance;
public static ExpansionDef Expansion;
public static AssetBundle Assets;
public static List<Pair> ItemConversionList = new List<Pair>();
public void Awake()
{
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Unknown result type (might be due to invalid IL or missing references)
//IL_018a: Unknown result type (might be due to invalid IL or missing references)
//IL_0190: Expected O, but got Unknown
Log.Init(((BaseUnityPlugin)this).Logger);
Log.Info("Init Nautilus 1.0.0");
Instance = this;
Log.Info("Creating assets...");
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Nautilus.nautilusvfx"))
{
Assets = AssetBundle.LoadFromStream(stream);
}
Log.Info("Creating config...");
if (Compat.RiskOfOptions)
{
Log.Info("Detected RiskOfOptions");
ModSettingsManager.SetModDescription("Adds new void counterparts for vanilla items.");
ModSettingsManager.SetModIcon(Assets.LoadAsset<Sprite>("Assets/icons/expansion.png"));
}
Log.Info("Creating expansion...");
Expansion = ScriptableObject.CreateInstance<ExpansionDef>();
((Object)Expansion).name = "Nautilus";
Expansion.nameToken = "NT_EXPANSION_NAME";
Expansion.descriptionToken = "NT_EXPANSION_DESC";
Expansion.iconSprite = Assets.LoadAsset<Sprite>("Assets/icons/expansion.png");
Expansion.disabledIconSprite = Assets.LoadAsset<Sprite>("Assets/icons/expansion-inactive.png");
Expansion.requiredEntitlement = null;
ContentAddition.AddExpansionDef(Expansion);
Log.Info("Creating items...");
ItemInit.Init();
ItemRelationshipProvider val = ScriptableObject.CreateInstance<ItemRelationshipProvider>();
((Object)val).name = "NT_ITEMRELATIONSHIPPROVIDER";
val.relationshipType = Addressables.LoadAssetAsync<ItemRelationshipType>((object)"RoR2/DLC1/Common/ContagiousItem.asset").WaitForCompletion();
val.relationships = ItemConversionList.ToArray();
ContentAddition.AddItemRelationshipProvider(val);
object obj = <>c.<>9__7_0;
if (obj == null)
{
hook_OnMainMenuControllerInitialized val2 = delegate(orig_OnMainMenuControllerInitialized orig, RoR2Application self)
{
ItemInit.FormatDescriptions();
orig.Invoke(self);
};
<>c.<>9__7_0 = val2;
obj = (object)val2;
}
RoR2Application.OnMainMenuControllerInitialized += (hook_OnMainMenuControllerInitialized)obj;
Log.Info("Done");
}
}
}
namespace Nautilus.Items
{
public abstract class ItemBase
{
public ItemDef ItemDef;
public string Name;
public ItemTag[] Tags;
public ItemTier Tier;
public bool CanRemove;
public bool IsConsumed;
public bool Hidden;
public ItemIndex ItemIndex => ItemCatalog.FindItemIndex(((Object)ItemDef).name);
public abstract bool Enabled { get; }
public abstract ItemDef ConversionItemDef { get; }
public abstract GameObject itemPrefab { get; }
public abstract Sprite itemIcon { get; }
public ItemBase(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove, bool _isConsumed, bool _hidden)
{
//IL_0017: 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)
Name = _name;
Tags = _tags;
Tier = _tier;
CanRemove = _canRemove;
IsConsumed = _isConsumed;
Hidden = _hidden;
ItemInit.ItemList.Add(this);
}
public bool RegisterItem()
{
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
//IL_01c0: Expected O, but got Unknown
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
if (!Enabled)
{
return Enabled;
}
ItemDef = ScriptableObject.CreateInstance<ItemDef>();
((Object)ItemDef).name = Name;
ItemDef.nameToken = "NT_ITEM_" + Name.ToUpper() + "_NAME";
ItemDef.pickupToken = "NT_ITEM_" + Name.ToUpper() + "_PICKUP";
ItemDef.descriptionToken = "NT_ITEM_" + Name.ToUpper() + "_DESC";
ItemDef.loreToken = "NT_ITEM_" + Name.ToUpper() + "_LORE";
ItemDef.tags = Tags;
ItemDef.deprecatedTier = Tier;
ItemDef.canRemove = CanRemove;
ItemDef.isConsumed = IsConsumed;
ItemDef.hidden = Hidden;
ItemDef.requiredExpansion = Main.Expansion;
ItemDef.pickupModelPrefab = itemPrefab;
ItemDef.pickupIconSprite = itemIcon;
if (Object.op_Implicit((Object)(object)itemPrefab))
{
Transform child = itemPrefab.transform.GetChild(0);
ModelPanelParameters val = itemPrefab.AddComponent<ModelPanelParameters>();
val.minDistance = 1f;
val.maxDistance = 2f;
val.focusPointTransform = child;
val.cameraPositionTransform = child;
}
ItemAPI.Add(new CustomItem(ItemDef, Array.Empty<ItemDisplayRule>()));
if (Object.op_Implicit((Object)(object)ConversionItemDef))
{
Pair val2 = default(Pair);
val2.itemDef1 = ConversionItemDef;
val2.itemDef2 = ItemDef;
Pair item = val2;
Main.ItemConversionList.Add(item);
Log.Info($"Added void conversion from {((Object)ConversionItemDef).name} to {((Object)ItemDef).name}");
}
return Enabled;
}
public int GetItemCountEffective(CharacterBody body)
{
int result = 0;
if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory))
{
result = body.inventory.GetItemCountEffective(ItemDef);
}
return result;
}
public int GetItemCountPermanent(CharacterBody body)
{
int result = 0;
if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory))
{
result = body.inventory.GetItemCountPermanent(ItemDef);
}
return result;
}
public abstract void FormatDescriptionTokens();
public abstract void RegisterHooks();
}
public static class ItemInit
{
public static List<ItemBase> ItemList = new List<ItemBase>();
public static Crabsinthe Crabsinthe = new Crabsinthe("Crabsinthe", (ItemTag[])(object)new ItemTag[1] { (ItemTag)2 }, (ItemTier)6);
public static VoidWatch VoidWatch = new VoidWatch("VoidWatch", (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }, (ItemTier)6);
public static Wellies Wellies = new Wellies("Wellies", (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }, (ItemTier)6);
public static MotherOfPearl MotherOfPearl = new MotherOfPearl("MotherOfPearl", (ItemTag[])(object)new ItemTag[2]
{
(ItemTag)1,
(ItemTag)4
}, (ItemTier)8);
public static ShimmeringNautilus ShimmeringNautilus;
public static Xenobacteria Xenobacteria;
public static PaleStar PaleStar;
public static PaleStarConsumed PaleStarConsumed;
public static ViscousPot ViscousPot;
public static void Init()
{
foreach (ItemBase item in ItemList)
{
if (item.RegisterItem())
{
Log.Info("Added definition for item " + item.Name);
item.RegisterHooks();
}
}
}
public static void FormatDescriptions()
{
foreach (ItemBase item in ItemList)
{
if (item.Enabled)
{
item.FormatDescriptionTokens();
}
}
}
static ItemInit()
{
ItemTag[] array = new ItemTag[3];
RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
ShimmeringNautilus = new ShimmeringNautilus("ShimmeringNautilus", (ItemTag[])(object)array, (ItemTier)8);
Xenobacteria = new Xenobacteria("Xenobacteria", (ItemTag[])(object)new ItemTag[2]
{
(ItemTag)1,
(ItemTag)4
}, (ItemTier)8);
PaleStar = new PaleStar("PaleStar", (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }, (ItemTier)7);
ItemTag[] array2 = new ItemTag[4];
RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
PaleStarConsumed = new PaleStarConsumed("PaleStarConsumed", (ItemTag[])(object)array2, (ItemTier)5);
ViscousPot = new ViscousPot("ViscousPot", (ItemTag[])(object)new ItemTag[1] { (ItemTag)2 }, (ItemTier)7);
}
}
public class Crabsinthe : ItemBase
{
public static ConfigItem<bool> Crabsinthe_Enabled = new ConfigItem<bool>("Void common: Crabsinthe", "Item enabled", "Should this item appear in runs?", _defaultValue: true);
public static ConfigItem<float> Crabsinthe_Regen = new ConfigItem<float>("Void common: Crabsinthe", "Regen boost", "Grants a regen boost with this multiplier.", 0.25f, 0f, 6f, 0.1f);
public static ConfigItem<float> Crabsinthe_RegenStack = new ConfigItem<float>("Void common: Crabsinthe", "Regen boost (Per stack)", "Grants a regen boost with this multiplier per additional stack.", 0.25f, 0f, 6f, 0.1f);
public static ConfigItem<bool> Crabsinthe_CorruptBottles = new ConfigItem<bool>("Void common: Crabsinthe", "Corrupt empty bottles", "Should this item corrupt consumed elixirs?", _defaultValue: true);
public override bool Enabled => Crabsinthe_Enabled.Value;
public override ItemDef ConversionItemDef => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/DLC1/HealingPotion/HealingPotion.asset").WaitForCompletion();
public override GameObject itemPrefab => OverwritePrefabMaterials();
public override Sprite itemIcon => Main.Assets.LoadAsset<Sprite>("Assets/icons/crabsinthe.png");
public ItemDef ConversionItemDefConsumed => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/DLC1/HealingPotion/HealingPotionConsumed.asset").WaitForCompletion();
public Material material0 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/HealingPotion/matHealingPotionGlass.mat").WaitForCompletion();
public Material material1 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidSurvivorBlasterSphereAreaIndicator.mat").WaitForCompletion();
public Material material2 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/TreasureCacheVoid/matLockboxVoidEgg.mat").WaitForCompletion();
public Material material4 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidRaidCrab/matVoidRaidCrabEyeOverlay2.mat").WaitForCompletion();
public Crabsinthe(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove = true, bool _isConsumed = false, bool _hidden = false)
: base(_name, _tags, _tier, _canRemove, _isConsumed, _hidden)
{
}//IL_0003: Unknown result type (might be due to invalid IL or missing references)
public GameObject OverwritePrefabMaterials()
{
GameObject val = Main.Assets.LoadAsset<GameObject>("Assets/prefabs/crabsinthe.prefab");
Material[] materialArray = (Material[])(object)new Material[5]
{
material0,
material1,
material2,
((Renderer)val.GetComponentInChildren<MeshRenderer>()).GetMaterialArray()[3],
material4
};
((Renderer)val.GetComponentInChildren<MeshRenderer>()).SetMaterialArray(materialArray);
return val;
}
public override void FormatDescriptionTokens()
{
string descriptionToken = ItemDef.descriptionToken;
string arg = (Crabsinthe_CorruptBottles.Value ? " and Empty Bottles" : "");
LanguageAPI.AddOverlay(descriptionToken, string.Format(Language.currentLanguage.GetLocalizedStringByToken(descriptionToken), Crabsinthe_Regen.Value * 100f, Crabsinthe_RegenStack.Value * 100f, arg));
}
public override void RegisterHooks()
{
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Expected O, but got Unknown
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: 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)
if (Crabsinthe_CorruptBottles.Value)
{
Pair val = default(Pair);
val.itemDef1 = ConversionItemDefConsumed;
val.itemDef2 = ItemDef;
Pair item = val;
Main.ItemConversionList.Add(item);
Log.Info($"Added void conversion from {((Object)ConversionItemDefConsumed).name} to {((Object)ItemDef).name}");
}
RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody orig, StatHookEventArgs self)
{
int itemCountEffective = GetItemCountEffective(orig);
if (itemCountEffective > 0)
{
self.regenMultAdd += Crabsinthe_Regen.Value + Crabsinthe_RegenStack.Value * (float)(itemCountEffective - 1);
}
};
}
}
public class VoidWatch : ItemBase
{
public BuffDef VoidWatchBuff;
public static ConfigItem<bool> VoidWatch_Enabled = new ConfigItem<bool>("Void common: Collectors Appraisal", "Item enabled", "Should this item appear in runs?", _defaultValue: true);
public static ConfigItem<float> VoidWatch_Damage = new ConfigItem<float>("Void common: Collectors Appraisal", "Damage boost", "Grants a damage boost with this multiplier.", 0.1f, 0f, 1f, 0.05f);
public static ConfigItem<float> VoidWatch_DamageStack = new ConfigItem<float>("Void common: Collectors Appraisal", "Damage boost (Per stack)", "Grants a damage boost with this multiplier per additional stack.", 0.1f, 0f, 1f, 0.05f);
public static ConfigItem<float> VoidWatch_HealthThreshold = new ConfigItem<float>("Void common: Collectors Appraisal", "Damage health threshold", "Health must be above this fraction for the damage boost to apply.", 0.9f, 0f, 1f, 0.05f);
public static ConfigItem<bool> VoidWatch_BarrierMult = new ConfigItem<bool>("Void common: Collectors Appraisal", "Damage scaling with barrier", "Adds up to 2x multiplier to the damage bonus scaling with barrier.", _defaultValue: true);
public static ConfigItem<bool> VoidWatch_HideBuff = new ConfigItem<bool>("Void common: Collectors Appraisal", "Hide buff", "Do not display the buff for this item.", _defaultValue: false);
public override bool Enabled => VoidWatch_Enabled.Value;
public override ItemDef ConversionItemDef => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/DLC1/FragileDamageBonus/FragileDamageBonus.asset").WaitForCompletion();
public override GameObject itemPrefab => OverwritePrefabMaterials();
public Material material0 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSuppressor/matVoidSuppressorStone.mat").WaitForCompletion();
public Material material1 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC2/meridian/Assets/matPMGold.mat").WaitForCompletion();
public override Sprite itemIcon => Main.Assets.LoadAsset<Sprite>("Assets/icons/voidWatch.png");
public VoidWatch(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove = true, bool _isConsumed = false, bool _hidden = false)
: base(_name, _tags, _tier, _canRemove, _isConsumed, _hidden)
{
}//IL_0003: Unknown result type (might be due to invalid IL or missing references)
public GameObject OverwritePrefabMaterials()
{
GameObject val = Main.Assets.LoadAsset<GameObject>("Assets/prefabs/voidWatch.prefab");
Material[] materialArray = (Material[])(object)new Material[3] { material0, material1, material1 };
((Renderer)val.GetComponentInChildren<MeshRenderer>()).SetMaterialArray(materialArray);
return val;
}
public override void FormatDescriptionTokens()
{
string descriptionToken = ItemDef.descriptionToken;
string text = (VoidWatch_BarrierMult.Value ? " <style=cIsHealing>Additional temporary barrier multiplies this bonus up to 2x.</style>" : "");
LanguageAPI.AddOverlay(descriptionToken, string.Format(Language.currentLanguage.GetLocalizedStringByToken(descriptionToken), VoidWatch_Damage.Value * 100f, VoidWatch_DamageStack.Value * 100f, VoidWatch_HealthThreshold.Value * 100f, text));
}
public override void RegisterHooks()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Expected O, but got Unknown
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Expected O, but got Unknown
CreateVoidWatchBuff();
RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody orig, StatHookEventArgs self)
{
int itemCountEffective = GetItemCountEffective(orig);
HealthComponent healthComponent = orig.healthComponent;
if (Object.op_Implicit((Object)(object)healthComponent) && itemCountEffective > 0 && healthComponent.healthFraction >= VoidWatch_HealthThreshold.Value)
{
if (!orig.HasBuff(VoidWatchBuff))
{
orig.AddBuff(VoidWatchBuff);
}
float num = 0f;
if (healthComponent.barrier > 0f && orig.maxBarrier > 0f)
{
num = healthComponent.barrier / orig.maxBarrier;
}
float num2 = VoidWatch_Damage.Value + VoidWatch_DamageStack.Value * (float)(itemCountEffective - 1);
float num3 = num2 + (VoidWatch_BarrierMult.Value ? (num2 * num) : 0f);
self.damageMultAdd += num3;
}
};
HealthComponent.TakeDamageProcess += (hook_TakeDamageProcess)delegate(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo)
{
orig.Invoke(self, damageInfo);
if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(VoidWatchBuff) && self.healthFraction < VoidWatch_HealthThreshold.Value)
{
self.body.RemoveBuff(VoidWatchBuff);
Util.PlaySound("Play_item_proc_delicateWatch_break", ((Component)self).gameObject);
}
};
}
public void CreateVoidWatchBuff()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
val.buffColor = new Color(0.76f, 0.3f, 0.92f);
val.canStack = false;
val.isDebuff = false;
val.ignoreGrowthNectar = true;
((Object)val).name = "Collector's Appraisal damage";
val.isHidden = VoidWatch_HideBuff.Value;
val.isCooldown = false;
val.iconSprite = Main.Assets.LoadAsset<Sprite>("Assets/icons/voidWatchBuff.png");
ContentAddition.AddBuffDef(val);
VoidWatchBuff = val;
}
}
public class Wellies : ItemBase
{
public static ConfigItem<bool> Wellies_Enabled = new ConfigItem<bool>("Void common: Waterlogged Wellies", "Item enabled", "Should this item appear in runs?", _defaultValue: true);
public static ConfigItem<float> Wellies_Force = new ConfigItem<float>("Void common: Waterlogged Wellies", "Downward pull force", "How strong the on-hit pull down effect is in arbitrary wacky units.", 100f, 0f, 240f, 10f);
public static ConfigItem<float> Wellies_ForceStack = new ConfigItem<float>("Void common: Waterlogged Wellies", "Downward pull force (Per stack)", "How strong the on-hit pull down effect is per additional stack.", 100f, 0f, 240f, 10f);
public static ConfigItem<float> Wellies_ForceUnmassed = new ConfigItem<float>("Void common: Waterlogged Wellies", "Pure downward pull force percentage", "What percentage of downward pull force should treat the enemy as if it's massless? Equalizes large vs. small enemies, but high values can cause larger enemies to take too much fall damage.", 1f, 0.1f, 2.5f, 0.1f);
public static ConfigItem<float> Wellies_DebuffSeconds = new ConfigItem<float>("Void common: Waterlogged Wellies", "Debuff length", "How long the on-hit debuff should last in seconds.", 2f, 0f, 12f, 0.5f);
public static ConfigItem<float> Wellies_DebuffSecondsStack = new ConfigItem<float>("Void common: Waterlogged Wellies", "Debuff length (Per stack)", "How long the on-hit debuff should last in seconds per additional stack.", 2f, 0f, 12f, 0.5f);
public override bool Enabled => Wellies_Enabled.Value;
public override ItemDef ConversionItemDef => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/DLC3/Items/CritAtLowerElevation/CritAtLowerElevation.asset").WaitForCompletion();
public override GameObject itemPrefab => OverwritePrefabMaterials();
public Material material0 => Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/Props/matRescueshipDirtPiles.mat").WaitForCompletion();
public Material material1 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/Railgunner/matRailGunnerBase.mat").WaitForCompletion();
public Material material2 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/ScrapVoid/matScrapVoidMetal.mat").WaitForCompletion();
public override Sprite itemIcon => Main.Assets.LoadAsset<Sprite>("Assets/icons/wellies.png");
public BuffDef DebuffDef => Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/Treebot/bdWeak.asset").WaitForCompletion();
public Wellies(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove = true, bool _isConsumed = false, bool _hidden = false)
: base(_name, _tags, _tier, _canRemove, _isConsumed, _hidden)
{
}//IL_0003: Unknown result type (might be due to invalid IL or missing references)
public GameObject OverwritePrefabMaterials()
{
GameObject val = Main.Assets.LoadAsset<GameObject>("Assets/prefabs/wellies.prefab");
Material[] materialArray = (Material[])(object)new Material[3] { material0, material1, material2 };
((Renderer)val.GetComponentInChildren<MeshRenderer>()).SetMaterialArray(materialArray);
return val;
}
public override void FormatDescriptionTokens()
{
string descriptionToken = ItemDef.descriptionToken;
LanguageAPI.AddOverlay(descriptionToken, string.Format(Language.currentLanguage.GetLocalizedStringByToken(descriptionToken), Wellies_DebuffSeconds.Value, Wellies_DebuffSecondsStack.Value));
}
public override void RegisterHooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
HealthComponent.TakeDamageProcess += (hook_TakeDamageProcess)delegate(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo)
{
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: 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_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: 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_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)damageInfo.attacker))
{
CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
CharacterBody body = self.body;
if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)body))
{
int itemCountEffective = GetItemCountEffective(component);
if (itemCountEffective > 0)
{
float num = Wellies_DebuffSeconds.Value + Wellies_DebuffSecondsStack.Value * (float)(itemCountEffective - 1);
float num2 = Wellies_Force.Value + Wellies_ForceStack.Value * (float)(itemCountEffective - 1);
float num3 = num2 * Wellies_ForceUnmassed.Value / 100f;
if (num2 > 0f && damageInfo.procCoefficient > 0f && !((Object)body).name.ToLower().Contains("grandparent"))
{
PhysForceInfo val = default(PhysForceInfo);
val.force = Vector3.down * num2;
PhysForceInfo val2 = val;
val = default(PhysForceInfo);
val.force = Vector3.down * num3;
((PhysForceInfo)(ref val)).massIsOne = true;
PhysForceInfo val3 = val;
CharacterMotor val4 = default(CharacterMotor);
RigidbodyMotor val5 = default(RigidbodyMotor);
if (((Component)body).TryGetComponent<CharacterMotor>(ref val4) && !val4.isGrounded)
{
val4.ApplyForceImpulse(ref val2);
val4.ApplyForceImpulse(ref val3);
body.AddTimedBuff(DebuffDef.buffIndex, num);
Util.PlaySound("Play_voidBarnacle_m1_chargeUp", ((Component)body).gameObject);
}
else if (((Component)body).TryGetComponent<RigidbodyMotor>(ref val5))
{
val5.ApplyForceImpulse(ref val2);
val5.ApplyForceImpulse(ref val3);
body.AddTimedBuff(DebuffDef.buffIndex, num);
Util.PlaySound("Play_voidBarnacle_m1_chargeUp", ((Component)body).gameObject);
}
}
}
}
}
orig.Invoke(self, damageInfo);
};
}
}
public class MotherOfPearl : ItemBase
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static hook_OnTriggerStay <>9__24_1;
internal void <RegisterHooks>b__24_1(orig_OnTriggerStay orig, MoneyPickup self, Collider other)
{
//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_0027: 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)
if (NetworkServer.active && self.alive)
{
TeamIndex objectTeam = TeamComponent.GetObjectTeam(((Component)other).gameObject);
CharacterBody val = default(CharacterBody);
MotherOfPearlBehavior motherOfPearlBehavior = default(MotherOfPearlBehavior);
if (objectTeam == self.teamFilter.teamIndex && ((Component)other).TryGetComponent<CharacterBody>(ref val) && ((Component)val).TryGetComponent<MotherOfPearlBehavior>(ref motherOfPearlBehavior))
{
motherOfPearlBehavior.Trigger();
}
orig.Invoke(self, other);
}
}
}
public static ConfigItem<bool> MotherOfPearl_Enabled = new ConfigItem<bool>("Void legendary: Mother Of Pearl", "Item enabled", "Should this item appear in runs?", _defaultValue: true);
public static ConfigItem<int> MotherOfPearl_MissilesLaunched = new ConfigItem<int>("Void legendary: Mother Of Pearl", "Missiles launched", "How many missiles to launch on gold pickup", 3, 1f, 10f, 1f);
public static ConfigItem<float> MotherOfPearl_DamageCoeff = new ConfigItem<float>("Void legendary: Mother Of Pearl", "Missile damage", "Missile damage in percentage", 300f, 100f, 1000f, 100f);
public static ConfigItem<float> MotherOfPearl_DamageCoeffStack = new ConfigItem<float>("Void legendary: Mother Of Pearl", "Missile damage (per stack)", "Missile damage in percentage, per additional stack", 300f, 100f, 1000f, 100f);
public static ConfigItem<float> MotherOfPearl_PickupConvert = new ConfigItem<float>("Void legendary: Mother Of Pearl", "Gold convert chance", "Flat fractional chance for any pickup generated by the holder to convert into a gold chunk", 0.1f, 0f, 1f, 0.01f);
public override bool Enabled => MotherOfPearl_Enabled.Value;
public override ItemDef ConversionItemDef => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/DLC2/Items/BarrageOnBoss/BarrageOnBoss.asset").WaitForCompletion();
public override GameObject itemPrefab => OverwritePrefabMaterials();
public Material material0 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/voidstage/matVoidTerrain.mat").WaitForCompletion();
public Material material1 => Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/BonusGoldPackOnKill/matTomeGold.mat").WaitForCompletion();
public override Sprite itemIcon => Main.Assets.LoadAsset<Sprite>("Assets/icons/motherOfPearl.png");
public static GameObject moneyPackPrefab => Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/BonusGoldPackOnKill/BonusMoneyPack.prefab").WaitForCompletion();
public static GameObject convertEffectPrefab => Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/DeathProjectile/DeathProjectileTickEffect.prefab").WaitForCompletion();
public MotherOfPearl(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove = true, bool _isConsumed = false, bool _hidden = false)
: base(_name, _tags, _tier, _canRemove, _isConsumed, _hidden)
{
}//IL_0003: Unknown result type (might be due to invalid IL or missing references)
public GameObject OverwritePrefabMaterials()
{
GameObject val = Main.Assets.LoadAsset<GameObject>("Assets/prefabs/motherOfPearl.prefab");
Material[] materialArray = (Material[])(object)new Material[2] { material0, material1 };
((Renderer)val.GetComponentInChildren<MeshRenderer>()).SetMaterialArray(materialArray);
return val;
}
public override void FormatDescriptionTokens()
{
string descriptionToken = ItemDef.descriptionToken;
LanguageAPI.AddOverlay(descriptionToken, string.Format(Language.currentLanguage.GetLocalizedStringByToken(descriptionToken), MotherOfPearl_MissilesLaunched.Value, MotherOfPearl_DamageCoeff.Value, MotherOfPearl_DamageCoeffStack.Value, MotherOfPearl_PickupConvert.Value * 100f));
}
public override void RegisterHooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//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_0032: Expected O, but got Unknown
CharacterBody.OnInventoryChanged += (hook_OnInventoryChanged)delegate(orig_OnInventoryChanged orig, CharacterBody self)
{
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self);
MotherOfPearlBehavior motherOfPearlBehavior2 = ((Component)self).GetComponent<MotherOfPearlBehavior>();
int itemCountEffective = GetItemCountEffective(self);
if (GetItemCountEffective(self) > 0 && !Object.op_Implicit((Object)(object)motherOfPearlBehavior2))
{
motherOfPearlBehavior2 = self.AddItemBehavior<MotherOfPearlBehavior>(itemCountEffective);
motherOfPearlBehavior2.itemIndex = base.ItemIndex;
motherOfPearlBehavior2.missiles = MotherOfPearl_MissilesLaunched.Value;
motherOfPearlBehavior2.convertChance = MotherOfPearl_PickupConvert.Value;
}
if (Object.op_Implicit((Object)(object)motherOfPearlBehavior2))
{
((ItemBehavior)motherOfPearlBehavior2).stack = itemCountEffective;
motherOfPearlBehavior2.damageCoeff = (MotherOfPearl_DamageCoeff.Value + MotherOfPearl_DamageCoeffStack.Value * (float)(itemCountEffective - 1)) / 100f;
}
if (GetItemCountEffective(self) <= 0 && Object.op_Implicit((Object)(object)motherOfPearlBehavior2))
{
Object.Destroy((Object)(object)((Component)self).GetComponent<MotherOfPearlBehavior>());
}
};
object obj = <>c.<>9__24_1;
if (obj == null)
{
hook_OnTriggerStay val = delegate(orig_OnTriggerStay orig, MoneyPickup self, Collider other)
{
//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_0027: 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)
if (NetworkServer.active && self.alive)
{
TeamIndex objectTeam = TeamComponent.GetObjectTeam(((Component)other).gameObject);
CharacterBody val2 = default(CharacterBody);
MotherOfPearlBehavior motherOfPearlBehavior = default(MotherOfPearlBehavior);
if (objectTeam == self.teamFilter.teamIndex && ((Component)other).TryGetComponent<CharacterBody>(ref val2) && ((Component)val2).TryGetComponent<MotherOfPearlBehavior>(ref motherOfPearlBehavior))
{
motherOfPearlBehavior.Trigger();
}
orig.Invoke(self, other);
}
};
<>c.<>9__24_1 = val;
obj = (object)val;
}
MoneyPickup.OnTriggerStay += (hook_OnTriggerStay)obj;
}
}
public class MotherOfPearlBehavior : ItemBehavior
{
public ItemIndex itemIndex;
public int missiles = 3;
public float damageCoeff = 3f;
public float convertRadius = 20f;
public float convertChance = 10f;
public float missileInterval = 0.1f;
public float missileTimer = 0f;
public float convertInterval = 0.33f;
public float convertTimer = 0f;
public int missileQueue = 0;
public void Trigger()
{
missileQueue += missiles;
}
private void FixedUpdate()
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Expected O, but got Unknown
missileTimer += Time.fixedDeltaTime;
convertTimer += Time.fixedDeltaTime;
if (convertTimer > convertInterval)
{
Collider[] array = Physics.OverlapSphere(base.body.transform.position, convertRadius);
Collider[] array2 = array;
foreach (Collider val in array2)
{
if (!Object.op_Implicit((Object)(object)((Component)val).gameObject))
{
continue;
}
GameObject gameObject = ((Component)val).gameObject;
if (!Object.op_Implicit((Object)(object)gameObject.GetComponent<MotherOfPearlBlacklistBehavior>()) && (Object.op_Implicit((Object)(object)gameObject.GetComponentInChildren<AmmoPickup>()) || Object.op_Implicit((Object)(object)gameObject.GetComponentInChildren<HealthPickup>()) || Object.op_Implicit((Object)(object)gameObject.GetComponentInChildren<ElusiveAntlersPickup>())))
{
if (CheckGoldPickupRoll())
{
SpawnGoldPickup(gameObject.transform.position);
EffectData val2 = new EffectData
{
origin = gameObject.transform.position
};
EffectManager.SpawnEffect(MotherOfPearl.convertEffectPrefab, val2, true);
Object.Destroy((Object)(object)gameObject);
}
else
{
gameObject.AddComponent<MotherOfPearlBlacklistBehavior>();
}
}
}
convertTimer = 0f;
}
if (missileTimer > missileInterval && missileQueue > 0)
{
MissileUtils.FireMissile(base.body.corePosition, base.body, default(ProcChainMask), (GameObject)null, damageCoeff * base.body.damage, base.body.RollCrit(), CommonAssets.missilePrefab, (DamageColorIndex)3, true);
missileQueue--;
missileTimer = 0f;
}
}
public bool CheckGoldPickupRoll()
{
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
float num = 0f;
ReadOnlyCollection<TeamComponent> teamMembers = TeamComponent.GetTeamMembers((TeamIndex)1);
foreach (TeamComponent item in teamMembers)
{
if (Object.op_Implicit((Object)(object)item.body) && Object.op_Implicit((Object)(object)item.body.inventory) && item.body.inventory.GetItemCountEffective(itemIndex) > 0)
{
num += convertChance * 100f;
}
}
return Util.CheckRoll(num, 0f, (CharacterMaster)null);
}
public void SpawnGoldPickup(Vector3 position)
{
//IL_0006: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Object.Instantiate<GameObject>(MotherOfPearl.moneyPackPrefab, position, Random.rotation);
if (Object.op_Implicit((Object)(object)val))
{
Collider component = val.GetComponent<Collider>();
Physics.IgnoreCollision(component, val.GetComponent<Collider>());
TeamFilter component2 = val.GetComponent<TeamFilter>();
if (Object.op_Implicit((Object)(object)component2))
{
component2.teamIndex = (TeamIndex)1;
}
MoneyPickup componentInChildren = val.GetComponentInChildren<MoneyPickup>();
if (Object.op_Implicit((Object)(object)componentInChildren))
{
componentInChildren.baseGoldReward = 25;
Physics.IgnoreCollision(component, ((Component)componentInChildren).GetComponent<Collider>());
}
GravitatePickup componentInChildren2 = val.GetComponentInChildren<GravitatePickup>();
if (Object.op_Implicit((Object)(object)componentInChildren2))
{
Physics.IgnoreCollision(component, ((Component)componentInChildren2).GetComponent<Collider>());
}
val.transform.localScale = Vector3.one * 1f;
NetworkServer.Spawn(val);
}
}
}
public class MotherOfPearlBlacklistBehavior : MonoBehaviour
{
}
public class ShimmeringNautilus : ItemBase
{
public BuffDef NautilusBuff;
public static ConfigItem<bool> ShimmeringNautilus_Enabled = new ConfigItem<bool>("Void legendary: Shimmering Nautilus", "Item enabled", "Should this item appear in runs?", _defaultValue: true);
public static ConfigItem<float> ShimmeringNautilus_DamageResist = new ConfigItem<float>("Void legendary: Shimmering Nautilus", "Damage resistance", "Resist this fraction of all damage.", 0.1f, 0f, 1f, 0.05f);
public static ConfigItem<int> ShimmeringNautilus_RetaliateHits = new ConfigItem<int>("Void legendary: Shimmering Nautilus", "Retaliation hits", "Retaliation damage requires this many hits from the same enemy to trigger.", 5, 1f, 20f, 1f);
public static ConfigItem<float> ShimmeringNautilus_RetaliateDamage = new ConfigItem<float>("Void legendary: Shimmering Nautilus", "Retaliation damage", "Base damage percentage of retaliation hits.", 1800f, 100f, 5000f, 100f);
public static ConfigItem<float> ShimmeringNautilus_RetaliateDamageStack = new ConfigItem<float>("Void legendary: Shimmering Nautilus", "Retaliation damage (per stack)", "Base damage percentage of retaliation hits, per additional stack.", 1800f, 100f, 2500f, 100f);
public override bool Enabled => ShimmeringNautilus_Enabled.Value;
public override ItemDef ConversionItemDef => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/Base/ArmorReductionOnHit/ArmorReductionOnHit.asset").WaitForCompletion();
public override GameObject itemPrefab => OverwritePrefabMaterials();
public Material material0 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/EliteVoid/matVoidInfestorMetal.mat").WaitForCompletion();
public override Sprite itemIcon => Main.Assets.LoadAsset<Sprite>("Assets/icons/shimmeringNautilus.png");
public Material OverlayMaterial => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidBlinkBodyOverlay.mat").WaitForCompletion();
public ShimmeringNautilus(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove = true, bool _isConsumed = false, bool _hidden = false)
: base(_name, _tags, _tier, _canRemove, _isConsumed, _hidden)
{
}//IL_0003: Unknown result type (might be due to invalid IL or missing references)
public GameObject OverwritePrefabMaterials()
{
GameObject val = Main.Assets.LoadAsset<GameObject>("Assets/prefabs/shimmeringNautilus.prefab");
Material[] materialArray = (Material[])(object)new Material[1] { material0 };
((Renderer)val.GetComponentInChildren<MeshRenderer>()).SetMaterialArray(materialArray);
return val;
}
public override void FormatDescriptionTokens()
{
string descriptionToken = ItemDef.descriptionToken;
LanguageAPI.AddOverlay(descriptionToken, string.Format(Language.currentLanguage.GetLocalizedStringByToken(descriptionToken), ShimmeringNautilus_DamageResist.Value * 100f, ShimmeringNautilus_RetaliateHits.Value, ShimmeringNautilus_RetaliateDamage.Value, ShimmeringNautilus_RetaliateDamageStack.Value));
}
public override void RegisterHooks()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Expected O, but got Unknown
CreateNautilusBuff();
HealthComponent.TakeDamageProcess += (hook_TakeDamageProcess)delegate(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo)
{
//IL_0088: 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_00ab: 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)
//IL_00e3: Expected O, but got Unknown
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_012c: 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_0153: Unknown result type (might be due to invalid IL or missing references)
CharacterBody body = self.body;
CharacterBody val = default(CharacterBody);
if (Object.op_Implicit((Object)(object)damageInfo.attacker) && damageInfo.attacker.TryGetComponent<CharacterBody>(ref val) && Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)val.teamComponent) && Object.op_Implicit((Object)(object)body.teamComponent))
{
int itemCountEffective = GetItemCountEffective(body);
if (itemCountEffective > 0)
{
damageInfo.damage *= 1f - ShimmeringNautilus_DamageResist.Value;
if (val.teamComponent.teamIndex != body.teamComponent.teamIndex)
{
val.AddBuff(NautilusBuff.buffIndex);
}
if (val.GetBuffCount(NautilusBuff) >= ShimmeringNautilus_RetaliateHits.Value)
{
MissileVoidOrb val2 = new MissileVoidOrb();
((Orb)val2).origin = body.aimOrigin;
((GenericDamageOrb)val2).damageValue = body.damage * (ShimmeringNautilus_RetaliateDamage.Value / 100f) + ShimmeringNautilus_RetaliateDamageStack.Value / 100f * (float)(itemCountEffective - 1);
((GenericDamageOrb)val2).teamIndex = body.teamComponent.teamIndex;
((GenericDamageOrb)val2).attacker = ((Component)body).gameObject;
((GenericDamageOrb)val2).procCoefficient = 0f;
((GenericDamageOrb)val2).damageColorIndex = (DamageColorIndex)9;
((GenericDamageOrb)val2).scale = 3f;
HurtBox mainHurtBox = val.mainHurtBox;
if (Object.op_Implicit((Object)(object)mainHurtBox))
{
TemporaryOverlay val3 = ((Component)body).gameObject.AddComponent<TemporaryOverlay>();
val3.duration = 1f;
val3.animateShaderAlpha = true;
val3.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
val3.destroyComponentOnEnd = true;
val3.originalMaterial = OverlayMaterial;
val3.AddToCharacerModel(((Component)((Component)body).gameObject.GetComponent<ModelLocator>().modelTransform).GetComponentInParent<CharacterModel>());
((Orb)val2).target = mainHurtBox;
OrbManager.instance.AddOrb((Orb)(object)val2);
val.ClearAllBuffs(NautilusBuff);
}
}
}
}
orig.Invoke(self, damageInfo);
};
}
public void CreateNautilusBuff()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
val.buffColor = new Color(1f, 0.35f, 0.8f);
val.canStack = true;
val.isDebuff = true;
((Object)val).name = "Shimmering Nautilus stacks";
val.isHidden = false;
val.isCooldown = false;
val.iconSprite = Main.Assets.LoadAsset<Sprite>("Assets/icons/nautilusBuff.png");
ContentAddition.AddBuffDef(val);
NautilusBuff = val;
}
}
public class Xenobacteria : ItemBase
{
public static ConfigItem<bool> Xenobacteria_Enabled = new ConfigItem<bool>("Void legendary: Xenobacteria", "Item enabled", "Should this item appear in runs?", _defaultValue: true);
public static ConfigItem<float> Xenobacteria_AttackSpeedBoost = new ConfigItem<float>("Void legendary: Xenobacteria", "Attack speed increase", "Boost your and your allies' attack speed by this fraction.", 0.3f, 0f, 1f, 0.05f);
public static ConfigItem<float> Xenobacteria_AttackSpeedBoostStack = new ConfigItem<float>("Void legendary: Xenobacteria", "Attack speed increase (per stack)", "Boost your and your allies' attack speed by this fraction, per additional stack.", 0.3f, 0f, 1f, 0.05f);
public override bool Enabled => Xenobacteria_Enabled.Value;
public override ItemDef ConversionItemDef => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/Base/AlienHead/AlienHead.asset").WaitForCompletion();
public override GameObject itemPrefab => OverwritePrefabMaterials();
public Material material0 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/Common/matVoidmetalTrim.mat").WaitForCompletion();
public Material material1 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/CloverVoid/matCloverVoidRing.mat").WaitForCompletion();
public Material material2 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/HealingPotion/matHealingPotionGlass.mat").WaitForCompletion();
public Material material3 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/ITAssets/matVoidWhale.mat").WaitForCompletion();
public override Sprite itemIcon => Main.Assets.LoadAsset<Sprite>("Assets/icons/xenobacteria.png");
public Xenobacteria(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove = true, bool _isConsumed = false, bool _hidden = false)
: base(_name, _tags, _tier, _canRemove, _isConsumed, _hidden)
{
}//IL_0003: Unknown result type (might be due to invalid IL or missing references)
public GameObject OverwritePrefabMaterials()
{
GameObject val = Main.Assets.LoadAsset<GameObject>("Assets/prefabs/xenobacteria.prefab");
Material[] materialArray = (Material[])(object)new Material[4] { material0, material1, material2, material3 };
((Renderer)val.GetComponentInChildren<MeshRenderer>()).SetMaterialArray(materialArray);
return val;
}
public override void FormatDescriptionTokens()
{
string descriptionToken = ItemDef.descriptionToken;
LanguageAPI.AddOverlay(descriptionToken, string.Format(Language.currentLanguage.GetLocalizedStringByToken(descriptionToken), Xenobacteria_AttackSpeedBoost.Value * 100f, Xenobacteria_AttackSpeedBoostStack.Value * 100f));
}
public override void RegisterHooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody orig, StatHookEventArgs self)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Invalid comparison between Unknown and I4
if (Object.op_Implicit((Object)(object)orig.teamComponent) && (int)orig.teamComponent.teamIndex == 1)
{
int bacteriasInTeam = GetBacteriasInTeam((TeamIndex)1);
if (bacteriasInTeam > 0)
{
self.attackSpeedMultAdd += Xenobacteria_AttackSpeedBoost.Value + Xenobacteria_AttackSpeedBoostStack.Value * (float)(bacteriasInTeam - 1);
}
}
};
}
public int GetBacteriasInTeam(TeamIndex teamIndex)
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
int num = 0;
foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(teamIndex))
{
if (Object.op_Implicit((Object)(object)teamMember.body))
{
num += GetItemCountEffective(teamMember.body);
}
}
return num;
}
}
public class PaleStar : ItemBase
{
public GameObject potentialPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/OptionPickup/OptionPickup.prefab").WaitForCompletion();
public GameObject chestKillPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/TreasureCacheVoid/VoidCacheOpenExplosion.prefab").WaitForCompletion();
private ItemDef _consumedItemDef;
public static ConfigItem<bool> PaleStar_Enabled = new ConfigItem<bool>("Void uncommon: Pale Star", "Item enabled", "Should this item appear in runs?", _defaultValue: true);
public static ConfigItem<int> PaleStar_Choices = new ConfigItem<int>("Void uncommon: Pale Star", "Void potential choices", "Amount of choices offered by Pale Star's void potential.", 3, 1f, 6f, 1f);
public static ConfigItem<int> PaleStar_ChoicesStack = new ConfigItem<int>("Void uncommon: Pale Star", "Void potential choices (per stack)", "Amount of choices offered by Pale Star's void potential, per additional stack.", 1, 1f, 3f, 1f);
public override bool Enabled => PaleStar_Enabled.Value;
public override ItemDef ConversionItemDef => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/DLC2/Items/LowerPricedChests/LowerPricedChests.asset").WaitForCompletion();
public ItemDef ConversionItemDefConsumed => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/DLC2/Items/LowerPricedChests/LowerPricedChestsConsumed.asset").WaitForCompletion();
public override GameObject itemPrefab => OverwritePrefabMaterials();
public Material material0 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/TreasureCacheVoid/matKeyVoid.mat").WaitForCompletion();
public Material material1 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/voidstage/matVoidCoral.mat").WaitForCompletion();
public override Sprite itemIcon => Main.Assets.LoadAsset<Sprite>("Assets/icons/paleStar.png");
public ItemDef ConsumedItemDef
{
get
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)_consumedItemDef))
{
_consumedItemDef = ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("PaleStarConsumed"));
}
return _consumedItemDef;
}
}
public PaleStar(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove = true, bool _isConsumed = false, bool _hidden = false)
: base(_name, _tags, _tier, _canRemove, _isConsumed, _hidden)
{
}//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_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
public GameObject OverwritePrefabMaterials()
{
GameObject val = Main.Assets.LoadAsset<GameObject>("Assets/prefabs/paleStar.prefab");
Material[] materialArray = (Material[])(object)new Material[2] { material0, material1 };
((Renderer)val.GetComponentInChildren<MeshRenderer>()).SetMaterialArray(materialArray);
return val;
}
public override void FormatDescriptionTokens()
{
string descriptionToken = ItemDef.descriptionToken;
LanguageAPI.AddOverlay(descriptionToken, string.Format(Language.currentLanguage.GetLocalizedStringByToken(descriptionToken), PaleStar_Choices.Value, PaleStar_ChoicesStack.Value));
}
public override void RegisterHooks()
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Expected O, but got Unknown
Pair val = default(Pair);
val.itemDef1 = ConversionItemDefConsumed;
val.itemDef2 = ItemDef;
Pair item = val;
Main.ItemConversionList.Add(item);
Log.Info($"Added void conversion from {((Object)ConversionItemDefConsumed).name} to {((Object)ItemDef).name}");
GlobalEventManager.OnInteractionBegin += (hook_OnInteractionBegin)delegate(orig_OnInteractionBegin orig, GlobalEventManager self, Interactor interactor, IInteractable interactable, GameObject interactableObject)
{
//IL_009c: 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_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Invalid comparison between Unknown and I4
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: 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_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
//IL_020e: Expected I4, but got Unknown
//IL_0287: Unknown result type (might be due to invalid IL or missing references)
//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
//IL_02b5: 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_02c9: Unknown result type (might be due to invalid IL or missing references)
//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
//IL_02f7: 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_0307: Unknown result type (might be due to invalid IL or missing references)
//IL_0312: 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_031e: Unknown result type (might be due to invalid IL or missing references)
//IL_032b: Expected O, but got Unknown
//IL_0376: Unknown result type (might be due to invalid IL or missing references)
//IL_0390: Unknown result type (might be due to invalid IL or missing references)
//IL_0247: Unknown result type (might be due to invalid IL or missing references)
//IL_0256: Unknown result type (might be due to invalid IL or missing references)
//IL_025b: Unknown result type (might be due to invalid IL or missing references)
//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
//IL_03df: Unknown result type (might be due to invalid IL or missing references)
//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
ChestBehavior component = interactableObject.GetComponent<ChestBehavior>();
CharacterBody component2 = ((Component)interactor).GetComponent<CharacterBody>();
PurchaseInteraction component3 = interactableObject.GetComponent<PurchaseInteraction>();
if (((Object)interactableObject).name.ToLower().Contains("voidchest") && Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.inventory) && Object.op_Implicit((Object)(object)component2.master))
{
int itemCountPermanent = component2.inventory.GetItemCountPermanent(ConsumedItemDef);
int num = component2.inventory.GetItemCountEffective(ConsumedItemDef) - itemCountPermanent;
if (num > 0)
{
component2.inventory.RemoveItemTemp(ConsumedItemDef.itemIndex, (float)num);
component2.inventory.GiveItemTemp(base.ItemIndex, (float)num);
}
if (itemCountPermanent > 0)
{
component2.inventory.RemoveItemPermanent(ConsumedItemDef.itemIndex, itemCountPermanent);
component2.inventory.GiveItemPermanent(base.ItemIndex, itemCountPermanent);
CharacterMasterNotificationQueue.SendTransformNotification(component2.master, ConsumedItemDef.itemIndex, base.ItemIndex, (TransformationType)0);
}
}
if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component3) && (int)component3.costType == 1 && component3.saleStarCompatible && !((Object)interactableObject).name.ToLower().Contains("equip") && Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.master) && GetItemCountEffective(component2) > 0)
{
int itemCountEffective = GetItemCountEffective(component2);
List<PickupIndex> list = new List<PickupIndex>();
List<UniquePickup> list2 = new List<UniquePickup>();
List<UniquePickup> list3 = new List<UniquePickup>();
component.dropTable.GenerateDistinctPickups(list3, PaleStar_Choices.Value + PaleStar_ChoicesStack.Value * (itemCountEffective - 1), component.rng, true);
foreach (UniquePickup item2 in list3)
{
ItemTier itemTier = PickupCatalog.GetPickupDef(item2.pickupIndex).itemTier;
ItemTier val2 = itemTier;
PickupDef val3 = (PickupDef)((int)val2 switch
{
1 => GetPickupOfTier((ItemTier)7, list),
2 => GetPickupOfTier((ItemTier)8, list),
_ => GetPickupOfTier((ItemTier)6, list),
});
if (val3 != null)
{
list.Add(val3.pickupIndex);
list2.Add(new UniquePickup(val3.pickupIndex));
}
}
CreatePickupInfo val4 = default(CreatePickupInfo);
val4.pickerOptions = PickupPickerController.GenerateOptionsFromList<List<UniquePickup>>(list2);
val4.prefabOverride = potentialPrefab;
val4.position = component.dropTransform.position;
val4.rotation = Quaternion.identity;
((CreatePickupInfo)(ref val4)).pickupIndex = PickupCatalog.FindPickupIndex((ItemTier)6);
PickupDropletController.CreatePickupDroplet(val4, component.dropTransform.position, Vector3.up * component.dropUpVelocityStrength + component.dropTransform.forward * component.dropForwardVelocityStrength);
EffectData val5 = new EffectData
{
origin = ((Component)component).transform.position
};
EffectManager.SpawnEffect(chestKillPrefab, val5, false);
int itemCountPermanent2 = component2.inventory.GetItemCountPermanent(ItemDef);
int num2 = component2.inventory.GetItemCountEffective(ItemDef) - itemCountPermanent2;
if (num2 > 0)
{
component2.inventory.RemoveItemTemp(base.ItemIndex, (float)num2);
component2.inventory.GiveItemTemp(ConsumedItemDef.itemIndex, (float)num2);
}
if (itemCountPermanent2 > 0)
{
component2.inventory.RemoveItemPermanent(base.ItemIndex, itemCountPermanent2);
component2.inventory.GiveItemPermanent(ConsumedItemDef.itemIndex, itemCountPermanent2);
CharacterMasterNotificationQueue.SendTransformNotification(component2.master, base.ItemIndex, ConsumedItemDef.itemIndex, (TransformationType)0);
}
Object.Destroy((Object)(object)interactableObject);
}
else
{
orig.Invoke(self, interactor, interactable, interactableObject);
}
};
}
public PickupDef GetPickupOfTier(ItemTier itemTier, List<PickupIndex> existingList)
{
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Invalid comparison between Unknown and I4
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
List<PickupDef> source = PickupCatalog.allPickups.ToList();
source = source.OrderBy((PickupDef i) => Guid.NewGuid()).ToList();
foreach (PickupDef item in source)
{
if ((Object)(object)item.displayPrefab != (Object)null && (int)item.itemIndex != -1 && item.itemTier == itemTier && !existingList.Contains(item.pickupIndex))
{
return item;
}
}
return null;
}
}
public class PaleStarConsumed : ItemBase
{
public override bool Enabled => PaleStar.PaleStar_Enabled.Value;
public override ItemDef ConversionItemDef => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/DLC2/Items/LowerPricedChests/LowerPricedChests.asset").WaitForCompletion();
public ItemDef ConversionItemDefConsumed => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/DLC2/Items/LowerPricedChests/LowerPricedChestsConsumed.asset").WaitForCompletion();
public override GameObject itemPrefab => null;
public override Sprite itemIcon => Main.Assets.LoadAsset<Sprite>("Assets/icons/paleStarConsumed.png");
public PaleStarConsumed(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove = true, bool _isConsumed = true, bool _hidden = false)
: base(_name, _tags, _tier, _canRemove, _isConsumed, _hidden)
{
}//IL_0003: Unknown result type (might be due to invalid IL or missing references)
public override void FormatDescriptionTokens()
{
}
public override void RegisterHooks()
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
Pair val = default(Pair);
val.itemDef1 = ConversionItemDefConsumed;
val.itemDef2 = ItemDef;
Pair item = val;
Main.ItemConversionList.Add(item);
Log.Info($"Added void conversion from {((Object)ConversionItemDefConsumed).name} to {((Object)ItemDef).name}");
}
}
public class ViscousPot : ItemBase
{
public static ConfigItem<bool> ViscousPot_Enabled = new ConfigItem<bool>("Void uncommon: Viscous Pot", "Item enabled", "Should this item appear in runs?", _defaultValue: true);
public static ConfigItem<float> ViscousPot_DecayReduction = new ConfigItem<float>("Void uncommon: Viscous Pot", "Barrier decay reduction", "Fraction for barrier decay reduction.", 0.2f, 0f, 1f, 0.05f);
public static ConfigItem<float> ViscousPot_BarrierAdd = new ConfigItem<float>("Void uncommon: Viscous Pot", "Barrier on secondary use", "Fraction of barrier added on secondary skill use.", 0.075f, 0f, 1f, 0.05f);
public static ConfigItem<float> ViscousPot_BarrierAddStack = new ConfigItem<float>("Void uncommon: Viscous Pot", "Barrier on secondary use (per stack)", "Fraction of barrier added on secondary skill use per additional stack.", 0.075f, 0f, 1f, 0.05f);
public override bool Enabled => ViscousPot_Enabled.Value;
public override ItemDef ConversionItemDef => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/DLC2/Items/IncreasePrimaryDamage/IncreasePrimaryDamage.asset").WaitForCompletion();
public override GameObject itemPrefab => OverwritePrefabMaterials();
public Material material0 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/EliteVoid/matVoidInfestorMetal.mat").WaitForCompletion();
public Material material1 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/RegeneratingScrap/matRegeneratingScrapGoo.mat").WaitForCompletion();
public Material material2 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/voidstage/matVoidAsteroid.mat").WaitForCompletion();
public override Sprite itemIcon => Main.Assets.LoadAsset<Sprite>("Assets/icons/viscousPot.png");
public ViscousPot(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove = true, bool _isConsumed = false, bool _hidden = false)
: base(_name, _tags, _tier, _canRemove, _isConsumed, _hidden)
{
}//IL_0003: Unknown result type (might be due to invalid IL or missing references)
public GameObject OverwritePrefabMaterials()
{
GameObject val = Main.Assets.LoadAsset<GameObject>("Assets/prefabs/viscousPot.prefab");
Material[] materialArray = (Material[])(object)new Material[3] { material0, material1, material2 };
((Renderer)val.GetComponentInChildren<MeshRenderer>()).SetMaterialArray(materialArray);
return val;
}
public override void FormatDescriptionTokens()
{
string descriptionToken = ItemDef.descriptionToken;
LanguageAPI.AddOverlay(descriptionToken, string.Format(Language.currentLanguage.GetLocalizedStringByToken(descriptionToken), ViscousPot_DecayReduction.Value * 100f, ViscousPot_BarrierAdd.Value * 100f, ViscousPot_BarrierAddStack.Value * 100f));
}
public override void RegisterHooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody orig, StatHookEventArgs self)
{
int itemCountEffective2 = GetItemCountEffective(orig);
if (itemCountEffective2 > 0)
{
self.barrierDecayMult *= 1f - ViscousPot_DecayReduction.Value;
}
};
CharacterBody.OnSkillActivated += (hook_OnSkillActivated)delegate(orig_OnSkillActivated orig, CharacterBody self, GenericSkill genericSkill)
{
//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)
if (GetItemCountEffective(self) > 0 && Object.op_Implicit((Object)(object)self.healthComponent))
{
int itemCountEffective = GetItemCountEffective(self);
float num = ViscousPot_BarrierAdd.Value + ViscousPot_BarrierAddStack.Value * (float)(itemCountEffective - 1);
if (self.bodyIndex == SpecialCases.RailGunner())
{
if (self.skillLocator.primary == genericSkill && self.canAddIncrasePrimaryDamage)
{
self.healthComponent.AddBarrier(self.maxHealth * num);
}
}
else if ((genericSkill.skillDef.autoHandleLuminousShot || self.canAddIncrasePrimaryDamage) && self.skillLocator.secondary == genericSkill)
{
self.healthComponent.AddBarrier(self.maxHealth * num);
}
}
};
}
}
}
namespace Nautilus.Configuration
{
public class ConfigItem<T>
{
private ConfigEntry<T> configEntry;
private readonly string header;
private readonly string name;
private readonly string desc;
private readonly T defaultValue;
private readonly float minValue;
private readonly float maxValue;
private readonly float increment;
public T Value => configEntry.Value;
public Type Type => typeof(T);
public ConfigItem(string _header, string _name, string _desc, T _defaultValue, float _minValue = float.MinValue, float _maxValue = float.MinValue, float _increment = float.MinValue)
{
header = _header;
name = _name;
desc = _desc;
defaultValue = _defaultValue;
minValue = _minValue;
maxValue = _maxValue;
increment = _increment;
InitConfigItem();
}
public void InitConfigItem()
{
//IL_0018: 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: Expected O, but got Unknown
//IL_0039: Expected O, but got Unknown
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Expected O, but got Unknown
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Expected O, but got Unknown
//IL_012f: 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_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_0152: Expected O, but got Unknown
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Expected O, but got Unknown
//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0201: Unknown result type (might be due to invalid IL or missing references)
//IL_0209: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_021d: Expected O, but got Unknown
//IL_0218: Unknown result type (might be due to invalid IL or missing references)
//IL_0222: Expected O, but got Unknown
configEntry = ((BaseUnityPlugin)Main.Instance).Config.Bind<T>(new ConfigDefinition(header, name), defaultValue, new ConfigDescription(desc, (AcceptableValueBase)null, Array.Empty<object>()));
if (Compat.RiskOfOptions)
{
if (Type == typeof(bool))
{
ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(configEntry as ConfigEntry<bool>, true));
}
else if (Type == typeof(string))
{
ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(configEntry as ConfigEntry<string>, true));
}
else if (Type == typeof(int))
{
int num = Convert.ToInt32(defaultValue);
float num2 = ((minValue == float.MinValue) ? 0f : minValue);
float num3 = ((maxValue == float.MinValue) ? ((float)num * 10f) : maxValue);
ModSettingsManager.AddOption((BaseOption)new IntSliderOption(configEntry as ConfigEntry<int>, new IntSliderConfig
{
min = (int)num2,
max = (int)num3,
restartRequired = true
}));
}
else if (Type == typeof(float))
{
float num4 = Convert.ToSingle(defaultValue);
float min = ((minValue == float.MinValue) ? 0f : minValue);
float max = ((maxValue == float.MinValue) ? (num4 * 10f) : maxValue);
float num5 = ((increment == float.MinValue) ? (num4 / 10f) : increment);
ModSettingsManager.AddOption((BaseOption)new StepSliderOption(configEntry as ConfigEntry<float>, new StepSliderConfig
{
min = min,
max = max,
increment = num5,
restartRequired = true
}));
}
}
}
}
}