using System;
using System.Collections.Generic;
using System.Diagnostics;
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.Logging;
using EntityStates.TitanMonster;
using Microsoft.CodeAnalysis;
using On.RoR2;
using On.RoR2.Items;
using R2API;
using RoR2;
using RoR2.Items;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
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("DarknessExpansion")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+0bdda48187651f8e76952178dcb8e13e32ad70d6")]
[assembly: AssemblyProduct("DarknessExpansion")]
[assembly: AssemblyTitle("DarknessExpansion")]
[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.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace DarknessExpansion
{
public class BigArtifact
{
public static ArtifactDef bigArtifact;
public static Sprite iconDisabled = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/EliteOnly/texArtifactEliteOnlyDisabled.png").WaitForCompletion();
public static Sprite iconEnabled = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/EliteOnly/texArtifactEliteOnlyEnabled.png").WaitForCompletion();
public BigArtifact()
{
bigArtifact = ScriptableObject.CreateInstance<ArtifactDef>();
bigArtifact.nameToken = "Artifact of Size";
bigArtifact.descriptionToken = "Everything is Bigger";
bigArtifact.smallIconDeselectedSprite = iconDisabled;
bigArtifact.smallIconSelectedSprite = iconEnabled;
ContentAddition.AddArtifactDef(bigArtifact);
SpawnCard.onSpawnedServerGlobal += SpawnCardOnonSpawnedServerGlobal;
}
private void SpawnCardOnonSpawnedServerGlobal(SpawnResult obj)
{
//IL_0001: 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_0034: 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_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)obj.spawnedInstance) && RunArtifactManager.instance.IsArtifactEnabled(bigArtifact))
{
Transform transform = obj.spawnedInstance.transform;
transform.localScale *= 3f;
CharacterMaster component = obj.spawnedInstance.GetComponent<CharacterMaster>();
if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.GetBody()))
{
Transform transform2 = component.GetBody().transform;
transform2.localScale *= 3f;
}
}
}
}
[BepInPlugin("com.cybug.Joke_Artifacts", "Joke_Artifacts", "1.0.2")]
[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.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class DarknessExpansion : BaseUnityPlugin
{
private void Awake()
{
Log.Init(((BaseUnityPlugin)this).Logger);
new BigArtifact();
new RandomArtifact();
}
}
public class Darkness
{
public static EliteDef DarknessElite;
public static EquipmentDef DarknessEquipment;
public static BuffDef DarknessBuff;
public static int DarknessLevel = 0;
private static Sprite eliteIcon = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/EliteFire/texBuffAffixRed.tif").WaitForCompletion();
public static event Action<int> onDarknessLevelChange;
public Darkness()
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: 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_01b1: Unknown result type (might be due to invalid IL or missing references)
//IL_01bb: Expected O, but got Unknown
DarknessElite = ScriptableObject.CreateInstance<EliteDef>();
DarknessElite.color = Color32.op_Implicit(new Color(0f, 0f, 0f, 255f));
EliteRamp.AddRamp(DarknessElite, CreateDarknessTexture());
((Object)DarknessElite).name = "EliteDarkness";
DarknessElite.modifierToken = "Dark {0}";
DarknessBuff = ScriptableObject.CreateInstance<BuffDef>();
((Object)DarknessBuff).name = "DarknessBuff";
DarknessBuff.canStack = false;
DarknessBuff.isCooldown = false;
DarknessBuff.isDebuff = false;
DarknessBuff.buffColor = new Color(0f, 0f, 0f, 255f);
DarknessBuff.iconSprite = eliteIcon;
DarknessEquipment = ScriptableObject.CreateInstance<EquipmentDef>();
DarknessEquipment.appearsInMultiPlayer = true;
DarknessEquipment.appearsInSinglePlayer = true;
DarknessEquipment.canBeRandomlyTriggered = false;
DarknessEquipment.canDrop = false;
DarknessEquipment.colorIndex = (ColorIndex)5;
DarknessEquipment.cooldown = 0f;
DarknessEquipment.isLunar = false;
DarknessEquipment.isBoss = false;
DarknessEquipment.passiveBuffDef = DarknessBuff;
DarknessEquipment.dropOnDeathChance = 0f;
DarknessEquipment.enigmaCompatible = false;
DarknessElite.eliteEquipmentDef = DarknessEquipment;
DarknessBuff.eliteDef = DarknessElite;
ContentAddition.AddEliteDef(DarknessElite);
ContentAddition.AddBuffDef(DarknessBuff);
ContentAddition.AddEquipmentDef(DarknessEquipment);
UpdateDarkness();
CombatDirector.Spawn += new hook_Spawn(CombatDirectorOnSpawn);
SpawnCard.onSpawnedServerGlobal += SpawnCardOnonSpawnedServerGlobal;
Run.onRunStartGlobal += delegate
{
DarknessLevel = 0;
};
}
private void SpawnCardOnonSpawnedServerGlobal(SpawnResult obj)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
Inventory component = obj.spawnedInstance.GetComponent<Inventory>();
if ((Object)(object)component != (Object)null && component.GetEquipmentIndex() == DarknessEquipment.equipmentIndex)
{
float num = (float)DarknessLevel / 10f;
if (Random.value < num)
{
List<ItemDef> darkItems = DarknessItems.darkItems;
component.GiveItem(darkItems[(int)((float)darkItems.Count * Random.value)], 1);
Log.Debug("Giving Item");
}
}
}
public static Texture2D CreateDarknessTexture()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: Unknown result type (might be due to invalid IL or missing references)
Texture2D val = new Texture2D(256, 8);
((Texture)val).wrapMode = (TextureWrapMode)1;
for (int i = 0; i < 8; i++)
{
for (int j = 0; j < 50; j++)
{
val.SetPixel(j, i, new Color(0f, 0f, (float)j / 255f, 255f));
}
for (int k = 0; k < 50; k++)
{
val.SetPixel(k + 50, i, new Color(0f, 0f, 10f / 51f - (float)k / 255f, 255f));
}
for (int l = 0; l < 50; l++)
{
val.SetPixel(l + 100, i, new Color((float)l / 255f, 0f, (float)l / 255f, 255f));
}
for (int m = 0; m < 50; m++)
{
val.SetPixel(m + 150, i, new Color(10f / 51f - (float)m / 255f, 0f, 10f / 51f - (float)m / 255f, 255f));
}
for (int n = 0; n < 56; n++)
{
val.SetPixel(n + 200, i, new Color(0f, (float)n / 255f, 0f, 255f));
}
}
val.Apply();
return val;
}
private bool CombatDirectorOnSpawn(orig_Spawn orig, CombatDirector self, SpawnCard spawncard, EliteDef elitedef, Transform spawntarget, MonsterSpawnDistance spawndistance, bool preventoverhead, float valuemultiplier, PlacementMode placementmode)
{
//IL_003b: 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)
float num = (float)(DarknessLevel * DarknessLevel) / 100f;
if (Random.value < num)
{
elitedef = DarknessElite;
Log.Debug("Changing Elite Type");
}
return orig.Invoke(self, spawncard, elitedef, spawntarget, spawndistance, preventoverhead, valuemultiplier, placementmode);
}
public static void UpdateDarkness()
{
DarknessElite.healthBoostCoefficient = 1f + Mathf.Sqrt((float)DarknessLevel);
DarknessElite.damageBoostCoefficient = 1f + (DarknessElite.healthBoostCoefficient - 1f) / 2f;
if (Darkness.onDarknessLevelChange != null)
{
Darkness.onDarknessLevelChange(DarknessLevel);
}
}
}
public class DarknessArtifact
{
public static ArtifactDef darknessArtifact;
public static Sprite iconDisabled = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/EliteOnly/texArtifactEliteOnlyDisabled.png").WaitForCompletion();
public static Sprite iconEnabled = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/EliteOnly/texArtifactEliteOnlyEnabled.png").WaitForCompletion();
public DarknessArtifact()
{
darknessArtifact = ScriptableObject.CreateInstance<ArtifactDef>();
darknessArtifact.nameToken = "Artifact of Darkness";
darknessArtifact.descriptionToken = "Start with the world partially consumed with darkness.";
darknessArtifact.smallIconDeselectedSprite = iconDisabled;
darknessArtifact.smallIconSelectedSprite = iconEnabled;
ContentAddition.AddArtifactDef(darknessArtifact);
Run.onRunStartGlobal += RunOnonRunStartGlobal;
}
private void RunOnonRunStartGlobal(Run obj)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Invalid comparison between Unknown and I4
if (!RunArtifactManager.instance.IsArtifactEnabled(darknessArtifact))
{
return;
}
Darkness.DarknessLevel += 3;
Darkness.UpdateDarkness();
foreach (CharacterMaster instances in CharacterMaster.instancesList)
{
List<ItemDef> darkItems = DarknessItems.darkItems;
if ((int)instances._teamIndex == 1)
{
instances.inventory.GiveItem(darkItems[(int)((float)darkItems.Count * Random.value)], 1);
}
}
}
}
public class DarknessItems
{
public class DarkStacksItem
{
private Sprite darkGolemSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Knurl/texKnurlIcon.png").WaitForCompletion();
private GameObject darkGolemPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Knurl/PickupKnurl.prefab").WaitForCompletion();
public DarkStacksItem()
{
//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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
stackingDarkItem = ScriptableObject.CreateInstance<ItemDef>();
((Object)stackingDarkItem).name = "DARK_STACK_NAME";
stackingDarkItem.descriptionToken = "DARK_STACK_DESCRIPTION";
stackingDarkItem.nameToken = "DARK_STACK_NAME";
stackingDarkItem.loreToken = "DARK_STACK_LORE";
stackingDarkItem.pickupToken = "DARK_STACK_PICKUP";
stackingDarkItem.pickupIconSprite = darkGolemSprite;
stackingDarkItem.pickupModelPrefab = darkGolemPickup;
stackingDarkItem.canRemove = false;
stackingDarkItem.hidden = true;
stackingDarkItem._itemTierDef = darkTier;
ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
stackingDarkItem.itemIndex = (ItemIndex)0;
ItemAPI.Add(new CustomItem(stackingDarkItem, val));
}
}
public class DarkGolemItem
{
public static ItemDef darkGolemItem;
private Sprite darkGolemSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Knurl/texKnurlIcon.png").WaitForCompletion();
private GameObject darkGolemPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Knurl/PickupKnurl.prefab").WaitForCompletion();
private GameObject fistProjectilePrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Titan/TitanPreFistProjectile.prefab").WaitForCompletion(), "Dark Fist");
public DarkGolemItem()
{
//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_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Expected O, but got Unknown
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: Expected O, but got Unknown
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Expected O, but got Unknown
darkGolemItem = ScriptableObject.CreateInstance<ItemDef>();
((Object)darkGolemItem).name = "DARK_GOLEM_NAME";
darkGolemItem.descriptionToken = "DARK_GOLEM_DESCRIPTION";
darkGolemItem.nameToken = "DARK_GOLEM_NAME";
darkGolemItem.loreToken = "DARK_GOLEM_LORE";
darkGolemItem.pickupToken = "DARK_GOLEM_PICKUP";
darkGolemItem.pickupIconSprite = darkGolemSprite;
darkGolemItem.pickupModelPrefab = darkGolemPickup;
darkGolemItem.canRemove = true;
darkGolemItem.hidden = false;
darkGolemItem._itemTierDef = darkTier;
ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
darkGolemItem.itemIndex = (ItemIndex)0;
ItemAPI.Add(new CustomItem(darkGolemItem, val));
HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(HealthComponentOnTakeDamageProcess);
LanguageAPI.Add("DARK_GOLEM_NAME", "Titanic Boulder");
LanguageAPI.Add("DARK_GOLEM_DESCRIPTION", "Gives 100 (+100 per stack) health and 10 (+10 per stack) regen. Upon taking damage, 20% chance to summon a fist for 200% (+200% per stack) damage + 100% damage (+100% per stack) per 500 health. Gives 5 (+5 per stack) health and 1 (+1 per stack) regen upon killing a dark enemy.");
LanguageAPI.Add("DARK_GOLEM_PICKUP", "Increases health and regen. Upon taking damage, chance to summon a fist. Fist damage scales with health. Grows stronger as it absorbs darkness.");
darkItems.Add(darkGolemItem);
}
private void HealthComponentOnTakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageinfo)
{
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Invalid comparison between Unknown and I4
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_0158: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)self.body.inventory))
{
int itemCount = self.body.inventory.GetItemCount(darkGolemItem);
if (itemCount > 0 && Util.CheckRoll(20f, self.body._master))
{
bool crit = self.body.RollCrit();
float damage = self.body.damage * (self.body.maxHealth + 1000f) * (float)itemCount / 500f;
if ((int)self.body.teamComponent.teamIndex != 1)
{
damage = self.body.damage * (self.body.maxHealth + 10000f) * (float)itemCount / 5000f;
}
FireProjectileInfo val = default(FireProjectileInfo);
val.projectilePrefab = fistProjectilePrefab;
val.position = damageinfo.attacker.transform.position;
val.rotation = Quaternion.identity;
val.owner = ((Component)self.body).gameObject;
val.damage = damage;
val.force = FireFist.fistForce;
val.crit = crit;
val._fuseOverride = FireFist.entryDuration - FireFist.trackingDuration + 2f;
ProjectileManager.instance.FireProjectile(val);
}
}
orig.Invoke(self, damageinfo);
}
}
public class DarkPearlItem
{
public static ItemDef darkPearlItem;
private Sprite darkPearlSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Pearl/texPearlIcon.png").WaitForCompletion();
private GameObject darkPearlPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Pearl/PickupPearl.prefab").WaitForCompletion();
public DarkPearlItem()
{
//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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
darkPearlItem = ScriptableObject.CreateInstance<ItemDef>();
((Object)darkPearlItem).name = "DARK_PEARL_NAME";
darkPearlItem.descriptionToken = "DARK_PEARL_DESCRIPTION";
darkPearlItem.nameToken = "DARK_PEARL_NAME";
darkPearlItem.loreToken = "DARK_PEARL_LORE";
darkPearlItem.pickupToken = "DARK_PEARL_PICKUP";
darkPearlItem.pickupIconSprite = darkPearlSprite;
darkPearlItem.pickupModelPrefab = darkPearlPickup;
darkPearlItem.canRemove = true;
darkPearlItem.hidden = false;
darkPearlItem._itemTierDef = darkTier;
ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
darkPearlItem.itemIndex = (ItemIndex)0;
ItemAPI.Add(new CustomItem(darkPearlItem, val));
LanguageAPI.Add("DARK_PEARL_NAME", "Dark Pearl");
LanguageAPI.Add("DARK_PEARL_DESCRIPTION", "Increases maximum health by 50% (+50% per stack). Upon killing a dark enemy, increases health by 2% (+2% per stack).");
LanguageAPI.Add("DARK_PEARL_PICKUP", "Increases health. Grows stronger as it absorbs darkness.");
darkItems.Add(darkPearlItem);
}
}
public class DarkPearlItem2
{
public static ItemDef darkPearlItem;
private Sprite darkPearlSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/ShinyPearl/texShinyPearlIcon.png").WaitForCompletion();
private GameObject darkPearlPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShinyPearl/PickupShinyPearl.prefab").WaitForCompletion();
public DarkPearlItem2()
{
//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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
darkPearlItem = ScriptableObject.CreateInstance<ItemDef>();
((Object)darkPearlItem).name = "DARK_PEARL_NAME2";
darkPearlItem.descriptionToken = "DARK_PEARL_DESCRIPTION2";
darkPearlItem.nameToken = "DARK_PEARL_NAME2";
darkPearlItem.loreToken = "DARK_PEARL_LORE2";
darkPearlItem.pickupToken = "DARK_PEARL_PICKUP2";
darkPearlItem.pickupIconSprite = darkPearlSprite;
darkPearlItem.pickupModelPrefab = darkPearlPickup;
darkPearlItem.canRemove = true;
darkPearlItem.hidden = false;
darkPearlItem._itemTierDef = darkTier;
ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
darkPearlItem.itemIndex = (ItemIndex)0;
ItemAPI.Add(new CustomItem(darkPearlItem, val));
LanguageAPI.Add("DARK_PEARL_NAME2", "Dark Irradient Pearl");
LanguageAPI.Add("DARK_PEARL_DESCRIPTION2", "Increases all stats by 50% (+50% per stack). Upon killing a dark enemy, increases all stats by 1% (+1% per stack).");
LanguageAPI.Add("DARK_PEARL_PICKUP2", "Increases all stats. Grows stronger as it absorbs darkness.");
darkItems.Add(darkPearlItem);
}
}
public class DarkBleedItem
{
public static ItemDef darkBleedItem;
private Sprite darkBleedSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/BleedOnHitAndExplode/texBleedOnHitAndExplodeIcon.png").WaitForCompletion();
private GameObject darkBleedPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/BleedOnHitAndExplode/DisplayBleedOnHitAndExplode.prefab").WaitForCompletion();
public DarkBleedItem()
{
//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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Expected O, but got Unknown
darkBleedItem = ScriptableObject.CreateInstance<ItemDef>();
((Object)darkBleedItem).name = "DARK_BLEED_NAME";
darkBleedItem.descriptionToken = "DARK_BLEED_DESCRIPTION";
darkBleedItem.nameToken = "DARK_BLEED_NAME";
darkBleedItem.loreToken = "DARK_BLEED_LORE";
darkBleedItem.pickupToken = "DARK_BLEED_PICKUP";
darkBleedItem.pickupIconSprite = darkBleedSprite;
darkBleedItem.pickupModelPrefab = darkBleedPickup;
darkBleedItem.canRemove = true;
darkBleedItem.hidden = false;
darkBleedItem._itemTierDef = darkTier;
ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
darkBleedItem.itemIndex = (ItemIndex)0;
ItemAPI.Add(new CustomItem(darkBleedItem, val));
LanguageAPI.Add("DARK_BLEED_NAME", "Dark Shatterspleen");
LanguageAPI.Add("DARK_BLEED_DESCRIPTION", "Gain 20% critical chance. All strikes apply 1 stack of bleed. Crits apply bonus bleed based on crit damage. Bleeding enemies explode on death for 100% damage (+100% per stack) damage per bleed stack + 15% (+15% per stack) of their max health. Upon killing a dark enemy, gain 3% (+3% per stack) crit damage.");
LanguageAPI.Add("DARK_BLEED_PICKUP", "All hits apply bleed, and crits apply extra. Bleeding enemies explode, dealing damage to nearby enemies. Grows stronger as it absorbs darkness.");
GlobalEventManager.ProcessHitEnemy += new hook_ProcessHitEnemy(GlobalEventManagerOnProcessHitEnemy);
GlobalEventManager.onCharacterDeathGlobal += GlobalEventManagerOnonCharacterDeathGlobal;
darkItems.Add(darkBleedItem);
}
private void GlobalEventManagerOnonCharacterDeathGlobal(DamageReport obj)
{
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: 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_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: 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_0182: 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_0197: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)obj.attacker) && Object.op_Implicit((Object)(object)obj.attackerBody) && Object.op_Implicit((Object)(object)obj.attackerBody.inventory))
{
int itemCount = obj.attackerBody.inventory.GetItemCount(darkBleedItem);
if ((itemCount > 0 && obj.victimBody.HasBuff(Buffs.Bleeding)) || obj.victimBody.HasBuff(Buffs.SuperBleed))
{
Util.PlaySound("Play_bleedOnCritAndExplode_explode", ((Component)obj.victimBody).gameObject);
Vector3 position = obj.victimBody.transform.position;
float num = 1f * (float)itemCount * (float)(obj.victimBody.GetBuffCount(Buffs.Bleeding) + 3);
float num2 = 0.15f * (float)itemCount;
float baseDamage = Util.OnKillProcDamage(obj.attackerBody.damage, num) + obj.victimBody.maxHealth * num2;
GameObject val = Object.Instantiate<GameObject>(CommonAssets.bleedOnHitAndExplodeBlastEffect, position, Quaternion.identity);
DelayBlast component = val.GetComponent<DelayBlast>();
component.position = position;
component.baseDamage = baseDamage;
component.baseForce = 0f;
component.radius = 16f;
component.attacker = obj.attacker;
component.inflictor = null;
component.crit = Util.CheckRoll(obj.attackerBody.crit, obj.attackerMaster);
component.maxTimer = 0f;
component.damageColorIndex = (DamageColorIndex)3;
component.falloffModel = (FalloffModel)2;
val.GetComponent<TeamFilter>().teamIndex = obj.attackerTeamIndex;
NetworkServer.Spawn(val);
}
}
}
private void GlobalEventManagerOnProcessHitEnemy(orig_ProcessHitEnemy orig, GlobalEventManager self, DamageInfo damageinfo, GameObject victim)
{
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self, damageinfo, victim);
if (!Object.op_Implicit((Object)(object)damageinfo.attacker) || !(damageinfo.procCoefficient > 0f))
{
return;
}
CharacterBody component = damageinfo.attacker.GetComponent<CharacterBody>();
if (!Object.op_Implicit((Object)(object)component))
{
return;
}
CharacterMaster master = component.master;
if (!Object.op_Implicit((Object)(object)master) || ((ProcChainMask)(ref damageinfo.procChainMask)).HasProc((ProcType)5))
{
return;
}
Inventory inventory = master.inventory;
int itemCount = inventory.GetItemCount(darkBleedItem);
if (itemCount > 0)
{
ProcChainMask procChainMask = damageinfo.procChainMask;
((ProcChainMask)(ref procChainMask)).AddProc((ProcType)5);
int num = 1;
if (damageinfo.crit)
{
num *= (int)component.critMultiplier;
}
for (int i = 0; i < num; i++)
{
DotController.InflictDot(victim, damageinfo.attacker, (DotIndex)0, 3f * damageinfo.procCoefficient, 1f, (uint?)null);
}
}
}
}
public class DarkBeetleItem
{
public class DarkBeetleBodyBehavior : BaseItemBodyBehavior
{
private CharacterMaster cm;
private float guardResummonCooldown;
[ItemDefAssociation(useOnServer = true, useOnClient = false)]
private static ItemDef GetItemDef()
{
return darkBeetleItem;
}
private void Start()
{
cm = ((BaseItemBodyBehavior)this).body.master;
guardResummonCooldown = 0f;
}
private void FixedUpdate()
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: 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_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Expected O, but got Unknown
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Expected O, but got Unknown
int deployableCount = cm.GetDeployableCount((DeployableSlot)2);
if (deployableCount >= base.stack)
{
return;
}
guardResummonCooldown -= Time.fixedDeltaTime;
if (guardResummonCooldown <= 0f)
{
DirectorSpawnRequest val = new DirectorSpawnRequest(LegacyResourcesAPI.Load<SpawnCard>("SpawnCards/CharacterSpawnCards/cscBeetleGuardAlly"), new DirectorPlacementRule
{
placementMode = (PlacementMode)1,
minDistance = 3f,
maxDistance = 40f,
spawnOnTarget = ((Component)this).transform
}, RoR2Application.rng);
val.summonerBodyObject = ((Component)this).gameObject;
val.onSpawnedServer = OnSpawned;
DirectorCore.instance.TrySpawnObject(val);
if (deployableCount < base.stack)
{
guardResummonCooldown = 1f;
}
else
{
guardResummonCooldown = 30f;
}
}
}
private void OnSpawned(SpawnResult obj)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: 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)
Deployable component = obj.spawnedInstance.GetComponent<Deployable>();
cm.AddDeployable(component, (DeployableSlot)2);
CharacterBody body = obj.spawnedInstance.GetComponent<CharacterMaster>().GetBody();
body.baseDamage *= (float)(base.stack * 3);
CharacterBody body2 = obj.spawnedInstance.GetComponent<CharacterMaster>().GetBody();
body2.baseMaxHealth *= (float)(base.stack * 3);
for (int i = 0; i < base.stack; i++)
{
obj.spawnedInstance.GetComponent<CharacterMaster>().GetBody().AddBuff(debuffApplier);
}
}
}
public static ItemDef darkBeetleItem;
private Sprite darkBeetleSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/BeetleGland/texBeetleGlandIcon.png").WaitForCompletion();
private GameObject darkBeetlePickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/BeetleGland/PickupBeetleGland.prefab").WaitForCompletion();
private static BuffDef debuffApplier;
public DarkBeetleItem()
{
//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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
//IL_017e: Unknown result type (might be due to invalid IL or missing references)
//IL_0188: Expected O, but got Unknown
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_019a: Expected O, but got Unknown
darkBeetleItem = ScriptableObject.CreateInstance<ItemDef>();
((Object)darkBeetleItem).name = "DARK_BEETLE_NAME";
darkBeetleItem.descriptionToken = "DARK_BEETLE_DESCRIPTION";
darkBeetleItem.nameToken = "DARK_BEETLE_NAME";
darkBeetleItem.loreToken = "DARK_BEETLE_LORE";
darkBeetleItem.pickupToken = "DARK_BEETLE_PICKUP";
darkBeetleItem.pickupIconSprite = darkBeetleSprite;
darkBeetleItem.pickupModelPrefab = darkBeetlePickup;
darkBeetleItem.canRemove = true;
darkBeetleItem.hidden = false;
darkBeetleItem._itemTierDef = darkTier;
ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
darkBeetleItem.itemIndex = (ItemIndex)0;
ItemAPI.Add(new CustomItem(darkBeetleItem, val));
LanguageAPI.Add("DARK_BEETLE_NAME", "King's Gland");
LanguageAPI.Add("DARK_BEETLE_DESCRIPTION", "Every 30 seconds, summon a Beetle Guard with 300% (+300% per stack) damage and 300% (+300% per stack) health. Beetle Guards apply 1 (+1 per stack) debuff on hit. Can have up to 1 (+1 per stack) beetle guard at a time. Give your beetles your attack speed. Upon killing a dark enemy, gain 3% (+3% per stack) attack speed.");
LanguageAPI.Add("DARK_BEETLE_PICKUP", "Summon a beetle guard which applies random debuffs on hit. Grows stronger as it absorbs darkness.");
darkItems.Add(darkBeetleItem);
debuffApplier = ScriptableObject.CreateInstance<BuffDef>();
debuffApplier.isHidden = true;
debuffApplier.canStack = true;
debuffApplier.isCooldown = false;
ContentAddition.AddBuffDef(debuffApplier);
testItem = darkBeetleItem;
GlobalEventManager.ProcessHitEnemy += new hook_ProcessHitEnemy(GlobalEventManagerOnProcessHitEnemy);
CharacterMaster.GetDeployableSameSlotLimit += new hook_GetDeployableSameSlotLimit(CharacterMasterOnGetDeployableSameSlotLimit);
MasterSummon.onServerMasterSummonGlobal += MasterSummonOnonServerMasterSummonGlobal;
}
private void MasterSummonOnonServerMasterSummonGlobal(MasterSummonReport obj)
{
//IL_0001: 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_003e: Unknown result type (might be due to invalid IL or missing references)
if (obj.leaderMasterInstance.inventory.GetItemCount(darkBeetleItem) > 0)
{
float attackSpeed = obj.leaderMasterInstance.GetBody().attackSpeed;
int num = (int)((attackSpeed - 1f) / 0.15f);
obj.summonMasterInstance.inventory.GiveItemString("Syringe", num);
}
}
private int CharacterMasterOnGetDeployableSameSlotLimit(orig_GetDeployableSameSlotLimit orig, CharacterMaster self, DeployableSlot slot)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Invalid comparison between Unknown and I4
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
if ((int)slot == 2)
{
int num = 1;
if (RunArtifactManager.instance.IsArtifactEnabled(Artifacts.swarmsArtifactDef))
{
num = 2;
}
return num * (self.inventory.GetItemCount(Items.BeetleGland) + self.inventory.GetItemCount(darkBeetleItem));
}
return orig.Invoke(self, slot);
}
private void GlobalEventManagerOnProcessHitEnemy(orig_ProcessHitEnemy orig, GlobalEventManager self, DamageInfo damageinfo, GameObject victim)
{
CharacterBody component = damageinfo.attacker.GetComponent<CharacterBody>();
if (component.HasBuff(debuffApplier))
{
int buffCount = component.GetBuffCount(debuffApplier);
for (int i = 0; i < buffCount; i++)
{
CharacterBody component2 = victim.GetComponent<CharacterBody>();
BuffDef val = BuffCatalog.buffDefs[(int)((float)BuffCatalog.buffDefs.Length * Random.value)];
while (!val.isDebuff)
{
val = BuffCatalog.buffDefs[(int)((float)BuffCatalog.buffDefs.Length * Random.value)];
}
component2.AddBuff(val);
}
}
orig.Invoke(self, damageinfo, victim);
}
}
public class DarkJellyfishItem
{
public static ItemDef darkJellyfishItem;
private Sprite darkJellyfishSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/NovaOnLowHealth/texJellyGutsIcon.png").WaitForCompletion();
private GameObject darkJellyfishPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/NovaOnLowHealth/PickupJellyGuts.prefab").WaitForCompletion();
public DarkJellyfishItem()
{
//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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
darkJellyfishItem = ScriptableObject.CreateInstance<ItemDef>();
((Object)darkJellyfishItem).name = "DARK_JELLYFISH_NAME";
darkJellyfishItem.descriptionToken = "DARK_JELLYFISH_DESCRIPTION";
darkJellyfishItem.nameToken = "DARK_JELLYFISH_NAME";
darkJellyfishItem.loreToken = "DARK_JELLYFISH_LORE";
darkJellyfishItem.pickupToken = "DARK_JELLYFISH_PICKUP";
darkJellyfishItem.pickupIconSprite = darkJellyfishSprite;
darkJellyfishItem.pickupModelPrefab = darkJellyfishPickup;
darkJellyfishItem.canRemove = true;
darkJellyfishItem.hidden = false;
darkJellyfishItem._itemTierDef = darkTier;
ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
darkJellyfishItem.itemIndex = (ItemIndex)0;
ItemAPI.Add(new CustomItem(darkJellyfishItem, val));
LanguageAPI.Add("DARK_JELLYFISH_NAME", "Omega Loop");
LanguageAPI.Add("DARK_JELLYFISH_DESCRIPTION", "When below 50% health, every 30 / 2 (+1 per stack) seconds, charge an explosion, dealing 6000% damage (+6000% per stack). Additionally, gain 3 (+3 per stack) charges. Upon using your secondary, release a ball of lightning that deaals 500% base damage (+500% per stack). Upon killing a dark enemy, gain 1% (+1% per stack) cooldown reduction, which affects this item.");
LanguageAPI.Add("DARK_JELLYFISH_PICKUP", "Upon reaching low health, explode in an area. Upon using your secondary, release a ball of lightning. Grows stronger as it absorbs darkness.");
darkItems.Add(darkJellyfishItem);
}
}
public class DarkWispItem
{
public static ItemDef darkWispItem;
private Sprite darkWispSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/SprintWisp/texBrokenMaskIcon.png").WaitForCompletion();
private GameObject darkWispPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/SprintWisp/PickupBrokenMask.prefab").WaitForCompletion();
public DarkWispItem()
{
//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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
darkWispItem = ScriptableObject.CreateInstance<ItemDef>();
((Object)darkWispItem).name = "DARK_WISP_NAME";
darkWispItem.descriptionToken = "DARK_WISP_DESCRIPTION";
darkWispItem.nameToken = "DARK_WISP_NAME";
darkWispItem.loreToken = "DARK_WISP_LORE";
darkWispItem.pickupToken = "DARK_WISP_PICKUP";
darkWispItem.pickupIconSprite = darkWispSprite;
darkWispItem.pickupModelPrefab = darkWispPickup;
darkWispItem.canRemove = true;
darkWispItem.hidden = false;
darkWispItem._itemTierDef = darkTier;
ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
darkWispItem.itemIndex = (ItemIndex)0;
ItemAPI.Add(new CustomItem(darkWispItem, val));
LanguageAPI.Add("DARK_WISP_NAME", "Large Disciple");
LanguageAPI.Add("DARK_WISP_DESCRIPTION", "Fire 3 (+3 per stack) tracking wisps for 300% (+300% per stack) base damage. Wisps have 3.0 (+3 per stack) proc coefficient. Fires every 1.6 seconds while sprinting. Fire rate increases with movement speed. Upon killing a dark enemy, gain 3% (+3% per stack) movement speed.");
LanguageAPI.Add("DARK_WISP_PICKUP", "Fire 3 tracking wisps while sprinting. Fire rate scales with move speed. Grows stronger as it absorbs darkness.");
darkItems.Add(darkWispItem);
}
}
public class DarkClayItem
{
public static ItemDef darkClayItem;
private Sprite darkClaySprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/SiphonOnLowHealth/texSiphonOnLowHealthIcon.png").WaitForCompletion();
private GameObject darkClayPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/SiphonOnLowHealth/PickupSiphonOnLowHealth.prefab").WaitForCompletion();
public DarkClayItem()
{
//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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
darkClayItem = ScriptableObject.CreateInstance<ItemDef>();
((Object)darkClayItem).name = "DARK_CLAY_NAME";
darkClayItem.descriptionToken = "DARK_CLAY_DESCRIPTION";
darkClayItem.nameToken = "DARK_CLAY_NAME";
darkClayItem.loreToken = "DARK_CLAY_LORE";
darkClayItem.pickupToken = "DARK_CLAY_PICKUP";
darkClayItem.pickupIconSprite = darkClaySprite;
darkClayItem.pickupModelPrefab = darkClayPickup;
darkClayItem.canRemove = true;
darkClayItem.hidden = false;
darkClayItem._itemTierDef = darkTier;
ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
darkClayItem.itemIndex = (ItemIndex)0;
ItemAPI.Add(new CustomItem(darkClayItem, val));
LanguageAPI.Add("DARK_CLAY_NAME", "Polished Urn");
LanguageAPI.Add("DARK_CLAY_DESCRIPTION", "The nearest 1 (+1 per stack) enemies to you within 13m (+8m per stack) will be 'tethered' to you, applying tar. Deal 15% (+15% per stack) additional damage to enemies with tar applied, and heal for 5% (+5% per stack) of the damage dealt. Upon killing a dark enemy, gain 3% (+3% per stack) healing multiplier.");
LanguageAPI.Add("DARK_CLAY_PICKUP", "Tether yourself to nearby enemies, dealing bonus damage and healing for a portion of the damage dealt. Grows stronger as it absorbs darkness.");
darkItems.Add(darkClayItem);
}
}
public class DarkConstructItem
{
public static ItemDef darkConstructItem;
private Sprite darkConstructSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/MinorConstructOnKill/texMinorConstructOnKillIcon.png").WaitForCompletion();
private GameObject darkConstructPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/MinorConstructOnKill/PickupDefenseNucleus.prefab").WaitForCompletion();
public DarkConstructItem()
{
//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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
darkConstructItem = ScriptableObject.CreateInstance<ItemDef>();
((Object)darkConstructItem).name = "DARK_CONSTRUCT_NAME";
darkConstructItem.descriptionToken = "DARK_CONSTRUCT_DESCRIPTION";
darkConstructItem.nameToken = "DARK_CONSTRUCT_NAME";
darkConstructItem.loreToken = "DARK_CONSTRUCT_LORE";
darkConstructItem.pickupToken = "DARK_CONSTRUCT_PICKUP";
darkConstructItem.pickupIconSprite = darkConstructSprite;
darkConstructItem.pickupModelPrefab = darkConstructPickup;
darkConstructItem.canRemove = true;
darkConstructItem.hidden = false;
darkConstructItem._itemTierDef = darkTier;
ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
darkConstructItem.itemIndex = (ItemIndex)0;
ItemAPI.Add(new CustomItem(darkConstructItem, val));
LanguageAPI.Add("DARK_CONSTRUCT_NAME", "Defense Cell");
LanguageAPI.Add("DARK_CONSTRUCT_DESCRIPTION", "Killing an elite enemy spawns an Alpha Construct that attaches to you with 1000% (+1000% per stack) health. On hit, all Constructs attached to you have a 5% chance to fire at the enemy hit for 300% (+300% per stack) damage. Limit of 4 (+4 per stack) constructs. Upon killing a dark enemy, gain .03 luck.");
LanguageAPI.Add("DARK_CONSTRUCT_PICKUP", "Upon killing an elite, gain an alpha construct that attaches to you and fires at enemies you fire at. Grows stronger as it absorbs darkness.");
darkItems.Add(darkConstructItem);
}
}
public class DarkCoreItem
{
public static ItemDef darkCoreItem;
private Sprite darkCoreSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/RoboBallBuddy/texEmpathyChip.png").WaitForCompletion();
private GameObject darkCorePickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/RoboBallBuddy/PickupEmpathyChip.prefab").WaitForCompletion();
public DarkCoreItem()
{
//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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
darkCoreItem = ScriptableObject.CreateInstance<ItemDef>();
((Object)darkCoreItem).name = "DARK_CORE_NAME";
darkCoreItem.descriptionToken = "DARK_CORE_DESCRIPTION";
darkCoreItem.nameToken = "DARK_CORE_NAME";
darkCoreItem.loreToken = "DARK_CORE_LORE";
darkCoreItem.pickupToken = "DARK_CORE_PICKUP";
darkCoreItem.pickupIconSprite = darkCoreSprite;
darkCoreItem.pickupModelPrefab = darkCorePickup;
darkCoreItem.canRemove = true;
darkCoreItem.hidden = false;
darkCoreItem._itemTierDef = darkTier;
ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
darkCoreItem.itemIndex = (ItemIndex)0;
ItemAPI.Add(new CustomItem(darkCoreItem, val));
LanguageAPI.Add("DARK_CORE_NAME", "Sympathy Cores");
LanguageAPI.Add("DARK_CORE_DESCRIPTION", "Every 10 seconds, summon two Solus Probes. All allies gain +100% (+100% per stack) health and damage per ally on your team. Upon killing a dark enemy, increase all of your allies stats by 2% (+2% per stack).");
LanguageAPI.Add("DARK_CORE_PICKUP", "Summon probes. All allies gain stats per ally on your team. Grows stronger as it absorbs darkness.");
darkItems.Add(darkCoreItem);
}
}
public class DarkParentItem
{
public static ItemDef darkParentItem;
private Sprite darkParentSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/ParentEgg/texParentEggIcon.png").WaitForCompletion();
private GameObject darkParentPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ParentEgg/PickupParentEgg.prefab").WaitForCompletion();
public DarkParentItem()
{
//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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
darkParentItem = ScriptableObject.CreateInstance<ItemDef>();
((Object)darkParentItem).name = "DARK_PARENT_NAME";
darkParentItem.descriptionToken = "DARK_PARENT_DESCRIPTION";
darkParentItem.nameToken = "DARK_PARENT_NAME";
darkParentItem.loreToken = "DARK_PARENT_LORE";
darkParentItem.pickupToken = "DARK_PARENT_PICKUP";
darkParentItem.pickupIconSprite = darkParentSprite;
darkParentItem.pickupModelPrefab = darkParentPickup;
darkParentItem.canRemove = true;
darkParentItem.hidden = false;
darkParentItem._itemTierDef = darkTier;
ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
darkParentItem.itemIndex = (ItemIndex)0;
ItemAPI.Add(new CustomItem(darkParentItem, val));
LanguageAPI.Add("DARK_PARENT_NAME", "Dark Planula");
LanguageAPI.Add("DARK_PARENT_DESCRIPTION", "Heal from incoming damage equal to 100% (+100% per stack) armor. On taking damage, ignite enemies within a 13m (+8m per stack) radius. Upon killing a dark enemy, gain 1.5 (+1.5 per stack) armor.");
LanguageAPI.Add("DARK_PARENT_PICKUP", "Heal from incoming damage and ignite nearby enemies. Grows stronger as it absorbs darkness.");
darkItems.Add(darkParentItem);
}
}
public class DarkLightningItem
{
public static ItemDef darkLightningItem;
private Sprite darkLightningSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/LightningStrikeOnHit/texLightningStrikeOnHit.png").WaitForCompletion();
private GameObject darkLightningPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LightningStrikeOnHit/PickupChargedPerforator.prefab").WaitForCompletion();
public DarkLightningItem()
{
//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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
darkLightningItem = ScriptableObject.CreateInstance<ItemDef>();
((Object)darkLightningItem).name = "DARK_LIGHTNING_NAME";
darkLightningItem.descriptionToken = "DARK_LIGHTNING_DESCRIPTION";
darkLightningItem.nameToken = "DARK_LIGHTNING_NAME";
darkLightningItem.loreToken = "DARK_LIGHTNING_LORE";
darkLightningItem.pickupToken = "DARK_LIGHTNING_PICKUP";
darkLightningItem.pickupIconSprite = darkLightningSprite;
darkLightningItem.pickupModelPrefab = darkLightningPickup;
darkLightningItem.canRemove = true;
darkLightningItem.hidden = false;
darkLightningItem._itemTierDef = darkTier;
ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
darkLightningItem.itemIndex = (ItemIndex)0;
ItemAPI.Add(new CustomItem(darkLightningItem, val));
LanguageAPI.Add("DARK_LIGHTNING_NAME", "Charged Claw");
LanguageAPI.Add("DARK_LIGHTNING_DESCRIPTION", "10% chance on hit to down a lightning strike on the enemy and 2 (+2 per stack) enemies within 15m (+8m per stack), dealing 1000% (+1000% per stack) damage. Killing a dark enemy grants 4% (+4% per stack) damage.");
LanguageAPI.Add("DARK_LIGHTNING_PICKUP", "Chance on hit to summon a lightning storm. Grows stronger as it absorbs darkness.");
darkItems.Add(darkLightningItem);
}
}
public class DarkFireItem
{
public static ItemDef darkFireItem;
private Sprite darkFireSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/FireballsOnHit/texFireballsOnHitIcon.png").WaitForCompletion();
private GameObject darkFirePickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/FireballsOnHit/PickupFireballsOnHit.prefab").WaitForCompletion();
public DarkFireItem()
{
//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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
darkFireItem = ScriptableObject.CreateInstance<ItemDef>();
((Object)darkFireItem).name = "DARK_FIRE_NAME";
darkFireItem.descriptionToken = "DARK_FIRE_DESCRIPTION";
darkFireItem.nameToken = "DARK_FIRE_NAME";
darkFireItem.loreToken = "DARK_FIRE_LORE";
darkFireItem.pickupToken = "DARK_FIRE_PICKUP";
darkFireItem.pickupIconSprite = darkFireSprite;
darkFireItem.pickupModelPrefab = darkFirePickup;
darkFireItem.canRemove = true;
darkFireItem.hidden = false;
darkFireItem._itemTierDef = darkTier;
ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
darkFireItem.itemIndex = (ItemIndex)0;
ItemAPI.Add(new CustomItem(darkFireItem, val));
LanguageAPI.Add("DARK_FIRE_NAME", "Molten Claw");
LanguageAPI.Add("DARK_FIRE_DESCRIPTION", "10% chance on hit to call forth 3 magma balls from an enemy, dealing (3000% (+3000% per stack) damage)% base damage. Killing a dark enemy grants 0.5 (+0.5 per stack) base damage.");
LanguageAPI.Add("DARK_FIRE_PICKUP", "Chance on hit to summon fireballs. Grows stronger as it absorbs darkness.");
darkItems.Add(darkFireItem);
}
}
public static ItemTierDef darkTier;
public static ItemDef testItem;
public static List<ItemDef> darkItems = new List<ItemDef>();
public static Action<CharacterBody> onKillDarknessEnemy;
public static ItemDef stackingDarkItem;
public DarknessItems()
{
//IL_0008: 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_0012: 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_0030: 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: 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_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0164: Unknown result type (might be due to invalid IL or missing references)
//IL_016e: Expected O, but got Unknown
//IL_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Expected O, but got Unknown
//IL_0188: Unknown result type (might be due to invalid IL or missing references)
//IL_0192: Expected O, but got Unknown
//IL_019a: Unknown result type (might be due to invalid IL or missing references)
//IL_01a4: Expected O, but got Unknown
ColorIndex val = ColorsAPI.RegisterColor(Color.black);
darkTier = ScriptableObject.CreateInstance<ItemTierDef>();
darkTier.tier = (ItemTier)10;
darkTier.darkColorIndex = val;
darkTier.colorIndex = val;
darkTier.highlightPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Junk/UI/HighlightMisc.prefab").WaitForCompletion(), "Dark Item Highlight");
CreateDropletPrefab();
darkTier.highlightPrefab.GetComponent<HighlightRect>().highlightColor = Color.black;
darkTier.isDroppable = true;
darkTier.canScrap = false;
darkTier.canRestack = false;
ContentAddition.AddItemTierDef(darkTier);
GlobalEventManager.onCharacterDeathGlobal += GlobalEventManagerOnonCharacterDeathGlobal;
new DarkGolemItem();
new DarkBeetleItem();
new DarkPearlItem();
new DarkPearlItem2();
new DarkJellyfishItem();
new DarkWispItem();
new DarkBleedItem();
new DarkClayItem();
new DarkConstructItem();
new DarkCoreItem();
new DarkParentItem();
new DarkLightningItem();
new DarkFireItem();
new DarkStacksItem();
Inventory.onServerItemGiven += InventoryOnonServerItemGiven;
onKillDarknessEnemy = (Action<CharacterBody>)Delegate.Combine(onKillDarknessEnemy, (Action<CharacterBody>)delegate(CharacterBody body)
{
body.inventory.GiveItem(stackingDarkItem, 1);
});
CharacterMaster.OnInventoryChanged += new hook_OnInventoryChanged(CharacterMasterOnOnInventoryChanged);
HealthComponent.Heal += new hook_Heal(HealthComponentOnHeal);
RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPIOnGetStatCoefficients);
BaseItemBodyBehavior.Init += new hook_Init(BaseItemBodyBehaviorOnInit);
}
private void BaseItemBodyBehaviorOnInit(orig_Init orig)
{
//IL_001b: 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_0043: 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_0087: 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)
orig.Invoke();
List<ItemTypePair> list = BaseItemBodyBehavior.server.itemTypePairs.ToList();
list.Add(new ItemTypePair
{
behaviorType = typeof(DarkBeetleItem.DarkBeetleBodyBehavior),
itemIndex = DarkBeetleItem.darkBeetleItem.itemIndex
});
((NetworkContextSet)(ref BaseItemBodyBehavior.server)).SetItemTypePairs(list);
list = BaseItemBodyBehavior.shared.itemTypePairs.ToList();
list.Add(new ItemTypePair
{
behaviorType = typeof(DarkBeetleItem.DarkBeetleBodyBehavior),
itemIndex = DarkBeetleItem.darkBeetleItem.itemIndex
});
((NetworkContextSet)(ref BaseItemBodyBehavior.shared)).SetItemTypePairs(list);
list = BaseItemBodyBehavior.client.itemTypePairs.ToList();
((NetworkContextSet)(ref BaseItemBodyBehavior.client)).SetItemTypePairs(list);
}
private void CreateDropletPrefab()
{
//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_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Expected O, but got Unknown
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: 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_0114: 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_014c: 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_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_0159: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0168: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/LunarOrb.prefab").WaitForCompletion(), "Darkness Orb", true);
Gradient val2 = new Gradient();
val2.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
{
new GradientColorKey(Color.black, 0f),
new GradientColorKey(Color.black, 1f)
}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
{
new GradientAlphaKey(1f, 0f),
new GradientAlphaKey(0f, 1f)
});
Color black = Color.black;
((Component)val.transform.GetChild(0)).gameObject.GetComponent<TrailRenderer>().startColor = Color.black;
((Component)val.transform.GetChild(0)).gameObject.GetComponent<TrailRenderer>().startColor_Injected = ref black;
((Component)val.transform.GetChild(0)).gameObject.GetComponent<TrailRenderer>().SetColorGradient(val2);
Light[] componentsInChildren = val.GetComponentsInChildren<Light>();
Light[] array = componentsInChildren;
foreach (Light val3 in array)
{
val3.color = black;
}
ParticleSystem[] componentsInChildren2 = val.GetComponentsInChildren<ParticleSystem>();
ParticleSystem[] array2 = componentsInChildren2;
foreach (ParticleSystem val4 in array2)
{
MainModule main = val4.main;
ColorOverLifetimeModule colorOverLifetime = val4.colorOverLifetime;
((MainModule)(ref main)).startColor = new MinMaxGradient(black);
((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(black);
}
darkTier.dropletDisplayPrefab = val;
}
private void CharacterMasterOnOnInventoryChanged(orig_OnInventoryChanged orig, CharacterMaster self)
{
int itemCount = self.inventory.GetItemCount(stackingDarkItem);
int itemCount2 = self.inventory.GetItemCount(DarkConstructItem.darkConstructItem);
orig.Invoke(self);
self.luck += (float)(itemCount * itemCount2) * 0.03f;
}
private float HealthComponentOnHeal(orig_Heal orig, HealthComponent self, float amount, ProcChainMask procchainmask, bool nonregen)
{
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)self.body.inventory))
{
int itemCount = self.body.inventory.GetItemCount(DarkClayItem.darkClayItem);
int itemCount2 = self.body.inventory.GetItemCount(stackingDarkItem);
float num = 1f + (float)(itemCount2 * itemCount) * 0.03f;
return orig.Invoke(self, amount * num, procchainmask, nonregen);
}
return orig.Invoke(self, amount, procchainmask, nonregen);
}
private void GlobalEventManagerOnonCharacterDeathGlobal(DamageReport obj)
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)obj.attacker) && Object.op_Implicit((Object)(object)obj.attackerBody) && Object.op_Implicit((Object)(object)obj.attackerBody.inventory) && obj.victimBody.inventory.GetEquipmentIndex() == Darkness.DarknessEquipment.equipmentIndex)
{
onKillDarknessEnemy(obj.attackerBody);
}
}
private void InventoryOnonServerItemGiven(Inventory arg1, ItemIndex arg2, int arg3)
{
//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_0020: Unknown result type (might be due to invalid IL or missing references)
if (arg1.currentEquipmentIndex != Darkness.DarknessEquipment.equipmentIndex && darkItems.Contains(ItemCatalog.GetItemDef(arg2)))
{
Darkness.DarknessLevel += arg3;
Darkness.UpdateDarkness();
}
}
private void RecalculateStatsAPIOnGetStatCoefficients(CharacterBody self, StatHookEventArgs args)
{
if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory))
{
int itemCount = self.inventory.GetItemCount(stackingDarkItem);
int itemCount2 = self.inventory.GetItemCount(DarkGolemItem.darkGolemItem);
int itemCount3 = self.inventory.GetItemCount(DarkBeetleItem.darkBeetleItem);
int itemCount4 = self.inventory.GetItemCount(DarkPearlItem.darkPearlItem);
int itemCount5 = self.inventory.GetItemCount(DarkPearlItem2.darkPearlItem);
int itemCount6 = self.inventory.GetItemCount(DarkJellyfishItem.darkJellyfishItem);
int itemCount7 = self.inventory.GetItemCount(DarkWispItem.darkWispItem);
int itemCount8 = self.inventory.GetItemCount(DarkBleedItem.darkBleedItem);
int itemCount9 = self.inventory.GetItemCount(DarkCoreItem.darkCoreItem);
int itemCount10 = self.inventory.GetItemCount(DarkParentItem.darkParentItem);
int itemCount11 = self.inventory.GetItemCount(DarkLightningItem.darkLightningItem);
int itemCount12 = self.inventory.GetItemCount(DarkFireItem.darkFireItem);
if (itemCount8 > 0)
{
args.critAdd += 20f;
}
args.baseDamageAdd += (float)(itemCount12 * itemCount) * 0.5f;
args.baseHealthAdd += (float)(itemCount2 * 100 + itemCount2 * 5 * itemCount);
args.baseRegenAdd += (float)(itemCount2 * 10 + itemCount2 * itemCount);
args.critDamageMultAdd += (float)(itemCount8 * itemCount) * 0.03f;
args.armorAdd += (float)(itemCount10 * itemCount) * 1.5f;
args.attackSpeedMultAdd += (float)(itemCount3 * itemCount) * 0.03f;
args.moveSpeedMultAdd += (float)(itemCount7 * itemCount) * 0.03f;
args.healthMultAdd += (1f + (float)itemCount4 * 0.5f) * (1f + (float)(itemCount4 * itemCount) * 0.02f) - 1f;
args.damageMultAdd += (float)itemCount * 0.04f * (float)itemCount11;
float num = 1f + (float)itemCount5 * 0.5f;
num *= 1f + (float)(itemCount5 * itemCount) * 0.01f;
num -= 1f;
args.healthMultAdd += num;
args.regenMultAdd += num;
args.moveSpeedMultAdd += num;
args.damageMultAdd += num;
args.critAdd += num * (self.crit + args.critAdd);
args.attackSpeedMultAdd += num;
args.armorAdd += num * (self.armor + args.armorAdd);
float num2 = Mathf.Pow(1f - 0.01f * (float)itemCount6, (float)itemCount);
args.cooldownMultAdd = num2 - 1f;
}
}
}
public class DarknessShrine
{
public class DarknessShrineManager : NetworkBehaviour
{
public PurchaseInteraction purchaseInteraction;
private GameObject shrineUseEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/ShrineUseEffect.prefab").WaitForCompletion();
private GameObject[] terminalGameObjects;
public List<ItemIndex> sacrificedItems = new List<ItemIndex>();
private ItemIndex bonusItemToGive;
public CombatSquad bossSquad;
public bool changedEnemies = false;
public void Start()
{
purchaseInteraction.SetAvailable(false);
((UnityEvent<Interactor>)(object)purchaseInteraction.onPurchase).AddListener((UnityAction<Interactor>)OnPurchase);
}
public void createPotentials(GameObject shrine2, SpawnCard spawnCard)
{
//IL_001f: 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_0026: 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_0041: Expected O, but got Unknown
//IL_0041: Expected O, but got Unknown
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Expected O, but got Unknown
terminalGameObjects = (GameObject[])(object)new GameObject[3];
for (int i = 0; i < 3; i++)
{
terminalGameObjects[i] = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(spawnCard, new DirectorPlacementRule
{
placementMode = (PlacementMode)4
}, new Xoroshiro128Plus((ulong)(Random.value * 1.8446744E+19f))));
terminalGameObjects[i].GetComponent<DarknessPotentialManager>().parent = this;
}
}
public void OnPurchase(Interactor interactor)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: 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_002e: 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_003f: 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_004f: Expected O, but got Unknown
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Expected O, but got Unknown
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_0479: Unknown result type (might be due to invalid IL or missing references)
//IL_047e: Unknown result type (might be due to invalid IL or missing references)
//IL_048b: Unknown result type (might be due to invalid IL or missing references)
//IL_049c: Expected O, but got Unknown
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
//IL_04b5: Expected O, but got Unknown
//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
//IL_0432: Unknown result type (might be due to invalid IL or missing references)
//IL_0437: Unknown result type (might be due to invalid IL or missing references)
//IL_0445: Unknown result type (might be due to invalid IL or missing references)
//IL_0456: Expected O, but got Unknown
//IL_013c: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: 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)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
//IL_0166: 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_01b9: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: 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_01f0: Unknown result type (might be due to invalid IL or missing references)
//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
//IL_0218: Unknown result type (might be due to invalid IL or missing references)
//IL_0227: 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_020b: Unknown result type (might be due to invalid IL or missing references)
//IL_024f: Unknown result type (might be due to invalid IL or missing references)
//IL_025e: Unknown result type (might be due to invalid IL or missing references)
//IL_023d: Unknown result type (might be due to invalid IL or missing references)
//IL_0242: 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_0295: Unknown result type (might be due to invalid IL or missing references)
//IL_0274: Unknown result type (might be due to invalid IL or missing references)
//IL_0279: Unknown result type (might be due to invalid IL or missing references)
//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
//IL_02ab: 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_02f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0303: Unknown result type (might be due to invalid IL or missing references)
//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
//IL_032b: Unknown result type (might be due to invalid IL or missing references)
//IL_033a: Unknown result type (might be due to invalid IL or missing references)
//IL_0319: 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_0363: Unknown result type (might be due to invalid IL or missing references)
//IL_0372: Unknown result type (might be due to invalid IL or missing references)
//IL_0351: Unknown result type (might be due to invalid IL or missing references)
//IL_0356: Unknown result type (might be due to invalid IL or missing references)
//IL_039b: Unknown result type (might be due to invalid IL or missing references)
//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
//IL_0389: Unknown result type (might be due to invalid IL or missing references)
//IL_038e: 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_03df: Unknown result type (might be due to invalid IL or missing references)
//IL_03be: Unknown result type (might be due to invalid IL or missing references)
//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
//IL_03f6: Unknown result type (might be due to invalid IL or missing references)
//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
EffectManager.SpawnEffect(shrineUseEffect, new EffectData
{
origin = ((Component)this).gameObject.transform.position,
rotation = Quaternion.identity,
scale = 1f,
color = Color32.op_Implicit(Color.black)
}, true);
Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
{
baseToken = "<style=cEvent><color=#000000>The Darkness Increases!</color></style>"
});
purchaseInteraction.SetAvailable(false);
Darkness.DarknessLevel++;
Darkness.UpdateDarkness();
for (int i = 0; i < 3; i++)
{
if (Object.op_Implicit((Object)(object)terminalGameObjects[i]))
{
DarknessPotentialManager component = terminalGameObjects[i].GetComponent<DarknessPotentialManager>();
component.shrinking = 0;
component.purchaseInteraction.SetAvailable(false);
}
}
bonusItemToGive = (ItemIndex)(-1);
int num = -1;
if (sacrificedItems.Count == 3 && sacrificedItems[0] == sacrificedItems[1] && sacrificedItems[0] == sacrificedItems[2])
{
if (sacrificedItems[0] == ItemCatalog.itemNameToIndex["BeetleGland"])
{
num = 0;
bonusItemToGive = DarknessItems.DarkBeetleItem.darkBeetleItem.itemIndex;
}
if (sacrificedItems[0] == ItemCatalog.itemNameToIndex["Knurl"])
{
num = 1;
bonusItemToGive = DarknessItems.DarkGolemItem.darkGolemItem.itemIndex;
}
if (sacrificedItems[0] == ItemCatalog.itemNameToIndex["NovaOnLowHealth"])
{
num = 2;
bonusItemToGive = DarknessItems.DarkJellyfishItem.darkJellyfishItem.itemIndex;
}
if (sacrificedItems[0] == ItemCatalog.itemNameToIndex["SprintWisp"])
{
num = 3;
bonusItemToGive = DarknessItems.DarkWispItem.darkWispItem.itemIndex;
}
if (sacrificedItems[0] == ItemCatalog.itemNameToIndex["BleedOnHitAndExplode"])
{
num = 4;
bonusItemToGive = DarknessItems.DarkBleedItem.darkBleedItem.itemIndex;
}
if (sacrificedItems[0] == ItemCatalog.itemNameToIndex["SiphonOnLowHealth"])
{
num = 5;
bonusItemToGive = DarknessItems.DarkClayItem.darkClayItem.itemIndex;
}
if (sacrificedItems[0] == ItemCatalog.itemNameToIndex["MinorConstructOnKill"])
{
num = 6;
bonusItemToGive = DarknessItems.DarkConstructItem.darkConstructItem.itemIndex;
}
if (sacrificedItems[0] == ItemCatalog.itemNameToIndex["RoboBallBuddy"])
{
num = 7;
bonusItemToGive = DarknessItems.DarkCoreItem.darkCoreItem.itemIndex;
}
if (sacrificedItems[0] == ItemCatalog.itemNameToIndex["ParentEgg"])
{
num = 8;
bonusItemToGive = DarknessItems.DarkParentItem.darkParentItem.itemIndex;
}
if (sacrificedItems[0] == ItemCatalog.itemNameToIndex["LightningStrikeOnHit"])
{
num = 9;
bonusItemToGive = DarknessItems.DarkLightningItem.darkLightningItem.itemIndex;
}
if (sacrificedItems[0] == ItemCatalog.itemNameToIndex["FireballsOnHit"])
{
num = 10;
bonusItemToGive = DarknessItems.DarkFireItem.darkFireItem.itemIndex;
}
if (sacrificedItems[0] == ItemCatalog.itemNameToIndex["Pearl"])
{
bonusItemToGive = DarknessItems.DarkPearlItem.darkPearlItem.itemIndex;
}
if (sacrificedItems[0] == ItemCatalog.itemNameToIndex["ShinyPearl"])
{
num = 11;
bonusItemToGive = DarknessItems.DarkPearlItem2.darkPearlItem.itemIndex;
}
}
CombatDirector component2 = ((Component)this).gameObject.GetComponent<CombatDirector>();
component2.monsterCardsSelection = new WeightedSelection<DirectorCard>(8);
if (num == -1)
{
for (int j = 0; j < bosses.Length; j++)
{
component2.monsterCardsSelection.AddChoice(new DirectorCard
{
spawnCard = bosses[j],
selectionWeight = 1
}, 1f);
}
}
else
{
component2.monsterCardsSelection.AddChoice(new DirectorCard
{
spawnCard = bosses[num],
selectionWeight = 1
}, 1f);
}
component2.rng = new Xoroshiro128Plus((ulong)(Random.value * 1.8446744E+19f));
CombatSquad val = (component2.combatSquad = ((Component)this).gameObject.AddComponent<CombatSquad>());
component2.teamIndex = (TeamIndex)2;
component2.currentSpawnTarget = ((Component)this).gameObject;
component2.ignoreTeamSizeLimit = true;
component2.shouldSpawnOneWave = true;
((Behaviour)component2).enabled = true;
component2.monsterCredit += (float)(int)(600f * Mathf.Pow(Run.instance.compensatedDifficultyCoefficient, 0.5f));
component2.SetNextSpawnAsBoss();
bossSquad = val;
}
private void FixedUpdate()
{
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Invalid comparison between Unknown and I4
//IL_018a: 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_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: 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)
//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Invalid comparison between Unknown and I4
//IL_01f3: 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_01e6: 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_02fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0309: Unknown result type (might be due to invalid IL or missing references)
//IL_030e: Unknown result type (might be due to invalid IL or missing references)
//IL_0318: 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_0322: Unknown result type (might be due to invalid IL or missing references)
//IL_0329: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_022a: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: 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_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_0274: Unknown result type (might be due to invalid IL or missing references)
//IL_0279: Unknown result type (might be due to invalid IL or missing references)
//IL_024f: Unknown result type (might be due to invalid IL or missing references)
//IL_0254: Unknown result type (might be due to invalid IL or missing references)
//IL_0284: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)bossSquad))
{
return;
}
if (!changedEnemies && bossSquad.membersList.Count > 0)
{
List<CharacterMaster> membersList = bossSquad.membersList;
for (int i = 0; i < membersList.Count; i++)
{
membersList[i].isBoss = true;
Transform transform = ((Component)membersList[i]).transform;
transform.localScale *= 1.5f;
Inventory inventory = membersList[i].inventory;
inventory.SetEquipmentIndex(Darkness.DarknessEquipment.equipmentIndex);
for (int j = 0; j < sacrificedItems.Count; j++)
{
ItemIndex val = sacrificedItems[j];
int num = 1;
if (ItemCatalog.tier1ItemList.Contains(val))
{
num = 5;
}
if (ItemCatalog.tier2ItemList.Contains(val))
{
num = 3;
}
inventory.GiveItem(val, num);
}
if ((int)bonusItemToGive != -1)
{
inventory.GiveItem(bonusItemToGive, 1);
}
inventory.GiveItemString("ShinyPearl", Darkness.DarknessLevel);
}
}
if (!bossSquad.defeatedServer)
{
return;
}
List<ItemIndex> list = new List<ItemIndex>();
if ((int)bonusItemToGive != -1)
{
list.Add(bonusItemToGive);
}
else
{
for (int k = 0; k < sacrificedItems.Count; k++)
{
ItemIndex item = sacrificedItems[k];
int num2 = 1;
ItemIndex item2;
if (ItemCatalog.tier1ItemList.Contains(item))
{
item2 = ItemCatalog.tier2ItemList[(int)((float)ItemCatalog.tier2ItemList.Count * Random.value)];
}
else if (ItemCatalog.tier2ItemList.Contains(item))
{
item2 = ItemCatalog.itemNameToIndex[yellowItemNames[(int)((float)yellowItemNames.Length * Random.value)]];
}
else if (ItemCatalog.tier3ItemList.Contains(item))
{
item2 = ItemCatalog.tier1ItemList[(int)((float)ItemCatalog.tier1ItemList.Count * Random.value)];
num2 = 5;
}
else
{
item2 = ItemCatalog.tier3ItemList[(int)((float)ItemCatalog.tier3ItemList.Count * Random.value)];
}
for (int l = 0; l < num2; l++)
{
list.Add(item2);
}
}
}
Vector3 val2 = default(Vector3);
for (int m = 0; m < list.Count; m++)
{
float num3 = (float)(m * 2) * MathF.PI / (float)list.Count;
((Vector3)(ref val2))..ctor(Mathf.Sin(num3), 1f, Mathf.Cos(num3));
PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(list[m]), ((Component)this).transform.position + Vector3.up * 5f, val2 * 20f);
}
bossSquad = null;
}
}
public class DarknessPotentialManager : NetworkBehaviour
{
public PurchaseInteraction purchaseInteraction;
public DarknessShrineManager parent;
public NetworkUIPromptController networkUIPromptController;
public PickupPickerController ppc;
private Interactor interactor;
private GameObject UIObject;
public int shrinking = -1;
public void Start()
{
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Expected O, but got Unknown
purchaseInteraction.SetAvailableTrue();
((UnityEvent<Interactor>)(object)purchaseInteraction.onPurchase).AddListener((UnityAction<Interactor>)OnPurchase);
networkUIPromptController = ((Component)this).gameObject.AddComponent<NetworkUIPromptController>();
ppc = ((Component)this).gameObject.AddComponent<PickupPickerController>();
networkUIPromptController.onDisplayBegin += ppc.OnDisplayBegin;
networkUIPromptController.onDisplayEnd += ppc.OnDisplayEnd;
ppc.panelPrefab = itemSelectionScreen;
ppc.onPickupSelected = new PickupIndexUnityEvent();
((UnityEvent<int>)(object)ppc.onPickupSelected).AddListener((UnityAction<int>)OnPickupSelected);
}
private void OnPickupSelected(int arg0)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: 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_0053: Unknown result type (might be due to invalid IL or missing references)
Object.FindObjectOfType<PickupPickerPanel>().DestroyIt();
ItemIndex itemIndex = PickupCatalog.GetPickupDef(new PickupIndex(arg0)).itemIndex;
((Component)parent).GetComponent<DarknessShrineManager>().sacrificedItems.Add(itemIndex);
purchaseInteraction.SetAvailable(false);
Inventory inventory = ((Component)interactor).GetComponent<CharacterBody>().inventory;
inventory.RemoveItem(itemIndex, 1);
shrinking = 0;
parent.purchaseInteraction.SetAvailableTrue();
}
public void OnPurchase(Interactor interactor)
{
this.interactor = interactor;
ppc.SetOptionsFromInteractor(interactor);
networkUIPromptController.SetParticipantMasterFromInteractor(interactor);
}
private void FixedUpdate()
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
if (shrinking > -1)
{
shrinking++;
Transform transform = ((Component)this).gameObject.transform;
transform.localScale *= 0.95f;
if (shrinking > 30)
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
}
}
private GameObject shrine1 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShrineBoss/mdlShrineBoss.fbx").WaitForCompletion(), "Darkness Shrine");
private Material darkMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/ShrineBlood/matShrineBlood.mat").WaitForCompletion();
private GameObject shrine2 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShrineBlood/mdlShrineBlood.fbx").WaitForCompletion(), "Darkness Item");
private static GameObject itemSelectionScreen = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Scrapper/ScrapperPickerPanel.prefab").WaitForCompletion(), "Darkness Item Selector");
private InteractableSpawnCard spawnCard;
public static string[] bossLocations = new string[12]
{
"RoR2/Base/Beetle/cscBeetleQueen.asset", "RoR2/Base/Titan/cscTitanGolemPlains.asset", "RoR2/Base/Vagrant/cscVagrant.asset", "RoR2/Base/Gravekeeper/cscGravekeeper.asset", "RoR2/Base/ImpBoss/cscImpBoss.asset", "RoR2/Base/ClayBoss/cscClayBoss.asset", "RoR2/DLC1/MajorAndMinorConstruct/cscMegaConstruct.asset", "RoR2/Base/RoboBallBoss/cscRoboBallBoss.asset", "RoR2/Base/Grandparent/cscGrandparent.asset", "RoR2/Base/ElectricWorm/cscElectricWorm.asset",
"RoR2/Base/MagmaWorm/cscMagmaWorm.asset", "RoR2/Base/Scav/cscScavBoss.asset"
};
public static string[] yellowItemNames = new string[13]
{
"BeetleGland", "Knurl", "NovaOnLowHealth", "SprintWisp", "BleedOnHitAndExplode", "SiphonOnLowHealth", "MinorConstructOnKill", "RoboBallBuddy", "ParentEgg", "LightningStrikeOnHit",
"FireballsOnHit", "Pearl", "ShinyPearl"
};
public static SpawnCard[] bosses;
public DarknessShrine()
{
//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_0028: 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_0040: 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_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Expected O, but got Unknown
//IL_018b: Unknown result type (might be due to invalid IL or missing references)
//IL_0193: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Unknown result type (might be due to invalid IL or missing references)
//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
//IL_01ec: Expected O, but got Unknown
//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
//IL_01f1: 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_0202: Expected O, but got Unknown
//IL_0239: 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_02bd: 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_02d5: Unknown result type (might be due to invalid IL or missing references)
//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
//IL_037a: Unknown result type (might be due to invalid IL or missing references)
//IL_038f: Expected O, but got Unknown
//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
((Object)shrine1).name = "Shrine of Darkness";
Transform transform = shrine1.transform;
transform.localScale *= 1.5f;
shrine1.AddComponent<NetworkIdentity>();
((Renderer)shrine1.GetComponent<MeshRenderer>()).sharedMaterial = darkMaterial;
shrine1.AddComponent<MeshCollider>();
((Behaviour)shrine1.AddComponent<CombatDirector>()).enabled = false;
DarknessShrineManager darknessShrineManager = shrine1.AddComponent<DarknessShrineManager>();
PurchaseInteraction val = shrine1.AddComponent<PurchaseInteraction>();
val.contextToken = "Reckon with the powers of Darkness (E)";
val.NetworkdisplayNameToken = "Shrine of Darkness";
darknessShrineManager.purchaseInteraction = val;
shrine1.GetComponent<Highlight>().targetRenderer = (Renderer)(object)shrine1.GetComponent<MeshRenderer>();
GameObject val2 = Object.Instantiate<GameObject>(new GameObject(), shrine1.transform);
((Collider)val2.AddComponent<BoxCollider>()).isTrigger = true;
val2.AddComponent<EntityLocator>().entity = shrine1;
InteractableSpawnCard val3 = ScriptableObject.CreateInstance<InteractableSpawnCard>();
((Object)val3).name = "iscDarknessShrine";
((SpawnCard)val3).prefab = shrine1;
((SpawnCard)val3).sendOverNetwork = true;
((SpawnCard)val3).hullSize = (HullClassification)1;
((SpawnCard)val3).nodeGraphType = (GraphType)0;
((SpawnCard)val3).requiredFlags = (NodeFlags)0;
((SpawnCard)val3).forbiddenFlags = (NodeFlags)16;
((SpawnCard)val3).directorCreditCost = 20;
((SpawnCard)val3).occupyPosition = true;
val3.orientToFloor = false;
val3.skipSpawnWhenSacrificeArtifactEnabled = false;
val3.maxSpawnsPerStage = 1;
DirectorCard card = new DirectorCard
{
selectionWeight = 500,
spawnCard = (SpawnCard)(object)val3
};
DirectorCardHolder val4 = new DirectorCardHolder
{
Card = card,
InteractableCategory = (InteractableCategory)4
};
Helpers.AddNewInteractable(val4);
SpawnCard.onSpawnedServerGlobal += SpawnCardOnonSpawnedServerGlobal;
((Object)shrine2).name = "Darkness Potential";
Transform transform2 = shrine2.transform;
transform2.localScale *= 0.005f;
shrine2.AddComponent<NetworkIdentity>();
shrine2.GetComponent<Renderer>().sharedMaterial = darkMaterial;
shrine2.AddComponent<MeshCollider>();
spawnCard = ScriptableObject.CreateInstance<InteractableSpawnCard>();
((Object)spawnCard).name = "iscDarknessPotential";
((SpawnCard)spawnCard).prefab = shrine2;
((SpawnCard)spawnCard).sendOverNetwork = true;
((SpawnCard)spawnCard).hullSize = (HullClassification)0;
((SpawnCard)spawnCard).nodeGraphType = (GraphType)0;
((SpawnCard)spawnCard).requiredFlags = (NodeFlags)0;
((SpawnCard)spawnCard).forbiddenFlags = (NodeFlags)16;
((SpawnCard)spawnCard).directorCreditCost = 0;
((SpawnCard)spawnCard).occupyPosition = true;
spawnCard.orientToFloor = false;
spawnCard.skipSpawnWhenSacrificeArtifactEnabled = false;
spawnCard.maxSpawnsPerStage = 3;
DarknessPotentialManager darknessPotentialManager = shrine2.AddComponent<DarknessPotentialManager>();
PurchaseInteraction val5 = shrine2.AddComponent<PurchaseInteraction>();
val5.contextToken = "Offer a Sacrifice to the Darkness (E)";
val5.NetworkdisplayNameToken = "Darkness Potential";
darknessPotentialManager.purchaseInteraction = val5;
shrine2.GetComponent<Highlight>().targetRenderer = shrine2.GetComponent<Renderer>();
GameObject val6 = Object.Instantiate<GameObject>(new GameObject(), shrine2.transform);
((Collider)val6.AddComponent<BoxCollider>()).isTrigger = true;
val6.AddComponent<EntityLocator>().entity = shrine2;
bosses = (SpawnCard[])(object)new SpawnCard[bossLocations.Length];
for (int i = 0; i < bosses.Length; i++)
{
bosses[i] = Addressables.LoadAssetAsync<SpawnCard>((object)bossLocations[i]).WaitForCompletion();
}
}
private void SpawnCardOnonSpawnedServerGlobal(SpawnResult obj)
{
//IL_0001: 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)
DarknessShrineManager component = obj.spawnedInstance.GetComponent<DarknessShrineManager>();
if ((Object)(object)component != (Object)null)
{
Log.Debug("Darkness Shrine Found");
((Component)component).transform.Rotate(-90f, -90f, -90f);
component.purchaseInteraction.SetAvailable(true);
component.createPotentials(shrine2, (SpawnCard)(object)spawnCard);
}
DarknessPotentialManager component2 = obj.spawnedInstance.GetComponent<DarknessPotentialManager>();
if ((Object)(object)component2 != (Object)null)
{
Log.Debug("Darkness Potential Found");
((Component)component2).transform.Rotate(-90f, -90f, -90f);
component2.purchaseInteraction.SetAvailable(true);
}
}
}
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);
}
}
public class RandomArtifact
{
public static ArtifactDef randomArtifact;
public static Sprite iconDisabled = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/TeamDeath/texArtifactDeathDisabled.png").WaitForCompletion();
public static Sprite iconEnabled = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/TeamDeath/texArtifactDeathEnabled.