Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of TonyPizzaScrap v0.5.0
TonyPizzaScrapV73-2.dll
Decompiled 2 weeks agousing System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; [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.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("TonyPizzaScrapV73-2")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("TonyPizzaScrapV73-2")] [assembly: AssemblyTitle("TonyPizzaScrapV73-2")] [assembly: AssemblyVersion("1.0.0.0")] 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; } } } public class BingusScrapBehaviour : NetworkBehaviour { public AudioClip[] voiceClips; private AudioSource audioSource; private GrabbableObject grabbable; private void Awake() { audioSource = ((Component)this).GetComponent<AudioSource>() ?? ((Component)this).gameObject.AddComponent<AudioSource>(); audioSource.spatialBlend = 1f; grabbable = ((Component)this).GetComponent<GrabbableObject>(); } private void Update() { if (((NetworkBehaviour)this).IsOwner && !((Object)(object)grabbable == (Object)null) && grabbable.isHeld && Mouse.current.leftButton.wasPressedThisFrame && voiceClips != null && voiceClips.Length != 0) { int clipIndex = Random.Range(0, voiceClips.Length); PlayVoiceServerRpc(clipIndex); } } [ServerRpc] private void PlayVoiceServerRpc(int clipIndex) { PlayVoiceClientRpc(clipIndex); } [ClientRpc] private void PlayVoiceClientRpc(int clipIndex) { if (voiceClips != null && clipIndex >= 0 && clipIndex < voiceClips.Length) { audioSource.PlayOneShot(voiceClips[clipIndex]); } } } namespace TonyPizzaScrap { [BepInPlugin("TonyPizza.TonyPizzaScrap", "TonyPizzaScrap", "0.0.2")] public class Plugin : BaseUnityPlugin { private const string GUID = "TonyPizza.TonyPizzaScrap"; private const string NAME = "TonyPizzaScrap"; private const string VERSION = "0.0.2"; public static Plugin instance; private void Awake() { instance = this; string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "tonypizzascrap2"); AssetBundle val = AssetBundle.LoadFromFile(text); if ((Object)(object)val == (Object)null) { ((BaseUnityPlugin)this).Logger.LogError((object)("Failed to load asset bundle at " + text)); return; } string[] array = new string[64] { "Assets/CustomScrap/Lays Stax/LaysStaxItem.asset", "Assets/CustomScrap/AsukaPlush/AsukaPlushie.asset", "Assets/CustomScrap/AigisToaster/AigisToasterExport.asset", "Assets/CustomScrap/LegoVaderPen/DarthvaderPen/VaderPen.asset", "Assets/CustomScrap/DarkstalkersSegaSaturn/DarkstalkersSegaSatun.asset", "Assets/CustomScrap/XenosagaFreaks/XenosagaFreaksExport.asset", "Assets/CustomScrap/MvC2 Dreamcast/MvC2DCExport.asset", "Assets/CustomScrap/Click/ClickScrap.asset", "Assets/CustomScrap/Infinity Eggs/Infinity Eggs/InfinityEggScript.asset", "Assets/CustomScrap/PizzaBox/PizzaBoxItem.asset", "Assets/CustomScrap/Bingus/bingusscrap.asset", "Assets/CustomScrap/MvC2 Arcade/MvC2Arcade.asset", "Assets/CustomScrap/Teddie Scrap/Bear Suit/TeddieScrapExport.asset", "Assets/CustomScrap/Pac-Man/PacManItem.asset", "Assets/CustomScrap/BaconEggCheese/BaconEggCheeseExport.asset", "Assets/CustomScrap/WaddleDee/WaddleDeeExport.asset", "Assets/CustomScrap/Pizza Slice/Pizza Slice/PizzaSliceExport.asset", "Assets/CustomScrap/MouseTrap/MouseTrapExport.asset", "Assets/CustomScrap/Pringles/PringlesItem.asset", "Assets/CustomScrap/XC2 Game/XC2Export.asset", "Assets/CustomScrap/SF6/SF6.asset", "Assets/CustomScrap/Jeep 1/JeepScrap.asset", "Assets/CustomScrap/Metal Bingus/MetalBingus.asset", "Assets/CustomScrap/PomPon/PomPonScrap.asset", "Assets/CustomScrap/CookieCutter/CookieCutter.asset", "Assets/CustomScrap/PaperBag/PaperBag.asset", "Assets/CustomScrap/FrootLoops/FrootLoopsBars.asset", "Assets/CustomScrap/CookieCutter/MagicCookieCutter.asset", "Assets/CustomScrap/CookieCutter/FatefulCookieCutter.asset", "Assets/CustomScrap/0-KirbyAirRide/Bulk Star/BulkStar.asset", "Assets/CustomScrap/0-KirbyAirRide/Compact Star/CompactStar.asset", "Assets/CustomScrap/0-KirbyAirRide/Dragoon/Dragoon.asset", "Assets/CustomScrap/0-KirbyAirRide/Flight Warp Star/FlightWarpstar.asset", "Assets/CustomScrap/0-KirbyAirRide/Warp Star/WarpStar.asset", "Assets/CustomScrap/0-KirbyAirRide/Rex Wheelie/RexWheelie.asset", "Assets/CustomScrap/0-KirbyAirRide/Shadow Star/ShadowStar.asset", "Assets/CustomScrap/0-KirbyAirRide/Turbo Star/TurboStar.asset", "Assets/CustomScrap/0-KirbyAirRide/Jet Star/JetStar.asset", "Assets/CustomScrap/0-KirbyAirRide/Winged Star/WingedStar.asset", "Assets/CustomScrap/0-KirbyAirRide/Formula Star/FormulaStar.asset", "Assets/CustomScrap/0-KirbyAirRide/Wagon Star/WagonStar.asset", "Assets/CustomScrap/0-KirbyAirRide/Hydra/Hydra.asset", "Assets/CustomScrap/0-KirbyAirRide/Slick Star/SlickStar.asset", "Assets/CustomScrap/0-KirbyAirRide/Swerve Star/SwerveStar.asset", "Assets/CustomScrap/0-KirbyAirRide/Wheelie Bike/WheelieBike.asset", "Assets/CustomScrap/0-KirbyAirRide/Wheelie Scooter/WheelieScooter.asset", "Assets/CustomScrap/0-KirbyAirRide/Rocket Star/RocketStar.asset", "Assets/CustomScrap/0-MisfitToys/Toy Soldier/TinSoldier.asset", "Assets/CustomScrap/0-MisfitToys/Scooter/ScooterForJimmy.asset", "Assets/CustomScrap/0-MisfitToys/Elephant/SpottedElephant.asset", "Assets/CustomScrap/0-MisfitToys/Dolly/DollyForSue.asset", "Assets/CustomScrap/0-MisfitToys/Charlie/Charlie.asset", "Assets/CustomScrap/0-MisfitToys/Airplane/Airplane.asset", "Assets/CustomScrap/0-MisfitToys/Boat/Boat.asset", "Assets/CustomScrap/0-MisfitToys/Cowboy/Cowboy.asset", "Assets/CustomScrap/Bug Two/BugTwoScrap.asset", "Assets/CustomScrap/Bug/BugItem.asset", "Assets/CustomScrap/Keyblade/Keyblade.asset", "Assets/CustomScrap/Giant Pringles/GiantPringlesItem.asset", "Assets/CustomScrap/CrashTeamRacing/CTR.asset", "Assets/CustomScrap/TrailMix/TrailMix.asset", "Assets/CustomScrap/MarioKart8/MarioKart8.asset", "Assets/CustomScrap/SonicRacingCrossworlds/SonicRacingCrossworlds.asset", "Assets/CustomScrap/N64 Controller/N64ControllerItem.asset" }; string[] array2 = array; foreach (string text2 in array2) { Item val2 = val.LoadAsset<Item>(text2); if ((Object)(object)val2 == (Object)null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Failed to load Item at " + text2)); continue; } string text3 = val2.itemName.Replace(" ", "_"); int value = ((BaseUnityPlugin)this).Config.Bind<int>(text3, "Rarity", 35, "Rarity of " + val2.itemName + " (higher = spawns more often)").Value; int num = ((BaseUnityPlugin)this).Config.Bind<int>(text3, "MinValue", val2.minValue, "Minimum scrap value of " + val2.itemName).Value; int value2 = ((BaseUnityPlugin)this).Config.Bind<int>(text3, "MaxValue", val2.maxValue, "Maximum scrap value of " + val2.itemName).Value; if (num > value2) { ((BaseUnityPlugin)this).Logger.LogWarning((object)$"{val2.itemName}: MinValue {num} > MaxValue {value2}, adjusting."); num = value2; } val2.minValue = num; val2.maxValue = value2; if (val2.itemName.Equals("BingBongScrapItem", StringComparison.OrdinalIgnoreCase)) { GameObject spawnPrefab = val2.spawnPrefab; AudioSource val3 = spawnPrefab.GetComponent<AudioSource>() ?? spawnPrefab.AddComponent<AudioSource>(); val3.spatialBlend = 1f; BingusScrapBehaviour bingusScrapBehaviour = spawnPrefab.GetComponent<BingusScrapBehaviour>() ?? spawnPrefab.AddComponent<BingusScrapBehaviour>(); AudioClip[] array3 = (AudioClip[])(object)new AudioClip[26]; for (int j = 0; j < 26; j++) { string text4 = "Assets/CustomScrap/Bingus/AudioOGG/AudioClip/bb" + (j + 1).ToString("D2") + ".wav"; array3[j] = val.LoadAsset<AudioClip>(text4); if ((Object)(object)array3[j] == (Object)null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Failed to load clip at " + text4)); } else { ((BaseUnityPlugin)this).Logger.LogInfo((object)("Loaded clip: " + ((Object)array3[j]).name)); } } bingusScrapBehaviour.voiceClips = array3; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Bing Bong has a voice!"); } NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab); Utilities.FixMixerGroups(val2.spawnPrefab); Items.RegisterScrap(val2, value, (LevelTypes)(-1)); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"Registered scrap: {val2.itemName} (rarity {value}, value {num}-{value2})"); } } } }