using System; using System.Collections; 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 HarmonyLib; using Microsoft.CodeAnalysis; using PEAKLib.Core; using PEAKLib.Items.UnityEditor; using Photon.Pun; using Photon.Realtime; using UnityEngine; using WateringCan; using Zorro.Core; [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("WateringCan")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0+41788df745913de6e4e2d17aa533c378530210d4")] [assembly: AssemblyProduct("WateringCan")] [assembly: AssemblyTitle("Watering Can")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.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; } } } public class WateringCanItem : ItemComponent { public float initialPourCost = 0.25f; public float totalPourTime = 10f; public bool pouring; public float interactionRadius = 1f; public LayerMask interactionLayers = LayerMask.op_Implicit(LayerMask.GetMask(new string[4] { "Map", "Terrain", "Character", "Default" })); public Transform overlapSphereDefault; public Transform overlapSphereUp; public Vector3 overlapSpherePosition; public bool isOverlapSphereVisible; public float selfWaterValue = 0.8f; public float seaLevel = 0.425f; public float rootsWaterLevel = 215f; public StormVisual rainVisual; public float rainRefillAmount = 0.05f; public GameObject[] heatZones; public float waterPoolsRadius = 4.5f; public float waterPoolsDepth = -0.9f; public float waterPoolsHeight = 0.9f; public Dictionary bushGrowthProgress = new Dictionary(); public int fruitGrowTime = 27; public float vineGrowLength = 30f; public float vineGrowTick; public bool canVineGrow = true; public float coolOffPlayerAmount = 0.025f; public float coolOffPlayerCooldown = 0.25f; [SerializeField] public float water; public float generalTick; public override void Awake() { ((ItemComponent)this).Awake(); Item item = base.item; item.OnPrimaryStarted = (Action)Delegate.Combine(item.OnPrimaryStarted, new Action(StartPour)); Item item2 = base.item; item2.OnPrimaryCancelled = (Action)Delegate.Combine(item2.OnPrimaryCancelled, new Action(CancelPour)); overlapSphereDefault = ((Component)this).transform.Find("Overlap_Sphere_Default"); overlapSphereUp = ((Component)this).transform.Find("Overlap_Sphere_Up"); ((Component)((Component)this).transform.Find("Sphere")).gameObject.SetActive(isOverlapSphereVisible); GameObject val = GameObject.FindGameObjectWithTag("Rain"); if ((Object)(object)val != (Object)null) { rainVisual = val.GetComponent(); } heatZones = (from gameObject in Object.FindObjectsByType((FindObjectsSortMode)0) where ((Object)gameObject).name == "heat zone" && gameObject.activeInHierarchy select gameObject).ToArray(); } public void OnDestroy() { Item item = base.item; item.OnPrimaryHeld = (Action)Delegate.Remove(item.OnPrimaryHeld, new Action(StartPour)); Item item2 = base.item; item2.OnPrimaryCancelled = (Action)Delegate.Remove(item2.OnPrimaryCancelled, new Action(CancelPour)); } public override void OnInstanceDataSet() { if (((ItemComponent)this).HasData((DataEntryKey)10)) { water = ((ItemComponent)this).GetData((DataEntryKey)10).Value; base.item.SetUseRemainingPercentage(water / totalPourTime); } else if (base.photonView.IsMine) { water = totalPourTime; base.item.SetUseRemainingPercentage(1f); } } public void Update() { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) generalTick -= Time.deltaTime; UpdatePour(); if (generalTick <= 0f) { if (water != totalPourTime) { RefillWater(); } generalTick = 0.1f; } if (Plugin.showWateringSphere.Value && Input.GetKeyDown((KeyCode)111)) { isOverlapSphereVisible = !isOverlapSphereVisible; ((Component)((Component)this).transform.Find("Sphere")).gameObject.SetActive(isOverlapSphereVisible); Plugin.Log.LogInfo((object)"Watering sphere toggled"); } overlapSpherePosition = overlapSphereDefault.position; if (overlapSphereDefault.position.y - ((Component)this).transform.position.y > selfWaterValue) { overlapSpherePosition = overlapSphereUp.position; } if (isOverlapSphereVisible) { ((Component)this).transform.Find("Sphere").position = overlapSpherePosition; } } public void UpdatePour() { //IL_0056: 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) if (!pouring || !base.photonView.IsMine) { return; } water -= Time.deltaTime; if (water <= 0f) { water = 0f; CancelPour(); } else if (generalTick <= 0f) { Collider[] array = Physics.OverlapSphere(overlapSpherePosition, interactionRadius, LayerMask.op_Implicit(interactionLayers)); Collider[] array2 = array; foreach (Collider val in array2) { if (!((Object)(object)((Component)val).transform == (Object)(object)((Component)this).transform) && !((Component)val).transform.IsChildOf(((Component)this).transform)) { WaterInteraction(((Component)val).gameObject); } } } ((ItemComponent)this).GetData((DataEntryKey)10).Value = water; base.item.SetUseRemainingPercentage(water / totalPourTime); } public void WaterInteraction(GameObject target) { //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Invalid comparison between Unknown and I4 if (((Object)target).name.Contains("berrybush ") && target.gameObject.layer == 21) { GrowFruitOnBush(target); } else if ((((Object)target).name.Contains("Mesh") || ((Object)target).name.Contains("Ice_DeadTree") || ((Object)target).name.Contains("Cactus")) && target.gameObject.layer == 21 && Object.op_Implicit((Object)(object)((Component)target.transform.parent).GetComponent())) { GrowFruitOnBush(((Component)target.transform.parent).gameObject); } else if (((Object)target).name == "RigCollider" && target.gameObject.layer == 10) { GameObject gameObject = ((Component)target.transform.root).gameObject; if (!(gameObject.GetComponent().GetCurrentStatus((STATUSTYPE)8) <= 0f) && !(gameObject.GetComponent().coolOffCooldown > 0f)) { base.photonView.RPC("RPC_CoolOffPlayer", (RpcTarget)0, new object[1] { PunExtensions.GetPhotonView(gameObject) }); } } else if (((Object)target.transform.root).name.Contains("Dynamite") && ((ItemComponent)((Component)target.transform.root).gameObject.GetComponent()).GetData((DataEntryKey)3).Value) { base.photonView.RPC("RPC_AnRPCToAddAnRPCLol", (RpcTarget)0, new object[1] { PunExtensions.GetPhotonView(((Component)target.transform.root).gameObject) }); } else if (Object.op_Implicit((Object)(object)((Component)target.transform.parent).GetComponent()) && (int)((Component)target.transform.parent).GetComponent().state == 1) { ((Component)target.transform.parent).GetComponent().RPC("Extinguish_Rpc", (RpcTarget)3, Array.Empty()); } } public void GrowFruitOnBush(GameObject bush) { //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) if (!bushGrowthProgress.ContainsKey(bush)) { bushGrowthProgress[bush] = 0; Transform val = FindFreeSpawnSpot(((Spawner)bush.GetComponent()).GetSpawnSpots()); if ((Object)(object)val == (Object)null) { bushGrowthProgress.Remove(bush); Plugin.Log.LogInfo((object)"No free spawn spots"); return; } } Plugin.Log.LogInfo((object)$"Growing fruit in {((Object)bush).name} ({bushGrowthProgress[bush] * 100 / fruitGrowTime}%)"); if (bushGrowthProgress[bush] < fruitGrowTime) { bushGrowthProgress[bush]++; } if (bushGrowthProgress[bush] >= fruitGrowTime) { bushGrowthProgress.Remove(bush); Transform val2 = FindFreeSpawnSpot(((Spawner)bush.GetComponent()).GetSpawnSpots()); if ((Object)(object)val2 == (Object)null) { Plugin.Log.LogInfo((object)"No free spawn spots"); return; } GameObject randomItem = LootData.GetRandomItem(((Spawner)bush.GetComponent()).GetSpawnPool(), false); ((MonoBehaviourPun)Character.localCharacter).photonView.RPC("RPC_InstantiateFruit", (RpcTarget)2, new object[3] { ((Object)randomItem).name, val2.position, ((Object)bush).name }); } } public Transform? FindFreeSpawnSpot(List spawnSpots) { Transform[] array = spawnSpots.OrderBy((Transform x) => new Random().Next()).ToArray(); Transform[] array2 = array; foreach (Transform val in array2) { if (IsSpawnSpotFree(val)) { return val; } } return null; } public bool IsSpawnSpotFree(Transform spot) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(spot.position, 0.1f); Collider[] array2 = array; foreach (Collider val in array2) { if (!((Component)val).transform.IsChildOf(spot.root) && !val.isTrigger) { return false; } } return true; } public void GrowMagicBean(GameObject stalk) { float maxLength = ((Component)stalk.transform.parent).GetComponentInParent().maxLength; if (maxLength < vineGrowLength) { vineGrowTick -= Time.deltaTime; if (vineGrowTick <= 0f) { MagicBeanVine componentInParent = ((Component)stalk.transform.parent).GetComponentInParent(); componentInParent.maxLength += 1f; Plugin.Log.LogInfo((object)$"Vine growing to {maxLength}"); vineGrowTick = 0.125f; } } } public void RemoveOtherVine(GameObject stalk) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(stalk.transform.position, 0.1f); Collider[] array2 = array; foreach (Collider val in array2) { GameObject gameObject = ((Component)((Component)val).transform.parent.parent).gameObject; if (((Object)gameObject).name == "MagicBeanVine(Clone)" && ((Component)val).transform.position == stalk.transform.position && (Object)(object)gameObject != (Object)(object)((Component)stalk.transform.parent.parent).gameObject) { Plugin.Log.LogInfo((object)("Removing duplicated " + ((Object)gameObject).name)); Object.Destroy((Object)(object)gameObject); } } } public void RefillWater() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 if (((Component)this).transform.position.y <= seaLevel || (((Component)this).transform.position.y <= rootsWaterLevel && (int)Singleton.Instance.GetCurrentBiome() == 7) || IsWaterPoolNear()) { water = totalPourTime; ((ItemComponent)this).GetData((DataEntryKey)10).Value = water; base.item.SetUseRemainingPercentage(1f); Plugin.Log.LogInfo((object)"Refilling Watering Can!"); } else if (IsRaining() && water < totalPourTime) { water += rainRefillAmount; ((ItemComponent)this).GetData((DataEntryKey)10).Value = water; base.item.SetUseRemainingPercentage(water / totalPourTime); Plugin.Log.LogInfo((object)$"Slowly refilling Watering Can! ({Math.Round(water * 10f)}%)"); } } public bool IsWaterPoolNear() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Singleton.Instance == (Object)null || (int)Singleton.Instance.GetCurrentSegment() != 2) { return false; } GameObject[] array = heatZones; foreach (GameObject val in array) { if (Vector3.Distance(((Component)this).transform.position, val.transform.position) <= waterPoolsRadius) { float num = ((Component)this).transform.position.y - val.transform.position.y; if (num >= waterPoolsDepth && num <= waterPoolsHeight) { return true; } } } return false; } public bool IsRaining() { if ((Object)(object)rainVisual == (Object)null) { return false; } if (rainVisual.observedPlayerInWindZone) { return true; } return false; } private void OnTriggerEnter(Collider collider) { if (water != totalPourTime && ((Object)((Component)collider).transform.parent.parent).name.Contains("Waterfall_Spline")) { water = totalPourTime; ((ItemComponent)this).GetData((DataEntryKey)10).Value = water; base.item.SetUseRemainingPercentage(1f); Plugin.Log.LogInfo((object)"Refilling Watering Can!"); } } public void StartPour() { if (water >= initialPourCost) { water -= initialPourCost; pouring = true; base.item.SetUseRemainingPercentage(water / totalPourTime); } else { water = 0f; pouring = true; base.item.SetUseRemainingPercentage(water / totalPourTime); } } public void CancelPour() { pouring = false; } [PunRPC] public void RPC_CoolOffPlayer(PhotonView characterView) { Player owner = characterView.Owner; if (owner != null) { if (owner.IsLocal) { Character.localCharacter.refs.afflictions.SubtractStatus((STATUSTYPE)8, coolOffPlayerAmount, false, false); } ((Component)((Component)characterView).transform.root).gameObject.GetComponent().coolOffCooldown = coolOffPlayerCooldown; Plugin.Log.LogInfo((object)("Cooling off " + owner.NickName)); } } [PunRPC] public void RPC_AnRPCToAddAnRPCLol(PhotonView dynamiteView) { GameObject gameObject = ((Component)((Component)dynamiteView).transform.root).gameObject; if ((Object)(object)gameObject.GetComponent() == (Object)null) { gameObject.AddComponent(); } dynamiteView.RPC("SetFlareUnlitRPC", (RpcTarget)0, Array.Empty()); } [PunRPC] public void RPC_PutOffCampfire(PhotonView campfireView) { GameObject gameObject = ((Component)campfireView).gameObject; gameObject.GetComponent().beenBurningFor = gameObject.GetComponent().burnsFor - 0.1f; } public void VaporizeWater() { water = 0f; ((ItemComponent)this).GetData((DataEntryKey)10).Value = 0f; base.item.SetUseRemainingPercentage(0f); Plugin.Log.LogInfo((object)"Vaporizing water!"); } } public class WateringCanVFX : MonoBehaviourPun { public Item item; public bool isPouring; public bool audioStarted; public AudioSource audioSource; public ParticleSystem particle; public GameObject waterLevel; public float minWaterLevelPosition = 0.000425f; public float maxWaterLevelPosition = 0.0056f; public float volume = 0.1f; public WateringCanItem wateringCanItem; public void Start() { item = ((Component)this).GetComponent(); audioSource = ((Component)((Component)this).transform.Find("Audio_Source")).GetComponent(); particle = ((Component)((Component)this).transform.Find("Water_VFX")).GetComponent(); waterLevel = ((Component)((Component)this).transform.Find("watering_can_B").Find("Water_Level")).gameObject; wateringCanItem = ((Component)this).GetComponent(); } public void Update() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) UpdatePouringWater(); float num = Mathf.Lerp(minWaterLevelPosition, maxWaterLevelPosition, wateringCanItem.water / wateringCanItem.totalPourTime); waterLevel.transform.localPosition = new Vector3(waterLevel.transform.localPosition.x, num, waterLevel.transform.localPosition.z); if (isPouring && !audioStarted) { audioSource.Play(); audioSource.volume = 0f; audioStarted = true; } if (isPouring) { audioSource.volume = Mathf.Lerp(audioSource.volume, volume, 10f * Time.deltaTime); } if (!isPouring) { audioSource.volume = Mathf.Lerp(audioSource.volume, 0f, 10f * Time.deltaTime); if (audioSource.volume <= 0.01f) { audioSource.Stop(); } } if (!isPouring && audioStarted) { audioStarted = false; } } public void UpdatePouringWater() { if (!((MonoBehaviourPun)this).photonView.IsMine || !Object.op_Implicit((Object)(object)wateringCanItem)) { return; } bool flag = wateringCanItem.pouring; if (wateringCanItem.water <= 0f) { flag = false; } if (flag != isPouring) { if (flag) { ((MonoBehaviourPun)this).photonView.RPC("RPC_StartPouringWater", (RpcTarget)0, Array.Empty()); } else { ((MonoBehaviourPun)this).photonView.RPC("RPC_EndPouringWater", (RpcTarget)0, Array.Empty()); } isPouring = flag; } } [PunRPC] public void RPC_StartPouringWater() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) isPouring = true; if (Object.op_Implicit((Object)(object)particle)) { if (!particle.isPlaying) { particle.Play(); } EmissionModule emission = particle.emission; ((EmissionModule)(ref emission)).enabled = true; } } [PunRPC] public void RPC_EndPouringWater() { //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) isPouring = false; if (Object.op_Implicit((Object)(object)particle)) { EmissionModule emission = particle.emission; ((EmissionModule)(ref emission)).enabled = false; } } } public class WateringCan_CustomMethods : MonoBehaviourPun { public float coolOffCooldown; public void Update() { if (coolOffCooldown > 0f) { coolOffCooldown -= Time.deltaTime; } } [PunRPC] public void RPC_InstantiateFruit(string fruitName, Vector3 spawnSpot, string bushName) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_0043: 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) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) GameObject val = PhotonNetwork.InstantiateItemRoom(fruitName, spawnSpot, Quaternion.identity); val.GetComponent().RPC("SetKinematicRPC", (RpcTarget)3, new object[3] { true, val.transform.position, val.transform.rotation }); ((MonoBehaviourPun)this).photonView.RPC("RPC_AddGrowFruitComponent", (RpcTarget)0, new object[1] { val.GetComponent() }); if (bushName.Contains("berrybush ") || bushName.Contains("Jungle_Willow")) { NetworkPrefabManager.SpawnNetworkPrefab(Plugin.modDefinition.Id + ":VFX_Leaves", val.transform.position, Quaternion.identity, (byte)0, (object[])null); } else if (bushName.Contains("Jungle_PalmTree")) { NetworkPrefabManager.SpawnNetworkPrefab(Plugin.modDefinition.Id + ":VFX_Palms", val.transform.position, Quaternion.identity, (byte)0, (object[])null); } else if (bushName.Contains("Ice_DeadTree")) { NetworkPrefabManager.SpawnNetworkPrefab(Plugin.modDefinition.Id + ":VFX_Snow", val.transform.position, Quaternion.identity, (byte)0, (object[])null); } else if (bushName.Contains("Cactus")) { NetworkPrefabManager.SpawnNetworkPrefab(Plugin.modDefinition.Id + ":VFX_Thorns", val.transform.position, Quaternion.identity, (byte)0, (object[])null); } Plugin.Log.LogInfo((object)(fruitName + " instantiated!")); } [PunRPC] public void RPC_AddGrowFruitComponent(PhotonView fruitPhotonView) { GameObject gameObject = ((Component)fruitPhotonView).gameObject; if ((Object)(object)gameObject.GetComponent() == (Object)null) { gameObject.AddComponent(); } } } public class WateringCan_GrowFruit : MonoBehaviour { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public WateringCan_GrowFruit <>4__this; private float 5__2; private float 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_007c: 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_00b7: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; WateringCan_GrowFruit wateringCan_GrowFruit = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = 0f; 5__3 = 0.5f; break; case 1: <>1__state = -1; break; } if (5__2 < 5__3) { 5__2 += Time.deltaTime; float num2 = Mathf.Clamp01(5__2 / 5__3); float num3 = 1f - Mathf.Pow(1f - num2, 3f); ((Component)wateringCan_GrowFruit).transform.localScale = Vector3.one * num3; <>2__current = null; <>1__state = 1; return true; } ((Component)wateringCan_GrowFruit).transform.localScale = Vector3.one; 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(); } } private void Start() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.localScale = Vector3.zero; ((MonoBehaviour)this).StartCoroutine(Grow()); } [IteratorStateMachine(typeof(d__1))] private IEnumerator Grow() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { <>4__this = this }; } } public class WateringCan_SetFlareUnlitRPC : ItemComponent { public void Start() { Dynamite component = ((Component)this).GetComponent(); component.lightFuseRadius = 0f; ((ItemComponent)component).GetData((DataEntryKey)3).Value = false; ((Component)component.sparks).gameObject.SetActive(false); ((Component)component.sparksPhotosensitive).gameObject.SetActive(false); } public override void OnInstanceDataSet() { } [PunRPC] public void SetFlareUnlitRPC() { Dynamite component = ((Component)this).GetComponent(); ((ItemComponent)component).GetData((DataEntryKey)3).Value = false; ((ItemComponent)component).GetData((DataEntryKey)10, (Func)component.SetupDefaultFuel).Value = component.startingFuseTime; component.lightFuseRadius = 0f; ((Component)component.sparks).gameObject.SetActive(false); ((Component)component.sparksPhotosensitive).gameObject.SetActive(false); GameObject[] array = (from gameObject in Object.FindObjectsByType((FindObjectsSortMode)0) where ((Object)gameObject).name.Contains("VFX_DynamiteSmoke") select gameObject).ToArray(); GameObject[] array2 = array; foreach (GameObject val in array2) { TrackNetworkedObject component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null && (Object)(object)component2.trackedObject != (Object)null && (Object)(object)component2.trackedObject == (Object)(object)component.trackable) { val.GetComponent().Stop(); val.GetComponent().volume = 0f; GameObject gameObject2 = ((Component)val.transform.Find("end")).gameObject; gameObject2.GetComponent().afterPlayAction = DestroySmoke(val); gameObject2.SetActive(true); } } Plugin.Log.LogInfo((object)"Putting off dynamite!"); } public Action? DestroySmoke(GameObject smoke) { Object.Destroy((Object)(object)smoke); return null; } } 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 WateringCan { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("WateringCan", "Watering Can", "1.1.0")] public class Plugin : BaseUnityPlugin { internal static ModDefinition modDefinition; internal static ConfigEntry showWateringSphere; private static Dictionary _peakShaders; public const string Id = "WateringCan"; internal static ManualLogSource Log { get; private set; } internal static Dictionary PeakShaders { get { if (_peakShaders == null) { List list = new List { "SmokeParticle" }; _peakShaders = new Dictionary(); foreach (string item in list) { Shader val = Shader.Find(item); if (!((Object)(object)val == (Object)null)) { _peakShaders[item] = val; } } } return _peakShaders; } } public static string Name => "Watering Can"; public static string Version => "1.1.0"; private void Awake() { //IL_01f4: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; modDefinition = ModDefinition.GetOrCreate(((BaseUnityPlugin)this).Info.Metadata); Log.LogInfo((object)"Plugin Watering Can is loaded!"); showWateringSphere = ((BaseUnityPlugin)this).Config.Bind("Debug", "Show Watering Sphere", false, "If true, allows to toggle the visibility of the watering sphere."); BundleLoader.LoadBundleAndContentsWithName((BaseUnityPlugin)(object)this, "watering_can_bundle.peakbundle", (Action)delegate(PeakBundle bundle) { UnityItemContent val = bundle.LoadAsset("Watering_Can"); WateringCanItem wateringCanItem = ((Component)val.Item).gameObject.AddComponent(); ((Component)val.Item).gameObject.AddComponent(); GameObject val2 = bundle.LoadAsset("VFX_Leaves"); NetworkPrefabManager.RegisterNetworkPrefab(modDefinition, val2); GameObject val3 = bundle.LoadAsset("VFX_Palms"); NetworkPrefabManager.RegisterNetworkPrefab(modDefinition, val3); GameObject val4 = bundle.LoadAsset("VFX_Snow"); NetworkPrefabManager.RegisterNetworkPrefab(modDefinition, val4); ParticleSystemRenderer component = ((Component)val4.GetComponent()).GetComponent(); ((Renderer)component).material = Resources.FindObjectsOfTypeAll().ToList().Find((Material m) => ((Object)m).name == "Snowflake softy"); ((Renderer)component).material.shader = PeakShaders["SmokeParticle"]; GameObject val5 = bundle.LoadAsset("VFX_Thorns"); NetworkPrefabManager.RegisterNetworkPrefab(modDefinition, val5); GameObject val6 = bundle.LoadAsset("VFX_Vine"); NetworkPrefabManager.RegisterNetworkPrefab(modDefinition, val6); }); LocalizedText.mainTable["NAME_WATERING CAN"] = new List(13) { "WATERING CAN", "ARROSOIR", "ANNAFFIATOIO", "GIEẞKANNE", "REGADERA", "REGADERA", "REGADOR", "ЛЕЙКА", "ЛІЙКА", "喷壶", "噴壺", "じょうろ", "물뿌리개", "KONEWKA", "SULAMA KABI" }; LocalizedText.mainTable["POUR WATER"] = new List(13) { "pour water", "verser de l'eau", "versare acqua", "wasser gießen", "verter agua", "verter agua", "despeje água", "налить воду", "налити воду", "倒水", "倒水", "水を注ぎ", "물을 붓다", "wlać wodę", "su dökmek" }; new Harmony("com.github.DaxxPurpura.WateringCan").PatchAll(); } } } namespace WateringCan.Patches { [HarmonyPatch(typeof(Character), "Awake")] public class CharacterAwakePatch { private static void Postfix(Character __instance) { if ((Object)(object)((Component)__instance).gameObject.GetComponent() == (Object)null) { Plugin.Log.LogInfo((object)("Adding CoolOffCooldown to " + __instance.characterName + "'s character.")); ((Component)__instance).gameObject.AddComponent(); } } } [HarmonyPatch(typeof(ItemCooking), "FinishCookingRPC")] public class ItemCookingFinishCookingRPCPatch { private static void Postfix(ItemCooking __instance) { WateringCanItem component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.VaporizeWater(); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }