Decompiled source of SoySauceRevived v1.0.5

SoySauceRevived.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using LookingGlass.ItemStatsNameSpace;
using Microsoft.CodeAnalysis;
using On.RoR2;
using R2API;
using RoR2;
using SoySauceRevived.Items;
using UnityEngine;
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("SoySauceRevived")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SoySauceRevived")]
[assembly: AssemblyTitle("SoySauceRevived")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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]
	[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;
		}
	}
}
namespace SoySauceRevived
{
	internal static class LookingGlassCompat
	{
		private struct Line
		{
			public string description;

			public ValueType valueType;

			public MeasurementUnits units;

			public Line(string description, ValueType valueType, MeasurementUnits units)
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				this.description = description;
				this.valueType = valueType;
				this.units = units;
			}
		}

		public const string GUID = "droppod.lookingglass";

		public static bool IsLookingGlassInstalled => Chainloader.PluginInfos.ContainsKey("droppod.lookingglass");

		[MethodImpl(MethodImplOptions.NoInlining)]
		public static void Init()
		{
			((ResourceAvailability)(ref ItemCatalog.availability)).CallWhenAvailable((Action)RegisterItemStats);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static ItemStatsDef Create(Line[] lines)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0030: 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)
			ItemStatsDef val = new ItemStatsDef();
			for (int i = 0; i < lines.Length; i++)
			{
				Line line = lines[i];
				val.descriptions.Add(line.description);
				val.valueTypes.Add(line.valueType);
				val.measurementUnits.Add(line.units);
			}
			return val;
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static void AddItem(ItemBase? item, Func<int, List<float>> values, params Line[] lines)
		{
			ItemStatsDef val = Create(lines);
			val.calculateValuesFlat = values;
			Register(item, val);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static void Register(ItemBase? item, ItemStatsDef def)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Invalid comparison between Unknown and I4
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected I4, but got Unknown
			if (item != null && Object.op_Implicit((Object)(object)item.ItemDef) && (int)item.ItemDef.itemIndex != -1)
			{
				ItemDefinitions.allItemDefinitions[(int)item.ItemDef.itemIndex] = def;
			}
		}

		private static float Stack(float initial, float additional, int count)
		{
			return initial + additional * (float)(count - 1);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static void RegisterItemStats()
		{
			try
			{
				AddItem(ItemBase<SoySauce>.instance, (int count) => new List<float> { Stack(0.01f, 0.005f, count) }, new Line("Damage Per Consecutive Hit: ", (ValueType)1, (MeasurementUnits)1));
			}
			catch (Exception ex)
			{
				Main.ModLogger.LogError((object)("Failed to register LookingGlass item stats: " + ex));
			}
		}
	}
	[BepInPlugin("com.Phreel.SoySauceRevived", "SoySauceRevived", "1.0.4")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Main : BaseUnityPlugin
	{
		public const string ModGuid = "com.Phreel.SoySauceRevived";

		public const string ModName = "SoySauceRevived";

		public const string ModVer = "1.0.5";

		public static AssetBundle MainAssets;

		public List<ItemBase> Items = new List<ItemBase>();

		internal static ManualLogSource ModLogger;

		private void Awake()
		{
			ModLogger = ((BaseUnityPlugin)this).Logger;
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SoySauceRevived.soysauceassets"))
			{
				MainAssets = AssetBundle.LoadFromStream(stream);
			}
			IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase))
				select type;
			foreach (Type item in enumerable)
			{
				ItemBase itemBase = (ItemBase)Activator.CreateInstance(item);
				if (ValidateItem(itemBase, Items))
				{
					itemBase.Init(((BaseUnityPlugin)this).Config);
				}
			}
			bool value = ((BaseUnityPlugin)this).Config.Bind<bool>("Mod Compatability: LookingGlass", "Enable Compatability Patches?", true, "Add item stats to LookingGlass (if installed)?").Value;
			if (LookingGlassCompat.IsLookingGlassInstalled && value)
			{
				LookingGlassCompat.Init();
			}
		}

