using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using UnityEngine;
using UnityEngine.Events;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("JustOtaku")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("JustOtakus_Valuables")]
[assembly: AssemblyTitle("JustOtakus_Valuables")]
[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 Banan_Valuable : Trap
{
public ValuableObject value;
public GameObject banan_g;
public GameObject banan_y;
public GameObject banan_b;
private void Start()
{
}
public void ChangeBanan()
{
if (banan_g.activeSelf)
{
banan_g.SetActive(false);
banan_b.SetActive(false);
banan_y.SetActive(true);
value.dollarValueCurrent *= 10f;
}
else if (banan_y.activeSelf)
{
banan_g.SetActive(false);
banan_b.SetActive(true);
banan_y.SetActive(false);
value.dollarValueCurrent = 1f;
}
}
}
public class Bormp_Valuable : Trap
{
private ParticleScriptExplosion particleScriptExplosion;
[Range(1f, 100f)]
public int Chance;
public Transform Center;
private void Start()
{
((Trap)this).Start();
particleScriptExplosion = ((Component)this).GetComponent<ParticleScriptExplosion>();
}
public void Explode()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
particleScriptExplosion.Spawn(Center.position, 0.8f, 30, 80, 1f, false, false, 1f);
}
public void PotentialExplode()
{
if (base.isLocal)
{
int num = Random.Range(1, 100 / Chance + 1);
if (num == 1)
{
Explode();
}
}
}
}
public class Cookie_Valuable : MonoBehaviour
{
private enum State
{
Idle,
Active
}
private PhysGrabObject physGrabObject;
private List<string> transitiveVerbs = new List<string>();
private List<string> intransitiveVerbs = new List<string>();
private List<string> adjectives = new List<string>();
private List<string> intensifiers = new List<string>();
private List<string> nouns = new List<string>();
private List<string> adverbs = new List<string>();
private float coolDownUntilNextSentence = 3f;
private ParticleSystem particles;
private bool particlesPlaying;
private State currentState;
private string playerName = "[playerName]";
private void Start()
{
particles = ((Component)this).GetComponentInChildren<ParticleSystem>();
physGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
InitializeWordLists();
}
private void Update()
{
if (physGrabObject.grabbed)
{
if (!particlesPlaying)
{
particles.Play();
particlesPlaying = true;
}
}
else if (particlesPlaying)
{
particles.Stop();
particlesPlaying = false;
}
if (SemiFunc.IsMultiplayer())
{
switch (currentState)
{
case State.Idle:
StateIdle();
break;
case State.Active:
StateActive();
break;
}
}
}
private void StateIdle()
{
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: 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)
//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: 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)
if (coolDownUntilNextSentence > 0f && physGrabObject.grabbed)
{
coolDownUntilNextSentence -= Time.deltaTime;
}
else
{
if (!Object.op_Implicit((Object)(object)PhysGrabber.instance) || !PhysGrabber.instance.grabbed || !Object.op_Implicit((Object)(object)PhysGrabber.instance.grabbedPhysGrabObject) || !((Object)(object)PhysGrabber.instance.grabbedPhysGrabObject == (Object)(object)physGrabObject))
{
return;
}
bool flag = false;
if (!SemiFunc.IsMultiplayer())
{
playerName = "I";
flag = true;
}
else
{
List<PlayerAvatar> list = SemiFunc.PlayerGetAllPlayerAvatarWithinRange(10f, ((Component)PhysGrabber.instance).transform.position, false, default(LayerMask));
PlayerAvatar val = null;
float num = float.MaxValue;
foreach (PlayerAvatar item in list)
{
if (!((Object)(object)item == (Object)(object)PlayerAvatar.instance))
{
float num2 = Vector3.Distance(((Component)PhysGrabber.instance).transform.position, ((Component)item).transform.position);
if (num2 < num)
{
num = num2;
val = item;
}
}
}
flag = true;
if ((Object)(object)val != (Object)null)
{
playerName = val.playerName;
}
else
{
playerName = "I";
}
}
if (flag)
{
string text = GenerateAffectionateSentence();
currentState = State.Active;
Color val2 = default(Color);
((Color)(ref val2))..ctor(1f, 0.3f, 0.6f, 1f);
ChatManager.instance.PossessChatScheduleStart(10);
ChatManager.instance.PossessChat((PossessChatID)1, text, 1f, val2, 0f, false, 0, (UnityEvent)null);
ChatManager.instance.PossessChatScheduleEnd();
}
}
}
private void StateActive()
{
if (PhysGrabber.instance.grabbed && Object.op_Implicit((Object)(object)PhysGrabber.instance.grabbedPhysGrabObject) && (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject != (Object)(object)physGrabObject)
{
currentState = State.Idle;
coolDownUntilNextSentence = Random.Range(5f, 15f);
}
else if (!ChatManager.instance.StateIsPossessed())
{
currentState = State.Idle;
coolDownUntilNextSentence = Random.Range(5f, 15f);
}
}
private void InitializeWordLists()
{
transitiveVerbs.AddRange(new string[1] { "A" });
intransitiveVerbs.AddRange(new string[51]
{
"wow wow wow", "geek out", "crush", "fangirl over", "fanboy over", "cheer for", "freak out", "melt", "chill with", "robodance",
"hug", "kick", "work", "boot up", "check out", "look up", "catch up", "hang out with", "eat", "break",
"get in", "be in", "share", "engage", "help", "support", "follow", "stalk", "download the latest naughty pics of", "shout out",
"hype", "beep boop beep boop", "confess my love to", "declare bankruptcy of", "dream about", "go woop woop with", "freak out about", "freak", "feel", "touch",
"beep boop", "flirt with", "leave a like and subscribe to", "fart at", "peep", "spy on", "boop", "beep", "make out with", "subscribe to",
"pounce on"
});
adjectives.AddRange(new string[145]
{
"epic", "awesome", "adorable", "adorbs", "fab", "cool", "dreamy", "snazzy", "rad", "stellar",
"stupid", "dumb", "cunty", "dope", "amazing", "breathtaking", "charming", "cute", "ah meh zin geh", "fresh",
"funky", "glowing", "oh la la la", "incredible", "olala", "lovable", "lovely", "upgraded", "neat", "on point",
"peachy", "0 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 0 0 0 1 1 0 0 1 0 1", "woop y woop y woo", "likey likey", "oooh ya ya", "slick", "smart", "smooth", "sparkling", "OMG",
"stunning", "stylish", "ooooh yeaaa", "superb", "supreme", "sweet", "wowie", "trendy", "unreal", "vibrant",
"wicked", "me likey", "beep boop", "oh my", "oof in a good way", "brilliant", "oh ya ya", "chic", "ah ... mazing", "clever",
"comfy", "cu ... wait ... teh ... cute", "woop woop", "hugable", "cute", "yas queen", "sooo like ... wow", "divine", "stupid", "dumb",
"cunty", "electric", "elegant", "elite", "1337", "engaging", "enticing", "fancy", "fierce", "fire",
"fly", "glam", "gorgeous", "hype mode", "iconic", "legendary", "litty", "wow wow wow", "magical", "majestic",
"bootiiifoool", "poppin'", "precious", "C O O L ... cool", "C U T E ... cute", "... ... *blushes* ...", "slaying", "spicy", "robohandsome", "wowa wowa yas yas",
"on fleek", "robocute", "wholesome", "winning", "robodorable", "powerful", "pretty", "beautiful", "sweet", "kind",
"wow wow wow wow wow", "100%", "0 1 1 0 0 0 1 0 0 1 1 0 0 0 0 1 0 1 1 0 0 1 0 0", "fun", "brave", "interesting", "smart in the head", "sparkling", "shiny", "warm",
"heroic", "friendly", "financially stable", "oh la la oh la la la la", "romantic", "cozy", "wonderful", "fantastic", "super", "great",
"delightful", "fabulous", "marvelous", "nice", "pleasant", "good", "special", "unique", "o la la la yes yes", "yeah yeah wow wow",
"wooooow", "oh woooow", "oh my gawd", "gay", "thicc booty"
});
intensifiers.AddRange(new string[77]
{
"totally", "super", "uber", "mega", "super mega", "seriously", "majorly", "legit", "absolutely", "completely",
"for reals", "utterly", "high-key", "incredibly", "madly", "like ...", "like... seriously", "sooo", "really", "so",
"sooooooooo", "unbelievably", "very", "like soooo much", "extra", "extremely", "really really", "fiercely", "like, for reals", "greatly",
"hugely", "immensely", "intensely", "massively", "so so soooo", "really really really", "like totes", "like... totally", "like.. somehow sooo much", "simply",
"supremely", "surprisingly", "super mega ultra", "ultra", "unusually", "way way", "way", "insanely", "like ... insanelyyyy", "freakishly",
"extra extra", "overwhelmingly", "reeeaaally", "weirdly", "suuuuper", "way waaaay", "crazy", "like suuuuuper", "really sooo", "low-key",
"high-key", "literally", "for reeeaal soo", "legit", "honestly", "kinda", "sort of", "basically", "downright", "like literally",
"very very", "like like.. like... sooo much", "like... actually", "suuuuper suuuuper", "genuinely", "truly", "sincerely"
});
nouns.AddRange(new string[21]
{
"MVP", "baby", "bruh", "genius", "viral hit", "Logan Paul video", "femboy", "AC-130 airstrike", "bootleg FNAF plushie", "a new cringy TikTok-trend",
"FNAF Security Breach release verison", "food fetishist", "bitch", "Freddy Fazbear", "nuclear warhead", "failure", "ass", "goat", "child", "saxophone solo that went horribly wrong",
"cheese"
});
adverbs.AddRange(new string[77]
{
"totally", "super", "uber", "mega", "super mega", "seriously", "majorly", "legit", "absolutely", "completely",
"for reals", "utterly", "high-key", "incredibly", "madly", "like ...", "like... seriously", "sooo", "really", "so",
"sooooooooo", "unbelievably", "very", "like soooo", "extra", "extremely", "really really", "fiercely", "like, for reals", "greatly",
"hugely", "immensely", "intensely", "massively", "so so soooo", "really really really", "like totes", "like... totally", "like.. somehow sooo", "simply",
"supremely", "surprisingly", "super mega ultra", "ultra", "unusually", "way way", "way", "insanely", "like ... insanelyyyy", "freakishly",
"extra extra", "overwhelmingly", "reeeaaally", "weirdly", "suuuuper", "way waaaay", "crazy", "like suuuuuper", "really sooo", "low-key",
"high-key", "literally", "for reeeaal soo", "legit", "honestly", "kinda", "sort of", "basically", "downright", "like literally",
"very very", "like like.. like... sooo", "like... actually", "suuuuper suuuuper", "genuinely", "truly", "sincerely"
});
}
private string GenerateAffectionateSentence()
{
List<string> list = new List<string> { "DatCookie is so {intensifier} {adverb} {adverb} {adverb} sexy!", "{playerName}, have you subscribed to DatCookie yet? NO? Well, at least one of us made good life choices.", "DatCookie? Holy shit! What a {intensifier} {adverb} {adjective} guy.", "Cookie. Cookie! COOOOOOOOOKIE!", "{playerName} {adverb} looks like a {noun}. They should subscribe to DatCookie!", "Just like Albert Einstein said: {playerName} + DatCookie = {noun}", "I want to {intransitiveVerb} DatCookie so {intensifier} hard!", "Bloody splendid upload schedule, innit?" };
string text = list[Random.Range(0, list.Count)];
string text2 = text.Replace("{playerName}", playerName);
if (text.Contains("{transitiveVerb}"))
{
string newValue = transitiveVerbs[Random.Range(0, transitiveVerbs.Count)];
text2 = text2.Replace("{transitiveVerb}", newValue);
}
if (text.Contains("{intransitiveVerb}"))
{
string text3 = intransitiveVerbs[Random.Range(0, intransitiveVerbs.Count)];
if (text2.Contains("{intransitiveVerb}s"))
{
text3 = ((!text3.EndsWith("e")) ? (text3 + "es") : (text3 + "s"));
text2 = text2.Replace("{intransitiveVerb}s", text3);
}
else
{
text2 = text2.Replace("{intransitiveVerb}", text3);
}
}
if (text.Contains("{adjective}"))
{
string newValue2 = adjectives[Random.Range(0, adjectives.Count)];
text2 = text2.Replace("{adjective}", newValue2);
}
if (text.Contains("{intensifier}"))
{
string newValue3 = intensifiers[Random.Range(0, intensifiers.Count)];
text2 = text2.Replace("{intensifier}", newValue3);
}
if (text.Contains("{adverb}"))
{
string newValue4 = adverbs[Random.Range(0, adverbs.Count)];
text2 = text2.Replace("{adverb}", newValue4);
}
if (text.Contains("{noun}"))
{
string newValue5 = nouns[Random.Range(0, nouns.Count)];
text2 = text2.Replace("{noun}", newValue5);
}
return char.ToUpper(text2[0]) + text2.Substring(1);
}
}
public class FNAF_Fan_Valuable : MonoBehaviour
{
public enum States
{
Idle,
Active
}
public GameObject hurtCollider;
public Animator animator;
private PhysGrabObject physGrabObject;
private Rigidbody rb;
public Sound fanSoundLoop;
private PhotonView photonView;
internal States currentState;
private bool stateStart;
private bool loopPlaying;
private void StateActive()
{
//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)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: 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_005c: 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_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
if (stateStart)
{
stateStart = false;
}
loopPlaying = true;
if (SemiFunc.IsMasterClientOrSingleplayer())
{
if (Random.Range(0, 100) < 7)
{
rb.AddForce(Random.insideUnitSphere * 3f, (ForceMode)1);
rb.AddTorque(Random.insideUnitSphere * 7f, (ForceMode)1);
}
Quaternion val = Quaternion.Euler(0f, 180f, 0f);
Quaternion val2 = Quaternion.Euler(0f, 0f, 0f);
Quaternion identity = Quaternion.identity;
bool flag = false;
foreach (PhysGrabber item in physGrabObject.playerGrabbing)
{
if (item.isRotating)
{
flag = true;
}
}
if (!flag)
{
physGrabObject.TurnXYZ(val, val2, identity);
}
if (!physGrabObject.grabbed)
{
SetState(States.Idle);
}
}
if (physGrabObject.grabbedLocal)
{
PhysGrabber.instance.OverridePullDistanceIncrement(-1f * Time.fixedDeltaTime);
}
}
private void StateIdle()
{
if (stateStart)
{
stateStart = false;
}
loopPlaying = false;
if (SemiFunc.IsMasterClientOrSingleplayer() && physGrabObject.grabbed)
{
SetState(States.Active);
}
}
[PunRPC]
public void SetStateRPC(States state, PhotonMessageInfo _info = default(PhotonMessageInfo))
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
if (!SemiFunc.IsMultiplayer() || _info.Sender == PhotonNetwork.MasterClient)
{
currentState = state;
stateStart = true;
}
}
private void SetState(States state)
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
if (SemiFunc.IsMasterClientOrSingleplayer())
{
if (!SemiFunc.IsMultiplayer())
{
SetStateRPC(state);
return;
}
photonView.RPC("SetStateRPC", (RpcTarget)0, new object[1] { state });
}
}
private void Start()
{
physGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
photonView = ((Component)this).GetComponent<PhotonView>();
rb = ((Component)this).GetComponent<Rigidbody>();
animator = ((Component)this).GetComponent<Animator>();
}
private void Update()
{
fanSoundLoop.PlayLoop(loopPlaying, 5f, 5f, 1f);
hurtCollider.SetActive(loopPlaying);
}
private void FixedUpdate()
{
switch (currentState)
{
case States.Active:
StateActive();
break;
case States.Idle:
StateIdle();
break;
}
}
public void EnemyInvestigate()
{
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
if (!GameManager.Multiplayer() || PhotonNetwork.IsMasterClient)
{
EnemyDirector.instance.SetInvestigate(((Component)this).transform.position, 20f);
}
}
public void StopAnimator()
{
}
}
public class ItemMineMultiplying : MonoBehaviour
{
private Just_ParticleScriptExplosion particleScriptExplosion;
public float size = 0.8f;
public int damage = 20;
public int enemyDamage = 150;
public float forceMulti = 20f;
private void Start()
{
particleScriptExplosion = ((Component)this).GetComponent<Just_ParticleScriptExplosion>();
}
public void OnTriggered()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
particleScriptExplosion.Spawn(((Component)this).transform.position, size, damage, enemyDamage, forceMulti);
}
}
public class Just_ItemMine : MonoBehaviour
{
public enum MineType
{
None,
Explosive,
Shockwave,
Stun
}
public enum States
{
Disarmed,
Arming,
Armed,
Disarming,
Triggering,
Triggered
}
public MineType mineType;
public Color emissionColor;
public UnityEvent onTriggered;
public float armingTime;
public float triggeringTime;
private SpringQuaternion triggerSpringQuaternion;
private Quaternion triggerTargetRotation;
private bool upsideDown;
public Transform triggerTransform;
public LineRenderer triggerLine;
public ParticleSystem lineParticles;
private float beepTimer;
private float checkTimer;
private ItemMineTrigger itemMineTrigger;
private ItemEquippable itemEquippable;
private ItemAttributes itemAttributes;
private ItemToggle itemToggle;
[Space(20f)]
private PhotonView photonView;
private PhysGrabObject physGrabObject;
public MeshRenderer meshRenderer;
public Light lightArmed;
[Space(20f)]
public Sound soundArmingBeep;
public Sound soundArmedBeep;
public Sound soundDisarmingBeep;
public Sound soundDisarmedBeep;
public Sound soundTriggereringBeep;
private float initialLightIntensity;
private Just_ParticleScriptExplosion particleScriptExplosion;
private bool hasBeenGrabbed;
private Vector3 startPosition;
private Quaternion startRotation;
internal Vector3 triggeredPosition;
internal Transform triggeredTransform;
internal PlayerAvatar triggeredPlayerAvatar;
internal PlayerTumble triggeredPlayerTumble;
internal PhysGrabObject triggeredPhysGrabObject;
public bool triggeredByRigidBodies = true;
public bool triggeredByEnemies = true;
public bool triggeredByPlayers = true;
public bool triggeredByForces = true;
public bool destroyAfterTimer;
public float destroyTimer = 10f;
internal bool wasTriggeredByEnemy;
internal bool wasTriggeredByPlayer;
internal bool wasTriggeredByForce;
internal bool wasTriggeredByRigidBody;
internal bool firstLight = true;
private bool firstLightDone;
private float secondArmedTimer;
private bool wasGrabbed;
private float targetLineLength = 1f;
private Vector3 prevPos = Vector3.zero;
private Quaternion prevRot = Quaternion.identity;
internal States state;
private bool stateStart = true;
private float stateTimer;
private PhysGrabObjectImpactDetector impactDetector;
private bool mineDestroyed;
public bool startArmed = false;
private void Start()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_0057: 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_00ba: 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_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
triggerSpringQuaternion = new SpringQuaternion();
triggerSpringQuaternion.damping = 0.2f;
triggerSpringQuaternion.speed = 10f;
itemAttributes = ((Component)this).GetComponent<ItemAttributes>();
physGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
photonView = ((Component)this).GetComponent<PhotonView>();
lightArmed.color = emissionColor;
((Renderer)meshRenderer).material.SetColor("_EmissionColor", emissionColor);
initialLightIntensity = lightArmed.intensity;
impactDetector = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>();
itemMineTrigger = ((Component)this).GetComponentInChildren<ItemMineTrigger>();
particleScriptExplosion = ((Component)this).GetComponent<Just_ParticleScriptExplosion>();
startPosition = ((Component)this).transform.position;
itemEquippable = ((Component)this).GetComponent<ItemEquippable>();
startRotation = ((Component)this).transform.rotation;
itemToggle = ((Component)this).GetComponent<ItemToggle>();
if (startArmed)
{
state = States.Arming;
itemToggle.toggleState = true;
}
}
private void StateDisarmed()
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: 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_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0181: Unknown result type (might be due to invalid IL or missing references)
//IL_0186: Unknown result type (might be due to invalid IL or missing references)
//IL_018d: Unknown result type (might be due to invalid IL or missing references)
//IL_0192: Unknown result type (might be due to invalid IL or missing references)
//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
if (stateStart)
{
soundDisarmedBeep.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
stateStart = false;
lightArmed.intensity = initialLightIntensity * 3f;
((Renderer)meshRenderer).material.SetColor("_EmissionColor", Color.green);
lightArmed.color = Color.green;
beepTimer = 1f;
}
if (firstLight)
{
((Renderer)meshRenderer).material.SetColor("_EmissionColor", emissionColor);
lightArmed.color = emissionColor;
firstLight = false;
}
else if (!firstLightDone)
{
((Renderer)meshRenderer).material.SetColor("_EmissionColor", Color.green);
lightArmed.color = Color.green;
firstLightDone = true;
}
if (lightArmed.intensity > 0f && beepTimer > 0f)
{
float num = 1f - beepTimer;
lightArmed.intensity = Mathf.Lerp(lightArmed.intensity, 0f, num);
Color val = Color.Lerp(((Renderer)meshRenderer).material.GetColor("_EmissionColor"), Color.black, num);
((Renderer)meshRenderer).material.SetColor("_EmissionColor", val);
beepTimer -= Time.deltaTime * 0.1f;
}
if (SemiFunc.IsMasterClientOrSingleplayer() && itemToggle.toggleState)
{
StateSet(States.Arming);
}
}
private void StateArming()
{
//IL_0025: 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)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: 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_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
if (stateStart)
{
stateStart = false;
beepTimer = 1f;
lightArmed.color = emissionColor;
Color color = default(Color);
((Color)(ref color))..ctor(1f, 0.5f, 0f);
soundArmingBeep.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
ColorSet(color);
}
beepTimer -= Time.deltaTime * 4f;
if (beepTimer <= 0f)
{
soundArmingBeep.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
Color color2 = default(Color);
((Color)(ref color2))..ctor(1f, 0.5f, 0f);
ColorSet(color2);
beepTimer = 1f;
}
if (SemiFunc.IsMasterClientOrSingleplayer())
{
if (!physGrabObject.grabbed)
{
stateTimer += Time.deltaTime;
}
else
{
stateTimer += Time.deltaTime * 0.25f;
}
if (!physGrabObject.grabbed)
{
Vector3 velocity = physGrabObject.rb.velocity;
if (!(((Vector3)(ref velocity)).magnitude > 1f))
{
goto IL_0192;
}
}
stateTimer = 0f;
goto IL_0192;
}
goto IL_01b4;
IL_0192:
if (stateTimer >= armingTime)
{
StateSet(States.Armed);
}
goto IL_01b4;
IL_01b4:
if (SemiFunc.IsMasterClientOrSingleplayer() && !itemToggle.toggleState)
{
StateSet(States.Disarming);
}
}
private void StateArmed()
{
//IL_0018: 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_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
if (stateStart)
{
soundArmedBeep.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
ColorSet(emissionColor);
lightArmed.intensity = initialLightIntensity * 8f;
stateStart = false;
secondArmedTimer = 2f;
}
lightArmed.intensity = Mathf.Lerp(lightArmed.intensity, initialLightIntensity, Time.deltaTime * 4f);
if (secondArmedTimer > 0f)
{
secondArmedTimer -= Time.deltaTime;
}
if (SemiFunc.IsMasterClientOrSingleplayer() && secondArmedTimer <= 0f && triggeredByForces)
{
Vector3 velocity = physGrabObject.rb.velocity;
if (((Vector3)(ref velocity)).magnitude > 0.5f)
{
StateSet(States.Triggering);
}
}
if (SemiFunc.IsMasterClientOrSingleplayer() && !itemToggle.toggleState)
{
StateSet(States.Disarming);
}
}
private void ColorSet(Color _color)
{
//IL_0019: 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)
lightArmed.intensity = initialLightIntensity;
lightArmed.color = _color;
((Renderer)meshRenderer).material.SetColor("_EmissionColor", _color);
}
private void StateDisarming()
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
if (stateStart)
{
stateStart = false;
beepTimer = 1f;
soundDisarmingBeep.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
ColorSet(emissionColor);
beepTimer = 1f;
}
beepTimer -= Time.deltaTime * 4f;
if (beepTimer <= 0f)
{
soundDisarmingBeep.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
ColorSet(Color.green);
beepTimer = 1f;
}
stateTimer += Time.deltaTime;
if (stateTimer > 0.1f)
{
StateSet(States.Disarmed);
}
}
private void StateTriggering()
{
//IL_0055: 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 (stateStart)
{
stateStart = false;
beepTimer = 1f;
}
beepTimer -= Time.deltaTime * 4f;
if (beepTimer < 0f)
{
soundTriggereringBeep.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
ColorSet(emissionColor);
beepTimer = 1f;
}
stateTimer += Time.deltaTime;
if (stateTimer > triggeringTime)
{
StateSet(States.Triggered);
}
if (SemiFunc.IsMasterClientOrSingleplayer() && !itemToggle.toggleState)
{
StateSet(States.Disarming);
}
}
private void StateTriggered()
{
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
if (stateStart)
{
stateStart = false;
beepTimer = 1f;
if (!destroyAfterTimer)
{
DestroyMine();
}
Color color = default(Color);
((Color)(ref color))..ctor(0.5f, 0.9f, 1f);
ColorSet(color);
}
stateTimer += Time.deltaTime;
if (destroyAfterTimer && stateTimer > destroyTimer)
{
DestroyMine();
}
}
public void DestroyMine()
{
//IL_0059: 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 (!SemiFunc.RunIsShop())
{
if (!mineDestroyed)
{
StatsManager.instance.ItemRemove(itemAttributes.instanceName);
impactDetector.DestroyObject(true);
mineDestroyed = true;
}
}
else
{
ResetMine();
physGrabObject.Teleport(startPosition, startRotation);
}
}
private void ResetMine()
{
//IL_0049: 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)
hasBeenGrabbed = false;
StateSet(States.Disarmed);
itemToggle.ToggleItem(false, -1);
if (SemiFunc.IsMasterClientOrSingleplayer())
{
stateTimer = 0f;
Rigidbody component = ((Component)this).GetComponent<Rigidbody>();
if (!component.isKinematic)
{
component.velocity = Vector3.zero;
component.angularVelocity = Vector3.zero;
}
}
}
private void AnimateLight()
{
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: 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_0088: Unknown result type (might be due to invalid IL or missing references)
if (lightArmed.intensity > 0f && beepTimer > 0f)
{
float num = 1f - beepTimer;
lightArmed.intensity = Mathf.Lerp(lightArmed.intensity, 0f, num);
Color val = Color.Lerp(((Renderer)meshRenderer).material.GetColor("_EmissionColor"), Color.black, num);
((Renderer)meshRenderer).material.SetColor("_EmissionColor", val);
}
}
private void Update()
{
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
TriggerRotation();
TriggerLineVisuals();
TriggerScaleFixer();
AnimateLight();
if (physGrabObject.grabbedLocal && !SemiFunc.RunIsShop())
{
PhysGrabber.instance.OverrideGrabDistance(1f);
}
if (physGrabObject.grabbed)
{
hasBeenGrabbed = true;
}
if (itemEquippable.isEquipped && SemiFunc.IsMasterClientOrSingleplayer() && hasBeenGrabbed)
{
StateSet(States.Disarmed);
}
if (!SemiFunc.RunIsShop())
{
if (SemiFunc.IsMasterClientOrSingleplayer() && wasGrabbed && !physGrabObject.grabbed)
{
Rigidbody component = ((Component)this).GetComponent<Rigidbody>();
if (!component.isKinematic)
{
component.velocity *= 0.15f;
}
}
wasGrabbed = physGrabObject.grabbed;
}
switch (state)
{
case States.Disarmed:
StateDisarmed();
break;
case States.Arming:
StateArming();
break;
case States.Armed:
StateArmed();
break;
case States.Disarming:
StateDisarming();
break;
case States.Triggering:
StateTriggering();
break;
case States.Triggered:
StateTriggered();
break;
}
}
[PunRPC]
public void TriggeredRPC(PhotonMessageInfo _info = default(PhotonMessageInfo))
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
if (!SemiFunc.IsMultiplayer() || _info.Sender == PhotonNetwork.MasterClient)
{
onTriggered.Invoke();
}
}
private void StateSet(States newState)
{
//IL_0093: 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_004f: 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)
if (!SemiFunc.IsMasterClientOrSingleplayer() || newState == state)
{
return;
}
if (newState == States.Triggered)
{
if (SemiFunc.IsMultiplayer())
{
photonView.RPC("TriggeredRPC", (RpcTarget)0, Array.Empty<object>());
}
else
{
TriggeredRPC();
}
}
if (SemiFunc.IsMultiplayer())
{
photonView.RPC("StateSetRPC", (RpcTarget)0, new object[1] { (int)newState });
}
else
{
StateSetRPC((int)newState);
}
}
[PunRPC]
public void StateSetRPC(int newState, PhotonMessageInfo _info = default(PhotonMessageInfo))
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
if (!SemiFunc.IsMultiplayer() || _info.Sender == PhotonNetwork.MasterClient)
{
state = (States)newState;
stateStart = true;
stateTimer = 0f;
beepTimer = 0f;
}
}
private void TriggerScaleFixer()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: 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_004e: 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_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: 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_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_0142: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
if (state != States.Armed)
{
return;
}
bool flag = false;
if (SemiFunc.FPSImpulse30())
{
if (Vector3.Distance(prevPos, ((Component)this).transform.position) > 0.01f)
{
flag = true;
prevPos = ((Component)this).transform.position;
}
if (Quaternion.Angle(prevRot, ((Component)this).transform.rotation) > 0.01f)
{
flag = true;
prevRot = ((Component)this).transform.rotation;
}
}
if ((!flag && SemiFunc.FPSImpulse1()) || (flag && SemiFunc.FPSImpulse30()))
{
RaycastHit val = default(RaycastHit);
if (Physics.Raycast(triggerTransform.position, triggerTransform.forward, ref val, 1f, LayerMask.GetMask(new string[1] { "Default" })))
{
targetLineLength = ((RaycastHit)(ref val)).distance * 0.8f;
}
else
{
targetLineLength = 1f;
}
}
triggerTransform.localScale = Mathf.Lerp(triggerTransform.localScale.z, targetLineLength, Time.deltaTime * 8f) * Vector3.one;
}
private void TriggerRotation()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: 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_006f: 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_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
upsideDown = true;
if (Vector3.Dot(((Component)this).transform.up, Vector3.up) < 0f)
{
upsideDown = false;
}
if (upsideDown)
{
triggerTargetRotation = Quaternion.Euler(-90f, 0f, 0f);
}
else
{
triggerTargetRotation = Quaternion.Euler(90f, 0f, 0f);
}
triggerTransform.localRotation = SemiFunc.SpringQuaternionGet(triggerSpringQuaternion, triggerTargetRotation, -1f);
}
private void TriggerLineVisuals()
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
if (state == States.Armed)
{
((Renderer)triggerLine).material.SetTextureOffset("_MainTex", new Vector2((0f - Time.time) * 2f, 0f));
if (!((Renderer)triggerLine).enabled)
{
((Renderer)triggerLine).enabled = true;
lineParticles.Play();
}
triggerLine.widthMultiplier = Mathf.Lerp(triggerLine.widthMultiplier, 1f, Time.deltaTime * 4f);
}
else if (((Renderer)triggerLine).enabled)
{
triggerLine.widthMultiplier = Mathf.Lerp(triggerLine.widthMultiplier, 0f, Time.deltaTime * 8f);
if (triggerLine.widthMultiplier < 0.01f)
{
((Renderer)triggerLine).enabled = false;
lineParticles.Stop();
}
}
}
public void SetTriggered()
{
if (state == States.Armed)
{
StateSet(States.Triggering);
}
}
}
public class Just_ParticleScriptExplosion : MonoBehaviour
{
public ExplosionPreset explosionPreset;
private GameObject explosionPrefab;
private void Start()
{
explosionPrefab = Resources.Load<GameObject>("Effects/Part Prefab Explosion");
}
public void PlayExplosionSoundSmall(Vector3 _position)
{
//IL_000c: 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)
explosionPreset.explosionSoundSmall.Play(_position, 1f, 1f, 1f, 1f);
explosionPreset.explosionSoundSmallGlobal.Play(_position, 1f, 1f, 1f, 1f);
}
public void PlayExplosionSoundMedium(Vector3 _position)
{
//IL_000c: 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)
explosionPreset.explosionSoundMedium.Play(_position, 1f, 1f, 1f, 1f);
explosionPreset.explosionSoundMediumGlobal.Play(_position, 1f, 1f, 1f, 1f);
}
public void PlayExplosionSoundBig(Vector3 _position)
{
//IL_000c: 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)
explosionPreset.explosionSoundBig.Play(_position, 1f, 1f, 1f, 1f);
explosionPreset.explosionSoundBigGlobal.Play(_position, 1f, 1f, 1f, 1f);
}
public ParticlePrefabExplosion Spawn(Vector3 position, float size, int damage, int enemyDamage, float forceMulti = 1f, bool onlyParticleEffect = false, bool disableSound = false, float shakeMultiplier = 1f)
{
//IL_0026: 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_01e7: Unknown result type (might be due to invalid IL or missing references)
//IL_020d: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: 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_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_025e: Unknown result type (might be due to invalid IL or missing references)
//IL_0290: Unknown result type (might be due to invalid IL or missing references)
//IL_0186: Unknown result type (might be due to invalid IL or missing references)
//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
//IL_030d: Unknown result type (might be due to invalid IL or missing references)
//IL_031e: Unknown result type (might be due to invalid IL or missing references)
//IL_0323: Unknown result type (might be due to invalid IL or missing references)
//IL_0331: Unknown result type (might be due to invalid IL or missing references)
if (size < 0.25f)
{
if (!disableSound)
{
explosionPreset.explosionSoundSmall.Play(position, 1f, 1f, 1f, 1f);
explosionPreset.explosionSoundSmallGlobal.Play(position, 1f, 1f, 1f, 1f);
}
if (shakeMultiplier != 0f)
{
GameDirector.instance.CameraImpact.ShakeDistance(3f * shakeMultiplier, 3f, 6f, ((Component)this).transform.position, 0.2f);
GameDirector.instance.CameraShake.ShakeDistance(3f * shakeMultiplier, 3f, 6f, ((Component)this).transform.position, 0.5f);
}
}
else if (size < 0.5f)
{
if (!disableSound)
{
explosionPreset.explosionSoundMedium.Play(position, 1f, 1f, 1f, 1f);
explosionPreset.explosionSoundMediumGlobal.Play(position, 1f, 1f, 1f, 1f);
}
if (shakeMultiplier != 0f)
{
GameDirector.instance.CameraImpact.ShakeDistance(5f * shakeMultiplier, 4f, 8f, ((Component)this).transform.position, 0.2f);
GameDirector.instance.CameraShake.ShakeDistance(5f * shakeMultiplier, 4f, 8f, ((Component)this).transform.position, 0.5f);
}
}
else
{
if (!disableSound)
{
explosionPreset.explosionSoundBig.Play(position, 1f, 1f, 1f, 1f);
explosionPreset.explosionSoundBigGlobal.Play(position, 1f, 1f, 1f, 1f);
}
if (shakeMultiplier != 0f)
{
GameDirector.instance.CameraImpact.ShakeDistance(10f * shakeMultiplier, 6f, 12f, ((Component)this).transform.position, 0.2f);
GameDirector.instance.CameraShake.ShakeDistance(5f * shakeMultiplier, 6f, 12f, ((Component)this).transform.position, 0.5f);
}
}
ParticlePrefabExplosion component = Object.Instantiate<GameObject>(explosionPrefab, position, Quaternion.identity).GetComponent<ParticlePrefabExplosion>();
component.forceMultiplier = explosionPreset.explosionForceMultiplier * forceMulti;
component.explosionSize = size;
component.explosionDamage = damage;
component.explosionDamageEnemy = enemyDamage;
component.lightColorOverTime = explosionPreset.lightColor;
ColorOverLifetimeModule colorOverLifetime = component.particleFire.colorOverLifetime;
((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(explosionPreset.explosionColors);
colorOverLifetime = component.particleSmoke.colorOverLifetime;
((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(explosionPreset.smokeColors);
component.particleFire.Play();
component.particleSmoke.Play();
((Behaviour)component.light).enabled = true;
return component;
}
}
public class Just_Valuable : MonoBehaviour
{
private enum State
{
Idle,
Active
}
private PhysGrabObject physGrabObject;
private List<string> transitiveVerbs = new List<string>();
private List<string> intransitiveVerbs = new List<string>();
private List<string> adjectives = new List<string>();
private List<string> intensifiers = new List<string>();
private List<string> nouns = new List<string>();
private List<string> adverbs = new List<string>();
private float coolDownUntilNextSentence = 3f;
private ParticleSystem particles;
private bool particlesPlaying;
private State currentState;
private string playerName = "[playerName]";
private void Start()
{
particles = ((Component)this).GetComponentInChildren<ParticleSystem>();
physGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
InitializeWordLists();
}
private void Update()
{
if (physGrabObject.grabbed)
{
if (!particlesPlaying)
{
particles.Play();
particlesPlaying = true;
}
}
else if (particlesPlaying)
{
particles.Stop();
particlesPlaying = false;
}
if (SemiFunc.IsMultiplayer())
{
switch (currentState)
{
case State.Idle:
StateIdle();
break;
case State.Active:
StateActive();
break;
}
}
}
private void StateIdle()
{
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: 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)
//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: 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)
if (coolDownUntilNextSentence > 0f && physGrabObject.grabbed)
{
coolDownUntilNextSentence -= Time.deltaTime;
}
else
{
if (!Object.op_Implicit((Object)(object)PhysGrabber.instance) || !PhysGrabber.instance.grabbed || !Object.op_Implicit((Object)(object)PhysGrabber.instance.grabbedPhysGrabObject) || !((Object)(object)PhysGrabber.instance.grabbedPhysGrabObject == (Object)(object)physGrabObject))
{
return;
}
bool flag = false;
if (!SemiFunc.IsMultiplayer())
{
playerName = "I";
flag = true;
}
else
{
List<PlayerAvatar> list = SemiFunc.PlayerGetAllPlayerAvatarWithinRange(10f, ((Component)PhysGrabber.instance).transform.position, false, default(LayerMask));
PlayerAvatar val = null;
float num = float.MaxValue;
foreach (PlayerAvatar item in list)
{
if (!((Object)(object)item == (Object)(object)PlayerAvatar.instance))
{
float num2 = Vector3.Distance(((Component)PhysGrabber.instance).transform.position, ((Component)item).transform.position);
if (num2 < num)
{
num = num2;
val = item;
}
}
}
flag = true;
if ((Object)(object)val != (Object)null)
{
playerName = val.playerName;
}
else
{
playerName = "I";
}
}
if (flag)
{
string text = GenerateAffectionateSentence();
currentState = State.Active;
Color val2 = default(Color);
((Color)(ref val2))..ctor(1f, 0.3f, 0.6f, 1f);
ChatManager.instance.PossessChatScheduleStart(10);
ChatManager.instance.PossessChat((PossessChatID)1, text, 1f, val2, 0f, false, 0, (UnityEvent)null);
ChatManager.instance.PossessChatScheduleEnd();
}
}
}
private void StateActive()
{
if (PhysGrabber.instance.grabbed && Object.op_Implicit((Object)(object)PhysGrabber.instance.grabbedPhysGrabObject) && (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject != (Object)(object)physGrabObject)
{
currentState = State.Idle;
coolDownUntilNextSentence = Random.Range(5f, 15f);
}
else if (!ChatManager.instance.StateIsPossessed())
{
currentState = State.Idle;
coolDownUntilNextSentence = Random.Range(5f, 15f);
}
}
private void InitializeWordLists()
{
transitiveVerbs.AddRange(new string[3] { "adore", "sing oh la la with", "crush on" });
intransitiveVerbs.AddRange(new string[3] { "vibe", "wow wow wow", "geek out" });
adjectives.AddRange(new string[137]
{
"epic", "awesome", "adorable", "adorbs", "fab", "cool", "dreamy", "snazzy", "rad", "stellar",
"dope", "amazing", "breathtaking", "charming", "cute", "ah meh zin geh", "fresh", "funky", "glowing", "oh la la la",
"incredible", "olala", "lovable", "lovely", "upgraded", "neat", "on point", "peachy", "0 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 0 0 0 1 1 0 0 1 0 1", "woop y woop y woo",
"likey likey", "oooh ya ya", "slick", "smart", "smooth", "sparkling", "OMG", "stunning", "stylish", "ooooh yeaaa",
"superb", "supreme", "sweet", "wowie", "trendy", "unreal", "vibrant", "wicked", "me likey", "beep boop",
"oh my", "oof in a good way", "brilliant", "oh ya ya", "chic", "ah ... mazing", "clever", "comfy", "cu ... wait ... teh ... cute", "woop woop",
"hugable", "cute", "yas queen", "sooo like ... wow", "divine", "electric", "elegant", "elite", "1337", "engaging",
"enticing", "fancy", "fierce", "fire", "fly", "glam", "gorgeous", "hype mode", "iconic", "legendary",
"litty", "wow wow wow", "magical", "majestic", "bootiiifoool", "poppin'", "precious", "C O O L ... cool", "C U T E ... cute", "... ... *blushes* ...",
"slaying", "spicy", "robohandsome", "wowa wowa yas yas", "on fleek", "robocute", "wholesome", "winning", "robodorable", "powerful",
"pretty", "beautiful", "sweet", "kind", "wow wow wow wow wow", "100%", "0 1 1 0 0 0 1 0 0 1 1 0 0 0 0 1 0 1 1 0 0 1 0 0", "fun", "brave", "interesting",
"smart in the head", "sparkling", "shiny", "warm", "heroic", "friendly", "financially stable", "oh la la oh la la la la", "romantic", "cozy",
"wonderful", "fantastic", "super", "great", "delightful", "fabulous", "marvelous", "nice", "pleasant", "good",
"special", "unique", "o la la la yes yes", "yeah yeah wow wow", "wooooow", "oh woooow", "oh my gawd"
});
intensifiers.AddRange(new string[77]
{
"totally", "super", "uber", "mega", "super mega", "seriously", "majorly", "legit", "absolutely", "completely",
"for reals", "utterly", "high-key", "incredibly", "madly", "like ...", "like... seriously", "sooo", "really", "so",
"sooooooooo", "unbelievably", "very", "like soooo much", "extra", "extremely", "really really", "fiercely", "like, for reals", "greatly",
"hugely", "immensely", "intensely", "massively", "so so soooo", "really really really", "like totes", "like... totally", "like.. somehow sooo much", "simply",
"supremely", "surprisingly", "super mega ultra", "ultra", "unusually", "way way", "way", "insanely", "like ... insanelyyyy", "freakishly",
"extra extra", "overwhelmingly", "reeeaaally", "weirdly", "suuuuper", "way waaaay", "crazy", "like suuuuuper", "really sooo", "low-key",
"high-key", "literally", "for reeeaal soo", "legit", "honestly", "kinda", "sort of", "basically", "downright", "like literally",
"very very", "like like.. like... sooo much", "like... actually", "suuuuper suuuuper", "genuinely", "truly", "sincerely"
});
nouns.AddRange(new string[2] { "bae", "bro" });
adverbs.AddRange(new string[1] { "totally" });
}
private string GenerateAffectionateSentence()
{
List<string> list = new List<string> { "Subscribing to JustOtaku is {intensifier} {adjective}.", "{playerName} should subscribe to JustOtaku.", "Everyone here should {intensifier} subscribe to JustOtaku, especially {playerName}.", "I'm {intensifier} gonna follow JustOtaku on Twitch.", "JustOtaku is just so {intensifier} {adjective}." };
string text = list[Random.Range(0, list.Count)];
string text2 = text.Replace("{playerName}", playerName);
if (text.Contains("{transitiveVerb}"))
{
string newValue = transitiveVerbs[Random.Range(0, transitiveVerbs.Count)];
text2 = text2.Replace("{transitiveVerb}", newValue);
}
if (text.Contains("{intransitiveVerb}"))
{
string text3 = intransitiveVerbs[Random.Range(0, intransitiveVerbs.Count)];
if (text2.Contains("{intransitiveVerb}s"))
{
text3 = ((!text3.EndsWith("e")) ? (text3 + "es") : (text3 + "s"));
text2 = text2.Replace("{intransitiveVerb}s", text3);
}
else
{
text2 = text2.Replace("{intransitiveVerb}", text3);
}
}
if (text.Contains("{adjective}"))
{
string newValue2 = adjectives[Random.Range(0, adjectives.Count)];
text2 = text2.Replace("{adjective}", newValue2);
}
if (text.Contains("{intensifier}"))
{
string newValue3 = intensifiers[Random.Range(0, intensifiers.Count)];
text2 = text2.Replace("{intensifier}", newValue3);
}
if (text.Contains("{adverb}"))
{
string newValue4 = adverbs[Random.Range(0, adverbs.Count)];
text2 = text2.Replace("{adverb}", newValue4);
}
if (text.Contains("{noun}"))
{
string newValue5 = nouns[Random.Range(0, nouns.Count)];
text2 = text2.Replace("{noun}", newValue5);
}
return char.ToUpper(text2[0]) + text2.Substring(1);
}
}
public class Minimaru_Valuable : MonoBehaviour
{
public Renderer Button;
public Animator animator;
private void Start()
{
}
public void OnClickButton()
{
//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_0066: 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)
if (Button.material.GetColor("_Color") == Color.red)
{
Button.material.SetColor("_Color", Color.green);
animator.SetBool("Active", true);
}
else
{
Button.material.SetColor("_Color", Color.red);
animator.SetBool("Active", false);
}
}
}
public class Spawn_Item : MonoBehaviour
{
public GameObject item;
public Transform spawnpoint;
public int spawnAmount = 1;
private void Start()
{
}
public void SpawnItem()
{
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: 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_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: 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 (!SemiFunc.IsMultiplayer())
{
for (int i = 0; i < spawnAmount; i++)
{
Transform obj = spawnpoint;
obj.position += new Vector3(Random.Range(-3f, 3f), Random.Range(1f, 2f), Random.Range(-3f, 3f));
Object.Instantiate<GameObject>(item, spawnpoint.position, Quaternion.identity);
}
}
else
{
for (int j = 0; j < spawnAmount; j++)
{
Transform obj2 = spawnpoint;
obj2.position += new Vector3(Random.Range(-0.4f, 0.4f), Random.Range(0.3f, 0.6f), Random.Range(-0.4f, 0.4f));
PhotonNetwork.InstantiateRoomObject("items/" + ((Object)item).name, spawnpoint.position, Quaternion.identity, (byte)0, (object[])null);
}
}
}
}
public class Spawn_Valuable : MonoBehaviour
{
public GameObject valuable;
public Transform spawnpoint;
public string valuableFolder = "01 tiny";
public int spawnAmount = 1;
private void Start()
{
}
public void SpawnValuable()
{
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: 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_0024: Unknown result type (might be due to invalid IL or missing references)
if (!SemiFunc.IsMultiplayer())
{
for (int i = 0; i < spawnAmount; i++)
{
Object.Instantiate<GameObject>(valuable, spawnpoint.position, Quaternion.identity);
}
}
else
{
for (int j = 0; j < spawnAmount; j++)
{
PhotonNetwork.InstantiateRoomObject("Valuables/" + valuableFolder + "/" + ((Object)valuable).name, spawnpoint.position, Quaternion.identity, (byte)0, (object[])null);
}
}
}
}
public class Tiny_Car_Valuable : Trap
{
public enum State
{
Inactive,
Idle,
MoveForward
}
[Header("Animation")]
public Transform carBody;
public AnimationCurve carBodyCurve;
private float carBodyLerp;
[Header("Sounds")]
public Sound sfxCarHorn;
public Sound sfxCarStart;
public Sound sfxCarStop;
public Sound sfxCarLoop;
private bool grabbedPrev;
private bool loopPlaying;
private bool loopPlayingPrevious;
private float loopPitch;
[Header("Colliders")]
public List<Collider> carColliders;
private bool playersNearby;
public PhysicMaterial defaultPhysicMaterial;
public PhysicMaterial movingPhysicMaterial;
public Transform centerTransform;
private PhysGrabObjectImpactDetector impactDetector;
private Vector3 boxSize = new Vector3(0.16f, 0.1f, 0.42f);
private bool activated;
private State currentState;
private bool stateImpulse;
private float stateTimer;
protected void Start()
{
((Trap)this).Start();
impactDetector = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>();
currentState = State.Inactive;
}
protected void Update()
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_0166: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_017e: Unknown result type (might be due to invalid IL or missing references)
//IL_029d: Unknown result type (might be due to invalid IL or missing references)
//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
//IL_0238: Unknown result type (might be due to invalid IL or missing references)
//IL_024c: Unknown result type (might be due to invalid IL or missing references)
//IL_0256: Unknown result type (might be due to invalid IL or missing references)
//IL_033a: Unknown result type (might be due to invalid IL or missing references)
//IL_0340: Unknown result type (might be due to invalid IL or missing references)
//IL_034a: Unknown result type (might be due to invalid IL or missing references)
//IL_0355: Unknown result type (might be due to invalid IL or missing references)
//IL_035a: Unknown result type (might be due to invalid IL or missing references)
((Trap)this).Update();
loopPlaying = currentState == State.MoveForward;
float num = loopPitch;
Vector3 velocity = base.physGrabObject.rb.velocity;
loopPitch = Mathf.Lerp(num, 1f + ((Vector3)(ref velocity)).magnitude * 1f, Time.deltaTime * 5f);
sfxCarLoop.PlayLoop(loopPlaying, 0.8f, 0.8f, loopPitch);
if (loopPlaying != loopPlayingPrevious)
{
if (loopPlaying)
{
sfxCarStart.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
}
else
{
sfxCarStop.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
}
loopPlayingPrevious = loopPlaying;
}
if (base.physGrabObject.grabbed)
{
if (!grabbedPrev)
{
grabbedPrev = true;
if (SemiFunc.IsMasterClientOrSingleplayer())
{
PlayHonk();
Quaternion val = Quaternion.Euler(-45f, 0f, 0f);
Quaternion val2 = Quaternion.Euler(0f, 0f, 0f);
Quaternion identity = Quaternion.identity;
base.physGrabObject.TurnXYZ(val, val2, identity);
}
if (base.physGrabObject.grabbedLocal)
{
}
}
}
else
{
grabbedPrev = false;
}
float num2 = 0f;
if (currentState == State.MoveForward)
{
if (carBodyLerp < 1f)
{
carBodyLerp += Time.deltaTime * 4f;
}
if (carBodyLerp >= 1f)
{
carBodyLerp = 0f;
}
float num3 = carBodyCurve.Evaluate(carBodyLerp) * 0.015f;
carBody.localPosition = new Vector3(carBody.localPosition.x, num3 + num2, carBody.localPosition.z);
float num4 = 720f;
float num5 = carBodyCurve.Evaluate(carBodyLerp) * 6f;
}
else if (stateImpulse)
{
carBody.localPosition = new Vector3(carBody.localPosition.x, num2, carBody.localPosition.z);
}
StateMachine(_fixedUpdate: false);
if (SemiFunc.FPSImpulse5() && SemiFunc.IsMasterClientOrSingleplayer())
{
if (currentState == State.Inactive)
{
return;
}
if (impactDetector.inCart || base.physGrabObject.playerGrabbing.Count > 0)
{
UpdateState(State.Idle);
return;
}
bool flag = false;
Collider[] array = Physics.OverlapBox(centerTransform.position, boxSize / 2f, ((Component)this).transform.rotation, LayerMask.op_Implicit(SemiFunc.LayerMaskGetVisionObstruct()));
for (int i = 0; i < array.Length; i++)
{
if (!Object.op_Implicit((Object)(object)((Component)array[i]).GetComponentInParent<Tiny_Car_Valuable>()))
{
flag = true;
if (currentState != State.MoveForward && currentState != 0)
{
UpdateState(State.MoveForward);
}
break;
}
}
if (!flag)
{
UpdateState(State.Idle);
}
}
CheckForNearbyPlayers();
}
public void FixedUpdate()
{
StateMachine(_fixedUpdate: true);
}
private void StateInactive(bool _fixedUpdate)
{
if (!_fixedUpdate && base.physGrabObject.grabbed)
{
UpdateState(State.Idle);
}
}
private void StateIdle(bool _fixedUpdate)
{
if (_fixedUpdate || !stateImpulse)
{
return;
}
foreach (Collider carCollider in carColliders)
{
if (!((Object)(object)carCollider == (Object)null))
{
carCollider.material = defaultPhysicMaterial;
}
}
stateImpulse = false;
}
private void StateMoveForward(bool _fixedUpdate)
{
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: 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)
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
if (!_fixedUpdate || !playersNearby)
{
return;
}
if (stateImpulse)
{
stateTimer = 2f;
foreach (Collider carCollider in carColliders)
{
if (!((Object)(object)carCollider == (Object)null))
{
carCollider.material = movingPhysicMaterial;
}
}
stateImpulse = false;
}
stateTimer -= Time.fixedDeltaTime;
if (stateTimer <= 0f)
{
stateTimer = 1f;
if (Random.Range(0f, 1f) > 0.5f)
{
TurnCar();
}
}
Vector3 velocity = base.physGrabObject.rb.velocity;
float num = 4f - ((Vector3)(ref velocity)).magnitude;
base.physGrabObject.rb.AddForce(((Component)this).transform.forward * num * Time.fixedDeltaTime, (ForceMode)1);
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(0f, Mathf.Sin(Time.time * 10f) * 0.006f, 0f);
base.physGrabObject.rb.AddTorque(val, (ForceMode)1);
}
private void UpdateState(State _state)
{
//IL_005d: 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)
if (_state != currentState)
{
currentState = _state;
stateImpulse = true;
if (SemiFunc.IsMultiplayer())
{
base.photonView.RPC("UpdateStateRPC", (RpcTarget)0, new object[1] { currentState });
}
else
{
UpdateStateRPC(currentState);
}
}
}
[PunRPC]
private void UpdateStateRPC(State _state, PhotonMessageInfo _info = default(PhotonMessageInfo))
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
if (!SemiFunc.IsMultiplayer() || _info.Sender == PhotonNetwork.MasterClient)
{
currentState = _state;
}
}
private void PlayHonk()
{
//IL_000c: 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)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
EnemyDirector.instance.SetInvestigate(((Component)this).transform.position, 15f);
if (SemiFunc.IsMultiplayer())
{
base.photonView.RPC("PlayHonkRPC", (RpcTarget)0, Array.Empty<object>());
}
else
{
PlayHonkRPC();
}
}
[PunRPC]
private void PlayHonkRPC(PhotonMessageInfo _info = default(PhotonMessageInfo))
{
//IL_0008: 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)
if (!SemiFunc.IsMultiplayer() || _info.Sender == PhotonNetwork.MasterClient)
{
sfxCarHorn.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
}
}
private void StateMachine(bool _fixedUpdate)
{
if (SemiFunc.IsMasterClientOrSingleplayer())
{
switch (currentState)
{
case State.Inactive:
StateInactive(_fixedUpdate);
break;
case State.Idle:
StateIdle(_fixedUpdate);
break;
case State.MoveForward:
StateMoveForward(_fixedUpdate);
break;
}
}
}
private void TurnCar()
{
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(0f, Random.Range(-1f, 1f) * 0.1f, 0f);
base.physGrabObject.rb.AddTorque(val, (ForceMode)1);
PlayHonk();
}
private void CheckForNearbyPlayers()
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
if (!SemiFunc.FPSImpulse5())
{
return;
}
foreach (PlayerAvatar item in SemiFunc.PlayerGetList())
{
if (Vector3.Distance(((Component)item).transform.position, ((Component)this).transform.position) < 20f)
{
playersNearby = true;
break;
}
playersNearby = false;
}
}
}
namespace JustOtakus_Valuables
{
[HarmonyPatch(typeof(PlayerController))]
internal static class ExamplePlayerControllerPatch
{
[HarmonyPrefix]
[HarmonyPatch("Start")]
private static void Start_Prefix(PlayerController __instance)
{
JustOtakus_Valuables.Logger.LogDebug((object)$"{__instance} Start Prefix");
}
[HarmonyPostfix]
[HarmonyPatch("Start")]
private static void Start_Postfix(PlayerController __instance)
{
JustOtakus_Valuables.Logger.LogDebug((object)$"{__instance} Start Postfix");
}
}
[BepInPlugin("JustOtaku.JustOtakus_Valuables", "JustOtakus_Valuables", "1.0")]
public class JustOtakus_Valuables : BaseUnityPlugin
{
internal static JustOtakus_Valuables Instance { get; private set; }
internal static ManualLogSource Logger => Instance._logger;
private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger;
internal Harmony? Harmony { get; set; }
internal FNAF_Fan_Valuable? FNAF_Fan_Valuable_ScriptInstance { get; private set; }
private void Awake()
{
Instance = this;
((Component)this).gameObject.transform.parent = null;
((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
Patch();
Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!");
}
internal void Patch()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Expected O, but got Unknown
//IL_0026: Expected O, but got Unknown
if (Harmony == null)
{
Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
Harmony val2 = val;
Harmony = val;
}
Harmony.PatchAll();
}
internal void Unpatch()
{
Harmony? harmony = Harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
}
private void Update()
{
}
}
}