using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using MiscFixes.Modules;
using Mono.Cecil.Cil;
using MonoDetour;
using MonoDetour.Cil;
using MonoDetour.DetourTypes;
using MonoDetour.HookGen;
using MonoMod.Cil;
using On.RoR2.HealthComponent;
using On.RoR2.UI;
using R2API;
using RoR2;
using RoR2.UI;
using UnityEngine;
[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("LunarRuinDamageNerf")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+6399c7438ac1be1cd84e842caf692b40bcb58f38")]
[assembly: AssemblyProduct("LunarRuinDamageNerf")]
[assembly: AssemblyTitle("LunarRuinDamageNerf")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.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;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace On.RoR2.HealthComponent
{
internal static class TakeDamageProcess
{
public delegate void PrefixSignature(HealthComponent self, ref DamageInfo damageInfo);
public delegate void PostfixSignature(HealthComponent self, ref DamageInfo damageInfo);
public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null)
{
return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault);
}
public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null)
{
return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault);
}
public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null)
{
return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault);
}
public static MethodBase Target()
{
return typeof(HealthComponent).GetMethod("TakeDamageProcess", (BindingFlags)(-1), null, new Type[1] { typeof(DamageInfo) }, null) ?? throw new MissingMethodException("RoR2.HealthComponent", "TakeDamageProcess");
}
}
internal static class Init
{
public delegate void PrefixSignature();
public delegate void PostfixSignature();
public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null)
{
return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault);
}
public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null)
{
return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault);
}
public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null)
{
return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault);
}
public static MethodBase Target()
{
return typeof(HealthComponent).GetMethod("Init", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("RoR2.HealthComponent", "Init");
}
}
internal static class Awake
{
public delegate void PrefixSignature(HealthComponent self);
public delegate void PostfixSignature(HealthComponent self);
public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null)
{
return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault);
}
public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null)
{
return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault);
}
public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null)
{
return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault);
}
public static MethodBase Target()
{
return typeof(HealthComponent).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("RoR2.HealthComponent", "Awake");
}
}
internal static class SetBarrier
{
}
internal static class get_recentlyTookDamage
{
}
internal static class get_killingDamageType
{
}
internal static class set_killingDamageType
{
}
internal static class get_alive
{
}
internal static class get_fullHealth
{
}
internal static class get_fullShield
{
}
internal static class get_fullBarrier
{
}
internal static class get_combinedHealth
{
}
internal static class get_fullCombinedHealth
{
}
internal static class get_combinedHealthFraction
{
}
internal static class get_missingCombinedHealth
{
}
internal static class get_lastHitTime
{
}
internal static class set_lastHitTime
{
}
internal static class get_lastHealTime
{
}
internal static class set_lastHealTime
{
}
internal static class get_lastHitAttacker
{
}
internal static class set_lastHitAttacker
{
}
internal static class get_timeSinceLastHit
{
}
internal static class get_timeSinceLastHeal
{
}
internal static class get_godMode
{
}
internal static class set_godMode
{
}
internal static class get_potionReserve
{
}
internal static class set_potionReserve
{
}
internal static class get_isInFrozenState
{
}
internal static class set_isInFrozenState
{
}
internal static class get_isHealthLow
{
}
internal static class IsHealthBelowThreshold_System_Single
{
}
internal static class IsHealthBelowThreshold_System_Single_System_Single
{
}
internal static class GetHealthAtThreshold
{
}
internal static class add_onCharacterHealServer
{
}
internal static class remove_onCharacterHealServer
{
}
internal static class OnValidate
{
}
internal static class Heal
{
}
internal static class UsePotion
{
}
internal static class HealFraction
{
}
internal static class SetCurrentHealthLevel
{
}
internal static class GetNormalizedHealth
{
}
internal static class CmdHealFull
{
}
internal static class RechargeShieldFull
{
}
internal static class CmdRechargeShieldFull
{
}
internal static class RechargeShield
{
}
internal static class AddBarrier
{
}
internal static class AddCharge
{
}
internal static class CmdAddBarrier
{
}
internal static class AddBarrierAuthority
{
}
internal static class CmdForceShieldRegen
{
}
internal static class ForceShieldRegen
{
}
internal static class Die
{
}
internal static class TakeDamageForce_RoR2_DamageInfo_System_Boolean_System_Boolean
{
}
internal static class TakeDamageForce_UnityEngine_Vector3_System_Boolean_System_Boolean
{
}
internal static class TakeDamage
{
}
internal static class DoWarp
{
}
internal static class TriggerOneShotProtection
{
}
internal static class Suicide
{
}
internal static class UpdateLastHitTime
{
}
internal static class OnDestroy
{
}
internal static class FixedUpdate
{
}
internal static class ManagedFixedUpdate
{
}
internal static class ServerFixedUpdate
{
}
internal static class SendDamageDealt
{
}
internal static class HandleDamageDealt
{
}
internal static class SendHeal
{
}
internal static class HandleHeal
{
}
internal static class OnInventoryChanged
{
}
internal static class GetHealthBarValues
{
}
internal static class _ctor
{
}
internal static class _cctor
{
}
internal static class _TakeDamageProcess_g__DoJuggle_109_0
{
}
internal static class UNetVersion
{
}
internal static class get_Networkhealth
{
}
internal static class set_Networkhealth
{
}
internal static class get_Networkshield
{
}
internal static class set_Networkshield
{
}
internal static class get_NetworkechoDamage
{
}
internal static class set_NetworkechoDamage
{
}
internal static class get_Networkbarrier
{
}
internal static class set_Networkbarrier
{
}
internal static class get_NetworkmagnetiCharge
{
}
internal static class set_NetworkmagnetiCharge
{
}
internal static class get_Network_killingDamageType
{
}
internal static class set_Network_killingDamageType
{
}
internal static class InvokeCmdCmdHealFull
{
}
internal static class InvokeCmdCmdRechargeShieldFull
{
}
internal static class InvokeCmdCmdAddBarrier
{
}
internal static class InvokeCmdCmdForceShieldRegen
{
}
internal static class CallCmdHealFull
{
}
internal static class CallCmdRechargeShieldFull
{
}
internal static class CallCmdAddBarrier
{
}
internal static class CallCmdForceShieldRegen
{
}
internal static class OnSerialize
{
}
internal static class OnDeserialize
{
}
internal static class PreStartClient
{
}
internal static class AssetReferences
{
internal static class Resolve
{
}
internal static class __c
{
internal static class _cctor
{
}
internal static class _ctor
{
}
internal static class _Resolve_b__18_0
{
}
internal static class _Resolve_b__18_1
{
}
internal static class _Resolve_b__18_2
{
}
internal static class _Resolve_b__18_3
{
}
internal static class _Resolve_b__18_4
{
}
internal static class _Resolve_b__18_5
{
}
internal static class _Resolve_b__18_6
{
}
internal static class _Resolve_b__18_7
{
}
internal static class _Resolve_b__18_8
{
}
internal static class _Resolve_b__18_9
{
}
internal static class _Resolve_b__18_10
{
}
internal static class _Resolve_b__18_11
{
}
internal static class _Resolve_b__18_12
{
}
internal static class _Resolve_b__18_13
{
}
internal static class _Resolve_b__18_14
{
}
internal static class _Resolve_b__18_15
{
}
internal static class _Resolve_b__18_16
{
}
internal static class _Resolve_b__18_17
{
}
}
}
internal static class HealMessage
{
internal static class _ctor
{
}
internal static class Serialize
{
}
internal static class Deserialize
{
}
}
internal static class ItemCounts
{
internal static class _ctor
{
}
internal static class _ctor_RoR2_Inventory
{
}
}
internal static class HealthBarValues
{
internal static class _ctor
{
}
}
internal static class RepeatHealComponent
{
internal static class FixedUpdate
{
}
internal static class AddReserve
{
}
internal static class _ctor
{
}
}
internal static class __c__DisplayClass109_0
{
internal static class _ctor
{
}
}
internal static class __c__DisplayClass109_1
{
internal static class _ctor
{
}
}
}
namespace MonoDetour.HookGen
{
internal static class DefaultMonoDetourManager
{
internal static MonoDetourManager Instance { get; } = New();
internal static MonoDetourManager New()
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Expected O, but got Unknown
return new MonoDetourManager(typeof(DefaultMonoDetourManager).Assembly.GetName().Name);
}
}
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
internal class MonoDetourTargetsAttribute : Attribute, IMonoDetourTargets
{
public Type? TargetType { get; }
public bool IncludeNestedTypes { get; set; }
public bool DistinguishOverloadsByName { get; set; }
public string[]? Members { get; set; }
public string[]? MemberNamePrefixes { get; set; }
public string[]? MemberNameSuffixes { get; set; }
public bool GenerateControlFlowVariants { get; set; }
public MonoDetourTargetsAttribute(Type? targetType = null)
{
TargetType = targetType;
IncludeNestedTypes = true;
base..ctor();
}
}
}
namespace LunarRuinDamageNerf
{
public static class ConfigOptions
{
private const string _configSectionName = "Lunar Ruin Damage Nerf";
public static ConfigEntry<bool> DamageIncreaseForSkillsOnly;
public static ConfigEntry<float> DamageIncreasePerLunarRuin;
public static ConfigEntry<bool> EnableDiminishingDamage;
public static ConfigEntry<float> LunarRuinDamageCap;
public static ConfigEntry<bool> EnableLoggingDamageIncrease;
private static void OnConfigOptionChanged(object sender, EventArgs e)
{
Main.UpdateLunarRuinDescription();
}
internal static void BindConfigOptions(ConfigFile config)
{
DamageIncreaseForSkillsOnly = Extensions.BindOption<bool>(config, "Lunar Ruin Damage Nerf", "Make lunar ruins damage increase only apply to skill damage", "If enabled, will make the damage increase from lunar ruin only apply to skill damage and not proc/item damage.", true, (ConfigFlags)0);
DamageIncreasePerLunarRuin = Extensions.BindOptionSlider<float>(config, "Lunar Ruin Damage Nerf", "Damage increase per lunar ruin stack", "The increase to incoming damage for each stack of lunar ruin. Value is a percentage, so 5 means lunar ruin will increase all incoming damage by 5%. Vanilla's value is 10.", 10f, (ConfigFlags)0);
EnableDiminishingDamage = Extensions.BindOption<bool>(config, "Lunar Ruin Damage Nerf", "Enable diminishing/hyperbolic scaling for lunar ruin`s damage increase.", "If enabled, will make the damage increase for each stack of lunar ruin smaller and smaller as it approaches the cap. Vanilla does not use this.\nOld default: true", false, (ConfigFlags)0);
LunarRuinDamageCap = Extensions.BindOptionSteppedSlider(config, "Lunar Ruin Damage Nerf", "Lunar ruin damage cap", "The maximum damage increase that stacking lunar ruin can reach. Set to -1 to not have a cap, which vanilla doesn't have.\nOld default: 145", -1f, 1f, -1f, 1000f, (ConfigFlags)0);
EnableLoggingDamageIncrease = Extensions.BindOption<bool>(config, "Lunar Ruin Damage Nerf", "Enable logging the new damage increase from lunar ruin.", "If you're re-configuring the mod and want to know how much of a damage increase lunar ruin is giving, enable this option.", false, (ConfigFlags)0);
DamageIncreaseForSkillsOnly.SettingChanged += OnConfigOptionChanged;
DamageIncreasePerLunarRuin.SettingChanged += OnConfigOptionChanged;
EnableDiminishingDamage.SettingChanged += OnConfigOptionChanged;
LunarRuinDamageCap.SettingChanged += OnConfigOptionChanged;
}
}
internal static class Log
{
private static ManualLogSource _logSource;
internal static void Init(ManualLogSource logSource)
{
_logSource = logSource;
}
internal static void Debug(object data)
{
}
internal static void Error(object data)
{
_logSource.LogError(data);
}
internal static void Fatal(object data)
{
_logSource.LogFatal(data);
}
internal static void Info(object data)
{
_logSource.LogInfo(data);
}
internal static void Message(object data)
{
_logSource.LogMessage(data);
}
internal static void Warning(object data)
{
_logSource.LogWarning(data);
}
}
internal static class Main
{
[MonoDetourTargets(typeof(HealthComponent))]
internal static class ILHooks
{
[CompilerGenerated]
private static class <>O
{
public static Manipulator <0>__SetupIL;
public static Func<HealthComponent, DamageInfo, float> <1>__ChangeDamageIncrease;
}
[MonoDetourHookInitialize]
internal static void Setup()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
object obj = <>O.<0>__SetupIL;
if (obj == null)
{
Manipulator val = SetupIL;
<>O.<0>__SetupIL = val;
obj = (object)val;
}
TakeDamageProcess.ILHook((Manipulator)obj);
}
private static void SetupIL(ILManipulationInfo info)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
ILWeaver w = new ILWeaver(info);
ILLabel val = w.DefineLabel();
w.MatchRelaxed(new Predicate<Instruction>[4]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) && w.SetCurrentTo(x),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<HealthComponent>(x, "body"),
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Buffs", "lunarruin"),
(Instruction x) => ILPatternMatchingExt.MatchCallvirt<CharacterBody>(x, "GetBuffCount")
}).ThrowIfFailure().InsertBeforeCurrent((IEnumerable<Instruction>)new <>z__ReadOnlyArray<Instruction>((Instruction[])(object)new Instruction[5]
{
w.Create(OpCodes.Ldarg_0),
w.Create(OpCodes.Ldarg_1),
w.CreateCall((Delegate)new Func<HealthComponent, DamageInfo, float>(ChangeDamageIncrease)),
w.Create(OpCodes.Stloc, 28),
w.Create(OpCodes.Br, (object)val)
}));
w.MatchRelaxed(new Predicate<Instruction>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.1f),
(Instruction x) => ILPatternMatchingExt.MatchMul(x),
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 28) && w.SetCurrentTo(x)
}).ThrowIfFailure().MarkLabelToCurrentNext(val);
}
private static float ChangeDamageIncrease(HealthComponent healthComponent, DamageInfo damageInfo)
{
int buffCount = healthComponent.body.GetBuffCount(Buffs.lunarruin);
float num;
if (ConfigOptions.DamageIncreaseForSkillsOnly.Value && !((DamageTypeCombo)(ref damageInfo.damageType)).IsDamageSourceSkillBased)
{
num = 0f;
}
else
{
float num2 = ConfigOptions.DamageIncreasePerLunarRuin.Value * (float)buffCount;
num = (ConfigOptions.EnableDiminishingDamage.Value ? GetHyperbolic(ConfigOptions.DamageIncreasePerLunarRuin.Value, ConfigOptions.LunarRuinDamageCap.Value, num2) : ((ConfigOptions.LunarRuinDamageCap.Value == -1f) ? num2 : MathF.Min(num2, ConfigOptions.LunarRuinDamageCap.Value)));
}
if (ConfigOptions.EnableLoggingDamageIncrease.Value)
{
Log.Info($"Lunar ruin's damage increase went from +{(float)buffCount * 0.1f * 100f}% to +{num}%");
}
return num *= 0.01f;
}
}
[CompilerGenerated]
private sealed class <DelaySelectFalseSon>d__8 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public SurvivorDef falseSonDef;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <DelaySelectFalseSon>d__8(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
if (!IsCharacterSelectControllerValid)
{
return false;
}
_characterSelectController.characterSelectBarController.PickIconBySurvivorDef(falseSonDef);
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private const int LunarRuinDamageIncreaseILVariableNumber = 28;
private static CharacterSelectController _characterSelectController;
private static bool IsCharacterSelectControllerValid
{
get
{
if ((Object)(object)_characterSelectController == (Object)null)
{
return false;
}
if ((Object)(object)_characterSelectController.characterSelectBarController == (Object)null)
{
return false;
}
return true;
}
}
private static float GetHyperbolic(float firstStack, float cap, float chance)
{
if (firstStack >= cap)
{
return cap * (chance / firstStack);
}
float num = chance / firstStack;
float num2 = 100f * firstStack / (cap - firstStack);
return cap * (1f - 100f / (num * num2 + 100f));
}
internal static void UpdateLunarRuinDescription()
{
Log.Debug("UpdateLunarRuinDescription");
string text = "";
bool flag = false;
if (ConfigOptions.LunarRuinDamageCap.Value != -1f)
{
text = Language.GetStringFormatted("KEYWORD_LUNARRUIN_DAMAGECAPPED", new object[1] { ConfigOptions.LunarRuinDamageCap.Value });
flag = true;
}
if (ConfigOptions.EnableDiminishingDamage.Value)
{
if (ConfigOptions.LunarRuinDamageCap.Value != -1f)
{
text += " ";
}
text += Language.GetString("KEYWORD_LUNARRUIN_HYPERBOLICSTACKING");
flag = true;
}
if (flag)
{
text = " " + text;
}
Log.Debug(text);
string text2 = ((!ConfigOptions.DamageIncreaseForSkillsOnly.Value) ? Language.GetStringFormatted("KEYWORD_LUNARRUIN_NERFED", new object[2]
{
ConfigOptions.DamageIncreasePerLunarRuin.Value,
text
}) : Language.GetStringFormatted("KEYWORD_LUNARRUIN_NERFED_SKILLSONLY", new object[2]
{
ConfigOptions.DamageIncreasePerLunarRuin.Value,
text
}));
Log.Debug(text2);
LanguageAPI.AddOverlay("KEYWORD_LUNARRUIN", text2);
ReselectFalseSonIfSelected();
}
private static void ReselectFalseSonIfSelected()
{
if (IsCharacterSelectControllerValid && !(_characterSelectController.currentSurvivorDef.displayNameToken != "FALSESON_BODY_NAME"))
{
SurvivorDef currentSurvivorDef = _characterSelectController.currentSurvivorDef;
SurvivorDef val = SurvivorCatalog.orderedSurvivorDefs.Where((SurvivorDef survivorDef) => survivorDef.displayNameToken == "COMMANDO_BODY_NAME").ElementAt(0);
_characterSelectController.characterSelectBarController.PickIconBySurvivorDef(val);
((MonoBehaviour)_characterSelectController).StartCoroutine(DelaySelectFalseSon(currentSurvivorDef));
}
}
[IteratorStateMachine(typeof(<DelaySelectFalseSon>d__8))]
private static IEnumerator DelaySelectFalseSon(SurvivorDef falseSonDef)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <DelaySelectFalseSon>d__8(0)
{
falseSonDef = falseSonDef
};
}
internal static void CharacterSelectController_Awake(orig_Awake orig, CharacterSelectController self)
{
orig.Invoke(self);
_characterSelectController = self;
}
internal static void CharacterSelectController_OnDisable(orig_OnDisable orig, CharacterSelectController self)
{
orig.Invoke(self);
_characterSelectController = null;
}
}
[BepInPlugin("LordVGames.LunarRuinDamageNerf", "LunarRuinDamageNerf", "1.1.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
[CompilerGenerated]
private static class <>O
{
public static hook_Awake <0>__CharacterSelectController_Awake;
public static hook_OnDisable <1>__CharacterSelectController_OnDisable;
}
public const string PluginGUID = "LordVGames.LunarRuinDamageNerf";
public const string PluginAuthor = "LordVGames";
public const string PluginName = "LunarRuinDamageNerf";
public const string PluginVersion = "1.1.0";
public void Awake()
{
//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_0041: Expected O, but got Unknown
//IL_0056: 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_0061: Expected O, but got Unknown
Log.Init(((BaseUnityPlugin)this).Logger);
ConfigOptions.BindConfigOptions(((BaseUnityPlugin)this).Config);
Extensions.WipeConfig(((BaseUnityPlugin)this).Config);
Main.ILHooks.Setup();
object obj = <>O.<0>__CharacterSelectController_Awake;
if (obj == null)
{
hook_Awake val = Main.CharacterSelectController_Awake;
<>O.<0>__CharacterSelectController_Awake = val;
obj = (object)val;
}
CharacterSelectController.Awake += (hook_Awake)obj;
object obj2 = <>O.<1>__CharacterSelectController_OnDisable;
if (obj2 == null)
{
hook_OnDisable val2 = Main.CharacterSelectController_OnDisable;
<>O.<1>__CharacterSelectController_OnDisable = val2;
obj2 = (object)val2;
}
CharacterSelectController.OnDisable += (hook_OnDisable)obj2;
RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate
{
Main.UpdateLunarRuinDescription();
});
}
}
}
[CompilerGenerated]
internal sealed class <>z__ReadOnlyArray<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T>
{
int ICollection.Count => _items.Length;
bool ICollection.IsSynchronized => false;
object ICollection.SyncRoot => this;
object IList.this[int index]
{
get
{
return _items[index];
}
set
{
throw new NotSupportedException();
}
}
bool IList.IsFixedSize => true;
bool IList.IsReadOnly => true;
int IReadOnlyCollection<T>.Count => _items.Length;
T IReadOnlyList<T>.this[int index] => _items[index];
int ICollection<T>.Count => _items.Length;
bool ICollection<T>.IsReadOnly => true;
T IList<T>.this[int index]
{
get
{
return _items[index];
}
set
{
throw new NotSupportedException();
}
}
public <>z__ReadOnlyArray(T[] items)
{
_items = items;
}
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable)_items).GetEnumerator();
}
void ICollection.CopyTo(Array array, int index)
{
((ICollection)_items).CopyTo(array, index);
}
int IList.Add(object value)
{
throw new NotSupportedException();
}
void IList.Clear()
{
throw new NotSupportedException();
}
bool IList.Contains(object value)
{
return ((IList)_items).Contains(value);
}
int IList.IndexOf(object value)
{
return ((IList)_items).IndexOf(value);
}
void IList.Insert(int index, object value)
{
throw new NotSupportedException();
}
void IList.Remove(object value)
{
throw new NotSupportedException();
}
void IList.RemoveAt(int index)
{
throw new NotSupportedException();
}
IEnumerator<T> IEnumerable<T>.GetEnumerator()
{
return ((IEnumerable<T>)_items).GetEnumerator();
}
void ICollection<T>.Add(T item)
{
throw new NotSupportedException();
}
void ICollection<T>.Clear()
{
throw new NotSupportedException();
}
bool ICollection<T>.Contains(T item)
{
return ((ICollection<T>)_items).Contains(item);
}
void ICollection<T>.CopyTo(T[] array, int arrayIndex)
{
((ICollection<T>)_items).CopyTo(array, arrayIndex);
}
bool ICollection<T>.Remove(T item)
{
throw new NotSupportedException();
}
int IList<T>.IndexOf(T item)
{
return ((IList<T>)_items).IndexOf(item);
}
void IList<T>.Insert(int index, T item)
{
throw new NotSupportedException();
}
void IList<T>.RemoveAt(int index)
{
throw new NotSupportedException();
}
}