using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using ExitGames.Client.Photon;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using Photon.Realtime;
using TMPro;
using TinyTweaks.Tweaks;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("YonDev.TinyTweaks")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.1.5.0")]
[assembly: AssemblyInformationalVersion("1.1.5+3b9baa80c503418c1872f3a0192a68e9c56a5526")]
[assembly: AssemblyProduct("YonDev.TinyTweaks")]
[assembly: AssemblyTitle("TinyTweaks")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.5.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[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]
[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]
[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 BepInEx
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
[Embedded]
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")]
[Embedded]
internal sealed class PatcherAutoPluginAttribute : Attribute
{
public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace Microsoft.CodeAnalysis
{
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace TinyTweaks
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("YonDev.TinyTweaks", "TinyTweaks", "1.1.5")]
public class tinyTweaks : BaseUnityPlugin
{
public static ConfigFile config;
private GameObject TweaksObj;
private Harmony harmony;
public static tinyTweaks Instance;
public const string Id = "YonDev.TinyTweaks";
internal static ManualLogSource Log { get; private set; }
public static string Name => "TinyTweaks";
public static string Version => "1.1.5";
private void Awake()
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Expected O, but got Unknown
Instance = this;
Log = ((BaseUnityPlugin)this).Logger;
config = ((BaseUnityPlugin)this).Config;
SceneManager.sceneLoaded += OnSceneChanged;
harmony = new Harmony("TinyTweaks!");
StartTweaks();
harmony.PatchAll();
Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
}
private void OnSceneChanged(Scene scene, LoadSceneMode mode)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Expected O, but got Unknown
if (!(((Scene)(ref scene)).name == "Title"))
{
TweaksObj = new GameObject("Tweaks!");
if (((Scene)(ref scene)).name == "Airport")
{
log("In Airport!");
((MonoBehaviour)this).StartCoroutine(checkIsHostDelayed());
}
TweaksObj.AddComponent<moveVersion>();
}
}
private void StartTweaks()
{
Customizations.Start();
ExtraMarshmallows.Start();
ItemAimbotFinder.Binds();
showNamesAlways.Start();
moveVersion.Binds();
BingBongSays.Start();
noBonusStaminaFromJumps.Start();
whisperTextChat.CheckforPeakTextChat(harmony);
ChangeRopeToRed.Start();
LetMeLEAVE.Start();
Shields.Start();
}
public static void Notification(string message, string color = "FFFFFF", bool sound = false)
{
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
PlayerConnectionLog val = Object.FindAnyObjectByType<PlayerConnectionLog>();
if ((Object)(object)val == (Object)null)
{
return;
}
string text = "<color=#" + color + ">" + message + "</color>";
MethodInfo method = typeof(PlayerConnectionLog).GetMethod("AddMessage", BindingFlags.Instance | BindingFlags.NonPublic);
if (method != null)
{
method.Invoke(val, new object[1] { text });
if ((Object)(object)val.sfxJoin != (Object)null && sound)
{
val.sfxJoin.Play(default(Vector3));
}
}
else
{
Log.LogMessage((object)"AddMessage method not found.");
}
}
public static void log(string message)
{
Log.LogInfo((object)message);
}
private void Update()
{
if (!((Object)(object)GUIManager.instance != (Object)null) || !GUIManager.instance.windowBlockingInput)
{
Customizations.Update();
LetMeLEAVE.Update();
}
}
private void OnDestroy()
{
if (harmony != null)
{
harmony.UnpatchSelf();
SceneManager.sceneLoaded -= OnSceneChanged;
if ((Object)(object)TweaksObj != (Object)null)
{
Object.Destroy((Object)(object)TweaksObj);
}
log("Unloading mod " + Name);
}
}
private IEnumerator checkIsHostDelayed()
{
yield return (object)new WaitForSeconds(10f);
if (!PhotonNetwork.IsMasterClient)
{
log($"Host is {PhotonNetwork.MasterClient}");
yield break;
}
log("Loading Basketball Aimbot!");
TweaksObj.AddComponent<ItemAimbotFinder>();
}
}
}
namespace TinyTweaks.Tweaks
{
[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(PhotonView))]
public class BasketballMagnet : MonoBehaviour, IPunOwnershipCallbacks
{
private Rigidbody rb = null;
private PhotonView pv = null;
private BasketballHoop targetHoop;
public bool hasLeftHand;
private bool hasExecutedLegitShot;
private float lastForceTime = -1f;
private void Awake()
{
rb = ((Component)this).GetComponent<Rigidbody>();
pv = ((Component)this).GetComponent<PhotonView>();
ResetState();
}
private void OnEnable()
{
PhotonNetwork.AddCallbackTarget((object)this);
FindNearestHoop();
}
private void OnDisable()
{
PhotonNetwork.RemoveCallbackTarget((object)this);
}
public void ResetState()
{
hasLeftHand = false;
hasExecutedLegitShot = false;
lastForceTime = -1f;
}
private void FindNearestHoop()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
BasketballHoop[] array = Object.FindObjectsByType<BasketballHoop>((FindObjectsSortMode)0);
float num = float.PositiveInfinity;
Vector3 position = ((Component)this).transform.position;
BasketballHoop[] array2 = array;
foreach (BasketballHoop val in array2)
{
float num2 = Vector3.Distance(position, ((Component)val).transform.position);
if (num2 < num)
{
num = num2;
targetHoop = val;
}
}
}
private void OnTriggerExit(Collider other)
{
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
if (pv.IsMine && ItemAimbotFinder.EnableAssist.Value && ItemAimbotFinder.RageAimbot.Value)
{
BasketballHoop componentInParent = ((Component)other).GetComponentInParent<BasketballHoop>();
if ((Object)(object)componentInParent != (Object)null && rb.linearVelocity.y < 0f && ((Component)this).transform.position.y < ((Component)componentInParent).transform.position.y)
{
Debug.Log((object)"[Rage Mode] Basket scored! Automatically tracking next objective...");
hasLeftHand = true;
FindNearestHoop();
ApplyParabolicAimbotForce();
}
}
}
private void FixedUpdate()
{
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
if (!pv.IsMine || !ItemAimbotFinder.EnableAssist.Value)
{
return;
}
if ((Object)(object)((Component)this).transform.parent != (Object)null && ((Object)(object)((Component)((Component)this).transform.root).GetComponent<Character>() != (Object)null || ((Object)((Component)this).transform.root).name.Contains("Player")))
{
ResetState();
}
else
{
if ((!ItemAimbotFinder.RageAimbot.Value && hasExecutedLegitShot) || hasLeftHand)
{
return;
}
hasLeftHand = true;
FindNearestHoop();
Vector3 linearVelocity = rb.linearVelocity;
float magnitude = ((Vector3)(ref linearVelocity)).magnitude;
if (magnitude < ItemAimbotFinder.MinimumThrowSpeedBasketBall.Value)
{
if (!ItemAimbotFinder.RageAimbot.Value)
{
hasExecutedLegitShot = true;
}
return;
}
ApplyParabolicAimbotForce();
if (!ItemAimbotFinder.RageAimbot.Value)
{
hasExecutedLegitShot = true;
}
}
}
private void Update()
{
if (pv.IsMine && lastForceTime > 0f && Time.time - lastForceTime >= 1.5f)
{
ReturnOwnershipToMaster();
lastForceTime = -1f;
}
}
private void ApplyParabolicAimbotForce()
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: 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)
//IL_0063: 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_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_0147: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: 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_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
//IL_0200: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_020c: Unknown result type (might be due to invalid IL or missing references)
//IL_0210: Unknown result type (might be due to invalid IL or missing references)
//IL_0219: Unknown result type (might be due to invalid IL or missing references)
//IL_022b: Unknown result type (might be due to invalid IL or missing references)
//IL_023c: Unknown result type (might be due to invalid IL or missing references)
//IL_024d: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)targetHoop == (Object)null)
{
FindNearestHoop();
if ((Object)(object)targetHoop == (Object)null)
{
return;
}
}
Vector3 position = ((Component)this).transform.position;
Vector3 val = ((Component)targetHoop).transform.position + Vector3.up * ItemAimbotFinder.HoopEntryHeightOffset.Value;
val.x += ItemAimbotFinder.GlobalXOffset.Value;
if (ItemAimbotFinder.ShowVisualTargetMarker.Value)
{
SpawnDebugMarker(val);
}
float num = Mathf.Abs(Physics.gravity.y);
if (Mathf.Approximately(num, 0f))
{
num = 9.81f;
}
float num2 = val.y - position.y;
Vector3 val2 = default(Vector3);
((Vector3)(ref val2))..ctor(val.x - position.x, 0f, val.z - position.z);
float num3 = Mathf.Max(val.y, position.y) + ItemAimbotFinder.PeakHeightAboveHoop.Value;
float num4 = num3 - position.y;
float num5 = num3 - val.y;
if (num4 <= 0f || num5 <= 0f)
{
Vector3 val3 = val - position;
Vector3 normalized = ((Vector3)(ref val3)).normalized;
rb.linearVelocity = normalized * 15f;
lastForceTime = Time.time;
return;
}
float num6 = Mathf.Sqrt(2f * num * num4);
float num7 = Mathf.Sqrt(2f * num4 / num);
float num8 = Mathf.Sqrt(2f * num5 / num);
float num9 = num7 + num8;
if (!Mathf.Approximately(num9, 0f))
{
float num10 = 1f - rb.linearDamping * num9 * 0.5f;
num10 = Mathf.Clamp(num10, 0.7f, 1f);
Vector3 val4 = val2 / (num9 * num10);
Vector3 val5 = default(Vector3);
((Vector3)(ref val5))..ctor(val4.x, num6, val4.z);
rb.linearVelocity = Vector3.zero;
rb.angularVelocity = Vector3.zero;
rb.AddForce(val5, (ForceMode)2);
lastForceTime = Time.time;
}
}
private void ReturnOwnershipToMaster()
{
if (PhotonNetwork.IsConnected && PhotonNetwork.MasterClient != null && pv.Owner != PhotonNetwork.MasterClient)
{
pv.TransferOwnership(PhotonNetwork.MasterClient);
tinyTweaks.Log.LogInfo((object)"[BasketballMagnet] Inactivity timeout (3.5s). Transferred ownership back to Master Client.");
}
}
private void SpawnDebugMarker(Vector3 position)
{
//IL_001b: 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)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Expected O, but got Unknown
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
try
{
GameObject val = GameObject.CreatePrimitive((PrimitiveType)0);
((Object)val).name = "Aimbot_Target_Indicator";
val.transform.position = position;
val.transform.localScale = new Vector3(0.25f, 0.25f, 0.25f);
Collider val2 = default(Collider);
if (val.TryGetComponent<Collider>(ref val2))
{
Object.Destroy((Object)(object)val2);
}
Renderer val3 = default(Renderer);
if (val.TryGetComponent<Renderer>(ref val3))
{
val3.material = new Material(Shader.Find("Sprites/Default"));
val3.material.color = Color.red;
}
Object.Destroy((Object)(object)val, 3f);
}
catch (Exception ex)
{
Debug.LogError((object)("[Arc Aimbot] Failed to render mod debug tracker sphere: " + ex.Message));
}
}
public void OnOwnershipRequest(PhotonView targetView, Player requestingPlayer)
{
targetView.RequestOwnership();
targetView.TransferOwnership(requestingPlayer);
tinyTweaks.Log.LogInfo((object)("[BasketballMagnet] Ownership requested by Player " + requestingPlayer.UserId + ". Attempting transfer..."));
}
public void OnOwnershipTransfered(PhotonView targetView, Player previousOwner)
{
if ((Object)(object)targetView == (Object)(object)pv && pv.IsMine)
{
ResetState();
FindNearestHoop();
tinyTweaks.Log.LogInfo((object)"[BasketballMagnet] Ownership transfer successful. Assist system active.");
}
}
public void OnOwnershipTransferFailed(PhotonView targetView, Player previousOwner)
{
tinyTweaks.Log.LogInfo((object)"[BasketballMagnet] Ownership transfer failed.");
}
}
internal class BingBongSays
{
[HarmonyPatch(typeof(Action_AskBingBong), "RunAction")]
public static class BingBongPatch
{
[HarmonyPrefix]
public static bool Prefix(Action_AskBingBong __instance)
{
if (!enableBingBongPatch.Value)
{
return true;
}
if (bingBongAnswer.Value >= (float)__instance.responses.Length)
{
bingBongAnswer.Value = __instance.responses.Length - 1;
bingBongAnswer.SettingChanged += delegate
{
if (bingBongAnswer.Value % 1f != 0f)
{
tinyTweaks.Log.LogWarning((object)$"BingBongAnswer value {bingBongAnswer.Value} is not an integer. Rounding down to nearest integer.");
bingBongAnswer.Value = Mathf.FloorToInt(bingBongAnswer.Value);
}
};
}
int num = Mathf.FloorToInt(bingBongAnswer.Value);
((MonoBehaviourPun)((ItemActionBase)__instance).item).photonView.RPC("Ask", (RpcTarget)0, new object[2]
{
num,
Time.time < __instance.lastAsked + 1f
});
return false;
}
}
public static ConfigEntry<float> bingBongAnswer;
public static ConfigEntry<bool> enableBingBongPatch;
private static ConfigFile config;
public static void Start()
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Expected O, but got Unknown
config = tinyTweaks.config;
enableBingBongPatch = config.Bind<bool>("Shorties", "BingBong", false, (ConfigDescription)null);
bingBongAnswer = config.Bind<float>("Shorties", "BingBongAnswer(rounded down)", 0f, new ConfigDescription("The answer to the Bing Bong action.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 30f), Array.Empty<object>()));
bingBongAnswer.SettingChanged += delegate
{
if (bingBongAnswer.Value % 1f != 0f)
{
tinyTweaks.Log.LogWarning((object)$"BingBongAnswer value {bingBongAnswer.Value} is not an integer. Rounding down to nearest integer.");
bingBongAnswer.Value = Mathf.FloorToInt(bingBongAnswer.Value);
}
};
}
}
internal class CampfireProtection : MonoBehaviour
{
private Vector3 protectionPoint;
private float timeToCheck = 0f;
private float delayTime = 1f;
private Dictionary<Character, float> playersAtCampfire = new Dictionary<Character, float>();
private Campfire campfire;
private void Awake()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
protectionPoint = ((Component)this).transform.position;
campfire = ((Component)this).GetComponent<Campfire>();
}
private void Update()
{
//IL_0055: 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)
if (timeToCheck > Time.time)
{
return;
}
timeToCheck = Time.time + delayTime;
foreach (Character allCharacter in Character.AllCharacters)
{
if (!allCharacter.data.dead && Vector3.Distance(protectionPoint, allCharacter.Center) < campfire.moraleBoostRadius)
{
if (playersAtCampfire.ContainsKey(allCharacter))
{
addCampfireEffect(allCharacter.refs.afflictions, campfire);
continue;
}
float currentStatus = allCharacter.refs.afflictions.GetCurrentStatus((STATUSTYPE)1);
playersAtCampfire.Add(allCharacter, currentStatus);
}
}
}
private void addCampfireEffect(CharacterAfflictions c, Campfire campfire)
{
if (PhotonNetwork.IsMasterClient)
{
float[] array = new float[CharacterAfflictions.NumStatusTypes];
float currentStatus = c.GetCurrentStatus((STATUSTYPE)1);
if (currentStatus < playersAtCampfire[c.character])
{
playersAtCampfire[c.character] = currentStatus;
}
float num = currentStatus - playersAtCampfire[c.character];
array[1] = 0f - num;
float currentStatus2 = c.GetCurrentStatus((STATUSTYPE)2);
if (currentStatus2 > 0f)
{
array[2] = 0f - currentStatus2;
}
((MonoBehaviourPun)c).photonView.RPC("RPC_ApplyStatusesFromFloatArray", (RpcTarget)0, new object[1] { array });
}
}
}
internal class canDrop
{
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
public static class CurrentItemPatch
{
[HarmonyPostfix]
private static void Postfix(CharacterData __instance, Item value)
{
if (!((Object)(object)value == (Object)null) && __instance.character.IsLocal && (!value.UIData.canThrow || !value.UIData.canDrop))
{
value.UIData.canThrow = true;
value.UIData.canDrop = true;
}
}
}
}
internal class ChangeRopeToRed
{
[HarmonyPatch]
private static class changeRope
{
[HarmonyPatch(typeof(RopeAnchorWithRope), "SpawnRope")]
[HarmonyPrefix]
private static void Prefix(RopeAnchorWithRope __instance)
{
if (enableRedRope.Value)
{
if (((Object)__instance.ropePrefab).name.Contains("Anti"))
{
tinyTweaks.log("Rope anchor has antigravity, skipping rope change");
return;
}
__instance.ropePrefab = Resources.Load<GameObject>("RopeDynamicBreakable");
tinyTweaks.log("Rope prefab changed to breakable version");
}
}
[HarmonyPatch(typeof(RopeSpool), "Awake")]
[HarmonyPrefix]
private static void changeRopeSpool(RopeSpool __instance)
{
if (enableRedRope.Value)
{
if ((Object)(object)((Component)__instance).GetComponent<Antigrav>() != (Object)null)
{
tinyTweaks.log("Rope spool has antigravity, skipping rope change");
return;
}
__instance.ropePrefab = Resources.Load<GameObject>("RopeDynamicBreakable");
tinyTweaks.log("Rope prefab changed to breakable version");
((Component)__instance).GetComponent<RopeTier>().anchorPrefab = Resources.Load<GameObject>("RopeAnchorWithRopeBreakable");
}
}
}
private static ConfigEntry<bool> enableRedRope;
public static void Start()
{
enableRedRope = tinyTweaks.config.Bind<bool>("Customization", "Red Rope", true, (ConfigDescription)null);
tinyTweaks.log("ChangeRopeToRed plugin loaded");
}
}
public class Customizations
{
[HarmonyPatch(typeof(CharacterData), "SetBadgeStatus")]
public static class NoobSashPatch
{
[HarmonyPrefix]
public static bool Prefix(CharacterData __instance)
{
if (!NoobSash.Value)
{
return true;
}
if (!((Component)__instance).GetComponent<Character>().IsLocal)
{
return true;
}
__instance.badgeStatus = new bool[GUIManager.instance.mainBadgeManager.badgeData.Length];
for (int i = 0; i < __instance.badgeStatus.Length; i++)
{
__instance.badgeStatus[i] = false;
}
((MonoBehaviourPun)__instance).photonView.RPC("SyncBadgeStatus", (RpcTarget)0, new object[1] { __instance.badgeStatus });
return false;
}
}
public static ConfigEntry<bool> NoobSash;
public static ConfigEntry<bool> DeadEyes;
public static ConfigEntry<bool> passedOutEyes;
public static ConfigEntry<bool> NormalEyes;
private static ConfigEntry<KeyCode> deadEyesKey;
private static ConfigEntry<KeyCode> passedEyesKey;
private static ConfigEntry<KeyCode> NormalEyesKey;
public static void Start()
{
ConfigFile config = tinyTweaks.config;
NoobSash = config.Bind<bool>("Customization", "Noob Sash", false, "Toggle the Noob Sash (hides badges) on/off.");
DeadEyes = config.Bind<bool>("Customization", "Dead Eyes", false, "Toggle the Dead Eyes on/off.");
passedOutEyes = config.Bind<bool>("Customization", "Passed Out Eyes", false, "Toggle the Passed Out Eyes on/off.");
NormalEyes = config.Bind<bool>("Customization", "Normal Eyes", false, "Toggle the Normal Eyes on/off.");
deadEyesKey = config.Bind<KeyCode>("Customization", "Dead Eyes Keybind", (KeyCode)0, (ConfigDescription)null);
passedEyesKey = config.Bind<KeyCode>("Customization", "Passed Out Eyes Keybind", (KeyCode)0, (ConfigDescription)null);
NormalEyesKey = config.Bind<KeyCode>("Customization", "Normal Eyes Keybind", (KeyCode)0, (ConfigDescription)null);
NoobSash.SettingChanged += delegate
{
tinyTweaks.Notification("Noob Sash is " + (NoobSash.Value ? "ON" : "OFF"));
Character localCharacter = Character.localCharacter;
CharacterData val = ((localCharacter != null) ? ((Component)localCharacter).GetComponent<CharacterData>() : null);
if ((Object)(object)val != (Object)null)
{
AccessTools.Method(typeof(CharacterData), "SetBadgeStatus", (Type[])null, (Type[])null).Invoke(val, null);
}
};
DeadEyes.Value = false;
passedOutEyes.Value = false;
NormalEyes.Value = false;
DeadEyes.SettingChanged += delegate
{
if (DeadEyes.Value)
{
tinyTweaks.Notification("Dead Eyes is " + (DeadEyes.Value ? "ON" : "OFF"));
DeadEyes.Value = false;
passedOutEyes.Value = false;
NormalEyes.Value = false;
Character localCharacter = Character.localCharacter;
if ((Object)(object)localCharacter != (Object)null)
{
((MonoBehaviourPun)localCharacter).photonView.RPC("CharacterDied", (RpcTarget)3, Array.Empty<object>());
}
}
};
passedOutEyes.SettingChanged += delegate
{
if (passedOutEyes.Value)
{
tinyTweaks.Notification("Passed Out Eyes is " + (passedOutEyes.Value ? "ON" : "OFF"));
passedOutEyes.Value = false;
DeadEyes.Value = false;
NormalEyes.Value = false;
Character localCharacter = Character.localCharacter;
if ((Object)(object)localCharacter != (Object)null)
{
((MonoBehaviourPun)localCharacter).photonView.RPC("CharacterPassedOut", (RpcTarget)3, Array.Empty<object>());
}
}
};
NormalEyes.SettingChanged += delegate
{
if (NormalEyes.Value)
{
tinyTweaks.Notification("Normal Eyes is " + (NormalEyes.Value ? "ON" : "OFF"));
NormalEyes.Value = false;
DeadEyes.Value = false;
passedOutEyes.Value = false;
Character localCharacter = Character.localCharacter;
if ((Object)(object)localCharacter != (Object)null)
{
((MonoBehaviourPun)localCharacter).photonView.RPC("OnRevive_RPC", (RpcTarget)3, Array.Empty<object>());
}
}
};
}
public static void Update()
{
//IL_0006: 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)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
if (Input.GetKeyDown(deadEyesKey.Value))
{
DeadEyes.Value = true;
}
if (Input.GetKeyDown(passedEyesKey.Value))
{
passedOutEyes.Value = true;
}
if (Input.GetKeyDown(NormalEyesKey.Value))
{
NormalEyes.Value = true;
}
}
}
public class ExtraMarshmallows
{
[HarmonyPatch(typeof(MapHandler), "SpawnCampfireItems")]
private class SetCampfire
{
[HarmonyPrefix]
public static bool Prefix(GameObject campfireRoot, bool skipMallows)
{
if (!Object.op_Implicit((Object)(object)campfireRoot) || skipMallows)
{
return true;
}
nextCampfire = campfireRoot.GetComponentInChildren<Campfire>();
if ((Object)(object)nextCampfire == (Object)null)
{
tinyTweaks.Log.LogError((object)"Campfire Component not found");
return true;
}
if (enableCampfireProtection.Value)
{
((Component)nextCampfire).gameObject.AddComponent<CampfireProtection>();
}
if (!PhotonNetwork.IsMasterClient)
{
return true;
}
if (enableExtraBackpacks.Value && backpackPercent.Value > 0f)
{
float num = playerCount - marshmallowsTaken;
if (backpackPercent.Value != 100f)
{
num *= backpackPercent.Value / 100f;
}
int num2 = Mathf.CeilToInt(num);
for (int i = 0; i < num2; i++)
{
SpawnExtraBackpacks(i);
}
}
if (!enableExtraMarshmallows.Value)
{
return true;
}
tinyTweaks.log("Skipping Spawning campfire items for " + ((Object)campfireRoot.gameObject).name);
marshmallows.Clear();
marshmallowsTaken = 0;
charactersThatPickedUp.Clear();
RefreshMarshmallows();
return false;
}
}
[HarmonyPatch(typeof(PlayerConnectionLog))]
private class PlayerConnectionLogPatches
{
[HarmonyPatch("OnPlayerEnteredRoom")]
[HarmonyPostfix]
private static void OnPlayerEnter()
{
if (isMasterAndEnabled)
{
tinyTweaks.log("Someone joined! Updated Marshmallows to:" + playerCount);
RefreshMarshmallows();
}
}
[HarmonyPatch("OnPlayerLeftRoom")]
[HarmonyPostfix]
private static void OnPlayerLeft()
{
if (isMasterAndEnabled)
{
tinyTweaks.log("Someone left! Updated Marshmallows to:" + playerCount);
RefreshMarshmallows();
}
}
}
[HarmonyPatch(typeof(Item))]
private class MarshmallowProtection
{
[HarmonyPatch("RequestPickup")]
[HarmonyPrefix]
private static bool onRequestPickup(Item __instance, PhotonView characterView)
{
if (!PhotonNetwork.IsMasterClient || !enableExtraMarshmallows.Value)
{
return true;
}
if (!marshmallows.Contains(((Component)__instance).gameObject))
{
return true;
}
if (charactersThatPickedUp.ContainsKey(characterView) && (extraMallowsPerScout.Value == 0 || charactersThatPickedUp[characterView] >= extraMallowsPerScout.Value))
{
tinyTweaks.log(((Object)characterView).name + " tried taking another Marshmallow! Unbelieveable...");
__instance.view.RPC("DenyPickupRPC", characterView.Owner, Array.Empty<object>());
return false;
}
if (!charactersThatPickedUp.ContainsKey(characterView))
{
charactersThatPickedUp.Add(characterView, 1);
}
else
{
charactersThatPickedUp[characterView]++;
}
marshmallows.Remove(((Component)__instance).gameObject);
return true;
}
[HarmonyPatch("SetKinematicRPC")]
[HarmonyPostfix]
private static void MarshmallowStandInPlace(Item __instance, bool value, Vector3 position, Quaternion rotation)
{
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
if (isMasterAndEnabled && marshmallows.Contains(((Component)__instance).gameObject) && !value)
{
__instance.SetKinematicNetworked(true, __instance.transform.position, __instance.transform.rotation);
}
}
}
private static ConfigEntry<bool> enableExtraMarshmallows;
private static ConfigEntry<bool> enableExtraBackpacks;
private static ConfigEntry<bool> enableCampfireProtection;
private static ConfigEntry<float> hotdogPercent;
private static ConfigEntry<float> backpackPercent;
private static ConfigEntry<float> fannypackChance;
private static ConfigEntry<int> cheatMallows;
private static ConfigEntry<int> extraMallowsPerScout;
private static ConfigEntry<bool> isCookedMarshmallow;
public static Campfire nextCampfire;
private static List<GameObject> marshmallows = new List<GameObject>();
private static Dictionary<PhotonView, int> charactersThatPickedUp = new Dictionary<PhotonView, int>();
private static float radius = 2f;
private static int marshmallowsTaken = 0;
private static int playerCount => PhotonNetwork.CurrentRoom.PlayerCount;
private static Vector3 originPoint => ((Component)nextCampfire).transform.position;
private static bool isMasterAndEnabled => PhotonNetwork.IsMasterClient && enableExtraMarshmallows.Value;
public static void Start()
{
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Expected O, but got Unknown
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Expected O, but got Unknown
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Expected O, but got Unknown
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Expected O, but got Unknown
//IL_0142: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Expected O, but got Unknown
ConfigFile config = tinyTweaks.config;
enableExtraMarshmallows = config.Bind<bool>("Campfire", "Extra Marshmallows", true, (ConfigDescription)null);
enableExtraBackpacks = config.Bind<bool>("Campfire", "Extra Backpacks", false, (ConfigDescription)null);
enableCampfireProtection = config.Bind<bool>("Campfire", "Campfire Protection", true, (ConfigDescription)null);
hotdogPercent = config.Bind<float>("Campfire", "Hotdog spawn chance", 33f, new ConfigDescription("from 0 to 100%", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>()));
backpackPercent = config.Bind<float>("Campfire", "Any Backpack spawn chance", 100f, new ConfigDescription("from 0 to 100%", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>()));
fannypackChance = config.Bind<float>("Campfire", "Fannypack chance", 33f, new ConfigDescription("from 0 to 100%", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>()));
extraMallowsPerScout = config.Bind<int>("Campfire", "Extra Marshmallows per scout", 0, new ConfigDescription("0 disabled - to idk 21", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 21), Array.Empty<object>()));
cheatMallows = config.Bind<int>("Campfire", "Cheat mallows", 0, new ConfigDescription("0 disabled - to 250", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 250), Array.Empty<object>()));
isCookedMarshmallow = config.Bind<bool>("Campfire", "Cook Marshmallows", false, (ConfigDescription)null);
}
private static void RefreshMarshmallows()
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)nextCampfire == (Object)null)
{
return;
}
Vector3 position = ((Component)nextCampfire).transform.position;
foreach (GameObject marshmallow in marshmallows)
{
if ((Object)(object)marshmallow == (Object)null)
{
marshmallowsTaken++;
continue;
}
PhotonView photonView = PunExtensions.GetPhotonView(marshmallow);
if (!((Object)(object)photonView == (Object)null))
{
if (!photonView.IsMine)
{
photonView.RequestOwnership();
}
PhotonNetwork.Destroy(marshmallow);
}
}
marshmallows.Clear();
tinyTweaks.log($"RefreshMarshmallows Called! Taken: {marshmallowsTaken}/{playerCount}");
int num = 0;
int num2 = ((extraMallowsPerScout.Value == 0) ? (playerCount - marshmallowsTaken) : (playerCount * extraMallowsPerScout.Value - marshmallowsTaken));
for (int i = 0; i < num2; i++)
{
SpawnMarshmallow(i);
num = i;
}
for (int j = 0; j < cheatMallows.Value; j++)
{
num++;
SpawnMarshmallow(num, isProtected: false);
}
tinyTweaks.log("Marshmallows number: " + num);
}
private static void SpawnMarshmallow(int partOfCircle, bool isProtected = true)
{
//IL_0037: 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_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: 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_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: 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_008a: 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)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
float num = (float)partOfCircle * (MathF.PI * 2f / (float)playerCount + (float)cheatMallows.Value);
float num2 = Mathf.Cos(num) * radius;
float num3 = Mathf.Sin(num) * radius;
Vector3 val = originPoint + new Vector3(num2, 0f, num3);
val.y = CastToFloor(val);
Vector3 val2 = originPoint - val;
val2.y = 0f;
Quaternion val3 = Quaternion.LookRotation(val2) * Quaternion.Euler(0f, -90f, 0f);
string text = "0_Items/Marshmallow";
if (Random.value <= hotdogPercent.Value / 100f)
{
text = "0_Items/Glizzy";
}
GameObject val4 = PhotonNetwork.InstantiateRoomObject(text, val, val3, (byte)0, (object[])null);
Item component = val4.GetComponent<Item>();
if (isCookedMarshmallow.Value)
{
((MonoBehaviourPun)component).photonView.RPC("SetCookedAmountRPC", (RpcTarget)0, new object[1] { 1 });
}
if ((Object)(object)component != (Object)null)
{
component.SetKinematicNetworked(true);
}
if (isProtected)
{
marshmallows.Add(val4);
}
}
private static void SpawnExtraBackpacks(int partOfCircle)
{
//IL_0037: 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_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: 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_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: 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_008a: 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)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
float num = (float)partOfCircle * (MathF.PI * 2f / (float)playerCount);
float num2 = Mathf.Cos(num) * radius * 2f;
float num3 = Mathf.Sin(num) * radius * 2f;
Vector3 val = originPoint + new Vector3(num2, 0f, num3);
val.y = CastToFloor(val);
Vector3 val2 = originPoint - val;
val2.y = 0f;
Quaternion val3 = Quaternion.LookRotation(val2) * Quaternion.Euler(0f, -90f, 0f);
string text = "0_Items/Backpack";
if (Random.value <= fannypackChance.Value / 100f)
{
text = "0_Items/Fannypack";
}
GameObject val4 = PhotonNetwork.InstantiateRoomObject(text, val, val3, (byte)0, (object[])null);
}
private static float CastToFloor(Vector3 spawnPosition)
{
//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_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: 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_002e: Unknown result type (might be due to invalid IL or missing references)
RaycastHit val = default(RaycastHit);
if (Physics.Raycast(spawnPosition + Vector3.up * 5f, Vector3.down, ref val, 10f))
{
return ((RaycastHit)(ref val)).point.y;
}
return spawnPosition.y;
}
}
public class ItemAimbotFinder : MonoBehaviour
{
[HarmonyPatch(typeof(Item))]
private static class FixDupingBasketballs
{
[HarmonyPatch("RequestPickup")]
[HarmonyPrefix]
private static bool onRequestPickup(Item __instance, PhotonView characterView)
{
if (((MonoBehaviourPun)__instance).photonView.Owner != PhotonNetwork.MasterClient)
{
((MonoBehaviourPun)__instance).photonView.TransferOwnership(PhotonNetwork.MasterClient);
}
return true;
}
}
[Header("Global Scan Settings")]
public float scanInterval = 0.5f;
private float nextScanTime;
private HashSet<int> pendingRequests = new HashSet<int>();
private static ConfigEntry<string> Basketball;
public static ConfigEntry<bool> EnableAssist { get; private set; }
public static ConfigEntry<bool> RageAimbot { get; private set; }
public static ConfigEntry<float> PeakHeightAboveHoop { get; private set; }
public static ConfigEntry<float> HoopEntryHeightOffset { get; private set; }
public static ConfigEntry<bool> ShowVisualTargetMarker { get; private set; }
public static ConfigEntry<float> MinimumThrowSpeedBasketBall { get; private set; }
public static ConfigEntry<float> GlobalXOffset { get; private set; }
public static void Binds()
{
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Expected O, but got Unknown
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Expected O, but got Unknown
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Expected O, but got Unknown
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Expected O, but got Unknown
ConfigFile config = tinyTweaks.config;
EnableAssist = config.Bind<bool>("Basketball", "Enable Assist", true, "Master toggle for the assist system.");
RageAimbot = config.Bind<bool>("Basketball", "RageAim-Bot", false, "When true, runs infinitely without self-destructing. When false, acts as one-time recorrections.");
PeakHeightAboveHoop = config.Bind<float>("Basketball", "Arc", 1.5f, new ConfigDescription("How high above the hoop the ball will reach at the peak of its arc.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>()));
HoopEntryHeightOffset = config.Bind<float>("Basketball", "Hoop Entry Height Offset", 0.5f, new ConfigDescription("An additional upward vertical offset directly above the hoop component to aim for before dropping.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-2f, 5f), Array.Empty<object>()));
MinimumThrowSpeedBasketBall = config.Bind<float>("Basketball", "Minimum Throw Speed", 4.5f, new ConfigDescription("Minimum velocity magnitude required at release to trigger the physics assist.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 30f), Array.Empty<object>()));
GlobalXOffset = config.Bind<float>("Basketball", "Global X Axis Offset", 0.8f, new ConfigDescription("Manually shifts the target position along Unity's absolute Global X axis to counter steady directional drifting.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-5f, 5f), Array.Empty<object>()));
ShowVisualTargetMarker = config.Bind<bool>("Basketball", "Show Target Marker Sphere", true, "Spawns a temporary physical red marker sphere in-game where the calculation is aiming.");
Basketball = config.Bind<string>("Basketball", "Basketball ItemName", "Basketball", "The substring used to identify Basketball items in the scene.");
}
private void Update()
{
if (Time.time >= nextScanTime)
{
nextScanTime = Time.time + scanInterval;
ScanAndSetupDynamicItems();
}
}
private void ScanAndSetupDynamicItems()
{
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
Item[] array = Object.FindObjectsByType<Item>((FindObjectsSortMode)0);
Item[] array2 = array;
foreach (Item val in array2)
{
if ((Object)(object)val == (Object)null)
{
continue;
}
if ((Object)(object)val.holderCharacter != (Object)null)
{
BasketballMagnet component = ((Component)val).GetComponent<BasketballMagnet>();
if ((Object)(object)component != (Object)null)
{
component.ResetState();
}
continue;
}
GameObject gameObject = ((Component)val).gameObject;
string name = ((Object)gameObject).name;
Rigidbody component2 = gameObject.GetComponent<Rigidbody>();
if ((Object)(object)component2 == (Object)null)
{
continue;
}
PhotonView component3 = gameObject.GetComponent<PhotonView>();
if ((Object)(object)component3 == (Object)null)
{
continue;
}
if (component3.IsMine && pendingRequests.Contains(component3.ViewID))
{
pendingRequests.Remove(component3.ViewID);
}
if (!name.Contains(Basketball.Value) || (!EnableAssist.Value && !RageAimbot.Value))
{
continue;
}
Vector3 linearVelocity = component2.linearVelocity;
if (((Vector3)(ref linearVelocity)).magnitude <= MinimumThrowSpeedBasketBall.Value || ((Object)(object)((Component)component3).GetComponent<BasketballMagnet>() != (Object)null && !((Component)component3).GetComponent<BasketballMagnet>().hasLeftHand))
{
continue;
}
if (!component3.IsMine)
{
if (!pendingRequests.Contains(component3.ViewID))
{
pendingRequests.Add(component3.ViewID);
component3.RequestOwnership();
}
}
else
{
EnsureBasketballComponent(gameObject);
}
}
}
private BasketballMagnet EnsureBasketballComponent(GameObject target)
{
BasketballMagnet basketballMagnet = target.GetComponent<BasketballMagnet>();
if ((Object)(object)basketballMagnet == (Object)null)
{
basketballMagnet = target.AddComponent<BasketballMagnet>();
}
return basketballMagnet;
}
}
internal class LetMeLEAVE
{
[HarmonyPatch(typeof(LoadingScreen), "Awake")]
private static class patches
{
[HarmonyPostfix]
private static void removeLoadingScreenPatch(LoadingScreen __instance)
{
tinyTweaks.log("found loadingScreen");
loadingScreen = ((Component)__instance).gameObject;
}
}
private static ConfigEntry<KeyCode> leaveKeybind;
private static GameObject loadingScreen;
private static float timeToHold = 5f;
private static float timeHeld = 0f;
public static void Update()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
Scene activeScene = SceneManager.GetActiveScene();
if (((Scene)(ref activeScene)).name == "Title")
{
return;
}
if (Input.GetKey(leaveKeybind.Value))
{
timeHeld += Time.deltaTime;
}
else
{
timeHeld = 0f;
}
if (timeHeld > timeToHold)
{
Player.LeaveCurrentGame();
GameObject obj = loadingScreen;
Transform val = ((obj != null) ? obj.transform.Find("LoadingText") : null);
if ((Object)(object)val != (Object)null)
{
((Component)val).gameObject.SetActive(false);
}
GameObject obj2 = loadingScreen;
Transform val2 = ((obj2 != null) ? obj2.transform.Find("Black") : null);
if ((Object)(object)val2 != (Object)null)
{
((Component)val2).gameObject.SetActive(false);
}
timeHeld = -999f;
}
}
public static void Start()
{
leaveKeybind = tinyTweaks.config.Bind<KeyCode>("Shorties", "Leave button", (KeyCode)0, (ConfigDescription)null);
}
}
internal class moveVersion : MonoBehaviour
{
[HarmonyPatch]
private static class UIPatches
{
[HarmonyPatch(typeof(VersionString), "Start")]
[HarmonyPostfix]
private static void setVersionObj(VersionString __instance)
{
//IL_0065: 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_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)
((Component)__instance).gameObject.AddComponent<moveVersion>();
version = ((Component)__instance).gameObject;
if (((Object)version.transform.parent).name == "VersionStack")
{
version = ((Component)version.transform.parent).gameObject;
peaker = true;
}
previousPosVersion = version.transform.localPosition;
if (peaker)
{
previousPosVersion = ((Transform)version.GetComponent<RectTransform>()).localPosition;
}
tinyTweaks.log("VersionString found!" + (peaker ? " (PEAKER detected)" : ""));
updateVersionText();
}
[HarmonyPatch(typeof(AscentUI), "Start")]
[HarmonyPostfix]
private static void setAscentObj(AscentUI __instance)
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
tinyTweaks.log("found AscentUI");
ascentUI = ((Component)__instance).gameObject;
previousPosAscent = ascentUI.transform.localPosition;
moveAscentText();
}
}
private static ConfigEntry<bool> hideVersionText;
private static ConfigEntry<bool> moveVersionText;
private static ConfigEntry<float> Xpos;
private static ConfigEntry<float> Ypos;
private static GameObject version = null;
private static Vector3 previousPosVersion;
private static ConfigEntry<bool> moveAscentUI;
private static ConfigEntry<float> XposAscent;
private static ConfigEntry<float> YposAscent;
private static GameObject ascentUI = null;
private static Vector3 previousPosAscent;
private static ConfigEntry<bool> usePeakFont;
private static Dictionary<TextMeshProUGUI, TMP_FontAsset> defaultFonts = new Dictionary<TextMeshProUGUI, TMP_FontAsset>();
private static TMP_FontAsset peakFont = null;
private static ConfigEntry<float> fontSize;
private static ConfigEntry<TextAlignment> textAlignment;
private static ConfigEntry<string> versionTextColor;
private static ConfigEntry<string> ascentTextColor;
private static bool peaker = false;
public static void Binds()
{
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Expected O, but got Unknown
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Expected O, but got Unknown
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Expected O, but got Unknown
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Expected O, but got Unknown
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Expected O, but got Unknown
ConfigFile config = tinyTweaks.config;
hideVersionText = config.Bind<bool>("Version", "Hide Version", false, (ConfigDescription)null);
moveVersionText = config.Bind<bool>("Version", "Move Version Text", true, (ConfigDescription)null);
Xpos = config.Bind<float>("Version", "X position", 890f, new ConfigDescription("", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-2000f, 2000f), Array.Empty<object>()));
Ypos = config.Bind<float>("Version", "Y position", 545f, new ConfigDescription("", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-2000f, 2000f), Array.Empty<object>()));
moveAscentUI = config.Bind<bool>("Version", "Move Ascent Text", true, (ConfigDescription)null);
XposAscent = config.Bind<float>("Version", "X position Ascent", 940f, new ConfigDescription("", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-2000f, 2000f), Array.Empty<object>()));
YposAscent = config.Bind<float>("Version", "Y position Ascent", 490f, new ConfigDescription("", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-2000f, 2000f), Array.Empty<object>()));
usePeakFont = config.Bind<bool>("Version", "Use Peak Font", true, (ConfigDescription)null);
fontSize = config.Bind<float>("Version", "Font Size", 24f, new ConfigDescription("", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>()));
textAlignment = config.Bind<TextAlignment>("Version", "Text Alignment", (TextAlignment)1, (ConfigDescription)null);
versionTextColor = config.Bind<string>("Version", "Version Text Color", "DBD7BF", (ConfigDescription)null);
ascentTextColor = config.Bind<string>("Version", "Ascent Text Color", "DBD7BF", (ConfigDescription)null);
}
private void Start()
{
tinyTweaks.log("Trying to find VersionString");
hideVersionText.SettingChanged += delegate
{
updateVersionText();
};
moveVersionText.SettingChanged += delegate
{
updateVersionText();
};
Xpos.SettingChanged += delegate
{
updateVersionText();
};
Ypos.SettingChanged += delegate
{
updateVersionText();
};
textAlignment.SettingChanged += delegate
{
updateVersionText();
};
versionTextColor.SettingChanged += delegate
{
updateVersionText();
};
fontSize.SettingChanged += delegate
{
updateVersionText();
};
usePeakFont.SettingChanged += delegate
{
updateVersionText();
};
moveAscentUI.SettingChanged += delegate
{
moveAscentText();
};
XposAscent.SettingChanged += delegate
{
moveAscentText();
};
YposAscent.SettingChanged += delegate
{
moveAscentText();
};
ascentTextColor.SettingChanged += delegate
{
moveAscentText();
};
defaultFonts.Clear();
}
private static void updateVersionText()
{
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)version == (Object)null)
{
return;
}
if (hideVersionText.Value)
{
version.SetActive(false);
return;
}
version.SetActive(true);
if (peaker)
{
moveVersionTextAndAlign(((Component)version.transform.GetChild(0)).gameObject);
((MonoBehaviour)tinyTweaks.Instance).StartCoroutine(WaitForPEAKtext());
}
else
{
moveVersionTextAndAlign(version);
}
if (!moveVersionText.Value)
{
if (peaker)
{
((Transform)version.GetComponent<RectTransform>()).localPosition = previousPosVersion;
((LayoutGroup)version.GetComponent<VerticalLayoutGroup>()).childAlignment = (TextAnchor)0;
version.GetComponent<RectTransform>().pivot = new Vector2(0f, 1f);
}
else
{
version.transform.localPosition = previousPosVersion;
((TMP_Text)version.GetComponent<TextMeshProUGUI>()).alignment = (TextAlignmentOptions)257;
version.GetComponent<RectTransform>().pivot = new Vector2(0f, 1f);
}
}
}
private static void moveVersionTextAndAlign(GameObject ver)
{
//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_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Expected I4, but got Unknown
//IL_006d: 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)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Expected I4, but got Unknown
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
TextMeshProUGUI component = ver.GetComponent<TextMeshProUGUI>();
RectTransform component2 = ver.GetComponent<RectTransform>();
ApplyColor(component, versionTextColor.Value);
peakfontUpdate(component);
if (!moveVersionText.Value)
{
return;
}
if (peaker)
{
RectTransform component3 = version.GetComponent<RectTransform>();
((Transform)component3).localPosition = new Vector3(Xpos.Value, Ypos.Value, 0f);
VerticalLayoutGroup component4 = version.GetComponent<VerticalLayoutGroup>();
((LayoutGroup)component4).childAlignment = (TextAnchor)4;
TextAlignment value = textAlignment.Value;
TextAlignment val = value;
switch ((int)val)
{
case 0:
((LayoutGroup)component4).childAlignment = (TextAnchor)3;
component3.pivot = new Vector2(0f, 1f);
break;
case 1:
((LayoutGroup)component4).childAlignment = (TextAnchor)4;
component3.pivot = new Vector2(0.5f, 1f);
break;
case 2:
((LayoutGroup)component4).childAlignment = (TextAnchor)5;
component3.pivot = new Vector2(1f, 1f);
break;
}
}
else
{
Vector2 pivot = component2.pivot;
pivot.y = 1f;
TextAlignment value2 = textAlignment.Value;
TextAlignment val2 = value2;
switch ((int)val2)
{
case 0:
((TMP_Text)component).horizontalAlignment = (HorizontalAlignmentOptions)1;
pivot.x = 0f;
break;
case 1:
((TMP_Text)component).horizontalAlignment = (HorizontalAlignmentOptions)2;
pivot.x = 0.5f;
break;
case 2:
((TMP_Text)component).horizontalAlignment = (HorizontalAlignmentOptions)4;
pivot.x = 1f;
break;
}
component2.pivot = pivot;
ver.transform.localPosition = new Vector3(Xpos.Value, Ypos.Value, 0f);
}
}
private static void moveAscentText()
{
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)ascentUI == (Object)null))
{
if (moveAscentUI.Value)
{
tinyTweaks.log("Moved AscentUI");
ascentUI.transform.localPosition = new Vector3(XposAscent.Value, YposAscent.Value, 0f);
ApplyColor(ascentUI.GetComponent<TextMeshProUGUI>(), ascentTextColor.Value);
}
else
{
ascentUI.transform.localPosition = previousPosAscent;
ApplyColor(ascentUI.GetComponent<TextMeshProUGUI>(), ascentTextColor.Value);
}
}
}
private static void ApplyColor(TextMeshProUGUI tmpro, string colorValue)
{
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)tmpro == (Object)null))
{
string text = colorValue?.Trim() ?? "FFFFFF";
if (text.StartsWith("#"))
{
text = text.Substring(1);
}
Color color = default(Color);
if (ColorUtility.TryParseHtmlString("#" + text, ref color))
{
((Graphic)tmpro).color = color;
}
}
}
private static void peakfontUpdate(TextMeshProUGUI tmpro)
{
if ((Object)(object)tmpro == (Object)null)
{
return;
}
if (!defaultFonts.ContainsKey(tmpro))
{
defaultFonts.Add(tmpro, ((TMP_Text)tmpro).font);
}
if (usePeakFont.Value)
{
if ((Object)(object)peakFont == (Object)null)
{
TMP_FontAsset[] array = Resources.FindObjectsOfTypeAll<TMP_FontAsset>();
peakFont = Array.Find(array, (TMP_FontAsset f) => ((Object)f).name == "DarumaDropOne-Regular SDF");
}
((TMP_Text)tmpro).font = peakFont;
((TMP_Text)tmpro).fontSize = fontSize.Value;
}
else
{
((TMP_Text)tmpro).font = defaultFonts[tmpro];
((TMP_Text)tmpro).fontSize = 18f;
}
}
private static IEnumerator WaitForPEAKtext()
{
yield return (object)new WaitForSeconds(5f);
Transform peakTextObj = version.transform.GetChild(1);
if ((Object)(object)peakTextObj != (Object)null)
{
moveVersionTextAndAlign(((Component)peakTextObj).gameObject);
}
}
}
internal class noBonusStaminaFromJumps
{
[HarmonyPatch]
private static class noBonusStamFromJumps
{
[HarmonyPatch(typeof(Character), "UseStamina")]
[HarmonyPrefix]
private static bool NoBonusStaminaFromJumps(Character __instance, float usage, ref bool useBonusStamina)
{
if (!__instance.IsLocal || !useBonusStamina || !enableNoStamJump.Value)
{
return true;
}
if (__instance.data.isSprinting && __instance.data.sinceJump < 0.2f)
{
useBonusStamina = false;
}
return true;
}
}
private static ConfigEntry<bool> enableNoStamJump;
public static void Start()
{
enableNoStamJump = tinyTweaks.config.Bind<bool>("Shorties", "NoBonusStaminaFromJumps", false, (ConfigDescription)null);
}
}
internal class Shields
{
[HarmonyPatch(typeof(CharacterAfflictions))]
private static class blockDaggerPatch
{
[HarmonyPatch("DieToRitualDagger")]
[HarmonyPrefix]
private static bool block()
{
if (!daggerShield.Value)
{
return true;
}
tinyTweaks.Notification("blocked stabbie stab!");
return false;
}
[HarmonyPatch("RPC_PetrifyInstantly")]
[HarmonyPrefix]
private static void blockPetrifyRequest(CharacterAfflictions __instance, bool killedByDagger, ref PhotonMessageInfo info)
{
if (info.Sender != ((MonoBehaviourPun)__instance).photonView.Owner)
{
tinyTweaks.Notification(info.Sender.NickName + " tried to petrify player " + ((Object)__instance).name + " by cheats!");
}
}
}
[HarmonyPatch]
private static class BlowgunShield
{
[HarmonyPatch(typeof(Action_RaycastDart), "RPC_DartImpact")]
[HarmonyPrefix]
private static bool block(Action_RaycastDart __instance, int characterID, Vector3 endpoint, ref PhotonMessageInfo info)
{
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
if (!blowgunShield.Value)
{
return true;
}
Character localCharacter = Character.localCharacter;
if (!((Object)(object)localCharacter == (Object)null))
{
PhotonView photonView = ((MonoBehaviourPun)localCharacter).photonView;
if (characterID == ((photonView != null) ? new int?(photonView.ViewID) : ((int?)null)))
{
if (!localCharacter.data.fullyConscious)
{
return true;
}
tinyTweaks.Notification("blocked blowgun from " + info.Sender.NickName);
Object.Instantiate<GameObject>(__instance.dartVFX, endpoint, Quaternion.identity);
GamefeelHandler.instance.AddPerlinShakeProximity(endpoint, 5f, 0.2f, 15f, 10f);
return false;
}
}
return true;
}
}
private static ConfigEntry<bool> daggerShield;
private static ConfigEntry<bool> blowgunShield;
public static void Start()
{
daggerShield = tinyTweaks.config.Bind<bool>("Shorties", "dagger Shield", false, (ConfigDescription)null);
blowgunShield = tinyTweaks.config.Bind<bool>("Shorties", "blowgun Shield", false, (ConfigDescription)null);
}
}
public class showNamesAlways
{
[HarmonyPatch(typeof(IsLookedAt))]
public static class IsLookedAtPatches
{
[HarmonyPatch("Update")]
[HarmonyPrefix]
public static bool IsLookAtUpdatePath(IsLookedAt __instance)
{
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: 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)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
if (!AlwaysShowNames.Value)
{
return true;
}
if ((Object)(object)__instance.playerNamePos == (Object)null || (Object)(object)__instance.mouth == (Object)null || (Object)(object)GUIManager.instance == (Object)null || (Object)(object)GUIManager.instance.playerNames == (Object)null)
{
return true;
}
bool flag = false;
float num = Vector3.Angle(((Component)MainCamera.instance).transform.forward, ((Component)__instance).transform.position - ((Component)MainCamera.instance).transform.position);
if (num < VisibleAngle.Value)
{
flag = true;
}
if (__instance.mouth.character.data.isBlind)
{
flag = DisplayWhenBlind.Value;
}
FieldInfo fieldInfo = AccessTools.Field(typeof(IsLookedAt), "index");
if (fieldInfo == null)
{
return true;
}
int num2 = (int)fieldInfo.GetValue(__instance);
GUIManager.instance.playerNames.UpdateName(num2, __instance.playerNamePos.position, flag, __instance.mouth.amplitudeIndex);
return false;
}
}
private static ConfigEntry<bool> AlwaysShowNames;
private static ConfigEntry<float> VisibleAngle;
private static ConfigEntry<bool> DisplayWhenBlind;
public static void Start()
{
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
ConfigFile config = tinyTweaks.config;
AlwaysShowNames = config.Bind<bool>("Show Names Always", "Always Show Names", true, (ConfigDescription)null);
VisibleAngle = config.Bind<float>("Show Names Always", "Visible Angle", 52f, new ConfigDescription("Visible Angle up to 360 deg", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 360f), Array.Empty<object>()));
DisplayWhenBlind = config.Bind<bool>("Show Names Always", "Show When Blind", false, (ConfigDescription)null);
}
}
internal class sitLonger
{
[HarmonyPatch]
private class Patcher
{
[HarmonyPatch(typeof(Character), "CreateHelperObjects")]
[HarmonyPostfix]
public static void CharacterUpdateAnims(Character __instance)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
List<KeyValuePair<AnimationClip, AnimationClip>> list = new List<KeyValuePair<AnimationClip, AnimationClip>>();
AnimatorOverrideController val = new AnimatorOverrideController();
val.runtimeAnimatorController = __instance.refs.animator.runtimeAnimatorController;
foreach (AnimationClip item in ((RuntimeAnimatorController)val).animationClips.Where((AnimationClip o) => ((Object)o).name.Equals("A_Scout_Emote_Sit")))
{
AnimationClip val2 = Object.Instantiate<AnimationClip>(item);
val2.wrapMode = (WrapMode)2;
list.Add(new KeyValuePair<AnimationClip, AnimationClip>(item, val2));
}
val.ApplyOverrides((IList<KeyValuePair<AnimationClip, AnimationClip>>)list);
__instance.refs.animator.runtimeAnimatorController = (RuntimeAnimatorController)(object)val;
}
[HarmonyPatch(typeof(CharacterAnimations), "RPCA_PlayRemove")]
[HarmonyPrefix]
public static void TrackEmote(CharacterAnimations __instance, string emoteName)
{
sittingPlayers[__instance] = emoteName;
}
[HarmonyPatch(typeof(CharacterAnimations), "Update")]
[HarmonyPrefix]
public static void CharacterAnimationsUpdatePostfix(CharacterAnimations __instance)
{
if (__instance.emoting && sittingPlayers.ContainsKey(__instance) && sittingPlayers[__instance].Equals("A_Scout_Emote_Sit"))
{
Character character = __instance.character;
if (!(((Vector2)(ref character.input.movementInput)).magnitude > 0.1f) && !character.input.jumpWasPressed && !(character.data.sinceGrounded > 0.2f))
{
__instance.sinceEmoteStart = 0f;
}
}
}
}
private const string sitEmote = "A_Scout_Emote_Sit";
private static readonly Dictionary<CharacterAnimations, string> sittingPlayers = new Dictionary<CharacterAnimations, string>();
}
internal class whisperTextChat
{
private static class InterceptMessage
{
[HarmonyPrefix]
private static bool SlashCommand(string message)
{
if (string.IsNullOrWhiteSpace(message) || !enableWhisperTextChat.Value)
{
return true;
}
string text = message.Split(' ')[0];
if (text.StartsWith("/w", StringComparison.OrdinalIgnoreCase) || text.StartsWith("/whisper", StringComparison.OrdinalIgnoreCase))
{
string text2 = message.Substring(text.Length).Trim();
string[] array = text2.Split(' ');
string text3 = array[0];
if (array.Length < 2)
{
logMessage("you need 2 parameters usage: /w playerName msg");
return false;
}
string text4 = text2.Substring(text3.Length);
Whisper(text3 + " " + text4);
return false;
}
if (text.StartsWith("/sit", StringComparison.OrdinalIgnoreCase))
{
Character localCharacter = Character.localCharacter;
if ((Object)(object)localCharacter == (Object)null)
{
return false;
}
localCharacter.refs.view.RPC("RPCA_PlayRemove", (RpcTarget)0, new object[2] { "A_Scout_Emote_Sit", false });
tinyTweaks.log("played sit emote");
return false;
}
return true;
}
}
private static ConfigEntry<bool> enableWhisperTextChat;
private static ConfigEntry<bool> whisperForYouEveryMsg;
private static byte chatEventCode = 81;
public static void CheckforPeakTextChat(Harmony harmony)
{
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Expected O, but got Unknown
enableWhisperTextChat = tinyTweaks.config.Bind<bool>("Shorties", "WhisperCmd", true, (ConfigDescription)null);
whisperForYouEveryMsg = tinyTweaks.config.Bind<bool>("Shorties", "send a (secret msg for you) everytime", true, (ConfigDescription)null);
if (Chainloader.PluginInfos.ContainsKey("com.borealityy.peaktextchat"))
{
tinyTweaks.log("found peaktextchat. Initializing patch!");
MethodInfo methodInfo = AccessTools.Method("PeakTextChat.TextChatManager:SendChatMessage", (Type[])null, (Type[])null);
HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(InterceptMessage), "SlashCommand", (Type[])null, (Type[])null));
if (methodInfo == null || val == null)
{
tinyTweaks.log((methodInfo == null) ? "didn't find peaktextchat method" : "didn't find whisper method");
}
else
{
harmony.Patch((MethodBase)methodInfo, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
}
}
}
private static void Whisper(Player whisperTo, string msg)
{
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Expected O, but got Unknown
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
bool flag = false;
msg = "<color=#8973a1>" + msg + " ";
msg += (whisperForYouEveryMsg.Value ? "<size=16><i>(secret msg for you)</i></size></color>" : "</color>");
object[] array = new object[4]
{
PhotonNetwork.LocalPlayer.NickName,
msg,
PhotonNetwork.LocalPlayer.UserId,
flag
};
byte num = chatEventCode;
RaiseEventOptions val = new RaiseEventOptions();
val.TargetActors = new int[1] { whisperTo.ActorNumber };
PhotonNetwork.RaiseEvent(num, (object)array, val, SendOptions.SendReliable);
logMessage("(/w) to " + returnNameWithColor(whisperTo) + ": " + msg);
}
private static void Whisper(string content)
{
string text = content.Split(' ')[0];
string msg = content.Substring(text.Length);
Player val = returnPlayerFromString(text);
if (val != null)
{
Whisper(val, msg);
}
}
public static void logMessage(string message)
{
MethodInfo methodInfo = AccessTools.Method("PeakTextChat.TextChatDisplay:AddMessage", new Type[1] { typeof(string) }, (Type[])null);
Type type = AccessTools.TypeByName("PeakTextChat.TextChatDisplay");
object obj = ((!(type != null)) ? null : AccessTools.Field(type, "instance")?.GetValue(null));
if (methodInfo != null && obj != null)
{
methodInfo.Invoke(obj, new object[1] { message });
}
else
{
tinyTweaks.log("logMethod could not be found");
}
}
private static string returnNameWithColor(Player plr)
{
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
string text = "";
Character val = returnCharacter(plr);
string text2 = ((!((Object)(object)val != (Object)null)) ? ColorUtility.ToHtmlStringRGB(new Color(0.64f, 0.69f, 0.83f)) : ColorUtility.ToHtmlStringRGB(val.refs.customization.PlayerColor));
return text + "<color=#" + text2 + ">" + plr.NickName + "</color>";
}
private static Character returnCharacter(Player player)
{
foreach (Character allCharacter in Character.AllCharacters)
{
PhotonView photonView = ((MonoBehaviourPun)allCharacter).photonView;
if (((Object)(object)photonView != (Object)null || ((Object)(object)allCharacter != (Object)null && (Object)(object)((Component)allCharacter).transform.Find("Scout") != (Object)null && ((Behaviour)allCharacter).enabled)) && photonView.Owner == player)
{
return allCharacter;
}
}
return null;
}
private static Player returnPlayerFromString(string id)
{
Player[] playerList = PhotonNetwork.PlayerList;
foreach (Player val in playerList)
{
string text = Regex.Replace(val.NickName.ToLower(), "</?color(=\\w+|=[#\\w]+)?>", string.Empty, RegexOptions.IgnoreCase);
if (text.Contains(id, StringComparison.OrdinalIgnoreCase))
{
return val;
}
}
logMessage("player not found!");
return null;
}
}
}
namespace System.Diagnostics.CodeAnalysis
{
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ConstantExpectedAttribute : Attribute
{
public object? Min { get; set; }
public object? Max { get; set; }
}
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ExperimentalAttribute : Attribute
{
public string DiagnosticId { get; }
public string? UrlFormat { get; set; }
public ExperimentalAttribute(string diagnosticId)
{
DiagnosticId = diagnosticId;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
internal sealed class MemberNotNullAttribute : Attribute
{
public string[] Members { get; }
public MemberNotNullAttribute(string member)
{
Members = new string[1] { member };
}
public MemberNotNullAttribute(params string[] members)
{
Members = members;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
internal sealed class MemberNotNullWhenAttribute : Attribute
{
public bool ReturnValue { get; }
public string[] Members { get; }
public MemberNotNullWhenAttribute(bool returnValue, string member)
{
ReturnValue = returnValue;
Members = new string[1] { member };
}
public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
{
ReturnValue = returnValue;
Members = members;
}
}
[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class SetsRequiredMembersAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class StringSyntaxAttribute : Attribute
{
public const string CompositeFormat = "CompositeFormat";
public const string DateOnlyFormat = "DateOnlyFormat";
public const string DateTimeFormat = "DateTimeFormat";
public const string EnumFormat = "EnumFormat";
public const string GuidFormat = "GuidFormat";
public const string Json = "Json";
public const string NumericFormat = "NumericFormat";
public const string Regex = "Regex";
public const string TimeOnlyFormat = "TimeOnlyFormat";
public const string TimeSpanFormat = "TimeSpanFormat";
public const string Uri = "Uri";
public const string Xml = "Xml";
public string Syntax { get; }
public object?[] Arguments { get; }
public StringSyntaxAttribute(string syntax)
{
Syntax = syntax;
Arguments = new object[0];
}
public StringSyntaxAttribute(string syntax, params object?[] arguments)
{
Syntax = syntax;
Arguments = arguments;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class UnscopedRefAttribute : Attribute
{
}
}
namespace System.Runtime.Versioning
{
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class RequiresPreviewFeaturesAttribute : Attribute
{
public string? Message { get; }
public string? Url { get; set; }
public RequiresPreviewFeaturesAttribute()
{
}
public RequiresPreviewFeaturesAttribute(string? message)
{
Message = message;
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CallerArgumentExpressionAttribute : Attribute
{
public string ParameterName { get; }
public CallerArgumentExpressionAttribute(string parameterName)
{
ParameterName = parameterName;
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CollectionBuilderAttribute : Attribute
{
public Type BuilderType { get; }
public string MethodName { get; }
public CollectionBuilderAttribute(Type builderType, string methodName)
{
BuilderType = builderType;
MethodName = methodName;
}
}
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CompilerFeatureRequiredAttribute : Attribute
{
public const string RefStructs = "RefStructs";
public const string RequiredMembers = "RequiredMembers";
public string FeatureName { get; }
public bool IsOptional { get; set; }
public CompilerFeatureRequiredAttribute(string featureName)
{
FeatureName = featureName;
}
}
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class InterpolatedStringHandlerArgumentAttribute : Attribute
{
public string[] Arguments { get; }
public InterpolatedStringHandlerArgumentAttribute(string argument)
{
Arguments = new string[1] { argument };
}
public InterpolatedStringHandlerArgumentAttribute(params string[] arguments)
{
Arguments = arguments;
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class InterpolatedStringHandlerAttribute : Attribute
{
}
[EditorBrowsable(EditorBrowsableState.Never)]
[ExcludeFromCodeCoverage]
internal static class IsExternalInit
{
}
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ModuleInitializerAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class OverloadResolutionPriorityAttribute : Attribute
{
public int Priority { get; }
public OverloadResolutionPriorityAttribute(int priority)
{
Priority = priority;
}
}
[AttributeUsage(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)]
[ExcludeFromCodeCoverage]
internal sealed class ParamCollectionAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class RequiredMemberAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[ExcludeFromCodeCoverage]
internal sealed class RequiresLocationAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event | AttributeTargets.Interface, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class SkipLocalsInitAttribute : Attribute
{
}
}