using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using UnityEngine;
using UnityEngine.Events;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("Sangrento")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SillyValuables")]
[assembly: AssemblyTitle("SillyValuables")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
public class RotateCameraWhileHeld : MonoBehaviour
{
private PhysGrabObject physGrabObject;
private bool isHeld = false;
private bool wasHeld = false;
private bool isReturning = false;
public float rotationSpeed = 180f;
public float returnSpeed = 5f;
private Quaternion originalRotation;
private void Start()
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
physGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
if ((Object)(object)Camera.main != (Object)null)
{
originalRotation = ((Component)Camera.main).transform.rotation;
}
}
private void Update()
{
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
Camera main = Camera.main;
if ((Object)(object)main == (Object)null || (Object)(object)physGrabObject == (Object)null)
{
return;
}
isHeld = physGrabObject.grabbed;
if (isHeld)
{
isReturning = false;
((Component)main).transform.Rotate(Vector3.forward, rotationSpeed * Time.deltaTime);
}
else if (!isHeld && wasHeld)
{
isReturning = true;
}
if (isReturning)
{
((Component)main).transform.rotation = Quaternion.Lerp(((Component)main).transform.rotation, originalRotation, returnSpeed * Time.deltaTime);
if (Quaternion.Angle(((Component)main).transform.rotation, originalRotation) < 0.1f)
{
((Component)main).transform.rotation = originalRotation;
isReturning = false;
}
}
wasHeld = isHeld;
}
}
public class Curar : MonoBehaviour
{
private void OnDestroy()
{
PlayerHealth playerHealth = PlayerAvatar.instance.playerHealth;
playerHealth.health = Mathf.Min(playerHealth.health + 50, playerHealth.maxHealth);
}
}
public class Doomsekkar : MonoBehaviour
{
private bool isItemHeld = false;
private float holdTime = 0f;
public float holdThreshold = 2f;
private bool isSpeaking = false;
private string GenerateAffectionateSentence()
{
string[] array = new string[1] { "Destiny's powerful hand has made the bed of my future, and it's up to me to lie in it." };
return array[Random.Range(0, array.Length)];
}
private void Update()
{
if (Input.GetKey((KeyCode)101))
{
if (!isItemHeld)
{
isItemHeld = true;
}
if (isItemHeld)
{
holdTime += Time.deltaTime;
if (!isSpeaking && holdTime >= holdThreshold)
{
StartSpeaking();
}
}
}
else if (isItemHeld)
{
isItemHeld = false;
holdTime = 0f;
isSpeaking = false;
}
}
public void StartSpeaking()
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
isSpeaking = true;
string text = GenerateAffectionateSentence();
Color val = default(Color);
((Color)(ref val))..ctor(1f, 0.3f, 0.6f, 1f);
ChatManager.instance.PossessChatScheduleStart(10);
ChatManager.instance.PossessChat((PossessChatID)1, text, 1f, val, 0f, false, 0, (UnityEvent)null);
ChatManager.instance.PossessChatScheduleEnd();
}
}
public class PulaPulaEin : MonoBehaviour
{
public float launchForce = 6f;
public float jumpForce = 4f;
public float cooldown = 0.5f;
public float minImpactForce = 2f;
private Rigidbody rb;
private bool launched = false;
private void Start()
{
rb = ((Component)this).GetComponent<Rigidbody>();
}
private void OnCollisionEnter(Collision collision)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: 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_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: 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_006a: Unknown result type (might be due to invalid IL or missing references)
if (!launched && collision.contacts.Length != 0)
{
Vector3 val = collision.relativeVelocity;
if (((Vector3)(ref val)).magnitude > minImpactForce)
{
val = ((Component)this).transform.forward;
Vector3 val2 = ((Vector3)(ref val)).normalized * launchForce + Vector3.up * jumpForce;
rb.AddForce(val2, (ForceMode)2);
launched = true;
((MonoBehaviour)this).Invoke("ResetLaunch", cooldown);
}
}
}
private void ResetLaunch()
{
launched = false;
}
}
public class ItemBehaviour : MonoBehaviour
{
public GameObject valuablePrefab;
public GameObject explosionEffectPrefab;
public Vector3 spawnOffset = new Vector3(2f, 1f, 0f);
private bool _used = false;
public float raycastDistance = 10f;
[Range(0f, 1f)]
public float explosionChance = 0.3f;
public float explosionRadius = 5f;
public int explosionDamage = 20;
private void Update()
{
//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_001e: 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)
if (!Input.GetMouseButtonDown(0))
{
return;
}
Ray val = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit val2 = default(RaycastHit);
if (Physics.Raycast(val, ref val2, raycastDistance) && (Object)(object)((Component)((RaycastHit)(ref val2)).collider).gameObject == (Object)(object)((Component)this).gameObject && !_used)
{
_used = true;
if (Random.Range(0f, 1f) <= explosionChance)
{
Explode();
}
else
{
GenerateNewValuable();
}
}
}
private void GenerateNewValuable()
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: 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_0035: 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_003d: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)valuablePrefab == (Object)null)
{
Debug.LogError((object)"Prefab de valuable não foi atribuído!");
return;
}
Vector3 val = ((Component)this).transform.position + spawnOffset;
Object.Instantiate<GameObject>(valuablePrefab, val, Quaternion.identity);
Debug.Log((object)"Novo valuable gerado!");
}
private void Explode()
{
//IL_0040: 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_002e: Unknown result type (might be due to invalid IL or missing references)
Debug.Log((object)"Explodindo!");
if ((Object)(object)explosionEffectPrefab != (Object)null)
{
Object.Instantiate<GameObject>(explosionEffectPrefab, ((Component)this).transform.position, Quaternion.identity);
}
Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, explosionRadius);
Collider[] array2 = array;
foreach (Collider val in array2)
{
if (((Component)val).CompareTag("Player"))
{
PlayerAvatar componentInParent = ((Component)val).GetComponentInParent<PlayerAvatar>();
if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.playerHealth != (Object)null)
{
Debug.Log((object)$"Dano aplicado ao jogador: {explosionDamage}");
PlayerHealth playerHealth = componentInParent.playerHealth;
playerHealth.health -= explosionDamage;
componentInParent.playerHealth.Hurt(explosionDamage, false, -1);
}
}
}
Object.Destroy((Object)(object)((Component)this).gameObject);
}
private void OnDrawGizmosSelected()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
Gizmos.color = Color.red;
Gizmos.DrawWireSphere(((Component)this).transform.position, explosionRadius);
}
}
public class ItemBehaviour2 : MonoBehaviour
{
[Header("Spawn de")]
public GameObject[] valuablePrefabs;
public Vector3 spawnOffset = new Vector3(2f, 1f, 0f);
[Header("Explosão")]
public GameObject explosionEffectPrefab;
public float explosionRadius = 5f;
public int explosionDamage = 20;
[Range(0f, 1f)]
public float explosionChance = 0.3f;
[Header("Interação")]
public float raycastDistance = 10f;
private bool _used = false;
private void Update()
{
//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_001e: 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)
if (!Input.GetMouseButtonDown(0))
{
return;
}
Ray val = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit val2 = default(RaycastHit);
if (Physics.Raycast(val, ref val2, raycastDistance) && (Object)(object)((Component)((RaycastHit)(ref val2)).collider).gameObject == (Object)(object)((Component)this).gameObject && !_used)
{
_used = true;
if (Random.Range(0f, 1f) <= explosionChance)
{
Explode();
}
else
{
GenerateRandomValuable();
}
}
}
private void GenerateRandomValuable()
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
if (valuablePrefabs == null || valuablePrefabs.Length == 0)
{
Debug.LogError((object)"Nenhum prefab de valuable foi atribuído!");
return;
}
int num = Random.Range(0, valuablePrefabs.Length);
GameObject val = valuablePrefabs[num];
Vector3 val2 = ((Component)this).transform.position + spawnOffset;
Object.Instantiate<GameObject>(val, val2, Quaternion.identity);
Debug.Log((object)("Valuable gerado: " + ((Object)val).name));
}
private void Explode()
{
//IL_0040: 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_002e: Unknown result type (might be due to invalid IL or missing references)
Debug.Log((object)"Explodindo!");
if ((Object)(object)explosionEffectPrefab != (Object)null)
{
Object.Instantiate<GameObject>(explosionEffectPrefab, ((Component)this).transform.position, Quaternion.identity);
}
Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, explosionRadius);
Collider[] array2 = array;
foreach (Collider val in array2)
{
if (((Component)val).CompareTag("Player"))
{
PlayerAvatar componentInParent = ((Component)val).GetComponentInParent<PlayerAvatar>();
if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.playerHealth != (Object)null)
{
Debug.Log((object)$"Dano aplicado ao jogador: {explosionDamage}");
PlayerHealth playerHealth = componentInParent.playerHealth;
playerHealth.health -= explosionDamage;
componentInParent.playerHealth.Hurt(explosionDamage, false, -1);
}
}
}
Object.Destroy((Object)(object)((Component)this).gameObject);
}
private void OnDrawGizmosSelected()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
Gizmos.color = Color.red;
Gizmos.DrawWireSphere(((Component)this).transform.position, explosionRadius);
}
}
public class ItemBehaviourSemLimite : MonoBehaviour
{
[Header("Spawn de Valuables")]
public GameObject[] valuablePrefabs;
public Vector3 spawnOffset = new Vector3(2f, 1f, 0f);
[Header("Explosão")]
public GameObject explosionEffectPrefab;
public float explosionRadius = 5f;
public int explosionDamage = 20;
[Range(0f, 1f)]
public float explosionChance = 0.3f;
[Header("Som da Explosão")]
public AudioClip explosionSound;
private AudioSource audioSource;
[Header("Interação")]
public float raycastDistance = 10f;
private void Start()
{
audioSource = ((Component)this).GetComponent<AudioSource>();
}
private void Update()
{
//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_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
if (!Input.GetMouseButtonDown(0))
{
return;
}
Ray val = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit val2 = default(RaycastHit);
if (Physics.Raycast(val, ref val2, raycastDistance) && (Object)(object)((Component)((RaycastHit)(ref val2)).collider).gameObject == (Object)(object)((Component)this).gameObject)
{
if (Random.Range(0f, 1f) <= explosionChance)
{
Explode();
}
else
{
GenerateRandomValuable();
}
}
}
private void GenerateRandomValuable()
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
if (valuablePrefabs == null || valuablePrefabs.Length == 0)
{
Debug.LogError((object)"Nenhum prefab de valuable foi atribuído!");
return;
}
int num = Random.Range(0, valuablePrefabs.Length);
GameObject val = valuablePrefabs[num];
Vector3 val2 = ((Component)this).transform.position + spawnOffset;
Object.Instantiate<GameObject>(val, val2, Quaternion.identity);
Debug.Log((object)("Valuable gerado: " + ((Object)val).name));
}
private void Explode()
{
//IL_0029: 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)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
Debug.Log((object)"Explodindo!");
if ((Object)(object)explosionEffectPrefab != (Object)null)
{
Object.Instantiate<GameObject>(explosionEffectPrefab, ((Component)this).transform.position, Quaternion.identity);
}
if ((Object)(object)explosionSound != (Object)null)
{
if ((Object)(object)audioSource != (Object)null)
{
audioSource.PlayOneShot(explosionSound);
}
else
{
AudioSource.PlayClipAtPoint(explosionSound, ((Component)this).transform.position);
}
}
Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, explosionRadius);
Collider[] array2 = array;
foreach (Collider val in array2)
{
if (((Component)val).CompareTag("Player"))
{
PlayerAvatar componentInParent = ((Component)val).GetComponentInParent<PlayerAvatar>();
if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.playerHealth != (Object)null)
{
Debug.Log((object)$"Dano aplicado ao jogador: {explosionDamage}");
PlayerHealth playerHealth = componentInParent.playerHealth;
playerHealth.health -= explosionDamage;
componentInParent.playerHealth.Hurt(explosionDamage, false, -1);
}
}
}
}
private void OnDrawGizmosSelected()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
Gizmos.color = Color.red;
Gizmos.DrawWireSphere(((Component)this).transform.position, explosionRadius);
}
}
public class ExplodeOnDestroy : MonoBehaviourPun
{
public GameObject explosionEffectPrefab;
public float explosionRadius = 5f;
public float explosionForce = 500f;
public int explosionDamage = 30;
public float damageRadius = 3f;
public bool beingExtracted = false;
private void OnDestroy()
{
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: 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_011d: 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)
//IL_0129: Unknown result type (might be due to invalid IL or missing references)
if (beingExtracted)
{
return;
}
if ((Object)(object)explosionEffectPrefab != (Object)null)
{
GameObject val = Object.Instantiate<GameObject>(explosionEffectPrefab, ((Component)this).transform.position, Quaternion.identity);
Object.Destroy((Object)(object)val, 5f);
}
Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, explosionRadius);
Collider[] array2 = array;
Ray val4 = default(Ray);
RaycastHit val5 = default(RaycastHit);
foreach (Collider val2 in array2)
{
float num = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position);
Rigidbody component = ((Component)val2).GetComponent<Rigidbody>();
if ((Object)(object)component != (Object)null)
{
component.AddExplosionForce(explosionForce, ((Component)this).transform.position, explosionRadius);
}
if (!(num <= damageRadius) || !((Component)val2).CompareTag("Player"))
{
continue;
}
Vector3 val3 = ((Component)val2).transform.position - ((Component)this).transform.position;
Vector3 normalized = ((Vector3)(ref val3)).normalized;
((Ray)(ref val4))..ctor(((Component)this).transform.position, normalized);
if (Physics.Raycast(val4, ref val5, damageRadius) && (Object)(object)((Component)((RaycastHit)(ref val5)).collider).gameObject == (Object)(object)((Component)val2).gameObject)
{
PhotonView component2 = ((Component)val2).GetComponent<PhotonView>();
if (!SemiFunc.IsMultiplayer() || ((Object)(object)component2 != (Object)null && component2.IsMine))
{
PlayerHealth playerHealth = PlayerAvatar.instance.playerHealth;
playerHealth.health -= explosionDamage;
PlayerAvatar.instance.playerHealth.Hurt(explosionDamage, false, -1);
}
}
}
}
}
public class TalkingValuable : MonoBehaviour
{
private bool isItemHeld = false;
private float holdTime = 0f;
public float holdThreshold = 2f;
private bool isSpeaking = false;
private string GenerateAffectionateSentence()
{
string[] array = new string[5] { "STAAN", "STAAAN", "STAAAAAN", "STAAAAAAAN", "STAAAAAAAAAAAN" };
return array[Random.Range(0, array.Length)];
}
public void StartSpeaking()
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
isSpeaking = true;
string text = GenerateAffectionateSentence();
Color val = default(Color);
((Color)(ref val))..ctor(1f, 0.3f, 0.6f, 1f);
ChatManager.instance.PossessChatScheduleStart(10);
ChatManager.instance.PossessChat((PossessChatID)1, text, 1f, val, 0f, false, 0, (UnityEvent)null);
ChatManager.instance.PossessChatScheduleEnd();
}
}
public class GiraGirandoPo : MonoBehaviour
{
private PhysGrabObject physGrabObject;
private Rigidbody rb;
public float forceAmount = 50f;
public float rotationRadius = 1.5f;
public float rotationSpeed = 3f;
private Vector3 centerOffset;
private float angle = 0f;
private void Start()
{
//IL_001a: 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_002a: Unknown result type (might be due to invalid IL or missing references)
physGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
rb = ((Component)this).GetComponent<Rigidbody>();
centerOffset = Vector3.right * rotationRadius;
}
private void FixedUpdate()
{
//IL_0048: 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_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: 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_0065: 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_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: 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_008a: 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_009d: 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)
if (physGrabObject.grabbed)
{
angle += rotationSpeed * Time.fixedDeltaTime;
Vector3 val = new Vector3(Mathf.Cos(angle), 0f, Mathf.Sin(angle)) * rotationRadius;
Vector3 val2 = val - centerOffset;
Vector3 val3 = ((Vector3)(ref val2)).normalized * forceAmount;
rb.AddForce(new Vector3(val3.x, 0f, val3.z), (ForceMode)5);
centerOffset = val;
}
}
}
public class GiraGiraEin : MonoBehaviour
{
public float rotationRadius = 1f;
public float angularSpeed = 360f;
public float duration = 2f;
public float minImpactForce = 2f;
public float groundCheckDistance = 0.15f;
private Rigidbody rb;
private bool rotating = false;
private float rotateTimer = 0f;
private float currentAngle = 0f;
private Vector3 centerPoint;
private void Start()
{
rb = ((Component)this).GetComponent<Rigidbody>();
}
private void OnCollisionEnter(Collision collision)
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: 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_0076: Unknown result type (might be due to invalid IL or missing references)
if (!rotating)
{
Vector3 relativeVelocity = collision.relativeVelocity;
if (((Vector3)(ref relativeVelocity)).magnitude > minImpactForce && IsGrounded())
{
rotating = true;
rotateTimer = duration;
centerPoint = new Vector3(((Component)this).transform.position.x, ((Component)this).transform.position.y, ((Component)this).transform.position.z);
currentAngle = 0f;
}
}
}
private void FixedUpdate()
{
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: 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)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: 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_00e2: 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_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: 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_005f: Unknown result type (might be due to invalid IL or missing references)
if (rotating)
{
rotateTimer -= Time.fixedDeltaTime;
if (rotateTimer <= 0f)
{
rotating = false;
rb.velocity = new Vector3(0f, rb.velocity.y, 0f);
return;
}
currentAngle += angularSpeed * (MathF.PI / 180f) * Time.fixedDeltaTime;
Vector3 val = new Vector3(Mathf.Cos(currentAngle), 0f, Mathf.Sin(currentAngle)) * rotationRadius;
Vector3 val2 = centerPoint + val;
Vector3 val3 = (val2 - ((Component)this).transform.position) / Time.fixedDeltaTime;
rb.velocity = new Vector3(val3.x, rb.velocity.y, val3.z);
}
}
private bool IsGrounded()
{
//IL_0007: 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)
return Physics.Raycast(((Component)this).transform.position, Vector3.down, groundCheckDistance + 0.01f);
}
}
public class FazSumi : MonoBehaviour
{
private PhysGrabObject physGrabObject;
private Renderer[] renderers;
private void Start()
{
physGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
renderers = ((Component)this).GetComponentsInChildren<Renderer>();
}
private void Update()
{
if ((Object)(object)physGrabObject != (Object)null && physGrabObject.grabbed)
{
SetRenderersVisible(visible: false);
}
else
{
SetRenderersVisible(visible: true);
}
}
private void SetRenderersVisible(bool visible)
{
Renderer[] array = renderers;
foreach (Renderer val in array)
{
val.enabled = visible;
}
}
}
public class IrFrente : MonoBehaviour
{
public float moveSpeed = 3f;
public float cooldown = 0.5f;
public float minImpactForce = 2f;
public float driftIntensity = 0.5f;
public float driftFrequency = 5f;
private Rigidbody rb;
private bool moving = false;
private float moveTimer = 0f;
private float lastMoveTime = float.NegativeInfinity;
private float driftTimer = 0f;
private void Start()
{
rb = ((Component)this).GetComponent<Rigidbody>();
}
private void OnCollisionEnter(Collision collision)
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
if (!moving)
{
Vector3 relativeVelocity = collision.relativeVelocity;
if (((Vector3)(ref relativeVelocity)).magnitude > minImpactForce && Time.time > lastMoveTime + cooldown)
{
moving = true;
moveTimer = 2f;
lastMoveTime = Time.time;
driftTimer = 0f;
}
}
}
private void FixedUpdate()
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//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)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: 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_0065: 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_0067: 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_006d: 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_0082: 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_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: 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)
if (moving)
{
driftTimer += Time.fixedDeltaTime;
Vector3 val = ((Component)this).transform.forward * moveSpeed;
Vector3 val2 = ((Component)this).transform.right * Mathf.Sin(driftTimer * driftFrequency) * driftIntensity;
Vector3 val3 = val + val2;
float y = rb.velocity.y;
Vector3 velocity = default(Vector3);
((Vector3)(ref velocity))..ctor(val3.x, y, val3.z);
rb.velocity = velocity;
moveTimer -= Time.fixedDeltaTime;
if (moveTimer <= 0f)
{
moving = false;
rb.velocity = new Vector3(0f, rb.velocity.y, 0f);
}
}
}
}
public class GiraIsso : MonoBehaviour
{
private PhysGrabObject physGrabObject;
[Header("Configuração da rotação")]
public Vector3 rotationSpeed = new Vector3(0f, 90f, 0f);
private Vector3 currentRotation;
private void Start()
{
//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)
physGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
currentRotation = ((Component)this).transform.localEulerAngles;
}
private void Update()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//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_0086: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)physGrabObject != (Object)null && physGrabObject.grabbed)
{
currentRotation += rotationSpeed * Time.deltaTime;
currentRotation.x %= 360f;
currentRotation.y %= 360f;
currentRotation.z %= 360f;
((Component)this).transform.localEulerAngles = currentRotation;
}
}
}
public class KillPlayer : MonoBehaviourPun
{
private PhotonView? pv;
private void Awake()
{
pv = ((Component)this).GetComponent<PhotonView>();
}
private void OnDestroy()
{
if (SemiFunc.IsMultiplayer())
{
if ((Object)(object)pv != (Object)null && pv.IsMine && PlayerIsInSight(PlayerAvatar.instance))
{
ChatManager.instance.PossessSelfDestruction();
}
}
else if (PlayerIsInSight(PlayerAvatar.instance))
{
PlayerAvatar.instance.playerHealth.health = 0;
PlayerAvatar.instance.playerHealth.Hurt(9999, false, -1);
}
}
private bool PlayerIsInSight(PlayerAvatar playerAvatar)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: 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_002a: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)playerAvatar == (Object)null)
{
return false;
}
Vector3 position = ((Component)this).transform.position;
Vector3 position2 = ((Component)playerAvatar).transform.position;
RaycastHit val = default(RaycastHit);
if (Physics.Linecast(position, position2, ref val))
{
return (Object)(object)((Component)((RaycastHit)(ref val)).collider).GetComponentInParent<PlayerAvatar>() == (Object)(object)playerAvatar;
}
return false;
}
}
public class TelaBambaPo : MonoBehaviour
{
private PhysGrabObject physGrabObject;
private Rigidbody rb;
public float forceAmount = 40f;
public float noiseSpeed = 25f;
private void Start()
{
physGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
rb = ((Component)this).GetComponent<Rigidbody>();
}
private void FixedUpdate()
{
//IL_006f: 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_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: 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)
if (physGrabObject.grabbed)
{
Vector3 val = new Vector3(Mathf.PerlinNoise(Time.time * noiseSpeed, 0f) - 0.5f, Mathf.PerlinNoise(0f, Time.time * noiseSpeed) - 0.5f, Mathf.PerlinNoise(Time.time * noiseSpeed, Time.time * noiseSpeed) - 0.5f);
Vector3 normalized = ((Vector3)(ref val)).normalized;
rb.AddForce(normalized * forceAmount, (ForceMode)5);
}
}
}
public class FazCresce : MonoBehaviour
{
private PhysGrabObject physGrabObject;
private Vector3 originalScale;
[Header("Escala do Item")]
public Vector3 grabbedScale = new Vector3(2f, 2f, 2f);
public float scaleSpeed = 5f;
private void Start()
{
//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)
physGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
originalScale = ((Component)this).transform.localScale;
}
private void Update()
{
//IL_0060: 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_0077: 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)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)physGrabObject != (Object)null && physGrabObject.grabbed)
{
((Component)this).transform.localScale = Vector3.Lerp(((Component)this).transform.localScale, grabbedScale, Time.deltaTime * scaleSpeed);
}
else
{
((Component)this).transform.localScale = Vector3.Lerp(((Component)this).transform.localScale, originalScale, Time.deltaTime * scaleSpeed);
}
}
}
namespace SillyValuables
{
[HarmonyPatch(typeof(PlayerController))]
internal static class ExamplePlayerControllerPatch
{
[HarmonyPrefix]
[HarmonyPatch("Start")]
private static void Start_Prefix(PlayerController __instance)
{
SillyValuables.Logger.LogDebug((object)$"{__instance} Start Prefix");
}
[HarmonyPostfix]
[HarmonyPatch("Start")]
private static void Start_Postfix(PlayerController __instance)
{
SillyValuables.Logger.LogDebug((object)$"{__instance} Start Postfix");
}
}
[BepInPlugin("Sangrento.SillyValuables", "SillyValuables", "1.5.4")]
public class SillyValuables : BaseUnityPlugin
{
internal static SillyValuables Instance { get; private set; }
internal static ManualLogSource Logger => Instance._logger;
private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger;
internal Harmony? Harmony { get; set; }
private void Awake()
{
Instance = this;
((Component)this).gameObject.transform.parent = null;
((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
Patch();
Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!");
}
internal void Patch()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Expected O, but got Unknown
//IL_0026: Expected O, but got Unknown
if (Harmony == null)
{
Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
Harmony val2 = val;
Harmony = val;
}
Harmony.PatchAll();
}
private void KillPlayer()
{
}
internal void Unpatch()
{
Harmony? harmony = Harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
}
}
}