Decompiled source of ForbiddenHealPotion v1.0.0

ForbiddenHealPotion.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using UnityEngine;
using UnityEngine.Events;

[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: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("BitZer0")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ForbiddenHealPotion")]
[assembly: AssemblyTitle("ForbiddenHealPotion")]
[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.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 ForbiddenHealPotion
{
	[HarmonyPatch(typeof(PlayerController))]
	internal static class ExamplePlayerControllerPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("Start")]
		private static void Start_Prefix(PlayerController __instance)
		{
			ForbiddenHealPotion.Logger.LogDebug((object)$"{__instance} Start Prefix");
		}

		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void Start_Postfix(PlayerController __instance)
		{
			ForbiddenHealPotion.Logger.LogDebug((object)$"{__instance} Start Postfix");
		}
	}
	[BepInPlugin("BitZer0.ForbiddenHealPotion", "ForbiddenHealPotion", "1.0")]
	public class ForbiddenHealPotion : BaseUnityPlugin
	{
		internal static ForbiddenHealPotion Instance { get; private set; }

		internal static ManualLogSource Logger => Instance._logger;

		private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger;

		internal Harmony? Harmony { get; set; }

		private void Awake()
		{
			Instance = this;
			((Component)this).gameObject.transform.parent = null;
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
			Patch();
			Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!");
		}

		internal void Patch()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//IL_0026: Expected O, but got Unknown
			if (Harmony == null)
			{
				Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
				Harmony val2 = val;
				Harmony = val;
			}
			Harmony.PatchAll();
		}

		internal void Unpatch()
		{
			Harmony? harmony = Harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}

		private void Update()
		{
		}
	}
	public class ValuableForbiddenHealthPotion : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <DelayedDestroy>d__27 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ValuableForbiddenHealthPotion <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DelayedDestroy>d__27(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					if (<>4__this.photonView.IsMine)
					{
						PhotonNetwork.RemoveRPCs(<>4__this.photonView);
						PhotonNetwork.Destroy(<>4__this.photonView);
					}
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public int healAmount;

		private PhysGrabObject physGrabObject;

		private List<string> transitiveVerbs = new List<string>();

		private List<string> intransitiveVerbs = new List<string>();

		private List<string> adjectives = new List<string>();

		private List<string> intensifiers = new List<string>();

		private List<string> nouns = new List<string>();

		private List<string> adverbs = new List<string>();

		private ParticleSystem particles;

		private bool particlesPlaying;

		public Renderer LovePotionRenderer;

		private string playerName = "[playerName]";

		private ItemToggle itemToggle;

		private PhotonView photonView;

		public ParticleSystem[]? rejectParticles;

		private ItemAttributes itemAttributes;

		private ItemEquippable? itemEquippable;

		private bool used;

		[Space]
		public Sound soundUse;

		public Sound soundReject;

		private void Start()
		{
			particles = ((Component)this).GetComponentInChildren<ParticleSystem>();
			physGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
			itemToggle = ((Component)this).GetComponent<ItemToggle>();
			photonView = ((Component)this).GetComponent<PhotonView>();
			itemAttributes = ((Component)this).GetComponent<ItemAttributes>();
			itemEquippable = ((Component)this).GetComponent<ItemEquippable>();
			InitializeWordLists();
		}

		private void Update()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: 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)
			LovePotionRenderer.material.mainTextureOffset = new Vector2(0f, Time.time * 0.3f);
			LovePotionRenderer.material.mainTextureScale = new Vector2(2f + Mathf.Sin(Time.time * 1f) * 0.5f, 2f + Mathf.Sin(Time.time * 1f) * 0.25f);
			if (physGrabObject.grabbed)
			{
				if (!particlesPlaying)
				{
					particles.Play();
					particlesPlaying = true;
				}
			}
			else if (particlesPlaying)
			{
				particles.Stop();
				particlesPlaying = false;
			}
			if (!SemiFunc.IsMasterClientOrSingleplayer() || !itemToggle.toggleState || used)
			{
				return;
			}
			PlayerAvatar val = SemiFunc.PlayerAvatarGetFromPhotonID(itemToggle.playerTogglePhotonID);
			if (!Object.op_Implicit((Object)(object)val))
			{
				return;
			}
			if (val.playerHealth.health >= val.playerHealth.maxHealth)
			{
				if (SemiFunc.IsMultiplayer())
				{
					photonView.RPC("RejectRPC", (RpcTarget)0, Array.Empty<object>());
				}
				else
				{
					RejectRPC();
				}
				itemToggle.ToggleItem(false, -1);
				physGrabObject.rb.AddForce(Vector3.up * 2f, (ForceMode)1);
				physGrabObject.rb.AddTorque(-((Component)physGrabObject).transform.right * 0.05f, (ForceMode)1);
				return;
			}
			Debug.Log((object)$"Healing {val.playerName} they currently have {val.playerHealth}");
			val.playerHealth.HealOther(healAmount, true);
			GameDirector.instance.CameraImpact.ShakeDistance(15f, 1f, 6f, ((Component)this).transform.position, 0.2f);
			if (SemiFunc.IsMultiplayer())
			{
				photonView.RPC("PotionDrank", val.photonView.Owner, Array.Empty<object>());
				photonView.RPC("UsedRPC", (RpcTarget)0, Array.Empty<object>());
			}
			else
			{
				PotionDrank();
				UsedRPC();
			}
		}

		[PunRPC]
		private void PotionDrank()
		{
			//IL_0033: 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)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			if (!SemiFunc.IsMultiplayer())
			{
				playerName = "the brain worms that control me";
				flag = true;
			}
			else
			{
				List<PlayerAvatar> list = SemiFunc.PlayerGetAllPlayerAvatarWithinRange(30f, ((Component)PhysGrabber.instance).transform.position, false, default(LayerMask));
				PlayerAvatar val = null;
				float num = float.MaxValue;
				foreach (PlayerAvatar item in list)
				{
					if (!((Object)(object)item == (Object)(object)PlayerAvatar.instance))
					{
						float num2 = Vector3.Distance(((Component)PhysGrabber.instance).transform.position, ((Component)item).transform.position);
						if (num2 < num)
						{
							num = num2;
							val = item;
						}
					}
				}
				flag = true;
				if ((Object)(object)val != (Object)null)
				{
					playerName = val.playerName;
				}
				else
				{
					playerName = "the brain worms that control me";
				}
			}
			if (flag)
			{
				string text = GenerateQuestionableSentence();
				Color val2 = default(Color);
				((Color)(ref val2))..ctor(100f, 200f, 60f, 1f);
				Debug.Log((object)("Chat player avatar name: " + ((Object)ChatManager.instance.playerAvatar).name));
				ChatManager.instance.PossessChatScheduleStart(10);
				ChatManager.instance.PossessChat((PossessChatID)1, text, 1f, val2, 0f, false, 0, (UnityEvent)null);
				ChatManager.instance.PossessChatScheduleEnd();
			}
		}

		private void InitializeWordLists()
		{
			transitiveVerbs.AddRange(new string[136]
			{
				"adore", "sing oh la la with", "crush on", "fan over", "root for", "olala over", "geek out over", "vibe with", "fangirl over", "fanboy over",
				"heart", "olalalalala", "can't even", "obsess over", "trip over", "flip for", "freak over", "go nuts for", "go crazy for", "get hyped to",
				"hype up", "read a book with", "ride or die for", "show love for", "dance with", "ship", "low-key crush on", "have a thing for", "can't stop thinking about", "eyeing",
				"have robofeeling for", "catch crushie feelings for", "go heart eyes for", "get butterflies over", "have heart eyes for", "can't get over", "can't get enough of", "get in my feels over", "dream about", "imagine being happy with",
				"can't handle", "get weak for", "melt for", "have a soft spot for", "got a thing for", "obsessed with", "blushing over", "head over heels for", "feel the feels for", "admire",
				"crushing hard on", "can't even with", "totally into", "lost in", "robofeels about", "gaga for", "beeping and booping over", "extracting valuables with", "grooving to", "all about",
				"blown away by", "hyped about", "tripping over", "losing it over", "crying over", "obsessing over", "dying for", "looking at", "checking out", "having nothing but love for",
				"waiting on", "going wild for", "living for", "hooked on", "feeling", "hyped for", "showing mad love to", "sending hugs to", "sending hearts to", "0 1 1 0 1 1 0 0 0 1 1 0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 1 0 1",
				"be friends with", "laugh hard with", "vibing with", "like", "cherish", "enjoy", "appreciate", "love", "treasure", "care for",
				"go gaga ding dong for", "long for", "think of", "miss", "want to be with", "smile at", "look at", "blush around", "get shy around", "laugh and cry with",
				"sing love songs with", "talk to", "listen to", "hold hands with", "share secrets with", "walk with", "sit with", "be near", "hang out with", "spend time with",
				"be around", "wink at", "wave to", "call", "write to", "sing to", "dance with", "cook for", "make art for", "make gifts for",
				"give gifts to", "surprise", "hug", "make taxman happy with", "ride the cart with", "robotickle", "do a stand-up routine for", "enjoy the sunset with", "share laughs with", "make smile",
				"bring joy to", "be silly with", "go on adventures with", "explore with", "go to Japan with", "grow old with"
			});
			intransitiveVerbs.AddRange(new string[140]
			{
				"vibe", "wow wow wow", "geek out", "daydream", "crush", "fangirl", "fanboy", "cheer", "freak out", "melt",
				"chill", "robostalk", "go oh la la", "robodance", "rock out", "hug", "kick it", "work", "match", "boot up",
				"meet up", "catch feels", "connect", "get along", "robohang", "check out", "look up", "catch up", "hang out", "tune in",
				"break", "tap in", "dive in", "get in", "be in", "collab", "share", "swap", "trade", "deal",
				"work", "play", "compete", "challenge", "engage", "join in", "get in on", "mix in", "add in", "help",
				"support", "follow", "track", "keep tabs", "keep up", "stay updated", "keep an eye", "buzz", "wow", "download the latest update",
				"update", "shout out", "yell", "scream", "hype", "beep boop beep boop", "vent", "express", "spill the beans", "confess love",
				"admit feelings", "declare bankruptcy", "dream", "blush", "imagine", "robodrool", "obsess", "admire", "go woop woop", "freak out",
				"lose it", "freak", "feel", "glow", "... i dunno ...", "trip", "groove", "beep boop", "crush", "flirt",
				"giggle", "smile", "laugh", "beam", "grin", "wonder", "wish", "hope", "long", "like",
				"leave a like and subscribe", "react", "lurk", "go OP", "despawn", "fart", "peep", "spy", "peek", "sigh",
				"breathe", "relate", "resonate", "go gaga ding dong", "boop", "jam", "flutter", "tingle", "twirl", "dance",
				"sing", "hum", "beep", "skip", "float", "sparkle", "bubble", "chirp", "glisten", "twinkle",
				"ponder", "admire", "breathe", "relax", "fancy", "laugh", "imagine", "melt", "smirk", "chuckle"
			});
			adjectives.AddRange(new string[137]
			{
				"epic", "awesome", "adorable", "adorbs", "fab", "cool", "dreamy", "snazzy", "rad", "stellar",
				"dope", "amazing", "breathtaking", "charming", "cute", "ah meh zin geh", "fresh", "funky", "glowing", "oh la la la",
				"incredible", "olala", "lovable", "lovely", "upgraded", "neat", "on point", "peachy", "0 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 0 0 0 1 1 0 0 1 0 1", "woop y woop y woo",
				"likey likey", "oooh ya ya", "slick", "smart", "smooth", "sparkling", "OMG", "stunning", "stylish", "ooooh yeaaa",
				"superb", "supreme", "sweet", "wowie", "trendy", "unreal", "vibrant", "wicked", "me likey", "beep boop",
				"oh my", "oof in a good way", "brilliant", "oh ya ya", "chic", "ah ... mazing", "clever", "comfy", "cu ... wait ... teh ... cute", "woop woop",
				"hugable", "cute", "yas queen", "sooo like ... wow", "divine", "electric", "elegant", "elite", "1337", "engaging",
				"enticing", "fancy", "fierce", "fire", "fly", "glam", "gorgeous", "hype mode", "iconic", "legendary",
				"litty", "wow wow wow", "magical", "majestic", "bootiiifoool", "poppin'", "precious", "C O O L ... cool", "C U T E ... cute", "... ... *blushes* ...",
				"slaying", "spicy", "robohandsome", "wowa wowa yas yas", "on fleek", "robocute", "wholesome", "winning", "robodorable", "powerful",
				"pretty", "beautiful", "sweet", "kind", "wow wow wow wow wow", "100%", "0 1 1 0 0 0 1 0 0 1 1 0 0 0 0 1 0 1 1 0 0 1 0 0", "fun", "brave", "interesting",
				"smart in the head", "sparkling", "shiny", "warm", "heroic", "friendly", "financially stable", "oh la la oh la la la la", "romantic", "cozy",
				"wonderful", "fantastic", "super", "great", "delightful", "fabulous", "marvelous", "nice", "pleasant", "good",
				"special", "unique", "o la la la yes yes", "yeah yeah wow wow", "wooooow", "oh woooow", "oh my gawd"
			});
			intensifiers.AddRange(new string[77]
			{
				"totally", "super", "uber", "mega", "super mega", "seriously", "majorly", "legit", "absolutely", "completely",
				"for reals", "utterly", "high-key", "incredibly", "madly", "like ...", "like... seriously", "sooo", "really", "so",
				"sooooooooo", "unbelievably", "very", "like soooo much", "extra", "extremely", "really really", "fiercely", "like, for reals", "greatly",
				"hugely", "immensely", "intensely", "massively", "so so soooo", "really really really", "like totes", "like... totally", "like.. somehow sooo much", "simply",
				"supremely", "surprisingly", "super mega ultra", "ultra", "unusually", "way way", "way", "insanely", "like ... insanelyyyy", "freakishly",
				"extra extra", "overwhelmingly", "reeeaaally", "weirdly", "suuuuper", "way waaaay", "crazy", "like suuuuuper", "really sooo", "low-key",
				"high-key", "literally", "for reeeaal soo", "legit", "honestly", "kinda", "sort of", "basically", "downright", "like literally",
				"very very", "like like.. like... sooo much", "like... actually", "suuuuper suuuuper", "genuinely", "truly", "sincerely"
			});
			nouns.AddRange(new string[108]
			{
				"bae", "bro", "fam", "goals", "friendo", "buddy", "pal", "champ", "MVP", "rockstar",
				"hero", "idol", "star", "queen", "king", "baby", "beast", "boss", "bruh", "boss queen",
				"girl", "dude", "genius", "guru", "cutie", "legend", "player", "boss king", "pog", "partner",
				"prodigy", "pro", "role model", "boy", "soulmate", "superhero", "sweetie", "twin", "robot", "wizard",
				"wonder", "crushie", "angel", "viral hit", "blessing", "champion", "charmer", "crush", "darling", "dear",
				"gamer", "fave", "friend", "gem", "heartthrob", "honey", "heartbreaker", "inspiration", "love", "main",
				"other half", "crushcrush", "person", "precious", "sunshine", "treasure", "bestie", "boo", "cutie", "sister",
				"sis", "brother", "fam", "beauty", "megacrush", "best friend", "supercrush", "favfav", "main character", "robo",
				"icon", "legend", "mood", "vibe", "goat", "man", "woman", "goal", "winner", "yas queen",
				"cute robot", "robot crush", "pal", "sweetheart", "pumpkin", "sugar", "baby", "peach", "dove", "cupcake",
				"buttercup", "snugglebug", "silly goose", "teddy bear", "dream", "princess", "prince", "superstar"
			});
			adverbs.AddRange(new string[77]
			{
				"totally", "super", "uber", "mega", "super mega", "seriously", "majorly", "legit", "absolutely", "completely",
				"for reals", "utterly", "high-key", "incredibly", "madly", "like ...", "like... seriously", "sooo", "really", "so",
				"sooooooooo", "unbelievably", "very", "like soooo", "extra", "extremely", "really really", "fiercely", "like, for reals", "greatly",
				"hugely", "immensely", "intensely", "massively", "so so soooo", "really really really", "like totes", "like... totally", "like.. somehow sooo", "simply",
				"supremely", "surprisingly", "super mega ultra", "ultra", "unusually", "way way", "way", "insanely", "like ... insanelyyyy", "freakishly",
				"extra extra", "overwhelmingly", "reeeaaally", "weirdly", "suuuuper", "way waaaay", "crazy", "like suuuuuper", "really sooo", "low-key",
				"high-key", "literally", "for reeeaal soo", "legit", "honestly", "kinda", "sort of", "basically", "downright", "like literally",
				"very very", "like like.. like... sooo", "like... actually", "suuuuper suuuuper", "genuinely", "truly", "sincerely"
			});
		}

		private string GenerateQuestionableSentence()
		{
			List<string> list = new List<string>
			{
				"Hey {playerName}, want to head back to my goon cave after this?", "I'm going to feel that in the morning", "Now THAT'S what I call goon juice", "mmmm, now to go and browse some femboys and firearms", "oh yes, oh yes, yummy in my tummy", "Legalize nuclear bombs", "According to all known laws of aviation, you're a bitch, {playerName}", "I {intensifier} need a tinkle right now", "{playerName} Would it be weird if we touched buts right now?", "If anyone makes me carry anything heavy, I'm going to break it and gaslight you about ever giving it to me",
				"I am a god, how can you kill a god?", "{playerName} is such a {noun}... but, {adverb}, the opposite of that", "You better not be looking at my chrome {intensifier} dome!", "{playerName} watch me {intransitiveVerb}", "I'm going to {transitiveVerb} with your dad", "Put this in the clip", "Hey {playerName}, can I show you my sonic fanart", "Yes Daddy", "Hahaha, do you smell that? I pooed my own pants. It's a dominance thing, not a fear thing", "I should kill {playerName}",
				"That potion was {adverb} kinda cringe", "I'm lowkey a {noun}", "Gimmie that piss balalalaalalalala", "This E-Girl bath water got be acting up", "This making me feel gassy, xbox google repo inflation", "Alright... who shit in my pants?", "Hang on guys, I'm mid-load", "I wouldn't drink that crick, it's full of loads", "Hey {playerName}, nice cock", "I was enjoying a succulent Chinese meal",
				"These potions are too strong for you traveler"
			};
			string text = list[Random.Range(0, list.Count)];
			string text2 = text.Replace("{playerName}", playerName);
			if (text.Contains("{transitiveVerb}"))
			{
				string newValue = transitiveVerbs[Random.Range(0, transitiveVerbs.Count)];
				text2 = text2.Replace("{transitiveVerb}", newValue);
			}
			if (text.Contains("{intransitiveVerb}"))
			{
				string text3 = intransitiveVerbs[Random.Range(0, intransitiveVerbs.Count)];
				if (text2.Contains("{intransitiveVerb}s"))
				{
					text3 = ((!text3.EndsWith("e")) ? (text3 + "es") : (text3 + "s"));
					text2 = text2.Replace("{intransitiveVerb}s", text3);
				}
				else
				{
					text2 = text2.Replace("{intransitiveVerb}", text3);
				}
			}
			if (text.Contains("{adjective}"))
			{
				string newValue2 = adjectives[Random.Range(0, adjectives.Count)];
				text2 = text2.Replace("{adjective}", newValue2);
			}
			if (text.Contains("{intensifier}"))
			{
				string newValue3 = intensifiers[Random.Range(0, intensifiers.Count)];
				text2 = text2.Replace("{intensifier}", newValue3);
			}
			if (text.Contains("{adverb}"))
			{
				string newValue4 = adverbs[Random.Range(0, adverbs.Count)];
				text2 = text2.Replace("{adverb}", newValue4);
			}
			if (text.Contains("{noun}"))
			{
				string newValue5 = nouns[Random.Range(0, nouns.Count)];
				text2 = text2.Replace("{noun}", newValue5);
			}
			return char.ToUpper(text2[0]) + text2.Substring(1);
		}

		[PunRPC]
		private void RejectRPC()
		{
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			PlayerAvatar val = SemiFunc.PlayerAvatarGetFromPhotonID(itemToggle.playerTogglePhotonID);
			Debug.Log((object)("Rejected! player name: " + ((Object)val).name));
			if (val.isLocal)
			{
				val.physGrabber.ReleaseObjectRPC(false, 1f);
			}
			ParticleSystem[] array = rejectParticles;
			for (int i = 0; i < array.Length; i++)
			{
				array[i].Play();
			}
			GameDirector.instance.CameraImpact.ShakeDistance(5f, 1f, 6f, ((Component)this).transform.position, 0.2f);
			soundReject.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
		}

		[PunRPC]
		private void UsedRPC()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			itemToggle.ToggleDisable(true);
			physGrabObject.impactDetector.indestructibleBreakEffects = true;
			soundUse.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
			used = true;
			((MonoBehaviour)this).StartCoroutine(DelayedDestroy());
		}

		[IteratorStateMachine(typeof(<DelayedDestroy>d__27))]
		private IEnumerator DelayedDestroy()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DelayedDestroy>d__27(0)
			{
				<>4__this = this
			};
		}
	}
}