Decompiled source of DealersAintSnitchez v1.0.0

DealersAintSnitchez.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using DealersAintSnitchez;
using HarmonyLib;
using MelonLoader;
using Microsoft.CodeAnalysis;
using ScheduleOne.Economy;
using ScheduleOne.NPCs;
using ScheduleOne.NPCs.Responses;
using ScheduleOne.PlayerScripts;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Core), "DealersAintSnitchez", "1.0.0", "Stehlel", null)]
[assembly: MelonGame("TVGS", "Schedule I")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("DealersAintSnitchez")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+1b0c852c6506e745eabf793bc2a2a2d7593cab2e")]
[assembly: AssemblyProduct("DealersAintSnitchez")]
[assembly: AssemblyTitle("DealersAintSnitchez")]
[assembly: NeutralResourcesLanguage("en-US")]
[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 DealersAintSnitchez
{
	public class Core : MelonMod
	{
		[HarmonyPatch(typeof(NPCResponses_Civilian))]
		[HarmonyPatch("GetThreatResponse", new Type[]
		{
			typeof(EThreatType),
			typeof(Player)
		})]
		public static class Patch_GetThreatResponse_None
		{
			private static bool Prefix(NPCResponses_Civilian __instance, EThreatType type, Player threatSource, ref EAttackResponse __result)
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0025: Expected O, but got Unknown
				PropertyInfo property = typeof(NPCResponses).GetProperty("npc", BindingFlags.Instance | BindingFlags.NonPublic);
				NPC val = (NPC)property.GetValue(__instance);
				Dealer val2 = (Dealer)(object)((val is Dealer) ? val : null);
				if (val2 != null && val2.IsRecruited)
				{
					MelonLogger.Msg("Suppressed ThreatResponse of " + val.FirstName + " (" + ((object)(EThreatType)(ref type)).ToString() + ")");
					__result = (EAttackResponse)0;
					return false;
				}
				return true;
			}
		}

		public override void OnInitializeMelon()
		{
			((MelonBase)this).LoggerInstance.Msg("Initialized.");
		}
	}
}