		public bool ValidateItem(ItemBase item, List<ItemBase> itemList)
		{
			bool value = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + item.ItemName, "Enable Item?", true, "Should this item appear in runs?").Value;
			bool value2 = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + item.ItemName, "Blacklist Item from AI Use?", item.AIBlacklisted, "Should the AI not be able to obtain this item?").Value;
			if (value)
			{
				itemList.Add(item);
				item.AIBlacklisted = value2;
			}
			return value;
		}
	}
}
namespace SoySauceRevived.Items
{
	public abstract class ItemBase<T> : ItemBase where T : ItemBase<T>
	{
		public static T instance { get; private set; }

		public ItemBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBase was instantiated twice");
			}
			instance = this as T;
		}
	}
	public abstract class ItemBase
	{
		public ItemDef ItemDef;

		public abstract string ItemName { get; }

		public abstract string ItemLangTokenName { get; }

		public abstract string ItemPickupDesc { get; }

		public abstract string ItemFullDescription { get; }

		public abstract string ItemLore { get; }

		public abstract ItemTier Tier { get; }

		public virtual ItemTag[] ItemTags { get; set; } = (ItemTag[])(object)new ItemTag[0];

		public abstract GameObject ItemModel { get; }

		public abstract Sprite ItemIcon { get; }

		public virtual bool CanRemove { get; } = true;

		public virtual bool AIBlacklisted { get; set; } = false;

		public abstract void Init(ConfigFile config);

		public virtual void CreateConfig(ConfigFile config)
		{
		}

		protected virtual void CreateLang()
		{
			LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", ItemName);
			LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc);
			LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription);
			LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore);
		}

		public abstract ItemDisplayRuleDict CreateItemDisplayRules();

		protected void CreateItem()
		{
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Expected O, but got Unknown
			if (AIBlacklisted)
			{
				ItemTags = new List<ItemTag>(ItemTags) { (ItemTag)4 }.ToArray();
			}
			ItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)ItemDef).name = "ITEM_" + ItemLangTokenName;
			ItemDef.nameToken = "ITEM_" + ItemLangTokenName + "_NAME";
			ItemDef.pickupToken = "ITEM_" + ItemLangTokenName + "_PICKUP";
			ItemDef.descriptionToken = "ITEM_" + ItemLangTokenName + "_DESCRIPTION";
			ItemDef.loreToken = "ITEM_" + ItemLangTokenName + "_LORE";
			ItemDef.pickupModelPrefab = ItemModel;
			ItemDef.pickupIconSprite = ItemIcon;
			ItemDef.hidden = false;
			ItemDef.canRemove = CanRemove;
			ItemDef.deprecatedTier = Tier;
			if (ItemTags.Length != 0)
			{
				ItemDef.tags = ItemTags;
			}
			ItemAPI.Add(new CustomItem(ItemDef, CreateItemDisplayRules()));
		}

		public virtual void Hooks()
		{
		}

		public int GetCount(CharacterBody body)
		{
			if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
			{
				return 0;
			}
			return body.inventory.GetItemCountEffective(ItemDef);
		}

		public int GetCount(CharacterMaster master)
		{
			if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory))
			{
				return 0;
			}
			return master.inventory.GetItemCountEffective(ItemDef);
		}

		public int GetCountSpecific(CharacterBody body, ItemDef itemDef)
		{
			if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
			{
				return 0;
			}
			return body.inventory.GetItemCountEffective(itemDef);
		}
	}
	internal class SoySauce : ItemBase<SoySauce>
	{
		public const float InitialDamageGain = 0.01f;

		public const float AdditionalDamageGain = 0.005f;

		public static ItemDef soySauceDef;

		public Dictionary<GameObject, GameObject> userDictionary = new Dictionary<GameObject, GameObject>();

		private readonly Dictionary<GameObject, double> damageBuffs = new Dictionary<GameObject, double>();

		public override string ItemName => "Soy Sauce";

		public override string ItemLangTokenName => "SOY_SAUCE";

		public override string ItemPickupDesc => "Continue attacking the same target to increase your damage. Reset your bonus upon attacking a new enemy.";

		public override string ItemFullDescription => "Each time you attack a single target, increase your damage by <style=cIsDamage>1%</style> <style=cStack>(+0.5% per stack).</style> Upon attacking a new enemy, return your base damage to normal.";

		public override string ItemLore => "Mystical soy sauce that rewards continued use. No matter how much you pour out, it never seems to run dry...";

		public override ItemTier Tier => (ItemTier)1;

		public override GameObject ItemModel => Main.MainAssets.LoadAsset<GameObject>("SoySauce.prefab");

		public override Sprite ItemIcon => Main.MainAssets.LoadAsset<Sprite>("SoySauceIcon.png");

		public override ItemTag[] ItemTags { get; set; } = (ItemTag[])(object)new ItemTag[2]
		{
			(ItemTag)1,
			(ItemTag)31
		};

		public override bool AIBlacklisted { get; set; } = true;

		public override void Init(ConfigFile config)
		{
			CreateLang();
			CreateItem();
			Hooks();
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Expected O, but got Unknown
			//IL_0023: 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_0056: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: 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_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: 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_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Unknown result type (might be due to invalid IL or missing references)
			//IL_035c: 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_0362: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0386: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b5: 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_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0415: Unknown result type (might be due to invalid IL or missing references)
			//IL_043f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0444: Unknown result type (might be due to invalid IL or missing references)
			//IL_045a: Unknown result type (might be due to invalid IL or missing references)
			//IL_045f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0475: Unknown result type (might be due to invalid IL or missing references)
			//IL_047a: Unknown result type (might be due to invalid IL or missing references)
			//IL_047f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0480: Unknown result type (might be due to invalid IL or missing references)
			//IL_049b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0504: Unknown result type (might be due to invalid IL or missing references)
			//IL_0509: Unknown result type (might be due to invalid IL or missing references)
			//IL_050e: Unknown result type (might be due to invalid IL or missing references)
			//IL_050f: Unknown result type (might be due to invalid IL or missing references)
			//IL_052a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0533: Unknown result type (might be due to invalid IL or missing references)
			//IL_055d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0562: Unknown result type (might be due to invalid IL or missing references)
			//IL_0578: Unknown result type (might be due to invalid IL or missing references)
			//IL_057d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0593: Unknown result type (might be due to invalid IL or missing references)
			//IL_0598: Unknown result type (might be due to invalid IL or missing references)
			//IL_059d: Unknown result type (might be due to invalid IL or missing references)
			//IL_059e: Unknown result type (might be due to invalid IL or missing references)
			GameObject itemModel = ItemModel;
			ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
			val.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = itemModel,
					childName = "Chest",
					localPos = new Vector3(0.1122f, 0.168f, 0.212f),
					localAngles = new Vector3(350.1537f, 0.0057f, 359.9348f),
					localScale = new Vector3(0.04f, 0.04f, 0.04f)
				}
			});
			val.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = itemModel,
					childName = "Chest",
					localPos = new Vector3(0.1122f, 0.3168f, 0.212f),
					localAngles = new Vector3(350.1537f, 0.0057f, 359.9348f),
					localScale = new Vector3(0.01f, 0.01f, 0.01f)
				}
			});
			val.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = itemModel,
					childName = "Chest",
					localPos = new Vector3(0.4493f, 3.1995f, -1.1082f),
					localAngles = new Vector3(54.7524f, 359.9821f, 0.1173f),
					localScale = new Vector3(0.04f, 0.004f, 0.004f)
				}
			});
			val.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = itemModel,
					childName = "CannonHeadR",
					localPos = new Vector3(-0.2175f, 0.2798f, -0.0528f),
					localAngles = new Vector3(0.4107f, 271.4308f, 238.6879f),
					localScale = new Vector3(0.01f, 0.01f, 0.01f)
				}
			});
			val.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = itemModel,
					childName = "Chest",
					localPos = new Vector3(0.1244f, 0.1703f, 0.1248f),
					localAngles = new Vector3(331.7253f, 358.0778f, 4.2768f),
					localScale = new Vector3(0.01f, 0.01f, 0.01f)
				}
			});
			val.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = itemModel,
					childName = "Chest",
					localPos = new Vector3(0.0034f, 0.1911f, -0.2936f),
					localAngles = new Vector3(13.9531f, 359.9117f, 359.09f),
					localScale = new Vector3(0.01f, 0.01f, 0.01f)
				}
			});
			val.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = itemModel,
					childName = "MechLowerArmL",
					localPos = new Vector3(0.0018f, 0.6337f, 0.0048f),
					localAngles = new Vector3(281.7989f, 159.6738f, 152.303f),
					localScale = new Vector3(0.01f, 0.01f, 0.01f)
				}
			});
			val.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = itemModel,
					childName = "Chest",
					localPos = new Vector3(0f, 0.2f, 0.3f),
					localAngles = new Vector3(-180f, 0f, 0f),
					localScale = new Vector3(0.01f, 0.01f, 0.01f)
				}
			});
			val.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = itemModel,
					childName = "Eye",
					localPos = new Vector3(-0.0203f, 0.7649f, 0.0108f),
					localAngles = new Vector3(270.5436f, 0f, 0f),
					localScale = new Vector3(0.01f, 0.01f, 0.01f)
				}
			});
			val.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = itemModel,
					childName = "Pelvis",
					localPos = new Vector3(0.0545f, -0.1244f, -0.205f),
					localAngles = new Vector3(345.5598f, 194.8679f, 174.2104f),
					localScale = new Vector3(0.01f, 0.01f, 0.01f)
				}
			});
			return val;
		}

		public override void Hooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(OnHitEnemy);
			Stage.onServerStageBegin += delegate
			{
				userDictionary.Clear();
				damageBuffs.Clear();
			};
		}

		private void OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			//IL_00fd: 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_010a: Expected O, but got Unknown
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: 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_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageInfo, victim);
			if (!NetworkServer.active || !Object.op_Implicit((Object)(object)damageInfo.attacker) || !Object.op_Implicit((Object)(object)victim))
			{
				return;
			}
			GameObject attacker = damageInfo.attacker;
			CharacterBody component = attacker.GetComponent<CharacterBody>();
			int count = GetCount(component);
			if (count <= 0)
			{
				return;
			}
			HealthComponent component2 = victim.GetComponent<HealthComponent>();
			if (Object.op_Implicit((Object)(object)component2))
			{
				damageBuffs.TryGetValue(attacker, out var value);
				if (!userDictionary.TryGetValue(attacker, out GameObject value2) || (Object)(object)value2 != (Object)(object)victim)
				{
					userDictionary[attacker] = victim;
					value = 0.0;
				}
				else
				{
					double num = 0.009999999776482582 + 0.004999999888241291 * (double)(count - 1);
					value += num;
				}
				damageBuffs[attacker] = value;
				ProcChainMask procChainMask = default(ProcChainMask);
				DamageInfo val = new DamageInfo();
				val.damageType = DamageTypeCombo.op_Implicit((DamageType)0);
				val.damage = (int)Math.Ceiling(value * (double)damageInfo.damage);
				val.crit = false;
				val.procCoefficient = 0f;
				val.procChainMask = procChainMask;
				val.damageColorIndex = (DamageColorIndex)3;
				val.attacker = attacker;
				val.position = damageInfo.position + default(Vector3);
				if (value != 0.0)
				{
					component2.TakeDamage(val);
				}
			}
		}
	}
}