using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using AccurateEnemies;
using BepInEx;
using BepInEx.Bootstrap;
using Direseeker;
using DireseekerMod.Components;
using DireseekerMod.Modules;
using DireseekerMod.States;
using DireseekerMod.States.Missions.DireseekerEncounter;
using EntityStates;
using EntityStates.LemurianBruiserMonster;
using EntityStates.TitanMonster;
using KinematicCharacterController;
using On.RoR2;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.CharacterAI;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using Zio.FileSystems;
[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("Direseeker")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+82b35bd8da9a9b2485cf0ad4e57c35965abde3e9")]
[assembly: AssemblyProduct("Direseeker")]
[assembly: AssemblyTitle("Direseeker")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Direseeker
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.rob.Direseeker", "Direseeker", "1.4.7")]
public class DireseekerPlugin : BaseUnityPlugin
{
public static bool AccurateEnemiesLoaded = false;
public static bool AccurateEnemiesCompat = true;
public static PluginInfo pluginInfo;
public void Awake()
{
AccurateEnemiesLoaded = Chainloader.PluginInfos.ContainsKey("com.Moffein.AccurateEnemies");
pluginInfo = ((BaseUnityPlugin)this).Info;
Assets.PopulateAssets();
Tokens.RegisterLanguageTokens();
Prefabs.CreatePrefab();
States.RegisterStates();
Skills.RegisterSkills();
Projectiles.CreateProjectiles();
SpawnCards.CreateSpawnCards();
Assets.UpdateAssets();
new Hooks().ApplyHooks();
}
}
}
namespace DireseekerMod.States
{
public class ChargeUltraFireball : BaseState
{
public static float baseDuration = 2f;
private float duration;
private GameObject chargeInstance;
public override void OnEnter()
{
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
((BaseState)this).OnEnter();
duration = baseDuration / base.attackSpeedStat;
Animator modelAnimator = ((EntityState)this).GetModelAnimator();
Transform modelTransform = ((EntityState)this).GetModelTransform();
Util.PlayAttackSpeedSound(ChargeMegaFireball.attackString, ((EntityState)this).gameObject, base.attackSpeedStat);
if (Object.op_Implicit((Object)(object)modelTransform))
{
ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
if (Object.op_Implicit((Object)(object)component))
{
Transform val = component.FindChild("MuzzleMouth");
if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)ChargeMegaFireball.chargeEffectPrefab))
{
chargeInstance = Object.Instantiate<GameObject>(ChargeMegaFireball.chargeEffectPrefab, val.position, val.rotation);
chargeInstance.transform.parent = val;
ScaleParticleSystemDuration component2 = chargeInstance.GetComponent<ScaleParticleSystemDuration>();
if (Object.op_Implicit((Object)(object)component2))
{
component2.newDuration = duration;
}
}
}
}
if (Object.op_Implicit((Object)(object)modelAnimator))
{
((EntityState)this).PlayCrossfade("Gesture, Additive", "ChargeMegaFireball", "ChargeMegaFireball.playbackRate", duration, 0.1f);
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
if (Object.op_Implicit((Object)(object)chargeInstance))
{
EntityState.Destroy((Object)(object)chargeInstance);
}
}
public override void Update()
{
((EntityState)this).Update();
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
FireUltraFireball nextState = new FireUltraFireball();
((EntityState)this).outer.SetNextState((EntityState)(object)nextState);
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)1;
}
}
public class Enrage : BaseState
{
private float lastUpdateTime;
public static float baseEntryDuration = 1.5f;
public static float baseExitDuration = 3.5f;
private float stopwatch;
private float entryDuration;
private float exitDuration;
private bool hasEnraged;
private bool heck;
private bool stoppedSound = false;
private ChildLocator childLocator;
private DireseekerController direController;
public override void OnEnter()
{
((BaseState)this).OnEnter();
lastUpdateTime = Time.time;
stopwatch = 0f;
entryDuration = baseEntryDuration / base.attackSpeedStat;
exitDuration = baseExitDuration / base.attackSpeedStat;
childLocator = ((EntityState)this).GetModelChildLocator();
direController = ((EntityState)this).GetComponent<DireseekerController>();
if (Object.op_Implicit((Object)(object)direController))
{
direController.StartRageMode();
}
if (NetworkServer.active)
{
((EntityState)this).characterBody.AddBuff(Buffs.ArmorBoost);
}
((EntityState)this).PlayAnimation("Gesture, Override", "PrepFlamebreath", "PrepFlamebreath.playbackRate", entryDuration, 0f);
Util.PlaySound("Play_magmaWorm_spawn_VO", ((EntityState)this).gameObject);
}
private void GrantItems()
{
if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master.inventory))
{
((EntityState)this).characterBody.master.inventory.GiveItem(Items.AdaptiveArmor, 1);
((EntityState)this).characterBody.master.inventory.GiveItem(Items.AlienHead, 2);
((EntityState)this).characterBody.master.inventory.GiveItem(Items.Hoof, 5);
((EntityState)this).characterBody.master.inventory.GiveItem(Items.Syringe, 5);
}
}
public override void OnExit()
{
((EntityState)this).PlayCrossfade("Gesture, Override", "BufferEmpty", 0.1f);
((EntityState)this).OnExit();
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
float num = Time.time - lastUpdateTime;
lastUpdateTime = Time.time;
stopwatch += num;
if (stopwatch >= entryDuration && !hasEnraged)
{
hasEnraged = true;
GrantItems();
stoppedSound = true;
Transform modelTransform = ((EntityState)this).GetModelTransform();
if (Object.op_Implicit((Object)(object)modelTransform))
{
CharacterModel component = ((Component)modelTransform).gameObject.GetComponent<CharacterModel>();
if (Object.op_Implicit((Object)(object)component))
{
if (component.temporaryOverlays == null)
{
component.temporaryOverlays = new List<TemporaryOverlayInstance>();
}
TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((Component)component).gameObject);
val.duration = 1f;
val.animateShaderAlpha = true;
val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
val.destroyComponentOnEnd = true;
val.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matOnFire");
val.inspectorCharacterModel = component;
val.Start();
}
}
((EntityState)this).PlayAnimation("Gesture, Override", "Flamebreath", "Flamebreath.playbackRate", exitDuration, 0f);
}
if (stopwatch >= entryDuration + 0.75f * exitDuration && !heck)
{
heck = true;
((EntityState)this).PlayCrossfade("Gesture, Override", "ExitFlamebreath", "ExitFlamebreath.playbackRate", 0.75f * exitDuration, 0.1f);
if (NetworkServer.active)
{
((EntityState)this).characterBody.RemoveBuff(Buffs.ArmorBoost);
}
}
if (stopwatch >= entryDuration + exitDuration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)1;
}
}
public class FireUltraFireball : BaseState
{
public static int projectileCount = 15;
public static float totalYawSpread = 25f;
public static float baseDuration = 1.5f;
public static float baseFireDuration = 0.25f;
public static float damageCoefficient = 1.4f;
public static float projectileSpeed = 80f;
public static float force = 1200f;
private float duration;
private float fireDuration;
private int projectilesFired;
private DireseekerController direController;
public override void OnEnter()
{
((BaseState)this).OnEnter();
duration = baseDuration / base.attackSpeedStat;
fireDuration = baseFireDuration / base.attackSpeedStat;
direController = ((EntityState)this).GetComponent<DireseekerController>();
if (Object.op_Implicit((Object)(object)direController))
{
direController.FlameBurst();
}
((EntityState)this).PlayAnimation("Gesture, Additive", "FireMegaFireball", "FireMegaFireball.playbackRate", duration, 0f);
Util.PlaySound(FireMegaFireball.attackString, ((EntityState)this).gameObject);
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
public override void FixedUpdate()
{
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: 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_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).FixedUpdate();
string text = "MuzzleMouth";
if (((EntityState)this).isAuthority)
{
int num = Mathf.FloorToInt(((EntityState)this).fixedAge / fireDuration * (float)projectileCount);
if (projectilesFired <= num && projectilesFired < projectileCount)
{
if (Object.op_Implicit((Object)(object)FireMegaFireball.muzzleflashEffectPrefab))
{
EffectManager.SimpleMuzzleFlash(FireMegaFireball.muzzleflashEffectPrefab, ((EntityState)this).gameObject, text, false);
}
Ray aimRay = ((BaseState)this).GetAimRay();
float num2 = projectileSpeed;
if (DireseekerPlugin.AccurateEnemiesLoaded && DireseekerPlugin.AccurateEnemiesCompat)
{
aimRay = PredictAimRay(aimRay, num2);
}
float num3 = (float)Mathf.FloorToInt((float)projectilesFired - (float)(projectileCount - 1) / 2f) / (float)(projectileCount - 1) * totalYawSpread;
Vector3 val = Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 0f, 1f, 1f, num3, 0f);
ProjectileManager.instance.FireProjectile(Projectiles.fireballPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(val), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, force, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, num2);
projectilesFired++;
}
}
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)1;
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
private Ray PredictAimRay(Ray aimRay, float speedOverride)
{
//IL_009b: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: 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_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: 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_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && !((EntityState)this).characterBody.isPlayerControlled && (AccurateEnemiesPlugin.alwaysAllowBosses || !AccurateEnemiesPlugin.eliteOnly || ((EntityState)this).characterBody.isElite))
{
HurtBox masterAITargetHurtbox = Util.GetMasterAITargetHurtbox(((EntityState)this).characterBody.master);
Ray result;
if (speedOverride > 0f)
{
speedOverride = AccurateEnemiesPlugin.GetProjectileSimpleModifiers(speedOverride);
result = Util.PredictAimray(aimRay, ((BaseState)this).GetTeam(), AccurateEnemiesPlugin.basePredictionAngle, speedOverride, masterAITargetHurtbox);
}
else
{
result = Util.PredictAimrayPS(aimRay, ((BaseState)this).GetTeam(), AccurateEnemiesPlugin.basePredictionAngle, Projectiles.fireballPrefab, masterAITargetHurtbox);
}
return result;
}
return aimRay;
}
}
public class FlamePillar : BaseState
{
private enum SubState
{
Prep,
FirePillar,
Exit
}
private class Predictor
{
private enum ExtrapolationType
{
None,
Linear,
Polar
}
private Transform bodyTransform;
private Transform targetTransform;
private Vector3 targetPosition0;
private Vector3 targetPosition1;
private Vector3 targetPosition2;
private int collectedPositions;
public bool hasTargetTransform => Object.op_Implicit((Object)(object)targetTransform);
public bool isPredictionReady => collectedPositions > 2;
public Predictor(Transform bodyTransform)
{
this.bodyTransform = bodyTransform;
}
private void PushTargetPosition(Vector3 newTargetPosition)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: 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_001b: Unknown result type (might be due to invalid IL or missing references)
targetPosition2 = targetPosition1;
targetPosition1 = targetPosition0;
targetPosition0 = newTargetPosition;
collectedPositions++;
}
public void SetTargetTransform(Transform newTargetTransform)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: 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_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
targetTransform = newTargetTransform;
targetPosition2 = (targetPosition1 = (targetPosition0 = newTargetTransform.position));
collectedPositions = 1;
}
public void Update()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)targetTransform))
{
PushTargetPosition(targetTransform.position);
}
}
public bool GetPredictedTargetPosition(float time, out Vector3 predictedPosition)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0014: 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_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_003d: 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_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: 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_006e: 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_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_0222: Unknown result type (might be due to invalid IL or missing references)
//IL_0227: Unknown result type (might be due to invalid IL or missing references)
//IL_022c: Unknown result type (might be due to invalid IL or missing references)
//IL_0231: Unknown result type (might be due to invalid IL or missing references)
//IL_0236: 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_024c: Unknown result type (might be due to invalid IL or missing references)
//IL_0251: Unknown result type (might be due to invalid IL or missing references)
//IL_0256: Unknown result type (might be due to invalid IL or missing references)
//IL_025b: Unknown result type (might be due to invalid IL or missing references)
//IL_026c: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: 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_00ff: 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_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_012c: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: 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_0157: 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_0168: Unknown result type (might be due to invalid IL or missing references)
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
//IL_016f: Unknown result type (might be due to invalid IL or missing references)
//IL_028a: Unknown result type (might be due to invalid IL or missing references)
//IL_028f: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
//IL_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_01ef: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0201: Unknown result type (might be due to invalid IL or missing references)
//IL_0212: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = targetPosition1 - targetPosition2;
Vector3 val2 = targetPosition0 - targetPosition1;
val.y = 0f;
val2.y = 0f;
ExtrapolationType extrapolationType;
if (val == Vector3.zero || val2 == Vector3.zero)
{
extrapolationType = ExtrapolationType.None;
}
else
{
Vector3 normalized = ((Vector3)(ref val)).normalized;
Vector3 normalized2 = ((Vector3)(ref val2)).normalized;
extrapolationType = ((Vector3.Dot(normalized, normalized2) > 0.98f) ? ExtrapolationType.Linear : ExtrapolationType.Polar);
}
float num = 1f / Time.fixedDeltaTime;
predictedPosition = targetPosition0;
switch (extrapolationType)
{
case ExtrapolationType.Polar:
{
Vector3 position = bodyTransform.position;
Vector3 val3 = Vector2.op_Implicit(Util.Vector3XZToVector2XY(targetPosition2 - position));
Vector3 val4 = Vector2.op_Implicit(Util.Vector3XZToVector2XY(targetPosition1 - position));
Vector3 val5 = Vector2.op_Implicit(Util.Vector3XZToVector2XY(targetPosition0 - position));
float magnitude = ((Vector3)(ref val3)).magnitude;
float magnitude2 = ((Vector3)(ref val4)).magnitude;
float magnitude3 = ((Vector3)(ref val5)).magnitude;
float num2 = Vector2.SignedAngle(Vector2.op_Implicit(val3), Vector2.op_Implicit(val4)) * num;
float num3 = Vector2.SignedAngle(Vector2.op_Implicit(val4), Vector2.op_Implicit(val5)) * num;
float num4 = (magnitude2 - magnitude) * num;
float num5 = (magnitude3 - magnitude2) * num;
float num6 = (num2 + num3) * 0.5f;
float num7 = (num4 + num5) * 0.5f;
float num8 = magnitude3 + num7 * time;
if (num8 < 0f)
{
num8 = 0f;
}
Vector2 val6 = Util.RotateVector2(Vector2.op_Implicit(val5), num6 * time);
val6 *= num8 * magnitude3;
predictedPosition = position;
predictedPosition.x += val6.x;
predictedPosition.z += val6.y;
break;
}
case ExtrapolationType.Linear:
predictedPosition = targetPosition0 + val2 * (time * num);
break;
}
RaycastHit val7 = default(RaycastHit);
if (Physics.Raycast(new Ray(predictedPosition + Vector3.up * 1f, Vector3.down), ref val7, 200f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
{
predictedPosition = ((RaycastHit)(ref val7)).point;
return true;
}
return false;
}
}
private float lastUpdateTime;
private float deltaTime;
public static float entryDuration = 1.5f;
public static float fireDuration = 0.5f;
public static float exitDuration = 0.5f;
public static float maxDistance = 128f;
public static float trackingDuration = 0.85f;
public static float pillarDamageCoefficient = 6f;
public static float pillarForce = 2000f;
public static float pillarVerticalForce = 4000f;
public static float pillarRadius = 6f;
public static float pillarDelay = 2f;
private bool hasShownPrediction;
private bool predictionOk;
protected Vector3 predictedTargetPosition;
private AimAnimator aimAnimator;
private GameObject chargeInstance;
private float stopwatch;
private SubState subState;
private Predictor predictor;
public override void OnEnter()
{
//IL_0230: Unknown result type (might be due to invalid IL or missing references)
//IL_0237: Expected O, but got Unknown
//IL_0239: Unknown result type (might be due to invalid IL or missing references)
//IL_023e: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_0291: Unknown result type (might be due to invalid IL or missing references)
//IL_0297: Unknown result type (might be due to invalid IL or missing references)
//IL_029c: Unknown result type (might be due to invalid IL or missing references)
//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
//IL_0266: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
((BaseState)this).OnEnter();
lastUpdateTime = Time.time;
stopwatch = 0f;
if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
{
ChildLocator component = ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent<ChildLocator>();
aimAnimator = ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent<AimAnimator>();
if (Object.op_Implicit((Object)(object)aimAnimator))
{
((Behaviour)aimAnimator).enabled = true;
}
if (Object.op_Implicit((Object)(object)component))
{
Transform modelTransform = ((EntityState)this).GetModelTransform();
if (Object.op_Implicit((Object)(object)modelTransform))
{
CharacterModel component2 = ((Component)modelTransform).gameObject.GetComponent<CharacterModel>();
if (Object.op_Implicit((Object)(object)component2))
{
if (component2.temporaryOverlays == null)
{
component2.temporaryOverlays = new List<TemporaryOverlayInstance>();
}
TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((Component)component2).gameObject);
val.duration = 3f;
val.animateShaderAlpha = true;
val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
val.destroyComponentOnEnd = true;
val.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matOnFire");
val.inspectorCharacterModel = component2;
val.Start();
}
}
Transform val2 = component.FindChild("MuzzleMouth");
if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)ChargeMegaFireball.chargeEffectPrefab))
{
chargeInstance = Object.Instantiate<GameObject>(ChargeMegaFireball.chargeEffectPrefab, val2.position, val2.rotation);
chargeInstance.transform.parent = val2;
ScaleParticleSystemDuration component3 = chargeInstance.GetComponent<ScaleParticleSystemDuration>();
if (Object.op_Implicit((Object)(object)component3))
{
component3.newDuration = 0.5f;
}
}
}
}
((EntityState)this).PlayAnimation("Gesture, Override", "PrepFlamebreath", "PrepFlamebreath.playbackRate", entryDuration, 0f);
subState = SubState.Prep;
Util.PlaySound("Play_magmaWorm_spawn_VO", ((EntityState)this).gameObject);
if (NetworkServer.active)
{
BullseyeSearch val3 = new BullseyeSearch();
val3.teamMaskFilter = TeamMask.allButNeutral;
if (Object.op_Implicit((Object)(object)((EntityState)this).teamComponent))
{
((TeamMask)(ref val3.teamMaskFilter)).RemoveTeam(((EntityState)this).teamComponent.teamIndex);
}
val3.maxDistanceFilter = maxDistance;
val3.maxAngleFilter = 90f;
Ray aimRay = ((BaseState)this).GetAimRay();
val3.searchOrigin = ((Ray)(ref aimRay)).origin;
val3.searchDirection = ((Ray)(ref aimRay)).direction;
val3.filterByLoS = false;
val3.sortMode = (SortMode)2;
val3.RefreshCandidates();
HurtBox val4 = val3.GetResults().FirstOrDefault();
if (Object.op_Implicit((Object)(object)val4))
{
predictor = new Predictor(((EntityState)this).transform);
predictor.SetTargetTransform(((Component)val4).transform);
}
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
if (Object.op_Implicit((Object)(object)chargeInstance))
{
EntityState.Destroy((Object)(object)chargeInstance);
}
((EntityState)this).PlayCrossfade("Gesture, Override", "BufferEmpty", 0.1f);
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
deltaTime = Time.time - lastUpdateTime;
lastUpdateTime = Time.time;
stopwatch += deltaTime;
switch (subState)
{
case SubState.Prep:
if (predictor != null)
{
predictor.Update();
}
if (stopwatch <= trackingDuration)
{
if (predictor != null)
{
predictionOk = predictor.GetPredictedTargetPosition(entryDuration - trackingDuration, out predictedTargetPosition);
}
}
else if (!hasShownPrediction)
{
hasShownPrediction = true;
PlacePredictedAttack();
}
if (stopwatch >= entryDuration)
{
predictor = null;
subState = SubState.FirePillar;
stopwatch = 0f;
((EntityState)this).PlayAnimation("Gesture, Override", "Flamebreath", "Flamebreath.playbackRate", entryDuration, 0f);
if (Object.op_Implicit((Object)(object)chargeInstance))
{
EntityState.Destroy((Object)(object)chargeInstance);
}
}
break;
case SubState.FirePillar:
if (stopwatch >= fireDuration)
{
subState = SubState.Exit;
stopwatch = 0f;
((EntityState)this).PlayCrossfade("Gesture, Override", "ExitFlamebreath", "ExitFlamebreath.playbackRate", fireDuration, 0.1f);
}
break;
case SubState.Exit:
if (stopwatch >= exitDuration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
break;
}
}
protected virtual void PlacePredictedAttack()
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
PlaceSingleDelayBlast(predictedTargetPosition, 0f);
}
protected void PlaceSingleDelayBlast(Vector3 position, float delay)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//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_0034: Expected O, but got Unknown
//IL_003f: 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_0053: 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_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_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/MeteorStrikePredictionEffect"), new EffectData
{
origin = position,
scale = pillarRadius,
rotation = Quaternion.identity
}, true);
GameObject val = Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/GenericDelayBlast"), position, Quaternion.identity);
DelayBlast component = val.GetComponent<DelayBlast>();
component.position = position;
component.baseDamage = base.damageStat * pillarDamageCoefficient;
component.baseForce = pillarForce;
component.bonusForce = pillarVerticalForce * Vector3.up;
component.attacker = ((EntityState)this).gameObject;
component.radius = pillarRadius;
component.crit = ((BaseState)this).RollCrit();
component.maxTimer = entryDuration - trackingDuration + delay;
component.falloffModel = (FalloffModel)0;
component.explosionEffect = LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/MagmaOrbProjectile").GetComponent<ProjectileImpactExplosion>().impactEffect;
component.maxTimer = pillarDelay;
val.GetComponent<TeamFilter>().teamIndex = TeamComponent.GetObjectTeam(component.attacker);
}
}
public class FlamePillars : FlamePillar
{
protected override void PlacePredictedAttack()
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_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_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: 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_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: 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_0083: 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)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: 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)
RaycastHit val4 = default(RaycastHit);
for (int i = 0; i < 2; i++)
{
int num = 0;
Vector3 val = predictedTargetPosition;
Vector3 val2 = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f) * Vector3.forward;
for (int j = -(2 * FireGoldFist.fistCount / 2); j < 2 * FireGoldFist.fistCount / 2; j++)
{
Vector3 val3 = val + val2 * FireGoldFist.distanceBetweenFists * (float)j;
float num2 = 60f;
if (Physics.Raycast(new Ray(val3 + Vector3.up * (num2 / 2f), Vector3.down), ref val4, num2, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
{
val3 = ((RaycastHit)(ref val4)).point;
}
PlaceSingleDelayBlast(val3, FireGoldFist.delayBetweenFists * (float)num);
num++;
}
}
}
}
public class Flamethrower : BaseState
{
private float lastUpdateTime;
public static GameObject flamethrowerEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Lemurian/FlamebreathEffect.prefab").WaitForCompletion();
public static float baseEntryDuration = 0.5f;
public static float baseExitDuration = 0.75f;
public static float baseFlamethrowerDuration = 2.25f;
private float tickDamageCoefficient;
private float flamethrowerStopwatch;
private float stopwatch;
private float entryDuration;
private float exitDuration;
private float flamethrowerDuration;
private bool hasBegunFlamethrower;
private ChildLocator childLocator;
private Transform flamethrowerEffectInstance;
private Transform secondaryFlamethrowerEffectInstance;
private Transform muzzleTransform;
private bool isCrit;
private const float flamethrowerEffectBaseDistance = 16f;
public override void OnEnter()
{
((BaseState)this).OnEnter();
lastUpdateTime = Time.time;
stopwatch = 0f;
entryDuration = baseEntryDuration / base.attackSpeedStat;
exitDuration = baseExitDuration / base.attackSpeedStat;
flamethrowerDuration = baseFlamethrowerDuration;
Transform modelTransform = ((EntityState)this).GetModelTransform();
if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
{
((EntityState)this).characterBody.SetAimTimer(entryDuration + flamethrowerDuration + 1f);
}
if (Object.op_Implicit((Object)(object)modelTransform))
{
childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
((Behaviour)((Component)modelTransform).GetComponent<AimAnimator>()).enabled = true;
}
float num = flamethrowerDuration * Flamebreath.tickFrequency;
tickDamageCoefficient = Flamebreath.totalDamageCoefficient / num;
if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
{
isCrit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master);
}
((EntityState)this).PlayAnimation("Gesture, Override", "PrepFlamebreath", "PrepFlamebreath.playbackRate", entryDuration, 0f);
}
public override void OnExit()
{
Util.PlaySound(Flamebreath.endAttackSoundString, ((EntityState)this).gameObject);
((EntityState)this).PlayCrossfade("Gesture, Override", "BufferEmpty", 0.1f);
if (Object.op_Implicit((Object)(object)flamethrowerEffectInstance))
{
EntityState.Destroy((Object)(object)((Component)flamethrowerEffectInstance).gameObject);
}
if (Object.op_Implicit((Object)(object)secondaryFlamethrowerEffectInstance))
{
EntityState.Destroy((Object)(object)((Component)secondaryFlamethrowerEffectInstance).gameObject);
}
((EntityState)this).OnExit();
}
private void FireFlame(string muzzleString)
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: 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_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_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)muzzleTransform))
{
new BulletAttack
{
owner = ((EntityState)this).gameObject,
weapon = ((EntityState)this).gameObject,
origin = muzzleTransform.position,
aimVector = muzzleTransform.forward,
minSpread = 0f,
maxSpread = Flamebreath.maxSpread,
damage = tickDamageCoefficient * base.damageStat,
force = Flamebreath.force,
muzzleName = muzzleString,
hitEffectPrefab = Flamebreath.impactEffectPrefab,
isCrit = isCrit,
radius = Flamebreath.radius,
falloffModel = (FalloffModel)0,
stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask,
procCoefficient = Flamebreath.procCoefficientPerTick,
maxDistance = Flamebreath.maxDistance,
smartCollision = true,
damageType = DamageTypeCombo.op_Implicit((DamageType)8192)
}.Fire();
}
}
public override void FixedUpdate()
{
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_018b: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).FixedUpdate();
float num = Time.time - lastUpdateTime;
lastUpdateTime = Time.time;
stopwatch += num;
if (stopwatch >= entryDuration && stopwatch < entryDuration + flamethrowerDuration && !hasBegunFlamethrower)
{
hasBegunFlamethrower = true;
Util.PlaySound(Flamebreath.startAttackSoundString, ((EntityState)this).gameObject);
((EntityState)this).PlayAnimation("Gesture, Override", "Flamebreath", "Flamebreath.playbackRate", flamethrowerDuration, 0f);
if (Object.op_Implicit((Object)(object)childLocator))
{
muzzleTransform = childLocator.FindChild("MuzzleMouth");
if (Object.op_Implicit((Object)(object)Flamebreath.flamethrowerEffectPrefab))
{
flamethrowerEffectInstance = Object.Instantiate<GameObject>(Flamebreath.flamethrowerEffectPrefab, muzzleTransform).transform;
((Component)flamethrowerEffectInstance).transform.localPosition = Vector3.zero;
((Component)flamethrowerEffectInstance).GetComponent<ScaleParticleSystemDuration>().newDuration = flamethrowerDuration;
}
if (Object.op_Implicit((Object)(object)flamethrowerEffectPrefab))
{
secondaryFlamethrowerEffectInstance = Object.Instantiate<GameObject>(flamethrowerEffectPrefab, muzzleTransform).transform;
Transform transform = ((Component)secondaryFlamethrowerEffectInstance).transform;
transform.localScale *= 1.25f;
((Component)secondaryFlamethrowerEffectInstance).transform.localPosition = Vector3.zero;
((Component)secondaryFlamethrowerEffectInstance).GetComponent<ScaleParticleSystemDuration>().newDuration = flamethrowerDuration;
}
}
}
if (stopwatch >= entryDuration + flamethrowerDuration && hasBegunFlamethrower)
{
hasBegunFlamethrower = false;
((EntityState)this).PlayCrossfade("Gesture, Override", "ExitFlamebreath", "ExitFlamebreath.playbackRate", exitDuration, 0.1f);
}
if (hasBegunFlamethrower)
{
flamethrowerStopwatch += num;
if (flamethrowerStopwatch > 1f / Flamebreath.tickFrequency)
{
flamethrowerStopwatch -= 1f / Flamebreath.tickFrequency;
FireFlame("MuzzleCenter");
}
}
else if (Object.op_Implicit((Object)(object)flamethrowerEffectInstance))
{
EntityState.Destroy((Object)(object)((Component)flamethrowerEffectInstance).gameObject);
}
if (stopwatch >= flamethrowerDuration + entryDuration + exitDuration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)1;
}
}
public class SpawnState : EntityState
{
private float lastUpdateTime;
public static float duration = 2.5f;
private float effectStopwatch;
public override void OnEnter()
{
((EntityState)this).OnEnter();
lastUpdateTime = Time.time;
((EntityState)this).GetModelAnimator();
Util.PlaySound(SpawnState.spawnSoundString, ((EntityState)this).gameObject);
Util.PlaySound("Play_magmaWorm_spawn_VO", ((EntityState)this).gameObject);
((EntityState)this).PlayAnimation("Body", "Spawn", "Spawn.playbackRate", duration, 0f);
EffectManager.SimpleMuzzleFlash(SpawnState.spawnEffectPrefab, ((EntityState)this).gameObject, "SpawnEffectOrigin", false);
effectStopwatch = 0.7f;
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
float num = Time.time - lastUpdateTime;
lastUpdateTime = Time.time;
effectStopwatch -= num;
if ((effectStopwatch <= 0f) & (((EntityState)this).fixedAge < 0.5f * duration))
{
PlaySpawnEffect();
}
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
base.outer.SetNextStateToMain();
}
}
private void PlaySpawnEffect()
{
//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_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: 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_004d: 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_0053: 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_006b: Expected O, but got Unknown
effectStopwatch = 0.1f;
for (int i = 0; i <= 5; i++)
{
Vector3 origin = ((EntityState)this).characterBody.footPosition + Random.insideUnitSphere * 22f;
origin.y = ((EntityState)this).characterBody.footPosition.y;
EffectManager.SpawnEffect(SpawnState.spawnEffectPrefab, new EffectData
{
origin = origin,
scale = 4f
}, true);
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)7;
}
}
}
namespace DireseekerMod.States.Missions.DireseekerEncounter
{
public class Listening : EntityState
{
public static float delayBeforeBeginningEncounter = 3f;
public static int buttonsPressedToTriggerEncounter = 4;
private ScriptedCombatEncounter scriptedCombatEncounter;
private List<DireseekerButtonController> buttonList = new List<DireseekerButtonController>();
private const float delayBeforeRegisteringButtons = 2f;
private bool hasRegisteredButtons;
private int previousPressedButtonCount;
private bool beginEncounterCountdown;
private float encounterCountdown;
public override void OnEnter()
{
((EntityState)this).OnEnter();
scriptedCombatEncounter = ((EntityState)this).GetComponent<ScriptedCombatEncounter>();
}
public override void FixedUpdate()
{
//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_00c0: Expected O, but got Unknown
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Expected O, but got Unknown
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_0164: Expected O, but got Unknown
((EntityState)this).FixedUpdate();
if (!NetworkServer.active)
{
return;
}
if (((EntityState)this).fixedAge >= 2f)
{
RegisterButtons();
}
if (!hasRegisteredButtons)
{
return;
}
int num = 0;
for (int i = 0; i < buttonList.Count; i++)
{
if (buttonList[i].isPressedServer)
{
num++;
}
}
int num2 = buttonsPressedToTriggerEncounter - 1;
if (previousPressedButtonCount < num2 && num >= num2)
{
Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
{
baseToken = "DIRESEEKER_SPAWN_WARNING"
});
}
if (num >= buttonsPressedToTriggerEncounter && !beginEncounterCountdown)
{
encounterCountdown = delayBeforeBeginningEncounter;
beginEncounterCountdown = true;
Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
{
baseToken = "DIRESEEKER_SPAWN_BEGIN"
});
}
if (beginEncounterCountdown)
{
encounterCountdown -= Time.fixedDeltaTime;
if (encounterCountdown <= 0f)
{
scriptedCombatEncounter.BeginEncounter();
base.outer.SetNextState((EntityState)new Idle());
}
}
previousPressedButtonCount = num;
}
private void RegisterButtons()
{
if (!hasRegisteredButtons)
{
DireseekerButtonController[] array = Object.FindObjectsOfType<DireseekerButtonController>();
foreach (DireseekerButtonController item in array)
{
buttonList.Add(item);
}
hasRegisteredButtons = true;
}
}
}
}
namespace DireseekerMod.Modules
{
public static class Assets
{
public static AssetBundle mainAssetBundle;
public static Texture bossPortrait;
public static Texture charPortrait;
public static GameObject flamePillarPredictionEffect;
public static GameObject direseekerEncounter;
public static GameObject direseekerButton;
public static void PopulateAssets()
{
if ((Object)(object)mainAssetBundle == (Object)null)
{
using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Direseeker.direseeker");
mainAssetBundle = AssetBundle.LoadFromStream(stream);
}
bossPortrait = (Texture)(object)mainAssetBundle.LoadAsset<Sprite>("texDireseekerIcon").texture;
charPortrait = (Texture)(object)mainAssetBundle.LoadAsset<Sprite>("texDireseekerPlayerIcon").texture;
direseekerEncounter = mainAssetBundle.LoadAsset<GameObject>("BossEncounter");
direseekerEncounter.AddComponent<NetworkIdentity>();
PrefabAPI.RegisterNetworkPrefab(direseekerEncounter);
direseekerButton = mainAssetBundle.LoadAsset<GameObject>("DireseekerButton");
Shader shader = LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/hgstandard");
Material material = ((Renderer)direseekerButton.GetComponentInChildren<SkinnedMeshRenderer>()).material;
material.shader = shader;
direseekerButton.AddComponent<DireseekerButtonController>();
direseekerButton.AddComponent<NetworkIdentity>();
PrefabAPI.RegisterNetworkPrefab(direseekerButton);
mainAssetBundle.LoadAsset<Material>("matPillarPrediction").shader = shader;
flamePillarPredictionEffect = LoadEffect("FlamePillarPredictionEffect", "");
}
public static void UpdateAssets()
{
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
GameObject gameObject = ((Component)direseekerEncounter.transform.GetChild(0)).gameObject;
gameObject.AddComponent<NetworkIdentity>();
PrefabAPI.RegisterNetworkPrefab(gameObject);
ScriptedCombatEncounter val = gameObject.AddComponent<ScriptedCombatEncounter>();
direseekerEncounter.transform.GetChild(0).GetChild(1).Translate(0f, 1f, 0f);
val.spawns = (SpawnInfo[])(object)new SpawnInfo[1]
{
new SpawnInfo
{
explicitSpawnPosition = direseekerEncounter.transform.GetChild(0).GetChild(0),
spawnCard = (SpawnCard)(object)SpawnCards.bossSpawnCard
}
};
val.randomizeSeed = false;
val.teamIndex = (TeamIndex)2;
val.spawnOnStart = false;
val.grantUniqueBonusScaling = true;
BossGroup val2 = gameObject.AddComponent<BossGroup>();
val2.bossDropChance = 1f;
val2.dropPosition = direseekerEncounter.transform.GetChild(0).GetChild(1);
val2.forceTier3Reward = true;
val2.scaleRewardsByPlayerCount = true;
val2.shouldDisplayHealthBarOnHud = true;
CombatSquad val3 = gameObject.AddComponent<CombatSquad>();
EntityStateMachine val4 = gameObject.AddComponent<EntityStateMachine>();
val4.initialStateType = new SerializableEntityStateType(typeof(Listening));
val4.mainStateType = new SerializableEntityStateType(typeof(Listening));
}
private static GameObject LoadEffect(string resourceName, string soundName)
{
//IL_002b: 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)
GameObject val = mainAssetBundle.LoadAsset<GameObject>(resourceName);
val.AddComponent<DestroyOnTimer>().duration = 12f;
val.AddComponent<NetworkIdentity>();
val.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
EffectComponent val2 = val.AddComponent<EffectComponent>();
val2.applyScale = false;
val2.effectIndex = (EffectIndex)(-1);
val2.parentToReferencedTransform = true;
val2.positionAtReferencedTransform = true;
val2.soundName = soundName;
ContentAddition.AddEffect(val);
return val;
}
}
public class Hooks
{
public Vector3[] buttonPosition;
public Vector3[] buttonRotation;
private void InitButtonPositions()
{
//IL_0019: 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_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_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_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: 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_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
//IL_016e: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_0189: Unknown result type (might be due to invalid IL or missing references)
buttonPosition = (Vector3[])(object)new Vector3[7]
{
new Vector3(2f, -140.5f, -439f),
new Vector3(110f, -179.2f, -150f),
new Vector3(203f, -75f, -195.5f),
new Vector3(51f, -86f, -200.6f),
new Vector3(-154f, -153f, -103.6f),
new Vector3(-0.5f, -135.5f, -12.5f),
new Vector3(-37.5f, -127f, -287.8f)
};
buttonRotation = (Vector3[])(object)new Vector3[7]
{
new Vector3(0f, 60f, 5f),
new Vector3(0f, 45f, 0f),
new Vector3(290f, 340f, 0f),
new Vector3(270f, 0f, 0f),
new Vector3(270f, 0f, 0f),
new Vector3(0f, 0f, 0f),
new Vector3(0f, 90f, 110f)
};
}
public void ApplyHooks()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Expected O, but got Unknown
InitButtonPositions();
SceneDirector.Start += (hook_Start)delegate(orig_Start orig, SceneDirector self)
{
//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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: 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)
if (NetworkServer.active)
{
Scene activeScene = SceneManager.GetActiveScene();
if (((Scene)(ref activeScene)).name == "dampcavesimple")
{
Object.Destroy((Object)(object)((Component)GameObject.Find("HOLDER: Newt Statues and Preplaced Chests").transform.Find("GoldChest")).gameObject);
for (int i = 0; i < buttonPosition.Length; i++)
{
GameObject val = Object.Instantiate<GameObject>(Assets.direseekerButton);
val.transform.position = buttonPosition[i];
val.transform.rotation = Quaternion.Euler(buttonRotation[i]);
NetworkServer.Spawn(val);
}
GameObject val2 = Object.Instantiate<GameObject>(Assets.direseekerEncounter);
NetworkServer.Spawn(val2);
}
}
orig.Invoke(self);
};
}
}
public static class Prefabs
{
public static GameObject bodyPrefab;
public static GameObject masterPrefab;
public static void CreatePrefab()
{
//IL_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
//IL_032a: Unknown result type (might be due to invalid IL or missing references)
//IL_034b: 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_0371: Unknown result type (might be due to invalid IL or missing references)
//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
//IL_042c: Unknown result type (might be due to invalid IL or missing references)
//IL_044d: Unknown result type (might be due to invalid IL or missing references)
//IL_0452: Unknown result type (might be due to invalid IL or missing references)
//IL_0473: Unknown result type (might be due to invalid IL or missing references)
//IL_04ea: Unknown result type (might be due to invalid IL or missing references)
//IL_04ef: Unknown result type (might be due to invalid IL or missing references)
//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0518: Unknown result type (might be due to invalid IL or missing references)
//IL_0525: Unknown result type (might be due to invalid IL or missing references)
//IL_0527: Unknown result type (might be due to invalid IL or missing references)
//IL_0530: Unknown result type (might be due to invalid IL or missing references)
//IL_0550: Unknown result type (might be due to invalid IL or missing references)
//IL_055d: Unknown result type (might be due to invalid IL or missing references)
//IL_055f: Unknown result type (might be due to invalid IL or missing references)
bodyPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/LemurianBruiserBody"), "DireseekerBody", true);
Rigidbody component = bodyPrefab.GetComponent<Rigidbody>();
if (Object.op_Implicit((Object)(object)component))
{
component.mass = 900f;
}
Object.Destroy((Object)(object)bodyPrefab.GetComponent<SetStateOnHurt>());
CharacterBody component2 = bodyPrefab.GetComponent<CharacterBody>();
((Object)component2).name = "DireseekerBossBody";
component2.baseNameToken = "DIRESEEKER_BOSS_BODY_NAME";
component2.subtitleNameToken = "DIRESEEKER_BOSS_BODY_SUBTITLE";
component2.baseMoveSpeed = 11f;
component2.baseMaxHealth = 2800f;
component2.levelMaxHealth = component2.baseMaxHealth * 0.3f;
component2.baseDamage = 20f;
component2.levelDamage = component2.baseDamage * 0.2f;
component2.isChampion = true;
component2.portraitIcon = Assets.bossPortrait;
bodyPrefab.GetComponent<SfxLocator>().deathSound = "DireseekerDeath";
Transform transform = ((Component)bodyPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject.transform;
transform.localScale *= 1.5f;
KinematicCharacterMotor[] componentsInChildren = bodyPrefab.GetComponentsInChildren<KinematicCharacterMotor>();
foreach (KinematicCharacterMotor val in componentsInChildren)
{
val.SetCapsuleDimensions(val.Capsule.radius * 1.5f, val.Capsule.height * 1.5f, 1.5f);
}
CharacterModel componentInChildren = bodyPrefab.GetComponentInChildren<CharacterModel>();
Material val2 = Object.Instantiate<Material>(componentInChildren.baseRendererInfos[0].defaultMaterial);
val2.SetTexture("_MainTex", Assets.mainAssetBundle.LoadAsset<Material>("matDireseeker").GetTexture("_MainTex"));
val2.SetTexture("_EmTex", Assets.mainAssetBundle.LoadAsset<Material>("matDireseeker").GetTexture("_EmissionMap"));
val2.SetFloat("_EmPower", 50f);
componentInChildren.baseRendererInfos[0].defaultMaterial = val2;
GameObject val3 = PrefabAPI.InstantiateClone(Assets.mainAssetBundle.LoadAsset<GameObject>("DireHorn"), "DireseekerHorn", false);
GameObject val4 = PrefabAPI.InstantiateClone(Assets.mainAssetBundle.LoadAsset<GameObject>("DireHornBroken"), "DireseekerHornBroken", false);
GameObject val5 = PrefabAPI.InstantiateClone(Assets.mainAssetBundle.LoadAsset<GameObject>("DireseekerRageFlame"), "DireseekerRageFlame", false);
GameObject val6 = PrefabAPI.InstantiateClone(Assets.mainAssetBundle.LoadAsset<GameObject>("DireseekerBurstFlame"), "DireseekerBurstFlame", false);
ChildLocator componentInChildren2 = bodyPrefab.GetComponentInChildren<ChildLocator>();
val3.transform.SetParent(componentInChildren2.FindChild("Head"));
val3.transform.localPosition = new Vector3(-2.5f, 1f, -0.5f);
val3.transform.localRotation = Quaternion.Euler(new Vector3(45f, 0f, 90f));
val3.transform.localScale = new Vector3(100f, 100f, 100f);
val4.transform.SetParent(componentInChildren2.FindChild("Head"));
val4.transform.localPosition = new Vector3(2.5f, 1f, -0.5f);
val4.transform.localRotation = Quaternion.Euler(new Vector3(45f, 0f, 90f));
val4.transform.localScale = new Vector3(100f, -100f, 100f);
val5.transform.SetParent(componentInChildren2.FindChild("Head"));
val5.transform.localPosition = new Vector3(0f, 1f, 0f);
val5.transform.localRotation = Quaternion.Euler(new Vector3(270f, 180f, 0f));
val5.transform.localScale = new Vector3(4f, 4f, 4f);
val6.transform.SetParent(componentInChildren2.FindChild("Head"));
val6.transform.localPosition = new Vector3(0f, 1f, 0f);
val6.transform.localRotation = Quaternion.Euler(new Vector3(270f, 180f, 0f));
val6.transform.localScale = new Vector3(6f, 6f, 6f);
DireseekerController direseekerController = bodyPrefab.AddComponent<DireseekerController>();
direseekerController.burstFlame = val6.GetComponent<ParticleSystem>();
direseekerController.rageFlame = val5.GetComponent<ParticleSystem>();
direseekerController.rageFlame.Stop();
Shader shader = LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/hgstandard");
Material material = ((Renderer)val3.GetComponentInChildren<MeshRenderer>()).material;
material.shader = shader;
RendererInfo[] baseRendererInfos = componentInChildren.baseRendererInfos;
RendererInfo[] baseRendererInfos2 = (RendererInfo[])(object)new RendererInfo[3]
{
baseRendererInfos[0],
new RendererInfo
{
renderer = (Renderer)(object)val3.GetComponentInChildren<MeshRenderer>(),
defaultMaterial = material,
defaultShadowCastingMode = (ShadowCastingMode)1,
ignoreOverlays = true
},
new RendererInfo
{
renderer = (Renderer)(object)val4.GetComponentInChildren<MeshRenderer>(),
defaultMaterial = material,
defaultShadowCastingMode = (ShadowCastingMode)1,
ignoreOverlays = true
}
};
componentInChildren.baseRendererInfos = baseRendererInfos2;
masterPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/LemurianBruiserMaster"), "DireseekerBossMaster", true);
CharacterMaster component3 = masterPrefab.GetComponent<CharacterMaster>();
component3.bodyPrefab = bodyPrefab;
component3.isBoss = true;
CreateAI();
ContentAddition.AddBody(bodyPrefab);
ContentAddition.AddMaster(masterPrefab);
}
private static void CreateAI()
{
//IL_0051: 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_008a: 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_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: 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_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: 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_01c0: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0216: Unknown result type (might be due to invalid IL or missing references)
//IL_0249: Unknown result type (might be due to invalid IL or missing references)
//IL_026d: 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_02a6: Unknown result type (might be due to invalid IL or missing references)
//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0325: Unknown result type (might be due to invalid IL or missing references)
//IL_032d: Unknown result type (might be due to invalid IL or missing references)
//IL_0365: Unknown result type (might be due to invalid IL or missing references)
//IL_038d: Unknown result type (might be due to invalid IL or missing references)
//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
//IL_041d: 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_047d: Unknown result type (might be due to invalid IL or missing references)
AISkillDriver[] componentsInChildren = masterPrefab.GetComponentsInChildren<AISkillDriver>();
foreach (AISkillDriver val in componentsInChildren)
{
Object.DestroyImmediate((Object)(object)val);
}
AISkillDriver val2 = masterPrefab.AddComponent<AISkillDriver>();
val2.customName = "Enrage";
val2.requireSkillReady = true;
val2.movementType = (MovementType)0;
val2.moveTargetType = (TargetType)0;
val2.selectionRequiresTargetLoS = false;
val2.activationRequiresAimConfirmation = false;
val2.activationRequiresTargetLoS = false;
val2.maxDistance = float.PositiveInfinity;
val2.minDistance = 0f;
val2.aimType = (AimType)1;
val2.ignoreNodeGraph = false;
val2.moveInputScale = 1f;
val2.driverUpdateTimerOverride = -1f;
val2.buttonPressType = (ButtonPressType)0;
val2.minTargetHealthFraction = float.NegativeInfinity;
val2.maxTargetHealthFraction = float.PositiveInfinity;
val2.minUserHealthFraction = float.NegativeInfinity;
val2.maxUserHealthFraction = 0.2f;
val2.skillSlot = (SkillSlot)3;
AISkillDriver val3 = masterPrefab.AddComponent<AISkillDriver>();
val3.customName = "FlamePillar";
val3.requireSkillReady = true;
val3.movementType = (MovementType)1;
val3.moveTargetType = (TargetType)0;
val3.selectionRequiresTargetLoS = true;
val3.activationRequiresAimConfirmation = true;
val3.activationRequiresTargetLoS = false;
val3.maxDistance = 120f;
val3.minDistance = 5f;
val3.aimType = (AimType)1;
val3.ignoreNodeGraph = false;
val3.moveInputScale = 1f;
val3.driverUpdateTimerOverride = -1f;
val3.buttonPressType = (ButtonPressType)0;
val3.minTargetHealthFraction = float.NegativeInfinity;
val3.maxTargetHealthFraction = float.PositiveInfinity;
val3.minUserHealthFraction = float.NegativeInfinity;
val3.maxUserHealthFraction = 0.75f;
val3.skillSlot = (SkillSlot)2;
AISkillDriver val4 = masterPrefab.AddComponent<AISkillDriver>();
val4.customName = "Flamethrower";
val4.requireSkillReady = true;
val4.movementType = (MovementType)1;
val4.moveTargetType = (TargetType)0;
val4.selectionRequiresTargetLoS = true;
val4.activationRequiresAimConfirmation = true;
val4.activationRequiresTargetLoS = false;
val4.maxDistance = 20f;
val4.minDistance = 0f;
val4.aimType = (AimType)1;
val4.ignoreNodeGraph = false;
val4.moveInputScale = 1f;
val4.driverUpdateTimerOverride = -1f;
val4.buttonPressType = (ButtonPressType)0;
val4.minTargetHealthFraction = float.NegativeInfinity;
val4.maxTargetHealthFraction = float.PositiveInfinity;
val4.minUserHealthFraction = float.NegativeInfinity;
val4.maxUserHealthFraction = float.PositiveInfinity;
val4.skillSlot = (SkillSlot)1;
AISkillDriver val5 = masterPrefab.AddComponent<AISkillDriver>();
val5.customName = "RunAndShoot";
val5.requireSkillReady = true;
val5.movementType = (MovementType)1;
val5.moveTargetType = (TargetType)0;
val5.selectionRequiresTargetLoS = true;
val5.activationRequiresAimConfirmation = true;
val5.activationRequiresTargetLoS = false;
val5.maxDistance = 50f;
val5.minDistance = 0f;
val5.aimType = (AimType)1;
val5.ignoreNodeGraph = false;
val5.moveInputScale = 1f;
val5.driverUpdateTimerOverride = 2f;
val5.buttonPressType = (ButtonPressType)0;
val5.minTargetHealthFraction = float.NegativeInfinity;
val5.maxTargetHealthFraction = float.PositiveInfinity;
val5.minUserHealthFraction = float.NegativeInfinity;
val5.maxUserHealthFraction = float.PositiveInfinity;
val5.skillSlot = (SkillSlot)0;
AISkillDriver val6 = masterPrefab.AddComponent<AISkillDriver>();
val6.customName = "StopAndShoot";
val6.requireSkillReady = true;
val6.movementType = (MovementType)0;
val6.moveTargetType = (TargetType)0;
val6.selectionRequiresTargetLoS = true;
val6.activationRequiresAimConfirmation = true;
val6.activationRequiresTargetLoS = false;
val6.maxDistance = 100f;
val6.minDistance = 50f;
val6.aimType = (AimType)1;
val6.ignoreNodeGraph = false;
val6.moveInputScale = 1f;
val6.driverUpdateTimerOverride = 2f;
val6.buttonPressType = (ButtonPressType)0;
val6.minTargetHealthFraction = float.NegativeInfinity;
val6.maxTargetHealthFraction = float.PositiveInfinity;
val6.minUserHealthFraction = float.NegativeInfinity;
val6.maxUserHealthFraction = float.PositiveInfinity;
val6.skillSlot = (SkillSlot)0;
AISkillDriver val7 = masterPrefab.AddComponent<AISkillDriver>();
val7.customName = "Chase";
val7.movementType = (MovementType)1;
val7.moveTargetType = (TargetType)0;
val7.activationRequiresAimConfirmation = false;
val7.activationRequiresTargetLoS = false;
val7.maxDistance = float.PositiveInfinity;
val7.minDistance = 0f;
val7.aimType = (AimType)1;
val7.ignoreNodeGraph = false;
val7.moveInputScale = 1f;
val7.driverUpdateTimerOverride = -1f;
val7.buttonPressType = (ButtonPressType)0;
val7.minTargetHealthFraction = float.NegativeInfinity;
val7.maxTargetHealthFraction = float.PositiveInfinity;
val7.minUserHealthFraction = float.NegativeInfinity;
val7.maxUserHealthFraction = float.PositiveInfinity;
val7.skillSlot = (SkillSlot)(-1);
}
}
public static class Projectiles
{
public static GameObject fireballPrefab;
public static GameObject fireballGroundPrefab;
public static GameObject fireTrailPrefab;
public static GameObject fireSegmentPrefab;
public static void CreateProjectiles()
{
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
fireballPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/ArchWispCannon"), "DireseekerBossFireball", true);
fireballGroundPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/ArchWispGroundCannon"), "DireseekerBossGroundFireball", true);
ProjectileController component = fireballPrefab.GetComponent<ProjectileController>();
component.ghostPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/LemurianBigFireball").GetComponent<ProjectileController>().ghostPrefab;
component.startSound = "Play_lemurianBruiser_m1_shoot";
GameObject impactEffect = LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/LemurianBigFireball").GetComponent<ProjectileImpactExplosion>().impactEffect;
ProjectileImpactExplosion component2 = fireballPrefab.GetComponent<ProjectileImpactExplosion>();
((ProjectileExplosion)component2).childrenProjectilePrefab = fireballGroundPrefab;
((Component)component2).GetComponent<ProjectileImpactExplosion>().impactEffect = impactEffect;
((ProjectileExplosion)component2).falloffModel = (FalloffModel)2;
((ProjectileExplosion)component2).blastDamageCoefficient = 1f;
((ProjectileExplosion)component2).blastProcCoefficient = 1f;
fireballGroundPrefab.GetComponent<ProjectileController>().ghostPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/MagmaOrbProjectile").GetComponent<ProjectileController>().ghostPrefab;
fireballGroundPrefab.GetComponent<ProjectileImpactExplosion>().impactEffect = impactEffect;
fireTrailPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/FireTrail"), "DireseekerBossFireTrail", true);
fireTrailPrefab.AddComponent<NetworkIdentity>();
fireballGroundPrefab.GetComponent<ProjectileDamageTrail>().trailPrefab = fireTrailPrefab;
ContentAddition.AddProjectile(fireballPrefab);
ContentAddition.AddProjectile(fireballGroundPrefab);
}
}
public static class Skills
{
public static void RegisterSkills()
{
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Expected O, but got Unknown
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: 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_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_0212: 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_0234: Expected O, but got Unknown
//IL_0235: Unknown result type (might be due to invalid IL or missing references)
//IL_0237: 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_0259: Unknown result type (might be due to invalid IL or missing references)
//IL_0292: Unknown result type (might be due to invalid IL or missing references)
//IL_0316: Unknown result type (might be due to invalid IL or missing references)
//IL_032e: Unknown result type (might be due to invalid IL or missing references)
//IL_0338: Expected O, but got Unknown
//IL_0339: Unknown result type (might be due to invalid IL or missing references)
//IL_033b: Unknown result type (might be due to invalid IL or missing references)
//IL_0358: Unknown result type (might be due to invalid IL or missing references)
//IL_035d: Unknown result type (might be due to invalid IL or missing references)
//IL_0396: Unknown result type (might be due to invalid IL or missing references)
//IL_041a: 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_043c: Expected O, but got Unknown
//IL_043d: Unknown result type (might be due to invalid IL or missing references)
//IL_043f: Unknown result type (might be due to invalid IL or missing references)
GameObject bodyPrefab = Prefabs.bodyPrefab;
GenericSkill[] componentsInChildren = bodyPrefab.GetComponentsInChildren<GenericSkill>();
foreach (GenericSkill val in componentsInChildren)
{
Object.DestroyImmediate((Object)(object)val);
}
SkillLocator componentInChildren = bodyPrefab.GetComponentInChildren<SkillLocator>();
SkillDef val2 = ScriptableObject.CreateInstance<SkillDef>();
val2.activationState = new SerializableEntityStateType(typeof(ChargeUltraFireball));
val2.activationStateMachineName = "Weapon";
val2.baseMaxStock = 3;
val2.baseRechargeInterval = 16f;
val2.beginSkillCooldownOnSkillEnd = true;
val2.canceledFromSprinting = false;
val2.fullRestockOnAssign = true;
val2.interruptPriority = (InterruptPriority)0;
val2.resetCooldownTimerOnUse = false;
val2.isCombatSkill = true;
val2.mustKeyPress = false;
val2.cancelSprintingOnActivation = false;
val2.rechargeStock = 1;
val2.requiredStock = 1;
val2.stockToConsume = 1;
ContentAddition.AddSkillDef(val2);
componentInChildren.primary = bodyPrefab.AddComponent<GenericSkill>();
SkillFamily val3 = ScriptableObject.CreateInstance<SkillFamily>();
val3.variants = (Variant[])(object)new Variant[1];
Reflection.SetFieldValue<SkillFamily>((object)componentInChildren.primary, "_skillFamily", val3);
SkillFamily skillFamily = componentInChildren.primary.skillFamily;
Variant[] variants = skillFamily.variants;
Variant val4 = new Variant
{
skillDef = val2
};
((Variant)(ref val4)).viewableNode = new Node(val2.skillNameToken, false, (Node)null);
variants[0] = val4;
ContentAddition.AddSkillFamily(val3);
val2 = ScriptableObject.CreateInstance<SkillDef>();
val2.activationState = new SerializableEntityStateType(typeof(Flamethrower));
val2.activationStateMachineName = "Body";
val2.baseMaxStock = 1;
val2.baseRechargeInterval = 0f;
val2.beginSkillCooldownOnSkillEnd = false;
val2.canceledFromSprinting = false;
val2.fullRestockOnAssign = true;
val2.interruptPriority = (InterruptPriority)0;
val2.resetCooldownTimerOnUse = false;
val2.isCombatSkill = true;
val2.mustKeyPress = false;
val2.cancelSprintingOnActivation = true;
val2.rechargeStock = 1;
val2.requiredStock = 1;
val2.stockToConsume = 0;
ContentAddition.AddSkillDef(val2);
componentInChildren.secondary = bodyPrefab.AddComponent<GenericSkill>();
val3 = ScriptableObject.CreateInstance<SkillFamily>();
val3.variants = (Variant[])(object)new Variant[1];
Reflection.SetFieldValue<SkillFamily>((object)componentInChildren.secondary, "_skillFamily", val3);
skillFamily = componentInChildren.secondary.skillFamily;
Variant[] variants2 = skillFamily.variants;
val4 = new Variant
{
skillDef = val2
};
((Variant)(ref val4)).viewableNode = new Node(val2.skillNameToken, false, (Node)null);
variants2[0] = val4;
ContentAddition.AddSkillFamily(val3);
val2 = ScriptableObject.CreateInstance<SkillDef>();
val2.activationState = new SerializableEntityStateType(typeof(FlamePillars));
val2.activationStateMachineName = "Body";
val2.baseMaxStock = 1;
val2.baseRechargeInterval = 12f;
val2.beginSkillCooldownOnSkillEnd = false;
val2.canceledFromSprinting = false;
val2.fullRestockOnAssign = true;
val2.interruptPriority = (InterruptPriority)0;
val2.resetCooldownTimerOnUse = false;
val2.isCombatSkill = true;
val2.mustKeyPress = false;
val2.cancelSprintingOnActivation = true;
val2.rechargeStock = 1;
val2.requiredStock = 1;
val2.stockToConsume = 1;
ContentAddition.AddSkillDef(val2);
componentInChildren.utility = bodyPrefab.AddComponent<GenericSkill>();
val3 = ScriptableObject.CreateInstance<SkillFamily>();
val3.variants = (Variant[])(object)new Variant[1];
Reflection.SetFieldValue<SkillFamily>((object)componentInChildren.utility, "_skillFamily", val3);
skillFamily = componentInChildren.utility.skillFamily;
Variant[] variants3 = skillFamily.variants;
val4 = new Variant
{
skillDef = val2
};
((Variant)(ref val4)).viewableNode = new Node(val2.skillNameToken, false, (Node)null);
variants3[0] = val4;
ContentAddition.AddSkillFamily(val3);
val2 = ScriptableObject.CreateInstance<SkillDef>();
val2.activationState = new SerializableEntityStateType(typeof(Enrage));
val2.activationStateMachineName = "Body";
val2.baseMaxStock = 1;
val2.baseRechargeInterval = 0f;
val2.beginSkillCooldownOnSkillEnd = false;
val2.canceledFromSprinting = false;
val2.fullRestockOnAssign = true;
val2.interruptPriority = (InterruptPriority)0;
val2.resetCooldownTimerOnUse = false;
val2.isCombatSkill = true;
val2.mustKeyPress = false;
val2.cancelSprintingOnActivation = true;
val2.rechargeStock = 0;
val2.requiredStock = 1;
val2.stockToConsume = 1;
ContentAddition.AddSkillDef(val2);
componentInChildren.special = bodyPrefab.AddComponent<GenericSkill>();
val3 = ScriptableObject.CreateInstance<SkillFamily>();
val3.variants = (Variant[])(object)new Variant[1];
Reflection.SetFieldValue<SkillFamily>((object)componentInChildren.special, "_skillFamily", val3);
skillFamily = componentInChildren.special.skillFamily;
Variant[] variants4 = skillFamily.variants;
val4 = new Variant
{
skillDef = val2
};
((Variant)(ref val4)).viewableNode = new Node(val2.skillNameToken, false, (Node)null);
variants4[0] = val4;
ContentAddition.AddSkillFamily(val3);
}
}
public static class SpawnCards
{
public static CharacterSpawnCard bossSpawnCard;
public static void CreateSpawnCards()
{
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: 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_008a: Expected O, but got Unknown
bossSpawnCard = ScriptableObject.CreateInstance<CharacterSpawnCard>();
((Object)bossSpawnCard).name = "cscDireseekerBoss";
((SpawnCard)bossSpawnCard).prefab = Prefabs.masterPrefab;
((SpawnCard)bossSpawnCard).sendOverNetwork = true;
((SpawnCard)bossSpawnCard).hullSize = (HullClassification)2;
((SpawnCard)bossSpawnCard).nodeGraphType = (GraphType)0;
((SpawnCard)bossSpawnCard).requiredFlags = (NodeFlags)0;
((SpawnCard)bossSpawnCard).forbiddenFlags = (NodeFlags)2;
((SpawnCard)bossSpawnCard).directorCreditCost = 800;
((SpawnCard)bossSpawnCard).occupyPosition = false;
bossSpawnCard.loadout = new SerializableLoadout();
bossSpawnCard.noElites = true;
bossSpawnCard.forbiddenAsBoss = false;
}
}
public class States
{
public static void RegisterStates()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: 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_0031: 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_0041: 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_006d: Unknown result type (might be due to invalid IL or missing references)
GameObject bodyPrefab = Prefabs.bodyPrefab;
bool flag = default(bool);
ContentAddition.AddEntityState<Listening>(ref flag);
ContentAddition.AddEntityState<SpawnState>(ref flag);
ContentAddition.AddEntityState<ChargeUltraFireball>(ref flag);
ContentAddition.AddEntityState<FireUltraFireball>(ref flag);
ContentAddition.AddEntityState<Flamethrower>(ref flag);
ContentAddition.AddEntityState<FlamePillar>(ref flag);
ContentAddition.AddEntityState<FlamePillars>(ref flag);
ContentAddition.AddEntityState<Enrage>(ref flag);
EntityStateMachine componentInChildren = bodyPrefab.GetComponentInChildren<EntityStateMachine>();
if (Object.op_Implicit((Object)(object)componentInChildren))
{
componentInChildren.initialStateType = new SerializableEntityStateType(typeof(SpawnState));
}
}
}
public static class Tokens
{
public static SubFileSystem fileSystem;
internal static string languageRoot => Path.Combine(assemblyDir, "language");
internal static string assemblyDir => Path.GetDirectoryName(DireseekerPlugin.pluginInfo.Location);
public static void RegisterLanguageTokens()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
Language.SetFolders += new hook_SetFolders(fixme);
}
private static void fixme(orig_SetFolders orig, Language self, IEnumerable<string> newFolders)
{
if (Directory.Exists(languageRoot))
{
IEnumerable<string> second = Directory.EnumerateDirectories(Path.Combine(languageRoot), self.name);
orig.Invoke(self, newFolders.Union(second));
}
else
{
orig.Invoke(self, newFolders);
}
}
}
}
namespace DireseekerMod.Components
{
public class DireseekerButtonController : NetworkBehaviour
{
[SyncVar]
public bool isPressedServer = false;
public bool isPressedLocal = false;
private bool enableOverlapSphere;
private float overlapSphereRadius;
private float overlapSphereStopwatch;
private float overlapSphereFrequency;
private Animator animator;
private void Awake()
{
animator = ((Component)this).GetComponent<Animator>();
if (NetworkServer.active)
{
isPressedServer = false;
}
isPressedLocal = false;
overlapSphereRadius = 1.5f;
overlapSphereFrequency = 5f;
enableOverlapSphere = true;
}
private void FixedUpdate()
{
if (NetworkServer.active)
{
FixedUpdateServer();
}
if (!isPressedLocal && isPressedServer)
{
Pressed();
}
}
private void FixedUpdateServer()
{
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
if (isPressedServer || !enableOverlapSphere)
{
return;
}
float num = 1f / overlapSphereFrequency;
overlapSphereStopwatch += Time.fixedDeltaTime;
if (overlapSphereStopwatch >= num)
{
overlapSphereStopwatch -= num;
if (HGPhysics.DoesOverlapSphere(((Component)this).transform.position, overlapSphereRadius, LayerMask.op_Implicit(CommonMasks.characterBodiesOrDefault) | LayerMask.op_Implicit(CommonMasks.fakeActorLayers), (QueryTriggerInteraction)0))
{
isPressedServer = true;
}
}
}
private void Pressed()
{
isPressedLocal = true;
enableOverlapSphere = false;
if (Object.op_Implicit((Object)(object)animator))
{
animator.SetBool("pressed", true);
}
Util.PlaySound("Play_item_proc_bandolierSpawn", ((Component)this).gameObject);
}
}
public class DireseekerController : MonoBehaviour
{
public ParticleSystem burstFlame;
public ParticleSystem rageFlame;
public void StartRageMode()
{
if (Object.op_Implicit((Object)(object)rageFlame))
{
rageFlame.Play();
}
}
public void FlameBurst()
{
if (Object.op_Implicit((Object)(object)burstFlame))
{
burstFlame.Play();
}
}
}
}