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.Bell.BellWeapon;
using EntityStates.BrotherMonster;
using EntityStates.LunarWisp;
using FubukiMods.Modules;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using On.RoR2;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Audio;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LunarExploder")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LunarExploder")]
[assembly: AssemblyTitle("LunarExploder")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
}
namespace FubukiMods
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("Fubuki.LunarExploder", "LunarExploder", "0.1.2")]
[R2APISubmoduleDependency(new string[] { "PrefabAPI", "LoadoutAPI", "LoadoutAPI" })]
public class MainPlugin : BaseUnityPlugin
{
public const string PluginGUID = "Fubuki.LunarExploder";
public const string PluginAuthor = "Fubuki";
public const string PluginName = "LunarExploder";
public const string PluginVersion = "0.1.2";
public static GameObject primaryPrefab;
public static GameObject secondaryPrefab;
public static GameObject utilityDot;
public void Awake()
{
//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_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_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_012c: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: Expected O, but got Unknown
Survivors.Init();
primaryPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarExploder/LunarExploderShardProjectile.prefab").WaitForCompletion(), "FubukiMods/LunarExploderShard", true);
ContentAddition.AddProjectile(primaryPrefab);
secondaryPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteLunar/LunarMissileProjectile.prefab").WaitForCompletion(), "FubukiMods/LunarExploderMissile", true);
secondaryPrefab.GetComponent<ProjectileDirectionalTargetFinder>().allowTargetLoss = true;
secondaryPrefab.GetComponent<ProjectileDirectionalTargetFinder>().ignoreAir = false;
secondaryPrefab.GetComponent<ProjectileDirectionalTargetFinder>().lookCone = 20f;
secondaryPrefab.GetComponent<ProjectileDirectionalTargetFinder>().lookRange = 40f;
secondaryPrefab.GetComponent<ProjectileDirectionalTargetFinder>().onlySearchIfNoTarget = false;
secondaryPrefab.GetComponent<ProjectileDirectionalTargetFinder>().targetSearchInterval = 0.1f;
secondaryPrefab.GetComponent<ProjectileDirectionalTargetFinder>().testLoS = false;
ProjectileSteerTowardTarget component = secondaryPrefab.GetComponent<ProjectileSteerTowardTarget>();
component.rotationSpeed *= 4f;
ContentAddition.AddProjectile(secondaryPrefab);
utilityDot = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarExploder/LunarExploderProjectileDotZone.prefab").WaitForCompletion(), "FubukiMods/LunarExploderDot", true);
ContentAddition.AddProjectile(utilityDot);
HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
}
private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
{
//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_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)((Component)self).GetComponent<Skills.ExploderComponent>()) && ((Component)self).GetComponent<Skills.ExploderComponent>().hasTarget && Object.op_Implicit((Object)(object)((Component)self).GetComponent<Skills.ExploderComponent>().target.healthComponent))
{
damageInfo.damage *= 0.8f;
((Component)self).GetComponent<Skills.ExploderComponent>().target.healthComponent.TakeDamage(damageInfo);
((Component)self).GetComponent<Skills.ExploderComponent>().extraWidth = 10f;
damageInfo.damage *= 0.2f;
EffectManager.SimpleEffect(Resources.Load<GameObject>("prefabs/effects/muzzleflashes/MuzzleflashLunarShard"), ((Component)((Component)self).GetComponent<Skills.ExploderComponent>().target).transform.position, Quaternion.identity, true);
EffectManager.SimpleEffect(Resources.Load<GameObject>("prefabs/effects/LunarRerollEffect"), ((Component)self).transform.position, Quaternion.identity, true);
EntitySoundManager.EmitSoundServer(Resources.Load<NetworkSoundEventDef>("NetworkSoundEventDefs/nseArmorPlateBlock").index, ((Component)this).gameObject);
}
orig.Invoke(self, damageInfo);
}
}
}
namespace FubukiMods.Modules
{
internal static class Skills
{
public class ExploderPrimary : BaseState
{
private readonly float totalDuration = 0.75f;
private float duration;
private readonly float baseShotDelay = 0.1f;
private float shotDelay;
private int shots = 0;
public override void OnEnter()
{
((BaseState)this).OnEnter();
duration = totalDuration / base.attackSpeedStat;
shotDelay = baseShotDelay / base.attackSpeedStat;
((EntityState)this).PlayAnimation("Gesture, Additive", "FireExploderShards");
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).isAuthority && shots == 0)
{
shots++;
Fire();
}
if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= shotDelay && shots == 1)
{
shots++;
Fire();
}
if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= shotDelay * 2f && shots == 2)
{
shots++;
Fire();
}
if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration && shots == 3)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
private void Fire()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: 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_0049: 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)
Ray aimRay = ((BaseState)this).GetAimRay();
if (((EntityState)this).isAuthority)
{
ProjectileManager.instance.FireProjectile(MainPlugin.primaryPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 3f, 1f, 1f, 0f, 0f)), ((EntityState)this).gameObject, base.damageStat * 1f, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f);
}
EffectManager.SimpleMuzzleFlash(Resources.Load<GameObject>("prefabs/effects/muzzleflashes/MuzzleflashLunarShard"), ((EntityState)this).gameObject, "MuzzleCore", false);
Util.PlaySound("Play_lunar_exploder_m1_fire", ((EntityState)this).gameObject);
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
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 ExploderSecondaryCharge : BaseState
{
private float totalDuration = 2f;
private float duration;
private int charge = 0;
private int oldCharge = 0;
private int maxShots = 6;
public override void OnEnter()
{
((BaseState)this).OnEnter();
duration = totalDuration / base.attackSpeedStat;
Util.PlaySound(((EntityState)this).sfxLocator.barkSound, ((EntityState)this).gameObject);
}
public override void FixedUpdate()
{
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).FixedUpdate();
charge = (int)Math.Floor(((EntityState)this).fixedAge / duration * 5f) + 1;
if (charge > oldCharge)
{
oldCharge++;
EffectManager.SimpleEffect(Resources.Load<GameObject>("prefabs/effects/muzzleflashes/MuzzleflashLunarShard"), ((EntityState)this).characterBody.corePosition + Vector3.up * 3f, Quaternion.identity, false);
Util.PlayAttackSpeedSound("Play_lunar_exploder_m1_fire", ((EntityState)this).gameObject, 0.5f);
((EntityState)this).skillLocator.secondary.DeductStock(1);
((EntityState)this).PlayAnimation("Gesture, Additive", "FireExploderShards");
}
if (((EntityState)this).isAuthority && (((EntityState)this).fixedAge >= duration || !((EntityState)this).inputBank.skill2.down || ((EntityState)this).skillLocator.secondary.stock == 0))
{
ExploderSecondaryFire exploderSecondaryFire = new ExploderSecondaryFire();
exploderSecondaryFire.bulletCount = (int)Math.Floor(((EntityState)this).fixedAge / duration * (float)(maxShots - 1)) + 1;
((EntityState)this).outer.SetNextState((EntityState)(object)exploderSecondaryFire);
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
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)2;
}
}
public class ExploderSecondaryFire : BaseState
{
public int bulletCount;
private int bulletsFired = 0;
private float fireDelay = 0.1f;
private float totalDuration = 0.8f;
private float duration;
public override void OnEnter()
{
((BaseState)this).OnEnter();
duration = totalDuration / base.attackSpeedStat;
}
public override void FixedUpdate()
{
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: 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_007d: 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_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_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_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_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: 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_013f: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).FixedUpdate();
if (bulletsFired < bulletCount)
{
if (((EntityState)this).fixedAge >= fireDelay / base.attackSpeedStat * (float)bulletsFired && ((EntityState)this).isAuthority)
{
bulletsFired++;
Vector3 val = Vector3.up * 3f + Random.insideUnitSphere * 3f;
FireProjectileInfo val2 = default(FireProjectileInfo);
val2.projectilePrefab = MainPlugin.secondaryPrefab;
val2.position = ((EntityState)this).characterBody.corePosition + val;
Ray aimRay = ((BaseState)this).GetAimRay();
val2.rotation = Util.QuaternionSafeLookRotation(Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 20f, 1f, 0.5f, 0f, 0f));
val2.owner = ((EntityState)this).gameObject;
val2.damage = base.damageStat * 2f;
val2.crit = ((BaseState)this).RollCrit();
val2.force = 200f;
val2.damageTypeOverride = DamageTypeCombo.op_Implicit((DamageType)4194336);
FireProjectileInfo val3 = val2;
ProjectileManager.instance.FireProjectile(val3);
}
}
else
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
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)2;
}
}
public class ExploderUtility : BaseState
{
private float totalDuration = 1f;
private float duration;
private bool hasBounced;
public override void OnEnter()
{
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
((BaseState)this).OnEnter();
((EntityState)this).characterMotor.disableAirControlUntilCollision = true;
duration = totalDuration / base.attackSpeedStat;
EffectManager.SimpleEffect(Resources.Load<GameObject>("prefabs/effects/BrotherDashEffect"), ((EntityState)this).characterBody.corePosition, Quaternion.LookRotation(Vector3.down, ((EntityState)this).characterDirection.forward), false);
Util.PlayAttackSpeedSound(BaseSlideState.soundString, ((EntityState)this).gameObject, 2f);
}
public override void FixedUpdate()
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_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_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)
//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_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_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: 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_013c: 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_0144: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).FixedUpdate();
if (hasBounced)
{
return;
}
((EntityState)this).characterMotor.velocity = Vector3.down * 70f;
if (((EntityState)this).characterMotor.isGrounded)
{
hasBounced = true;
((EntityState)this).characterMotor.velocity = (((EntityState)this).characterMotor.estimatedGroundNormal + Vector3.down / 2f + Vector3.zero) * 70f;
((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
if (((EntityState)this).isAuthority)
{
FireProjectileInfo val = default(FireProjectileInfo);
val.projectilePrefab = MainPlugin.utilityDot;
val.position = ((EntityState)this).characterBody.footPosition;
val.rotation = Quaternion.identity;
val.owner = ((EntityState)this).gameObject;
val.damage = base.damageStat * 1f;
val.crit = ((BaseState)this).RollCrit();
val.force = 0f;
val.damageTypeOverride = DamageTypeCombo.op_Implicit((DamageType)4194312);
FireProjectileInfo val2 = val;
ProjectileManager.instance.FireProjectile(val2);
Util.PlayAttackSpeedSound(SeekingBomb.fireBombSoundString, ((EntityState)this).gameObject, 0.5f);
}
if (((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
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)5;
}
}
public class ExploderSpecial : BaseState
{
private float totalDuration = 6f;
private float duration;
private GameObject tetherInstance;
private BezierCurveLine tetherCurve;
private Transform tetherTip;
private HurtBox target;
public override void OnEnter()
{
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Expected O, but got Unknown
//IL_0079: 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_008a: 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_00a1: 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_00ab: 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)
((BaseState)this).OnEnter();
duration = totalDuration;
tetherInstance = Object.Instantiate<GameObject>(BuffBeam.buffBeamPrefab);
ChildLocator component = tetherInstance.GetComponent<ChildLocator>();
tetherTip = component.FindChild("BeamTip");
tetherCurve = tetherInstance.GetComponentInChildren<BezierCurveLine>();
if (((EntityState)this).isAuthority)
{
BullseyeSearch val = new BullseyeSearch();
val.viewer = ((EntityState)this).characterBody;
val.searchOrigin = ((EntityState)this).characterBody.corePosition;
val.searchDirection = ((EntityState)this).characterBody.corePosition;
val.maxDistanceFilter = 100f;
val.teamMaskFilter = TeamMask.GetEnemyTeams(((BaseState)this).GetTeam());
val.sortMode = (SortMode)3;
val.RefreshCandidates();
target = val.GetResults().FirstOrDefault();
if (Object.op_Implicit((Object)(object)target))
{
((EntityState)this).GetComponent<ExploderComponent>().hasTarget = true;
((EntityState)this).GetComponent<ExploderComponent>().target = target;
((EntityState)this).GetComponent<ExploderComponent>().extraWidth = -1f;
}
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).isAuthority && (((EntityState)this).fixedAge >= duration || !Object.op_Implicit((Object)(object)target)))
{
((EntityState)this).outer.SetNextStateToMain();
((EntityState)this).GetComponent<ExploderComponent>().hasTarget = false;
}
else if (Object.op_Implicit((Object)(object)target) && !target.healthComponent.alive)
{
((EntityState)this).outer.SetNextStateToMain();
((EntityState)this).GetComponent<ExploderComponent>().hasTarget = false;
}
}
public override void Update()
{
((EntityState)this).Update();
if (Object.op_Implicit((Object)(object)target))
{
UpdateTetherVisuals();
}
}
private void UpdateTetherVisuals()
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: 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_007a: Unknown result type (might be due to invalid IL or missing references)
float num = 1f - ((EntityState)this).fixedAge / duration;
tetherCurve.lineRenderer.widthMultiplier = num + ((EntityState)this).GetComponent<ExploderComponent>().extraWidth;
tetherCurve.v0 = Vector3.up * 20f;
((Component)tetherCurve).transform.position = ((EntityState)this).characterBody.corePosition;
tetherTip.position = ((Component)target).transform.position;
}
public override void OnExit()
{
EntityState.Destroy((Object)(object)tetherInstance);
((EntityState)this).GetComponent<ExploderComponent>().hasTarget = false;
((EntityState)this).OnExit();
}
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;
}
}
public class ExploderComponent : MonoBehaviour
{
public HurtBox target;
public bool hasTarget = false;
public float extraWidth = 0f;
public void FixedUpdate()
{
extraWidth = Mathf.Lerp(extraWidth, 0f, 0.1f);
}
}
}
internal class Survivors
{
internal static void Init()
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: 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_0087: 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_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
//IL_0203: Unknown result type (might be due to invalid IL or missing references)
//IL_0208: Unknown result type (might be due to invalid IL or missing references)
//IL_021f: Unknown result type (might be due to invalid IL or missing references)
//IL_0224: 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_0240: Unknown result type (might be due to invalid IL or missing references)
//IL_0257: Unknown result type (might be due to invalid IL or missing references)
//IL_025c: Unknown result type (might be due to invalid IL or missing references)
//IL_0273: Unknown result type (might be due to invalid IL or missing references)
//IL_0278: 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_0294: Unknown result type (might be due to invalid IL or missing references)
//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
//IL_02de: Unknown result type (might be due to invalid IL or missing references)
//IL_02e3: 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_03b9: Unknown result type (might be due to invalid IL or missing references)
//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
//IL_042f: Unknown result type (might be due to invalid IL or missing references)
//IL_04b5: Unknown result type (might be due to invalid IL or missing references)
//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
//IL_052b: Unknown result type (might be due to invalid IL or missing references)
//IL_05a9: Unknown result type (might be due to invalid IL or missing references)
//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
//IL_05c7: Unknown result type (might be due to invalid IL or missing references)
//IL_061f: Unknown result type (might be due to invalid IL or missing references)
//IL_06d3: Unknown result type (might be due to invalid IL or missing references)
//IL_06dd: Unknown result type (might be due to invalid IL or missing references)
//IL_06f9: Unknown result type (might be due to invalid IL or missing references)
//IL_06fe: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Tools.CreateBody("FubukiMods/PlayerLunarExploder", "RoR2/Base/LunarExploder/LunarExploderBody.prefab");
val.AddComponent<Skills.ExploderComponent>();
EntityStateMachine val2 = val.AddComponent<EntityStateMachine>();
val2.customName = "Tether";
val2.mainStateType = new SerializableEntityStateType(typeof(Idle));
val2.commonComponents = new CommonComponentCache(val.gameObject);
val2.initialStateType = new SerializableEntityStateType(typeof(Idle));
GameObject val3 = PrefabAPI.InstantiateClone(((Component)val.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "FubukiMods/PlayerLunarExploderDisplay");
val3.transform.localScale = Vector3.one * 1.5f;
val3.AddComponent<NetworkIdentity>();
val.GetComponent<CharacterBody>().bodyFlags = (BodyFlags)49;
val.GetComponent<SetStateOnHurt>().canBeHitStunned = false;
CharacterBody component = val.GetComponent<CharacterBody>();
component.baseDamage = 12f;
component.levelDamage = component.baseDamage * 0.2f;
component.baseCrit = 1f;
component.levelCrit = 0f;
component.baseMaxHealth = 120f;
component.levelMaxHealth = component.baseMaxHealth * 0.3f;
component.baseMaxShield = 0f;
component.levelMaxShield = 0f;
component.baseArmor = 0f;
component.levelArmor = 0f;
component.baseRegen = 1f;
component.levelRegen = component.baseRegen * 0.2f;
component.baseMoveSpeed = 9f;
component.levelMoveSpeed = 0f;
component.sprintingSpeedMultiplier = 1.45f;
component.baseAcceleration = 80f;
component.baseJumpCount = 1;
component.baseJumpPower = 15f;
component.baseAttackSpeed = 1f;
component.baseNameToken = "Lunar Exploder Survivor";
Color[] palette = (Color[])(object)new Color[16]
{
new Color(0f, 0f, 0f),
new Color(0.1f, 0.125f, 0.55f),
new Color(0.3f, 0.4f, 0.9f),
new Color(0f, 0.6f, 0.7f),
new Color(0.45f, 0.7f, 0.8f),
new Color(0.7f, 0.85f, 0.92f),
new Color(1f, 1f, 1f),
new Color(0.25f, 0.3f, 0.4f),
default(Color),
default(Color),
default(Color),
default(Color),
default(Color),
default(Color),
default(Color),
new Color(0f, 0f, 0f, 0f)
};
ContentAddition.AddBody(val);
bool flag = default(bool);
ContentAddition.AddEntityState<Skills.ExploderPrimary>(ref flag);
SkillDef val4 = ScriptableObject.CreateInstance<SkillDef>();
val4.activationState = new SerializableEntityStateType(typeof(Skills.ExploderPrimary));
val4.activationStateMachineName = "Weapon";
val4.baseMaxStock = 1;
val4.baseRechargeInterval = 1f;
val4.beginSkillCooldownOnSkillEnd = true;
val4.canceledFromSprinting = false;
val4.cancelSprintingOnActivation = false;
val4.dontAllowPastMaxStocks = false;
val4.forceSprintDuringState = false;
val4.fullRestockOnAssign = true;
val4.interruptPriority = (InterruptPriority)0;
val4.isCombatSkill = true;
val4.mustKeyPress = false;
val4.rechargeStock = val4.baseMaxStock;
val4.requiredStock = 1;
val4.stockToConsume = 0;
val4.skillDescriptionToken = "Fire 3 light shards that deal <style=cIsDamage>100% damage</style>.";
val4.skillName = "EXPLODER_PRIMARY";
val4.skillNameToken = "Flash Blitz";
val4.icon = Tools.SpriteFromString("7777777777577777777777777767777777777777756277777777777756657777777725666666527777777725666666527777777756652772727777772657777575777777762777767627777775777756265777777277726626627777777756665665277772566666666665227772566666666666652775666666665277777262", palette);
Tools.AddSkill(val, val4);
ContentAddition.AddEntityState<Skills.ExploderSecondaryCharge>(ref flag);
SkillDef val5 = ScriptableObject.CreateInstance<SkillDef>();
val5.activationState = new SerializableEntityStateType(typeof(Skills.ExploderSecondaryCharge));
val5.activationStateMachineName = "Weapon";
val5.baseMaxStock = 6;
val5.baseRechargeInterval = 1.5f;
val5.beginSkillCooldownOnSkillEnd = true;
val5.canceledFromSprinting = false;
val5.cancelSprintingOnActivation = true;
val5.dontAllowPastMaxStocks = false;
val5.forceSprintDuringState = false;
val5.fullRestockOnAssign = true;
val5.interruptPriority = (InterruptPriority)1;
val5.isCombatSkill = true;
val5.mustKeyPress = false;
val5.rechargeStock = val5.baseMaxStock;
val5.requiredStock = 1;
val5.resetCooldownTimerOnUse = true;
val5.stockToConsume = 0;
val5.skillDescriptionToken = "Charge up to 6 unstable bolts that can pass through terrain. Each bolt seeks out nearby targets, dealing <style=cIsDamage>200% damage</style> and <style=cIsUtility>crippling</style> those hit.";
val5.skillName = "EXPLODER_SECONDARY";
val5.skillNameToken = "Perfected Charge";
val5.icon = Tools.SpriteFromString("7234664327777123233432477777111212431477744661273222777734666677121777724666667711777723666666771177724366646477177743364644327777741333343327777772233241217777772133121177777777113211177777347112111177772346244666777712466644666667122346663466666422344664", palette);
Tools.AddSkill(val, val5, "secondary");
ContentAddition.AddEntityState<Skills.ExploderUtility>(ref flag);
SkillDef val6 = ScriptableObject.CreateInstance<SkillDef>();
val6.activationState = new SerializableEntityStateType(typeof(Skills.ExploderUtility));
val6.activationStateMachineName = "Weapon";
val6.baseMaxStock = 1;
val6.baseRechargeInterval = 6f;
val6.beginSkillCooldownOnSkillEnd = false;
val6.canceledFromSprinting = false;
val6.cancelSprintingOnActivation = false;
val6.dontAllowPastMaxStocks = false;
val6.forceSprintDuringState = true;
val6.fullRestockOnAssign = true;
val6.interruptPriority = (InterruptPriority)2;
val6.isCombatSkill = false;
val6.mustKeyPress = false;
val6.rechargeStock = val6.baseMaxStock;
val6.requiredStock = 1;
val6.stockToConsume = 1;
val6.skillDescriptionToken = "Slam onto the ground, leaving a <style=cIsDamage>pool of fire</style> upon impact and bouncing against the terrain. Use on slopes for a speed boost!";
val6.skillName = "EXPLODER_UTILITY";
val6.skillNameToken = "Volatile Bounce";
val6.icon = Tools.SpriteFromString("7777277007777277777727700277727777777400027772777777740002777277772775000007777777277500000777777727061111007727277706222210772727771524422177272227144664117427377711366311747274770413311075775677750110077675766576060077566777766656556667777777776666777777", palette);
Tools.AddSkill(val, val6, "utility");
ContentAddition.AddEntityState<Skills.ExploderSpecial>(ref flag);
SkillDef val7 = ScriptableObject.CreateInstance<SkillDef>();
val7.activationState = new SerializableEntityStateType(typeof(Skills.ExploderSpecial));
val7.activationStateMachineName = "Tether";
val7.baseMaxStock = 1;
val7.baseRechargeInterval = 3f;
val7.beginSkillCooldownOnSkillEnd = true;
val7.canceledFromSprinting = false;
val7.cancelSprintingOnActivation = true;
val7.dontAllowPastMaxStocks = false;
val7.forceSprintDuringState = false;
val7.fullRestockOnAssign = true;
val7.interruptPriority = (InterruptPriority)2;
val7.isCombatSkill = false;
val7.mustKeyPress = false;
val7.rechargeStock = val7.baseMaxStock;
val7.requiredStock = 1;
val7.stockToConsume = 1;
val7.skillDescriptionToken = "Tether to the nearest enemy, redirecting 80% damage to the target.";
val7.skillName = "EXPLODER_SPECIAL";
val7.skillNameToken = "Lifeline";
val7.icon = Tools.SpriteFromString("1100011111110000111111117771100077111777777771007777777771107710177771113444170011111134433133104311356311101130544464311777700106564311777711101065431177710000110643177710000021105317771000002110431177110000221104117771000021100431177110001000043117771100", palette);
Tools.AddSkill(val, val7, "special");
SurvivorDef val8 = ScriptableObject.CreateInstance<SurvivorDef>();
val8.bodyPrefab = val;
val8.descriptionToken = "Lunar Chimera (Exploder Form) is a volatile little ball crab. <style=cSub>\r\n\r\n < ! > Tips go here." + Environment.NewLine;
val8.displayPrefab = val3;
val8.displayPrefab.transform.localScale = Vector3.one * 0.3f;
val8.primaryColor = new Color(0.55f, 0.7f, 0.8f);
val8.desiredSortPosition = 44.44f;
ContentAddition.AddSurvivorDef(val8);
}
}
internal static class Tools
{
internal static int Hex2Num(string hex)
{
int result = 0;
hex = hex.ToUpper();
switch (hex)
{
case "1":
result = 1;
break;
case "2":
result = 2;
break;
case "3":
result = 3;
break;
case "4":
result = 4;
break;
case "5":
result = 5;
break;
case "6":
result = 6;
break;
case "7":
result = 7;
break;
case "8":
result = 8;
break;
case "9":
result = 9;
break;
case "A":
result = 10;
break;
case "B":
result = 11;
break;
case "C":
result = 12;
break;
case "D":
result = 13;
break;
case "E":
result = 14;
break;
case "F":
result = 15;
break;
}
return result;
}
internal static string Num2Hex(int num)
{
string result = "0";
switch (num)
{
case 1:
result = "1";
break;
case 2:
result = "2";
break;
case 3:
result = "3";
break;
case 4:
result = "4";
break;
case 5:
result = "5";
break;
case 6:
result = "6";
break;
case 7:
result = "7";
break;
case 8:
result = "8";
break;
case 9:
result = "9";
break;
case 10:
result = "A";
break;
case 11:
result = "B";
break;
case 12:
result = "C";
break;
case 13:
result = "D";
break;
case 14:
result = "E";
break;
case 15:
result = "F";
break;
}
return result;
}
public static Sprite SpriteFromString(string texture, Color[] palette, bool Flipped = false)
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Expected O, but got Unknown
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: 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_0067: Unknown result type (might be due to invalid IL or missing references)
int num = (int)Math.Floor(Math.Pow(texture.Length, 0.5));
Texture2D val = new Texture2D(num, num, (TextureFormat)4, false);
((Texture)val).filterMode = (FilterMode)0;
((Texture)val).wrapMode = (TextureWrapMode)1;
int num2 = 0;
int i = 0;
int num3 = 0;
for (; i < num; i++)
{
for (num2 = 0; num2 < num; num2++)
{
if (!Flipped)
{
val.SetPixel(num - 1 - num2, i, palette[Hex2Num(texture.Substring(num3, 1))]);
}
else
{
val.SetPixel(num2, num - 1 - i, palette[Hex2Num(texture.Substring(num3, 1))]);
}
num3++;
}
}
val.Apply();
return Sprite.Create(val, new Rect((float)num, (float)num, (float)(-num), (float)(-num)), new Vector2((float)num * 0.5f, (float)num * 0.5f), (float)num);
}
internal static GameObject VoxelSprite(string texture, Color[] palette, Transform rootTransform)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0029: 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_00d4: 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_0107: 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)
GameObject val = new GameObject();
val.transform.parent = rootTransform;
val.transform.localPosition = new Vector3(0f, 0f, 0f);
val.transform.localScale = new Vector3(0.25f, 0.25f, 0.25f);
int num = -4;
int i = -4;
int num2 = 0;
for (; i < 4; i++)
{
for (num = -4; num < 4; num++)
{
if (Hex2Num(texture.Substring(num2, 1)) != 0)
{
GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)3);
((Renderer)val2.GetComponent<MeshRenderer>()).material.shader = Resources.Load<Shader>("Shaders/Deferred/HGStandard");
val2.transform.parent = val.transform;
val2.transform.localPosition = new Vector3((float)(-num) - 0.5f, (float)(-i), 0f);
val2.transform.localScale = new Vector3(1f, 1f, 1f);
val2.transform.localRotation = Quaternion.identity;
val2.GetComponent<Renderer>().material.color = palette[Hex2Num(texture.Substring(num2, 1))];
val2.gameObject.layer = LayerIndex.noCollision.intVal;
}
num2++;
}
}
return val;
}
internal static GameObject CreateBody(string BodyName, string BodyDirectory = "RoR2/Base/Commando/CommandoBody.prefab")
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Addressables.LoadAssetAsync<GameObject>((object)BodyDirectory).WaitForCompletion();
GameObject val2 = PrefabAPI.InstantiateClone(val, "FubukiMods/" + BodyName);
KinematicCharacterMotor component = val2.GetComponent<KinematicCharacterMotor>();
if (Object.op_Implicit((Object)(object)component))
{
component.playerCharacter = true;
}
GenericSkill[] componentsInChildren = val2.GetComponentsInChildren<GenericSkill>();
foreach (GenericSkill val3 in componentsInChildren)
{
Object.DestroyImmediate((Object)(object)val3);
}
SkillLocator component2 = val2.GetComponent<SkillLocator>();
Reflection.SetFieldValue<GenericSkill[]>((object)component2, "allSkills", (GenericSkill[])(object)new GenericSkill[0]);
component2.primary = val2.AddComponent<GenericSkill>();
SkillFamily val4 = ScriptableObject.CreateInstance<SkillFamily>();
val4.variants = (Variant[])(object)new Variant[1];
ContentAddition.AddSkillFamily(val4);
Reflection.SetFieldValue<SkillFamily>((object)component2.primary, "_skillFamily", val4);
component2.secondary = val2.AddComponent<GenericSkill>();
SkillFamily val5 = ScriptableObject.CreateInstance<SkillFamily>();
val5.variants = (Variant[])(object)new Variant[1];
ContentAddition.AddSkillFamily(val5);
Reflection.SetFieldValue<SkillFamily>((object)component2.secondary, "_skillFamily", val5);
component2.utility = val2.AddComponent<GenericSkill>();
SkillFamily val6 = ScriptableObject.CreateInstance<SkillFamily>();
val6.variants = (Variant[])(object)new Variant[1];
ContentAddition.AddSkillFamily(val6);
Reflection.SetFieldValue<SkillFamily>((object)component2.utility, "_skillFamily", val6);
component2.special = val2.AddComponent<GenericSkill>();
SkillFamily val7 = ScriptableObject.CreateInstance<SkillFamily>();
val7.variants = (Variant[])(object)new Variant[1];
ContentAddition.AddSkillFamily(val7);
Reflection.SetFieldValue<SkillFamily>((object)component2.special, "_skillFamily", val7);
return val2;
}
internal static bool CreateIDR(List<KeyAssetRuleGroup> ItemDisplayRules, ItemDef Item)
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: 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_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: 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_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: 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_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)
ItemDisplayRules.Add(new KeyAssetRuleGroup
{
keyAsset = (Object)(object)Item,
displayRuleGroup = new DisplayRuleGroup
{
rules = (ItemDisplayRule[])(object)new ItemDisplayRule[1]
{
new ItemDisplayRule
{
ruleType = (ItemDisplayRuleType)0,
followerPrefab = null,
childName = "Muzzle",
localPos = new Vector3(0f, 0.2091f, -0.3642f),
localAngles = new Vector3(0f, 0f, 0f),
localScale = new Vector3(0.15f, 0.15f, 0.15f),
limbMask = (LimbFlags)0
}
}
}
});
return true;
}
internal static void AddIDR(string AttachPoint, Vector3 Position, Vector3 Rotation, Vector3 Scale)
{
}
internal static bool AddSkill(GameObject Body, SkillDef SkillDef, string Slot = "primary", int Variant = 0)
{
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_0181: Expected O, but got Unknown
//IL_0182: 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_00d2: 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_00fe: Expected O, but got Unknown
//IL_00ff: 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)
ContentAddition.AddSkillDef(SkillDef);
SkillLocator component = Body.GetComponent<SkillLocator>();
Reflection.SetFieldValue<GenericSkill[]>((object)component, "allSkills", (GenericSkill[])(object)new GenericSkill[0]);
GenericSkill val;
if (Slot.ToLower() == "primary")
{
val = component.primary;
}
else if (Slot.ToLower() == "secondary")
{
val = component.secondary;
}
else if (Slot.ToLower() == "utility")
{
val = component.utility;
}
else
{
if (!(Slot.ToLower() == "special"))
{
MonoBehaviour.print((object)"[FUBUKI ERROR:] Unrecognized slot.");
return false;
}
val = component.special;
}
Variant val2;
if (Variant == 0)
{
SkillFamily skillFamily = val.skillFamily;
Variant[] variants = skillFamily.variants;
val2 = new Variant
{
skillDef = SkillDef
};
((Variant)(ref val2)).viewableNode = new Node(SkillDef.skillName + "_TEST", false, (Node)null);
variants[0] = val2;
MonoBehaviour.print((object)("Skill Added: " + Slot + " - " + SkillDef.skillName));
return true;
}
SkillFamily skillFamily2 = val.skillFamily;
Array.Resize(ref skillFamily2.variants, skillFamily2.variants.Length + 1);
Variant[] variants2 = skillFamily2.variants;
val2 = new Variant
{
skillDef = SkillDef
};
((Variant)(ref val2)).viewableNode = new Node(SkillDef.skillName + "_TEST", false, (Node)null);
variants2[Variant] = val2;
MonoBehaviour.print((object)("Alt Skill Added: " + Slot + " - " + SkillDef.skillName));
return true;
}
}
}