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 EntityStates;
using EntityStates.VoidSurvivor;
using EntityStates.VoidSurvivor.Weapon;
using Microsoft.CodeAnalysis;
using On.EntityStates.VoidSurvivor.Weapon;
using On.RoR2.UI;
using R2API;
using RoR2;
using RoR2.CharacterAI;
using RoR2.Navigation;
using RoR2.Skills;
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.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("VoidBeacon")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("VoidBeacon")]
[assembly: AssemblyTitle("VoidBeacon")]
[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 VoidBeacon
{
public class Enemies
{
private GameObject voidZombieBody = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorBody.prefab").WaitForCompletion(), "VoidZombieNux");
private GameObject voidZombieMaster = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorMonsterMaster.prefab").WaitForCompletion(), "VoidZombieNuxMaster");
private List<string> skillDriversToDestroy = new List<string> { "Back up a little for comfort", "Flee and Heal", "Void Blink Up", "Fire Corrupt Ball", "Fire Corrupt Beam", "Crush Self Heal" };
private SkillDef voidMelee = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/VoidSurvivor/SwingMelee.asset").WaitForCompletion();
private SkillDef voidBall = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/VoidSurvivor/ChargeMegaBlaster.asset").WaitForCompletion();
private SkillDef voidBlink = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/VoidSurvivor/VoidBlinkUp.asset").WaitForCompletion();
public static GameObject voidZombieSpawnEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidJailer/VoidJailerSpawnEffect.prefab").WaitForCompletion(), "VoidZombieSpawnEffectNux");
public static CharacterSpawnCard spawnCard = ScriptableObject.CreateInstance<CharacterSpawnCard>();
public Enemies()
{
//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_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
//IL_0350: Unknown result type (might be due to invalid IL or missing references)
//IL_035b: Unknown result type (might be due to invalid IL or missing references)
//IL_0366: Unknown result type (might be due to invalid IL or missing references)
//IL_0371: Unknown result type (might be due to invalid IL or missing references)
Transform transform = voidZombieSpawnEffect.transform;
transform.localScale /= 4f;
voidZombieSpawnEffect.AddComponent<NetworkIdentity>();
ContentAddition.AddEffect(voidZombieSpawnEffect);
bool flag = default(bool);
ContentAddition.AddEntityState<VoidZombieSpawn>(ref flag);
ChangeEntityStateValue("RoR2/DLC1/VoidSurvivor/EntityStates.VoidSurvivor.Weapon.SwingMelee1.asset", "beginSwingSoundString", "Play_voidman_m1_corrupted_end");
ChangeEntityStateValue("RoR2/DLC1/VoidSurvivor/EntityStates.VoidSurvivor.Weapon.SwingMelee2.asset", "beginSwingSoundString", "Play_voidman_m1_corrupted_end");
ChangeEntityStateValue("RoR2/DLC1/VoidSurvivor/EntityStates.VoidSurvivor.Weapon.SwingMelee3.asset", "beginSwingSoundString", "Play_voidman_m1_corrupted_end");
Object.Destroy((Object)(object)voidZombieBody.GetComponent<VoidSurvivorController>());
AISkillDriver[] components = voidZombieMaster.GetComponents<AISkillDriver>();
foreach (AISkillDriver val in components)
{
val.requiredSkill = null;
if (val.customName == "Fire Hand Beam")
{
val.minDistance = 0f;
val.maxDistance = 4f;
val.movementType = (MovementType)1;
}
if (val.customName.Contains("Chase"))
{
val.minDistance = 4f;
val.shouldSprint = true;
}
if (val.customName.Contains("Blink"))
{
val.minDistance = 30f;
}
if (skillDriversToDestroy.Contains(val.customName))
{
Object.Destroy((Object)(object)val);
}
}
CharacterBody component = voidZombieBody.GetComponent<CharacterBody>();
component.baseMaxHealth = 225f;
component.levelMaxHealth = 68f;
component.baseDamage = 6f;
component.levelDamage = 1.2f;
component.baseNameToken = "Void Zombie";
component.subtitleNameToken = "";
GenericSkill[] components2 = voidZombieBody.GetComponents<GenericSkill>();
for (int i = 0; i < components2.Length; i++)
{
Object.Destroy((Object)(object)components2[i]);
}
ZombieSkills();
(from x in voidZombieBody.GetComponents<EntityStateMachine>()
where x.customName == "Body"
select x).First().initialStateType = new SerializableEntityStateType(typeof(VoidZombieSpawn));
voidZombieMaster.GetComponent<CharacterMaster>().bodyPrefab = voidZombieBody;
ContentAddition.AddBody(voidZombieBody);
ContentAddition.AddMaster(voidZombieMaster);
((Object)spawnCard).name = "cscVoidZombie";
((SpawnCard)spawnCard).prefab = voidZombieMaster;
((SpawnCard)spawnCard).sendOverNetwork = true;
((SpawnCard)spawnCard).hullSize = (HullClassification)0;
((SpawnCard)spawnCard).nodeGraphType = (GraphType)0;
((SpawnCard)spawnCard).requiredFlags = (NodeFlags)0;
((SpawnCard)spawnCard).forbiddenFlags = (NodeFlags)4;
((SpawnCard)spawnCard).directorCreditCost = 20;
((SpawnCard)spawnCard).occupyPosition = true;
}
private void ZombieSkills()
{
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: 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_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_018d: 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_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01eb: 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_020f: Unknown result type (might be due to invalid IL or missing references)
//IL_0214: Unknown result type (might be due to invalid IL or missing references)
//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0304: Unknown result type (might be due to invalid IL or missing references)
//IL_0306: Unknown result type (might be due to invalid IL or missing references)
SkillLocator component = voidZombieBody.GetComponent<SkillLocator>();
GenericSkill val = voidZombieBody.AddComponent<GenericSkill>();
val.skillName = "VoidZombiePrimary";
SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
((Object)val2).name = "VoidZombiePrimaryFamily";
val2.variants = (Variant[])(object)new Variant[1]
{
new Variant
{
skillDef = voidMelee
}
};
val._skillFamily = val2;
ContentAddition.AddSkillFamily(val2);
component.primary = val;
SkillDef val3 = ScriptableObject.CreateInstance<SkillDef>();
val3.skillName = "VoidBall";
((Object)val3).name = "VoidBall";
val3.activationState = new SerializableEntityStateType(typeof(ChargeMegaBlaster));
val3.activationStateMachineName = "Weapon";
val3.interruptPriority = voidBall.interruptPriority;
val3.baseMaxStock = 1;
val3.baseRechargeInterval = 20f;
val3.rechargeStock = 1;
val3.requiredStock = 1;
val3.stockToConsume = 1;
val3.dontAllowPastMaxStocks = true;
val3.beginSkillCooldownOnSkillEnd = voidBall.beginSkillCooldownOnSkillEnd;
val3.canceledFromSprinting = voidBall.canceledFromSprinting;
val3.forceSprintDuringState = voidBall.forceSprintDuringState;
val3.fullRestockOnAssign = true;
val3.resetCooldownTimerOnUse = false;
val3.isCombatSkill = true;
val3.mustKeyPress = false;
val3.cancelSprintingOnActivation = voidBall.cancelSprintingOnActivation;
ContentAddition.AddSkillDef(val3);
GenericSkill val4 = voidZombieBody.AddComponent<GenericSkill>();
val4.skillName = "VoidZombieSecondary";
SkillFamily val5 = ScriptableObject.CreateInstance<SkillFamily>();
((Object)val5).name = "VoidZombieSecondaryFamily";
val5.variants = (Variant[])(object)new Variant[1]
{
new Variant
{
skillDef = val3
}
};
val4._skillFamily = val5;
ContentAddition.AddSkillFamily(val5);
component.secondary = val4;
SkillDef val6 = ScriptableObject.CreateInstance<SkillDef>();
val6.skillName = "VoidBlink";
((Object)val6).name = "VoidBlink";
val6.activationState = new SerializableEntityStateType(typeof(VoidBlinkDown));
val6.activationStateMachineName = voidBlink.activationStateMachineName;
val6.interruptPriority = voidBlink.interruptPriority;
val6.baseMaxStock = 1;
val6.baseRechargeInterval = 10f;
val6.rechargeStock = 1;
val6.requiredStock = 1;
val6.stockToConsume = 1;
val6.dontAllowPastMaxStocks = true;
val6.beginSkillCooldownOnSkillEnd = voidBlink.beginSkillCooldownOnSkillEnd;
val6.canceledFromSprinting = voidBlink.canceledFromSprinting;
val6.forceSprintDuringState = voidBlink.forceSprintDuringState;
val6.fullRestockOnAssign = true;
val6.resetCooldownTimerOnUse = false;
val6.isCombatSkill = true;
val6.mustKeyPress = false;
val6.cancelSprintingOnActivation = voidBlink.cancelSprintingOnActivation;
ContentAddition.AddSkillDef(val6);
GenericSkill val7 = voidZombieBody.AddComponent<GenericSkill>();
val7.skillName = "voidZombieUtility";
SkillFamily val8 = ScriptableObject.CreateInstance<SkillFamily>();
((Object)val8).name = "VoidZombieUtilityFamily";
val8.variants = (Variant[])(object)new Variant[1]
{
new Variant
{
skillDef = val6
}
};
val7._skillFamily = val8;
ContentAddition.AddSkillFamily(val8);
component.utility = val7;
}
private static void ChangeEntityStateValue(string entityStateConfiguration, string fieldName, string newValue)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
EntityStateConfiguration val = Addressables.LoadAssetAsync<EntityStateConfiguration>((object)entityStateConfiguration).WaitForCompletion();
for (int i = 0; i < val.serializedFieldsCollection.serializedFields.Length; i++)
{
if (val.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
{
val.serializedFieldsCollection.serializedFields[i].fieldValue.stringValue = newValue;
}
}
}
}
[BepInPlugin("com.Nuxlar.VoidBeacon", "VoidBeacon", "1.0.2")]
public class VoidBeacon : BaseUnityPlugin
{
private GameObject voidThing = PrefabAPI.InstantiateClone(((Component)Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/voidstage/VoidXYZMesh1OpenVariant.prefab").WaitForCompletion().transform.GetChild(2)).gameObject, "VoidBeaconSphere");
private GameObject voidBattery = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/DeepVoidPortalBattery/mdlVoidSignal.fbx").WaitForCompletion(), "VoidBeaconBase");
public void Awake()
{
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Expected O, but got Unknown
//IL_0193: 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_01b3: Unknown result type (might be due to invalid IL or missing references)
//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
//IL_01ea: 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_0221: Unknown result type (might be due to invalid IL or missing references)
//IL_0226: Unknown result type (might be due to invalid IL or missing references)
//IL_022e: Unknown result type (might be due to invalid IL or missing references)
//IL_0236: Expected O, but got Unknown
//IL_0236: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: 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_0244: Unknown result type (might be due to invalid IL or missing references)
//IL_024a: Expected O, but got Unknown
//IL_02be: Unknown result type (might be due to invalid IL or missing references)
//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
//IL_02fc: Expected O, but got Unknown
//IL_0303: Unknown result type (might be due to invalid IL or missing references)
//IL_030d: Expected O, but got Unknown
new Enemies();
voidThing.AddComponent<NetworkIdentity>();
voidThing.transform.parent = voidBattery.transform;
voidThing.transform.localPosition = new Vector3(0f, 4f, 0f);
voidThing.transform.localScale = new Vector3(2.5f, 2.5f, 2.5f);
voidBattery.transform.GetChild(2).localScale = new Vector3(1f, 1f, 2f);
((Object)voidBattery).name = "VoidBeacon";
voidBattery.AddComponent<NetworkIdentity>();
((Component)voidBattery.transform.GetChild(0)).gameObject.AddComponent<BoxCollider>();
PurchaseInteraction val = voidBattery.AddComponent<PurchaseInteraction>();
val.contextToken = "Broadcast Si?gnal??";
val.NetworkdisplayNameToken = "Broadcast Si?gnal??";
voidBattery.GetComponent<Highlight>().targetRenderer = (Renderer)(object)((Component)voidBattery.transform.GetChild(0)).GetComponent<SkinnedMeshRenderer>();
GameObject obj = Object.Instantiate<GameObject>(new GameObject("Trigger"), voidBattery.transform);
((Collider)obj.AddComponent<BoxCollider>()).isTrigger = true;
obj.AddComponent<EntityLocator>().entity = voidBattery;
voidBattery.AddComponent<VoidBeaconManager>().purchaseInteraction = val;
((Behaviour)voidBattery.AddComponent<CrystalManager>()).enabled = false;
CombatDirector obj2 = voidBattery.AddComponent<CombatDirector>();
((Behaviour)obj2).enabled = false;
obj2.moneyWaveIntervals = (RangeFloat[])(object)new RangeFloat[1]
{
new RangeFloat
{
min = 1f,
max = 1f
}
};
InteractableSpawnCard val2 = ScriptableObject.CreateInstance<InteractableSpawnCard>();
((Object)val2).name = "iscVoidBeacon";
((SpawnCard)val2).prefab = voidBattery;
((SpawnCard)val2).sendOverNetwork = true;
((SpawnCard)val2).hullSize = (HullClassification)0;
((SpawnCard)val2).nodeGraphType = (GraphType)0;
((SpawnCard)val2).requiredFlags = (NodeFlags)0;
((SpawnCard)val2).forbiddenFlags = (NodeFlags)16;
((SpawnCard)val2).directorCreditCost = 0;
((SpawnCard)val2).occupyPosition = true;
val2.orientToFloor = false;
val2.skipSpawnWhenSacrificeArtifactEnabled = false;
val2.maxSpawnsPerStage = 1;
DirectorCard card = new DirectorCard
{
selectionWeight = 10,
spawnCard = (SpawnCard)(object)val2
};
DirectorCardHolder val3 = new DirectorCardHolder
{
Card = card,
InteractableCategory = (InteractableCategory)4
};
foreach (Stage item in new List<Stage>
{
(Stage)4,
(Stage)2,
(Stage)8,
(Stage)16,
(Stage)262144,
(Stage)134217728,
(Stage)64,
(Stage)32,
(Stage)131072,
(Stage)256,
(Stage)16384
})
{
Helpers.AddNewInteractableToStage(val3, item, "");
}
FireMegaBlasterBase.OnEnter += new hook_OnEnter(ReduceZombieDamage);
DestroyTimeCrystals.GenerateString += new hook_GenerateString(DestroyTimeCrystals_GenerateString);
}
private void ReduceZombieDamage(orig_OnEnter orig, FireMegaBlasterBase self)
{
if (((Object)((EntityState)self).characterBody).name.Contains("VoidZombieNux"))
{
Debug.LogWarning((object)self.damageCoefficient);
if (self is FireMegaBlasterBig)
{
self.damageCoefficient = 6f;
}
if (self is FireMegaBlasterSmall)
{
self.damageCoefficient = 3f;
}
}
orig.Invoke(self);
}
private string DestroyTimeCrystals_GenerateString(orig_GenerateString orig, ObjectiveTracker self)
{
CrystalManager crystalManager = (CrystalManager)(object)InstanceTracker.FindInstancesEnumerable(typeof(CrystalManager)).First();
if (Object.op_Implicit((Object)(object)crystalManager))
{
return string.Format(Language.GetString(self.baseToken), crystalManager.crystalsKilled, crystalManager.crystalsRequiredToKill);
}
return orig.Invoke(self);
}
}
public class VoidBeaconManager : NetworkBehaviour
{
public PurchaseInteraction purchaseInteraction;
private GameObject shrineUseEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/ShrineUseEffect.prefab").WaitForCompletion();
private GameObject skybox = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/InfiniteTowerAssets/Weather, InfiniteTower.prefab").WaitForCompletion();
private GameObject signalEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorMegaBlasterExplosion.prefab").WaitForCompletion();
public void Start()
{
if (NetworkServer.active && Object.op_Implicit((Object)(object)Run.instance))
{
purchaseInteraction.SetAvailable(true);
}
((UnityEvent<Interactor>)(object)purchaseInteraction.onPurchase).AddListener((UnityAction<Interactor>)OnPurchase);
}
[Server]
public void OnPurchase(Interactor interactor)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_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_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_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Expected O, but got Unknown
//IL_007b: 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_0082: 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_008d: 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_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: Expected O, but got Unknown
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Expected O, but got Unknown
if (!NetworkServer.active)
{
Debug.LogWarning((object)"[Server] function 'VoidBeaconManager::OnPurchase(RoR2.Interactor)' called on client");
return;
}
EffectManager.SpawnEffect(shrineUseEffect, new EffectData
{
origin = ((Component)this).gameObject.transform.position,
rotation = Quaternion.identity,
scale = 3f,
color = Color32.op_Implicit(Color.magenta)
}, true);
Transform val = ((Component)this).gameObject.transform.Find("VoidBeaconSphere");
EffectManager.SpawnEffect(signalEffect, new EffectData
{
origin = val.position,
rotation = Quaternion.identity,
scale = 1f
}, true);
((Component)val).gameObject.SetActive(false);
((Component)this).gameObject.GetComponent<PurchaseInteraction>().SetAvailable(false);
CrystalManager component = ((Component)this).gameObject.GetComponent<CrystalManager>();
component.skyboxInstance = Object.Instantiate<GameObject>(skybox, new Vector3(0f, 0f, 0f), Quaternion.identity);
((Behaviour)component).enabled = true;
CombatDirector component2 = ((Component)this).gameObject.GetComponent<CombatDirector>();
component2.monsterCredit = Mathf.CeilToInt(60f * Run.instance.difficultyCoefficient);
component2.monsterCardsSelection = new WeightedSelection<DirectorCard>(8);
component2.monsterCardsSelection.AddChoice(new DirectorCard
{
spawnCard = (SpawnCard)(object)Enemies.spawnCard,
selectionWeight = 1
}, 1f);
((Behaviour)component2).enabled = true;
if (Object.op_Implicit((Object)(object)TeleporterInteraction.instance))
{
ChildLocator component3 = ((Component)((Component)TeleporterInteraction.instance).GetComponent<ModelLocator>().modelTransform).GetComponent<ChildLocator>();
if (Object.op_Implicit((Object)(object)component3))
{
((Component)component3.FindChild("TimeCrystalProps")).gameObject.SetActive(true);
((Component)component3.FindChild("TimeCrystalBeaconBlocker")).gameObject.SetActive(true);
}
}
}
}
public class CrystalManager : MonoBehaviour
{
public GameObject skyboxInstance;
public SpawnCard crystalSpawnCard = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/Base/WeeklyRun/bscTimeCrystal.asset").WaitForCompletion();
public uint crystalCount = 3u;
public uint crystalsRequiredToKill = 3u;
private BasicPickupDropTable voidDropTable = Addressables.LoadAssetAsync<BasicPickupDropTable>((object)"RoR2/Base/Common/dtVoidChest.asset").WaitForCompletion();
private List<OnDestroyCallback> crystalActiveList = new List<OnDestroyCallback>();
public uint crystalsKilled => (uint)(crystalCount - crystalActiveList.Count);
public static event Action<CrystalManager> onBossGroupStartServer;
public void OnStart()
{
if (NetworkServer.active)
{
CrystalManager.onBossGroupStartServer?.Invoke(this);
}
}
private void OnEnable()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Expected O, but got Unknown
//IL_0008: 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_0037: Expected O, but got Unknown
DirectorPlacementRule val = new DirectorPlacementRule();
val.placementMode = (PlacementMode)4;
for (int i = 0; i < crystalCount; i++)
{
crystalActiveList.Add(OnDestroyCallback.AddCallback(DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(crystalSpawnCard, val, Run.instance.stageRng)), (Action<OnDestroyCallback>)delegate(OnDestroyCallback component)
{
crystalActiveList.Remove(component);
}));
}
InstanceTracker.Add<CrystalManager>(this);
ObjectivePanelController.collectObjectiveSources += ReportObjective;
}
private void OnDisable()
{
ObjectivePanelController.collectObjectiveSources -= ReportObjective;
InstanceTracker.Remove<CrystalManager>(this);
}
public void ReportObjective(CharacterMaster master, List<ObjectiveSourceDescriptor> output)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
if (crystalsKilled != crystalCount)
{
output.Add(new ObjectiveSourceDescriptor
{
source = (Object)(object)this,
master = master,
objectiveType = typeof(DestroyTimeCrystals)
});
}
}
public void FixedUpdate()
{
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Expected O, but got Unknown
//IL_00fc: 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_0111: Expected O, but got Unknown
if (!Object.op_Implicit((Object)(object)TeleporterInteraction.instance))
{
return;
}
bool flag = crystalsRequiredToKill > crystalsKilled;
if (flag == TeleporterInteraction.instance.locked)
{
return;
}
if (flag)
{
if (NetworkServer.active)
{
TeleporterInteraction.instance.locked = true;
}
return;
}
if (NetworkServer.active)
{
TeleporterInteraction.instance.locked = false;
}
ChildLocator component = ((Component)((Component)TeleporterInteraction.instance).GetComponent<ModelLocator>().modelTransform).GetComponent<ChildLocator>();
if (Object.op_Implicit((Object)(object)component))
{
Util.PlaySound("Play_outro_planetExplode_01", ((Component)TeleporterInteraction.instance).gameObject);
Transform val = component.FindChild("TimeCrystalBeaconBlocker");
EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/TimeCrystalDeath"), new EffectData
{
origin = ((Component)val).transform.position
}, false);
((Component)val).gameObject.SetActive(false);
((Behaviour)this).enabled = false;
TeleporterInteraction.instance.bossGroup.dropTable = (PickupDropTable)(object)voidDropTable;
Object.Destroy((Object)(object)skyboxInstance);
((Behaviour)((Component)this).gameObject.GetComponent<CombatDirector>()).enabled = false;
Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
{
baseToken = "<color=#9b42f5>The teleporter hums with a strange new energy...</color>"
});
}
}
}
public class VoidZombieSpawn : GenericCharacterSpawnState
{
private Animator modelAnimator;
private CharacterModel characterModel;
private bool hasLaunched;
public override void OnEnter()
{
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: 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_0074: 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_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Expected O, but got Unknown
((GenericCharacterSpawnState)this).OnEnter();
modelAnimator = ((EntityState)this).GetModelAnimator();
if (Object.op_Implicit((Object)(object)modelAnimator))
{
characterModel = ((Component)modelAnimator).gameObject.GetComponent<CharacterModel>();
CharacterModel obj = characterModel;
obj.invisibilityCount++;
}
Util.PlaySound("Play_voidJailer_spawn", ((EntityState)this).gameObject);
EffectManager.SpawnEffect(Enemies.voidZombieSpawnEffect, new EffectData
{
origin = ((EntityState)this).characterBody.footPosition,
rotation = Quaternion.identity,
scale = 1f
}, true);
}
public override void FixedUpdate()
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: 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_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Expected O, but got Unknown
((GenericCharacterSpawnState)this).FixedUpdate();
if (((EntityState)this).fixedAge >= 1f && !hasLaunched)
{
hasLaunched = true;
HealthComponent component = ((Component)((EntityState)this).characterBody).GetComponent<HealthComponent>();
if (Object.op_Implicit((Object)(object)component))
{
component.TakeDamageForce(new DamageInfo
{
attacker = ((EntityState)this).gameObject,
force = Vector3.up * 2000f,
position = ((EntityState)this).characterBody.corePosition
}, true, false);
CharacterModel obj = characterModel;
obj.invisibilityCount--;
}
}
}
}
}