using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Chef;
using EntityStates.FalseSon;
using EntityStates.Seeker;
using IL.EntityStates.Chef;
using IL.EntityStates.FalseSon;
using IL.EntityStates.Seeker;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On;
using On.EntityStates.Chef;
using On.EntityStates.FalseSon;
using On.EntityStates.Seeker;
using On.RoR2;
using On.RoR2.Projectile;
using R2API;
using RoR2;
using RoR2.Projectile;
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("SOTSSurvivorTweaks")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+27046df7e6b289ed4e1dac7cedd74d177302f5a7")]
[assembly: AssemblyProduct("SOTSSurvivorTweaks")]
[assembly: AssemblyTitle("SOTSSurvivorTweaks")]
[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 SOTSSurvivorTweaks
{
internal static class Log
{
private static ManualLogSource _logSource;
internal static void Init(ManualLogSource logSource)
{
_logSource = logSource;
}
internal static void Debug(object data)
{
_logSource.LogDebug(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);
}
}
public static class ModUtil
{
public static void WrapILHook(this ILContext il, Action<ILContext> edit, string hookName, bool dump = false)
{
try
{
edit(il);
Log.Info("IL hook " + hookName + " completed");
}
catch (Exception data)
{
Log.Error("IL hook " + hookName + " encountered an unhandled exception!!!");
Log.Error(data);
}
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("mayhemmmwith3ms.SOTSSurvivorTweaks", "SOTSSurvivorTweaks", "0.1.0")]
public class SOTSSurvivorTweaks : BaseUnityPlugin
{
public const string PluginGUID = "mayhemmmwith3ms.SOTSSurvivorTweaks";
public const string PluginAuthor = "mayhemmmwith3ms";
public const string PluginName = "SOTSSurvivorTweaks";
public const string PluginVersion = "0.1.0";
private static Dictionary<string, Dictionary<string, string>> LanguageAPITokenDict;
public const string SeekerTweaksConfigSection = "Seeker Tweaks";
public const string ChefTweaksConfigSection = "Chef Tweaks";
public const string FalseSonTweaksConfigSection = "False Son Tweaks";
public static ConfigEntry<bool> Config_SeekerPalmBlastLevelDamageFix { get; set; }
public static ConfigEntry<bool> Config_SeekerReduceUnseenHandZoomout { get; set; }
public static ConfigEntry<bool> Config_SeekerReduceMeditateZoomout { get; set; }
public static ConfigEntry<bool> Config_ChefCleaverTweaks { get; set; }
public static ConfigEntry<bool> Config_ChefCleaverHoldoutTweaks { get; set; }
public static ConfigEntry<bool> Config_ChefHideCookingDebuffs { get; set; }
public static ConfigEntry<bool> Config_ChefOiledTweaks { get; set; }
public static ConfigEntry<bool> Config_ChefBoostedRollRemoveBleed { get; set; }
public static ConfigEntry<bool> Config_ChefMarkOilSpillAsSkill { get; set; }
public static ConfigEntry<bool> Config_ChefFixOilSpillAirMomentum { get; set; }
public static ConfigEntry<bool> Config_ChefStopYesChefFromStealingBands { get; set; }
public static ConfigEntry<bool> Config_FalseSonLunarRuinDamageStackingFix { get; set; }
public static ConfigEntry<bool> Config_FalseSonMeridiansWillCameraJumpFix { get; set; }
public static ConfigEntry<bool> Config_FalseSonRemoveMeridiansWillZoomout { get; set; }
public static ConfigEntry<bool> Config_FalseSonReduceChargedLaserFatherZoomout { get; set; }
public void Awake()
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Expected O, but got Unknown
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Expected O, but got Unknown
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Expected O, but got Unknown
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: 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_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Expected O, but got Unknown
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Expected O, but got Unknown
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Expected O, but got Unknown
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Expected O, but got Unknown
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Expected O, but got Unknown
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Expected O, but got Unknown
//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Expected O, but got Unknown
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Expected O, but got Unknown
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Expected O, but got Unknown
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Expected O, but got Unknown
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Expected O, but got Unknown
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Expected O, but got Unknown
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Expected O, but got Unknown
Log.Init(((BaseUnityPlugin)this).Logger);
BindConfigs();
RemoveLanguageOverridesBasedOnConfig();
CleaverProjectile.Awake += new hook_Awake(CleaverProjectile_Awake);
Dice.OnEnter += new hook_OnEnter(Dice_OnEnter);
BuffCatalog.Init += new hook_Init(BuffCatalog_Init);
RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
RolyPoly.OnEnter += new hook_OnEnter(RolyPoly_OnEnter);
OilSpillBase.OnEnter += new hook_OnEnter(OilSpillBase_OnEnter);
YesChef.OnEnter += new hook_OnEnter(YesChef_OnEnter);
OilSpillBase.OnExit += new hook_OnExit(OilSpillBase_OnExit);
CleaverProjectile.HandleFlyback += new hook_HandleFlyback(CleaverProjectile_HandleFlyback);
MeridiansWillTeleport.FixedUpdate += new hook_FixedUpdate(MeridiansWillTeleport_FixedUpdate);
LaserFatherCharged.OnEnter += new hook_OnEnter(LaserFatherCharged_OnEnter);
MeridiansWillAim.OnEnter += new hook_OnEnter(MeridiansWillAim_OnEnter);
UnseenHand.OnEnter += new hook_OnEnter(UnseenHand_OnEnter);
PalmBlastProjectileController.Init += new hook_Init(PalmBlastProjectileController_Init);
Glaze.FireGrenade += new Manipulator(ILGlazeWeakenRemoval);
HealthComponent.TakeDamageProcess += new Manipulator(ILLunarRuinDamageMultFix);
MeridiansWillTeleport.OnEnter += new Manipulator(ILMeridianTeleportCameraFix);
Meditate.OnEnter += new Manipulator(ILMeditateZoomoutTweak);
}
public void BindConfigs()
{
Config_SeekerReduceMeditateZoomout = ((BaseUnityPlugin)this).Config.Bind<bool>("Seeker Tweaks", "Reduce Meditate Zoomout", true, "Reduces the camera zoomout during Meditate.");
Config_SeekerReduceUnseenHandZoomout = ((BaseUnityPlugin)this).Config.Bind<bool>("Seeker Tweaks", "Reduce Unseen Hand Zoomout", true, "Reduces the camera zoomout while targeting Unseen Hand.");
Config_SeekerPalmBlastLevelDamageFix = ((BaseUnityPlugin)this).Config.Bind<bool>("Seeker Tweaks", "Fix Palm Blast Level Scaling", true, "Fixes Palm Blast's damage not scaling with player level.");
Config_ChefCleaverTweaks = ((BaseUnityPlugin)this).Config.Bind<bool>("Chef Tweaks", "Dice Tweaks", true, "Reduces the base damage of Dice from 200% to 180%, and increases the proc coefficient from 0.5 to 0.8.");
Config_ChefCleaverHoldoutTweaks = ((BaseUnityPlugin)this).Config.Bind<bool>("Chef Tweaks", "Dice Holdout Tweaks", true, "Changes Dice's lingering cleavers to deal 4x40% damage per second, with a proc coefficient of 0.5.");
Config_ChefHideCookingDebuffs = ((BaseUnityPlugin)this).Config.Bind<bool>("Chef Tweaks", "Hide Cooking Debuffs", true, "Hides the 'marker' debuffs inflicted by CHEF's skills to reduce visual clutter.");
Config_ChefOiledTweaks = ((BaseUnityPlugin)this).Config.Bind<bool>("Chef Tweaks", "Oiled Tweaks", true, "Changes Glaze to no longer inflict Weak, and instead adds the effects of Weak to Oiled, and makes Oiled count towards activating Death Mark.");
Config_ChefBoostedRollRemoveBleed = ((BaseUnityPlugin)this).Config.Bind<bool>("Chef Tweaks", "Boosted Roll Tweaks", true, "Changes Boosted Roll to no longer inflict Bleed, and instead make it rapidly hit enemies in its area for 8x50% damage per second, with a proc coefficient of 0.6");
Config_ChefMarkOilSpillAsSkill = ((BaseUnityPlugin)this).Config.Bind<bool>("Chef Tweaks", "Mark Oil Spill as Skill", true, "Fixes the globs fired by Oil Spill not being marked as a skill for items like Breaching Fin.");
Config_ChefFixOilSpillAirMomentum = ((BaseUnityPlugin)this).Config.Bind<bool>("Chef Tweaks", "Oil Spill Air Control Fix", true, "Fixes Oil Spill's increased air control persisting indefinitely after the skill ends.");
Config_ChefStopYesChefFromStealingBands = ((BaseUnityPlugin)this).Config.Bind<bool>("Chef Tweaks", "Yes, CHEF! Elemental Band Fix.", true, "Lowers Yes, CHEF!'s damage slightly to prevent it stealing Elemental Band procs.");
Config_FalseSonLunarRuinDamageStackingFix = ((BaseUnityPlugin)this).Config.Bind<bool>("False Son Tweaks", "Lunar Ruin Damage Multiplication Fix", true, "Fixes Lunar Ruin's damage multiplication applying to the initial damage of the hit and carrying over through proc chains, rather than just the final damage of the hit.\nThe vanilla behaviour would cause long proc chains to multiply damage exponentially, and for effects based on % base damage to erroneously activate with enough Lunar Ruin (e.g. the Elemental Bands).\nThis fix brings the damage multiplication in line with all other sources of damage multiplication in the game.");
Config_FalseSonMeridiansWillCameraJumpFix = ((BaseUnityPlugin)this).Config.Bind<bool>("False Son Tweaks", "Meridians Will Camera Lerp Fix", true, "Fixes the jarring camera movement at the start of the Meridian's Will teleport ability.");
Config_FalseSonRemoveMeridiansWillZoomout = ((BaseUnityPlugin)this).Config.Bind<bool>("False Son Tweaks", "Remove Meridians Will Camera Zoomout", true, "Removes the camera zoomout while aiming Meridian's Will.");
Config_FalseSonReduceChargedLaserFatherZoomout = ((BaseUnityPlugin)this).Config.Bind<bool>("False Son Tweaks", "Remove Laser of the Father Zoomout", true, "Removes the camera zoomout while using Laser of the Father.");
}
private void RemoveLanguageOverridesBasedOnConfig()
{
try
{
LanguageAPITokenDict = (Dictionary<string, Dictionary<string, string>>)typeof(LanguageAPI).GetField("CustomLanguage", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
}
catch (Exception ex) when (ex is ArgumentNullException || ex is NullReferenceException)
{
Log.Error(ex);
LanguageAPITokenDict = null;
}
if (LanguageAPITokenDict == null)
{
Log.Error("LanguageAPITokenDict is null! This may indicate an attempt to get the dict before LanguageAPI is initialized, or a change in the field name in the API itself.");
}
foreach (string key in LanguageAPITokenDict.Keys)
{
if (!Config_ChefCleaverTweaks.Value)
{
LanguageAPITokenDict[key].Remove("CHEF_PRIMARY_DESCRIPTION");
LanguageAPITokenDict[key].Remove("CHEF_PRIMARY_BOOST_DESCRIPTION");
LanguageAPITokenDict[key].Remove("CHEF_PRIMARY_BOOST_DESCRIPTION_SKILL");
}
if (!Config_ChefBoostedRollRemoveBleed.Value)
{
LanguageAPITokenDict[key].Remove("CHEF_UTILITY_BOOST_DESCRIPTION_SKILL");
LanguageAPITokenDict[key].Remove("CHEF_UTILITY_BOOST_DESCRIPTION");
}
if (!Config_ChefStopYesChefFromStealingBands.Value)
{
LanguageAPITokenDict[key].Remove("CHEF_SPECIAL_ALT1_DESCRIPTION");
}
}
}
private void MeridiansWillAim_OnEnter(orig_OnEnter orig, MeridiansWillAim self)
{
//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)
if (Config_FalseSonRemoveMeridiansWillZoomout.Value)
{
self.cameraTeleportPositionOffset = Vector3.zero;
}
orig.Invoke(self);
}
private void PalmBlastProjectileController_Init(orig_Init orig, PalmBlastProjectileController self, CharacterBody body)
{
orig.Invoke(self, body);
if (Config_SeekerPalmBlastLevelDamageFix.Value)
{
self.projectileDamage.damage = body.damage;
}
}
private void ILMeditateZoomoutTweak(ILContext il)
{
if (!Config_SeekerReduceMeditateZoomout.Value)
{
return;
}
il.WrapILHook(delegate(ILContext cx)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(cx);
val.GotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 5)
});
val.Remove();
val.Emit(OpCodes.Ldc_I4, 2);
}, "ILMeditateZoomoutTweak");
}
private void UnseenHand_OnEnter(orig_OnEnter orig, UnseenHand self)
{
if (Config_SeekerReduceUnseenHandZoomout.Value)
{
UnseenHand.abilityAimType = 2;
}
orig.Invoke(self);
}
private void LaserFatherCharged_OnEnter(orig_OnEnter orig, LaserFatherCharged self)
{
if (Config_FalseSonReduceChargedLaserFatherZoomout.Value)
{
LaserFatherCharged.abilityAimType = 0;
}
orig.Invoke(self);
}
private void MeridiansWillTeleport_FixedUpdate(orig_FixedUpdate orig, MeridiansWillTeleport self)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
if (Config_FalseSonMeridiansWillCameraJumpFix.Value && ((EntityState)self).fixedAge >= self.teleportDelayDuration - 0.05f && self.teleportVector != Vector3.zero)
{
float num = Vector3.Distance(self.aimLocation, ((EntityState)self).characterBody.corePosition);
float num2 = Mathf.Lerp(self.minTeleportCameraLerpDuration, self.maxTeleportCameraLerpDuration, num / self.distanceToCheck);
if (num2 < 1f)
{
num2 = Mathf.Sqrt(num2);
}
((EntityState)self).cameraTargetParams.AddLerpRequest(num2 * 0.8f);
self.teleportVector = Vector3.zero;
}
orig.Invoke(self);
}
private void ILMeridianTeleportCameraFix(ILContext il)
{
if (!Config_FalseSonMeridiansWillCameraJumpFix.Value)
{
return;
}
il.WrapILHook(delegate(ILContext x)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
ILCursor val = new ILCursor(x);
ILLabel i = null;
val.GotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchBgeUn(x, ref i)
});
val.GotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchRet(x)
});
val.MarkLabel(i);
val.GotoPrev(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0)
});
val.RemoveRange(4);
}, "ILMeridianTeleportCameraFix");
}
private void ILLunarRuinDamageMultFix(ILContext il)
{
if (!Config_FalseSonLunarRuinDamageStackingFix.Value)
{
return;
}
il.WrapILHook(delegate(ILContext x)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_0159: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(x);
val.GotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs).GetField("lunarruin", BindingFlags.Static | BindingFlags.Public))
});
val.GotoPrev(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0)
});
ILLabel val2 = val.IncomingLabels.First();
val.RemoveRange(4);
val.Emit(OpCodes.Ldc_I4, 0);
int index = val.Index;
val.Index = index - 1;
val.MarkLabel(val2);
val.GotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 9)
});
val.GotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 7)
});
index = val.Index;
val.Index = index + 1;
val.Emit(OpCodes.Ldloc, 7);
val.Emit(OpCodes.Ldarg, 1);
val.Emit(OpCodes.Ldarg, 0);
val.EmitDelegate<Func<float, DamageInfo, HealthComponent, float>>((Func<float, DamageInfo, HealthComponent, float>)delegate(float damage, DamageInfo damageInfo, HealthComponent healthComponent)
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
if (healthComponent.body.HasBuff(Buffs.lunarruin))
{
damage *= 1f + (float)healthComponent.body.GetBuffCount(Buffs.lunarruin) * 0.1f;
damageInfo.damageColorIndex = (DamageColorIndex)9;
}
return damage;
});
val.Emit(OpCodes.Stloc, 7);
}, "ILLunarRuinDamageMultFix");
}
private void YesChef_OnEnter(orig_OnEnter orig, YesChef self)
{
if (Config_ChefStopYesChefFromStealingBands.Value)
{
self.explosionDamageCoefficient = 3.8f;
}
orig.Invoke(self);
}
private void OilSpillBase_OnExit(orig_OnExit orig, OilSpillBase self)
{
orig.Invoke(self);
if (Config_ChefFixOilSpillAirMomentum.Value)
{
((EntityState)self).characterBody.characterMotor.airControl = 0.25f;
}
}
private void OilSpillBase_OnEnter(orig_OnEnter orig, OilSpillBase self)
{
//IL_001d: 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_0049: Unknown result type (might be due to invalid IL or missing references)
if (Config_ChefMarkOilSpillAsSkill.Value)
{
self.meatballProjectile.GetComponent<ProjectileDamage>().damageType.damageSource = (DamageSource)4;
self.meatballProjectileBoostedIgnite.GetComponent<ProjectileDamage>().damageType.damageSource = (DamageSource)4;
self.meatballProjectileFrozen.GetComponent<ProjectileDamage>().damageType.damageSource = (DamageSource)4;
}
orig.Invoke(self);
}
private void RolyPoly_OnEnter(orig_OnEnter orig, RolyPoly self)
{
//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)
if (Config_ChefBoostedRollRemoveBleed.Value && self.projectilePrefab != null)
{
ProjectileDotZone component = self.projectilePrefab.GetComponent<ProjectileDotZone>();
ProjectileDamage component2 = self.projectilePrefab.GetComponent<ProjectileDamage>();
ProjectileController component3 = self.projectilePrefab.GetComponent<ProjectileController>();
component2.damageType = DamageTypeCombo.GenericUtility;
self.whirlwindDamageCo = 0.5f;
component.damageCoefficient = 1f;
component.resetFrequency = 8f;
component.fireFrequency = 8f;
component3.procCoefficient = 0.6f;
}
orig.Invoke(self);
}
private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
{
if (Config_ChefOiledTweaks.Value && sender.HasBuff(Buffs.Oiled))
{
args.armorAdd -= 30f;
args.damageMultAdd -= 0.4f;
args.moveSpeedReductionMultAdd += 0.6f;
}
}
private void ILGlazeWeakenRemoval(ILContext il)
{
if (!Config_ChefOiledTweaks.Value)
{
return;
}
il.WrapILHook(delegate(ILContext x)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(x);
val.GotoNext(new Func<Instruction, bool>[1]
{
(Instruction i) => ILPatternMatchingExt.MatchLdcI4(i, 16384)
});
val.Remove();
val.Emit(OpCodes.Ldc_I4, 0);
}, "ILGlazeWeakenRemoval");
}
private void BuffCatalog_Init(orig_Init orig)
{
ConfigEntry<bool> config_ChefHideCookingDebuffs = Config_ChefHideCookingDebuffs;
if (config_ChefHideCookingDebuffs == null || config_ChefHideCookingDebuffs.Value)
{
Buffs.CookingChilled.isHidden = true;
Buffs.CookingChopped.isHidden = true;
Buffs.CookingOiled.isHidden = true;
Buffs.CookingRoasted.isHidden = true;
Buffs.CookingRolled.isHidden = true;
Buffs.CookingRolling.isHidden = true;
Buffs.CookingSearing.isHidden = true;
}
if (Config_ChefOiledTweaks.Value)
{
Buffs.Oiled.isDebuff = true;
}
orig.Invoke();
}
private void CleaverProjectile_HandleFlyback(orig_HandleFlyback orig, CleaverProjectile self)
{
if (Config_ChefCleaverTweaks.Value && !self.recallDamageFired)
{
ProjectileOverlapAttack impactOverlapAttack = self.ImpactOverlapAttack;
impactOverlapAttack.overlapProcCoefficient /= 1.5f;
}
orig.Invoke(self);
}
private void Dice_OnEnter(orig_OnEnter orig, Dice self)
{
if (Config_ChefCleaverTweaks.Value)
{
self.damageCoefficient = 1.8f;
self.boostedDamageCoefficient = 3.6f;
}
orig.Invoke(self);
}
private void CleaverProjectile_Awake(orig_Awake orig, CleaverProjectile self)
{
orig.Invoke(self);
if (Config_ChefCleaverTweaks.Value)
{
self.projectileController.procCoefficient = 1f;
self.ImpactOverlapAttack.overlapProcCoefficient = 0.8f;
}
if (Config_ChefCleaverHoldoutTweaks.Value)
{
self.IdleOverlapAttack.resetInterval = 0.25f;
self.IdleOverlapAttack.damageCoefficient = 0.2f;
self.IdleOverlapAttack.overlapProcCoefficient = 0.5f;
}
}
}
}