Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of KingItems v1.4.5
KingItems.dll
Decompiled 6 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using EntityStates; using EntityStates.ClayBruiser.Weapon; using EntityStates.GolemMonster; using EntityStates.TitanMonster; using NS_KingModUtilities; using On.EntityStates; using On.EntityStates.ClayBruiser.Weapon; using On.EntityStates.GolemMonster; using On.EntityStates.TitanMonster; using On.RoR2; using On.RoR2.Orbs; using On.RoR2.Projectile; using On.RoR2.UI; using R2API.Utils; using RoR2; using RoR2.Orbs; using RoR2.Projectile; using RoR2.UI; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering.PostProcessing; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("KingItems")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+f2f955e7b924cb1b05acd47131e33099e566f8ec")] [assembly: AssemblyProduct("KingItems")] [assembly: AssemblyTitle("KingItems")] [assembly: AssemblyVersion("1.0.0.0")] namespace NS_KingItems; public class TimeStopFreezeState : BaseState { public float duration; public override void OnEnter() { //IL_003c: 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) ((BaseState)this).OnEnter(); Animator modelAnimator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)modelAnimator)) { ((Behaviour)modelAnimator).enabled = false; } if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbody) && !((EntityState)this).rigidbody.isKinematic) { ((EntityState)this).rigidbody.velocity = Vector3.zero; if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbodyMotor)) { ((EntityState)this).rigidbodyMotor.moveVector = Vector3.zero; } } } public override void OnExit() { Animator modelAnimator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)modelAnimator)) { ((Behaviour)modelAnimator).enabled = true; } ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public static class ItemsSounds { public static readonly uint TimeResumeSFX = 3090400288u; public static readonly uint TimeStopSFX = 2383709427u; } public class DiosHead { private static GameObject timeStopFX; private static CharacterBody characterBodyUsed = null; private static readonly float TIMESTOP_DURATION = 9f; private static readonly float TIMESTOP_STARTUP_DURATION = 2f; private static bool TIMESTOP_ACTIVE = false; private static bool TIMESTOP_FREEZE_PROJECTILES = false; private static bool TIMESTOP_FREEZE_SPAWNS = false; private static float FREEZE_TIMER = 0f; private static readonly float FREEZE_TIMER_INTERVAL = 1f; private static float TIMESTOP_STARTED_TIME = 0f; private static LTSeq currentSequence = null; public static EquipmentDef CreateCustomEquipmentDef() { //IL_0044: 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: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Expected O, but got Unknown //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Expected O, but got Unknown //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Expected O, but got Unknown //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Expected O, but got Unknown //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Expected O, but got Unknown //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Expected O, but got Unknown //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Expected O, but got Unknown //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Expected O, but got Unknown //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Expected O, but got Unknown //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Expected O, but got Unknown //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Expected O, but got Unknown //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Expected O, but got Unknown //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Expected O, but got Unknown //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Expected O, but got Unknown //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Expected O, but got Unknown ScriptableObject obj = ScriptableObject.CreateInstance(typeof(EquipmentDef)); ScriptableObject obj2 = ((obj is EquipmentDef) ? obj : null); ((Object)obj2).name = CreateName(); ((EquipmentDef)obj2).appearsInMultiPlayer = false; ((EquipmentDef)obj2).appearsInSinglePlayer = true; ((EquipmentDef)obj2).isBoss = false; ((EquipmentDef)obj2).isLunar = false; ((EquipmentDef)obj2).canDrop = true; ((EquipmentDef)obj2).colorIndex = (ColorIndex)5; ((EquipmentDef)obj2).enigmaCompatible = true; ((EquipmentDef)obj2).pickupIconSprite = KingItemsAssets.Img_DiosHead; ((EquipmentDef)obj2).pickupModelPrefab = KingItemsAssets.DiosHead; ((EquipmentDef)obj2).loreToken = CreateItemLore(); ((EquipmentDef)obj2).descriptionToken = CreateItemComplexDescription(); ((EquipmentDef)obj2).pickupToken = CreateItemSimpleDescription(); ((EquipmentDef)obj2).nameToken = CreateNameToken(); ((EquipmentDef)obj2).cooldown = 300f; CombatDirector.Simulate += new hook_Simulate(CombatDirector_Simulate_Hook); ProjectileSimple.FixedUpdate += new hook_FixedUpdate(ProjectileSimple_FixedUpdate_Hook); Run.ShouldUpdateRunStopwatch += new hook_ShouldUpdateRunStopwatch(Run_ShouldUpdateRunStopwatch_Hook); OrbEffect.UpdateOrb += new hook_UpdateOrb(OrbEffect_UpdateOrb_Hook); OrbManager.FixedUpdate += new hook_FixedUpdate(OrbManager_FixedUpdate_Hook); SetStateOnHurt.SetFrozen += new hook_SetFrozen(SetStateOnHurt_SetFrozen_Hook); SetStateOnHurt.SetStun += new hook_SetStun(SetStateOnHurt_SetStun_Hook); SetStateOnHurt.SetPain += new hook_SetPain(SetStateOnHurt_SetPain_Hook); ProjectileImpactExplosion.FixedUpdate += new hook_FixedUpdate(ProjectileImpactExplosion_FixedUpdate_Hook); RigidbodyMotor.FixedUpdate += new hook_FixedUpdate(RigidbodyMotor_FixedUpdate_Hook); DelayBlast.FixedUpdate += new hook_FixedUpdate(DelayBlast_FixedUpdate_Hook); DestroyOnTimer.FixedUpdate += new hook_FixedUpdate(DestroyOnTimer_FixedUpdate_Hook); ChargeLaser.Update += new hook_Update(ChargeLaser_Update); ChargeLaser.FixedUpdate += new hook_FixedUpdate(ChargeLaser_FixedUpdate); ChargeMegaLaser.Update += new hook_Update(ChargeMegaLaser_Update_Hook); ChargeMegaLaser.FixedUpdate += new hook_FixedUpdate(ChargeMegaLaser_FixedUpdate_Hook); FireMegaLaser.FixedUpdate += new hook_FixedUpdate(FireMegaLaser_FixedUpdate_Hook); ChargeGoldMegaLaser.FixedUpdate += new hook_FixedUpdate(ChargeGoldMegaLaser_FixedUpdate_Hook); FireGoldMegaLaser.FixedUpdate += new hook_FixedUpdate(FireGoldMegaLaser_FixedUpdate_Hook); WormBodyPositionsDriver.FixedUpdateServer += new hook_FixedUpdateServer(WormBodyPositionsDriver_FixedUpdateServer_Hook); WormBodyPositions2.OnDeathStart += new hook_OnDeathStart(WormBodyPositions2_OnDeathStart_Hook); MinigunFire.FixedUpdate += new hook_FixedUpdate(MinigunFire_FixedUpdate_Hook); GenericCharacterDeath.OnEnter += new hook_OnEnter(GenericCharacterDeath_OnEnter_Hook); MainPlugin.s_updateAction = (Action)Delegate.Combine(MainPlugin.s_updateAction, new Action(IntervalFreeze_Update_Hook)); MainPlugin.s_delegate_OnStageStarted = (VoidDelegate)Delegate.Combine((Delegate?)(object)MainPlugin.s_delegate_OnStageStarted, (Delegate?)new VoidDelegate(ResetTimeStopValues)); return (EquipmentDef)(object)obj2; } private static Vector3 GenerateTimeStopFrozenVelocity(Rigidbody rb) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) bool flag = false; AntiGravityForce component = ((Component)rb).GetComponent<AntiGravityForce>(); if ((Object)(object)component != (Object)null) { flag = component.antiGravityCoefficient == 1f; } if (!rb.useGravity || flag) { return Vector3.zero; } return new Vector3(0f, 0.5f - (MainPlugin.IsInStage("moon2") ? 0.16f : 0f), 0f); } private static void RigidbodyMotor_FixedUpdate_Hook(orig_FixedUpdate orig, RigidbodyMotor self) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } else { self.rigid.velocity = GenerateTimeStopFrozenVelocity(self.rigid); } } public static string CreateName() { return "DiosHead"; } public static string CreateNameToken() { return "Dio's Head"; } public static string CreateItemComplexDescription() { return CreateItemSimpleDescription(); } public static string CreateItemSimpleDescription() { return "Unleash Dio's Stand..." + MainPlugin.ColorText("Stopping Time", "#03f4fc") + " for 9 Seconds."; } public static string CreateItemLore() { return "Dio's signature power is its ability to stop time, allowing DIO and anyone with the same power, to act within the duration of stopped time."; } public static bool OnCustomEquipmentActivated(EquipmentSlot self) { if (!RoR2Application.isInSinglePlayer) { return false; } if ((((Object)(object)self != (Object)null) & ((Object)(object)self.characterBody != (Object)null)) && (Object)(object)self.characterBody.healthComponent != (Object)null && self.characterBody.healthComponent.alive && !TIMESTOP_ACTIVE) { TIMESTOP_ACTIVE = true; characterBodyUsed = self.characterBody; OnTimeStop_Start(); return true; } return false; } public static void IntervalFreeze_Update_Hook() { if ((Object)(object)Run.instance != (Object)null && TIMESTOP_ACTIVE) { FREEZE_TIMER -= Time.deltaTime; if (FREEZE_TIMER <= 0f) { TimeStopFreezeAllEnemies(); FREEZE_TIMER = FREEZE_TIMER_INTERVAL; } if ((Object)(object)characterBodyUsed == (Object)null && (Object)(object)timeStopFX == (Object)null) { MainPlugin.DebugLog("WTF? Time Stop Got Stuck, lets abort it just incase?!?"); ForceEndTimeStop(); } } } public static void TimeStopFreezeAllEnemies() { //IL_0017: 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_0026: 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) if ((Object)(object)characterBodyUsed != (Object)null) { Vector3 position = ((Component)characterBodyUsed).transform.position; LayerIndex entityPrecise = LayerIndex.entityPrecise; TimeStopEnemies(Physics.OverlapSphere(position, float.MaxValue, LayerMask.op_Implicit(((LayerIndex)(ref entityPrecise)).mask)).ToArray(), characterBodyUsed, TIMESTOP_STARTED_TIME + (TIMESTOP_STARTUP_DURATION + TIMESTOP_DURATION + TIMESTOP_STARTUP_DURATION - 1f) - Time.time); } } public static void FXStart_OnUpdate(float timeRatio) { ((ParameterOverride<float>)(object)timeStopFX.GetComponent<PostProcessVolume>().profile.GetSetting<ColorGrading>().hueShift).value = 0f + Mathf.Lerp(0f, 180f, timeRatio); ((ParameterOverride<float>)(object)timeStopFX.GetComponent<PostProcessVolume>().profile.GetSetting<LensDistortion>().intensity).value = 0f + Mathf.Lerp(0f, 80f, timeRatio); } public static void FXStart_Middle_OnComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) LeanTween.scale(timeStopFX, new Vector3(0f, 0f, 0f), TIMESTOP_STARTUP_DURATION / 2f).setOnComplete((Action)FXStart_End_OnComplete).setOnUpdate((Action<float>)FXStart_End_OnUpdate) .setEase((LeanTweenType)6); } public static void FXStart_End_OnComplete() { currentSequence = LeanTween.sequence(true); currentSequence.append(TIMESTOP_DURATION); currentSequence.append((Action)FXEnd); } public static void FXStart_End_OnUpdate(float timeRatio) { ((ParameterOverride<float>)(object)timeStopFX.GetComponent<PostProcessVolume>().profile.GetSetting<ColorGrading>().saturation).value = Mathf.Lerp(0f, -75f, timeRatio); ((ParameterOverride<float>)(object)timeStopFX.GetComponent<PostProcessVolume>().profile.GetSetting<LensDistortion>().intensity).value = 0f + Mathf.Lerp(80f, 0f, timeRatio); } public static void FXEnd() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)timeStopFX != (Object)null) { MainPlugin.PlaySoundEvent(timeStopFX, ItemsSounds.TimeResumeSFX, 100); LeanTween.scale(timeStopFX, new Vector3(15f, 15f, 15f), TIMESTOP_STARTUP_DURATION / 2f).setOnComplete((Action)FXEnd_Middle_OnComplete).setOnUpdate((Action<float>)FXEnd_OnUpdate); } } public static void FXEnd_OnUpdate(float timeRatio) { ((ParameterOverride<float>)(object)timeStopFX.GetComponent<PostProcessVolume>().profile.GetSetting<LensDistortion>().intensity).value = 0f + Mathf.Lerp(0f, 80f, timeRatio); } public static void FXEnd_Middle_OnComplete() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) LeanTween.scale(timeStopFX, new Vector3(0f, 0f, 0f), TIMESTOP_STARTUP_DURATION / 2f).setOnComplete((Action)FXEnd_End_OnComplete).setOnUpdate((Action<float>)FXEnd_End_OnUpdate) .setEase((LeanTweenType)6); OnTimeStop_PreEnd(); } public static void FXEnd_End_OnComplete() { OnTimeStop_End(); } public static void FXEnd_End_OnUpdate(float timeRatio) { ((ParameterOverride<float>)(object)timeStopFX.GetComponent<PostProcessVolume>().profile.GetSetting<ColorGrading>().saturation).value = Mathf.Lerp(-75f, 0f, timeRatio); ((ParameterOverride<float>)(object)timeStopFX.GetComponent<PostProcessVolume>().profile.GetSetting<ColorGrading>().hueShift).value = 0f + Mathf.Lerp(180f, 0f, timeRatio); ((ParameterOverride<float>)(object)timeStopFX.GetComponent<PostProcessVolume>().profile.GetSetting<LensDistortion>().intensity).value = 0f + Mathf.Lerp(80f, 0f, timeRatio); } private static bool TimeStopEnemies(Collider[] array, CharacterBody self, float ts_duration) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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) IEnumerable<Collider> enumerable = array.Where((Collider x) => (Object)(object)((Component)x).GetComponent<HurtBox>() != (Object)null); List<HurtBoxGroup> list = new List<HurtBoxGroup>(); foreach (Collider item in enumerable) { HurtBox hurtBox2 = ((Component)item).GetComponentInChildren<HurtBox>(); if ((Object)(object)hurtBox2 == (Object)null || (Object)(object)hurtBox2.healthComponent == (Object)(object)self.healthComponent || list.Where((HurtBoxGroup x) => (Object)(object)x == (Object)(object)hurtBox2.hurtBoxGroup).Count() > 0 || (hurtBox2.teamIndex == self.teamComponent.teamIndex && (int)FriendlyFireManager.friendlyFireMode == 0)) { continue; } _ = hurtBox2; list.Add(hurtBox2.hurtBoxGroup); HealthComponent componentInChildren = ((Component)hurtBox2.healthComponent).gameObject.GetComponentInChildren<HealthComponent>(); if (!((Object)(object)componentInChildren != (Object)null)) { continue; } CharacterBody body = componentInChildren.body; if ((Object)(object)body != (Object)null) { EntityStateMachine component = ((Component)body).GetComponent<EntityStateMachine>(); if ((Object)(object)component != (Object)null) { TimeStopFreezeState state = new TimeStopFreezeState { duration = ts_duration }; component.SetState((EntityState)(object)state); } } } if (list == null) { return false; } return list.Count() > 0; } private static void CombatDirector_Simulate_Hook(orig_Simulate orig, CombatDirector self, float deltaTime) { if (!TIMESTOP_FREEZE_SPAWNS) { orig.Invoke(self, deltaTime); } } private static void ProjectileSimple_FixedUpdate_Hook(orig_FixedUpdate orig, ProjectileSimple self) { //IL_0019: 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) if (TIMESTOP_FREEZE_PROJECTILES) { Rigidbody component = ((Component)self).GetComponent<Rigidbody>(); if ((Object)(object)component != (Object)null) { component.velocity = GenerateTimeStopFrozenVelocity(component); component.angularVelocity = Vector3.zero; } } else { orig.Invoke(self); } } private static void OrbManager_FixedUpdate_Hook(orig_FixedUpdate orig, OrbManager self) { if (!TIMESTOP_FREEZE_PROJECTILES) { orig.Invoke(self); } } private static void OrbEffect_UpdateOrb_Hook(orig_UpdateOrb orig, OrbEffect self, float deltaTime) { if (!TIMESTOP_FREEZE_PROJECTILES) { orig.Invoke(self, deltaTime); } } private static bool Run_ShouldUpdateRunStopwatch_Hook(orig_ShouldUpdateRunStopwatch orig, Run self) { if (orig.Invoke(self)) { return !TIMESTOP_ACTIVE; } return false; } private static void SetStateOnHurt_SetPain_Hook(orig_SetPain orig, SetStateOnHurt self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } private static void SetStateOnHurt_SetStun_Hook(orig_SetStun orig, SetStateOnHurt self, float duration) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self, duration); } } private static void SetStateOnHurt_SetFrozen_Hook(orig_SetFrozen orig, SetStateOnHurt self, float duration) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self, duration); } } private static void ProjectileImpactExplosion_FixedUpdate_Hook(orig_FixedUpdate orig, ProjectileImpactExplosion self) { if (!TIMESTOP_FREEZE_PROJECTILES) { orig.Invoke(self); } } private static void ChargeLaser_FixedUpdate(orig_FixedUpdate orig, ChargeLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } private static void ChargeLaser_Update(orig_Update orig, ChargeLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } private static void ChargeMegaLaser_FixedUpdate_Hook(orig_FixedUpdate orig, ChargeMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } private static void ChargeMegaLaser_Update_Hook(orig_Update orig, ChargeMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } private static void FireMegaLaser_FixedUpdate_Hook(orig_FixedUpdate orig, FireMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } private static void ChargeGoldMegaLaser_FixedUpdate_Hook(orig_FixedUpdate orig, ChargeGoldMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } private static void FireGoldMegaLaser_FixedUpdate_Hook(orig_FixedUpdate orig, FireGoldMegaLaser self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } private static void WormBodyPositions2_OnDeathStart_Hook(orig_OnDeathStart orig, WormBodyPositions2 self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } private static void WormBodyPositionsDriver_FixedUpdateServer_Hook(orig_FixedUpdateServer orig, WormBodyPositionsDriver self) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } else { self.chaserVelocity = Vector3.zero; } } private static void DelayBlast_FixedUpdate_Hook(orig_FixedUpdate orig, DelayBlast self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } private static void DestroyOnTimer_FixedUpdate_Hook(orig_FixedUpdate orig, DestroyOnTimer self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } private static void MinigunFire_FixedUpdate_Hook(orig_FixedUpdate orig, MinigunFire self) { if (!TIMESTOP_ACTIVE) { orig.Invoke(self); } } private static void GenericCharacterDeath_OnEnter_Hook(orig_OnEnter orig, GenericCharacterDeath self) { MainPlugin.DebugLog("GenericCharacterDeath_OnEnter_Hook();"); if (TIMESTOP_ACTIVE) { CharacterBody characterBody = ((EntityState)self).outer.commonComponents.characterBody; if ((Object)(object)characterBody != (Object)null && (Object)(object)characterBody == (Object)(object)characterBodyUsed) { MainPlugin.DebugLog("GenericCharacterDeath_OnEnter_Hook() : Time User Died, end timestop!!!"); ForceEndTimeStop(); } } orig.Invoke(self); } private static void OnTimeStop_Start() { //IL_0014: 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_004d: 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) TIMESTOP_STARTED_TIME = Time.time; MainPlugin.CreateCameraShake(((Component)characterBodyUsed).transform.position, TIMESTOP_STARTUP_DURATION, 100f, 1f, 180f, 0f, true); timeStopFX = Object.Instantiate<GameObject>(KingItemsAssets.ZaWarudoEffect, ((Component)characterBodyUsed).transform.position, Quaternion.identity); timeStopFX.transform.SetParent(((Component)characterBodyUsed).transform, true); timeStopFX.layer = LayerMask.NameToLayer("PostProcess"); LeanTween.scale(timeStopFX, new Vector3(20f, 20f, 20f), TIMESTOP_STARTUP_DURATION / 2f).setOnComplete((Action)FXStart_Middle_OnComplete).setOnUpdate((Action<float>)FXStart_OnUpdate); MainPlugin.PlaySoundEvent(timeStopFX, ItemsSounds.TimeStopSFX, 100); MainPlugin.SetOverrideMusic(true, TIMESTOP_STARTUP_DURATION + TIMESTOP_DURATION + TIMESTOP_STARTUP_DURATION); ((ParameterOverride<float>)(object)timeStopFX.GetComponent<PostProcessVolume>().profile.GetSetting<ColorGrading>().hueShift).value = 0f; ((ParameterOverride<float>)(object)timeStopFX.GetComponent<PostProcessVolume>().profile.GetSetting<ColorGrading>().saturation).value = 0f; ((ParameterOverride<float>)(object)timeStopFX.GetComponent<PostProcessVolume>().profile.GetSetting<LensDistortion>().intensity).value = 0f; TimeStopFreezeAllEnemies(); TIMESTOP_FREEZE_PROJECTILES = true; TIMESTOP_FREEZE_SPAWNS = true; FREEZE_TIMER = 0f; ParticleSystem[] array = Object.FindObjectsOfType<ParticleSystem>(); for (int i = 0; i < array.Length; i++) { array[i].Pause(true); } } private static void OnTimeStop_PreEnd() { TIMESTOP_FREEZE_PROJECTILES = false; TIMESTOP_FREEZE_SPAWNS = false; ProjectileSimple[] array = Object.FindObjectsOfType<ProjectileSimple>(); foreach (ProjectileSimple val in array) { Reflection.InvokeMethod((object)val, "SetForwardSpeed", new object[1] { val.desiredForwardSpeed }); } ParticleSystem[] array2 = Object.FindObjectsOfType<ParticleSystem>(); foreach (ParticleSystem val2 in array2) { if (val2.isPaused) { val2.Play(true); } } } private static void OnTimeStop_End() { if ((Object)(object)timeStopFX != (Object)null) { Object.Destroy((Object)(object)timeStopFX); } if (currentSequence != null) { LeanTween.cancel(currentSequence.id); } ResetTimeStopValues(); } public static void ResetTimeStopValues() { timeStopFX = null; TIMESTOP_ACTIVE = false; TIMESTOP_FREEZE_PROJECTILES = false; TIMESTOP_FREEZE_SPAWNS = false; FREEZE_TIMER = 0f; currentSequence = null; } public static void ForceEndTimeStop() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)timeStopFX != (Object)null) { LeanTween.cancel(timeStopFX); } if ((Object)(object)characterBodyUsed != (Object)null) { Vector3 position = ((Component)characterBodyUsed).transform.position; LayerIndex entityPrecise = LayerIndex.entityPrecise; TimeStopEnemies(Physics.OverlapSphere(position, float.MaxValue, LayerMask.op_Implicit(((LayerIndex)(ref entityPrecise)).mask)).ToArray(), characterBodyUsed, 0f); } OnTimeStop_PreEnd(); OnTimeStop_End(); } } public class KaioEssence { private const float m_buffDuration = 10f; public static string s_buffName = CreateName() + "Buff"; public const float s_buffScale = 0.85f; public static EquipmentDef CreateCustomEquipmentDef() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) ScriptableObject obj = ScriptableObject.CreateInstance(typeof(EquipmentDef)); ScriptableObject obj2 = ((obj is EquipmentDef) ? obj : null); ((Object)obj2).name = CreateName(); ((EquipmentDef)obj2).appearsInMultiPlayer = true; ((EquipmentDef)obj2).appearsInSinglePlayer = true; ((EquipmentDef)obj2).isBoss = false; ((EquipmentDef)obj2).isLunar = false; ((EquipmentDef)obj2).canDrop = true; ((EquipmentDef)obj2).colorIndex = (ColorIndex)5; ((EquipmentDef)obj2).enigmaCompatible = true; ((EquipmentDef)obj2).pickupIconSprite = KingItemsAssets.Img_KaioEssence; ((EquipmentDef)obj2).loreToken = CreateItemLore(); ((EquipmentDef)obj2).descriptionToken = CreateItemComplexDescription(); ((EquipmentDef)obj2).pickupToken = CreateItemSimpleDescription(); ((EquipmentDef)obj2).nameToken = CreateNameToken(); ((EquipmentDef)obj2).cooldown = 60f; ((EquipmentDef)obj2).pickupModelPrefab = KingItemsAssets.KaioEssence; return (EquipmentDef)(object)obj2; } public static string CreateName() { return "KaioEssence"; } public static string CreateNameToken() { return "Kaio Essence"; } public static string CreateItemComplexDescription() { string text = ""; string text2 = ""; string text3 = ""; KaiokenTransformationState kaiokenReference = GetKaiokenReference(); if (kaiokenReference != null) { text = KingUtil.MultToPercent(((TransformationState)kaiokenReference).GetDamagePercentBonus() * 0.85f).ToString("n0"); text2 = KingUtil.MultToPercent(((TransformationState)kaiokenReference).GetAttackSpeedPercentBonus() * 0.85f).ToString("n0"); text3 = KingUtil.MultToPercent(((TransformationState)kaiokenReference).GetMoveSpeedPercentBonus() * 0.85f).ToString("n0"); } return "Grants a purified variant of the Kaioken, gaining bonus " + MainPlugin.ColorText(text + "% Damage, " + text2 + "% Attack Speed & " + text3 + "% Movement Speed", "#E5C962") + " for " + MainPlugin.ColorText(10f.ToString("n0"), "#FFFFFF") + " Seconds."; } public static string CreateItemSimpleDescription() { return "Grants a purified variant of the Kaioken, gaining bonus " + MainPlugin.ColorText("Damage, Attack Speed & Movement Speed", "#E5C962") + " for " + MainPlugin.ColorText(10f.ToString("n0"), "#FFFFFF") + " Seconds."; } public static string CreateItemLore() { return "Forged by the great Kai himself, a fragment of the Kaioken was formed, granting its user the benefits without repercussion..."; } public static bool OnCustomEquipmentActivated(EquipmentSlot self) { //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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)self.characterBody != (Object)null) { BonusStatHandler component = ((Component)self.characterBody).GetComponent<BonusStatHandler>(); if ((Object)(object)component != (Object)null) { if (((NetworkBehaviour)self.characterBody).hasAuthority) { KaiokenTransformationState kaiokenReference = GetKaiokenReference(); if (kaiokenReference != null) { if (!component.HasBonusStatBundle(s_buffName)) { MainPlugin.PlaySoundEvent(((Component)self).gameObject, BaseSounds.aura_kaioken_start, 100); } BonusStatBundle val = default(BonusStatBundle); ((BonusStatBundle)(ref val))..ctor(s_buffName, KingItemsAssets.KaioEssence_Aura, 10f); BonusStatBundle val2 = ((TransformationState)kaiokenReference).GenerateBonusStateBundle(); List<BonusStat> allBonusStats = ((BonusStatBundle)(ref val2)).GetAllBonusStats(); for (int i = 0; i < allBonusStats.Count; i++) { BonusStat val3 = allBonusStats[i]; val3.MultValue *= 0.85f; ((BonusStatBundle)(ref val)).AddBonusStat(ref val3); } component.AddBonusStatBundle(val); } } else { NetworkHandler component2 = ((Component)self.characterBody).GetComponent<NetworkHandler>(); if ((Object)(object)component2 != (Object)null) { component2.CmdCallFunction(MainPlugin.GetAssemblyNameFromNamespace("NS_KingItems"), "KaioEssence", "ClientOnCustomEquipmentActivated", ((Component)self.characterBody).gameObject, true, true, false, true); } } } } return true; } public static KaiokenTransformationState GetKaiokenReference() { TransformationState obj = TransformationBank.FindLoadedTransformation("Kaioken x3"); return (KaiokenTransformationState)(object)((obj is KaiokenTransformationState) ? obj : null); } public static void ClientOnCustomEquipmentActivated(GameObject characterBodyGO) { CharacterBody component = characterBodyGO.GetComponent<CharacterBody>(); if ((Object)(object)component != (Object)null && ((NetworkBehaviour)component).hasAuthority) { OnCustomEquipmentActivated(component.equipmentSlot); } } } public class SenzuBean { public static EquipmentDef CreateCustomEquipmentDef() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) ScriptableObject obj = ScriptableObject.CreateInstance(typeof(EquipmentDef)); ScriptableObject obj2 = ((obj is EquipmentDef) ? obj : null); ((Object)obj2).name = CreateName(); ((EquipmentDef)obj2).appearsInMultiPlayer = true; ((EquipmentDef)obj2).appearsInSinglePlayer = true; ((EquipmentDef)obj2).isBoss = false; ((EquipmentDef)obj2).isLunar = false; ((EquipmentDef)obj2).canDrop = true; ((EquipmentDef)obj2).colorIndex = (ColorIndex)5; ((EquipmentDef)obj2).enigmaCompatible = true; ((EquipmentDef)obj2).pickupIconSprite = KingItemsAssets.Img_SenzuBean; ((EquipmentDef)obj2).pickupModelPrefab = KingItemsAssets.SenzuBean; ((EquipmentDef)obj2).loreToken = CreateItemLore(); ((EquipmentDef)obj2).descriptionToken = CreateItemComplexDescription(); ((EquipmentDef)obj2).pickupToken = CreateItemSimpleDescription(); ((EquipmentDef)obj2).nameToken = CreateNameToken(); ((EquipmentDef)obj2).cooldown = 150f; return (EquipmentDef)(object)obj2; } public static string CreateName() { return "SenzuBean"; } public static string CreateNameToken() { return "Senzu Bean"; } public static string CreateItemComplexDescription() { return "Instantly replenish " + MainPlugin.ColorText("100% of your Maximum Health", "#00FF00") + "\nAdditionally, replenish " + MainPlugin.ColorText("100% of your Maximum Ki", "#03bcff"); } public static string CreateItemSimpleDescription() { return "Instantly replenish " + MainPlugin.ColorText("All Health", "#00FF00") + " and " + MainPlugin.ColorText("All Ki", "#03bcff"); } public static string CreateItemLore() { return "Senzu Beans are grown by Korin in Korin Tower.\nWhen eaten, the consumer's energy and physical health are restored to their fullest;\nthe effects are typically almost instantaneous for the recipient,\nmaking these beans a great asset both in and out of battle."; } public static bool OnCustomEquipmentActivated(EquipmentSlot self) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_000d: 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_004c: Unknown result type (might be due to invalid IL or missing references) EffectData val = new EffectData(); val.origin = ((Component)self).transform.position; val.SetNetworkedObjectReference(((Component)self).gameObject); EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/FruitHealEffect"), val, true); self.characterBody.healthComponent.HealFraction(1f, default(ProcChainMask)); NetworkHandler component = ((Component)self.characterBody).GetComponent<NetworkHandler>(); if ((Object)(object)component != (Object)null) { component.CmdRefillKi(100f); } return true; } } public class TrainingWeight { private static List<float> s_currentTrainingValues = new List<float>(); private static List<bool> s_currentValuesTrained = new List<bool>(); private const string s_bsbName = "TrainingWeightBonus"; private const string s_bsbNameDebuff = "TrainingWeightBonusDebuff"; private const string s_descriptionToken = "TrainingWeight_DescToken"; private const float s_statPercentModifier = 30f; private const float s_maxTrainingValue = 480f; private const float s_gainBonusMult = 1.5f; private static float s_updateTrainingBuffTimer = 0f; private const float s_updateTrainingBuffTimerMax = 1f; private const int s_trainingLimit = 3; private const float s_expGainMultPerItem = 0.15f; private static DynamicArray<ItemIcon> s_inventoryIcons = new DynamicArray<ItemIcon>(); public static void ResetCurrentTrainingValues() { s_currentValuesTrained.Clear(); s_currentTrainingValues.Clear(); } private static bool IsTrainingComplete(int idx) { return s_currentTrainingValues[idx] == 480f; } private static float GetTrainingCompleteRatio(int idx) { if (idx >= 0 && idx < s_currentTrainingValues.Count) { return s_currentTrainingValues[idx] / 480f; } return 0f; } public static ItemDef CreateCustomItemDef() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown ScriptableObject obj = ScriptableObject.CreateInstance(typeof(ItemDef)); ScriptableObject obj2 = ((obj is ItemDef) ? obj : null); ((Object)obj2).name = CreateName(); ((ItemDef)obj2).pickupIconSprite = KingItemsAssets.Img_TrainingWeight; ((ItemDef)obj2).pickupModelPrefab = KingItemsAssets.TrainingWeight; ((ItemDef)obj2).loreToken = CreateItemLore(); ((ItemDef)obj2).descriptionToken = CreateItemSimpleDescription(); ((ItemDef)obj2).pickupToken = CreateItemSimpleDescription(); ((ItemDef)obj2).nameToken = CreateNameToken(); ItemTierDef val = Addressables.LoadAssetAsync<ItemTierDef>((object)"RoR2/Base/Common/LunarTierDef.asset").WaitForCompletion(); Reflection.SetFieldValue<ItemTierDef>((object)obj2, "_itemTierDef", val); MainPlugin.s_delegate_ResetStaticCharacterValues = (VoidDelegate)Delegate.Combine((Delegate?)(object)MainPlugin.s_delegate_ResetStaticCharacterValues, (Delegate?)new VoidDelegate(ResetCurrentTrainingValues)); TransformationHandler.s_onTransformationExpGain_Delegate = (OnTransformationExpGain_DelegateDeclaration)Delegate.Combine((Delegate?)(object)TransformationHandler.s_onTransformationExpGain_Delegate, (Delegate?)new OnTransformationExpGain_DelegateDeclaration(OnTransformationExpGain_Hook)); ItemIcon.SetItemIndex_ItemIndex_int += new hook_SetItemIndex_ItemIndex_int(ItemIcon_SetItemIndex_ItemIndex_int_Hook); return (ItemDef)(object)obj2; } private static void ItemIcon_SetItemIndex_ItemIndex_int_Hook(orig_SetItemIndex_ItemIndex_int orig, ItemIcon self, ItemIndex newItemIndex, int newItemCount) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, newItemIndex, newItemCount); int num = MainPlugin.s_customItemManager.AccessRegisteredItems().FindFirstElementIndex((Predicate<RegisteredItem>)((RegisteredItem x) => x.itemDef.itemIndex == newItemIndex)); if (num != -1) { RegisteredItem val = MainPlugin.s_customItemManager.AccessRegisteredItems().AccessElement(num); if ((Object)(object)self.tooltipProvider != (Object)null && (Object)(object)val.itemDef != (Object)null && val.itemDef.nameToken == CreateNameToken()) { s_inventoryIcons.AddElementUnique(self); } } } public static string CreateName() { return "TrainingWeight"; } public static string CreateNameToken() { return "Training Weight"; } public static string CreateItemComplexDescription() { string text = "Lose " + 30f.ToString("n0") + "% of your total " + MainPlugin.ColorText("Damage, Attack Speed & Movement Speed", "#C7B96A") + " but gain an additional " + 45f.ToString("n0") + "% over time whilst in combat. \nIncreases " + MainPlugin.ColorText("Form Mastery Exp", "#FF5400") + " gain by " + KingUtil.MultToPercent(0.15f).ToString("n0") + "%. \n"; string text2 = null; for (int i = 0; i < s_currentTrainingValues.Count; i++) { if (!s_currentValuesTrained[i]) { text2 = text2 + "[" + i + "] : " + MainPlugin.ColorText(KingUtil.MultToPercent(GetTrainingCompleteRatio(i)).ToString("n0") + "% \n", "#03f4fc"); } } if (!string.IsNullOrWhiteSpace(text2)) { text += "Current: \n"; text += text2; } return text + "Trained: " + MainPlugin.ColorText(GetCompletedTrainedItems().ToString(), "#03f4fc") + "\n" + MainPlugin.ColorText("Only " + 3 + " " + CreateNameToken() + "s can be trained at a time.", "#999999"); } public static void RefreshItemComplexDescription() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) int num = MainPlugin.s_customItemManager.AccessRegisteredItems().FindFirstElementIndex((Predicate<RegisteredItem>)((RegisteredItem x) => x.itemDef.nameToken == CreateNameToken())); if (num == -1) { return; } RegisteredItem val = MainPlugin.s_customItemManager.AccessRegisteredItems().AccessElement(num); if (val == null) { return; } bool flag = false; while (!flag) { int num2 = -1; for (int i = 0; i < s_inventoryIcons.GetCount(); i++) { if ((Object)(object)s_inventoryIcons.AccessElement(i) == (Object)null) { num2 = i; break; } if (Reflection.GetFieldValue<ItemIndex>((object)s_inventoryIcons.AccessElement(i), "itemIndex") != val.itemDef.itemIndex) { num2 = i; break; } } if (num2 != -1) { s_inventoryIcons.RemoveElement(num2); } else { flag = true; } } for (int j = 0; j < s_inventoryIcons.GetCount(); j++) { s_inventoryIcons.AccessElement(j).tooltipProvider.overrideBodyText = CreateItemComplexDescription(); } } public static string CreateItemSimpleDescription() { return "Lose a portion of your total " + MainPlugin.ColorText("Stats", "#C7B96A") + " but gain additional bonus " + MainPlugin.ColorText("Stats", "#C7B96A") + " over time whilst in combat. \nIncreases " + MainPlugin.ColorText("Form Mastery Exp", "#FF5400") + " gain. \n" + MainPlugin.ColorText("Only " + 3 + " " + CreateNameToken() + "s can be trained at a time.", "#999999"); } public static string CreateItemLore() { return "\"Yup! Kami told me to. It was part of my training. It's not much different than Master Roshi's style. You wear a big turtle shell to gain strength. It's pretty much the same principle here.\" - Goku"; } public static int GetCompletedTrainedItems() { int num = 0; foreach (bool item in s_currentValuesTrained) { if (item) { num++; } } return num; } public static bool CanTrain(CharacterBody characterBody) { if (!characterBody.outOfCombat) { return !MainPlugin.IsInStage("bazaar"); } return false; } private static void AddTrainableValues() { s_currentTrainingValues.Add(0f); s_currentValuesTrained.Add(item: false); } private static void RemoveTrainableValues() { s_currentTrainingValues.RemoveAt(s_currentTrainingValues.Count - 1); s_currentValuesTrained.RemoveAt(s_currentValuesTrained.Count - 1); } public static void OnItemUpdate(CharacterBody characterBody, int itemCount) { if (!((Object)(object)characterBody != (Object)null) || ((Object)(object)characterBody.inventory != (Object)null && characterBody.inventory.GetItemCount(Items.InvadingDoppelganger) > 0)) { return; } BonusStatHandler component = ((Component)characterBody).GetComponent<BonusStatHandler>(); if (!((Object)(object)component != (Object)null)) { return; } if (itemCount != s_currentTrainingValues.Count) { CheckTrainingDebuffs(component, itemCount); CheckTrainingBuffs(component, itemCount); int num = itemCount - s_currentTrainingValues.Count; if (num > 0) { for (int i = 0; i < num; i++) { AddTrainableValues(); } } else if (num < 0 && !MainPlugin.IsInStage("moon2")) { for (int j = 0; j < Mathf.Abs(num); j++) { RemoveTrainableValues(); } } return; } if (itemCount > 0 && CanTrain(characterBody)) { int num2 = 0; for (int k = 0; k < itemCount; k++) { if (num2 < 3 && !s_currentValuesTrained[k]) { s_currentTrainingValues[k] += Time.deltaTime; if (MainPlugin.FASTER_TRAINING) { s_currentTrainingValues[k] += Time.deltaTime * 100f; } s_currentTrainingValues[k] = Mathf.Clamp(s_currentTrainingValues[k], 0f, 480f); if (IsTrainingComplete(k)) { s_currentValuesTrained[k] = true; } num2++; } } } CheckTrainingDebuffs(component, itemCount); if (s_updateTrainingBuffTimer < 0f) { CheckTrainingBuffs(component, itemCount); s_updateTrainingBuffTimer = 1f; RefreshItemComplexDescription(); } else { s_updateTrainingBuffTimer -= Time.deltaTime; } } private static string GetBsbName(int idx) { return "TrainingWeightBonus" + idx; } private static string GetBsbNameDebuff(int idx) { return "TrainingWeightBonusDebuff" + idx; } private static void CheckTrainingDebuffs(BonusStatHandler bsh, int itemCount) { for (int i = 0; i < s_currentTrainingValues.Count; i++) { string bsbNameDebuff = GetBsbNameDebuff(i); if (i < itemCount) { if (!bsh.HasBonusStatBundle(bsbNameDebuff)) { ApplyDebuffBonusStats(bsh, bsbNameDebuff); } } else if (bsh.HasBonusStatBundle(bsbNameDebuff)) { bsh.RemoveBonusStatBundle(ref bsbNameDebuff); } } } private static void CheckTrainingBuffs(BonusStatHandler bsh, int itemCount) { for (int i = 0; i < s_currentTrainingValues.Count; i++) { if (i < itemCount) { ApplyBonusStats(bsh, i); } else if (bsh.HasBonusStatBundle(GetBsbName(i))) { string bsbName = GetBsbName(i); bsh.RemoveBonusStatBundle(ref bsbName); } } } private static void ApplyBonusStats(BonusStatHandler bsh, int trainingIndex) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) string bsbName = GetBsbName(trainingIndex); bsh.RemoveBonusStatBundle(ref bsbName); BonusStatBundle val = default(BonusStatBundle); ((BonusStatBundle)(ref val))..ctor(bsbName, (GameObject)null, 0f); float num = Mathf.Lerp(0f, KingUtil.PercentToMult(45f), s_currentTrainingValues[trainingIndex] / 480f); BonusStat val2 = new BonusStat("damage", 0f, num); ((BonusStatBundle)(ref val)).AddBonusStat(ref val2); val2 = new BonusStat("moveSpeed", 0f, num); ((BonusStatBundle)(ref val)).AddBonusStat(ref val2); val2 = new BonusStat("attackSpeed", 0f, num); ((BonusStatBundle)(ref val)).AddBonusStat(ref val2); bsh.AddBonusStatBundle(val); } private static void ApplyDebuffBonusStats(BonusStatHandler bsh, string bsbName) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_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_0069: Unknown result type (might be due to invalid IL or missing references) BonusStatBundle val = default(BonusStatBundle); ((BonusStatBundle)(ref val))..ctor(bsbName, (GameObject)null, 0f); float num = 0f - KingUtil.PercentToMult(30f); BonusStat val2 = new BonusStat("damage", 0f, num); ((BonusStatBundle)(ref val)).AddBonusStat(ref val2); val2 = new BonusStat("moveSpeed", 0f, num); ((BonusStatBundle)(ref val)).AddBonusStat(ref val2); val2 = new BonusStat("attackSpeed", 0f, num); ((BonusStatBundle)(ref val)).AddBonusStat(ref val2); bsh.AddBonusStatBundle(val); } private static void OnTransformationExpGain_Hook(Inventory inventory, ref float expGainMult) { //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_005c: Unknown result type (might be due to invalid IL or missing references) int num = MainPlugin.s_customItemManager.AccessRegisteredItems().FindFirstElementIndex((Predicate<RegisteredItem>)((RegisteredItem x) => x.itemDef.nameToken == CreateNameToken())); RegisteredItem val = MainPlugin.s_customItemManager.AccessRegisteredItems().AccessElement(num); if (val != null) { ItemIndex itemIndex = val.itemDef.itemIndex; if ((Object)(object)inventory != (Object)null) { int itemCount = inventory.GetItemCount(itemIndex); expGainMult += (float)itemCount * 0.15f; } } } } public static class KingItemsAssets { public static AssetBundle LocalAssetBundle; public static Sprite Img_DiosHead; public static Sprite Img_KaioEssence; public static Sprite Img_SenzuBean; public static Sprite Img_TrainingWeight; public static Sprite Tex_DioHead; public static Material COL_KaioEssence; public static Material Mat_DiosHead; public static GameObject KaioEssence_Aura; public static GameObject DiosHead; public static GameObject KaioEssence; public static GameObject SenzuBean; public static GameObject TrainingWeight; public static GameObject ZaWarudoEffect; public static void PopulateAssets() { MainPlugin.DebugLog("KingItemsAssets::PopulateAssets() Started!"); AssetLoader.LoadAssetBundle("KingItems.items_assetbundle", ref LocalAssetBundle); AssetLoader.LoadSoundBank("KingItems.items_soundbank.bnk"); LoadAllAssetsFromAssetBundle(); MainPlugin.DebugLog("KingItemsAssets::PopulateAssets() Complete!"); } private static void LoadAllAssetsFromAssetBundle() { AssetLoader.LoadAsset(ref Img_DiosHead, "Img_DiosHead", LocalAssetBundle); AssetLoader.LoadAsset(ref Img_KaioEssence, "Img_KaioEssence", LocalAssetBundle); AssetLoader.LoadAsset(ref Img_SenzuBean, "Img_SenzuBean", LocalAssetBundle); AssetLoader.LoadAsset(ref Img_TrainingWeight, "Img_TrainingWeight", LocalAssetBundle); AssetLoader.LoadAsset(ref Tex_DioHead, "Tex_DioHead", LocalAssetBundle); AssetLoader.LoadAsset(ref COL_KaioEssence, "COL_KaioEssence", LocalAssetBundle); AssetLoader.LoadAsset(ref Mat_DiosHead, "Mat_DiosHead", LocalAssetBundle); AssetLoader.LoadAsset(ref KaioEssence_Aura, "KaioEssence_Aura", LocalAssetBundle); AssetLoader.LoadAsset(ref DiosHead, "DiosHead", LocalAssetBundle); AssetLoader.LoadAsset(ref KaioEssence, "KaioEssence", LocalAssetBundle); AssetLoader.LoadAsset(ref SenzuBean, "SenzuBean", LocalAssetBundle); AssetLoader.LoadAsset(ref TrainingWeight, "TrainingWeight", LocalAssetBundle); AssetLoader.LoadAsset(ref ZaWarudoEffect, "ZaWarudoEffect", LocalAssetBundle); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Kingpinush.KingItems", "KingItems", "1.4.2")] public class KingItemsMainPlugin : BaseUnityPlugin { public const string MOD_NAME = "KingItems"; public const string MOD_UID = "com.Kingpinush.KingItems"; private void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown KingItemsAssets.PopulateAssets(); MainPlugin.s_customItemManager.RegisterCustomEquipment(SenzuBean.CreateCustomEquipmentDef(), new OnCustomEquipmentUse_DelegateDeclaration(SenzuBean.OnCustomEquipmentActivated)); MainPlugin.s_customItemManager.RegisterCustomItem(TrainingWeight.CreateCustomItemDef(), new OnCustomItemUpdate_DelegateDeclaration(TrainingWeight.OnItemUpdate)); MainPlugin.s_customItemManager.RegisterCustomEquipment(KaioEssence.CreateCustomEquipmentDef(), new OnCustomEquipmentUse_DelegateDeclaration(KaioEssence.OnCustomEquipmentActivated)); MainPlugin.s_customItemManager.RegisterCustomEquipment(DiosHead.CreateCustomEquipmentDef(), new OnCustomEquipmentUse_DelegateDeclaration(DiosHead.OnCustomEquipmentActivated)); } }