using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using EntityStates;
using On.RoR2;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Navigation;
using RoR2.Skills;
using RoR2.UI;
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 = "")]
[assembly: AssemblyCompany("OmegaItems")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("OmegaItems")]
[assembly: AssemblyTitle("OmegaItems")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace OmegaItems;
internal class Assets
{
public static AssetBundle MainAssetBundle;
public static T Load<T>(string name) where T : Object
{
return MainAssetBundle.LoadAsset<T>(name);
}
public static void PopulateAssets()
{
Assembly executingAssembly = Assembly.GetExecutingAssembly();
if ((Object)(object)MainAssetBundle == (Object)null)
{
using (Stream stream = executingAssembly.GetManifestResourceStream("OmegaItems.AssetBundle." + "OmegaItems".ToLower() + "assets"))
{
MainAssetBundle = AssetBundle.LoadFromStream(stream);
}
}
}
}
internal class Behaviour : MonoBehaviour
{
private CharacterBody body;
private void Awake()
{
body = ((Component)this).GetComponent<CharacterBody>();
}
}
public class MushroomBodyBehavior : ItemBehavior
{
private float stopwatch;
private float interval = 0.25f;
private GameObject wardEffect;
private float radius => Utils.CalculateItemBonus(3.5f, 1.5f, base.stack);
private void FixedUpdate()
{
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
if (base.stack > 0 && base.body.GetNotMoving())
{
if (!Object.op_Implicit((Object)(object)wardEffect))
{
wardEffect = Object.Instantiate<GameObject>(Prefabs.mushroom2Ward, base.body.footPosition, Quaternion.identity);
}
stopwatch += Time.fixedDeltaTime;
if (stopwatch >= interval)
{
stopwatch = 0f;
Barrier();
}
}
else
{
stopwatch = 0f;
if (Object.op_Implicit((Object)(object)wardEffect))
{
Object.Destroy((Object)(object)wardEffect);
}
}
if (Object.op_Implicit((Object)(object)wardEffect))
{
wardEffect.transform.localScale = Vector3.one * radius;
}
}
private void Barrier()
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
if (!NetworkServer.active)
{
return;
}
ReadOnlyCollection<TeamComponent> teamMembers = TeamComponent.GetTeamMembers(base.body.teamComponent.teamIndex);
float num = radius * radius;
Vector3 position = ((Component)this).transform.position;
for (int i = 0; i < teamMembers.Count; i++)
{
Vector3 val = ((Component)teamMembers[i]).transform.position - position;
if (!(((Vector3)(ref val)).sqrMagnitude <= num))
{
continue;
}
HealthComponent component = ((Component)teamMembers[i]).GetComponent<HealthComponent>();
if (Object.op_Implicit((Object)(object)component))
{
float num2 = component.fullHealth * Utils.CalculateItemBonus(Configs.mushroomBarrierCoef.Value, Configs.mushroomBarrierCoefStack.Value, base.stack);
if (num2 > 0f)
{
component.AddBarrier(num2 * interval);
}
}
}
}
private void OnDisable()
{
if (Object.op_Implicit((Object)(object)wardEffect))
{
Object.Destroy((Object)(object)wardEffect);
}
}
}
internal class Configs
{
internal static ConfigFile config;
internal static ConfigEntry<float> hoofJumpMult;
internal static ConfigEntry<float> hoofFallDMGMult;
internal static ConfigEntry<float> hoofFallDMGMultStack;
internal static ConfigEntry<float> mushroomBarrierCoef;
internal static ConfigEntry<float> mushroomBarrierCoefStack;
internal static void InitConfigs()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
config = new ConfigFile(Paths.ConfigPath + "\\OmegaItems\\ItemConfig.cfg", true);
string text = "Paul’s Other Goat Hoof";
hoofJumpMult = config.Bind<float>(text, "Jump Mult Add", 0.25f, (ConfigDescription)null);
hoofFallDMGMult = config.Bind<float>(text, "Fall Damage Reduction", 0.2f, (ConfigDescription)null);
hoofFallDMGMultStack = config.Bind<float>(text, "Additional Fall Damage Reduction Per Stack", 0.1f, (ConfigDescription)null);
text = "Massive Fungus";
mushroomBarrierCoef = config.Bind<float>(text, "Barrier Amount Per Second", 0.045f, (ConfigDescription)null);
mushroomBarrierCoefStack = config.Bind<float>(text, "Additional Barrier Amount Per Second Per Stack", 0.0225f, (ConfigDescription)null);
}
}
internal class Hook
{
internal static void Hooks()
{
//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
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Expected O, but got Unknown
SurvivorCatalog.Init += new hook_Init(SurvivorCatalog_Init);
HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal;
RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
}
private static void SurvivorCatalog_Init(orig_Init orig)
{
orig.Invoke();
ItemDisplays.AddItemDisplays();
}
private static void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
if ((int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)2097152)) != 0 && Object.op_Implicit((Object)(object)damageInfo.attacker))
{
CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory))
{
int itemCount = component.inventory.GetItemCount(Prefabs.hoof2);
if (itemCount > 0)
{
damageInfo.damage /= 1f + Utils.CalculateItemBonus(Configs.hoofFallDMGMult.Value, Configs.hoofFallDMGMultStack.Value, itemCount);
}
}
}
orig.Invoke(self, damageInfo);
}
private static void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body)
{
body.AddItemBehavior<MushroomBodyBehavior>(body.inventory.GetItemCount(Prefabs.mushroom2));
}
private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
{
if (Object.op_Implicit((Object)(object)sender.inventory))
{
int itemCount = sender.inventory.GetItemCount(Prefabs.hoof2);
if (itemCount > 0)
{
args.jumpPowerMultAdd += Configs.hoofJumpMult.Value;
}
}
}
}
internal class ItemDisplays
{
public static void AddItemDisplays()
{
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
//IL_02be: Unknown result type (might be due to invalid IL or missing references)
//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
//IL_02db: Unknown result type (might be due to invalid IL or missing references)
//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0300: Unknown result type (might be due to invalid IL or missing references)
//IL_0305: Unknown result type (might be due to invalid IL or missing references)
//IL_031d: Unknown result type (might be due to invalid IL or missing references)
//IL_031f: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_0256: Unknown result type (might be due to invalid IL or missing references)
//IL_0262: Unknown result type (might be due to invalid IL or missing references)
//IL_0264: Unknown result type (might be due to invalid IL or missing references)
//IL_0269: Unknown result type (might be due to invalid IL or missing references)
//IL_026b: Unknown result type (might be due to invalid IL or missing references)
//IL_0270: Unknown result type (might be due to invalid IL or missing references)
//IL_027a: Unknown result type (might be due to invalid IL or missing references)
//IL_027f: Unknown result type (might be due to invalid IL or missing references)
//IL_0281: Unknown result type (might be due to invalid IL or missing references)
//IL_0286: Unknown result type (might be due to invalid IL or missing references)
//IL_028b: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_0206: Unknown result type (might be due to invalid IL or missing references)
//IL_0208: Unknown result type (might be due to invalid IL or missing references)
//IL_020d: Unknown result type (might be due to invalid IL or missing references)
//IL_020f: Unknown result type (might be due to invalid IL or missing references)
//IL_0214: Unknown result type (might be due to invalid IL or missing references)
//IL_0216: Unknown result type (might be due to invalid IL or missing references)
//IL_0220: Unknown result type (might be due to invalid IL or missing references)
//IL_0222: Unknown result type (might be due to invalid IL or missing references)
//IL_0232: Unknown result type (might be due to invalid IL or missing references)
//IL_0234: 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_0245: Unknown result type (might be due to invalid IL or missing references)
//IL_024a: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
SurvivorDef[] survivorDefs = SurvivorCatalog.survivorDefs;
foreach (SurvivorDef val in survivorDefs)
{
ItemDisplayRuleSet itemDisplayRuleSet = ((Component)val.bodyPrefab.GetComponent<ModelLocator>().modelTransform).GetComponent<CharacterModel>().itemDisplayRuleSet;
if (!Object.op_Implicit((Object)(object)itemDisplayRuleSet))
{
continue;
}
bool flag = false;
bool flag2 = false;
ItemDisplayRule val2 = default(ItemDisplayRule);
ItemDisplayRule val3 = default(ItemDisplayRule);
KeyAssetRuleGroup[] array = itemDisplayRuleSet.keyAssetRuleGroups;
if (array != null && array.Length != 0)
{
KeyAssetRuleGroup[] array2 = array;
foreach (KeyAssetRuleGroup val4 in array2)
{
ItemDisplayRule[] rules = val4.displayRuleGroup.rules;
ItemDisplayRule[] array3 = rules;
foreach (ItemDisplayRule val5 in array3)
{
GameObject followerPrefab = val5.followerPrefab;
if (!Object.op_Implicit((Object)(object)followerPrefab))
{
continue;
}
Object keyAsset = val4.keyAsset;
ItemDef val6 = (ItemDef)(object)((keyAsset is ItemDef) ? keyAsset : null);
if ((Object)(object)val6 != (Object)null)
{
if (val6.nameToken == Prefabs.hoof.nameToken)
{
flag = true;
val2 = val5;
}
else if (val6.nameToken == Prefabs.mushroom.nameToken)
{
flag2 = true;
val3 = val5;
}
}
}
if (flag)
{
string text = val2.childName;
if (text.Contains(".r"))
{
text = text.Replace(".r", ".l");
}
else if (text.Contains(".R"))
{
text = text.Replace(".R", ".L");
}
else if (text.Contains("right"))
{
text = text.Replace("right", "left");
}
else if (text.Contains("R"))
{
text = text.Replace("R", "L");
}
val2 = NewDisplayRule(text, Prefabs.hoof2FollowerPrefab, val2.localPos, val2.localAngles, new Vector3(val2.localScale.x, val2.localScale.y * -1f, val2.localScale.z), (LimbFlags)16);
}
if (flag2)
{
val3 = NewDisplayRule(val3.childName, Prefabs.mushroom2FollowerPrefab, val3.localPos, val3.localAngles, Vector3.one * 0.15f, val3.limbMask);
}
}
}
if (flag)
{
KeyAssetRuleGroup val7 = NewIDRS((Object)(object)Prefabs.hoof2, val2);
Array.Resize(ref array, array.Length + 1);
array[^1] = val7;
}
if (flag2)
{
KeyAssetRuleGroup val8 = NewIDRS((Object)(object)Prefabs.mushroom2, val3);
Array.Resize(ref array, array.Length + 1);
array[^1] = val8;
}
itemDisplayRuleSet.keyAssetRuleGroups = array;
itemDisplayRuleSet.GenerateRuntimeValues();
}
}
private static KeyAssetRuleGroup NewIDRS(Object obj, params ItemDisplayRule[] rules)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0029: 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_002d: Unknown result type (might be due to invalid IL or missing references)
KeyAssetRuleGroup result = default(KeyAssetRuleGroup);
result.keyAsset = obj;
result.displayRuleGroup = new DisplayRuleGroup
{
rules = rules
};
return result;
}
internal static ItemDisplayRule NewDisplayRule(string childName, GameObject followerPrefab, Vector3 localPos, Vector3 localAngles, Vector3 localScale, LimbFlags flags)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_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_002b: 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_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
ItemDisplayRule result = default(ItemDisplayRule);
result.ruleType = (ItemDisplayRuleType)0;
result.followerPrefab = followerPrefab;
result.childName = childName;
result.localPos = localPos;
result.localAngles = localAngles;
result.localScale = localScale;
result.limbMask = flags;
return result;
}
}
[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.*/)]
[BepInPlugin("com.Dragonyck.OmegaItems", "OmegaItems", "1.0.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
public const string MODUID = "com.Dragonyck.OmegaItems";
public const string MODNAME = "OmegaItems";
public const string VERSION = "1.0.0";
private void Awake()
{
Assets.PopulateAssets();
Configs.InitConfigs();
Prefabs.CreatePrefabs();
Hook.Hooks();
}
}
internal class Prefabs
{
internal static ItemDef hoof;
internal static ItemDef mushroom;
internal static ItemDef mushroom2;
internal static GameObject mushroom2FollowerPrefab;
internal static GameObject mushroom2PickupPrefab;
internal static GameObject mushroom2Ward;
internal static ItemDef hoof2;
internal static GameObject hoof2PickupPrefab;
internal static GameObject hoof2FollowerPrefab;
internal static void CreatePrefabs()
{
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Expected O, but got Unknown
//IL_006c: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_0272: Unknown result type (might be due to invalid IL or missing references)
//IL_027c: Expected O, but got Unknown
//IL_0296: Unknown result type (might be due to invalid IL or missing references)
//IL_029b: Unknown result type (might be due to invalid IL or missing references)
//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
//IL_0473: Unknown result type (might be due to invalid IL or missing references)
//IL_0478: Unknown result type (might be due to invalid IL or missing references)
hoof = Load<ItemDef>("RoR2/Base/Hoof/Hoof.asset");
mushroom = Load<ItemDef>("RoR2/Base/Mushroom/Mushroom.asset");
string text = "OMEGA";
string text2 = "HOOF";
hoof2PickupPrefab = Instantiate(hoof.pickupModelPrefab, "OmegaHoofPickupPrefab");
Material val = new Material(Load<Material>("RoR2/Base/Hoof/matHoof.mat"));
val.SetColor("_Color", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)165, (byte)89, byte.MaxValue)));
Renderer[] componentsInChildren = hoof2PickupPrefab.GetComponentsInChildren<Renderer>();
foreach (Renderer val2 in componentsInChildren)
{
val2.material = val;
((Component)val2).transform.localScale = new Vector3(((Component)val2).transform.localScale.x, ((Component)val2).transform.localScale.y * -1f, ((Component)val2).transform.localScale.z);
}
hoof2FollowerPrefab = Instantiate("RoR2/Base/Hoof/DisplayHoof.prefab", "OmegaHoofDisplayPrefab");
RendererInfo[] rendererInfos = hoof2FollowerPrefab.GetComponent<ItemDisplay>().rendererInfos;
for (int j = 0; j < rendererInfos.Length; j++)
{
rendererInfos[j].defaultMaterial = val;
}
hoof2 = NewItemDef(text + text2, hoof2PickupPrefab, (ItemTier)0, hoof.tags);
LanguageAPI.Add(text + text2 + "_NAME", "Paul’s Other Goat Hoof");
LanguageAPI.Add(text + text2 + "_DESCRIPTION", "Increases <style=cIsUtility>jump height</style> by <style=cIsUtility>" + Configs.hoofJumpMult.Value * 100f + "%</style>, and reduces fall damage by <style=cIsUtility>" + Configs.hoofFallDMGMult.Value * 100f + "%</style> <style=cStack>(+" + Configs.hoofFallDMGMultStack.Value * 100f + "% per stack)</style>.");
LanguageAPI.Add(text + text2 + "_PICKUP", "Increase jump height and reduce fall damage.");
LanguageAPI.Add(text + text2 + "_LORE", "");
text2 = "MUSHROOM";
mushroom2PickupPrefab = Instantiate(mushroom.pickupModelPrefab, "OmegaMushroomPickupPrefab");
Renderer componentInChildren = mushroom2PickupPrefab.GetComponentInChildren<Renderer>();
componentInChildren.material = new Material(componentInChildren.material);
componentInChildren.material.SetColor("_Color", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)84, (byte)0, byte.MaxValue)));
componentInChildren.material.SetColor("_EmColor", Color32.op_Implicit(new Color32((byte)217, (byte)181, (byte)0, byte.MaxValue)));
mushroom2FollowerPrefab = Instantiate("RoR2/Base/Mushroom/DisplayMushroom.prefab", "OmegaMushroomDisplayPrefab");
RendererInfo[] rendererInfos2 = mushroom2FollowerPrefab.GetComponent<ItemDisplay>().rendererInfos;
for (int k = 0; k < rendererInfos2.Length; k++)
{
rendererInfos2[k].defaultMaterial = componentInChildren.material;
}
mushroom2 = NewItemDef(text + text2, mushroom2PickupPrefab, (ItemTier)0, mushroom.tags);
LanguageAPI.Add(text + text2 + "_NAME", "Massive Fungus");
LanguageAPI.Add(text + text2 + "_DESCRIPTION", "After standing still for <style=cIsHealing>1</style> second, create a zone that gives a <style=cIsHealing>temporary barrier</style> for <style=cIsHealing>" + Configs.mushroomBarrierCoef.Value * 100f + "%</style> <style=cStack>(+" + Configs.mushroomBarrierCoefStack.Value * 100f + "% per stack)</style> of your <style=cIsHealing>health</style> every second to all allies within <style=cIsHealing>3m</style> <style=cStack>(+1.5m per stack)</style>.");
LanguageAPI.Add(text + text2 + "_PICKUP", "All nearby allies gain a temporary barrier after standing still for 1 second.");
LanguageAPI.Add(text + text2 + "_LORE", "");
mushroom2Ward = Instantiate("RoR2/Base/MiniMushroom/MiniMushroomWard.prefab", "OmegaMushroomWard");
Renderer[] componentsInChildren2 = mushroom2Ward.GetComponentsInChildren<Renderer>();
foreach (Renderer val3 in componentsInChildren2)
{
string name = ((Object)val3).name;
if (name == "IndicatorSphere" || name == "MushroomMeshes")
{
val3.material.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)92, (byte)0, byte.MaxValue)));
}
else if (name == "HealingSymbols")
{
((Component)val3).gameObject.SetActive(false);
}
}
Object.Destroy((Object)(object)mushroom2Ward.GetComponent<HealingWard>());
Object.Destroy((Object)(object)mushroom2Ward.GetComponent<Rigidbody>());
Object.Destroy((Object)(object)mushroom2Ward.GetComponent<TeamFilter>());
}
internal static ItemDef NewItemDef(string name, GameObject pickupModelPrefab, ItemTier tier, params ItemTag[] tags)
{
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
ItemDef val = ScriptableObject.CreateInstance<ItemDef>();
((Object)val).name = name;
val.nameToken = name + "_NAME";
val.descriptionToken = name + "_DESCRIPTION";
val.pickupToken = name + "_PICKUP";
val.loreToken = name + "_LORE";
val.pickupIconSprite = Assets.Load<Sprite>(name);
val.pickupModelPrefab = pickupModelPrefab;
val.deprecatedTier = tier;
val.tier = tier;
val.tags = tags;
ContentAddition.AddItemDef(val);
return val;
}
internal static T Load<T>(string path)
{
//IL_0002: 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)
return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion();
}
internal static GameObject Instantiate(string path, string name, bool registerNetwork = false)
{
return PrefabAPI.InstantiateClone(Load<GameObject>(path), name, registerNetwork);
}
internal static GameObject Instantiate(GameObject obj, string name, bool registerNetwork = false)
{
return PrefabAPI.InstantiateClone(obj, name, registerNetwork);
}
}
internal static class Extensions
{
public static GameObject NewSyringe(this GameObject g, params Material[] m)
{
((Renderer)g.GetComponentsInChildren<MeshRenderer>(false)[0]).material = m[0];
((Renderer)g.GetComponent<TrailRenderer>()).material = m[1];
((Renderer)g.GetComponent<ParticleSystemRenderer>()).material = m[2];
return g;
}
public static Material SwapTexture(this Material m, Texture2D t)
{
m.mainTexture = (Texture)(object)t;
return m;
}
public static GameObject SwapMaterials(this GameObject g, Material[] m)
{
Renderer[] componentsInChildren = g.GetComponentsInChildren<Renderer>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
if (Object.op_Implicit((Object)(object)m[i]))
{
componentsInChildren[i].material = m[i];
}
}
return g;
}
public static float Mult(this float f, float mult = 100f)
{
return f * mult;
}
public static Color ToRGB255(this Color c, string title, string body)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
return new Color(c.r / 255f, c.g / 255f, c.b / 255f);
}
public static void SetStrings(this TooltipProvider t, string title, string body)
{
t.overrideTitleText = title;
t.overrideBodyText = body;
}
}
internal class Utils
{
public static int CalculateItemBonus(int float1, int float1Stack, int itemCount)
{
return float1 + float1Stack * (itemCount - 1);
}
public static float CalculateItemBonus(float float1, float float1Stack, int itemCount)
{
return float1 + float1Stack * (float)(itemCount - 1);
}
internal static void RecolorEffect(GameObject obj, Color color)
{
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)obj))
{
return;
}
OmniEffect component = obj.GetComponent<OmniEffect>();
if (Object.op_Implicit((Object)(object)component))
{
Object.DestroyImmediate((Object)(object)obj.GetComponent<OmniEffect>());
}
Renderer[] componentsInChildren = obj.GetComponentsInChildren<Renderer>(Object.op_Implicit((Object)(object)component));
for (int i = 0; i < componentsInChildren.Length; i++)
{
((Component)componentsInChildren[i]).gameObject.SetActive(true);
if (Object.op_Implicit((Object)(object)componentsInChildren[i].material) && componentsInChildren[i].material.HasProperty("_TintColor"))
{
componentsInChildren[i].material.SetColor("_TintColor", color);
}
}
}
public static Vector3 FindNearestNodePosition(Vector3 targetPosition, GraphType nodeGraphType)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: 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_0025: 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_002d: 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_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Expected O, but got Unknown
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Expected O, but got Unknown
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
SpawnCard val = ScriptableObject.CreateInstance<SpawnCard>();
val.hullSize = (HullClassification)1;
val.nodeGraphType = nodeGraphType;
val.prefab = Prefabs.Load<GameObject>("RoR2/Base/Common/DirectorSpawnProbeHelperPrefab.prefab");
Vector3 result = targetPosition;
GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, new DirectorPlacementRule
{
placementMode = (PlacementMode)3,
position = targetPosition
}, RoR2Application.rng));
if (Object.op_Implicit((Object)(object)val2))
{
result = val2.transform.position;
}
if (Object.op_Implicit((Object)(object)val2))
{
Object.Destroy((Object)(object)val2);
}
Object.Destroy((Object)(object)val);
return result;
}
public static Vector3 GetForwardDirection(Vector3 dir)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
Vector2 val = Util.Vector3XZToVector2XY(dir);
if (val != Vector2.zero)
{
((Vector2)(ref val)).Normalize();
Vector3 val2 = new Vector3(val.x, 0f, val.y);
return ((Vector3)(ref val2)).normalized;
}
return dir;
}
public static void PlayAnimation(GameObject g, string layerName, string animationStateName)
{
Animator component = g.GetComponent<Animator>();
if (Object.op_Implicit((Object)(object)component))
{
int layerIndex = component.GetLayerIndex(layerName);
component.speed = 1f;
component.Update(0f);
component.PlayInFixedTime(animationStateName, layerIndex, 0f);
}
}
public static void PlayAnimation(GameObject g, string layerName, string animationStateName, string playbackRateParam, float duration)
{
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
Animator component = g.GetComponent<Animator>();
if (Object.op_Implicit((Object)(object)component))
{
component.speed = 1f;
component.Update(0f);
int layerIndex = component.GetLayerIndex(layerName);
component.SetFloat(playbackRateParam, 1f);
component.PlayInFixedTime(animationStateName, layerIndex, 0f);
component.Update(0f);
AnimatorStateInfo currentAnimatorStateInfo = component.GetCurrentAnimatorStateInfo(layerIndex);
float length = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).length;
component.SetFloat(playbackRateParam, length / duration);
}
}
public static void AnimatorPlayAnimation(Animator modelAnimator, string layerName, string animationStateName)
{
int layerIndex = modelAnimator.GetLayerIndex(layerName);
modelAnimator.speed = 1f;
modelAnimator.Update(0f);
modelAnimator.PlayInFixedTime(animationStateName, layerIndex, 0f);
}
public static void AnimatorPlayAnimation(Animator modelAnimator, string layerName, string animationStateName, string playbackRateParam, float duration)
{
//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)
modelAnimator.speed = 1f;
modelAnimator.Update(0f);
int layerIndex = modelAnimator.GetLayerIndex(layerName);
modelAnimator.SetFloat(playbackRateParam, 1f);
modelAnimator.PlayInFixedTime(animationStateName, layerIndex, 0f);
modelAnimator.Update(0f);
AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
float length = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).length;
modelAnimator.SetFloat(playbackRateParam, length / duration);
}
public static SkillDef NewSkillDef<T>(Type activationState, string activationStateMachineName, int baseMaxStock, float baseRechargeInterval, bool beginSkillCooldownOnSkillEnd, bool canceledFromSprinting, bool fullRestockOnAssign, InterruptPriority interruptPriority, bool isCombatSkill, bool mustKeyPress, bool cancelSprintingOnActivation, int rechargeStock, int requiredStock, int stockToConsume, Sprite icon, string skillDescriptionToken, string skillName, params string[] keywordTokens) where T : SkillDef
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
T val = ScriptableObject.CreateInstance<T>();
((SkillDef)val).activationState = new SerializableEntityStateType(activationState);
((SkillDef)val).activationStateMachineName = activationStateMachineName;
((SkillDef)val).baseMaxStock = baseMaxStock;
((SkillDef)val).baseRechargeInterval = baseRechargeInterval;
((SkillDef)val).beginSkillCooldownOnSkillEnd = beginSkillCooldownOnSkillEnd;
((SkillDef)val).canceledFromSprinting = canceledFromSprinting;
((SkillDef)val).fullRestockOnAssign = fullRestockOnAssign;
((SkillDef)val).interruptPriority = interruptPriority;
((SkillDef)val).isCombatSkill = isCombatSkill;
((SkillDef)val).mustKeyPress = mustKeyPress;
((SkillDef)val).cancelSprintingOnActivation = cancelSprintingOnActivation;
((SkillDef)val).rechargeStock = rechargeStock;
((SkillDef)val).requiredStock = requiredStock;
((SkillDef)val).stockToConsume = stockToConsume;
((SkillDef)val).icon = icon;
((SkillDef)val).skillDescriptionToken = skillDescriptionToken;
((SkillDef)val).skillName = skillName;
((SkillDef)val).skillNameToken = ((SkillDef)val).skillName;
((SkillDef)val).keywordTokens = keywordTokens;
ContentAddition.AddSkillDef((SkillDef)(object)val);
return (SkillDef)(object)val;
}
public static Color HexTo10(string hexColor)
{
//IL_0025: 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_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: 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)
char[] array = hexColor.ToCharArray();
return new Color((float)(array[0] + array[1]), (float)(array[2] + array[3]), (float)(array[4] + array[5]), 255f) / 255f;
}
public static EntityStateMachine NewStateMachine<T>(GameObject obj, string customName) where T : EntityState
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
SerializableEntityStateType val = default(SerializableEntityStateType);
((SerializableEntityStateType)(ref val))..ctor(typeof(T));
EntityStateMachine val2 = obj.AddComponent<EntityStateMachine>();
val2.customName = customName;
val2.initialStateType = val;
val2.mainStateType = val;
return val2;
}
public static GenericSkill NewGenericSkill(GameObject obj, SkillDef skill)
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Expected O, but got Unknown
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
GenericSkill val = obj.AddComponent<GenericSkill>();
SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
val2.variants = (Variant[])(object)new Variant[1];
val._skillFamily = val2;
SkillFamily skillFamily = val.skillFamily;
Variant[] variants = skillFamily.variants;
Variant val3 = new Variant
{
skillDef = skill
};
((Variant)(ref val3)).viewableNode = new Node(skill.skillNameToken, false, (Node)null);
variants[0] = val3;
ContentAddition.AddSkillFamily(skillFamily);
return val;
}
public static void AddAlt(SkillFamily skillFamily, SkillDef SkillDef)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Expected O, but got Unknown
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
Variant[] variants = skillFamily.variants;
int num = skillFamily.variants.Length - 1;
Variant val = new Variant
{
skillDef = SkillDef
};
((Variant)(ref val)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null);
variants[num] = val;
}
public static BuffDef NewBuffDef(string name, bool stack, bool hidden, Sprite sprite, Color color)
{
//IL_0025: 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)
BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
((Object)val).name = name;
val.canStack = stack;
val.isHidden = hidden;
val.iconSprite = sprite;
val.buffColor = color;
ContentAddition.AddBuffDef(val);
return val;
}
public static ObjectScaleCurve AddScaleComponent(GameObject target, float timeMax)
{
ObjectScaleCurve val = target.AddComponent<ObjectScaleCurve>();
val.useOverallCurveOnly = true;
val.timeMax = timeMax;
val.overallCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f);
return val;
}
public static RotateAroundAxis AddRotationComponent(GameObject target, float speed, RotationAxis axis)
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
RotateAroundAxis val = target.AddComponent<RotateAroundAxis>();
val.speed = (Speed)2;
val.fastRotationSpeed = speed;
val.rotateAroundAxis = axis;
return val;
}
public static GameObject NewDisplayModel(GameObject model, string name)
{
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Expected O, but got Unknown
GameObject val = PrefabAPI.InstantiateClone(model, name, false);
Animator componentInChildren = val.GetComponentInChildren<Animator>();
componentInChildren.runtimeAnimatorController = Assets.Load<RuntimeAnimatorController>("displayAnimator");
((Behaviour)val.GetComponentInChildren<CharacterModel>()).enabled = false;
SkinnedMeshRenderer[] componentsInChildren = val.GetComponentsInChildren<SkinnedMeshRenderer>(true);
foreach (SkinnedMeshRenderer val2 in componentsInChildren)
{
((Renderer)val2).material = new Material(((Renderer)val2).material);
((Renderer)val2).material.DisableKeyword("DITHER");
}
return val;
}
public static AnimateShaderAlpha AddShaderAlphaComponent(GameObject target, float timeMax, AnimationCurve curve, bool destroyOnEnd = true, bool disableOnEnd = false)
{
AnimateShaderAlpha val = target.AddComponent<AnimateShaderAlpha>();
val.timeMax = timeMax;
val.alphaCurve = curve;
val.destroyOnEnd = destroyOnEnd;
val.disableOnEnd = disableOnEnd;
return val;
}
internal static Sprite CreateSprite(Texture2D tex)
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f), 128f);
}
internal static SkinDefInfo CreateNewSkinDefInfo(SkinnedMeshRenderer[] childList, GameObject rootObject, string skinName, string objectToEnable, RendererInfo[] rendererInfos, UnlockableDef unlockableDef = null)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
SkinDefInfo result = default(SkinDefInfo);
result.BaseSkins = Array.Empty<SkinDef>();
result.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0];
result.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0];
List<GameObjectActivation> list = new List<GameObjectActivation>();
foreach (SkinnedMeshRenderer val in childList)
{
GameObjectActivation val2 = default(GameObjectActivation);
val2.gameObject = ((Component)val).gameObject;
val2.shouldActivate = ((Object)val).name.Contains(objectToEnable);
GameObjectActivation item = val2;
list.Add(item);
}
result.GameObjectActivations = list.ToArray();
result.Icon = Assets.MainAssetBundle.LoadAsset<Sprite>(objectToEnable);
result.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0];
result.Name = skinName;
result.NameToken = skinName;
result.RendererInfos = rendererInfos;
result.RootObject = rootObject;
result.UnlockableDef = unlockableDef;
return result;
}
internal static T CopyComponent<T>(T original, GameObject destination) where T : Component
{
Type type = ((object)original).GetType();
Component val = destination.AddComponent(type);
FieldInfo[] fields = type.GetFields();
FieldInfo[] array = fields;
foreach (FieldInfo fieldInfo in array)
{
fieldInfo.SetValue(val, fieldInfo.GetValue(original));
}
return (T)(object)((val is T) ? val : null);
}
public static Sprite CreateSpriteFromTexture(Texture2D texture)
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)texture))
{
return Sprite.Create(texture, new Rect(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height), new Vector2(0.5f, 0.5f));
}
return null;
}
public static GameObject FindInActiveObjectByName(string name)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Invalid comparison between Unknown and I4
Transform[] array = Resources.FindObjectsOfTypeAll<Transform>();
for (int i = 0; i < array.Length; i++)
{
if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name)
{
return ((Component)array[i]).gameObject;
}
}
return null;
}
public static void CreateHitboxes(string name, Transform parent, Vector3[] sizes, Vector3[] positions)
{
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Expected O, but got Unknown
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
HitBoxGroup val = ((Component)parent).gameObject.AddComponent<HitBoxGroup>();
val.groupName = name;
List<HitBox> list = new List<HitBox>();
for (int i = 0; i < sizes.Length; i++)
{
GameObject val2 = new GameObject(name + (i + 1));
val2.transform.SetParent(parent);
val2.transform.localPosition = positions[i];
val2.transform.localRotation = Quaternion.Euler(Vector3.forward * 45f);
val2.transform.localScale = sizes[i];
HitBox item = val2.AddComponent<HitBox>();
val2.layer = LayerIndex.projectile.intVal;
list.Add(item);
}
val.hitBoxes = list.ToArray();
}
public static GameObject CreateHitbox(string name, Transform parent, Vector3 scale, Vector3 localPosition)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject(name);
val.transform.SetParent(parent);
val.transform.localPosition = localPosition;
val.transform.localRotation = Quaternion.Euler(Vector3.forward * 45f);
val.transform.localScale = scale;
HitBoxGroup val2 = ((Component)parent).gameObject.AddComponent<HitBoxGroup>();
HitBox val3 = val.AddComponent<HitBox>();
val.layer = LayerIndex.projectile.intVal;
val2.hitBoxes = (HitBox[])(object)new HitBox[1] { val3 };
val2.groupName = name;
return val;
}
internal static EffectComponent RegisterEffect(GameObject effect, float duration, string soundName = "", bool applyScale = false, bool parentToReferencedTransform = true, bool positionAtReferencedTransform = true)
{
//IL_00a6: 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)
EffectComponent val = effect.GetComponent<EffectComponent>();
if (!Object.op_Implicit((Object)(object)val))
{
val = effect.AddComponent<EffectComponent>();
}
if (duration != -1f)
{
DestroyOnTimer component = effect.GetComponent<DestroyOnTimer>();
if (!Object.op_Implicit((Object)(object)component))
{
effect.AddComponent<DestroyOnTimer>().duration = duration;
}
else
{
component.duration = duration;
}
}
if (!Object.op_Implicit((Object)(object)effect.GetComponent<NetworkIdentity>()))
{
effect.AddComponent<NetworkIdentity>();
}
if (!Object.op_Implicit((Object)(object)effect.GetComponent<VFXAttributes>()))
{
effect.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
}
val.applyScale = applyScale;
val.effectIndex = (EffectIndex)(-1);
val.parentToReferencedTransform = parentToReferencedTransform;
val.positionAtReferencedTransform = positionAtReferencedTransform;
val.soundName = soundName;
ContentAddition.AddEffect(effect);
return val;
}
public static Material InstantiateMaterial(Texture tex)
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
Material val = Object.Instantiate<Material>(Prefabs.Load<Material>("RoR2/Base/Commando/matCommandoDualies.mat"));
if (Object.op_Implicit((Object)(object)val))
{
val.SetColor("_Color", Color.white);
val.SetTexture("_MainTex", tex);
val.SetColor("_EmColor", Color.black);
val.SetFloat("_EmPower", 0f);
val.SetTexture("_EmTex", (Texture)null);
val.SetFloat("_NormalStrength", 1f);
val.SetTexture("_NormalTex", (Texture)null);
return val;
}
return val;
}
public static Material InstantiateMaterial(Color color, Texture tex, Color emColor, float emPower, Texture emTex, float normStr, Texture normTex)
{
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
Material val = Object.Instantiate<Material>(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<CharacterModel>().baseRendererInfos[0].defaultMaterial);
if (Object.op_Implicit((Object)(object)val))
{
val.SetColor("_Color", color);
val.SetTexture("_MainTex", tex);
val.SetColor("_EmColor", emColor);
val.SetFloat("_EmPower", emPower);
val.SetTexture("_EmTex", emTex);
val.SetFloat("_NormalStrength", 1f);
val.SetTexture("_NormalTex", normTex);
return val;
}
return val;
}
public static Material FindMaterial(string name)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Invalid comparison between Unknown and I4
Material[] array = Resources.FindObjectsOfTypeAll<Material>();
for (int i = 0; i < array.Length; i++)
{
if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name)
{
return array[i];
}
}
return null;
}
}