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 System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Croco;
using HIFUAcridTweaks.Keywords;
using HIFUAcridTweaks.Misc;
using HIFUAcridTweaks.Skills;
using HarmonyLib;
using IL.EntityStates.Croco;
using IL.RoR2;
using IL.RoR2.Achievements;
using IL.RoR2.Orbs;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.Croco;
using On.RoR2;
using R2API;
using RoR2;
using RoR2.Achievements;
using RoR2.Achievements.Croco;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.Stats;
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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("HIFUAcridTweaks")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("HIFUAcridTweaks")]
[assembly: AssemblyTitle("HIFUAcridTweaks")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace HIFUAcridTweaks
{
public class ConfigManager
{
internal static bool ConfigChanged;
internal static bool VersionChanged;
public static T HandleConfig<T>(ConfigEntryBase entry, ConfigFile config, string name)
{
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Expected O, but got Unknown
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Expected O, but got Unknown
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Expected O, but got Unknown
MethodInfo methodInfo = (from x in typeof(ConfigFile).GetMethods()
where x.Name == "Bind"
select x).First();
methodInfo = methodInfo.MakeGenericMethod(typeof(T));
object[] parameters = new object[3]
{
(object)new ConfigDefinition(Regex.Replace(config.ConfigFilePath, "\\W", "") + " : " + entry.Definition.Section, name),
entry.DefaultValue,
(object)new ConfigDescription(entry.Description.Description, (AcceptableValueBase)null, Array.Empty<object>())
};
ConfigEntryBase val = (ConfigEntryBase)methodInfo.Invoke(config, parameters);
if (Main._preVersioning)
{
entry.BoxedValue = entry.DefaultValue;
}
if (!ConfigEqual(val.DefaultValue, val.BoxedValue) && VersionChanged)
{
entry.BoxedValue = entry.DefaultValue;
val.BoxedValue = val.DefaultValue;
}
return default(T);
}
private static bool ConfigEqual(object a, object b)
{
if (a.Equals(b))
{
return true;
}
if (float.TryParse(a.ToString(), out var result) && float.TryParse(b.ToString(), out var result2) && (double)Mathf.Abs(result - result2) < 0.0001)
{
return true;
}
return false;
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("HIFU.HIFUAcridTweaks", "HIFUAcridTweaks", "1.2.2")]
public class Main : BaseUnityPlugin
{
public const string PluginGUID = "HIFU.HIFUAcridTweaks";
public const string PluginAuthor = "HIFU";
public const string PluginName = "HIFUAcridTweaks";
public const string PluginVersion = "1.2.2";
public static ConfigFile HACTConfig;
public static ConfigFile HACTBackupConfig;
public static ManualLogSource HACTLogger;
public static ModdedDamageType poison = DamageAPI.ReserveDamageType();
public static ModdedDamageType blight = DamageAPI.ReserveDamageType();
public static bool _preVersioning = false;
public static AssetBundle iHateThis;
public static ConfigEntry<bool> enableAutoConfig { get; set; }
public static ConfigEntry<string> latestVersion { get; set; }
public void Awake()
{
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected O, but got Unknown
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
//IL_01db: Unknown result type (might be due to invalid IL or missing references)
//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
//IL_0215: Unknown result type (might be due to invalid IL or missing references)
//IL_021a: Unknown result type (might be due to invalid IL or missing references)
//IL_022b: Unknown result type (might be due to invalid IL or missing references)
//IL_0230: Unknown result type (might be due to invalid IL or missing references)
HACTLogger = ((BaseUnityPlugin)this).Logger;
HACTConfig = ((BaseUnityPlugin)this).Config;
iHateThis = AssetBundle.LoadFromFile(Assembly.GetExecutingAssembly().Location.Replace("HIFUAcridTweaks.dll", "hifuacridtweaks"));
HACTBackupConfig = new ConfigFile(Paths.ConfigPath + "\\HIFU.HIFUAcridTweaks.Backup.cfg", true);
HACTBackupConfig.Bind<string>(": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :");
enableAutoConfig = HACTConfig.Bind<bool>("Config", "Enable Auto Config Sync", true, "Disabling this would stop HIFUAcridTweaks from syncing config whenever a new version is found.");
_preVersioning = !((Dictionary<ConfigDefinition, string>)AccessTools.DeclaredPropertyGetter(typeof(ConfigFile), "OrphanedEntries").Invoke(HACTConfig, null)).Keys.Any((ConfigDefinition x) => x.Key == "Latest Version");
latestVersion = HACTConfig.Bind<string>("Config", "Latest Version", "1.2.2", "DO NOT CHANGE THIS");
if (enableAutoConfig.Value && (_preVersioning || latestVersion.Value != "1.2.2"))
{
latestVersion.Value = "1.2.2";
ConfigManager.VersionChanged = true;
HACTLogger.LogInfo((object)"Config Autosync Enabled.");
}
GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Croco/CrocoBody.prefab").WaitForCompletion();
EntityStateMachine val2 = val.AddComponent<EntityStateMachine>();
val2.customName = "Leap";
val2.initialStateType = new SerializableEntityStateType(typeof(Idle));
val2.mainStateType = new SerializableEntityStateType(typeof(Idle));
SkillDef val3 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Croco/CrocoLeap.asset").WaitForCompletion();
val3.activationStateMachineName = "Leap";
SkillDef val4 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Croco/CrocoChainableLeap.asset").WaitForCompletion();
val4.activationStateMachineName = "Leap";
EntityStateMachine val5 = val.AddComponent<EntityStateMachine>();
val5.customName = "Neurotoxin";
val5.initialStateType = new SerializableEntityStateType(typeof(Idle));
val5.mainStateType = new SerializableEntityStateType(typeof(Idle));
NetworkStateMachine component = val.GetComponent<NetworkStateMachine>();
Array.Resize(ref component.stateMachines, component.stateMachines.Length + 2);
component.stateMachines[component.stateMachines.Length - 2] = val2;
component.stateMachines[component.stateMachines.Length - 1] = val5;
IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
where !type.IsAbstract && type.IsSubclassOf(typeof(TweakBase))
select type;
HACTLogger.LogInfo((object)"==+----------------==TWEAKS==----------------+==");
foreach (Type item in enumerable)
{
TweakBase tweakBase = (TweakBase)Activator.CreateInstance(item);
if (ValidateTweak(tweakBase))
{
tweakBase.Init();
}
}
IEnumerable<Type> enumerable2 = from type in Assembly.GetExecutingAssembly().GetTypes()
where !type.IsAbstract && type.IsSubclassOf(typeof(MiscBase))
select type;
HACTLogger.LogInfo((object)"==+----------------==MISC==----------------+==");
foreach (Type item2 in enumerable2)
{
MiscBase miscBase = (MiscBase)Activator.CreateInstance(item2);
if (ValidateMisc(miscBase))
{
miscBase.Init();
}
}
HIFUAcridTweaks.Keywords.Keywords.Init();
}
public bool ValidateTweak(TweakBase tb)
{
if (!tb.DoesNotKillTheMod)
{
return true;
}
if (tb.isEnabled && ((BaseUnityPlugin)this).Config.Bind<bool>(tb.Name, "Enable?", true, "Vanilla is false").Value)
{
return true;
}
return false;
}
public bool ValidateMisc(MiscBase mb)
{
if (!mb.DoesNotKillTheMod)
{
return true;
}
if (mb.isEnabled && ((BaseUnityPlugin)this).Config.Bind<bool>(mb.Name, "Enable?", true, "Vanilla is false").Value)
{
return true;
}
return false;
}
private void WITHINDESTRUCTIONMYFUCKINGBELOVED()
{
}
}
public abstract class MiscBase
{
public abstract string Name { get; }
public virtual bool isEnabled { get; } = true;
public abstract bool DoesNotKillTheMod { get; }
public T ConfigOption<T>(T value, string name, string description)
{
ConfigEntry<T> val = Main.HACTConfig.Bind<T>(Name, name, value, description);
ConfigManager.HandleConfig<T>((ConfigEntryBase)(object)val, Main.HACTBackupConfig, name);
return val.Value;
}
public abstract void Hooks();
public string d(float f)
{
return f * 100f + "%";
}
public virtual void Init()
{
Hooks();
Main.HACTLogger.LogInfo((object)("Added " + Name));
}
}
public abstract class MiscBase<T> : MiscBase where T : MiscBase<T>
{
public static T instance { get; set; }
public MiscBase()
{
if (instance != null)
{
throw new InvalidOperationException("Singleton class " + typeof(T).Name + " was instantiated twice");
}
instance = this as T;
}
}
public abstract class TweakBase
{
public abstract string Name { get; }
public abstract string SkillToken { get; }
public abstract string DescText { get; }
public virtual bool isEnabled { get; } = true;
public abstract bool DoesNotKillTheMod { get; }
public T ConfigOption<T>(T value, string name, string description)
{
ConfigEntry<T> val = Main.HACTConfig.Bind<T>(Name, name, value, description);
ConfigManager.HandleConfig<T>((ConfigEntryBase)(object)val, Main.HACTBackupConfig, name);
return val.Value;
}
public abstract void Hooks();
public string d(float f)
{
return f * 100f + "%";
}
public virtual void Init()
{
Hooks();
string text = "CROCO_" + SkillToken.ToUpper() + "_DESCRIPTION";
LanguageAPI.Add(text, DescText);
Main.HACTLogger.LogInfo((object)("Added " + Name));
}
}
public abstract class TweakBase<T> : TweakBase where T : TweakBase<T>
{
public static T instance { get; set; }
public TweakBase()
{
if (instance != null)
{
throw new InvalidOperationException("Singleton class " + typeof(T).Name + " was instantiated twice");
}
instance = this as T;
}
}
}
namespace HIFUAcridTweaks.Skills
{
public class Blight : TweakBase
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static CustomDotBehaviour <>9__13_0;
public static Func<Instruction, bool> <>9__16_1;
public static Func<int, int> <>9__16_0;
internal void <Init>b__13_0(DotController self, DotStack dotStack)
{
GameObject attackerObject = dotStack.attackerObject;
CharacterBody val = ((attackerObject != null) ? attackerObject.GetComponent<CharacterBody>() : null);
dotStack.damage = val.damage * damagePerSecond * 0.2f;
}
internal bool <GlobalEventManager_OnHitEnemy>b__16_1(Instruction x)
{
return ILPatternMatchingExt.MatchLdcI4(x, 1048576);
}
internal int <GlobalEventManager_OnHitEnemy>b__16_0(int useless)
{
return 0;
}
}
public static float duration;
public static float damagePerSecond;
public static BuffDef blight;
public static DotDef blightDef;
public static DotIndex blightIndex;
public override bool DoesNotKillTheMod => false;
public override string Name => "Passive : Blight";
public override string SkillToken => "passive_alt";
public override string DescText => "<style=cArtifact>Blighted</style> attacks apply a stacking damage-over-time.";
public override void Init()
{
//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_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: 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_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Expected O, but got Unknown
//IL_0123: 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_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Expected O, but got Unknown
blight = ScriptableObject.CreateInstance<BuffDef>();
blight.isDebuff = true;
blight.isCooldown = false;
blight.canStack = true;
blight.isHidden = false;
blight.iconSprite = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/Croco/bdBlight.asset").WaitForCompletion().iconSprite;
blight.buffColor = Color32.op_Implicit(new Color32((byte)177, (byte)56, (byte)127, byte.MaxValue));
((Object)blight).name = "Blight";
ContentAddition.AddBuffDef(blight);
duration = ConfigOption(3f, "Duration", "Vanilla is 5");
damagePerSecond = ConfigOption(1.1f, "Base Damage Per Second", "Decimal. Vanilla is 0.6");
blightDef = new DotDef
{
associatedBuff = blight,
damageCoefficient = 1f,
damageColorIndex = (DamageColorIndex)9,
interval = 0.2f
};
object obj = <>c.<>9__13_0;
if (obj == null)
{
CustomDotBehaviour val = delegate(DotController self, DotStack dotStack)
{
GameObject attackerObject = dotStack.attackerObject;
CharacterBody val3 = ((attackerObject != null) ? attackerObject.GetComponent<CharacterBody>() : null);
dotStack.damage = val3.damage * damagePerSecond * 0.2f;
};
<>c.<>9__13_0 = val;
obj = (object)val;
}
CustomDotBehaviour val2 = (CustomDotBehaviour)obj;
blightIndex = DotAPI.RegisterDotDef(blightDef, val2, (CustomDotVisual)null);
base.Init();
}
public override void Hooks()
{
GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
}
private void GlobalEventManager_onServerDamageDealt(DamageReport report)
{
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_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_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
DamageInfo damageInfo = report.damageInfo;
GameObject attacker = report.attacker;
if (Object.op_Implicit((Object)(object)attacker))
{
HealthComponent victim = report.victim;
if (Object.op_Implicit((Object)(object)victim) && DamageAPI.HasModdedDamageType(damageInfo, Main.blight))
{
InflictDotInfo val = default(InflictDotInfo);
val.victimObject = ((Component)victim).gameObject;
val.attackerObject = attacker;
val.totalDamage = null;
val.dotIndex = blightIndex;
val.duration = duration;
val.damageMultiplier = 1f;
val.maxStacksFromAttacker = uint.MaxValue;
InflictDotInfo val2 = val;
DotController.InflictDot(ref val2);
}
}
}
private void GlobalEventManager_OnHitEnemy(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
ILCursor val = new ILCursor(il);
if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1048576)
}))
{
int index = val.Index;
val.Index = index + 1;
val.EmitDelegate<Func<int, int>>((Func<int, int>)((int useless) => 0));
}
else
{
Main.HACTLogger.LogError((object)"Failed to apply Blight Deletion hook");
}
}
}
internal class CausticLeap : TweakBase
{
public static float damage;
public static float poolDamage;
public static float cooldown;
public override bool DoesNotKillTheMod => true;
public override string Name => "Utility : Caustic Leap";
public override string SkillToken => "utility";
public override string DescText => "<style=cArtifact>Blighted</style>. <style=cIsDamage>Stunning</style>. Leap in the air, dealing <style=cIsDamage>" + d(damage) + " damage</style>. Leave acid that deals <style=cIsDamage>" + d(poolDamage) + " damage</style>.";
public override void Init()
{
damage = ConfigOption(2.6f, "Damage", "Decimal. Vanilla is 3.2");
poolDamage = ConfigOption(2f, "Pool Damage", "Decimal. Vanilla is 1");
cooldown = ConfigOption(6f, "Cooldown", "Vanilla is 6");
base.Init();
}
public override void Hooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
BaseLeap.OnEnter += new hook_OnEnter(BaseLeap_OnEnter);
BaseLeap.DropAcidPoolAuthority += new Manipulator(BaseLeap_DropAcidPoolAuthority);
Changes();
}
private void BaseLeap_DropAcidPoolAuthority(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_003d: 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)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdfld<BaseState>(x, "damageStat")
}))
{
val.Emit(OpCodes.Ldc_R4, poolDamage);
val.Emit(OpCodes.Mul);
}
else
{
Main.HACTLogger.LogError((object)"Failed to apply Caustic Leap Pool Damage hook");
}
}
private void BaseLeap_OnEnter(orig_OnEnter orig, BaseLeap self)
{
//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)
if (!(self is ChainableLeap))
{
self.blastDamageCoefficient = damage;
self.blastForce = 0f;
self.blastBonusForce = Vector3.zero;
}
orig.Invoke(self);
}
private void Changes()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
SkillDef val = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Croco/CrocoLeap.asset").WaitForCompletion();
val.baseRechargeInterval = cooldown;
val.keywordTokens = new string[2] { "HAT_BLIGHT", "KEYWORD_STUNNING" };
}
}
internal class Epidemic : TweakBase
{
public static float damage;
public static float cooldown;
public static int maxTargets;
public static float maxDistance;
public static float shareDuration;
public static ModdedDamageType shared = DamageAPI.ReserveDamageType();
public static BuffDef shareDamage;
public static float sharedPercent;
public static ProcType sharedMask = (ProcType)12561269;
public override bool DoesNotKillTheMod => true;
public override string Name => "Special : Epidemic";
public override string SkillToken => "special";
public override string DescText => "<style=cArtifact>Blighted</style>. Release a deadly disease that deals <style=cIsDamage>" + d(damage) + " damage</style> and spreads up to <style=cIsDamage>" + maxTargets + "</style> times. All enemies hit <style=cIsDamage>share " + d(sharedPercent) + " TOTAL damage taken</style> for <style=cIsDamage>" + shareDuration + "s</style>.";
public override void Init()
{
shareDamage = ScriptableObject.CreateInstance<BuffDef>();
shareDamage.isDebuff = true;
shareDamage.canStack = false;
shareDamage.isCooldown = false;
shareDamage.isHidden = true;
((Object)shareDamage).name = "Epidemic Shared Damage";
ContentAddition.AddBuffDef(shareDamage);
damage = ConfigOption(2.4f, "Damage", "Decimal. Vanilla is 1");
cooldown = ConfigOption(10f, "Cooldown", "Vanilla is 10");
maxTargets = ConfigOption(4, "Max Targets", "Vanilla is 1048577");
maxDistance = ConfigOption(35f, "Max Range", "Vanilla is 30");
shareDuration = ConfigOption(5f, "Damage Sharing Duration", "");
sharedPercent = ConfigOption(0.25f, "Damage Sharing Percent", "Decimal.");
base.Init();
}
public override void Hooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
LightningOrb.Begin += new Manipulator(LightningOrb_Begin);
FireSpit.OnEnter += new hook_OnEnter(FireSpit_OnEnter);
HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
Changes();
}
private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo info)
{
//IL_003a: 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_006c: 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_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: 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_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Expected O, but got Unknown
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: 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)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_018d: Unknown result type (might be due to invalid IL or missing references)
//IL_0192: Unknown result type (might be due to invalid IL or missing references)
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
//IL_01eb: 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_01ee: Unknown result type (might be due to invalid IL or missing references)
//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0205: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_020c: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_021c: Unknown result type (might be due to invalid IL or missing references)
//IL_0227: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: Expected O, but got Unknown
//IL_023d: Unknown result type (might be due to invalid IL or missing references)
//IL_0245: Unknown result type (might be due to invalid IL or missing references)
//IL_0252: Unknown result type (might be due to invalid IL or missing references)
//IL_0254: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self, info);
if (!NetworkServer.active || !Object.op_Implicit((Object)(object)info.attacker) || !Object.op_Implicit((Object)(object)info.attacker.GetComponent<TeamComponent>()) || (DamageAPI.HasModdedDamageType(info, Main.poison) && DamageAPI.HasModdedDamageType(info, Main.blight)) || !(info.procCoefficient > 0f))
{
return;
}
if (DamageAPI.HasModdedDamageType(info, shared))
{
self.body.AddTimedBuffAuthority(shareDamage.buffIndex, shareDuration);
}
if (!self.body.HasBuff(shareDamage) || ((ProcChainMask)(ref info.procChainMask)).HasProc(sharedMask))
{
return;
}
SphereSearch val = new SphereSearch
{
origin = info.position,
radius = maxDistance * 3f,
mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask,
queryTriggerInteraction = (QueryTriggerInteraction)1
};
TeamIndex teamIndex = info.attacker.GetComponent<TeamComponent>().teamIndex;
val.RefreshCandidates();
val.FilterCandidatesByDistinctHurtBoxEntities();
HurtBox[] hurtBoxes = val.GetHurtBoxes();
HurtBox[] array = hurtBoxes;
foreach (HurtBox val2 in array)
{
if (val2.teamIndex != teamIndex && Object.op_Implicit((Object)(object)val2.healthComponent) && (Object)(object)val2.healthComponent != (Object)(object)self && val2.healthComponent.body.HasBuff(shareDamage))
{
LightningOrb val3 = new LightningOrb
{
lightningType = (LightningType)2,
canBounceOnSameTarget = false,
bouncesRemaining = 1,
damageColorIndex = (DamageColorIndex)8,
damageValue = info.damage * sharedPercent,
damageCoefficientPerBounce = 1f,
attacker = info.attacker,
isCrit = info.crit,
target = val2,
teamIndex = teamIndex,
targetsToFindPerBounce = 1,
speed = 20f,
origin = info.position,
procCoefficient = 0f,
bouncedObjects = new List<HealthComponent>(),
duration = maxDistance * 3f
};
ProcChainMask procChainMask = default(ProcChainMask);
((ProcChainMask)(ref procChainMask)).AddProc(sharedMask);
val3.procChainMask = procChainMask;
OrbManager.instance.AddOrb((Orb)(object)val3);
}
}
}
private void FireSpit_OnEnter(orig_OnEnter orig, FireSpit self)
{
self.baseDuration = 0.3f;
if (self is FireDiseaseProjectile)
{
self.damageCoefficient = damage;
}
orig.Invoke(self);
}
private void LightningOrb_Begin(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
ILCursor val = new ILCursor(il);
int num = default(int);
if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[4]
{
(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.6f),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Orb>(x, "set_duration"),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num),
(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 2)
}))
{
val.Next.Operand = 0.25f;
val.Index += 4;
val.EmitDelegate<Func<int, int>>((Func<int, int>)((int useless) => 1));
}
else
{
Main.HACTLogger.LogError((object)"Failed to apply Epidemic Un-J hook");
}
}
private void Changes()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0050: 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)
SkillDef val = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Croco/CrocoDisease.asset").WaitForCompletion();
val.baseRechargeInterval = cooldown;
val.keywordTokens = new string[1] { "HAT_BLIGHT" };
GameObject val2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Croco/CrocoDiseaseProjectile.prefab").WaitForCompletion();
ModdedDamageTypeHolderComponent val3 = val2.AddComponent<ModdedDamageTypeHolderComponent>();
val3.Add(Main.blight);
val3.Add(shared);
ProjectileSimple component = val2.GetComponent<ProjectileSimple>();
component.lifetime = 10f;
component.desiredForwardSpeed = 100f;
ProjectileProximityBeamController component2 = val2.GetComponent<ProjectileProximityBeamController>();
component2.attackRange = maxDistance;
component2.bounces = maxTargets;
Rigidbody component3 = val2.GetComponent<Rigidbody>();
component3.useGravity = true;
component3.collisionDetectionMode = (CollisionDetectionMode)1;
component3.freezeRotation = true;
AntiGravityForce val4 = val2.AddComponent<AntiGravityForce>();
val4.rb = val2.GetComponent<Rigidbody>();
val4.antiGravityCoefficient = 0.25f;
}
}
internal class FrenziedLeap : TweakBase
{
public static float damage;
public static float cdr;
public static float cooldown;
public static float radius;
public override bool DoesNotKillTheMod => true;
public override string Name => "Utility :: Frenzied Leap";
public override string SkillToken => "utility_alt1";
public override string DescText => "<style=cIsHealing>Regenerative</style>. <style=cIsDamage>Stunning</style>. Leap in the air, dealing <style=cIsDamage>" + d(damage) + " damage</style> in a small area.";
public override void Init()
{
damage = ConfigOption(6.5f, "Damage", "Decimal. Vanilla is 5.5");
cooldown = ConfigOption(6f, "Cooldown", "Vanilla is 10");
radius = ConfigOption(6.5f, "Area of Effect", "Vanilla is 10");
base.Init();
}
public override void Hooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Expected O, but got Unknown
BaseLeap.OnEnter += new hook_OnEnter(BaseLeap_OnEnter);
BaseLeap.OnExit += new hook_OnExit(BaseLeap_OnExit);
BaseLeap.DetonateAuthority += new hook_DetonateAuthority(BaseLeap_DetonateAuthority);
ChainableLeap.DoImpactAuthority += new hook_DoImpactAuthority(ChainableLeap_DoImpactAuthority);
Changes();
}
private Result BaseLeap_DetonateAuthority(orig_DetonateAuthority orig, BaseLeap self)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Expected O, but got Unknown
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: 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_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: 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_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: 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_009f: 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_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)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Expected O, but got Unknown
//IL_012f: 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_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
Vector3 footPosition = ((EntityState)self).characterBody.footPosition;
EffectManager.SpawnEffect(self.blastEffectPrefab, new EffectData
{
origin = footPosition,
scale = radius
}, true);
BlastAttack val = new BlastAttack
{
attacker = ((EntityState)self).gameObject,
baseDamage = ((BaseState)self).damageStat * self.blastDamageCoefficient,
baseForce = 0f,
bonusForce = Vector3.zero,
crit = self.isCritAuthority,
falloffModel = (FalloffModel)0,
procCoefficient = BaseLeap.blastProcCoefficient,
radius = radius,
damageType = (DamageType)32,
position = footPosition,
attackerFiltering = (AttackerFiltering)2,
impactEffect = EffectCatalog.FindEffectIndexFromPrefab(self.blastImpactEffectPrefab),
teamIndex = ((EntityState)self).teamComponent.teamIndex
};
if (self is ChainableLeap)
{
PassiveController component = ((EntityState)self).GetComponent<PassiveController>();
if ((Object)(object)component != (Object)null)
{
string currentPassive = component.currentPassive;
string text = currentPassive;
if (text == "HAT_FRENZY_NAME")
{
DamageAPI.AddModdedDamageType(val, Passives.frenzy);
}
else
{
DamageAPI.AddModdedDamageType(val, Passives.regen);
}
}
}
else
{
DamageAPI.AddModdedDamageType(val, Main.blight);
}
return val.Fire();
}
private void BaseLeap_OnExit(orig_OnExit orig, BaseLeap self)
{
orig.Invoke(self);
((EntityState)self).characterBody.isSprinting = true;
}
private void ChainableLeap_DoImpactAuthority(orig_DoImpactAuthority orig, ChainableLeap self)
{
ChainableLeap.refundPerHit = 0f;
orig.Invoke(self);
}
private void BaseLeap_OnEnter(orig_OnEnter orig, BaseLeap self)
{
if (self is ChainableLeap)
{
self.blastDamageCoefficient = damage;
}
orig.Invoke(self);
}
private void Changes()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
SkillDef val = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Croco/CrocoChainableLeap.asset").WaitForCompletion();
val.baseRechargeInterval = cooldown;
val.keywordTokens = new string[2] { "KEYWORD_RAPID_REGEN", "KEYWORD_STUNNING" };
}
}
internal class Neurotoxin : TweakBase
{
public static float damage;
public static float cooldown;
public static float aoe;
public override bool DoesNotKillTheMod => true;
public override string Name => "Secondary : Neurotoxin";
public override string SkillToken => "secondary";
public override string DescText => "<style=cIsUtility>Agile</style>. <style=cArtifact>Blighted</style>. Spit toxic bile for <style=cIsDamage>" + d(damage) + " damage</style>.";
public override void Init()
{
damage = ConfigOption(2.6f, "Damage", "Decimal. Vanilla is 2.4");
cooldown = ConfigOption(3f, "Cooldown", "Vanilla is 2");
aoe = ConfigOption(8f, "Area of Effect", "Vanilla is 3");
base.Init();
}
public override void Hooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
FireSpit.OnEnter += new hook_OnEnter(FireSpit_OnEnter1);
FireSpit.OnEnter += new Manipulator(FireSpit_OnEnter);
Changes();
}
private void FireSpit_OnEnter1(orig_OnEnter orig, FireSpit self)
{
self.baseDuration = 0.3f;
if (!(self is FireDiseaseProjectile))
{
self.damageCoefficient = damage;
}
orig.Invoke(self);
}
private void FireSpit_OnEnter(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
ILCursor val = new ILCursor(il);
int num = default(int);
if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchStfld(x, "RoR2.Projectile.FireProjectileInfo", "damage"),
(Instruction x) => ILPatternMatchingExt.MatchLdloca(x, ref num)
}))
{
val.Index += 3;
val.EmitDelegate<Func<int, int>>((Func<int, int>)((int useless) => 0));
}
else
{
Main.HACTLogger.LogError((object)"Failed to apply Spit Damage Type hook");
}
}
private void Changes()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_0189: Unknown result type (might be due to invalid IL or missing references)
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Expected O, but got Unknown
//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_01db: Unknown result type (might be due to invalid IL or missing references)
//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
//IL_020d: Unknown result type (might be due to invalid IL or missing references)
//IL_0212: Unknown result type (might be due to invalid IL or missing references)
//IL_0223: Unknown result type (might be due to invalid IL or missing references)
//IL_0228: Unknown result type (might be due to invalid IL or missing references)
//IL_0245: Unknown result type (might be due to invalid IL or missing references)
//IL_024a: Unknown result type (might be due to invalid IL or missing references)
//IL_0250: Unknown result type (might be due to invalid IL or missing references)
//IL_026d: Unknown result type (might be due to invalid IL or missing references)
//IL_0272: Unknown result type (might be due to invalid IL or missing references)
//IL_028d: Unknown result type (might be due to invalid IL or missing references)
//IL_0292: Unknown result type (might be due to invalid IL or missing references)
//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
//IL_02be: Unknown result type (might be due to invalid IL or missing references)
//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
//IL_02cd: Expected O, but got Unknown
//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
//IL_030e: Unknown result type (might be due to invalid IL or missing references)
//IL_0313: Unknown result type (might be due to invalid IL or missing references)
//IL_031c: Unknown result type (might be due to invalid IL or missing references)
//IL_0333: Unknown result type (might be due to invalid IL or missing references)
//IL_0338: Unknown result type (might be due to invalid IL or missing references)
//IL_0353: Unknown result type (might be due to invalid IL or missing references)
//IL_0358: Unknown result type (might be due to invalid IL or missing references)
//IL_0369: Unknown result type (might be due to invalid IL or missing references)
//IL_036e: Unknown result type (might be due to invalid IL or missing references)
//IL_037f: Unknown result type (might be due to invalid IL or missing references)
//IL_0384: Unknown result type (might be due to invalid IL or missing references)
//IL_0389: Unknown result type (might be due to invalid IL or missing references)
//IL_0393: Expected O, but got Unknown
//IL_038e: Unknown result type (might be due to invalid IL or missing references)
//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
//IL_03b3: Expected O, but got Unknown
//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
//IL_03f8: Unknown result type (might be due to invalid IL or missing references)
//IL_040f: Unknown result type (might be due to invalid IL or missing references)
//IL_0414: Unknown result type (might be due to invalid IL or missing references)
//IL_0425: Unknown result type (might be due to invalid IL or missing references)
//IL_042a: Unknown result type (might be due to invalid IL or missing references)
//IL_043b: Unknown result type (might be due to invalid IL or missing references)
//IL_0440: Unknown result type (might be due to invalid IL or missing references)
//IL_044f: Unknown result type (might be due to invalid IL or missing references)
//IL_0465: Unknown result type (might be due to invalid IL or missing references)
SkillDef val = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Croco/CrocoSpit.asset").WaitForCompletion();
val.baseRechargeInterval = cooldown;
val.keywordTokens = new string[1] { "HAT_BLIGHT" };
GameObject val2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Croco/CrocoSpit.prefab").WaitForCompletion();
ModdedDamageTypeHolderComponent val3 = val2.AddComponent<ModdedDamageTypeHolderComponent>();
val3.Add(Main.blight);
val2.transform.localScale = new Vector3(0.1f, 0.1f, 1f);
GameObject val4 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Croco/CrocoSpitGhost.prefab").WaitForCompletion();
val4.transform.localScale = new Vector3(2f, 2f, 2f);
ProjectileSimple component = val2.GetComponent<ProjectileSimple>();
component.desiredForwardSpeed = 100f;
component.lifetime = 10f;
Rigidbody component2 = val2.GetComponent<Rigidbody>();
component2.useGravity = true;
component2.collisionDetectionMode = (CollisionDetectionMode)1;
component2.freezeRotation = true;
AntiGravityForce val5 = val2.AddComponent<AntiGravityForce>();
val5.rb = val2.GetComponent<Rigidbody>();
val5.antiGravityCoefficient = 0.25f;
ProjectileImpactExplosion component3 = val2.GetComponent<ProjectileImpactExplosion>();
((ProjectileExplosion)component3).blastRadius = aoe;
component3.lifetime = 10f;
GameObject val6 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Croco/CrocoDiseaseImpactEffect.prefab").WaitForCompletion();
val6.transform.localScale = new Vector3(aoe, aoe, aoe);
MainModule main = ((Component)val6.transform.GetChild(1)).GetComponent<ParticleSystem>().main;
((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.33f);
Gradient val7 = new Gradient();
val7.SetKeys((GradientColorKey[])(object)new GradientColorKey[3]
{
new GradientColorKey(Color.white, 0f),
new GradientColorKey(Color.white, 0.165f),
new GradientColorKey(Color.black, 0.33f)
}, (GradientAlphaKey[])(object)new GradientAlphaKey[3]
{
new GradientAlphaKey(0f, 0f),
new GradientAlphaKey(1f, 0.165f),
new GradientAlphaKey(0f, 0.33f)
});
ColorOverLifetimeModule colorOverLifetime = ((Component)val6.transform.GetChild(1)).GetComponent<ParticleSystem>().colorOverLifetime;
((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val7);
SizeOverLifetimeModule sizeOverLifetime = ((Component)val6.transform.GetChild(1)).GetComponent<ParticleSystem>().sizeOverLifetime;
((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 0f),
new Keyframe(1f, 0.165f),
new Keyframe(0f, 0.33f)
}));
ParticleSystemRenderer component4 = ((Component)val6.transform.GetChild(2)).GetComponent<ParticleSystemRenderer>();
component4.mesh = Addressables.LoadAssetAsync<Mesh>((object)"RoR2/Base/Common/VFX/mdlVFXDonut2.fbx").WaitForCompletion();
MainModule main2 = ((Component)component4).gameObject.GetComponent<ParticleSystem>().main;
((MainModule)(ref main2)).startLifetime = MinMaxCurve.op_Implicit(0.5f);
SizeOverLifetimeModule sizeOverLifetime2 = ((Component)component4).gameObject.GetComponent<ParticleSystem>().sizeOverLifetime;
((SizeOverLifetimeModule)(ref sizeOverLifetime2)).size = new MinMaxCurve(1f, new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 0f),
new Keyframe(1f, 0.1f),
new Keyframe(0f, 0.5f)
}));
ColorOverLifetimeModule colorOverLifetime2 = ((Component)component4).gameObject.GetComponent<ParticleSystem>().colorOverLifetime;
Gradient val8 = new Gradient();
val8.SetKeys((GradientColorKey[])(object)new GradientColorKey[3]
{
new GradientColorKey(Color.black, 0f),
new GradientColorKey(Color.white, 0.1f),
new GradientColorKey(Color.black, 0.5f)
}, (GradientAlphaKey[])(object)new GradientAlphaKey[3]
{
new GradientAlphaKey(0f, 0f),
new GradientAlphaKey(1f, 0.1f),
new GradientAlphaKey(0f, 0.5f)
});
((ColorOverLifetimeModule)(ref colorOverLifetime2)).color = MinMaxGradient.op_Implicit(val8);
ProjectileDamage component5 = val2.GetComponent<ProjectileDamage>();
component5.damageType = (DamageType)0;
}
}
internal class PassiveController : MonoBehaviour
{
public string currentPassive;
public static SkillFamily passiveFamily = Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Croco/CrocoBodyPassiveFamily.asset").WaitForCompletion();
public void Start()
{
GenericSkill val = (from x in ((Component)this).gameObject.GetComponents<GenericSkill>()
where (Object)(object)x.skillFamily == (Object)(object)passiveFamily
select x).First();
currentPassive = val.skillNameToken;
}
}
public class Poison : TweakBase
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static CustomDotBehaviour <>9__15_0;
public static Func<Instruction, bool> <>9__18_1;
public static Func<int, int> <>9__18_0;
internal void <Init>b__15_0(DotController self, DotStack dotStack)
{
GameObject attackerObject = dotStack.attackerObject;
CharacterBody val = ((attackerObject != null) ? attackerObject.GetComponent<CharacterBody>() : null);
dotStack.damage = Mathf.Min(Mathf.Max(Object.op_Implicit((Object)(object)self.victimHealthComponent) ? (self.victimHealthComponent.fullCombinedHealth * percentDamagePerSecond * 0.25f) : 0f, val.damage * getReal * 0.25f), val.damage * dpsCap * 0.25f);
}
internal bool <GlobalEventManager_OnHitEnemy>b__18_1(Instruction x)
{
return ILPatternMatchingExt.MatchLdcI4(x, 4096);
}
internal int <GlobalEventManager_OnHitEnemy>b__18_0(int useless)
{
return 0;
}
}
public static float duration;
public static float percentDamagePerSecond;
public static float dpsCap;
public static float getReal;
public static BuffDef poison;
public static DotDef poisonDef;
public static DotIndex poisonIndex;
public override bool DoesNotKillTheMod => false;
public override string Name => "Passive : Poison";
public override string SkillToken => "passive";
public override string DescText => "<style=cIsHealing>Poisonous</style> attacks apply a powerful damage-over-time.";
public override void Init()
{
//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_006e: 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_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Expected O, but got Unknown
//IL_0159: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: Unknown result type (might be due to invalid IL or missing references)
//IL_0151: Expected O, but got Unknown
poison = ScriptableObject.CreateInstance<BuffDef>();
poison.isDebuff = true;
poison.isCooldown = false;
poison.canStack = false;
poison.isHidden = false;
poison.iconSprite = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/Croco/bdPoisoned.asset").WaitForCompletion().iconSprite;
poison.buffColor = Color32.op_Implicit(new Color32((byte)201, (byte)242, (byte)77, byte.MaxValue));
((Object)poison).name = "Poison";
ContentAddition.AddBuffDef(poison);
duration = ConfigOption(3f, "Duration", "Vanilla is 10");
percentDamagePerSecond = ConfigOption(0.015f, "Percent Max Health Damage Per Second", "Decimal. Vanilla is 0.01");
dpsCap = ConfigOption(50f, "Maximum Base Damage Per Second", "Decimal. Vanilla is 50");
getReal = ConfigOption(1f, "Minimum Base Damage Per Second", "Decimal. Vanilla is 1");
poisonDef = new DotDef
{
associatedBuff = poison,
damageCoefficient = 1f,
damageColorIndex = (DamageColorIndex)4,
interval = 0.25f
};
object obj = <>c.<>9__15_0;
if (obj == null)
{
CustomDotBehaviour val = delegate(DotController self, DotStack dotStack)
{
GameObject attackerObject = dotStack.attackerObject;
CharacterBody val3 = ((attackerObject != null) ? attackerObject.GetComponent<CharacterBody>() : null);
dotStack.damage = Mathf.Min(Mathf.Max(Object.op_Implicit((Object)(object)self.victimHealthComponent) ? (self.victimHealthComponent.fullCombinedHealth * percentDamagePerSecond * 0.25f) : 0f, val3.damage * getReal * 0.25f), val3.damage * dpsCap * 0.25f);
};
<>c.<>9__15_0 = val;
obj = (object)val;
}
CustomDotBehaviour val2 = (CustomDotBehaviour)obj;
poisonIndex = DotAPI.RegisterDotDef(poisonDef, val2, (CustomDotVisual)null);
base.Init();
}
public override void Hooks()
{
GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
}
private void GlobalEventManager_onServerDamageDealt(DamageReport report)
{
//IL_003f: 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_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_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
DamageInfo damageInfo = report.damageInfo;
CharacterBody attackerBody = report.attackerBody;
if (!Object.op_Implicit((Object)(object)attackerBody))
{
return;
}
HealthComponent victim = report.victim;
if (Object.op_Implicit((Object)(object)victim) && DamageAPI.HasModdedDamageType(damageInfo, Main.poison))
{
InflictDotInfo val = default(InflictDotInfo);
val.victimObject = ((Component)victim).gameObject;
val.attackerObject = ((Component)attackerBody).gameObject;
val.totalDamage = null;
val.dotIndex = poisonIndex;
val.duration = duration;
val.damageMultiplier = 1f;
val.maxStacksFromAttacker = 1u;
InflictDotInfo val2 = val;
DotController.InflictDot(ref val2);
CharacterMaster master = attackerBody.master;
if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.playerStatsComponent))
{
master.playerStatsComponent.currentStats.PushStatValue(StatDef.totalCrocoInfectionsInflicted, 1uL);
}
}
}
private void GlobalEventManager_OnHitEnemy(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
ILCursor val = new ILCursor(il);
if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 4096)
}))
{
int index = val.Index;
val.Index = index + 1;
val.EmitDelegate<Func<int, int>>((Func<int, int>)((int useless) => 0));
}
else
{
Main.HACTLogger.LogError((object)"Failed to apply Poison Deletion hook");
}
}
}
internal class RavenousBite : TweakBase
{
public static float damage;
public static float cooldown;
public override bool DoesNotKillTheMod => true;
public override string Name => "Secondary :: Ravenous Bite";
public override string SkillToken => "secondary_alt";
public override string DescText => "<style=cIsUtility>Agile</style>. <style=cArtifact>Blighted</style>. <style=cIsHealing>Regenerative</style>. Bite an enemy for <style=cIsDamage>" + d(damage) + " damage</style>.";
public override void Init()
{
damage = ConfigOption(4.4f, "Damage", "Decimal. Vanilla is 3.2");
cooldown = ConfigOption(3f, "Cooldown", "Vanilla is 2");
base.Init();
}
public override void Hooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
Bite.OnEnter += new hook_OnEnter(Bite_OnEnter);
Bite.AuthorityModifyOverlapAttack += new hook_AuthorityModifyOverlapAttack(Bite_AuthorityModifyOverlapAttack);
Changes();
}
private void Bite_OnEnter(orig_OnEnter orig, Bite self)
{
((BasicMeleeAttack)self).damageCoefficient = damage;
orig.Invoke(self);
}
private void Bite_AuthorityModifyOverlapAttack(orig_AuthorityModifyOverlapAttack orig, Bite self, OverlapAttack overlapAttack)
{
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
PassiveController component = ((EntityState)self).GetComponent<PassiveController>();
if ((Object)(object)component != (Object)null)
{
string currentPassive = component.currentPassive;
string text = currentPassive;
if (text == "HAT_FRENZY_NAME")
{
DamageAPI.AddModdedDamageType(overlapAttack, Passives.frenzy);
}
else
{
DamageAPI.AddModdedDamageType(overlapAttack, Passives.regen);
}
}
DamageAPI.AddModdedDamageType(overlapAttack, Main.blight);
}
private void Changes()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
SkillDef val = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Croco/CrocoBite.asset").WaitForCompletion();
val.baseRechargeInterval = cooldown;
val.cancelSprintingOnActivation = false;
val.keywordTokens = new string[3] { "HAT_BLIGHT", "KEYWORD_AGILE", "KEYWORD_RAPID_REGEN" };
}
}
internal class ViciousWounds : TweakBase
{
public static bool disableCancel;
public static float duration;
public static float damage;
public static float lastHitDamage;
public override bool DoesNotKillTheMod => true;
public override string Name => "Primary : Vicious Wounds";
public override string SkillToken => "primary";
public override string DescText => "Maul an enemy for <style=cIsDamage>" + d(damage) + " damage</style>. Every third hit is <style=cIsHealing>Poisonous</style>, <style=cIsHealing>Regenerative</style> and deals <style=cIsDamage>" + d(lastHitDamage) + " damage</style>.";
public override void Init()
{
disableCancel = ConfigOption(value: true, "Disable M1 Cancel?", "Vanilla is false. For a bit of a backstory, Acrid used to have a choice between dealing more dps and healing with the cancel, now it's straight up better and I can't revert it.");
duration = ConfigOption(1.25f, "Total Duration", "Vanilla is 1.5");
damage = ConfigOption(2f, "First And Second Hit Damage", "Decimal. Vanilla is 2");
lastHitDamage = ConfigOption(4f, "Last Hit Damage", "Decimal. Vanilla is 4");
base.Init();
}
public override void Hooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
Slash.OnEnter += new hook_OnEnter(Slash_OnEnter);
Slash.AuthorityModifyOverlapAttack += new hook_AuthorityModifyOverlapAttack(Slash_AuthorityModifyOverlapAttack);
Changes();
}
private void Slash_AuthorityModifyOverlapAttack(orig_AuthorityModifyOverlapAttack orig, Slash self, OverlapAttack overlapAttack)
{
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
if (self.isComboFinisher)
{
PassiveController component = ((EntityState)self).GetComponent<PassiveController>();
if ((Object)(object)component != (Object)null)
{
string currentPassive = component.currentPassive;
string text = currentPassive;
if (text == "HAT_FRENZY_NAME")
{
DamageAPI.AddModdedDamageType(overlapAttack, Passives.frenzy);
}
else
{
DamageAPI.AddModdedDamageType(overlapAttack, Passives.regen);
}
}
DamageAPI.AddModdedDamageType(overlapAttack, Main.poison);
}
orig.Invoke(self, overlapAttack);
}
private void Slash_OnEnter(orig_OnEnter orig, Slash self)
{
((BasicMeleeAttack)self).damageCoefficient = damage;
Slash.comboFinisherDamageCoefficient = lastHitDamage;
((BasicMeleeAttack)self).baseDuration = duration;
((BasicMeleeAttack)self).duration = duration / ((BaseState)self).attackSpeedStat;
Slash.comboFinisherBaseDurationBeforeInterruptable = duration / 1.5f;
Slash.baseDurationBeforeInterruptable = duration / 2.7272727f;
orig.Invoke(self);
}
private void Changes()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
SteppedSkillDef val = Addressables.LoadAssetAsync<SteppedSkillDef>((object)"RoR2/Base/Croco/CrocoSlash.asset").WaitForCompletion();
if (disableCancel)
{
((SkillDef)val).canceledFromSprinting = false;
}
((SkillDef)val).keywordTokens = new string[2] { "HAT_POISON", "KEYWORD_RAPID_REGEN" };
}
}
}
namespace HIFUAcridTweaks.Misc
{
internal class Achievements : MiscBase
{
public static ulong poisonCount;
public override string Name => "Misc ::::: Achievements";
public override bool DoesNotKillTheMod => true;
public override void Init()
{
poisonCount = ConfigOption(100uL, "Acrid: Pandemic Poison Requirement Amount", "Vanilla is 1000");
base.Init();
}
public override void Hooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
BaseStatMilestoneAchievement.ProgressForAchievement += new Manipulator(BaseStatMilestoneAchievement_ProgressForAchievement);
BaseStatMilestoneAchievement.Check += new Manipulator(BaseStatMilestoneAchievement_Check);
Changes();
}
private void BaseStatMilestoneAchievement_Check(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<BaseStatMilestoneAchievement>(x, "get_statRequirement")
}))
{
int index = val.Index;
val.Index = index + 1;
val.Emit(OpCodes.Ldarg_0);
val.EmitDelegate<Func<ulong, BaseStatMilestoneAchievement, ulong>>((Func<ulong, BaseStatMilestoneAchievement, ulong>)((ulong orig, BaseStatMilestoneAchievement self) => (self is CrocoTotalInfectionsMilestoneAchievement) ? poisonCount : orig));
}
else
{
Main.HACTLogger.LogError((object)"Failed to apply Poison Count 2 hook");
}
}
private void BaseStatMilestoneAchievement_ProgressForAchievement(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<BaseStatMilestoneAchievement>(x, "get_statRequirement")
}))
{
int index = val.Index;
val.Index = index + 1;
val.Emit(OpCodes.Ldarg_0);
val.EmitDelegate<Func<ulong, BaseStatMilestoneAchievement, ulong>>((Func<ulong, BaseStatMilestoneAchievement, ulong>)((ulong orig, BaseStatMilestoneAchievement self) => (self is CrocoTotalInfectionsMilestoneAchievement) ? poisonCount : orig));
}
else
{
Main.HACTLogger.LogError((object)"Failed to apply Poison Count 1 hook");
}
}
private void Changes()
{
LanguageAPI.Add("ACHIEVEMENT_CROCOTOTALINFECTIONSMILESTONE_DESCRIPTION", "As Acrid, inflict Poison " + poisonCount + " total times.");
}
}
internal class BaseStats : MiscBase
{
public static float baseDamage;
public static float baseHealth;
public override string Name => "Misc :: Base Stats";
public override bool DoesNotKillTheMod => true;
public override void Init()
{
baseDamage = ConfigOption(12f, "Base Damage", "Vanilla is 15");
baseHealth = ConfigOption(120f, "Base Health", "Vanilla is 160");
base.Init();
}
public override void Hooks()
{
Changes();
}
private void Changes()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
CharacterBody component = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Croco/CrocoBody.prefab").WaitForCompletion().GetComponent<CharacterBody>();
component.baseDamage = baseDamage;
component.levelDamage = baseDamage * 0.2f;
component.baseMaxHealth = baseHealth;
component.levelMaxHealth = baseHealth * 0.3f;
}
}
internal class HurtBox : MiscBase
{
public static float sizeMultiplier;
public override string Name => "Misc ::: Hurt Box";
public override bool DoesNotKillTheMod => true;
public override void Init()
{
sizeMultiplier = ConfigOption(0.75f, "Size Multiplier", "Vanilla is 1");
base.Init();
}
public override void Hooks()
{
Changes();
}
private void Changes()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Croco/CrocoBody.prefab").WaitForCompletion();
SphereCollider component = ((Component)val.transform.GetChild(0).GetChild(2).Find("TempHurtbox")).GetComponent<SphereCollider>();
((Component)component).transform.localPosition = new Vector3(0f, 7f, 2f);
component.radius = 5.26f * sizeMultiplier;
}
}
internal class Passives : MiscBase
{
public static float regenHeal;
public static float regenDur;
public static float frenSpeed;
public static float frenDur;
public static SkillDef regenerativeSD;
public static SkillDef frenziedSD;
public static BuffDef regenerative;
public static BuffDef frenzied;
public static ModdedDamageType regen = DamageAPI.ReserveDamageType();
public static ModdedDamageType frenzy = DamageAPI.ReserveDamageType();
public static BodyIndex acridBodyIndex;
public static UnlockableDef frenziedUnlock;
public override string Name => "Misc :::: Passives";
public override bool DoesNotKillTheMod => false;
public override void Init()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_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_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_0205: Unknown result type (might be due to invalid IL or missing references)
//IL_020a: Unknown result type (might be due to invalid IL or missing references)
//IL_0215: Unknown result type (might be due to invalid IL or missing references)
//IL_0344: Unknown result type (might be due to invalid IL or missing references)
//IL_0356: Unknown result type (might be due to invalid IL or missing references)
//IL_0358: Unknown result type (might be due to invalid IL or missing references)
//IL_0366: Unknown result type (might be due to invalid IL or missing references)
//IL_0384: Unknown result type (might be due to invalid IL or missing references)
//IL_0386: 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_03dc: Unknown result type (might be due to invalid IL or missing references)
//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0464: Unknown result type (might be due to invalid IL or missing references)
//IL_0469: Unknown result type (might be due to invalid IL or missing references)
//IL_046e: Unknown result type (might be due to invalid IL or missing references)
//IL_047d: Unknown result type (might be due to invalid IL or missing references)
//IL_0482: Unknown result type (might be due to invalid IL or missing references)
SkillFamily val = Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Croco/CrocoBodyPassiveFamily.asset").WaitForCompletion();
regenerativeSD = ScriptableObject.CreateInstance<SkillDef>();
((Object)regenerativeSD).name = "Regenerative Passive";
regenerativeSD.skillName = "Regenerative HAT";
regenerativeSD.skillNameToken = "HAT_REGEN_NAME";
regenerativeSD.skillDescriptionToken = "HAT_REGEN_DESCRIPTION";
regenerativeSD.keywordTokens = new string[1] { "KEYWORD_RAPID_REGEN" };
regenerativeSD.activationStateMachineName = "Weapon";
regenerativeSD.activationState = new SerializableEntityStateType(typeof(Idle));
regenerativeSD.interruptPriority = (InterruptPriority)1;
regenerativeSD.baseRechargeInterval = 1f;
regenerativeSD.baseMaxStock = 1;
regenerativeSD.rechargeStock = 1;
regenerativeSD.requiredStock = 1;
regenerativeSD.stockToConsume = 1;
regenerativeSD.resetCooldownTimerOnUse = false;
regenerativeSD.fullRestockOnAssign = true;
regenerativeSD.dontAllowPastMaxStocks = false;
regenerativeSD.beginSkillCooldownOnSkillEnd = false;
regenerativeSD.cancelSprintingOnActivation = true;
regenerativeSD.forceSprintDuringState = false;
regenerativeSD.canceledFromSprinting = false;
regenerativeSD.isCombatSkill = true;
regenerativeSD.mustKeyPress = false;
regenerativeSD.icon = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Croco/CrocoPassivePoison.asset").WaitForCompletion().icon;
ContentAddition.AddSkillDef(regenerativeSD);
Sprite icon = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Croco/CrocoPassiveBlight.asset").WaitForCompletion().icon;
frenziedSD = ScriptableObject.CreateInstance<SkillDef>();
((Object)frenziedSD).name = "Frenzied Passive";
frenziedSD.skillName = "Frenzied HAT";
frenziedSD.skillNameToken = "HAT_FRENZY_NAME";
frenziedSD.skillDescriptionToken = "HAT_FRENZY_DESCRIPTION";
frenziedSD.keywordTokens = new string[1] { "KEYWORD_RAPID_SPEED" };
frenziedSD.activationStateMachineName = "Weapon";
frenziedSD.activationState = new SerializableEntityStateType(typeof(Idle));
frenziedSD.interruptPriority = (InterruptPriority)1;
frenziedSD.baseRechargeInterval = 1f;
frenziedSD.baseMaxStock = 1;
frenziedSD.rechargeStock = 1;
frenziedSD.requiredStock = 1;
frenziedSD.stockToConsume = 1;
frenziedSD.resetCooldownTimerOnUse = false;
frenziedSD.fullRestockOnAssign = true;
frenziedSD.dontAllowPastMaxStocks = false;
frenziedSD.beginSkillCooldownOnSkillEnd = false;
frenziedSD.cancelSprintingOnActivation = true;
frenziedSD.forceSprintDuringState = false;
frenziedSD.canceledFromSprinting = false;
frenziedSD.isCombatSkill = true;
frenziedSD.mustKeyPress = false;
frenziedSD.icon = icon;
ContentAddition.AddSkillDef(frenziedSD);
frenziedUnlock = ScriptableObject.CreateInstance<UnlockableDef>();
frenziedUnlock.nameToken = "ACHIEVEMENT_ACRIDFRENZIED_NAME";
frenziedUnlock.cachedName = "Acrid.Skills_Frenzied";
frenziedUnlock.achievementIcon = Main.iHateThis.LoadAsset<Sprite>("Assets/HIFUAcridTweaks/bloighjt.png");
LanguageAPI.Add("ACHIEVEMENT_ACRIDFRENZIED_NAME", "Acrid: Frenzy");
LanguageAPI.Add("ACHIEVEMENT_ACRIDFRENZIED_DESCRIPTION", "As Acrid, use 10 skills in under 3 seconds.");
ContentAddition.AddUnlockableDef(frenziedUnlock);
val.variants[0] = new Variant
{
skillDef = regenerativeSD
};
val.variants[1] = new Variant
{
skillDef = frenziedSD,
unlockableDef = frenziedUnlock
};
regenerative = ScriptableObject.CreateInstance<BuffDef>();
regenerative.isDebuff = false;
regenerative.isCooldown = false;
regenerative.canStack = true;
regenerative.isHidden = false;
regenerative.buffColor = Color32.op_Implicit(new Color32((byte)201, (byte)242, (byte)77, byte.MaxValue));
regenerative.iconSprite = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/Croco/bdCrocoRegen.asset").WaitForCompletion().iconSprite;
((Object)regenerative).name = "HIFUAcridTweaks Regenerative";
frenzied = ScriptableObject.CreateInstance<BuffDef>();
frenzied.isDebuff = false;
frenzied.isCooldown = false;
frenzied.canStack = true;
frenzied.isHidden = false;
frenzied.buffColor = Color32.op_Implicit(new Color32((byte)201, (byte)242, (byte)77, byte.MaxValue));
frenzied.iconSprite = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/DLC1/MoveSpeedOnKill/bdKillMoveSpeed.asset").WaitForCompletion().iconSprite;
((Object)frenzied).name = "HIFUAcridTweaks Frenzied";
ContentAddition.AddBuffDef(regenerative);
ContentAddition.AddBuffDef(frenzied);
regenHeal = ConfigOption(0.05f, "Regenerative Heal Percent", "Decimal. Vanilla is 0.05");
regenDur = ConfigOption(1f, "Regenerative Buff Duration", "Vanilla is 0.5");
frenSpeed = ConfigOption(0.2f, "Frenzied Movement Speed", "Decimal.");
frenDur = ConfigOption(5f, "Frenzied Buff Duration", "");
base.Init();
}
public override void Hooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Expected O, but got Unknown
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Expected O, but got Unknown
BodyCatalog.Init += new hook_Init(BodyCatalog_Init);
CharacterBody.onBodyStartGlobal += CharacterBody_onBodyStartGlobal;
Slash.OnMeleeHitAuthority += new Manipulator(Slash_OnMeleeHitAuthority);
Bite.OnMeleeHitAuthority += new Manipulator(Bite_OnMeleeHitAuthority);
CharacterBody.RecalculateStats += new Manipulator(CharacterBody_RecalculateStats);
RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
HealthComponent.ServerFixedUpdate += new hook_ServerFixedUpdate(HealthComponent_ServerFixedUpdate);
Changes();
}
private void Bite_OnMeleeHitAuthority(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "AddSpreadBloom")
}))
{
int index = val.Index;
val.Index = index + 1;
val.Emit(OpCodes.Ret);
}
else
{
Main.HACTLogger.LogError((object)"Failed to apply Regenerative Deletion 2 hook");
}
}
private void Slash_OnMeleeHitAuthority(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "AddSpreadBloom")
}))
{
int index = val.Index;
val.Index = index + 1;
val.Emit(OpCodes.Ret);
}
else
{
Main.HACTLogger.LogError((object)"Failed to apply Regenerative Deletion 1 hook");
}
}
private void BodyCatalog_Init(orig_Init orig)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke();
acridBodyIndex = BodyCatalog.FindBodyIndex("CrocoBody");
}
private void CharacterBody_onBodyStartGlobal(CharacterBody body)
{
//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)
if (body.bodyIndex == acridBodyIndex && (Object)(object)((Component)body).GetComponent<PassiveController>() == (Object)null)
{
((Component)body).gameObject.AddComponent<PassiveController>();
}
}
private void HealthComponent_ServerFixedUpdate(orig_ServerFixedUpdate orig, HealthComponent self)
{
if (self.alive && Object.op_Implicit((Object)(object)self.body))
{
self.regenAccumulator += self.fullCombinedHealth * regenHeal / (regenDur / Time.fixedDeltaTime) * (float)self.body.GetBuffCount(regenerative);
}
orig.Invoke(self);
}
private void GlobalEventManager_onServerDamageDealt(DamageReport report)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: 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)
CharacterBody attackerBody = report.attackerBody;
if (Object.op_Implicit((Object)(object)attackerBody))
{
if (DamageAPI.HasModdedDamageType(report.damageInfo, regen))
{
attackerBody.AddTimedBuffAuthority(regenerative.buffIndex, regenDur);
}
if (DamageAPI.HasModdedDamageType(report.damageInfo, frenzy))
{
attackerBody.AddTimedBuffAuthority(frenzied.buffIndex, frenDur);
}
}
}
private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
{
if (Object.op_Implicit((Object)(object)sender))
{
args.moveSpeedMultAdd += frenSpeed * (float)sender.GetBuffCount(frenzied);
}
}
private void CharacterBody_RecalculateStats(ILContext il)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
ILCursor val = new ILCursor(il);
if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[7]
{
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Buffs", "CrocoRegen"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "GetBuffCount"),
(Instruction x) => ILPatternMatchingExt.MatchConvR4(x),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_maxHealth"),
(Instruction x) => ILPatternMatchingExt.MatchMul(x),
(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.1f)
}))
{
val.Index += 6;
val.Next.Operand = 0f;
}
else
{
Main.HACTLogger.LogError((object)"Failed to apply Regenerative Healing hook");
}
}
private void Changes()
{
LanguageAPI.Add("HAT_REGEN_NAME", "Regenerative");
LanguageAPI.Add("HAT_REGEN_DESCRIPTION", "<style=cIsHealing>Regenerative</style> attacks <style=cIsHealing>heal</style> over a short duration.");
LanguageAPI.Add("HAT_FRENZY_NAME", "Frenzied");
LanguageAPI.Add("HAT_FRENZY_DESCRIPTION", "Attacks that apply <style=cIsHealing>Regenerative</style> apply <style=cIsDamage>Frenzied</style> instead, which increases <style=cIsUtility>movement speed</style> for a short duration.");
LanguageAPI.Add("KEYWORD_RAPID_REGEN", "<style=cKeywordName>Regenerative</style><style=cSub>Heal for <style=cIsHealing>" + Math.Round(regenHeal * 100f, 2) + "%</style> of your maximum health over <style=cIsHealing>" + Math.Round(regenDur, 2) + "s</style>. <i>Can stack.</i></style>");
LanguageAPI.Add("KEYWORD_RAPID_SPEED", "<style=cKeywordName>Frenzied</style><style=cSub>Gain <style=cIsUtility>" + Math.Round(frenSpeed * 100f, 2) + "%</style> movement speed for <style=cIsUtility>" + Math.Round(frenDur, 2) + "s</style>. <i>Can stack.</i></style>");
}
}
[RegisterAchievement("AcridFrenzied", "Acrid.Skills_Frenzied", "BeatArena", null)]
public class FrenziedAchievement : BaseAchievement
{
private static readonly int requiredSkillCount = 10;
private CharacterBody _trackedBody;
private DoXInYSecondsTracker tracker;
private static readonly float windowSeconds = 3f;
private CharacterBody trackedBody
{
get
{
return _trackedBody;
}
set
{
if (!((Object)(object)_trackedBody == (Object)(object)value))
{
if ((Object)(object)_trackedBody != (Object)null)
{
_trackedBody.onSkillActivatedAuthority -= OnSkillActivated;
}
_trackedBody = value;
if ((Object)(object)_trackedBody != (Object)null)
{
_trackedBody.onSkillActivatedAuthority += OnSkillActivated;
}
}
}
}
[SystemInitializer(new Type[] { typeof(OptInAttribute) })]
public override BodyIndex LookUpRequiredBodyIndex()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
return BodyCatalog.FindBodyIndex("CrocoBody");
}
[SystemInitializer(new Type[] { typeof(OptInAttribute) })]
public override void OnInstall()
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
((BaseAchievement)this).OnInstall();
tracker = new DoXInYSecondsTracker(requiredSkillCount, windowSeconds);
}
[SystemInitializer(new Type[] { typeof(OptInAttribute) })]
public override void OnUninstall()
{
tracker = null;
((BaseAchievement)this).OnUninstall();
}
[SystemInitializer(new Type[] { typeof(OptInAttribute) })]
public override void OnBodyRequirementMet()
{
((BaseAchievement)this).OnBodyRequirementMet();
trackedBody = ((BaseAchievement)this).localUser.cachedBody;
((BaseAchievement)this).localUser.onBodyChanged += OnBodyChanged;
tracker.Clear();
}
[SystemInitializer(new Type[] { typeof(OptInAttribute) })]
public override void OnBodyRequirementBroken()
{
if (((BaseAchievement)this).localUser != null)
{
((BaseAchievement)this).localUser.onBodyChanged -= OnBodyChanged;
}
trackedBody = null;
((BaseAchievement)this).OnBodyRequirementBroken();
if (tracker != null)
{
tracker.Clear();
}
}
[SystemInitializer(new Type[] { typeof(OptInAttribute) })]
private void OnBodyChanged()
{
trackedBody = ((BaseAchievement)this).localUser.cachedBody;
tracker.Clear();
}
[SystemInitializer(new Type[] { typeof(OptInAttribute) })]
private void OnSkillActivated(GenericSkill skill)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
if (tracker.Push(FixedTimeStamp.now.t))
{
((BaseAchievement)this).Grant();
}
}
}
internal class Spawn : MiscBase
{
public override string Name => "Misc : Spawn Animation";
public override bool DoesNotKillTheMod => true;
public override void Init()
{
base.Init();
}
public override void Hooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
Spawn.OnEnter += new hook_OnEnter(Spawn_OnEnter);
WakeUp.OnEnter += new hook_OnEnter(WakeUp_OnEnter);
}
private void WakeUp_OnEnter(orig_OnEnter orig, WakeUp self)
{
WakeUp.duration = 1.2f;
orig.Invoke(self);
}
private void Spawn_OnEnter(orig_OnEnter orig, Spawn self)
{
Spawn.minimumSleepDuration = 0.7f;
orig.Invoke(self);
}
}
}
namespace HIFUAcridTweaks.Keywords
{
public static class Keywords
{
public static void Init()
{
LanguageAPI.Add("HAT_POISON", "<style=cKeywordName>Poisonous</style><style=cSub>Deal damage equal to <style=cIsDamage>" + Poison.percentDamagePerSecond * 100f * Poison.duration + "%</style> of the enemy's maximum health over " + Poison.duration + "s. <i>Cannot stack.</i></style>");
LanguageAPI.Add("HAT_BLIGHT", "<style=cKeywordName>Blighted</style><style=cSub>Deal <style=cIsDamage>" + Blight.damagePerSecond * 100f * Blight.duration + "%</style> base damage over " + Blight.duration + "s. <i>Can stack.</i></style>");
}
}
}