using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; 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.Logging; using CanadianCuisine.Behaviours; using CanadianCuisine.Behaviours.Afflictions; using CanadianCuisine.Behaviours.CookingBehaviours; using CanadianCuisine.Data; using CanadianCuisine.Patchers; using HarmonyLib; using Md.ItemCooking; using Md.Peak.Afflictions.Affliction; using Microsoft.CodeAnalysis; using MonoDetour; using MonoDetour.Cil; using MonoDetour.DetourTypes; using MonoDetour.HookGen; using PEAKLib.Core; using Peak.Afflictions; using Photon.Pun; using UnityEngine; using Zorro.Core; using Zorro.Core.Serizalization; using pworld.Scripts.Extensions; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("com.github.MiiMii1205.CanadianCuisine")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.6.1.0")] [assembly: AssemblyInformationalVersion("1.6.1+ba212eb60eedfc183488d7c784caf609c4072f5a")] [assembly: AssemblyProduct("com.github.MiiMii1205.CanadianCuisine")] [assembly: AssemblyTitle("CanadianCuisine")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.6.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Md.ItemCooking { internal static class UpdateCookedBehavior { public delegate void PrefixSignature(ItemCooking self); public delegate void PostfixSignature(ItemCooking self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(ItemCooking); MethodInfo method = typeFromHandle.GetMethod("UpdateCookedBehavior", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("ItemCooking", "UpdateCookedBehavior"); } return method; } } internal static class get_timesCookedLocal { } internal static class set_timesCookedLocal { } internal static class get_canBeCooked { } internal static class get_hasExplosion { } internal static class OnInstanceDataSet { } internal static class RunAdditionalCookingBehaviors { } internal static class CookVisually { } internal static class GetCookColor { } internal static class FinishCookingRPC { } internal static class StartCookingVisuals { } internal static class EnableCookingSmokeRPC { } internal static class Wreck { } internal static class ChangeStatsCooked { } internal static class CancelCookingVisuals { } internal static class FinishCooking { } internal static class Explode { } internal static class RPC_CookingExplode { } internal static class _ctor { } internal static class _cctor { } internal static class __c { internal static class _ctor { } } } namespace Md.Peak.Afflictions.Affliction { internal static class Tick { public delegate void PrefixSignature(Affliction self); public delegate void PostfixSignature(Affliction self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(Affliction); MethodInfo method = typeFromHandle.GetMethod("Tick", (BindingFlags)(-1), null, Array.Empty(), null); if ((object)method == null) { throw new MissingMethodException("Peak.Afflictions.Affliction", "Tick"); } return method; } } internal static class CreateBlankAffliction { public delegate void PrefixSignature(ref AfflictionType afflictionType); public delegate void PostfixSignature(ref AfflictionType afflictionType, ref Affliction returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(Affliction); MethodInfo method = typeFromHandle.GetMethod("CreateBlankAffliction", (BindingFlags)(-1), null, new Type[1] { typeof(AfflictionType) }, null); if ((object)method == null) { throw new MissingMethodException("Peak.Afflictions.Affliction", "CreateBlankAffliction"); } return method; } } internal static class _ctor { } internal static class _ctor_System_Single { } internal static class OnApplied { } internal static class OnRemoved { } internal static class get_worksOnBot { } internal static class UpdateEffect { } internal static class UpdateEffectNetworked { } internal static class Copy { } internal static class AfflictionType { internal static class _ctor { } } } namespace MonoDetour.HookGen { internal static class DefaultMonoDetourManager { internal static MonoDetourManager Instance { get; } = New(); internal static MonoDetourManager New() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown return new MonoDetourManager(typeof(DefaultMonoDetourManager).Assembly.GetName().Name); } } [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, AllowMultiple = true, Inherited = false)] internal class MonoDetourTargetsAttribute : Attribute, IMonoDetourTargets { public Type? TargetType { get; } public bool IncludeNestedTypes { get; set; } public string[]? Members { get; set; } public string[]? MemberNamePrefixes { get; set; } public string[]? MemberNameSuffixes { get; set; } public bool GenerateControlFlowVariants { get; set; } public MonoDetourTargetsAttribute(Type? targetType = null) { TargetType = targetType; IncludeNestedTypes = true; base..ctor(); } } } namespace BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace CanadianCuisine { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.github.MiiMii1205.CanadianCuisine", "CanadianCuisine", "1.6.1")] public class Plugin : BaseUnityPlugin { private static readonly DateTime December1St = new DateTime((DateTime.Now.Month == 1) ? (DateTime.Now.Year - 1) : DateTime.Now.Year, 12, 1); private static readonly DateTime January6St = new DateTime(((DateTime.Now.Month == 1) ? (DateTime.Now.Year - 1) : DateTime.Now.Year) + 1, 1, 6); public const string Id = "com.github.MiiMii1205.CanadianCuisine"; internal static ManualLogSource Log { get; private set; } = null; public static GameObject HighJumpEffectPrefab { get; private set; } = null; public static bool IsHoliday { get; private set; } = false; public static string Name => "CanadianCuisine"; public static string Version => "1.6.1"; private void FixColorblindMaterials(GameObject go) { ColorblindVariant componentInChildren = go.GetComponentInChildren(); Shader val = Shader.Find(((Object)componentInChildren.colorblindMaterial.shader).name); if ((Object)(object)val == (Object)null) { Log.LogWarning((object)(": Shader " + ((Object)componentInChildren.colorblindMaterial.shader).name + " was not found.")); } else { componentInChildren.colorblindMaterial.shader = val; } } private void OnDestroy() { DefaultMonoDetourManager.Instance.Dispose(); Harmony.UnpatchID("com.github.MiiMii1205.CanadianCuisine"); Log.LogInfo((object)("Plugin " + Name + " unloaded!")); } private void Awake() { //IL_0105: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; AddLocalizedTextCsv(); Log.LogInfo((object)("Plugin " + Name + " is loading...")); DateTime now = DateTime.Now; if (now > December1St && now < January6St) { IsHoliday = true; Log.LogInfo((object)$"Happy Holidays! The holiday season will end in {January6St - now:%d} days"); } else { IsHoliday = false; Log.LogInfo((object)$"Next holiday season will start in {December1St - now:%d} days."); } BundleLoader.LoadBundleWithName((BaseUnityPlugin)(object)this, "canadiansnacks.peakbundle", (Action)delegate(PeakBundle peakBundle) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Expected O, but got Unknown //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Expected O, but got Unknown //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Expected O, but got Unknown //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Expected O, but got Unknown //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Expected O, but got Unknown //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Expected O, but got Unknown //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0364: 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_0373: 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_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0388: 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_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Expected O, but got Unknown //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Expected O, but got Unknown //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03df: 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_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Expected O, but got Unknown //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) GameObject val5 = peakBundle.LoadAsset("HostCuttings.prefab"); ItemCooking val6 = val5.AddComponent(); val6.ignoreDefaultCookBehavior = true; AdditionalCookingBehavior[] obj = new AdditionalCookingBehavior[7] { new CookingBehaviourChangeFeedbackSfx { cookedAmountToTrigger = 1, soundEffectNameToChangeTo = "SFXI Heal Hunger Stamina" }, default(AdditionalCookingBehavior), default(AdditionalCookingBehavior), default(AdditionalCookingBehavior), default(AdditionalCookingBehavior), default(AdditionalCookingBehavior), default(AdditionalCookingBehavior) }; CookingBehavior_EnableScripts val7 = new CookingBehavior_EnableScripts(); ((AdditionalCookingBehavior)val7).cookedAmountToTrigger = 1; val7.scriptsToEnable = (MonoBehaviour[])(object)new MonoBehaviour[1] { (MonoBehaviour)val5.GetComponent() }; obj[1] = (AdditionalCookingBehavior)val7; obj[2] = new CookingBehaviourChangeFeedbackSfx { cookedAmountToTrigger = 3, soundEffectNameToChangeTo = "SFXI Heal Fortified Milk" }; val7 = new CookingBehavior_EnableScripts(); ((AdditionalCookingBehavior)val7).cookedAmountToTrigger = 3; val7.scriptsToEnable = (MonoBehaviour[])(object)new MonoBehaviour[1] { (MonoBehaviour)val5.GetComponent() }; obj[3] = (AdditionalCookingBehavior)val7; val7 = new CookingBehavior_EnableScripts(); ((AdditionalCookingBehavior)val7).cookedAmountToTrigger = 3; val7.scriptsToEnable = (MonoBehaviour[])(object)new MonoBehaviour[1] { (MonoBehaviour)val5.GetComponent() }; obj[4] = (AdditionalCookingBehavior)val7; obj[5] = new CookingBehaviourChangeFeedbackSfx { cookedAmountToTrigger = 4, soundEffectNameToChangeTo = "SFXI Heal Hunger Normal" }; CookingBehavior_DisableScripts val8 = new CookingBehavior_DisableScripts(); ((AdditionalCookingBehavior)val8).cookedAmountToTrigger = 4; val8.scriptsToDisable = (MonoBehaviour[])(object)new MonoBehaviour[2] { (MonoBehaviour)val5.GetComponent(), (MonoBehaviour)val5.GetComponent() }; obj[6] = (AdditionalCookingBehavior)val8; val6.additionalCookingBehaviors = (AdditionalCookingBehavior[])(object)obj; val5.AddComponent(); GameObject val9 = peakBundle.LoadAsset("PapinoCookies.prefab"); Action_ApplyAffliction val10 = val9.AddComponent(); ((ItemAction)val10).OnCastFinished = true; AfflictionWithConsequence affliction = new AfflictionWithConsequence { mainAffliction = (Affliction?)new Affliction_LowGravity { totalTime = 12f, warning = true, lowGravAmount = 3 }, delay = 1f, consequentAffliction = (Affliction?)(object)new AfflictionParalyzed { totalTime = 4f } }; val10.affliction = (Affliction)(object)affliction; val9.AddComponent(); ItemCooking orAddComponent = ExtGameObject.GetOrAddComponent(val9); AdditionalCookingBehavior[] additionalCookingBehaviors = orAddComponent.additionalCookingBehaviors; val8 = new CookingBehavior_DisableScripts(); val8.scriptsToDisable = (MonoBehaviour[])(object)new MonoBehaviour[1] { (MonoBehaviour)val10 }; ((AdditionalCookingBehavior)val8).cookedAmountToTrigger = 1; orAddComponent.additionalCookingBehaviors = CollectionExtensions.AddToArray(additionalCookingBehaviors, (AdditionalCookingBehavior)(object)val8); GameObject val11 = peakBundle.LoadAsset("SugarFudge.prefab"); val11.AddComponent(); ItemCooking orAddComponent2 = ExtGameObject.GetOrAddComponent(val11); Action_ApplyAffliction val12 = val11.AddComponent(); ((ItemAction)val12).OnCastFinished = true; val12.affliction = (Affliction)(object)new AfflictionWithConsequence { mainAffliction = (Affliction?)(object)new AfflictionHighJump { totalTime = 12f, highJumpMultiplier = 6f }, consequentAffliction = (Affliction?)new Affliction_AdjustDrowsyOverTime { totalTime = 10f, statusPerSecond = 0.0333f } }; Action_ApplyAffliction val13 = val11.AddComponent(); ((ItemAction)val13).OnCastFinished = true; val13.affliction = (Affliction)(object)new AfflictionHighJump { totalTime = 12f, highJumpMultiplier = 6f }; ((Behaviour)val13).enabled = false; AdditionalCookingBehavior[] additionalCookingBehaviors2 = orAddComponent2.additionalCookingBehaviors; val8 = new CookingBehavior_DisableScripts(); val8.scriptsToDisable = (MonoBehaviour[])(object)new MonoBehaviour[1] { (MonoBehaviour)val12 }; ((AdditionalCookingBehavior)val8).cookedAmountToTrigger = 1; AdditionalCookingBehavior[] array = CollectionExtensions.AddToArray(additionalCookingBehaviors2, (AdditionalCookingBehavior)(object)val8); val7 = new CookingBehavior_EnableScripts(); val7.scriptsToEnable = (MonoBehaviour[])(object)new MonoBehaviour[1] { (MonoBehaviour)val13 }; ((AdditionalCookingBehavior)val7).cookedAmountToTrigger = 1; orAddComponent2.additionalCookingBehaviors = CollectionExtensions.AddToArray(array, (AdditionalCookingBehavior)(object)val7); GameObject val14 = peakBundle.LoadAsset("Tourtiere.prefab"); val14.AddComponent(); Item val15 = default(Item); if (val14.TryGetComponent(ref val15)) { val15.carryWeight = 2; } if (IsHoliday) { LootData component = val14.GetComponent(); Rarity rarity = component.Rarity; component.spawnLocations = EnumFlagExtensions.AddFlag(EnumFlagExtensions.AddFlag(EnumFlagExtensions.AddFlag(EnumFlagExtensions.AddFlag(EnumFlagExtensions.AddFlag(component.spawnLocations, (SpawnPool)1024), (SpawnPool)2048), (SpawnPool)8192), (SpawnPool)16777216), (SpawnPool)67108864); component.rarityOverrides.Add(new ItemRarityOverride { Rarity = (Rarity)(rarity - 1), spawnPool = (SpawnPool)4096 }); LootData component2 = val11.GetComponent(); Rarity rarity2 = component2.Rarity; component2.rarityOverrides = new List(2) { new ItemRarityOverride { Rarity = (Rarity)(rarity2 - 2), spawnPool = (SpawnPool)4096 }, new ItemRarityOverride { Rarity = (Rarity)(rarity2 - 1), spawnPool = (SpawnPool)16777216 } }; component2.Rarity = (Rarity)(rarity2 - 1); } GameObject val16 = peakBundle.LoadAsset("Paw Cakes.prefab"); val16.AddComponent(); GameObject val17 = peakBundle.LoadAsset("MapleCookies.prefab"); val17.AddComponent(); GameObject val18 = peakBundle.LoadAsset("Airplane Poutine.prefab"); val18.AddComponent(); GameObject val19 = peakBundle.LoadAsset("SpruceBeer.prefab"); val19.AddComponent(); ItemCooking orAddComponent3 = ExtGameObject.GetOrAddComponent(val19); ActionSpawnOnFirstUse orAddComponent4 = ExtGameObject.GetOrAddComponent(val19); Action_Spawn component3 = val19.GetComponent(); ((Action_Spawn)orAddComponent4).objectToSpawn = component3.objectToSpawn; ((ItemAction)orAddComponent4).OnCastFinished = true; ((Behaviour)component3).enabled = false; ((Behaviour)orAddComponent4).enabled = false; Object.Destroy((Object)(object)component3); AdditionalCookingBehavior[] additionalCookingBehaviors3 = orAddComponent3.additionalCookingBehaviors; val7 = new CookingBehavior_EnableScripts(); ((AdditionalCookingBehavior)val7).cookedAmountToTrigger = 1; val7.scriptsToEnable = (MonoBehaviour[])(object)new MonoBehaviour[1] { (MonoBehaviour)orAddComponent4 }; orAddComponent3.additionalCookingBehaviors = CollectionExtensions.AddToArray(additionalCookingBehaviors3, (AdditionalCookingBehavior)(object)val7); peakBundle.Mod.RegisterContent(); HighJumpEffectPrefab = peakBundle.LoadAsset("VFX_Screen_HighJump.prefab"); Log.LogInfo((object)"Snacks items are loaded!"); }); BundleLoader.LoadBundleWithName((BaseUnityPlugin)(object)this, "canadianfruits.peakbundle", (Action)delegate(PeakBundle peakBundle) { Shader val = Shader.Find("GD/FoliageGD"); if ((Object)(object)val == (Object)null) { Log.LogWarning((object)": Shader GD/FoliageGD was not found."); } else { List list = new List { peakBundle.LoadAsset("Bub Berry Blue.prefab"), peakBundle.LoadAsset("Bub Berry Purple.prefab"), peakBundle.LoadAsset("Bub Berry White.prefab") }; foreach (GameObject item in list) { FixColorblindMaterials(item); item.AddComponent(); Renderer[] componentsInChildren = item.GetComponentsInChildren(); foreach (Renderer val2 in componentsInChildren) { Material[] sharedMaterials = val2.sharedMaterials; foreach (Material val3 in sharedMaterials) { if (!(((Object)val3.shader).name != ((Object)val).name)) { val3.shader = val; val3.EnableKeyword("_ALPHATEST_ON"); val3.EnableKeyword("_TRIPLANAR1_TOPDOWN"); val3.EnableKeyword("_TRIPLANAR2_TRIPLANAR"); val3.EnableKeyword("_TRIPLANAR3_UV"); val3.EnableKeyword("_USESIMPLEMASK_ON"); } } Material[] materials = val2.materials; foreach (Material val4 in materials) { if (!(((Object)val4.shader).name != ((Object)val).name)) { val4.shader = val; val4.EnableKeyword("_ALPHATEST_ON"); val4.EnableKeyword("_TRIPLANAR1_TOPDOWN"); val4.EnableKeyword("_TRIPLANAR2_TRIPLANAR"); val4.EnableKeyword("_TRIPLANAR3_UV"); val4.EnableKeyword("_USESIMPLEMASK_ON"); } } } } } peakBundle.Mod.RegisterContent(); Log.LogInfo((object)"Fruits items are loaded!"); }); LoadAllCustomAfflictions(); MonoDetourManager.InvokeHookInitializers(typeof(Plugin).Assembly); new Harmony("com.github.MiiMii1205.CanadianCuisine").PatchAll(typeof(CuisineCharacterPatcher)); Log.LogInfo((object)("Plugin " + Name + " is loaded!")); } private void LoadAllCustomAfflictions() { ModDefinition orCreate = ModDefinition.GetOrCreate(((BaseUnityPlugin)this).Info); CuisineAfflictionManager.RegisterAfflictions(new AfflictionDefinition { Name = CuisineAfflictionValues.HIGH_JUMP_NAME }, orCreate); CuisineAfflictionManager.RegisterAfflictions(new AfflictionDefinition { Name = CuisineAfflictionValues.WITH_CONSEQUENCE }, orCreate); CuisineAfflictionManager.RegisterAfflictions(new AfflictionDefinition { Name = CuisineAfflictionValues.PARALYZED }, orCreate); } private void AddLocalizedTextCsv() { using StreamReader streamReader = new StreamReader(Path.Join((ReadOnlySpan)Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), (ReadOnlySpan)"CanadianCuisineLocalizedText.csv")); int num = 0; while (!streamReader.EndOfStream) { string text = streamReader.ReadLine(); if (text == null) { break; } num++; List list = new List(CSVReader.SplitCsvLine(text, true)); string text2 = ExtCollections.Deque(list); string text3 = ExtCollections.Pop(list); if (text3 != "ENDLINE") { Log.LogError((object)$"Invalid localization at line {num}"); } if (text2 != "CURRENT_LANGUAGE") { LocalizedText.mainTable[text2] = list; Log.LogDebug((object)("Added localization of " + text2)); } } Log.LogDebug((object)$"Added {num - 1} localizations"); } } } namespace CanadianCuisine.Patchers { public class CuisineCharacterPatcher { [HarmonyPatch(typeof(CharacterAfflictions), "Awake")] [HarmonyPostfix] public static void AfflictionAwakePostfix(CharacterAfflictions __instance) { CuisineCharacterAfflictions orAddComponent = ExtGameObject.GetOrAddComponent(((Component)__instance.character).gameObject); if ((Object)(object)orAddComponent == (Object)null) { Plugin.Log.LogError((object)("Can't add CuisineCharacterAfflictions to " + __instance.character.characterName)); } } [HarmonyPatch(typeof(GUIManager), "Awake")] [HarmonyPostfix] public static void GUIAwakePostfix(GUIManager __instance) { //IL_0063: 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_008f: Unknown result type (might be due to invalid IL or missing references) CuisineGUIManager orAddComponent = ExtGameObject.GetOrAddComponent(((Component)__instance).gameObject); Transform transform = ((Component)__instance.poisonSVFX).transform; if ((Object)(object)orAddComponent == (Object)null) { Plugin.Log.LogError((object)("Can't add CuisineGUIManager to " + __instance.character.characterName + "'s GUI")); return; } GameObject val = Object.Instantiate(Plugin.HighJumpEffectPrefab, transform.parent); ((Component)val.transform).transform.localPosition = transform.localPosition; ((Component)val.transform).transform.localRotation = transform.localRotation; ((Component)val.transform).transform.localScale = transform.localScale; orAddComponent.highJumpSvfx = val.GetComponent(); val.SetActive(false); } [HarmonyPatch(typeof(CharacterMovement), "CheckForPalJump")] [HarmonyPrefix] public static void CheckForPalJumpPrefix(CharacterMovement __instance, Character c, ref bool __runOriginal) { CuisineCharacterAfflictions component = ((Component)c).GetComponent(); if (component == null || !component.HasHighJump) { __runOriginal = true; return; } __runOriginal = false; Plugin.Log.LogInfo((object)("High Jump boost given to " + __instance.character.characterName + " by " + c.characterName)); if (__instance.character.data.sinceStandOnPlayer < 0.3f && c.data.sinceJump < 0.3f) { __instance.character.data.lastStoodOnPlayer = null; if (__instance.character.refs.view.IsMine) { __instance.character.refs.view.RPC("HighJumpRpc", (RpcTarget)0, new object[2] { true, c.refs.movement.jumpImpulse }); } } } [HarmonyPatch(typeof(CharacterClimbing), "RPCA_ClimbJump")] [HarmonyPrefix] public static void RPCA_ClimbJumpPrefix(CharacterClimbing __instance, ref bool __runOriginal) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) CuisineCharacterAfflictions component = ((Component)__instance).GetComponent(); if (component == null || !component.HasHighJump) { __runOriginal = true; return; } __runOriginal = false; Plugin.Log.LogInfo((object)(__instance.character.characterName + " lunged while in high jump.")); __instance.character.data.sinceClimbJump = 0f; __instance.character.UseStamina(0.2f, true); __instance.playerSlide += ((Vector2)(ref __instance.character.input.movementInput)).normalized * (8f * (component.highJumpMultiplier / 4f)); if (__instance.view.IsMine && !__instance.character.isBot) { GamefeelHandler.instance.AddPerlinShake(10f, 0.5f, 10f); GUIManager.instance.ClimbJump(); } } } } namespace CanadianCuisine.Patchers.Hooks { [MonoDetourTargets(typeof(Affliction))] internal static class AfflictionHooks { [MonoDetourHookInitialize] private static void Init() { CreateBlankAffliction.Postfix(Postfix_BlankAffliction); } private static void Postfix_BlankAffliction(ref AfflictionType afflictionType, ref Affliction returnValue) { if (returnValue == null) { AfflictionDefinition afflictionDefinition = CuisineAfflictionManager.StatusByType(afflictionType); Plugin.Log.LogInfo((object)("Found affliction type " + afflictionDefinition.Name)); if (afflictionDefinition.Name == CuisineAfflictionValues.HIGH_JUMP_NAME) { returnValue = (Affliction)(object)new AfflictionHighJump(); } else if (afflictionDefinition.Name == CuisineAfflictionValues.WITH_CONSEQUENCE) { returnValue = (Affliction)(object)new AfflictionWithConsequence(); } else if (afflictionDefinition.Name == CuisineAfflictionValues.PARALYZED) { returnValue = (Affliction)(object)new AfflictionParalyzed(); } } } } [MonoDetourTargets(typeof(ItemCooking))] public class CookingHooks { [MonoDetourHookInitialize] private static void Init() { UpdateCookedBehavior.Prefix(Prefix_UpdateCookedBehavior); } private static void Prefix_UpdateCookedBehavior(ItemCooking self) { CookingHungerController cookingHungerController = default(CookingHungerController); if (!((Component)((ItemComponent)self).item).TryGetComponent(ref cookingHungerController)) { return; } IntItemData data = ((ItemComponent)self).item.GetData((DataEntryKey)1); if (data.Value == 0) { data.Value += self.preCooked; } int num = data.Value - self.timesCookedLocal; if (num > 0) { for (int i = 1 + self.timesCookedLocal; i <= data.Value; i++) { cookingHungerController.UpdateCookingHunger(i); } } } } } namespace CanadianCuisine.Data { public class AfflictionDefinition { internal int index; public string Name { get; set; } = ""; public AfflictionType Type => (AfflictionType)index; } public static class CuisineAfflictionManager { private static SortedList registered = new SortedList(); public static IList Afflictions => registered.Values; public static int length => registered.Count; internal static void RegisterAfflictions(AfflictionDefinition affliction, ModDefinition owner) { string text = owner.Id + "->" + affliction.Name; if (!registered.TryAdd(text, affliction)) { throw new ArgumentException("Affliction with name " + text + " already registered. Choose a unique name."); } ReIndex(); } internal static AfflictionDefinition StatusByType(AfflictionType type) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return registered.FirstOrDefault>((KeyValuePair x) => x.Value.Type == type).Value; } internal static AfflictionType TypeByName(string name) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) string name2 = name; return registered.FirstOrDefault>((KeyValuePair x) => x.Value.Name == name2).Value.Type; } private static void ReIndex() { List list = Enum.GetValues(typeof(AfflictionType)).OfType().ToList(); List list2 = registered.Values.ToList(); int i = 0; int num = 0; for (; i < list.Count + list2.Count; i++) { if (num >= list2.Count) { break; } if (!Enum.IsDefined(typeof(AfflictionType), i)) { list2[num].index = i; num++; } } } } public static class CuisineAfflictionValues { public static readonly string PARALYZED = "Paralyzed"; public static readonly string HIGH_JUMP_NAME = "HighJump"; public static readonly string WITH_CONSEQUENCE = "WithConsequences"; } } namespace CanadianCuisine.Behaviours { public class ActionSpawnOnFirstUse : Action_Spawn { public override void RunAction() { OptionableIntItemData data = ((ItemActionBase)this).item.GetData((DataEntryKey)2); if (!data.HasData || data.Value == ((ItemActionBase)this).item.totalUses - 1) { ((Action_Spawn)this).RunAction(); } } } public class CookingHungerController : MonoBehaviour { public Item item; public Action_RestoreHunger restoreHunger; private void Awake() { item = ThrowHelper.ThrowIfArgumentNull(((Component)this).GetComponent(), "GetComponent()"); restoreHunger = ThrowHelper.ThrowIfArgumentNull(((Component)this).GetComponent(), "GetComponent()"); } public void UpdateCookingHunger(int totalCooked) { if (Object.op_Implicit((Object)(object)restoreHunger)) { if (totalCooked < 2) { Action_RestoreHunger obj = restoreHunger; obj.restorationAmount *= 2f; } else if (totalCooked > 2) { restoreHunger.restorationAmount = Mathf.Max(restoreHunger.restorationAmount - 0.05f, 0f); } } } } public class CuisineCharacterAfflictions : MonoBehaviourPunCallbacks { private Character m_character; private bool m_hasHighJump; private float m_originalJumpImpulse; public float highJumpMultiplier = 2f; private CharacterMovement m_characterMovement; public bool HasHighJump => m_hasHighJump; private void Awake() { m_character = ((Component)this).GetComponent(); m_characterMovement = ((Component)m_character).GetComponent(); m_originalJumpImpulse = m_characterMovement.jumpImpulse; } public void RecalculateHighJump() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) m_hasHighJump = false; Affliction val = default(Affliction); if (m_character.refs.afflictions.HasAfflictionType(CuisineAfflictionManager.TypeByName(CuisineAfflictionValues.HIGH_JUMP_NAME), ref val) && val is AfflictionHighJump afflictionHighJump) { m_hasHighJump = true; highJumpMultiplier = afflictionHighJump.highJumpMultiplier; } m_characterMovement.jumpImpulse = (m_hasHighJump ? (m_originalJumpImpulse * highJumpMultiplier) : m_originalJumpImpulse); } [PunRPC] public void HighJumpRpc(bool isPalJump, float jumpImpulse) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) float staminaCostMult = 1f; float jumpMult = 1f; Vector3 jumpDir = Vector3.up; if (isPalJump) { staminaCostMult = 0f; jumpMult = 2f; m_character.data.sincePalJump = 0f; jumpDir += m_character.data.lookDirection_Flat * 0.25f; SFX_Instance[] boostPlayer = m_characterMovement.boostPlayer; foreach (SFX_Instance val in boostPlayer) { val.Play(m_character.Center); } } CharacterData data = m_character.data; data.jumpsRemaining--; m_character.data.isCrouching = false; m_character.data.chargingJump = true; m_character.OnStartJump(); ((MonoBehaviour)this).StartCoroutine(IDoJump()); IEnumerator IDoJump() { _ = jumpImpulse; if (!m_character.OutOfStamina()) { m_character.refs.afflictions.SubtractStatus((STATUSTYPE)11, 0.05f, true, false); } float c = 0f; while (c < 0.1f) { m_character.data.sinceGrounded = 0f; m_character.data.sinceJump = 0f; c += Time.deltaTime; yield return null; } m_character.OnJump(); m_character.data.chargingJump = false; m_character.data.isJumping = true; bool flag = m_character.GetTotalStamina() > m_characterMovement.jumpStaminaUsageSprinting && m_character.input.sprintIsPressed; m_character.data.sprintJump = flag; m_character.UseStamina((flag ? m_characterMovement.jumpStaminaUsageSprinting : m_characterMovement.jumpStaminaUsage) * staminaCostMult, flag); foreach (Bodypart part in m_character.refs.ragdoll.partList) { part.AddForce(jumpDir * (jumpImpulse * jumpMult * m_characterMovement.balloonJumpMultiplier), (ForceMode)5); } } } } public class CuisineGUIManager : MonoBehaviour { public ScreenVFX highJumpSvfx; public static CuisineGUIManager instance; private void Awake() { instance = this; } public void StartHighJump() { highJumpSvfx.StartFX(0.15f); } public void EndHighJump() { highJumpSvfx.EndFX(); } } public class MapleToffeeVariantController : MonoBehaviour { private void Start() { Transform transform = ((Component)this).transform; int num = Random.Range(0, transform.childCount); MeshRenderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(); MeshRenderer[] array = componentsInChildren; foreach (MeshRenderer val in array) { ((Component)val).gameObject.SetActive(false); } ((Component)transform.GetChild(num)).gameObject.SetActive(true); } } } namespace CanadianCuisine.Behaviours.CookingBehaviours { public class CookingBehaviourChangeFeedbackSfx : AdditionalCookingBehavior { public string soundEffectNameToChangeTo = ""; public CookingBehaviourChangeFeedbackSfx() { if (soundEffectNameToChangeTo == "") { Plugin.Log.LogWarning((object)"Cooking Behaviour will try to change to an empty sound effect name."); } } public override void TriggerBehaviour(int cookedAmount) { ItemUseFeedback[] components = ((Component)((ItemComponent)base.itemCooking).item).gameObject.GetComponents(); ItemUseFeedback useFeedback = ((ItemComponent)base.itemCooking).item._useFeedback; ItemUseFeedback val = null; ItemUseFeedback[] array = components; foreach (ItemUseFeedback val2 in array) { if ((Object)(object)val2 != (Object)(object)useFeedback && ((Object)val2.sfxUsed).name == soundEffectNameToChangeTo) { val = val2; } } if ((Object)(object)val != (Object)null && (Object)(object)useFeedback != (Object)null) { useFeedback.sfxUsed = val.sfxUsed; Plugin.Log.LogDebug((object)("Changed Feedback SFX to \"" + soundEffectNameToChangeTo + "\"")); } } } } namespace CanadianCuisine.Behaviours.Afflictions { public class AfflictionHighJump : Affliction { public float highJumpMultiplier = 2f; private CuisineCharacterAfflictions? m_cuisineAfflictionCharacter; private Color m_jumpy = new Color(0.48599997f, 0.73300004f, 0.59599996f, 0.125f); public override void UpdateEffectNetworked() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) base.character.refs.customization.PulseStatus(m_jumpy, m_jumpy.a); } public AfflictionHighJump(float totalTime, float highJumpMultiplier) : base(totalTime) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) this.highJumpMultiplier = highJumpMultiplier; } public AfflictionHighJump(float totalTime) : base(totalTime) { }//IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) public AfflictionHighJump() { }//IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) public override AfflictionType GetAfflictionType() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return CuisineAfflictionManager.TypeByName(CuisineAfflictionValues.HIGH_JUMP_NAME); } public override void Stack(Affliction incomingAffliction) { base.totalTime = incomingAffliction.totalTime; if (incomingAffliction is AfflictionHighJump afflictionHighJump) { highJumpMultiplier = Mathf.Max(highJumpMultiplier, afflictionHighJump.highJumpMultiplier); } base.timeElapsed = 0f; if (m_cuisineAfflictionCharacter == null) { m_cuisineAfflictionCharacter = ((Component)base.character).GetComponent(); } m_cuisineAfflictionCharacter.RecalculateHighJump(); } public override void Serialize(BinarySerializer serializer) { serializer.WriteFloat(base.totalTime); serializer.WriteFloat(highJumpMultiplier); } public override void Deserialize(BinaryDeserializer serializer) { base.totalTime = serializer.ReadFloat(); highJumpMultiplier = serializer.ReadFloat(); } public override void OnApplied() { if (m_cuisineAfflictionCharacter == null) { m_cuisineAfflictionCharacter = ((Component)base.character).GetComponent(); } m_cuisineAfflictionCharacter.RecalculateHighJump(); if (base.character.IsLocal) { CuisineGUIManager.instance.StartHighJump(); } } public override void OnRemoved() { m_cuisineAfflictionCharacter?.RecalculateHighJump(); if (base.character.IsLocal) { CuisineGUIManager.instance.EndHighJump(); } } } public class AfflictionParalyzed : Affliction { public override AfflictionType GetAfflictionType() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return CuisineAfflictionManager.TypeByName(CuisineAfflictionValues.PARALYZED); } public override void Stack(Affliction incomingAffliction) { } public override void Serialize(BinarySerializer serializer) { serializer.WriteFloat(base.totalTime); } public override void Deserialize(BinaryDeserializer serializer) { base.totalTime = serializer.ReadFloat(); } public override void OnApplied() { base.character.Fall(base.totalTime, 0f); } } public class AfflictionWithConsequence : Affliction { [SerializeReference] public Affliction? mainAffliction; [SerializeReference] public Affliction? consequentAffliction; public float delay; public AfflictionWithConsequence(float totalTime) : base(totalTime) { } public AfflictionWithConsequence() { } public override AfflictionType GetAfflictionType() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return CuisineAfflictionManager.TypeByName(CuisineAfflictionValues.WITH_CONSEQUENCE); } public override void Stack(Affliction incomingAffliction) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if (incomingAffliction is AfflictionWithConsequence afflictionWithConsequence && afflictionWithConsequence.mainAffliction != null && mainAffliction != null && afflictionWithConsequence.mainAffliction.GetAfflictionType() == mainAffliction.GetAfflictionType()) { base.totalTime = ((Affliction)afflictionWithConsequence).totalTime; base.timeElapsed = 0f; if (afflictionWithConsequence.consequentAffliction != null && consequentAffliction != null && afflictionWithConsequence.consequentAffliction.GetAfflictionType() == consequentAffliction.GetAfflictionType()) { Affliction? obj = consequentAffliction; obj.totalTime += afflictionWithConsequence.consequentAffliction.totalTime; } } } public override void Serialize(BinarySerializer serializer) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected I4, but got O //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected I4, but got O //IL_002e->IL002e: Incompatible stack types: O vs I4 //IL_0029->IL002e: Incompatible stack types: I4 vs O //IL_0029->IL002e: Incompatible stack types: O vs I4 //IL_0055->IL0055: Incompatible stack types: O vs I4 //IL_0050->IL0055: Incompatible stack types: I4 vs O //IL_0050->IL0055: Incompatible stack types: O vs I4 serializer.WriteFloat(delay); serializer.WriteBool(mainAffliction != null); object obj = serializer; Affliction? obj2 = mainAffliction; int num; if (obj2 != null) { obj = obj2.GetAfflictionType(); num = (int)obj; } else { num = -1; obj = num; num = (int)obj; } ((BinarySerializer)num).WriteInt((int)obj); serializer.WriteBool(consequentAffliction != null); object obj3 = serializer; Affliction? obj4 = consequentAffliction; int num2; if (obj4 != null) { obj3 = obj4.GetAfflictionType(); num2 = (int)obj3; } else { num2 = -1; obj3 = num2; num2 = (int)obj3; } ((BinarySerializer)num2).WriteInt((int)obj3); Affliction? obj5 = mainAffliction; if (obj5 != null) { obj5.Serialize(serializer); } Affliction? obj6 = consequentAffliction; if (obj6 != null) { obj6.Serialize(serializer); } } public override bool Tick() { if (mainAffliction != null && (Object)(object)mainAffliction.character != (Object)null) { base.timeElapsed = Mathf.Max(mainAffliction.timeElapsed, base.timeElapsed); return (double)mainAffliction.timeElapsed >= (double)mainAffliction.totalTime; } return ((Affliction)this).Tick(); } public override void Deserialize(BinaryDeserializer serializer) { delay = serializer.ReadFloat(); bool flag = serializer.ReadBool(); int num = serializer.ReadInt(); bool flag2 = serializer.ReadBool(); int num2 = serializer.ReadInt(); if (flag) { mainAffliction = Affliction.CreateBlankAffliction((AfflictionType)num); mainAffliction.Deserialize(serializer); } if (flag2) { consequentAffliction = Affliction.CreateBlankAffliction((AfflictionType)num2); consequentAffliction.Deserialize(serializer); } base.totalTime = delay + (mainAffliction?.totalTime ?? 0f); } public override void OnApplied() { if (base.character.IsLocal) { base.character.refs.afflictions.AddAffliction(mainAffliction, false); } } public override void OnRemoved() { if (base.character.IsLocal) { base.character.refs.afflictions.AddAffliction(consequentAffliction, false); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }